Peano
Loading...
Searching...
No Matches
Loh1_Transposed.h
Go to the documentation of this file.
1#ifndef EXASEIS_SCENARIOLOHONE_TRANSPOSED_HEADER
2#define EXASEIS_SCENARIOLOHONE_TRANSPOSED_HEADER
3#include "Scenario.h"
4
5template <class Shortcuts, int basisSize>
6class Loh1_Transposed: public Scenario<Shortcuts, basisSize> {
7private:
9
10public:
12 Scenario<Shortcuts, basisSize>(info) {
13 // place point source in center of topography 2km below surface
14 m_pointSourceLocation[0] = 2.0;
15 m_pointSourceLocation[1] = 0.0;
16 m_pointSourceLocation[2] = 0.0;
17 };
18
20 const double* const x,
22 const double t,
23 const double dt,
24 double* Q
25 ) {
26 Shortcuts s;
27
28#ifdef ISOTROPIC
29 if (x[0] <= (1.0 + 1.0e-6) && center[0] < 1.0) {
30 Q[s.rho] = 2.6;
31 Q[s.cp] = 4.0;
32 Q[s.cs] = 2.0;
33 } else if (x[0] >= (1.0 - 1.0e-6) && center[0] > 1.0) {
34 Q[s.rho] = 2.7;
35 Q[s.cp] = 6.0;
36 // Q[s.cs ] = 3.343;
37 Q[s.cs] = 3.464;
38 } else {
39 assertion3(false, "Point not initialised", x[0], center[0]);
40 }
41#elif defined ANISOTROPIC
42 assertion1(false, "Loh1_transposed Not implemented in the Anisotropic case");
43#else
44#error Whole space problem only defined for Isotropic and Anisotropic Scenario
45#endif // ISOTROPIC
46 }
47
48 void initPointSourceLocation(double pointSourceLocation[][3]) {
49 pointSourceLocation[0][0] = m_pointSourceLocation[0];
50 pointSourceLocation[0][1] = m_pointSourceLocation[1];
51 pointSourceLocation[0][2] = m_pointSourceLocation[2];
52 }
53
55 const double* const Q, const double* const x, const double t, const double dt, double* forceVector, int n
56 ) {
57
58 assertion2(n == 0, "Only a single pointSource for Loh1_transposed", n);
59
60 constexpr double t0 = 0.1;
61 constexpr double M0 = 1000.0;
62
63 double f = M0 * t / (t0 * t0) * std::exp(-t / t0);
64
65 Shortcuts s;
66 forceVector[s.sigma + 5] = f;
67 }
68
69 void refinementCriteria(std::vector<Refinement::RefinementCriterion<Shortcuts>*>& criteria) override {
70 Shortcuts s;
71
72 criteria.push_back(new Refinement::StaticAMR<Shortcuts>);
73// criteria.push_back(new Refinement::CoarseBoundaryLayer<Shortcuts>(
74// solver->getMaximumAdaptiveMeshLevel(),
75// solver->getCoarsestMeshLevel(),
76// solver->getCoarsestMeshSize(),
77// 0,
78// &(solver->getDomainSize()[0]),
79// &(solver->getDomainOffset()[0])
80// ));
81// #ifdef _CUSTOM_COORDINATES
82// criteria.push_back(new Refinement::RefineDownToPositionCustomCoordinates<Shortcuts>(
83// basisSize,
84// solver->getMaximumAdaptiveMeshLevel(),
85// m_pointSourceLocation,
86// 0,
87// static_cast<exahype::solvers::ADERDGSolver*>(solver)->FCoeff[basisSize - 1][0]
88// ));
89
90// #else
91// double left[3];
92// double right[3];
93
94// left[0] = -0.0;
95// left[1] = -3.0;
96// left[2] = -3.0;
97
98// right[0] = 3.0;
99// right[1] = 12.0;
100// right[2] = 12.0;
101
102// criteria.push_back(
103// new Refinement::RefineBetweenPositions<Shortcuts>(solver->getMaximumAdaptiveMeshLevel(), left, right)
104// );
105// #endif
106 };
107};
108#endif
#define assertion2(expr, param0, param1)
#define assertion3(expr, param0, param1, param2)
#define assertion1(expr, param)
double m_pointSourceLocation[3]
Loh1_Transposed(DomainInformation *info)
void setPointSourceVector(const double *const Q, const double *const x, const double t, const double dt, double *forceVector, int n)
void refinementCriteria(std::vector< Refinement::RefinementCriterion< Shortcuts > * > &criteria) override
void initUnknownsPointwise(const double *const x, const tarch::la::Vector< Dimensions, double > &center, const double t, const double dt, double *Q)
void initPointSourceLocation(double pointSourceLocation[][3])
DomainInformation * info
Definition Scenario.h:35
Simple vector class.
Definition Vector.h:159