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