41 namespace GlobalMapping
71 const TiXmlElement *pMapping)
78 "General Mapping needs at least 2 velocity components.");
85 int physTot =
m_fields[0]->GetTotPoints();
88 for (
int i=0; i<nvel; i++)
91 for (
int j=0; j<nvel; j++)
106 int physTot =
m_fields[0]->GetTotPoints();
109 for (
int i=0; i<nvel; i++)
112 for (
int j=0; j<nvel; j++)
127 int physTot =
m_fields[0]->GetTotPoints();
130 for (
int i=0; i<nvel; i++)
133 for (
int j=0; j<nvel; j++)
148 int physTot =
m_fields[0]->GetTotPoints();
151 for (
int i=0; i<nvel; i++)
154 for (
int j=0; j<nvel; j++)
168 int physTot =
m_fields[0]->GetTotPoints();
175 int physTot =
m_fields[0]->GetTotPoints();
178 for (
int i=0; i<nvel; i++)
180 for (
int j=0; j<nvel; j++)
184 outarray[i*nvel+j], 1);
193 int physTot =
m_fields[0]->GetTotPoints();
196 for (
int i=0; i<nvel; i++)
198 for (
int j=0; j<nvel; j++)
202 outarray[i*nvel+j], 1);
212 int physTot =
m_fields[0]->GetTotPoints();
216 for (
int i = 0; i <nvel; i++)
218 for (
int k = 0; k < nvel; k++)
221 for (
int j = 0; j < nvel; j++)
225 outarray[i*nvel+k], 1,
226 outarray[i*nvel+k], 1);
237 int physTot =
m_fields[0]->GetTotPoints();
241 for (
int j = 0; j < nvel; j++)
243 for (
int k = 0; k < nvel; k++)
246 for (
int i = 0; i <nvel; i++)
250 outarray[j*nvel+k], 1,
251 outarray[j*nvel+k], 1);
265 int physTot =
m_fields[0]->GetTotPoints();
269 bool wavespace =
m_fields[0]->GetWaveSpace();
287 for(
int i = 0; i<nvel; i++)
289 for(
int j = 0; j<nvel; j++)
304 for(
int i = 0; i<nvel; i++)
306 for(
int j = 0; j<nvel; j++)
308 for(
int k = 0; k<nvel; k++)
336 int a, b, c, d, e, i, j;
339 for (i = 0; i < nvel; ++i)
341 for (j = 0; j < nvel; ++j)
343 a = ((i+1)%nvel) * nvel + ((j+1)%nvel);
344 b = ((i+1)%nvel) * nvel + ((j+2)%nvel);
345 c = ((i+2)%nvel) * nvel + ((j+1)%nvel);
346 d = ((i+2)%nvel) * nvel + ((j+2)%nvel);
364 for (
int i = 0; i < nvel; ++i)
372 for (
int i = 0; i < nvel*nvel; ++i)
383 for (
int i = 0; i < nvel; ++i)
385 for (
int j = 0; j < nvel; ++j)
387 for (
int k = 0; k < nvel; ++k)
398 m_fields[0]->SetWaveSpace(wavespace);
403 int physTot =
m_fields[0]->GetTotPoints();
410 for (
int i = 0; i < gradG.size(); i++)
418 bool waveSpace =
m_fields[0]->GetWaveSpace();
422 for (
int i = 0; i <nvel; i++)
424 for(
int j=0; j<nvel; j++)
426 for(
int k=0; k<nvel; k++)
430 gradG[i*nvel*nvel + j*nvel + k]);
436 for (
int p = 0;
p <nvel;
p++)
438 for (
int j = 0; j < nvel; j++)
440 for (
int k = 0; k < nvel; k++)
442 Vmath::Vadd(physTot, gradG[
p*nvel*nvel + j*nvel + k], 1,
443 gradG[
p*nvel*nvel + k*nvel + j], 1,
444 tmp[
p*nvel*nvel + j*nvel + k], 1);
446 gradG[j*nvel*nvel + k*nvel +
p], 1,
447 tmp[
p*nvel*nvel + j*nvel + k], 1);
448 Vmath::Smul(physTot, 0.5, tmp[
p*nvel*nvel + j*nvel + k], 1,
449 tmp[
p*nvel*nvel + j*nvel + k], 1);
455 for (
int i = 0; i <nvel; i++)
457 for (
int j = 0; j < nvel; j++)
459 for (
int k = 0; k < nvel; k++)
461 for (
int p = 0;
p < nvel;
p++)
464 tmp[
p*nvel*nvel + j*nvel + k], 1,
472 m_fields[0]->SetWaveSpace(waveSpace);
#define ASSERTL0(condition, msg)
static std::string className
Name of the class.
virtual GLOBAL_MAPPING_EXPORT void v_CovarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Array< OneD, Array< OneD, NekDouble > > m_invDeriv
Array< OneD, Array< OneD, NekDouble > > m_metricTensor
virtual GLOBAL_MAPPING_EXPORT void v_GetJacobian(Array< OneD, NekDouble > &outarray)
Array< OneD, Array< OneD, NekDouble > > m_deriv
virtual GLOBAL_MAPPING_EXPORT void v_GetMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
Array< OneD, NekDouble > m_jac
Array< OneD, Array< OneD, NekDouble > > m_invMetricTensor
virtual GLOBAL_MAPPING_EXPORT void v_ContravarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
void CalculateChristoffel()
void CalculateMetricTerms()
Array< OneD, Array< OneD, NekDouble > > m_Christoffel
virtual GLOBAL_MAPPING_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
virtual GLOBAL_MAPPING_EXPORT void v_ContravarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual GLOBAL_MAPPING_EXPORT void v_UpdateGeomInfo()
virtual GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelContravar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
MappingGeneral(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
virtual GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelCovar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
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_CovarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
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[]
The above copyright notice and this permission notice shall be included.
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 plus 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.