Peano
Loading...
Searching...
No Matches
acoustic.py
Go to the documentation of this file.
1
# This file is part of the ExaHyPE2 project. For conditions of distribution and
2
# use, please see the copyright notice at www.peano-framework.org
3
from
.equation
import
Equation
4
5
6
class
Acoustic
(
Equation
):
7
def
__init__
(self, dimensions, rho=1.0, K0=4.0):
8
self.
dimensions
= dimensions
9
self.
num_unknowns
= 3
if
dimensions == 2
else
4
10
self.
num_auxiliary_variables
= 0
11
self.
rho
= rho
12
self.
K0
= K0
13
self.
is_linear
=
True
14
15
def
eigenvalues
(self):
16
return
(
17
"""
18
const double c = std::sqrt("""
19
+ str(self.
K0
)
20
+
"/"
21
+ str(self.
rho
)
22
+
""");
23
return c;
24
"""
25
)
26
27
def
flux
(self):
28
return
(
29
"""
30
constexpr double K0 = """
31
+ str(self.
K0
)
32
+
""";
33
constexpr double inv_rho = 1.0 / """
34
+ str(self.
rho
)
35
+
""";
36
37
F[0] = K0 * Q[normal+1];
38
F[1] = 0.0;
39
F[2] = 0.0;
40
#if DIMENSIONS==3
41
F[3] = 0.0;
42
#endif
43
44
F[normal+1] = inv_rho * Q[0];
45
"""
46
)
equations.acoustic.Acoustic
Definition
acoustic.py:6
equations.acoustic.Acoustic.rho
rho
Definition
acoustic.py:11
equations.acoustic.Acoustic.__init__
__init__(self, dimensions, rho=1.0, K0=4.0)
Definition
acoustic.py:7
equations.acoustic.Acoustic.K0
K0
Definition
acoustic.py:12
equations.equation.Equation
Definition
equation.py:6
equations.equation.Equation.flux
flux()
Definition
equation.py:17
equations.equation.Equation.eigenvalues
eigenvalues()
Definition
equation.py:13
tests
exahype2
aderdg
equations
acoustic.py
Generated on
for Peano by
1.14.0