Skip to content

Commit

Permalink
feat(vtk): improve export at vertices (#844)
Browse files Browse the repository at this point in the history
* Use bilinear interpolation to calculate the z of cell vertices (this is more appropriate than simple averaging when the grid is not regular)
* Ignore inactive cells when calculating the z of cell vertices (until now, they were not ignored, potentially yielding wrong values at the boundary of inactive cells)
* Use trilinear interpolation to calculate array values at cell vertices (this is more appropriate than simple averaging when the grid is not regular; furthermore, until now, everything was shifted downward with an awkward repetition of values at the top and bottom of the first layer)
* Improve performance by using scipy functions and avoiding loops (until now, interpolation was done by looping through all the cells in Python)
* Allow for directly passing array values at vertices to functions add_array() and add_vector() of the Vtk class
* New option "position" in the function postprocessing.get_specific_discharge() for calculating the values at "centers" (default), "faces" or "vertices"
* Cast delc, delr, top and botm of the grid to float64 (float32 was yielding significant round-off errors when rotating grid coordinates)
  • Loading branch information
etiennebresciani authored Apr 6, 2020
1 parent 14040ff commit e43dccc
Show file tree
Hide file tree
Showing 6 changed files with 813 additions and 250 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ Additional dependencies to use optional FloPy helper methods are listed below.
| `Raster()` in `flopy.utils.Raster` | **rasterio**, **affine**, and **scipy** |
| `Raster().sample_polygon()` in `flopy.utils.Raster` | **shapely** |
| `Raster().crop()` in `flopy.utils.Raster` | **shapely** |
| `._zverts_smooth()` in `flopy.discretization.structuredgrid` `StructuredGrid` class | **scipy.interpolate** |
| `.array_at_verts()` in `flopy.discretization.structuredgrid` `StructuredGrid` class | **scipy.interpolate** |

How to Cite
-----------------------------------------------
Expand Down
Loading

0 comments on commit e43dccc

Please sign in to comment.