41 string SkewSymmetricAdvection::className
44 SkewSymmetricAdvection::create);
49 SkewSymmetricAdvection::SkewSymmetricAdvection():
74 pSession->MatchSolverInfo(
"ModeType",
"SingleMode",
m_SingleMode,
false);
75 pSession->MatchSolverInfo(
"ModeType",
"HalfMode",
m_HalfMode,
false);
83 const int nConvectiveFields,
93 int ndim = advVel.size();
94 int nqtot = fields[0]->GetTotPoints();
95 ASSERTL1(nConvectiveFields == inarray.size(),
"Number of convective fields and Inarray are not compatible");
98 for(
int i = 0; i < ndim; ++i)
103 fields[i]->HomogeneousBwdTrans(advVel[i],velocity[i]);
107 velocity[i] = advVel[i];
111 for(
int n = 0; n < nConvectiveFields; ++n)
115 int nPointsTot = fields[0]->GetNpoints();
125 fields[0]->PhysDeriv(inarray[n],gradV0);
126 Vmath::Vmul(nPointsTot,gradV0,1,velocity[0],1,outarray[n],1);
127 Vmath::Vmul(nPointsTot,inarray[n],1,velocity[0],1,gradV0,1);
128 fields[0]->PhysDeriv(gradV0,tmp);
129 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
130 Vmath::Smul(nPointsTot,0.5,outarray[n],1,outarray[n],1);
134 fields[0]->PhysDeriv(inarray[n],gradV0,gradV1);
135 Vmath::Vmul (nPointsTot,gradV0,1,velocity[0],1,outarray[n],1);
136 Vmath::Vvtvp(nPointsTot,gradV1,1,velocity[1],1,outarray[n],1,outarray[n],1);
137 Vmath::Vmul(nPointsTot,inarray[n],1,velocity[0],1,gradV0,1);
138 Vmath::Vmul(nPointsTot,inarray[n],1,velocity[1],1,gradV1,1);
140 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
142 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
143 Vmath::Smul(nPointsTot,0.5,outarray[n],1,outarray[n],1);
149 fields[0]->PhysDeriv(inarray[n],gradV0,gradV1,gradV2);
155 fields[0]->DealiasedProd(velocity[0],gradV0,gradV0);
156 fields[0]->DealiasedProd(velocity[1],gradV1,gradV1);
157 fields[0]->DealiasedProd(velocity[2],gradV2,gradV2);
158 Vmath::Vadd(nPointsTot,gradV0,1,gradV1,1,outarray[n],1);
159 Vmath::Vadd(nPointsTot,gradV2,1,outarray[n],1,outarray[n],1);
160 fields[0]->DealiasedProd(inarray[n],velocity[0],gradV0);
161 fields[0]->DealiasedProd(inarray[n],velocity[1],gradV1);
162 fields[0]->DealiasedProd(inarray[n],velocity[2],gradV2);
164 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
166 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
168 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
169 Vmath::Smul(nPointsTot,0.5,outarray[n],1,outarray[n],1);
176 fields[0]->HomogeneousBwdTrans(gradV0,tmp);
177 Vmath::Vmul(nPointsTot,tmp,1,velocity[0],1,outarray[n],1);
178 fields[0]->HomogeneousBwdTrans(gradV1,tmp);
179 Vmath::Vvtvp(nPointsTot,tmp,1,velocity[1],1,outarray[n],1,outarray[n],1);
180 fields[0]->HomogeneousBwdTrans(gradV2,tmp);
181 Vmath::Vvtvp(nPointsTot,tmp,1,velocity[2],1,outarray[n],1,outarray[n],1);
183 fields[0]->HomogeneousBwdTrans(inarray[n],Up);
184 Vmath::Vmul(nPointsTot,Up,1,velocity[0],1,gradV0,1);
185 Vmath::Vmul(nPointsTot,Up,1,velocity[1],1,gradV1,1);
186 Vmath::Vmul(nPointsTot,Up,1,velocity[2],1,gradV2,1);
188 fields[0]->SetWaveSpace(
false);
190 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
192 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
194 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
195 fields[0]->SetWaveSpace(
true);
198 fields[0]->HomogeneousFwdTrans(tmp,outarray[n]);
202 Vmath::Vmul(nPointsTot,gradV0,1,velocity[0],1,outarray[n],1);
203 Vmath::Vvtvp(nPointsTot,gradV1,1,velocity[1],1,outarray[n],1,outarray[n],1);
204 Vmath::Vvtvp(nPointsTot,gradV2,1,velocity[2],1,outarray[n],1,outarray[n],1);
205 Vmath::Vmul(nPointsTot,inarray[n],1,velocity[0],1,gradV0,1);
206 Vmath::Vmul(nPointsTot,inarray[n],1,velocity[1],1,gradV1,1);
207 Vmath::Vmul(nPointsTot,inarray[n],1,velocity[2],1,gradV2,1);
209 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
211 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
213 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
214 Vmath::Smul(nPointsTot,0.5,outarray[n],1,outarray[n],1);
218 ASSERTL0(
false,
"Dealiasing is not allowed in combination "
219 "with the Skew-Symmetric advection form for "
220 "efficiency reasons.");
224 ASSERTL0(
false,
"dimension unknown");
#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.
virtual ~SkewSymmetricAdvection()
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)
Advects a vector field.
bool m_homogen_dealiasing
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initialises the advection object.
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
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.