35#include <boost/core/ignore_unused.hpp>
42namespace GlobalMapping
48 "Translation mapping (X_i = x_i + constant)");
72 const TiXmlElement *pMapping)
77 if (
m_session->DefinesElement(
"Nektar/Mapping"))
83 int phystot = pFields[0]->GetTotPoints();
89 for (
int i = 0; i < 3; i++)
110 int physTot =
m_fields[0]->GetTotPoints();
122 int physTot =
m_fields[0]->GetTotPoints();
134 int physTot =
m_fields[0]->GetTotPoints();
146 int physTot =
m_fields[0]->GetTotPoints();
156 int physTot =
m_fields[0]->GetTotPoints();
164 boost::ignore_unused(inarray);
166 int physTot =
m_fields[0]->GetTotPoints();
174 int physTot =
m_fields[0]->GetTotPoints();
177 for (
int i = 0; i < nvel * nvel; i++)
182 for (
int i = 0; i < nvel; i++)
184 Vmath::Sadd(physTot, 1.0, outarray[i + nvel * i], 1,
185 outarray[i + nvel * i], 1);
192 int physTot =
m_fields[0]->GetTotPoints();
195 for (
int i = 0; i < nvel * nvel; i++)
200 for (
int i = 0; i < nvel; i++)
202 Vmath::Sadd(physTot, 1.0, outarray[i + nvel * i], 1,
203 outarray[i + nvel * i], 1);
211 int physTot =
m_fields[0]->GetTotPoints();
214 for (
int i = 0; i < nvel; i++)
219 for (
int i = 0; i < nvel; i++)
229 int physTot =
m_fields[0]->GetTotPoints();
232 for (
int i = 0; i < nvel; i++)
237 for (
int i = 0; i < nvel; i++)
247 boost::ignore_unused(inarray);
249 int physTot =
m_fields[0]->GetTotPoints();
252 for (
int i = 0; i < nvel; i++)
254 for (
int j = 0; j < nvel; j++)
265 boost::ignore_unused(inarray);
267 int physTot =
m_fields[0]->GetTotPoints();
270 for (
int i = 0; i < nvel; i++)
272 for (
int j = 0; j < nvel; j++)
Base class for mapping to be applied to the coordinate system.
int m_nConvectiveFields
Number of velocity components.
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
Array< OneD, Array< OneD, NekDouble > > m_coords
Array with the Cartesian coordinates.
Array< OneD, Array< OneD, NekDouble > > m_coordsVel
Array with the velocity of the coordinates.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
virtual GLOBAL_MAPPING_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
Array< OneD, Array< OneD, NekDouble > > m_tmp
bool m_constantJacobian
Flag defining if the Jacobian is constant.
bool m_timeDependent
Flag defining if the Mapping is time-dependent.
virtual GLOBAL_MAPPING_EXPORT void v_CovarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
virtual GLOBAL_MAPPING_EXPORT void v_UpdateGeomInfo() override
virtual GLOBAL_MAPPING_EXPORT void v_ContravarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
virtual GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray) override
virtual GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelContravar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
virtual GLOBAL_MAPPING_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping) override
virtual GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelCovar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
virtual GLOBAL_MAPPING_EXPORT void v_GetMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray) override
virtual GLOBAL_MAPPING_EXPORT void v_LowerIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
virtual GLOBAL_MAPPING_EXPORT void v_ContravarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
virtual GLOBAL_MAPPING_EXPORT void v_CovarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
virtual GLOBAL_MAPPING_EXPORT void v_RaiseIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
virtual GLOBAL_MAPPING_EXPORT void v_GetJacobian(Array< OneD, NekDouble > &outarray) override
MappingTranslation(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
virtual GLOBAL_MAPPING_EXPORT void v_DotGradJacobian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray) override
static std::string className
Name of the class.
static GLOBAL_MAPPING_EXPORT MappingSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
Creates an instance of this class.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
MappingFactory & GetMappingFactory()
Declaration of the mapping factory singleton.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
The above copyright notice and this permission notice shall be included.
void Zero(int n, T *x, const int incx)
Zero vector.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add scalar y = alpha + x.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)