74 pSession->MatchSolverInfo(
"ModeType",
"SingleMode",
m_SingleMode,
false);
75 pSession->MatchSolverInfo(
"ModeType",
"HalfMode",
m_HalfMode,
false);
77 Advection::v_InitObject(pSession, pFields);
82 const int nConvectiveFields,
89 int nqtot = fields[0]->GetTotPoints();
90 ASSERTL1(nConvectiveFields == inarray.num_elements(),
"Number of convective fields and Inarray are not compatible");
94 for(
int n = 0; n < nConvectiveFields; ++n)
97 int ndim = advVel.num_elements();
102 int nPointsTot = fields[0]->GetNpoints();
110 nPointsTot = fields[0]->Get1DScaledTotPoints(OneDptscale);
116 int nadv = advVel.num_elements();
120 for(
int i = 0; i < nadv; ++i)
124 AdvVel[i] = AdvVel[i-1]+nPointsTot;
127 fields[0]->PhysInterp1DScaled(OneDptscale,advVel[i],AdvVel[i]);
130 Outarray = AdvVel[nadv-1] + nPointsTot;
134 for(
int i = 0; i < nadv; ++i)
136 AdvVel[i] = advVel[i];
139 Outarray = outarray[n];
149 fields[0]->PhysDeriv(inarray[n],grad0);
150 Vmath::Vmul(nPointsTot,grad0,1,advVel[0],1,outarray[n],1);
155 fields[0]->PhysDeriv(inarray[n],grad0,grad1);
159 fields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
161 fields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
165 Vmath::Vmul (nPointsTot,grad0,1,AdvVel[0],1,Outarray,1);
166 Vmath::Vvtvp(nPointsTot,grad1,1,AdvVel[1],1,Outarray,1,Outarray,1);
170 fields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,outarray[n]);
183 fields[0]->PhysDeriv(inarray[n],grad0,grad1,grad2);
185 fields[0]->DealiasedProd(advVel[0],grad0,grad0,
m_CoeffState);
186 fields[0]->DealiasedProd(advVel[1],grad1,grad1,
m_CoeffState);
187 fields[0]->DealiasedProd(advVel[2],grad2,grad2,
m_CoeffState);
188 Vmath::Vadd(nPointsTot,grad0,1,grad1,1,outarray[n],1);
189 Vmath::Vadd(nPointsTot,grad2,1,outarray[n],1,outarray[n],1);
194 fields[0]->PhysDeriv(advVel[n],grad0,grad1);
199 fields[0]->HomogeneousBwdTrans(outarray[n],grad2);
203 fields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
204 Vmath::Vmul(nPointsTot,wkSp,1,AdvVel[0],1,Outarray,1);
208 Vmath::Vmul(nPointsTot,grad0,1,AdvVel[0],1,Outarray,1);
213 fields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
225 fields[0]->PhysInterp1DScaled(OneDptscale,grad2,wkSp);
226 Vmath::Vvtvp(nPointsTot,wkSp,1,AdvVel[2],1,Outarray,1,Outarray,1);
227 fields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,grad2);
228 fields[0]->HomogeneousFwdTrans(grad2,outarray[n]);
232 Vmath::Vvtvp(nPointsTot,grad2,1,AdvVel[2],1,Outarray,1,grad0,1);
233 fields[0]->HomogeneousFwdTrans(grad0,outarray[n]);
239 fields[0]->PhysDeriv(inarray[n],grad0,grad1,grad2);
243 fields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
244 Vmath::Vmul(nPointsTot,wkSp,1,AdvVel[0],1,Outarray,1);
248 Vmath::Vmul(nPointsTot,grad0,1,AdvVel[0],1,Outarray,1);
254 fields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
266 fields[0]->PhysInterp1DScaled(OneDptscale,grad2,wkSp);
267 Vmath::Vvtvp(nPointsTot,wkSp,1,AdvVel[2],1,Outarray,1,Outarray,1);
268 fields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,outarray[n]);
272 Vmath::Vvtvp(nPointsTot,grad2,1,AdvVel[2],1,Outarray,1,outarray[n],1);
279 fields[0]->PhysDeriv(inarray[n],grad0,grad1,grad2);
281 fields[0]->HomogeneousBwdTrans(grad0, outarray[n]);
282 fields[0]->DealiasedProd(advVel[0], outarray[n], grad0,
285 fields[0]->HomogeneousBwdTrans(grad1,outarray[n]);
286 fields[0]->DealiasedProd(advVel[1], outarray[n], grad1,
289 fields[0]->HomogeneousBwdTrans(grad2,outarray[n]);
290 fields[0]->DealiasedProd(advVel[2], outarray[n], grad2,
293 Vmath::Vadd(nPointsTot, grad0, 1, grad1, 1, grad0, 1);
294 Vmath::Vadd(nPointsTot, grad0, 1, grad2, 1, grad0, 1);
296 fields[0]->HomogeneousFwdTrans(grad0,outarray[n]);
300 ASSERTL0(
false,
"Advection term calculation not implented or "
301 "possible with the current problem set up");
305 ASSERTL0(
false,
"dimension unknown");
bool m_homogen_dealiasing
#define ASSERTL0(condition, msg)
static SolverUtils::AdvectionSharedPtr create(std::string)
Creates an instance of this class.
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.
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
static std::string className
Name of class.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
void Neg(int n, T *x, const int incx)
Negate x = -x.
MultiRegions::CoeffState m_CoeffState
static std::string className2
virtual ~NavierStokesAdvection()
MultiRegions::Direction const DirCartesianMap[]
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initialises the advection object.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
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.