38 #include <boost/core/ignore_unused.hpp> 39 #include <boost/algorithm/string/predicate.hpp> 67 int shapedim =
m_fields[0]->GetShapeDimension();
69 for (
int j = 0; j < shapedim; ++j)
90 "No TESTTYPE defined in session.");
91 std::string TestTypeStr =
m_session->GetSolverInfo(
"TESTTYPE");
108 NekDouble SecondToDay = 60.0 * 60.0 * 24.0;
113 m_g = (gms * SecondToDay * SecondToDay) / rad_earth;
117 m_session->LoadParameter(
"Omega", Omegams, 7.292 * 0.00001);
118 m_Omega = Omegams * SecondToDay;
129 NekDouble SecondToDay = 60.0 * 60.0 * 24.0;
134 m_g = (gms * SecondToDay * SecondToDay) / rad_earth;
138 m_session->LoadParameter(
"Omega", Omegams, 7.292 * 0.00001);
139 m_Omega = Omegams * SecondToDay;
141 m_H0 = 133681.0 / (rad_earth * gms);
142 m_k2 = 10.0 / (rad_earth * gms);
148 NekDouble SecondToDay = 60.0 * 60.0 * 24.0;
153 m_g = (gms * SecondToDay * SecondToDay) / rad_earth;
158 m_u0 =
m_u0 * SecondToDay / rad_earth;
160 m_session->LoadParameter(
"Omega", Omegams, 7.292 * 0.00001);
161 m_Omega = Omegams * SecondToDay;
163 m_H0 = 5960.0 / rad_earth;
164 m_hs0 = 2000.0 / rad_earth;
170 NekDouble SecondToDay = 60.0 * 60.0 * 24.0;
175 m_g = (gms * SecondToDay * SecondToDay) / rad_earth;
178 m_u0 =
m_u0 * SecondToDay / rad_earth;
180 m_session->LoadParameter(
"Omega", Omegams, 7.292 * 0.00001);
181 m_Omega = Omegams * SecondToDay;
190 m_hbar = 120.0 / rad_earth;
193 <<
", m_en = " <<
m_en <<
", m_hbar = " <<
m_hbar 200 NekDouble SecondToDay = 60.0 * 60.0 * 24.0;
205 m_g = (gms * SecondToDay * SecondToDay) / rad_earth;
207 m_session->LoadParameter(
"Omega", Omegams, 7.292 * 0.00001);
208 m_Omega = Omegams * SecondToDay;
213 m_angfreq = 7.848 * 0.000001 * SecondToDay;
214 m_K = 7.848 * 0.000001 * SecondToDay;
237 ASSERTL0(
false,
"Implicit unsteady Advection not set up.");
254 int nfields =
m_fields.num_elements();
259 for (i = 0; i < nfields; ++i)
263 nvariables = nfields;
275 for (i = 0; i < nvariables; ++i)
289 "Only one of IO_CheckTime and IO_CheckSteps " 293 bool doCheckTime =
false;
299 NekDouble Mass = 0.0, Energy = 0.0, Enstrophy = 0.0, Vorticity = 0.0;
302 for (
int i = 0; i < nvariables; ++i)
321 std::cout <<
"Steps: " << std::setw(8) << std::left << step + 1 <<
" " 322 <<
"Time: " << std::setw(12) << std::left <<
m_time;
324 std::stringstream ss;
325 ss << cpuTime <<
"s";
326 std::cout <<
" CPU Time: " << std::setw(8) << std::left << ss.str()
341 Energy = (
ComputeEnergy(fieldsprimitive[0], fieldsprimitive[1],
342 fieldsprimitive[2]) -
350 fieldsprimitive[2]) -
354 std::cout <<
"dMass = " << std::setw(8) << std::left << Mass <<
" " 355 <<
", dEnergy = " << std::setw(8) << std::left << Energy
357 <<
", dEnstrophy = " << std::setw(8) << std::left
359 <<
", dVorticity = " << std::setw(8) << std::left
360 << Vorticity << std::endl
370 for (i = 0; i < nvariables; ++i)
394 if (
m_session->GetComm()->GetRank() == 0)
399 <<
"CFL time-step : " <<
m_timestep << std::endl;
402 if (
m_session->GetSolverInfo(
"Driver") !=
"SteadyState")
404 std::cout <<
"Time-integration : " << intTime <<
"s" << std::endl;
408 for (i = 0; i < nvariables; ++i)
417 for (i = 0; i < nvariables; ++i)
428 boost::ignore_unused(time);
431 int nvariables = inarray.num_elements();
439 for (i = 0; i < nvariables; ++i)
452 for (i = 0; i < nvariables; ++i)
473 for (i = 0; i < nvariables; ++i)
475 m_fields[i]->MultiplyByElmtInvMass(modarray[i], modarray[i]);
476 m_fields[i]->BwdTrans(modarray[i], outarray[i]);
488 int nvariables =
m_fields.num_elements();
499 for (i = 0; i < nvariables; ++i)
501 physfield[i] = InField[i];
511 for (i = 0; i < nvariables; ++i)
522 Vmath::Vadd(ncoeffs, &tmp[0], 1, &OutField[i][0], 1,
531 for (i = 0; i < nvariables; ++i)
540 for (i = 0; i < nvariables; ++i)
543 m_fields[i]->AddFwdBwdTraceIntegral(numfluxFwd[i], numfluxBwd[i],
554 int ncoeffs = outarray[0].num_elements();
555 int nq = physarray[0].num_elements();
574 m_fields[0]->IProductWRTBase(tmp, tmpc);
576 Vmath::Vadd(ncoeffs, outarray[j + 1], 1, tmpc, 1, outarray[j + 1], 1);
584 int nq =
m_fields[0]->GetTotPoints();
595 Vmath::Vmul(nq, flux[1], 1, physfield[1], 1, flux[0], 1);
598 Vmath::Vmul(nq, flux[1], 1, physfield[2], 1, flux[1], 1);
611 Vmath::Vmul(nq, tmp, 1, physfield[1], 1, flux[1], 1);
614 Vmath::Vmul(nq, flux[1], 1, physfield[1], 1, flux[0], 1);
624 Vmath::Vmul(nq, flux[1], 1, physfield[2], 1, flux[1], 1);
637 Vmath::Vmul(nq, tmp, 1, physfield[2], 1, flux[0], 1);
640 Vmath::Vmul(nq, flux[0], 1, physfield[2], 1, flux[1], 1);
643 Vmath::Vmul(nq, flux[0], 1, physfield[1], 1, flux[0], 1);
690 for (i = 0; i < nvariables; ++i)
697 for (i = 0; i < nvariables; ++i)
699 m_fields[i]->GetFwdBwdTracePhys(physfield[i], Fwd[i], Bwd[i]);
723 for (k = 0; k < nTraceNumPoints; ++k)
747 for (k = 0; k < nTraceNumPoints; ++k)
750 Fwd[2][k], Bwd[0][k] + DepthFwd[k], Bwd[1][k],
751 Bwd[2][k], numfluxF, numfluxB);
769 denomFwd = eF1n * eF2t - eF2n * eF1t;
770 denomBwd = eB1n * eB2t - eB2n * eB1t;
772 numfluxFwd[0][k] = numfluxF[0];
773 numfluxFwd[1][k] = (1.0 / denomFwd) *
774 (eF2t * numfluxF[1] - eF2n * numfluxF[2]);
777 (-1.0 * eF1t * numfluxF[1] + eF1n * numfluxF[2]);
779 numfluxBwd[0][k] = 1.0 * numfluxB[0];
780 numfluxBwd[1][k] = (1.0 / denomBwd) *
781 (eB2t * numfluxB[1] - eB2n * numfluxB[2]);
784 (-1.0 * eB1t * numfluxB[1] + eB1n * numfluxB[2]);
796 for (k = 0; k < nTraceNumPoints; ++k)
801 Fwd[2][k], Bwd[0][k] + DepthFwd[k], Bwd[1][k],
802 Bwd[2][k], numfluxF, numfluxB);
808 Fwd[2][k], Bwd[0][k] + DepthFwd[k],
809 Bwd[1][k], Bwd[2][k], numfluxF, numfluxB);
815 Fwd[2][k], Bwd[0][k] + DepthFwd[k], Bwd[1][k],
816 Bwd[2][k], numfluxF, numfluxB);
821 for (i = 0; i < nvariables; ++i)
826 tmpF1 = numfluxF[indx + 1] * m_ncdotMFFwd[1][k];
829 tmpB1 = numfluxB[indx + 1] * m_ncdotMFBwd[1][k];
831 numfluxFwd[i][k] = tmpF0 + tmpF1 + numfluxF[indx + 2];
832 numfluxBwd[i][k] = tmpB0 + tmpB1 + numfluxB[indx + 2];
840 ASSERTL0(
false,
"populate switch statement for upwind flux");
851 boost::ignore_unused(index);
868 hstarF = 0.5 * (cL + cR) + 0.25 * (uL - uRF);
872 hstarB = 0.5 * (cL + cR) + 0.25 * (uLB - uR);
883 numfluxF[0] = hfluxF;
884 numfluxF[1] = hufluxF;
885 numfluxF[2] = hvfluxF;
887 numfluxB[0] = hfluxB;
888 numfluxB[1] = hufluxB;
889 numfluxB[2] = hvfluxB;
905 SL = uL - cL * sqrt(0.5 * ((hstar * hstar + hstar * hL) / (hL * hL)));
911 SR = uR + cR * sqrt(0.5 * ((hstar * hstar + hstar * hR) / (hR * hR)));
915 if (fabs(hR * (uR - SR) - hL * (uL - SL)) <= 1.0e-15)
918 Sstar = (SL * hR * (uR - SR) - SR * hL * (uL - SL)) /
919 (hR * (uR - SR) - hL * (uL - SL));
924 huflux = uL * uL * hL + 0.5 * g * hL * hL;
925 hvflux = hL * uL * vL;
930 huflux = uR * uR * hR + 0.5 * g * hR * hR;
931 hvflux = hR * uR * vR;
935 if ((SL < 0) && (Sstar >= 0))
937 hC = hL * ((SL - uL) / (SL - Sstar));
941 hflux = hL * uL + SL * (hC - hL);
942 huflux = (uL * uL * hL + 0.5 * g * hL * hL) + SL * (huC - hL * uL);
943 hvflux = (uL * vL * hL) + SL * (hvC - hL * vL);
947 hC = hR * ((SR - uR) / (SR - Sstar));
951 hflux = hR * uR + SR * (hC - hR);
952 huflux = (uR * uR * hR + 0.5 * g * hR * hR) + SR * (huC - hR * uR);
953 hvflux = (uR * vR * hR) + SR * (hvC - hR * vR);
963 NekDouble MageF1, MageF2, MageB1, MageB2;
971 eF1_cdot_eB2, eF2_cdot_eB1, eF2_cdot_eB2);
975 uRF = (uR * eF1_cdot_eB1 + vR * eF1_cdot_eB2) / MageF1;
976 vRF = (uR * eF2_cdot_eB1 + vR * eF2_cdot_eB2) / MageF2;
978 numfluxF[0] = 0.5 * (hL * uL + hR * uRF);
979 numfluxF[1] = 0.5 * (hL * vL + hR * vRF);
983 0.5 * (hL * uL * uL + hR * uRF * uRF + 0.5 * g * (hL * hL + hR * hR));
984 numfluxF[4] = 0.5 * (hL * uL * vL + hR * uRF * vRF);
987 numfluxF[6] = 0.5 * (hL * uL * vL + hR * uRF * vRF);
989 0.5 * (hL * vL * vL + hR * vRF * vRF + 0.5 * g * (hL * hL + hR * hR));
994 uLB = (uL * eF1_cdot_eB1 + vL * eF2_cdot_eB1) / MageB1;
995 vLB = (uL * eF1_cdot_eB2 + vL * eF2_cdot_eB2) / MageB2;
997 numfluxB[0] = 0.5 * (hR * uR + hR * uLB);
998 numfluxB[1] = 0.5 * (hR * vR + hR * vLB);
1002 0.5 * (hR * uR * uR + hR * uLB * uLB + 0.5 * g * (hR * hR + hL * hL));
1003 numfluxB[4] = 0.5 * (hR * uR * vR + hR * uLB * vLB);
1006 numfluxB[6] = 0.5 * (hR * uR * vR + hR * uLB * vLB);
1008 0.5 * (hR * vR * vR + hR * vLB * vLB + 0.5 * g * (hR * hR + hL * hL));
1018 NekDouble MageF1, MageF2, MageB1, MageB2;
1031 eF1_cdot_eB2, eF2_cdot_eB1, eF2_cdot_eB2);
1037 EigF[0] = velL - sqrt(g * hL);
1039 EigF[2] = velL + sqrt(g * hL);
1041 EigB[0] = velR - sqrt(g * hR);
1043 EigB[2] = velR + sqrt(g * hR);
1050 uRF = (uR * eF1_cdot_eB1 + vR * eF1_cdot_eB2) / MageF1;
1051 vRF = (uR * eF2_cdot_eB1 + vR * eF2_cdot_eB2) / MageF2;
1053 numfluxF[0] = 0.5 * (hL * uL + hR * uRF);
1054 numfluxF[1] = 0.5 * (hL * vL + hR * vRF);
1055 numfluxF[2] = 0.5 * lambdaF * (hL - hR);
1057 numfluxF[3] = 0.5 * (hL * uL * uL * MageF1 + hR * uRF * uRF * MageB1 +
1058 0.5 * g * (hL * hL + hR * hR));
1059 numfluxF[4] = 0.5 * (hL * uL * vL * MageF1 + hR * uRF * vRF * MageB1);
1060 numfluxF[5] = 0.5 * lambdaF * (uL * hL - uRF * hR);
1062 numfluxF[6] = 0.5 * (hL * uL * vL * MageF2 + hR * uRF * vRF * MageB2);
1063 numfluxF[7] = 0.5 * (hL * vL * vL * MageF2 + hR * vRF * vRF * MageB2 +
1064 0.5 * g * (hL * hL + hR * hR));
1065 numfluxF[8] = 0.5 * lambdaF * (vL * hL - vRF * hR);
1069 uLB = (uL * eF1_cdot_eB1 + vL * eF2_cdot_eB1) / MageB1;
1070 vLB = (uL * eF1_cdot_eB2 + vL * eF2_cdot_eB2) / MageB2;
1072 numfluxB[0] = 0.5 * (hR * uR + hR * uLB);
1073 numfluxB[1] = 0.5 * (hR * vR + hR * vLB);
1074 numfluxB[2] = 0.5 * lambdaB * (hL - hR);
1076 numfluxB[3] = 0.5 * (hR * uR * uR * MageB1 + hR * uLB * uLB * MageF1 +
1077 0.5 * g * (hR * hR + hL * hL));
1078 numfluxB[4] = 0.5 * (hR * uR * vR * MageB1 + hR * uLB * vLB * MageF1);
1079 numfluxB[5] = 0.5 * lambdaB * (uLB * hL - uR * hR);
1081 numfluxB[6] = 0.5 * (hR * uR * vR * MageB2 + hR * uLB * vLB * MageF2);
1082 numfluxB[7] = 0.5 * (hR * vR * vR * MageB2 + hR * vLB * vLB * MageF2 +
1083 0.5 * g * (hR * hR + hL * hL));
1084 numfluxB[8] = 0.5 * lambdaB * (vLB * hL - vR * hR);
1093 NekDouble MageF1, MageF2, MageB1, MageB2;
1106 eF1_cdot_eB2, eF2_cdot_eB1, eF2_cdot_eB2);
1113 SL = fabs(velL) + sqrt(g * hL);
1114 SR = fabs(velR) + sqrt(g * hR);
1124 uRF = (uR * eF1_cdot_eB1 + vR * eF1_cdot_eB2) / MageF1;
1125 vRF = (uR * eF2_cdot_eB1 + vR * eF2_cdot_eB2) / MageF2;
1127 numfluxF[0] = 0.5 * (hL * uL + hR * uRF);
1128 numfluxF[1] = 0.5 * (hL * vL + hR * vRF);
1129 numfluxF[2] = 0.5 * S * (hL - hR);
1132 0.5 * (hL * uL * uL + hR * uRF * uRF + 0.5 * g * (hL * hL + hR * hR));
1133 numfluxF[4] = 0.5 * (hL * uL * vL + hR * uRF * vRF);
1134 numfluxF[5] = 0.5 * S * (uL * hL - uRF * hR);
1136 numfluxF[6] = 0.5 * (hL * uL * vL + hR * uRF * vRF);
1138 0.5 * (hL * vL * vL + hR * vRF * vRF + 0.5 * g * (hL * hL + hR * hR));
1139 numfluxF[8] = 0.5 * S * (vL * hL - vRF * hR);
1143 uLB = (uL * eF1_cdot_eB1 + vL * eF2_cdot_eB1) / MageB1;
1144 vLB = (uL * eF1_cdot_eB2 + vL * eF2_cdot_eB2) / MageB2;
1146 numfluxB[0] = 0.5 * (hR * uR + hR * uLB);
1147 numfluxB[1] = 0.5 * (hR * vR + hR * vLB);
1148 numfluxB[2] = 0.5 * S * (hL - hR);
1151 0.5 * (hR * uR * uR + hR * uLB * uLB + 0.5 * g * (hR * hR + hL * hL));
1152 numfluxB[4] = 0.5 * (hR * uR * vR + hR * uLB * vLB);
1153 numfluxB[5] = 0.5 * S * (uLB * hL - uR * hR);
1155 numfluxB[6] = 0.5 * (hR * uR * vR + hR * uLB * vLB);
1157 0.5 * (hR * vR * vR + hR * vLB * vLB + 0.5 * g * (hR * hR + hL * hL));
1158 numfluxB[8] = 0.5 * S * (vLB * hL - vR * hR);
1167 NekDouble MF1x, MF1y, MF1z, MF2x, MF2y, MF2z;
1168 NekDouble MB1x, MB1y, MB1z, MB2x, MB2y, MB2z;
1187 MageF1 = MF1x * MF1x + MF1y * MF1y + MF1z * MF1z;
1188 MageF2 = MF2x * MF2x + MF2y * MF2y + MF2z * MF2z;
1189 MageB1 = MB1x * MB1x + MB1y * MB1y + MB1z * MB1z;
1190 MageB2 = MB2x * MB2x + MB2y * MB2y + MB2z * MB2z;
1192 eF1_cdot_eB1 = MF1x * MB1x + MF1y * MB1y + MF1z * MB1z;
1193 eF1_cdot_eB2 = MF1x * MB2x + MF1y * MB2y + MF1z * MB2z;
1194 eF2_cdot_eB1 = MF2x * MB1x + MF2y * MB1y + MF2z * MB1z;
1195 eF2_cdot_eB2 = MF2x * MB2x + MF2y * MB2y + MF2z * MB2z;
1202 int ncoeffs = outarray[0].num_elements();
1203 int nq = physarray[0].num_elements();
1238 m_fields[0]->IProductWRTBase(tmp, tmpc);
1239 Vmath::Vadd(ncoeffs, tmpc, 1, outarray[j + 1], 1, outarray[j + 1], 1);
1247 int ncoeffs = outarray[0].num_elements();
1248 int nq = physarray[0].num_elements();
1264 m_fields[0]->IProductWRTBase(tmp, tmpc);
1266 Vmath::Vadd(ncoeffs, tmpc, 1, outarray[j + 1], 1, outarray[j + 1], 1);
1277 int ncoeffs = outarray[0].num_elements();
1278 int nq = physarray[0].num_elements();
1295 Vmath::Vmul(nq, physarray[1], 1, de0dt_cdot_e0, 1, Rott1, 1);
1296 Vmath::Vmul(nq, physarray[1], 1, de0dt_cdot_e1, 1, Rott2, 1);
1297 Vmath::Vvtvp(nq, physarray[2], 1, de1dt_cdot_e0, 1, Rott1, 1, Rott1, 1);
1298 Vmath::Vvtvp(nq, physarray[2], 1, de1dt_cdot_e1, 1, Rott2, 1, Rott2, 1);
1301 Vmath::Vmul(nq, &h[0], 1, &Rott1[0], 1, &Rott1[0], 1);
1302 Vmath::Vmul(nq, &h[0], 1, &Rott2[0], 1, &Rott2[0], 1);
1309 m_fields[0]->IProductWRTBase(Rott1, tmpc1);
1310 m_fields[0]->IProductWRTBase(Rott2, tmpc2);
1312 Vmath::Vadd(ncoeffs, tmpc1, 1, outarray[1], 1, outarray[1], 1);
1313 Vmath::Vadd(ncoeffs, tmpc2, 1, outarray[2], 1, outarray[2], 1);
1321 const int indm,
const int indk,
1326 int nq =
m_fields[0]->GetNpoints();
1340 Vmath::Vmul(nq, &physarray[j + 1][0], 1, &tmpderiv[0], 1,
1344 &outarray[0], 1, &outarray[0], 1);
1370 ASSERTL0(
false,
"Unknown projection scheme");
1379 int nvariables =
m_fields.num_elements();
1383 for (
int n = 0; n <
m_fields[0]->GetBndConditions().num_elements(); ++n)
1387 if (
m_fields[0]->GetBndConditions()[n]->GetUserDefined() ==
"eMG")
1391 ASSERTL0(
false,
"Illegal dimension");
1400 if (
m_fields[0]->GetBndConditions()[n]->GetUserDefined() ==
"eWall")
1404 ASSERTL0(
false,
"Illegal dimension");
1413 if (
m_fields[0]->GetBndConditions()[n]->GetUserDefined() ==
1416 for (
int i = 0; i < nvariables; ++i)
1418 m_fields[i]->EvaluateBoundaryConditions(time);
1421 cnt +=
m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
1431 int nvariables = physarray.num_elements();
1435 for (i = 0; i < nvariables; ++i)
1438 m_fields[i]->ExtractTracePhys(physarray[i], Fwd0[i]);
1442 for (i = 0; i < nvariables; ++i)
1445 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
1450 int e, id1, id2, npts;
1452 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
1456 ->GetBndCondExpansions()[bcRegion]
1459 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetPhys_Offset(e);
1460 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(
1461 m_fields[0]->GetTraceMap()->GetBndCondCoeffsToGlobalCoeffsMap(cnt +
1480 &tmp_n[0], 1, &tmp_n[0], 1);
1485 1, &tmp_t[0], 1, &tmp_t[0], 1);
1505 &tmp_u[0], 1, &tmp_u[0], 1);
1506 Vmath::Vdiv(npts, &tmp_u[0], 1, &denom[0], 1, &tmp_u[0], 1);
1513 &tmp_v[0], 1, &tmp_v[0], 1);
1514 Vmath::Vdiv(npts, &tmp_v[0], 1, &denom[0], 1, &tmp_v[0], 1);
1521 ASSERTL0(
false,
"Illegal expansion dimension");
1525 for (i = 0; i < nvariables; ++i)
1529 ->GetBndCondExpansions()[bcRegion]
1530 ->UpdatePhys())[id1],
1548 for(
int i = 0; i <
m_fields.num_elements(); ++i)
1580 NekDouble sin_varphi, cos_varphi, sin_theta, cos_theta;
1582 for (
int j = 0; j < nq; ++j)
1589 sin_theta, cos_theta);
1608 NekDouble phi, theta, sin_varphi, cos_varphi, sin_theta, cos_theta;
1614 thetac =
m_pi / 6.0;
1616 for (
int j = 0; j < nq; ++j)
1623 sin_theta, cos_theta);
1625 if ((std::abs(sin(phic) - sin_varphi) +
1626 std::abs(sin(thetac) - sin_theta)) < Tol)
1628 std::cout <<
"A point " << j
1629 <<
" is coincient with the singularity " 1634 phi = atan2(sin_varphi, cos_varphi);
1635 theta = atan2(sin_theta, cos_theta);
1638 dist2 = (phi - phic) * (phi - phic) +
1639 (theta - thetac) * (theta - thetac);
1641 if (dist2 > hRad * hRad)
1643 dist2 = hRad * hRad;
1651 std::cout <<
"No point is coincident with the singularity point" 1659 for (
int j = 0; j < nq; ++j)
1690 std::cout <<
"Water Depth (m_depth) was generated with mag = " 1729 NekDouble sin_theta, cos_theta, sin_varphi, cos_varphi;
1741 for (
int j = 0; j < nq; ++j)
1752 tmp = -1.0 * cos_varphi * cos_theta * sin(
m_alpha) +
1754 outarray[j] = 2.0 *
m_Omega * tmp;
1763 NekDouble sin_theta, cos_theta, sin_varphi, cos_varphi;
1772 for (
int j = 0; j < nq; ++j)
1781 outarray[j] = 2.0 *
m_Omega * sin_theta;
1786 bool dumpInitialConditions,
1789 boost::ignore_unused(domain);
1811 for (
int i = 0; i <
m_fields.num_elements(); ++i)
1844 for (
int i = 0; i <
m_fields.num_elements(); ++i)
1873 for (
int i = 0; i <
m_fields.num_elements(); ++i)
1902 for (
int i = 0; i <
m_fields.num_elements(); ++i)
1931 for (
int i = 0; i <
m_fields.num_elements(); ++i)
1960 for (
int i = 0; i <
m_fields.num_elements(); ++i)
1973 if (dumpInitialConditions)
1987 boost::ignore_unused(time);
1989 int nq =
m_fields[0]->GetNpoints();
1995 m_fields[0]->GetCoords(x0, x1, x2);
2008 for (
int i = 0; i < nq; ++i)
2010 eta0[i] = (0.771 * 0.395 * 0.395 * (1.0 / cosh(0.395 * x0[i])) *
2011 (1.0 / cosh(0.395 * x0[i]))) *
2012 (3.0 + 6.0 * x1[i] * x1[i]) / (4.0) *
2013 exp(-0.5 * x1[i] * x1[i]);
2014 uvec[0][i] = (0.771 * 0.395 * 0.395 * (1.0 / cosh(0.395 * x0[i])) *
2015 (1.0 / cosh(0.395 * x0[i]))) *
2016 (-9.0 + 6.0 * x1[i] * x1[i]) / (4.0) *
2017 exp(-0.5 * x1[i] * x1[i]);
2018 uvec[1][i] = (-2.0 * 0.395 * tanh(0.395 * x0[i])) *
2019 (0.771 * 0.395 * 0.395 * (1.0 / cosh(0.395 * x0[i])) *
2020 (1.0 / cosh(0.395 * x0[i]))) *
2021 (2.0 * x1[i]) * exp(-0.5 * x1[i] * x1[i]);
2054 NekDouble sin_theta, cos_theta, sin_varphi, cos_varphi;
2073 for (
int j = 0; j < nq; ++j)
2084 tmp = -1.0 * cos_varphi * cos_theta * sin(
m_alpha) +
2091 sin_theta * cos_varphi * sin(
m_alpha));
2094 uvec[0][j] = -1.0 * uhat * sin_varphi - vhat * sin_theta * cos_varphi;
2095 uvec[1][j] = uhat * cos_varphi - vhat * sin_theta * sin_varphi;
2096 uvec[2][j] = vhat * cos_theta;
2142 int nq =
m_fields[0]->GetTotPoints();
2147 return m_fields[0]->PhysIntegral(tmp);
2154 int nq =
m_fields[0]->GetTotPoints();
2176 return m_fields[0]->PhysIntegral(tmp);
2183 int nq =
m_fields[0]->GetTotPoints();
2205 return m_fields[0]->PhysIntegral(tmp);
2214 int nq =
m_fields[0]->GetTotPoints();
2228 Vmath::Vadd(nq, tmp, 1, Vorticity, 1, Vorticity, 1);
2233 int nq =
m_fields[0]->GetNpoints();
2255 1, &velcoeff[0], 1, &velcoeff[0], 1);
2259 m_fields[0]->PhysDeriv(velcoeff, Dtmp0, Dtmp1, Dtmp2);
2269 1, &vellc[0], 1, &vellc[0], 1);
2276 1, &vellc[0], 1, &vellc[0], 1);
2283 1, &vellc[0], 1, &vellc[0], 1);
2296 NekDouble sin_theta, cos_theta, sin_varphi, cos_varphi;
2317 for (
int j = 0; j < nq; ++j)
2330 cos_varphi * cos(
m_Omega * time) - sin_varphi * sin(
m_Omega * time);
2332 sin_varphi * cos(
m_Omega * time) + cos_varphi * sin(
m_Omega * time);
2333 tmp = -1.0 * TR * sin(
m_alpha) * cos_theta + cos(
m_alpha) * sin_theta;
2335 eta[j] = -1.0 * (
m_u0 * tmp +
m_Omega * sin_theta) *
2338 eta[j] = 0.5 * eta[j] /
m_g;
2346 uvec[0][j] = -1.0 * uhat * sin_varphi - vhat * sin_theta * cos_varphi;
2347 uvec[1][j] = uhat * cos_varphi - vhat * sin_theta * sin_varphi;
2348 uvec[2][j] = vhat * cos_theta;
2395 boost::ignore_unused(time);
2400 NekDouble sin_theta, cos_theta, sin_varphi, cos_varphi;
2419 for (
int j = 0; j < nq; ++j)
2430 sin_theta * sin_theta;
2432 uhat = m_u0 * cos_theta;
2435 uvec[0][j] = -1.0 * uhat * sin_varphi - vhat * sin_theta * cos_varphi;
2436 uvec[1][j] = uhat * cos_varphi - vhat * sin_theta * sin_varphi;
2437 uvec[2][j] = vhat * cos_theta;
2484 boost::ignore_unused(time);
2489 NekDouble sin_theta, cos_theta, sin_varphi, cos_varphi;
2511 for (
int j = 0; j < nq; ++j)
2520 Ttheta = atan2(sin_theta, cos_theta);
2521 Tphi = atan2(sin_varphi, cos_varphi);
2527 dth = Ttheta / Nint;
2528 eta[j] = dth * 0.5 *
2530 for (
int i = 1; i < Nint - 1; i++)
2535 eta[j] = (-1.0 /
m_g) * eta[j];
2542 m_hbar * cos_theta * exp(-9.0 * Tphi * Tphi) *
2543 exp(-225.0 * (
m_pi / 4.0 - Ttheta) * (
m_pi / 4.0 - Ttheta));
2546 uvec[0][j] = -1.0 * uhat * sin_varphi - vhat * sin_theta * cos_varphi;
2547 uvec[1][j] = uhat * cos_varphi - vhat * sin_theta * sin_varphi;
2548 uvec[2][j] = vhat * cos_theta;
2596 NekDouble sin_theta, cos_theta, sin_varphi, cos_varphi;
2617 NekDouble cos2theta, cosRtheta, cos6theta, cos2Rtheta, cosRm1theta;
2618 NekDouble cos2phi, cos4phi, sin4phi, cos8phi;
2624 phi0 = 40.0 *
m_pi / 180.0;
2625 theta0 = 50.0 *
m_pi / 180.0;
2627 x0d = cos(phi0) * cos(theta0);
2628 y0d = sin(phi0) * cos(theta0);
2631 for (
int j = 0; j < nq; ++j)
2644 cos2theta = cos_theta * cos_theta;
2645 cosRm1theta = cos_theta * cos2theta;
2646 cosRtheta = cos2theta * cos2theta;
2647 cos6theta = cos2theta * cosRtheta;
2648 cos2Rtheta = cosRtheta * cosRtheta;
2651 Ath = tmp * cos2theta +
2652 0.25 *
m_K *
m_K * cos6theta *
2653 ((R + 1.0) * cosRtheta + (2 * R * R - R - 2.0) * cos2theta -
2657 Bth = tmp * cosRtheta *
2658 ((R * R + 2 * R + 2) - (R + 1.0) * (R + 1.0) * cos2theta);
2661 0.25 *
m_K *
m_K * cos2Rtheta * ((R + 1.0) * cos2theta - (R + 2.0));
2664 cos2phi = 2.0 * cos_varphi * cos_varphi - 1.0;
2665 cos4phi = 2.0 * cos2phi * cos2phi - 1.0;
2666 cos8phi = 2.0 * cos4phi * cos4phi - 1.0;
2669 sin4phi = 4.0 * sin_varphi * cos_varphi * cos2phi;
2671 eta[j] =
m_H0 + (1.0 /
m_g) * (Ath + Bth * cos4phi + Cth * cos8phi);
2677 (1.0 + (1.0 / 40.0) * (x0j * x0d + x1j * y0d + x2j * z0d));
2683 m_K * cosRm1theta * (R * sin_theta * sin_theta - cos2theta) *
2685 vhat = -1.0 *
m_K * R * cosRm1theta * sin_theta * sin4phi;
2687 uvec[0][j] = -1.0 * uhat * sin_varphi - vhat * sin_theta * cos_varphi;
2688 uvec[1][j] = uhat * cos_varphi - vhat * sin_theta * sin_varphi;
2689 uvec[2][j] = vhat * cos_theta;
2742 f = 2.0 *
m_Omega * sin(theta);
2744 dh = f * uphi + tan(theta) * uphi * uphi;
2769 int nq =
m_fields[0]->GetTotPoints();
2770 int ncoeffs =
m_fields[0]->GetNcoeffs();
2772 NekDouble rad_earth = 6.37122 * 1000000;
2777 std::vector<std::string> variables(nvariables);
2779 variables[0] =
"eta";
2780 variables[1] =
"hstar";
2781 variables[2] =
"vorticity";
2782 variables[3] =
"ux";
2783 variables[4] =
"uy";
2784 variables[5] =
"uz";
2785 variables[6] =
"null";
2789 std::vector<Array<OneD, NekDouble>> fieldcoeffs(nvariables);
2790 for (
int i = 0; i < nvariables; ++i)
2797 &fieldphys[0][0], 1);
2804 Vmath::Smul(nq, rad_earth, &fieldphys[1][0], 1, &fieldphys[1][0], 1);
2818 &fieldphys[k + indx][0], 1);
2820 &fieldphys[k + indx][0], 1, &fieldphys[k + indx][0], 1);
2823 for (
int i = 0; i < nvariables; ++i)
2825 m_fields[0]->FwdTrans(fieldphys[i], fieldcoeffs[i]);
2838 if (physin[0].
get() == physout[0].
get())
2842 for (
int i = 0; i < 3; ++i)
2853 Vmath::Vdiv(nq, tmp[1], 1, tmp[0], 1, physout[1], 1);
2856 Vmath::Vdiv(nq, tmp[2], 1, tmp[0], 1, physout[2], 1);
2864 Vmath::Vdiv(nq, physin[1], 1, physin[0], 1, physout[1], 1);
2867 Vmath::Vdiv(nq, physin[2], 1, physin[0], 1, physout[2], 1);
2878 if (physin[0].
get() == physout[0].
get())
2882 for (
int i = 0; i < 3; ++i)
2893 Vmath::Vmul(nq, physout[0], 1, tmp[1], 1, physout[1], 1);
2896 Vmath::Vmul(nq, physout[0], 1, tmp[2], 1, physout[2], 1);
2904 Vmath::Vmul(nq, physout[0], 1, physin[1], 1, physout[1], 1);
2907 Vmath::Vmul(nq, physout[0], 1, physin[2], 1, physout[2], 1);
2951 int nq =
m_fields[0]->GetTotPoints();
2956 NekDouble theta, phi, sin_theta, cos_theta, sin_varphi, cos_varphi;
2981 for (k = 0; k < nq; ++k)
2987 Re = sqrt(xp * xp + yp * yp + zp * zp);
2994 theta = atan2(sin_theta, cos_theta);
2995 phi = atan2(sin_varphi, cos_varphi);
2997 cosntheta3 = cos(n * theta) * cos(n * theta) * cos(n * theta);
2999 beta_theta = -4.0 * n * cosntheta3 * cos(m * phi) * sin(n * theta) / Re;
3000 beta_phi = -m * cosntheta3 * sin(m * phi) / Re;
3002 thetax = -1.0 * cos_varphi * sin_theta;
3003 thetay = -1.0 * sin_varphi * sin_theta;
3006 phix = -1.0 * sin_varphi;
3010 uvec[0][k] = alpha * (beta_theta * thetax + beta_phi * phix);
3011 uvec[1][k] = alpha * (beta_theta * thetay + beta_phi * phiy);
3012 uvec[2][k] = alpha * (beta_theta * thetaz + beta_phi * phiz);
3014 vorticityexact[k] = -4.0 * n / Re / Re * cos_theta * cos_theta *
3015 cos_varphi * cos(m * phi) * sin(n * theta);
3021 std::cout <<
"chi migi1" << std::endl;
3032 Vmath::Vsub(nq, vorticityexact, 1, vorticitycompt, 1, vorticitycompt, 1);
3034 std::cout <<
"Vorticity: L2 error = " <<
AvgAbsInt(vorticitycompt)
3035 <<
", Linf error = " <<
Vmath::Vamax(nq, vorticitycompt, 1)
3043 boost::ignore_unused(exactsoln);
3045 int nq =
m_fields[field]->GetNpoints();
3050 if (
m_fields[field]->GetPhysState() ==
false)
3068 &exactsolution[0], 1, &exactsolution[0], 1);
3069 Vmath::Vabs(nq, exactsolution, 1, exactsolution, 1);
3071 L2error = (
m_fields[0]->PhysIntegral(exactsolution)) / L2exact;
3088 Vmath::Vvtvp(nq, exactv, 1, exactv, 1, tmp, 1, tmp, 1);
3091 L2exact =
m_fields[1]->PhysIntegral(tmp);
3100 Vmath::Vvtvp(nq, exactv, 1, exactv, 1, tmp, 1, tmp, 1);
3103 L2error = (
m_fields[1]->PhysIntegral(tmp)) / L2exact;
3117 if (Normalised ==
true)
3124 L2error = sqrt(L2error * L2error / Vol);
3140 boost::ignore_unused(exactsoln);
3144 if (
m_fields[field]->GetPhysState() ==
false)
3150 int nq =
m_fields[field]->GetNpoints();
3174 1, &exactsolution[0], 1);
3176 LinfError = fabs(LinfError / Letaint);
3196 Vmath::Vsub(nq, &exactu[0], 1, &tmpu[0], 1, &tmpu[0], 1);
3197 Vmath::Vsub(nq, &exactv[0], 1, &tmpv[0], 1, &tmpv[0], 1);
3199 Vmath::Vmul(nq, &tmpu[0], 1, &tmpu[0], 1, &tmpu[0], 1);
3200 Vmath::Vmul(nq, &tmpv[0], 1, &tmpv[0], 1, &tmpv[0], 1);
3202 Vmath::Vadd(nq, &tmpu[0], 1, &tmpv[0], 1, &Lerr[0], 1);
3206 Vmath::Vmul(nq, &exactu[0], 1, &exactu[0], 1, &tmpu[0], 1);
3207 Vmath::Vmul(nq, &exactv[0], 1, &exactv[0], 1, &tmpv[0], 1);
3208 Vmath::Vadd(nq, &tmpu[0], 1, &tmpv[0], 1, &uT[0], 1);
virtual void v_DoSolve()
Solves an unsteady problem.
void TestVorticityComputation()
averaged (or centred) flux
void AverageFlux(const int index, NekDouble hL, NekDouble uL, NekDouble vL, NekDouble hR, NekDouble uR, NekDouble vR, Array< OneD, NekDouble > &numfluxF, Array< OneD, NekDouble > &numfluxB)
#define ASSERTL0(condition, msg)
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Array< OneD, Array< OneD, NekDouble > > m_ncdotMFBwd
const char *const TestTypeMap[]
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the projection.
void AddDivForGradient(Array< OneD, Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Array< OneD, Array< OneD, NekDouble > > m_Derivdepth
NekDouble m_time
Current time of simulation.
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
void LaxFriedrichFlux(const int index, NekDouble hL, NekDouble uL, NekDouble vL, NekDouble hR, NekDouble uR, NekDouble vR, Array< OneD, NekDouble > &numfluxF, Array< OneD, NekDouble > &numfluxB)
A base class for PDEs which include an advection component.
void ComputeMagAndDot(const int index, NekDouble &MageF1, NekDouble &MageF2, NekDouble &MageB1, NekDouble &MageB2, NekDouble &eF1_cdot_eB1, NekDouble &eF1_cdot_eB2, NekDouble &eF2_cdot_eB1, NekDouble &eF2_cdot_eB2)
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
NekDouble m_timestep
Time step size.
NekDouble TimePerTest(unsigned int n)
Returns amount of seconds per iteration in a test with n iterations.
std::vector< std::pair< std::string, std::string > > SummaryList
MMFSWE(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Session reader.
void RusanovFlux(const int index, NekDouble hL, NekDouble uL, NekDouble vL, NekDouble hR, NekDouble uR, NekDouble vR, Array< OneD, NekDouble > &numfluxF, Array< OneD, NekDouble > &numfluxB)
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_CurlMF
virtual void v_InitObject()
Initialise the object.
void RossbyWave(unsigned int field, Array< OneD, NekDouble > &outfield)
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
int m_expdim
Expansion dimension.
SOLVER_UTILS_EXPORT void Checkpoint_Output(const int n)
Write checkpoint file of m_fields.
virtual void v_DoInitialise()
Sets up initial conditions.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
Harten-Lax-Leer Contact wave flux.
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > ErrorExtraPoints(unsigned int field)
Compute error (L2 and L_inf) over an larger set of quadrature points return [L2 Linf].
void EvaluateCoriolis(void)
void IsolatedMountainFlow(unsigned int field, const NekDouble time, Array< OneD, NekDouble > &outfield)
NekDouble m_checktime
Time between checkpoints.
void EvaluateWaterDepth(void)
void ConservativeToPrimitive()
void PrimitiveToConservative()
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Array< OneD, NekDouble > m_depth
Still water depth.
void AddElevationEffect(Array< OneD, Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
std::string m_sessionName
Name of the session.
void Vabs(int n, const T *x, const int incx, T *y, const int incy)
vabs: y = |x|
int m_checksteps
Number of steps between checkpoints.
void Computehhuhvflux(NekDouble hL, NekDouble uL, NekDouble vL, NekDouble hR, NekDouble uR, NekDouble vR, NekDouble hstar, NekDouble &hflux, NekDouble &huflux, NekDouble &hvflux)
LibUtilities::CommSharedPtr m_comm
Communicator.
SOLVER_UTILS_EXPORT int GetTotPoints()
Array< OneD, Array< OneD, NekDouble > > m_movingframes
void AddCoriolis(Array< OneD, Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
NekDouble m_fintime
Finish time of the simulation.
void UnstableJetFlow(unsigned int field, const NekDouble time, Array< OneD, NekDouble > &outfield)
void ComputeVorticity(const Array< OneD, const NekDouble > &u, const Array< OneD, const NekDouble > &v, Array< OneD, NekDouble > &Vorticity)
NekDouble ComputeMass(const Array< OneD, const NekDouble > &eta)
Array< OneD, Array< OneD, NekDouble > > m_DivMF
NekDouble ComputeEnstrophy(const Array< OneD, const NekDouble > &eta, const Array< OneD, const NekDouble > &u, const Array< OneD, const NekDouble > &v)
int m_steps
Number of steps to take.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
void ComputeNablaCdotVelocity(Array< OneD, NekDouble > &vellc)
static const NekDouble kNekZeroTol
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > CartesianToMovingframes(const Array< OneD, const Array< OneD, NekDouble >> &uvec, unsigned int field)
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
SurfaceType m_surfaceType
Array< OneD, Array< OneD, NekDouble > > m_nperpcdotMFFwd
Array< OneD, NekDouble > m_coriolis
Coriolis force.
void Checkpoint_Output_Cartesian(std::string outname)
Base class for unsteady solvers.
virtual NekDouble v_L2Error(unsigned int field, const Array< OneD, NekDouble > &exactsoln, bool Normalised)
Virtual function for the L_2 error computation between fields and a given exact solution.
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
void Compute_demdt_cdot_ek(const int indm, const int indk, const Array< OneD, const Array< OneD, NekDouble >> &physarray, Array< OneD, NekDouble > &outarray)
int m_spacedim
Spatial dimension (>= expansion dim).
void Neg(int n, T *x, const int incx)
Negate x = -x.
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print Summary.
SOLVER_UTILS_EXPORT void MMFInitObject(const Array< OneD, const Array< OneD, NekDouble >> &Anisotropy, const int TangentXelem=-1)
void GetSWEFluxVector(const int i, const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &flux)
virtual SOLVER_UTILS_EXPORT void v_InitObject()
Init object for UnsteadySystem class.
T Vamax(int n, const T *x, const int incx)
Return the maximum absolute element in x called vamax to avoid conflict with max. ...
void SteadyZonalFlow(unsigned int field, Array< OneD, NekDouble > &outfield)
Array< OneD, Array< OneD, NekDouble > > m_ncdotMFFwd
NekDouble m_cflSafetyFactor
CFL safety factor (comprise between 0 to 1).
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
Array< OneD, Array< OneD, NekDouble > > m_velocity
Advection velocity.
static std::string className
Name of class.
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
virtual void v_SetInitialConditions(const NekDouble initialtime, bool dumpInitialConditions, const int domain)
Array< OneD, Array< OneD, NekDouble > > m_nperpcdotMFBwd
void TestSWE2Dproblem(const NekDouble time, unsigned int field, Array< OneD, NekDouble > &outfield)
EquationSystemFactory & GetEquationSystemFactory()
SOLVER_UTILS_EXPORT void CartesianToSpherical(const NekDouble x0j, const NekDouble x1j, const NekDouble x2j, NekDouble &sin_varphi, NekDouble &cos_varphi, NekDouble &sin_theta, NekDouble &cos_theta)
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_MFtraceBwd
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
void WeakDGSWEDirDeriv(const Array< OneD, Array< OneD, NekDouble >> &InField, Array< OneD, Array< OneD, NekDouble >> &OutField)
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction(std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
Get a SessionFunction by name.
void AddRotation(Array< OneD, Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
void NumericalSWEFlux(Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &numfluxFwd, Array< OneD, Array< OneD, NekDouble >> &numfluxBwd)
SOLVER_UTILS_EXPORT int GetNpoints()
SOLVER_UTILS_EXPORT NekDouble AvgAbsInt(const Array< OneD, const NekDouble > &inarray)
void RiemannSolverHLLC(const int index, NekDouble hL, NekDouble uL, NekDouble vL, NekDouble hR, NekDouble uR, NekDouble vR, Array< OneD, NekDouble > &numfluxF, Array< OneD, NekDouble > &numfluxB)
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void EvaluateStandardCoriolis(Array< OneD, NekDouble > &outarray)
void SetBoundaryConditions(Array< OneD, Array< OneD, NekDouble >> &inarray, NekDouble time)
virtual ~MMFSWE()
Destructor.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
void Vvtvm(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvm (vector times vector plus vector): z = w*x - y
SOLVER_UTILS_EXPORT NekDouble LinfError(unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
Linf error computation.
SOLVER_UTILS_EXPORT int GetTraceNpoints()
SOLVER_UTILS_EXPORT int GetNcoeffs()
SOLVER_UTILS_EXPORT void CopyBoundaryTrace(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, const BoundaryCopyType BDCopyType, const int var=0, const std::string btype="NoUserDefined")
LibUtilities::TimeIntegrationWrapperSharedPtr m_intScheme
Wrapper to the time integration scheme.
NekDouble ComputeUnstableJetuphi(const NekDouble theta)
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the RHS.
void EvaluateCoriolisForZonalFlow(Array< OneD, NekDouble > &outarray)
SOLVER_UTILS_EXPORT void EvaluateExactSolution(int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
Evaluates an exact solution.
int m_infosteps
Number of time steps between outputting status information.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
SOLVER_UTILS_EXPORT void SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
Initialise the data in the dependent fields.
void WallBoundary2D(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble >> &physarray)
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_MFtraceFwd
void Zero(int n, T *x, const int incx)
Zero vector.
int m_NumQuadPointsError
Number of Quadrature points used to work out the error.
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s)
Print a summary of time stepping parameters.
static void Daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: y = alpha x plus y.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
NekDouble ComputeUnstableJetEta(const NekDouble theta)
virtual void v_EvaluateExactSolution(unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
NekDouble ComputeEnergy(const Array< OneD, const NekDouble > &eta, const Array< OneD, const NekDouble > &u, const Array< OneD, const NekDouble > &v)
LibUtilities::TimeIntegrationSolutionSharedPtr m_intSoln
virtual NekDouble v_LinfError(unsigned int field, const Array< OneD, NekDouble > &exactsoln)
Virtual function for the L_inf error computation between fields and a given exact solution...
std::shared_ptr< SessionReader > SessionReaderSharedPtr
void UnsteadyZonalFlow(unsigned int field, const NekDouble time, Array< OneD, NekDouble > &outfield)
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
std::vector< int > m_intVariables