Skip to content
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

update(Gridgen): added keyword arguments for smoothing_level_vertical and smoothing_level_horizontal #1322

Merged
merged 1 commit into from
Dec 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions flopy/utils/gridgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@ class Gridgen:
If true, Gridgen's GRID_TO_USGDATA command will connect layers
where intermediate layers are inactive.
(default is False)
**kwargs
verical_smoothing_level : int
maximum level difference between two vertically adjacent cells.
Adjust with caution, as adjustments can cause unexpected results
to simulated flows
horizontal_smoothing_level : int
maximum level difference between two horizontally adjacent cells.
Adjust with caution, as adjustments can cause unexpected results
to simulated flows

Notes
-----
Expand All @@ -201,6 +210,7 @@ def __init__(
exe_name="gridgen",
surface_interpolation="replicate",
vertical_pass_through=False,
**kwargs,
):
self.dis = dis
if isinstance(dis, ModflowGwfdis):
Expand Down Expand Up @@ -241,6 +251,12 @@ def __init__(
if vertical_pass_through:
self.vertical_pass_through = "True"

self.smoothing_level_vertical = kwargs.pop(
"smoothing_level_vertical", 1
)
self.smoothing_level_horizontal = kwargs.pop(
"smoothing_level_horizontal", 1
)
# Set up a blank _active_domain list with None for each layer
self._addict = {}
self._active_domain = []
Expand Down Expand Up @@ -1855,6 +1871,8 @@ def _builder_block(self):
s += "\n"

s += " SMOOTHING = full\n"
s += f" SMOOTHING_LEVEL_VERTICAL = {self.smoothing_level_vertical}\n"
s += f" SMOOTHING_LEVEL_HORIZONTAL = {self.smoothing_level_horizontal}\n"

for k in range(self.nlay):
if self.surface_interpolation[k] == "ASCIIGRID":
Expand Down