64 Array<OneD, MultiRegions::ExpListSharedPtr> pFields)
74 pSession->MatchSolverInfo(
"ModeType",
"SingleMode",
m_SingleMode,
false);
75 pSession->MatchSolverInfo(
"ModeType",
"HalfMode",
m_HalfMode,
false);
82 const int nConvectiveFields,
83 const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
84 const Array<
OneD, Array<OneD, NekDouble> > &advVel,
85 const Array<
OneD, Array<OneD, NekDouble> > &inarray,
86 Array<
OneD, Array<OneD, NekDouble> > &outarray,
89 int nqtot = fields[0]->GetTotPoints();
90 ASSERTL1(nConvectiveFields == inarray.num_elements(),
"Number of convective fields and Inarray are not compatible");
92 Array<OneD, NekDouble > Deriv(nqtot*nConvectiveFields);
94 for(
int n = 0; n < nConvectiveFields; ++n)
97 int ndim = advVel.num_elements();
98 Array<OneD, Array<OneD, NekDouble> > AdvVel (advVel.num_elements());
99 Array<OneD, NekDouble> Outarray;
102 int nPointsTot = fields[0]->GetNpoints();
103 Array<OneD, NekDouble> grad0,grad1,grad2,wkSp;
110 nPointsTot = fields[0]->Get1DScaledTotPoints(OneDptscale);
113 grad0 = Array<OneD, NekDouble> (nPointsTot);
116 int nadv = advVel.num_elements();
119 AdvVel[0] = Array<OneD, NekDouble> (nPointsTot*(nadv+1));
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];
142 wkSp = Array<OneD, NekDouble> (nPointsTot);
149 fields[0]->PhysDeriv(inarray[n],grad0);
150 Vmath::Vmul(nPointsTot,grad0,1,advVel[0],1,outarray[n],1);
154 grad1 = Array<OneD, NekDouble> (nPointsTot);
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]);
176 grad1 = Array<OneD, NekDouble> (fields[0]->GetNpoints());
177 grad2 = Array<OneD, NekDouble> (fields[0]->GetNpoints());
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");