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 <vector>
41 #include <memory>
42 
43 #include <boost/core/ignore_unused.hpp>
44 
49 namespace Nektar { namespace LocalRegions { class MatrixKey; class Expansion; } }
50 
51 namespace Nektar
52 {
53  namespace StdRegions
54  {
55 
56  /** \brief The base class for all shapes
57  *
58  * This is the lowest level basic class for all shapes and so
59  * contains the definition of common data and common routine to all
60  * elements
61  */
62  class StdExpansion : public std::enable_shared_from_this<StdExpansion>
63  {
64  public:
65 
66  /** \brief Default Constructor */
68 
69  /** \brief Constructor */
70  STD_REGIONS_EXPORT StdExpansion(const int numcoeffs, const int numbases,
74 
75 
76  /** \brief Copy Constructor */
78 
79  /** \brief Destructor */
81 
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  {
102  return(m_base);
103  }
104 
105  /** \brief This function gets the shared point to basis in
106  * the \a dir direction
107  *
108  * \return returns the shared pointer to the basis in
109  * directin \a dir
110  */
111  inline const LibUtilities::BasisSharedPtr& GetBasis(int dir) const
112  {
113  ASSERTL1(dir < m_base.size(),
114  "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 i;
137  int nqtot = 1;
138 
139  for(i=0; i < m_base.size(); ++i)
140  {
141  nqtot *= m_base[i]->GetNumPoints();
142  }
143 
144  return nqtot;
145  }
146 
147 
148  /** \brief This function returns the type of basis used in the \a dir
149  * direction
150  *
151  * The different types of bases implemented in the code are defined
152  * in the LibUtilities::BasisType enumeration list. As a result, the
153  * function will return one of the types of this enumeration list.
154  *
155  * \param dir the direction
156  * \return returns the type of basis used in the \a dir direction
157  */
158  inline LibUtilities::BasisType GetBasisType(const int dir) const
159  {
160  ASSERTL1(dir < m_base.size(), "dir is larger than m_numbases");
161  return(m_base[dir]->GetBasisType());
162  }
163 
164  /** \brief This function returns the number of expansion modes
165  * in the \a dir direction
166  *
167  * \param dir the direction
168  * \return returns the number of expansion modes in the \a dir
169  * direction
170  */
171  inline int GetBasisNumModes(const int dir) const
172  {
173  ASSERTL1(dir < m_base.size(),"dir is larger than m_numbases");
174  return(m_base[dir]->GetNumModes());
175  }
176 
177  /** \brief This function returns the maximum number of
178  * expansion modes over all local directions
179  *
180  * \return returns the maximum number of expansion modes
181  * over all local directions
182  */
183  inline int EvalBasisNumModesMax(void) const
184  {
185  int i;
186  int returnval = 0;
187 
188  for(i = 0; i < m_base.size(); ++i)
189  {
190  returnval = std::max(returnval, m_base[i]->GetNumModes());
191  }
192 
193  return returnval;
194  }
195 
196  /** \brief This function returns the type of quadrature points used
197  * in the \a dir direction
198  *
199  * The different types of quadrature points implemented in the code
200  * are defined in the LibUtilities::PointsType enumeration list.
201  * As a result, the function will return one of the types of this
202  * enumeration list.
203  *
204  * \param dir the direction
205  * \return returns the type of quadrature points used in the \a dir
206  * direction
207  */
208  inline LibUtilities::PointsType GetPointsType(const int dir) const
209  {
210  ASSERTL1(dir < m_base.size(), "dir is larger than m_numbases");
211  return(m_base[dir]->GetPointsType());
212  }
213 
214  /** \brief This function returns the number of quadrature points
215  * in the \a dir direction
216  *
217  * \param dir the direction
218  * \return returns the number of quadrature points in the \a dir
219  * direction
220  */
221  inline int GetNumPoints(const int dir) const
222  {
223  ASSERTL1(dir < m_base.size() || dir == 0,
224  "dir is larger than m_numbases");
225  return(m_base.size() > 0 ? m_base[dir]->GetNumPoints() : 1);
226  }
227 
228  /** \brief This function returns a pointer to the array containing
229  * the quadrature points in \a dir direction
230  *
231  * \param dir the direction
232  * \return returns a pointer to the array containing
233  * the quadrature points in \a dir direction
234  */
235  inline const Array<OneD, const NekDouble>& GetPoints(const int dir) const
236  {
237  return m_base[dir]->GetZ();
238  }
239 
240  // Wrappers around virtual Functions
241  /** \brief This function returns the number of vertices of the
242  * expansion domain
243  *
244  * This function is a wrapper around the virtual function
245  * \a v_GetNverts()
246  *
247  * \return returns the number of vertices of the expansion domain
248  */
249  int GetNverts() const
250  {
251  return v_GetNverts();
252  }
253 
254 
255  /** \brief This function returns the number of expansion coefficients
256  * belonging to the \a i-th trace
257  *
258  * This function is a wrapper around the virtual function
259  * \a v_GetTraceNcoeffs()
260  *
261  * \param i specifies which trace
262  * \return returns the number of expansion coefficients belonging to
263  * the \a i-th trace
264  */
265  int GetTraceNcoeffs(const int i) const
266  {
267  return v_GetTraceNcoeffs(i);
268  }
269 
270  int GetTraceIntNcoeffs(const int i) const
271  {
272  return v_GetTraceIntNcoeffs(i);
273  }
274 
275 
276  /** \brief This function returns the number of quadrature points
277  * belonging to the \a i-th trace
278  *
279  * This function is a wrapper around the virtual function
280  * \a v_GetTraceNumPoints()
281  *
282  * \param i specifies which trace id
283  * \return returns the number of quadrature points belonging to
284  * the \a i-th trace
285  */
286  int GetTraceNumPoints(const int i) const
287  {
288  return v_GetTraceNumPoints(i);
289  }
290 
291  /** \brief This function returns the basis key belonging
292  * to the \a i-th trace
293  *
294  * This function is a wrapper around the virtual function
295  * \a v_GetTraceBasisKey()
296  *
297  * \param i specifies which trace id
298  * \param k is the direction of the basis key for 2D traces
299  *
300  * \return returns the number of Basis key of the ith
301  * trace in the k th direction (when trace is a 2D
302  * object)
303  */
305  int k = -1) const
306  {
307  return v_GetTraceBasisKey(i, k);
308  }
309 
310  /** \brief This function returns the basis key belonging
311  * to the \a i-th trace
312  *
313  * This function is a wrapper around the virtual function
314  * \a v_GetTracePointsKey()
315  *
316  * \param i specifies which trace id
317  * \param k is the direction of the basis key for 2D traces
318  *
319  * \return returns the number of Points key of the ith
320  * trace in the k th direction (when trace is a 2D
321  * object)
322  */
324  int k = -1) const
325  {
326  return v_GetTracePointsKey(i, k);
327  }
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 
341  /** \brief This function returns the type of expansion
342  * Nodal point type if defined
343  *
344  * This function is a wrapper around the virtual function
345  * \a v_GetNodalPointsKey()
346  *
347  */
349  {
350  return v_GetNodalPointsKey();
351  };
352 
353  /**
354  * @brief Returns the number of trace elements connected to this
355  * element.
356  *
357  * For example, a quadrilateral has four edges, so this function
358  * would return 4.
359  */
360  int GetNtraces() const
361  {
362  return v_GetNtraces();
363  }
364 
365  /** \brief This function returns the shape of the expansion domain
366  *
367  * This function is a wrapper around the virtual function
368  * \a v_DetShapeType()
369  *
370  * The different shape types implemented in the code are defined
371  * in the ::ShapeType enumeration list. As a result, the
372  * function will return one of the types of this enumeration list.
373  *
374  * \return returns the shape of the expansion domain
375  */
377  {
378  return v_DetShapeType();
379  }
380 
381  std::shared_ptr<StdExpansion> GetStdExp(void) const
382  {
383  return v_GetStdExp();
384  }
385 
386  std::shared_ptr<StdExpansion> GetLinStdExp(void) const
387  {
388  return v_GetLinStdExp();
389  }
390 
391  int GetShapeDimension() const
392  {
393  return v_GetShapeDimension();
394  }
395 
397  {
399  }
400 
402  {
403  return v_IsNodalNonTensorialExp();
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_FwdTrans_BndConstrained(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>& base,
545  const Array<OneD, const NekDouble>& inarray,
546  Array<OneD, NekDouble> &outarray,
547  int coll_check)
548  {
549  v_IProductWRTBase(base, inarray, outarray, coll_check);
550  }
551 
552 
554  const int dir,
555  const Array<OneD, const NekDouble>& inarray,
556  Array<OneD, NekDouble> &outarray)
557  {
558  v_IProductWRTDerivBase(dir,inarray, outarray);
559  }
560 
562  const Array<OneD, const NekDouble>& direction,
563  const Array<OneD, const NekDouble>& inarray,
564  Array<OneD, NekDouble> &outarray)
565  {
566  v_IProductWRTDirectionalDerivBase(direction, inarray, outarray);
567  }
568 
569  /// \brief Get the element id of this expansion when used
570  /// in a list by returning value of #m_elmt_id
571  inline int GetElmtId()
572  {
573  return m_elmt_id;
574  }
575 
576 
577  /// \brief Set the element id of this expansion when used
578  /// in a list by returning value of #m_elmt_id
579  inline void SetElmtId(const int id)
580  {
581  m_elmt_id = id;
582  }
583 
584  /** \brief this function returns the physical coordinates of the
585  * quadrature points of the expansion
586  *
587  * This function is a wrapper around the virtual function
588  * \a v_GetCoords()
589  *
590  * \param coords an array containing the coordinates of the
591  * quadrature points (output of the function)
592  */
596  {
597  v_GetCoords(coords_1,coords_2,coords_3);
598  }
599 
600  /** \brief given the coordinates of a point of the element in the
601  * local collapsed coordinate system, this function calculates the
602  * physical coordinates of the point
603  *
604  * This function is a wrapper around the virtual function
605  * \a v_GetCoord()
606  *
607  * \param Lcoords the coordinates in the local collapsed
608  * coordinate system
609  * \param coords the physical coordinates (output of the function)
610  */
612  Array<OneD, NekDouble> &coord)
613  {
614  v_GetCoord(Lcoord, coord);
615  }
616 
618  {
619  return m_stdMatrixManager[mkey];
620  }
621 
623  {
624  return m_stdStaticCondMatrixManager[mkey];
625  }
626 
628  (const Array<OneD, const NekDouble> &Fx,
629  Array< OneD, NekDouble> &outarray)
630  {
631  v_NormVectorIProductWRTBase(Fx,outarray);
632  }
633 
635  (const Array<OneD, const NekDouble> &Fx,
636  const Array<OneD, NekDouble> &Fy,
637  Array< OneD, NekDouble> &outarray)
638  {
639  v_NormVectorIProductWRTBase(Fx,Fy,outarray);
640  }
641 
643  (const Array<OneD, const NekDouble> &Fx,
646  Array< OneD, NekDouble> &outarray)
647  {
648  v_NormVectorIProductWRTBase(Fx,Fy,Fz,outarray);
649  }
650 
652  (const Array<OneD,
653  const Array<OneD, NekDouble> > &Fvec,
654  Array< OneD, NekDouble> &outarray)
655  {
656  v_NormVectorIProductWRTBase(Fvec, outarray);
657  }
658 
660  (const LocalRegions::MatrixKey &mkey)
661  {
662  return v_GetLocStaticCondMatrix(mkey);
663  }
664 
666  (const LocalRegions::MatrixKey &mkey)
667  {
668  return v_DropLocStaticCondMatrix(mkey);
669  }
670 
671  int CalcNumberOfCoefficients(const std::vector<unsigned int> &nummodes,
672  int &modes_offset)
673  {
674  return v_CalcNumberOfCoefficients(nummodes,modes_offset);
675  }
676 
677  // virtual functions related to LocalRegions
679  const Array<OneD, const NekDouble> &Lcoord,
680  const Array<OneD, const NekDouble> &physvals);
681 
683  {
684  return v_GetCoordim();
685  }
686 
688  {
689  v_GetBoundaryMap(outarray);
690  }
691 
693  {
694  v_GetInteriorMap(outarray);
695  }
696 
697  int GetVertexMap(const int localVertexId,
698  bool useCoeffPacking = false)
699  {
700  return v_GetVertexMap(localVertexId,useCoeffPacking);
701  }
702 
704  const int tid,
705  Array<OneD, unsigned int> &maparray,
706  Array<OneD, int> &signarray,
707  Orientation traceOrient = eForwards,
708  int P = -1,
709  int Q = -1)
710  {
711  v_GetTraceToElementMap(tid,maparray,signarray,traceOrient,P,Q);
712  }
713 
715  const int tid,
716  Array<OneD, unsigned int> &maparray,
717  Array<OneD, int> &signarray,
718  const Orientation traceOrient = eForwards)
719  {
720  v_GetTraceInteriorToElementMap(tid,maparray,signarray,traceOrient);
721  }
722 
723 
724  void GetTraceNumModes(const int tid,
725  int &numModes0,
726  int &numModes1,
727  const Orientation traceOrient
729  {
730  v_GetTraceNumModes(tid,numModes0,numModes1,traceOrient);
731  }
732 
734  const Array<OneD, const NekDouble> &inarray,
735  Array<OneD, NekDouble> &outarray)
736  {
737  v_MultiplyByQuadratureMetric(inarray, outarray);
738  }
739 
741  const Array<OneD, const NekDouble> &inarray,
742  Array<OneD, NekDouble> & outarray)
743  {
744  v_MultiplyByStdQuadratureMetric(inarray, outarray);
745  }
746 
747  // Matrix Routines
748 
749  /** \brief this function generates the mass matrix
750  * \f$\mathbf{M}[i][j] =
751  * \int \phi_i(\mathbf{x}) \phi_j(\mathbf{x}) d\mathbf{x}\f$
752  *
753  * \return returns the mass matrix
754  */
755 
757 
759  Array<OneD,NekDouble> &outarray,
760  const StdMatrixKey &mkey);
761 
763  Array<OneD,NekDouble> &outarray,
764  const StdMatrixKey &mkey)
765  {
766  v_MassMatrixOp(inarray,outarray,mkey);
767  }
768 
770  Array<OneD,NekDouble> &outarray,
771  const StdMatrixKey &mkey)
772  {
773  v_LaplacianMatrixOp(inarray,outarray,mkey);
774  }
775 
776  void ReduceOrderCoeffs(int numMin,
777  const Array<OneD, const NekDouble> &inarray,
778  Array<OneD,NekDouble> &outarray)
779  {
780  v_ReduceOrderCoeffs(numMin,inarray,outarray);
781  }
782 
784  const StdMatrixKey &mkey)
785  {
786  v_SVVLaplacianFilter(array,mkey);
787  }
788 
790  const NekDouble alpha,
791  const NekDouble exponent,
792  const NekDouble cutoff)
793  {
794  v_ExponentialFilter(array, alpha, exponent, cutoff);
795  }
796 
797  void LaplacianMatrixOp(const int k1, const int k2,
798  const Array<OneD, const NekDouble> &inarray,
799  Array<OneD,NekDouble> &outarray,
800  const StdMatrixKey &mkey)
801  {
802  v_LaplacianMatrixOp(k1,k2,inarray,outarray,mkey);
803  }
804 
805  void WeakDerivMatrixOp(const int i,
806  const Array<OneD, const NekDouble> &inarray,
807  Array<OneD,NekDouble> &outarray,
808  const StdMatrixKey &mkey)
809  {
810  v_WeakDerivMatrixOp(i,inarray,outarray,mkey);
811  }
812 
814  Array<OneD,NekDouble> &outarray,
815  const StdMatrixKey &mkey)
816  {
817  v_WeakDirectionalDerivMatrixOp(inarray,outarray,mkey);
818  }
819 
821  Array<OneD,NekDouble> &outarray,
822  const StdMatrixKey &mkey)
823  {
824  v_MassLevelCurvatureMatrixOp(inarray,outarray,mkey);
825  }
826 
828  const Array<OneD, const NekDouble> &inarray,
829  Array<OneD,NekDouble> &outarray,
830  const StdMatrixKey &mkey,
831  bool addDiffusionTerm = true)
832  {
834  (inarray,outarray,mkey,addDiffusionTerm);
835  }
836 
837  /**
838  * @param inarray Input array @f$ \mathbf{u} @f$.
839  * @param outarray Output array @f$ \boldsymbol{\nabla^2u}
840  * + \lambda \boldsymbol{u} @f$.
841  * @param mkey
842  */
844  Array<OneD,NekDouble> &outarray,
845  const StdMatrixKey &mkey)
846  {
847  v_HelmholtzMatrixOp(inarray,outarray,mkey);
848  }
849 
851  {
852  return v_GenMatrix(mkey);
853  }
854 
856  Array<OneD, NekDouble> &out_d0,
859  {
860  v_PhysDeriv (inarray, out_d0, out_d1, out_d2);
861  }
862 
863  void PhysDeriv(const int dir,
864  const Array<OneD, const NekDouble>& inarray,
865  Array<OneD, NekDouble> &outarray)
866  {
867  v_PhysDeriv (dir, inarray, outarray);
868  }
869 
871  Array<OneD, NekDouble> &out_ds)
872  {
873  v_PhysDeriv_s(inarray,out_ds);
874  }
875 
877  Array<OneD, NekDouble>& out_dn)
878  {
879  v_PhysDeriv_n(inarray,out_dn);
880  }
881 
883  const Array<OneD, const NekDouble>& direction,
884  Array<OneD, NekDouble> &outarray)
885  {
886  v_PhysDirectionalDeriv (inarray, direction, outarray);
887  }
888 
890  Array<OneD, NekDouble> &out_d0,
893  {
894  v_StdPhysDeriv(inarray, out_d0, out_d1, out_d2);
895  }
896 
897  void StdPhysDeriv (const int dir,
898  const Array<OneD, const NekDouble>& inarray,
899  Array<OneD, NekDouble> &outarray)
900  {
901  v_StdPhysDeriv(dir,inarray,outarray);
902  }
903 
904  /** \brief This function evaluates the expansion at a single
905  * (arbitrary) point of the domain
906  *
907  * This function is a wrapper around the virtual function
908  * \a v_PhysEvaluate()
909  *
910  * Based on the value of the expansion at the quadrature
911  * points provided in \a physvals, this function
912  * calculates the value of the expansion at an arbitrary
913  * single points (with coordinates \f$ \mathbf{x_c}\f$
914  * given by the pointer \a coords). This operation,
915  * equivalent to \f[ u(\mathbf{x_c}) = \sum_p
916  * \phi_p(\mathbf{x_c}) \hat{u}_p \f] is evaluated using
917  * Lagrangian interpolants through the quadrature points:
918  * \f[ u(\mathbf{x_c}) = \sum_p h_p(\mathbf{x_c}) u_p\f]
919  *
920  * \param coords the coordinates of the single point
921  * \param physvals the interpolated field at the quadrature points
922  *
923  * \return returns the value of the expansion at the
924  * single point
925  */
927  const Array<OneD, const NekDouble>& physvals)
928  {
929  return v_PhysEvaluate(coords,physvals);
930  }
931 
932 
933  /** \brief This function evaluates the expansion at a single
934  * (arbitrary) point of the domain
935  *
936  * This function is a wrapper around the virtual function
937  * \a v_PhysEvaluate()
938  *
939  * Based on the value of the expansion at the quadrature
940  * points provided in \a physvals, this function
941  * calculates the value of the expansion at an arbitrary
942  * single points associated with the interpolation
943  * matrices provided in \f$ I \f$.
944  *
945  * \param I an Array of lagrange interpolantes evaluated
946  * at the coordinate and going through the local physical
947  * quadrature
948  * \param physvals the interpolated field at the quadrature points
949  *
950  * \return returns the value of the expansion at the
951  * single point
952  */
954  const Array<OneD, const NekDouble >& physvals)
955  {
956  return v_PhysEvaluate(I,physvals);
957  }
958 
959  /**
960  * @brief This function evaluates the basis function mode @p mode at a
961  * point @p coords of the domain.
962  *
963  * This function uses barycentric interpolation with the tensor
964  * product separation of the basis function to improve performance.
965  *
966  * @param coord The coordinate inside the standard region.
967  * @param mode The mode number to be evaluated.
968  *
969  * @return The value of the basis function @p mode at @p coords.
970  */
972  const Array<OneD, const NekDouble>& coords,
973  int mode)
974  {
975  return v_PhysEvaluateBasis(coords, mode);
976  }
977 
978  /**
979  * \brief Convert local cartesian coordinate \a xi into local
980  * collapsed coordinates \a eta
981  **/
984  {
985  v_LocCoordToLocCollapsed(xi,eta);
986  }
987 
988  /**
989  * \brief Convert local collapsed coordinates \a eta into local
990  * cartesian coordinate \a xi
991  **/
994  {
995  v_LocCollapsedToLocCoord(eta,xi);
996  }
997 
999  (const std::vector<unsigned int> &nummodes, int &modes_offset);
1000 
1003 
1005  const Array<OneD, const NekDouble> &Fx,
1006  const Array<OneD, const NekDouble> &Fy,
1007  Array< OneD, NekDouble> &outarray);
1008 
1010  const Array<OneD, const NekDouble> &Fx,
1011  const Array<OneD, const NekDouble> &Fy,
1012  const Array<OneD, const NekDouble> &Fz,
1013  Array< OneD, NekDouble> &outarray);
1014 
1016  const Array<OneD, const Array<OneD, NekDouble> > &Fvec,
1017  Array< OneD, NekDouble> &outarray);
1018 
1021 
1022  STD_REGIONS_EXPORT virtual void
1024 
1025  /** \brief Function to evaluate the discrete \f$ L_\infty\f$
1026  * error \f$ |\epsilon|_\infty = \max |u - u_{exact}|\f$ where \f$
1027  * u_{exact}\f$ is given by the array \a sol.
1028  *
1029  * This function takes the physical value space array \a m_phys as
1030  * approximate solution
1031  *
1032  * \param sol array of solution function at physical quadrature
1033  * points
1034  * \return returns the \f$ L_\infty \f$ error as a NekDouble.
1035  */
1037  const Array<OneD,
1038  const NekDouble>& phys,
1039  const Array<OneD,
1040  const NekDouble>& sol = NullNekDouble1DArray);
1041 
1042  /** \brief Function to evaluate the discrete \f$ L_2\f$ error,
1043  * \f$ | \epsilon |_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2
1044  * dx \right]^{1/2} d\xi_1 \f$ where \f$ u_{exact}\f$ is given by
1045  * the array \a sol.
1046  *
1047  * This function takes the physical value space array \a m_phys as
1048  * approximate solution
1049  *
1050  * \param sol array of solution function at physical quadrature
1051  * points
1052  * \return returns the \f$ L_2 \f$ error as a double.
1053  */
1055  const Array<OneD, const NekDouble>& phys,
1056  const Array<OneD, const NekDouble>& sol =
1058 
1059  /** \brief Function to evaluate the discrete \f$ H^1\f$
1060  * error, \f$ | \epsilon |^1_{2} = \left [ \int^1_{-1} [u -
1061  * u_{exact}]^2 + \nabla(u - u_{exact})\cdot\nabla(u -
1062  * u_{exact})\cdot dx \right]^{1/2} d\xi_1 \f$ where \f$
1063  * u_{exact}\f$ is given by the array \a sol.
1064  *
1065  * This function takes the physical value space array
1066  * \a m_phys as approximate solution
1067  *
1068  * \param sol array of solution function at physical quadrature
1069  * points
1070  * \return returns the \f$ H_1 \f$ error as a double.
1071  */
1073  const Array<OneD,
1074  const NekDouble>& phys,
1076 
1077  // I/O routines
1079  {
1081  p.reserve(m_base.size());
1082  for (int i = 0; i < m_base.size(); ++i)
1083  {
1084  p.push_back(m_base[i]->GetPointsKey());
1085  }
1086  return p;
1087  }
1088 
1090  const DNekScalMatSharedPtr & m_transformationmatrix)
1091  {
1093  m_transformationmatrix);
1094  }
1095 
1096 
1097  /** \brief This function performs an interpolation from
1098  * the physical space points provided at input into an
1099  * array of equispaced points which are not the collapsed
1100  * coordinate. So for a tetrahedron you will only get a
1101  * tetrahedral number of values.
1102  *
1103  * This is primarily used for output purposes to get a
1104  * better distribution of points more suitable for most
1105  * postprocessing
1106  */
1108  const Array<OneD, const NekDouble> &inarray,
1109  Array<OneD, NekDouble> &outarray,
1110  int npset = -1);
1111 
1112 
1113  /** \brief This function provides the connectivity of
1114  * local simplices (triangles or tets) to connect the
1115  * equispaced data points provided by
1116  * PhysInterpToSimplexEquiSpaced
1117  *
1118  * This is a virtual call to the function
1119  * \a v_GetSimplexEquiSpaceConnectivity
1120  */
1122  Array<OneD, int> &conn,
1123  bool standard = true)
1124  {
1125  v_GetSimplexEquiSpacedConnectivity(conn,standard);
1126  }
1127 
1128  /** \brief This function performs a
1129  * projection/interpolation from the equispaced points
1130  * sometimes used in post-processing onto the coefficient
1131  * space
1132  *
1133  * This is primarily used for output purposes to use a
1134  * more even distribution of points more suitable for alot of
1135  * postprocessing
1136  */
1138  const Array<OneD, const NekDouble> &inarray,
1139  Array<OneD, NekDouble> &outarray);
1140 
1141  template<class T>
1142  std::shared_ptr<T> as()
1143  {
1144  return std::dynamic_pointer_cast<T>( shared_from_this() );
1145  }
1146 
1148  Array<OneD, NekDouble> &outarray,
1149  bool multiplybyweights = true)
1150  {
1151  v_IProductWRTBase_SumFac(inarray,outarray,multiplybyweights);
1152  }
1153 
1155  const int dir,
1156  DNekMatSharedPtr &mat)
1157  {
1158  v_GenStdMatBwdDeriv(dir,mat);
1159  }
1160 
1161  protected:
1162  Array<OneD, LibUtilities::BasisSharedPtr> m_base; /**< Bases needed for the expansion */
1164  int m_ncoeffs; /**< Total number of coefficients used in the expansion */
1165 
1170 
1172  {
1173  return v_CreateStdMatrix(mkey);
1174  }
1175 
1176  /** \brief Create the static condensation of a matrix when
1177  using a boundary interior decomposition
1178 
1179  If a matrix system can be represented by
1180  \f$ Mat = \left [ \begin{array}{cc}
1181  A & B \\
1182  C & D \end{array} \right ] \f$
1183  This routine creates a matrix containing the statically
1184  condense system of the form
1185  \f$ Mat = \left [ \begin{array}{cc}
1186  A - B D^{-1} C & B D^{-1} \\
1187  D^{-1} C & D^{-1} \end{array} \right ] \f$
1188  **/
1190  (const StdMatrixKey &mkey);
1191 
1192 
1194  (const Array<OneD, const NekDouble>& inarray,
1195  Array<OneD, NekDouble> &outarray);
1196 
1198  Array<OneD, NekDouble> &outarray)
1199  {
1200  v_BwdTrans_SumFac(inarray,outarray);
1201  }
1202 
1204  const int dir,
1205  const Array<OneD, const NekDouble>& inarray,
1206  Array<OneD, NekDouble> &outarray)
1207  {
1208  v_IProductWRTDerivBase_SumFac(dir,inarray,outarray);
1209  }
1210 
1211 
1213  const Array<OneD, const NekDouble>& direction,
1214  const Array<OneD, const NekDouble>& inarray,
1215  Array<OneD, NekDouble> &outarray)
1216  {
1218  inarray,outarray);
1219  }
1220 
1221 
1222  // The term _MatFree denotes that the action of the
1223  // MatrixOperation is done withouth actually using the
1224  // matrix (which then needs to be stored/calculated).
1225  // Although this does not strictly mean that no matrix
1226  // operations are involved in the evaluation of the
1227  // operation, we use this term in the same context used as
1228  // in the following paper: R. C. Kirby, M. G. Knepley,
1229  // A. Logg, and L. R. Scott, "Optimizing the evaluation of
1230  // finite element matrices," SISC 27:741-758 (2005)
1232  (const Array<OneD, const NekDouble> &inarray,
1233  Array<OneD,NekDouble> &outarray,
1234  const StdMatrixKey &mkey);
1235 
1237  (const Array<OneD, const NekDouble> &inarray,
1238  Array<OneD,NekDouble> &outarray,
1239  const StdMatrixKey &mkey);
1240 
1242  Array<OneD,NekDouble> &outarray,
1243  const StdMatrixKey &mkey)
1244  {
1245  v_LaplacianMatrixOp_MatFree(inarray,outarray,mkey);
1246  }
1247 
1249  const Array<OneD, const NekDouble> &inarray,
1250  Array<OneD, NekDouble> &outarray,
1252  {
1253  v_LaplacianMatrixOp_MatFree_Kernel(inarray, outarray, wsp);
1254  }
1255 
1257  (const Array<OneD, const NekDouble> &inarray,
1258  Array<OneD,NekDouble> &outarray,
1259  const StdMatrixKey &mkey);
1260 
1262  (const int k1, const int k2,
1263  const Array<OneD, const NekDouble> &inarray,
1264  Array<OneD,NekDouble> &outarray,
1265  const StdMatrixKey &mkey);
1266 
1268  const Array<OneD, const NekDouble> &inarray,
1269  Array<OneD,NekDouble> &outarray,
1270  const StdMatrixKey &mkey);
1271 
1273  (const Array<OneD, const NekDouble> &inarray,
1274  Array<OneD,NekDouble> &outarray,
1275  const StdMatrixKey &mkey);
1276 
1278  (const Array<OneD, const NekDouble> &inarray,
1279  Array<OneD,NekDouble> &outarray,
1280  const StdMatrixKey &mkey);
1281 
1283  (const Array<OneD, const NekDouble> &inarray,
1284  Array<OneD,NekDouble> &outarray,
1285  const StdMatrixKey &mkey,
1286  bool addDiffusionTerm = true);
1287 
1289  Array<OneD,NekDouble> &outarray,
1290  const StdMatrixKey &mkey)
1291  {
1292  v_HelmholtzMatrixOp_MatFree(inarray,outarray,mkey);
1293  }
1294 
1296  (const Array<OneD, const NekDouble> &inarray,
1297  Array<OneD,NekDouble> &outarray,
1298  const StdMatrixKey &mkey);
1299 
1303  Array<OneD, NekDouble> &outarray);
1304 
1306  (Array<OneD, NekDouble> &coeffs,
1308 
1310  const Array<OneD, const NekDouble> &Lcoord,
1311  const Array<OneD, const NekDouble> &physvals);
1312 
1314  const int dir,
1315  DNekMatSharedPtr &mat)
1316  {
1317  boost::ignore_unused(dir,mat);
1318  NEKERROR(ErrorUtil::efatal,"not defined");
1319  }
1320 
1322  const Array<OneD, const NekDouble> &inarray,
1323  Array<OneD, NekDouble> &outarray);
1324 
1325  /**
1326  * @brief This function performs the barycentric interpolation of
1327  * the polynomial stored in @p coord at a point @p physvals using
1328  * barycentric interpolation weights in direction @tparam DIR.
1329  *
1330  * This method is intended to be used a helper function for
1331  * StdExpansion::PhysEvaluate and its elemental instances, so that
1332  * the calling method should provide @p coord for x, y and z
1333  * sequentially and the appropriate @p physvals and @p weights for
1334  * that particular direction.
1335  *
1336  * @param coord The coordinate of the single point.
1337  * @param physvals The polynomial stored at each quadrature point.
1338  * @tparam DIR The direction of evaluation.
1339  *
1340  * @return The value of @p physvals at @p coord in direction @p dir.
1341  */
1342  template<int DIR>
1344  const NekDouble &coord,
1345  const NekDouble *physvals)
1346  {
1347  NekDouble numer = 0.0, denom = 0.0;
1348 
1349  ASSERTL2(DIR < m_base.size(),
1350  "Direction should be less than shape dimension.");
1351 
1352  const Array<OneD, const NekDouble> &z = m_base[DIR]->GetZ();
1353  const Array<OneD, const NekDouble> &bw =
1354  m_base[DIR]->GetBaryWeights();
1355 
1356  const auto nquad = z.size();
1357 
1358  for (int i = 0; i < nquad; ++i)
1359  {
1360  NekDouble xdiff = z[i] - coord;
1361  NekDouble pval = physvals[i];
1362 
1363  /*
1364  * (in this specific case) you actually
1365  * want to do the comparison exactly
1366  * (believe it or not!) See chapter 7 of
1367  * the paper here:
1368  *https://people.maths.ox.ac.uk/trefethen/barycentric.pdf
1369  */
1370  if (xdiff == 0.0)
1371  {
1372  return pval;
1373  }
1374 
1375  NekDouble tmp = bw[i] / xdiff;
1376  numer += tmp * pval;
1377  denom += tmp;
1378  }
1379 
1380  return numer / denom;
1381  }
1382 
1383  /**
1384  * @brief This function evaluates the basis function mode @p mode at
1385  * a point @p coords of the domain in direction @dir.
1386  *
1387  * @param coord The coordinate inside the standard region.
1388  * @param mode The mode number to be evaluated of #m_base[dir]
1389  * @param dir The direction of interpolation.
1390  *
1391  * @return The value of the basis function @p mode at @p coords in
1392  * direction @p dir.
1393  */
1394  template<int DIR>
1396  const int &mode)
1397  {
1398  const int nquad = m_base[DIR]->GetNumPoints();
1399  return BaryEvaluate<DIR>(
1400  coord, &(m_base[DIR]->GetBdata())[0] + nquad * mode);
1401  }
1402 
1403  private:
1404  // Virtual functions
1405  STD_REGIONS_EXPORT virtual int v_GetNverts() const = 0;
1406  STD_REGIONS_EXPORT virtual int v_GetNtraces() const;
1407 
1408  STD_REGIONS_EXPORT virtual int v_NumBndryCoeffs() const;
1409  STD_REGIONS_EXPORT virtual int v_NumDGBndryCoeffs() const;
1410 
1411  STD_REGIONS_EXPORT virtual int v_GetTraceNcoeffs(const int i) const;
1412  STD_REGIONS_EXPORT virtual int v_GetTotalTraceIntNcoeffs() const;
1413  STD_REGIONS_EXPORT virtual int v_GetTraceIntNcoeffs(const int i) const;
1414  STD_REGIONS_EXPORT virtual int v_GetTraceNumPoints(const int i) const;
1415 
1416 
1418  v_GetTraceBasisKey(const int i, const int k) const;
1419 
1421  v_GetTracePointsKey(const int i, const int j) const;
1422 
1424  v_GetNodalPointsKey() const;
1425 
1427  v_DetShapeType() const;
1428 
1429  STD_REGIONS_EXPORT virtual std::shared_ptr<StdExpansion>
1430  v_GetStdExp(void) const;
1431 
1432  STD_REGIONS_EXPORT virtual std::shared_ptr<StdExpansion>
1433  v_GetLinStdExp(void) const;
1434 
1435  STD_REGIONS_EXPORT virtual int
1436  v_GetShapeDimension() const;
1437 
1438  STD_REGIONS_EXPORT virtual bool
1440 
1441  STD_REGIONS_EXPORT virtual bool
1443 
1445  (const Array<OneD, const NekDouble>& inarray,
1446  Array<OneD, NekDouble> &outarray) = 0;
1447 
1448  /**
1449  * @brief Transform a given function from physical quadrature space
1450  * to coefficient space.
1451  * @see StdExpansion::FwdTrans
1452  */
1454  const Array<OneD, const NekDouble>& inarray,
1455  Array<OneD, NekDouble> &outarray) = 0;
1456 
1457  /**
1458  * @brief Calculates the inner product of a given function \a f
1459  * with the different modes of the expansion
1460  */
1462  const Array<OneD, const NekDouble>& inarray,
1463  Array<OneD, NekDouble> &outarray) = 0;
1464 
1466  const Array<OneD, const NekDouble>& base,
1467  const Array<OneD, const NekDouble>& inarray,
1468  Array<OneD, NekDouble>& outarray,
1469  int coll_check)
1470  {
1471  boost::ignore_unused(base, inarray, outarray, coll_check);
1473  "StdExpansion::v_IProductWRTBase has no "
1474  "(and should have no) implementation");
1475  }
1476 
1478  const int dir,
1479  const Array<OneD, const NekDouble>& inarray,
1480  Array<OneD, NekDouble> &outarray);
1481 
1483  const Array<OneD, const NekDouble>& direction,
1484  const Array<OneD, const NekDouble>& inarray,
1485  Array<OneD, NekDouble> &outarray);
1486 
1488  const Array<OneD, const NekDouble>& inarray,
1489  Array<OneD, NekDouble> &outarray);
1490 
1492  const Array<OneD, const NekDouble>& inarray );
1493 
1494  STD_REGIONS_EXPORT virtual void v_PhysDeriv
1495  (const Array<OneD, const NekDouble>& inarray,
1496  Array<OneD, NekDouble> &out_d1,
1497  Array<OneD, NekDouble> &out_d2,
1498  Array<OneD, NekDouble> &out_d3);
1499 
1500  STD_REGIONS_EXPORT virtual void v_PhysDeriv_s
1501  (const Array<OneD, const NekDouble>& inarray,
1502  Array<OneD, NekDouble> &out_ds);
1503 
1504  STD_REGIONS_EXPORT virtual void v_PhysDeriv_n
1505  (const Array<OneD, const NekDouble>& inarray,
1506  Array<OneD, NekDouble>& out_dn);
1507 
1508  STD_REGIONS_EXPORT virtual void v_PhysDeriv
1509  (const int dir,
1510  const Array<OneD, const NekDouble>& inarray,
1511  Array<OneD, NekDouble> &out_d0);
1512 
1514  (const Array<OneD, const NekDouble>& inarray,
1515  const Array<OneD, const NekDouble>& direction,
1516  Array<OneD, NekDouble> &outarray);
1517 
1518  STD_REGIONS_EXPORT virtual void v_StdPhysDeriv
1519  (const Array<OneD,
1520  const NekDouble>& inarray,
1521  Array<OneD, NekDouble> &out_d1,
1522  Array<OneD, NekDouble> &out_d2,
1523  Array<OneD, NekDouble> &out_d3);
1524 
1525  STD_REGIONS_EXPORT virtual void v_StdPhysDeriv
1526  (const int dir,
1527  const Array<OneD, const NekDouble>& inarray,
1528  Array<OneD, NekDouble> &outarray);
1529 
1531  (const Array<OneD,
1532  const NekDouble>& coords,
1533  const Array<OneD, const NekDouble> & physvals);
1534 
1537  const Array<OneD, const NekDouble> & physvals);
1538 
1540  (const Array<OneD, const NekDouble>& coords, int mode);
1541 
1543  const Array<OneD, const NekDouble>& xi,
1544  Array<OneD, NekDouble>& eta);
1545 
1547  const Array<OneD, const NekDouble>& eta,
1549 
1550  STD_REGIONS_EXPORT virtual void v_FillMode(const int mode,
1551  Array<OneD, NekDouble> &outarray);
1552 
1554  const StdMatrixKey &mkey);
1555 
1557  const StdMatrixKey &mkey);
1558 
1559  STD_REGIONS_EXPORT virtual void v_GetCoords(
1560  Array<OneD, NekDouble> &coords_0,
1561  Array<OneD, NekDouble> &coords_1,
1562  Array<OneD, NekDouble> &coords_2);
1563 
1564  STD_REGIONS_EXPORT virtual void v_GetCoord(
1565  const Array<OneD, const NekDouble>& Lcoord,
1566  Array<OneD, NekDouble> &coord);
1567 
1568  STD_REGIONS_EXPORT virtual int v_GetCoordim(void);
1569 
1570  STD_REGIONS_EXPORT virtual void v_GetBoundaryMap(
1571  Array<OneD, unsigned int>& outarray);
1572 
1573  STD_REGIONS_EXPORT virtual void v_GetInteriorMap(
1574  Array<OneD, unsigned int>& outarray);
1575 
1576  STD_REGIONS_EXPORT virtual int v_GetVertexMap(int localVertexId,
1577  bool useCoeffPacking = false);
1578 
1580  const int tid,
1581  Array<OneD, unsigned int> &maparray,
1582  Array<OneD, int> &signarray,
1583  Orientation traceOrient = eForwards,
1584  int P = -1,
1585  int Q = -1);
1586 
1588  const int eid,
1589  Array<OneD, unsigned int>& maparray,
1590  Array<OneD, int>& signarray,
1591  const Orientation traceOrient = eForwards);
1592 
1593 
1595  const int fid,
1596  int &numModes0,
1597  int &numModes1,
1598  Orientation traceOrient
1600 
1602  (const int vertex,
1603  const Array<OneD, const NekDouble> &inarray,
1604  NekDouble &outarray);
1605 
1607  const Array<OneD, const NekDouble> &inarray,
1608  Array<OneD, NekDouble> &outarray);
1609 
1611  (const Array<OneD, const NekDouble>& inarray,
1612  Array<OneD, NekDouble> &outarray);
1613 
1614 
1616  (const Array<OneD, const NekDouble>& inarray,
1617  Array<OneD, NekDouble> &outarray,
1618  bool multiplybyweights = true);
1619 
1621  const int dir,
1622  const Array<OneD, const NekDouble>& inarray,
1623  Array<OneD, NekDouble> &outarray);
1624 
1625  STD_REGIONS_EXPORT virtual void
1627  const Array<OneD, const NekDouble>& direction,
1628  const Array<OneD, const NekDouble>& inarray,
1629  Array<OneD, NekDouble> &outarray);
1630 
1631  STD_REGIONS_EXPORT virtual void v_MassMatrixOp
1632  (const Array<OneD, const NekDouble> &inarray,
1633  Array<OneD,NekDouble> &outarray,
1634  const StdMatrixKey &mkey);
1635 
1637  (const Array<OneD, const NekDouble> &inarray,
1638  Array<OneD,NekDouble> &outarray,
1639  const StdMatrixKey &mkey);
1640 
1642  (Array<OneD,NekDouble> &array,
1643  const StdMatrixKey &mkey);
1644 
1646  Array<OneD, NekDouble> &array,
1647  const NekDouble alpha,
1648  const NekDouble exponent,
1649  const NekDouble cutoff);
1650 
1652  int numMin,
1653  const Array<OneD, const NekDouble> &inarray,
1654  Array<OneD,NekDouble> &outarray);
1655 
1657  const int k1, const int k2,
1658  const Array<OneD, const NekDouble> &inarray,
1659  Array<OneD,NekDouble> &outarray,
1660  const StdMatrixKey &mkey);
1661 
1663  const int i,
1664  const Array<OneD, const NekDouble> &inarray,
1665  Array<OneD,NekDouble> &outarray,
1666  const StdMatrixKey &mkey);
1667 
1669  const Array<OneD, const NekDouble> &inarray,
1670  Array<OneD,NekDouble> &outarray,
1671  const StdMatrixKey &mkey);
1672 
1674  const Array<OneD, const NekDouble> &inarray,
1675  Array<OneD,NekDouble> &outarray,
1676  const StdMatrixKey &mkey);
1677 
1679  const Array<OneD,
1680  const NekDouble> &inarray,
1681  Array<OneD,NekDouble> &outarray,
1682  const StdMatrixKey &mkey,
1683  bool addDiffusionTerm=true);
1684 
1686  const Array<OneD, const NekDouble> &inarray,
1687  Array<OneD,NekDouble> &outarray,
1688  const StdMatrixKey &mkey);
1689 
1691  const Array<OneD, const NekDouble> &inarray,
1692  Array<OneD,NekDouble> &outarray,
1693  const StdMatrixKey &mkey);
1694 
1696  const Array<OneD, const NekDouble> &inarray,
1697  Array<OneD, NekDouble> &outarray,
1698  Array<OneD, NekDouble> &wsp);
1699 
1701  const Array<OneD, const NekDouble> &inarray,
1702  Array<OneD,NekDouble> &outarray,
1703  const StdMatrixKey &mkey);
1704 
1707  m_transformationmatrix);
1708 
1710  Array<OneD, int> &conn,
1711  bool standard = true);
1712  };
1713 
1714  typedef std::shared_ptr<StdExpansion> StdExpansionSharedPtr;
1715  typedef std::vector< StdExpansionSharedPtr > StdExpansionVector;
1716 
1717  /**
1718  * This function is a wrapper around the virtual function
1719  * \a v_FwdTrans()
1720  *
1721  * Given a function evaluated at the quadrature points, this
1722  * function calculates the expansion coefficients such that the
1723  * resulting expansion approximates the original function.
1724  *
1725  * The calculation of the expansion coefficients is done using a
1726  * Galerkin projection. This is equivalent to the operation:
1727  * \f[ \mathbf{\hat{u}} = \mathbf{M}^{-1} \mathbf{I}\f]
1728  * where
1729  * - \f$\mathbf{M}[p][q]= \int\phi_p(\mathbf{\xi})\phi_q(
1730  * \mathbf{\xi}) d\mathbf{\xi}\f$ is the Mass matrix
1731  * - \f$\mathbf{I}[p] = \int\phi_p(\mathbf{\xi}) u(\mathbf{\xi})
1732  * d\mathbf{\xi}\f$
1733  *
1734  * This function takes the array \a inarray as the values of the
1735  * function evaluated at the quadrature points
1736  * (i.e. \f$\mathbf{u}\f$),
1737  * and stores the resulting coefficients \f$\mathbf{\hat{u}}\f$
1738  * in the \a outarray
1739  *
1740  * @param inarray array of the function discretely evaluated at the
1741  * quadrature points
1742  *
1743  * @param outarray array of the function coefficieints
1744  */
1746  Array<OneD, NekDouble> &outarray)
1747  {
1748  v_FwdTrans(inarray,outarray);
1749  }
1750 
1751  } //end of namespace
1752 } //end of namespace
1753 
1754 #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:250
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
Definition: ErrorUtil.hpp:274
#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:60
The base class for all shapes.
Definition: StdExpansion.h:63
void PhysDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:863
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:687
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:124
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:134
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:111
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:500
void FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:446
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:348
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:870
void WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:813
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:666
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:643
int GetTraceNumPoints(const int i) const
This function returns the number of quadrature points belonging to the i-th trace.
Definition: StdExpansion.h:286
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:158
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:323
void MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:820
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:617
void LaplacianMatrixOp(const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:797
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &base, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int coll_check)
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:270
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:982
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:622
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:805
int EvalBasisNumModesMax(void) const
This function returns the maximum number of expansion modes over all local directions.
Definition: StdExpansion.h:183
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:882
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 MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:762
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:671
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:611
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:897
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:876
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:100
void BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
Definition: StdExpansion.h:660
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:579
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:304
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:697
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:628
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)
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:537
int GetNtraces() const
Returns the number of trace elements connected to this element.
Definition: StdExpansion.h:360
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:249
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:769
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)
Definition: StdExpansion.h:652
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:593
void IProductWRTDirectionalDerivBase(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:561
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:571
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:926
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:703
void IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:553
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:376
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:692
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:433
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:714
int GetTraceNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th trace.
Definition: StdExpansion.h:265
DNekMatSharedPtr GenMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:850
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_NumDGBndryCoeffs() const
virtual void v_FwdTrans_BndConstrained(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.
Definition: StdExpansion.h:971
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)
void ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
Definition: StdExpansion.h:789
int GetNumBases() const
This function returns the number of 1D bases used in the expansion.
Definition: StdExpansion.h:91
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:208
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:776
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:827
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:221
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:733
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:889
void MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:740
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:992
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:843
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:953
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:543
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:783
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:171
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:855
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:381
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:235
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 NekDouble > &Fx, const Array< OneD, NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:635
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:386
NekDouble Integral(const Array< OneD, const NekDouble > &inarray)
This function integrates the specified function over the domain.
Definition: StdExpansion.h:482
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:246
std::vector< StdExpansionSharedPtr > StdExpansionVector
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
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:71
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:73
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
double NekDouble
P
Definition: main.py:133