Peano
advection_linear.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
Advection
10
11
12
class
AdvectionLinear
(
Scenario
):
13
"""
14
Very simple scenario in which the initial value of x is shifted
15
in each spatial dimension.
16
"""
17
18
_plot_dt = 0.1
19
_periodic_bc =
False
20
21
def
__init__
(self, dimensions=2):
22
self.
_dimensions
_dimensions
_dimensions = dimensions
23
self.
_equation
_equation
_equation =
Advection
(dimensions=dimensions)
24
25
def
initial_conditions
(self):
26
return
"""
27
Q[0] = x[0];
28
Q[1] = x[1];
29
#if DIMENSIONS==3
30
Q[2] = x[2];
31
#endif
32
"""
33
34
def
boundary_conditions
(self):
35
return
"""
36
Qoutside[0] = x[0] - t;
37
Qoutside[1] = x[1] - t;
38
#if DIMENSIONS==3
39
Qoutside[2] = x[2] - t;
40
#endif
41
"""
equations.advection.Advection
Definition:
advection.py:6
scenarios.advection_linear.AdvectionLinear
Very simple scenario in which the initial value of x is shifted in each spatial dimension.
Definition:
advection_linear.py:12
scenarios.advection_linear.AdvectionLinear._equation
_equation
Definition:
advection_linear.py:23
scenarios.advection_linear.AdvectionLinear.initial_conditions
def initial_conditions(self)
Definition:
advection_linear.py:25
scenarios.advection_linear.AdvectionLinear.__init__
def __init__(self, dimensions=2)
Definition:
advection_linear.py:21
scenarios.advection_linear.AdvectionLinear.boundary_conditions
def boundary_conditions(self)
Definition:
advection_linear.py:34
scenarios.advection_linear.AdvectionLinear._dimensions
_dimensions
Definition:
advection_linear.py:22
scenarios.scenario.Scenario
Definition:
scenario.py:6
scenarios.scenario.Scenario._equation
_equation
Definition:
scenario.py:7
scenarios.scenario.Scenario._dimensions
int _dimensions
Definition:
scenario.py:8
tests
exahype2
aderdg
scenarios
advection_linear.py
Generated by
1.9.1