43 "X = X(x,y), Y = Y(x,y)");
64 const TiXmlElement *pMapping)
71 "Mapping X = X(x,y), Y = Y(x,y) needs 2 velocity components.");
78 int physTot =
m_fields[0]->GetTotPoints();
101 int physTot =
m_fields[0]->GetTotPoints();
127 int physTot =
m_fields[0]->GetTotPoints();
153 int physTot =
m_fields[0]->GetTotPoints();
174 int physTot =
m_fields[0]->GetTotPoints();
181 int physTot =
m_fields[0]->GetTotPoints();
184 for (
int i = 0; i < nvel * nvel; i++)
202 Vmath::Sadd(physTot, 1.0, outarray[2 * nvel + 2], 1,
203 outarray[2 * nvel + 2], 1);
210 int physTot =
m_fields[0]->GetTotPoints();
213 for (
int i = 0; i < nvel * nvel; i++)
227 Vmath::Vdiv(physTot, outarray[0 * nvel + 0], 1, wk, 1,
228 outarray[0 * nvel + 0], 1);
232 Vmath::Vdiv(physTot, outarray[1 * nvel + 1], 1, wk, 1,
233 outarray[1 * nvel + 1], 1);
237 Vmath::Neg(physTot, outarray[0 * nvel + 1], 1);
238 Vmath::Vdiv(physTot, outarray[0 * nvel + 1], 1, wk, 1,
239 outarray[0 * nvel + 1], 1);
240 Vmath::Vcopy(physTot, outarray[0 * nvel + 1], 1, outarray[1 * nvel + 0], 1);
245 Vmath::Sadd(physTot, 1.0, outarray[2 * nvel + 2], 1,
246 outarray[2 * nvel + 2], 1);
254 int physTot =
m_fields[0]->GetTotPoints();
257 for (
int i = 0; i < nvel; i++)
259 for (
int j = 0; j < nvel; j++)
269 outarray[0 * nvel + 0], 1);
271 outarray[0 * nvel + 0], 1, outarray[0 * nvel + 0], 1);
275 outarray[0 * nvel + 1], 1);
277 outarray[0 * nvel + 1], 1, outarray[0 * nvel + 1], 1);
281 outarray[1 * nvel + 0], 1);
283 outarray[1 * nvel + 0], 1, outarray[1 * nvel + 0], 1);
287 outarray[1 * nvel + 1], 1);
289 outarray[1 * nvel + 1], 1, outarray[1 * nvel + 1], 1);
296 int physTot =
m_fields[0]->GetTotPoints();
299 for (
int i = 0; i < nvel; i++)
301 for (
int j = 0; j < nvel; j++)
311 outarray[0 * nvel + 0], 1);
313 outarray[0 * nvel + 0], 1, outarray[0 * nvel + 0], 1);
317 outarray[0 * nvel + 1], 1);
319 outarray[0 * nvel + 1], 1, outarray[0 * nvel + 1], 1);
323 outarray[1 * nvel + 0], 1);
325 outarray[1 * nvel + 0], 1, outarray[1 * nvel + 0], 1);
329 outarray[1 * nvel + 1], 1);
331 outarray[1 * nvel + 1], 1, outarray[1 * nvel + 1], 1);
336 int phystot =
m_fields[0]->GetTotPoints();
344 bool waveSpace =
m_fields[0]->GetWaveSpace();
368 m_fields[0]->SetWaveSpace(waveSpace);
373 int physTot =
m_fields[0]->GetTotPoints();
399 int physTot =
m_fields[0]->GetTotPoints();
408 for (
int i = 0; i < gradG.size(); i++)
413 for (
int i = 0; i < G.size(); i++)
423 bool waveSpace =
m_fields[0]->GetWaveSpace();
427 for (
int i = 0; i < 2; i++)
429 for (
int j = 0; j < 2; j++)
431 for (
int k = 0; k < 2; k++)
435 gradG[i * 2 * 2 + j * 2 + k]);
441 for (
int p = 0;
p < 2;
p++)
443 for (
int j = 0; j < 2; j++)
445 for (
int k = 0; k < 2; k++)
448 gradG[
p * 2 * 2 + k * 2 + j], 1,
449 tmp[
p * 2 * 2 + j * 2 + k], 1);
451 gradG[j * 2 * 2 + k * 2 +
p], 1,
452 tmp[
p * 2 * 2 + j * 2 + k], 1);
453 Vmath::Smul(physTot, 0.5, tmp[
p * 2 * 2 + j * 2 + k], 1,
454 tmp[
p * 2 * 2 + j * 2 + k], 1);
461 for (
int i = 0; i < 2; i++)
463 for (
int j = 0; j < 2; j++)
465 for (
int k = 0; k <= j; k++)
468 for (
int p = 0;
p < 2;
p++)
471 tmp[
p * 2 * 2 + j * 2 + k], 1,
479 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.
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.
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
GLOBAL_MAPPING_EXPORT void v_GetMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray) override
GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelContravar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
GLOBAL_MAPPING_EXPORT void v_UpdateGeomInfo() override
GLOBAL_MAPPING_EXPORT void v_CovarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
GLOBAL_MAPPING_EXPORT void v_GetJacobian(Array< OneD, NekDouble > &outarray) override
GLOBAL_MAPPING_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping) override
GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray) override
void CalculateChristoffel()
GLOBAL_MAPPING_EXPORT void v_ContravarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
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[]
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 vector 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.