35 #include <boost/core/ignore_unused.hpp>
67 const int nConvectiveFields,
75 boost::ignore_unused(time, pFwd, pBwd);
77 int nDim = advVel.size();
78 int nPointsTot = fields[0]->GetNpoints();
93 for (
int i = 0; i < nConvectiveFields; ++i)
99 fields[0]->PhysDeriv(inarray[i], grad0);
101 Vmath::Vmul(nPointsTot, grad0, 1, advVel[0], 1, outarray[i], 1);
104 fields[0]->PhysDeriv(inarray[i], grad0, grad1);
107 Vmath::Vmul(nPointsTot, grad0, 1, advVel[0], 1, outarray[i], 1);
109 Vmath::Vvtvp(nPointsTot, grad1, 1, advVel[1], 1, outarray[i], 1,
114 fields[0]->PhysDeriv(inarray[i], grad0, grad1, grad2);
117 Vmath::Vmul(nPointsTot, grad0, 1, advVel[0], 1, outarray[i], 1);
119 Vmath::Vvtvp(nPointsTot, grad1, 1, advVel[1], 1, outarray[i], 1,
122 Vmath::Vvtvp(nPointsTot, grad2, 1, advVel[2], 1, outarray[i], 1,
126 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.
virtual 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)
virtual 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.
The above copyright notice and this permission notice shall be included.
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