Skip to content

Next multi timestep monitor#364

Merged
bendudson merged 21 commits intoboutproject:v4.1-RCfrom
dschwoerer:next_multi_timestep_monitor
Sep 2, 2017
Merged

Next multi timestep monitor#364
bendudson merged 21 commits intoboutproject:v4.1-RCfrom
dschwoerer:next_multi_timestep_monitor

Conversation

@dschwoerer
Copy link
Contributor

Implementation of a multi time step monitor

Useful if you want to e.g. have a high-frequency PID controller monitor or any other monitor that changes physics (e.g. a call to EIRENE) so that your physics does not depend to strongly on the output monitor interval ...

The last commit isn't directly related, but the touching annoyed me during coding ...

@dschwoerer dschwoerer closed this Nov 3, 2016
@dschwoerer dschwoerer reopened this Nov 3, 2016
@dschwoerer dschwoerer force-pushed the next_multi_timestep_monitor branch from e504c81 to 62b9ea1 Compare November 3, 2016 19:42
@ZedThree
Copy link
Member

I finally managed to go through this the other week, and I think it's a solid base for the rewrite. I got pretty much all of the features we want working using this -- in particular, using fields directly from physics models in a monitor. Not sure how e.g #343 or #321 fit in here though.

It does still need some work, but it's definitely a good place to start from 👍

One thing that's not very clear to me is how time sub-sampling actually works in this implementation. What exactly sets the timestep, and how/when are monitors with timesteps of < 1 called?

@dschwoerer
Copy link
Contributor Author

here is an example.

If you want I can include an example of subsampling a field ...

@ZedThree
Copy link
Member

Could you write some documentation for how it all works? e.g how does my_output_monitor_fast(.5) interact with the timestep set in the input file? What sets the output frequency in the end?

@dschwoerer
Copy link
Contributor Author

I can add an example of sub sampling, using two files.

my_output_monitor_fast(.5) sets the output frequency to .5 time units.
If the main output repetition time is set to 2, than this samples 4 times per time step, if the main output repetition time is set to .1, than it only samples every 5 time steps.

The output frequency of the monitor is 1/.5=2, the output frequency of the BOUT.dmp.* remains unchanged by the other monitors.

@dschwoerer
Copy link
Contributor Author

Now an example with comments!

I hope that helps 😃

@dschwoerer
Copy link
Contributor Author

Concerning #343 (or #321) - it is possible to merge them, but I wasn't sure whether both would be merged, therefore I kept them separate pull requests ...

@dschwoerer
Copy link
Contributor Author

One more thing:
I think this is useful, even if this isn't the default way of doing sub/super sampling, because:

  • Allows for monitors to have states (without dirty hacks).
  • Allows monitors to be called independently of the output. Useful e.g. for coupling with EIRENE

@dschwoerer
Copy link
Contributor Author

One more thing, concerning the all in one file approach:
I don't think that this is would actually require any change.
I am not sure how this is done (haven't looked at netcdf or hdf5) but the code (if I remember correctly) doesn't handle several files, this is done by the user. Therefore the user might choose to put it in one file, if the file supports it, but this is not a choice of the monitors ...

@dschwoerer
Copy link
Contributor Author

now with README

bendudson
bendudson previously approved these changes Jun 14, 2017
[Probes]
file = "PROBES.dmp"
floats = true
opencloase = true # false if it should be fast No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: openclose

In the code another monitor is added with an output timestep of 0.01.
This Monitor uses a separat datafile, (via class `SimpleDatafile`, see monitor.cxx
line 12 ff) to write the data. The options for the simple datafile are
read fro the `[probes]` section in the input.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: from

@@ -0,0 +1,20 @@
#include <bout/solver.hxx>

// int Monitor::call(Solver * solver, BoutReal time, int iter, int nout){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this commented-out code

@dschwoerer dschwoerer changed the base branch from next to v4.1-RC August 28, 2017 13:37
@dschwoerer dschwoerer added this to the BOUT-4.1 milestone Aug 28, 2017
@bendudson bendudson merged commit ed201a0 into boutproject:v4.1-RC Sep 2, 2017
@bendudson bendudson mentioned this pull request Sep 7, 2017
@dschwoerer dschwoerer deleted the next_multi_timestep_monitor branch February 27, 2018 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants