68 Array<OneD, MultiRegions::ExpListSharedPtr> pFields)
74 pSession->MatchSolverInfo(
"ModeType",
"SingleMode",
m_SingleMode,
false);
75 pSession->MatchSolverInfo(
"ModeType",
"HalfMode",
m_HalfMode,
false);
83 const int nConvectiveFields,
84 const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
85 const Array<
OneD, Array<OneD, NekDouble> > &advVel,
86 const Array<
OneD, Array<OneD, NekDouble> > &inarray,
87 Array<
OneD, Array<OneD, NekDouble> > &outarray,
90 int nqtot = fields[0]->GetTotPoints();
91 ASSERTL1(nConvectiveFields == inarray.num_elements(),
"Number of convective fields and Inarray are not compatible");
93 Array<OneD, NekDouble > Deriv = Array<OneD, NekDouble> (nqtot*nConvectiveFields);
95 for(
int n = 0; n < nConvectiveFields; ++n)
98 int ndim = advVel.num_elements();
102 int nPointsTot = fields[0]->GetNpoints();
103 Array<OneD, NekDouble> gradV0,gradV1,gradV2, tmp, Up;
105 gradV0 = Array<OneD, NekDouble> (nPointsTot);
106 tmp = Array<OneD, NekDouble> (nPointsTot);
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);
120 gradV1 = Array<OneD, NekDouble> (nPointsTot);
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);
133 gradV1 = Array<OneD, NekDouble> (nPointsTot);
134 gradV2 = Array<OneD, NekDouble> (nPointsTot);
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);
160 Up = Array<OneD, NekDouble> (nPointsTot);
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");