Peano
Loading...
Searching...
No Matches
test_fv_volumetric_source.py
Go to the documentation of this file.
2
3
5 solver = exahype2.api.Solver("Probe", 2, 0)
6 solver.add_pde_term(exahype2.api.VolumetricSource(implementation="S[0] = t;"))
7 solver.add_pde_term(exahype2.api.MaxEigenvalue(implementation="*lambdaMax = 1.0;"))
8 solver.add_pde_term(exahype2.api.InitPointWisely(implementation="Q[0] = 0.0;"))
10 solver.numerical_scheme = scheme
11 # Normally set once the scheme constructs its output for a project
12 scheme.kernel_namespace = ["probe"]
13 return scheme
14
15
17 assert exahype2.api.VolumetricSource.SIGNATURE == (
18 "const double* __restrict__ Q, "
19 "const tarch::la::Vector<Dimensions, double>& x, "
20 "double t, "
21 "double* __restrict__ S"
22 )
23
24
27 call = scheme._RusanovWithOptimisticExplicitEuler__construct_kernel_call(
28 exahype2.api.Target.Serial, False
29 )
30 assert "repositories::instanceOfProbe.volumetricSource(Q, x, t, S);" in call
31
32
35 scheme._RusanovWithOptimisticExplicitEuler__create_time_step_functions(
36 str(tmp_path)
37 )
38 kernels = tmp_path / "kernels"
39 for name in [
40 "Probe_rusanov2d",
41 "Probe_rusanov3d",
42 "Probe_rusanov2d_patch_interior",
43 "Probe_rusanov2d_shell",
44 "Probe_rusanov3d_patch_interior",
45 "Probe_rusanov3d_shell",
46 ]:
47 header = (kernels / (name + ".h")).read_text()
48 assert (
49 "const ::exahype2::fv::rusanov::VolumetricSourceFunctor& volumetricSource"
50 in header
51 ), name
52 assert "volumetricSource(" in (kernels / (name + ".cpph")).read_text(), name
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.
Abstract base class for all ExaHyPE 2 solvers.
Definition Solver.py:17
The algebraic, volume-distributed source term S(Q) of a hyperbolic PDE - as opposed to PointSource,...
Finite Volumes with a Rusanov Riemann solver and optimistic explicit Euler time stepping,...