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 
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 
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 """
Very simple scenario in which the initial value of x is shifted in each spatial dimension.