67 const int nConvectiveFields,
74 for(
int n = 0; n < nConvectiveFields; ++n)
77 int ndim = advVel.num_elements();
81 int nPointsTot = fields[0]->GetNpoints();
93 fields[0]->PhysDeriv(inarray[n],gradV0);
94 Vmath::Vmul(nPointsTot,gradV0,1,advVel[0],1,outarray[n],1);
98 Vmath::Vmul(nPointsTot,inarray[n],1,advVel[0],1,gradV0,1);
99 fields[0]->PhysDeriv(gradV0,outarray[n]);
101 Vmath::Smul(nPointsTot,0.5,outarray[n],1,outarray[n],1);
107 fields[0]->PhysDeriv(inarray[n],gradV0,gradV1);
108 Vmath::Vmul (nPointsTot,gradV0,1,advVel[0],1,outarray[n],1);
109 Vmath::Vvtvp(nPointsTot,gradV1,1,advVel[1],1,outarray[n],1,outarray[n],1);
113 Vmath::Vmul(nPointsTot,inarray[n],1,advVel[0],1,gradV0,1);
114 Vmath::Vmul(nPointsTot,inarray[n],1,advVel[1],1,gradV1,1);
117 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
119 Vmath::Smul(nPointsTot,1.0,outarray[n],1,outarray[n],1);
127 if(fields[0]->GetWaveSpace() ==
true)
133 fields[0]->PhysDeriv(inarray[n],gradV0,gradV1,gradV2);
134 fields[0]->HomogeneousBwdTrans(gradV0,tmp);
135 Vmath::Vmul(nPointsTot,tmp,1,advVel[0],1,outarray[n],1);
136 fields[0]->HomogeneousBwdTrans(gradV1,tmp);
137 Vmath::Vvtvp(nPointsTot,tmp,1,advVel[1],1,outarray[n],1,outarray[n],1);
138 fields[0]->HomogeneousBwdTrans(gradV2,tmp);
139 Vmath::Vvtvp(nPointsTot,tmp,1,advVel[2],1,outarray[n],1,outarray[n],1);
144 fields[0]->HomogeneousBwdTrans(inarray[n],Up);
149 fields[0]->SetWaveSpace(
false);
152 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
154 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
155 fields[0]->SetWaveSpace(
true);
159 fields[0]->HomogeneousFwdTrans(tmp,outarray[n]);
165 fields[0]->PhysDeriv(inarray[n],gradV0,gradV1,gradV2);
166 Vmath::Vmul(nPointsTot,gradV0,1,advVel[0],1,outarray[n],1);
167 Vmath::Vvtvp(nPointsTot,gradV1,1,advVel[1],1,outarray[n],1,outarray[n],1);
168 Vmath::Vvtvp(nPointsTot,gradV2,1,advVel[2],1,outarray[n],1,outarray[n],1);
172 Vmath::Vmul(nPointsTot,inarray[n],1,advVel[0],1,gradV0,1);
173 Vmath::Vmul(nPointsTot,inarray[n],1,advVel[1],1,gradV1,1);
174 Vmath::Vmul(nPointsTot,inarray[n],1,advVel[2],1,gradV2,1);
177 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
179 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
181 Vmath::Smul(nPointsTot,1.0,outarray[n],1,outarray[n],1);
185 ASSERTL0(
false,
"dimension unknown");
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)
Advects a vector field.
#define ASSERTL0(condition, msg)
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
static std::string className
Name of class.
static SolverUtils::AdvectionSharedPtr create(std::string)
Creates an instance of this class.
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.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.