45 "NonSmooth artificial diffusion for shock capture.");
66 int nPts =
m_fields[0]->GetTotPoints();
67 int nElements =
m_fields[0]->GetExpSize();
73 m_varConv->GetSoundSpeed(physfield, soundspeed);
74 m_varConv->GetAbsoluteVelocity(physfield, absVelocity);
75 Vmath::Vadd(nPts, absVelocity, 1, soundspeed, 1, Lambda, 1);
83 for (
int e = 0; e < nElements; e++)
85 int physOffset =
m_fields[0]->GetPhys_Offset(e);
86 int nElmtPoints =
m_fields[0]->GetExp(e)->GetTotPoints();
90 LambdaElmt =
Vmath::Vmax(nElmtPoints, tmp = Lambda + physOffset, 1);
94 Vmath::Smul(nElmtPoints, LambdaElmt, tmp = mu + physOffset, 1,
95 tmp = mu + physOffset, 1);
Encapsulates the artificial diffusion used in shock capture.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array of fields.
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
NekDouble m_mu0
Constant scaling.
VariableConverterSharedPtr m_varConv
Auxiliary object to convert variables.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static ArtificialDiffusionSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const int spacedim)
Creates an instance of this class.
static std::string className
Name of the class.
void v_GetArtificialViscosity(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &mu) override
NonSmoothShockCapture(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const int spacedim)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
ArtificialDiffusionFactory & GetArtificialDiffusionFactory()
Declaration of the artificial diffusion factory singleton.
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.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.