66 const int nConvectiveFields,
75 int nDim = advVel.size();
76 int nPointsTot = fields[0]->GetNpoints();
91 for (
int i = 0; i < nConvectiveFields; ++i)
97 fields[0]->PhysDeriv(inarray[i], grad0);
99 Vmath::Vmul(nPointsTot, grad0, 1, advVel[0], 1, outarray[i], 1);
102 fields[0]->PhysDeriv(inarray[i], grad0, grad1);
105 Vmath::Vmul(nPointsTot, grad0, 1, advVel[0], 1, outarray[i], 1);
107 Vmath::Vvtvp(nPointsTot, grad1, 1, advVel[1], 1, outarray[i], 1,
112 fields[0]->PhysDeriv(inarray[i], grad0, grad1, grad2);
115 Vmath::Vmul(nPointsTot, grad0, 1, advVel[0], 1, outarray[i], 1);
117 Vmath::Vvtvp(nPointsTot, grad1, 1, advVel[1], 1, outarray[i], 1,
120 Vmath::Vvtvp(nPointsTot, grad2, 1, advVel[2], 1, outarray[i], 1,
124 ASSERTL0(
false,
"dimension unknown");
#define ASSERTL0(condition, msg)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
virtual SOLVER_UTILS_EXPORT void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initialises the advection object.
void v_Advect(const int nConvective, 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.
AdvectionNonConservative()
static AdvectionSharedPtr create(std::string advType)
void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) override
Initialise AdvectionNonConservative objects and store them before starting the time-stepping.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
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