mesh-reshape v3.2.3¶
Mercurial revision 5803:7164e00e8f3d | 2026-08-18
Description¶
Reshape and adjust finite element (FE) mesh boundaries to fit given polygons. This tool uses elasticity-based methods to smoothly deform the mesh while preserving its quality and ensuring alignment with the specified boundaries. It is particularly useful for ocean modeling or computational fluid dynamics (CFD) applications where mesh boundaries must accurately follow geographical or physical constraints.
Usage¶
mesh-reshape [OPTIONS] -m <input_mesh> -s <boundary_polygon>
Options¶
Option |
Description |
|---|---|
|
Show this help message and exit. |
|
Required. Input mesh file (e.g., |
|
Required. Polygon file to align mesh boundaries (e.g., |
|
Polygon file for mesh destruction (optional). |
|
Polygon file for edge selection (optional). |
|
Output mesh file. Default: |
|
Enable mesh smoothing after reshaping. |
|
Enable debug verbose mode. |
Examples¶
Basic Usage¶
Align a mesh to a coastline polygon:
mesh-reshape -m input_mesh.nei -s coastline.plg -o output_mesh.nei
With Mesh Smoothing¶
Apply smoothing to improve mesh quality after reshaping:
mesh-reshape -m input_mesh.nei -s coastline.plg --smooth -o smoothed_mesh.nei
With Debug Mode¶
Enable debug output for troubleshooting:
mesh-reshape -m input_mesh.nei -s coastline.plg --debug -o debug_mesh.nei
With Mesh Destruction¶
Remove parts of the mesh using a destruction polygon:
mesh-reshape -m input_mesh.nei -s coastline.plg -d destruction_area.plg -o final_mesh.nei
Environment Variables¶
None.
Notes¶
The input mesh file (
-m) and boundary polygon file (-s) are mandatory.The tool assumes the input mesh is in TRIGRID format (
.nei).For large meshes, consider using
--debugto monitor progress and identify issues.Mesh smoothing (
--smooth) may increase computation time but improves element quality.
See Also¶
---