Nektar++
ExpList.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: ExpList.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: Expansion list top class definition
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_LIBS_MULTIREGIONS_EXPLIST_H
36 #define NEKTAR_LIBS_MULTIREGIONS_EXPLIST_H
37 
38 #include <boost/core/ignore_unused.hpp>
39 
40 #include <Collections/Collection.h>
45 #include <LocalRegions/Expansion.h>
55 #include <tinyxml.h>
56 
57 namespace Nektar
58 {
59 namespace MultiRegions
60 {
61 
62 // Forward declarations
63 class ExpList;
64 class GlobalLinSys;
65 class AssemblyMapDG;
66 class AssemblyMapCG;
67 class GlobalLinSysKey;
68 class GlobalMatrix;
69 
71 {
72  eX,
73  eY,
74  eZ,
75  eS,
76  eN
77 };
78 
80 {
81  e0D,
82  e1D,
83  e2D,
87  e3D,
88  eNoType
89 };
90 
92 
93 /// A map between global matrix keys and their associated block
94 /// matrices.
95 typedef std::map<GlobalMatrixKey, DNekScalBlkMatSharedPtr> BlockMatrixMap;
96 /// A shared pointer to a BlockMatrixMap.
97 typedef std::shared_ptr<BlockMatrixMap> BlockMatrixMapShPtr;
98 /// Shared pointer to an ExpList object.
99 typedef std::shared_ptr<ExpList> ExpListSharedPtr;
100 
101 /// Base class for all multi-elemental spectral/hp expansions.
102 class ExpList : public std::enable_shared_from_this<ExpList>
103 {
104 public:
105  /// The default constructor using a type
107 
108  /// The copy constructor.
110  const bool DeclareCoeffPhysArrays = true);
111 
112  /// Constructor copying only elements defined in eIds.
114  const std::vector<unsigned int> &eIDs,
115  const bool DeclareCoeffPhysArrays = true,
116  const Collections::ImplementationType ImpType =
118 
119  /// Generate an ExpList from a meshgraph \a graph and session file
121  const LibUtilities::SessionReaderSharedPtr &pSession,
123  const bool DeclareCoeffPhysArrays = true,
124  const std::string &var = "DefaultVar",
125  const Collections::ImplementationType ImpType =
127 
128  /// Sets up a list of local expansions based on an expansion Map
130  const LibUtilities::SessionReaderSharedPtr &pSession,
131  const SpatialDomains::ExpansionInfoMap &expansions,
132  const bool DeclareCoeffPhysArrays = true,
133  const Collections::ImplementationType ImpType =
135 
136  //---------------------------------------------------------
137  // Specialised constructors in ExpListConstructor.cpp
138  //---------------------------------------------------------
139  /// Specialised constructors for 0D Expansions
140  /// Wrapper around LocalRegion::PointExp - used in PrePacing.cpp
143 
144  /// Generate expansions for the trace space expansions used in
145  /// DisContField.
147  const LibUtilities::SessionReaderSharedPtr &pSession,
148  const Array<OneD, const ExpListSharedPtr> &bndConstraint,
150  &bndCond,
151  const LocalRegions::ExpansionVector &locexp,
153  const LibUtilities::CommSharedPtr &comm,
154  const bool DeclareCoeffPhysArrays = true,
155  const std::string variable = "DefaultVar",
156  const Collections::ImplementationType ImpType =
158 
159  /// Generate an trace ExpList from a meshgraph \a graph and session file
161  const LibUtilities::SessionReaderSharedPtr &pSession,
162  const LocalRegions::ExpansionVector &locexp,
164  const bool DeclareCoeffPhysArrays, const std::string variable,
165  const Collections::ImplementationType ImpType =
167 
168  /// Constructor based on domain information only for 1D &
169  /// 2D boundary conditions
171  const LibUtilities::SessionReaderSharedPtr &pSession,
172  const SpatialDomains::CompositeMap &domain,
174  const bool DeclareCoeffPhysArrays = true,
175  const std::string variable = "DefaultVar",
176  bool SetToOneSpaceDimension = false,
178  const Collections::ImplementationType ImpType =
180 
181  /// The default destructor.
182  MULTI_REGIONS_EXPORT virtual ~ExpList();
183 
184  /// Returns the total number of local degrees of freedom
185  /// \f$N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_m\f$.
186  inline int GetNcoeffs(void) const;
187 
188  /// Returns the total number of local degrees of freedom
189  /// for element eid
190  MULTI_REGIONS_EXPORT int GetNcoeffs(const int eid) const;
191 
192  /// Returns the type of the expansion
194 
195  /// Returns the type of the expansion
197 
198  /// Evaulates the maximum number of modes in the elemental basis
199  /// order over all elements
200  inline int EvalBasisNumModesMax(void) const;
201 
202  /// Returns the vector of the number of modes in the elemental
203  /// basis order over all elements.
205  void) const;
206 
207  /// Returns the total number of quadrature points #m_npoints
208  /// \f$=Q_{\mathrm{tot}}\f$.
209  inline int GetTotPoints(void) const;
210 
211  /// Returns the total number of quadrature points for eid's element
212  /// \f$=Q_{\mathrm{tot}}\f$.
213  inline int GetTotPoints(const int eid) const;
214 
215  /// Returns the total number of quadrature points #m_npoints
216  /// \f$=Q_{\mathrm{tot}}\f$.
217  inline int GetNpoints(void) const;
218 
219  /// Returns the total number of qudature points scaled by
220  /// the factor scale on each 1D direction
221  inline int Get1DScaledTotPoints(const NekDouble scale) const;
222 
223  /// Sets the wave space to the one of the possible configuration
224  /// true or false
225  inline void SetWaveSpace(const bool wavespace);
226 
227  /// Set Modified Basis for the stability analysis
228  inline void SetModifiedBasis(const bool modbasis);
229 
230  /// This function returns the third direction expansion condition,
231  /// which can be in wave space (coefficient) or not
232  /// It is stored in the variable m_WaveSpace.
233  inline bool GetWaveSpace(void) const;
234 
235  /// Set the \a i th value of \a m_phys to value \a val
236  inline void SetPhys(int i, NekDouble val);
237  /// Fills the array #m_phys
238  inline void SetPhys(const Array<OneD, const NekDouble> &inarray);
239  /// Sets the array #m_phys
240  inline void SetPhysArray(Array<OneD, NekDouble> &inarray);
241  /// This function manually sets whether the array of physical
242  /// values \f$\boldsymbol{u}_l\f$ (implemented as #m_phys) is
243  /// filled or not.
244  inline void SetPhysState(const bool physState);
245  /// This function indicates whether the array of physical values
246  /// \f$\boldsymbol{u}_l\f$ (implemented as #m_phys) is filled or
247  /// not.
248  inline bool GetPhysState(void) const;
249 
250  /// multiply the metric jacobi and quadrature weights
252  const Array<OneD, const NekDouble> &inarray,
253  Array<OneD, NekDouble> &outarray);
254  /// Divided by the metric jacobi and quadrature weights
256  const Array<OneD, const NekDouble> &inarray,
257  Array<OneD, NekDouble> &outarray);
258  /// This function calculates the inner product of a function
259  /// \f$f(\boldsymbol{x})\f$ with respect to all \em local
260  /// expansion modes \f$\phi_n^e(\boldsymbol{x})\f$.
261  inline void IProductWRTBase(const Array<OneD, const NekDouble> &inarray,
262  Array<OneD, NekDouble> &outarray);
263  /// This function calculates the inner product of a function
264  /// \f$f(\boldsymbol{x})\f$ with respect to the derivative (in
265  /// direction \param dir) of all \em local expansion modes
266  /// \f$\phi_n^e(\boldsymbol{x})\f$.
268  const int dir, const Array<OneD, const NekDouble> &inarray,
269  Array<OneD, NekDouble> &outarray);
271  const Array<OneD, const NekDouble> &direction,
272  const Array<OneD, const NekDouble> &inarray,
273  Array<OneD, NekDouble> &outarray);
274  /// This function calculates the inner product of a
275  /// function \f$f(\boldsymbol{x})\f$ with respect to the
276  /// derivative of all \em local expansion modes
277  /// \f$\phi_n^e(\boldsymbol{x})\f$.
279  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
280  Array<OneD, NekDouble> &outarray);
281  /// This function elementally evaluates the forward transformation
282  /// of a function \f$u(\boldsymbol{x})\f$ onto the global
283  /// spectral/hp expansion.
284  inline void FwdTransLocalElmt(const Array<OneD, const NekDouble> &inarray,
285  Array<OneD, NekDouble> &outarray);
286  ///
287  inline void FwdTrans(const Array<OneD, const NekDouble> &inarray,
288  Array<OneD, NekDouble> &outarray);
290  const NekDouble alpha,
291  const NekDouble exponent,
292  const NekDouble cutoff);
293  /// This function elementally mulplies the coefficient space of
294  /// Sin my the elemental inverse of the mass matrix.
296  const Array<OneD, const NekDouble> &inarray,
297  Array<OneD, NekDouble> &outarray);
298  inline void MultiplyByInvMassMatrix(
299  const Array<OneD, const NekDouble> &inarray,
300  Array<OneD, NekDouble> &outarray);
301  inline void MultiplyByMassMatrix(
302  const Array<OneD, const NekDouble> &inarray,
303  Array<OneD, NekDouble> &outarray)
304  {
306  BwdTrans(inarray, tmp);
307  IProductWRTBase(tmp, outarray);
308  }
309  /// Smooth a field across elements
310  inline void SmoothField(Array<OneD, NekDouble> &field);
311 
312  /// Solve helmholtz problem
313  inline GlobalLinSysKey HelmSolve(
314  const Array<OneD, const NekDouble> &inarray,
315  Array<OneD, NekDouble> &outarray,
316  const StdRegions::ConstFactorMap &factors,
318  const MultiRegions::VarFactorsMap &varfactors =
321  const bool PhysSpaceForcing = true);
322  /// Solve Advection Diffusion Reaction
324  const Array<OneD, Array<OneD, NekDouble>> &velocity,
325  const Array<OneD, const NekDouble> &inarray,
326  Array<OneD, NekDouble> &outarray, const NekDouble lambda,
328  /// Solve Advection Diffusion Reaction
329  inline void LinearAdvectionReactionSolve(
330  const Array<OneD, Array<OneD, NekDouble>> &velocity,
331  const Array<OneD, const NekDouble> &inarray,
332  Array<OneD, NekDouble> &outarray, const NekDouble lambda,
334  ///
336  const Array<OneD, const NekDouble> &inarray,
337  Array<OneD, NekDouble> &outarray);
338  /// This function elementally evaluates the backward transformation
339  /// of the global spectral/hp element expansion.
340  inline void BwdTrans(const Array<OneD, const NekDouble> &inarray,
341  Array<OneD, NekDouble> &outarray);
342  /// This function calculates the coordinates of all the elemental
343  /// quadrature points \f$\boldsymbol{x}_i\f$.
344  inline void GetCoords(
345  Array<OneD, NekDouble> &coord_0,
348 
349  inline void GetCoords(
350  const int eid, Array<OneD, NekDouble> &coord_0,
353 
354  // Homogeneous transforms
355  inline void HomogeneousFwdTrans(const int npts,
356  const Array<OneD, const NekDouble> &inarray,
357  Array<OneD, NekDouble> &outarray,
358  bool Shuff = true, bool UnShuff = true);
359  inline void HomogeneousBwdTrans(const int npts,
360  const Array<OneD, const NekDouble> &inarray,
361  Array<OneD, NekDouble> &outarray,
362  bool Shuff = true, bool UnShuff = true);
363  inline void DealiasedProd(const int num_dofs,
364  const Array<OneD, NekDouble> &inarray1,
365  const Array<OneD, NekDouble> &inarray2,
366  Array<OneD, NekDouble> &outarray);
367  inline void DealiasedDotProd(
368  const int num_dofs, const Array<OneD, Array<OneD, NekDouble>> &inarray1,
369  const Array<OneD, Array<OneD, NekDouble>> &inarray2,
370  Array<OneD, Array<OneD, NekDouble>> &outarray);
371  inline void GetBCValues(Array<OneD, NekDouble> &BndVals,
372  const Array<OneD, NekDouble> &TotField, int BndID);
375  Array<OneD, NekDouble> &outarray,
376  int BndID);
377  inline void NormVectorIProductWRTBase(
379  Array<OneD, NekDouble> &outarray);
380  /// Apply geometry information to each expansion.
382  /// Reset geometry information and reset matrices
384  {
385  v_Reset();
386  }
387  // not sure we really need these in ExpList
388  void WriteTecplotHeader(std::ostream &outfile, std::string var = "")
389  {
390  v_WriteTecplotHeader(outfile, var);
391  }
392  void WriteTecplotZone(std::ostream &outfile, int expansion = -1)
393  {
394  v_WriteTecplotZone(outfile, expansion);
395  }
396  void WriteTecplotField(std::ostream &outfile, int expansion = -1)
397  {
398  v_WriteTecplotField(outfile, expansion);
399  }
400  void WriteTecplotConnectivity(std::ostream &outfile, int expansion = -1)
401  {
402  v_WriteTecplotConnectivity(outfile, expansion);
403  }
404  MULTI_REGIONS_EXPORT void WriteVtkHeader(std::ostream &outfile);
405  MULTI_REGIONS_EXPORT void WriteVtkFooter(std::ostream &outfile);
406  void WriteVtkPieceHeader(std::ostream &outfile, int expansion,
407  int istrip = 0)
408  {
409  v_WriteVtkPieceHeader(outfile, expansion, istrip);
410  }
411  MULTI_REGIONS_EXPORT void WriteVtkPieceFooter(std::ostream &outfile,
412  int expansion);
413  void WriteVtkPieceData(std::ostream &outfile, int expansion,
414  std::string var = "v")
415  {
416  v_WriteVtkPieceData(outfile, expansion, var);
417  }
418 
419  /// This function returns the dimension of the coordinates of the
420  /// element \a eid.
421  // inline
422  MULTI_REGIONS_EXPORT int GetCoordim(int eid);
423 
424  /// Set the \a i th coefficiient in \a m_coeffs to value \a val
425  inline void SetCoeff(int i, NekDouble val);
426  /// Set the \a i th coefficiient in #m_coeffs to value \a val
427  inline void SetCoeffs(int i, NekDouble val);
428  /// Set the #m_coeffs array to inarray
429  inline void SetCoeffsArray(Array<OneD, NekDouble> &inarray);
430  /// This function returns the dimension of the shape of the
431  /// element \a eid.
432  // inline
434  /// This function returns (a reference to) the array
435  /// \f$\boldsymbol{\hat{u}}_l\f$ (implemented as #m_coeffs)
436  /// containing all local expansion coefficients.
437  inline const Array<OneD, const NekDouble> &GetCoeffs() const;
438  /// Impose Dirichlet Boundary Conditions onto Array
439  inline void ImposeDirichletConditions(Array<OneD, NekDouble> &outarray);
440  /// Fill Bnd Condition expansion from the values stored in expansion
441  inline void FillBndCondFromField(const Array<OneD, NekDouble> coeffs);
442  /// Fill Bnd Condition expansion in nreg from the values
443  /// stored in expansion
444  inline void FillBndCondFromField(const int nreg,
445  const Array<OneD, NekDouble> coeffs);
446  /// Gathers the global coefficients \f$\boldsymbol{\hat{u}}_g\f$
447  /// from the local coefficients \f$\boldsymbol{\hat{u}}_l\f$.
448  // inline
449  MULTI_REGIONS_EXPORT inline void LocalToGlobal(bool useComm = true);
451  const Array<OneD, const NekDouble> &inarray,
452  Array<OneD, NekDouble> &outarray, bool useComm = true);
453  /// Scatters from the global coefficients
454  /// \f$\boldsymbol{\hat{u}}_g\f$ to the local coefficients
455  /// \f$\boldsymbol{\hat{u}}_l\f$.
456  // inline
457  MULTI_REGIONS_EXPORT inline void GlobalToLocal(void);
458  /**
459  * This operation is evaluated as:
460  * \f{tabbing}
461  * \hspace{1cm} \= Do \= $e=$ $1, N_{\mathrm{el}}$ \\
462  * > > Do \= $i=$ $0,N_m^e-1$ \\
463  * > > > $\boldsymbol{\hat{u}}^{e}[i] = \mbox{sign}[e][i] \cdot
464  * \boldsymbol{\hat{u}}_g[\mbox{map}[e][i]]$ \\
465  * > > continue \\
466  * > continue
467  * \f}
468  * where \a map\f$[e][i]\f$ is the mapping array and \a
469  * sign\f$[e][i]\f$ is an array of similar dimensions ensuring the
470  * correct modal connectivity between the different elements (both
471  * these arrays are contained in the data member #m_locToGloMap). This
472  * operation is equivalent to the scatter operation
473  * \f$\boldsymbol{\hat{u}}_l=\mathcal{A}\boldsymbol{\hat{u}}_g\f$,
474  * where \f$\mathcal{A}\f$ is the
475  * \f$N_{\mathrm{eof}}\times N_{\mathrm{dof}}\f$ permutation matrix.
476  *
477  * @param inarray An array of size \f$N_\mathrm{dof}\f$
478  * containing the global degrees of freedom
479  * \f$\boldsymbol{x}_g\f$.
480  * @param outarray The resulting local degrees of freedom
481  * \f$\boldsymbol{x}_l\f$ will be stored in this
482  * array of size \f$N_\mathrm{eof}\f$.
483  */
485  const Array<OneD, const NekDouble> &inarray,
486  Array<OneD, NekDouble> &outarray);
487  /// Get the \a i th value (coefficient) of #m_coeffs
488  inline NekDouble GetCoeff(int i);
489  /// Get the \a i th value (coefficient) of #m_coeffs
490  inline NekDouble GetCoeffs(int i);
491  /// This function returns (a reference to) the array
492  /// \f$\boldsymbol{u}_l\f$ (implemented as #m_phys) containing the
493  /// function \f$u^{\delta}(\boldsymbol{x})\f$ evaluated at the
494  /// quadrature points.
495  // inline
497  /// This function calculates the \f$L_\infty\f$ error of the global
498  /// spectral/hp element approximation.
500  Linf(const Array<OneD, const NekDouble> &inarray,
502  /// This function calculates the \f$L_\infty\f$ error of the global
503  /// This function calculates the \f$L_2\f$ error with
504  /// respect to soln of the global
505  /// spectral/hp element approximation.
507  const Array<OneD, const NekDouble> &inarray,
509  {
510  return v_L2(inarray, soln);
511  }
512  /// Calculates the \f$H^1\f$ error of the global spectral/hp
513  /// element approximation.
515  H1(const Array<OneD, const NekDouble> &inarray,
517  /// Calculates the \f$H^1\f$ error of the global spectral/hp
518  /// element approximation.
519  /**
520  * The integration is evaluated locally, that is
521  * \f[\int
522  * f(\boldsymbol{x})d\boldsymbol{x}=\sum_{e=1}^{{N_{\mathrm{el}}}}
523  * \left\{\int_{\Omega_e}f(\boldsymbol{x})d\boldsymbol{x}\right\}, \f]
524  * where the integration over the separate elements is done by the
525  * function StdRegions#StdExpansion#Integral, which discretely
526  * evaluates the integral using Gaussian quadrature.
527  *
528  * Note that the array #m_phys should be filled with the values of the
529  * function \f$f(\boldsymbol{x})\f$ at the quadrature points
530  * \f$\boldsymbol{x}_i\f$.
531  *
532  * @return The value of the discretely evaluated integral
533  * \f$\int f(\boldsymbol{x})d\boldsymbol{x}\f$.
534  */
536  {
537  ASSERTL1(m_physState == true, "local physical space is not true ");
538  return Integral(m_phys);
539  }
540  /**
541  * The integration is evaluated locally, that is
542  * \f[\int
543  * f(\boldsymbol{x})d\boldsymbol{x}=\sum_{e=1}^{{N_{\mathrm{el}}}}
544  * \left\{\int_{\Omega_e}f(\boldsymbol{x})d\boldsymbol{x}\right\}, \f]
545  * where the integration over the separate elements is done by the
546  * function StdRegions#StdExpansion#Integral, which discretely
547  * evaluates the integral using Gaussian quadrature.
548  *
549  * @param inarray An array of size \f$Q_{\mathrm{tot}}\f$
550  * containing the values of the function
551  * \f$f(\boldsymbol{x})\f$ at the quadrature
552  * points \f$\boldsymbol{x}_i\f$.
553  * @return The value of the discretely evaluated integral
554  * \f$\int f(\boldsymbol{x})d\boldsymbol{x}\f$.
555  */
557  {
558  return v_Integral(inarray);
559  }
561  {
562  return v_VectorFlux(inarray);
563  }
564  /// This function calculates the energy associated with
565  /// each one of the modesof a 3D homogeneous nD expansion
567  {
568  return v_HomogeneousEnergy();
569  }
570 
571  /// This function sets the Spectral Vanishing Viscosity
572  /// in homogeneous1D expansion.
574  {
576  }
577 
578  /// This function returns a vector containing the wave
579  /// numbers in z-direction associated
580  /// with the 3D homogenous expansion. Required if a
581  /// parellelisation is applied in the Fourier direction
583  {
584  return v_GetZIDs();
585  }
586 
587  /// This function returns the transposition class
588  /// associated with the homogeneous expansion.
590  {
591  return v_GetTransposition();
592  }
593 
594  /// This function returns the Width of homogeneous direction
595  /// associated with the homogeneous expansion.
597  {
598  return v_GetHomoLen();
599  }
600 
601  /// This function sets the Width of homogeneous direction
602  /// associated with the homogeneous expansion.
603  void SetHomoLen(const NekDouble lhom)
604  {
605  return v_SetHomoLen(lhom);
606  }
607 
608  /// This function returns a vector containing the wave
609  /// numbers in y-direction associated
610  /// with the 3D homogenous expansion. Required if a
611  /// parellelisation is applied in the Fourier direction
613  {
614  return v_GetYIDs();
615  }
616 
617  /// This function interpolates the physical space points in
618  /// \a inarray to \a outarray using the same points defined in the
619  /// expansion but where the number of points are rescaled
620  /// by \a 1DScale
621  void PhysInterp1DScaled(const NekDouble scale,
622  const Array<OneD, NekDouble> &inarray,
623  Array<OneD, NekDouble> &outarray)
624  {
625  v_PhysInterp1DScaled(scale, inarray, outarray);
626  }
627 
628  /// This function Galerkin projects the physical space points in
629  /// \a inarray to \a outarray where inarray is assumed to
630  /// be defined in the expansion but where the number of
631  /// points are rescaled by \a 1DScale
633  const Array<OneD, NekDouble> &inarray,
634  Array<OneD, NekDouble> &outarray)
635  {
636  v_PhysGalerkinProjection1DScaled(scale, inarray, outarray);
637  }
638 
639  /// This function returns the number of elements in the expansion.
640  inline int GetExpSize(void);
641 
642  /// This function returns the number of elements in the
643  /// expansion which may be different for a homogeoenous extended
644  /// expansionp.
645  inline size_t GetNumElmts(void)
646  {
647  return v_GetNumElmts();
648  }
649 
650  /// This function returns the vector of elements in the expansion.
651  inline const std::shared_ptr<LocalRegions::ExpansionVector> GetExp() const;
652 
653  /// This function returns (a shared pointer to) the local elemental
654  /// expansion of the \f$n^{\mathrm{th}}\f$ element.
655  inline LocalRegions::ExpansionSharedPtr &GetExp(int n) const;
656 
657  /// This function returns (a shared pointer to) the local elemental
658  /// expansion of the \f$n^{\mathrm{th}}\f$ element given a global
659  /// geometry ID.
661 
662  /// This function returns (a shared pointer to) the local elemental
663  /// expansion containing the arbitrary point given by \a gloCoord.
665  const Array<OneD, const NekDouble> &gloCoord);
666 
667  /**
668  * @brief This function returns the index of the local elemental
669  * expansion containing the arbitrary point given by \a gloCoord,
670  * within a distance tolerance of tol.
671  *
672  * If returnNearestElmt is true and no element contains the point,
673  * this function returns the nearest element whose bounding box contains
674  * the point. The bounding box has a 10% margin in each direction.
675  *
676  * @param gloCoord (input) coordinate in physics space
677  * @param locCoords (output) local coordinate xi in the returned element
678  * @param tol distance tolerance to judge if a point lies in an
679  * element
680  * @param returnNearestElmt if true and no element contains this point, the
681  * nearest element whose bounding box contains this
682  * point is returned
683  * @param cachedId an initial guess of the most possible element index
684  * @param maxDistance if returnNearestElmt is set as true, the nearest
685  * element will be returned. But the distance of the
686  * nearest element and this point should be <=
687  * maxDistance.
688  *
689  * @return element index; if no element is found, -1 is returned.
690  */
692  const Array<OneD, const NekDouble> &gloCoord, NekDouble tol = 0.0,
693  bool returnNearestElmt = false, int cachedId = -1,
694  NekDouble maxDistance = 1e6);
695 
696  /** This function returns the index and the Local
697  * Cartesian Coordinates \a locCoords of the local
698  * elemental expansion containing the arbitrary point
699  * given by \a gloCoords.
700  **/
702  const Array<OneD, const NekDouble> &gloCoords,
703  Array<OneD, NekDouble> &locCoords, NekDouble tol = 0.0,
704  bool returnNearestElmt = false, int cachedId = -1,
705  NekDouble maxDistance = 1e6);
706 
707  /** This function return the expansion field value
708  * at the coordinates given as input.
709  **/
712  const Array<OneD, const NekDouble> &phys);
713 
714  /// Get the start offset position for a local contiguous list of
715  /// coeffs correspoinding to element n.
716  inline int GetCoeff_Offset(int n) const;
717 
718  /// Get the start offset position for a local contiguous list of
719  /// quadrature points in a full array correspoinding to element n.
720  inline int GetPhys_Offset(int n) const;
721 
722  /// This function returns (a reference to) the array
723  /// \f$\boldsymbol{\hat{u}}_l\f$ (implemented as #m_coeffs)
724  /// containing all local expansion coefficients.
726  /// This function returns (a reference to) the array
727  /// \f$\boldsymbol{u}_l\f$ (implemented as #m_phys) containing the
728  /// function \f$u^{\delta}(\boldsymbol{x})\f$ evaluated at the
729  /// quadrature points.
731  inline void PhysDeriv(Direction edir,
732  const Array<OneD, const NekDouble> &inarray,
733  Array<OneD, NekDouble> &out_d);
734  /// This function discretely evaluates the derivative of a function
735  /// \f$f(\boldsymbol{x})\f$ on the domain consisting of all
736  /// elements of the expansion.
737  inline void PhysDeriv(
738  const Array<OneD, const NekDouble> &inarray,
739  Array<OneD, NekDouble> &out_d0,
742  inline void PhysDeriv(const int dir,
743  const Array<OneD, const NekDouble> &inarray,
744  Array<OneD, NekDouble> &out_d);
745  inline void CurlCurl(Array<OneD, Array<OneD, NekDouble>> &Vel,
747  inline void PhysDirectionalDeriv(
748  const Array<OneD, const NekDouble> &direction,
749  const Array<OneD, const NekDouble> &inarray,
750  Array<OneD, NekDouble> &outarray);
751  inline void GetMovingFrames(const SpatialDomains::GeomMMF MMFdir,
752  const Array<OneD, const NekDouble> &CircCentre,
753  Array<OneD, Array<OneD, NekDouble>> &outarray);
754  // functions associated with DisContField
757  /// Get the weight value for boundary conditions
759  /// Set the weight value for boundary conditions
760  inline void SetBndCondBwdWeight(const int index, const NekDouble value);
761  inline std::shared_ptr<ExpList> &UpdateBndCondExpansion(int i);
762  inline void Upwind(const Array<OneD, const NekDouble> &Vn,
763  const Array<OneD, const NekDouble> &Fwd,
764  const Array<OneD, const NekDouble> &Bwd,
766  inline void Upwind(const Array<OneD, const Array<OneD, NekDouble>> &Vec,
767  const Array<OneD, const NekDouble> &Fwd,
768  const Array<OneD, const NekDouble> &Bwd,
770  /**
771  * Return a reference to the trace space associated with this
772  * expansion list.
773  */
774  inline std::shared_ptr<ExpList> &GetTrace();
775  inline std::shared_ptr<AssemblyMapDG> &GetTraceMap(void);
776  inline const Array<OneD, const int> &GetTraceBndMap(void);
777  inline void GetNormals(Array<OneD, Array<OneD, NekDouble>> &normals);
778  /// Get the length of elements in boundary normal direction
780  Array<OneD, NekDouble> &lengthsFwd, Array<OneD, NekDouble> &lengthsBwd);
781  /// Get the weight value for boundary conditions
782  /// for boundary average and jump calculations
784  Array<OneD, NekDouble> &weightJump);
785  inline void AddTraceIntegral(const Array<OneD, const NekDouble> &Fx,
787  Array<OneD, NekDouble> &outarray);
788  inline void AddTraceIntegral(const Array<OneD, const NekDouble> &Fn,
789  Array<OneD, NekDouble> &outarray);
791  const Array<OneD, const NekDouble> &Bwd,
792  Array<OneD, NekDouble> &outarray);
795  inline void GetFwdBwdTracePhys(const Array<OneD, const NekDouble> &field,
798  bool FillBnd = true,
799  bool PutFwdInBwdOnBCs = false,
800  bool DoExchange = true);
801  inline void FillBwdWithBoundCond(const Array<OneD, NekDouble> &Fwd,
803  bool PutFwdInBwdOnBCs = false);
804  /// Add Fwd and Bwd value to field,
805  /// a reverse procedure of GetFwdBwdTracePhys
807  const Array<OneD, const NekDouble> &Bwd,
808  Array<OneD, NekDouble> &field);
810  const Array<OneD, const NekDouble> &Fwd,
812  {
813  v_AddTraceQuadPhysToOffDiag(Fwd, Bwd, field);
814  }
816  const Array<OneD, const NekDouble> &Bwd,
817  Array<OneD, NekDouble> &locTraceFwd,
818  Array<OneD, NekDouble> &locTraceBwd);
819  /// Fill Bwd with boundary conditions
820  inline void FillBwdWithBwdWeight(Array<OneD, NekDouble> &weightave,
821  Array<OneD, NekDouble> &weightjmp);
822  /// Copy and fill the Periodic boundaries
823  inline void PeriodicBwdCopy(const Array<OneD, const NekDouble> &Fwd,
825  inline const std::vector<bool> &GetLeftAdjacentFaces(void) const;
826  inline void ExtractTracePhys(Array<OneD, NekDouble> &outarray);
827  inline void ExtractTracePhys(const Array<OneD, const NekDouble> &inarray,
828  Array<OneD, NekDouble> &outarray);
830  &GetBndConditions();
833  inline void EvaluateBoundaryConditions(
834  const NekDouble time = 0.0, const std::string varName = "",
837  // Routines for continous matrix solution
838  /// This function calculates the result of the multiplication of a
839  /// matrix of type specified by \a mkey with a vector given by \a
840  /// inarray.
842  const GlobalMatrixKey &gkey,
843  const Array<OneD, const NekDouble> &inarray,
844  Array<OneD, NekDouble> &outarray);
845  inline void SetUpPhysNormals();
846  inline void GetBoundaryToElmtMap(Array<OneD, int> &ElmtID,
847  Array<OneD, int> &EdgeID);
848  virtual void GetBndElmtExpansion(int i, std::shared_ptr<ExpList> &result,
849  const bool DeclareCoeffPhysArrays = true);
850 
851  inline void ExtractElmtToBndPhys(int i, const Array<OneD, NekDouble> &elmt,
852  Array<OneD, NekDouble> &boundary);
853 
854  inline void ExtractPhysToBndElmt(int i,
855  const Array<OneD, const NekDouble> &phys,
856  Array<OneD, NekDouble> &bndElmt);
857 
858  inline void ExtractPhysToBnd(int i,
859  const Array<OneD, const NekDouble> &phys,
861 
862  inline void GetBoundaryNormals(
863  int i, Array<OneD, Array<OneD, NekDouble>> &normals);
864 
866  std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef,
867  int NumHomoDir = 0,
870  std::vector<NekDouble> &HomoLen = LibUtilities::NullNekDoubleVector,
871  bool homoStrips = false,
872  std::vector<unsigned int> &HomoSIDs =
874  std::vector<unsigned int> &HomoZIDs =
876  std::vector<unsigned int> &HomoYIDs =
878 
879  std::map<int, RobinBCInfoSharedPtr> GetRobinBCInfo()
880  {
881  return v_GetRobinBCInfo();
882  }
883 
884  void GetPeriodicEntities(PeriodicMap &periodicVerts,
885  PeriodicMap &periodicEdges,
886  PeriodicMap &periodicFaces = NullPeriodicMap)
887  {
888  v_GetPeriodicEntities(periodicVerts, periodicEdges, periodicFaces);
889  }
890 
891  std::vector<LibUtilities::FieldDefinitionsSharedPtr> GetFieldDefinitions()
892  {
893  return v_GetFieldDefinitions();
894  }
895 
897  std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef)
898  {
899  v_GetFieldDefinitions(fielddef);
900  }
901 
902  /// Append the element data listed in elements
903  /// fielddef->m_ElementIDs onto fielddata
905  std::vector<NekDouble> &fielddata)
906  {
907  v_AppendFieldData(fielddef, fielddata);
908  }
909  /// Append the data in coeffs listed in elements
910  /// fielddef->m_ElementIDs onto fielddata
912  std::vector<NekDouble> &fielddata,
913  Array<OneD, NekDouble> &coeffs)
914  {
915  v_AppendFieldData(fielddef, fielddata, coeffs);
916  }
917  /** \brief Extract the data in fielddata into the coeffs
918  * using the basic ExpList Elemental expansions rather
919  * than planes in homogeneous case
920  */
923  std::vector<NekDouble> &fielddata, std::string &field,
924  Array<OneD, NekDouble> &coeffs);
925  /** \brief Extract the data from fromField using
926  * fromExpList the coeffs using the basic ExpList
927  * Elemental expansions rather than planes in homogeneous
928  * case
929  */
931  const std::shared_ptr<ExpList> &fromExpList,
932  const Array<OneD, const NekDouble> &fromCoeffs,
933  Array<OneD, NekDouble> &toCoeffs);
934  // Extract data in fielddata into the m_coeffs_list for the 3D stability
935  // analysis (base flow is 2D)
938  std::vector<NekDouble> &fielddata, std::string &field,
939  Array<OneD, NekDouble> &coeffs,
940  std::unordered_map<int, int> zIdToPlane =
941  std::unordered_map<int, int>());
942  // Extract data from file fileName and put coefficents into array coefffs
944  const std::string &fileName, LibUtilities::CommSharedPtr comm,
945  const std::string &varName, Array<OneD, NekDouble> &coeffs);
947  const int ElementID, const NekDouble scalar1, const NekDouble scalar2,
948  Array<OneD, NekDouble> &outarray);
949  /// Returns a shared pointer to the current object.
950  std::shared_ptr<ExpList> GetSharedThisPtr()
951  {
952  return shared_from_this();
953  }
954  /// Returns the session object
955  std::shared_ptr<LibUtilities::SessionReader> GetSession() const
956  {
957  return m_session;
958  }
959  /// Returns the comm object
960  std::shared_ptr<LibUtilities::Comm> GetComm() const
961  {
962  return m_comm;
963  }
965  {
966  return m_graph;
967  }
968  // Wrapper functions for Homogeneous Expansions
970  {
971  return v_GetHomogeneousBasis();
972  }
973  std::shared_ptr<ExpList> &GetPlane(int n)
974  {
975  return v_GetPlane(n);
976  }
980 
981  MULTI_REGIONS_EXPORT int GetPoolCount(std::string);
982 
984 
986  &GetGlobalLinSysManager(void);
987 
988  /// Get m_coeffs to elemental value map
990  &GetCoeffsToElmt() const;
996  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
997  const int nDirctn, Array<OneD, DNekMatSharedPtr> &mtxPerVar);
999  const TensorOfArray3D<NekDouble> &inarray,
1000  Array<OneD, DNekMatSharedPtr> &mtxPerVar);
1002  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
1003  Array<OneD, DNekMatSharedPtr> &mtxPerVar);
1005  const Array<OneD, const NekDouble> &FwdFlux,
1006  const Array<OneD, const NekDouble> &BwdFlux,
1007  Array<OneD, NekDouble> &outarray)
1008  {
1009  v_AddTraceIntegralToOffDiag(FwdFlux, BwdFlux, outarray);
1010  }
1012  const int dir, const Array<OneD, const DNekMatSharedPtr> ElmtJacQuad,
1013  Array<OneD, DNekMatSharedPtr> ElmtJacCoef);
1015  const Array<OneD, const DNekMatSharedPtr> ElmtJacQuad,
1016  Array<OneD, DNekMatSharedPtr> ElmtJacCoef);
1018  GetLocTraceToTraceMap() const;
1019  // Return the internal vector which identifieds if trace
1020  // is left adjacent definiing which trace the normal
1021  // points otwards from
1022  MULTI_REGIONS_EXPORT std::vector<bool> &GetLeftAdjacentTraces(void);
1023 
1024  /// This function returns the map of index inside m_exp to geom id
1025  MULTI_REGIONS_EXPORT inline const std::unordered_map<int, int>
1027  {
1028  return m_elmtToExpId;
1029  }
1030 
1031  /// This function returns the index inside m_exp for a given geom id
1032  MULTI_REGIONS_EXPORT inline int GetElmtToExpId(int elmtId)
1033  {
1034  auto it = m_elmtToExpId.find(elmtId);
1035  ASSERTL0(it != m_elmtToExpId.end(), "Global geometry ID " +
1036  std::to_string(elmtId) +
1037  " not found in element ID to "
1038  "expansion ID map.")
1039  return it->second;
1040  }
1041 
1042 protected:
1043  /// Exapnsion type
1045  std::shared_ptr<DNekMat> GenGlobalMatrixFull(
1046  const GlobalLinSysKey &mkey,
1047  const std::shared_ptr<AssemblyMapCG> &locToGloMap);
1048  /// Communicator
1050  /// Session
1052  /// Mesh associated with this expansion list.
1054  /// The total number of local degrees of freedom. #m_ncoeffs
1055  /// \f$=N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_l\f$
1057  /** The total number of quadrature points. #m_npoints
1058  *\f$=Q_{\mathrm{tot}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_Q\f$
1059  **/
1061  /**
1062  * \brief Concatenation of all local expansion coefficients.
1063  *
1064  * The array of length #m_ncoeffs\f$=N_{\mathrm{eof}}\f$ which is
1065  * the concatenation of the local expansion coefficients
1066  * \f$\hat{u}_n^e\f$ over all \f$N_{\mathrm{el}}\f$ elements
1067  * \f[\mathrm{\texttt{m\_coeffs}}=\boldsymbol{\hat{u}}_{l} =
1068  * \underline{\boldsymbol{\hat{u}}}^e = \left [ \begin{array}{c}
1069  * \boldsymbol{\hat{u}}^{1} \ \
1070  * \boldsymbol{\hat{u}}^{2} \ \
1071  * \vdots \ \
1072  * \boldsymbol{\hat{u}}^{{{N_{\mathrm{el}}}}} \end{array} \right ],
1073  * \quad
1074  * \mathrm{where}\quad \boldsymbol{\hat{u}}^{e}[n]=\hat{u}_n^{e}\f]
1075  */
1077  /**
1078  * \brief The global expansion evaluated at the quadrature points
1079  *
1080  * The array of length #m_npoints\f$=Q_{\mathrm{tot}}\f$ containing
1081  * the evaluation of \f$u^{\delta}(\boldsymbol{x})\f$ at the
1082  * quadrature points \f$\boldsymbol{x}_i\f$.
1083  * \f[\mathrm{\texttt{m\_phys}}=\boldsymbol{u}_{l} =
1084  * \underline{\boldsymbol{u}}^e = \left [ \begin{array}{c}
1085  * \boldsymbol{u}^{1} \ \
1086  * \boldsymbol{u}^{2} \ \
1087  * \vdots \ \
1088  * \boldsymbol{u}^{{{N_{\mathrm{el}}}}} \end{array} \right ],\quad
1089  * \mathrm{where}\quad
1090  * \boldsymbol{u}^{e}[i]=u^{\delta}(\boldsymbol{x}_i)\f]
1091  */
1093  /**
1094  * \brief The state of the array #m_phys.
1095  *
1096  * Indicates whether the array #m_phys, created to contain the
1097  * evaluation of \f$u^{\delta}(\boldsymbol{x})\f$ at the quadrature
1098  * points \f$\boldsymbol{x}_i\f$, is filled with these values.
1099  */
1101  /**
1102  * \brief The list of local expansions.
1103  *
1104  * The (shared pointer to the) vector containing (shared pointers
1105  * to) all local expansions. The fact that the local expansions are
1106  * all stored as a (pointer to a) #StdExpansion, the abstract base
1107  * class for all local expansions, allows a general implementation
1108  * where most of the routines for the derived classes are defined
1109  * in the #ExpList base class.
1110  */
1111  std::shared_ptr<LocalRegions::ExpansionVector> m_exp;
1113  /// Vector of bools to act as an initialise on first call flag
1114  std::vector<bool> m_collectionsDoInit;
1115  /// Offset of elemental data into the array #m_coeffs
1116  std::vector<int> m_coll_coeff_offset;
1117  /// Offset of elemental data into the array #m_phys
1118  std::vector<int> m_coll_phys_offset;
1119  /// Offset of elemental data into the array #m_coeffs
1121  /// Offset of elemental data into the array #m_phys
1123  /// m_coeffs to elemental value map
1126  //@todo should this be in ExpList or
1127  // ExpListHomogeneous1D.cpp it's a bool which determine if
1128  // the expansion is in the wave space (coefficient space)
1129  // or not
1131  /// Mapping from geometry ID of element to index inside #m_exp
1132  std::unordered_map<int, int> m_elmtToExpId;
1133  /// This function assembles the block diagonal matrix of local
1134  /// matrices of the type \a mtype.
1137  void MultiplyByBlockMatrix(const GlobalMatrixKey &gkey,
1138  const Array<OneD, const NekDouble> &inarray,
1139  Array<OneD, NekDouble> &outarray);
1140  /// Generates a global matrix from the given key and map.
1141  std::shared_ptr<GlobalMatrix> GenGlobalMatrix(
1142  const GlobalMatrixKey &mkey,
1143  const std::shared_ptr<AssemblyMapCG> &locToGloMap);
1145  const std::shared_ptr<DNekMat> &Gmat,
1146  Array<OneD, NekDouble> &EigValsReal,
1147  Array<OneD, NekDouble> &EigValsImag,
1149  /// This operation constructs the global linear system of type \a
1150  /// mkey.
1151  std::shared_ptr<GlobalLinSys> GenGlobalLinSys(
1152  const GlobalLinSysKey &mkey,
1153  const std::shared_ptr<AssemblyMapCG> &locToGloMap);
1154  /// Generate a GlobalLinSys from information provided by the key
1155  /// "mkey" and the mapping provided in LocToGloBaseMap.
1156  std::shared_ptr<GlobalLinSys> GenGlobalBndLinSys(
1157  const GlobalLinSysKey &mkey, const AssemblyMapSharedPtr &locToGloMap);
1158  // Virtual prototypes
1159  virtual size_t v_GetNumElmts(void)
1160  {
1161  return (*m_exp).size();
1162  }
1164  &v_GetBndCondExpansions(void);
1166  virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value);
1167  virtual std::shared_ptr<ExpList> &v_UpdateBndCondExpansion(int i);
1168  virtual void v_Upwind(const Array<OneD, const Array<OneD, NekDouble>> &Vec,
1169  const Array<OneD, const NekDouble> &Fwd,
1170  const Array<OneD, const NekDouble> &Bwd,
1172  virtual void v_Upwind(const Array<OneD, const NekDouble> &Vn,
1173  const Array<OneD, const NekDouble> &Fwd,
1174  const Array<OneD, const NekDouble> &Bwd,
1176  virtual std::shared_ptr<ExpList> &v_GetTrace();
1177  virtual std::shared_ptr<AssemblyMapDG> &v_GetTraceMap();
1178  virtual const Array<OneD, const int> &v_GetTraceBndMap();
1179  virtual const std::shared_ptr<LocTraceToTraceMap> &v_GetLocTraceToTraceMap(
1180  void) const;
1181  virtual std::vector<bool> &v_GetLeftAdjacentTraces(void);
1182  /// Populate \a normals with the normals of all expansions.
1183  virtual void v_GetNormals(Array<OneD, Array<OneD, NekDouble>> &normals);
1184  virtual void v_AddTraceIntegral(const Array<OneD, const NekDouble> &Fx,
1185  const Array<OneD, const NekDouble> &Fy,
1186  Array<OneD, NekDouble> &outarray);
1187  virtual void v_AddTraceIntegral(const Array<OneD, const NekDouble> &Fn,
1188  Array<OneD, NekDouble> &outarray);
1189  virtual void v_AddFwdBwdTraceIntegral(
1190  const Array<OneD, const NekDouble> &Fwd,
1191  const Array<OneD, const NekDouble> &Bwd,
1192  Array<OneD, NekDouble> &outarray);
1193  virtual void v_GetFwdBwdTracePhys(Array<OneD, NekDouble> &Fwd,
1194  Array<OneD, NekDouble> &Bwd);
1195  virtual void v_GetFwdBwdTracePhys(const Array<OneD, const NekDouble> &field,
1198  bool FillBnd = true,
1199  bool PutFwdInBwdOnBCs = false,
1200  bool DoExchange = true);
1201  virtual void v_FillBwdWithBoundCond(const Array<OneD, NekDouble> &Fwd,
1203  bool PutFwdInBwdOnBCs);
1204  virtual void v_AddTraceQuadPhysToField(
1205  const Array<OneD, const NekDouble> &Fwd,
1207  virtual void v_AddTraceQuadPhysToOffDiag(
1208  const Array<OneD, const NekDouble> &Fwd,
1210  virtual void v_GetLocTraceFromTracePts(
1211  const Array<OneD, const NekDouble> &Fwd,
1212  const Array<OneD, const NekDouble> &Bwd,
1213  Array<OneD, NekDouble> &locTraceFwd,
1214  Array<OneD, NekDouble> &locTraceBwd);
1215  virtual void v_FillBwdWithBwdWeight(Array<OneD, NekDouble> &weightave,
1216  Array<OneD, NekDouble> &weightjmp);
1217  virtual void v_PeriodicBwdCopy(const Array<OneD, const NekDouble> &Fwd,
1218  Array<OneD, NekDouble> &Bwd);
1219  virtual const std::vector<bool> &v_GetLeftAdjacentFaces(void) const;
1220  virtual void v_ExtractTracePhys(Array<OneD, NekDouble> &outarray);
1221  virtual void v_ExtractTracePhys(const Array<OneD, const NekDouble> &inarray,
1222  Array<OneD, NekDouble> &outarray);
1223  virtual void v_MultiplyByInvMassMatrix(
1224  const Array<OneD, const NekDouble> &inarray,
1225  Array<OneD, NekDouble> &outarray);
1226 
1227  virtual GlobalLinSysKey v_HelmSolve(
1228  const Array<OneD, const NekDouble> &inarray,
1229  Array<OneD, NekDouble> &outarray,
1230  const StdRegions::ConstFactorMap &factors,
1231  const StdRegions::VarCoeffMap &varcoeff,
1232  const MultiRegions::VarFactorsMap &varfactors,
1233  const Array<OneD, const NekDouble> &dirForcing,
1234  const bool PhysSpaceForcing);
1235 
1237  const Array<OneD, Array<OneD, NekDouble>> &velocity,
1238  const Array<OneD, const NekDouble> &inarray,
1239  Array<OneD, NekDouble> &outarray, const NekDouble lambda,
1241  virtual void v_LinearAdvectionReactionSolve(
1242  const Array<OneD, Array<OneD, NekDouble>> &velocity,
1243  const Array<OneD, const NekDouble> &inarray,
1244  Array<OneD, NekDouble> &outarray, const NekDouble lambda,
1246  // wrapper functions about virtual functions
1247  virtual void v_ImposeDirichletConditions(Array<OneD, NekDouble> &outarray);
1248  virtual void v_FillBndCondFromField(const Array<OneD, NekDouble> coeffs);
1249  virtual void v_FillBndCondFromField(const int nreg,
1250  const Array<OneD, NekDouble> coeffs);
1251  virtual void v_Reset();
1252  virtual void v_LocalToGlobal(bool UseComm);
1253  virtual void v_LocalToGlobal(const Array<OneD, const NekDouble> &inarray,
1254  Array<OneD, NekDouble> &outarray,
1255  bool UseComm);
1256  virtual void v_GlobalToLocal(void);
1257  virtual void v_GlobalToLocal(const Array<OneD, const NekDouble> &inarray,
1258  Array<OneD, NekDouble> &outarray);
1259  virtual void v_BwdTrans(const Array<OneD, const NekDouble> &inarray,
1260  Array<OneD, NekDouble> &outarray);
1261  virtual void v_FwdTrans(const Array<OneD, const NekDouble> &inarray,
1262  Array<OneD, NekDouble> &outarray);
1263  virtual void v_FwdTransLocalElmt(
1264  const Array<OneD, const NekDouble> &inarray,
1265  Array<OneD, NekDouble> &outarray);
1266  virtual void v_FwdTransBndConstrained(
1267  const Array<OneD, const NekDouble> &inarray,
1268  Array<OneD, NekDouble> &outarray);
1269  virtual void v_SmoothField(Array<OneD, NekDouble> &field);
1270  virtual void v_IProductWRTBase(const Array<OneD, const NekDouble> &inarray,
1271  Array<OneD, NekDouble> &outarray);
1272  virtual void v_GetCoords(
1273  Array<OneD, NekDouble> &coord_0,
1276 
1277  virtual void v_GetCoords(const int eid, Array<OneD, NekDouble> &xc0,
1279  Array<OneD, NekDouble> &xc2);
1280 
1281  virtual void v_PhysDeriv(const Array<OneD, const NekDouble> &inarray,
1282  Array<OneD, NekDouble> &out_d0,
1283  Array<OneD, NekDouble> &out_d1,
1284  Array<OneD, NekDouble> &out_d2);
1285  virtual void v_PhysDeriv(const int dir,
1286  const Array<OneD, const NekDouble> &inarray,
1287  Array<OneD, NekDouble> &out_d);
1288  virtual void v_PhysDeriv(Direction edir,
1289  const Array<OneD, const NekDouble> &inarray,
1290  Array<OneD, NekDouble> &out_d);
1291  virtual void v_CurlCurl(Array<OneD, Array<OneD, NekDouble>> &Vel,
1293  virtual void v_PhysDirectionalDeriv(
1294  const Array<OneD, const NekDouble> &direction,
1295  const Array<OneD, const NekDouble> &inarray,
1296  Array<OneD, NekDouble> &outarray);
1297  virtual void v_GetMovingFrames(
1298  const SpatialDomains::GeomMMF MMFdir,
1299  const Array<OneD, const NekDouble> &CircCentre,
1300  Array<OneD, Array<OneD, NekDouble>> &outarray);
1301  virtual void v_HomogeneousFwdTrans(
1302  const int npts, const Array<OneD, const NekDouble> &inarray,
1303  Array<OneD, NekDouble> &outarray, bool Shuff = true,
1304  bool UnShuff = true);
1305  virtual void v_HomogeneousBwdTrans(
1306  const int npts, const Array<OneD, const NekDouble> &inarray,
1307  Array<OneD, NekDouble> &outarray, bool Shuff = true,
1308  bool UnShuff = true);
1309  virtual void v_DealiasedProd(const int num_dofs,
1310  const Array<OneD, NekDouble> &inarray1,
1311  const Array<OneD, NekDouble> &inarray2,
1312  Array<OneD, NekDouble> &outarray);
1313  virtual void v_DealiasedDotProd(
1314  const int num_dofs, const Array<OneD, Array<OneD, NekDouble>> &inarray1,
1315  const Array<OneD, Array<OneD, NekDouble>> &inarray2,
1316  Array<OneD, Array<OneD, NekDouble>> &outarray);
1317  virtual void v_GetBCValues(Array<OneD, NekDouble> &BndVals,
1318  const Array<OneD, NekDouble> &TotField,
1319  int BndID);
1322  Array<OneD, NekDouble> &outarray,
1323  int BndID);
1324  virtual void v_NormVectorIProductWRTBase(
1326  Array<OneD, NekDouble> &outarray);
1327  virtual void v_SetUpPhysNormals();
1328  virtual void v_GetBoundaryToElmtMap(Array<OneD, int> &ElmtID,
1329  Array<OneD, int> &EdgeID);
1330  virtual void v_GetBndElmtExpansion(int i, std::shared_ptr<ExpList> &result,
1331  const bool DeclareCoeffPhysArrays);
1332 
1333  virtual void v_ExtractElmtToBndPhys(const int i,
1334  const Array<OneD, NekDouble> &elmt,
1335  Array<OneD, NekDouble> &boundary);
1336 
1337  virtual void v_ExtractPhysToBndElmt(
1338  const int i, const Array<OneD, const NekDouble> &phys,
1339  Array<OneD, NekDouble> &bndElmt);
1340 
1341  virtual void v_ExtractPhysToBnd(const int i,
1342  const Array<OneD, const NekDouble> &phys,
1343  Array<OneD, NekDouble> &bnd);
1344 
1345  virtual void v_GetBoundaryNormals(
1346  int i, Array<OneD, Array<OneD, NekDouble>> &normals);
1347 
1348  virtual std::vector<LibUtilities::FieldDefinitionsSharedPtr>
1349  v_GetFieldDefinitions(void);
1350 
1351  virtual void v_GetFieldDefinitions(
1352  std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef);
1353 
1354  virtual void v_AppendFieldData(
1356  std::vector<NekDouble> &fielddata);
1357  virtual void v_AppendFieldData(
1359  std::vector<NekDouble> &fielddata, Array<OneD, NekDouble> &coeffs);
1360  virtual void v_ExtractDataToCoeffs(
1362  std::vector<NekDouble> &fielddata, std::string &field,
1363  Array<OneD, NekDouble> &coeffs,
1364  std::unordered_map<int, int> zIdToPlane);
1365  virtual void v_ExtractCoeffsToCoeffs(
1366  const std::shared_ptr<ExpList> &fromExpList,
1367  const Array<OneD, const NekDouble> &fromCoeffs,
1368  Array<OneD, NekDouble> &toCoeffs);
1369  virtual void v_WriteTecplotHeader(std::ostream &outfile,
1370  std::string var = "");
1371  virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion);
1372  virtual void v_WriteTecplotField(std::ostream &outfile, int expansion);
1373  virtual void v_WriteTecplotConnectivity(std::ostream &outfile,
1374  int expansion);
1375  virtual void v_WriteVtkPieceData(std::ostream &outfile, int expansion,
1376  std::string var);
1377  virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion,
1378  int istrip);
1379 
1380  virtual NekDouble v_L2(
1381  const Array<OneD, const NekDouble> &phys,
1383 
1384  virtual NekDouble v_Integral(const Array<OneD, const NekDouble> &inarray);
1385  virtual NekDouble v_VectorFlux(
1386  const Array<OneD, Array<OneD, NekDouble>> &inarray);
1387 
1389 
1391  virtual NekDouble v_GetHomoLen(void);
1392  virtual void v_SetHomoLen(const NekDouble lhom);
1395 
1396  // 1D Scaling and projection
1397  virtual void v_PhysInterp1DScaled(const NekDouble scale,
1398  const Array<OneD, NekDouble> &inarray,
1399  Array<OneD, NekDouble> &outarray);
1400 
1401  virtual void v_PhysGalerkinProjection1DScaled(
1402  const NekDouble scale, const Array<OneD, NekDouble> &inarray,
1403  Array<OneD, NekDouble> &outarray);
1404 
1405  virtual void v_ClearGlobalLinSysManager(void);
1406 
1407  virtual int v_GetPoolCount(std::string);
1408 
1409  virtual void v_UnsetGlobalLinSys(GlobalLinSysKey, bool);
1410 
1412  &v_GetGlobalLinSysManager(void);
1413 
1414  void ExtractFileBCs(const std::string &fileName,
1416  const std::string &varName,
1417  const std::shared_ptr<ExpList> locExpList);
1418 
1419  // Utility function for a common case of retrieving a
1420  // BoundaryCondition from a boundary condition collection.
1424  unsigned int index, const std::string &variable);
1425 
1427  &v_GetBndConditions();
1428 
1431 
1432  virtual void v_EvaluateBoundaryConditions(
1433  const NekDouble time = 0.0, const std::string varName = "",
1436 
1437  virtual std::map<int, RobinBCInfoSharedPtr> v_GetRobinBCInfo(void);
1438 
1439  virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts,
1440  PeriodicMap &periodicEdges,
1441  PeriodicMap &periodicFaces);
1442 
1443  // Homogeneous direction wrapper functions.
1445  {
1447  "This method is not defined or valid for this class type");
1449  }
1450 
1451  // wrapper function to set viscosity for Homo1D expansion
1453  {
1454  boost::ignore_unused(visc);
1456  "This method is not defined or valid for this class type");
1457  }
1458 
1459  virtual std::shared_ptr<ExpList> &v_GetPlane(int n);
1460 
1461  virtual void v_AddTraceIntegralToOffDiag(
1462  const Array<OneD, const NekDouble> &FwdFlux,
1463  const Array<OneD, const NekDouble> &BwdFlux,
1464  Array<OneD, NekDouble> &outarray);
1465 
1466 private:
1467  /// Definition of the total number of degrees of freedom and
1468  /// quadrature points and offsets to access data
1469  void SetupCoeffPhys(bool DeclareCoeffPhysArrays = true,
1470  bool SetupOffsets = true);
1471 
1472  /// Define a list of elements using the geometry and basis
1473  /// key information in expmap;
1475 };
1476 
1477 /// An empty ExpList object.
1480 
1481 // An empty GlobaLinSysManager object
1485 
1486 // Inline routines follow.
1487 
1488 /**
1489  * Returns the total number of local degrees of freedom
1490  * \f$N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_m\f$.
1491  */
1492 inline int ExpList::GetNcoeffs() const
1493 {
1494  return m_ncoeffs;
1495 }
1496 
1497 inline int ExpList::GetNcoeffs(const int eid) const
1498 {
1499  return (*m_exp)[eid]->GetNcoeffs();
1500 }
1501 
1502 /**
1503  * Evaulates the maximum number of modes in the elemental basis
1504  * order over all elements
1505  */
1507 {
1508  int returnval = 0;
1509 
1510  for (size_t i = 0; i < (*m_exp).size(); ++i)
1511  {
1512  returnval = (std::max)(returnval, (*m_exp)[i]->EvalBasisNumModesMax());
1513  }
1514 
1515  return returnval;
1516 }
1517 
1518 /**
1519  *
1520  */
1522 {
1523  Array<OneD, int> returnval((*m_exp).size(), 0);
1524 
1525  for (size_t i = 0; i < (*m_exp).size(); ++i)
1526  {
1527  returnval[i] =
1528  (std::max)(returnval[i], (*m_exp)[i]->EvalBasisNumModesMax());
1529  }
1530 
1531  return returnval;
1532 }
1533 
1534 /**
1535  *
1536  */
1537 inline int ExpList::GetTotPoints() const
1538 {
1539  return m_npoints;
1540 }
1541 
1542 inline int ExpList::GetTotPoints(const int eid) const
1543 {
1544  return (*m_exp)[eid]->GetTotPoints();
1545 }
1546 
1547 inline int ExpList::Get1DScaledTotPoints(const NekDouble scale) const
1548 {
1549  int returnval = 0;
1550  size_t cnt;
1551  size_t nbase = (*m_exp)[0]->GetNumBases();
1552 
1553  for (size_t i = 0; i < (*m_exp).size(); ++i)
1554  {
1555  cnt = 1;
1556  for (size_t j = 0; j < nbase; ++j)
1557  {
1558  cnt *= scale * ((*m_exp)[i]->GetNumPoints(j));
1559  }
1560  returnval += cnt;
1561  }
1562  return returnval;
1563 }
1564 
1565 /**
1566  *
1567  */
1568 inline int ExpList::GetNpoints() const
1569 {
1570  return m_npoints;
1571 }
1572 
1573 /**
1574  *
1575  */
1576 inline void ExpList::SetWaveSpace(const bool wavespace)
1577 {
1578  m_WaveSpace = wavespace;
1579 }
1580 
1581 /**
1582  *
1583  */
1584 inline bool ExpList::GetWaveSpace() const
1585 {
1586  return m_WaveSpace;
1587 }
1588 
1589 /// Set the \a i th value of\a m_phys to value \a val
1590 inline void ExpList::SetPhys(int i, NekDouble val)
1591 {
1592  m_phys[i] = val;
1593 }
1594 /**
1595  * This function fills the array \f$\boldsymbol{u}_l\f$, the evaluation
1596  * of the expansion at the quadrature points (implemented as #m_phys),
1597  * with the values of the array \a inarray.
1598  *
1599  * @param inarray The array containing the values where
1600  * #m_phys should be filled with.
1601  */
1603 {
1604  ASSERTL0((int)inarray.size() == m_npoints,
1605  "Input array does not have correct number of elements.");
1606  Vmath::Vcopy(m_npoints, &inarray[0], 1, &m_phys[0], 1);
1607  m_physState = true;
1608 }
1610 {
1611  m_phys = inarray;
1612 }
1613 /**
1614  * @param physState \a true (=filled) or \a false (=not filled).
1615  */
1616 inline void ExpList::SetPhysState(const bool physState)
1617 {
1618  m_physState = physState;
1619 }
1620 /**
1621  * @return physState \a true (=filled) or \a false (=not filled).
1622  */
1623 inline bool ExpList::GetPhysState() const
1624 {
1625  return m_physState;
1626 }
1627 /**
1628  *
1629  */
1631  const Array<OneD, const NekDouble> &inarray,
1632  Array<OneD, NekDouble> &outarray)
1633 {
1634  v_IProductWRTBase(inarray, outarray);
1635 }
1636 /**
1637  *
1638  */
1640  Array<OneD, NekDouble> &outarray)
1641 {
1642  v_FwdTrans(inarray, outarray);
1643 }
1644 /**
1645  *
1646  */
1648  const Array<OneD, const NekDouble> &inarray,
1649  Array<OneD, NekDouble> &outarray)
1650 {
1651  v_FwdTransLocalElmt(inarray, outarray);
1652 }
1653 /**
1654  *
1655  */
1657  const Array<OneD, const NekDouble> &inarray,
1658  Array<OneD, NekDouble> &outarray)
1659 {
1660  v_FwdTransBndConstrained(inarray, outarray);
1661 }
1662 /**
1663  *
1664  */
1666 {
1667  v_SmoothField(field);
1668 }
1669 /**
1670  *
1671  */
1672 /**
1673  * Given the coefficients of an expansion, this function evaluates the
1674  * spectral/hp expansion \f$u^{\delta}(\boldsymbol{x})\f$ at the
1675  * quadrature points \f$\boldsymbol{x}_i\f$.
1676  */
1678  Array<OneD, NekDouble> &outarray)
1679 {
1680  v_BwdTrans(inarray, outarray);
1681 }
1682 /**
1683  *
1684  */
1686  const Array<OneD, const NekDouble> &inarray,
1687  Array<OneD, NekDouble> &outarray)
1688 {
1689  v_MultiplyByInvMassMatrix(inarray, outarray);
1690 }
1691 /**
1692  *
1693  */
1695  const Array<OneD, const NekDouble> &inarray,
1696  Array<OneD, NekDouble> &outarray, const StdRegions::ConstFactorMap &factors,
1697  const StdRegions::VarCoeffMap &varcoeff,
1698  const MultiRegions::VarFactorsMap &varfactors,
1699  const Array<OneD, const NekDouble> &dirForcing, const bool PhysSpaceForcing)
1700 {
1701  return v_HelmSolve(inarray, outarray, factors, varcoeff, varfactors,
1702  dirForcing, PhysSpaceForcing);
1703 }
1704 /**
1705  *
1706  */
1708  const Array<OneD, Array<OneD, NekDouble>> &velocity,
1709  const Array<OneD, const NekDouble> &inarray,
1710  Array<OneD, NekDouble> &outarray, const NekDouble lambda,
1711  const Array<OneD, const NekDouble> &dirForcing)
1712 {
1713  return v_LinearAdvectionDiffusionReactionSolve(velocity, inarray, outarray,
1714  lambda, dirForcing);
1715 }
1717  const Array<OneD, Array<OneD, NekDouble>> &velocity,
1718  const Array<OneD, const NekDouble> &inarray,
1719  Array<OneD, NekDouble> &outarray, const NekDouble lambda,
1720  const Array<OneD, const NekDouble> &dirForcing)
1721 {
1722  v_LinearAdvectionReactionSolve(velocity, inarray, outarray, lambda,
1723  dirForcing);
1724 }
1725 /**
1726  *
1727  */
1729  Array<OneD, NekDouble> &coord_1,
1730  Array<OneD, NekDouble> &coord_2)
1731 {
1732  v_GetCoords(coord_0, coord_1, coord_2);
1733 }
1734 
1735 inline void ExpList::GetCoords(const int eid, Array<OneD, NekDouble> &xc0,
1738 {
1739  v_GetCoords(eid, xc0, xc1, xc2);
1740 }
1741 
1742 /**
1743  *
1744  */
1746  const SpatialDomains::GeomMMF MMFdir,
1747  const Array<OneD, const NekDouble> &CircCentre,
1748  Array<OneD, Array<OneD, NekDouble>> &outarray)
1749 {
1750  v_GetMovingFrames(MMFdir, CircCentre, outarray);
1751 }
1752 /**
1753  *
1754  */
1756  Array<OneD, NekDouble> &out_d0,
1757  Array<OneD, NekDouble> &out_d1,
1758  Array<OneD, NekDouble> &out_d2)
1759 {
1760  v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
1761 }
1762 /**
1763  *
1764  */
1765 inline void ExpList::PhysDeriv(const int dir,
1766  const Array<OneD, const NekDouble> &inarray,
1767  Array<OneD, NekDouble> &out_d)
1768 {
1769  v_PhysDeriv(dir, inarray, out_d);
1770 }
1772  const Array<OneD, const NekDouble> &inarray,
1773  Array<OneD, NekDouble> &out_d)
1774 {
1775  v_PhysDeriv(edir, inarray, out_d);
1776 }
1777 /**
1778  *
1779  */
1781  const Array<OneD, const NekDouble> &direction,
1782  const Array<OneD, const NekDouble> &inarray,
1783  Array<OneD, NekDouble> &outarray)
1784 {
1785  v_PhysDirectionalDeriv(direction, inarray, outarray);
1786 }
1787 /**
1788  *
1789  */
1792 {
1793  v_CurlCurl(Vel, Q);
1794 }
1795 /**
1796  *
1797  */
1799  const int npts, const Array<OneD, const NekDouble> &inarray,
1800  Array<OneD, NekDouble> &outarray, bool Shuff, bool UnShuff)
1801 {
1802  v_HomogeneousFwdTrans(npts, inarray, outarray, Shuff, UnShuff);
1803 }
1804 /**
1805  *
1806  */
1808  const int npts, const Array<OneD, const NekDouble> &inarray,
1809  Array<OneD, NekDouble> &outarray, bool Shuff, bool UnShuff)
1810 {
1811  v_HomogeneousBwdTrans(npts, inarray, outarray, Shuff, UnShuff);
1812 }
1813 /**
1814  *
1815  */
1816 inline void ExpList::DealiasedProd(const int num_dofs,
1817  const Array<OneD, NekDouble> &inarray1,
1818  const Array<OneD, NekDouble> &inarray2,
1819  Array<OneD, NekDouble> &outarray)
1820 {
1821  v_DealiasedProd(num_dofs, inarray1, inarray2, outarray);
1822 }
1823 /**
1824  *
1825  */
1827  const int num_dofs, const Array<OneD, Array<OneD, NekDouble>> &inarray1,
1828  const Array<OneD, Array<OneD, NekDouble>> &inarray2,
1829  Array<OneD, Array<OneD, NekDouble>> &outarray)
1830 {
1831  v_DealiasedDotProd(num_dofs, inarray1, inarray2, outarray);
1832 }
1833 /**
1834  *
1835  */
1837  const Array<OneD, NekDouble> &TotField,
1838  int BndID)
1839 {
1840  v_GetBCValues(BndVals, TotField, BndID);
1841 }
1842 /**
1843  *
1844  */
1847  Array<OneD, NekDouble> &outarray,
1848  int BndID)
1849 {
1850  v_NormVectorIProductWRTBase(V1, V2, outarray, BndID);
1851 }
1854 {
1855  v_NormVectorIProductWRTBase(V, outarray);
1856 }
1857 /**
1858  * @param eid The index of the element to be checked.
1859  * @return The dimension of the coordinates of the specific element.
1860  */
1861 inline int ExpList::GetCoordim(int eid)
1862 {
1863  ASSERTL2(eid <= (*m_exp).size(), "eid is larger than number of elements");
1864  return (*m_exp)[eid]->GetCoordim();
1865 }
1866 /**
1867  * @param eid The index of the element to be checked.
1868  * @return The dimension of the shape of the specific element.
1869  */
1871 {
1872  return (*m_exp)[0]->GetShapeDimension();
1873 }
1874 /**
1875  * @param i The index of m_coeffs to be set
1876  * @param val The value which m_coeffs[i] is to be set to.
1877  */
1878 inline void ExpList::SetCoeff(int i, NekDouble val)
1879 {
1880  m_coeffs[i] = val;
1881 }
1882 /**
1883  * @param i The index of #m_coeffs to be set.
1884  * @param val The value which #m_coeffs[i] is to be set to.
1885  */
1886 inline void ExpList::SetCoeffs(int i, NekDouble val)
1887 {
1888  m_coeffs[i] = val;
1889 }
1891 {
1892  m_coeffs = inarray;
1893 }
1894 /**
1895  * As the function returns a constant reference to a
1896  * <em>const Array</em>, it is not possible to modify the
1897  * underlying data of the array #m_coeffs. In order to do
1898  * so, use the function #UpdateCoeffs instead.
1899  *
1900  * @return (A constant reference to) the array #m_coeffs.
1901  */
1903 {
1904  return m_coeffs;
1905 }
1907 {
1908  v_ImposeDirichletConditions(outarray);
1909 }
1911 {
1912  v_FillBndCondFromField(coeffs);
1913 }
1914 inline void ExpList::FillBndCondFromField(const int nreg,
1915  const Array<OneD, NekDouble> coeffs)
1916 {
1917  v_FillBndCondFromField(nreg, coeffs);
1918 }
1919 inline void ExpList::LocalToGlobal(bool useComm)
1920 {
1921  v_LocalToGlobal(useComm);
1922 }
1924  Array<OneD, NekDouble> &outarray,
1925  bool useComm)
1926 {
1927  v_LocalToGlobal(inarray, outarray, useComm);
1928 }
1929 inline void ExpList::GlobalToLocal(void)
1930 {
1931  v_GlobalToLocal();
1932 }
1933 /**
1934  * This operation is evaluated as:
1935  * \f{tabbing}
1936  * \hspace{1cm} \= Do \= $e=$ $1, N_{\mathrm{el}}$ \\
1937  * > > Do \= $i=$ $0,N_m^e-1$ \\
1938  * > > > $\boldsymbol{\hat{u}}^{e}[i] = \mbox{sign}[e][i] \cdot
1939  * \boldsymbol{\hat{u}}_g[\mbox{map}[e][i]]$ \\
1940  * > > continue \\
1941  * > continue
1942  * \f}
1943  * where \a map\f$[e][i]\f$ is the mapping array and \a
1944  * sign\f$[e][i]\f$ is an array of similar dimensions ensuring the
1945  * correct modal connectivity between the different elements (both
1946  * these arrays are contained in the data member #m_locToGloMap). This
1947  * operation is equivalent to the scatter operation
1948  * \f$\boldsymbol{\hat{u}}_l=\mathcal{A}\boldsymbol{\hat{u}}_g\f$, where
1949  * \f$\mathcal{A}\f$ is the
1950  * \f$N_{\mathrm{eof}}\times N_{\mathrm{dof}}\f$ permutation matrix.
1951  *
1952  * @param inarray An array of size \f$N_\mathrm{dof}\f$
1953  * containing the global degrees of freedom
1954  * \f$\boldsymbol{x}_g\f$.
1955  * @param outarray The resulting local degrees of freedom
1956  * \f$\boldsymbol{x}_l\f$ will be stored in this
1957  * array of size \f$N_\mathrm{eof}\f$.
1958  */
1960  Array<OneD, NekDouble> &outarray)
1961 {
1962  v_GlobalToLocal(inarray, outarray);
1963 }
1964 /**
1965  * @param i The index of #m_coeffs to be returned
1966  * @return The NekDouble held in #m_coeffs[i].
1967  */
1969 {
1970  return m_coeffs[i];
1971 }
1972 /**
1973  * @param i The index of #m_coeffs to be returned
1974  * @return The NekDouble held in #m_coeffs[i].
1975  */
1977 {
1978  return m_coeffs[i];
1979 }
1980 /**
1981  * As the function returns a constant reference to a
1982  * <em>const Array</em> it is not possible to modify the
1983  * underlying data of the array #m_phys. In order to do
1984  * so, use the function #UpdatePhys instead.
1985  *
1986  * @return (A constant reference to) the array #m_phys.
1987  */
1989 {
1990  return m_phys;
1991 }
1992 /**
1993  * @return \f$N_{\mathrm{el}}\f$, the number of elements in the
1994  * expansion.
1995  */
1996 inline int ExpList::GetExpSize(void)
1997 {
1998  return (*m_exp).size();
1999 }
2000 /**
2001  * @param n The index of the element concerned.
2002  *
2003  * @return (A shared pointer to) the local expansion of the
2004  * \f$n^{\mathrm{th}}\f$ element.
2005  */
2007 {
2008  return (*m_exp)[n];
2009 }
2010 /**
2011  * @param n The global id of the element concerned.
2012  *
2013  * @return (A shared pointer to) the local expansion of the
2014  * \f$n^{\mathrm{th}}\f$ element.
2015  */
2017 {
2018  auto it = m_elmtToExpId.find(n);
2019  ASSERTL0(it != m_elmtToExpId.end(), "Global geometry ID " +
2020  std::to_string(n) +
2021  " not found in element ID to "
2022  "expansion ID map.")
2023  return (*m_exp)[it->second];
2024 }
2025 
2026 /**
2027  * @return (A const shared pointer to) the local expansion vector #m_exp
2028  */
2029 inline const std::shared_ptr<LocalRegions::ExpansionVector> ExpList::GetExp(
2030  void) const
2031 {
2032  return m_exp;
2033 }
2034 /**
2035  *
2036  */
2037 inline int ExpList::GetCoeff_Offset(int n) const
2038 {
2039  return m_coeff_offset[n];
2040 }
2041 /**
2042  *
2043  */
2044 inline int ExpList::GetPhys_Offset(int n) const
2045 {
2046  return m_phys_offset[n];
2047 }
2048 /**
2049  * If one wants to get hold of the underlying data without modifying
2050  * them, rather use the function #GetCoeffs instead.
2051  *
2052  * @return (A reference to) the array #m_coeffs.
2053  */
2055 {
2056  return m_coeffs;
2057 }
2058 /**
2059  * If one wants to get hold of the underlying data without modifying
2060  * them, rather use the function #GetPhys instead.
2061  *
2062  * @return (A reference to) the array #m_phys.
2063  */
2065 {
2066  m_physState = true;
2067  return m_phys;
2068 }
2069 // functions associated with DisContField
2072 {
2073  return v_GetBndCondExpansions();
2074 }
2075 /// Get m_coeffs to elemental value map
2078 {
2079  return m_coeffsToElmt;
2080 }
2082  GetLocTraceToTraceMap() const
2083 {
2084  return v_GetLocTraceToTraceMap();
2085 }
2087 {
2088  return v_GetBndCondBwdWeight();
2089 }
2090 inline void ExpList::SetBndCondBwdWeight(const int index, const NekDouble value)
2091 {
2092  v_SetBndCondBwdWeight(index, value);
2093 }
2094 inline std::shared_ptr<ExpList> &ExpList::UpdateBndCondExpansion(int i)
2095 {
2096  return v_UpdateBndCondExpansion(i);
2097 }
2098 inline void ExpList::Upwind(
2099  const Array<OneD, const Array<OneD, NekDouble>> &Vec,
2100  const Array<OneD, const NekDouble> &Fwd,
2102 {
2103  v_Upwind(Vec, Fwd, Bwd, Upwind);
2104 }
2106  const Array<OneD, const NekDouble> &Fwd,
2107  const Array<OneD, const NekDouble> &Bwd,
2108  Array<OneD, NekDouble> &Upwind)
2109 {
2110  v_Upwind(Vn, Fwd, Bwd, Upwind);
2111 }
2112 inline std::shared_ptr<ExpList> &ExpList::GetTrace()
2113 {
2114  return v_GetTrace();
2115 }
2116 inline std::shared_ptr<AssemblyMapDG> &ExpList::GetTraceMap()
2117 {
2118  return v_GetTraceMap();
2119 }
2121 {
2122  return v_GetTraceBndMap();
2123 }
2125 {
2126  v_GetNormals(normals);
2127 }
2129  const Array<OneD, const NekDouble> &Fy,
2130  Array<OneD, NekDouble> &outarray)
2131 {
2132  v_AddTraceIntegral(Fx, Fy, outarray);
2133 }
2135  Array<OneD, NekDouble> &outarray)
2136 {
2137  v_AddTraceIntegral(Fn, outarray);
2138 }
2140  const Array<OneD, const NekDouble> &Fwd,
2142 {
2143  v_AddFwdBwdTraceIntegral(Fwd, Bwd, outarray);
2144 }
2147 {
2148  v_GetFwdBwdTracePhys(Fwd, Bwd);
2149 }
2152  Array<OneD, NekDouble> &Bwd, bool FillBnd, bool PutFwdInBwdOnBCs,
2153  bool DoExchange)
2154 {
2155  v_GetFwdBwdTracePhys(field, Fwd, Bwd, FillBnd, PutFwdInBwdOnBCs,
2156  DoExchange);
2157 }
2160  bool PutFwdInBwdOnBCs)
2161 {
2162  v_FillBwdWithBoundCond(Fwd, Bwd, PutFwdInBwdOnBCs);
2163 }
2165  const Array<OneD, const NekDouble> &Fwd,
2167 {
2168  v_AddTraceQuadPhysToField(Fwd, Bwd, field);
2169 }
2171  const Array<OneD, const NekDouble> &Fwd,
2172  const Array<OneD, const NekDouble> &Bwd,
2173  Array<OneD, NekDouble> &locTraceFwd, Array<OneD, NekDouble> &locTraceBwd)
2174 {
2175  v_GetLocTraceFromTracePts(Fwd, Bwd, locTraceFwd, locTraceBwd);
2176 }
2178  Array<OneD, NekDouble> &weightjmp)
2179 {
2180  v_FillBwdWithBwdWeight(weightave, weightjmp);
2181 }
2184 {
2185  v_PeriodicBwdCopy(Fwd, Bwd);
2186 }
2187 inline const std::vector<bool> &ExpList::GetLeftAdjacentFaces(void) const
2188 {
2189  return v_GetLeftAdjacentFaces();
2190 }
2192 {
2193  v_ExtractTracePhys(outarray);
2194 }
2196  const Array<OneD, const NekDouble> &inarray,
2197  Array<OneD, NekDouble> &outarray)
2198 {
2199  v_ExtractTracePhys(inarray, outarray);
2200 }
2203 {
2204  return v_GetBndConditions();
2205 }
2208 {
2209  return v_UpdateBndConditions();
2210 }
2212  const std::string varName,
2213  const NekDouble x2_in,
2214  const NekDouble x3_in)
2215 {
2216  v_EvaluateBoundaryConditions(time, varName, x2_in, x3_in);
2217 }
2219 {
2221 }
2223  Array<OneD, int> &EdgeID)
2224 {
2225  v_GetBoundaryToElmtMap(ElmtID, EdgeID);
2226 }
2228  std::shared_ptr<ExpList> &result,
2229  const bool DeclareCoeffPhysArrays)
2230 {
2231  v_GetBndElmtExpansion(i, result, DeclareCoeffPhysArrays);
2232 }
2233 
2235  const Array<OneD, NekDouble> &elmt,
2236  Array<OneD, NekDouble> &boundary)
2237 {
2238  v_ExtractElmtToBndPhys(i, elmt, boundary);
2239 }
2240 
2242  int i, const Array<OneD, const NekDouble> &phys,
2243  Array<OneD, NekDouble> &bndElmt)
2244 {
2245  v_ExtractPhysToBndElmt(i, phys, bndElmt);
2246 }
2247 
2248 inline void ExpList::ExtractPhysToBnd(int i,
2249  const Array<OneD, const NekDouble> &phys,
2251 {
2252  v_ExtractPhysToBnd(i, phys, bnd);
2253 }
2254 
2256  int i, Array<OneD, Array<OneD, NekDouble>> &normals)
2257 {
2258  v_GetBoundaryNormals(i, normals);
2259 }
2260 
2261 inline std::vector<bool> &ExpList::GetLeftAdjacentTraces(void)
2262 {
2263  return v_GetLeftAdjacentTraces();
2264 }
2265 
2267 
2268 } // namespace MultiRegions
2269 } // namespace Nektar
2270 
2271 #endif // EXPLIST_H
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215
#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 MULTI_REGIONS_EXPORT
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:103
virtual void v_Reset()
Reset geometry information, metrics, matrix managers and geometry information.
Definition: ExpList.cpp:2673
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:1076
Array< OneD, NekDouble > & UpdateCoeffs()
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
Definition: ExpList.h:2054
void AddTraceJacToElmtJac(const Array< OneD, const DNekMatSharedPtr > &FwdMat, const Array< OneD, const DNekMatSharedPtr > &BwdMat, Array< OneD, DNekMatSharedPtr > &fieldMat)
inverse process of v_GetFwdBwdTracePhys. Given Trace integration of Fwd and Bwd Jacobian,...
Definition: ExpList.cpp:5620
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the inner product of a function with respect to all local expansion modes .
Definition: ExpList.h:1630
const Array< OneD, const std::shared_ptr< ExpList > > & GetBndCondExpansions()
Definition: ExpList.h:2071
std::shared_ptr< ExpList > & GetTrace()
Definition: ExpList.h:2112
void WriteTecplotConnectivity(std::ostream &outfile, int expansion=-1)
Definition: ExpList.h:400
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
Definition: ExpList.h:1492
virtual void v_ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Definition: ExpList.cpp:3675
virtual void v_Upwind(const Array< OneD, const Array< OneD, NekDouble >> &Vec, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
Definition: ExpList.cpp:3818
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
Definition: ExpList.cpp:2016
virtual void v_AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4397
LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & GetGlobalLinSysManager(void)
Definition: ExpList.cpp:5316
ExpList(const ExpansionType Type=eNoType)
The default constructor using a type.
Definition: ExpList.cpp:102
void SetCoeffs(int i, NekDouble val)
Set the i th coefficiient in m_coeffs to value val.
Definition: ExpList.h:1886
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
Construct collections of elements containing a single element type and polynomial order from the list...
Definition: ExpList.cpp:5103
void CurlCurl(Array< OneD, Array< OneD, NekDouble >> &Vel, Array< OneD, Array< OneD, NekDouble >> &Q)
Definition: ExpList.h:1790
virtual void v_GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition: ExpList.cpp:4993
void ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
Definition: ExpList.cpp:1750
std::shared_ptr< GlobalMatrix > GenGlobalMatrix(const GlobalMatrixKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
Generates a global matrix from the given key and map.
Definition: ExpList.cpp:2131
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4718
std::shared_ptr< LibUtilities::Comm > GetComm() const
Returns the comm object.
Definition: ExpList.h:960
void DealiasedDotProd(const int num_dofs, const Array< OneD, Array< OneD, NekDouble >> &inarray1, const Array< OneD, Array< OneD, NekDouble >> &inarray2, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: ExpList.h:1826
void MultiplyByMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:301
void GlobalEigenSystem(const std::shared_ptr< DNekMat > &Gmat, Array< OneD, NekDouble > &EigValsReal, Array< OneD, NekDouble > &EigValsImag, Array< OneD, NekDouble > &EigVecs=NullNekDouble1DArray)
void FillBwdWithBoundCond(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs=false)
Definition: ExpList.h:2158
void AddRightIPTPhysDerivBase(const int dir, const Array< OneD, const DNekMatSharedPtr > ElmtJacQuad, Array< OneD, DNekMatSharedPtr > ElmtJacCoef)
Definition: ExpList.cpp:5856
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4485
void ExtractPhysToBndElmt(int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
Definition: ExpList.h:2241
void Reset()
Reset geometry information and reset matrices.
Definition: ExpList.h:383
int GetExpIndex(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0, bool returnNearestElmt=false, int cachedId=-1, NekDouble maxDistance=1e6)
This function returns the index of the local elemental expansion containing the arbitrary point given...
Definition: ExpList.cpp:2521
virtual GlobalLinSysKey v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
Definition: ExpList.cpp:4509
void GetFieldDefinitions(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef)
Definition: ExpList.h:896
virtual void v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:2831
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1125
virtual Array< OneD, const unsigned int > v_GetYIDs(void)
Definition: ExpList.cpp:3295
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
multiply the metric jacobi and quadrature weights
Definition: ExpList.cpp:1347
void SetPhys(int i, NekDouble val)
Set the i th value of m_phys to value val.
Definition: ExpList.h:1590
void ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:2191
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition: ExpList.h:2222
void PeriodicBwdCopy(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Copy and fill the Periodic boundaries.
Definition: ExpList.h:2182
void WriteVtkPieceFooter(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:3092
virtual void v_ExtractPhysToBnd(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
Definition: ExpList.cpp:4912
void GetBwdWeight(Array< OneD, NekDouble > &weightAver, Array< OneD, NekDouble > &weightJump)
Get the weight value for boundary conditions for boundary average and jump calculations.
Definition: ExpList.cpp:3704
virtual void v_AddTraceIntegralToOffDiag(const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5397
virtual std::vector< bool > & v_GetLeftAdjacentTraces(void)
Definition: ExpList.cpp:3937
void InitialiseExpVector(const SpatialDomains::ExpansionInfoMap &expmap)
Define a list of elements using the geometry and basis key information in expmap;.
Definition: ExpList.cpp:1142
void SetupCoeffPhys(bool DeclareCoeffPhysArrays=true, bool SetupOffsets=true)
Definition of the total number of degrees of freedom and quadrature points and offsets to access data...
Definition: ExpList.cpp:1099
std::shared_ptr< ExpList > & GetPlane(int n)
Definition: ExpList.h:973
virtual LibUtilities::BasisSharedPtr v_GetHomogeneousBasis(void)
Definition: ExpList.h:1444
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
Definition: ExpList.cpp:5070
const Array< OneD, const NekDouble > & GetCoeffs() const
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
Definition: ExpList.h:1902
virtual void GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays=true)
Definition: ExpList.h:2227
virtual void v_CurlCurl(Array< OneD, Array< OneD, NekDouble >> &Vel, Array< OneD, Array< OneD, NekDouble >> &Q)
Definition: ExpList.cpp:1652
void SetPhysArray(Array< OneD, NekDouble > &inarray)
Sets the array m_phys.
Definition: ExpList.h:1609
virtual void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1720
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
Definition: ExpList.cpp:4585
void FillBndCondFromField(const Array< OneD, NekDouble > coeffs)
Fill Bnd Condition expansion from the values stored in expansion.
Definition: ExpList.h:1910
const Array< OneD, const std::pair< int, int > > & GetCoeffsToElmt() const
Get m_coeffs to elemental value map.
Definition: ExpList.h:2077
virtual void v_GetLocTraceFromTracePts(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
Definition: ExpList.cpp:4452
const Array< OneD, const NekDouble > & GetPhys() const
This function returns (a reference to) the array (implemented as m_phys) containing the function ev...
Definition: ExpList.h:1988
std::shared_ptr< ExpList > & UpdateBndCondExpansion(int i)
Definition: ExpList.h:2094
virtual void v_WriteTecplotHeader(std::ostream &outfile, std::string var="")
Definition: ExpList.cpp:2700
virtual std::shared_ptr< ExpList > & v_GetPlane(int n)
Definition: ExpList.cpp:5091
void NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
Definition: ExpList.h:1845
int GetCoeff_Offset(int n) const
Get the start offset position for a local contiguous list of coeffs correspoinding to element n.
Definition: ExpList.h:2037
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1996
virtual void v_AddTraceQuadPhysToOffDiag(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:4443
virtual void v_ClearGlobalLinSysManager(void)
Definition: ExpList.cpp:3303
virtual void v_UnsetGlobalLinSys(GlobalLinSysKey, bool)
Definition: ExpList.cpp:3316
void GeneralGetFieldDefinitions(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef, int NumHomoDir=0, Array< OneD, LibUtilities::BasisSharedPtr > &HomoBasis=LibUtilities::NullBasisSharedPtr1DArray, std::vector< NekDouble > &HomoLen=LibUtilities::NullNekDoubleVector, bool homoStrips=false, std::vector< unsigned int > &HomoSIDs=LibUtilities::NullUnsignedIntVector, std::vector< unsigned int > &HomoZIDs=LibUtilities::NullUnsignedIntVector, std::vector< unsigned int > &HomoYIDs=LibUtilities::NullUnsignedIntVector)
Definition: ExpList.cpp:3404
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
Definition: ExpList.cpp:5061
void IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the inner product of a function with respect to the derivative (in directio...
Definition: ExpList.cpp:1391
void SetCoeffsArray(Array< OneD, NekDouble > &inarray)
Set the m_coeffs array to inarray.
Definition: ExpList.h:1890
LibUtilities::TranspositionSharedPtr GetTransposition(void)
This function returns the transposition class associated with the homogeneous expansion.
Definition: ExpList.h:589
virtual void v_LocalToGlobal(bool UseComm)
Definition: ExpList.cpp:4672
void SetBndCondBwdWeight(const int index, const NekDouble value)
Set the weight value for boundary conditions.
Definition: ExpList.h:2090
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
Definition: ExpList.cpp:5018
virtual LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & v_GetGlobalLinSysManager(void)
Definition: ExpList.cpp:3324
void SetHomoLen(const NekDouble lhom)
This function sets the Width of homogeneous direction associated with the homogeneous expansion.
Definition: ExpList.h:603
int GetNpoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1568
SpatialDomains::MeshGraphSharedPtr GetGraph()
Definition: ExpList.h:964
const std::unordered_map< int, int > & GetElmtToExpId(void)
This function returns the map of index inside m_exp to geom id.
Definition: ExpList.h:1026
virtual ~ExpList()
The default destructor.
Definition: ExpList.cpp:1315
void GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.h:2145
int GetElmtToExpId(int elmtId)
This function returns the index inside m_exp for a given geom id.
Definition: ExpList.h:1032
const Array< OneD, const int > & GetTraceBndMap(void)
Definition: ExpList.h:2120
virtual void v_FwdTransLocalElmt(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1809
int GetPoolCount(std::string)
Definition: ExpList.cpp:5305
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4646
void FwdTransLocalElmt(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function elementally evaluates the forward transformation of a function onto the global spectra...
Definition: ExpList.h:1647
virtual void v_EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="", const NekDouble x2_in=NekConstants::kNekUnsetDouble, const NekDouble x3_in=NekConstants::kNekUnsetDouble)
Definition: ExpList.cpp:5039
void FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:1656
virtual size_t v_GetNumElmts(void)
Definition: ExpList.h:1159
virtual const std::vector< bool > & v_GetLeftAdjacentFaces(void) const
Definition: ExpList.cpp:4477
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble >> &normals)
Populate normals with the normals of all expansions.
Definition: ExpList.cpp:4015
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:1120
int EvalBasisNumModesMax(void) const
Evaulates the maximum number of modes in the elemental basis order over all elements.
Definition: ExpList.h:1506
void AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:2139
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble >> &inarray)
Definition: ExpList.cpp:3236
std::shared_ptr< AssemblyMapDG > & GetTraceMap(void)
Definition: ExpList.h:2116
void WriteTecplotField(std::ostream &outfile, int expansion=-1)
Definition: ExpList.h:396
size_t GetNumElmts(void)
This function returns the number of elements in the expansion which may be different for a homogeoeno...
Definition: ExpList.h:645
virtual std::shared_ptr< AssemblyMapDG > & v_GetTraceMap()
Definition: ExpList.cpp:3924
Array< OneD, std::pair< int, int > > m_coeffsToElmt
m_coeffs to elemental value map
Definition: ExpList.h:1124
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:4406
NekDouble PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &phys)
Definition: ExpList.cpp:2638
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Definition: ExpList.cpp:3222
virtual void v_ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs, std::unordered_map< int, int > zIdToPlane)
Extract data from raw field data into expansion list.
Definition: ExpList.cpp:3587
void PhysDirectionalDeriv(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:1780
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo(void)
Definition: ExpList.cpp:5051
virtual const Array< OneD, const int > & v_GetTraceBndMap()
Definition: ExpList.cpp:3932
virtual GlobalLinSysKey v_LinearAdvectionDiffusionReactionSolve(const Array< OneD, Array< OneD, NekDouble >> &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Definition: ExpList.cpp:4522
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
Definition: ExpList.cpp:3256
virtual NekDouble v_GetHomoLen(void)
Definition: ExpList.cpp:3272
void ExtractFileBCs(const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, const std::shared_ptr< ExpList > locExpList)
void GetNormals(Array< OneD, Array< OneD, NekDouble >> &normals)
Definition: ExpList.h:2124
const LocTraceToTraceMapSharedPtr & GetLocTraceToTraceMap() const
Definition: ExpList.h:2082
virtual void v_LinearAdvectionReactionSolve(const Array< OneD, Array< OneD, NekDouble >> &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Definition: ExpList.cpp:4534
virtual Array< OneD, const unsigned int > v_GetZIDs(void)
Definition: ExpList.cpp:3287
void SetHomo1DSpecVanVisc(Array< OneD, NekDouble > visc)
This function sets the Spectral Vanishing Viscosity in homogeneous1D expansion.
Definition: ExpList.h:573
void ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Extract the data from fromField using fromExpList the coeffs using the basic ExpList Elemental expans...
Definition: ExpList.cpp:3571
void GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
This function calculates the coordinates of all the elemental quadrature points .
Definition: ExpList.h:1728
const Array< OneD, int > EvalBasisNumModesMaxPerExp(void) const
Returns the vector of the number of modes in the elemental basis order over all elements.
Definition: ExpList.h:1521
std::shared_ptr< GlobalLinSys > GenGlobalBndLinSys(const GlobalLinSysKey &mkey, const AssemblyMapSharedPtr &locToGloMap)
Generate a GlobalLinSys from information provided by the key "mkey" and the mapping provided in LocTo...
Definition: ExpList.cpp:2434
void GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble >> &normals)
Definition: ExpList.h:2255
virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value)
Definition: ExpList.cpp:4470
void GetMatIpwrtDeriveBase(const Array< OneD, const Array< OneD, NekDouble >> &inarray, const int nDirctn, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
Definition: ExpList.cpp:5406
void UnsetGlobalLinSys(GlobalLinSysKey, bool)
Definition: ExpList.cpp:5310
void DealiasedProd(const int num_dofs, const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:1816
void ExtractPhysToBnd(int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
Definition: ExpList.h:2248
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:1841
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
Definition: ExpList.cpp:3531
std::vector< bool > m_collectionsDoInit
Vector of bools to act as an initialise on first call flag.
Definition: ExpList.h:1114
NekDouble GetCoeff(int i)
Get the i th value (coefficient) of m_coeffs.
Definition: ExpList.h:1968
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:1100
virtual void v_HomogeneousFwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.cpp:4545
virtual void v_DealiasedDotProd(const int num_dofs, const Array< OneD, Array< OneD, NekDouble >> &inarray1, const Array< OneD, Array< OneD, NekDouble >> &inarray2, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: ExpList.cpp:4575
void ExtractCoeffsFromFile(const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, Array< OneD, NekDouble > &coeffs)
Definition: ExpList.cpp:3331
NekDouble Integral()
Calculates the error of the global spectral/hp element approximation.
Definition: ExpList.h:535
virtual void v_DealiasedProd(const int num_dofs, const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4565
void AddRightIPTBaseMatrix(const Array< OneD, const DNekMatSharedPtr > ElmtJacQuad, Array< OneD, DNekMatSharedPtr > ElmtJacCoef)
Definition: ExpList.cpp:5913
void GetLocTraceFromTracePts(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
Definition: ExpList.h:2170
virtual void v_WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var)
Definition: ExpList.cpp:3099
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
Definition: ExpList.cpp:2958
int GetShapeDimension()
This function returns the dimension of the shape of the element eid.
Definition: ExpList.h:1870
void ExtractElmtDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs)
Extract the data in fielddata into the coeffs using the basic ExpList Elemental expansions rather tha...
Array< OneD, const unsigned int > GetYIDs(void)
This function returns a vector containing the wave numbers in y-direction associated with the 3D homo...
Definition: ExpList.h:612
NekDouble H1(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
Calculates the error of the global spectral/hp element approximation.
Definition: ExpList.cpp:3386
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:1118
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:1049
std::shared_ptr< GlobalLinSys > GenGlobalLinSys(const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
This operation constructs the global linear system of type mkey.
Definition: ExpList.cpp:2416
void WriteVtkHeader(std::ostream &outfile)
Definition: ExpList.cpp:2944
bool GetPhysState(void) const
This function indicates whether the array of physical values (implemented as m_phys) is filled or no...
Definition: ExpList.h:1623
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:1111
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:1056
void GenerateElementVector(const int ElementID, const NekDouble scalar1, const NekDouble scalar2, Array< OneD, NekDouble > &outarray)
Generate vector v such that v[i] = scalar1 if i is in the element < ElementID. Otherwise,...
Definition: ExpList.cpp:3761
void AddTraceIntegralToOffDiag(const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:1004
std::shared_ptr< DNekMat > GenGlobalMatrixFull(const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
Definition: ExpList.cpp:2264
const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & GetBndConditions()
Definition: ExpList.h:2202
LocalRegions::ExpansionSharedPtr & GetExpFromGeomId(int n)
This function returns (a shared pointer to) the local elemental expansion of the element given a glo...
Definition: ExpList.h:2016
void SetPhysState(const bool physState)
This function manually sets whether the array of physical values (implemented as m_phys) is filled o...
Definition: ExpList.h:1616
void PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function Galerkin projects the physical space points in inarray to outarray where inarray is ass...
Definition: ExpList.h:632
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
Definition: ExpList.cpp:4593
virtual void v_ExtractElmtToBndPhys(const int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
Definition: ExpList.cpp:4835
virtual void v_ExtractPhysToBndElmt(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
Definition: ExpList.cpp:4873
std::vector< LibUtilities::FieldDefinitionsSharedPtr > GetFieldDefinitions()
Definition: ExpList.h:891
GlobalLinSysKey HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff=StdRegions::NullVarCoeffMap, const MultiRegions::VarFactorsMap &varfactors=MultiRegions::NullVarFactorsMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray, const bool PhysSpaceForcing=true)
Solve helmholtz problem.
Definition: ExpList.h:1694
void EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="", const NekDouble=NekConstants::kNekUnsetDouble, const NekDouble=NekConstants::kNekUnsetDouble)
Definition: ExpList.h:2211
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4380
virtual void v_FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Definition: ExpList.cpp:5001
Array< OneD, NekDouble > & UpdatePhys()
This function returns (a reference to) the array (implemented as m_phys) containing the function ev...
Definition: ExpList.h:2064
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5970
void GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the result of the multiplication of a matrix of type specified by mkey with ...
Definition: ExpList.cpp:2060
virtual void v_SetUpPhysNormals()
: Set up a normal along the trace elements between two elements at elemental level
Definition: ExpList.cpp:4812
virtual void v_GlobalToLocal(void)
Definition: ExpList.cpp:4687
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition(void)
Definition: ExpList.cpp:3264
void ExtractElmtToBndPhys(int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
Definition: ExpList.h:2234
void HomogeneousBwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.h:1807
void SetWaveSpace(const bool wavespace)
Sets the wave space to the one of the possible configuration true or false.
Definition: ExpList.h:1576
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition: ExpList.h:2029
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:1053
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4500
virtual void v_AddTraceQuadPhysToField(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:4434
virtual const Array< OneD, const NekDouble > & v_GetBndCondBwdWeight()
Definition: ExpList.cpp:4462
virtual void v_GetMovingFrames(const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: ExpList.cpp:3717
std::shared_ptr< LibUtilities::SessionReader > GetSession() const
Returns the session object.
Definition: ExpList.h:955
void GlobalToLocal(void)
Scatters from the global coefficients to the local coefficients .
Definition: ExpList.h:1929
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
Definition: ExpList.cpp:3177
const Array< OneD, const NekDouble > & GetBndCondBwdWeight()
Get the weight value for boundary conditions.
Definition: ExpList.h:2086
void WriteVtkFooter(std::ostream &outfile)
Definition: ExpList.cpp:2952
void MultiplyByBlockMatrix(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1327
virtual std::shared_ptr< ExpList > & v_GetTrace()
Definition: ExpList.cpp:3916
void GetElmtNormalLength(Array< OneD, NekDouble > &lengthsFwd, Array< OneD, NekDouble > &lengthsBwd)
Get the length of elements in boundary normal direction.
Definition: ExpList.cpp:4232
void LinearAdvectionReactionSolve(const Array< OneD, Array< OneD, NekDouble >> &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Solve Advection Diffusion Reaction.
Definition: ExpList.h:1716
int Get1DScaledTotPoints(const NekDouble scale) const
Returns the total number of qudature points scaled by the factor scale on each 1D direction.
Definition: ExpList.h:1547
void PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function interpolates the physical space points in inarray to outarray using the same points def...
Definition: ExpList.h:621
NekDouble L2(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
This function calculates the error of the global This function calculates the error with respect to...
Definition: ExpList.h:506
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void)
Definition: ExpList.cpp:3516
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:1116
void IProductWRTDirectionalDerivBase(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Directional derivative along a given direction.
Definition: ExpList.cpp:1411
void WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var="v")
Definition: ExpList.h:413
void FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Fill Bwd with boundary conditions.
Definition: ExpList.h:2177
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2470
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
Definition: ExpList.cpp:5029
void SetCoeff(int i, NekDouble val)
Set the i th coefficiient in m_coeffs to value val.
Definition: ExpList.h:1878
void LocalToGlobal(bool useComm=true)
Gathers the global coefficients from the local coefficients .
Definition: ExpList.h:1919
Array< OneD, const NekDouble > HomogeneousEnergy(void)
This function calculates the energy associated with each one of the modesof a 3D homogeneous nD expan...
Definition: ExpList.h:566
void GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces=NullPeriodicMap)
Definition: ExpList.h:884
NekDouble Integral(const Array< OneD, const NekDouble > &inarray)
Definition: ExpList.h:556
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
Definition: ExpList.cpp:4752
virtual void v_WriteTecplotField(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:2911
virtual void v_FillBndCondFromField(const Array< OneD, NekDouble > coeffs)
Definition: ExpList.cpp:4655
std::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
Definition: ExpList.h:950
Collections::CollectionVector m_collections
Definition: ExpList.h:1112
void AddTraceQuadPhysToField(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Add Fwd and Bwd value to field, a reverse procedure of GetFwdBwdTracePhys.
Definition: ExpList.h:2164
virtual int v_GetPoolCount(std::string)
Definition: ExpList.cpp:3309
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5321
virtual void v_HomogeneousBwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.cpp:4555
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble >> &normals)
Definition: ExpList.cpp:4949
void ApplyGeomInfo()
Apply geometry information to each expansion.
Definition: ExpList.cpp:2661
void GetMovingFrames(const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: ExpList.h:1745
Array< OneD, const unsigned int > GetZIDs(void)
This function returns a vector containing the wave numbers in z-direction associated with the 3D homo...
Definition: ExpList.h:582
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
Definition: ExpList.cpp:1555
virtual void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1818
std::unordered_map< int, int > m_elmtToExpId
Mapping from geometry ID of element to index inside m_exp.
Definition: ExpList.h:1132
void GetDiagMatIpwrtBase(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
Definition: ExpList.cpp:5549
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:1639
void SmoothField(Array< OneD, NekDouble > &field)
Smooth a field across elements.
Definition: ExpList.h:1665
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:2738
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:1051
virtual void v_PeriodicBwdCopy(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:5008
void MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:1685
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
Definition: ExpList.h:879
void AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, Array< OneD, NekDouble > &coeffs)
Append the data in coeffs listed in elements fielddef->m_ElementIDs onto fielddata.
Definition: ExpList.h:911
void AddTraceIntegral(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:2128
virtual void v_FillBwdWithBoundCond(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs)
Definition: ExpList.cpp:4425
void DivideByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Divided by the metric jacobi and quadrature weights.
Definition: ExpList.cpp:1364
virtual const Array< OneD, const std::shared_ptr< ExpList > > & v_GetBndCondExpansions(void)
Definition: ExpList.cpp:3791
void ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Impose Dirichlet Boundary Conditions onto Array.
Definition: ExpList.h:1906
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:1122
virtual void v_SetHomoLen(const NekDouble lhom)
Definition: ExpList.cpp:3280
void Upwind(const Array< OneD, const NekDouble > &Vn, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
Definition: ExpList.h:2105
Array< OneD, SpatialDomains::BoundaryConditionShPtr > & UpdateBndConditions()
Definition: ExpList.h:2207
const DNekScalBlkMatSharedPtr GenBlockMatrix(const GlobalMatrixKey &gkey)
This function assembles the block diagonal matrix of local matrices of the type mtype.
Definition: ExpList.cpp:1881
void PhysDeriv(Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
Definition: ExpList.h:1771
void MultiplyByElmtInvMass(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function elementally mulplies the coefficient space of Sin my the elemental inverse of the mass ...
Definition: ExpList.cpp:1771
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function elementally evaluates the backward transformation of the global spectral/hp element exp...
Definition: ExpList.h:1677
NekDouble GetHomoLen(void)
This function returns the Width of homogeneous direction associated with the homogeneous expansion.
Definition: ExpList.h:596
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
Definition: ExpList.cpp:4825
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4701
bool GetWaveSpace(void) const
This function returns the third direction expansion condition, which can be in wave space (coefficien...
Definition: ExpList.h:1584
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
Definition: ExpList.cpp:3799
int GetPhys_Offset(int n) const
Get the start offset position for a local contiguous list of quadrature points in a full array corres...
Definition: ExpList.h:2044
virtual const std::shared_ptr< LocTraceToTraceMap > & v_GetLocTraceToTraceMap(void) const
Definition: ExpList.cpp:6045
void ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs, std::unordered_map< int, int > zIdToPlane=std::unordered_map< int, int >())
Extract the data in fielddata into the coeffs.
Definition: ExpList.cpp:3563
void SetModifiedBasis(const bool modbasis)
Set Modified Basis for the stability analysis.
ExpansionType m_expType
Exapnsion type.
Definition: ExpList.h:1044
void WriteTecplotHeader(std::ostream &outfile, std::string var="")
Definition: ExpList.h:388
NekDouble VectorFlux(const Array< OneD, Array< OneD, NekDouble >> &inarray)
Definition: ExpList.h:560
const std::vector< bool > & GetLeftAdjacentFaces(void) const
Definition: ExpList.h:2187
void AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
Append the element data listed in elements fielddef->m_ElementIDs onto fielddata.
Definition: ExpList.h:904
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:1092
std::vector< bool > & GetLeftAdjacentTraces(void)
Definition: ExpList.h:2261
ExpansionType GetExpType(void)
Returns the type of the expansion.
Definition: ExpList.cpp:1310
void AddTraceQuadPhysToOffDiag(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition: ExpList.h:809
NekDouble Linf(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
This function calculates the error of the global spectral/hp element approximation.
Definition: ExpList.cpp:3139
void HomogeneousFwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.h:1798
void WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip=0)
Definition: ExpList.h:406
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1537
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
GlobalLinSysKey LinearAdvectionDiffusionReactionSolve(const Array< OneD, Array< OneD, NekDouble >> &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Solve Advection Diffusion Reaction.
Definition: ExpList.h:1707
LibUtilities::BasisSharedPtr GetHomogeneousBasis(void)
Definition: ExpList.h:969
void WriteTecplotZone(std::ostream &outfile, int expansion=-1)
Definition: ExpList.h:392
ExpList(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, const ExpListSharedPtr > &bndConstraint, const Array< OneD, const SpatialDomains ::BoundaryConditionShPtr > &bndCond, const LocalRegions::ExpansionVector &locexp, const SpatialDomains::MeshGraphSharedPtr &graph, const LibUtilities::CommSharedPtr &comm, const bool DeclareCoeffPhysArrays=true, const std::string variable="DefaultVar", const Collections::ImplementationType ImpType=Collections::eNoImpType)
Generate expansions for the trace space expansions used in DisContField.
virtual void v_SetHomo1DSpecVanVisc(Array< OneD, NekDouble > visc)
Definition: ExpList.h:1452
void GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
Definition: ExpList.h:1836
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:1861
Describes a matrix with ordering defined by a local to global map.
std::vector< Collection > CollectionVector
Definition: Collection.h:110
static BasisSharedPtr NullBasisSharedPtr
Definition: Basis.h:369
static std::vector< unsigned int > NullUnsignedIntVector
std::shared_ptr< Basis > BasisSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
Definition: FieldIO.h:186
static std::vector< NekDouble > NullNekDoubleVector
std::shared_ptr< Transposition > TranspositionSharedPtr
static Array< OneD, BasisSharedPtr > NullBasisSharedPtr1DArray
Definition: Basis.h:370
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:54
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
std::vector< ExpansionSharedPtr > ExpansionVector
Definition: Expansion.h:70
static ExpList NullExpList
An empty ExpList object.
Definition: ExpList.h:1478
static PeriodicMap NullPeriodicMap
MultiRegions::Direction const DirCartesianMap[]
Definition: ExpList.h:91
std::shared_ptr< BlockMatrixMap > BlockMatrixMapShPtr
A shared pointer to a BlockMatrixMap.
Definition: ExpList.h:97
static VarFactorsMap NullVarFactorsMap
static ExpListSharedPtr NullExpListSharedPtr
Definition: ExpList.h:1479
static LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > NullGlobalLinSysManager
Definition: ExpList.h:1483
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
static GlobalLinSysKey NullGlobalLinSysKey(StdRegions::eNoMatrixType)
std::shared_ptr< LocTraceToTraceMap > LocTraceToTraceMapSharedPtr
static const Array< OneD, ExpListSharedPtr > NullExpListSharedPtrArray
Definition: ExpList.h:2266
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Definition: AssemblyMap.h:51
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
std::map< GlobalMatrixKey, DNekScalBlkMatSharedPtr > BlockMatrixMap
A map between global matrix keys and their associated block matrices.
Definition: ExpList.h:95
static const NekDouble kNekUnsetDouble
GeomMMF
Principle direction for MMF.
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:212
std::map< int, BoundaryConditionMapShPtr > BoundaryConditionCollection
Definition: Conditions.h:219
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:172
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:59
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
Definition: MeshGraph.h:143
std::map< int, CompositeSharedPtr > CompositeMap
Definition: MeshGraph.h:138
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:399
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:344
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:343
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:79
static Array< OneD, NekDouble > NullNekDouble1DArray
double NekDouble
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1255