40namespace GlobalMapping
69 const TiXmlElement *pMapping)
76 "Mapping X = X(x,z) needs 3 velocity components.");
83 int physTot =
m_fields[0]->GetTotPoints();
101 int physTot =
m_fields[0]->GetTotPoints();
113 Vmath::Vsub(physTot, inarray[2], 1, wk, 1, outarray[2], 1);
120 int physTot =
m_fields[0]->GetTotPoints();
127 Vmath::Vsub(physTot, outarray[0], 1, wk, 1, outarray[0], 1);
140 int physTot =
m_fields[0]->GetTotPoints();
150 Vmath::Vadd(physTot, inarray[2], 1, outarray[2], 1, outarray[2], 1);
155 int physTot =
m_fields[0]->GetTotPoints();
163 int physTot =
m_fields[0]->GetTotPoints();
173 int physTot =
m_fields[0]->GetTotPoints();
177 for (
int i = 0; i < nvel * nvel; i++)
182 for (
int i = 1; i < nvel; i++)
184 Vmath::Sadd(physTot, 1.0, outarray[i + nvel * i], 1,
185 outarray[i + nvel * i], 1);
191 Vmath::Vcopy(physTot, wk, 1, outarray[0 * nvel + 2], 1);
192 Vmath::Vcopy(physTot, wk, 1, outarray[2 * nvel + 0], 1);
196 outarray[0 * nvel + 0], 1);
201 Vmath::Vadd(physTot, wk, 1, outarray[2 * nvel + 2], 1,
202 outarray[2 * nvel + 2], 1);
208 int physTot =
m_fields[0]->GetTotPoints();
212 for (
int i = 0; i < nvel * nvel; i++)
217 for (
int i = 0; i < nvel; i++)
219 Vmath::Sadd(physTot, 1.0, outarray[i + nvel * i], 1,
220 outarray[i + nvel * i], 1);
227 Vmath::Vcopy(physTot, wk, 1, outarray[0 * nvel + 2], 1);
228 Vmath::Vcopy(physTot, wk, 1, outarray[2 * nvel + 0], 1);
233 Vmath::Vadd(physTot, wk, 1, outarray[0 * nvel + 0], 1,
234 outarray[0 * nvel + 0], 1);
238 Vmath::Vdiv(physTot, outarray[0 * nvel + 0], 1, wk, 1,
239 outarray[0 * nvel + 0], 1);
246 int physTot =
m_fields[0]->GetTotPoints();
252 Vmath::Vmul(physTot, wk, 1, inarray[2], 1, outarray[0], 1);
253 Vmath::Vmul(physTot, wk, 1, inarray[0], 1, outarray[2], 1);
259 Vmath::Vadd(physTot, outarray[0], 1, wk, 1, outarray[0], 1);
270 Vmath::Vadd(physTot, wk, 1, outarray[2], 1, outarray[2], 1);
277 int physTot =
m_fields[0]->GetTotPoints();
283 Vmath::Vmul(physTot, wk, 1, inarray[0], 1, outarray[2], 1);
284 Vmath::Vsub(physTot, inarray[2], 1, outarray[2], 1, outarray[2], 1);
287 Vmath::Vmul(physTot, wk, 1, inarray[2], 1, outarray[0], 1);
293 Vmath::Vsub(physTot, wk, 1, outarray[0], 1, outarray[0], 1);
303 int physTot =
m_fields[0]->GetTotPoints();
307 for (
int i = 0; i < nvel; i++)
309 for (
int j = 0; j < nvel; j++)
319 Vmath::Vmul(physTot, wk, 1, inarray[0], 1, outarray[0 * nvel + 0], 1);
321 Vmath::Vvtvp(physTot, wk, 1, inarray[2], 1, outarray[0 * nvel + 0], 1,
322 outarray[0 * nvel + 0], 1);
325 Vmath::Vmul(physTot, wk, 1, inarray[0], 1, outarray[0 * nvel + 2], 1);
327 Vmath::Vvtvp(physTot, wk, 1, inarray[2], 1, outarray[0 * nvel + 2], 1,
328 outarray[0 * nvel + 2], 1);
335 int physTot =
m_fields[0]->GetTotPoints();
339 for (
int i = 0; i < nvel; i++)
341 for (
int j = 0; j < nvel; j++)
351 Vmath::Vmul(physTot, wk, 1, inarray[0], 1, outarray[0 * nvel + 0], 1);
355 Vmath::Vmul(physTot, wk, 1, inarray[0], 1, outarray[0 * nvel + 2], 1);
356 Vmath::Vcopy(physTot, outarray[0 * nvel + 2], 1, outarray[2 * nvel + 0], 1);
360 Vmath::Vmul(physTot, wk, 1, inarray[0], 1, outarray[2 * nvel + 2], 1);
365 int phystot =
m_fields[0]->GetTotPoints();
373 bool waveSpace =
m_fields[0]->GetWaveSpace();
389 m_fields[0]->SetWaveSpace(waveSpace);
#define ASSERTL0(condition, msg)
Base class for mapping to be applied to the coordinate system.
int m_nConvectiveFields
Number of velocity components.
Array< OneD, Array< OneD, NekDouble > > m_GeometricInfo
Array with metric terms of the mapping.
Array< OneD, Array< OneD, NekDouble > > m_coords
Array with the Cartesian coordinates.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
virtual GLOBAL_MAPPING_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
bool m_constantJacobian
Flag defining if the Jacobian is constant.
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_UpdateGeomInfo() 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
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_ContravarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
static std::string className
Name of the class.
virtual GLOBAL_MAPPING_EXPORT void v_DotGradJacobian(const Array< OneD, Array< OneD, NekDouble > > &inarray, 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_ApplyChristoffelContravar(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_CovarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
MappingXofXZ(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
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.
virtual GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor(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_GetMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray) override
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
MultiRegions::Direction const DirCartesianMap[]
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 Neg(int n, T *x, const int incx)
Negate x = -x.
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
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 Vdiv(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 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)
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.