Peano
Loading...
Searching...
No Matches
exahype2.api.AuxiliaryVariables Namespace Reference

Data Structures

class  AuxiliaryVariables
 A set of auxiliary variables of a solver. More...
 

Functions

List[str] split_signature (str signature)
 Split a C++ parameter list at the commas that are not within template brackets.
 
str extend_signature (str signature, solver)
 Add the pointers to the auxiliary variables of a solver to a PDE term's signature.
 
List[str] forwarding_arguments (str signature, solver)
 Arguments to call the version of a PDE term with auxiliary variables from a caller that holds the original signature.
 
 register_auxiliary_variables (solver, peano_project, int patch_size, int overlap)
 Create and register the data of all auxiliary variables of a solver.
 
 add_reconstruction_of_auxiliary_variables (task, solver)
 Make a reconstruction task of a solver fill the halos of the solver's auxiliary variables.
 
 use_halos_of_auxiliary_variables (task, solver)
 Let a task (typically the update of the cells) read the halos of the auxiliary variables.
 
str volumes_expression (int patch_size, int halo)
 C++ expression for the number of volumes of a patch with halo.
 
str code_to_assemble_kernel_input (solver, str buffer, str unknowns, int halo_size, parameters_of=None)
 C++ code which assembles the input buffer of the compute kernels.
 
str code_to_allocate_kernel_output (solver, str buffer)
 C++ code which defines the output buffer (a std::vector<double>) of the compute kernels.
 
str code_to_copy_back_kernel_output (solver, str buffer, str unknowns)
 C++ code which copies the unknowns of the output buffer back into the patch.
 
 add_auxiliary_variables_to_setup (solver, initial_condition_task, project_on_faces_task, project_patch_onto_faces, roll_over_updated_face)
 Let the setup of a solver write its auxiliary variables.
 

Function Documentation

◆ add_auxiliary_variables_to_setup()

exahype2.api.AuxiliaryVariables.add_auxiliary_variables_to_setup (   solver,
  initial_condition_task,
  project_on_faces_task,
  project_patch_onto_faces,
  roll_over_updated_face 
)

Let the setup of a solver write its auxiliary variables.

Auxiliary variables are written once, by their owner: the owner initialises them in its initial condition task and projects them onto the faces, so the halos can be reconstructed later on. A solver that merely shares a set reads it after the owner has written it.

Parameters
project_patch_onto_facesclass The action set that projects a patch onto the faces (exahype2.api.fv.actionsets.ProjectPatchOntoFaces).
roll_over_updated_faceclass The action set that rolls the projection over (exahype2.api.fv.actionsets.RollOverUpdatedFace).

Definition at line 453 of file AuxiliaryVariables.py.

◆ add_reconstruction_of_auxiliary_variables()

exahype2.api.AuxiliaryVariables.add_reconstruction_of_auxiliary_variables (   task,
  solver 
)

Make a reconstruction task of a solver fill the halos of the solver's auxiliary variables.

Parameters
taskpeano4.api.taskgraph.Task The task which also reconstructs the unknowns.

Definition at line 342 of file AuxiliaryVariables.py.

◆ code_to_allocate_kernel_output()

str exahype2.api.AuxiliaryVariables.code_to_allocate_kernel_output (   solver,
str  buffer 
)

C++ code which defines the output buffer (a std::vector<double>) of the compute kernels.

Definition at line 427 of file AuxiliaryVariables.py.

References exahype2.api.AuxiliaryVariables.volumes_expression().

Here is the call graph for this function:

◆ code_to_assemble_kernel_input()

str exahype2.api.AuxiliaryVariables.code_to_assemble_kernel_input (   solver,
str  buffer,
str  unknowns,
int  halo_size,
  parameters_of = None 
)

C++ code which assembles the input buffer of the compute kernels.

The kernels work on one buffer that holds the unknowns of a volume followed by the entries of all sets of auxiliary variables. The code defines a std::vector<double> named buffer. It is empty if the solver has no auxiliary variables.

Parameters
unknownsstr C++ expression for the unknowns of the patch with halo.
parameters_offunction Maps a set onto the C++ expression of its patch with halo. Defaults to the halo patches of the solver.

Definition at line 385 of file AuxiliaryVariables.py.

References exahype2.api.AuxiliaryVariables.volumes_expression().

Here is the call graph for this function:

◆ code_to_copy_back_kernel_output()

str exahype2.api.AuxiliaryVariables.code_to_copy_back_kernel_output (   solver,
str  buffer,
str  unknowns 
)

C++ code which copies the unknowns of the output buffer back into the patch.

Definition at line 439 of file AuxiliaryVariables.py.

◆ extend_signature()

str exahype2.api.AuxiliaryVariables.extend_signature ( str  signature,
  solver 
)

Add the pointers to the auxiliary variables of a solver to a PDE term's signature.

Each argument named Q is followed by one pointer per set, each argument named deltaQ is followed by one pointer to the jump of each set. The pointers are non-const iff Q is non-const (the initial condition) and the solver owns the set.

Parameters
signaturestr The signature without auxiliary variables
solverexahype2.api.Solver

Definition at line 258 of file AuxiliaryVariables.py.

References exahype2.api.AuxiliaryVariables.split_signature().

Here is the call graph for this function:

◆ forwarding_arguments()

List[str] exahype2.api.AuxiliaryVariables.forwarding_arguments ( str  signature,
  solver 
)

Arguments to call the version of a PDE term with auxiliary variables from a caller that holds the original signature.

The caller's Q (and deltaQ) points to a volume in a buffer which hosts the unknowns followed by the entries of all auxiliary variables (the layout the compute kernels work on). The auxiliary variables are slices of this buffer.

Definition at line 293 of file AuxiliaryVariables.py.

References exahype2.api.AuxiliaryVariables.split_signature().

Here is the call graph for this function:

◆ register_auxiliary_variables()

exahype2.api.AuxiliaryVariables.register_auxiliary_variables (   solver,
  peano_project,
int  patch_size,
int  overlap 
)

Create and register the data of all auxiliary variables of a solver.

The persistent data of a set (its patch and the face overlaps) exists only once, even if several solvers share it. Each solver gets its own temporary patch with halo per set (solver._auxiliary_variable_halos, a dict from the name of the set to the patch), so concurrently running solvers do not overwrite each other's halos.

Definition at line 315 of file AuxiliaryVariables.py.

◆ split_signature()

List[str] exahype2.api.AuxiliaryVariables.split_signature ( str  signature)

Split a C++ parameter list at the commas that are not within template brackets.

Definition at line 249 of file AuxiliaryVariables.py.

Referenced by exahype2.api.AuxiliaryVariables.extend_signature(), and exahype2.api.AuxiliaryVariables.forwarding_arguments().

Here is the caller graph for this function:

◆ use_halos_of_auxiliary_variables()

exahype2.api.AuxiliaryVariables.use_halos_of_auxiliary_variables (   task,
  solver 
)

Let a task (typically the update of the cells) read the halos of the auxiliary variables.

Definition at line 370 of file AuxiliaryVariables.py.

◆ volumes_expression()

str exahype2.api.AuxiliaryVariables.volumes_expression ( int  patch_size,
int  halo 
)

C++ expression for the number of volumes of a patch with halo.

Definition at line 379 of file AuxiliaryVariables.py.

Referenced by exahype2.api.AuxiliaryVariables.code_to_allocate_kernel_output(), and exahype2.api.AuxiliaryVariables.code_to_assemble_kernel_input().

Here is the caller graph for this function: