70 Advection::v_InitObject(pSession, pFields);
74 pSession->MatchSolverInfo(
"ModeType",
"SingleMode",
m_SingleMode,
false);
75 pSession->MatchSolverInfo(
"ModeType",
"HalfMode",
m_HalfMode,
false);
83 const int nConvectiveFields,
90 int nqtot = fields[0]->GetTotPoints();
91 ASSERTL1(nConvectiveFields == inarray.num_elements(),
"Number of convective fields and Inarray are not compatible");
95 for(
int n = 0; n < nConvectiveFields; ++n)
98 int ndim = advVel.num_elements();
102 int nPointsTot = fields[0]->GetNpoints();
112 fields[0]->PhysDeriv(inarray[n],gradV0);
113 Vmath::Vmul(nPointsTot,gradV0,1,advVel[0],1,outarray[n],1);
114 Vmath::Vmul(nPointsTot,inarray[n],1,advVel[0],1,gradV0,1);
115 fields[0]->PhysDeriv(gradV0,tmp);
116 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
117 Vmath::Smul(nPointsTot,0.5,outarray[n],1,outarray[n],1);
121 fields[0]->PhysDeriv(inarray[n],gradV0,gradV1);
122 Vmath::Vmul (nPointsTot,gradV0,1,advVel[0],1,outarray[n],1);
123 Vmath::Vvtvp(nPointsTot,gradV1,1,advVel[1],1,outarray[n],1,outarray[n],1);
124 Vmath::Vmul(nPointsTot,inarray[n],1,advVel[0],1,gradV0,1);
125 Vmath::Vmul(nPointsTot,inarray[n],1,advVel[1],1,gradV1,1);
127 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
129 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
130 Vmath::Smul(nPointsTot,0.5,outarray[n],1,outarray[n],1);
136 fields[0]->PhysDeriv(inarray[n],gradV0,gradV1,gradV2);
142 fields[0]->DealiasedProd(advVel[0],gradV0,gradV0,
m_CoeffState);
143 fields[0]->DealiasedProd(advVel[1],gradV1,gradV1,
m_CoeffState);
144 fields[0]->DealiasedProd(advVel[2],gradV2,gradV2,
m_CoeffState);
145 Vmath::Vadd(nPointsTot,gradV0,1,gradV1,1,outarray[n],1);
146 Vmath::Vadd(nPointsTot,gradV2,1,outarray[n],1,outarray[n],1);
147 fields[0]->DealiasedProd(inarray[n],advVel[0],gradV0,
m_CoeffState);
148 fields[0]->DealiasedProd(inarray[n],advVel[1],gradV1,
m_CoeffState);
149 fields[0]->DealiasedProd(inarray[n],advVel[2],gradV2,
m_CoeffState);
151 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
153 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
155 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
156 Vmath::Smul(nPointsTot,0.5,outarray[n],1,outarray[n],1);
163 fields[0]->HomogeneousBwdTrans(gradV0,tmp);
164 Vmath::Vmul(nPointsTot,tmp,1,advVel[0],1,outarray[n],1);
165 fields[0]->HomogeneousBwdTrans(gradV1,tmp);
166 Vmath::Vvtvp(nPointsTot,tmp,1,advVel[1],1,outarray[n],1,outarray[n],1);
167 fields[0]->HomogeneousBwdTrans(gradV2,tmp);
168 Vmath::Vvtvp(nPointsTot,tmp,1,advVel[2],1,outarray[n],1,outarray[n],1);
170 fields[0]->HomogeneousBwdTrans(inarray[n],Up);
175 fields[0]->SetWaveSpace(
false);
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::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
182 fields[0]->SetWaveSpace(
true);
185 fields[0]->HomogeneousFwdTrans(tmp,outarray[n]);
189 Vmath::Vmul(nPointsTot,gradV0,1,advVel[0],1,outarray[n],1);
190 Vmath::Vvtvp(nPointsTot,gradV1,1,advVel[1],1,outarray[n],1,outarray[n],1);
191 Vmath::Vvtvp(nPointsTot,gradV2,1,advVel[2],1,outarray[n],1,outarray[n],1);
192 Vmath::Vmul(nPointsTot,inarray[n],1,advVel[0],1,gradV0,1);
193 Vmath::Vmul(nPointsTot,inarray[n],1,advVel[1],1,gradV1,1);
194 Vmath::Vmul(nPointsTot,inarray[n],1,advVel[2],1,gradV2,1);
196 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
198 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
200 Vmath::Vadd(nPointsTot,tmp,1,outarray[n],1,outarray[n],1);
201 Vmath::Smul(nPointsTot,0.5,outarray[n],1,outarray[n],1);
205 ASSERTL0(
false,
"Dealiasing is not allowed in combination "
206 "with the Skew-Symmetric advection form for "
207 "efficiency reasons.");
211 ASSERTL0(
false,
"dimension unknown");
#define ASSERTL0(condition, msg)
MultiRegions::CoeffState m_CoeffState
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
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.
void Neg(int n, T *x, const int incx)
Negate x = -x.
MultiRegions::Direction const DirCartesianMap[]
virtual ~SkewSymmetricAdvection()
static std::string className
Name of class.
bool m_homogen_dealiasing
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
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 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.
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initialises the advection object.