4from .AbstractLimiterActionSet
import AbstractLimiterActionSet
6import peano4.solversteps
9 TemplateCopyAndConvertDataFromRegularToLimiterAndProjectToFaces =
"""
10 if ( {{CONVERT_FROM_REGULAR_TO_LIMITER_AND_SEND_PREDICATE}} ) {
11 celldata::{{SOLVER_NAME}}CellLabel::Troubled_Marker ownStatus = fineGridCell{{SOLVER_NAME}}CellLabel.getTroubled_Marker();
13 bool sendFaceProjection = ownStatus>=celldata::{{SOLVER_NAME}}CellLabel::Troubled_Marker::REGULAR_TO_LIMITER;
14 for(int d=0; d<2*Dimensions; d++){
15 sendFaceProjection |= fineGridFaces{{SOLVER_NAME}}FaceLabel(d).getTroubled_Marker()>= facedata::{{SOLVER_NAME}}FaceLabel::Troubled_Marker::LIMITER_TO_REGULAR;
18 //If there's no need to send anything, skip this step
19 if(!sendFaceProjection) return;
21 double* regularSolverOldValues = fineGridCell{{REGULAR_SOLVER_UNKNOWN_IDENTIFIER}}_old.value;
22 double* limiterSolverNewValues = fineGridCell{{LIMITER_SOLVER_UNKNOWN_IDENTIFIER}}.value;
24 //TODO: Replace with more general conversion
25 // Converts DG into FV
26 kernels::{{SOLVER_NAME}}::projectOnFVLimiterSpaceWithoutHalo(regularSolverOldValues, limiterSolverNewValues);
32 TemplateCopyAndConvertDataFromLimiterToRegular =
"""
33 if ({{CONVERT_FROM_LIMITER_TO_REGULAR_PREDICATE}}) {
34 kernels::{{SOLVER_NAME}}::projectOnDGSpaceFromFVWithoutHalo(
35 fineGridCell{{LIMITER_SOLVER_UNKNOWN_IDENTIFIER}}.value,
36 fineGridCell{{REGULAR_SOLVER_UNKNOWN_IDENTIFIER}}.value
40 def __init__(self,solver, regularToLimiterGuard, limiterToRegularGuard):
41 super(CopyAndConvertPatch, self).
__init__(solver)
47 if operation_name==peano4.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
49 self.
_solver._init_dictionary_with_default_parameters(d)
50 self.
_solver.add_entries_to_text_replacement_dictionary(d)
53 elif operation_name==peano4.solversteps.ActionSet.OPERATION_TOUCH_CELL_LAST_TIME:
55 self.
_solver._init_dictionary_with_default_parameters(d)
56 self.
_solver.add_entries_to_text_replacement_dictionary(d)
62 return __name__.replace(
".py",
"").replace(
".",
"_")
68#include "kernels/""" + self.
_solver._name +
"""/Limiter.h"
69#include "toolbox/blockstructured/Enumeration.h"
70#include "exahype2/fv/rusanov/rusanov.h"
str TemplateCopyAndConvertDataFromRegularToLimiterAndProjectToFaces
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
str TemplateCopyAndConvertDataFromLimiterToRegular
get_action_set_name(self)
Return unique action set name.
get_includes(self)
Return include statements that you need.
__init__(self, solver, regularToLimiterGuard, limiterToRegularGuard)