Skip to content

Commit d085a33

Browse files
author
keith roberts
authored
Gen mesh (#12)
* Including some critical fixes that were not included in #11.
1 parent 0bb73b5 commit d085a33

File tree

5 files changed

+411
-179
lines changed

5 files changed

+411
-179
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Coastal ocean mesh generation from ESRI Shapefiles and digitial elevation models
1313
Functionality
1414
=============
1515

16+
1617
* A toolkit for the development of meshes and their auxiliary files that are used in the simulation of coastal ocean circulation. The software integrates mesh generation with geophysical datasets such as topobathymetric rasters/digital elevation models and shapefiles representing coastal features. It provides some necessary pre- and post-processing tools to inevitably perform a succesful numerical simulations with the developed model.
1718
* Automatically deal with arbitrarily complex shoreline vector datasets that represent complex coastal boundaries and incorporate the data in an automatic-sense into the mesh generation process.
1819
* A variety of commonly used mesh size functions to distribute element sizes that can easily be controlled via a simple scripting application interface.
@@ -81,8 +82,7 @@ Build a simple mesh around New York witha minimum element size of 1 km expanding
8182
points,
8283
[("triangle", cells)],
8384
file_format="vtk",
84-
)
85-
~
85+
)
8686
```
8787

8888
Testing

oceanmesh/edgefx.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
__all__ = ["distance_sizing_function"]
77

88

9-
def distance_sizing_function(shoreline, rate=0.15):
9+
def distance_sizing_function(shoreline, rate=0.15, max_size=99999.0):
1010
"""Mesh sizes that vary linearly at `rate` from coordinates in `obj`:Shoreline
1111
1212
Parameters
@@ -31,5 +31,6 @@ def distance_sizing_function(shoreline, rate=0.15):
3131
phi[indices] = -1.0
3232
dis = numpy.abs(skfmm.distance(phi, grid.grid_spacing))
3333
grid.values = shoreline.h0 + dis * rate
34+
grid.values[grid.values > max_size] = max_size
3435
grid.build_interpolant()
3536
return grid

0 commit comments

Comments
 (0)