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 
42 #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
56 typedef LibUtilities::NekFactory<std::string, Mapping,
59  const TiXmlElement*> MappingFactory;
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  /// @brief Initialise the mapping object
76  const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields,
77  const TiXmlElement* pMapping)
78  {
79  v_InitObject( pFields, pMapping);
80  }
81 
82  /// @brief Replace the Expansion List used by the mapping
84  const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields);
85 
86  /// @brief Return a pointer to the mapping, creating it on first call
87  GLOBAL_MAPPING_EXPORT static MappingSharedPtr Load(
88  const LibUtilities::SessionReaderSharedPtr& pSession,
89  const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields);
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  */
137  {
138  v_GetCartesianCoordinates( out0, out1, out2);
139  }
140 
141  /////////////////////////////////////////////////////////////
142  //
143  // Basic tensor calculus functions
144  //
145  /////////////////////////////////////////////////////////////
146 
147  /**
148  * @brief Get the Jacobian of the transformation
149  *
150  * This function is used to obtain the Jacobian of the Mapping.
151  *
152  * @param outarray Array containing the Jacobian
153  */
155  Array<OneD, NekDouble> &outarray)
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,
327  const bool generalized)
328  {
329  v_CurlCurlField( inarray, outarray, generalized);
330  }
331 
332 
333  /////////////////////////////////////////////////////////////
334  //
335  // Functions defining mapping properties
336  //
337  /////////////////////////////////////////////////////////////
338 
339  /// @brief Get flag defining if mapping is time-dependent
341  {
342  return m_timeDependent;
343  }
344 
345  /// @brief Set flag defining if mapping is time-dependent
346  GLOBAL_MAPPING_EXPORT void SetTimeDependent( const bool value)
347  {
348  m_timeDependent = value;
349  }
350 
351  /// @brief Get flag defining if mapping is defined by a function
353  {
354  return m_fromFunction;
355  }
356 
357  /// @brief Set flag defining if mapping is defined by a function
358  GLOBAL_MAPPING_EXPORT void SetFromFunction( const bool value)
359  {
360  m_fromFunction = value;
361  }
362 
363  /// @brief Get flag defining if mapping has constant Jacobian
365  {
366  return m_constantJacobian;
367  }
368 
369  /// @brief Get flag determining if the mapping was defined or is trivial
371  {
372  return m_isDefined;
373  }
374 
375  //
376  // Function to update time-dependent mappings
377  //
378 
379  /// @brief Update the Dirichlet Boundary Conditions when using Mappings
381  {
382  v_UpdateBCs(time);
383  }
384 
385  /// @brief Update the Mapping with new coordinates
387  const Array<OneD, Array<OneD, NekDouble> > &coords
389  const Array<OneD, Array<OneD, NekDouble> > &coordsVel
391  {
392  v_UpdateMapping( time, coords, coordsVel);
393  }
394 
395  /// @brief Recompute the metric terms of the Mapping
397  {
399  }
400 
401 
402  protected:
403  /// Session reader
404  LibUtilities::SessionReaderSharedPtr m_session;
405  // FieldIO object used to output mapping
407  // Fields
408  Array<OneD, MultiRegions::ExpListSharedPtr> m_fields;
409  /// Array with the Cartesian coordinates
411  /// Array with the velocity of the coordinates
413  /// Array with metric terms of the mapping
415  /// Number of velocity components
417 
418  /// Name of the function containing the coordinates
419  std::string m_funcName;
420  /// Name of the function containing the velocity of the coordinates
421  std::string m_velFuncName;
422 
423 
424  // Flags to help the solver
425  /// Flag defining if the Jacobian is constant
427  /// Flag defining if the Mapping is time-dependent
429  /// Flag defining if the Mapping is defined by a function
431 
432  // Static variables to load mapping
433  static MappingSharedPtr m_mappingPtr;
434  static bool m_init;
435  static bool m_isDefined;
436 
437  // Workspace variables
441 
442  /// @brief Constructor
444  const LibUtilities::SessionReaderSharedPtr& pSession,
445  const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields);
446 
447  // Evaluators
449  Array<OneD, MultiRegions::ExpListSharedPtr> pFields,
450  LibUtilities::SessionReaderSharedPtr pSession,
451  std::string pFieldName,
452  Array<OneD, NekDouble>& pArray,
453  const std::string& pFunctionName,
454  NekDouble pTime = NekDouble(0));
455 
457  LibUtilities::SessionReaderSharedPtr pSession,
458  std::string pFieldName,
459  Array<OneD, NekDouble>& pArray,
460  const std::string& pFunctionName,
461  NekDouble pTime = NekDouble(0));
462 
463  // Virtual functions
464  GLOBAL_MAPPING_EXPORT virtual void v_InitObject(
465  const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields,
466  const TiXmlElement* pMapping);
467 
469  const Array<OneD, Array<OneD, NekDouble> > &inarray,
470  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
471 
473  const Array<OneD, Array<OneD, NekDouble> > &inarray,
474  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
475 
477  const Array<OneD, Array<OneD, NekDouble> > &inarray,
478  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
479 
481  const Array<OneD, Array<OneD, NekDouble> > &inarray,
482  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
483 
487  Array<OneD, NekDouble> &out2);
488 
490  Array<OneD, Array<OneD, NekDouble> > &outarray);
491 
493  Array<OneD, NekDouble> &outarray) =0;
494 
496  const Array<OneD, Array<OneD, NekDouble> > &inarray,
497  Array<OneD, NekDouble> &outarray);
498 
500  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
501 
503  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
504 
505  GLOBAL_MAPPING_EXPORT virtual void v_LowerIndex(
506  const Array<OneD, Array<OneD, NekDouble> > &inarray,
507  Array<OneD, Array<OneD, NekDouble> > &outarray);
508 
509  GLOBAL_MAPPING_EXPORT virtual void v_RaiseIndex(
510  const Array<OneD, Array<OneD, NekDouble> > &inarray,
511  Array<OneD, Array<OneD, NekDouble> > &outarray);
512 
514  const Array<OneD, Array<OneD, NekDouble> > &inarray,
515  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
516 
518  const Array<OneD, Array<OneD, NekDouble> > &inarray,
519  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
520 
521  GLOBAL_MAPPING_EXPORT virtual void v_Divergence(
522  const Array<OneD, Array<OneD, NekDouble> > &inarray,
523  Array<OneD, NekDouble> &outarray);
524 
526  const Array<OneD, Array<OneD, NekDouble> > &inarray,
527  Array<OneD, Array<OneD, NekDouble> > &outarray,
528  const NekDouble alpha);
529 
530  GLOBAL_MAPPING_EXPORT virtual void v_gradgradU(
531  const Array<OneD, Array<OneD, NekDouble> > &inarray,
532  Array<OneD, Array<OneD, NekDouble> > &outarray);
533 
535  Array<OneD, Array<OneD, NekDouble> > &inarray,
536  Array<OneD, Array<OneD, NekDouble> > &outarray,
537  const bool generalized);
538 
540  const NekDouble time,
541  const Array<OneD, Array<OneD, NekDouble> > &coords
543  const Array<OneD, Array<OneD, NekDouble> > &coordsVel
545 
546  GLOBAL_MAPPING_EXPORT virtual void v_UpdateGeomInfo() =0;
547 
548  GLOBAL_MAPPING_EXPORT virtual void v_UpdateBCs(const NekDouble time);
549 
550 };
551 
552 }
553 }
554 
555 #endif
static MappingSharedPtr m_mappingPtr
Definition: Mapping.h:433
std::string m_funcName
Name of the function containing the coordinates.
Definition: Mapping.h:419
GLOBAL_MAPPING_EXPORT void InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
Initialise the mapping object.
Definition: Mapping.h:75
virtual GLOBAL_MAPPING_EXPORT void v_CovarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
std::string m_velFuncName
Name of the function containing the velocity of the coordinates.
Definition: Mapping.h:421
Array< OneD, Array< OneD, NekDouble > > m_GeometricInfo
Array with metric terms of the mapping.
Definition: Mapping.h:414
Array< OneD, Array< OneD, NekDouble > > m_coords
Array with the Cartesian coordinates.
Definition: Mapping.h:410
MappingFactory & GetMappingFactory()
Declaration of the mapping factory singleton.
Definition: Mapping.cpp:52
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:795
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:579
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:386
GLOBAL_MAPPING_EXPORT void GetMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
Get the metric tensor .
Definition: Mapping.h:177
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
virtual GLOBAL_MAPPING_EXPORT void v_GetCoordVelocity(Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: Mapping.cpp:678
virtual GLOBAL_MAPPING_EXPORT ~Mapping()
Destructor.
Definition: Mapping.h:72
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:489
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
Array< OneD, Array< OneD, NekDouble > > m_wk2
Definition: Mapping.h:439
GLOBAL_MAPPING_EXPORT bool IsDefined()
Get flag determining if the mapping was defined or is trivial.
Definition: Mapping.h:370
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_UpdateGeomInfo()=0
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 GetJacobian(Array< OneD, NekDouble > &outarray)
Get the Jacobian of the transformation.
Definition: Mapping.h:154
int m_nConvectiveFields
Number of velocity components.
Definition: Mapping.h:416
std::map< std::string, std::string > FieldMetaDataMap
Definition: FieldIO.h:52
#define GLOBAL_MAPPING_EXPORT
GLOBAL_MAPPING_EXPORT void SetTimeDependent(const bool value)
Set flag defining if mapping is time-dependent.
Definition: Mapping.h:346
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:305
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:641
virtual GLOBAL_MAPPING_EXPORT void v_DotGradJacobian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
Definition: Mapping.cpp:690
GLOBAL_MAPPING_EXPORT bool IsFromFunction()
Get flag defining if mapping is defined by a function.
Definition: Mapping.h:352
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_GetJacobian(Array< OneD, NekDouble > &outarray)=0
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Definition: Mapping.h:408
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
Definition: Mapping.h:404
bool m_timeDependent
Flag defining if the Mapping is time-dependent.
Definition: Mapping.h:428
GLOBAL_MAPPING_EXPORT void UpdateBCs(const NekDouble time)
Update the Dirichlet Boundary Conditions when using Mappings.
Definition: Mapping.h:380
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_GetCartesianCoordinates(Array< OneD, NekDouble > &out0, Array< OneD, NekDouble > &out1, Array< OneD, NekDouble > &out2)
Definition: Mapping.cpp:662
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
Array< OneD, Array< OneD, NekDouble > > m_coordsVel
Array with the velocity of the coordinates.
Definition: Mapping.h:412
LibUtilities::FieldIOSharedPtr m_fld
Definition: Mapping.h:406
GLOBAL_MAPPING_EXPORT bool HasConstantJacobian()
Get flag defining if mapping has constant Jacobian.
Definition: Mapping.h:364
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_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
Definition: Mapping.cpp:100
bool m_constantJacobian
Flag defining if the Jacobian is constant.
Definition: Mapping.h:426
double NekDouble
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
Array< OneD, Array< OneD, NekDouble > > m_tmp
Definition: Mapping.h:440
virtual GLOBAL_MAPPING_EXPORT void v_gradgradU(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: Mapping.cpp:902
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:1230
virtual GLOBAL_MAPPING_EXPORT void v_Divergence(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
Definition: Mapping.cpp:766
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
Base class for mapping to be applied to the coordinate system.
Definition: Mapping.h:68
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:385
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:1012
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 Mapping(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Constructor.
Definition: Mapping.cpp:58
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
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:406
virtual GLOBAL_MAPPING_EXPORT void v_ApplyChristoffelCovar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
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:610
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 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:549
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:519
virtual GLOBAL_MAPPING_EXPORT void v_RaiseIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: Mapping.cpp:743
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayofArray
virtual GLOBAL_MAPPING_EXPORT void v_LowerIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: Mapping.cpp:720
GLOBAL_MAPPING_EXPORT void ReplaceField(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Replace the Expansion List used by the mapping.
Definition: Mapping.cpp:245
virtual GLOBAL_MAPPING_EXPORT void v_ContravarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
GLOBAL_MAPPING_EXPORT typedef std::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:50
Array< OneD, Array< OneD, NekDouble > > m_wk1
Definition: Mapping.h:438
virtual GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)=0
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:306
bool m_fromFunction
Flag defining if the Mapping is defined by a function.
Definition: Mapping.h:430
virtual GLOBAL_MAPPING_EXPORT void v_GetMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)=0
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:268
std::shared_ptr< SessionReader > SessionReaderSharedPtr
GLOBAL_MAPPING_EXPORT bool IsTimeDependent()
Get flag defining if mapping is time-dependent.
Definition: Mapping.h:340
Provides a generic Factory class.
Definition: NekFactory.hpp:103
GLOBAL_MAPPING_EXPORT void GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
Get the inverse of metric tensor .
Definition: Mapping.h:184
GLOBAL_MAPPING_EXPORT void SetFromFunction(const bool value)
Set flag defining if mapping is defined by a function.
Definition: Mapping.h:358
GLOBAL_MAPPING_EXPORT void UpdateGeomInfo()
Recompute the metric terms of the Mapping.
Definition: Mapping.h:396
virtual GLOBAL_MAPPING_EXPORT void v_UpdateBCs(const NekDouble time)
Definition: Mapping.cpp:1075