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