35 #include <boost/core/ignore_unused.hpp>
45 #include <boost/math/special_functions/gamma.hpp>
58 std::string AdvectionFR::type[] = {
60 "FRDG", AdvectionFR::create),
62 "FRSD", AdvectionFR::create),
64 "FRHU", AdvectionFR::create),
66 "FRcmin", AdvectionFR::create),
68 "FRcinf", AdvectionFR::create)};
78 AdvectionFR::AdvectionFR(std::string advType):m_advType(advType)
121 boost::ignore_unused(pSession);
125 int nLocalSolutionPts;
126 int nElements = pFields[0]->GetExpSize();
127 int nDimensions = pFields[0]->GetCoordim(0);
128 int nSolutionPts = pFields[0]->GetTotPoints();
129 int nTracePts = pFields[0]->GetTrace()->GetTotPoints();
144 for (n = 0; n < nElements; ++n)
146 ptsKeys = pFields[0]->GetExp(n)->GetPointsKeys();
147 nLocalSolutionPts = pFields[0]->GetExp(n)->GetTotPoints();
148 phys_offset = pFields[0]->GetPhys_Offset(n);
149 jac = pFields[0]->GetExp(n)
152 for (i = 0; i < nLocalSolutionPts; ++i)
154 m_jac[i+phys_offset] = jac[0];
174 for (n = 0; n < nElements; ++n)
176 base = pFields[0]->GetExp(n)->GetBase();
177 nquad0 = base[0]->GetNumPoints();
178 nquad1 = base[1]->GetNumPoints();
186 pFields[0]->GetExp(n)->GetTraceQFactors(
188 pFields[0]->GetExp(n)->GetTraceQFactors(
190 pFields[0]->GetExp(n)->GetTraceQFactors(
192 pFields[0]->GetExp(n)->GetTraceQFactors(
195 ptsKeys = pFields[0]->GetExp(n)->GetPointsKeys();
196 nLocalSolutionPts = pFields[0]->GetExp(n)->GetTotPoints();
197 phys_offset = pFields[0]->GetPhys_Offset(n);
199 jac = pFields[0]->GetExp(n)
202 gmat = pFields[0]->GetExp(n)
206 if (pFields[0]->GetExp(n)
211 for (i = 0; i < nLocalSolutionPts; ++i)
213 m_jac[i+phys_offset] = jac[i];
214 m_gmat[0][i+phys_offset] = gmat[0][i];
215 m_gmat[1][i+phys_offset] = gmat[1][i];
216 m_gmat[2][i+phys_offset] = gmat[2][i];
217 m_gmat[3][i+phys_offset] = gmat[3][i];
222 for (i = 0; i < nLocalSolutionPts; ++i)
224 m_jac[i+phys_offset] = jac[0];
225 m_gmat[0][i+phys_offset] = gmat[0][0];
226 m_gmat[1][i+phys_offset] = gmat[1][0];
227 m_gmat[2][i+phys_offset] = gmat[2][0];
228 m_gmat[3][i+phys_offset] = gmat[3][0];
235 for(i = 0; i < nDimensions; ++i)
245 ASSERTL0(
false,
"3DFR Metric terms not implemented yet");
250 ASSERTL0(
false,
"Expansion dimension not recognised");
276 boost::ignore_unused(pSession);
282 int nquad0, nquad1, nquad2;
283 int nmodes0, nmodes1, nmodes2;
286 int nElements = pFields[0]->GetExpSize();
287 int nDimensions = pFields[0]->GetCoordim(0);
296 for (n = 0; n < nElements; ++n)
298 base = pFields[0]->GetExp(n)->GetBase();
299 nquad0 = base[0]->GetNumPoints();
300 nmodes0 = base[0]->GetNumModes();
304 base[0]->GetZW(z0, w0);
316 int p0 = nmodes0 - 1;
322 NekDouble ap0 = boost::math::tgamma(2 * p0 + 1)
324 * boost::math::tgamma(p0 + 1)
325 * boost::math::tgamma(p0 + 1));
334 c0 = 2.0 * p0 / ((2.0 * p0 + 1.0) * (p0 + 1.0)
335 * (ap0 * boost::math::tgamma(p0 + 1))
336 * (ap0 * boost::math::tgamma(p0 + 1)));
340 c0 = 2.0 * (p0 + 1.0) / ((2.0 * p0 + 1.0) * p0
341 * (ap0 * boost::math::tgamma(p0 + 1))
342 * (ap0 * boost::math::tgamma(p0 + 1)));
346 c0 = -2.0 / ((2.0 * p0 + 1.0)
347 * (ap0 * boost::math::tgamma(p0 + 1))
348 * (ap0 * boost::math::tgamma(p0 + 1)));
352 c0 = 10000000000000000.0;
355 NekDouble etap0 = 0.5 * c0 * (2.0 * p0 + 1.0)
356 * (ap0 * boost::math::tgamma(p0 + 1))
357 * (ap0 * boost::math::tgamma(p0 + 1));
359 NekDouble overeta0 = 1.0 / (1.0 + etap0);
370 for(i = 0; i < nquad0; ++i)
380 for(i = 0; i < nquad0; ++i)
403 for (n = 0; n < nElements; ++n)
405 base = pFields[0]->GetExp(n)->GetBase();
406 nquad0 = base[0]->GetNumPoints();
407 nquad1 = base[1]->GetNumPoints();
408 nmodes0 = base[0]->GetNumModes();
409 nmodes1 = base[1]->GetNumModes();
416 base[0]->GetZW(z0, w0);
417 base[1]->GetZW(z1, w1);
434 int p0 = nmodes0 - 1;
435 int p1 = nmodes1 - 1;
442 NekDouble ap0 = boost::math::tgamma(2 * p0 + 1)
444 * boost::math::tgamma(p0 + 1)
445 * boost::math::tgamma(p0 + 1));
447 NekDouble ap1 = boost::math::tgamma(2 * p1 + 1)
449 * boost::math::tgamma(p1 + 1)
450 * boost::math::tgamma(p1 + 1));
460 c0 = 2.0 * p0 / ((2.0 * p0 + 1.0) * (p0 + 1.0)
461 * (ap0 * boost::math::tgamma(p0 + 1))
462 * (ap0 * boost::math::tgamma(p0 + 1)));
464 c1 = 2.0 * p1 / ((2.0 * p1 + 1.0) * (p1 + 1.0)
465 * (ap1 * boost::math::tgamma(p1 + 1))
466 * (ap1 * boost::math::tgamma(p1 + 1)));
470 c0 = 2.0 * (p0 + 1.0) / ((2.0 * p0 + 1.0) * p0
471 * (ap0 * boost::math::tgamma(p0 + 1))
472 * (ap0 * boost::math::tgamma(p0 + 1)));
474 c1 = 2.0 * (p1 + 1.0) / ((2.0 * p1 + 1.0) * p1
475 * (ap1 * boost::math::tgamma(p1 + 1))
476 * (ap1 * boost::math::tgamma(p1 + 1)));
480 c0 = -2.0 / ((2.0 * p0 + 1.0)
481 * (ap0 * boost::math::tgamma(p0 + 1))
482 * (ap0 * boost::math::tgamma(p0 + 1)));
484 c1 = -2.0 / ((2.0 * p1 + 1.0)
485 * (ap1 * boost::math::tgamma(p1 + 1))
486 * (ap1 * boost::math::tgamma(p1 + 1)));
490 c0 = 10000000000000000.0;
491 c1 = 10000000000000000.0;
494 NekDouble etap0 = 0.5 * c0 * (2.0 * p0 + 1.0)
495 * (ap0 * boost::math::tgamma(p0 + 1))
496 * (ap0 * boost::math::tgamma(p0 + 1));
498 NekDouble etap1 = 0.5 * c1 * (2.0 * p1 + 1.0)
499 * (ap1 * boost::math::tgamma(p1 + 1))
500 * (ap1 * boost::math::tgamma(p1 + 1));
502 NekDouble overeta0 = 1.0 / (1.0 + etap0);
503 NekDouble overeta1 = 1.0 / (1.0 + etap1);
518 for(i = 0; i < nquad0; ++i)
528 for(i = 0; i < nquad1; ++i)
538 for(i = 0; i < nquad0; ++i)
548 for(i = 0; i < nquad1; ++i)
568 for (n = 0; n < nElements; ++n)
570 base = pFields[0]->GetExp(n)->GetBase();
571 nquad0 = base[0]->GetNumPoints();
572 nquad1 = base[1]->GetNumPoints();
573 nquad2 = base[2]->GetNumPoints();
574 nmodes0 = base[0]->GetNumModes();
575 nmodes1 = base[1]->GetNumModes();
576 nmodes2 = base[2]->GetNumModes();
585 base[0]->GetZW(z0, w0);
586 base[1]->GetZW(z1, w1);
587 base[1]->GetZW(z2, w2);
609 int p0 = nmodes0 - 1;
610 int p1 = nmodes1 - 1;
611 int p2 = nmodes2 - 1;
618 NekDouble ap0 = boost::math::tgamma(2 * p0 + 1)
620 * boost::math::tgamma(p0 + 1)
621 * boost::math::tgamma(p0 + 1));
624 NekDouble ap1 = boost::math::tgamma(2 * p1 + 1)
626 * boost::math::tgamma(p1 + 1)
627 * boost::math::tgamma(p1 + 1));
630 NekDouble ap2 = boost::math::tgamma(2 * p2 + 1)
632 * boost::math::tgamma(p2 + 1)
633 * boost::math::tgamma(p2 + 1));
644 c0 = 2.0 * p0 / ((2.0 * p0 + 1.0) * (p0 + 1.0)
645 * (ap0 * boost::math::tgamma(p0 + 1))
646 * (ap0 * boost::math::tgamma(p0 + 1)));
648 c1 = 2.0 * p1 / ((2.0 * p1 + 1.0) * (p1 + 1.0)
649 * (ap1 * boost::math::tgamma(p1 + 1))
650 * (ap1 * boost::math::tgamma(p1 + 1)));
652 c2 = 2.0 * p2 / ((2.0 * p2 + 1.0) * (p2 + 1.0)
653 * (ap2 * boost::math::tgamma(p2 + 1))
654 * (ap2 * boost::math::tgamma(p2 + 1)));
658 c0 = 2.0 * (p0 + 1.0) / ((2.0 * p0 + 1.0) * p0
659 * (ap0 * boost::math::tgamma(p0 + 1))
660 * (ap0 * boost::math::tgamma(p0 + 1)));
662 c1 = 2.0 * (p1 + 1.0) / ((2.0 * p1 + 1.0) * p1
663 * (ap1 * boost::math::tgamma(p1 + 1))
664 * (ap1 * boost::math::tgamma(p1 + 1)));
666 c2 = 2.0 * (p2 + 1.0) / ((2.0 * p2 + 1.0) * p2
667 * (ap2 * boost::math::tgamma(p2 + 1))
668 * (ap2 * boost::math::tgamma(p2 + 1)));
672 c0 = -2.0 / ((2.0 * p0 + 1.0)
673 * (ap0 * boost::math::tgamma(p0 + 1))
674 * (ap0 * boost::math::tgamma(p0 + 1)));
676 c1 = -2.0 / ((2.0 * p1 + 1.0)
677 * (ap1 * boost::math::tgamma(p1 + 1))
678 * (ap1 * boost::math::tgamma(p1 + 1)));
680 c2 = -2.0 / ((2.0 * p2 + 1.0)
681 * (ap2 * boost::math::tgamma(p2 + 1))
682 * (ap2 * boost::math::tgamma(p2 + 1)));
686 c0 = 10000000000000000.0;
687 c1 = 10000000000000000.0;
688 c2 = 10000000000000000.0;
691 NekDouble etap0 = 0.5 * c0 * (2.0 * p0 + 1.0)
692 * (ap0 * boost::math::tgamma(p0 + 1))
693 * (ap0 * boost::math::tgamma(p0 + 1));
695 NekDouble etap1 = 0.5 * c1 * (2.0 * p1 + 1.0)
696 * (ap1 * boost::math::tgamma(p1 + 1))
697 * (ap1 * boost::math::tgamma(p1 + 1));
699 NekDouble etap2 = 0.5 * c2 * (2.0 * p2 + 1.0)
700 * (ap2 * boost::math::tgamma(p2 + 1))
701 * (ap2 * boost::math::tgamma(p2 + 1));
703 NekDouble overeta0 = 1.0 / (1.0 + etap0);
704 NekDouble overeta1 = 1.0 / (1.0 + etap1);
705 NekDouble overeta2 = 1.0 / (1.0 + etap2);
724 for(i = 0; i < nquad0; ++i)
734 for(i = 0; i < nquad1; ++i)
744 for(i = 0; i < nquad2; ++i)
754 for(i = 0; i < nquad0; ++i)
764 for(i = 0; i < nquad1; ++i)
774 for(i = 0; i < nquad2; ++i)
787 ASSERTL0(
false,
"Expansion dimension not recognised");
806 const int nConvectiveFields,
815 boost::ignore_unused(advVel, time, pFwd, pBwd);
823 Basis = fields[0]->GetExp(0)->GetBase();
825 int nElements = fields[0]->GetExpSize();
826 int nDimensions = fields[0]->GetCoordim(0);
827 int nSolutionPts = fields[0]->GetTotPoints();
828 int nTracePts = fields[0]->GetTrace()->GetTotPoints();
829 int nCoeffs = fields[0]->GetNcoeffs();
843 for (i = 0; i < nConvectiveFields; ++i)
854 for (i = 0; i < nConvectiveFields; ++i)
860 fields[i]->GetFwdBwdTracePhys(inarray[i], Fwd[i], Bwd[i]);
879 for(i = 0; i < nConvectiveFields; ++i)
881 for (n = 0; n < nElements; n++)
883 phys_offset = fields[0]->GetPhys_Offset(n);
885 fields[i]->GetExp(n)->PhysDeriv(
886 0, fluxvector[i][0] + phys_offset,
887 auxArray2 = DfluxvectorX1 + phys_offset);
892 fluxvector[i][0], numflux[i], divFC);
900 &DfluxvectorX1[0], 1, &outarray[i][0], 1);
903 if (!(
Basis[0]->Collocation()))
905 fields[i]->FwdTrans(outarray[i], outarrayCoeff[i]);
906 fields[i]->BwdTrans(outarrayCoeff[i], outarray[i]);
922 for (i = 0; i < nConvectiveFields; ++i)
930 &fluxvector[i][0][0], 1,
932 &fluxvector[i][1][0], 1,
940 &fluxvector[i][0][0], 1,
942 &fluxvector[i][1][0], 1,
949 for (n = 0; n < nElements; n++)
951 phys_offset = fields[0]->GetPhys_Offset(n);
952 fields[0]->GetExp(n)->StdPhysDeriv(0,
953 auxArray1 = f_hat + phys_offset,
954 auxArray2 = DfluxvectorX1 + phys_offset);
955 fields[0]->GetExp(n)->StdPhysDeriv(1,
956 auxArray1 = g_hat + phys_offset,
957 auxArray2 = DfluxvectorX2 + phys_offset);
962 DfluxvectorX2, 1, divFD, 1);
965 if (
Basis[0]->GetPointsType() ==
967 Basis[1]->GetPointsType() ==
971 nConvectiveFields, fields, f_hat, g_hat,
977 nConvectiveFields, fields,
978 fluxvector[i][0], fluxvector[i][1],
989 &
m_jac[0], 1, &outarray[i][0], 1);
992 if (!(
Basis[0]->Collocation()))
994 fields[i]->FwdTrans(outarray[i], outarrayCoeff[i]);
995 fields[i]->BwdTrans(outarrayCoeff[i], outarray[i]);
1003 ASSERTL0(
false,
"3D FRDG case not implemented yet");
1020 const int nConvectiveFields,
1026 boost::ignore_unused(nConvectiveFields);
1029 int nLocalSolutionPts, phys_offset, t_offset;
1032 Basis = fields[0]->GetExp(0)->GetBasis(0);
1034 int nElements = fields[0]->GetExpSize();
1035 int nSolutionPts = fields[0]->GetTotPoints();
1038 vector<bool> negatedFluxNormal =
1039 std::static_pointer_cast<MultiRegions::DisContField>(
1040 fields[0])->GetNegatedFluxNormal();
1051 &elmtToTrace = fields[0]->GetTraceMap()->GetElmtToTrace();
1053 for (n = 0; n < nElements; ++n)
1055 nLocalSolutionPts = fields[0]->GetExp(n)->GetTotPoints();
1056 phys_offset = fields[0]->GetPhys_Offset(n);
1061 &fluxX1[phys_offset], 1,
1064 fields[0]->GetExp(n)->GetTracePhysVals(0, elmtToTrace[n][0],
1068 t_offset = fields[0]->GetTrace()
1069 ->GetPhys_Offset(elmtToTrace[n][0]->GetElmtId());
1071 if(negatedFluxNormal[2*n])
1073 JumpL[n] = numericalFlux[t_offset] - tmpFluxVertex[0];
1077 JumpL[n] = -numericalFlux[t_offset] - tmpFluxVertex[0];
1080 fields[0]->GetExp(n)->GetTracePhysVals(1, elmtToTrace[n][1],
1084 t_offset = fields[0]->GetTrace()
1085 ->GetPhys_Offset(elmtToTrace[n][1]->GetElmtId());
1087 if(negatedFluxNormal[2*n+1])
1089 JumpR[n] = -numericalFlux[t_offset] - tmpFluxVertex[0];
1093 JumpR[n] = numericalFlux[t_offset] - tmpFluxVertex[0];
1097 for (n = 0; n < nElements; ++n)
1099 nLocalSolutionPts = fields[0]->GetExp(n)->GetTotPoints();
1100 phys_offset = fields[0]->GetPhys_Offset(n);
1111 Vmath::Vadd(nLocalSolutionPts, &DCL[0], 1, &DCR[0], 1,
1112 &divCFlux[phys_offset], 1);
1129 const int nConvectiveFields,
1136 boost::ignore_unused(nConvectiveFields);
1138 int n, e, i, j, cnt;
1140 int nElements = fields[0]->GetExpSize();
1142 int nLocalSolutionPts, nEdgePts;
1143 int trace_offset, phys_offset;
1150 &elmtToTrace = fields[0]->GetTraceMap()->GetElmtToTrace();
1153 for(n = 0; n < nElements; ++n)
1156 phys_offset = fields[0]->GetPhys_Offset(n);
1157 nLocalSolutionPts = fields[0]->GetExp(n)->GetTotPoints();
1159 base = fields[0]->GetExp(n)->GetBase();
1160 nquad0 = base[0]->GetNumPoints();
1161 nquad1 = base[1]->GetNumPoints();
1169 for(e = 0; e < fields[0]->GetExp(n)->GetNtraces(); ++e)
1172 nEdgePts = fields[0]->GetExp(n)->GetTraceNumPoints(e);
1181 trace_offset = fields[0]->GetTrace()->GetPhys_Offset(
1182 elmtToTrace[n][e]->GetElmtId());
1186 fields[0]->GetExp(n)->GetTraceNormal(e);
1190 fields[0]->GetExp(n)->GetTracePhysVals(
1191 e, elmtToTrace[n][e],
1192 fluxX1 + phys_offset,
1193 auxArray1 = tmparrayX1);
1197 fields[0]->GetExp(n)->GetTracePhysVals(
1198 e, elmtToTrace[n][e],
1199 fluxX2 + phys_offset,
1200 auxArray1 = tmparrayX2);
1210 Vmath::Vsub(nEdgePts, &numericalFlux[trace_offset], 1,
1211 &fluxN[0], 1, &fluxJumps[0], 1);
1214 if (fields[0]->GetExp(n)->GetTraceOrient(e) ==
1221 for (i = 0; i < nEdgePts; ++i)
1226 fluxJumps[i] = -fluxJumps[i];
1234 for (i = 0; i < nquad0; ++i)
1237 fluxJumps[i] = -(
m_Q2D_e0[n][i]) * fluxJumps[i];
1239 for (j = 0; j < nquad1; ++j)
1242 divCFluxE0[cnt] = fluxJumps[i] *
m_dGL_xi2[n][j];
1247 for (i = 0; i < nquad1; ++i)
1250 fluxJumps[i] = (
m_Q2D_e1[n][i]) * fluxJumps[i];
1252 for (j = 0; j < nquad0; ++j)
1254 cnt = (nquad0)*i + j;
1255 divCFluxE1[cnt] = fluxJumps[i] *
m_dGR_xi1[n][j];
1260 for (i = 0; i < nquad0; ++i)
1263 fluxJumps[i] = (
m_Q2D_e2[n][i]) * fluxJumps[i];
1265 for (j = 0; j < nquad1; ++j)
1268 divCFluxE2[cnt] = fluxJumps[i] *
m_dGR_xi2[n][j];
1273 for (i = 0; i < nquad1; ++i)
1276 fluxJumps[i] = -(
m_Q2D_e3[n][i]) * fluxJumps[i];
1277 for (j = 0; j < nquad0; ++j)
1280 divCFluxE3[cnt] = fluxJumps[i] *
m_dGL_xi1[n][j];
1285 ASSERTL0(
false,
"edge value (< 3) is out of range");
1292 &divCFluxE1[0], 1, &divCFlux[phys_offset], 1);
1294 Vmath::Vadd(nLocalSolutionPts, &divCFlux[phys_offset], 1,
1295 &divCFluxE2[0], 1, &divCFlux[phys_offset], 1);
1297 Vmath::Vadd(nLocalSolutionPts, &divCFlux[phys_offset], 1,
1298 &divCFluxE3[0], 1, &divCFlux[phys_offset], 1);
1317 const int nConvectiveFields,
1324 boost::ignore_unused(nConvectiveFields);
1326 int n, e, i, j, cnt;
1328 int nElements = fields[0]->GetExpSize();
1329 int nLocalSolutionPts;
1340 &elmtToTrace = fields[0]->GetTraceMap()->GetElmtToTrace();
1343 for(n = 0; n < nElements; ++n)
1346 phys_offset = fields[0]->GetPhys_Offset(n);
1347 nLocalSolutionPts = fields[0]->GetExp(n)->GetTotPoints();
1349 base = fields[0]->GetExp(n)->GetBase();
1350 nquad0 = base[0]->GetNumPoints();
1351 nquad1 = base[1]->GetNumPoints();
1359 for(e = 0; e < fields[0]->GetExp(n)->GetNtraces(); ++e)
1362 nEdgePts = fields[0]->GetExp(n)->GetTraceNumPoints(e);
1371 trace_offset = fields[0]->GetTrace()->GetPhys_Offset(
1372 elmtToTrace[n][e]->GetElmtId());
1376 fields[0]->GetExp(n)->GetTraceNormal(e);
1385 fields[0]->GetExp(n)->GetTracePhysVals(
1386 e, elmtToTrace[n][e],
1387 fluxX2 + phys_offset,
1388 auxArray1 = fluxN_D);
1394 &numericalFlux[trace_offset], 1,
1398 if (fields[0]->GetExp(n)->GetTraceOrient(e) ==
1402 auxArray1 = fluxN, 1,
1403 auxArray2 = fluxN, 1);
1406 auxArray1 = fluxN_D, 1,
1407 auxArray2 = fluxN_D, 1);
1411 for (i = 0; i < nquad0; ++i)
1414 fluxN_R[i] = (
m_Q2D_e0[n][i]) * fluxN[i];
1417 for (i = 0; i < nEdgePts; ++i)
1424 fluxN_R[i] = -fluxN_R[i];
1432 &fluxN_D[0], 1, &fluxJumps[0], 1);
1436 for (i = 0; i < nquad0; ++i)
1438 for (j = 0; j < nquad1; ++j)
1450 fields[0]->GetExp(n)->GetTracePhysVals(
1451 e, elmtToTrace[n][e],
1452 fluxX1 + phys_offset,
1453 auxArray1 = fluxN_D);
1457 &numericalFlux[trace_offset], 1,
1461 if (fields[0]->GetExp(n)->GetTraceOrient(e) ==
1465 auxArray1 = fluxN, 1,
1466 auxArray2 = fluxN, 1);
1469 auxArray1 = fluxN_D, 1,
1470 auxArray2 = fluxN_D, 1);
1474 for (i = 0; i < nquad1; ++i)
1477 fluxN_R[i] = (
m_Q2D_e1[n][i]) * fluxN[i];
1480 for (i = 0; i < nEdgePts; ++i)
1487 fluxN_R[i] = -fluxN_R[i];
1495 &fluxN_D[0], 1, &fluxJumps[0], 1);
1499 for (i = 0; i < nquad1; ++i)
1501 for (j = 0; j < nquad0; ++j)
1503 cnt = (nquad0)*i + j;
1515 fields[0]->GetExp(n)->GetTracePhysVals(
1516 e, elmtToTrace[n][e],
1517 fluxX2 + phys_offset,
1518 auxArray1 = fluxN_D);
1522 &numericalFlux[trace_offset], 1,
1526 if (fields[0]->GetExp(n)->GetTraceOrient(e) ==
1530 auxArray1 = fluxN, 1,
1531 auxArray2 = fluxN, 1);
1534 auxArray1 = fluxN_D, 1,
1535 auxArray2 = fluxN_D, 1);
1539 for (i = 0; i < nquad0; ++i)
1542 fluxN_R[i] = (
m_Q2D_e2[n][i]) * fluxN[i];
1545 for (i = 0; i < nEdgePts; ++i)
1552 fluxN_R[i] = -fluxN_R[i];
1561 &fluxN_D[0], 1, &fluxJumps[0], 1);
1565 for (i = 0; i < nquad0; ++i)
1567 for (j = 0; j < nquad1; ++j)
1580 fields[0]->GetExp(n)->GetTracePhysVals(
1581 e, elmtToTrace[n][e],
1582 fluxX1 + phys_offset,
1583 auxArray1 = fluxN_D);
1588 &numericalFlux[trace_offset], 1,
1592 if (fields[0]->GetExp(n)->GetTraceOrient(e) ==
1596 auxArray1 = fluxN, 1,
1597 auxArray2 = fluxN, 1);
1600 auxArray1 = fluxN_D, 1,
1601 auxArray2 = fluxN_D, 1);
1605 for (i = 0; i < nquad1; ++i)
1608 fluxN_R[i] = (
m_Q2D_e3[n][i]) * fluxN[i];
1611 for (i = 0; i < nEdgePts; ++i)
1618 fluxN_R[i] = -fluxN_R[i];
1627 &fluxN_D[0], 1, &fluxJumps[0], 1);
1631 for (i = 0; i < nquad1; ++i)
1633 for (j = 0; j < nquad0; ++j)
1642 ASSERTL0(
false,
"edge value (< 3) is out of range");
1650 &divCFluxE1[0], 1, &divCFlux[phys_offset], 1);
1652 Vmath::Vadd(nLocalSolutionPts, &divCFlux[phys_offset], 1,
1653 &divCFluxE2[0], 1, &divCFlux[phys_offset], 1);
1655 Vmath::Vadd(nLocalSolutionPts, &divCFlux[phys_offset], 1,
1656 &divCFluxE3[0], 1, &divCFlux[phys_offset], 1);
1675 const int nConvectiveFields,
1683 boost::ignore_unused(nConvectiveFields, fields, fluxX1, fluxX2,
1684 fluxX3, numericalFlux, divCFlux);
#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
Array< OneD, Array< OneD, NekDouble > > m_dGL_xi1
virtual void v_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.
virtual void v_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_dGR_xi3
Array< OneD, Array< OneD, NekDouble > > m_dGR_xi1
virtual 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)
Compute the advection term at each time-step using the Flux Reconstruction approach (FR).
Array< OneD, Array< OneD, NekDouble > > m_dGR_xi2
Array< OneD, Array< OneD, NekDouble > > m_dGL_xi3
Array< OneD, NekDouble > m_jac
virtual void v_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_Q2D_e0
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e3
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e1
virtual void v_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".
Array< OneD, Array< OneD, NekDouble > > m_dGL_xi2
virtual void v_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...
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initiliase AdvectionFR objects and store them before starting the time-stepping.
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
virtual void v_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.
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.
The above copyright notice and this permission notice shall be included.
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.