45 "Alternating Skew Symmetric");
65 pSession->MatchSolverInfo(
"ModeType",
"SingleMode",
m_SingleMode,
false);
66 pSession->MatchSolverInfo(
"ModeType",
"HalfMode",
m_HalfMode,
false);
70 const int nConvectiveFields,
80 int ndim = advVel.size();
81 int nPointsTot = fields[0]->GetNpoints();
83 for (
int i = 0; i < ndim; ++i)
88 fields[i]->HomogeneousBwdTrans(nPointsTot, advVel[i], velocity[i]);
92 velocity[i] = advVel[i];
95 for (
int n = 0; n < nConvectiveFields; ++n)
109 fields[0]->PhysDeriv(inarray[n], gradV0);
115 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[0], 1,
117 fields[0]->PhysDeriv(gradV0, outarray[n]);
119 Vmath::Smul(nPointsTot, 0.5, outarray[n], 1, outarray[n],
126 fields[0]->PhysDeriv(inarray[n], gradV0, gradV1);
130 outarray[n], 1, outarray[n], 1);
134 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[0], 1,
136 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[1], 1,
139 gradV0, outarray[n]);
142 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n],
145 Vmath::Smul(nPointsTot, 1.0, outarray[n], 1, outarray[n],
155 if (fields[0]->GetWaveSpace() ==
true)
161 fields[0]->PhysDeriv(inarray[n], gradV0, gradV1,
163 fields[0]->HomogeneousBwdTrans(nPointsTot, gradV0, tmp);
166 fields[0]->HomogeneousBwdTrans(nPointsTot, gradV1, tmp);
168 outarray[n], 1, outarray[n],
170 fields[0]->HomogeneousBwdTrans(nPointsTot, gradV2, tmp);
172 outarray[n], 1, outarray[n],
178 fields[0]->HomogeneousBwdTrans(nPointsTot, inarray[n],
180 Vmath::Vmul(nPointsTot, Up, 1, velocity[0], 1, gradV0,
182 Vmath::Vmul(nPointsTot, Up, 1, velocity[1], 1, gradV1,
184 Vmath::Vmul(nPointsTot, Up, 1, velocity[2], 1, gradV2,
187 fields[0]->SetWaveSpace(
false);
189 gradV0, outarray[n]);
198 fields[0]->SetWaveSpace(
true);
203 fields[0]->HomogeneousFwdTrans(nPointsTot, tmp,
210 fields[0]->PhysDeriv(inarray[n], gradV0, gradV1,
215 outarray[n], 1, outarray[n], 1);
217 outarray[n], 1, outarray[n], 1);
221 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[0], 1,
223 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[1], 1,
225 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[2], 1,
228 gradV0, outarray[n]);
238 Vmath::Smul(nPointsTot, 1.0, outarray[n], 1, outarray[n],
243 ASSERTL0(
false,
"dimension unknown");
#define ASSERTL0(condition, msg)
~AlternateSkewAdvection() 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.
void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) override
Initialises the advection object.
static std::string className
Name of class.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
An abstract base class encapsulating the concept of advection of a vector field.
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 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
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.