Peano
Loading...
Searching...
No Matches
exahype2.api.blockstructured.BoundaryConditions Namespace Reference

Decide which boundary treatment a solver's numerical scheme has to generate. More...

Functions

bool has_domain_boundary (exahype2_project)
 Does the domain have a boundary, i.e.
 
 get_access_to_persistent_face_data (solver, exahype2_project, default)
 Access qualifier of the persistent face data for a task of the time step.
 
 get_boundary_conditions (solver, exahype2_project)
 The solver's boundary condition term, or None if the domain has no boundary.
 

Variables

tuple BOUNDARY_CONDITION_TERMS = (DirichletBoundaryConditions, SommerfeldBoundaryConditions)
 

Detailed Description

Decide which boundary treatment a solver's numerical scheme has to generate.

All numerical schemes evaluate the same two helpers: has_domain_boundary() tells whether the domain has a boundary at all, i.e. whether at least one axis is not periodic. get_boundary_conditions() returns the solver's boundary condition term and checks that the solver's PDE terms are consistent with the domain:

  • If all axes are periodic, the domain has no boundary. The schemes then generate no boundary treatment at all, and the solver must not hold a boundary condition term.
  • Otherwise, the solver has to hold exactly one boundary condition term, i.e. either an exahype2.api.DirichletBoundaryConditions or an exahype2.api.SommerfeldBoundaryConditions term.

Function Documentation

◆ get_access_to_persistent_face_data()

exahype2.api.blockstructured.BoundaryConditions.get_access_to_persistent_face_data (   solver,
  exahype2_project,
  default 
)

Access qualifier of the persistent face data for a task of the time step.

Sommerfeld boundary conditions advance the ghost cells within the roll over of the projection onto the faces, and they read the old face data there (exahype2::blockstructured::applySommerfeldBoundaryConditions()). The face data hence has to survive the reconstruction of the halo, and the projection has to load it: peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag only stores data after tasks which write it, and only loads it before tasks which read it. With Sommerfeld boundary conditions, all tasks of the time step which use the persistent face data therefore have to declare READ_AND_WRITE.

Parameters
solverexahype2.api.Solver
exahype2_projectexahype2.api.Project
defaultpeano4.api.taskgraph.Task.DataAccess The qualifier the task uses without Sommerfeld boundary conditions, typically READ_AND_DISCARD for the reconstruction and WRITE for the projection.
Returns
peano4.api.taskgraph.Task.DataAccess

Definition at line 44 of file BoundaryConditions.py.

◆ get_boundary_conditions()

exahype2.api.blockstructured.BoundaryConditions.get_boundary_conditions (   solver,
  exahype2_project 
)

The solver's boundary condition term, or None if the domain has no boundary.

Parameters
solverexahype2.api.Solver The solver whose PDE terms are checked.
exahype2_projectexahype2.api.Project Provides the periodic boundary conditions (periodic_BC).
Returns
exahype2.api.DirichletBoundaryConditions, exahype2.api.SommerfeldBoundaryConditions or None None if and only if all axes are periodic.
Exceptions
ValueErrorIf all axes are periodic and the solver holds a boundary condition term, if at least one axis is not periodic and the solver holds no or more than one boundary condition term, if the term is stateless, or if the solver holds a SommerfeldBoundaryConditions term but no non-stateless MaxEigenvalue term.

Definition at line 81 of file BoundaryConditions.py.

References exahype2.api.blockstructured.BoundaryConditions.has_domain_boundary().

Referenced by test_boundary_conditions.test_get_boundary_conditions_rejects_inconsistent_terms().

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

◆ has_domain_boundary()

bool exahype2.api.blockstructured.BoundaryConditions.has_domain_boundary (   exahype2_project)

Does the domain have a boundary, i.e.

is at least one axis not periodic?

Parameters
exahype2_projectexahype2.api.Project Provides the periodic boundary conditions (periodic_BC).
Returns
bool False if and only if all axes are periodic.

Definition at line 29 of file BoundaryConditions.py.

Referenced by exahype2.api.blockstructured.BoundaryConditions.get_boundary_conditions().

Here is the caller graph for this function:

Variable Documentation

◆ BOUNDARY_CONDITION_TERMS

tuple exahype2.api.blockstructured.BoundaryConditions.BOUNDARY_CONDITION_TERMS = (DirichletBoundaryConditions, SommerfeldBoundaryConditions)

Definition at line 26 of file BoundaryConditions.py.