Peano
Loading...
Searching...
No Matches
exagrype.api.scalarfield.ScalarField.ScalarField Class Reference

Four scalar fields which a spacetime advects. More...

Inheritance diagram for exagrype.api.scalarfield.ScalarField.ScalarField:
Collaboration diagram for exagrype.api.scalarfield.ScalarField.ScalarField:

Public Member Functions

 __init__ (self, str name, exahype2.api.AuxiliaryVariables ccz4_fields)
Public Member Functions inherited from exahype2.api.Solver.Solver
 __init__ (self, str name, VariableSpecification unknowns)
 Create solver.
str __str__ (self)
str name (self)
 Unique solver name.
"Solver.NumericalScheme" numerical_scheme (self)
 numerical_scheme (self, "Solver.NumericalScheme" value)
List["Solver.Plotter"] plotters (self)
 All plotters of the solver, in the order they have been added.
 add_plotter (self, "Solver.Plotter" plotter)
 Add a plotter to the solver.
"Solver.Plotter" plotter (self)
 Shorthand for solvers with at most one plotter.
 plotter (self, "Solver.Plotter" value)
int unknowns (self)
List["AuxiliaryVariables"] auxiliary_variables (self)
 All sets of auxiliary variables in the order they have been attached.
int number_of_auxiliary_variables (self)
 Total number of entries of all sets of auxiliary variables.
int auxiliary_variable_offset (self, "AuxiliaryVariables" auxiliary)
 Offset of the first entry of a set within the buffer the compute kernels work on, i.e.
 add_auxiliary_variables (self, "AuxiliaryVariables" auxiliary)
 Attach a set of auxiliary variables to the solver.
str signature_of (self, PDETerm term)
 The signature of a PDE term including the pointers to the auxiliary variables.
str user_solver_includes (self)
 Add further includes to this property, if your solver requires some additional routines from other header files.
 add_user_solver_includes (self, str value)
 Add further includes to this property, if your solver requires some additional routines from other header files.
 set_solver_constants (self, str datastring)
 add_solver_constants (self, str datastring)
List[str] variable_names_per_entry (self)
 One name per entry of Q, i.e.
str get_name_of_global_instance (self)
List[PDETerm] pde_terms (self)
 All PDE terms (flux, eigenvalues, ...) registered with this solver, in registration order.
bool requires_user_class (self)
 True iff at least one PDE term has no implementation.
str get_name_of_solver_class (self)
 Name of the C++ class the solver repository instantiates: <SolverName> if requires_user_class, Abstract<SolverName> otherwise.
 add_pde_term (self, PDETerm term)
 Register a PDE term with this solver, or replace the one already registered under the same name and statelessness.
 remove_pde_term (self, str name, bool stateless=False)
 Remove a previously registered PDE term by name and statelessness.
PDETerm get_pde_term (self, str name, bool stateless=False)
 Look up a previously registered PDE term by name and statelessness.
 add_abstract_solver_attribute (self, str declaration)
 Add a raw C++ member attribute declaration to the generated Abstract<SolverName> class (.
 add_abstract_solver_method (self, str declaration, Callable[[str], str] definition_generator)
 Add a raw C++ method to the generated Abstract<SolverName> class: declaration goes into the class body (public section), verbatim.
str create_readme_descriptor (self, domain_offset, domain_size)
 Return a human-readable description of this solver instance, to be embedded into the generated project's README.
 generate_solver_realisation (self, exahype2_project, peano_project, setup_simulation, time_step, plot, mesh_adaptation, add_global_tasks=True)
 Turn this solver specification into a task graph and create the required C++ kernels/stubs.

Static Public Attributes

dict Unknowns = {"phi": 4}
Static Public Attributes inherited from exahype2.api.Solver.Solver
str SolutionUpdateTaskTag = "exahype2.api.Solver.SolutionUpdateTaskTag"
 Tag of all tasks which write a new solution.
str IntermediateSolutionUpdateTag = "exahype2.api.Solver.IntermediateSolutionUpdateTag"
 Tag of all tasks which write an intermediate solution.

Additional Inherited Members

Data Fields inherited from exahype2.api.Solver.Solver
 solver_generator = SolverToCPPFiles(self)
 grid_construction = None
tuple mesh_adaptation = None
 Turn this solver specification into a task graph and create the required C++ kernels/stubs.
tuple grid_selector
str compute_kernel_call = None
 pde_terms
 True iff at least one PDE term has no implementation.
Protected Member Functions inherited from exahype2.api.Solver.Solver
int _register_variables (self, VariableSpecification variables, int offset)
 Translate a plain int or a name-to-multiplicity dict into a total variable count, and - for the dict case - add each name's position within Q to _variable_positions.
str _get_default_includes (self)
 Includes every generated action set can rely on being available, regardless of which action sets a concrete discretisation (e.g.
str _unknown_identifier (self)
 _add_wants_to_plot_to_solver (self)
 Add wantsToPlot() to the solver's C++ class: It holds if any of the solver's plotters is active (exahype2.api.Solver.Solver.Plotter).
 _add_checkpoint_meta_data_to_solver (self)
 Override exahype2.Solver.toCheckpointMetaData() in the solver's C++ class such that it also writes the attributes added through add_abstract_solver_attribute(), e.g.
Protected Attributes inherited from exahype2.api.Solver.Solver
str _name = name
 Create solver.
dict _variable_positions = {}
 Translate a plain int or a name-to-multiplicity dict into a total variable count, and - for the dict case - add each name's position within Q to _variable_positions.
int _unknowns = self._register_variables(unknowns, 0)
list _auxiliary_variables = []
 All sets of auxiliary variables in the order they have been attached.
str _user_solver_includes = ""
str _solver_constants = ""
dict _pde_terms = {}
list _abstract_solver_attributes = []
list _abstract_solver_methods = []
 _numerical_scheme = None
list _plotters = []
 Turn this solver specification into a task graph and create the required C++ kernels/stubs.

Detailed Description

Four scalar fields which a spacetime advects.

The solver has four unknowns phi_0, ..., phi_3. They obey the advection equation

\( \\partial_t \\phi + v \\partial_x \\phi = 0, \\qquad v = \\alpha^2, \)

along the x-axis, where \( \\alpha \) is the lapse of first-order CCZ4. The lapse enters through a set of auxiliary variables, which holds the 58 entries of CCZ4 (exagrype.api.FOCCZ4Solver). A coupling creates the set, fills it, and hands it over to the constructor. The coupling is a fake coupling: the spacetime advects the field, but the field does not feed back into the spacetime. The velocity is the metric component g_xx of the gauge wave, i.e. the equation has a closed-form solution on the gauge wave (benchmarks/exagrype/gauge-wave-with-scalar-field).

The PDE terms are a non-conservative product, a maximum eigenvalue and an initial condition (four sine waves along the x-axis with phase shifts). All of them are stateless and call exagrype.scalarfield.nonconservativeProduct() and friends. The solver has no flux: the advective form is what the exact solution refers to.

The solver is deliberately plain. Its numerical scheme is assigned like for any other solver (outer coupling), or by the coupling (inner coupling).

Definition at line 10 of file ScalarField.py.

Constructor & Destructor Documentation

◆ __init__()

exagrype.api.scalarfield.ScalarField.ScalarField.__init__ ( self,
str name,
exahype2.api.AuxiliaryVariables ccz4_fields )
Parameters
namestr Name of the solver, exahype2.api.Solver.
ccz4_fieldsexahype2.api.AuxiliaryVariables The set which holds the 58 entries of first-order CCZ4. The solver attaches it. The coupling fills it.

Definition at line 42 of file ScalarField.py.

References __init__(), exagrype.api.euler.Euler.Euler.add_auxiliary_variables(), exahype2.api.Solver.Solver.add_auxiliary_variables(), exahype2.api.Solver.Solver.add_pde_term(), exahype2.api.Solver.Solver.add_user_solver_includes(), exagrype.api.euler.Euler.Euler.Unknowns, exagrype.api.FOCCZ4Solver.FOCCZ4Solver.Unknowns, exagrype.api.FOSOCCZ4Solver.FOSOCCZ4Solver.Unknowns, and Unknowns.

Referenced by __init__().

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

Field Documentation

◆ Unknowns

dict exagrype.api.scalarfield.ScalarField.ScalarField.Unknowns = {"phi": 4}
static

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