Peano
Loading...
Searching...
No Matches
Loh1.h
Go to the documentation of this file.
1#ifndef EXASEIS_SCENARIOLOHONE_HEADER
2#define EXASEIS_SCENARIOLOHONE_HEADER
3#include "Scenario.h"
4
5template <class Shortcuts, int basisSize>
6class Loh1 : public Scenario<Shortcuts, basisSize>{
7 private:
9
10 public:
11
12 Loh1(DomainInformation* info):Scenario<Shortcuts,basisSize>(info){
13 //place point source in center of topography 2km below surface
14 m_pointSourceLocation[0] = 0.0;
15 m_pointSourceLocation[1] = 2.0;
16 m_pointSourceLocation[2] = 0.0;
17 };
18
19
20 void initUnknownsPointwise(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[1] <= (1.0 + 1.0e-6) && center[1] < 1.0) {
30 Q[s.rho] = 2.6;
31 Q[s.cp ] = 4.0;
32 Q[s.cs ] = 2.0;
33 }else if(x[1] >= (1.0 - 1.0e-6) && center[1] > 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 }
39#elif defined ANISOTROPIC
40 assertion1(false,"Loh1 Not implemented in the Anisotropic case" );
41#else
42#error Whole space problem only defined for Isotropic and Anisotropic Scenario
43#endif
44
45 }
46 void initPointSourceLocation(double pointSourceLocation[][3]){
47 pointSourceLocation[0][0]=m_pointSourceLocation[0];
48 pointSourceLocation[0][1]=m_pointSourceLocation[1];
49 pointSourceLocation[0][2]=m_pointSourceLocation[2];
50 }
51
52 void setPointSourceVector(const double* const Q,
53 const double* const x,const double t,const double dt,
54 double* forceVector, int n){
55
56 assertion2(n == 0, "Only a single pointSource for Loh1",n);
57
58
59 constexpr double t0 = 0.1;
60 constexpr double M0 = 1000.0;
61
62 double f = M0*t/(t0*t0)*std::exp(-t/t0);
63
64 Shortcuts s;
65 forceVector[s.sigma + 4] = f;
66 }
67
68 void refinementCriteria(std::vector<Refinement::RefinementCriterion<Shortcuts>*>& criteria) override{
69 criteria.push_back(new Refinement::StaticAMR<Shortcuts>);
70 /* criteria.push_back(new Refinement::CoarseBoundaryLayer<Shortcuts>(
71 solver->getMaximumAdaptiveMeshLevel(),
72 solver->getCoarsestMeshLevel(),
73 solver->getCoarsestMeshSize(),
74 1,
75 &(solver->getDomainSize()[0]),
76 &(solver->getDomainOffset()[0])));*/
77 double lower[3];
78 double upper[3];
79
80 // criteria.push_back(
81 // new Refinement::RefineDownToPosition<Shortcuts>(
82 // basisSize,
83 // solver->getMaximumAdaptiveMeshLevel(),
84 // m_pointSourceLocation,
85 // 1
86 // )
87 // );
88
89 }
90};
91#endif
#define assertion2(expr, param0, param1)
#define assertion1(expr, param)
Definition Loh1.h:6
void refinementCriteria(std::vector< Refinement::RefinementCriterion< Shortcuts > * > &criteria) override
Definition Loh1.h:68
void initUnknownsPointwise(const double *const x, const tarch::la::Vector< Dimensions, double > &center, const double t, const double dt, double *Q)
Definition Loh1.h:20
void initPointSourceLocation(double pointSourceLocation[][3])
Definition Loh1.h:46
double m_pointSourceLocation[3]
Definition Loh1.h:8
Loh1(DomainInformation *info)
Definition Loh1.h:12
void setPointSourceVector(const double *const Q, const double *const x, const double t, const double dt, double *forceVector, int n)
Definition Loh1.h:52
DomainInformation * info
Definition Scenario.h:35
Simple vector class.
Definition Vector.h:159