OCSMesh
OCSMesh is a Python package for processing DEM data into georeferenced unstructured meshes using the jigsaw-python library.
Installation
Two ways of installing OCSMesh are described below:
Using conda
The recommended way to setup the environment for installing OCSMesh is to
use ``conda` <https://docs.conda.io/en/latest/miniconda.html#linux-installers>`_
with the environment.yml
file provided in the repo to install
required libraries.
The Jigsaw library and its Python wrapper must be instlled
before OCSMesh can be used. Jigsaw is available on conda-forge
channel.
First you need to download the environment.yml
file.
wget https://raw.githubusercontent.com/noaa-ocs-modeling/OCSMesh/main/environment.yml
conda env create -f environment.yml -n your-env-name
conda activate your-env-name
conda install -y -c conda-forge jigsawpy
pip install ocsmesh
From GitHub repo
OCSMesh can be installed from the GitHub repository as well.
After downloading the repo, you need to first install Jigsaw using
the script provided in OCSMesh repo by calling:
./setup.py install_jigsaw
in the OCSMesh root directory.
Then OCSMesh can be installed.
git clone https://github.com/noaa-ocs-modeling/ocsmesh
cd ocsmesh
python ./setup.py install_jigsaw # To install latest Jigsaw from GitHub
python ./setup.py install # Installs the OCSMesh library to the current Python environment
# OR
python ./setup.py develop # Run this if you are a developer.
Requirements
3.10 <= Python
CMake
C/C++ compilers
How to Cite
Title : OCSMesh: a data-driven automated unstructured mesh generation software for coastal ocean modeling
Personal Author(s) : Mani, Soroosh;Calzada, Jaime R.;Moghimi, Saeed;Zhang, Y. Joseph;Myers, Edward;Pe’eri, Shachak;
Corporate Authors(s) : Coast Survey Development Laboratory (U.S.)
Published Date : 2021
Series : NOAA Technical Memorandum NOS CS ; 47
DOI : https://doi.org/10.25923/csba-m072
- Domain definition
- Mesh size definition
Hfun
HfunRaster
HfunRaster.msh_t()
HfunRaster.apply_added_constraints()
HfunRaster.apply_constraints()
HfunRaster.get_xy_memcache()
HfunRaster.raster
HfunRaster.hmin
HfunRaster.hmax
HfunRaster.verbosity
HfunRaster.add_band()
HfunRaster.adjust()
HfunRaster.average_filter()
HfunRaster.bbox
HfunRaster.chunk_size
HfunRaster.clip()
HfunRaster.close()
HfunRaster.contourf()
HfunRaster.count
HfunRaster.crs
HfunRaster.dtype()
HfunRaster.dtypes
HfunRaster.dx
HfunRaster.dy
HfunRaster.fill_nodata()
HfunRaster.gaussian_filter()
HfunRaster.generic_filter()
HfunRaster.get_bbox()
HfunRaster.get_channels()
HfunRaster.get_contour()
HfunRaster.get_multipolygon()
HfunRaster.get_values()
HfunRaster.get_window_bounds()
HfunRaster.get_window_data()
HfunRaster.get_window_transform()
HfunRaster.get_x()
HfunRaster.get_xy()
HfunRaster.get_xyz()
HfunRaster.get_y()
HfunRaster.height
HfunRaster.is_masked
HfunRaster.iter_windows()
HfunRaster.mask()
HfunRaster.md5
HfunRaster.modifying_raster()
HfunRaster.nodataval()
HfunRaster.overlap
HfunRaster.path
HfunRaster.read()
HfunRaster.read_masks()
HfunRaster.resample()
HfunRaster.resampling_method
HfunRaster.sample()
HfunRaster.save()
HfunRaster.shape
HfunRaster.src
HfunRaster.tags()
HfunRaster.tmpfile
HfunRaster.transform
HfunRaster.values
HfunRaster.warp()
HfunRaster.width
HfunRaster.x
HfunRaster.xres
HfunRaster.y
HfunRaster.yres
HfunMesh
HfunCollector
HfunCollector.msh_t()
HfunCollector.add_topo_bound_constraint()
HfunCollector.add_topo_func_constraint()
HfunCollector.add_courant_num_constraint()
HfunCollector.add_region_constraint()
HfunCollector.add_contour()
HfunCollector.add_channel()
HfunCollector.add_subtidal_flow_limiter()
HfunCollector.add_constant_value()
HfunCollector.add_patch()
HfunCollector.add_feature()
- Mesh representation
Mesh
EuclideanMesh2D
EuclideanMesh2D.get_bbox()
EuclideanMesh2D.boundaries
EuclideanMesh2D.tricontourf()
EuclideanMesh2D.interpolate()
EuclideanMesh2D.get_contour()
EuclideanMesh2D.get_multipolygon()
EuclideanMesh2D.vert2
EuclideanMesh2D.value
EuclideanMesh2D.bbox
EuclideanMesh2D.coord
EuclideanMesh2D.crs
EuclideanMesh2D.elements
EuclideanMesh2D.hull
EuclideanMesh2D.msh_t
EuclideanMesh2D.nodes
EuclideanMesh2D.quad4
EuclideanMesh2D.quads
EuclideanMesh2D.tria3
EuclideanMesh2D.triangles
EuclideanMesh2D.write()
- Utility classes and functions
Raster
Raster.modifying_raster()
Raster.get_x()
Raster.get_y()
Raster.get_xy()
Raster.get_values()
Raster.get_xyz()
Raster.get_multipolygon()
Raster.get_bbox()
Raster.contourf()
Raster.tags()
Raster.read()
Raster.dtype()
Raster.nodataval()
Raster.sample()
Raster.close()
Raster.add_band()
Raster.fill_nodata()
Raster.gaussian_filter()
Raster.average_filter()
Raster.generic_filter()
Raster.mask()
Raster.read_masks()
Raster.warp()
Raster.resample()
Raster.save()
Raster.clip()
Raster.adjust()
Raster.get_contour()
Raster.get_channels()
Raster.iter_windows()
Raster.get_window_data()
Raster.get_window_bounds()
Raster.get_window_transform()
Raster.x
Raster.y
Raster.values
Raster.path
Raster.tmpfile
Raster.md5
Raster.count
Raster.is_masked
Raster.shape
Raster.height
Raster.bbox
Raster.src
Raster.width
Raster.dx
Raster.dy
Raster.crs
Raster.transform
Raster.dtypes
Raster.xres
Raster.yres
Raster.resampling_method
Raster.chunk_size
Raster.overlap
must_be_euclidean_mesh()
mesh_to_tri()
cleanup_isolates()
cleanup_duplicates()
cleanup_folded_bound_el()
put_edge2()
geom_to_multipolygon()
get_boundary_segments()
get_mesh_polygons()
repartition_features()
transform_linestring()
needs_sieve()
put_id_tags()
finalize_mesh()
remesh_small_elements()
sieve()
sort_edges()
index_ring_collection()
outer_ring_collection()
inner_ring_collection()
get_multipolygon_from_pathplot()
signed_polygon_area()
vertices_around_vertex()
get_surrounding_elem_verts()
get_lone_element_verts()
get_verts_in_shape()
select_adjacent()
get_incident_edges()
get_cross_edges()
clip_mesh_by_shape()
remove_mesh_by_edge()
clip_mesh_by_vertex()
get_mesh_edges()
calculate_tria_areas()
calculate_edge_lengths()
elements()
faces_around_vertex()
get_boundary_edges()
get_pinched_nodes()
has_pinched_nodes()
cleanup_pinched_nodes()
interpolate()
interpolate_euclidean_mesh_to_euclidean_mesh()
interpolate_euclidean_grid_to_euclidean_mesh()
tricontourf()
triplot()
reproject()
limgrad()
msh_t_to_grd()
grd_to_msh_t()
msh_t_to_2dm()
sms2dm_to_msh_t()
msh_t_to_utm()
estimate_bounds_utm()
estimate_mesh_utm()
get_polygon_channels()
merge_msh_t()
add_pool_args()
drop_extra_vertex_from_line()
drop_extra_vertex_from_polygon()
remove_holes()
remove_holes_by_relative_size()
get_element_size_courant()
can_velocity_be_approximated_by_linear_wave_theory()
estimate_particle_velocity_from_depth()
approximate_courant_number_for_depth()
create_rectangle_mesh()
raster_from_numpy()
msht_from_numpy()
shape_to_msh_t()
shape_to_msh_t_2()
triangulate_polygon()
triangulate_polygon_s()
filter_el_by_area()
create_patch_mesh()
clip_mesh_by_mesh()
create_mesh_from_mesh_diff()
merge_neighboring_meshes()
fix_small_el()
merge_overlapping_meshes()
calc_el_angles()
order_mesh()
quads_from_tri()
clip_elements_by_index()
cleanup_skewed_el()
cleanup_concave_quads()
quadrangulate_rivermapper_arcs()
batched()
delaunay_within()
triangulate_shp()
shptri_to_msht()
triangulate_rivermapper_poly()
- Command line interface