SpECTRE
v2025.03.17
|
Run the troubled-cell indicator on the subcell solution to see if it is safe to switch back to DG. More...
#include <TciAndSwitchToDg.hpp>
Static Public Member Functions | |
template<typename DbTags , typename... InboxTags, typename Metavariables , typename ArrayIndex , typename ActionList , typename ParallelComponent , size_t Dim = Metavariables::volume_dim> | |
static Parallel::iterable_action_return_t | apply (db::DataBox< DbTags > &box, const tuples::TaggedTuple< InboxTags... > &, const Parallel::GlobalCache< Metavariables > &, const ArrayIndex &, const ActionList, const ParallelComponent *const) |
Run the troubled-cell indicator on the subcell solution to see if it is safe to switch back to DG.
In terms of the DG-subcell/FD hybrid solver, this action is run after the FD step has calculated the solution at
The algorithm proceeds as follows:
subcell_options.always_use_subcells() == true
, then we do not run any TCI or try to go back to DG. We need to avoid reconstructing (in the sense of the inverse of projecting the DG solution to the subcells) the time stepper history if there are shocks present in the history, and for substep methods this is most easily handled by only switching back at the end of a full time step. During the self-start phase of the multistep time integrators we integrate over the same region of time at increasingly higher order, which means if we were on subcell "previously" (since we use a forward-in-time self-start method the time history is actually in the future of the current step) then we will very likely need to again switch to subcell.TciMutator
.ActiveGrid::Dg
, and clearing the subcell neighbor data.subcell::Tags::TciGridHistory
.Actions::TciAndRollback
, this action does not jump back to Labels::BeginDg
. This is because users may add actions after a time step has been completed. In that sense, it may be more proper to actually check the TCI and switch back to DG at the start of the step rather than the end.subcell::Tags::DidRollback
to false
at the very beginning since this action is called after an FD step has completed.subcell::Tags::DidRollback=True
i.e. the grid has been switched from DG to FD in the current time step by preceding actions, this action is skipped except setting DidRollback
to false
. Stated differently, if an element switched from DG to FD it needs to remain at least one time step on the FD grid.GlobalCache:
DataBox:
System::variables_tag
if the cell is not troubledTags::HistoryEvolvedVariables
if the cell is not troubledsubcell::Tags::ActiveGrid
if the cell is not troubledsubcell::Tags::DidRollback
sets to false
subcell::Tags::TciDecision
is set to an integer value according to the return of TciMutator.subcell::Tags::GhostDataForReconstruction<Dim>
if the cell is not troubledsubcell::Tags::TciGridHistory
if the time stepper is a multistep method