65 const int nConvectiveFields,
74 int nqtot = fields[0]->GetTotPoints();
75 ASSERTL1(nConvectiveFields == inarray.size(),
76 "Number of convective fields and Inarray are not compatible");
79 int ndim = advVel.size();
85 for (
int i = 0; i < ndim; ++i)
87 velocity[i] = advVel[i];
90 int nPointsTot = fields[0]->GetNpoints();
93 for (
int i = 0; i < ndim; ++i)
95 AdvVel[i] = velocity[i];
105 for (
int n = 0; n < nConvectiveFields; ++n)
107 fields[0]->PhysDeriv(inarray[n], grad0);
108 Vmath::Vmul(nPointsTot, grad0, 1, AdvVel[0], 1, outarray[n], 1);
118 for (
int n = 0; n < nConvectiveFields; ++n)
120 fields[0]->PhysDeriv(inarray[n], grad0, grad1);
121 Vmath::Vmul(nPointsTot, grad0, 1, AdvVel[0], 1, outarray[n], 1);
122 Vmath::Vvtvp(nPointsTot, grad1, 1, AdvVel[1], 1, outarray[n], 1,
135 for (
int n = 0; n < nConvectiveFields; ++n)
137 fields[0]->PhysDeriv(inarray[n], grad0, grad1, grad2);
138 Vmath::Vmul(nPointsTot, grad0, 1, AdvVel[0], 1, outarray[n], 1);
139 Vmath::Vvtvp(nPointsTot, grad1, 1, AdvVel[1], 1, outarray[n], 1,
141 Vmath::Vvtvp(nPointsTot, grad2, 1, AdvVel[2], 1, outarray[n], 1,
149 ASSERTL0(
false,
"dimension unknown");
152 for (
int n = 0; n < nConvectiveFields; ++n)
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, const Array< OneD, Array< OneD, NekDouble > > &pFwd=NullNekDoubleArrayOfArray, const Array< OneD, Array< OneD, NekDouble > > &pBwd=NullNekDoubleArrayOfArray) override
Advects a vector field.
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.
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