Skip to content

Add GeometryFM3D.from_2d_geometry() for building 3D mesh from 2D#958

Open
ecomodeller wants to merge 2 commits into
mainfrom
feature/from-2d-geometry
Open

Add GeometryFM3D.from_2d_geometry() for building 3D mesh from 2D#958
ecomodeller wants to merge 2 commits into
mainfrom
feature/from-2d-geometry

Conversation

@ecomodeller

Copy link
Copy Markdown
Member

Summary

Creating 3D initial conditions (e.g. temperature/salinity from CTD profiles) requires a 3D geometry, but users often only have a 2D mesh and the vertical discretization from their .m3fm setup file — no existing 3D dfsu to read from.

GeometryFM3D.from_2d_geometry() fills this gap by extruding a 2D mesh vertically using sigma or sigma-z layer parameters, producing a geometry that can be used to construct and write 3D dfsu files.

Also fixes the dfsu writer to derive zn from node coordinates when not explicitly provided, which is needed for freshly created (not read-from-file) geometries.

Enable creating 3D layered geometries programmatically from a 2D mesh
and vertical discretization parameters (sigma and sigma-z), which is
needed when constructing initial condition files without an existing
3D dfsu to read from.

- Add from_2d_geometry() classmethod with sigma and sigma-z support
- Fix dfsu writer to handle missing zn for freshly created geometries
- Add Oresund .m3fm test data and 3D initial conditions example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant