Compute the advection term at each time-step using the Discontinuous Glaerkin approach (DG).
84 int nPointsTot = fields[0]->GetTotPoints();
85 int nCoeffs = fields[0]->GetNcoeffs();
86 int nTracePointsTot = fields[0]->GetTrace()->GetTotPoints();
89 Array<OneD, Array<OneD, NekDouble> > tmp(nConvectiveFields);
90 Array<OneD, Array<OneD, Array<OneD, NekDouble> > > fluxvector(
94 for (i = 0; i < nConvectiveFields; ++i)
97 Array<OneD, Array<OneD, NekDouble> >(
m_spaceDim);
100 fluxvector[i][j] = Array<OneD, NekDouble>(nPointsTot);
105 "Riemann solver must be provided for AdvectionWeakDG.");
110 for(i = 0; i < nConvectiveFields; ++i)
112 tmp[i] = Array<OneD, NekDouble>(nCoeffs, 0.0);
114 fields[i]->IProductWRTDerivBase(fluxvector[i],tmp[i]);
118 Array<OneD, Array<OneD, NekDouble> > Fwd (nConvectiveFields);
119 Array<OneD, Array<OneD, NekDouble> > Bwd (nConvectiveFields);
120 Array<OneD, Array<OneD, NekDouble> > numflux(nConvectiveFields);
122 for(i = 0; i < nConvectiveFields; ++i)
124 Fwd[i] = Array<OneD, NekDouble>(nTracePointsTot, 0.0);
125 Bwd[i] = Array<OneD, NekDouble>(nTracePointsTot, 0.0);
126 numflux[i] = Array<OneD, NekDouble>(nTracePointsTot, 0.0);
127 fields[i]->GetFwdBwdTracePhys(inarray[i], Fwd[i], Bwd[i]);
133 for(i = 0; i < nConvectiveFields; ++i)
136 fields[i]->AddTraceIntegral (numflux[i], tmp[i]);
137 fields[i]->MultiplyByElmtInvMass(tmp[i], tmp[i]);
138 fields[i]->BwdTrans (tmp[i], outarray[i]);
RiemannSolverSharedPtr m_riemann
Riemann solver for DG-type schemes.
void Neg(int n, T *x, const int incx)
Negate x = -x.
AdvectionFluxVecCB m_fluxVector
Callback function to the flux vector (set when advection is in conservative form).
int m_spaceDim
Storage for space dimension. Used for homogeneous extension.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...