40 namespace GlobalMapping
70 const TiXmlElement *pMapping)
77 "Mapping X = X(x,y), Y = Y(x,y) needs 2 velocity components.");
84 int physTot =
m_fields[0]->GetTotPoints();
90 outarray[0], 1, outarray[0],1);
96 outarray[1], 1, outarray[1],1);
109 int physTot =
m_fields[0]->GetTotPoints();
141 int physTot =
m_fields[0]->GetTotPoints();
173 int physTot =
m_fields[0]->GetTotPoints();
179 outarray[0], 1, outarray[0],1);
185 outarray[1], 1, outarray[1],1);
197 int physTot =
m_fields[0]->GetTotPoints();
204 int physTot =
m_fields[0]->GetTotPoints();
207 for (
int i=0; i<nvel*nvel; i++)
226 outarray[2*nvel+2], 1);
233 int physTot =
m_fields[0]->GetTotPoints();
236 for (
int i=0; i<nvel*nvel; i++)
251 outarray[0*nvel+0], 1);
256 outarray[1*nvel+1], 1);
262 outarray[0*nvel+1], 1);
263 Vmath::Vcopy(physTot, outarray[0*nvel+1], 1, outarray[1*nvel+0], 1);
269 outarray[2*nvel+2], 1);
277 int physTot =
m_fields[0]->GetTotPoints();
280 for (
int i = 0; i< nvel; i++)
282 for (
int j = 0; j< nvel; j++)
292 outarray[0*nvel+0],1);
294 outarray[0*nvel+0],1,outarray[0*nvel+0],1);
298 outarray[0*nvel+1],1);
300 outarray[0*nvel+1],1,outarray[0*nvel+1],1);
304 outarray[1*nvel+0],1);
306 outarray[1*nvel+0],1,outarray[1*nvel+0],1);
310 outarray[1*nvel+1],1);
312 outarray[1*nvel+1],1,outarray[1*nvel+1],1);
320 int physTot =
m_fields[0]->GetTotPoints();
323 for (
int i = 0; i< nvel; i++)
325 for (
int j = 0; j< nvel; j++)
335 outarray[0*nvel+0],1);
337 outarray[0*nvel+0],1,outarray[0*nvel+0],1);
341 outarray[0*nvel+1],1);
343 outarray[0*nvel+1],1,outarray[0*nvel+1],1);
347 outarray[1*nvel+0],1);
349 outarray[1*nvel+0],1,outarray[1*nvel+0],1);
353 outarray[1*nvel+1],1);
355 outarray[1*nvel+1],1,outarray[1*nvel+1],1);
360 int phystot =
m_fields[0]->GetTotPoints();
368 bool waveSpace =
m_fields[0]->GetWaveSpace();
388 m_fields[0]->SetWaveSpace(waveSpace);
393 int physTot =
m_fields[0]->GetTotPoints();
422 int physTot =
m_fields[0]->GetTotPoints();
431 for (
int i = 0; i < gradG.size(); i++)
436 for (
int i = 0; i < G.size(); i++)
446 bool waveSpace =
m_fields[0]->GetWaveSpace();
450 for (
int i = 0; i <2; i++)
452 for(
int j=0; j<2; j++)
454 for(
int k=0; k<2; k++)
457 G[i*nvel+j],gradG[i*2*2 + j*2 + k]);
463 for (
int p = 0;
p <2;
p++)
465 for (
int j = 0; j < 2; j++)
467 for (
int k = 0; k < 2; k++)
470 gradG[
p*2*2 + k*2 + j], 1,
471 tmp[
p*2*2 + j*2 + k], 1);
473 gradG[j*2*2 + k*2 +
p], 1,
474 tmp[
p*2*2 + j*2 + k], 1);
476 tmp[
p*2*2 + j*2 + k], 1);
483 for (
int i = 0; i <2; i++)
485 for (
int j = 0; j < 2; j++)
487 for (
int k = 0; k <= j; k++)
490 for (
int p = 0;
p < 2;
p++)
493 tmp[
p*2*2 + j*2 + k], 1,
502 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_ContravarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelCovar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelContravar(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_CovarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
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)
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)
void CalculateChristoffel()
virtual GLOBAL_MAPPING_EXPORT void v_UpdateGeomInfo()
virtual GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual GLOBAL_MAPPING_EXPORT void v_CovarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual GLOBAL_MAPPING_EXPORT void v_GetJacobian(Array< OneD, NekDouble > &outarray)
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 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 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.