78 pSession->MatchSolverInfo(
"SPECTRALHPDEALIASING",
"True",
80 pSession->MatchSolverInfo(
"ModeType",
"SingleMode",
m_SingleMode,
false);
81 pSession->MatchSolverInfo(
"ModeType",
"HalfMode",
m_HalfMode,
false);
87 const int nConvectiveFields,
96 int nqtot = fields[0]->GetTotPoints();
97 ASSERTL1(nConvectiveFields == inarray.size(),
98 "Number of convective fields and Inarray are not compatible");
101 int ndim = advVel.size();
108 for (
int i = 0; i < ndim; ++i)
114 fields[i]->HomogeneousBwdTrans(nqtot, advVel[i], velocity[i]);
118 velocity[i] = advVel[i];
122 int nPointsTot = fields[0]->GetNpoints();
130 nPointsTot = fields[0]->Get1DScaledTotPoints(OneDptscale);
136 for (
int i = 0; i < ndim; ++i)
141 fields[0]->PhysInterp1DScaled(OneDptscale, velocity[i], AdvVel[i]);
148 for (
int i = 0; i < ndim; ++i)
150 AdvVel[i] = velocity[i];
161 for (
int n = 0; n < nConvectiveFields; ++n)
163 fields[0]->PhysDeriv(inarray[n], grad0);
167 fields[0]->PhysInterp1DScaled(OneDptscale, grad0, wkSp);
168 Vmath::Vmul(nPointsTot, wkSp, 1, AdvVel[0], 1, Outarray, 1);
171 fields[0]->PhysGalerkinProjection1DScaled(
172 OneDptscale, Outarray, outarray[n]);
178 Vmath::Vmul(nPointsTot, grad0, 1, AdvVel[0], 1, outarray[n],
186 for (
int n = 0; n < nConvectiveFields; ++n)
188 fields[0]->PhysDeriv(inarray[n], grad0, grad1);
193 fields[0]->PhysInterp1DScaled(OneDptscale, grad0, wkSp);
194 Vmath::Vmul(nPointsTot, wkSp, 1, AdvVel[0], 1, Outarray, 1);
196 fields[0]->PhysInterp1DScaled(OneDptscale, grad1, wkSp);
199 Vmath::Vvtvp(nPointsTot, wkSp, 1, AdvVel[1], 1, Outarray, 1,
203 fields[0]->PhysGalerkinProjection1DScaled(
204 OneDptscale, Outarray, outarray[n]);
210 Vmath::Vmul(nPointsTot, grad0, 1, AdvVel[0], 1, outarray[n],
213 outarray[n], 1, outarray[n], 1);
222 ndim * nConvectiveFields);
224 for (
int i = 0; i < ndim; i++)
228 for (
int i = 0; i < ndim * nConvectiveFields; i++)
232 for (
int i = 0; i < nConvectiveFields; i++)
237 for (
int n = 0; n < nConvectiveFields; n++)
239 fields[0]->PhysDeriv(inarray[n], grad[0], grad[1], grad[2]);
240 for (
int i = 0; i < ndim; i++)
243 fields[0]->PhysInterp1DScaled(OneDptscale, grad[i],
244 gradScaled[n * ndim + i]);
250 fields[0]->DealiasedDotProd(nPointsTot, AdvVel, gradScaled,
254 for (
int n = 0; n < nConvectiveFields; n++)
256 fields[0]->PhysGalerkinProjection1DScaled(
257 OneDptscale, Outarray[n], outarray[n]);
268 for (
int i = 0; i < ndim * nConvectiveFields; i++)
272 for (
int i = 0; i < nConvectiveFields; i++)
277 for (
int n = 0; n < nConvectiveFields; n++)
279 fields[0]->PhysDeriv(inarray[n], grad[n * ndim + 0],
284 fields[0]->DealiasedDotProd(nPointsTot, AdvVel, grad, outarray);
292 for (
int n = 0; n < nConvectiveFields; ++n)
294 if (fields[0]->GetWaveSpace() ==
true &&
297 fields[0]->HomogeneousBwdTrans(nqtot, inarray[n], tmp);
298 fields[0]->PhysDeriv(tmp, grad0, grad1);
301 inarray[n], outarray[n]);
302 fields[0]->HomogeneousBwdTrans(nqtot, outarray[n],
305 else if (fields[0]->GetWaveSpace() ==
true &&
308 fields[0]->HomogeneousBwdTrans(nqtot, inarray[n], tmp);
309 fields[0]->PhysDeriv(tmp, grad0);
312 inarray[n], outarray[n]);
313 fields[0]->HomogeneousBwdTrans(nqtot, outarray[n],
317 inarray[n], outarray[n]);
318 fields[0]->HomogeneousBwdTrans(nqtot, outarray[n],
323 fields[0]->PhysDeriv(inarray[n], grad0, grad1, grad2);
330 fields[0]->PhysInterp1DScaled(OneDptscale, grad0, wkSp);
333 Vmath::Vmul(nPointsTot, wkSp, 1, AdvVel[0], 1, Outarray,
337 fields[0]->PhysInterp1DScaled(OneDptscale, grad1, wkSp);
341 Outarray, 1, Outarray, 1);
344 fields[0]->PhysInterp1DScaled(OneDptscale, grad2, wkSp);
348 Outarray, 1, Outarray, 1);
350 fields[0]->PhysGalerkinProjection1DScaled(
351 OneDptscale, Outarray, outarray[n]);
360 outarray[n], 1, outarray[n], 1);
362 outarray[n], 1, outarray[n], 1);
365 if (fields[0]->GetWaveSpace() ==
true)
367 fields[0]->HomogeneousFwdTrans(nqtot, outarray[n],
374 ASSERTL0(
false,
"dimension unknown");
377 for (
int n = 0; n < nConvectiveFields; ++n)
#define ASSERTL0(condition, msg)
#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.
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.
void AccumulateRegion(std::string, int iolevel=0)
Accumulate elapsed time for a region.
static std::string className2
void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) override
Initialises the advection object.
~NavierStokesAdvection() override
static SolverUtils::AdvectionSharedPtr create(std::string)
Creates an instance of this class.
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
Advects a vector field.
static std::string className
Name of class.
static std::string navierStokesAdvectionTypeLookupIds[]
bool m_homogen_dealiasing
An abstract base class encapsulating the concept of advection of a vector field.
virtual SOLVER_UTILS_EXPORT void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initialises the advection object.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
MultiRegions::Direction const DirCartesianMap[]
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
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 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