45 "X = X(x,y,z), Y = Y(x,y,z), Z=Z(x,y,z)");
69 const TiXmlElement *pMapping)
76 "General Mapping needs at least 2 velocity components.");
83 int physTot =
m_fields[0]->GetTotPoints();
86 for (
int i = 0; i < nvel; i++)
89 for (
int j = 0; j < nvel; j++)
92 outarray[i], 1, outarray[i], 1);
101 int physTot =
m_fields[0]->GetTotPoints();
104 for (
int i = 0; i < nvel; i++)
107 for (
int j = 0; j < nvel; j++)
110 outarray[i], 1, outarray[i], 1);
119 int physTot =
m_fields[0]->GetTotPoints();
122 for (
int i = 0; i < nvel; i++)
125 for (
int j = 0; j < nvel; j++)
128 outarray[i], 1, outarray[i], 1);
137 int physTot =
m_fields[0]->GetTotPoints();
140 for (
int i = 0; i < nvel; i++)
143 for (
int j = 0; j < nvel; j++)
146 outarray[i], 1, outarray[i], 1);
153 int physTot =
m_fields[0]->GetTotPoints();
160 int physTot =
m_fields[0]->GetTotPoints();
163 for (
int i = 0; i < nvel; i++)
165 for (
int j = 0; j < nvel; j++)
169 outarray[i * nvel + j], 1);
177 int physTot =
m_fields[0]->GetTotPoints();
180 for (
int i = 0; i < nvel; i++)
182 for (
int j = 0; j < nvel; j++)
186 outarray[i * nvel + j], 1);
195 int physTot =
m_fields[0]->GetTotPoints();
199 for (
int i = 0; i < nvel; i++)
201 for (
int k = 0; k < nvel; k++)
204 for (
int j = 0; j < nvel; j++)
208 outarray[i * nvel + k], 1, outarray[i * nvel + k],
219 int physTot =
m_fields[0]->GetTotPoints();
223 for (
int j = 0; j < nvel; j++)
225 for (
int k = 0; k < nvel; k++)
228 for (
int i = 0; i < nvel; i++)
232 outarray[j * nvel + k], 1, outarray[j * nvel + k],
247 int physTot =
m_fields[0]->GetTotPoints();
251 bool wavespace =
m_fields[0]->GetWaveSpace();
269 for (
int i = 0; i < nvel; i++)
271 for (
int j = 0; j < nvel; j++)
285 for (
int i = 0; i < nvel; i++)
287 for (
int j = 0; j < nvel; j++)
289 for (
int k = 0; k < nvel; k++)
317 int a, b, c,
d, e, i, j;
320 for (i = 0; i < nvel; ++i)
322 for (j = 0; j < nvel; ++j)
324 a = ((i + 1) % nvel) * nvel + ((j + 1) % nvel);
325 b = ((i + 1) % nvel) * nvel + ((j + 2) % nvel);
326 c = ((i + 2) % nvel) * nvel + ((j + 1) % nvel);
327 d = ((i + 2) % nvel) * nvel + ((j + 2) % nvel);
343 for (
int i = 0; i < nvel; ++i)
350 for (
int i = 0; i < nvel * nvel; ++i)
361 for (
int i = 0; i < nvel; ++i)
363 for (
int j = 0; j < nvel; ++j)
365 for (
int k = 0; k < nvel; ++k)
376 m_fields[0]->SetWaveSpace(wavespace);
381 int physTot =
m_fields[0]->GetTotPoints();
388 for (
int i = 0; i < gradG.size(); i++)
396 bool waveSpace =
m_fields[0]->GetWaveSpace();
400 for (
int i = 0; i < nvel; i++)
402 for (
int j = 0; j < nvel; j++)
404 for (
int k = 0; k < nvel; k++)
408 gradG[i * nvel * nvel + j * nvel + k]);
414 for (
int p = 0;
p < nvel;
p++)
416 for (
int j = 0; j < nvel; j++)
418 for (
int k = 0; k < nvel; k++)
420 Vmath::Vadd(physTot, gradG[
p * nvel * nvel + j * nvel + k], 1,
421 gradG[
p * nvel * nvel + k * nvel + j], 1,
422 tmp[
p * nvel * nvel + j * nvel + k], 1);
423 Vmath::Vsub(physTot, tmp[
p * nvel * nvel + j * nvel + k], 1,
424 gradG[j * nvel * nvel + k * nvel +
p], 1,
425 tmp[
p * nvel * nvel + j * nvel + k], 1);
426 Vmath::Smul(physTot, 0.5, tmp[
p * nvel * nvel + j * nvel + k],
427 1, tmp[
p * nvel * nvel + j * nvel + k], 1);
433 for (
int i = 0; i < nvel; i++)
435 for (
int j = 0; j < nvel; j++)
437 for (
int k = 0; k < nvel; k++)
439 for (
int p = 0;
p < nvel;
p++)
443 tmp[
p * nvel * nvel + j * nvel + k], 1,
451 m_fields[0]->SetWaveSpace(waveSpace);
#define ASSERTL0(condition, msg)
static std::string className
Name of the class.
GLOBAL_MAPPING_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping) override
GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelCovar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
GLOBAL_MAPPING_EXPORT void v_CovarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
Array< OneD, Array< OneD, NekDouble > > m_invDeriv
Array< OneD, Array< OneD, NekDouble > > m_metricTensor
GLOBAL_MAPPING_EXPORT void v_GetJacobian(Array< OneD, NekDouble > &outarray) override
Array< OneD, Array< OneD, NekDouble > > m_deriv
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_ContravarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
Array< OneD, NekDouble > m_jac
Array< OneD, Array< OneD, NekDouble > > m_invMetricTensor
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_CovarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray) override
void CalculateChristoffel()
void CalculateMetricTerms()
Array< OneD, Array< OneD, NekDouble > > m_Christoffel
MappingGeneral(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.
GLOBAL_MAPPING_EXPORT void v_UpdateGeomInfo() override
Base class for mapping to be applied to the coordinate system.
int m_nConvectiveFields
Number of velocity components.
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.
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[]
std::vector< double > d(NPUPPER *NPUPPER)
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
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 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 Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
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.