15 double layerWidth = 1.0;
16 bool upperLayer = x(1) <= layerWidth;
19 // bool upperLayer = false;
22 Q[ 0 + 1 ] = Q[ 0 + 0 ];
23 Q[ 0 + 2 ] = Q[ 0 + 1 ];
26 Q[9] = upperLayer ? 2.6 : 2.7;
27 Q[10] = upperLayer ? 4.0 : 6.0;
28 Q[11] = upperLayer ? 2.0 : 3.464;
36 Qoutside[3+0] = 0.; //xx
37 Qoutside[3+3] = 0.; //xy
38 Qoutside[3+4] = 0.; //xz
44 // free surface boundary condition
45 Qoutside[3+1] = -Qinside[3+1]; //yy
46 Qoutside[3+3] = -Qinside[3+3]; //xy
47 Qoutside[3+5] = -Qinside[3+5]; //yz
48 Qoutside[0+0] = Qinside[0+0];
49 Qoutside[0+1] = Qinside[0+1];
50 Qoutside[0+2] = Qinside[0+2];
53 Qoutside[3+2] = 0.; //zz
54 Qoutside[3+4] = 0.; //xz
55 Qoutside[3+5] = 0.; //yz
62 Qoutside[9] = Qinside[9];
63 Qoutside[10] = Qinside[10];
64 Qoutside[11] = Qinside[11];
70 return std::max(std::abs(Q[10]), std::abs(Q[11]));
76 auto mu(Q[9] * Q[11] * Q[11]); //rho*cs^2
77 auto lambda(Q[9] * Q[10] * Q[10] - 2.0 * mu); //rho*cp^2 - 2 mu
78 auto neg_irho(-1.0/Q[9]);
82 F[0+0] = neg_irho*Q[3+0]; //sigma_xx
83 F[0+1] = neg_irho*Q[3+3]; //sigma_xy
84 F[0+2] = neg_irho*Q[3+4]; //sigma_xz
85 F[3+0] = -(lambda + 2*mu) * Q[0+0]; //xx
86 F[3+1] = -lambda * Q[0+0]; //yy
87 F[3+2] = -lambda * Q[0+0]; //zz
88 F[3+3] = -mu * Q[0+1]; //xy
89 F[3+4] = -mu * Q[0+2]; //xz
93 F[0+0] = neg_irho*Q[3+3]; //sigma_xy
94 F[0+1] = neg_irho*Q[3+1]; //sigma_yy
95 F[0+2] = neg_irho*Q[3+5]; //sigma_yz
96 F[3+0] = -lambda * Q[0+1]; //xx
97 F[3+1] = -(lambda + 2*mu) * Q[0+1]; //yy
98 F[3+2] = - lambda * Q[0+1]; //zz
99 F[3+3] = -mu * Q[0+0]; //xy
101 F[3+5] = -mu * Q[0+2]; //yz
104 F[0+0] = neg_irho*Q[3+4]; //sigma_xz
105 F[0+1] = neg_irho*Q[3+5]; //sigma_yz
106 F[0+2] = neg_irho*Q[3+2]; //sigma_zz
107 F[3+0] = -lambda * Q[0+2]; //xx
108 F[3+1] = -lambda * Q[0+2]; //yy
109 F[3+2] = -(lambda + 2*mu) * Q[0+2]; //zz
111 F[3+4] = -mu * Q[0+0]; //xz
112 F[3+5] = -mu * Q[0+1]; //yz
118 auto result = ::exahype2::RefinementCommand::Keep;
120 tarch::la::Vector<DIMENSIONS, double> sourceLocation = {
121 pointSourceLocation[0][0],
122 pointSourceLocation[0][1],
124 pointSourceLocation[0][2]
128 if (tarch::la::equals(t, 0.0)) {
129 if (tarch::la::norm2(x - sourceLocation) < 1.0) {
130 result = ::exahype2::RefinementCommand::Refine;
139 for (int i = 0; i < NumberOfUnknowns; i++) {
140 forceVector[i] = 0.0;
143 constexpr double t0 = 0.1;
144 constexpr double M0 = 10.;//1000.0;
145 double f = M0 * t / (t0 * t0) * std::exp(-t / t0);
147 forceVector[3+4] = f; //sigma_xy
151 location[0][0] = 0.0;
152 location[0][1] = 2.0;
153 location[0][2] = 0.0;
158 Numerics::riemannSolver<VariableShortcuts{{SOLVER_NAME}}, {{CORRECTOR_COMPUTATION_PRECISION}}, Order+1, NumberOfUnknowns, NumberOfUnknowns+NumberOfAuxiliaryVariables, 1>(
159 FL, FR, QL, QR, dt, direction, isBoundaryFace, faceIndex
def refinement_criterion()