42 string AlternateSkewAdvection::className =
44 "AlternateSkew", AlternateSkewAdvection::create,
45 "Alternating Skew Symmetric");
53 AlternateSkewAdvection::AlternateSkewAdvection() :
Advection()
65 boost::ignore_unused(fields);
67 pSession->MatchSolverInfo(
"ModeType",
"SingleMode",
m_SingleMode,
false);
68 pSession->MatchSolverInfo(
"ModeType",
"HalfMode",
m_HalfMode,
false);
72 const int nConvectiveFields,
80 boost::ignore_unused(time, pFwd, pBwd);
83 int ndim = advVel.size();
84 int nPointsTot = fields[0]->GetNpoints();
86 for (
int i = 0; i < ndim; ++i)
91 fields[i]->HomogeneousBwdTrans(nPointsTot, advVel[i], velocity[i]);
95 velocity[i] = advVel[i];
98 for (
int n = 0; n < nConvectiveFields; ++n)
112 fields[0]->PhysDeriv(inarray[n], gradV0);
118 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[0], 1,
120 fields[0]->PhysDeriv(gradV0, outarray[n]);
122 Vmath::Smul(nPointsTot, 0.5, outarray[n], 1, outarray[n],
129 fields[0]->PhysDeriv(inarray[n], gradV0, gradV1);
133 outarray[n], 1, outarray[n], 1);
137 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[0], 1,
139 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[1], 1,
142 gradV0, outarray[n]);
145 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n],
148 Vmath::Smul(nPointsTot, 1.0, outarray[n], 1, outarray[n],
158 if (fields[0]->GetWaveSpace() ==
true)
164 fields[0]->PhysDeriv(inarray[n], gradV0, gradV1,
166 fields[0]->HomogeneousBwdTrans(nPointsTot, gradV0, tmp);
169 fields[0]->HomogeneousBwdTrans(nPointsTot, gradV1, tmp);
171 outarray[n], 1, outarray[n],
173 fields[0]->HomogeneousBwdTrans(nPointsTot, gradV2, tmp);
175 outarray[n], 1, outarray[n],
181 fields[0]->HomogeneousBwdTrans(nPointsTot, inarray[n],
183 Vmath::Vmul(nPointsTot, Up, 1, velocity[0], 1, gradV0,
185 Vmath::Vmul(nPointsTot, Up, 1, velocity[1], 1, gradV1,
187 Vmath::Vmul(nPointsTot, Up, 1, velocity[2], 1, gradV2,
190 fields[0]->SetWaveSpace(
false);
192 gradV0, outarray[n]);
201 fields[0]->SetWaveSpace(
true);
206 fields[0]->HomogeneousFwdTrans(nPointsTot, tmp,
213 fields[0]->PhysDeriv(inarray[n], gradV0, gradV1,
218 outarray[n], 1, outarray[n], 1);
220 outarray[n], 1, outarray[n], 1);
224 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[0], 1,
226 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[1], 1,
228 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[2], 1,
231 gradV0, outarray[n]);
241 Vmath::Smul(nPointsTot, 1.0, outarray[n], 1, outarray[n],
246 ASSERTL0(
false,
"dimension unknown");
#define ASSERTL0(condition, msg)
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.
virtual ~AlternateSkewAdvection()
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) override
Initialises the advection object.
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.
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 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.