43 string AlternateSkewAdvection::className =
45 "AlternateSkew", AlternateSkewAdvection::create);
53 AlternateSkewAdvection::AlternateSkewAdvection()
66 pSession->MatchSolverInfo(
"ModeType",
"SingleMode",
m_SingleMode,
false);
67 pSession->MatchSolverInfo(
"ModeType",
"HalfMode",
m_HalfMode,
false);
71 const int nConvectiveFields,
81 int ndim = advVel.num_elements();
82 int nPointsTot = fields[0]->GetNpoints();
84 for(
int i = 0; i < ndim; ++i)
89 fields[i]->HomogeneousBwdTrans(advVel[i],velocity[i]);
93 velocity[i] = advVel[i];
96 for(
int n = 0; n < nConvectiveFields; ++n)
110 fields[0]->PhysDeriv(inarray[n],gradV0);
111 Vmath::Vmul(nPointsTot,gradV0,1,velocity[0],1,outarray[n],1);
115 Vmath::Vmul(nPointsTot,inarray[n],1,velocity[0],1,gradV0,1);
116 fields[0]->PhysDeriv(gradV0,outarray[n]);
118 Vmath::Smul(nPointsTot,0.5,outarray[n],1,outarray[n],1);
124 fields[0]->PhysDeriv(inarray[n],gradV0,gradV1);
125 Vmath::Vmul (nPointsTot,gradV0,1,velocity[0],1,outarray[n],1);
126 Vmath::Vvtvp(nPointsTot,gradV1,1,velocity[1],1,outarray[n],1,outarray[n],1);
130 Vmath::Vmul(nPointsTot,inarray[n],1,velocity[0],1,gradV0,1);
131 Vmath::Vmul(nPointsTot,inarray[n],1,velocity[1],1,gradV1,1);
134 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
136 Vmath::Smul(nPointsTot,1.0,outarray[n],1,outarray[n],1);
144 if(fields[0]->GetWaveSpace() ==
true)
150 fields[0]->PhysDeriv(inarray[n],gradV0,gradV1,gradV2);
151 fields[0]->HomogeneousBwdTrans(gradV0,tmp);
152 Vmath::Vmul(nPointsTot,tmp,1,velocity[0],1,outarray[n],1);
153 fields[0]->HomogeneousBwdTrans(gradV1,tmp);
154 Vmath::Vvtvp(nPointsTot,tmp,1,velocity[1],1,outarray[n],1,outarray[n],1);
155 fields[0]->HomogeneousBwdTrans(gradV2,tmp);
156 Vmath::Vvtvp(nPointsTot,tmp,1,velocity[2],1,outarray[n],1,outarray[n],1);
161 fields[0]->HomogeneousBwdTrans(inarray[n],Up);
162 Vmath::Vmul(nPointsTot,Up,1,velocity[0],1,gradV0,1);
163 Vmath::Vmul(nPointsTot,Up,1,velocity[1],1,gradV1,1);
164 Vmath::Vmul(nPointsTot,Up,1,velocity[2],1,gradV2,1);
166 fields[0]->SetWaveSpace(
false);
169 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
171 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
172 fields[0]->SetWaveSpace(
true);
176 fields[0]->HomogeneousFwdTrans(tmp,outarray[n]);
182 fields[0]->PhysDeriv(inarray[n],gradV0,gradV1,gradV2);
183 Vmath::Vmul(nPointsTot,gradV0,1,velocity[0],1,outarray[n],1);
184 Vmath::Vvtvp(nPointsTot,gradV1,1,velocity[1],1,outarray[n],1,outarray[n],1);
185 Vmath::Vvtvp(nPointsTot,gradV2,1,velocity[2],1,outarray[n],1,outarray[n],1);
189 Vmath::Vmul(nPointsTot,inarray[n],1,velocity[0],1,gradV0,1);
190 Vmath::Vmul(nPointsTot,inarray[n],1,velocity[1],1,gradV1,1);
191 Vmath::Vmul(nPointsTot,inarray[n],1,velocity[2],1,gradV2,1);
194 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
196 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
198 Vmath::Smul(nPointsTot,1.0,outarray[n],1,outarray[n],1);
202 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)
Advects a vector field.
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
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initialises the advection object.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
virtual ~AlternateSkewAdvection()
MultiRegions::Direction const DirCartesianMap[]
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 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.
Defines a callback function which evaluates the flux vector.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.