1""" This file is part of the ExaGRyPE project. For conditions of distribution and
2 use, please see the copyright notice at www.peano-framework.org
7from ..FOCCZ4Solver
import FOCCZ4Solver
13 Four scalar fields which a spacetime advects
15 The solver has four unknowns phi_0, ..., phi_3. They obey the advection equation
17 @f$ \\partial_t \\phi + v \\partial_x \\phi = 0, \\qquad v = \\alpha^2, @f$
19 along the x-axis, where @f$ \\alpha @f$ is the lapse of first-order CCZ4. The
20 lapse enters through a set of auxiliary variables, which holds the 58
21 entries of CCZ4 (@ref exagrype.api.FOCCZ4Solver). A coupling creates the
22 set, fills it, and hands it over to the constructor. The coupling is a
23 fake coupling: the spacetime advects the field, but the field does not
24 feed back into the spacetime. The velocity is the metric component g_xx
25 of the gauge wave, i.e. the equation has a closed-form solution on the
26 gauge wave (@ref benchmarks/exagrype/gauge-wave-with-scalar-field).
28 The PDE terms are a non-conservative product, a maximum eigenvalue and an
29 initial condition (four sine waves along the x-axis with phase shifts). All of them
30 are stateless and call @ref exagrype::scalarfield::nonconservativeProduct()
31 and friends. The solver has no flux: the advective form is what the exact
34 The solver is deliberately plain. Its numerical scheme is assigned like for any
35 other solver (outer coupling), or by the coupling (inner coupling).
40 """! The four advected fields """
46 Name of the solver, @ref exahype2.api.Solver.
48 @param ccz4_fields: exahype2.api.AuxiliaryVariables
49 The set which holds the 58 entries of first-order CCZ4. The solver
50 attaches it. The coupling fills it.
53 if ccz4_fields.size != sum(FOCCZ4Solver.Unknowns.values()):
55 f
"Solver {name}: the auxiliary set has to hold the "
56 f
"{sum(FOCCZ4Solver.Unknowns.values())} entries of first-order CCZ4, "
57 f
"but holds {ccz4_fields.size}"
62 fields = ccz4_fields.argument_name
65 implementation=f
"::exagrype::scalarfield::nonconservativeProduct({fields}, deltaQ, normal, BTimesDeltaQ);",
71 implementation=f
"*lambdaMax = ::exagrype::scalarfield::maxEigenvalue({fields}, normal);",
77 implementation=f
"::exagrype::scalarfield::initialValues(Q, {fields}, x);"
Four scalar fields which a spacetime advects.
__init__(self, str name, exahype2.api.AuxiliaryVariables ccz4_fields)
A set of auxiliary variables of a solver.
Point-wise initial condition: given the physical position of a single degree of freedom,...
The maximum absolute eigenvalue of the flux Jacobian in a given direction, i.e.
The non-conservative product B(Q) applied to a jump deltaQ in a given direction, i....
Abstract base class for all ExaHyPE 2 solvers.
add_pde_term(self, PDETerm term)
Register a PDE term with this solver, or replace the one already registered under the same name and s...
add_user_solver_includes(self, str value)
Add further includes to this property, if your solver requires some additional routines from other he...
add_auxiliary_variables(self, "AuxiliaryVariables" auxiliary)
Attach a set of auxiliary variables to the solver.