Skip to content

Commit

Permalink
fix: adding option to define custom mesh builder for pli
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachlan Grose committed Oct 11, 2021
1 parent f5a5f9b commit b21fa8c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions LoopStructural/modelling/core/geological_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,10 @@ def get_interpolator(self, interpolatortype='FDI', nelements=1e4,
if mesh_id not in self.support:
self.support[mesh_id] = mesh
else:
mesh = TetMesh(origin=bb[0, :], nsteps=nsteps, step_vector=step_vector)
if 'meshbuilder' in kwargs:
mesh = kwargs['meshbuilder'](bb,nelements)
else:
mesh = TetMesh(origin=bb[0, :], nsteps=nsteps, step_vector=step_vector)
logger.info("Creating regular tetrahedron mesh with %i elements \n"
"for modelling using PLI" % (mesh.ntetra))

Expand Down Expand Up @@ -635,8 +638,11 @@ def get_interpolator(self, interpolatortype='FDI', nelements=1e4,
# number of steps is the length of the box / step vector
nsteps = np.ceil((bb[1, :] - bb[0, :]) / step_vector).astype(int)
# create a structured grid using the origin and number of steps
mesh = kwargs.get('mesh', TetMesh(origin=bb[0, :], nsteps=nsteps,
step_vector=step_vector))
if 'meshbuilder' in kwargs:
mesh = kwargs['meshbuilder'].build(bb,nelements)
else:
mesh = kwargs.get('mesh', TetMesh(origin=bb[0, :], nsteps=nsteps,
step_vector=step_vector))
logger.info("Creating regular tetrahedron mesh with %i elements \n"
"for modelling using DFI" % mesh.ntetra)
return DFI(mesh, kwargs['fold'])
Expand Down

0 comments on commit b21fa8c

Please sign in to comment.