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

-h, --help

Show this help message and exit.

-m <file>

Required. Input mesh file (e.g., mesh.nei).

-s <file>

Required. Polygon file to align mesh boundaries (e.g., coastline.plg).

-d <file>

Polygon file for mesh destruction (optional).

-p <file>

Polygon file for edge selection (optional).

-o <file>

Output mesh file. Default: mesh-reshape.nei.

--smooth

Enable mesh smoothing after reshaping.

--debug

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 --debug to monitor progress and identify issues.

  • Mesh smoothing (--smooth) may increase computation time but improves element quality.


See Also


---