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,
95 boost::ignore_unused(time, pFwd, pBwd);
97 int nqtot = fields[0]->GetTotPoints();
98 ASSERTL1(nConvectiveFields == inarray.size(),
99 "Number of convective fields and Inarray are not compatible");
102 int ndim = advVel.size();
109 for (
int i = 0; i < ndim; ++i)
115 fields[i]->HomogeneousBwdTrans(nqtot, advVel[i], velocity[i]);
119 velocity[i] = advVel[i];
123 int nPointsTot = fields[0]->GetNpoints();
131 nPointsTot = fields[0]->Get1DScaledTotPoints(OneDptscale);
137 for (
int i = 0; i < ndim; ++i)
142 fields[0]->PhysInterp1DScaled(OneDptscale, velocity[i], AdvVel[i]);
149 for (
int i = 0; i < ndim; ++i)
151 AdvVel[i] = velocity[i];
162 for (
int n = 0; n < nConvectiveFields; ++n)
164 fields[0]->PhysDeriv(inarray[n], grad0);
168 fields[0]->PhysInterp1DScaled(OneDptscale, grad0, wkSp);
169 Vmath::Vmul(nPointsTot, wkSp, 1, AdvVel[0], 1, Outarray, 1);
172 fields[0]->PhysGalerkinProjection1DScaled(
173 OneDptscale, Outarray, outarray[n]);
179 Vmath::Vmul(nPointsTot, grad0, 1, AdvVel[0], 1, outarray[n],
187 for (
int n = 0; n < nConvectiveFields; ++n)
189 fields[0]->PhysDeriv(inarray[n], grad0, grad1);
194 fields[0]->PhysInterp1DScaled(OneDptscale, grad0, wkSp);
195 Vmath::Vmul(nPointsTot, wkSp, 1, AdvVel[0], 1, Outarray, 1);
197 fields[0]->PhysInterp1DScaled(OneDptscale, grad1, wkSp);
200 Vmath::Vvtvp(nPointsTot, wkSp, 1, AdvVel[1], 1, Outarray, 1,
204 fields[0]->PhysGalerkinProjection1DScaled(
205 OneDptscale, Outarray, outarray[n]);
211 Vmath::Vmul(nPointsTot, grad0, 1, AdvVel[0], 1, outarray[n],
214 outarray[n], 1, outarray[n], 1);
223 ndim * nConvectiveFields);
225 for (
int i = 0; i < ndim; i++)
229 for (
int i = 0; i < ndim * nConvectiveFields; i++)
233 for (
int i = 0; i < nConvectiveFields; i++)
238 for (
int n = 0; n < nConvectiveFields; n++)
240 fields[0]->PhysDeriv(inarray[n], grad[0], grad[1], grad[2]);
241 for (
int i = 0; i < ndim; i++)
244 fields[0]->PhysInterp1DScaled(OneDptscale, grad[i],
245 gradScaled[n * ndim + i]);
251 fields[0]->DealiasedDotProd(nPointsTot, AdvVel, gradScaled,
255 for (
int n = 0; n < nConvectiveFields; n++)
257 fields[0]->PhysGalerkinProjection1DScaled(
258 OneDptscale, Outarray[n], outarray[n]);
269 for (
int i = 0; i < ndim * nConvectiveFields; i++)
273 for (
int i = 0; i < nConvectiveFields; i++)
278 for (
int n = 0; n < nConvectiveFields; n++)
280 fields[0]->PhysDeriv(inarray[n], grad[n * ndim + 0],
285 fields[0]->DealiasedDotProd(nPointsTot, AdvVel, grad, outarray);
293 for (
int n = 0; n < nConvectiveFields; ++n)
295 if (fields[0]->GetWaveSpace() ==
true &&
298 fields[0]->HomogeneousBwdTrans(nqtot, inarray[n], tmp);
299 fields[0]->PhysDeriv(tmp, grad0, grad1);
302 inarray[n], outarray[n]);
303 fields[0]->HomogeneousBwdTrans(nqtot, outarray[n],
306 else if (fields[0]->GetWaveSpace() ==
true &&
309 fields[0]->HomogeneousBwdTrans(nqtot, inarray[n], tmp);
310 fields[0]->PhysDeriv(tmp, grad0);
313 inarray[n], outarray[n]);
314 fields[0]->HomogeneousBwdTrans(nqtot, outarray[n],
318 inarray[n], outarray[n]);
319 fields[0]->HomogeneousBwdTrans(nqtot, outarray[n],
324 fields[0]->PhysDeriv(inarray[n], grad0, grad1, grad2);
331 fields[0]->PhysInterp1DScaled(OneDptscale, grad0, wkSp);
334 Vmath::Vmul(nPointsTot, wkSp, 1, AdvVel[0], 1, Outarray,
338 fields[0]->PhysInterp1DScaled(OneDptscale, grad1, wkSp);
342 Outarray, 1, Outarray, 1);
345 fields[0]->PhysInterp1DScaled(OneDptscale, grad2, wkSp);
349 Outarray, 1, Outarray, 1);
351 fields[0]->PhysGalerkinProjection1DScaled(
352 OneDptscale, Outarray, outarray[n]);
361 outarray[n], 1, outarray[n], 1);
363 outarray[n], 1, outarray[n], 1);
366 if (fields[0]->GetWaveSpace() ==
true)
368 fields[0]->HomogeneousFwdTrans(nqtot, outarray[n],
375 ASSERTL0(
false,
"dimension unknown");
378 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
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) override
Initialises the advection object.
static SolverUtils::AdvectionSharedPtr create(std::string)
Creates an instance of this class.
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) override
Advects a vector field.
static std::string className
Name of class.
static std::string navierStokesAdvectionTypeLookupIds[]
bool m_homogen_dealiasing
virtual ~NavierStokesAdvection()
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.
The above copyright notice and this permission notice shall be included.
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