Skip to content

Commit

Permalink
Merge pull request #279 from ImperialCollegeLondon/dev_beam_stride
Browse files Browse the repository at this point in the history
Update beamplot.py to have stride option, consistent with aerogridplot.py
  • Loading branch information
ben-l-p committed May 8, 2024
2 parents d16e60a + e9e4e05 commit 522138d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sharpy/postproc/beamplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ class BeamPlot(BaseSolver):
settings_default['output_rbm'] = True
settings_description['output_rbm'] = 'Write ``csv`` file with rigid body motion data'

settings_types['stride'] = 'int'
settings_default['stride'] = 1
settings_description['stride'] = 'Number of steps between the execution calls when run online'

settings_table = settings_utils.SettingsTable()
__doc__ += settings_table.generate(settings_types, settings_default, settings_description)

Expand Down Expand Up @@ -107,7 +111,7 @@ def plot(self, online):
self.write_beam(it)
if self.settings['include_FoR']:
self.write_for(it)
else:
elif ((len(self.data.structure.timestep_info) - 1) % self.settings['stride'] == 0):
it = len(self.data.structure.timestep_info) - 1
self.write_beam(it)
if self.settings['include_FoR']:
Expand Down

0 comments on commit 522138d

Please sign in to comment.