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 
43 #include <MultiRegions/ExpList.h>
44 
45 namespace Nektar
46 {
47 namespace GlobalMapping
48 {
49 // Forward declaration
50 class Mapping;
51 
52 /// A shared pointer to a Mapping object
53 GLOBAL_MAPPING_EXPORT typedef std::shared_ptr<Mapping> MappingSharedPtr;
54 
55 /// Declaration of the mapping factory
57  std::string, Mapping, const LibUtilities::SessionReaderSharedPtr &,
58  const Array<OneD, MultiRegions::ExpListSharedPtr> &, const TiXmlElement *>
60 
61 /// Declaration of the mapping factory singleton
63 
64 /**
65  * @class Mapping
66  * @brief Base class for mapping to be applied to the coordinate system
67  */
68 class Mapping
69 {
70 public:
71  /// @brief Destructor
73  {
74  }
75 
76  /// @brief Initialise the mapping object
79  const TiXmlElement *pMapping)
80  {
81  v_InitObject(pFields, pMapping);
82  }
83 
84  /// @brief Replace the Expansion List used by the mapping
87 
88  /// @brief Return a pointer to the mapping, creating it on first call
92 
93  /// @brief Output function called when a chk or fld file is written
95  LibUtilities::FieldMetaDataMap &fieldMetaDataMap,
96  const std::string &outname);
97 
98  /////////////////////////////////////////////////////////////
99  //
100  // Functions for transforming results to and from the
101  // Cartesian coordinate system
102  // (useful for pre and post processing)
103  /////////////////////////////////////////////////////////////
104 
105  /// @brief Convert a contravariant vector to the Cartesian system
107  const Array<OneD, Array<OneD, NekDouble>> &inarray,
108  Array<OneD, Array<OneD, NekDouble>> &outarray);
109 
110  /// @brief Convert a covariant vector to the Cartesian system
112  const Array<OneD, Array<OneD, NekDouble>> &inarray,
113  Array<OneD, Array<OneD, NekDouble>> &outarray);
114 
115  /// @brief Convert a contravariant vector to the transformed system
117  const Array<OneD, Array<OneD, NekDouble>> &inarray,
118  Array<OneD, Array<OneD, NekDouble>> &outarray);
119 
120  /// @brief Convert a covariant vector to the transformed system
122  const Array<OneD, Array<OneD, NekDouble>> &inarray,
123  Array<OneD, Array<OneD, NekDouble>> &outarray);
124 
125  /**
126  * @brief Get the Cartesian coordinates in the field
127  *
128  * This function is used to obtain the Cartesian coordinates
129  * associated withthe Mapping
130  *
131  * @param out0 Coordinates in the x-direction
132  * @param out1 Coordinates in the y-direction
133  * @param out2 Coordinates in the z-direction
134  */
138  {
139  v_GetCartesianCoordinates(out0, out1, out2);
140  }
141 
142  /////////////////////////////////////////////////////////////
143  //
144  // Basic tensor calculus functions
145  //
146  /////////////////////////////////////////////////////////////
147 
148  /**
149  * @brief Get the Jacobian of the transformation
150  *
151  * This function is used to obtain the Jacobian of the Mapping.
152  *
153  * @param outarray Array containing the Jacobian
154  */
156  {
157  v_GetJacobian(outarray);
158  }
159 
160  /**
161  * @brief Calculate the dot product with the gradient of the Jacobian
162  *
163  * This function calculates the dot product of an array against the
164  * gradient of the Jacobian of the Mapping.
165  *
166  * @param inarray Input array
167  * @param outarray Output array
168  */
170  const Array<OneD, Array<OneD, NekDouble>> &inarray,
171  Array<OneD, NekDouble> &outarray)
172  {
173  v_DotGradJacobian(inarray, outarray);
174  }
175 
176  /// @brief Get the metric tensor \f$g_{ij}\f$
178  Array<OneD, Array<OneD, NekDouble>> &outarray)
179  {
180  v_GetMetricTensor(outarray);
181  }
182 
183  /// @brief Get the inverse of metric tensor \f$g^{ij}\f$
185  Array<OneD, Array<OneD, NekDouble>> &outarray)
186  {
187  v_GetInvMetricTensor(outarray);
188  }
189 
190  /// @brief Lower index of vector: \f$v_{i} = g_{ij}*v^{j}\f$
192  const Array<OneD, Array<OneD, NekDouble>> &inarray,
193  Array<OneD, Array<OneD, NekDouble>> &outarray);
194 
195  /// @brief Raise index of vector: \f$v^{i} = g^{ij}*v_{j}\f$
197  const Array<OneD, Array<OneD, NekDouble>> &inarray,
198  Array<OneD, Array<OneD, NekDouble>> &outarray);
199 
200  /**
201  * @brief Apply the Christoffel symbols to a contravariant vector
202  *
203  * This function is used apply the Christoffel symbols
204  * \f$ \left( i,pk\right)\f$ to
205  * a contravariant vector \f$u^p\f$, following the relation
206  * \f[ (out)^{i}_{k} = \left( i,pk\right)u^p \f]
207  *
208  * @param inarray Contravariant vector \f$u^p\f$
209  * @param outarray Result of applying Christoffel symbols to \f$u^p\f$
210  */
212  const Array<OneD, Array<OneD, NekDouble>> &inarray,
213  Array<OneD, Array<OneD, NekDouble>> &outarray)
214  {
215  v_ApplyChristoffelContravar(inarray, outarray);
216  }
217 
218  /**
219  * @brief Apply the Christoffel symbols to a covariant vector
220  *
221  * This function is used apply the Christoffel symbols
222  * \f$ \left( p,ik\right)\f$ to
223  * a covariant vector \f$u_p\f$, following the relation
224  * \f[ (out)_{ik} = \left( p,ik\right)u_p \f]
225  *
226  * @param inarray Contravariant vector \f$u_p\f$
227  * @param outarray Result of applying Christoffel symbols to \f$u_p\f$
228  */
230  const Array<OneD, Array<OneD, NekDouble>> &inarray,
231  Array<OneD, Array<OneD, NekDouble>> &outarray)
232  {
233  v_ApplyChristoffelCovar(inarray, outarray);
234  }
235 
236  /**
237  * @brief Obtain the velocity of the coordinates
238  *
239  * This function is used to obtain the velocity of the coordinates
240  * associated with the Mapping
241  *
242  * @param outarray Velocity of the coordinates
243  */
245  Array<OneD, Array<OneD, NekDouble>> &outarray)
246  {
247  v_GetCoordVelocity(outarray);
248  }
249 
250  /////////////////////////////////////////////////////////////
251  //
252  // Differential operators
253  //
254  /////////////////////////////////////////////////////////////
255 
256  /**
257  * @brief Calculate the generalised divergence operator
258  *
259  * This function is used to calculate the generalised divergence
260  * of a contravariant vector, defined as
261  * \f[ D = u^i_{,i} = \frac{1}{J}\frac{\partial(Ju^i)}{\partial x^i}\f]
262  *
263  * @param inarray Contravariant vector \f$u^i\f$
264  * @param outarray Divergence of \f$u^i\f$
265  */
267  const Array<OneD, Array<OneD, NekDouble>> &inarray,
268  Array<OneD, NekDouble> &outarray)
269  {
270  v_Divergence(inarray, outarray);
271  }
272 
273  /**
274  * @brief Generalised (correction to the) velocity Laplacian operator
275  *
276  * This function is used to calculate a correction defined as
277  * the difference between the generalised Laplacian and the
278  * original Laplacian multiplied by a constant \f$\alpha\f$,
279  * resulting in
280  * \f[ L^i = g^{jk}u^{i}_{,jk} - \alpha \frac{\partial^2 x^i}
281  * {\partial x^j \partial x^j}\f]
282  * By default, \f$\alpha\f$ is zero, resulting in the generalised
283  * Laplacian.
284  *
285  * @param inarray Contravariant vector \f$u^i\f$
286  * @param outarray Result of the operation
287  * @param alpha The constant \f$\alpha\f$
288  */
290  const Array<OneD, Array<OneD, NekDouble>> &inarray,
291  Array<OneD, Array<OneD, NekDouble>> &outarray,
292  const NekDouble alpha = 0.0)
293  {
294  v_VelocityLaplacian(inarray, outarray, alpha);
295  }
296 
297  /**
298  * @brief Second order covariant derivatives of a contravariant vector
299  *
300  * This function computes the second order covariant derivatives
301  * of a contravariant vector, resulting in \f$u^{i}_{,jk}\f$
302  *
303  * @param inarray Contravariant vector \f$u^i\f$
304  * @param outarray Second order derivatives \f$u^{i}_{,jk}\f$
305  */
307  const Array<OneD, Array<OneD, NekDouble>> &inarray,
308  Array<OneD, Array<OneD, NekDouble>> &outarray)
309  {
310  v_gradgradU(inarray, outarray);
311  }
312 
313  /**
314  * @brief CurlCurl calculated on the whole field
315  *
316  * This function can be used to compute both the generalised CurlCurl
317  * or the typical (Cartesian) CurlCurl, depending on the flag
318  * generalized
319  *
320  * @param inarray Contravariant vector \f$u^i\f$
321  * @param outarray CurlCurl of \f$u\f$
322  * @param generalized Flag defining if generalised or typical CurlCurl
323  */
325  Array<OneD, Array<OneD, NekDouble>> &inarray,
326  Array<OneD, Array<OneD, NekDouble>> &outarray, const bool generalized)
327  {
328  v_CurlCurlField(inarray, outarray, generalized);
329  }
330 
331  /////////////////////////////////////////////////////////////
332  //
333  // Functions defining mapping properties
334  //
335  /////////////////////////////////////////////////////////////
336 
337  /// @brief Get flag defining if mapping is time-dependent
339  {
340  return m_timeDependent;
341  }
342 
343  /// @brief Set flag defining if mapping is time-dependent
345  {
346  m_timeDependent = value;
347  }
348 
349  /// @brief Get flag defining if mapping is defined by a function
351  {
352  return m_fromFunction;
353  }
354 
355  /// @brief Set flag defining if mapping is defined by a function
356  GLOBAL_MAPPING_EXPORT void SetFromFunction(const bool value)
357  {
358  m_fromFunction = value;
359  }
360 
361  /// @brief Get flag defining if mapping has constant Jacobian
363  {
364  return m_constantJacobian;
365  }
366 
367  /// @brief Get flag determining if the mapping was defined or is trivial
369  {
370  return m_isDefined;
371  }
372 
373  //
374  // Function to update time-dependent mappings
375  //
376 
377  /// @brief Update the Dirichlet Boundary Conditions when using Mappings
379  {
380  v_UpdateBCs(time);
381  }
382 
383  /// @brief Update the Mapping with new coordinates
385  const NekDouble time,
386  const Array<OneD, Array<OneD, NekDouble>> &coords =
388  const Array<OneD, Array<OneD, NekDouble>> &coordsVel =
390  {
391  v_UpdateMapping(time, coords, coordsVel);
392  }
393 
394  /// @brief Recompute the metric terms of the Mapping
396  {
398  }
399 
400 protected:
401  /// Session reader
403  // FieldIO object used to output mapping
405  // Fields
407  /// Array with the Cartesian coordinates
409  /// Array with the velocity of the coordinates
411  /// Array with metric terms of the mapping
413  /// Number of velocity components
415 
416  /// Name of the function containing the coordinates
417  std::string m_funcName;
418  /// Name of the function containing the velocity of the coordinates
419  std::string m_velFuncName;
420 
421  // Flags to help the solver
422  /// Flag defining if the Jacobian is constant
424  /// Flag defining if the Mapping is time-dependent
426  /// Flag defining if the Mapping is defined by a function
428 
429  // Static variables to load mapping
431  static bool m_init;
432  static bool m_isDefined;
433 
434  // Workspace variables
438 
439  /// @brief Constructor
441  const LibUtilities::SessionReaderSharedPtr &pSession,
443 
444  // Evaluators
447  LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName,
448  Array<OneD, NekDouble> &pArray, const std::string &pFunctionName,
449  NekDouble pTime = NekDouble(0));
450 
452  LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName,
453  Array<OneD, NekDouble> &pArray, const std::string &pFunctionName,
454  NekDouble pTime = NekDouble(0));
455 
456  // Virtual functions
457  GLOBAL_MAPPING_EXPORT virtual void v_InitObject(
459  const TiXmlElement *pMapping);
460 
462  const Array<OneD, Array<OneD, NekDouble>> &inarray,
463  Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
464 
466  const Array<OneD, Array<OneD, NekDouble>> &inarray,
467  Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
468 
470  const Array<OneD, Array<OneD, NekDouble>> &inarray,
471  Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
472 
474  const Array<OneD, Array<OneD, NekDouble>> &inarray,
475  Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
476 
479  Array<OneD, NekDouble> &out2);
480 
482  Array<OneD, Array<OneD, NekDouble>> &outarray);
483 
485  Array<OneD, NekDouble> &outarray) = 0;
486 
488  const Array<OneD, Array<OneD, NekDouble>> &inarray,
489  Array<OneD, NekDouble> &outarray);
490 
492  Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
493 
495  Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
496 
497  GLOBAL_MAPPING_EXPORT virtual void v_LowerIndex(
498  const Array<OneD, Array<OneD, NekDouble>> &inarray,
499  Array<OneD, Array<OneD, NekDouble>> &outarray);
500 
501  GLOBAL_MAPPING_EXPORT virtual void v_RaiseIndex(
502  const Array<OneD, Array<OneD, NekDouble>> &inarray,
503  Array<OneD, Array<OneD, NekDouble>> &outarray);
504 
506  const Array<OneD, Array<OneD, NekDouble>> &inarray,
507  Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
508 
510  const Array<OneD, Array<OneD, NekDouble>> &inarray,
511  Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
512 
513  GLOBAL_MAPPING_EXPORT virtual void v_Divergence(
514  const Array<OneD, Array<OneD, NekDouble>> &inarray,
515  Array<OneD, NekDouble> &outarray);
516 
518  const Array<OneD, Array<OneD, NekDouble>> &inarray,
519  Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble alpha);
520 
521  GLOBAL_MAPPING_EXPORT virtual void v_gradgradU(
522  const Array<OneD, Array<OneD, NekDouble>> &inarray,
523  Array<OneD, Array<OneD, NekDouble>> &outarray);
524 
526  Array<OneD, Array<OneD, NekDouble>> &inarray,
527  Array<OneD, Array<OneD, NekDouble>> &outarray, const bool generalized);
528 
530  const NekDouble time,
531  const Array<OneD, Array<OneD, NekDouble>> &coords =
533  const Array<OneD, Array<OneD, NekDouble>> &coordsVel =
535 
537 
538  GLOBAL_MAPPING_EXPORT virtual void v_UpdateBCs(const NekDouble time);
539 };
540 
541 } // namespace GlobalMapping
542 } // namespace Nektar
543 
544 #endif
#define GLOBAL_MAPPING_EXPORT
Base class for mapping to be applied to the coordinate system.
Definition: Mapping.h:69
bool m_fromFunction
Flag defining if the Mapping is defined by a function.
Definition: Mapping.h:427
int m_nConvectiveFields
Number of velocity components.
Definition: Mapping.h:414
GLOBAL_MAPPING_EXPORT void SetFromFunction(const bool value)
Set flag defining if mapping is defined by a function.
Definition: Mapping.h:356
static MappingSharedPtr m_mappingPtr
Definition: Mapping.h:430
virtual GLOBAL_MAPPING_EXPORT void v_GetCartesianCoordinates(Array< OneD, NekDouble > &out0, Array< OneD, NekDouble > &out1, Array< OneD, NekDouble > &out2)
Definition: Mapping.cpp:655
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:384
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
Definition: Mapping.h:402
virtual GLOBAL_MAPPING_EXPORT ~Mapping()
Destructor.
Definition: Mapping.h:72
virtual GLOBAL_MAPPING_EXPORT void v_UpdateBCs(const NekDouble time)
Definition: Mapping.cpp:1051
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:229
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:135
GLOBAL_MAPPING_EXPORT bool IsTimeDependent()
Get flag defining if mapping is time-dependent.
Definition: Mapping.h:338
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:780
Array< OneD, Array< OneD, NekDouble > > m_GeometricInfo
Array with metric terms of the mapping.
Definition: Mapping.h:412
Array< OneD, Array< OneD, NekDouble > > m_wk2
Definition: Mapping.h:436
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:481
GLOBAL_MAPPING_EXPORT void UpdateGeomInfo()
Recompute the metric terms of the Mapping.
Definition: Mapping.h:395
Array< OneD, Array< OneD, NekDouble > > m_coords
Array with the Cartesian coordinates.
Definition: Mapping.h:408
Array< OneD, Array< OneD, NekDouble > > m_coordsVel
Array with the velocity of the coordinates.
Definition: Mapping.h:410
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Definition: Mapping.h:406
std::string m_velFuncName
Name of the function containing the velocity of the coordinates.
Definition: Mapping.h:419
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:289
GLOBAL_MAPPING_EXPORT void InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
Initialise the mapping object.
Definition: Mapping.h:77
GLOBAL_MAPPING_EXPORT bool IsFromFunction()
Get flag defining if mapping is defined by a function.
Definition: Mapping.h:350
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 Output(LibUtilities::FieldMetaDataMap &fieldMetaDataMap, const std::string &outname)
Output function called when a chk or fld file is written.
Definition: Mapping.cpp:306
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:543
GLOBAL_MAPPING_EXPORT bool IsDefined()
Get flag determining if the mapping was defined or is trivial.
Definition: Mapping.h:368
GLOBAL_MAPPING_EXPORT void GetCoordVelocity(Array< OneD, Array< OneD, NekDouble >> &outarray)
Obtain the velocity of the coordinates.
Definition: Mapping.h:244
virtual GLOBAL_MAPPING_EXPORT void v_LowerIndex(const Array< OneD, Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: Mapping.cpp:710
Array< OneD, Array< OneD, NekDouble > > m_wk1
Definition: Mapping.h:435
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:402
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:989
virtual GLOBAL_MAPPING_EXPORT void v_GetJacobian(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_GetMetricTensor(Array< OneD, Array< OneD, NekDouble >> &outarray)=0
LibUtilities::FieldIOSharedPtr m_fld
Definition: Mapping.h:404
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:384
GLOBAL_MAPPING_EXPORT void GetMetricTensor(Array< OneD, Array< OneD, NekDouble >> &outarray)
Get the metric tensor .
Definition: Mapping.h:177
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:574
GLOBAL_MAPPING_EXPORT void Divergence(const Array< OneD, Array< OneD, NekDouble >> &inarray, Array< OneD, NekDouble > &outarray)
Calculate the generalised divergence operator.
Definition: Mapping.h:266
GLOBAL_MAPPING_EXPORT void UpdateBCs(const NekDouble time)
Update the Dirichlet Boundary Conditions when using Mappings.
Definition: Mapping.h:378
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:324
virtual GLOBAL_MAPPING_EXPORT void v_gradgradU(const Array< OneD, Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: Mapping.cpp:881
GLOBAL_MAPPING_EXPORT bool HasConstantJacobian()
Get flag defining if mapping has constant Jacobian.
Definition: Mapping.h:362
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:306
GLOBAL_MAPPING_EXPORT void ReplaceField(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Replace the Expansion List used by the mapping.
Definition: Mapping.cpp:247
GLOBAL_MAPPING_EXPORT void GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble >> &outarray)
Get the inverse of metric tensor .
Definition: Mapping.h:184
virtual GLOBAL_MAPPING_EXPORT void v_DotGradJacobian(const Array< OneD, Array< OneD, NekDouble >> &inarray, Array< OneD, NekDouble > &outarray)
Definition: Mapping.cpp:681
virtual GLOBAL_MAPPING_EXPORT void v_Divergence(const Array< OneD, Array< OneD, NekDouble >> &inarray, Array< OneD, NekDouble > &outarray)
Definition: Mapping.cpp:752
virtual GLOBAL_MAPPING_EXPORT void v_ContravarFromCartesian(const Array< OneD, Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)=0
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:169
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:605
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:344
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:512
std::string m_funcName
Name of the function containing the coordinates.
Definition: Mapping.h:417
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:270
GLOBAL_MAPPING_EXPORT void GetJacobian(Array< OneD, NekDouble > &outarray)
Get the Jacobian of the transformation.
Definition: Mapping.h:155
GLOBAL_MAPPING_EXPORT Mapping(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Constructor.
Definition: Mapping.cpp:59
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:101
Array< OneD, Array< OneD, NekDouble > > m_tmp
Definition: Mapping.h:437
bool m_constantJacobian
Flag defining if the Jacobian is constant.
Definition: Mapping.h:423
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:1209
virtual GLOBAL_MAPPING_EXPORT void v_RaiseIndex(const Array< OneD, Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: Mapping.cpp:731
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:211
virtual GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelCovar(const Array< OneD, Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)=0
bool m_timeDependent
Flag defining if the Mapping is time-dependent.
Definition: Mapping.h:425
virtual GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor(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:635
virtual GLOBAL_MAPPING_EXPORT void v_GetCoordVelocity(Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: Mapping.cpp:670
Provides a generic Factory class.
Definition: NekFactory.hpp:105
GLOBAL_MAPPING_EXPORT typedef std::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:50
LibUtilities::NekFactory< std::string, Mapping, const LibUtilities::SessionReaderSharedPtr &, const Array< OneD, MultiRegions::ExpListSharedPtr > &, const TiXmlElement * > MappingFactory
Declaration of the mapping factory.
Definition: Mapping.h:59
MappingFactory & GetMappingFactory()
Declaration of the mapping factory singleton.
Definition: Mapping.cpp:53
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:327
std::map< std::string, std::string > FieldMetaDataMap
Definition: FieldIO.h:52
std::shared_ptr< SessionReader > SessionReaderSharedPtr
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayOfArray
double NekDouble