Nektar++
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 <boost/core/ignore_unused.hpp>
44 #include <set>
45 
50 namespace Nektar
51 {
52 namespace LocalRegions
53 {
54 class MatrixKey;
55 class Expansion;
56 } // namespace LocalRegions
57 } // namespace Nektar
58 
59 namespace Nektar
60 {
61 namespace StdRegions
62 {
63 
64 /** \brief The base class for all shapes
65  *
66  * This is the lowest level basic class for all shapes and so
67  * contains the definition of common data and common routine to all
68  * elements
69  */
70 class StdExpansion : public std::enable_shared_from_this<StdExpansion>
71 {
72 public:
73  /** \brief Default Constructor */
75 
76  /** \brief Constructor */
78  const int numcoeffs, const int numbases,
82 
83  /** \brief Copy Constructor */
85 
86  /** \brief Destructor */
88 
89  // Standard Expansion Routines Applicable Regardless of Region
90 
91  /** \brief This function returns the number of 1D bases used in
92  * the expansion
93  *
94  * \return returns the number of 1D bases used in the expansion,
95  * which is equal to number dimension of the expansion
96  */
97  inline int GetNumBases() const
98  {
99  return m_base.size();
100  }
101 
102  /** \brief This function gets the shared point to basis
103  *
104  * \return returns the shared pointer to the bases
105  */
107  const
108  {
109  return (m_base);
110  }
111 
112  /** \brief This function gets the shared point to basis in
113  * the \a dir direction
114  *
115  * \return returns the shared pointer to the basis in
116  * directin \a dir
117  */
118  inline const LibUtilities::BasisSharedPtr &GetBasis(int dir) const
119  {
120  ASSERTL1(dir < m_base.size(), "dir is larger than number of bases");
121  return (m_base[dir]);
122  }
123 
124  /** \brief This function returns the total number of coefficients
125  * used in the expansion
126  *
127  * \return returns the total number of coefficients (which is
128  * equivalent to the total number of modes) used in the expansion
129  */
130  inline int GetNcoeffs(void) const
131  {
132  return (m_ncoeffs);
133  }
134 
135  /** \brief This function returns the total number of quadrature
136  * points used in the element
137  *
138  * \return returns the total number of quadrature points
139  */
140  inline int GetTotPoints() const
141  {
142  int i;
143  int nqtot = 1;
144 
145  for (i = 0; i < m_base.size(); ++i)
146  {
147  nqtot *= m_base[i]->GetNumPoints();
148  }
149 
150  return nqtot;
151  }
152 
153  /** \brief This function returns the type of basis used in the \a dir
154  * direction
155  *
156  * The different types of bases implemented in the code are defined
157  * in the LibUtilities::BasisType enumeration list. As a result, the
158  * function will return one of the types of this enumeration list.
159  *
160  * \param dir the direction
161  * \return returns the type of basis used in the \a dir direction
162  */
163  inline LibUtilities::BasisType GetBasisType(const int dir) const
164  {
165  ASSERTL1(dir < m_base.size(), "dir is larger than m_numbases");
166  return (m_base[dir]->GetBasisType());
167  }
168 
169  /** \brief This function returns the number of expansion modes
170  * in the \a dir direction
171  *
172  * \param dir the direction
173  * \return returns the number of expansion modes in the \a dir
174  * direction
175  */
176  inline int GetBasisNumModes(const int dir) const
177  {
178  ASSERTL1(dir < m_base.size(), "dir is larger than m_numbases");
179  return (m_base[dir]->GetNumModes());
180  }
181 
182  /** \brief This function returns the maximum number of
183  * expansion modes over all local directions
184  *
185  * \return returns the maximum number of expansion modes
186  * over all local directions
187  */
188  inline int EvalBasisNumModesMax(void) const
189  {
190  int i;
191  int returnval = 0;
192 
193  for (i = 0; i < m_base.size(); ++i)
194  {
195  returnval = std::max(returnval, m_base[i]->GetNumModes());
196  }
197 
198  return returnval;
199  }
200 
201  /** \brief This function returns the type of quadrature points used
202  * in the \a dir direction
203  *
204  * The different types of quadrature points implemented in the code
205  * are defined in the LibUtilities::PointsType enumeration list.
206  * As a result, the function will return one of the types of this
207  * enumeration list.
208  *
209  * \param dir the direction
210  * \return returns the type of quadrature points used in the \a dir
211  * direction
212  */
213  inline LibUtilities::PointsType GetPointsType(const int dir) const
214  {
215  ASSERTL1(dir < m_base.size(), "dir is larger than m_numbases");
216  return (m_base[dir]->GetPointsType());
217  }
218 
219  /** \brief This function returns the number of quadrature points
220  * in the \a dir direction
221  *
222  * \param dir the direction
223  * \return returns the number of quadrature points in the \a dir
224  * direction
225  */
226  inline int GetNumPoints(const int dir) const
227  {
228  ASSERTL1(dir < m_base.size() || dir == 0,
229  "dir is larger than m_numbases");
230  return (m_base.size() > 0 ? m_base[dir]->GetNumPoints() : 1);
231  }
232 
233  /** \brief This function returns a pointer to the array containing
234  * the quadrature points in \a dir direction
235  *
236  * \param dir the direction
237  * \return returns a pointer to the array containing
238  * the quadrature points in \a dir direction
239  */
240  inline const Array<OneD, const NekDouble> &GetPoints(const int dir) const
241  {
242  return m_base[dir]->GetZ();
243  }
244 
245  // Wrappers around virtual Functions
246  /** \brief This function returns the number of vertices of the
247  * expansion domain
248  *
249  * This function is a wrapper around the virtual function
250  * \a v_GetNverts()
251  *
252  * \return returns the number of vertices of the expansion domain
253  */
254  int GetNverts() const
255  {
256  return v_GetNverts();
257  }
258 
259  /** \brief This function returns the number of expansion coefficients
260  * belonging to the \a i-th trace
261  *
262  * This function is a wrapper around the virtual function
263  * \a v_GetTraceNcoeffs()
264  *
265  * \param i specifies which trace
266  * \return returns the number of expansion coefficients belonging to
267  * the \a i-th trace
268  */
269  int GetTraceNcoeffs(const int i) const
270  {
271  return v_GetTraceNcoeffs(i);
272  }
273 
274  int GetTraceIntNcoeffs(const int i) const
275  {
276  return v_GetTraceIntNcoeffs(i);
277  }
278 
279  /** \brief This function returns the number of quadrature points
280  * belonging to the \a i-th trace
281  *
282  * This function is a wrapper around the virtual function
283  * \a v_GetTraceNumPoints()
284  *
285  * \param i specifies which trace id
286  * \return returns the number of quadrature points belonging to
287  * the \a i-th trace
288  */
289  int GetTraceNumPoints(const int i) const
290  {
291  return v_GetTraceNumPoints(i);
292  }
293 
294  /** \brief This function returns the basis key belonging
295  * to the \a i-th trace
296  *
297  * This function is a wrapper around the virtual function
298  * \a v_GetTraceBasisKey()
299  *
300  * \param i specifies which trace id
301  * \param k is the direction of the basis key for 2D traces
302  *
303  * \return returns the number of Basis key of the ith
304  * trace in the k th direction (when trace is a 2D
305  * object)
306  */
307  const LibUtilities::BasisKey GetTraceBasisKey(const int i, int k = -1) const
308  {
309  return v_GetTraceBasisKey(i, k);
310  }
311 
312  /** \brief This function returns the basis key belonging
313  * to the \a i-th trace
314  *
315  * This function is a wrapper around the virtual function
316  * \a v_GetTracePointsKey()
317  *
318  * \param i specifies which trace id
319  * \param k is the direction of the basis key for 2D traces
320  *
321  * \return returns the number of Points key of the ith
322  * trace in the k th direction (when trace is a 2D
323  * object)
324  */
325  LibUtilities::PointsKey GetTracePointsKey(const int i, int k = -1) const
326  {
327  return v_GetTracePointsKey(i, k);
328  }
329 
330  int NumBndryCoeffs(void) const
331  {
332  return v_NumBndryCoeffs();
333  }
334 
335  int NumDGBndryCoeffs(void) const
336  {
337  return v_NumDGBndryCoeffs();
338  }
339 
340  /** \brief This function returns the type of expansion
341  * Nodal point type if defined
342  *
343  * This function is a wrapper around the virtual function
344  * \a v_GetNodalPointsKey()
345  *
346  */
348  {
349  return v_GetNodalPointsKey();
350  };
351 
352  /**
353  * @brief Returns the number of trace elements connected to this
354  * element.
355  *
356  * For example, a quadrilateral has four edges, so this function
357  * would return 4.
358  */
359  int GetNtraces() const
360  {
361  return v_GetNtraces();
362  }
363 
364  /** \brief This function returns the shape of the expansion domain
365  *
366  * This function is a wrapper around the virtual function
367  * \a v_DetShapeType()
368  *
369  * The different shape types implemented in the code are defined
370  * in the ::ShapeType enumeration list. As a result, the
371  * function will return one of the types of this enumeration list.
372  *
373  * \return returns the shape of the expansion domain
374  */
376  {
377  return v_DetShapeType();
378  }
379 
380  std::shared_ptr<StdExpansion> GetStdExp(void) const
381  {
382  return v_GetStdExp();
383  }
384 
385  std::shared_ptr<StdExpansion> GetLinStdExp(void) const
386  {
387  return v_GetLinStdExp();
388  }
389 
390  int GetShapeDimension() const
391  {
392  return v_GetShapeDimension();
393  }
394 
396  {
398  }
399 
401  {
402  return v_IsNodalNonTensorialExp();
403  }
404 
405  /** \brief This function performs the Backward transformation from
406  * coefficient space to physical space
407  *
408  * This function is a wrapper around the virtual function
409  * \a v_BwdTrans()
410  *
411  * Based on the expansion coefficients, this function evaluates the
412  * expansion at the quadrature points. This is equivalent to the
413  * operation \f[ u(\xi_{1i}) =
414  * \sum_{p=0}^{P-1} \hat{u}_p \phi_p(\xi_{1i}) \f] which can be
415  * evaluated as \f$ {\bf u} = {\bf B}^T {\bf \hat{u}} \f$ with
416  * \f${\bf B}[i][j] = \phi_i(\xi_{j})\f$
417  *
418  * This function requires that the coefficient array
419  * \f$\mathbf{\hat{u}}\f$ provided as \a inarray.
420  *
421  * The resulting array
422  * \f$\mathbf{u}[m]=u(\mathbf{\xi}_m)\f$ containing the
423  * expansion evaluated at the quadrature points, is stored
424  * in the \a outarray.
425  *
426  * \param inarray contains the values of the expansion
427  * coefficients (input of the function)
428  *
429  * \param outarray contains the values of the expansion evaluated
430  * at the quadrature points (output of the function)
431  */
433  Array<OneD, NekDouble> &outarray)
434  {
435  v_BwdTrans(inarray, outarray);
436  }
437 
438  /**
439  * @brief This function performs the Forward transformation from
440  * physical space to coefficient space.
441  */
442  inline void FwdTrans(const Array<OneD, const NekDouble> &inarray,
443  Array<OneD, NekDouble> &outarray);
444 
446  Array<OneD, NekDouble> &outarray)
447  {
448  v_FwdTransBndConstrained(inarray, outarray);
449  }
450 
451  /** \brief This function integrates the specified function over the
452  * domain
453  *
454  * This function is a wrapper around the virtual function
455  * \a v_Integral()
456  *
457  * Based on the values of the function evaluated at the quadrature
458  * points (which are stored in \a inarray), this function calculates
459  * the integral of this function over the domain. This is
460  * equivalent to the numerical evaluation of the operation
461  * \f[ I=\int u(\mathbf{\xi})d \mathbf{\xi}\f]
462  *
463  * \param inarray values of the function to be integrated evaluated
464  * at the quadrature points (i.e.
465  * \a inarray[m]=\f$u(\mathbf{\xi}_m)\f$)
466  * \return returns the value of the calculated integral
467  *
468  * Inputs:\n
469 
470  - \a inarray: definition of function to be returned at quadrature point
471  of expansion.
472 
473  Outputs:\n
474 
475  - returns \f$\int^1_{-1}\int^1_{-1} u(\xi_1, \xi_2) J[i,j] d
476  \xi_1 d \xi_2 \f$ where \f$inarray[i,j] =
477  u(\xi_{1i},\xi_{2j}) \f$ and \f$ J[i,j] \f$ is the
478  Jacobian evaluated at the quadrature point.
479  *
480  */
482  {
483  return v_Integral(inarray);
484  }
485 
486  /** \brief This function fills the array \a outarray with the
487  * \a mode-th mode of the expansion
488  *
489  * This function is a wrapper around the virtual function
490  * \a v_FillMode()
491  *
492  * The requested mode is evaluated at the quadrature points
493  *
494  * \param mode the mode that should be filled
495  * \param outarray contains the values of the \a mode-th mode of the
496  * expansion evaluated at the quadrature points (output of the
497  * function)
498  */
499  void FillMode(const int mode, Array<OneD, NekDouble> &outarray)
500  {
501  v_FillMode(mode, outarray);
502  }
503 
504  /** \brief this function calculates the inner product of a given
505  * function \a f with the different modes of the expansion
506  *
507  * This function is a wrapper around the virtual function
508  * \a v_IProductWRTBase()
509  *
510  * This is equivalent to the numerical evaluation of
511  * \f[ I[p] = \int \phi_p(\mathbf{x}) f(\mathbf{x}) d\mathbf{x}\f]
512  * \f$ \begin{array}{rcl} I_{pq} = (\phi_q \phi_q, u) & = &
513  \sum_{i=0}^{nq_0} \sum_{j=0}^{nq_1} \phi_p(\xi_{0,i})
514  \phi_q(\xi_{1,j}) w^0_i w^1_j u(\xi_{0,i} \xi_{1,j})
515  J_{i,j}\\ & = & \sum_{i=0}^{nq_0} \phi_p(\xi_{0,i})
516  \sum_{j=0}^{nq_1} \phi_q(\xi_{1,j}) \tilde{u}_{i,j}
517  J_{i,j} \end{array} \f$
518 
519  where
520 
521  \f$ \tilde{u}_{i,j} = w^0_i w^1_j u(\xi_{0,i},\xi_{1,j}) \f$
522 
523  which can be implemented as
524 
525  \f$ f_{qi} = \sum_{j=0}^{nq_1} \phi_q(\xi_{1,j}) \tilde{u}_{i,j} =
526  {\bf B_1 U} \f$
527  \f$ I_{pq} = \sum_{i=0}^{nq_0} \phi_p(\xi_{0,i}) f_{qi} =
528  {\bf B_0 F} \f$
529  *
530  * \param inarray contains the values of the function \a f
531  * evaluated at the quadrature points
532  * \param outarray contains the values of the inner product of \a f
533  * with the different modes, i.e. \f$ outarray[p] = I[p]\f$
534  * (output of the function)
535  */
537  Array<OneD, NekDouble> &outarray)
538  {
539  v_IProductWRTBase(inarray, outarray);
540  }
541 
543  const Array<OneD, const NekDouble> &inarray,
544  Array<OneD, NekDouble> &outarray, int coll_check)
545  {
546  v_IProductWRTBase(base, inarray, outarray, coll_check);
547  }
548 
549  void IProductWRTDerivBase(const int dir,
550  const Array<OneD, const NekDouble> &inarray,
551  Array<OneD, NekDouble> &outarray)
552  {
553  v_IProductWRTDerivBase(dir, inarray, outarray);
554  }
555 
557  const Array<OneD, const NekDouble> &direction,
558  const Array<OneD, const NekDouble> &inarray,
559  Array<OneD, NekDouble> &outarray)
560  {
561  v_IProductWRTDirectionalDerivBase(direction, inarray, outarray);
562  }
563 
564  /// \brief Get the element id of this expansion when used
565  /// in a list by returning value of #m_elmt_id
566  inline int GetElmtId()
567  {
568  return m_elmt_id;
569  }
570 
571  /// \brief Set the element id of this expansion when used
572  /// in a list by returning value of #m_elmt_id
573  inline void SetElmtId(const int id)
574  {
575  m_elmt_id = id;
576  }
577 
578  /** \brief this function returns the physical coordinates of the
579  * quadrature points of the expansion
580  *
581  * This function is a wrapper around the virtual function
582  * \a v_GetCoords()
583  *
584  * \param coords an array containing the coordinates of the
585  * quadrature points (output of the function)
586  */
590  {
591  v_GetCoords(coords_1, coords_2, coords_3);
592  }
593 
594  /** \brief given the coordinates of a point of the element in the
595  * local collapsed coordinate system, this function calculates the
596  * physical coordinates of the point
597  *
598  * This function is a wrapper around the virtual function
599  * \a v_GetCoord()
600  *
601  * \param Lcoords the coordinates in the local collapsed
602  * coordinate system
603  * \param coords the physical coordinates (output of the function)
604  */
606  Array<OneD, NekDouble> &coord)
607  {
608  v_GetCoord(Lcoord, coord);
609  }
610 
612  {
613  return m_stdMatrixManager[mkey];
614  }
615 
617  {
618  return m_stdStaticCondMatrixManager[mkey];
619  }
620 
622  Array<OneD, NekDouble> &outarray)
623  {
624  v_NormVectorIProductWRTBase(Fx, outarray);
625  }
626 
628  const Array<OneD, NekDouble> &Fy,
629  Array<OneD, NekDouble> &outarray)
630  {
631  v_NormVectorIProductWRTBase(Fx, Fy, outarray);
632  }
633 
637  Array<OneD, NekDouble> &outarray)
638  {
639  v_NormVectorIProductWRTBase(Fx, Fy, Fz, outarray);
640  }
641 
643  const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
644  Array<OneD, NekDouble> &outarray)
645  {
646  v_NormVectorIProductWRTBase(Fvec, outarray);
647  }
648 
650  const LocalRegions::MatrixKey &mkey)
651  {
652  return v_GetLocStaticCondMatrix(mkey);
653  }
654 
656  const LocalRegions::MatrixKey &mkey)
657  {
658  return v_DropLocStaticCondMatrix(mkey);
659  }
660 
661  int CalcNumberOfCoefficients(const std::vector<unsigned int> &nummodes,
662  int &modes_offset)
663  {
664  return v_CalcNumberOfCoefficients(nummodes, modes_offset);
665  }
666 
667  // virtual functions related to LocalRegions
670  const Array<OneD, const NekDouble> &physvals);
671 
673  {
674  return v_GetCoordim();
675  }
676 
678  {
679  v_GetBoundaryMap(outarray);
680  }
681 
683  {
684  v_GetInteriorMap(outarray);
685  }
686 
687  int GetVertexMap(const int localVertexId, bool useCoeffPacking = false)
688  {
689  return v_GetVertexMap(localVertexId, useCoeffPacking);
690  }
691 
692  void GetTraceToElementMap(const int tid,
693  Array<OneD, unsigned int> &maparray,
694  Array<OneD, int> &signarray,
695  Orientation traceOrient = eForwards, int P = -1,
696  int Q = -1)
697  {
698  v_GetTraceToElementMap(tid, maparray, signarray, traceOrient, P, Q);
699  }
700 
701  void GetTraceCoeffMap(const unsigned int traceid,
702  Array<OneD, unsigned int> &maparray)
703  {
704  v_GetTraceCoeffMap(traceid, maparray);
705  }
706 
707  void GetElmtTraceToTraceMap(const unsigned int tid,
708  Array<OneD, unsigned int> &maparray,
709  Array<OneD, int> &signarray,
710  Orientation traceOrient = eForwards, int P = -1,
711  int Q = -1)
712  {
713  v_GetElmtTraceToTraceMap(tid, maparray, signarray, traceOrient, P, Q);
714  }
715 
716  void GetTraceInteriorToElementMap(const int tid,
717  Array<OneD, unsigned int> &maparray,
718  Array<OneD, int> &signarray,
719  const Orientation traceOrient = eForwards)
720  {
721  v_GetTraceInteriorToElementMap(tid, maparray, signarray, traceOrient);
722  }
723 
725  const int tid, int &numModes0, int &numModes1,
726  const Orientation traceOrient = eDir1FwdDir1_Dir2FwdDir2)
727  {
728  v_GetTraceNumModes(tid, numModes0, numModes1, traceOrient);
729  }
730 
732  Array<OneD, NekDouble> &outarray)
733  {
734  v_MultiplyByQuadratureMetric(inarray, outarray);
735  }
736 
738  const Array<OneD, const NekDouble> &inarray,
739  Array<OneD, NekDouble> &outarray)
740  {
741  v_MultiplyByStdQuadratureMetric(inarray, outarray);
742  }
743 
744  // Matrix Routines
745 
746  /** \brief this function generates the mass matrix
747  * \f$\mathbf{M}[i][j] =
748  * \int \phi_i(\mathbf{x}) \phi_j(\mathbf{x}) d\mathbf{x}\f$
749  *
750  * \return returns the mass matrix
751  */
752 
754  CreateGeneralMatrix(const StdMatrixKey &mkey);
755 
757  const Array<OneD, const NekDouble> &inarray,
758  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
759 
761  Array<OneD, NekDouble> &outarray,
762  const StdMatrixKey &mkey)
763  {
764  v_MassMatrixOp(inarray, outarray, mkey);
765  }
766 
768  Array<OneD, NekDouble> &outarray,
769  const StdMatrixKey &mkey)
770  {
771  v_LaplacianMatrixOp(inarray, outarray, mkey);
772  }
773 
774  void ReduceOrderCoeffs(int numMin,
775  const Array<OneD, const NekDouble> &inarray,
776  Array<OneD, NekDouble> &outarray)
777  {
778  v_ReduceOrderCoeffs(numMin, inarray, outarray);
779  }
780 
782  const StdMatrixKey &mkey)
783  {
784  v_SVVLaplacianFilter(array, mkey);
785  }
786 
788  const NekDouble exponent, const NekDouble cutoff)
789  {
790  v_ExponentialFilter(array, alpha, exponent, cutoff);
791  }
792 
793  void LaplacianMatrixOp(const int k1, const int k2,
794  const Array<OneD, const NekDouble> &inarray,
795  Array<OneD, NekDouble> &outarray,
796  const StdMatrixKey &mkey)
797  {
798  v_LaplacianMatrixOp(k1, k2, inarray, outarray, mkey);
799  }
800 
801  void WeakDerivMatrixOp(const int i,
802  const Array<OneD, const NekDouble> &inarray,
803  Array<OneD, NekDouble> &outarray,
804  const StdMatrixKey &mkey)
805  {
806  v_WeakDerivMatrixOp(i, inarray, outarray, mkey);
807  }
808 
810  const Array<OneD, const NekDouble> &inarray,
811  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey)
812  {
813  v_WeakDirectionalDerivMatrixOp(inarray, outarray, mkey);
814  }
815 
817  Array<OneD, NekDouble> &outarray,
818  const StdMatrixKey &mkey)
819  {
820  v_MassLevelCurvatureMatrixOp(inarray, outarray, mkey);
821  }
822 
824  const Array<OneD, const NekDouble> &inarray,
825  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey,
826  bool addDiffusionTerm = true)
827  {
828  v_LinearAdvectionDiffusionReactionMatrixOp(inarray, outarray, mkey,
829  addDiffusionTerm);
830  }
831 
832  /**
833  * @param inarray Input array @f$ \mathbf{u} @f$.
834  * @param outarray Output array @f$ \boldsymbol{\nabla^2u}
835  * + \lambda \boldsymbol{u} @f$.
836  * @param mkey
837  */
839  Array<OneD, NekDouble> &outarray,
840  const StdMatrixKey &mkey)
841  {
842  v_HelmholtzMatrixOp(inarray, outarray, mkey);
843  }
844 
846  {
847  return v_GenMatrix(mkey);
848  }
849 
851  Array<OneD, NekDouble> &out_d0,
854  {
855  v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
856  }
857 
858  void PhysDeriv(const int dir, const Array<OneD, const NekDouble> &inarray,
859  Array<OneD, NekDouble> &outarray)
860  {
861  v_PhysDeriv(dir, inarray, outarray);
862  }
863 
865  Array<OneD, NekDouble> &out_ds)
866  {
867  v_PhysDeriv_s(inarray, out_ds);
868  }
869 
871  Array<OneD, NekDouble> &out_dn)
872  {
873  v_PhysDeriv_n(inarray, out_dn);
874  }
875 
877  const Array<OneD, const NekDouble> &direction,
878  Array<OneD, NekDouble> &outarray)
879  {
880  v_PhysDirectionalDeriv(inarray, direction, outarray);
881  }
882 
884  Array<OneD, NekDouble> &out_d0,
887  {
888  v_StdPhysDeriv(inarray, out_d0, out_d1, out_d2);
889  }
890 
891  void StdPhysDeriv(const int dir,
892  const Array<OneD, const NekDouble> &inarray,
893  Array<OneD, NekDouble> &outarray)
894  {
895  v_StdPhysDeriv(dir, inarray, outarray);
896  }
897 
898  /** \brief This function evaluates the expansion at a single
899  * (arbitrary) point of the domain
900  *
901  * This function is a wrapper around the virtual function
902  * \a v_PhysEvaluate()
903  *
904  * Based on the value of the expansion at the quadrature
905  * points provided in \a physvals, this function
906  * calculates the value of the expansion at an arbitrary
907  * single points (with coordinates \f$ \mathbf{x_c}\f$
908  * given by the pointer \a coords). This operation,
909  * equivalent to \f[ u(\mathbf{x_c}) = \sum_p
910  * \phi_p(\mathbf{x_c}) \hat{u}_p \f] is evaluated using
911  * Lagrangian interpolants through the quadrature points:
912  * \f[ u(\mathbf{x_c}) = \sum_p h_p(\mathbf{x_c}) u_p\f]
913  *
914  * \param coords the coordinates of the single point
915  * \param physvals the interpolated field at the quadrature points
916  *
917  * \return returns the value of the expansion at the
918  * single point
919  */
921  const Array<OneD, const NekDouble> &physvals)
922  {
923  return v_PhysEvaluate(coords, physvals);
924  }
925 
926  /** \brief This function evaluates the expansion at a single
927  * (arbitrary) point of the domain
928  *
929  * This function is a wrapper around the virtual function
930  * \a v_PhysEvaluate()
931  *
932  * Based on the value of the expansion at the quadrature
933  * points provided in \a physvals, this function
934  * calculates the value of the expansion at an arbitrary
935  * single points associated with the interpolation
936  * matrices provided in \f$ I \f$.
937  *
938  * \param I an Array of lagrange interpolantes evaluated
939  * at the coordinate and going through the local physical
940  * quadrature
941  * \param physvals the interpolated field at the quadrature points
942  *
943  * \return returns the value of the expansion at the
944  * single point
945  */
947  const Array<OneD, const NekDouble> &physvals)
948  {
949  return v_PhysEvaluate(I, physvals);
950  }
951 
952  /**
953  * @brief This function evaluates the basis function mode @p mode at a
954  * point @p coords of the domain.
955  *
956  * This function uses barycentric interpolation with the tensor
957  * product separation of the basis function to improve performance.
958  *
959  * @param coord The coordinate inside the standard region.
960  * @param mode The mode number to be evaluated.
961  *
962  * @return The value of the basis function @p mode at @p coords.
963  */
965  int mode)
966  {
967  return v_PhysEvaluateBasis(coords, mode);
968  }
969 
970  /**
971  * \brief Convert local cartesian coordinate \a xi into local
972  * collapsed coordinates \a eta
973  **/
976  {
977  v_LocCoordToLocCollapsed(xi, eta);
978  }
979 
980  /**
981  * \brief Convert local collapsed coordinates \a eta into local
982  * cartesian coordinate \a xi
983  **/
986  {
987  v_LocCollapsedToLocCoord(eta, xi);
988  }
989 
991  const std::vector<unsigned int> &nummodes, int &modes_offset);
992 
995  Array<OneD, NekDouble> &outarray);
996 
1000  Array<OneD, NekDouble> &outarray);
1001 
1003  const Array<OneD, const NekDouble> &Fx,
1004  const Array<OneD, const NekDouble> &Fy,
1005  const Array<OneD, const NekDouble> &Fz,
1006  Array<OneD, NekDouble> &outarray);
1007 
1009  const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
1010  Array<OneD, NekDouble> &outarray);
1011 
1013  const LocalRegions::MatrixKey &mkey);
1014 
1016  const LocalRegions::MatrixKey &mkey);
1017 
1018  /** \brief Function to evaluate the discrete \f$ L_\infty\f$
1019  * error \f$ |\epsilon|_\infty = \max |u - u_{exact}|\f$ where \f$
1020  * u_{exact}\f$ is given by the array \a sol.
1021  *
1022  * This function takes the physical value space array \a m_phys as
1023  * approximate solution
1024  *
1025  * \param sol array of solution function at physical quadrature
1026  * points
1027  * \return returns the \f$ L_\infty \f$ error as a NekDouble.
1028  */
1030  Linf(const Array<OneD, const NekDouble> &phys,
1032 
1033  /** \brief Function to evaluate the discrete \f$ L_2\f$ error,
1034  * \f$ | \epsilon |_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2
1035  * dx \right]^{1/2} d\xi_1 \f$ where \f$ u_{exact}\f$ is given by
1036  * the array \a sol.
1037  *
1038  * This function takes the physical value space array \a m_phys as
1039  * approximate solution
1040  *
1041  * \param sol array of solution function at physical quadrature
1042  * points
1043  * \return returns the \f$ L_2 \f$ error as a double.
1044  */
1046  L2(const Array<OneD, const NekDouble> &phys,
1048 
1049  /** \brief Function to evaluate the discrete \f$ H^1\f$
1050  * error, \f$ | \epsilon |^1_{2} = \left [ \int^1_{-1} [u -
1051  * u_{exact}]^2 + \nabla(u - u_{exact})\cdot\nabla(u -
1052  * u_{exact})\cdot dx \right]^{1/2} d\xi_1 \f$ where \f$
1053  * u_{exact}\f$ is given by the array \a sol.
1054  *
1055  * This function takes the physical value space array
1056  * \a m_phys as approximate solution
1057  *
1058  * \param sol array of solution function at physical quadrature
1059  * points
1060  * \return returns the \f$ H_1 \f$ error as a double.
1061  */
1063  H1(const Array<OneD, const NekDouble> &phys,
1065 
1066  // I/O routines
1068  {
1070  p.reserve(m_base.size());
1071  for (int i = 0; i < m_base.size(); ++i)
1072  {
1073  p.push_back(m_base[i]->GetPointsKey());
1074  }
1075  return p;
1076  }
1077 
1079  const DNekScalMatSharedPtr &m_transformationmatrix)
1080  {
1081  return v_BuildInverseTransformationMatrix(m_transformationmatrix);
1082  }
1083 
1084  /** \brief This function performs an interpolation from
1085  * the physical space points provided at input into an
1086  * array of equispaced points which are not the collapsed
1087  * coordinate. So for a tetrahedron you will only get a
1088  * tetrahedral number of values.
1089  *
1090  * This is primarily used for output purposes to get a
1091  * better distribution of points more suitable for most
1092  * postprocessing
1093  */
1095  const Array<OneD, const NekDouble> &inarray,
1096  Array<OneD, NekDouble> &outarray, int npset = -1);
1097 
1098  /** \brief This function provides the connectivity of
1099  * local simplices (triangles or tets) to connect the
1100  * equispaced data points provided by
1101  * PhysInterpToSimplexEquiSpaced
1102  *
1103  * This is a virtual call to the function
1104  * \a v_GetSimplexEquiSpaceConnectivity
1105  */
1107  Array<OneD, int> &conn, bool standard = true)
1108  {
1109  v_GetSimplexEquiSpacedConnectivity(conn, standard);
1110  }
1111 
1112  /** \brief This function performs a
1113  * projection/interpolation from the equispaced points
1114  * sometimes used in post-processing onto the coefficient
1115  * space
1116  *
1117  * This is primarily used for output purposes to use a
1118  * more even distribution of points more suitable for alot of
1119  * postprocessing
1120  */
1122  const Array<OneD, const NekDouble> &inarray,
1123  Array<OneD, NekDouble> &outarray);
1124 
1125  template <class T> std::shared_ptr<T> as()
1126  {
1127  return std::dynamic_pointer_cast<T>(shared_from_this());
1128  }
1129 
1131  Array<OneD, NekDouble> &outarray,
1132  bool multiplybyweights = true)
1133  {
1134  v_IProductWRTBase_SumFac(inarray, outarray, multiplybyweights);
1135  }
1136 
1138  DNekMatSharedPtr &mat)
1139  {
1140  v_GenStdMatBwdDeriv(dir, mat);
1141  }
1142 
1143 protected:
1145  m_base; /**< Bases needed for the expansion */
1147  int m_ncoeffs; /**< Total number of coefficients used in the expansion */
1148 
1153 
1155  {
1156  return v_CreateStdMatrix(mkey);
1157  }
1158 
1159  /** \brief Create the static condensation of a matrix when
1160  using a boundary interior decomposition
1161 
1162  If a matrix system can be represented by
1163  \f$ Mat = \left [ \begin{array}{cc}
1164  A & B \\
1165  C & D \end{array} \right ] \f$
1166  This routine creates a matrix containing the statically
1167  condense system of the form
1168  \f$ Mat = \left [ \begin{array}{cc}
1169  A - B D^{-1} C & B D^{-1} \\
1170  D^{-1} C & D^{-1} \end{array} \right ] \f$
1171  **/
1174 
1176  const Array<OneD, const NekDouble> &inarray,
1177  Array<OneD, NekDouble> &outarray);
1178 
1180  Array<OneD, NekDouble> &outarray)
1181  {
1182  v_BwdTrans_SumFac(inarray, outarray);
1183  }
1184 
1186  const int dir, const Array<OneD, const NekDouble> &inarray,
1187  Array<OneD, NekDouble> &outarray)
1188  {
1189  v_IProductWRTDerivBase_SumFac(dir, inarray, outarray);
1190  }
1191 
1193  const Array<OneD, const NekDouble> &direction,
1194  const Array<OneD, const NekDouble> &inarray,
1195  Array<OneD, NekDouble> &outarray)
1196  {
1197  v_IProductWRTDirectionalDerivBase_SumFac(direction, inarray, outarray);
1198  }
1199 
1200  // The term _MatFree denotes that the action of the
1201  // MatrixOperation is done withouth actually using the
1202  // matrix (which then needs to be stored/calculated).
1203  // Although this does not strictly mean that no matrix
1204  // operations are involved in the evaluation of the
1205  // operation, we use this term in the same context used as
1206  // in the following paper: R. C. Kirby, M. G. Knepley,
1207  // A. Logg, and L. R. Scott, "Optimizing the evaluation of
1208  // finite element matrices," SISC 27:741-758 (2005)
1210  const Array<OneD, const NekDouble> &inarray,
1211  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1212 
1214  const Array<OneD, const NekDouble> &inarray,
1215  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1216 
1218  Array<OneD, NekDouble> &outarray,
1219  const StdMatrixKey &mkey)
1220  {
1221  v_LaplacianMatrixOp_MatFree(inarray, outarray, mkey);
1222  }
1223 
1225  const Array<OneD, const NekDouble> &inarray,
1227  {
1228  v_LaplacianMatrixOp_MatFree_Kernel(inarray, outarray, wsp);
1229  }
1230 
1232  const Array<OneD, const NekDouble> &inarray,
1233  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1234 
1236  const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
1237  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1238 
1240  const int i, const Array<OneD, const NekDouble> &inarray,
1241  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1242 
1244  const Array<OneD, const NekDouble> &inarray,
1245  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1246 
1248  const Array<OneD, const NekDouble> &inarray,
1249  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1250 
1252  const Array<OneD, const NekDouble> &inarray,
1253  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey,
1254  bool addDiffusionTerm = true);
1255 
1257  Array<OneD, NekDouble> &outarray,
1258  const StdMatrixKey &mkey)
1259  {
1260  v_HelmholtzMatrixOp_MatFree(inarray, outarray, mkey);
1261  }
1262 
1264  const Array<OneD, const NekDouble> &inarray,
1265  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1266 
1269  Array<OneD, NekDouble> &outarray);
1270 
1273 
1275  const Array<OneD, const NekDouble> &Lcoord,
1276  const Array<OneD, const NekDouble> &physvals);
1277 
1278  STD_REGIONS_EXPORT virtual void v_GenStdMatBwdDeriv(const int dir,
1279  DNekMatSharedPtr &mat)
1280  {
1281  boost::ignore_unused(dir, mat);
1282  NEKERROR(ErrorUtil::efatal, "not defined");
1283  }
1284 
1286  const Array<OneD, const NekDouble> &inarray,
1287  Array<OneD, NekDouble> &outarray);
1288 
1289  /**
1290  * @brief This function performs the barycentric interpolation of
1291  * the polynomial stored in @p coord at a point @p physvals using
1292  * barycentric interpolation weights in direction @tparam DIR.
1293  *
1294  * This method is intended to be used a helper function for
1295  * StdExpansion::PhysEvaluate and its elemental instances, so that
1296  * the calling method should provide @p coord for x, y and z
1297  * sequentially and the appropriate @p physvals and @p weights for
1298  * that particular direction.
1299  *
1300  * @param coord The coordinate of the single point.
1301  * @param physvals The polynomial stored at each quadrature point.
1302  * @tparam DIR The direction of evaluation.
1303  *
1304  * @return The value of @p physvals at @p coord in direction @p dir.
1305  */
1306  template <int DIR>
1307  inline NekDouble BaryEvaluate(const NekDouble &coord,
1308  const NekDouble *physvals)
1309  {
1310  NekDouble numer = 0.0, denom = 0.0;
1311 
1312  ASSERTL2(DIR < m_base.size(),
1313  "Direction should be less than shape dimension.");
1314 
1315  const Array<OneD, const NekDouble> &z = m_base[DIR]->GetZ();
1316  const Array<OneD, const NekDouble> &bw = m_base[DIR]->GetBaryWeights();
1317 
1318  const auto nquad = z.size();
1319 
1320  for (int i = 0; i < nquad; ++i)
1321  {
1322  NekDouble xdiff = z[i] - coord;
1323  NekDouble pval = physvals[i];
1324 
1325  /*
1326  * (in this specific case) you actually
1327  * want to do the comparison exactly
1328  * (believe it or not!) See chapter 7 of
1329  * the paper here:
1330  *https://people.maths.ox.ac.uk/trefethen/barycentric.pdf
1331  */
1332  if (xdiff == 0.0)
1333  {
1334  return pval;
1335  }
1336 
1337  NekDouble tmp = bw[i] / xdiff;
1338  numer += tmp * pval;
1339  denom += tmp;
1340  }
1341 
1342  return numer / denom;
1343  }
1344 
1345  /**
1346  * @brief This function evaluates the basis function mode @p mode at
1347  * a point @p coords of the domain in direction @dir.
1348  *
1349  * @param coord The coordinate inside the standard region.
1350  * @param mode The mode number to be evaluated of #m_base[dir]
1351  * @param dir The direction of interpolation.
1352  *
1353  * @return The value of the basis function @p mode at @p coords in
1354  * direction @p dir.
1355  */
1356  template <int DIR>
1357  inline NekDouble BaryEvaluateBasis(const NekDouble &coord, const int &mode)
1358  {
1359  const int nquad = m_base[DIR]->GetNumPoints();
1360  return BaryEvaluate<DIR>(coord,
1361  &(m_base[DIR]->GetBdata())[0] + nquad * mode);
1362  }
1363 
1364 private:
1365  // Virtual functions
1366  STD_REGIONS_EXPORT virtual int v_GetNverts() const = 0;
1367  STD_REGIONS_EXPORT virtual int v_GetNtraces() const;
1368 
1369  STD_REGIONS_EXPORT virtual int v_NumBndryCoeffs() const;
1370  STD_REGIONS_EXPORT virtual int v_NumDGBndryCoeffs() const;
1371 
1372  STD_REGIONS_EXPORT virtual int v_GetTraceNcoeffs(const int i) const;
1373  STD_REGIONS_EXPORT virtual int v_GetTotalTraceIntNcoeffs() const;
1374  STD_REGIONS_EXPORT virtual int v_GetTraceIntNcoeffs(const int i) const;
1375  STD_REGIONS_EXPORT virtual int v_GetTraceNumPoints(const int i) const;
1376 
1378  const int i, const int k) const;
1379 
1381  const int i, const int j) const;
1382 
1384  const;
1385 
1387 
1388  STD_REGIONS_EXPORT virtual std::shared_ptr<StdExpansion> v_GetStdExp(
1389  void) const;
1390 
1391  STD_REGIONS_EXPORT virtual std::shared_ptr<StdExpansion> v_GetLinStdExp(
1392  void) const;
1393 
1394  STD_REGIONS_EXPORT virtual int v_GetShapeDimension() const;
1395 
1397 
1399 
1401  const Array<OneD, const NekDouble> &inarray,
1402  Array<OneD, NekDouble> &outarray) = 0;
1403 
1404  /**
1405  * @brief Transform a given function from physical quadrature space
1406  * to coefficient space.
1407  * @see StdExpansion::FwdTrans
1408  */
1410  const Array<OneD, const NekDouble> &inarray,
1411  Array<OneD, NekDouble> &outarray) = 0;
1412 
1413  /**
1414  * @brief Calculates the inner product of a given function \a f
1415  * with the different modes of the expansion
1416  */
1418  const Array<OneD, const NekDouble> &inarray,
1419  Array<OneD, NekDouble> &outarray) = 0;
1420 
1422  const Array<OneD, const NekDouble> &base,
1423  const Array<OneD, const NekDouble> &inarray,
1424  Array<OneD, NekDouble> &outarray, int coll_check)
1425  {
1426  boost::ignore_unused(base, inarray, outarray, coll_check);
1427  NEKERROR(ErrorUtil::efatal, "StdExpansion::v_IProductWRTBase has no "
1428  "(and should have no) implementation");
1429  }
1430 
1432  const int dir, const Array<OneD, const NekDouble> &inarray,
1433  Array<OneD, NekDouble> &outarray);
1434 
1436  const Array<OneD, const NekDouble> &direction,
1437  const Array<OneD, const NekDouble> &inarray,
1438  Array<OneD, NekDouble> &outarray);
1439 
1441  const Array<OneD, const NekDouble> &inarray,
1442  Array<OneD, NekDouble> &outarray);
1443 
1445  const Array<OneD, const NekDouble> &inarray);
1446 
1447  STD_REGIONS_EXPORT virtual void v_PhysDeriv(
1448  const Array<OneD, const NekDouble> &inarray,
1450  Array<OneD, NekDouble> &out_d3);
1451 
1452  STD_REGIONS_EXPORT virtual void v_PhysDeriv_s(
1453  const Array<OneD, const NekDouble> &inarray,
1454  Array<OneD, NekDouble> &out_ds);
1455 
1456  STD_REGIONS_EXPORT virtual void v_PhysDeriv_n(
1457  const Array<OneD, const NekDouble> &inarray,
1458  Array<OneD, NekDouble> &out_dn);
1459 
1460  STD_REGIONS_EXPORT virtual void v_PhysDeriv(
1461  const int dir, const Array<OneD, const NekDouble> &inarray,
1462  Array<OneD, NekDouble> &out_d0);
1463 
1465  const Array<OneD, const NekDouble> &inarray,
1466  const Array<OneD, const NekDouble> &direction,
1467  Array<OneD, NekDouble> &outarray);
1468 
1469  STD_REGIONS_EXPORT virtual void v_StdPhysDeriv(
1470  const Array<OneD, const NekDouble> &inarray,
1472  Array<OneD, NekDouble> &out_d3);
1473 
1474  STD_REGIONS_EXPORT virtual void v_StdPhysDeriv(
1475  const int dir, const Array<OneD, const NekDouble> &inarray,
1476  Array<OneD, NekDouble> &outarray);
1477 
1479  const Array<OneD, const NekDouble> &coords,
1480  const Array<OneD, const NekDouble> &physvals);
1481 
1484  const Array<OneD, const NekDouble> &physvals);
1485 
1487  const Array<OneD, const NekDouble> &coords, int mode);
1488 
1491 
1494 
1495  STD_REGIONS_EXPORT virtual void v_FillMode(
1496  const int mode, Array<OneD, NekDouble> &outarray);
1497 
1499  const StdMatrixKey &mkey);
1500 
1502  const StdMatrixKey &mkey);
1503 
1504  STD_REGIONS_EXPORT virtual void v_GetCoords(
1505  Array<OneD, NekDouble> &coords_0, Array<OneD, NekDouble> &coords_1,
1506  Array<OneD, NekDouble> &coords_2);
1507 
1508  STD_REGIONS_EXPORT virtual void v_GetCoord(
1509  const Array<OneD, const NekDouble> &Lcoord,
1510  Array<OneD, NekDouble> &coord);
1511 
1512  STD_REGIONS_EXPORT virtual int v_GetCoordim(void);
1513 
1514  STD_REGIONS_EXPORT virtual void v_GetBoundaryMap(
1515  Array<OneD, unsigned int> &outarray);
1516 
1517  STD_REGIONS_EXPORT virtual void v_GetInteriorMap(
1518  Array<OneD, unsigned int> &outarray);
1519 
1520  STD_REGIONS_EXPORT virtual int v_GetVertexMap(int localVertexId,
1521  bool useCoeffPacking = false);
1522 
1524  const int tid, Array<OneD, unsigned int> &maparray,
1525  Array<OneD, int> &signarray, Orientation traceOrient = eForwards,
1526  int P = -1, int Q = -1);
1527 
1529  const unsigned int traceid, Array<OneD, unsigned int> &maparray);
1530 
1532  const unsigned int tid, Array<OneD, unsigned int> &maparray,
1533  Array<OneD, int> &signarray, Orientation traceOrient = eForwards,
1534  int P = -1, int Q = -1);
1535 
1537  const int eid, Array<OneD, unsigned int> &maparray,
1538  Array<OneD, int> &signarray, const Orientation traceOrient = eForwards);
1539 
1541  const int fid, int &numModes0, int &numModes1,
1542  Orientation traceOrient = eDir1FwdDir1_Dir2FwdDir2);
1543 
1545  const int vertex, const Array<OneD, const NekDouble> &inarray,
1546  NekDouble &outarray);
1547 
1549  const Array<OneD, const NekDouble> &inarray,
1550  Array<OneD, NekDouble> &outarray);
1551 
1553  const Array<OneD, const NekDouble> &inarray,
1554  Array<OneD, NekDouble> &outarray);
1555 
1557  const Array<OneD, const NekDouble> &inarray,
1558  Array<OneD, NekDouble> &outarray, bool multiplybyweights = true);
1559 
1561  const int dir, const Array<OneD, const NekDouble> &inarray,
1562  Array<OneD, NekDouble> &outarray);
1563 
1565  const Array<OneD, const NekDouble> &direction,
1566  const Array<OneD, const NekDouble> &inarray,
1567  Array<OneD, NekDouble> &outarray);
1568 
1569  STD_REGIONS_EXPORT virtual void v_MassMatrixOp(
1570  const Array<OneD, const NekDouble> &inarray,
1571  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1572 
1574  const Array<OneD, const NekDouble> &inarray,
1575  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1576 
1578  Array<OneD, NekDouble> &array, const StdMatrixKey &mkey);
1579 
1581  Array<OneD, NekDouble> &array, const NekDouble alpha,
1582  const NekDouble exponent, const NekDouble cutoff);
1583 
1585  int numMin, const Array<OneD, const NekDouble> &inarray,
1586  Array<OneD, NekDouble> &outarray);
1587 
1589  const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
1590  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1591 
1593  const int i, const Array<OneD, const NekDouble> &inarray,
1594  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1595 
1597  const Array<OneD, const NekDouble> &inarray,
1598  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1599 
1601  const Array<OneD, const NekDouble> &inarray,
1602  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1603 
1605  const Array<OneD, const NekDouble> &inarray,
1606  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey,
1607  bool addDiffusionTerm = true);
1608 
1610  const Array<OneD, const NekDouble> &inarray,
1611  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1612 
1614  const Array<OneD, const NekDouble> &inarray,
1615  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1616 
1618  const Array<OneD, const NekDouble> &inarray,
1620 
1622  const Array<OneD, const NekDouble> &inarray,
1623  Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey);
1624 
1626  const DNekScalMatSharedPtr &m_transformationmatrix);
1627 
1629  Array<OneD, int> &conn, bool standard = true);
1630 };
1631 
1632 typedef std::shared_ptr<StdExpansion> StdExpansionSharedPtr;
1633 typedef std::vector<StdExpansionSharedPtr> StdExpansionVector;
1634 
1635 /**
1636  * This function is a wrapper around the virtual function
1637  * \a v_FwdTrans()
1638  *
1639  * Given a function evaluated at the quadrature points, this
1640  * function calculates the expansion coefficients such that the
1641  * resulting expansion approximates the original function.
1642  *
1643  * The calculation of the expansion coefficients is done using a
1644  * Galerkin projection. This is equivalent to the operation:
1645  * \f[ \mathbf{\hat{u}} = \mathbf{M}^{-1} \mathbf{I}\f]
1646  * where
1647  * - \f$\mathbf{M}[p][q]= \int\phi_p(\mathbf{\xi})\phi_q(
1648  * \mathbf{\xi}) d\mathbf{\xi}\f$ is the Mass matrix
1649  * - \f$\mathbf{I}[p] = \int\phi_p(\mathbf{\xi}) u(\mathbf{\xi})
1650  * d\mathbf{\xi}\f$
1651  *
1652  * This function takes the array \a inarray as the values of the
1653  * function evaluated at the quadrature points
1654  * (i.e. \f$\mathbf{u}\f$),
1655  * and stores the resulting coefficients \f$\mathbf{\hat{u}}\f$
1656  * in the \a outarray
1657  *
1658  * @param inarray array of the function discretely evaluated at the
1659  * quadrature points
1660  *
1661  * @param outarray array of the function coefficieints
1662  */
1664  Array<OneD, NekDouble> &outarray)
1665 {
1666  v_FwdTrans(inarray, outarray);
1667 }
1668 
1669 } // namespace StdRegions
1670 } // namespace Nektar
1671 
1672 #endif // STANDARDDEXPANSION_H
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:249
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
Definition: ErrorUtil.hpp:272
#define STD_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:50
Defines a specification for a set of points.
Definition: Points.h:59
The base class for all shapes.
Definition: StdExpansion.h:71
void PhysDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:858
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:677
virtual void v_LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
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)
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.
Definition: StdExpansion.h:130
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.
Definition: StdExpansion.h:140
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
const LibUtilities::BasisSharedPtr & GetBasis(int dir) const
This function gets the shared point to basis in the dir direction.
Definition: StdExpansion.h:118
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.
Definition: StdExpansion.h:499
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.
Definition: StdExpansion.h:347
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)
Definition: StdExpansion.h:864
void WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:809
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)
Definition: StdExpansion.h:655
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:634
int GetTraceNumPoints(const int i) const
This function returns the number of quadrature points belonging to the i-th trace.
Definition: StdExpansion.h:289
void GetElmtTraceToTraceMap(const unsigned int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
Definition: StdExpansion.h:707
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.
Definition: StdExpansion.h:163
virtual void v_IProductWRTDirectionalDerivBase_SumFac(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetTraceNumPoints(const int i) const
void HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual int v_GetNverts() const =0
void BwdTrans_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
LibUtilities::PointsKey GetTracePointsKey(const int i, int k=-1) const
This function returns the basis key belonging to the i-th trace.
Definition: StdExpansion.h:325
void MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:816
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)
virtual std::shared_ptr< StdExpansion > v_GetStdExp(void) const
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:611
void LaplacianMatrixOp(const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:793
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 bool v_IsBoundaryInteriorExpansion()
virtual void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
virtual int v_GetTraceNcoeffs(const int i) const
int GetTraceIntNcoeffs(const int i) const
Definition: StdExpansion.h:274
void LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
Convert local cartesian coordinate xi into local collapsed coordinates eta.
Definition: StdExpansion.h:974
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)
Definition: StdExpansion.h:616
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)
Definition: StdExpansion.h:801
int EvalBasisNumModesMax(void) const
This function returns the maximum number of expansion modes over all local directions.
Definition: StdExpansion.h:188
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)
Definition: StdExpansion.h:876
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)
Definition: StdExpansion.h:445
void MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:760
virtual int v_GetTotalTraceIntNcoeffs() const
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)
Definition: StdExpansion.h:661
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,...
Definition: StdExpansion.h:605
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void StdPhysDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:891
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)
Definition: StdExpansion.h:870
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.
Definition: StdExpansion.h:106
void BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
Definition: StdExpansion.h:649
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)
virtual int v_GetShapeDimension() const
void SetElmtId(const int id)
Set the element id of this expansion when used in a list by returning value of m_elmt_id.
Definition: StdExpansion.h:573
const LibUtilities::BasisKey GetTraceBasisKey(const int i, int k=-1) const
This function returns the basis key belonging to the i-th trace.
Definition: StdExpansion.h:307
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetTraceIntNcoeffs(const int i) const
int GetVertexMap(const int localVertexId, bool useCoeffPacking=false)
Definition: StdExpansion.h:687
void GetTraceCoeffMap(const unsigned int traceid, Array< OneD, unsigned int > &maparray)
Definition: StdExpansion.h:701
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:621
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix
virtual int v_NumBndryCoeffs() const
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
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...
Definition: StdExpansion.h:536
int GetNtraces() const
Returns the number of trace elements connected to this element.
Definition: StdExpansion.h:359
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.
Definition: StdExpansion.h:254
std::shared_ptr< T > as()
virtual LibUtilities::ShapeType v_DetShapeType() const
void LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:767
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 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
Definition: StdExpansion.h:587
void IProductWRTDirectionalDerivBase(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:556
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.
Definition: StdExpansion.h:566
virtual void v_ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
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.
Definition: StdExpansion.h:920
void GetTraceToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
Definition: StdExpansion.h:692
void IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:549
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.
Definition: StdExpansion.h:375
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
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)
void GetInteriorMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:682
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Backward transformation from coefficient space to physical space.
Definition: StdExpansion.h:432
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)
Definition: StdExpansion.h:716
int GetTraceNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th trace.
Definition: StdExpansion.h:269
DNekMatSharedPtr GenMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:845
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_NumDGBndryCoeffs() const
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.
Definition: StdExpansion.h:964
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)
Definition: StdExpansion.h:787
int GetNumBases() const
This function returns the number of 1D bases used in the expansion.
Definition: StdExpansion.h:97
DNekMatSharedPtr BuildInverseTransformationMatrix(const DNekScalMatSharedPtr &m_transformationmatrix)
void GetTraceNumModes(const int tid, int &numModes0, int &numModes1, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
Definition: StdExpansion.h:724
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:213
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)
void ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:774
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)
Definition: StdExpansion.h:823
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:226
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)
Definition: StdExpansion.h:731
virtual void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
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)
Definition: StdExpansion.h:883
void MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:737
void LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
Convert local collapsed coordinates eta into local cartesian coordinate xi.
Definition: StdExpansion.h:984
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)
Definition: StdExpansion.h:838
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.
Definition: StdExpansion.h:946
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 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)
Definition: StdExpansion.h:542
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrates the specified function over the domain.
NekDouble BaryEvaluate(const NekDouble &coord, const NekDouble *physvals)
This function performs the barycentric interpolation of the polynomial stored in coord at a point phy...
NekDouble BaryEvaluateBasis(const NekDouble &coord, const int &mode)
void SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
Definition: StdExpansion.h:781
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.
Definition: StdExpansion.h:176
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)
Definition: StdExpansion.h:850
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
std::shared_ptr< StdExpansion > GetStdExp(void) const
Definition: StdExpansion.h:380
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.
Definition: StdExpansion.h:240
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)
void NormVectorIProductWRTBase(const Array< OneD, const Array< OneD, NekDouble >> &Fvec, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:642
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:627
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 const LibUtilities::BasisKey v_GetTraceBasisKey(const int i, const int k) const
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)
std::shared_ptr< StdExpansion > GetLinStdExp(void) const
Definition: StdExpansion.h:385
NekDouble Integral(const Array< OneD, const NekDouble > &inarray)
This function integrates the specified function over the domain.
Definition: StdExpansion.h:481
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:250
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::vector< StdExpansionSharedPtr > StdExpansionVector
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
Definition: NekTypeDefs.hpp:77
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:79
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble