Skip to content

Commit

Permalink
only save inlet_nr and inlet_migr variables when there is an active i…
Browse files Browse the repository at this point in the history
…nlet
  • Loading branch information
anardek committed Oct 22, 2024
1 parent 3e85c26 commit e5d6f2b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions brie/brie.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,19 +1252,16 @@ def update(self):

# inlet statistics
if np.mod(self._time_index, self._dtsave) == 0:
# KA: modified this from matlab version so that I can save every
# time step in python
# skip first time step (initial condition)
self._inlet_nr[
np.fix(self._time_index / self._dtsave).astype(int) - 1
] = len(
self._inlet_idx
) # number of inlets
self._inlet_migr[
np.fix(self._time_index / self._dtsave).astype(int) - 1
] = np.mean(migr_up / self._dt)

if len(self._inlet_idx) != 0:
self._inlet_nr[
np.fix(self._time_index / self._dtsave).astype(int) - 1
] = len(
self._inlet_idx
) # number of inlets
self._inlet_migr[
np.fix(self._time_index / self._dtsave).astype(int) - 1
] = np.mean(migr_up / self._dt)
self._inlet_Qs_in[
np.fix(self._time_index / self._dtsave).astype(int) - 1
] = np.mean(Qs_in)
Expand Down

0 comments on commit e5d6f2b

Please sign in to comment.