From 6db70ac0b3da282e2e697909368d3204747bf2ca Mon Sep 17 00:00:00 2001 From: Joshua Larsen Date: Tue, 28 Dec 2021 11:40:29 -0800 Subject: [PATCH] update(Gridgen): added keyword arguments for smoothing_level_vertical and smoothing_level_horizontal --- flopy/utils/gridgen.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/flopy/utils/gridgen.py b/flopy/utils/gridgen.py index aeabaa336c..7f65bfda28 100644 --- a/flopy/utils/gridgen.py +++ b/flopy/utils/gridgen.py @@ -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 ----- @@ -201,6 +210,7 @@ def __init__( exe_name="gridgen", surface_interpolation="replicate", vertical_pass_through=False, + **kwargs, ): self.dis = dis if isinstance(dis, ModflowGwfdis): @@ -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 = [] @@ -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":