Add GeometryFM3D.from_2d_geometry() for building 3D mesh from 2D#958
Open
ecomodeller wants to merge 2 commits into
Open
Add GeometryFM3D.from_2d_geometry() for building 3D mesh from 2D#958ecomodeller wants to merge 2 commits into
ecomodeller wants to merge 2 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.m3fmsetup 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
znfrom node coordinates when not explicitly provided, which is needed for freshly created (not read-from-file) geometries.