Skip to content

Commit

Permalink
tidy fixed_nodes|links_exist
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Oct 24, 2024
1 parent 7b0d5d0 commit 699e134
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/landlab/components/river_flow_dynamics/river_flow_dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,23 +545,16 @@ def __init__(
)

# Using fixed entry nodes/links only when they exist
if len(self._fixed_entry_nodes) > 0:
self._fixed_nodes_exist = True
else:
self._fixed_nodes_exist = False

if len(self._fixed_entry_links) > 0:
self._fixed_links_exist = True
else:
self._fixed_links_exist = False
self._fixed_nodes_exist = len(self._fixed_entry_nodes) > 0
self._fixed_links_exist = len(self._fixed_entry_links) > 0

# Updating grid fixed values according to the user input
if self._fixed_nodes_exist is True:
if self._fixed_nodes_exist:
self._h[self._fixed_entry_nodes] = entry_nodes_h_values
self._eta[self._fixed_entry_nodes] = (
entry_nodes_h_values - self._z[self._fixed_entry_nodes]
)
if self._fixed_links_exist is True:
if self._fixed_links_exist:
self._vel[self._fixed_entry_links] = entry_links_vel_values

# Mapping node values at links
Expand Down

0 comments on commit 699e134

Please sign in to comment.