43 "Alternating Skew Symmetric");
59 pSession->MatchSolverInfo(
"ModeType",
"SingleMode",
m_SingleMode,
false);
60 pSession->MatchSolverInfo(
"ModeType",
"HalfMode",
m_HalfMode,
false);
64 const int nConvectiveFields,
74 int ndim = advVel.size();
75 int nPointsTot = fields[0]->GetNpoints();
77 for (
int i = 0; i < ndim; ++i)
82 fields[i]->HomogeneousBwdTrans(nPointsTot, advVel[i], velocity[i]);
86 velocity[i] = advVel[i];
89 for (
int n = 0; n < nConvectiveFields; ++n)
103 fields[0]->PhysDeriv(inarray[n], gradV0);
109 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[0], 1,
111 fields[0]->PhysDeriv(gradV0, outarray[n]);
113 Vmath::Smul(nPointsTot, 0.5, outarray[n], 1, outarray[n],
120 fields[0]->PhysDeriv(inarray[n], gradV0, gradV1);
124 outarray[n], 1, outarray[n], 1);
128 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[0], 1,
130 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[1], 1,
133 gradV0, outarray[n]);
136 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n],
139 Vmath::Smul(nPointsTot, 1.0, outarray[n], 1, outarray[n],
149 if (fields[0]->GetWaveSpace() ==
true)
155 fields[0]->PhysDeriv(inarray[n], gradV0, gradV1,
157 fields[0]->HomogeneousBwdTrans(nPointsTot, gradV0, tmp);
160 fields[0]->HomogeneousBwdTrans(nPointsTot, gradV1, tmp);
162 outarray[n], 1, outarray[n],
164 fields[0]->HomogeneousBwdTrans(nPointsTot, gradV2, tmp);
166 outarray[n], 1, outarray[n],
172 fields[0]->HomogeneousBwdTrans(nPointsTot, inarray[n],
174 Vmath::Vmul(nPointsTot, Up, 1, velocity[0], 1, gradV0,
176 Vmath::Vmul(nPointsTot, Up, 1, velocity[1], 1, gradV1,
178 Vmath::Vmul(nPointsTot, Up, 1, velocity[2], 1, gradV2,
181 fields[0]->SetWaveSpace(
false);
183 gradV0, outarray[n]);
192 fields[0]->SetWaveSpace(
true);
197 fields[0]->HomogeneousFwdTrans(nPointsTot, tmp,
204 fields[0]->PhysDeriv(inarray[n], gradV0, gradV1,
209 outarray[n], 1, outarray[n], 1);
211 outarray[n], 1, outarray[n], 1);
215 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[0], 1,
217 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[1], 1,
219 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[2], 1,
222 gradV0, outarray[n]);
232 Vmath::Smul(nPointsTot, 1.0, outarray[n], 1, outarray[n],
237 ASSERTL0(
false,
"dimension unknown");
#define ASSERTL0(condition, msg)
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.