52 : m_session(pSession), m_fields(pFields)
84 int nvariables = inarray.size();
85 int npoints =
m_fields[0]->GetNpoints();
89 for (
int i = 0; i < nvariables; ++i)
96 for (
int i = 0; i < nvariables; ++i)
98 Vmath::Vadd(npoints, outarray[i], 1, outarrayDiff[i], 1, outarray[i],
120 size_t nvariables = inarray.size();
121 size_t ncoeffs =
m_fields[0]->GetNcoeffs();
125 for (
size_t i = 0; i < nvariables; ++i)
132 for (
size_t i = 0; i < nvariables; ++i)
134 Vmath::Vadd(ncoeffs, outarray[i], 1, outarrayDiff[i], 1, outarray[i],
157 unsigned int nDim = qfield.size();
158 unsigned int nConvectiveFields = qfield[0].size();
159 unsigned int nPts = qfield[0][0].size();
166 for (
unsigned int j = 0; j < nDim; ++j)
168 for (
unsigned int i = 0; i < nConvectiveFields; ++i)
170 Vmath::Vmul(nPts, qfield[j][i], 1, mu, 1, viscousTensor[j][i], 1);
void GetArtificialViscosity(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &mu)
Calculate the artificial viscosity.
void DoArtificialDiffusionCoeff(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Apply the artificial diffusion the outarray is in coeff space.
virtual void v_GetArtificialViscosity(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &mu)=0
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array of fields.
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
virtual void v_DoArtificialDiffusion(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
ArtificialDiffusion(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const int spacedim)
Constructor.
NekDouble m_mu0
Constant scaling.
VariableConverterSharedPtr m_varConv
Auxiliary object to convert variables.
virtual void v_DoArtificialDiffusionCoeff(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
void DoArtificialDiffusion(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Apply the artificial diffusion.
void GetFluxVector(const Array< OneD, Array< OneD, NekDouble > > &inarray, const Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &qfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &viscousTensor)
Return the flux vector for the artificial viscosity operator.
SolverUtils::DiffusionSharedPtr m_diffusion
LDG Diffusion operator.
Provides a generic Factory class.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
DiffusionFactory & GetDiffusionFactory()
ArtificialDiffusionFactory & GetArtificialDiffusionFactory()
Declaration of the artificial diffusion factory singleton.
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 Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.