116 int nLocalSolutionPts;
117 int nElements = pFields[0]->GetExpSize();
118 int nDimensions = pFields[0]->GetCoordim(0);
119 int nSolutionPts = pFields[0]->GetTotPoints();
120 int nTracePts = pFields[0]->GetTrace()->GetTotPoints();
135 for (n = 0; n < nElements; ++n)
137 ptsKeys = pFields[0]->GetExp(n)->GetPointsKeys();
138 nLocalSolutionPts = pFields[0]->GetExp(n)->GetTotPoints();
139 phys_offset = pFields[0]->GetPhys_Offset(n);
146 for (i = 0; i < nLocalSolutionPts; ++i)
148 m_jac[i + phys_offset] = jac[0];
168 for (n = 0; n < nElements; ++n)
170 base = pFields[0]->GetExp(n)->GetBase();
171 nquad0 = base[0]->GetNumPoints();
172 nquad1 = base[1]->GetNumPoints();
180 pFields[0]->GetExp(n)->GetTraceQFactors(0, auxArray1 =
182 pFields[0]->GetExp(n)->GetTraceQFactors(1, auxArray1 =
184 pFields[0]->GetExp(n)->GetTraceQFactors(2, auxArray1 =
186 pFields[0]->GetExp(n)->GetTraceQFactors(3, auxArray1 =
189 ptsKeys = pFields[0]->GetExp(n)->GetPointsKeys();
190 nLocalSolutionPts = pFields[0]->GetExp(n)->GetTotPoints();
191 phys_offset = pFields[0]->GetPhys_Offset(n);
204 ->GetDerivFactors(ptsKeys);
213 for (i = 0; i < nLocalSolutionPts; ++i)
215 m_jac[i + phys_offset] = jac[i];
216 m_gmat[0][i + phys_offset] = gmat[0][i];
217 m_gmat[1][i + phys_offset] = gmat[1][i];
218 m_gmat[2][i + phys_offset] = gmat[2][i];
219 m_gmat[3][i + phys_offset] = gmat[3][i];
224 for (i = 0; i < nLocalSolutionPts; ++i)
226 m_jac[i + phys_offset] = jac[0];
227 m_gmat[0][i + phys_offset] = gmat[0][0];
228 m_gmat[1][i + phys_offset] = gmat[1][0];
229 m_gmat[2][i + phys_offset] = gmat[2][0];
230 m_gmat[3][i + phys_offset] = gmat[3][0];
236 for (i = 0; i < nDimensions; ++i)
246 ASSERTL0(
false,
"3DFR Metric terms not implemented yet");
251 ASSERTL0(
false,
"Expansion dimension not recognised");
281 int nquad0, nquad1, nquad2;
282 int nmodes0, nmodes1, nmodes2;
285 int nElements = pFields[0]->GetExpSize();
286 int nDimensions = pFields[0]->GetCoordim(0);
295 for (n = 0; n < nElements; ++n)
297 base = pFields[0]->GetExp(n)->GetBase();
298 nquad0 = base[0]->GetNumPoints();
299 nmodes0 = base[0]->GetNumModes();
303 base[0]->GetZW(z0, w0);
315 int p0 = nmodes0 - 1;
322 std::tgamma(2 * p0 + 1) /
323 (pow(2.0, p0) * std::tgamma(p0 + 1) * std::tgamma(p0 + 1));
333 ((2.0 * p0 + 1.0) * (p0 + 1.0) *
334 (ap0 * std::tgamma(p0 + 1)) *
335 (ap0 * std::tgamma(p0 + 1)));
339 c0 = 2.0 * (p0 + 1.0) /
340 ((2.0 * p0 + 1.0) * p0 * (ap0 * std::tgamma(p0 + 1)) *
341 (ap0 * std::tgamma(p0 + 1)));
346 -2.0 / ((2.0 * p0 + 1.0) * (ap0 * std::tgamma(p0 + 1)) *
347 (ap0 * std::tgamma(p0 + 1)));
351 c0 = 10000000000000000.0;
354 NekDouble etap0 = 0.5 * c0 * (2.0 * p0 + 1.0) *
355 (ap0 * std::tgamma(p0 + 1)) *
356 (ap0 * std::tgamma(p0 + 1));
358 NekDouble overeta0 = 1.0 / (1.0 + etap0);
371 for (i = 0; i < nquad0; ++i)
381 for (i = 0; i < nquad0; ++i)
404 for (n = 0; n < nElements; ++n)
406 base = pFields[0]->GetExp(n)->GetBase();
407 nquad0 = base[0]->GetNumPoints();
408 nquad1 = base[1]->GetNumPoints();
409 nmodes0 = base[0]->GetNumModes();
410 nmodes1 = base[1]->GetNumModes();
417 base[0]->GetZW(z0, w0);
418 base[1]->GetZW(z1, w1);
435 int p0 = nmodes0 - 1;
436 int p1 = nmodes1 - 1;
444 std::tgamma(2 * p0 + 1) /
445 (pow(2.0, p0) * std::tgamma(p0 + 1) * std::tgamma(p0 + 1));
448 std::tgamma(2 * p1 + 1) /
449 (pow(2.0, p1) * std::tgamma(p1 + 1) * std::tgamma(p1 + 1));
460 ((2.0 * p0 + 1.0) * (p0 + 1.0) *
461 (ap0 * std::tgamma(p0 + 1)) *
462 (ap0 * std::tgamma(p0 + 1)));
465 ((2.0 * p1 + 1.0) * (p1 + 1.0) *
466 (ap1 * std::tgamma(p1 + 1)) *
467 (ap1 * std::tgamma(p1 + 1)));
471 c0 = 2.0 * (p0 + 1.0) /
472 ((2.0 * p0 + 1.0) * p0 * (ap0 * std::tgamma(p0 + 1)) *
473 (ap0 * std::tgamma(p0 + 1)));
475 c1 = 2.0 * (p1 + 1.0) /
476 ((2.0 * p1 + 1.0) * p1 * (ap1 * std::tgamma(p1 + 1)) *
477 (ap1 * std::tgamma(p1 + 1)));
482 -2.0 / ((2.0 * p0 + 1.0) * (ap0 * std::tgamma(p0 + 1)) *
483 (ap0 * std::tgamma(p0 + 1)));
486 -2.0 / ((2.0 * p1 + 1.0) * (ap1 * std::tgamma(p1 + 1)) *
487 (ap1 * std::tgamma(p1 + 1)));
491 c0 = 10000000000000000.0;
492 c1 = 10000000000000000.0;
495 NekDouble etap0 = 0.5 * c0 * (2.0 * p0 + 1.0) *
496 (ap0 * std::tgamma(p0 + 1)) *
497 (ap0 * std::tgamma(p0 + 1));
499 NekDouble etap1 = 0.5 * c1 * (2.0 * p1 + 1.0) *
500 (ap1 * std::tgamma(p1 + 1)) *
501 (ap1 * std::tgamma(p1 + 1));
503 NekDouble overeta0 = 1.0 / (1.0 + etap0);
504 NekDouble overeta1 = 1.0 / (1.0 + etap1);
523 for (i = 0; i < nquad0; ++i)
533 for (i = 0; i < nquad1; ++i)
543 for (i = 0; i < nquad0; ++i)
553 for (i = 0; i < nquad1; ++i)
573 for (n = 0; n < nElements; ++n)
575 base = pFields[0]->GetExp(n)->GetBase();
576 nquad0 = base[0]->GetNumPoints();
577 nquad1 = base[1]->GetNumPoints();
578 nquad2 = base[2]->GetNumPoints();
579 nmodes0 = base[0]->GetNumModes();
580 nmodes1 = base[1]->GetNumModes();
581 nmodes2 = base[2]->GetNumModes();
590 base[0]->GetZW(z0, w0);
591 base[1]->GetZW(z1, w1);
592 base[1]->GetZW(z2, w2);
614 int p0 = nmodes0 - 1;
615 int p1 = nmodes1 - 1;
616 int p2 = nmodes2 - 1;
624 std::tgamma(2 * p0 + 1) /
625 (pow(2.0, p0) * std::tgamma(p0 + 1) * std::tgamma(p0 + 1));
629 std::tgamma(2 * p1 + 1) /
630 (pow(2.0, p1) * std::tgamma(p1 + 1) * std::tgamma(p1 + 1));
634 std::tgamma(2 * p2 + 1) /
635 (pow(2.0, p2) * std::tgamma(p2 + 1) * std::tgamma(p2 + 1));
647 ((2.0 * p0 + 1.0) * (p0 + 1.0) *
648 (ap0 * std::tgamma(p0 + 1)) *
649 (ap0 * std::tgamma(p0 + 1)));
652 ((2.0 * p1 + 1.0) * (p1 + 1.0) *
653 (ap1 * std::tgamma(p1 + 1)) *
654 (ap1 * std::tgamma(p1 + 1)));
657 ((2.0 * p2 + 1.0) * (p2 + 1.0) *
658 (ap2 * std::tgamma(p2 + 1)) *
659 (ap2 * std::tgamma(p2 + 1)));
663 c0 = 2.0 * (p0 + 1.0) /
664 ((2.0 * p0 + 1.0) * p0 * (ap0 * std::tgamma(p0 + 1)) *
665 (ap0 * std::tgamma(p0 + 1)));
667 c1 = 2.0 * (p1 + 1.0) /
668 ((2.0 * p1 + 1.0) * p1 * (ap1 * std::tgamma(p1 + 1)) *
669 (ap1 * std::tgamma(p1 + 1)));
671 c2 = 2.0 * (p2 + 1.0) /
672 ((2.0 * p2 + 1.0) * p2 * (ap2 * std::tgamma(p2 + 1)) *
673 (ap2 * std::tgamma(p2 + 1)));
678 -2.0 / ((2.0 * p0 + 1.0) * (ap0 * std::tgamma(p0 + 1)) *
679 (ap0 * std::tgamma(p0 + 1)));
682 -2.0 / ((2.0 * p1 + 1.0) * (ap1 * std::tgamma(p1 + 1)) *
683 (ap1 * std::tgamma(p1 + 1)));
686 -2.0 / ((2.0 * p2 + 1.0) * (ap2 * std::tgamma(p2 + 1)) *
687 (ap2 * std::tgamma(p2 + 1)));
691 c0 = 10000000000000000.0;
692 c1 = 10000000000000000.0;
693 c2 = 10000000000000000.0;
696 NekDouble etap0 = 0.5 * c0 * (2.0 * p0 + 1.0) *
697 (ap0 * std::tgamma(p0 + 1)) *
698 (ap0 * std::tgamma(p0 + 1));
700 NekDouble etap1 = 0.5 * c1 * (2.0 * p1 + 1.0) *
701 (ap1 * std::tgamma(p1 + 1)) *
702 (ap1 * std::tgamma(p1 + 1));
704 NekDouble etap2 = 0.5 * c2 * (2.0 * p2 + 1.0) *
705 (ap2 * std::tgamma(p2 + 1)) *
706 (ap2 * std::tgamma(p2 + 1));
708 NekDouble overeta0 = 1.0 / (1.0 + etap0);
709 NekDouble overeta1 = 1.0 / (1.0 + etap1);
710 NekDouble overeta2 = 1.0 / (1.0 + etap2);
735 for (i = 0; i < nquad0; ++i)
745 for (i = 0; i < nquad1; ++i)
755 for (i = 0; i < nquad2; ++i)
765 for (i = 0; i < nquad0; ++i)
775 for (i = 0; i < nquad1; ++i)
785 for (i = 0; i < nquad2; ++i)
798 ASSERTL0(
false,
"Expansion dimension not recognised");
817 const int nConvectiveFields,
832 Basis = fields[0]->GetExp(0)->GetBase();
834 int nElements = fields[0]->GetExpSize();
835 int nDimensions = fields[0]->GetCoordim(0);
836 int nSolutionPts = fields[0]->GetTotPoints();
837 int nTracePts = fields[0]->GetTrace()->GetTotPoints();
838 int nCoeffs = fields[0]->GetNcoeffs();
851 for (i = 0; i < nConvectiveFields; ++i)
861 for (i = 0; i < nConvectiveFields; ++i)
867 fields[i]->GetFwdBwdTracePhys(inarray[i], Fwd[i], Bwd[i]);
886 for (i = 0; i < nConvectiveFields; ++i)
888 for (n = 0; n < nElements; n++)
890 phys_offset = fields[0]->GetPhys_Offset(n);
892 fields[i]->GetExp(n)->PhysDeriv(
893 0, fluxvector[i][0] + phys_offset,
894 auxArray2 = DfluxvectorX1 + phys_offset);
898 DivCFlux_1D(nConvectiveFields, fields, fluxvector[i][0],
906 Vmath::Vadd(nSolutionPts, &outarray[i][0], 1, &DfluxvectorX1[0],
907 1, &outarray[i][0], 1);
910 if (!(
Basis[0]->Collocation()))
912 fields[i]->FwdTrans(outarray[i], outarrayCoeff[i]);
913 fields[i]->BwdTrans(outarrayCoeff[i], outarray[i]);
929 for (i = 0; i < nConvectiveFields; ++i)
936 &fluxvector[i][0][0], 1, &
m_gmat[2][0], 1,
937 &fluxvector[i][1][0], 1, &f_hat[0], 1);
943 &fluxvector[i][0][0], 1, &
m_gmat[3][0], 1,
944 &fluxvector[i][1][0], 1, &g_hat[0], 1);
950 for (n = 0; n < nElements; n++)
952 phys_offset = fields[0]->GetPhys_Offset(n);
953 fields[0]->GetExp(n)->StdPhysDeriv(
954 0, auxArray1 = f_hat + phys_offset,
955 auxArray2 = DfluxvectorX1 + phys_offset);
956 fields[0]->GetExp(n)->StdPhysDeriv(
957 1, auxArray1 = g_hat + phys_offset,
958 auxArray2 = DfluxvectorX2 + phys_offset);
962 Vmath::Vadd(nSolutionPts, DfluxvectorX1, 1, DfluxvectorX2, 1,
966 if (
Basis[0]->GetPointsType() ==
968 Basis[1]->GetPointsType() ==
976 DivCFlux_2D(nConvectiveFields, fields, fluxvector[i][0],
977 fluxvector[i][1], numflux[i], divFC);
981 Vmath::Vadd(nSolutionPts, divFD, 1, divFC, 1, outarray[i], 1);
988 if (!(
Basis[0]->Collocation()))
990 fields[i]->FwdTrans(outarray[i], outarrayCoeff[i]);
991 fields[i]->BwdTrans(outarrayCoeff[i], outarray[i]);
999 ASSERTL0(
false,
"3D FRDG case not implemented yet");
1016 [[maybe_unused]]
const int nConvectiveFields,
1023 int nLocalSolutionPts, phys_offset, t_offset;
1026 Basis = fields[0]->GetExp(0)->GetBasis(0);
1028 int nElements = fields[0]->GetExpSize();
1029 int nSolutionPts = fields[0]->GetTotPoints();
1031 vector<bool> leftAdjacentTraces =
1032 std::static_pointer_cast<MultiRegions::DisContField>(fields[0])
1033 ->GetLeftAdjacentTraces();
1044 fields[0]->GetTraceMap()->GetElmtToTrace();
1046 for (n = 0; n < nElements; ++n)
1048 nLocalSolutionPts = fields[0]->GetExp(n)->GetTotPoints();
1049 phys_offset = fields[0]->GetPhys_Offset(n);
1053 Vmath::Vcopy(nLocalSolutionPts, &fluxX1[phys_offset], 1, &tmparrayX1[0],
1056 fields[0]->GetExp(n)->GetTracePhysVals(0, elmtToTrace[n][0], tmparrayX1,
1059 t_offset = fields[0]->GetTrace()->GetPhys_Offset(
1060 elmtToTrace[n][0]->GetElmtId());
1062 if (leftAdjacentTraces[2 * n])
1064 JumpL[n] = -numericalFlux[t_offset] - tmpFluxVertex[0];
1068 JumpL[n] = numericalFlux[t_offset] - tmpFluxVertex[0];
1071 fields[0]->GetExp(n)->GetTracePhysVals(1, elmtToTrace[n][1], tmparrayX1,
1074 t_offset = fields[0]->GetTrace()->GetPhys_Offset(
1075 elmtToTrace[n][1]->GetElmtId());
1077 if (leftAdjacentTraces[2 * n + 1])
1079 JumpR[n] = numericalFlux[t_offset] - tmpFluxVertex[0];
1083 JumpR[n] = -numericalFlux[t_offset] - tmpFluxVertex[0];
1087 for (n = 0; n < nElements; ++n)
1089 nLocalSolutionPts = fields[0]->GetExp(n)->GetTotPoints();
1090 phys_offset = fields[0]->GetPhys_Offset(n);
1101 Vmath::Vadd(nLocalSolutionPts, &DCL[0], 1, &DCR[0], 1,
1102 &divCFlux[phys_offset], 1);
1119 [[maybe_unused]]
const int nConvectiveFields,
1126 int n, e, i, j, cnt;
1128 int nElements = fields[0]->GetExpSize();
1130 int nLocalSolutionPts, nEdgePts;
1131 int trace_offset, phys_offset;
1138 fields[0]->GetTraceMap()->GetElmtToTrace();
1141 for (n = 0; n < nElements; ++n)
1144 phys_offset = fields[0]->GetPhys_Offset(n);
1145 nLocalSolutionPts = fields[0]->GetExp(n)->GetTotPoints();
1147 base = fields[0]->GetExp(n)->GetBase();
1148 nquad0 = base[0]->GetNumPoints();
1149 nquad1 = base[1]->GetNumPoints();
1157 for (e = 0; e < fields[0]->GetExp(n)->GetNtraces(); ++e)
1160 nEdgePts = fields[0]->GetExp(n)->GetTraceNumPoints(e);
1169 trace_offset = fields[0]->GetTrace()->GetPhys_Offset(
1170 elmtToTrace[n][e]->GetElmtId());
1174 fields[0]->GetExp(n)->GetTraceNormal(e);
1178 fields[0]->GetExp(n)->GetTracePhysVals(e, elmtToTrace[n][e],
1179 fluxX1 + phys_offset,
1180 auxArray1 = tmparrayX1);
1184 fields[0]->GetExp(n)->GetTracePhysVals(e, elmtToTrace[n][e],
1185 fluxX2 + phys_offset,
1186 auxArray1 = tmparrayX2);
1195 Vmath::Vsub(nEdgePts, &numericalFlux[trace_offset], 1, &fluxN[0], 1,
1199 if (fields[0]->GetExp(n)->GetTraceOrient(e) ==
1205 for (i = 0; i < nEdgePts; ++i)
1210 fluxJumps[i] = -fluxJumps[i];
1218 for (i = 0; i < nquad0; ++i)
1221 fluxJumps[i] = -(
m_Q2D_e0[n][i]) * fluxJumps[i];
1223 for (j = 0; j < nquad1; ++j)
1225 cnt = i + j * nquad0;
1226 divCFluxE0[cnt] = fluxJumps[i] *
m_dGL_xi2[n][j];
1231 for (i = 0; i < nquad1; ++i)
1234 fluxJumps[i] = (
m_Q2D_e1[n][i]) * fluxJumps[i];
1236 for (j = 0; j < nquad0; ++j)
1238 cnt = (nquad0)*i + j;
1239 divCFluxE1[cnt] = fluxJumps[i] *
m_dGR_xi1[n][j];
1244 for (i = 0; i < nquad0; ++i)
1247 fluxJumps[i] = (
m_Q2D_e2[n][i]) * fluxJumps[i];
1249 for (j = 0; j < nquad1; ++j)
1251 cnt = j * nquad0 + i;
1252 divCFluxE2[cnt] = fluxJumps[i] *
m_dGR_xi2[n][j];
1257 for (i = 0; i < nquad1; ++i)
1260 fluxJumps[i] = -(
m_Q2D_e3[n][i]) * fluxJumps[i];
1261 for (j = 0; j < nquad0; ++j)
1263 cnt = j + i * nquad0;
1264 divCFluxE3[cnt] = fluxJumps[i] *
m_dGL_xi1[n][j];
1269 ASSERTL0(
false,
"edge value (< 3) is out of range");
1275 Vmath::Vadd(nLocalSolutionPts, &divCFluxE0[0], 1, &divCFluxE1[0], 1,
1276 &divCFlux[phys_offset], 1);
1278 Vmath::Vadd(nLocalSolutionPts, &divCFlux[phys_offset], 1,
1279 &divCFluxE2[0], 1, &divCFlux[phys_offset], 1);
1281 Vmath::Vadd(nLocalSolutionPts, &divCFlux[phys_offset], 1,
1282 &divCFluxE3[0], 1, &divCFlux[phys_offset], 1);
1301 [[maybe_unused]]
const int nConvectiveFields,
1308 int n, e, i, j, cnt;
1310 int nElements = fields[0]->GetExpSize();
1311 int nLocalSolutionPts;
1322 fields[0]->GetTraceMap()->GetElmtToTrace();
1325 for (n = 0; n < nElements; ++n)
1328 phys_offset = fields[0]->GetPhys_Offset(n);
1329 nLocalSolutionPts = fields[0]->GetExp(n)->GetTotPoints();
1331 base = fields[0]->GetExp(n)->GetBase();
1332 nquad0 = base[0]->GetNumPoints();
1333 nquad1 = base[1]->GetNumPoints();
1341 for (e = 0; e < fields[0]->GetExp(n)->GetNtraces(); ++e)
1344 nEdgePts = fields[0]->GetExp(n)->GetTraceNumPoints(e);
1353 trace_offset = fields[0]->GetTrace()->GetPhys_Offset(
1354 elmtToTrace[n][e]->GetElmtId());
1358 fields[0]->GetExp(n)->GetTraceNormal(e);
1367 fields[0]->GetExp(n)->GetTracePhysVals(e, elmtToTrace[n][e],
1368 fluxX2 + phys_offset,
1369 auxArray1 = fluxN_D);
1374 Vmath::Vcopy(nEdgePts, &numericalFlux[trace_offset], 1,
1378 if (fields[0]->GetExp(n)->GetTraceOrient(e) ==
1382 auxArray2 = fluxN, 1);
1385 auxArray2 = fluxN_D, 1);
1389 for (i = 0; i < nquad0; ++i)
1392 fluxN_R[i] = (
m_Q2D_e0[n][i]) * fluxN[i];
1395 for (i = 0; i < nEdgePts; ++i)
1402 fluxN_R[i] = -fluxN_R[i];
1408 Vmath::Vsub(nEdgePts, &fluxN_R[0], 1, &fluxN_D[0], 1,
1413 for (i = 0; i < nquad0; ++i)
1415 for (j = 0; j < nquad1; ++j)
1417 cnt = i + j * nquad0;
1418 divCFluxE0[cnt] = -fluxJumps[i] *
m_dGL_xi2[n][j];
1426 fields[0]->GetExp(n)->GetTracePhysVals(e, elmtToTrace[n][e],
1427 fluxX1 + phys_offset,
1428 auxArray1 = fluxN_D);
1431 Vmath::Vcopy(nEdgePts, &numericalFlux[trace_offset], 1,
1435 if (fields[0]->GetExp(n)->GetTraceOrient(e) ==
1439 auxArray2 = fluxN, 1);
1442 auxArray2 = fluxN_D, 1);
1446 for (i = 0; i < nquad1; ++i)
1449 fluxN_R[i] = (
m_Q2D_e1[n][i]) * fluxN[i];
1452 for (i = 0; i < nEdgePts; ++i)
1459 fluxN_R[i] = -fluxN_R[i];
1465 Vmath::Vsub(nEdgePts, &fluxN_R[0], 1, &fluxN_D[0], 1,
1470 for (i = 0; i < nquad1; ++i)
1472 for (j = 0; j < nquad0; ++j)
1474 cnt = (nquad0)*i + j;
1475 divCFluxE1[cnt] = fluxJumps[i] *
m_dGR_xi1[n][j];
1485 fields[0]->GetExp(n)->GetTracePhysVals(e, elmtToTrace[n][e],
1486 fluxX2 + phys_offset,
1487 auxArray1 = fluxN_D);
1490 Vmath::Vcopy(nEdgePts, &numericalFlux[trace_offset], 1,
1494 if (fields[0]->GetExp(n)->GetTraceOrient(e) ==
1498 auxArray2 = fluxN, 1);
1501 auxArray2 = fluxN_D, 1);
1505 for (i = 0; i < nquad0; ++i)
1508 fluxN_R[i] = (
m_Q2D_e2[n][i]) * fluxN[i];
1511 for (i = 0; i < nEdgePts; ++i)
1518 fluxN_R[i] = -fluxN_R[i];
1525 Vmath::Vsub(nEdgePts, &fluxN_R[0], 1, &fluxN_D[0], 1,
1530 for (i = 0; i < nquad0; ++i)
1532 for (j = 0; j < nquad1; ++j)
1534 cnt = j * nquad0 + i;
1535 divCFluxE2[cnt] = fluxJumps[i] *
m_dGR_xi2[n][j];
1544 fields[0]->GetExp(n)->GetTracePhysVals(e, elmtToTrace[n][e],
1545 fluxX1 + phys_offset,
1546 auxArray1 = fluxN_D);
1550 Vmath::Vcopy(nEdgePts, &numericalFlux[trace_offset], 1,
1554 if (fields[0]->GetExp(n)->GetTraceOrient(e) ==
1558 auxArray2 = fluxN, 1);
1561 auxArray2 = fluxN_D, 1);
1565 for (i = 0; i < nquad1; ++i)
1568 fluxN_R[i] = (
m_Q2D_e3[n][i]) * fluxN[i];
1571 for (i = 0; i < nEdgePts; ++i)
1578 fluxN_R[i] = -fluxN_R[i];
1585 Vmath::Vsub(nEdgePts, &fluxN_R[0], 1, &fluxN_D[0], 1,
1590 for (i = 0; i < nquad1; ++i)
1592 for (j = 0; j < nquad0; ++j)
1594 cnt = j + i * nquad0;
1595 divCFluxE3[cnt] = -fluxJumps[i] *
m_dGL_xi1[n][j];
1600 ASSERTL0(
false,
"edge value (< 3) is out of range");
1606 Vmath::Vadd(nLocalSolutionPts, &divCFluxE0[0], 1, &divCFluxE1[0], 1,
1607 &divCFlux[phys_offset], 1);
1609 Vmath::Vadd(nLocalSolutionPts, &divCFlux[phys_offset], 1,
1610 &divCFluxE2[0], 1, &divCFlux[phys_offset], 1);
1612 Vmath::Vadd(nLocalSolutionPts, &divCFlux[phys_offset], 1,
1613 &divCFluxE3[0], 1, &divCFlux[phys_offset], 1);
1631 [[maybe_unused]]
const int nConvectiveFields,
#define ASSERTL0(condition, msg)
Represents a basis of a given type.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
const SpatialDomains::GeomFactorsSharedPtr & GetMetricInfo() const
static AdvectionSharedPtr create(std::string advType)
void v_Advect(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &advVel, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time, const Array< OneD, Array< OneD, NekDouble > > &pFwd=NullNekDoubleArrayOfArray, const Array< OneD, Array< OneD, NekDouble > > &pBwd=NullNekDoubleArrayOfArray) override
Compute the advection term at each time-step using the Flux Reconstruction approach (FR).
Array< OneD, Array< OneD, NekDouble > > m_dGL_xi1
Array< OneD, Array< OneD, NekDouble > > m_dGR_xi3
Array< OneD, Array< OneD, NekDouble > > m_dGR_xi1
Array< OneD, Array< OneD, NekDouble > > m_dGR_xi2
void SetupMetrics(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Setup the metric terms to compute the contravariant fluxes. (i.e. this special metric terms transform...
Array< OneD, Array< OneD, NekDouble > > m_dGL_xi3
Array< OneD, NekDouble > m_jac
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e0
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e3
AdvectionFR(std::string advType)
AdvectionFR uses the Flux Reconstruction (FR) approach to compute the advection term....
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e1
void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) override
Initiliase AdvectionFR objects and store them before starting the time-stepping.
Array< OneD, Array< OneD, NekDouble > > m_dGL_xi2
void DivCFlux_2D_Gauss(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const NekDouble > &fluxX1, const Array< OneD, const NekDouble > &fluxX2, const Array< OneD, const NekDouble > &numericalFlux, Array< OneD, NekDouble > &divCFlux)
Compute the divergence of the corrective flux for 2D problems where POINTSTYPE="GaussGaussLegendre".
void SetupCFunctions(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Setup the derivatives of the correction functions. For more details see J Sci Comput (2011) 47: 50–72...
void DivCFlux_2D(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const NekDouble > &fluxX1, const Array< OneD, const NekDouble > &fluxX2, const Array< OneD, const NekDouble > &numericalFlux, Array< OneD, NekDouble > &divCFlux)
Compute the divergence of the corrective flux for 2D problems.
void DivCFlux_3D(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const NekDouble > &fluxX1, const Array< OneD, const NekDouble > &fluxX2, const Array< OneD, const NekDouble > &fluxX3, const Array< OneD, const NekDouble > &numericalFlux, Array< OneD, NekDouble > &divCFlux)
Compute the divergence of the corrective flux for 3D problems.
static std::string type[]
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
void DivCFlux_1D(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const NekDouble > &fluxX1, const Array< OneD, const NekDouble > &numericalFlux, Array< OneD, NekDouble > &divCFlux)
Compute the divergence of the corrective flux for 1D problems.
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e2
Array< OneD, Array< OneD, NekDouble > > m_gmat
int m_spaceDim
Storage for space dimension. Used for homogeneous extension.
AdvectionFluxVecCB m_fluxVector
Callback function to the flux vector (set when advection is in conservative form).
virtual SOLVER_UTILS_EXPORT void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initialises the advection object.
RiemannSolverSharedPtr m_riemann
Riemann solver for DG-type schemes.
std::shared_ptr< Basis > BasisSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::vector< PointsKey > PointsKeyVector
@ eGaussGaussLegendre
1D Gauss-Gauss-Legendre quadrature points
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
@ eDeformed
Geometry is curved or has non-constant factors.
void jacobd(const int np, const double *z, double *polyd, const int n, const double alpha, const double beta)
Calculate the derivative of Jacobi polynomials.
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.
void Neg(int n, T *x, const int incx)
Negate x = -x.
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 Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
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.
void Reverse(int n, const T *x, const int incx, T *y, const int incy)
void Vvtvvtp(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtp (vector times vector plus vector times vector):
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
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.