Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
radius_loop = 100
model_names = ["target_{}".format(mur) for mur in target_mur]
# Set up a Cyl mesh
csx = 5. # cell size in the x-direction
csz = 5. # cell size in the z-direction
domainx = 100 # go out 500m from the well
# padding parameters
npadx, npadz = 15, 15 # number of padding cells
pfx = 1.4 # expansion factor for the padding to infinity
pfz = 1.4
ncz = int(target_l/csz)
mesh = discretize.CylMesh([
[(csx, int(domainx/csx)), (csx, npadx, pfx)],
1,
[(csz, npadz, -pfz), (csz, ncz), (csz, npadz, pfz)]
])
mesh.x0 = [0, 0, -mesh.hz[:npadz + ncz].sum()]
# Plot the mesh
if plotIt:
mesh.plotGrid()
plt.show()
self.radius_loop = radius_loop
self.target_mur = target_mur
self.target_l = target_l
self.target_r = target_r
self.sigma_back = sigma_back
# Define the survey
#survey = survey(src_list)
###############################################################
# Create Cylindrical Mesh
# -----------------------
#
# Here we create the cylindrical mesh that will be used for this tutorial
# example.
#
hr = [(10., 50), (10., 10, 1.5)]
hz = [(10., 10, -1.5), (10., 100), (10., 10, 1.5)]
mesh = CylMesh([hr, 1, hz], x0='00C')
###############################################################
# Create Conductivity Model and Mapping for Cylindrical Mesh
# ----------------------------------------------------------
#
# Here, the model consists of a long vertical conductive pipe and a resistive
# surface layer. For this example, we will have only flat topography.
#
# Conductivity in S/m
air_val = 1e-8
background_val = 1e-1
layer_val = 1e-2
pipe_val = 1e1
# Active cells are cells below the surface
def make_example_mesh():
ncr = 20 # number of mesh cells in r
ncz = 20 # number of mesh cells in z
dh = 5. # cell width
hr = [(dh, ncr), (dh, 5, 1.3)]
hz = [(dh, 5, -1.3), (dh, ncz), (dh, 5, 1.3)]
# Use flag of 1 to denote perfect rotational symmetry
mesh = CylMesh([hr, 1, hz], '0CC')
return mesh
self.M = TensorMesh(h[:self.meshDimension])
max_h = max([np.max(hi) for hi in self.M.h])
return max_h
elif 'CylMesh' in self._meshType:
if 'uniform' in self._meshType:
h = [nc, nc, nc]
else:
raise Exception('Unexpected meshType')
if self.meshDimension == 2:
self.M = CylMesh([h[0], 1, h[2]])
max_h = max([np.max(hi) for hi in [self.M.hx, self.M.hz]])
elif self.meshDimension == 3:
self.M = CylMesh(h)
max_h = max([np.max(hi) for hi in self.M.h])
return max_h
elif 'Curv' in self._meshType:
if 'uniform' in self._meshType:
kwrd = 'rect'
elif 'rotate' in self._meshType:
kwrd = 'rotate'
else:
raise Exception('Unexpected meshType')
if self.meshDimension == 1:
raise Exception('Lom not supported for 1D')
elif self.meshDimension == 2:
X, Y = Utils.exampleLrmGrid([nc, nc], kwrd)
self.M = CurvilinearMesh([X, Y])
elif self.meshDimension == 3:
h = [hi/np.sum(hi) for hi in [h1, h2, h3]] # normalize
else:
raise Exception('Unexpected meshType')
self.M = TensorMesh(h[:self.meshDimension])
max_h = max([np.max(hi) for hi in self.M.h])
return max_h
elif 'CylMesh' in self._meshType:
if 'uniform' in self._meshType:
h = [nc, nc, nc]
else:
raise Exception('Unexpected meshType')
if self.meshDimension == 2:
self.M = CylMesh([h[0], 1, h[2]])
max_h = max([np.max(hi) for hi in [self.M.hx, self.M.hz]])
elif self.meshDimension == 3:
self.M = CylMesh(h)
max_h = max([np.max(hi) for hi in self.M.h])
return max_h
elif 'Curv' in self._meshType:
if 'uniform' in self._meshType:
kwrd = 'rect'
elif 'rotate' in self._meshType:
kwrd = 'rotate'
else:
raise Exception('Unexpected meshType')
if self.meshDimension == 1:
raise Exception('Lom not supported for 1D')
elif self.meshDimension == 2:
source_list.append(
sources.MagDipole(rx_list, loc=src_locs[ii], moment=1., orientation='z')
)
###############################################################
# Create Cylindrical Mesh
# -----------------------
#
# Here we create the cylindrical mesh that will be used for this tutorial
# example.
#
hr = [(10., 50), (10., 10, 1.5)]
hz = [(10., 10, -1.5), (10., 100), (10., 10, 1.5)]
mesh = CylMesh([hr, 1, hz], x0='00C')
###############################################################
# Create Conductivity Model and Mapping for Cylindrical Mesh
# ----------------------------------------------------------
#
# Here, the model consists of a long vertical conductive pipe and a resistive
# surface layer. For this example, we will have only flat topography.
#
# Conductivity in S/m
air_val = 1e-8
background_val = 1e-1
layer_val = 1e-2
pipe_val = 1e1
# Active cells are cells below the surface.
#
# Next, we create a cylindrically symmteric tensor mesh
csx = 5. # core cell size in the x-direction
csz = 5. # core cell size in the z-direction
domainx = 100 # use a uniform cell size out to a radius of 100m
# padding parameters
npadx, npadz = 15, 15 # number of padding cells
pfx = 1.4 # expansion factor for the padding to infinity in the x-direction
pfz = 1.4 # expansion factor for the padding to infinity in the z-direction
ncz = int(target_l/csz) # number of z cells in the core region
# create the cyl mesh
mesh = discretize.CylMesh([
[(csx, int(domainx/csx)), (csx, npadx, pfx)],
1,
[(csz, npadz, -pfz), (csz, ncz), (csz, npadz, pfz)]
])
# put the origin at the top of the target
mesh.x0 = [0, 0, -mesh.hz[:npadz + ncz].sum()]
# plot the mesh
mesh.plotGrid()
###############################################################################
# Assign physical properties on the mesh
mur_model = np.ones(mesh.nC)