Peano
Toggle main menu visibility
Main Page
Related Pages
Packages
Package List
Package Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
b
c
d
e
f
g
i
l
m
n
p
r
s
t
u
v
Enumerations
Enumerator
Concepts
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
b
c
d
f
g
h
i
l
m
n
o
p
r
s
t
u
v
Enumerations
a
e
i
k
m
o
p
r
s
t
Enumerator
Related Symbols
b
c
d
e
i
m
o
p
r
s
t
v
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
w
Variables
_
a
b
c
d
e
f
g
h
i
k
m
n
o
p
r
s
t
u
v
w
x
Typedefs
Enumerations
Enumerator
Macros
_
a
c
d
e
f
g
h
i
k
l
m
n
o
p
q
s
t
u
v
w
z
▼
Peano
Content
History
►
Installation
►
Vendor Software Stacks and System- and Compiler-specific Settings
►
Optional Third-party Tools and Libraries
►
Architecture
►
FAQs and Troubleshooting (User Perspective)
►
Coding Conventions and IDEs
Version Control (Git)
►
Documentation (Doxygen)
Continuous Integration (CI)
►
Tutorials Overview
►
Peano 4
►
Toolbox
►
ExaHyPE 2
►
MGHyPE
►
Swift 2
►
DaStGen
►
Technical Architecture (tarch)
Todo List
►
Packages
►
Concepts
►
Data Structures
▼
Files
▼
File List
►
applications
apptainer
►
benchmarks
docker
►
documentation
►
python
►
spack
►
src
▼
tests
▼
exahype2
▼
aderdg
►
equations
▼
scenarios
__init__.py
►
acoustic_planar_waves.py
►
advection_linear.py
►
elastic_planar_waves.py
►
euler_gaussian_bell.py
►
euler_isotropic_vortex.py
►
scenario.py
►
swe_radial_dam_break.py
►
swe_resting_lake.py
►
aderdg.py
►
aderdg-amr-swe
►
aderdg-limiting-euler-airfoil
►
aderdg-limiting-posteriori
►
aderdg-limiting-static
►
multigrid
►
swift2
►
tutorials
►
Globals
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Concepts
Loading...
Searching...
No Matches
swe_resting_lake.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
.scenario
import
Scenario
4
5
import
os
6
import
sys
7
8
sys.path.insert(0, os.path.abspath(
"../equations"
))
9
from
equations
import
SWE_W_Bathymetry
10
11
_initial_conditions = {
12
"bilinear"
:
"""
13
Q[1] = 0.0;
14
Q[2] = 0.0;
15
Q[3] = 1.0 - std::abs(x[0]) - std::abs(x[1]);
16
Q[0] = 2.0 - Q[3];
17
"""
,
18
"sinusoidal"
:
"""
19
Q[1] = 0.0;
20
Q[2] = 0.0;
21
Q[3] = sin( 2*M_PI * (x[0]+x[1]) );
22
Q[0] = 2.0 - Q[3];
23
"""
,
24
"constant"
:
"""
25
Q[1] = 0.0;
26
Q[2] = 0.0;
27
Q[3] = 1.0;
28
Q[0] = 2.0 - Q[3];
29
"""
,
30
}
31
32
33
class
SWERestingLake
(
Scenario
):
34
"""
35
Resting lake scenario for the shallow water equations.
36
The real water height H as defined by the sum of the water column h and
37
the bathymetry b is constant over the entire domain, meaning that there
38
should be no changes on the entire domain, but because we use the sum of
39
the derivatives of h and b (h' + b') instead of the derivative of the sum
40
(h + b)' some rounding errors will creep in, which causes unphysical
41
waves to appear.
42
As such this scenario is nice for testing how large these unphysical waves
43
are for a given algorithm, and how stable the algorithm is, i.e. does it
44
dampen out these waves or do they oscillate out of control.
45
"""
46
47
_plot_dt = 0.0
48
_offset = -0.5
49
_domain_size = 1.0
50
_periodic_bc =
True
51
_dimensions = 2
52
_equation =
SWE_W_Bathymetry
()
53
_end_time = 1.0
54
55
def
__init__
(
56
self,
57
initial_conditions="sinusoidal",
58
):
59
self.
_init
= _initial_conditions[initial_conditions]
60
55
def
__init__
(
…
61
def
initial_conditions
(self):
62
return
self.
_init
63
61
def
initial_conditions
(self):
…
64
def
analytical_solution
(self):
65
return
"""
66
double _Q[4];
67
initialCondition(
68
_Q,
69
x,
70
tarch::la::Vector<Dimensions, double>(),
71
true
72
);
73
74
solution[0] = _Q[0];
75
solution[1] = _Q[1];
76
solution[2] = _Q[2];
77
solution[3] = _Q[3];
78
"""
64
def
analytical_solution
(self):
…
33
class
SWERestingLake
(
Scenario
):
…
equations.swe.SWE_W_Bathymetry
Definition
swe.py:6
scenarios.scenario.Scenario
Definition
scenario.py:6
scenarios.swe_resting_lake.SWERestingLake
Resting lake scenario for the shallow water equations.
Definition
swe_resting_lake.py:33
scenarios.swe_resting_lake.SWERestingLake.analytical_solution
analytical_solution(self)
Definition
swe_resting_lake.py:64
scenarios.swe_resting_lake.SWERestingLake.initial_conditions
initial_conditions(self)
Definition
swe_resting_lake.py:61
scenarios.swe_resting_lake.SWERestingLake._init
_init
Definition
swe_resting_lake.py:59
scenarios.swe_resting_lake.SWERestingLake.__init__
__init__(self, initial_conditions="sinusoidal")
Definition
swe_resting_lake.py:58
tests
exahype2
aderdg
scenarios
swe_resting_lake.py
Generated on Thu Mar 6 2025 23:03:40 for Peano by
1.10.0