Replies: 3 comments 5 replies
-
@ajnonaka @gardner48 -- can you address this one? |
Beta Was this translation helpful? Give feedback.
-
Some further clarification and discussion after getting sleep:
This is not strictly true. Interior data is being updated during each step of the RKIntegrator update, however ghost data (which is what I was looking at when I made the post) remains unchanged throughout the RK update, and only changes when FillPatch is called before the next simulation time-step. This is to be expected, I believe. I would have to implement something like you've done in STvAR: https://github.com/AMReX-Astro/STvAR/blob/6fa69d6382165d3f04c2093e3ba5c4c0eebcb925/Source/AmrCoreAdv.cpp#L716 by supplying a function to I am still debugging why SUNDIALS won't work. My code runs with the behaviour described above when I use:
But when I run with:
It crashes when trying to access ghost cells (negative indices) of the data |
Beta Was this translation helpful? Give feedback.
-
Sorry, I want to ask a question that is not related to your issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Are there any examples that show use of the TimeIntegrator class, particularly for the SUNDIALS adaptive methods when using AmrLevel with subcycling? I would like to experiment with integrating electron and ion dynamics at different rates in our multi fluid plasma code, where we have separate states for each fluid species and the field (same distribution map, however).
For example, see here for our RK2 implementation:
https://github.com/PlasmaSimUQ/cerberus/blob/a9930678ecd2788d6d6a4b9a2f91d6679d80413a/Source/MFP_advance.cpp#L58
The call to
get_data
is aFillPatch
operation intoRK_step[data_idx].U
andRK_step[data_idx].dU
stores the update.data_idx
is the state index.As a simple first attempt, I have tried this with only a single fluid state, with the aim of getting it working with the TimeIntegrator class before moving on to coupled states.
I load the state data into a
Vector<MultiFab>
, initialize the time integrator and create a rhs function that calls thecalc_time_derivative
(source terms) andcalc_spatial_derivative
(flux divergence) update functions. Using this with the amrex native RKIntegrator gives correct output for 'ForwardEuler' and first order 'RungeKutta', but only the first step in the higher order RK methods appears to do anything, with the data remaining unchanged for remaining steps of the RK update. Trying it with the integrator type set to SUNDIALS with appropriate method (ERK) doesn't run at all. I can post this code when I get back to the office if necessary.Is this why
AmrLevel::RK
exists (relevant discussion topic maybe: #3319)? I am interested in the multi-rate methods provided in ARKODE, so using that isn't really an option in this case.All advice is greatly appreciated :)
Beta Was this translation helpful? Give feedback.
All reactions