68 Array<OneD, MultiRegions::ExpListSharedPtr > &pFields,
69 const Array<
OneD, Array<OneD, NekDouble> > &pV,
70 const Array<OneD, const NekDouble> &pU,
71 Array<OneD, NekDouble> &pOutarray,
72 int pVelocityComponent,
74 Array<OneD, NekDouble> &pWk)
77 int ndim = pV.num_elements();
78 Array<OneD, Array<OneD, NekDouble> > AdvVel (pV.num_elements());
79 Array<OneD, NekDouble> Outarray;
82 int nPointsTot = pFields[0]->GetNpoints();
83 Array<OneD, NekDouble> grad0,grad1,grad2,wkSp;
90 nPointsTot = pFields[0]->Get1DScaledTotPoints(OneDptscale);
93 grad0 = Array<OneD, NekDouble> (nPointsTot);
96 int nadv = pV.num_elements();
99 AdvVel[0] = Array<OneD, NekDouble> (nPointsTot*(nadv+1));
100 for(
int i = 0; i < nadv; ++i)
104 AdvVel[i] = AdvVel[i-1]+nPointsTot;
107 pFields[0]->PhysInterp1DScaled(OneDptscale,pV[i],AdvVel[i]);
110 Outarray = AdvVel[nadv-1] + nPointsTot;
114 for(
int i = 0; i < nadv; ++i)
119 Outarray = pOutarray;
122 wkSp = Array<OneD, NekDouble> (nPointsTot);
129 pFields[0]->PhysDeriv(pU,grad0);
130 Vmath::Vmul(nPointsTot,grad0,1,pV[0],1,pOutarray,1);
134 grad1 = Array<OneD, NekDouble> (nPointsTot);
135 pFields[0]->PhysDeriv(pU,grad0,grad1);
139 pFields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
141 pFields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
145 Vmath::Vmul (nPointsTot,grad0,1,AdvVel[0],1,Outarray,1);
146 Vmath::Vvtvp(nPointsTot,grad1,1,AdvVel[1],1,Outarray,1,Outarray,1);
150 pFields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,pOutarray);
156 grad1 = Array<OneD, NekDouble> (pFields[0]->GetNpoints());
157 grad2 = Array<OneD, NekDouble> (pFields[0]->GetNpoints());
163 pFields[0]->PhysDeriv(pU,grad0,grad1,grad2);
165 pFields[0]->DealiasedProd(pV[0],grad0,grad0,
m_CoeffState);
166 pFields[0]->DealiasedProd(pV[1],grad1,grad1,
m_CoeffState);
167 pFields[0]->DealiasedProd(pV[2],grad2,grad2,
m_CoeffState);
168 Vmath::Vadd(nPointsTot,grad0,1,grad1,1,pOutarray,1);
169 Vmath::Vadd(nPointsTot,grad2,1,pOutarray,1,pOutarray,1);
174 pFields[0]->PhysDeriv(pV[pVelocityComponent],grad0,grad1);
179 pFields[0]->HomogeneousBwdTrans(pOutarray,grad2);
183 pFields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
184 Vmath::Vmul(nPointsTot,wkSp,1,AdvVel[0],1,Outarray,1);
188 Vmath::Vmul(nPointsTot,grad0,1,AdvVel[0],1,Outarray,1);
193 pFields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
205 pFields[0]->PhysInterp1DScaled(OneDptscale,grad2,wkSp);
206 Vmath::Vvtvp(nPointsTot,wkSp,1,AdvVel[2],1,Outarray,1,Outarray,1);
207 pFields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,grad2);
208 pFields[0]->HomogeneousFwdTrans(grad2,pOutarray);
212 Vmath::Vvtvp(nPointsTot,grad2,1,AdvVel[2],1,Outarray,1,grad0,1);
213 pFields[0]->HomogeneousFwdTrans(grad0,pOutarray);
219 pFields[0]->PhysDeriv(pU,grad0,grad1,grad2);
223 pFields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
224 Vmath::Vmul(nPointsTot,wkSp,1,AdvVel[0],1,Outarray,1);
228 Vmath::Vmul(nPointsTot,grad0,1,AdvVel[0],1,Outarray,1);
234 pFields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
246 pFields[0]->PhysInterp1DScaled(OneDptscale,grad2,wkSp);
247 Vmath::Vvtvp(nPointsTot,wkSp,1,AdvVel[2],1,Outarray,1,Outarray,1);
248 pFields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,pOutarray);
252 Vmath::Vvtvp(nPointsTot,grad2,1,AdvVel[2],1,Outarray,1,pOutarray,1);
259 pFields[0]->PhysDeriv(pU,grad0,grad1,grad2);
261 pFields[0]->HomogeneousBwdTrans(grad0, pOutarray);
262 pFields[0]->DealiasedProd(pV[0], pOutarray, grad0,
265 pFields[0]->HomogeneousBwdTrans(grad1,pOutarray);
266 pFields[0]->DealiasedProd(pV[1], pOutarray, grad1,
269 pFields[0]->HomogeneousBwdTrans(grad2,pOutarray);
270 pFields[0]->DealiasedProd(pV[2], pOutarray, grad2,
273 Vmath::Vadd(nPointsTot, grad0, 1, grad1, 1, grad0, 1);
274 Vmath::Vadd(nPointsTot, grad0, 1, grad2, 1, grad0, 1);
276 pFields[0]->HomogeneousFwdTrans(grad0,pOutarray);
280 ASSERTL0(
false,
"Advection term calculation not implented or "
281 "possible with the current problem set up");
285 ASSERTL0(
false,
"dimension unknown");