Skip to content

Post Timestep Calculations #862

Answered by baperry2
spaceman-spence asked this question in Q&A
Discussion options

You must be logged in to vote

Here's very simple example problem_post_timestep that shows how to access the state data

void
PeleC::problem_post_timestep()
{
    amrex::MultiFab& S_new = get_new_data(State_Type);
    amrex::Print() << "Max density on lev " << level << " is " << S_new.max(URHO) << std::endl;
}

To access pointwise data, you could use an amrex::ParallelFor over the S_new MultiFab. This should work fine if you just want to access the state to do some on-the-fly data processing. It could potentially also work for manipulating the state, but I'd proceed with caution if you do that, as it would be easy to set state variables in an inconsistent way that leads to problems on the next timestep.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@spaceman-spence
Comment options

Answer selected by spaceman-spence
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants