35 #include <boost/core/ignore_unused.hpp>
42 namespace GlobalMapping
71 const TiXmlElement *pMapping)
78 "Mapping X = x + f(z), Y = y+g(z) needs 3 velocity components.");
85 int physTot =
m_fields[0]->GetTotPoints();
89 inarray[0], 1, outarray[0],1);
93 inarray[1], 1, outarray[1],1);
103 int physTot =
m_fields[0]->GetTotPoints();
114 Vmath::Vsub(physTot, inarray[2], 1, wk, 1, outarray[2], 1);
116 Vmath::Vsub(physTot, inarray[2], 1, wk, 1, outarray[2], 1);
123 int physTot =
m_fields[0]->GetTotPoints();
128 Vmath::Vsub(physTot, inarray[0], 1, wk, 1, outarray[0], 1);
132 Vmath::Vsub(physTot, inarray[1], 1, wk, 1, outarray[1], 1);
142 int physTot =
m_fields[0]->GetTotPoints();
152 inarray[0], 1, outarray[2], 1);
154 outarray[2], 1, outarray[2], 1);
155 Vmath::Vadd(physTot, inarray[2], 1, outarray[2], 1, outarray[2], 1);
161 int physTot =
m_fields[0]->GetTotPoints();
169 boost::ignore_unused(inarray);
171 int physTot =
m_fields[0]->GetTotPoints();
178 int physTot =
m_fields[0]->GetTotPoints();
181 for (
int i=0; i<nvel*nvel; i++)
186 for (
int i=0; i<nvel; i++)
189 outarray[i*nvel+i], 1);
202 outarray[2*nvel+2], 1);
204 outarray[2*nvel+2], 1);
210 int physTot =
m_fields[0]->GetTotPoints();
214 for (
int i=0; i<nvel*nvel; i++)
219 for (
int i=0; i<nvel; i++)
222 outarray[i*nvel+i], 1);
227 outarray[0*nvel+0], 1);
231 outarray[1*nvel+1], 1);
235 Vmath::Vcopy(physTot, outarray[0*nvel+1], 1, outarray[1*nvel+0], 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+2],1);
273 outarray[1*nvel+2],1);
281 int physTot =
m_fields[0]->GetTotPoints();
284 for (
int i = 0; i< nvel; i++)
286 for (
int j = 0; j< nvel; j++)
297 outarray[2*nvel+2], 1, outarray[2*nvel+2],1);
302 int phystot =
m_fields[0]->GetTotPoints();
310 bool waveSpace =
m_fields[0]->GetWaveSpace();
335 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.
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
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.
virtual GLOBAL_MAPPING_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
virtual GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual GLOBAL_MAPPING_EXPORT void v_GetMetricTensor(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_ContravarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual GLOBAL_MAPPING_EXPORT void v_GetJacobian(Array< OneD, NekDouble > &outarray)
static std::string className
Name of the class.
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_CovarFromCartesian(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.
MappingXYofZ(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
virtual GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelContravar(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_ContravarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual GLOBAL_MAPPING_EXPORT void v_DotGradJacobian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
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 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 Zero(int n, T *x, const int incx)
Zero vector.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
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.