Nektar++
Mapping.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: Mapping.h
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Abstract base class for mappings.
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_GLOBALMAPPING_MAPPING
36#define NEKTAR_GLOBALMAPPING_MAPPING
37
38#include <string>
39
44
46{
47// Forward declaration
48class Mapping;
49
50/// A shared pointer to a Mapping object
51GLOBAL_MAPPING_EXPORT typedef std::shared_ptr<Mapping> MappingSharedPtr;
52
53/// Declaration of the mapping factory
56 const Array<OneD, MultiRegions::ExpListSharedPtr> &, const TiXmlElement *>
58
59/// Declaration of the mapping factory singleton
61
62/**
63 * @class Mapping
64 * @brief Base class for mapping to be applied to the coordinate system
65 */
67{
68public:
69 /// @brief Destructor
71 {
72 }
73
74 /// @brief Initialise the mapping object
77 const TiXmlElement *pMapping)
78 {
79 v_InitObject(pFields, pMapping);
80 }
81
82 /// @brief Replace the Expansion List used by the mapping
85
86 /// @brief Return a pointer to the mapping, creating it on first call
90
91 /// @brief Output function called when a chk or fld file is written
93 LibUtilities::FieldMetaDataMap &fieldMetaDataMap,
94 const std::string &outname);
95
96 /////////////////////////////////////////////////////////////
97 //
98 // Functions for transforming results to and from the
99 // Cartesian coordinate system
100 // (useful for pre and post processing)
101 /////////////////////////////////////////////////////////////
102
103 /// @brief Convert a contravariant vector to the Cartesian system
105 const Array<OneD, Array<OneD, NekDouble>> &inarray,
106 Array<OneD, Array<OneD, NekDouble>> &outarray);
107
108 /// @brief Convert a covariant vector to the Cartesian system
110 const Array<OneD, Array<OneD, NekDouble>> &inarray,
111 Array<OneD, Array<OneD, NekDouble>> &outarray);
112
113 /// @brief Convert a contravariant vector to the transformed system
115 const Array<OneD, Array<OneD, NekDouble>> &inarray,
116 Array<OneD, Array<OneD, NekDouble>> &outarray);
117
118 /// @brief Convert a covariant vector to the transformed system
120 const Array<OneD, Array<OneD, NekDouble>> &inarray,
121 Array<OneD, Array<OneD, NekDouble>> &outarray);
122
123 /**
124 * @brief Get the Cartesian coordinates in the field
125 *
126 * This function is used to obtain the Cartesian coordinates
127 * associated withthe Mapping
128 *
129 * @param out0 Coordinates in the x-direction
130 * @param out1 Coordinates in the y-direction
131 * @param out2 Coordinates in the z-direction
132 */
136 {
137 v_GetCartesianCoordinates(out0, out1, out2);
138 }
139
140 /////////////////////////////////////////////////////////////
141 //
142 // Basic tensor calculus functions
143 //
144 /////////////////////////////////////////////////////////////
145
146 /**
147 * @brief Get the Jacobian of the transformation
148 *
149 * This function is used to obtain the Jacobian of the Mapping.
150 *
151 * @param outarray Array containing the Jacobian
152 */
154 {
155 v_GetJacobian(outarray);
156 }
157
158 /**
159 * @brief Calculate the dot product with the gradient of the Jacobian
160 *
161 * This function calculates the dot product of an array against the
162 * gradient of the Jacobian of the Mapping.
163 *
164 * @param inarray Input array
165 * @param outarray Output array
166 */
168 const Array<OneD, Array<OneD, NekDouble>> &inarray,
169 Array<OneD, NekDouble> &outarray)
170 {
171 v_DotGradJacobian(inarray, outarray);
172 }
173
174 /// @brief Get the metric tensor \f$g_{ij}\f$
177 {
178 v_GetMetricTensor(outarray);
179 }
180
181 /// @brief Get the inverse of metric tensor \f$g^{ij}\f$
184 {
185 v_GetInvMetricTensor(outarray);
186 }
187
188 /// @brief Lower index of vector: \f$v_{i} = g_{ij}*v^{j}\f$
190 const Array<OneD, Array<OneD, NekDouble>> &inarray,
191 Array<OneD, Array<OneD, NekDouble>> &outarray);
192
193 /// @brief Raise index of vector: \f$v^{i} = g^{ij}*v_{j}\f$
195 const Array<OneD, Array<OneD, NekDouble>> &inarray,
196 Array<OneD, Array<OneD, NekDouble>> &outarray);
197
198 /**
199 * @brief Apply the Christoffel symbols to a contravariant vector
200 *
201 * This function is used apply the Christoffel symbols
202 * \f$ \left( i,pk\right)\f$ to
203 * a contravariant vector \f$u^p\f$, following the relation
204 * \f[ (out)^{i}_{k} = \left( i,pk\right)u^p \f]
205 *
206 * @param inarray Contravariant vector \f$u^p\f$
207 * @param outarray Result of applying Christoffel symbols to \f$u^p\f$
208 */
210 const Array<OneD, Array<OneD, NekDouble>> &inarray,
212 {
213 v_ApplyChristoffelContravar(inarray, outarray);
214 }
215
216 /**
217 * @brief Apply the Christoffel symbols to a covariant vector
218 *
219 * This function is used apply the Christoffel symbols
220 * \f$ \left( p,ik\right)\f$ to
221 * a covariant vector \f$u_p\f$, following the relation
222 * \f[ (out)_{ik} = \left( p,ik\right)u_p \f]
223 *
224 * @param inarray Contravariant vector \f$u_p\f$
225 * @param outarray Result of applying Christoffel symbols to \f$u_p\f$
226 */
228 const Array<OneD, Array<OneD, NekDouble>> &inarray,
230 {
231 v_ApplyChristoffelCovar(inarray, outarray);
232 }
233
234 /**
235 * @brief Obtain the velocity of the coordinates
236 *
237 * This function is used to obtain the velocity of the coordinates
238 * associated with the Mapping
239 *
240 * @param outarray Velocity of the coordinates
241 */
244 {
245 v_GetCoordVelocity(outarray);
246 }
247
248 /////////////////////////////////////////////////////////////
249 //
250 // Differential operators
251 //
252 /////////////////////////////////////////////////////////////
253
254 /**
255 * @brief Calculate the generalised divergence operator
256 *
257 * This function is used to calculate the generalised divergence
258 * of a contravariant vector, defined as
259 * \f[ D = u^i_{,i} = \frac{1}{J}\frac{\partial(Ju^i)}{\partial x^i}\f]
260 *
261 * @param inarray Contravariant vector \f$u^i\f$
262 * @param outarray Divergence of \f$u^i\f$
263 */
265 const Array<OneD, Array<OneD, NekDouble>> &inarray,
266 Array<OneD, NekDouble> &outarray)
267 {
268 v_Divergence(inarray, outarray);
269 }
270
271 /**
272 * @brief Generalised (correction to the) velocity Laplacian operator
273 *
274 * This function is used to calculate a correction defined as
275 * the difference between the generalised Laplacian and the
276 * original Laplacian multiplied by a constant \f$\alpha\f$,
277 * resulting in
278 * \f[ L^i = g^{jk}u^{i}_{,jk} - \alpha \frac{\partial^2 x^i}
279 * {\partial x^j \partial x^j}\f]
280 * By default, \f$\alpha\f$ is zero, resulting in the generalised
281 * Laplacian.
282 *
283 * @param inarray Contravariant vector \f$u^i\f$
284 * @param outarray Result of the operation
285 * @param alpha The constant \f$\alpha\f$
286 */
288 const Array<OneD, Array<OneD, NekDouble>> &inarray,
290 const NekDouble alpha = 0.0)
291 {
292 v_VelocityLaplacian(inarray, outarray, alpha);
293 }
294
295 /**
296 * @brief Second order covariant derivatives of a contravariant vector
297 *
298 * This function computes the second order covariant derivatives
299 * of a contravariant vector, resulting in \f$u^{i}_{,jk}\f$
300 *
301 * @param inarray Contravariant vector \f$u^i\f$
302 * @param outarray Second order derivatives \f$u^{i}_{,jk}\f$
303 */
305 const Array<OneD, Array<OneD, NekDouble>> &inarray,
307 {
308 v_gradgradU(inarray, outarray);
309 }
310
311 /**
312 * @brief CurlCurl calculated on the whole field
313 *
314 * This function can be used to compute both the generalised CurlCurl
315 * or the typical (Cartesian) CurlCurl, depending on the flag
316 * generalized
317 *
318 * @param inarray Contravariant vector \f$u^i\f$
319 * @param outarray CurlCurl of \f$u\f$
320 * @param generalized Flag defining if generalised or typical CurlCurl
321 */
324 Array<OneD, Array<OneD, NekDouble>> &outarray, const bool generalized)
325 {
326 v_CurlCurlField(inarray, outarray, generalized);
327 }
328
329 /////////////////////////////////////////////////////////////
330 //
331 // Functions defining mapping properties
332 //
333 /////////////////////////////////////////////////////////////
334
335 /// @brief Get flag defining if mapping is time-dependent
337 {
338 return m_timeDependent;
339 }
340
341 /// @brief Set flag defining if mapping is time-dependent
343 {
344 m_timeDependent = value;
345 }
346
347 /// @brief Get flag defining if mapping is defined by a function
349 {
350 return m_fromFunction;
351 }
352
353 /// @brief Set flag defining if mapping is defined by a function
355 {
356 m_fromFunction = value;
357 }
358
359 /// @brief Get flag defining if mapping has constant Jacobian
361 {
362 return m_constantJacobian;
363 }
364
365 /// @brief Get flag determining if the mapping was defined or is trivial
367 {
368 return m_isDefined;
369 }
370
371 //
372 // Function to update time-dependent mappings
373 //
374
375 /// @brief Update the Dirichlet Boundary Conditions when using Mappings
377 {
378 v_UpdateBCs(time);
379 }
380
381 /// @brief Update the Mapping with new coordinates
383 const NekDouble time,
384 const Array<OneD, Array<OneD, NekDouble>> &coords =
386 const Array<OneD, Array<OneD, NekDouble>> &coordsVel =
388 {
389 v_UpdateMapping(time, coords, coordsVel);
390 }
391
392 /// @brief Recompute the metric terms of the Mapping
394 {
396 }
397
398protected:
399 /// Session reader
401 // FieldIO object used to output mapping
403 // Fields
405 /// Array with the Cartesian coordinates
407 /// Array with the velocity of the coordinates
409 /// Array with metric terms of the mapping
411 /// Number of velocity components
413
414 /// Name of the function containing the coordinates
415 std::string m_funcName;
416 /// Name of the function containing the velocity of the coordinates
417 std::string m_velFuncName;
418
419 // Flags to help the solver
420 /// Flag defining if the Jacobian is constant
422 /// Flag defining if the Mapping is time-dependent
424 /// Flag defining if the Mapping is defined by a function
426
427 // Static variables to load mapping
429 static bool m_init;
430 static bool m_isDefined;
431
432 // Workspace variables
436
437 /// @brief Constructor
441
442 // Evaluators
445 LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName,
446 Array<OneD, NekDouble> &pArray, const std::string &pFunctionName,
447 NekDouble pTime = NekDouble(0));
448
450 LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName,
451 Array<OneD, NekDouble> &pArray, const std::string &pFunctionName,
452 NekDouble pTime = NekDouble(0));
453
454 // Virtual functions
457 const TiXmlElement *pMapping);
458
460 const Array<OneD, Array<OneD, NekDouble>> &inarray,
461 Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
462
464 const Array<OneD, Array<OneD, NekDouble>> &inarray,
465 Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
466
468 const Array<OneD, Array<OneD, NekDouble>> &inarray,
469 Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
470
472 const Array<OneD, Array<OneD, NekDouble>> &inarray,
473 Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
474
478
480 Array<OneD, Array<OneD, NekDouble>> &outarray);
481
483 Array<OneD, NekDouble> &outarray) = 0;
484
486 const Array<OneD, Array<OneD, NekDouble>> &inarray,
487 Array<OneD, NekDouble> &outarray);
488
490 Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
491
493 Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
494
496 const Array<OneD, Array<OneD, NekDouble>> &inarray,
497 Array<OneD, Array<OneD, NekDouble>> &outarray);
498
500 const Array<OneD, Array<OneD, NekDouble>> &inarray,
501 Array<OneD, Array<OneD, NekDouble>> &outarray);
502
504 const Array<OneD, Array<OneD, NekDouble>> &inarray,
505 Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
506
508 const Array<OneD, Array<OneD, NekDouble>> &inarray,
509 Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
510
512 const Array<OneD, Array<OneD, NekDouble>> &inarray,
513 Array<OneD, NekDouble> &outarray);
514
516 const Array<OneD, Array<OneD, NekDouble>> &inarray,
517 Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble alpha);
518
520 const Array<OneD, Array<OneD, NekDouble>> &inarray,
521 Array<OneD, Array<OneD, NekDouble>> &outarray);
522
525 Array<OneD, Array<OneD, NekDouble>> &outarray, const bool generalized);
526
528 const NekDouble time,
529 const Array<OneD, Array<OneD, NekDouble>> &coords =
531 const Array<OneD, Array<OneD, NekDouble>> &coordsVel =
533
535
536 GLOBAL_MAPPING_EXPORT virtual void v_UpdateBCs(const NekDouble time);
537};
538
539} // namespace Nektar::GlobalMapping
540
541#endif
#define GLOBAL_MAPPING_EXPORT
Base class for mapping to be applied to the coordinate system.
Definition: Mapping.h:67
bool m_fromFunction
Flag defining if the Mapping is defined by a function.
Definition: Mapping.h:425
int m_nConvectiveFields
Number of velocity components.
Definition: Mapping.h:412
GLOBAL_MAPPING_EXPORT void SetFromFunction(const bool value)
Set flag defining if mapping is defined by a function.
Definition: Mapping.h:354
static MappingSharedPtr m_mappingPtr
Definition: Mapping.h:428
virtual GLOBAL_MAPPING_EXPORT void v_GetCartesianCoordinates(Array< OneD, NekDouble > &out0, Array< OneD, NekDouble > &out1, Array< OneD, NekDouble > &out2)
Definition: Mapping.cpp:653
GLOBAL_MAPPING_EXPORT void LowerIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Lower index of vector: .
Definition: Mapping.cpp:603
GLOBAL_MAPPING_EXPORT void EvaluateTimeFunction(LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName, Array< OneD, NekDouble > &pArray, const std::string &pFunctionName, NekDouble pTime=NekDouble(0))
Definition: Mapping.cpp:382
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
Definition: Mapping.h:400
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.
Definition: Mapping.cpp:479
virtual GLOBAL_MAPPING_EXPORT ~Mapping()
Destructor.
Definition: Mapping.h:70
GLOBAL_MAPPING_EXPORT void GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
Get the inverse of metric tensor .
Definition: Mapping.h:182
virtual GLOBAL_MAPPING_EXPORT void v_UpdateBCs(const NekDouble time)
Definition: Mapping.cpp:1049
GLOBAL_MAPPING_EXPORT void GetCartesianCoordinates(Array< OneD, NekDouble > &out0, Array< OneD, NekDouble > &out1, Array< OneD, NekDouble > &out2)
Get the Cartesian coordinates in the field.
Definition: Mapping.h:133
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.
Definition: Mapping.h:304
GLOBAL_MAPPING_EXPORT bool IsTimeDependent()
Get flag defining if mapping is time-dependent.
Definition: Mapping.h:336
Array< OneD, Array< OneD, NekDouble > > m_GeometricInfo
Array with metric terms of the mapping.
Definition: Mapping.h:410
Array< OneD, Array< OneD, NekDouble > > m_wk2
Definition: Mapping.h:434
virtual GLOBAL_MAPPING_EXPORT void v_CurlCurlField(Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const bool generalized)
Definition: Mapping.cpp:987
GLOBAL_MAPPING_EXPORT void UpdateGeomInfo()
Recompute the metric terms of the Mapping.
Definition: Mapping.h:393
Array< OneD, Array< OneD, NekDouble > > m_coords
Array with the Cartesian coordinates.
Definition: Mapping.h:406
Array< OneD, Array< OneD, NekDouble > > m_coordsVel
Array with the velocity of the coordinates.
Definition: Mapping.h:408
virtual GLOBAL_MAPPING_EXPORT void v_RaiseIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: Mapping.cpp:729
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Definition: Mapping.h:404
std::string m_velFuncName
Name of the function containing the velocity of the coordinates.
Definition: Mapping.h:417
GLOBAL_MAPPING_EXPORT void InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
Initialise the mapping object.
Definition: Mapping.h:75
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.
Definition: Mapping.h:167
GLOBAL_MAPPING_EXPORT bool IsFromFunction()
Get flag defining if mapping is defined by a function.
Definition: Mapping.h:348
virtual GLOBAL_MAPPING_EXPORT void v_LowerIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: Mapping.cpp:708
GLOBAL_MAPPING_EXPORT void Output(LibUtilities::FieldMetaDataMap &fieldMetaDataMap, const std::string &outname)
Output function called when a chk or fld file is written.
Definition: Mapping.cpp:304
GLOBAL_MAPPING_EXPORT void GetMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
Get the metric tensor .
Definition: Mapping.h:175
GLOBAL_MAPPING_EXPORT bool IsDefined()
Get flag determining if the mapping was defined or is trivial.
Definition: Mapping.h:366
Array< OneD, Array< OneD, NekDouble > > m_wk1
Definition: Mapping.h:433
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.
Definition: Mapping.cpp:541
virtual GLOBAL_MAPPING_EXPORT void v_GetCoordVelocity(Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: Mapping.cpp:668
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))
Definition: Mapping.cpp:400
virtual GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)=0
virtual GLOBAL_MAPPING_EXPORT void v_GetJacobian(Array< OneD, NekDouble > &outarray)=0
virtual GLOBAL_MAPPING_EXPORT void v_gradgradU(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: Mapping.cpp:879
virtual GLOBAL_MAPPING_EXPORT void v_ContravarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
LibUtilities::FieldIOSharedPtr m_fld
Definition: Mapping.h:402
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.
Definition: Mapping.h:322
virtual GLOBAL_MAPPING_EXPORT void v_Divergence(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
Definition: Mapping.cpp:750
virtual GLOBAL_MAPPING_EXPORT void v_CovarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
GLOBAL_MAPPING_EXPORT void UpdateBCs(const NekDouble time)
Update the Dirichlet Boundary Conditions when using Mappings.
Definition: Mapping.h:376
GLOBAL_MAPPING_EXPORT bool HasConstantJacobian()
Get flag defining if mapping has constant Jacobian.
Definition: Mapping.h:360
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.
Definition: Mapping.cpp:510
GLOBAL_MAPPING_EXPORT void ReplaceField(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Replace the Expansion List used by the mapping.
Definition: Mapping.cpp:241
virtual GLOBAL_MAPPING_EXPORT void v_CovarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
GLOBAL_MAPPING_EXPORT void RaiseIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Raise index of vector: .
Definition: Mapping.cpp:633
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.
Definition: Mapping.h:209
virtual GLOBAL_MAPPING_EXPORT void v_DotGradJacobian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
Definition: Mapping.cpp:679
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.
Definition: Mapping.h:382
virtual GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelContravar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
GLOBAL_MAPPING_EXPORT void SetTimeDependent(const bool value)
Set flag defining if mapping is time-dependent.
Definition: Mapping.h:342
GLOBAL_MAPPING_EXPORT void GetCoordVelocity(Array< OneD, Array< OneD, NekDouble > > &outarray)
Obtain the velocity of the coordinates.
Definition: Mapping.h:242
std::string m_funcName
Name of the function containing the coordinates.
Definition: Mapping.h:415
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.
Definition: Mapping.cpp:266
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.
Definition: Mapping.cpp:572
GLOBAL_MAPPING_EXPORT void GetJacobian(Array< OneD, NekDouble > &outarray)
Get the Jacobian of the transformation.
Definition: Mapping.h:153
GLOBAL_MAPPING_EXPORT Mapping(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Constructor.
Definition: Mapping.cpp:55
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.
Definition: Mapping.h:287
virtual GLOBAL_MAPPING_EXPORT void v_VelocityLaplacian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble alpha)
Definition: Mapping.cpp:778
virtual GLOBAL_MAPPING_EXPORT void v_GetMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)=0
virtual GLOBAL_MAPPING_EXPORT void v_UpdateGeomInfo()=0
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_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
Definition: Mapping.cpp:97
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.
Definition: Mapping.h:227
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)
Definition: Mapping.cpp:1207
virtual GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelCovar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
Array< OneD, Array< OneD, NekDouble > > m_tmp
Definition: Mapping.h:435
bool m_constantJacobian
Flag defining if the Jacobian is constant.
Definition: Mapping.h:421
bool m_timeDependent
Flag defining if the Mapping is time-dependent.
Definition: Mapping.h:423
GLOBAL_MAPPING_EXPORT void Divergence(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
Calculate the generalised divergence operator.
Definition: Mapping.h:264
Provides a generic Factory class.
GLOBAL_MAPPING_EXPORT typedef std::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:51
LibUtilities::NekFactory< std::string, Mapping, const LibUtilities::SessionReaderSharedPtr &, const Array< OneD, MultiRegions::ExpListSharedPtr > &, const TiXmlElement * > MappingFactory
Declaration of the mapping factory.
Definition: Mapping.h:57
MappingFactory & GetMappingFactory()
Declaration of the mapping factory singleton.
Definition: Mapping.cpp:49
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:322
std::map< std::string, std::string > FieldMetaDataMap
Definition: FieldIO.h:50
std::shared_ptr< SessionReader > SessionReaderSharedPtr
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayOfArray
double NekDouble