Peano
Loading...
Searching...
No Matches
Sinusodial.h
Go to the documentation of this file.
1#ifndef EXASEIS_SCENARIOSINUSODIAL_HEADER
2#define EXASEIS_SCENARIOSINUSODIAL_HEADER
3#include "Hsp1.h"
4#include <math.h>
5
6template <class Shortcuts, int basisSize>
7class Sinusodial : public Scenario<Shortcuts, basisSize>{
8 private:
10
11 public:
12
13 Sinusodial(DomainInformation* info): Scenario<Shortcuts,basisSize>(info){
14 //place point source in center of topography 2000m below surface
15 m_pointSourceLocation[0] = 0.0;
16 m_pointSourceLocation[1] = 0.2;
17 m_pointSourceLocation[2] = 0.0;
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#if defined ISOTROPIC
28 Q[s.rho] = 2.0;
29 Q[s.cs ] = 2.000;
30 Q[s.cp ] = 3.464101615;
31#else
32#error Whole space problem only defined for Isotropic Simulations
33#endif
34
35 }
36
37 void initPointSourceLocation(double pointSourceLocation[][3]){
38 pointSourceLocation[0][0]=m_pointSourceLocation[0];
39 pointSourceLocation[0][1]=m_pointSourceLocation[1];
40 pointSourceLocation[0][2]=m_pointSourceLocation[2];
41 }
42
43
44 void setPointSourceVector(const double* const Q,
45 const double* const x,const double t,const double dt,
46 double* forceVector, int n){
47
48 assertion2(n == 0, "Only a single pointSource for Sinusodial",n);
49
50 constexpr double t0 = 0.2;
51 constexpr double f0 = 10.0;
52 constexpr double M0 = 1000.0;
53 double pi = 2*std::acos(0.0);
54 double alpha = -pi*pi*f0*f0;
55
56 // double f = 2.0 * alpha*(1.0 + 2.0 * alpha * (t-t0)*(t-t0)) * std::exp(alpha * (t-t0) * (t-t0));
57
58 // We need em fu*** integral
59 double f = std::exp(alpha*(t-t0)*(t-t0)) * 2 * alpha *(t-t0);
60
61 Shortcuts s;
62 forceVector[s.sigma + 0] = f;
63 forceVector[s.sigma + 1] = f;
64 forceVector[s.sigma + 2] = f;
65 }
66
67};
68#endif
#define assertion2(expr, param0, param1)
DomainInformation * info
Definition Scenario.h:35
Sinusodial(DomainInformation *info)
Definition Sinusodial.h:13
double m_pointSourceLocation[3]
Definition Sinusodial.h:9
void setPointSourceVector(const double *const Q, const double *const x, const double t, const double dt, double *forceVector, int n)
Definition Sinusodial.h:44
void initUnknownsPointwise(const double *const x, const tarch::la::Vector< Dimensions, double > &center, const double t, const double dt, double *Q)
Definition Sinusodial.h:20
void initPointSourceLocation(double pointSourceLocation[][3])
Definition Sinusodial.h:37
Simple vector class.
Definition Vector.h:159