Peano
Loading...
Searching...
No Matches
exahype2.api.AdaptivityCriterion.AdaptivityCriterion Class Reference

Base class of all the PDE terms which decide where to refine or coarsen the mesh. More...

Inheritance diagram for exahype2.api.AdaptivityCriterion.AdaptivityCriterion:
Collaboration diagram for exahype2.api.AdaptivityCriterion.AdaptivityCriterion:

Public Member Functions

 __init__ (self, str name, str implementation=None, bool stateless=False)
 
- Public Member Functions inherited from exahype2.api.PDETerm.PDETerm
str __repr__ (self)
 
str __str__ (self)
 
"PDETerm.Generator" generator (self)
 Code generator for this term: an instance of this term's own (possibly subclass-specific) Generator.
 

Additional Inherited Members

- Data Fields inherited from exahype2.api.PDETerm.PDETerm
 name
 
 implementation
 
 stateless
 
- Static Public Attributes inherited from exahype2.api.PDETerm.PDETerm
str NAME
 
str SIGNATURE
 

Detailed Description

Base class of all the PDE terms which decide where to refine or coarsen the mesh.

An adaptivity criterion is a PDE term which writes its decision into the output argument refinementCommand. It points to one exahype2::RefinementCommand, i.e. Keep, Refine or Erase (see exahype2/RefinementControl.h). The caller initialises it with Keep before the call, so an implementation only has to set it if it wants to refine or erase. In particular, the empty string as implementation yields a criterion which always keeps the mesh.

The subclasses differ in what they are handed:

  • exahype2.api.RefineErasePointwisely is handed the solution in one volume.
  • exahype2.api.GradientRefinement is handed a one-sided difference quotient of the solution along one coordinate axis.

Only if a solver has an adaptivity criterion do the numerical schemes and the setup evaluate it, i.e. add the action sets which collect refine and erase requests (exahype2.api.blockstructured.create_dynamic_mesh_refinement_action_set.create_dynamic_mesh_refinement_action_set()). A solver may have at most one adaptivity criterion.

The class itself defines no signature, i.e. you always add one of its subclasses to a solver.

Definition at line 8 of file AdaptivityCriterion.py.

Constructor & Destructor Documentation

◆ __init__()

exahype2.api.AdaptivityCriterion.AdaptivityCriterion.__init__ (   self,
str  name,
str   implementation = None,
bool   stateless = False 
)
Parameters
namestr The C++ method name of the criterion.
implementationstr A C++ snippet that becomes the method's body, or None (the default) to leave the method pure virtual for you to implement by hand. The empty string is a valid body: it leaves *refinementCommand untouched, i.e. at Keep.
statelessbool Generate a static, GPU-offloadable method instead of a virtual one. Requires an implementation.

Reimplemented from exahype2.api.PDETerm.PDETerm.

Reimplemented in exahype2.api.GradientRefinement.GradientRefinement, and exahype2.api.RefineErasePointwisely.RefineErasePointwisely.

Definition at line 39 of file AdaptivityCriterion.py.

References exahype2.api.AdaptivityCriterion.AdaptivityCriterion.__init__().

Referenced by exahype2.api.AdaptivityCriterion.AdaptivityCriterion.__init__().

Here is the call graph for this function:
Here is the caller graph for this function:

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