19 const tarch::la::Vector<DIMENSIONS, double>& volumeX,
20 const tarch::la::Vector<DIMENSIONS, double>& volumeH
22 constexpr int nVars = 59;
23 constexpr double pi = M_PI;
24 constexpr double peak_number = 2.0;
25 constexpr double ICA = 0.1;
26 double HH = 1.0 - ICA * sin(peak_number * pi * (volumeX[0] - 0));
27 double dxH = -peak_number * pi * ICA * cos(peak_number * pi * (volumeX[0] - 0));
28 double dxphi = -pow(HH, (-7.0 / 6.0)) * dxH / 6.0;
29 double phi = pow((1.0 / HH), (1.0 / 6.0));
30 double Kxx = -0.5 * peak_number * pi * ICA * cos(peak_number * pi * (volumeX[0] - 0))
31 / sqrt(1.0 - ICA * sin(peak_number * pi * (volumeX[0] - 0)));
32 double traceK = Kxx / HH;
33 std::memset(Q, .0, nVars *
sizeof(
double));
34 Q[0] = phi * phi * HH;
37 Q[6] = phi * phi * (Kxx - 1.0 / 3.0 * traceK * HH);
38 Q[9] = phi * phi * (0.0 - 1.0 / 3.0 * traceK * 1.0);
39 Q[11] = phi * phi * (0.0 - 1.0 / 3.0 * traceK * 1.0);
41 Q[13] = 2.0 / (3.0 * pow(HH, (5.0 / 3.0))) * dxH;
42 Q[23] = 1.0 / (2.0) * dxH * pow(HH, (-1.0 / 2.0));
43 Q[35] = pow(HH, (-1.0 / 3.0)) * dxH / 3.0;
50 for (
int i = 0; i < NumberOfUnknowns; i++) {
51 assertion2(std::isfinite(Q[i]), volumeX, i);
56 const double* NOALIAS Qinside,
57 double* NOALIAS Qoutside,
58 const tarch::la::Vector<DIMENSIONS, double>& faceCentre,
59 const tarch::la::Vector<DIMENSIONS, double>& volumeH,
63 for (
int i = 0; i < NumberOfUnknowns + NumberOfAuxiliaryVariables; i++) {
64 assertion4(Qinside[i] == Qinside[i], faceCentre, t, normal, i);
65 Qoutside[i] = Qinside[i];
70 const double* NOALIAS Q,
71 const tarch::la::Vector<DIMENSIONS, double>& volumeCentre,
72 const tarch::la::Vector<DIMENSIONS, double>& volumeH,
75 ::exahype2::RefinementCommand result = ::exahype2::RefinementCommand::Keep;
77 const double radius = tarch::la::norm2(volumeCentre);
78 constexpr int NumberOfRefinementLayers = 3;
80 const double radii[NumberOfRefinementLayers] = {40, 15, 6};
81 const double maxH[NumberOfRefinementLayers] = {0.32, 0.12, 0.04};
83 result = ::exahype2::RefinementCommand::Keep;
84 for (
int i = 0; i < NumberOfRefinementLayers; i++) {
85 if (radius < radii[i] and tarch::la::max(volumeH) > maxH[i]) {
86 result = ::exahype2::RefinementCommand::Refine;
::exahype2::RefinementCommand refinementCriterion(const double *NOALIAS Q, const tarch::la::Vector< DIMENSIONS, double > &volumeCentre, const tarch::la::Vector< DIMENSIONS, double > &volumeH, double t) override
Refinement criterion.
virtual void boundaryConditions(const double *NOALIAS Qinside, double *NOALIAS Qoutside, const tarch::la::Vector< DIMENSIONS, double > &faceCentre, const tarch::la::Vector< DIMENSIONS, double > &volumeH, double t, int normal) override