diff --git a/pyDeltaRCM/init_tools.py b/pyDeltaRCM/init_tools.py index e30d0ebf..ce11dddf 100644 --- a/pyDeltaRCM/init_tools.py +++ b/pyDeltaRCM/init_tools.py @@ -386,7 +386,6 @@ def set_constants(self) -> None: # kernels for topographic smoothing self.kernel1 = np.array([[1, 1, 1], [1, -8, 1], [1, 1, 1]]).astype(np.int64) - self.kernel2 = np.array([[1, 1, 1], [1, 0, 1], [1, 1, 1]]).astype(np.int64) def create_boundary_conditions(self) -> None: @@ -434,7 +433,7 @@ def create_boundary_conditions(self) -> None: # at inlet self.qw0 = self.u0 * self.h0 # water unit input discharge - self.Qp_water = self.Qw0 / self._Np_water # volume each water parcel + self.Qp_water = self.Qw0 / self._Np_water # discharge each water parcel self.qs0 = self.qw0 * self.C0 # sed unit discharge self.dVs = 0.1 * self.N0**2 * self.V0 # total sed added per timestep self.Qs0 = self.Qw0 * self.C0 # sediment total input discharge diff --git a/pyDeltaRCM/water_tools.py b/pyDeltaRCM/water_tools.py index 786b4bba..026a811a 100644 --- a/pyDeltaRCM/water_tools.py +++ b/pyDeltaRCM/water_tools.py @@ -58,6 +58,12 @@ def init_water_iteration(self) -> None: self.pad_depth = np.pad(self.depth, 1, "edge") self.pad_cell_type = np.pad(self.cell_type, 1, "edge") + # configure the starting indices for each parcel + inlet_weights = self.get_inlet_weights_water() + self.start_indices = shared_tools.get_start_indices( + self.inlet, inlet_weights, self._Np_water + ) + def get_inlet_weights_water(self, **kwargs): """Get weight for inlet cells for water parcels. @@ -91,11 +97,8 @@ def run_water_iteration(self) -> None: _msg = "Beginning stepping of water parcels" self.log_info(_msg, verbosity=2) - # configure the starting indices for each parcel - inlet_weights = self.get_inlet_weights_water() - start_indices = shared_tools.get_start_indices( - self.inlet, inlet_weights, self._Np_water - ) + # grab from initialization step + start_indices = self.start_indices # init parcel step number counter _step = 0 @@ -691,7 +694,8 @@ def _get_weight_at_cell_water( weight[~wall] = 1 / nnotwall else: raise RuntimeError( - "No non-wall cells surrounding cell. " "Please report error." + "No non-wall cells surrounding cell." + "Please report error including logfile." ) weight = weight / np.sum(weight)