-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(UnstructuredGrid): unstructured grid from specification file #1524
Conversation
416eb2c
to
72fd4cc
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1524 +/- ##
=======================================
Coverage 72.4% 72.5%
=======================================
Files 251 251
Lines 54183 54227 +44
=======================================
+ Hits 39280 39320 +40
- Misses 14903 14907 +4
|
72fd4cc
to
0b6ef11
Compare
fe42b36
to
85b01e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a couple comments on this PR.
It's great that we can read a grid specification file and create a modelgrid. We already have a class method for this in the StructuredGrid class, but only for structured grids, I think. Should we do the same for the UnstructuredGrid class and add this as a class method instead (or in addition to)?
In your notebook you use copy tree to move the example files and then you load and run the model. This works just fine, but I think we have a somewhat consistent pattern where we load the model, change the workspace (m.change_model_ws(new_folder) for MF2005-based models and sim.set_simpath(new_folder) for MF6) and then run the model in the new space. Maybe we should try to be consistent in how we do this across our autotests and notebooks?
Just as an FYI, the official format for the unstructured grid specification file is described here in the gwutil_a.pdf file as:
Hi, just as a note, I checked with J.Doherty and the description of the ivertex variable in that document might be a bit confusing. |
82471ce
to
f5ebd2e
Compare
* add from_gridspec method to UnstructuredGrid * add freyberg USG example notebook * update cross section plot example notebook with accepted line representations * validate line representations in PlotCrossSection instead of GeoSpatialUtil * fix flopy.utils.gridutil.get_lni docstring
f5ebd2e
to
a06436b
Compare
I updated the Freyberg USG notebook to follow the load/switch workspace/run pattern. Also moved the GSF-loading functionality to I noticed that nodes defined in As a tentative solution |
Hey @w-bonelli, I think your approach for handling the vertex issue is reasonable for now. MODFLOW-USG requires cells to have flat tops and bottoms, just like in MODFLOW 6. MODFLOW-USG reads in cell tops and bottoms as its input. MODFLOW-USG doesn't read GSF files as input; my understanding is that the GSF files are used to plot the results of MODFLOW-USG models using programs like Paraview, which can handle the x,y,z vertices. Not sure where that leaves us here, but I suspect we haven't heard the last of this. Ideally we would retain these x,y,z vertices and make them available elsewhere, like the vtk export, but I don't think we should get into that right now. |
* add from_gridspec method to UnstructuredGrid * add freyberg USG example notebook * update cross section plot example notebook with accepted line representations * validate line representations in PlotCrossSection instead of GeoSpatialUtil * fix flopy.utils.gridutil.get_lni docstring
* add from_gridspec method to UnstructuredGrid * add freyberg USG example notebook * update cross section plot example notebook with accepted line representations * validate line representations in PlotCrossSection instead of GeoSpatialUtil * fix flopy.utils.gridutil.get_lni docstring
* add from_gridspec method to UnstructuredGrid * add freyberg USG example notebook * update cross section plot example notebook with accepted line representations * validate line representations in PlotCrossSection instead of GeoSpatialUtil * fix flopy.utils.gridutil.get_lni docstring
* add from_gridspec method to UnstructuredGrid * add freyberg USG example notebook * update cross section plot example notebook with accepted line representations * validate line representations in PlotCrossSection instead of GeoSpatialUtil * fix flopy.utils.gridutil.get_lni docstring
Adapted from the notebook uploaded by @javgs-bd in #1436:
from_gridspec
method toUnstructuredGrid
flopy3_mfusg_freyberg.ipynb
Plus a few fixes for #1520 and #1521 and other miscellaneous:
flopy.utils.geometry.LineString
andshapely.geometry.LineString
in cross section notebookCrossSectionPlot
instead ofGeoSpatialUtil
(it seems non-trivial to cover all combinations ofshapetype
and line representation and keep this consistent with shapely — maybe best to let shapely handle validation?)StructuredGrid
andUnstructuredGrid
flopy.utils.gridutil.get_lni
docstringGeoSpatialUtil
tests