Peano
Loading...
Searching...
No Matches
LOH1.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
3from .Scenario import Scenario
4
5import os
6
8 """
9 Part of a series of benchmarks by the SeISmic MOdeling Web INterfacE (Sismowine)
10
11 Single point-source in a domain composed of two homogeneous media
12 stacked atop one another.
13 Purpose: Assess the precision of modeling a planar free surface and planar internal interface.
14
15 The description of the scenario can be found at: https://sismowine.org/model/WP2_LOH1.pdf
16 """
17
18 domain_offset = [-2.025, 0.0, -2.025]
19 domain_size = [12.15, 12.15, 12.15]
20
21 end_time = 10.0
22
23 tracer_coordinates = [
24 [0.000, 0., 0.693], [0.000, 0., 5.543], [0.000, 0., 10.392],
25 [0.490, 0., 0.490], [3.919, 0., 3.919], [7.348, 0., 7.3480],
26 [0.577, 0., 0.384], [4.612, 0., 3.075], [8.647, 0., 5.7640]
27 ]
28
30 return """
31 if( x[1] <= (1.0 + 1.0e-6) && center[1] < 1.0) {
32 Q[Shortcuts::rho] = 2.6;
33 Q[Shortcuts::cp ] = 4.0;
34 Q[Shortcuts::cs ] = 2.0;
35 }else if(x[1] >= (1.0 - 1.0e-6) && center[1] > 1.0){
36 Q[Shortcuts::rho] = 2.7;
37 Q[Shortcuts::cp ] = 6.0;
38 Q[Shortcuts::cs ] = 3.464;
39 }
40"""
41
42 def point_source(self):
43 return """
44 std::fill_n(forceVector, 9, 0.);
45
46 auto jacobian = Q[Shortcuts::jacobian];
47
48 assertion2(n == 0, "Only a single pointSource for LOH1",n);
49
50 constexpr double t0 = 0.1;
51 constexpr double M0 = 1000.0;
52
53 double f = M0*t/(t0*t0)*std::exp(-t/t0);
54
55 forceVector[Shortcuts::sigma + 4] = f;
56
57 for (int i = 0; i < NumberOfUnknowns; i++) {
58 forceVector[i] = forceVector[i] / jacobian;
59 }
60"""
62 return """
63 pointSourceLocation[0][0] = 0.0;
64 pointSourceLocation[0][1] = 2.0;
65 pointSourceLocation[0][2] = 0.0;
66
67 context->correctPointSourceLocation(pointSourceLocation);
68"""
69
70 def generate_required_files(self, order):
71
72 dictionary = { "MODE": order+1 }
74 os.path.dirname(os.path.realpath(__file__))+"/specs/LOH1/loh1.yaml.template",
75 "loh1.yaml", dictionary
76 )
77
78 return
Part of a series of benchmarks by the SeISmic MOdeling Web INterfacE (Sismowine)
Definition LOH1.py:7
point_source(self)
Definition LOH1.py:42
generate_required_files(self, order)
Definition LOH1.py:70
initial_conditions(self)
Definition LOH1.py:29
init_point_source(self)
Definition LOH1.py:61
generate_file_from_template(self, template_file, full_qualified_filename, dictionary)
Definition Scenario.py:21