4 from .AbstractLimiterActionSet
import AbstractLimiterActionSet
5 from exahype2.solvers.PDETerms
import PDETerms
7 import peano4.solversteps
10 from .kernels
import check_troubledness
13 TemplateVerifyTroubledness =
"""
15 if ( {{PREDICATE}} ) {
18 const double timeStamp = fineGridCell{{REGULAR_SOLVER_NAME}}CellLabel.getTimeStamp();
19 const double timeStepSize = fineGridCell{{REGULAR_SOLVER_NAME}}CellLabel.getTimeStepSize();
21 bool isUnTroubled = true;
23 auto* luh = fineGridCell{{REGULAR_SOLVER_UNKNOWN_IDENTIFIER}}.value;
28 int linearisedIndex = 0;
29 dfor( index, {{ORDER}}+1 ) {
31 isUnTroubled &= repositories::{{SOLVER_INSTANCE}}.isPhysicallyAdmissible(
32 luh + linearisedIndex,
33 ::exahype2::dg::getQuadraturePoint(
34 marker.x(), marker.h(), index, repositories::{{REGULAR_SOLVER_INSTANCE}}.Order+1,
35 kernels::{{REGULAR_SOLVER_NAME}}::Quadrature<{{REGULAR_SOLVER_STORAGE_PRECISION}}>::nodes
38 timeStamp+timeStepSize
41 linearisedIndex += repositories::{{REGULAR_SOLVER_INSTANCE}}.NumberOfUnknowns + repositories::{{REGULAR_SOLVER_INSTANCE}}.NumberOfAuxiliaryVariables;
48 repositories::{{SOLVER_INSTANCE}}.addTroubledCell();
49 fineGridCell{{SOLVER_NAME}}CellLabel.setTroubled_Marker(celldata::{{SOLVER_NAME}}CellLabel::Troubled_Marker::TROUBLED);
50 for(int d=0; d<2*DIMENSIONS; d++){
51 fineGridFaces{{SOLVER_NAME}}FaceLabel(d).setTroubled_Marker(facedata::{{SOLVER_NAME}}FaceLabel::Troubled_Marker::TROUBLED);
55 fineGridCell{{LIMITER_SOLVER_NAME}}CellLabel.setTimeStamp(timeStamp);
56 fineGridCell{{LIMITER_SOLVER_NAME}}CellLabel.setTimeStepSize(timeStepSize);
58 fineGridCell{{LIMITER_SOLVER_NAME}}CellLabel.setHasUpdated(true);
64 def __init__(self, solver, guard, use_PAC=False):
65 super(VerifyTroubledness,self).
__init__(solver)
72 if operation_name==peano4.solversteps.ActionSet.OPERATION_TOUCH_CELL_LAST_TIME:
74 self.
_solver_solver._init_dictionary_with_default_parameters(d)
75 self.
_solver_solver.add_entries_to_text_replacement_dictionary(d)
76 d[
"PREDICATE" ] = self.
guardguard
77 d[
"USE_PAC"] = self.
use_PACuse_PAC
85 return __name__.replace(
".py",
"").replace(
".",
"_")
88 return ( super(VerifyTroubledness, self).
get_includes() +
"""
90 + self.
_solver_solver._regular_solver._name
92 #include "exahype2/dg/DGUtils.h"
def __init__(self, solver, guard, use_PAC=False)
string TemplateVerifyTroubledness
def get_body_of_operation(self, operation_name)
def get_action_set_name(self)