Nektar++
Loading...
Searching...
No Matches
StdExpansion.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: StdExpansion.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: Class definition StdExpansion which is the base class
32// to all expansion shapes
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#ifndef NEKTAR_LIB_STDREGIONS_STANDARDEXPANSION_H
37#define NEKTAR_LIB_STDREGIONS_STANDARDEXPANSION_H
38
39#include <fstream>
40#include <memory>
41#include <vector>
42
43#include <set>
44
50{
51class MatrixKey;
52class Expansion;
53} // namespace Nektar::LocalRegions
54
55namespace Nektar::StdRegions
56{
57
58/** \brief The base class for all shapes
59 *
60 * This is the lowest level basic class for all shapes and so
61 * contains the definition of common data and common routine to all
62 * elements
63 */
64class StdExpansion : public std::enable_shared_from_this<StdExpansion>
65{
66public:
67 /** \brief Default Constructor */
69
70 /** \brief Constructor */
72 const int numcoeffs, const int numbases,
76
77 /** \brief Copy Constructor */
79
80 /** \brief Destructor */
82
83 // Standard Expansion Routines Applicable Regardless of Region
84
85 /** \brief This function returns the number of 1D bases used in
86 * the expansion
87 *
88 * \return returns the number of 1D bases used in the expansion,
89 * which is equal to number dimension of the expansion
90 */
91 inline int GetNumBases() const
92 {
93 return m_base.size();
94 }
95
96 /** \brief This function gets the shared point to basis
97 *
98 * \return returns the shared pointer to the bases
99 */
101 const
102 {
103 return (m_base);
104 }
105
106 /** \brief This function gets the shared point to basis in
107 * the \a dir direction
108 *
109 * \return returns the shared pointer to the basis in
110 * directin \a dir
111 */
112 inline const LibUtilities::BasisSharedPtr &GetBasis(int dir) const
113 {
114 ASSERTL1(dir < m_base.size(), "dir is larger than number of bases");
115 return (m_base[dir]);
116 }
117
118 /** \brief This function returns the total number of coefficients
119 * used in the expansion
120 *
121 * \return returns the total number of coefficients (which is
122 * equivalent to the total number of modes) used in the expansion
123 */
124 inline int GetNcoeffs(void) const
125 {
126 return (m_ncoeffs);
127 }
128
129 /** \brief This function returns the total number of quadrature
130 * points used in the element
131 *
132 * \return returns the total number of quadrature points
133 */
134 inline int GetTotPoints() const
135 {
136 int nqtot = 1;
137
138 for (size_t i = 0; i < m_base.size(); ++i)
139 {
140 nqtot *= m_base[i]->GetNumPoints();
141 }
142
143 return nqtot;
144 }
145
146 /** \brief This function returns the type of basis used in the \a dir
147 * direction
148 *
149 * The different types of bases implemented in the code are defined
150 * in the LibUtilities::BasisType enumeration list. As a result, the
151 * function will return one of the types of this enumeration list.
152 *
153 * \param dir the direction
154 * \return returns the type of basis used in the \a dir direction
155 */
156 inline LibUtilities::BasisType GetBasisType(const int dir) const
157 {
158 ASSERTL1(dir < m_base.size(), "dir is larger than m_numbases");
159 return (m_base[dir]->GetBasisType());
160 }
161
162 /** \brief This function returns the number of expansion modes
163 * in the \a dir direction
164 *
165 * \param dir the direction
166 * \return returns the number of expansion modes in the \a dir
167 * direction
168 */
169 inline int GetBasisNumModes(const int dir) const
170 {
171 ASSERTL1(dir < m_base.size(), "dir is larger than m_numbases");
172 return (m_base[dir]->GetNumModes());
173 }
174
175 /** \brief This function returns the maximum number of
176 * expansion modes over all local directions
177 *
178 * \return returns the maximum number of expansion modes
179 * over all local directions
180 */
181 inline int EvalBasisNumModesMax(void) const
182 {
183 int returnval = 0;
184
185 for (size_t i = 0; i < m_base.size(); ++i)
186 {
187 returnval = std::max(returnval, m_base[i]->GetNumModes());
188 }
189
190 return returnval;
191 }
192
193 /** \brief This function returns the type of quadrature points used
194 * in the \a dir direction
195 *
196 * The different types of quadrature points implemented in the code
197 * are defined in the LibUtilities::PointsType enumeration list.
198 * As a result, the function will return one of the types of this
199 * enumeration list.
200 *
201 * \param dir the direction
202 * \return returns the type of quadrature points used in the \a dir
203 * direction
204 */
205 inline LibUtilities::PointsType GetPointsType(const int dir) const
206 {
207 ASSERTL1(dir < m_base.size(), "dir is larger than m_numbases");
208 return (m_base[dir]->GetPointsType());
209 }
210
211 /** \brief This function returns the number of quadrature points
212 * in the \a dir direction
213 *
214 * \param dir the direction
215 * \return returns the number of quadrature points in the \a dir
216 * direction
217 */
218 inline int GetNumPoints(const int dir) const
219 {
220 ASSERTL1(dir < m_base.size() || dir == 0,
221 "dir is larger than m_numbases");
222 return (m_base.size() > 0 ? m_base[dir]->GetNumPoints() : 1);
223 }
224
225 /** \brief This function returns a pointer to the array containing
226 * the quadrature points in \a dir direction
227 *
228 * \param dir the direction
229 * \return returns a pointer to the array containing
230 * the quadrature points in \a dir direction
231 */
232 inline const Array<OneD, const NekDouble> &GetPoints(const int dir) const
233 {
234 return m_base[dir]->GetZ();
235 }
236
237 // Wrappers around virtual Functions
238 /** \brief This function returns the number of vertices of the
239 * expansion domain
240 *
241 * This function is a wrapper around the virtual function
242 * \a v_GetNverts()
243 *
244 * \return returns the number of vertices of the expansion domain
245 */
246 int GetNverts() const
247 {
248 return v_GetNverts();
249 }
250
251 /** \brief This function returns the number of expansion coefficients
252 * belonging to the \a i-th trace
253 *
254 * This function is a wrapper around the virtual function
255 * \a v_GetTraceNcoeffs()
256 *
257 * \param i specifies which trace
258 * \return returns the number of expansion coefficients belonging to
259 * the \a i-th trace
260 */
261 int GetTraceNcoeffs(const int i) const
262 {
263 return v_GetTraceNcoeffs(i);
264 }
265
266 int GetTraceIntNcoeffs(const int i) const
267 {
268 return v_GetTraceIntNcoeffs(i);
269 }
270
271 /** \brief This function returns the number of quadrature points
272 * belonging to the \a i-th trace
273 *
274 * This function is a wrapper around the virtual function
275 * \a v_GetTraceNumPoints()
276 *
277 * \param i specifies which trace id
278 * \return returns the number of quadrature points belonging to
279 * the \a i-th trace
280 */
281 int GetTraceNumPoints(const int i) const
282 {
283 return v_GetTraceNumPoints(i);
284 }
285
286 /** \brief This function returns the basis key belonging
287 * to the \a i-th trace
288 *
289 * This function is a wrapper around the virtual function
290 * \a v_GetTraceBasisKey()
291 *
292 * \param i specifies which trace id
293 * \param k is the direction of the basis key for 2D traces
294 * \param UseGll use GLL quadrature points in Trace Expansion (defaulted to
295 * false)
296 *
297 * \return returns the number of Basis key of the ith
298 * trace in the k th direction (when trace is a 2D
299 * object)
300 */
301 const LibUtilities::BasisKey GetTraceBasisKey(const int i, int k = -1,
302 bool UseGLL = false) const
303 {
304 return v_GetTraceBasisKey(i, k, UseGLL);
305 }
306
307 /** \brief This function returns the basis key belonging
308 * to the \a i-th trace
309 *
310 * This function is a wrapper around the virtual function
311 * \a v_GetTracePointsKey()
312 *
313 * \param i specifies which trace id
314 * \param k is the direction of the basis key for 2D traces
315 *
316 * \return returns the number of Points key of the ith
317 * trace in the k th direction (when trace is a 2D
318 * object)
319 */
320 LibUtilities::PointsKey GetTracePointsKey(const int i, int k = -1) const
321 {
322 return v_GetTracePointsKey(i, k);
323 }
324
325 int NumBndryCoeffs(void) const
326 {
327 return v_NumBndryCoeffs();
328 }
329
330 int NumDGBndryCoeffs(void) const
331 {
332 return v_NumDGBndryCoeffs();
333 }
334
335 /** \brief This function returns the type of expansion
336 * Nodal point type if defined
337 *
338 * This function is a wrapper around the virtual function
339 * \a v_GetNodalPointsKey()
340 *
341 */
343 {
344 return v_GetNodalPointsKey();
345 };
346
347 /**
348 * @brief Returns the number of trace elements connected to this
349 * element.
350 *
351 * For example, a quadrilateral has four edges, so this function
352 * would return 4.
353 */
354 int GetNtraces() const
355 {
356 return v_GetNtraces();
357 }
358
359 /** \brief This function returns the shape of the expansion domain
360 *
361 * This function is a wrapper around the virtual function
362 * \a v_DetShapeType()
363 *
364 * The different shape types implemented in the code are defined
365 * in the ::ShapeType enumeration list. As a result, the
366 * function will return one of the types of this enumeration list.
367 *
368 * \return returns the shape of the expansion domain
369 */
371 {
372 return v_DetShapeType();
373 }
374
375 std::shared_ptr<StdExpansion> GetStdExp() const
376 {
377 return v_GetStdExp();
378 }
379
380 std::shared_ptr<StdExpansion> GetLinStdExp(void) const
381 {
382 return v_GetLinStdExp();
383 }
384
386 {
387 return v_GetShapeDimension();
388 }
389
391 {
393 }
394
396 {
398 }
399
401 Array<OneD, NekDouble> &outarray)
402 {
403 v_NodalToModal(inarray, outarray);
404 }
405
406 /** \brief This function performs the Backward transformation from
407 * coefficient space to physical space
408 *
409 * This function is a wrapper around the virtual function
410 * \a v_BwdTrans()
411 *
412 * Based on the expansion coefficients, this function evaluates the
413 * expansion at the quadrature points. This is equivalent to the
414 * operation \f[ u(\xi_{1i}) =
415 * \sum_{p=0}^{P-1} \hat{u}_p \phi_p(\xi_{1i}) \f] which can be
416 * evaluated as \f$ {\bf u} = {\bf B}^T {\bf \hat{u}} \f$ with
417 * \f${\bf B}[i][j] = \phi_i(\xi_{j})\f$
418 *
419 * This function requires that the coefficient array
420 * \f$\mathbf{\hat{u}}\f$ provided as \a inarray.
421 *
422 * The resulting array
423 * \f$\mathbf{u}[m]=u(\mathbf{\xi}_m)\f$ containing the
424 * expansion evaluated at the quadrature points, is stored
425 * in the \a outarray.
426 *
427 * \param inarray contains the values of the expansion
428 * coefficients (input of the function)
429 *
430 * \param outarray contains the values of the expansion evaluated
431 * at the quadrature points (output of the function)
432 */
434 Array<OneD, NekDouble> &outarray)
435 {
436 v_BwdTrans(inarray, outarray);
437 }
438
439 /**
440 * @brief This function performs the Forward transformation from
441 * physical space to coefficient space.
442 */
443 inline void FwdTrans(const Array<OneD, const NekDouble> &inarray,
444 Array<OneD, NekDouble> &outarray);
445
447 Array<OneD, NekDouble> &outarray)
448 {
449 v_FwdTransBndConstrained(inarray, outarray);
450 }
451
452 /** \brief This function integrates the specified function over the
453 * domain
454 *
455 * This function is a wrapper around the virtual function
456 * \a v_Integral()
457 *
458 * Based on the values of the function evaluated at the quadrature
459 * points (which are stored in \a inarray), this function calculates
460 * the integral of this function over the domain. This is
461 * equivalent to the numerical evaluation of the operation
462 * \f[ I=\int u(\mathbf{\xi})d \mathbf{\xi}\f]
463 *
464 * \param inarray values of the function to be integrated evaluated
465 * at the quadrature points (i.e.
466 * \a inarray[m]=\f$u(\mathbf{\xi}_m)\f$)
467 * \return returns the value of the calculated integral
468 *
469 * Inputs:\n
470
471 - \a inarray: definition of function to be returned at quadrature point
472 of expansion.
473
474 Outputs:\n
475
476 - returns \f$\int^1_{-1}\int^1_{-1} u(\xi_1, \xi_2) J[i,j] d
477 \xi_1 d \xi_2 \f$ where \f$inarray[i,j] =
478 u(\xi_{1i},\xi_{2j}) \f$ and \f$ J[i,j] \f$ is the
479 Jacobian evaluated at the quadrature point.
480 *
481 */
483 {
484 return v_Integral(inarray);
485 }
486
487 /** \brief This function fills the array \a outarray with the
488 * \a mode-th mode of the expansion
489 *
490 * This function is a wrapper around the virtual function
491 * \a v_FillMode()
492 *
493 * The requested mode is evaluated at the quadrature points
494 *
495 * \param mode the mode that should be filled
496 * \param outarray contains the values of the \a mode-th mode of the
497 * expansion evaluated at the quadrature points (output of the
498 * function)
499 */
500 void FillMode(const int mode, Array<OneD, NekDouble> &outarray)
501 {
502 v_FillMode(mode, outarray);
503 }
504
505 /** \brief this function calculates the inner product of a given
506 * function \a f with the different modes of the expansion
507 *
508 * This function is a wrapper around the virtual function
509 * \a v_IProductWRTBase()
510 *
511 * This is equivalent to the numerical evaluation of
512 * \f[ I[p] = \int \phi_p(\mathbf{x}) f(\mathbf{x}) d\mathbf{x}\f]
513 * \f$ \begin{array}{rcl} I_{pq} = (\phi_q \phi_q, u) & = &
514 \sum_{i=0}^{nq_0} \sum_{j=0}^{nq_1} \phi_p(\xi_{0,i})
515 \phi_q(\xi_{1,j}) w^0_i w^1_j u(\xi_{0,i} \xi_{1,j})
516 J_{i,j}\\ & = & \sum_{i=0}^{nq_0} \phi_p(\xi_{0,i})
517 \sum_{j=0}^{nq_1} \phi_q(\xi_{1,j}) \tilde{u}_{i,j}
518 J_{i,j} \end{array} \f$
519
520 where
521
522 \f$ \tilde{u}_{i,j} = w^0_i w^1_j u(\xi_{0,i},\xi_{1,j}) \f$
523
524 which can be implemented as
525
526 \f$ f_{qi} = \sum_{j=0}^{nq_1} \phi_q(\xi_{1,j}) \tilde{u}_{i,j} =
527 {\bf B_1 U} \f$
528 \f$ I_{pq} = \sum_{i=0}^{nq_0} \phi_p(\xi_{0,i}) f_{qi} =
529 {\bf B_0 F} \f$
530 *
531 * \param inarray contains the values of the function \a f
532 * evaluated at the quadrature points
533 * \param outarray contains the values of the inner product of \a f
534 * with the different modes, i.e. \f$ outarray[p] = I[p]\f$
535 * (output of the function)
536 */
538 Array<OneD, NekDouble> &outarray)
539 {
540 v_IProductWRTBase(inarray, outarray);
541 }
542
544 const Array<OneD, const NekDouble> &inarray,
545 Array<OneD, NekDouble> &outarray, int coll_check)
546 {
547 v_IProductWRTBase(base, inarray, outarray, coll_check);
548 }
549
550 void IProductWRTDerivBase(const int dir,
551 const Array<OneD, const NekDouble> &inarray,
552 Array<OneD, NekDouble> &outarray)
553 {
554 v_IProductWRTDerivBase(dir, inarray, outarray);
555 }
556
558 const Array<OneD, const NekDouble> &direction,
559 const Array<OneD, const NekDouble> &inarray,
560 Array<OneD, NekDouble> &outarray)
561 {
562 v_IProductWRTDirectionalDerivBase(direction, inarray, outarray);
563 }
564
565 /// \brief Get the element id of this expansion when used
566 /// in a list by returning value of #m_elmt_id
567 inline int GetElmtId()
568 {
569 return m_elmt_id;
570 }
571
572 /// \brief Set the element id of this expansion when used
573 /// in a list by returning value of #m_elmt_id
574 inline void SetElmtId(const int id)
575 {
576 m_elmt_id = id;
577 }
578
579 /** \brief this function returns the physical coordinates of the
580 * quadrature points of the expansion
581 *
582 * This function is a wrapper around the virtual function
583 * \a v_GetCoords()
584 *
585 * \param coords an array containing the coordinates of the
586 * quadrature points (output of the function)
587 */
591 {
592 v_GetCoords(coords_1, coords_2, coords_3);
593 }
594
595 /** \brief given the coordinates of a point of the element in the
596 * local collapsed coordinate system, this function calculates the
597 * physical coordinates of the point
598 *
599 * This function is a wrapper around the virtual function
600 * \a v_GetCoord()
601 *
602 * \param Lcoords the coordinates in the local collapsed
603 * coordinate system
604 * \param coords the physical coordinates (output of the function)
605 */
608 {
609 v_GetCoord(Lcoord, coord);
610 }
611
613 {
614 return m_stdMatrixManager[mkey];
615 }
616
621
627
629 const Array<OneD, NekDouble> &Fy,
630 Array<OneD, NekDouble> &outarray)
631 {
632 v_NormVectorIProductWRTBase(Fx, Fy, outarray);
633 }
634
642
644 const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
645 Array<OneD, NekDouble> &outarray)
646 {
647 v_NormVectorIProductWRTBase(Fvec, outarray);
648 }
649
655
661
662 int CalcNumberOfCoefficients(const std::vector<unsigned int> &nummodes,
663 int &modes_offset)
664 {
665 return v_CalcNumberOfCoefficients(nummodes, modes_offset);
666 }
667
668 // virtual functions related to LocalRegions
671 const Array<OneD, const NekDouble> &physvals);
672
674 {
675 return v_GetCoordim();
676 }
677
679 {
680 v_GetBoundaryMap(outarray);
681 }
682
684 {
685 v_GetInteriorMap(outarray);
686 }
687
688 int GetVertexMap(const int localVertexId, bool useCoeffPacking = false)
689 {
690 return v_GetVertexMap(localVertexId, useCoeffPacking);
691 }
692
693 void GetTraceToElementMap(const int tid,
695 Array<OneD, int> &signarray,
696 Orientation traceOrient = eForwards, int P = -1,
697 int Q = -1)
698 {
699 v_GetTraceToElementMap(tid, maparray, signarray, traceOrient, P, Q);
700 }
701
702 void GetTraceCoeffMap(const unsigned int traceid,
704 {
705 v_GetTraceCoeffMap(traceid, maparray);
706 }
707
708 void GetElmtTraceToTraceMap(const unsigned int tid,
710 Array<OneD, int> &signarray,
711 Orientation traceOrient = eForwards, int P = -1,
712 int Q = -1)
713 {
714 v_GetElmtTraceToTraceMap(tid, maparray, signarray, traceOrient, P, Q);
715 }
716
719 Array<OneD, int> &signarray,
720 const Orientation traceOrient = eForwards)
721 {
722 v_GetTraceInteriorToElementMap(tid, maparray, signarray, traceOrient);
723 }
724
726 const int tid, int &numModes0, int &numModes1,
727 const Orientation traceOrient = eDir1FwdDir1_Dir2FwdDir2)
728 {
729 v_GetTraceNumModes(tid, numModes0, numModes1, traceOrient);
730 }
731
733 Array<OneD, NekDouble> &outarray)
734 {
735 v_MultiplyByQuadratureMetric(inarray, outarray);
736 }
737
739 const Array<OneD, const NekDouble> &inarray,
740 Array<OneD, NekDouble> &outarray)
741 {
742 v_MultiplyByStdQuadratureMetric(inarray, outarray);
743 }
744
745 // Matrix Routines
746
747 /** \brief this function generates the mass matrix
748 * \f$\mathbf{M}[i][j] =
749 * \int \phi_i(\mathbf{x}) \phi_j(\mathbf{x}) d\mathbf{x}\f$
750 *
751 * \return returns the mass matrix
752 */
753
756
758 const Array<OneD, const NekDouble> &inarray,
759 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
760
762 Array<OneD, NekDouble> &outarray,
763 const StdMatrixKey &mkey)
764 {
765 v_MassMatrixOp(inarray, outarray, mkey);
766 }
767
769 Array<OneD, NekDouble> &outarray,
770 const StdMatrixKey &mkey)
771 {
772 v_LaplacianMatrixOp(inarray, outarray, mkey);
773 }
774
775 void ReduceOrderCoeffs(int numMin,
776 const Array<OneD, const NekDouble> &inarray,
777 Array<OneD, NekDouble> &outarray)
778 {
779 v_ReduceOrderCoeffs(numMin, inarray, outarray);
780 }
781
783 const StdMatrixKey &mkey)
784 {
785 v_SVVLaplacianFilter(array, mkey);
786 }
787
789 const NekDouble exponent, const NekDouble cutoff)
790 {
791 v_ExponentialFilter(array, alpha, exponent, cutoff);
792 }
793
794 void LaplacianMatrixOp(const int k1, const int k2,
795 const Array<OneD, const NekDouble> &inarray,
796 Array<OneD, NekDouble> &outarray,
797 const StdMatrixKey &mkey)
798 {
799 v_LaplacianMatrixOp(k1, k2, inarray, outarray, mkey);
800 }
801
802 void WeakDerivMatrixOp(const int i,
803 const Array<OneD, const NekDouble> &inarray,
804 Array<OneD, NekDouble> &outarray,
805 const StdMatrixKey &mkey)
806 {
807 v_WeakDerivMatrixOp(i, inarray, outarray, mkey);
808 }
809
811 const Array<OneD, const NekDouble> &inarray,
812 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey)
813 {
814 v_WeakDirectionalDerivMatrixOp(inarray, outarray, mkey);
815 }
816
818 Array<OneD, NekDouble> &outarray,
819 const StdMatrixKey &mkey)
820 {
821 v_MassLevelCurvatureMatrixOp(inarray, outarray, mkey);
822 }
823
825 Array<OneD, NekDouble> &outarray,
826 const StdMatrixKey &mkey)
827 {
828 v_LinearAdvectionMatrixOp(inarray, outarray, mkey);
829 }
830
832 const Array<OneD, const NekDouble> &inarray,
833 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey,
834 bool addDiffusionTerm = true)
835 {
836 v_LinearAdvectionDiffusionReactionMatrixOp(inarray, outarray, mkey,
837 addDiffusionTerm);
838 }
839
840 /**
841 * @param inarray Input array @f$ \mathbf{u} @f$.
842 * @param outarray Output array @f$ \boldsymbol{\nabla^2u}
843 * + \lambda \boldsymbol{u} @f$.
844 * @param mkey
845 */
847 Array<OneD, NekDouble> &outarray,
848 const StdMatrixKey &mkey)
849 {
850 v_HelmholtzMatrixOp(inarray, outarray, mkey);
851 }
852
854 {
855 return v_GenMatrix(mkey);
856 }
857
862 {
863 v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
864 }
865
866 void PhysDeriv(const int dir, const Array<OneD, const NekDouble> &inarray,
867 Array<OneD, NekDouble> &outarray)
868 {
869 v_PhysDeriv(dir, inarray, outarray);
870 }
871
874 {
875 v_PhysDeriv_s(inarray, out_ds);
876 }
877
880 {
881 v_PhysDeriv_n(inarray, out_dn);
882 }
883
885 const Array<OneD, const NekDouble> &direction,
886 Array<OneD, NekDouble> &outarray)
887 {
888 v_PhysDirectionalDeriv(inarray, direction, outarray);
889 }
890
895 {
896 v_StdPhysDeriv(inarray, out_d0, out_d1, out_d2);
897 }
898
899 /** \brief This function evaluates the expansion at a single
900 * (arbitrary) point of the domain
901 *
902 * This function is a wrapper around the virtual function
903 * \a v_PhysEvaluate()
904 *
905 * Based on the value of the expansion at the quadrature
906 * points provided in \a physvals, this function
907 * calculates the value of the expansion at an arbitrary
908 * single points (with coordinates \f$ \mathbf{x_c}\f$
909 * given by the pointer \a coords). This operation,
910 * equivalent to \f[ u(\mathbf{x_c}) = \sum_p
911 * \phi_p(\mathbf{x_c}) \hat{u}_p \f] is evaluated using
912 * Lagrangian interpolants through the quadrature points:
913 * \f[ u(\mathbf{x_c}) = \sum_p h_p(\mathbf{x_c}) u_p\f]
914 *
915 * \param coords the coordinates of the single point
916 * \param physvals the interpolated field at the quadrature points
917 *
918 * \return returns the value of the expansion at the
919 * single point
920 */
922 const Array<OneD, const NekDouble> &physvals)
923 {
924 return v_PhysEvaluate(coords, physvals);
925 }
926
927 /** \brief This function evaluates the first derivative of the expansion
928 * at a single (arbitrary) point of the domain
929 *
930 * This function is a wrapper around the virtual function
931 * \a v_PhysEvaluate()
932
933 * Based on the value of the expansion at the quadrature
934 * points provided in \a physvals, this function
935 * calculates the value of the expansion at a set of points
936 * given in \a coords
937 */
939 const Array<OneD, const NekDouble> &inarray,
940 std::array<NekDouble, 3> &firstOrderDerivs)
941
942 {
943 return v_PhysEvalFirstDeriv(coord, inarray, firstOrderDerivs);
944 }
945
947 const Array<OneD, const NekDouble> &inarray,
948 std::array<NekDouble, 3> &firstOrderDerivs,
949 std::array<NekDouble, 6> &secondOrderDerivs)
950
951 {
952 return v_PhysEvalFirstSecondDeriv(coord, inarray, firstOrderDerivs,
953 secondOrderDerivs);
954 }
955
956 /** \brief This function evaluates the expansion at a single
957 * (arbitrary) point of the domain
958 *
959 * This function is a wrapper around the virtual function
960 * \a v_PhysEvaluate()
961 *
962 * Based on the value of the expansion at the quadrature
963 * points provided in \a physvals, this function
964 * calculates the value of the expansion at an arbitrary
965 * single points associated with the interpolation
966 * matrices provided in \f$ I \f$.
967 *
968 * \param I an Array of lagrange interpolantes evaluated
969 * at the coordinate and going through the local physical
970 * quadrature
971 * \param physvals the interpolated field at the quadrature points
972 *
973 * \return returns the value of the expansion at the
974 * single point
975 */
977 const Array<OneD, const NekDouble> &physvals)
978 {
979 return v_PhysEvaluateInterp(I, physvals);
980 }
981
982 /**
983 * @brief This function evaluates the basis function mode @p mode at a
984 * point @p coords of the domain.
985 *
986 * This function uses barycentric interpolation with the tensor
987 * product separation of the basis function to improve performance.
988 *
989 * @param coord The coordinate inside the standard region.
990 * @param mode The mode number to be evaluated.
991 *
992 * @return The value of the basis function @p mode at @p coords.
993 */
995 int mode)
996 {
997 return v_PhysEvaluateBasis(coords, mode);
998 }
999
1000 /**
1001 * \brief Convert local cartesian coordinate \a xi into local
1002 * collapsed coordinates \a eta
1003 **/
1009
1010 /**
1011 * \brief Convert local collapsed coordinates \a eta into local
1012 * cartesian coordinate \a xi
1013 **/
1019
1020 /** \brief interpolate from one set of quadrature points available from
1021 * FromExp to the set of quadrature points in the current expansion. If the
1022 * points are the same this routine will just copy the data
1023 **/
1024 void PhysInterp(std::shared_ptr<StdExpansion> fromExp,
1025 const Array<OneD, const NekDouble> &fromData,
1026 Array<OneD, NekDouble> &toData)
1027 {
1028 v_PhysInterp(fromExp, fromData, toData);
1029 }
1030
1032 const std::vector<unsigned int> &nummodes, int &modes_offset);
1033
1036 Array<OneD, NekDouble> &outarray);
1037
1041 Array<OneD, NekDouble> &outarray);
1042
1047 Array<OneD, NekDouble> &outarray);
1048
1050 const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
1051 Array<OneD, NekDouble> &outarray);
1052
1054 const LocalRegions::MatrixKey &mkey);
1055
1057 const LocalRegions::MatrixKey &mkey);
1058
1059 /** \brief Function to evaluate the discrete \f$ L_\infty\f$
1060 * error \f$ |\epsilon|_\infty = \max |u - u_{exact}|\f$ where \f$
1061 * u_{exact}\f$ is given by the array \a sol.
1062 *
1063 * This function takes the physical value space array \a m_phys as
1064 * approximate solution
1065 *
1066 * \param sol array of solution function at physical quadrature
1067 * points
1068 * \return returns the \f$ L_\infty \f$ error as a NekDouble.
1069 */
1073
1074 /** \brief Function to evaluate the discrete \f$ L_2\f$ error,
1075 * \f$ | \epsilon |_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2
1076 * dx \right]^{1/2} d\xi_1 \f$ where \f$ u_{exact}\f$ is given by
1077 * the array \a sol.
1078 *
1079 * This function takes the physical value space array \a m_phys as
1080 * approximate solution
1081 *
1082 * \param sol array of solution function at physical quadrature
1083 * points
1084 * \return returns the \f$ L_2 \f$ error as a double.
1085 */
1087 L2(const Array<OneD, const NekDouble> &phys,
1089
1090 /** \brief Function to evaluate the discrete \f$ H^1\f$
1091 * error, \f$ | \epsilon |^1_{2} = \left [ \int^1_{-1} [u -
1092 * u_{exact}]^2 + \nabla(u - u_{exact})\cdot\nabla(u -
1093 * u_{exact})\cdot dx \right]^{1/2} d\xi_1 \f$ where \f$
1094 * u_{exact}\f$ is given by the array \a sol.
1095 *
1096 * This function takes the physical value space array
1097 * \a m_phys as approximate solution
1098 *
1099 * \param sol array of solution function at physical quadrature
1100 * points
1101 * \return returns the \f$ H_1 \f$ error as a double.
1102 */
1104 H1(const Array<OneD, const NekDouble> &phys,
1106
1107 // I/O routines
1109 {
1111 p.reserve(m_base.size());
1112 for (size_t i = 0; i < m_base.size(); ++i)
1113 {
1114 p.push_back(m_base[i]->GetPointsKey());
1115 }
1116 return p;
1117 }
1118
1120 const DNekScalMatSharedPtr &m_transformationmatrix)
1121 {
1122 return v_BuildInverseTransformationMatrix(m_transformationmatrix);
1123 }
1124
1125 /** \brief This function performs an interpolation from
1126 * the physical space points provided at input into an
1127 * array of equispaced points which are not the collapsed
1128 * coordinate. So for a tetrahedron you will only get a
1129 * tetrahedral number of values.
1130 *
1131 * This is primarily used for output purposes to get a
1132 * better distribution of points more suitable for most
1133 * postprocessing
1134 */
1136 const Array<OneD, const NekDouble> &inarray,
1137 Array<OneD, NekDouble> &outarray, int npset = -1);
1138
1139 /** \brief This function provides the connectivity of
1140 * local simplices (triangles or tets) to connect the
1141 * equispaced data points provided by
1142 * PhysInterpToSimplexEquiSpaced
1143 *
1144 * This is a virtual call to the function
1145 * \a v_GetSimplexEquiSpaceConnectivity
1146 */
1148 Array<OneD, int> &conn, bool standard = true)
1149 {
1150 v_GetSimplexEquiSpacedConnectivity(conn, standard);
1151 }
1152
1153 /** \brief This function performs a
1154 * projection/interpolation from the equispaced points
1155 * sometimes used in post-processing onto the coefficient
1156 * space
1157 *
1158 * This is primarily used for output purposes to use a
1159 * more even distribution of points more suitable for alot of
1160 * postprocessing
1161 */
1163 const Array<OneD, const NekDouble> &inarray,
1164 Array<OneD, NekDouble> &outarray);
1165
1166 template <class T> std::shared_ptr<T> as()
1167 {
1168 return std::dynamic_pointer_cast<T>(shared_from_this());
1169 }
1170
1172 Array<OneD, NekDouble> &outarray,
1173 bool multiplybyweights = true)
1174 {
1175 v_IProductWRTBase_SumFac(inarray, outarray, multiplybyweights);
1176 }
1177
1179 DNekMatSharedPtr &mat)
1180 {
1181 v_GenStdMatBwdDeriv(dir, mat);
1182 }
1183
1184protected:
1186 m_base; /**< Bases needed for the expansion */
1188 int m_ncoeffs; /**< Total number of coefficients used in the expansion */
1189
1194
1196 {
1197 return v_CreateStdMatrix(mkey);
1198 }
1199
1200 /** \brief Create the static condensation of a matrix when
1201 using a boundary interior decomposition
1202
1203 If a matrix system can be represented by
1204 \f$ Mat = \left [ \begin{array}{cc}
1205 A & B \\
1206 C & D \end{array} \right ] \f$
1207 This routine creates a matrix containing the statically
1208 condense system of the form
1209 \f$ Mat = \left [ \begin{array}{cc}
1210 A - B D^{-1} C & B D^{-1} \\
1211 D^{-1} C & D^{-1} \end{array} \right ] \f$
1212 **/
1215
1217 Array<OneD, NekDouble> &outarray)
1218 {
1219 v_BwdTrans_SumFac(inarray, outarray);
1220 }
1221
1223 const int dir, const Array<OneD, const NekDouble> &inarray,
1224 Array<OneD, NekDouble> &outarray)
1225 {
1226 v_IProductWRTDerivBase_SumFac(dir, inarray, outarray);
1227 }
1228
1230 const Array<OneD, const NekDouble> &direction,
1231 const Array<OneD, const NekDouble> &inarray,
1232 Array<OneD, NekDouble> &outarray)
1233 {
1234 v_IProductWRTDirectionalDerivBase_SumFac(direction, inarray, outarray);
1235 }
1236
1237 // The term _MatFree denotes that the action of the
1238 // MatrixOperation is done withouth actually using the
1239 // matrix (which then needs to be stored/calculated).
1240 // Although this does not strictly mean that no matrix
1241 // operations are involved in the evaluation of the
1242 // operation, we use this term in the same context used as
1243 // in the following paper: R. C. Kirby, M. G. Knepley,
1244 // A. Logg, and L. R. Scott, "Optimizing the evaluation of
1245 // finite element matrices," SISC 27:741-758 (2005)
1247 const Array<OneD, const NekDouble> &inarray,
1248 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1249
1251 const Array<OneD, const NekDouble> &inarray,
1252 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1253
1255 Array<OneD, NekDouble> &outarray,
1256 const StdMatrixKey &mkey)
1257 {
1258 v_LaplacianMatrixOp_MatFree(inarray, outarray, mkey);
1259 }
1260
1267
1269 const Array<OneD, const NekDouble> &inarray,
1270 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1271
1273 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
1274 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1275
1277 const int i, const Array<OneD, const NekDouble> &inarray,
1278 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1279
1281 const Array<OneD, const NekDouble> &inarray,
1282 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1283
1285 const Array<OneD, const NekDouble> &inarray,
1286 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1287
1289 const Array<OneD, const NekDouble> &inarray,
1290 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1291
1293 const Array<OneD, const NekDouble> &inarray,
1294 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey,
1295 bool addDiffusionTerm = true);
1296
1298 Array<OneD, NekDouble> &outarray,
1299 const StdMatrixKey &mkey)
1300 {
1301 v_HelmholtzMatrixOp_MatFree(inarray, outarray, mkey);
1302 }
1303
1305 const Array<OneD, const NekDouble> &inarray,
1306 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1307
1310 Array<OneD, NekDouble> &outarray);
1311
1313 const Array<OneD, const NekDouble> &Lcoord,
1314 const Array<OneD, const NekDouble> &physvals);
1315
1317 [[maybe_unused]] const int dir, [[maybe_unused]] DNekMatSharedPtr &mat)
1318 {
1319 NEKERROR(ErrorUtil::efatal, "not defined");
1320 }
1321
1323 const Array<OneD, const NekDouble> &inarray,
1324 Array<OneD, NekDouble> &outarray);
1325
1326 /**
1327 * @brief This function performs the barycentric interpolation of
1328 * the polynomial stored in @p coord at a point @p physvals using
1329 * barycentric interpolation weights in direction @tparam DIR.
1330 * It can also perform the barycentric interpolation of the
1331 * derivative of the polynomial if @tparam DERIV is set to true,
1332 * which outputs in to @param deriv.
1333 *
1334 * This method is intended to be used a helper function for
1335 * StdExpansion::PhysEvaluate and its elemental instances, so that
1336 * the calling method should provide @p coord for x, y and z
1337 * sequentially and the appropriate @p physvals and @p weights for
1338 * that particular direction.
1339 *
1340 * @param coord The coordinate of the single point.
1341 * @param physvals The polynomial stored at each quadrature point.
1342 * @param deriv The value of the derivative.
1343 * @param deriv The value of the 2nd derivative.
1344 * @tparam DIR The direction of evaluation.
1345 * @tparam DERIV Bool to find derivative.
1346 *
1347 * @return The value of @p physvals at @p coord in direction @p dir.
1348 */
1349 template <int DIR, bool DERIV = false, bool DERIV2 = false>
1350 inline NekDouble BaryEvaluate(const NekDouble &coord,
1351 const NekDouble *physvals, NekDouble &deriv,
1352 NekDouble &deriv2)
1353 {
1354 NekDouble numer1 = 0.0, numer2 = 0.0, numer3 = 0.0, numer4 = 0.0,
1355 numer5 = 0.0, denom = 0.0;
1356
1357 ASSERTL2(DIR < m_base.size(),
1358 "Direction should be less than shape dimension.");
1359
1360 const Array<OneD, const NekDouble> &z = m_base[DIR]->GetZ();
1361 const Array<OneD, const NekDouble> &bw = m_base[DIR]->GetBaryWeights();
1362
1363 const size_t nquad = z.size();
1364
1365 for (size_t i = 0; i < nquad; ++i)
1366 {
1367 NekDouble xdiff = z[i] - coord;
1368 NekDouble pval = physvals[i];
1369
1370 /*
1371 * (in this specific case) you actually
1372 * want to do the comparison exactly
1373 * (believe it or not!) See chapter 7 of
1374 * the paper here:
1375 *https://people.maths.ox.ac.uk/trefethen/barycentric.pdf
1376 */
1377 if ((!DERIV && xdiff == 0.0) ||
1378 ((DERIV || DERIV2) && std::abs(xdiff) < 1e-15))
1379 {
1380
1381 if constexpr (DERIV2)
1382 {
1383 DNekMatSharedPtr D0 = m_base[DIR]->GetD();
1384
1385 // take ith row of z and multiply with physvals
1386 Array<OneD, NekDouble> tmp(nquad);
1387 for (int kk = 0; kk < nquad; kk++)
1388 {
1389 tmp[kk] = Vmath::Dot(nquad, &(D0->GetPtr())[kk], nquad,
1390 &physvals[0], 1);
1391 }
1392
1393 deriv2 = Vmath::Dot(nquad, &(D0->GetPtr())[i], nquad,
1394 &tmp[0], 1);
1395 deriv = tmp[i];
1396 }
1397 else if constexpr (DERIV)
1398 {
1399 DNekMatSharedPtr D0 = m_base[DIR]->GetD();
1400
1401 // take ith row of z and multiply with physvals
1402 deriv = Vmath::Dot(z.size(), &(D0->GetPtr())[i], z.size(),
1403 &physvals[0], 1);
1404 }
1405
1406 return pval;
1407 }
1408
1409 NekDouble tmp = bw[i] / xdiff;
1410 numer1 += tmp * pval;
1411 denom += tmp;
1412
1413 if constexpr (DERIV || DERIV2)
1414 {
1415 NekDouble tmp2 = tmp / xdiff;
1416 numer2 += tmp2 * pval;
1417 numer3 += tmp2;
1418
1419 if constexpr (DERIV2)
1420 {
1421 NekDouble tmp3 = tmp2 / xdiff;
1422 numer4 += tmp3 * pval;
1423 numer5 += tmp3;
1424 }
1425 }
1426 }
1427
1428 if constexpr (DERIV || DERIV2)
1429 {
1430 NekDouble denomdenom = denom * denom;
1431 NekDouble numer1numer3 = numer1 * numer3;
1432
1433 deriv = (numer2 * denom - numer1numer3) / (denomdenom);
1434
1435 if constexpr (DERIV2)
1436 {
1437 deriv2 = (2.0 * numer4 / denom) -
1438 (2.0 * numer5 * numer1) / (denomdenom) -
1439 (2.0 * numer2 * numer3) / (denomdenom) +
1440 (2.0 * numer3 * numer1numer3) / (denomdenom * denom);
1441 }
1442 }
1443
1444 return numer1 / denom;
1445 }
1446
1447 /**
1448 * @brief This function evaluates the basis function mode @p mode at
1449 * a point @p coords of the domain in direction @dir.
1450 *
1451 * @param coord The coordinate inside the standard region.
1452 * @param mode The mode number to be evaluated of #m_base[dir]
1453 * @param dir The direction of interpolation.
1454 *
1455 * @return The value of the basis function @p mode at @p coords in
1456 * direction @p dir.
1457 */
1458 template <int DIR>
1459 inline NekDouble BaryEvaluateBasis(const NekDouble &coord, const int &mode)
1460 {
1461 const int nquad = m_base[DIR]->GetNumPoints();
1462 return BaryEvaluate<DIR>(coord,
1463 &(m_base[DIR]->GetBdata())[0] + nquad * mode);
1464 }
1465
1466 /**
1467 * @brief Helper function to pass an unused value by reference into
1468 * BaryEvaluate.
1469 *
1470 * @param coord The coordinate of the single point.
1471 * @param physvals The polynomial stored at each quadrature point.
1472 * @tparam DIR The direction of evaluation.
1473 * @tparam DERIV Bool to find derivative.
1474 *
1475 * @return The value of @p physvals at @p coord in direction @p dir.
1476 */
1477 template <int DIR, bool DERIV = false, bool DERIV2 = false>
1478 inline NekDouble BaryEvaluate(const NekDouble &coord,
1479 const NekDouble *physvals)
1480 {
1481 NekDouble unusedValue = 0.0;
1482 return BaryEvaluate<DIR, DERIV, DERIV2>(coord, physvals, unusedValue,
1483 unusedValue);
1484 }
1485
1486 template <int DIR, bool DERIV = false, bool DERIV2 = false>
1487 inline NekDouble BaryEvaluate(const NekDouble &coord,
1488 const NekDouble *physvals, NekDouble &deriv)
1489 {
1490 NekDouble unusedValue = 0.0;
1491 return BaryEvaluate<DIR, DERIV, DERIV2>(coord, physvals, deriv,
1492 unusedValue);
1493 }
1494
1495private:
1496 // Virtual functions
1497 STD_REGIONS_EXPORT virtual int v_GetNverts() const = 0;
1498 STD_REGIONS_EXPORT virtual int v_GetNtraces() const = 0;
1499
1500 STD_REGIONS_EXPORT virtual int v_NumBndryCoeffs() const = 0;
1502
1503 STD_REGIONS_EXPORT virtual int v_GetTraceNcoeffs(const int i) const = 0;
1504 STD_REGIONS_EXPORT virtual int v_GetTraceIntNcoeffs(const int i) const = 0;
1505 STD_REGIONS_EXPORT virtual int v_GetTraceNumPoints(const int i) const = 0;
1506
1508 const int i, const int k, bool UseGLL = false) const;
1509
1511 const int i, const int j) const;
1512
1514 const;
1515
1517 const = 0;
1518
1519 STD_REGIONS_EXPORT virtual std::shared_ptr<StdExpansion> v_GetStdExp()
1520 const;
1521
1522 STD_REGIONS_EXPORT virtual std::shared_ptr<StdExpansion> v_GetLinStdExp(
1523 void) const;
1524
1526
1528
1530
1532 [[maybe_unused]] const Array<OneD, const NekDouble> &inarray,
1533 [[maybe_unused]] Array<OneD, NekDouble> &outarray){};
1534
1536 const Array<OneD, const NekDouble> &inarray,
1537 Array<OneD, NekDouble> &outarray) = 0;
1538
1539 /**
1540 * @brief Transform a given function from physical quadrature space
1541 * to coefficient space.
1542 * @see StdExpansion::FwdTrans
1543 */
1545 const Array<OneD, const NekDouble> &inarray,
1546 Array<OneD, NekDouble> &outarray) = 0;
1547
1548 /**
1549 * @brief Calculates the inner product of a given function \a f
1550 * with the different modes of the expansion
1551 */
1553 const Array<OneD, const NekDouble> &inarray,
1554 Array<OneD, NekDouble> &outarray) = 0;
1555
1557 [[maybe_unused]] const Array<OneD, const NekDouble> &base,
1558 [[maybe_unused]] const Array<OneD, const NekDouble> &inarray,
1559 [[maybe_unused]] Array<OneD, NekDouble> &outarray,
1560 [[maybe_unused]] int coll_check)
1561 {
1562 NEKERROR(ErrorUtil::efatal, "StdExpansion::v_IProductWRTBase has no "
1563 "(and should have no) implementation");
1564 }
1565
1567 const int dir, const Array<OneD, const NekDouble> &inarray,
1568 Array<OneD, NekDouble> &outarray);
1569
1571 const Array<OneD, const NekDouble> &direction,
1572 const Array<OneD, const NekDouble> &inarray,
1573 Array<OneD, NekDouble> &outarray);
1574
1576 const Array<OneD, const NekDouble> &inarray,
1577 Array<OneD, NekDouble> &outarray);
1578
1580 const Array<OneD, const NekDouble> &inarray);
1581
1582 STD_REGIONS_EXPORT virtual void v_PhysDeriv(
1583 const Array<OneD, const NekDouble> &inarray,
1585 Array<OneD, NekDouble> &out_d3);
1586
1587 STD_REGIONS_EXPORT virtual void v_PhysDeriv_s(
1588 const Array<OneD, const NekDouble> &inarray,
1589 Array<OneD, NekDouble> &out_ds);
1590
1591 STD_REGIONS_EXPORT virtual void v_PhysDeriv_n(
1592 const Array<OneD, const NekDouble> &inarray,
1593 Array<OneD, NekDouble> &out_dn);
1594
1595 STD_REGIONS_EXPORT virtual void v_PhysDeriv(
1596 const int dir, const Array<OneD, const NekDouble> &inarray,
1597 Array<OneD, NekDouble> &out_d0);
1598
1600 const Array<OneD, const NekDouble> &inarray,
1601 const Array<OneD, const NekDouble> &direction,
1602 Array<OneD, NekDouble> &outarray);
1603
1605 const Array<OneD, const NekDouble> &inarray,
1607 Array<OneD, NekDouble> &out_d3);
1608
1610 const Array<OneD, const NekDouble> &coords,
1611 const Array<OneD, const NekDouble> &physvals);
1612
1615 const Array<OneD, const NekDouble> &physvals);
1616
1618 const Array<OneD, NekDouble> &coord,
1619 const Array<OneD, const NekDouble> &inarray,
1620 std::array<NekDouble, 3> &firstOrderDerivs);
1621
1623 const Array<OneD, NekDouble> &coord,
1624 const Array<OneD, const NekDouble> &inarray,
1625 std::array<NekDouble, 3> &firstOrderDerivs,
1626 std::array<NekDouble, 6> &secondOrderDerivs);
1627
1629 const Array<OneD, const NekDouble> &coords, int mode);
1630
1633
1636
1637 STD_REGIONS_EXPORT virtual void v_PhysInterp(
1638 std::shared_ptr<StdExpansion> FromExp,
1639 const Array<OneD, const NekDouble> &fromData,
1640 Array<OneD, NekDouble> &toData);
1641
1643 virtual void v_FillMode(const int mode, Array<OneD, NekDouble> &outarray);
1644
1646 const StdMatrixKey &mkey);
1647
1649 const StdMatrixKey &mkey);
1650
1651 STD_REGIONS_EXPORT virtual void v_GetCoords(
1653 Array<OneD, NekDouble> &coords_2);
1654
1655 STD_REGIONS_EXPORT virtual void v_GetCoord(
1656 const Array<OneD, const NekDouble> &Lcoord,
1657 Array<OneD, NekDouble> &coord);
1658
1659 STD_REGIONS_EXPORT virtual int v_GetCoordim() const;
1660
1662 Array<OneD, unsigned int> &outarray);
1663
1665 Array<OneD, unsigned int> &outarray);
1666
1667 STD_REGIONS_EXPORT virtual int v_GetVertexMap(int localVertexId,
1668 bool useCoeffPacking = false);
1669
1671 const int tid, Array<OneD, unsigned int> &maparray,
1672 Array<OneD, int> &signarray, Orientation traceOrient = eForwards,
1673 int P = -1, int Q = -1);
1674
1676 const unsigned int traceid, Array<OneD, unsigned int> &maparray);
1677
1679 const unsigned int tid, Array<OneD, unsigned int> &maparray,
1680 Array<OneD, int> &signarray, Orientation traceOrient = eForwards,
1681 int P = -1, int Q = -1);
1682
1684 const int eid, Array<OneD, unsigned int> &maparray,
1685 Array<OneD, int> &signarray, const Orientation traceOrient = eForwards);
1686
1688 const int fid, int &numModes0, int &numModes1,
1690
1692 const int vertex, const Array<OneD, const NekDouble> &inarray,
1693 NekDouble &outarray);
1694
1696 const Array<OneD, const NekDouble> &inarray,
1697 Array<OneD, NekDouble> &outarray);
1698
1700 const Array<OneD, const NekDouble> &inarray,
1701 Array<OneD, NekDouble> &outarray);
1702
1704 const Array<OneD, const NekDouble> &inarray,
1705 Array<OneD, NekDouble> &outarray, bool multiplybyweights = true);
1706
1708 const int dir, const Array<OneD, const NekDouble> &inarray,
1709 Array<OneD, NekDouble> &outarray);
1710
1712 const Array<OneD, const NekDouble> &direction,
1713 const Array<OneD, const NekDouble> &inarray,
1714 Array<OneD, NekDouble> &outarray);
1715
1717 const Array<OneD, const NekDouble> &inarray,
1718 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1719
1721 const Array<OneD, const NekDouble> &inarray,
1722 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1723
1725 Array<OneD, NekDouble> &array, const StdMatrixKey &mkey);
1726
1728 Array<OneD, NekDouble> &array, const NekDouble alpha,
1729 const NekDouble exponent, const NekDouble cutoff);
1730
1732 int numMin, const Array<OneD, const NekDouble> &inarray,
1733 Array<OneD, NekDouble> &outarray);
1734
1736 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
1737 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1738
1740 const int i, const Array<OneD, const NekDouble> &inarray,
1741 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1742
1744 const Array<OneD, const NekDouble> &inarray,
1745 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1746
1748 const Array<OneD, const NekDouble> &inarray,
1749 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1750
1752 const Array<OneD, const NekDouble> &inarray,
1753 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1754
1756 const Array<OneD, const NekDouble> &inarray,
1757 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey,
1758 bool addDiffusionTerm = true);
1759
1761 const Array<OneD, const NekDouble> &inarray,
1762 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1763
1765 const Array<OneD, const NekDouble> &inarray,
1766 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1767
1769 const Array<OneD, const NekDouble> &inarray,
1771
1773 const Array<OneD, const NekDouble> &inarray,
1774 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1775
1777 const DNekScalMatSharedPtr &m_transformationmatrix);
1778
1780 Array<OneD, int> &conn, bool standard = true);
1781};
1782
1783typedef std::shared_ptr<StdExpansion> StdExpansionSharedPtr;
1784typedef std::vector<StdExpansionSharedPtr> StdExpansionVector;
1785
1786/**
1787 * This function is a wrapper around the virtual function
1788 * \a v_FwdTrans()
1789 *
1790 * Given a function evaluated at the quadrature points, this
1791 * function calculates the expansion coefficients such that the
1792 * resulting expansion approximates the original function.
1793 *
1794 * The calculation of the expansion coefficients is done using a
1795 * Galerkin projection. This is equivalent to the operation:
1796 * \f[ \mathbf{\hat{u}} = \mathbf{M}^{-1} \mathbf{I}\f]
1797 * where
1798 * - \f$\mathbf{M}[p][q]= \int\phi_p(\mathbf{\xi})\phi_q(
1799 * \mathbf{\xi}) d\mathbf{\xi}\f$ is the Mass matrix
1800 * - \f$\mathbf{I}[p] = \int\phi_p(\mathbf{\xi}) u(\mathbf{\xi})
1801 * d\mathbf{\xi}\f$
1802 *
1803 * This function takes the array \a inarray as the values of the
1804 * function evaluated at the quadrature points
1805 * (i.e. \f$\mathbf{u}\f$),
1806 * and stores the resulting coefficients \f$\mathbf{\hat{u}}\f$
1807 * in the \a outarray
1808 *
1809 * @param inarray array of the function discretely evaluated at the
1810 * quadrature points
1811 *
1812 * @param outarray array of the function coefficieints
1813 */
1815 Array<OneD, NekDouble> &outarray)
1816{
1817 v_FwdTrans(inarray, outarray);
1818}
1819
1820} // namespace Nektar::StdRegions
1821
1822#endif // STANDARDDEXPANSION_H
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
#define STD_REGIONS_EXPORT
Describes the specification for a Basis.
Definition Basis.h:45
Defines a specification for a set of points.
Definition Points.h:50
The base class for all shapes.
void PhysDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
virtual void v_LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void NodalToModal(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false)
virtual void v_LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
virtual ~StdExpansion()
Destructor.
virtual void v_PhysDeriv_n(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
const LibUtilities::BasisSharedPtr & GetBasis(int dir) const
This function gets the shared point to basis in the dir direction.
virtual void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
Physical derivative along a direction vector.
StdExpansion()
Default Constructor.
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
virtual void v_GetTraceToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
void GeneralMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void FillMode(const int mode, Array< OneD, NekDouble > &outarray)
This function fills the array outarray with the mode-th mode of the expansion.
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
const LibUtilities::PointsKey GetNodalPointsKey() const
This function returns the type of expansion Nodal point type if defined.
void PhysInterpToSimplexEquiSpaced(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int npset=-1)
This function performs an interpolation from the physical space points provided at input into an arra...
void PhysDeriv_s(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
void WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void WeakDerivMatrixOp_MatFree(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
DNekBlkMatSharedPtr CreateStdStaticCondMatrix(const StdMatrixKey &mkey)
Create the static condensation of a matrix when using a boundary interior decomposition.
void DropLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
std::shared_ptr< StdExpansion > GetStdExp() const
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
int GetTraceNumPoints(const int i) const
This function returns the number of quadrature points belonging to the i-th trace.
void GetElmtTraceToTraceMap(const unsigned int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
void LaplacianMatrixOp_MatFree_GenericImpl(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
virtual void v_IProductWRTDirectionalDerivBase_SumFac(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual int v_GetNverts() const =0
LibUtilities::PointsKey GetTracePointsKey(const int i, int k=-1) const
This function returns the basis key belonging to the i-th trace.
void MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2)
void LinearAdvectionDiffusionReactionMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
void LaplacianMatrixOp(const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
NekDouble BaryEvaluate(const NekDouble &coord, const NekDouble *physvals, NekDouble &deriv)
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &base, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int coll_check)
virtual void v_GetElmtTraceToTraceMap(const unsigned int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
const LibUtilities::PointsKeyVector GetPointsKeys() const
virtual void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
int GetTraceIntNcoeffs(const int i) const
void LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
Convert local cartesian coordinate xi into local collapsed coordinates eta.
virtual void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true)
void GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true)
This function provides the connectivity of local simplices (triangles or tets) to connect the equispa...
DNekBlkMatSharedPtr GetStdStaticCondMatrix(const StdMatrixKey &mkey)
const Array< OneD, const NekDouble > & GetPoints(const int dir) const
This function returns a pointer to the array containing the quadrature points in dir direction.
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
virtual std::shared_ptr< StdExpansion > v_GetLinStdExp(void) const
void WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
int EvalBasisNumModesMax(void) const
This function returns the maximum number of expansion modes over all local directions.
virtual void v_GetInteriorMap(Array< OneD, unsigned int > &outarray)
virtual void v_SetCoeffsToOrientation(StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
NekDouble Linf(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
Function to evaluate the discrete error where is given by the array sol.
void PhysDirectionalDeriv(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
virtual NekDouble v_PhysEvalFirstSecondDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs, std::array< NekDouble, 6 > &secondOrderDerivs)
void EquiSpacedToCoeffs(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs a projection/interpolation from the equispaced points sometimes used in post-p...
void FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset)
void GetCoord(const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
given the coordinates of a point of the element in the local collapsed coordinate system,...
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void PhysDeriv_n(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
virtual void v_WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
const Array< OneD, const LibUtilities::BasisSharedPtr > & GetBase() const
This function gets the shared point to basis.
void BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
virtual DNekMatSharedPtr v_BuildInverseTransformationMatrix(const DNekScalMatSharedPtr &m_transformationmatrix)
NekDouble L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
Function to evaluate the discrete error, where is given by the array sol.
virtual void v_GetVertexPhysVals(const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
void SetElmtId(const int id)
Set the element id of this expansion when used in a list by returning value of m_elmt_id.
virtual int v_NumDGBndryCoeffs() const =0
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int GetVertexMap(const int localVertexId, bool useCoeffPacking=false)
void GetTraceCoeffMap(const unsigned int traceid, Array< OneD, unsigned int > &maparray)
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
virtual NekDouble v_PhysEvaluateInterp(const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
void LinearAdvectionMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
std::shared_ptr< StdExpansion > GetLinStdExp(void) const
virtual void v_GetTraceCoeffMap(const unsigned int traceid, Array< OneD, unsigned int > &maparray)
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
this function calculates the inner product of a given function f with the different modes of the expa...
virtual bool v_IsBoundaryInteriorExpansion() const
int GetNtraces() const
Returns the number of trace elements connected to this element.
virtual void v_MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int GetNverts() const
This function returns the number of vertices of the expansion domain.
virtual int v_NumBndryCoeffs() const =0
void LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
NekDouble BaryEvaluate(const NekDouble &coord, const NekDouble *physvals, NekDouble &deriv, NekDouble &deriv2)
This function performs the barycentric interpolation of the polynomial stored in coord at a point phy...
virtual int v_GetShapeDimension() const =0
virtual void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray)
void LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void NormVectorIProductWRTBase(const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray)
void GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2=NullNekDouble1DArray, Array< OneD, NekDouble > &coords_3=NullNekDouble1DArray)
this function returns the physical coordinates of the quadrature points of the expansion
void IProductWRTDirectionalDerivBase(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int GetElmtId()
Get the element id of this expansion when used in a list by returning value of m_elmt_id.
virtual void v_ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
virtual const LibUtilities::BasisKey v_GetTraceBasisKey(const int i, const int k, bool UseGLL=false) const
NekDouble PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
This function evaluates the expansion at a single (arbitrary) point of the domain.
void GetTraceToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
void IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void MassLevelCurvatureMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual int v_GetTraceNumPoints(const int i) const =0
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey)
NekDouble BaryEvaluate(const NekDouble &coord, const NekDouble *physvals)
Helper function to pass an unused value by reference into BaryEvaluate.
void GetInteriorMap(Array< OneD, unsigned int > &outarray)
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Backward transformation from coefficient space to physical space.
void PhysInterp(std::shared_ptr< StdExpansion > fromExp, const Array< OneD, const NekDouble > &fromData, Array< OneD, NekDouble > &toData)
interpolate from one set of quadrature points available from FromExp to the set of quadrature points ...
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey)
void GetTraceInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eForwards)
int GetTraceNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th trace.
DNekMatSharedPtr GenMatrix(const StdMatrixKey &mkey)
virtual void v_NodalToModal(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
NekDouble PhysEvaluateBasis(const Array< OneD, const NekDouble > &coords, int mode)
This function evaluates the basis function mode mode at a point coords of the domain.
virtual void v_GetTraceNumModes(const int fid, int &numModes0, int &numModes1, Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
virtual void v_PhysDeriv_s(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
virtual void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
int GetNumBases() const
This function returns the number of 1D bases used in the expansion.
DNekMatSharedPtr BuildInverseTransformationMatrix(const DNekScalMatSharedPtr &m_transformationmatrix)
void GetTraceNumModes(const int tid, int &numModes0, int &numModes1, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Forward transformation from physical space to coefficient space.
virtual void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray)
void GenStdMatBwdDeriv(const int dir, DNekMatSharedPtr &mat)
virtual int v_GetNtraces() const =0
void ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
LibUtilities::NekManager< StdMatrixKey, DNekBlkMat, StdMatrixKey::opLess > m_stdStaticCondMatrixManager
virtual const LibUtilities::PointsKey v_GetNodalPointsKey() const
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LinearAdvectionDiffusionReactionMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
void IProductWRTDirectionalDerivBase_SumFac(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
virtual LibUtilities::ShapeType v_DetShapeType() const =0
virtual NekDouble v_PhysEvaluateBasis(const Array< OneD, const NekDouble > &coords, int mode)
virtual void v_GetTraceInteriorToElementMap(const int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eForwards)
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)=0
Calculates the inner product of a given function f with the different modes of the expansion.
void StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
const LibUtilities::BasisKey GetTraceBasisKey(const int i, int k=-1, bool UseGLL=false) const
This function returns the basis key belonging to the i-th trace.
void MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
Convert local collapsed coordinates eta into local cartesian coordinate xi.
NekDouble PhysEvaluate(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs, std::array< NekDouble, 6 > &secondOrderDerivs)
virtual void v_PhysInterp(std::shared_ptr< StdExpansion > FromExp, const Array< OneD, const NekDouble > &fromData, Array< OneD, NekDouble > &toData)
virtual void v_LinearAdvectionDiffusionReactionMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
void HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
NekDouble PhysEvaluate(const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
This function evaluates the expansion at a single (arbitrary) point of the domain.
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)=0
Transform a given function from physical quadrature space to coefficient space.
virtual void v_DropLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
void WeakDirectionalDerivMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual int v_GetTraceIntNcoeffs(const int i) const =0
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
NekDouble H1(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
Function to evaluate the discrete error, where is given by the array sol.
virtual int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset)
void IProductWRTBase(const Array< OneD, const NekDouble > &base, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int coll_check)
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrates the specified function over the domain.
NekDouble BaryEvaluateBasis(const NekDouble &coord, const int &mode)
void SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
virtual std::shared_ptr< StdExpansion > v_GetStdExp() const
void HelmholtzMatrixOp_MatFree_GenericImpl(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)=0
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLess > m_stdMatrixManager
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
virtual LibUtilities::PointsKey v_GetTracePointsKey(const int i, const int j) const
void PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
virtual NekDouble v_PhysEvalFirstDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
virtual void v_LinearAdvectionMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
DNekMatSharedPtr CreateStdMatrix(const StdMatrixKey &mkey)
virtual void v_IProductWRTDirectionalDerivBase(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetTraceNcoeffs(const int i) const =0
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
void LinearAdvectionMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2, Array< OneD, NekDouble > &out_d3)
Calculate the derivative of the physical points.
virtual void v_GenStdMatBwdDeriv(const int dir, DNekMatSharedPtr &mat)
virtual void v_StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2, Array< OneD, NekDouble > &out_d3)
NekDouble StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
void MassMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void GeneralMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
NekDouble PhysEvaluate(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
This function evaluates the first derivative of the expansion at a single (arbitrary) point of the do...
NekDouble Integral(const Array< OneD, const NekDouble > &inarray)
This function integrates the specified function over the domain.
std::shared_ptr< Basis > BasisSharedPtr
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
std::vector< PointsKey > PointsKeyVector
Definition Points.h:231
@ P
Monomial polynomials .
Definition BasisType.h:62
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::vector< StdExpansionSharedPtr > StdExpansionVector
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr
T Dot(int n, const T *w, const T *x)
dot product
Definition Vmath.hpp:761