35 #include <boost/core/ignore_unused.hpp>
81 const int nConvectiveFields,
92 boost::ignore_unused(advVel, time);
93 size_t nCoeffs = fields[0]->GetNcoeffs();
96 for (
int i = 0; i < nConvectiveFields; ++i)
103 tmp, time, pFwd, pBwd);
111 for (
int i = 0; i < nConvectiveFields; ++i)
113 fields[i]->BwdTrans(tmp[i], outarray[i]);
122 const int nConvectiveFields,
130 size_t nPointsTot = fields[0]->GetTotPoints();
131 size_t nCoeffs = fields[0]->GetNcoeffs();
132 size_t nTracePointsTot = fields[0]->GetTrace()->GetTotPoints();
137 for (
int i = 0; i < nConvectiveFields; ++i)
155 for (
int i = 0; i < nConvectiveFields; ++i)
157 Vmath::Fill(outarray[i].size(), 0.0, outarray[i], 1);
158 fields[i]->IProductWRTDerivBase(fluxvector[i], outarray[i]);
165 for (
int i = 0; i < nConvectiveFields; ++i)
174 for (
int i = 0; i < nConvectiveFields; ++i)
179 fields[i]->AddTraceIntegral(numflux[i], outarray[i]);
184 fields[i]->MultiplyByElmtInvMass(outarray[i], outarray[i]);
191 const int nConvectiveFields,
199 boost::ignore_unused(advVel, time);
200 int nTracePointsTot = fields[0]->GetTrace()->GetTotPoints();
210 for (
int i = 0; i < nConvectiveFields; ++i)
214 fields[i]->GetFwdBwdTracePhys(inarray[i], Fwd[i], Bwd[i]);
219 for (
int i = 0; i < nConvectiveFields; ++i)
235 const int &nConvectiveFields,
240 std::shared_ptr<LocalRegions::ExpansionVector> pexp = explist->GetExp();
241 int nTotElmt = (*pexp).size();
242 int nElmtPnt, nElmtCoef;
254 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
256 nElmtCoef = (*pexp)[nelmt]->GetNcoeffs();
257 nElmtPnt = (*pexp)[nelmt]->GetTotPoints();
258 elmtpnts[nelmt] = nElmtPnt;
259 elmtcoef[nelmt] = nElmtCoef;
265 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
267 nElmtCoef = elmtcoef[nelmt];
268 mtxPerVarCoeff[nelmt] =
272 for (
int m = 0; m < nConvectiveFields; m++)
274 for (
int n = 0; n < nConvectiveFields; n++)
276 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
278 (*mtxPerVarCoeff[nelmt]) = 0.0;
279 (*mtxPerVar[nelmt]) = 0.0;
282 explist->GetMatIpwrtDeriveBase(ElmtJacArray[m][n], mtxPerVar);
284 explist->AddRightIPTBaseMatrix(mtxPerVar, mtxPerVarCoeff);
286 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
288 nElmtCoef = elmtcoef[nelmt];
289 nElmtPnt = elmtpnts[nelmt];
290 int ntotDofs = nElmtCoef * nElmtCoef;
292 if (Elmt_dataSingle.size() < ntotDofs)
297 tmpGmtx = gmtxarray[m][n]->GetBlock(nelmt, nelmt);
298 ElmtMat = mtxPerVarCoeff[nelmt];
300 GMat_data = tmpGmtx->GetPtr();
301 Elmt_data = ElmtMat->GetPtr();
303 for (
int i = 0; i < ntotDofs; i++)
305 Elmt_dataSingle[i] =
NekSingle(Elmt_data[i]);
308 Vmath::Vadd(ntotDofs, GMat_data, 1, Elmt_dataSingle, 1,
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
void AccumulateRegion(std::string, int iolevel=0)
Accumulate elapsed time for a region.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
int m_spaceDim
Storage for space dimension. Used for homogeneous extension.
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.
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) override
Initialise AdvectionWeakDG objects and store them before starting the time-stepping.
virtual void v_AddVolumJacToMat(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const int &nConvectiveFields, const TensorOfArray5D< NekDouble > &ElmtJacArray, Array< OneD, Array< OneD, SNekBlkMatSharedPtr >> &gmtxarray) override
virtual void v_AdvectTraceFlux(const int nConvective, 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 >> &TraceFlux, const NekDouble &time, const Array< OneD, Array< OneD, NekDouble >> &pFwd=NullNekDoubleArrayOfArray, const Array< OneD, Array< OneD, NekDouble >> &pBwd=NullNekDoubleArrayOfArray) override
Advects Trace Flux.
virtual void v_AdvectVolumeFlux(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble >> &advVel, const Array< OneD, Array< OneD, NekDouble >> &inarray, TensorOfArray3D< NekDouble > &VolumeFlux, const NekDouble &time) override
Advects Volume Flux.
static AdvectionSharedPtr create(std::string advType)
virtual void v_Advect(const int nConvective, 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 Discontinuous Galerkin approach (DG).
virtual void v_AdvectCoeffs(const int nConvective, 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
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
The above copyright notice and this permission notice shall be included.
std::shared_ptr< SNekMat > SNekMatSharedPtr
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayOfArray
std::shared_ptr< DNekMat > DNekMatSharedPtr
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 Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.