Peano
Loading...
Searching...
No Matches
exahype2.api.blockstructured.DynamicMeshRefinementWithGradients.DynamicMeshRefinementWithGradients Class Reference

Evaluate the gradient-based refinement criterion and collect the outcome as refine and erase requests. More...

Inheritance diagram for exahype2.api.blockstructured.DynamicMeshRefinementWithGradients.DynamicMeshRefinementWithGradients:
Collaboration diagram for exahype2.api.blockstructured.DynamicMeshRefinementWithGradients.DynamicMeshRefinementWithGradients:

Public Member Functions

 get_action_set_name (self)
 Return unique action set name.
 
- Public Member Functions inherited from exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement
 __init__ (self, solver, int patch_size, str guard, float min_volume_size=None, float max_volume_size=None, int event_lifetime=2, bool hand_events_to_peano=False, bool veto_erase=False)
 
str get_volume_evaluation (self)
 C++ Jinja2 template evaluating the criterion within one volume.
 
 get_body_of_operation (self, operation_name)
 Return actual C++ code snippets to be inserted into C++ code.
 
 get_guard_of_operation (self, operation_name)
 Return the guard of an operation.
 
 get_body_of_unprepareTraversal (self)
 Commit the new events once per rank and mesh sweep, after all trees have merged their local events into the service.
 
 get_body_of_createGridControlEventsForNextTraversal (self)
 Return the grid control events that this action set wants to trigger.
 
 get_attributes (self)
 Return attributes as copied and pasted into the generated class.
 
 user_should_modify_template (self)
 Is the user allowed to modify the output.
 
 get_includes (self)
 Return include statements that you need.
 
- Public Member Functions inherited from peano4.api.solversteps.ActionSet.ActionSet
 get_constructor_body (self)
 Define a tailored constructor body.
 
 get_static_initialisations (self, full_qualified_classname)
 
 get_destructor_body (self)
 
 get_implementation_of_createGridControlEventsForNextTraversal (self)
 Return the C++ implementation of createGridControlEventsForNextTraversal()
 
 get_body_of_prepareTraversal (self)
 
 get_implementation_of_prepareTraversal (self)
 Return the C++ implementation of prepareTraversal()
 
 get_implementation_of_unprepareTraversal (self)
 Return the C++ implementation of unprepareTraversal()
 
 get_implementation_of_operation (self, operation_name)
 Return the C++ implementation of an operation.
 
bool may_run_in_background_task (self)
 May a task graph compiler move touchCellFirstTime() into a task.
 

Static Public Attributes

str TemplateEvaluateVolume
 Per-volume evaluation of the gradient-based criterion.
 
- Static Public Attributes inherited from exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement
str TemplateEvaluateVolume
 Per-volume evaluation of the point-wise criterion.
 
str TemplateEvaluateCriterion
 
- Static Public Attributes inherited from peano4.api.solversteps.ActionSet.ActionSet
int descend_invocation_order = 0
 
bool parallel = False
 
str OPERATION_BEGIN_TRAVERSAL = "beginTraversal"
 
str OPERATION_END_TRAVERSAL = "endTraversal"
 
str OPERATION_CREATE_PERSISTENT_VERTEX = "createPersistentVertex"
 
str OPERATION_DESTROY_PERSISTENT_VERTEX = "destroyPersistentVertex"
 
str OPERATION_CREATE_HANGING_VERTEX = "createHangingVertex"
 
str OPERATION_DESTROY_HANGING_VERTEX = "destroyHangingVertex"
 
str OPERATION_CREATE_PERSISTENT_FACE = "createPersistentFace"
 
str OPERATION_DESTROY_PERSISTENT_FACE = "destroyPersistentFace"
 
str OPERATION_CREATE_HANGING_FACE = "createHangingFace"
 
str OPERATION_DESTROY_HANGING_FACE = "destroyHangingFace"
 
str OPERATION_CREATE_CELL = "createCell"
 
str OPERATION_DESTROY_CELL = "destroyCell"
 
str OPERATION_TOUCH_VERTEX_FIRST_TIME = "touchVertexFirstTime"
 
str OPERATION_TOUCH_VERTEX_LAST_TIME = "touchVertexLastTime"
 
str OPERATION_TOUCH_FACE_FIRST_TIME = "touchFaceFirstTime"
 
str OPERATION_TOUCH_FACE_LAST_TIME = "touchFaceLastTime"
 
str OPERATION_TOUCH_CELL_FIRST_TIME = "touchCellFirstTime"
 
str OPERATION_TOUCH_CELL_LAST_TIME = "touchCellLastTime"
 

Additional Inherited Members

- Data Fields inherited from exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement
 patch_size
 
 guard
 
 event_lifetime
 
 min_volume_size
 
 max_volume_size
 
 hand_events_to_peano
 
 veto_erase
 
- Data Fields inherited from peano4.api.solversteps.ActionSet.ActionSet
 descend_invocation_order
 
 parallel
 
- Protected Attributes inherited from exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement
 _solver
 

Detailed Description

Evaluate the gradient-based refinement criterion and collect the outcome as refine and erase requests.

The action set is the counterpart of exahype2.api.blockstructured.DynamicMeshRefinement for solvers with an exahype2.api.GradientRefinement PDE term. It differs only in what it evaluates per volume: For each coordinate axis, it computes the left and the right difference quotient of the solution (exahype2::fv::computeOneSidedGradient()) and hands each of them to the term, i.e. it calls the term 2*Dimensions times per volume. Each call starts from Keep.

A volume asks for a refinement if any call says Refine, and it may be erased only if all calls say Erase. As the action set combines the volumes of a cell the same way, it simply treats each call like the outcome of one further volume. Everything else, i.e. the mesh size bounds and the bookkeeping within the refinement service, is inherited.

Definition at line 6 of file DynamicMeshRefinementWithGradients.py.

Member Function Documentation

◆ get_action_set_name()

exahype2.api.blockstructured.DynamicMeshRefinementWithGradients.DynamicMeshRefinementWithGradients.get_action_set_name (   self)

Return unique action set name.

Returns a description (word) for the mapping which is also used as class name for the generated type. As a consequence, the result should be one word (if possible) and uppercase. Also, every subclass should overwrite this routine.

The generator will take the result and construct eventually classes similar to MyStep2Dummy.h and MyStep2Dummy.cpp or similar for the example below, where we return Dummy.

Reimplemented from exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement.

Definition at line 56 of file DynamicMeshRefinementWithGradients.py.

Field Documentation

◆ TemplateEvaluateVolume

str exahype2.api.blockstructured.DynamicMeshRefinementWithGradients.DynamicMeshRefinementWithGradients.TemplateEvaluateVolume
static
Initial value:
= """
for (int normal=0; normal<Dimensions; normal++) {
for (int side=0; side<2; side++) {
double gradient[{{NUMBER_OF_UNKNOWNS}} + {{NUMBER_OF_AUXILIARY_VARIABLES}}];
::exahype2::fv::computeOneSidedGradient(
fineGridCell{{UNKNOWN_IDENTIFIER}}.value,
{{NUMBER_OF_UNKNOWNS}} + {{NUMBER_OF_AUXILIARY_VARIABLES}},
{{NUMBER_OF_VOLUMES_PER_AXIS}},
volume,
normal,
side==1,
::exahype2::fv::getVolumeLength( marker.h(), {{NUMBER_OF_VOLUMES_PER_AXIS}} ),
gradient
);
::exahype2::RefinementCommand command = ::exahype2::RefinementCommand::Keep;
repositories::{{SOLVER_INSTANCE}}.refineEraseWithGradient(
gradient,
normal,
&command
);
anyVolumeWantsToRefine = anyVolumeWantsToRefine or command == ::exahype2::RefinementCommand::Refine;
allVolumesWantToErase = allVolumesWantToErase and command == ::exahype2::RefinementCommand::Erase;
}
}
"""

Per-volume evaluation of the gradient-based criterion.

Definition at line 30 of file DynamicMeshRefinementWithGradients.py.

Referenced by exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement.get_volume_evaluation().


The documentation for this class was generated from the following file: