43 RegisterCreatorFunction(
"NonSmooth",
44 NonSmoothShockCapture::create,
45 "NonSmooth artificial diffusion for shock capture.");
47 NonSmoothShockCapture::NonSmoothShockCapture(
60 int nPts =
m_fields[0]->GetTotPoints();
61 int nElements =
m_fields[0]->GetExpSize();
67 m_varConv->GetSoundSpeed(physfield, soundspeed);
68 m_varConv->GetAbsoluteVelocity(physfield, absVelocity);
69 Vmath::Vadd(nPts, absVelocity, 1, soundspeed, 1, Lambda, 1);
77 for (
int e = 0; e < nElements; e++)
79 int physOffset =
m_fields[0]->GetPhys_Offset(e);
80 int nElmtPoints =
m_fields[0]->GetExp(e)->GetTotPoints();
84 LambdaElmt =
Vmath::Vmax(nElmtPoints, tmp = Lambda + physOffset, 1);
88 Vmath::Smul(nElmtPoints, LambdaElmt, tmp = mu + physOffset, 1,
89 tmp = mu + physOffset, 1);
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
virtual void v_GetArtificialViscosity(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &mu)
Encapsulates the artificial diffusion used in shock capture.
Array< OneD, NekDouble > m_hOverP
h/p scaling
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
ArtificialDiffusionFactory & GetArtificialDiffusionFactory()
Declaration of the artificial diffusion factory singleton.
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
NekDouble m_mu0
Constant scaling.
VariableConverterSharedPtr m_varConv
Auxiliary object to convert variables.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array of fields.
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.