40namespace GlobalMapping
45 "X = X(x,y), Y = Y(x,y)");
69 const TiXmlElement *pMapping)
76 "Mapping X = X(x,y), Y = Y(x,y) needs 2 velocity components.");
83 int physTot =
m_fields[0]->GetTotPoints();
106 int physTot =
m_fields[0]->GetTotPoints();
132 int physTot =
m_fields[0]->GetTotPoints();
158 int physTot =
m_fields[0]->GetTotPoints();
179 int physTot =
m_fields[0]->GetTotPoints();
186 int physTot =
m_fields[0]->GetTotPoints();
189 for (
int i = 0; i < nvel * nvel; i++)
207 Vmath::Sadd(physTot, 1.0, outarray[2 * nvel + 2], 1,
208 outarray[2 * nvel + 2], 1);
215 int physTot =
m_fields[0]->GetTotPoints();
218 for (
int i = 0; i < nvel * nvel; i++)
232 Vmath::Vdiv(physTot, outarray[0 * nvel + 0], 1, wk, 1,
233 outarray[0 * nvel + 0], 1);
237 Vmath::Vdiv(physTot, outarray[1 * nvel + 1], 1, wk, 1,
238 outarray[1 * nvel + 1], 1);
242 Vmath::Neg(physTot, outarray[0 * nvel + 1], 1);
243 Vmath::Vdiv(physTot, outarray[0 * nvel + 1], 1, wk, 1,
244 outarray[0 * nvel + 1], 1);
245 Vmath::Vcopy(physTot, outarray[0 * nvel + 1], 1, outarray[1 * nvel + 0], 1);
250 Vmath::Sadd(physTot, 1.0, outarray[2 * nvel + 2], 1,
251 outarray[2 * nvel + 2], 1);
259 int physTot =
m_fields[0]->GetTotPoints();
262 for (
int i = 0; i < nvel; i++)
264 for (
int j = 0; j < nvel; j++)
274 outarray[0 * nvel + 0], 1);
276 outarray[0 * nvel + 0], 1, outarray[0 * nvel + 0], 1);
280 outarray[0 * nvel + 1], 1);
282 outarray[0 * nvel + 1], 1, outarray[0 * nvel + 1], 1);
286 outarray[1 * nvel + 0], 1);
288 outarray[1 * nvel + 0], 1, outarray[1 * nvel + 0], 1);
292 outarray[1 * nvel + 1], 1);
294 outarray[1 * nvel + 1], 1, outarray[1 * nvel + 1], 1);
301 int physTot =
m_fields[0]->GetTotPoints();
304 for (
int i = 0; i < nvel; i++)
306 for (
int j = 0; j < nvel; j++)
316 outarray[0 * nvel + 0], 1);
318 outarray[0 * nvel + 0], 1, outarray[0 * nvel + 0], 1);
322 outarray[0 * nvel + 1], 1);
324 outarray[0 * nvel + 1], 1, outarray[0 * nvel + 1], 1);
328 outarray[1 * nvel + 0], 1);
330 outarray[1 * nvel + 0], 1, outarray[1 * nvel + 0], 1);
334 outarray[1 * nvel + 1], 1);
336 outarray[1 * nvel + 1], 1, outarray[1 * nvel + 1], 1);
341 int phystot =
m_fields[0]->GetTotPoints();
349 bool waveSpace =
m_fields[0]->GetWaveSpace();
373 m_fields[0]->SetWaveSpace(waveSpace);
378 int physTot =
m_fields[0]->GetTotPoints();
404 int physTot =
m_fields[0]->GetTotPoints();
413 for (
int i = 0; i < gradG.size(); i++)
418 for (
int i = 0; i < G.size(); i++)
428 bool waveSpace =
m_fields[0]->GetWaveSpace();
432 for (
int i = 0; i < 2; i++)
434 for (
int j = 0; j < 2; j++)
436 for (
int k = 0; k < 2; k++)
440 gradG[i * 2 * 2 + j * 2 + k]);
446 for (
int p = 0;
p < 2;
p++)
448 for (
int j = 0; j < 2; j++)
450 for (
int k = 0; k < 2; k++)
453 gradG[
p * 2 * 2 + k * 2 + j], 1,
454 tmp[
p * 2 * 2 + j * 2 + k], 1);
456 gradG[j * 2 * 2 + k * 2 +
p], 1,
457 tmp[
p * 2 * 2 + j * 2 + k], 1);
458 Vmath::Smul(physTot, 0.5, tmp[
p * 2 * 2 + j * 2 + k], 1,
459 tmp[
p * 2 * 2 + j * 2 + k], 1);
466 for (
int i = 0; i < 2; i++)
468 for (
int j = 0; j < 2; j++)
470 for (
int k = 0; k <= j; k++)
473 for (
int p = 0;
p < 2;
p++)
476 tmp[
p * 2 * 2 + j * 2 + k], 1,
484 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.
GLOBAL_MAPPING_EXPORT void GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
Get the inverse of metric tensor .
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
GLOBAL_MAPPING_EXPORT void GetMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
Get the metric tensor .
GLOBAL_MAPPING_EXPORT void GetJacobian(Array< OneD, NekDouble > &outarray)
Get the Jacobian of the transformation.
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.
static std::string className
Name of the class.
virtual GLOBAL_MAPPING_EXPORT void v_CovarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
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_ApplyChristoffelCovar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
MappingXYofXY(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Array< OneD, Array< OneD, NekDouble > > m_metricTensor
Array< OneD, Array< OneD, NekDouble > > m_Christoffel
virtual GLOBAL_MAPPING_EXPORT void v_GetMetricTensor(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_UpdateGeomInfo() override
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_GetJacobian(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_GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray) override
void CalculateChristoffel()
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
void CalculateMetricTensor()
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 Vabs(int n, const T *x, const int incx, T *y, const int incy)
vabs: y = |x|
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 Vvtvm(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)
vvtvm (vector times vector minus vector): z = w*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.
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.