Peano
Loading...
Searching...
No Matches
WholeSpaceProblem.h
Go to the documentation of this file.
1#ifndef EXASEIS_SCENARIOWHOLESPACEPROBLEM_HEADER
2#define EXASEIS_SCENARIOWHOLESPACEPROBLEM_HEADER
3
4#include "Scenario.h"
5
6template <class VariableShortcuts,int basisSize>
7class WholeSpaceProblem : public Scenario<VariableShortcuts,basisSize>{
8 private:
10
11 public:
13 //place point source in center of domain
14 m_pointSourceLocation[0] = 15.0;
15 m_pointSourceLocation[1] = 15.0;
16 m_pointSourceLocation[2] = 15.0;
17 };
18
19 void initUnknownsPointwise(const double* const x,
21 const double t,
22 const double dt,
23 double* Q
24 ) override{
26 double rho = 2.67;
27 double cp = 6.0;
28 double cs = 3.464;
29
30
31#ifdef ISOTROPIC
32 Q[s.rho] = rho;
33 Q[s.cp ] = cp;
34 Q[s.cs ] = cs;
35
36#elif defined ANISOTROPIC
37 double mue = Q[s.rho] *cs*cs;
38 double lambda = Q[s.rho]*(cp*cp -2*cs*cs);
39
40 Q[s.c + 0] = 2*mue+lambda; //c11
41 Q[s.c + 1] = 2*mue+lambda; //c22
42 Q[s.c + 2] = 2*mue+lambda; //c33
43
44 Q[s.c + 3] = lambda; //c44
45 Q[s.c + 4] = lambda; //c55
46 Q[s.c + 5] = lambda; //c66
47
48 Q[s.c + 6] = mue; //c12
49 Q[s.c + 7] = mue; //c13
50 Q[s.c + 8] = mue; //c23
51#else
52#error Whole space problem only defined for Isotropic and Anisotropic Scenario
53#endif
54
55 }
56
57 void initPointSourceLocation(double pointSourceLocation[][3]) override{
58 pointSourceLocation[0][0]=m_pointSourceLocation[0];
59 pointSourceLocation[0][1]=m_pointSourceLocation[1];
60 pointSourceLocation[0][2]=m_pointSourceLocation[2];
61 }
62
63 void setPointSourceVector(const double* const Q,
64 const double* const x,const double t,const double dt,
65 double* forceVector, int n) override{
66
67 assertion2(n == 0, "Only a single pointSource for WholeSpaceProblem",n);
68
69 constexpr double pi = 3.14159265359;
70 constexpr double sigma = 0.1149;
71 constexpr double t0 = 0.7;
72 constexpr double M0 = 1000.0;
73
74 double f = M0*(1.0/(sigma*std::sqrt(2.0*pi)))*(std::exp(-((t-t0)*(t-t0))/(2.0*sigma*sigma)));
75
77 forceVector[s.sigma + 0] = f;
78 forceVector[s.sigma + 1] = f;
79 forceVector[s.sigma + 2] = f;
80 }
81};
82#endif
83
#define assertion2(expr, param0, param1)
{{NAMESPACE|join("::")}}::VariableShortcuts VariableShortcuts
void initUnknownsPointwise(const double *const x, const tarch::la::Vector< Dimensions, double > &center, const double t, const double dt, double *Q) override
void initPointSourceLocation(double pointSourceLocation[][3]) override
double m_pointSourceLocation[3]
WholeSpaceProblem(DomainInformation *info)
void setPointSourceVector(const double *const Q, const double *const x, const double t, const double dt, double *forceVector, int n) override
Simple vector class.
Definition Vector.h:159