Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remesh_tiny_elements keyword to driver.run() #176

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions ocsmesh/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(
self._crs = CRS.from_user_input(crs) if crs is not None else crs
self._opts.verbosity = verbosity

def run(self, sieve=None, quality_metric=1.05):
def run(self, sieve=None, quality_metric=1.05, remesh_tiny_elements=False):

hfun_msh_t = self.hfun.msh_t()

Expand Down Expand Up @@ -116,12 +116,12 @@ def run(self, sieve=None, quality_metric=1.05):
utils.reproject(output_mesh, self._crs)

_logger.info('Finalizing mesh...')
# Don't need to use ad-hoc fix since Jigsaw tiny element
# issue is resolve. In case needed add a flag for remesh
# since it's computationally expensive
# if self.opts.hfun_hmin > 0:
# output_mesh = utils.remesh_small_elements(
# self.opts, geom_msh_t, output_mesh, hfun_msh_t)
if self.opts.hfun_hmin > 0 and remesh_tiny_elements:
# Jigsaw creates tiny elements on high gradients. Run the driver with the remesh_tiny_elements key
# set to True once you find that your mesh has tiny elements. Default is False as it is an expensive
# operation
output_mesh = utils.remesh_small_elements(
self.opts, geom_msh_t, output_mesh, hfun_msh_t)
utils.finalize_mesh(output_mesh, sieve)

_logger.info('done!')
Expand Down
Loading