4from .AbstractFVActionSet
import AbstractFVActionSet
12 The global periodic boundary conditions are set in the Constants.h.
14 There is no need to update QOld along the faces. QOld is always rolled
15 over from QNew, i.e. we may assume it is already set correctly. It is
16 not correctly set in the very first time step (after InitGrid, we haven't
17 yet set QOld), so apply the boundary conditions here would even confuse
21 TemplateHandleBoundary_Prologue =
"""
25 not repositories::{{SOLVER_INSTANCE}}.PeriodicBC[marker.getSelectedFaceNumber()%Dimensions]
27 not marker.hasBeenRefined()
29 fineGridFace{{SOLVER_NAME}}FaceLabel.getBoundary()
31 logTraceInWith3Arguments( "touchFaceFirstTime(...)", fineGridFace{{SOLVER_NAME}}FaceLabel.toString(), (repositories::{{SOLVER_INSTANCE}}.PeriodicBC[marker.getSelectedFaceNumber()%Dimensions]), marker.toString() );
36 TemplateHandleBoundary_KernelCalls =
"""
37 ::exahype2::fv::applyBoundaryConditions(
39 const double * __restrict__ Qinside,
40 double * __restrict__ Qoutside,
41 const tarch::la::Vector<Dimensions,double>& faceCentre,
42 const tarch::la::Vector<Dimensions,double>& volumeH,
47 repositories::{{SOLVER_INSTANCE}}.boundaryConditions( Qinside, Qoutside, faceCentre, volumeH, t, normal );
51 {{FACE_METADATA_ACCESSOR}}.getNewTimeStamp(marker.getSelectedFaceNumber()<Dimensions ? 1 : 0),
52 repositories::{{SOLVER_INSTANCE}}.getMinTimeStepSize(),
53 {{NUMBER_OF_VOLUMES_PER_AXIS}},
55 {{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}},
56 marker.getSelectedFaceNumber(),
57 fineGridFace{{UNKNOWN_IDENTIFIER}}New.value
59 ::exahype2::fv::applyBoundaryConditions(
61 const double * __restrict__ Qinside,
62 double * __restrict__ Qoutside,
63 const tarch::la::Vector<Dimensions,double>& faceCentre,
64 const tarch::la::Vector<Dimensions,double>& volumeH,
69 repositories::{{SOLVER_INSTANCE}}.boundaryConditions( Qinside, Qoutside, faceCentre, volumeH, t, normal );
73 {{FACE_METADATA_ACCESSOR}}.getOldTimeStamp(marker.getSelectedFaceNumber()<Dimensions ? 1 : 0),
74 repositories::{{SOLVER_INSTANCE}}.getMinTimeStepSize(),
75 {{NUMBER_OF_VOLUMES_PER_AXIS}},
77 {{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}},
78 marker.getSelectedFaceNumber(),
79 fineGridFace{{UNKNOWN_IDENTIFIER}}Old.value
84 TemplateHandleBoundary_Epilogue =
"""
86 bool isLeftEntryOutside = marker.getSelectedFaceNumber() < Dimensions;
87 double innerTimeStamp;
89 innerTimeStamp = {{FACE_METADATA_ACCESSOR}}.getUpdatedTimeStamp( isLeftEntryOutside ? 1 : 0 );
90 {{FACE_METADATA_ACCESSOR}}.setUpdatedTimeStamp( isLeftEntryOutside ? 0 : 1, innerTimeStamp );
92 innerTimeStamp = {{FACE_METADATA_ACCESSOR}}.getNewTimeStamp( isLeftEntryOutside ? 1 : 0 );
93 {{FACE_METADATA_ACCESSOR}}.setNewTimeStamp( isLeftEntryOutside ? 0 : 1, innerTimeStamp );
95 innerTimeStamp = {{FACE_METADATA_ACCESSOR}}.getOldTimeStamp( isLeftEntryOutside ? 1 : 0 );
96 {{FACE_METADATA_ACCESSOR}}.setOldTimeStamp( isLeftEntryOutside ? 0 : 1, innerTimeStamp );
98 logTraceOut( "touchFaceFirstTime(...)" );
101 logDebug( "touchFaceFirstTime(...)", "skip face " << marker.toString() );
106 AbstractFVActionSet.__init__(self,solver)
112 if operation_name==peano4.solversteps.ActionSet.OPERATION_TOUCH_FACE_FIRST_TIME:
114 self.
_solver._init_dictionary_with_default_parameters(self.
d)
115 self.
_solver.add_entries_to_text_replacement_dictionary(self.
d)
116 self.
d[
"PREDICATE" ] = self.
guard
117 self.
d[
"FACE_METADATA_ACCESSOR" ] =
"fineGridFace" + self.
_solver._face_label.name
127#include "exahype2/fv/BoundaryConditions.h"
128""" + AbstractFVActionSet.get_includes(self)
132 return __name__.replace(
".py",
"").replace(
".",
"_")
The global periodic boundary conditions are set in the Constants.h.
str TemplateHandleBoundary_KernelCalls
get_action_set_name(self)
You should replicate this function in each subclass, so you get meaningful action set names (otherwis...
str TemplateHandleBoundary_Epilogue
__init__(self, solver, guard)
solver: ADERDG Reference to creating class
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
get_includes(self)
Return include statements that you need.
str TemplateHandleBoundary_Prologue