43 "X = X(x,y), Y = Y(x,y)");
67 const TiXmlElement *pMapping)
74 "Mapping X = X(x,y), Y = Y(x,y) needs 2 velocity components.");
81 int physTot =
m_fields[0]->GetTotPoints();
104 int physTot =
m_fields[0]->GetTotPoints();
130 int physTot =
m_fields[0]->GetTotPoints();
156 int physTot =
m_fields[0]->GetTotPoints();
177 int physTot =
m_fields[0]->GetTotPoints();
184 int physTot =
m_fields[0]->GetTotPoints();
187 for (
int i = 0; i < nvel * nvel; i++)
205 Vmath::Sadd(physTot, 1.0, outarray[2 * nvel + 2], 1,
206 outarray[2 * nvel + 2], 1);
213 int physTot =
m_fields[0]->GetTotPoints();
216 for (
int i = 0; i < nvel * nvel; i++)
230 Vmath::Vdiv(physTot, outarray[0 * nvel + 0], 1, wk, 1,
231 outarray[0 * nvel + 0], 1);
235 Vmath::Vdiv(physTot, outarray[1 * nvel + 1], 1, wk, 1,
236 outarray[1 * nvel + 1], 1);
240 Vmath::Neg(physTot, outarray[0 * nvel + 1], 1);
241 Vmath::Vdiv(physTot, outarray[0 * nvel + 1], 1, wk, 1,
242 outarray[0 * nvel + 1], 1);
243 Vmath::Vcopy(physTot, outarray[0 * nvel + 1], 1, outarray[1 * nvel + 0], 1);
248 Vmath::Sadd(physTot, 1.0, outarray[2 * nvel + 2], 1,
249 outarray[2 * nvel + 2], 1);
257 int physTot =
m_fields[0]->GetTotPoints();
260 for (
int i = 0; i < nvel; i++)
262 for (
int j = 0; j < nvel; j++)
272 outarray[0 * nvel + 0], 1);
274 outarray[0 * nvel + 0], 1, outarray[0 * nvel + 0], 1);
278 outarray[0 * nvel + 1], 1);
280 outarray[0 * nvel + 1], 1, outarray[0 * nvel + 1], 1);
284 outarray[1 * nvel + 0], 1);
286 outarray[1 * nvel + 0], 1, outarray[1 * nvel + 0], 1);
290 outarray[1 * nvel + 1], 1);
292 outarray[1 * nvel + 1], 1, outarray[1 * nvel + 1], 1);
299 int physTot =
m_fields[0]->GetTotPoints();
302 for (
int i = 0; i < nvel; i++)
304 for (
int j = 0; j < nvel; j++)
314 outarray[0 * nvel + 0], 1);
316 outarray[0 * nvel + 0], 1, outarray[0 * nvel + 0], 1);
320 outarray[0 * nvel + 1], 1);
322 outarray[0 * nvel + 1], 1, outarray[0 * nvel + 1], 1);
326 outarray[1 * nvel + 0], 1);
328 outarray[1 * nvel + 0], 1, outarray[1 * nvel + 0], 1);
332 outarray[1 * nvel + 1], 1);
334 outarray[1 * nvel + 1], 1, outarray[1 * nvel + 1], 1);
339 int phystot =
m_fields[0]->GetTotPoints();
347 bool waveSpace =
m_fields[0]->GetWaveSpace();
371 m_fields[0]->SetWaveSpace(waveSpace);
376 int physTot =
m_fields[0]->GetTotPoints();
402 int physTot =
m_fields[0]->GetTotPoints();
411 for (
int i = 0; i < gradG.size(); i++)
416 for (
int i = 0; i < G.size(); i++)
426 bool waveSpace =
m_fields[0]->GetWaveSpace();
430 for (
int i = 0; i < 2; i++)
432 for (
int j = 0; j < 2; j++)
434 for (
int k = 0; k < 2; k++)
438 gradG[i * 2 * 2 + j * 2 + k]);
444 for (
int p = 0;
p < 2;
p++)
446 for (
int j = 0; j < 2; j++)
448 for (
int k = 0; k < 2; k++)
451 gradG[
p * 2 * 2 + k * 2 + j], 1,
452 tmp[
p * 2 * 2 + j * 2 + k], 1);
454 gradG[j * 2 * 2 + k * 2 +
p], 1,
455 tmp[
p * 2 * 2 + j * 2 + k], 1);
456 Vmath::Smul(physTot, 0.5, tmp[
p * 2 * 2 + j * 2 + k], 1,
457 tmp[
p * 2 * 2 + j * 2 + k], 1);
464 for (
int i = 0; i < 2; i++)
466 for (
int j = 0; j < 2; j++)
468 for (
int k = 0; k <= j; k++)
471 for (
int p = 0;
p < 2;
p++)
474 tmp[
p * 2 * 2 + j * 2 + k], 1,
482 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.