69 const int nConvectiveFields,
79 int ndim = advVel.size();
80 int nqtot = fields[0]->GetTotPoints();
81 ASSERTL1(nConvectiveFields == inarray.size(),
82 "Number of convective fields and Inarray are not compatible");
85 for (
int i = 0; i < ndim; ++i)
90 fields[i]->HomogeneousBwdTrans(nqtot, advVel[i], velocity[i]);
94 velocity[i] = advVel[i];
98 for (
int n = 0; n < nConvectiveFields; ++n)
102 int nPointsTot = fields[0]->GetNpoints();
112 fields[0]->PhysDeriv(inarray[n], gradV0);
113 Vmath::Vmul(nPointsTot, gradV0, 1, velocity[0], 1, outarray[n],
115 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[0], 1, gradV0,
117 fields[0]->PhysDeriv(gradV0, tmp);
118 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n], 1);
119 Vmath::Smul(nPointsTot, 0.5, outarray[n], 1, outarray[n], 1);
123 fields[0]->PhysDeriv(inarray[n], gradV0, gradV1);
124 Vmath::Vmul(nPointsTot, gradV0, 1, velocity[0], 1, outarray[n],
126 Vmath::Vvtvp(nPointsTot, gradV1, 1, velocity[1], 1, outarray[n],
128 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[0], 1, gradV0,
130 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[1], 1, gradV1,
134 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n], 1);
137 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n], 1);
138 Vmath::Smul(nPointsTot, 0.5, outarray[n], 1, outarray[n], 1);
144 fields[0]->PhysDeriv(inarray[n], gradV0, gradV1, gradV2);
150 fields[0]->GetWaveSpace() ==
false)
152 fields[0]->DealiasedProd(nPointsTot, velocity[0], gradV0,
154 fields[0]->DealiasedProd(nPointsTot, velocity[1], gradV1,
156 fields[0]->DealiasedProd(nPointsTot, velocity[2], gradV2,
158 Vmath::Vadd(nPointsTot, gradV0, 1, gradV1, 1, outarray[n],
162 fields[0]->DealiasedProd(nPointsTot, inarray[n],
163 velocity[0], gradV0);
164 fields[0]->DealiasedProd(nPointsTot, inarray[n],
165 velocity[1], gradV1);
166 fields[0]->DealiasedProd(nPointsTot, inarray[n],
167 velocity[2], gradV2);
170 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n],
174 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n],
178 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n],
180 Vmath::Smul(nPointsTot, 0.5, outarray[n], 1, outarray[n],
183 else if (fields[0]->GetWaveSpace() ==
true &&
189 fields[0]->HomogeneousBwdTrans(nPointsTot, gradV0, tmp);
190 Vmath::Vmul(nPointsTot, tmp, 1, velocity[0], 1, outarray[n],
192 fields[0]->HomogeneousBwdTrans(nPointsTot, gradV1, tmp);
194 outarray[n], 1, outarray[n], 1);
195 fields[0]->HomogeneousBwdTrans(nPointsTot, gradV2, tmp);
197 outarray[n], 1, outarray[n], 1);
199 fields[0]->HomogeneousBwdTrans(nPointsTot, inarray[n], Up);
200 Vmath::Vmul(nPointsTot, Up, 1, velocity[0], 1, gradV0, 1);
201 Vmath::Vmul(nPointsTot, Up, 1, velocity[1], 1, gradV1, 1);
202 Vmath::Vmul(nPointsTot, Up, 1, velocity[2], 1, gradV2, 1);
204 fields[0]->SetWaveSpace(
false);
207 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n],
211 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n],
215 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n],
217 fields[0]->SetWaveSpace(
true);
219 Vmath::Smul(nPointsTot, 0.5, outarray[n], 1, tmp, 1);
220 fields[0]->HomogeneousFwdTrans(nPointsTot, tmp,
223 else if (fields[0]->GetWaveSpace() ==
false &&
229 outarray[n], 1, outarray[n], 1);
231 outarray[n], 1, outarray[n], 1);
232 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[0], 1,
234 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[1], 1,
236 Vmath::Vmul(nPointsTot, inarray[n], 1, velocity[2], 1,
240 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n],
244 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n],
248 Vmath::Vadd(nPointsTot, tmp, 1, outarray[n], 1, outarray[n],
250 Vmath::Smul(nPointsTot, 0.5, outarray[n], 1, outarray[n],
256 "Dealiasing is not allowed in combination "
257 "with the Skew-Symmetric advection form for "
258 "efficiency reasons.");
262 ASSERTL0(
false,
"dimension unknown");