Nektar++
Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
Nektar::GlobalMapping::MappingXofZ Class Reference

#include <MappingXofZ.h>

Inheritance diagram for Nektar::GlobalMapping::MappingXofZ:
[legend]

Static Public Member Functions

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. More...
 
- Static Public Member Functions inherited from Nektar::GlobalMapping::Mapping
static GLOBAL_MAPPING_EXPORT MappingSharedPtr Load (const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
 Return a pointer to the mapping, creating it on first call. More...
 

Static Public Attributes

static std::string className
 Name of the class. More...
 

Protected Member Functions

 MappingXofZ (const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
 
GLOBAL_MAPPING_EXPORT void v_InitObject (const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping) override
 
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_CovarToCartesian (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
 
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_DotGradJacobian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray) override
 
GLOBAL_MAPPING_EXPORT void v_GetMetricTensor (Array< OneD, Array< OneD, NekDouble > > &outarray) override
 
GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor (Array< OneD, Array< OneD, NekDouble > > &outarray) override
 
GLOBAL_MAPPING_EXPORT void v_LowerIndex (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
 
GLOBAL_MAPPING_EXPORT void v_RaiseIndex (const Array< OneD, Array< OneD, NekDouble > > &inarray, 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_ApplyChristoffelCovar (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
 
GLOBAL_MAPPING_EXPORT void v_UpdateGeomInfo () override
 
- Protected Member Functions inherited from Nektar::GlobalMapping::Mapping
GLOBAL_MAPPING_EXPORT Mapping (const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
 Constructor. More...
 
GLOBAL_MAPPING_EXPORT void EvaluateFunction (Array< OneD, MultiRegions::ExpListSharedPtr > pFields, LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName, Array< OneD, NekDouble > &pArray, const std::string &pFunctionName, NekDouble pTime=NekDouble(0))
 
GLOBAL_MAPPING_EXPORT void EvaluateTimeFunction (LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName, Array< OneD, NekDouble > &pArray, const std::string &pFunctionName, NekDouble pTime=NekDouble(0))
 
virtual GLOBAL_MAPPING_EXPORT void v_InitObject (const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
 
virtual GLOBAL_MAPPING_EXPORT void v_ContravarToCartesian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
 
virtual GLOBAL_MAPPING_EXPORT void v_CovarToCartesian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
 
virtual GLOBAL_MAPPING_EXPORT void v_ContravarFromCartesian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
 
virtual GLOBAL_MAPPING_EXPORT void v_CovarFromCartesian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
 
virtual GLOBAL_MAPPING_EXPORT void v_GetCartesianCoordinates (Array< OneD, NekDouble > &out0, Array< OneD, NekDouble > &out1, Array< OneD, NekDouble > &out2)
 
virtual GLOBAL_MAPPING_EXPORT void v_GetCoordVelocity (Array< OneD, Array< OneD, NekDouble > > &outarray)
 
virtual GLOBAL_MAPPING_EXPORT void v_GetJacobian (Array< OneD, NekDouble > &outarray)=0
 
virtual GLOBAL_MAPPING_EXPORT void v_DotGradJacobian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual GLOBAL_MAPPING_EXPORT void v_GetMetricTensor (Array< OneD, Array< OneD, NekDouble > > &outarray)=0
 
virtual GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor (Array< OneD, Array< OneD, NekDouble > > &outarray)=0
 
virtual GLOBAL_MAPPING_EXPORT void v_LowerIndex (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
virtual GLOBAL_MAPPING_EXPORT void v_RaiseIndex (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)=0
 
virtual GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelCovar (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
 
virtual GLOBAL_MAPPING_EXPORT void v_Divergence (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual GLOBAL_MAPPING_EXPORT void v_VelocityLaplacian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble alpha)
 
virtual GLOBAL_MAPPING_EXPORT void v_gradgradU (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
virtual GLOBAL_MAPPING_EXPORT void v_CurlCurlField (Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const bool generalized)
 
virtual GLOBAL_MAPPING_EXPORT void v_UpdateMapping (const NekDouble time, const Array< OneD, Array< OneD, NekDouble > > &coords=NullNekDoubleArrayOfArray, const Array< OneD, Array< OneD, NekDouble > > &coordsVel=NullNekDoubleArrayOfArray)
 
virtual GLOBAL_MAPPING_EXPORT void v_UpdateGeomInfo ()=0
 
virtual GLOBAL_MAPPING_EXPORT void v_UpdateBCs (const NekDouble time)
 

Friends

class MemoryManager< MappingXofZ >
 

Additional Inherited Members

- Public Member Functions inherited from Nektar::GlobalMapping::Mapping
virtual GLOBAL_MAPPING_EXPORT ~Mapping ()
 Destructor. More...
 
GLOBAL_MAPPING_EXPORT void InitObject (const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
 Initialise the mapping object. More...
 
GLOBAL_MAPPING_EXPORT void ReplaceField (const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
 Replace the Expansion List used by the mapping. More...
 
GLOBAL_MAPPING_EXPORT void Output (LibUtilities::FieldMetaDataMap &fieldMetaDataMap, const std::string &outname)
 Output function called when a chk or fld file is written. More...
 
GLOBAL_MAPPING_EXPORT void ContravarToCartesian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 Convert a contravariant vector to the Cartesian system. More...
 
GLOBAL_MAPPING_EXPORT void CovarToCartesian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 Convert a covariant vector to the Cartesian system. More...
 
GLOBAL_MAPPING_EXPORT void ContravarFromCartesian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 Convert a contravariant vector to the transformed system. More...
 
GLOBAL_MAPPING_EXPORT void CovarFromCartesian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 Convert a covariant vector to the transformed system. More...
 
GLOBAL_MAPPING_EXPORT void GetCartesianCoordinates (Array< OneD, NekDouble > &out0, Array< OneD, NekDouble > &out1, Array< OneD, NekDouble > &out2)
 Get the Cartesian coordinates in the field. More...
 
GLOBAL_MAPPING_EXPORT void GetJacobian (Array< OneD, NekDouble > &outarray)
 Get the Jacobian of the transformation. More...
 
GLOBAL_MAPPING_EXPORT void DotGradJacobian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
 Calculate the dot product with the gradient of the Jacobian. More...
 
GLOBAL_MAPPING_EXPORT void GetMetricTensor (Array< OneD, Array< OneD, NekDouble > > &outarray)
 Get the metric tensor \(g_{ij}\). More...
 
GLOBAL_MAPPING_EXPORT void GetInvMetricTensor (Array< OneD, Array< OneD, NekDouble > > &outarray)
 Get the inverse of metric tensor \(g^{ij}\). More...
 
GLOBAL_MAPPING_EXPORT void LowerIndex (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 Lower index of vector: \(v_{i} = g_{ij}*v^{j}\). More...
 
GLOBAL_MAPPING_EXPORT void RaiseIndex (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 Raise index of vector: \(v^{i} = g^{ij}*v_{j}\). More...
 
GLOBAL_MAPPING_EXPORT void ApplyChristoffelContravar (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 Apply the Christoffel symbols to a contravariant vector. More...
 
GLOBAL_MAPPING_EXPORT void ApplyChristoffelCovar (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 Apply the Christoffel symbols to a covariant vector. More...
 
GLOBAL_MAPPING_EXPORT void GetCoordVelocity (Array< OneD, Array< OneD, NekDouble > > &outarray)
 Obtain the velocity of the coordinates. More...
 
GLOBAL_MAPPING_EXPORT void Divergence (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
 Calculate the generalised divergence operator. More...
 
GLOBAL_MAPPING_EXPORT void VelocityLaplacian (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble alpha=0.0)
 Generalised (correction to the) velocity Laplacian operator. More...
 
GLOBAL_MAPPING_EXPORT void gradgradU (const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 Second order covariant derivatives of a contravariant vector. More...
 
GLOBAL_MAPPING_EXPORT void CurlCurlField (Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const bool generalized)
 CurlCurl calculated on the whole field. More...
 
GLOBAL_MAPPING_EXPORT bool IsTimeDependent ()
 Get flag defining if mapping is time-dependent. More...
 
GLOBAL_MAPPING_EXPORT void SetTimeDependent (const bool value)
 Set flag defining if mapping is time-dependent. More...
 
GLOBAL_MAPPING_EXPORT bool IsFromFunction ()
 Get flag defining if mapping is defined by a function. More...
 
GLOBAL_MAPPING_EXPORT void SetFromFunction (const bool value)
 Set flag defining if mapping is defined by a function. More...
 
GLOBAL_MAPPING_EXPORT bool HasConstantJacobian ()
 Get flag defining if mapping has constant Jacobian. More...
 
GLOBAL_MAPPING_EXPORT bool IsDefined ()
 Get flag determining if the mapping was defined or is trivial. More...
 
GLOBAL_MAPPING_EXPORT void UpdateBCs (const NekDouble time)
 Update the Dirichlet Boundary Conditions when using Mappings. More...
 
GLOBAL_MAPPING_EXPORT void UpdateMapping (const NekDouble time, const Array< OneD, Array< OneD, NekDouble > > &coords=NullNekDoubleArrayOfArray, const Array< OneD, Array< OneD, NekDouble > > &coordsVel=NullNekDoubleArrayOfArray)
 Update the Mapping with new coordinates. More...
 
GLOBAL_MAPPING_EXPORT void UpdateGeomInfo ()
 Recompute the metric terms of the Mapping. More...
 
- Protected Attributes inherited from Nektar::GlobalMapping::Mapping
LibUtilities::SessionReaderSharedPtr m_session
 Session reader. More...
 
LibUtilities::FieldIOSharedPtr m_fld
 
Array< OneD, MultiRegions::ExpListSharedPtrm_fields
 
Array< OneD, Array< OneD, NekDouble > > m_coords
 Array with the Cartesian coordinates. More...
 
Array< OneD, Array< OneD, NekDouble > > m_coordsVel
 Array with the velocity of the coordinates. More...
 
Array< OneD, Array< OneD, NekDouble > > m_GeometricInfo
 Array with metric terms of the mapping. More...
 
int m_nConvectiveFields
 Number of velocity components. More...
 
std::string m_funcName
 Name of the function containing the coordinates. More...
 
std::string m_velFuncName
 Name of the function containing the velocity of the coordinates. More...
 
bool m_constantJacobian
 Flag defining if the Jacobian is constant. More...
 
bool m_timeDependent
 Flag defining if the Mapping is time-dependent. More...
 
bool m_fromFunction
 Flag defining if the Mapping is defined by a function. More...
 
Array< OneD, Array< OneD, NekDouble > > m_wk1
 
Array< OneD, Array< OneD, NekDouble > > m_wk2
 
Array< OneD, Array< OneD, NekDouble > > m_tmp
 
- Static Protected Attributes inherited from Nektar::GlobalMapping::Mapping
static MappingSharedPtr m_mappingPtr = MappingSharedPtr()
 
static bool m_init = false
 
static bool m_isDefined = false
 

Detailed Description

This class implements a constant-Jacobian mapping defined by a transformation of the type

\[ \bar{x} = \bar{x}(x,z) = x + f(z) \]

\[ \bar{y} = y \]

\[ \bar{z} = z \]

where \((\bar{x},\bar{y},\bar{z})\) are the Cartesian (physical) coordinates and \((x,y,z)\) are the transformed (computational) coordinates.

Definition at line 43 of file MappingXofZ.h.

Constructor & Destructor Documentation

◆ MappingXofZ()

Nektar::GlobalMapping::MappingXofZ::MappingXofZ ( const LibUtilities::SessionReaderSharedPtr pSession,
const Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields 
)
protected

Definition at line 56 of file MappingXofZ.cpp.

59 : Mapping(pSession, pFields)
60{
61}
GLOBAL_MAPPING_EXPORT Mapping(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Constructor.
Definition: Mapping.cpp:53

Member Function Documentation

◆ create()

static GLOBAL_MAPPING_EXPORT MappingSharedPtr Nektar::GlobalMapping::MappingXofZ::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const TiXmlElement *  pMapping 
)
inlinestatic

Creates an instance of this class.

Definition at line 50 of file MappingXofZ.h.

54 {
57 p->InitObject(pFields, pMapping);
58 return p;
59 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
GLOBAL_MAPPING_EXPORT typedef std::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:57

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::GlobalMapping::MappingSharedPtr, and CellMLToNektar.cellml_metadata::p.

◆ v_ApplyChristoffelContravar()

void Nektar::GlobalMapping::MappingXofZ::v_ApplyChristoffelContravar ( const Array< OneD, Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
overrideprotectedvirtual

Implements Nektar::GlobalMapping::Mapping.

Definition at line 263 of file MappingXofZ.cpp.

266{
267 int physTot = m_fields[0]->GetTotPoints();
268 int nvel = m_nConvectiveFields;
269
270 for (int i = 0; i < nvel; i++)
271 {
272 for (int j = 0; j < nvel; j++)
273 {
274 outarray[i * nvel + j] = Array<OneD, NekDouble>(physTot, 0.0);
275 }
276 }
277
278 // Calculate non-zero terms
279
280 // outarray(0,2) = U3 * fzz
281 Vmath::Vmul(physTot, m_GeometricInfo[1], 1, inarray[2], 1,
282 outarray[0 * nvel + 2], 1); // U1 * fzz
283}
int m_nConvectiveFields
Number of velocity components.
Definition: Mapping.h:418
Array< OneD, Array< OneD, NekDouble > > m_GeometricInfo
Array with metric terms of the mapping.
Definition: Mapping.h:416
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Definition: Mapping.h:410
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.
Definition: Vmath.hpp:72

References Nektar::GlobalMapping::Mapping::m_fields, Nektar::GlobalMapping::Mapping::m_GeometricInfo, Nektar::GlobalMapping::Mapping::m_nConvectiveFields, and Vmath::Vmul().

◆ v_ApplyChristoffelCovar()

void Nektar::GlobalMapping::MappingXofZ::v_ApplyChristoffelCovar ( const Array< OneD, Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
overrideprotectedvirtual

Implements Nektar::GlobalMapping::Mapping.

Definition at line 285 of file MappingXofZ.cpp.

288{
289 int physTot = m_fields[0]->GetTotPoints();
290 int nvel = m_nConvectiveFields;
291
292 for (int i = 0; i < nvel; i++)
293 {
294 for (int j = 0; j < nvel; j++)
295 {
296 outarray[i * nvel + j] = Array<OneD, NekDouble>(physTot, 0.0);
297 }
298 }
299
300 // Calculate non-zero terms
301
302 // outarray(2,2) = U1 * fzz
303 Vmath::Vmul(physTot, m_GeometricInfo[1], 1, inarray[0], 1,
304 outarray[2 * nvel + 2], 1); // U1 * fzz
305}

References Nektar::GlobalMapping::Mapping::m_fields, Nektar::GlobalMapping::Mapping::m_GeometricInfo, Nektar::GlobalMapping::Mapping::m_nConvectiveFields, and Vmath::Vmul().

◆ v_ContravarFromCartesian()

void Nektar::GlobalMapping::MappingXofZ::v_ContravarFromCartesian ( const Array< OneD, Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
overrideprotectedvirtual

Implements Nektar::GlobalMapping::Mapping.

Definition at line 111 of file MappingXofZ.cpp.

114{
115 int physTot = m_fields[0]->GetTotPoints();
116 Array<OneD, NekDouble> wk(physTot, 0.0);
117
118 // U1 = u1 - fz * u3
119 Vmath::Vmul(physTot, m_GeometricInfo[0], 1, inarray[2], 1, wk, 1);
120 Vmath::Vsub(physTot, inarray[0], 1, wk, 1, outarray[0], 1);
121
122 // U2 = u2
123 Vmath::Vcopy(physTot, inarray[1], 1, outarray[1], 1);
124
125 // U3 = u3
126 Vmath::Vcopy(physTot, inarray[2], 1, outarray[2], 1);
127}
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825
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.
Definition: Vmath.hpp:220

References Nektar::GlobalMapping::Mapping::m_fields, Nektar::GlobalMapping::Mapping::m_GeometricInfo, Vmath::Vcopy(), Vmath::Vmul(), and Vmath::Vsub().

◆ v_ContravarToCartesian()

void Nektar::GlobalMapping::MappingXofZ::v_ContravarToCartesian ( const Array< OneD, Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
overrideprotectedvirtual

Implements Nektar::GlobalMapping::Mapping.

Definition at line 75 of file MappingXofZ.cpp.

78{
79 int physTot = m_fields[0]->GetTotPoints();
80 Array<OneD, NekDouble> wk(physTot, 0.0);
81
82 // U1 = u1 + fz*u3
83 Vmath::Vmul(physTot, inarray[2], 1, m_GeometricInfo[0], 1, wk, 1);
84 Vmath::Vadd(physTot, wk, 1, inarray[0], 1, outarray[0], 1);
85
86 // U2 = u2
87 Vmath::Vcopy(physTot, inarray[1], 1, outarray[1], 1);
88
89 // U3 = u3
90 Vmath::Vcopy(physTot, inarray[2], 1, outarray[2], 1);
91}
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.
Definition: Vmath.hpp:180

References Nektar::GlobalMapping::Mapping::m_fields, Nektar::GlobalMapping::Mapping::m_GeometricInfo, Vmath::Vadd(), Vmath::Vcopy(), and Vmath::Vmul().

◆ v_CovarFromCartesian()

void Nektar::GlobalMapping::MappingXofZ::v_CovarFromCartesian ( const Array< OneD, Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
overrideprotectedvirtual

Implements Nektar::GlobalMapping::Mapping.

Definition at line 129 of file MappingXofZ.cpp.

132{
133 int physTot = m_fields[0]->GetTotPoints();
134
135 // U1 = u1
136 Vmath::Vcopy(physTot, inarray[0], 1, outarray[0], 1);
137
138 // U2 = u2
139 Vmath::Vcopy(physTot, inarray[1], 1, outarray[1], 1);
140
141 // U3 = u3 + fz*u1
142 Vmath::Vmul(physTot, m_GeometricInfo[0], 1, inarray[0], 1, outarray[2], 1);
143 Vmath::Vadd(physTot, inarray[2], 1, outarray[2], 1, outarray[2], 1);
144}

References Nektar::GlobalMapping::Mapping::m_fields, Nektar::GlobalMapping::Mapping::m_GeometricInfo, Vmath::Vadd(), Vmath::Vcopy(), and Vmath::Vmul().

◆ v_CovarToCartesian()

void Nektar::GlobalMapping::MappingXofZ::v_CovarToCartesian ( const Array< OneD, Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
overrideprotectedvirtual

Implements Nektar::GlobalMapping::Mapping.

Definition at line 93 of file MappingXofZ.cpp.

96{
97 int physTot = m_fields[0]->GetTotPoints();
98 Array<OneD, NekDouble> wk(physTot, 0.0);
99
100 // U1 = u1
101 Vmath::Vcopy(physTot, inarray[0], 1, outarray[0], 1);
102
103 // U2 = u2
104 Vmath::Vcopy(physTot, inarray[1], 1, outarray[1], 1);
105
106 // U3 = u3 - fz*u1
107 Vmath::Vmul(physTot, m_GeometricInfo[0], 1, inarray[0], 1, wk, 1);
108 Vmath::Vsub(physTot, inarray[2], 1, wk, 1, outarray[2], 1);
109}

References Nektar::GlobalMapping::Mapping::m_fields, Nektar::GlobalMapping::Mapping::m_GeometricInfo, Vmath::Vcopy(), Vmath::Vmul(), and Vmath::Vsub().

◆ v_DotGradJacobian()

void Nektar::GlobalMapping::MappingXofZ::v_DotGradJacobian ( const Array< OneD, Array< OneD, NekDouble > > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::GlobalMapping::Mapping.

Definition at line 152 of file MappingXofZ.cpp.

155{
156 int physTot = m_fields[0]->GetTotPoints();
157
158 Vmath::Zero(physTot, outarray, 1);
159}
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.hpp:273

References Nektar::GlobalMapping::Mapping::m_fields, and Vmath::Zero().

◆ v_GetInvMetricTensor()

void Nektar::GlobalMapping::MappingXofZ::v_GetInvMetricTensor ( Array< OneD, Array< OneD, NekDouble > > &  outarray)
overrideprotectedvirtual

Implements Nektar::GlobalMapping::Mapping.

Definition at line 187 of file MappingXofZ.cpp.

189{
190 int physTot = m_fields[0]->GetTotPoints();
191 int nvel = m_nConvectiveFields;
192 Array<OneD, NekDouble> wk(physTot, 0.0);
193
194 for (int i = 0; i < nvel * nvel; i++)
195 {
196 outarray[i] = Array<OneD, NekDouble>(physTot, 0.0);
197 }
198 // Fill diagonal with 1.0
199 for (int i = 0; i < nvel; i++)
200 {
201 Vmath::Sadd(physTot, 1.0, outarray[i + nvel * i], 1,
202 outarray[i + nvel * i], 1);
203 }
204
205 // G^{13} and G^{31} = -fz
206 Vmath::Vcopy(physTot, m_GeometricInfo[0], 1, wk, 1); // fz
207 Vmath::Neg(physTot, wk, 1);
208 Vmath::Vcopy(physTot, wk, 1, outarray[0 * nvel + 2], 1);
209 Vmath::Vcopy(physTot, wk, 1, outarray[2 * nvel + 0], 1);
210
211 // G^{11} = (1+fz^2)
212 Vmath::Vadd(physTot, m_GeometricInfo[2], 1, outarray[0 * nvel + 0], 1,
213 outarray[0 * nvel + 0], 1);
214}
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.hpp:292
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
Definition: Vmath.hpp:194

References Nektar::GlobalMapping::Mapping::m_fields, Nektar::GlobalMapping::Mapping::m_GeometricInfo, Nektar::GlobalMapping::Mapping::m_nConvectiveFields, Vmath::Neg(), Vmath::Sadd(), Vmath::Vadd(), and Vmath::Vcopy().

◆ v_GetJacobian()

void Nektar::GlobalMapping::MappingXofZ::v_GetJacobian ( Array< OneD, NekDouble > &  outarray)
overrideprotectedvirtual

Implements Nektar::GlobalMapping::Mapping.

Definition at line 146 of file MappingXofZ.cpp.

147{
148 int physTot = m_fields[0]->GetTotPoints();
149 Vmath::Fill(physTot, 1.0, outarray, 1);
150}
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.hpp:54

References Vmath::Fill(), and Nektar::GlobalMapping::Mapping::m_fields.

◆ v_GetMetricTensor()

void Nektar::GlobalMapping::MappingXofZ::v_GetMetricTensor ( Array< OneD, Array< OneD, NekDouble > > &  outarray)
overrideprotectedvirtual

Implements Nektar::GlobalMapping::Mapping.

Definition at line 161 of file MappingXofZ.cpp.

163{
164 int physTot = m_fields[0]->GetTotPoints();
165 int nvel = m_nConvectiveFields;
166
167 for (int i = 0; i < nvel * nvel; i++)
168 {
169 outarray[i] = Array<OneD, NekDouble>(physTot, 0.0);
170 }
171 // Fill diagonal with 1.0
172 for (int i = 0; i < nvel; i++)
173 {
174 Vmath::Sadd(physTot, 1.0, outarray[i + nvel * i], 1,
175 outarray[i + nvel * i], 1);
176 }
177
178 // G_{13} and G_{31} = fz
179 Vmath::Vcopy(physTot, m_GeometricInfo[0], 1, outarray[0 * nvel + 2], 1);
180 Vmath::Vcopy(physTot, m_GeometricInfo[0], 1, outarray[2 * nvel + 0], 1);
181
182 // G^{33} = (1+fz^2)
183 Vmath::Vadd(physTot, m_GeometricInfo[2], 1, outarray[2 * nvel + 2], 1,
184 outarray[2 * nvel + 2], 1);
185}

References Nektar::GlobalMapping::Mapping::m_fields, Nektar::GlobalMapping::Mapping::m_GeometricInfo, Nektar::GlobalMapping::Mapping::m_nConvectiveFields, Vmath::Sadd(), Vmath::Vadd(), and Vmath::Vcopy().

◆ v_InitObject()

void Nektar::GlobalMapping::MappingXofZ::v_InitObject ( const Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const TiXmlElement *  pMapping 
)
overrideprotectedvirtual

This function initialises the Mapping object. It computes the coordinates and velocity coordinates, initialises the workspace variables, and calls UpdateGeomInfo, which will perform the calculations specific for each type of Mapping.

Parameters
pFieldsExpList array used in the mapping
pMappingxml element describing the mapping

Reimplemented from Nektar::GlobalMapping::Mapping.

Definition at line 63 of file MappingXofZ.cpp.

66{
67 Mapping::v_InitObject(pFields, pMapping);
68
69 m_constantJacobian = true;
70
72 "Mapping X = x + f(z) needs 3 velocity components.");
73}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
virtual GLOBAL_MAPPING_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
Definition: Mapping.cpp:95
bool m_constantJacobian
Flag defining if the Jacobian is constant.
Definition: Mapping.h:427

References ASSERTL0, Nektar::GlobalMapping::Mapping::m_constantJacobian, Nektar::GlobalMapping::Mapping::m_nConvectiveFields, and Nektar::GlobalMapping::Mapping::v_InitObject().

◆ v_LowerIndex()

void Nektar::GlobalMapping::MappingXofZ::v_LowerIndex ( const Array< OneD, Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::GlobalMapping::Mapping.

Definition at line 216 of file MappingXofZ.cpp.

219{
220 int physTot = m_fields[0]->GetTotPoints();
221 Array<OneD, NekDouble> wk(physTot, 0.0);
222
223 // out[0] = in[0] + in[2] * fz
224 Vmath::Vmul(physTot, m_GeometricInfo[0], 1, inarray[2], 1, outarray[0],
225 1); // in[2]*fz
226 Vmath::Vmul(physTot, m_GeometricInfo[0], 1, inarray[0], 1, outarray[2],
227 1); // in[0]*fz
228
229 Vmath::Vadd(physTot, outarray[0], 1, inarray[0], 1, outarray[0], 1);
230
231 // out[1] = in[1]
232 Vmath::Vcopy(physTot, inarray[1], 1, outarray[1], 1);
233
234 // out[2] = fz*in[0] + (1+fz^2)*in[2]
235 Vmath::Sadd(physTot, 1.0, m_GeometricInfo[2], 1, wk, 1); // 1+fz^2
236 Vmath::Vmul(physTot, wk, 1, inarray[2], 1, wk, 1); // (1+fz^2)*in[2]
237 Vmath::Vadd(physTot, wk, 1, outarray[2], 1, outarray[2], 1);
238}

References Nektar::GlobalMapping::Mapping::m_fields, Nektar::GlobalMapping::Mapping::m_GeometricInfo, Vmath::Sadd(), Vmath::Vadd(), Vmath::Vcopy(), and Vmath::Vmul().

◆ v_RaiseIndex()

void Nektar::GlobalMapping::MappingXofZ::v_RaiseIndex ( const Array< OneD, Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::GlobalMapping::Mapping.

Definition at line 240 of file MappingXofZ.cpp.

243{
244 int physTot = m_fields[0]->GetTotPoints();
245 Array<OneD, NekDouble> wk(physTot, 0.0);
246
247 // out[2] = in[2] - in[0] * fz
248 Vmath::Vmul(physTot, m_GeometricInfo[0], 1, inarray[2], 1, outarray[0],
249 1); // in[2]*fz
250 Vmath::Vmul(physTot, m_GeometricInfo[0], 1, inarray[0], 1, outarray[2],
251 1); // in[0]*fz
252 Vmath::Vsub(physTot, inarray[2], 1, outarray[2], 1, outarray[2], 1);
253
254 // out[1] = in[1]]
255 Vmath::Vcopy(physTot, inarray[1], 1, outarray[1], 1);
256
257 // out[0] = in[0]*(1+fz^2)- in[2] * fz
258 Vmath::Sadd(physTot, 1.0, m_GeometricInfo[2], 1, wk, 1); // 1+fz^2
259 Vmath::Vmul(physTot, wk, 1, inarray[0], 1, wk, 1); // in[0]*(1+fz^2)
260 Vmath::Vsub(physTot, wk, 1, outarray[0], 1, outarray[0], 1);
261}

References Nektar::GlobalMapping::Mapping::m_fields, Nektar::GlobalMapping::Mapping::m_GeometricInfo, Vmath::Sadd(), Vmath::Vcopy(), Vmath::Vmul(), and Vmath::Vsub().

◆ v_UpdateGeomInfo()

void Nektar::GlobalMapping::MappingXofZ::v_UpdateGeomInfo ( )
overrideprotectedvirtual

Implements Nektar::GlobalMapping::Mapping.

Definition at line 307 of file MappingXofZ.cpp.

308{
309 int phystot = m_fields[0]->GetTotPoints();
310 // Allocation of geometry memory
311 m_GeometricInfo = Array<OneD, Array<OneD, NekDouble>>(4);
312 for (int i = 0; i < m_GeometricInfo.size(); i++)
313 {
314 m_GeometricInfo[i] = Array<OneD, NekDouble>(phystot, 0.0);
315 }
316
317 bool waveSpace = m_fields[0]->GetWaveSpace();
318 m_fields[0]->SetWaveSpace(false);
319 // Calculate derivatives of transformation
321 m_GeometricInfo[0]);
323 m_GeometricInfo[1]);
324 // m_GeometricInfo[2] = fz^2
325 Vmath::Vmul(phystot, m_GeometricInfo[0], 1, m_GeometricInfo[0], 1,
326 m_GeometricInfo[2], 1);
327
328 m_fields[0]->SetWaveSpace(waveSpace);
329}
Array< OneD, Array< OneD, NekDouble > > m_coords
Array with the Cartesian coordinates.
Definition: Mapping.h:412
MultiRegions::Direction const DirCartesianMap[]
Definition: ExpList.h:87

References Nektar::MultiRegions::DirCartesianMap, Nektar::GlobalMapping::Mapping::m_coords, Nektar::GlobalMapping::Mapping::m_fields, Nektar::GlobalMapping::Mapping::m_GeometricInfo, and Vmath::Vmul().

Friends And Related Function Documentation

◆ MemoryManager< MappingXofZ >

friend class MemoryManager< MappingXofZ >
friend

Definition at line 1 of file MappingXofZ.h.

Member Data Documentation

◆ className

std::string Nektar::GlobalMapping::MappingXofZ::className
static
Initial value:
=
"X = x + f(z)")
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.
Definition: MappingXofZ.h:50
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
MappingFactory & GetMappingFactory()
Declaration of the mapping factory singleton.
Definition: Mapping.cpp:47

Name of the class.

Definition at line 62 of file MappingXofZ.h.