Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Abstract base class for mappings.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_GLOBALMAPPING_MAPPING
37 #define NEKTAR_GLOBALMAPPING_MAPPING
38 
39 #include <string>
40 
43 #include <MultiRegions/ExpList.h>
45 
46 namespace Nektar
47 {
48 namespace GlobalMapping
49 {
50 // Forward declaration
51 class Mapping;
52 
53 /// A shared pointer to a Mapping object
54 GLOBAL_MAPPING_EXPORT typedef boost::shared_ptr<Mapping> MappingSharedPtr;
55 
56 /// Declaration of the mapping factory
57 typedef LibUtilities::NekFactory<std::string, Mapping,
60  const TiXmlElement*> MappingFactory;
61 
62 /// Declaration of the mapping factory singleton
64 
65 /**
66  * @class Mapping
67  * @brief Base class for mapping to be applied to the coordinate system
68  */
69 class Mapping
70 {
71  public:
72  /// @brief Destructor
74 
75  /// @brief Initialise the mapping object
77  const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields,
78  const TiXmlElement* pMapping)
79  {
80  v_InitObject( pFields, pMapping);
81  }
82 
83  /// @brief Replace the Expansion List used by the mapping
85  const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields);
86 
87  /// @brief Return a pointer to the mapping, creating it on first call
88  GLOBAL_MAPPING_EXPORT static MappingSharedPtr Load(
89  const LibUtilities::SessionReaderSharedPtr& pSession,
90  const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields);
91 
92  /// @brief Output function called when a chk or fld file is written
94  LibUtilities::FieldMetaDataMap & fieldMetaDataMap,
95  const std::string &outname);
96 
97  /////////////////////////////////////////////////////////////
98  //
99  // Functions for transforming results to and from the
100  // Cartesian coordinate system
101  // (useful for pre and post processing)
102  /////////////////////////////////////////////////////////////
103 
104  /// @brief Convert a contravariant vector to the Cartesian system
106  const Array<OneD, Array<OneD, NekDouble> > &inarray,
107  Array<OneD, Array<OneD, NekDouble> > &outarray);
108 
109  /// @brief Convert a covariant vector to the Cartesian system
111  const Array<OneD, Array<OneD, NekDouble> > &inarray,
112  Array<OneD, Array<OneD, NekDouble> > &outarray);
113 
114  /// @brief Convert a contravariant vector to the transformed system
116  const Array<OneD, Array<OneD, NekDouble> > &inarray,
117  Array<OneD, Array<OneD, NekDouble> > &outarray);
118 
119  /// @brief Convert a covariant vector to the transformed system
121  const Array<OneD, Array<OneD, NekDouble> > &inarray,
122  Array<OneD, Array<OneD, NekDouble> > &outarray);
123 
124  /**
125  * @brief Get the Cartesian coordinates in the field
126  *
127  * This function is used to obtain the Cartesian coordinates
128  * associated withthe Mapping
129  *
130  * @param out0 Coordinates in the x-direction
131  * @param out1 Coordinates in the y-direction
132  * @param out2 Coordinates in the z-direction
133  */
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  Array<OneD, NekDouble> &outarray)
157  {
158  v_GetJacobian( outarray);
159  }
160 
161  /**
162  * @brief Calculate the dot product with the gradient of the Jacobian
163  *
164  * This function calculates the dot product of an array against the
165  * gradient of the Jacobian of the Mapping.
166  *
167  * @param inarray Input array
168  * @param outarray Output array
169  */
171  const Array<OneD, Array<OneD, NekDouble> > &inarray,
172  Array<OneD, NekDouble> &outarray)
173  {
174  v_DotGradJacobian( inarray, outarray);
175  }
176 
177  /// @brief Get the metric tensor \f$g_{ij}\f$
179  Array<OneD, Array<OneD, NekDouble> > &outarray)
180  {
181  v_GetMetricTensor( outarray);
182  }
183 
184  /// @brief Get the inverse of metric tensor \f$g^{ij}\f$
186  Array<OneD, Array<OneD, NekDouble> > &outarray)
187  {
188  v_GetInvMetricTensor( outarray);
189  }
190 
191  /// @brief Lower index of vector: \f$v_{i} = g_{ij}*v^{j}\f$
193  const Array<OneD, Array<OneD, NekDouble> > &inarray,
194  Array<OneD, Array<OneD, NekDouble> > &outarray);
195 
196  /// @brief Raise index of vector: \f$v^{i} = g^{ij}*v_{j}\f$
198  const Array<OneD, Array<OneD, NekDouble> > &inarray,
199  Array<OneD, Array<OneD, NekDouble> > &outarray);
200 
201  /**
202  * @brief Apply the Christoffel symbols to a contravariant vector
203  *
204  * This function is used apply the Christoffel symbols
205  * \f$ \left( i,pk\right)\f$ to
206  * a contravariant vector \f$u^p\f$, following the relation
207  * \f[ (out)^{i}_{k} = \left( i,pk\right)u^p \f]
208  *
209  * @param inarray Contravariant vector \f$u^p\f$
210  * @param outarray Result of applying Christoffel symbols to \f$u^p\f$
211  */
213  const Array<OneD, Array<OneD, NekDouble> > &inarray,
214  Array<OneD, Array<OneD, NekDouble> > &outarray)
215  {
216  v_ApplyChristoffelContravar( inarray, outarray);
217  }
218 
219  /**
220  * @brief Apply the Christoffel symbols to a covariant vector
221  *
222  * This function is used apply the Christoffel symbols
223  * \f$ \left( p,ik\right)\f$ to
224  * a covariant vector \f$u_p\f$, following the relation
225  * \f[ (out)_{ik} = \left( p,ik\right)u_p \f]
226  *
227  * @param inarray Contravariant vector \f$u_p\f$
228  * @param outarray Result of applying Christoffel symbols to \f$u_p\f$
229  */
231  const Array<OneD, Array<OneD, NekDouble> > &inarray,
232  Array<OneD, Array<OneD, NekDouble> > &outarray)
233  {
234  v_ApplyChristoffelCovar( inarray, outarray);
235  }
236 
237  /**
238  * @brief Obtain the velocity of the coordinates
239  *
240  * This function is used to obtain the velocity of the coordinates
241  * associated with the Mapping
242  *
243  * @param outarray Velocity of the coordinates
244  */
246  Array<OneD, Array<OneD, NekDouble> > &outarray)
247  {
248  v_GetCoordVelocity( outarray);
249  }
250 
251  /////////////////////////////////////////////////////////////
252  //
253  // Differential operators
254  //
255  /////////////////////////////////////////////////////////////
256 
257  /**
258  * @brief Calculate the generalised divergence operator
259  *
260  * This function is used to calculate the generalised divergence
261  * of a contravariant vector, defined as
262  * \f[ D = u^i_{,i} = \frac{1}{J}\frac{\partial(Ju^i)}{\partial x^i}\f]
263  *
264  * @param inarray Contravariant vector \f$u^i\f$
265  * @param outarray Divergence of \f$u^i\f$
266  */
268  const Array<OneD, Array<OneD, NekDouble> > &inarray,
269  Array<OneD, NekDouble> &outarray)
270  {
271  v_Divergence( inarray, outarray);
272  }
273 
274  /**
275  * @brief Generalised (correction to the) velocity Laplacian operator
276  *
277  * This function is used to calculate a correction defined as
278  * the difference between the generalised Laplacian and the
279  * original Laplacian multiplied by a constant \f$\alpha\f$,
280  * resulting in
281  * \f[ L^i = g^{jk}u^{i}_{,jk} - \alpha \frac{\partial^2 x^i}
282  * {\partial x^j \partial x^j}\f]
283  * By default, \f$\alpha\f$ is zero, resulting in the generalised
284  * Laplacian.
285  *
286  * @param inarray Contravariant vector \f$u^i\f$
287  * @param outarray Result of the operation
288  * @param alpha The constant \f$\alpha\f$
289  */
291  const Array<OneD, Array<OneD, NekDouble> > &inarray,
292  Array<OneD, Array<OneD, NekDouble> > &outarray,
293  const NekDouble alpha = 0.0)
294  {
295  v_VelocityLaplacian( inarray, outarray, alpha);
296  }
297 
298  /**
299  * @brief Second order covariant derivatives of a contravariant vector
300  *
301  * This function computes the second order covariant derivatives
302  * of a contravariant vector, resulting in \f$u^{i}_{,jk}\f$
303  *
304  * @param inarray Contravariant vector \f$u^i\f$
305  * @param outarray Second order derivatives \f$u^{i}_{,jk}\f$
306  */
308  const Array<OneD, Array<OneD, NekDouble> > &inarray,
309  Array<OneD, Array<OneD, NekDouble> > &outarray)
310  {
311  v_gradgradU( inarray, outarray);
312  }
313 
314  /**
315  * @brief CurlCurl calculated on the whole field
316  *
317  * This function can be used to compute both the generalised CurlCurl
318  * or the typical (Cartesian) CurlCurl, depending on the flag
319  * generalized
320  *
321  * @param inarray Contravariant vector \f$u^i\f$
322  * @param outarray CurlCurl of \f$u\f$
323  * @param generalized Flag defining if generalised or typical CurlCurl
324  */
326  Array<OneD, Array<OneD, NekDouble> > &inarray,
327  Array<OneD, Array<OneD, NekDouble> > &outarray,
328  const bool generalized)
329  {
330  v_CurlCurlField( inarray, outarray, generalized);
331  }
332 
333 
334  /////////////////////////////////////////////////////////////
335  //
336  // Functions defining mapping properties
337  //
338  /////////////////////////////////////////////////////////////
339 
340  /// @brief Get flag defining if mapping is time-dependent
342  {
343  return m_timeDependent;
344  }
345 
346  /// @brief Set flag defining if mapping is time-dependent
347  GLOBAL_MAPPING_EXPORT void SetTimeDependent( const bool value)
348  {
349  m_timeDependent = value;
350  }
351 
352  /// @brief Get flag defining if mapping is defined by a function
354  {
355  return m_fromFunction;
356  }
357 
358  /// @brief Set flag defining if mapping is defined by a function
359  GLOBAL_MAPPING_EXPORT void SetFromFunction( const bool value)
360  {
361  m_fromFunction = value;
362  }
363 
364  /// @brief Get flag defining if mapping has constant Jacobian
366  {
367  return m_constantJacobian;
368  }
369 
370  /// @brief Get flag determining if the mapping was defined or is trivial
372  {
373  return m_isDefined;
374  }
375 
376  //
377  // Function to update time-dependent mappings
378  //
379 
380  /// @brief Update the Dirichlet Boundary Conditions when using Mappings
382  {
383  v_UpdateBCs(time);
384  }
385 
386  /// @brief Update the Mapping with new coordinates
388  const Array<OneD, Array<OneD, NekDouble> > &coords
390  const Array<OneD, Array<OneD, NekDouble> > &coordsVel
392  {
393  v_UpdateMapping( time, coords, coordsVel);
394  }
395 
396  /// @brief Recompute the metric terms of the Mapping
398  {
400  }
401 
402 
403  protected:
404  /// Session reader
405  LibUtilities::SessionReaderSharedPtr m_session;
406  // FieldIO object used to output mapping
408  // Fields
409  Array<OneD, MultiRegions::ExpListSharedPtr> m_fields;
410  /// Array with the Cartesian coordinates
412  /// Array with the velocity of the coordinates
414  /// Array with metric terms of the mapping
416  /// Number of velocity components
418 
419  /// Name of the function containing the coordinates
420  std::string m_funcName;
421  /// Name of the function containing the velocity of the coordinates
422  std::string m_velFuncName;
423 
424 
425  // Flags to help the solver
426  /// Flag defining if the Jacobian is constant
428  /// Flag defining if the Mapping is time-dependent
430  /// Flag defining if the Mapping is defined by a function
432 
433  // Static variables to load mapping
434  static MappingSharedPtr m_mappingPtr;
435  static bool m_init;
436  static bool m_isDefined;
437 
438  // Workspace variables
442 
443  /// @brief Constructor
445  const LibUtilities::SessionReaderSharedPtr& pSession,
446  const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields);
447 
448  // Evaluators
450  Array<OneD, MultiRegions::ExpListSharedPtr> pFields,
451  LibUtilities::SessionReaderSharedPtr pSession,
452  std::string pFieldName,
453  Array<OneD, NekDouble>& pArray,
454  const std::string& pFunctionName,
455  NekDouble pTime = NekDouble(0));
456 
458  LibUtilities::SessionReaderSharedPtr pSession,
459  std::string pFieldName,
460  Array<OneD, NekDouble>& pArray,
461  const std::string& pFunctionName,
462  NekDouble pTime = NekDouble(0));
463 
464  // Virtual functions
465  GLOBAL_MAPPING_EXPORT virtual void v_InitObject(
466  const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields,
467  const TiXmlElement* pMapping);
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 
478  const Array<OneD, Array<OneD, NekDouble> > &inarray,
479  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
480 
482  const Array<OneD, Array<OneD, NekDouble> > &inarray,
483  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
484 
488  Array<OneD, NekDouble> &out2);
489 
491  Array<OneD, Array<OneD, NekDouble> > &outarray);
492 
494  Array<OneD, NekDouble> &outarray) =0;
495 
497  const Array<OneD, Array<OneD, NekDouble> > &inarray,
498  Array<OneD, NekDouble> &outarray);
499 
501  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
502 
504  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
505 
506  GLOBAL_MAPPING_EXPORT virtual void v_LowerIndex(
507  const Array<OneD, Array<OneD, NekDouble> > &inarray,
508  Array<OneD, Array<OneD, NekDouble> > &outarray);
509 
510  GLOBAL_MAPPING_EXPORT virtual void v_RaiseIndex(
511  const Array<OneD, Array<OneD, NekDouble> > &inarray,
512  Array<OneD, Array<OneD, NekDouble> > &outarray);
513 
515  const Array<OneD, Array<OneD, NekDouble> > &inarray,
516  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
517 
519  const Array<OneD, Array<OneD, NekDouble> > &inarray,
520  Array<OneD, Array<OneD, NekDouble> > &outarray) =0;
521 
522  GLOBAL_MAPPING_EXPORT virtual void v_Divergence(
523  const Array<OneD, Array<OneD, NekDouble> > &inarray,
524  Array<OneD, NekDouble> &outarray);
525 
527  const Array<OneD, Array<OneD, NekDouble> > &inarray,
528  Array<OneD, Array<OneD, NekDouble> > &outarray,
529  const NekDouble alpha);
530 
531  GLOBAL_MAPPING_EXPORT virtual void v_gradgradU(
532  const Array<OneD, Array<OneD, NekDouble> > &inarray,
533  Array<OneD, Array<OneD, NekDouble> > &outarray);
534 
536  Array<OneD, Array<OneD, NekDouble> > &inarray,
537  Array<OneD, Array<OneD, NekDouble> > &outarray,
538  const bool generalized);
539 
541  const NekDouble time,
542  const Array<OneD, Array<OneD, NekDouble> > &coords
544  const Array<OneD, Array<OneD, NekDouble> > &coordsVel
546 
547  GLOBAL_MAPPING_EXPORT virtual void v_UpdateGeomInfo() =0;
548 
549  GLOBAL_MAPPING_EXPORT virtual void v_UpdateBCs(const NekDouble time);
550 
551 };
552 
553 }
554 }
555 
556 #endif
static MappingSharedPtr m_mappingPtr
Definition: Mapping.h:434
std::string m_funcName
Name of the function containing the coordinates.
Definition: Mapping.h:420
GLOBAL_MAPPING_EXPORT void InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
Initialise the mapping object.
Definition: Mapping.h:76
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:422
Array< OneD, Array< OneD, NekDouble > > m_GeometricInfo
Array with metric terms of the mapping.
Definition: Mapping.h:415
Array< OneD, Array< OneD, NekDouble > > m_coords
Array with the Cartesian coordinates.
Definition: Mapping.h:411
MappingFactory & GetMappingFactory()
Declaration of the mapping factory singleton.
Definition: Mapping.cpp:49
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:792
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:576
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:387
GLOBAL_MAPPING_EXPORT void GetMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
Get the metric tensor .
Definition: Mapping.h:178
GLOBAL_MAPPING_EXPORT void Divergence(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
Calculate the generalised divergence operator.
Definition: Mapping.h:267
virtual GLOBAL_MAPPING_EXPORT void v_GetCoordVelocity(Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: Mapping.cpp:675
virtual GLOBAL_MAPPING_EXPORT ~Mapping()
Destructor.
Definition: Mapping.h:73
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:486
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:325
Array< OneD, Array< OneD, NekDouble > > m_wk2
Definition: Mapping.h:440
GLOBAL_MAPPING_EXPORT bool IsDefined()
Get flag determining if the mapping was defined or is trivial.
Definition: Mapping.h:371
GLOBAL_MAPPING_EXPORT void GetCoordVelocity(Array< OneD, Array< OneD, NekDouble > > &outarray)
Obtain the velocity of the coordinates.
Definition: Mapping.h:245
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:134
GLOBAL_MAPPING_EXPORT void GetJacobian(Array< OneD, NekDouble > &outarray)
Get the Jacobian of the transformation.
Definition: Mapping.h:155
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
int m_nConvectiveFields
Number of velocity components.
Definition: Mapping.h:417
std::map< std::string, std::string > FieldMetaDataMap
Definition: FieldIO.h:54
#define GLOBAL_MAPPING_EXPORT
GLOBAL_MAPPING_EXPORT void SetTimeDependent(const bool value)
Set flag defining if mapping is time-dependent.
Definition: Mapping.h:347
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:302
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:638
virtual GLOBAL_MAPPING_EXPORT void v_DotGradJacobian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
Definition: Mapping.cpp:687
GLOBAL_MAPPING_EXPORT bool IsFromFunction()
Get flag defining if mapping is defined by a function.
Definition: Mapping.h:353
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:409
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
Definition: Mapping.h:405
bool m_timeDependent
Flag defining if the Mapping is time-dependent.
Definition: Mapping.h:429
GLOBAL_MAPPING_EXPORT void UpdateBCs(const NekDouble time)
Update the Dirichlet Boundary Conditions when using Mappings.
Definition: Mapping.h:381
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:659
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:212
Array< OneD, Array< OneD, NekDouble > > m_coordsVel
Array with the velocity of the coordinates.
Definition: Mapping.h:413
LibUtilities::FieldIOSharedPtr m_fld
Definition: Mapping.h:407
GLOBAL_MAPPING_EXPORT bool HasConstantJacobian()
Get flag defining if mapping has constant Jacobian.
Definition: Mapping.h:365
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:99
bool m_constantJacobian
Flag defining if the Jacobian is constant.
Definition: Mapping.h:427
boost::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:309
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:290
Array< OneD, Array< OneD, NekDouble > > m_tmp
Definition: Mapping.h:441
virtual GLOBAL_MAPPING_EXPORT void v_gradgradU(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: Mapping.cpp:899
GLOBAL_MAPPING_EXPORT typedef boost::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:51
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:1227
virtual GLOBAL_MAPPING_EXPORT void v_Divergence(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
Definition: Mapping.cpp:763
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:307
Base class for mapping to be applied to the coordinate system.
Definition: Mapping.h:69
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
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:1009
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:170
GLOBAL_MAPPING_EXPORT Mapping(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Constructor.
Definition: Mapping.cpp:57
LibUtilities::NekFactory< std::string, Mapping, const LibUtilities::SessionReaderSharedPtr &, const Array< OneD, MultiRegions::ExpListSharedPtr > &, const TiXmlElement * > MappingFactory
Declaration of the mapping factory.
Definition: Mapping.h:60
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:403
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:607
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:230
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:546
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:516
virtual GLOBAL_MAPPING_EXPORT void v_RaiseIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: Mapping.cpp:740
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:717
GLOBAL_MAPPING_EXPORT void ReplaceField(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Replace the Expansion List used by the mapping.
Definition: Mapping.cpp:242
virtual GLOBAL_MAPPING_EXPORT void v_ContravarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
Array< OneD, Array< OneD, NekDouble > > m_wk1
Definition: Mapping.h:439
virtual GLOBAL_MAPPING_EXPORT void v_GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)=0
bool m_fromFunction
Flag defining if the Mapping is defined by a function.
Definition: Mapping.h:431
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:265
GLOBAL_MAPPING_EXPORT bool IsTimeDependent()
Get flag defining if mapping is time-dependent.
Definition: Mapping.h:341
Provides a generic Factory class.
Definition: NekFactory.hpp:116
GLOBAL_MAPPING_EXPORT void GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
Get the inverse of metric tensor .
Definition: Mapping.h:185
GLOBAL_MAPPING_EXPORT void SetFromFunction(const bool value)
Set flag defining if mapping is defined by a function.
Definition: Mapping.h:359
GLOBAL_MAPPING_EXPORT void UpdateGeomInfo()
Recompute the metric terms of the Mapping.
Definition: Mapping.h:397
virtual GLOBAL_MAPPING_EXPORT void v_UpdateBCs(const NekDouble time)
Definition: Mapping.cpp:1072