Nektar++
Loading...
Searching...
No Matches
NodalUtil.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: NodalUtil.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: 2D and 3D Nodal Utilities header file Basis function,
32// Interpolation, Integral, Derivation, etc.
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#ifndef NODALUTIL_H
37#define NODALUTIL_H
38
39#include <tuple>
40
45
47{
48
49typedef std::shared_ptr<NekMatrix<NekDouble>> SharedMatrix;
50
51/**
52 * @brief A class to assist in the construction of nodal simplex and hybrid
53 * elements in two and three dimensions.
54 *
55 * The NodalUtil class and its subclasses are designed to take care of some
56 * common issues that arise when considering triangles, tetrahedra and prismatic
57 * elements that are equipped with a nodal Lagrangian basis, defined using a set
58 * of nodal points \f$ \xi_i \f$ that we store in the array
59 * NodalUtil::m_xi. Since one cannot write this basis analytically, we instead
60 * construct the Vandermonde matrix
61 *
62 * \f[ \mathbf{V}_{ij} = \psi_j(\xi_i) \f]
63 *
64 * where \f$ \psi_j \f$ is a basis that spans the polynomial space of the
65 * element. The Vandermonde matrix can then be used to construct the integration
66 * weights, derivative and interpolation matrices. Although this can be any
67 * basis, such as the monomial basis \f$ x^i y^j z^k \f$, in practice this is
68 * numerically unstable at high polynomial orders. Elements are therefore
69 * expected to use the 'traditional' modal orthogonal basis. See Sherwin &
70 * Karniadakis or Hesthaven & Warburton for further details of this basis and
71 * the surrounding numerical issues.
72 *
73 * This class therefore contains the generic logic needed to construct various
74 * matrices, and subclasses override virtual functions that define the
75 * orthogonal basis and its derivatives for a particular element type.
76 */
78{
79public:
80 LIB_UTILITIES_EXPORT virtual ~NodalUtil() = default;
87
88protected:
89 /**
90 * @brief Set up the NodalUtil object.
91 *
92 * @param dim Dimension of the element.
93 * @param degree Polynomial degree of the element.
94 */
95 NodalUtil(size_t degree, size_t dim)
96 : m_dim(dim), m_degree(degree), m_xi(dim)
97 {
98 }
99
100 /// Dimension of the nodal element
101 size_t m_dim;
102 /// Degree of the nodal element
103 size_t m_degree;
104 /// Total number of nodal points
106 /// Coordinates of the nodal points defining the basis
108
109 /**
110 * @brief Return the values of the orthogonal basis at the nodal points for
111 * a given mode.
112 *
113 * @param mode Mode number, which is between 0 and NodalUtil::v_NumModes()
114 * - 1.
115 *
116 * @return Orthogonal mode @p mode evaluated at the nodal points.
117 */
118 virtual NekVector<NekDouble> v_OrthoBasis(const size_t mode) = 0;
119
120 /**
121 * @brief Return the values of the derivative of the orthogonal basis at the
122 * nodal points for a given mode.
123 *
124 * @param dir Coordinate direction of derivative.
125 * @param mode Mode number, which is between 0 and NodalUtil::v_NumModes()
126 * - 1.
127 */
128 virtual NekVector<NekDouble> v_OrthoBasisDeriv(const size_t dir,
129 const size_t mode) = 0;
130
131 /**
132 * @brief Construct a NodalUtil object of the appropriate element type for a
133 * given set of points.
134 *
135 * This function is used inside NodalUtil::GetInterpolationMatrix so that
136 * the (potentially non-square) Vandermonde matrix can be constructed to
137 * create the interpolation matrix at an arbitrary set of points in the
138 * domain.
139 *
140 * @param xi Distribution of nodal points to create utility with.
141 */
142 virtual std::shared_ptr<NodalUtil> v_CreateUtil(
144
145 /**
146 * @brief Return the value of the integral of the zero-th mode for this
147 * element.
148 *
149 * Note that for the orthogonal basis under consideration, all modes
150 * integrate to zero asides from the zero-th mode. This function is used in
151 * NodalUtil::GetWeights to determine integration weights.
152 */
154
155 /**
156 * @brief Calculate the number of degrees of freedom for this element.
157 */
158 virtual size_t v_NumModes() = 0;
159};
160
161/**
162 * @brief Specialisation of the NodalUtil class to support nodal triangular
163 * elements.
164 */
166{
167public:
171
175
176 // set up mapping from point ordering (vert,edge,face int) to
177 // increasing point ordering in cartesizan type format
178 LIB_UTILITIES_EXPORT static void CartesianOrdering(const int nq,
179 Array<OneD, int> &sorted)
180 {
181 sorted = Array<OneD, int>(nq * (nq + 1) / 2, -1);
182 int cnt = 0;
183 sorted[cnt++] = 0; /* vertex 0 */
184 for (int i = 0; i < nq - 2; ++i) // edge 0
185 {
186 sorted[cnt++] = 3 + i;
187 }
188 sorted[cnt++] = 1; // vertex 1
189 int cnt1 = 0;
190 for (int j = 0; j < nq - 2; ++j)
191 {
192 // edge 2 (counter-clockwise ordering)
193 sorted[cnt++] = 3 + 2 * (nq - 2) + nq - 3 - j;
194 for (int i = 0; i < nq - 3 - j; ++i) // face 0
195 {
196 sorted[cnt++] = 3 + 3 * (nq - 2) + cnt1++;
197 }
198 sorted[cnt++] = 3 + (nq - 2) + j; // edge 1
199 }
200 sorted[cnt++] = 2; /* vertex 2 */
201
202 ASSERTL1(cnt == nq * (nq + 1) / 2,
203 "No of sorted points not the same as number in expansion");
204 }
205
206protected:
207 /// Mapping from the \f$ (i,j) \f$ indexing of the basis to a continuous
208 /// ordering.
209 std::vector<std::pair<int, int>> m_ordering;
210
211 /// Collapsed coordinates \f$ (\eta_1, \eta_2) \f$ of the nodal points.
213
214 NekVector<NekDouble> v_OrthoBasis(const size_t mode) override;
216 const size_t mode) override;
217
218 std::shared_ptr<NodalUtil> v_CreateUtil(
219 Array<OneD, Array<OneD, NekDouble>> &xi) override
220 {
222 m_degree, xi[0], xi[1]);
223 }
224
226 {
227 return 2.0 * sqrt(2.0);
228 }
229
230 size_t v_NumModes() override
231 {
232 return (m_degree + 1) * (m_degree + 2) / 2;
233 }
234};
235
236/**
237 * @brief Specialisation of the NodalUtil class to support nodal tetrahedral
238 * elements.
239 */
241{
242 typedef std::tuple<int, int, int> Mode;
243
244public:
249
253
254 // set up mapping from point ordering (vert,edge,face int) to
255 // increasing point ordering in cartesizan type format
256 LIB_UTILITIES_EXPORT static void CartesianOrdering(const int nq,
257 Array<OneD, int> &sorted)
258 {
259 sorted = Array<OneD, int>(nq * (nq + 1) * (nq + 2) / 6, -1);
260 int cnt = 0;
261 sorted[cnt++] = 0; /* vertex 0 */
262 for (int i = 0; i < nq - 2; ++i) // edge 0
263 {
264 sorted[cnt++] = 4 + i;
265 }
266 sorted[cnt++] = 1; // vertex 1
267 int cnt1 = 0;
268 for (int j = 0; j < nq - 2; ++j)
269 {
270 sorted[cnt++] = 4 + 2 * (nq - 2) + nq - 3 -
271 j; // edge 2 (counter-clockwise ordering)
272 for (int i = 0; i < nq - 3 - j; ++i) // face 0
273 {
274 sorted[cnt++] = 4 + 6 * (nq - 2) + cnt1++;
275 }
276 sorted[cnt++] = 4 + (nq - 2) + j; // edge 1
277 }
278 sorted[cnt++] = 2; /* vertex 2 */
279
280 cnt1 = 0;
281 int cnt2 = 0;
282 int cnt3 = 0;
283 int cint = 0;
284 for (int k = 0; k < nq - 2; ++k)
285 {
286 sorted[cnt++] = 4 + 3 * (nq - 2) + k; // edge 3
287 for (int i = 0; i < nq - 3 - k; ++i) // face 1
288 {
289 sorted[cnt++] =
290 4 + 6 * (nq - 2) + (nq - 3) * (nq - 2) / 2 + cnt1++;
291 }
292 sorted[cnt++] = 4 + 4 * (nq - 2) + k; // edge 4
293
294 for (int j = 0; j < nq - 3 - k; ++j)
295 {
296 sorted[cnt++] = 4 + 6 * (nq - 2) + 3 * (nq - 3) * (nq - 2) / 2 +
297 cnt3++; // face 3
298 for (int i = 0; i < nq - 4 - k - j; ++i) /* int */
299 {
300 sorted[cnt++] =
301 4 + 6 * (nq - 2) + 4 * (nq - 3) * (nq - 2) / 2 + cint++;
302 }
303 sorted[cnt++] = 4 + 6 * (nq - 2) + 2 * (nq - 3) * (nq - 2) / 2 +
304 cnt2++; // face 2
305 }
306 sorted[cnt++] = 4 + 5 * (nq - 2) + k; // edge 5
307 }
308 sorted[cnt++] = 3; /* vertex 3 */
309 ASSERTL1(cnt == nq * (nq + 1) * (nq + 2) / 6,
310 "No of sorted points not the same as number in expansion");
311 }
312
313protected:
314 /// Mapping from the \f$ (i,j,k) \f$ indexing of the basis to a continuous
315 /// ordering.
316 std::vector<Mode> m_ordering;
317
318 /// Collapsed coordinates \f$ (\eta_1, \eta_2, \eta_3) \f$ of the nodal
319 /// points.
321
322 NekVector<NekDouble> v_OrthoBasis(const size_t mode) override;
324 const size_t mode) override;
325
326 std::shared_ptr<NodalUtil> v_CreateUtil(
327 Array<OneD, Array<OneD, NekDouble>> &xi) override
328 {
330 m_degree, xi[0], xi[1], xi[2]);
331 }
332
334 {
335 return 8.0 * sqrt(2.0) / 3.0;
336 }
337
338 size_t v_NumModes() override
339 {
340 return (m_degree + 1) * (m_degree + 2) * (m_degree + 3) / 6;
341 }
342};
343
344/**
345 * @brief Specialisation of the NodalUtil class to support nodal prismatic
346 * elements.
347 */
349{
350 typedef std::tuple<int, int, int> Mode;
351
352public:
356
358 {
359 }
360
361 // set up mapping from point ordering (vert,edge,face int) to
362 // increasing point ordering in cartesizan type format
363 LIB_UTILITIES_EXPORT static void CartesianOrdering(const int nq,
364 Array<OneD, int> &sorted)
365 {
366 sorted = Array<OneD, int>(nq * nq * (nq + 11) / 2, -1);
367 int cnt = 0;
368 sorted[cnt++] = 0; /* vertex 0 */
369 for (int i = 0; i < nq - 2; ++i) // edge 0
370 {
371 sorted[cnt++] = 6 + i;
372 }
373 sorted[cnt++] = 1; // vertex 1
374 int cnt1 = 0;
375 for (int j = 0; j < nq - 2; ++j)
376 {
377 sorted[cnt++] = 6 + 3 * (nq - 2) + nq - 3 -
378 j; // edge 3 (counter-clockwise ordering)
379 for (int i = 0; i < nq - 2; ++i) // face 0
380 {
381 sorted[cnt++] = 6 + 9 * (nq - 2) + cnt1++;
382 }
383 sorted[cnt++] = 6 + (nq - 2) + j; // edge 1
384 }
385 sorted[cnt++] = 3; /* vertex 3 */
386 for (int i = 0; i < nq - 2; ++i) // edge 2 (counter-clockwise ordering)
387 {
388 sorted[cnt++] = 6 + 2 * (nq - 2) + nq - 3 - i;
389 }
390 sorted[cnt++] = 2; /* vertex 2 */
391
392 cnt1 = 0;
393 int cnt2 = 0;
394 int cnt3 = 0;
395 int cnt4 = 0;
396 int cint = 0;
397 for (int k = 0; k < nq - 2; ++k)
398 {
399 sorted[cnt++] = 6 + 4 * (nq - 2) + k; // edge 4
400 for (int i = 0; i < nq - 3 - k; ++i) // face 1
401 {
402 sorted[cnt++] = 6 + 9 * (nq - 2) + (nq - 2) * (nq - 2) + cnt1++;
403 }
404 sorted[cnt++] = 6 + 5 * (nq - 2) + k; // edge 5
405
406 for (int j = 0; j < nq - 2; ++j)
407 {
408 sorted[cnt++] = 6 + 9 * (nq - 2) + 2 * (nq - 3) * (nq - 2) / 2 +
409 2 * (nq - 2) * (nq - 2) + cnt4++; // face 4
410
411 for (int i = 0; i < nq - 3 - k; ++i) /* int */
412 {
413 sorted[cnt++] = 6 + 9 * (nq - 2) +
414 2 * (nq - 3) * (nq - 2) / 2 +
415 3 * (nq - 2) * (nq - 2) + cint++;
416 }
417 sorted[cnt++] = 6 + 9 * (nq - 2) + (nq - 3) * (nq - 2) / 2 +
418 (nq - 2) * (nq - 2) + cnt2++; // face 2
419 }
420
421 sorted[cnt++] = 6 + 7 * (nq - 2) + k; // edge 7
422 for (int i = 0; i < nq - 3 - k; ++i) // face 3
423 {
424 sorted[cnt++] = 6 + 9 * (nq - 2) + (nq - 3) * (nq - 2) / 2 +
425 2 * (nq - 2) * (nq - 2) + cnt3++;
426 }
427 sorted[cnt++] = 6 + 6 * (nq - 2) + k; // edge 6
428 }
429
430 sorted[cnt++] = 4; /* vertex 4 */
431 for (int j = 0; j < nq - 2; ++j) // edge 8
432 {
433 sorted[cnt++] = 6 + 8 * (nq - 2) + j;
434 }
435 sorted[cnt++] = 5; /* vertex 5 */
436
437 ASSERTL1(cnt == nq * nq * (nq + 1) / 2,
438 "No of sorted points not the same as number in expansion");
439 }
440
441protected:
442 /// Mapping from the \f$ (i,j) \f$ indexing of the basis to a continuous
443 /// ordering.
444 std::vector<Mode> m_ordering;
445
446 /// Collapsed coordinates \f$ (\eta_1, \eta_2, \eta_3) \f$ of the nodal
447 /// points.
449
450 NekVector<NekDouble> v_OrthoBasis(const size_t mode) override;
452 const size_t mode) override;
453
454 std::shared_ptr<NodalUtil> v_CreateUtil(
455 Array<OneD, Array<OneD, NekDouble>> &xi) override
456 {
458 xi[1], xi[2]);
459 }
460
462 {
463 return 4.0 * sqrt(2.0);
464 }
465
466 size_t v_NumModes() override
467 {
468 return (m_degree + 1) * (m_degree + 1) * (m_degree + 2) / 2;
469 }
470};
471
472/**
473 * @brief Specialisation of the NodalUtil class to support nodal quad elements.
474 */
476{
477public:
480
482 {
483 }
484
485protected:
486 /// Mapping from the \f$ (i,j) \f$ indexing of the basis to a continuous
487 /// ordering.
488 std::vector<std::pair<int, int>> m_ordering;
489
490 NekVector<NekDouble> v_OrthoBasis(const size_t mode) override;
492 const size_t mode) override;
493
494 std::shared_ptr<NodalUtil> v_CreateUtil(
495 Array<OneD, Array<OneD, NekDouble>> &xi) override
496 {
498 xi[1]);
499 }
500
502 {
503 return 4.0;
504 }
505
506 size_t v_NumModes() override
507 {
508 return (m_degree + 1) * (m_degree + 1);
509 }
510};
511
512/**
513 * @brief Specialisation of the NodalUtil class to support nodal hex elements.
514 */
516{
517 typedef std::tuple<int, int, int> Mode;
518
519public:
523
525 {
526 }
527
528protected:
529 /// Mapping from the \f$ (i,j,k) \f$ indexing of the basis to a continuous
530 /// ordering.
531 std::vector<Mode> m_ordering;
532
533 NekVector<NekDouble> v_OrthoBasis(const size_t mode) override;
535 const size_t mode) override;
536
537 std::shared_ptr<NodalUtil> v_CreateUtil(
538 Array<OneD, Array<OneD, NekDouble>> &xi) override
539 {
541 xi[1], xi[2]);
542 }
543
545 {
546 return 8.0;
547 }
548
549 size_t v_NumModes() override
550 {
551 return (m_degree + 1) * (m_degree + 1) * (m_degree + 1);
552 }
553};
554
555} // namespace Nektar::LibUtilities
556
557#endif // NODALUTIL_H
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define LIB_UTILITIES_EXPORT
Specialisation of the NodalUtil class to support nodal hex elements.
Definition NodalUtil.h:516
size_t v_NumModes() override
Calculate the number of degrees of freedom for this element.
Definition NodalUtil.h:549
NekVector< NekDouble > v_OrthoBasis(const size_t mode) override
Return the value of the modal functions for the hex element at the nodal points m_xi for a given mode...
NekDouble v_ModeZeroIntegral() override
Return the value of the integral of the zero-th mode for this element.
Definition NodalUtil.h:544
NekVector< NekDouble > v_OrthoBasisDeriv(const size_t dir, const size_t mode) override
Return the values of the derivative of the orthogonal basis at the nodal points for a given mode.
std::vector< Mode > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
Definition NodalUtil.h:531
std::shared_ptr< NodalUtil > v_CreateUtil(Array< OneD, Array< OneD, NekDouble > > &xi) override
Construct a NodalUtil object of the appropriate element type for a given set of points.
Definition NodalUtil.h:537
std::tuple< int, int, int > Mode
Definition NodalUtil.h:517
A class to assist in the construction of nodal simplex and hybrid elements in two and three dimension...
Definition NodalUtil.h:78
size_t m_dim
Dimension of the nodal element.
Definition NodalUtil.h:101
SharedMatrix GetDerivMatrix(size_t dir)
Return the derivative matrix for the nodal distribution.
virtual std::shared_ptr< NodalUtil > v_CreateUtil(Array< OneD, Array< OneD, NekDouble > > &xi)=0
Construct a NodalUtil object of the appropriate element type for a given set of points.
Array< OneD, Array< OneD, NekDouble > > m_xi
Coordinates of the nodal points defining the basis.
Definition NodalUtil.h:107
NekVector< NekDouble > GetWeights()
Obtain the integration weights for the given nodal distribution.
Definition NodalUtil.cpp:61
SharedMatrix GetVandermonde()
Return the Vandermonde matrix for the nodal distribution.
Definition NodalUtil.cpp:97
virtual NekVector< NekDouble > v_OrthoBasisDeriv(const size_t dir, const size_t mode)=0
Return the values of the derivative of the orthogonal basis at the nodal points for a given mode.
size_t m_degree
Degree of the nodal element.
Definition NodalUtil.h:103
size_t m_numPoints
Total number of nodal points.
Definition NodalUtil.h:105
SharedMatrix GetVandermondeForDeriv(size_t dir)
Return the Vandermonde matrix of the derivative of the basis functions for the nodal distribution.
virtual NekDouble v_ModeZeroIntegral()=0
Return the value of the integral of the zero-th mode for this element.
virtual NekVector< NekDouble > v_OrthoBasis(const size_t mode)=0
Return the values of the orthogonal basis at the nodal points for a given mode.
virtual size_t v_NumModes()=0
Calculate the number of degrees of freedom for this element.
SharedMatrix GetInterpolationMatrix(Array< OneD, Array< OneD, NekDouble > > &xi)
Construct the interpolation matrix used to evaluate the basis at the points xi inside the element.
NodalUtil(size_t degree, size_t dim)
Set up the NodalUtil object.
Definition NodalUtil.h:95
Specialisation of the NodalUtil class to support nodal prismatic elements.
Definition NodalUtil.h:349
std::shared_ptr< NodalUtil > v_CreateUtil(Array< OneD, Array< OneD, NekDouble > > &xi) override
Construct a NodalUtil object of the appropriate element type for a given set of points.
Definition NodalUtil.h:454
NekVector< NekDouble > v_OrthoBasisDeriv(const size_t dir, const size_t mode) override
Return the value of the derivative of the modal functions for the prismatic element at the nodal poin...
static void CartesianOrdering(const int nq, Array< OneD, int > &sorted)
Definition NodalUtil.h:363
Array< OneD, Array< OneD, NekDouble > > m_eta
Collapsed coordinates of the nodal points.
Definition NodalUtil.h:448
std::vector< Mode > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
Definition NodalUtil.h:444
NekVector< NekDouble > v_OrthoBasis(const size_t mode) override
Return the value of the modal functions for the prismatic element at the nodal points m_xi for a give...
size_t v_NumModes() override
Calculate the number of degrees of freedom for this element.
Definition NodalUtil.h:466
std::tuple< int, int, int > Mode
Definition NodalUtil.h:350
NekDouble v_ModeZeroIntegral() override
Return the value of the integral of the zero-th mode for this element.
Definition NodalUtil.h:461
Specialisation of the NodalUtil class to support nodal quad elements.
Definition NodalUtil.h:476
std::shared_ptr< NodalUtil > v_CreateUtil(Array< OneD, Array< OneD, NekDouble > > &xi) override
Construct a NodalUtil object of the appropriate element type for a given set of points.
Definition NodalUtil.h:494
NekDouble v_ModeZeroIntegral() override
Return the value of the integral of the zero-th mode for this element.
Definition NodalUtil.h:501
std::vector< std::pair< int, int > > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
Definition NodalUtil.h:488
size_t v_NumModes() override
Calculate the number of degrees of freedom for this element.
Definition NodalUtil.h:506
NekVector< NekDouble > v_OrthoBasis(const size_t mode) override
Return the value of the modal functions for the quad element at the nodal points m_xi for a given mod...
NekVector< NekDouble > v_OrthoBasisDeriv(const size_t dir, const size_t mode) override
Return the value of the derivative of the modal functions for the quadrilateral element at the nodal ...
Specialisation of the NodalUtil class to support nodal tetrahedral elements.
Definition NodalUtil.h:241
NekDouble v_ModeZeroIntegral() override
Return the value of the integral of the zero-th mode for this element.
Definition NodalUtil.h:333
std::tuple< int, int, int > Mode
Definition NodalUtil.h:242
NekVector< NekDouble > v_OrthoBasis(const size_t mode) override
Return the value of the modal functions for the tetrahedral element at the nodal points m_xi for a gi...
Array< OneD, Array< OneD, NekDouble > > m_eta
Collapsed coordinates of the nodal points.
Definition NodalUtil.h:320
std::shared_ptr< NodalUtil > v_CreateUtil(Array< OneD, Array< OneD, NekDouble > > &xi) override
Construct a NodalUtil object of the appropriate element type for a given set of points.
Definition NodalUtil.h:326
size_t v_NumModes() override
Calculate the number of degrees of freedom for this element.
Definition NodalUtil.h:338
NekVector< NekDouble > v_OrthoBasisDeriv(const size_t dir, const size_t mode) override
Return the value of the derivative of the modal functions for the tetrahedral element at the nodal po...
std::vector< Mode > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
Definition NodalUtil.h:316
static void CartesianOrdering(const int nq, Array< OneD, int > &sorted)
Definition NodalUtil.h:256
Specialisation of the NodalUtil class to support nodal triangular elements.
Definition NodalUtil.h:166
NekVector< NekDouble > v_OrthoBasisDeriv(const size_t dir, const size_t mode) override
Return the value of the derivative of the modal functions for the triangular element at the nodal poi...
std::vector< std::pair< int, int > > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
Definition NodalUtil.h:209
NekDouble v_ModeZeroIntegral() override
Return the value of the integral of the zero-th mode for this element.
Definition NodalUtil.h:225
static void CartesianOrdering(const int nq, Array< OneD, int > &sorted)
Definition NodalUtil.h:178
size_t v_NumModes() override
Calculate the number of degrees of freedom for this element.
Definition NodalUtil.h:230
std::shared_ptr< NodalUtil > v_CreateUtil(Array< OneD, Array< OneD, NekDouble > > &xi) override
Construct a NodalUtil object of the appropriate element type for a given set of points.
Definition NodalUtil.h:218
Array< OneD, Array< OneD, NekDouble > > m_eta
Collapsed coordinates of the nodal points.
Definition NodalUtil.h:212
NekVector< NekDouble > v_OrthoBasis(const size_t mode) override
Return the value of the modal functions for the triangular element at the nodal points m_xi for a giv...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< NekMatrix< NekDouble > > SharedMatrix
Definition NodalUtil.h:49
scalarT< T > sqrt(scalarT< T > in)
Definition scalar.hpp:290