Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Expansion list top class definition
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_LIBS_MULTIREGIONS_EXPLIST_H
37 #define NEKTAR_LIBS_MULTIREGIONS_EXPLIST_H
38 
43 #include <LocalRegions/Expansion.h>
44 #include <Collections/Collection.h>
51 #include <boost/enable_shared_from_this.hpp>
52 #include <tinyxml.h>
53 
54 namespace Nektar
55 {
56  namespace MultiRegions
57  {
58  // Forward declarations
59  class GlobalLinSys;
60  class AssemblyMapDG;
61 
62  class AssemblyMapCG;
63  class GlobalLinSysKey;
64  class GlobalMatrix;
65 
66  enum Direction
67  {
68  eX,
69  eY,
70  eZ,
71  eS,
73  };
74 
76  {
77  e0D,
78  e1D,
79  e2D,
82  e3D,
84  };
85 
87  {
88  eX,
89  eY,
90  eZ
91  };
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 boost::shared_ptr<BlockMatrixMap> BlockMatrixMapShPtr;
98 
99 
100  /// Base class for all multi-elemental spectral/hp expansions.
101  class ExpList: public boost::enable_shared_from_this<ExpList>
102  {
103  public:
104  /// The default constructor.
106 
107  /// The default constructor.
109  const LibUtilities::SessionReaderSharedPtr &pSession);
110 
111  /// The default constructor.
113  const LibUtilities::SessionReaderSharedPtr &pSession,
114  const SpatialDomains::MeshGraphSharedPtr &pGraph);
115 
116  /// Constructor copying only elements defined in eIds.
118  const ExpList &in,
119  const std::vector<unsigned int> &eIDs,
120  const bool DeclareCoeffPhysArrays = true);
121 
122  /// The copy constructor.
124  const ExpList &in,
125  const bool DeclareCoeffPhysArrays = true);
126 
127  /// The default destructor.
128  MULTI_REGIONS_EXPORT virtual ~ExpList();
129 
130  /// Returns the total number of local degrees of freedom
131  /// \f$N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_m\f$.
132  inline int GetNcoeffs(void) const;
133 
134  /// Returns the total number of local degrees of freedom
135  /// for element eid
136  MULTI_REGIONS_EXPORT int GetNcoeffs(const int eid) const;
137 
138  /// Returns the type of the expansion
140 
141  /// Returns the type of the expansion
143 
144  /// Evaulates the maximum number of modes in the elemental basis
145  /// order over all elements
146  inline int EvalBasisNumModesMax(void) const;
147 
148  /// Returns the vector of the number of modes in the elemental
149  /// basis order over all elements.
151  EvalBasisNumModesMaxPerExp(void) const;
152 
153  /// Returns the total number of quadrature points #m_npoints
154  /// \f$=Q_{\mathrm{tot}}\f$.
155  inline int GetTotPoints(void) const;
156 
157  /// Returns the total number of quadrature points for eid's element
158  /// \f$=Q_{\mathrm{tot}}\f$.
159  inline int GetTotPoints(const int eid) const;
160 
161  /// Returns the total number of quadrature points #m_npoints
162  /// \f$=Q_{\mathrm{tot}}\f$.
163  inline int GetNpoints(void) const;
164 
165 
166  /// Returns the total number of qudature points scaled by
167  /// the factor scale on each 1D direction
168  inline int Get1DScaledTotPoints(const NekDouble scale) const;
169 
170  /// Sets the wave space to the one of the possible configuration
171  /// true or false
172  inline void SetWaveSpace(const bool wavespace);
173 
174 
175  ///Set Modified Basis for the stability analysis
176  inline void SetModifiedBasis(const bool modbasis);
177 
178  /// Set the \a i th value of \a m_phys to value \a val
179  inline void SetPhys(int i, NekDouble val);
180 
181  /// This function returns the third direction expansion condition,
182  /// which can be in wave space (coefficient) or not
183  /// It is stored in the variable m_WaveSpace.
184  inline bool GetWaveSpace(void) const;
185 
186  /// Fills the array #m_phys
187  inline void SetPhys(const Array<OneD, const NekDouble> &inarray);
188 
189  /// Sets the array #m_phys
190  inline void SetPhysArray(Array<OneD, NekDouble> &inarray);
191 
192  /// This function manually sets whether the array of physical
193  /// values \f$\boldsymbol{u}_l\f$ (implemented as #m_phys) is
194  /// filled or not.
195  inline void SetPhysState(const bool physState);
196 
197  /// This function indicates whether the array of physical values
198  /// \f$\boldsymbol{u}_l\f$ (implemented as #m_phys) is filled or
199  /// not.
200  inline bool GetPhysState(void) const;
201 
202  /// This function integrates a function \f$f(\boldsymbol{x})\f$
203  /// over the domain consisting of all the elements of the expansion.
205 
206  /// This function integrates a function \f$f(\boldsymbol{x})\f$
207  /// over the domain consisting of all the elements of the expansion.
209  const Array<OneD,
210  const NekDouble> &inarray);
211 
212  /// This function calculates the inner product of a function
213  /// \f$f(\boldsymbol{x})\f$ with respect to all \emph{local}
214  /// expansion modes \f$\phi_n^e(\boldsymbol{x})\f$.
215  inline void IProductWRTBase_IterPerExp(
216  const Array<OneD, const NekDouble> &inarray,
217  Array<OneD, NekDouble> &outarray);
218 
219  ///
220  inline void IProductWRTBase(
221  const Array<OneD, const NekDouble> &inarray,
222  Array<OneD, NekDouble> &outarray,
223  CoeffState coeffstate = eLocal);
224 
225  /// This function calculates the inner product of a function
226  /// \f$f(\boldsymbol{x})\f$ with respect to the derivative (in
227  /// direction \param dir) of all \emph{local} expansion modes
228  /// \f$\phi_n^e(\boldsymbol{x})\f$.
230  (const int dir,
231  const Array<OneD, const NekDouble> &inarray,
232  Array<OneD, NekDouble> &outarray);
233 
234  /// This function calculates the inner product of a function
235  /// \f$f(\boldsymbol{x})\f$ with respect to the derivative (in
236  /// direction \param dir) of all \emph{local} expansion modes
237  /// \f$\phi_n^e(\boldsymbol{x})\f$.
239  (const Array<OneD, const Array<OneD, NekDouble> > &inarray,
240  Array<OneD, NekDouble> &outarray);
241 
242  /// This function elementally evaluates the forward transformation
243  /// of a function \f$u(\boldsymbol{x})\f$ onto the global
244  /// spectral/hp expansion.
245  inline void FwdTrans_IterPerExp (
246  const Array<OneD,
247  const NekDouble> &inarray,
248  Array<OneD,NekDouble> &outarray);
249 
250  ///
251  inline void FwdTrans(
252  const Array<OneD,
253  const NekDouble> &inarray,
254  Array<OneD, NekDouble> &outarray,
255  CoeffState coeffstate = eLocal);
256 
257  /// This function elementally mulplies the coefficient space of
258  /// Sin my the elemental inverse of the mass matrix.
260  const Array<OneD,
261  const NekDouble> &inarray,
262  Array<OneD, NekDouble> &outarray);
263 
264  ///
265  inline void MultiplyByInvMassMatrix(
266  const Array<OneD,const NekDouble> &inarray,
267  Array<OneD, NekDouble> &outarray,
268  CoeffState coeffstate = eLocal);
269 
270  /// Smooth a field across elements
271  inline void SmoothField(Array<OneD,NekDouble> &field);
272 
273  /// Solve helmholtz problem
274  inline void HelmSolve(
275  const Array<OneD, const NekDouble> &inarray,
276  Array<OneD, NekDouble> &outarray,
277  const FlagList &flags,
278  const StdRegions::ConstFactorMap &factors,
279  const StdRegions::VarCoeffMap &varcoeff =
281  const Array<OneD, const NekDouble> &dirForcing =
283 
284  /// Solve Advection Diffusion Reaction
286  const Array<OneD, Array<OneD, NekDouble> > &velocity,
287  const Array<OneD, const NekDouble> &inarray,
288  Array<OneD, NekDouble> &outarray,
289  const NekDouble lambda,
290  CoeffState coeffstate = eLocal,
292  dirForcing = NullNekDouble1DArray);
293 
294 
295  /// Solve Advection Diffusion Reaction
296  inline void LinearAdvectionReactionSolve(
297  const Array<OneD, Array<OneD, NekDouble> > &velocity,
298  const Array<OneD, const NekDouble> &inarray,
299  Array<OneD, NekDouble> &outarray,
300  const NekDouble lambda,
301  CoeffState coeffstate = eLocal,
303  dirForcing = NullNekDouble1DArray);
304 
305  ///
307  const Array<OneD, const NekDouble> &inarray,
308  Array<OneD, NekDouble> &outarray);
309 
310 
311  /// This function elementally evaluates the backward transformation
312  /// of the global spectral/hp element expansion.
313  inline void BwdTrans_IterPerExp (
314  const Array<OneD, const NekDouble> &inarray,
315  Array<OneD,NekDouble> &outarray);
316 
317  ///
318  inline void BwdTrans (
319  const Array<OneD,
320  const NekDouble> &inarray,
321  Array<OneD,NekDouble> &outarray,
322  CoeffState coeffstate = eLocal);
323 
324  /// This function calculates the coordinates of all the elemental
325  /// quadrature points \f$\boldsymbol{x}_i\f$.
326  inline void GetCoords(
327  Array<OneD, NekDouble> &coord_0,
330 
331  // Homogeneous transforms
332  inline void HomogeneousFwdTrans(
333  const Array<OneD, const NekDouble> &inarray,
334  Array<OneD, NekDouble> &outarray,
335  CoeffState coeffstate = eLocal,
336  bool Shuff = true,
337  bool UnShuff = true);
338 
339  inline void HomogeneousBwdTrans(
340  const Array<OneD, const NekDouble> &inarray,
341  Array<OneD, NekDouble> &outarray,
342  CoeffState coeffstate = eLocal,
343  bool Shuff = true,
344  bool UnShuff = true);
345 
346  inline void DealiasedProd(
347  const Array<OneD, NekDouble> &inarray1,
348  const Array<OneD, NekDouble> &inarray2,
349  Array<OneD, NekDouble> &outarray,
350  CoeffState coeffstate = eLocal);
351 
352  inline void GetBCValues(
353  Array<OneD, NekDouble> &BndVals,
354  const Array<OneD, NekDouble> &TotField,
355  int BndID);
356 
357  inline void NormVectorIProductWRTBase(
360  Array<OneD, NekDouble> &outarray,
361  int BndID);
362 
363  inline void NormVectorIProductWRTBase(
365  Array<OneD, NekDouble> &outarray);
366 
367  /// Apply geometry information to each expansion.
369 
370  /// Reset geometry information and reset matrices
372  {
373  v_Reset();
374  }
375 
376  void WriteTecplotHeader(std::ostream &outfile,
377  std::string var = "")
378  {
379  v_WriteTecplotHeader(outfile, var);
380  }
381 
383  std::ostream &outfile,
384  int expansion = -1)
385  {
386  v_WriteTecplotZone(outfile, expansion);
387  }
388 
389  void WriteTecplotField(std::ostream &outfile,
390  int expansion = -1)
391  {
392  v_WriteTecplotField(outfile, expansion);
393  }
394 
395  void WriteTecplotConnectivity(std::ostream &outfile,
396  int expansion = -1)
397  {
398  v_WriteTecplotConnectivity(outfile, expansion);
399  }
400 
401  MULTI_REGIONS_EXPORT void WriteVtkHeader(std::ostream &outfile);
402  MULTI_REGIONS_EXPORT void WriteVtkFooter(std::ostream &outfile);
403 
404  void WriteVtkPieceHeader(std::ostream &outfile, int expansion,
405  int istrip = 0)
406  {
407  v_WriteVtkPieceHeader(outfile, expansion, istrip);
408  }
409 
411  std::ostream &outfile,
412  int expansion);
413 
415  std::ostream &outfile,
416  int expansion,
417  std::string var = "v")
418  {
419  v_WriteVtkPieceData(outfile, expansion, var);
420  }
421 
422  /// This function returns the dimension of the coordinates of the
423  /// element \a eid.
424  // inline
425  MULTI_REGIONS_EXPORT int GetCoordim(int eid);
426 
427  /// Set the \a i th coefficiient in \a m_coeffs to value \a val
428  inline void SetCoeff(int i, NekDouble val);
429 
430  /// Set the \a i th coefficiient in #m_coeffs to value \a val
431  inline void SetCoeffs(int i, NekDouble val);
432 
433  /// Set the #m_coeffs array to inarray
434  inline void SetCoeffsArray(Array<OneD, NekDouble> &inarray);
435 
436  /// This function returns (a reference to) the array
437  /// \f$\boldsymbol{\hat{u}}_l\f$ (implemented as #m_coeffs)
438  /// containing all local expansion coefficients.
439  inline const Array<OneD, const NekDouble> &GetCoeffs() const;
440 
441  /// Impose Dirichlet Boundary Conditions onto Array
442  inline void ImposeDirichletConditions(
443  Array<OneD,NekDouble>& outarray);
444 
445  /// Fill Bnd Condition expansion from the values stored in expansion
446  inline void FillBndCondFromField(void);
447 
448  /// Put the coefficients into global ordering using m_coeffs
449  inline void LocalToGlobal(void);
450 
451  /// Put the coefficients into local ordering and place in m_coeffs
452  inline void GlobalToLocal(void);
453 
454  /// Get the \a i th value (coefficient) of #m_coeffs
455  inline NekDouble GetCoeff(int i);
456 
457  /// Get the \a i th value (coefficient) of #m_coeffs
458  inline NekDouble GetCoeffs(int i);
459 
460  /// This function returns (a reference to) the array
461  /// \f$\boldsymbol{u}_l\f$ (implemented as #m_phys) containing the
462  /// function \f$u^{\delta}(\boldsymbol{x})\f$ evaluated at the
463  /// quadrature points.
464  // inline
466  &GetPhys() const;
467 
468  /// This function calculates the \f$L_\infty\f$ error of the global
469  /// spectral/hp element approximation.
471  const Array<OneD, const NekDouble> &inarray,
473 
474  /// This function calculates the \f$L_2\f$ error with
475  /// respect to soln of the global
476  /// spectral/hp element approximation.
478  const Array<OneD, const NekDouble> &inarray,
480  {
481  return v_L2(inarray, soln);
482  }
483 
484  /// Calculates the \f$H^1\f$ error of the global spectral/hp
485  /// element approximation.
487  const Array<OneD, const NekDouble> &inarray,
489 
491  {
492  return v_Integral(inarray);
493  }
494 
495  /// This function calculates the energy associated with
496  /// each one of the modesof a 3D homogeneous nD expansion
498  {
499  return v_HomogeneousEnergy();
500  }
501 
502  /// This function sets the Spectral Vanishing Viscosity
503  /// in homogeneous1D expansion.
505  {
507  }
508 
509  /// This function returns a vector containing the wave
510  /// numbers in z-direction associated
511  /// with the 3D homogenous expansion. Required if a
512  /// parellelisation is applied in the Fourier direction
514  {
515  return v_GetZIDs();
516  }
517 
518  /// This function returns the transposition class
519  /// associaed with the homogeneous expansion.
521  {
522  return v_GetTransposition();
523  }
524 
525  /// This function returns the Width of homogeneous direction
526  /// associaed with the homogeneous expansion.
528  {
529  return v_GetHomoLen();
530  }
531 
532  /// This function returns a vector containing the wave
533  /// numbers in y-direction associated
534  /// with the 3D homogenous expansion. Required if a
535  /// parellelisation is applied in the Fourier direction
537  {
538  return v_GetYIDs();
539  }
540 
541  /// This function interpolates the physical space points in
542  /// \a inarray to \a outarray using the same points defined in the
543  /// expansion but where the number of points are rescaled
544  /// by \a 1DScale
546  const NekDouble scale,
547  const Array<OneD, NekDouble> &inarray,
548  Array<OneD, NekDouble> &outarray)
549  {
550  v_PhysInterp1DScaled(scale, inarray,outarray);
551  }
552 
553  /// This function Galerkin projects the physical space points in
554  /// \a inarray to \a outarray where inarray is assumed to
555  /// be defined in the expansion but where the number of
556  /// points are rescaled by \a 1DScale
558  const NekDouble scale,
559  const Array<OneD, NekDouble> &inarray,
560  Array<OneD, NekDouble> &outarray)
561  {
562  v_PhysGalerkinProjection1DScaled(scale, inarray, outarray);
563  }
564 
565  /// This function returns the number of elements in the expansion.
566  inline int GetExpSize(void);
567 
568 
569  /// This function returns the number of elements in the
570  /// expansion which may be different for a homogeoenous extended
571  /// expansionp.
572  inline int GetNumElmts(void)
573  {
574  return v_GetNumElmts();
575  }
576 
577  /// This function returns the vector of elements in the expansion.
578  inline const boost::shared_ptr<LocalRegions::ExpansionVector>
579  GetExp() const;
580 
581  /// This function returns (a shared pointer to) the local elemental
582  /// expansion of the \f$n^{\mathrm{th}}\f$ element.
583  inline LocalRegions::ExpansionSharedPtr& GetExp(int n) const;
584 
585  /// This function returns (a shared pointer to) the local elemental
586  /// expansion containing the arbitrary point given by \a gloCoord.
588  const Array<OneD, const NekDouble> &gloCoord);
589 
590  /** This function returns the index of the local elemental
591  * expansion containing the arbitrary point given by \a gloCoord.
592  **/
594  const Array<OneD, const NekDouble> &gloCoord,
595  NekDouble tol = 0.0,
596  bool returnNearestElmt = false);
597 
598  /** This function returns the index and the Local
599  * Cartesian Coordinates \a locCoords of the local
600  * elemental expansion containing the arbitrary point
601  * given by \a gloCoords.
602  **/
604  const Array<OneD, const NekDouble> &gloCoords,
605  Array<OneD, NekDouble> &locCoords,
606  NekDouble tol = 0.0,
607  bool returnNearestElmt = false);
608 
609  /// Get the start offset position for a global list of #m_coeffs
610  /// correspoinding to element n.
611  inline int GetCoeff_Offset(int n) const;
612 
613  /// Get the start offset position for a global list of m_phys
614  /// correspoinding to element n.
615  inline int GetPhys_Offset(int n) const;
616 
617  /// Get the element id associated with the n th
618  /// consecutive block of data in #m_phys and #m_coeffs
619  inline int GetOffset_Elmt_Id(int n) const;
620 
621  /// This function returns (a reference to) the array
622  /// \f$\boldsymbol{\hat{u}}_l\f$ (implemented as #m_coeffs)
623  /// containing all local expansion coefficients.
625 
626  /// This function returns (a reference to) the array
627  /// \f$\boldsymbol{u}_l\f$ (implemented as #m_phys) containing the
628  /// function \f$u^{\delta}(\boldsymbol{x})\f$ evaluated at the
629  /// quadrature points.
631 
632  inline void PhysDeriv(
633  Direction edir,
634  const Array<OneD, const NekDouble> &inarray,
635  Array<OneD, NekDouble> &out_d);
636 
637  /// This function discretely evaluates the derivative of a function
638  /// \f$f(\boldsymbol{x})\f$ on the domain consisting of all
639  /// elements of the expansion.
640  inline void PhysDeriv(
641  const Array<OneD, const NekDouble> &inarray,
642  Array<OneD, NekDouble> &out_d0,
645 
646  inline void PhysDeriv(
647  const int dir,
648  const Array<OneD, const NekDouble> &inarray,
649  Array<OneD, NekDouble> &out_d);
650 
651 
652  // functions associated with DisContField
655 
656  inline boost::shared_ptr<ExpList> &UpdateBndCondExpansion(int i);
657 
658  inline void Upwind(
659  const Array<OneD, const Array<OneD, NekDouble> > &Vec,
660  const Array<OneD, const NekDouble> &Fwd,
661  const Array<OneD, const NekDouble> &Bwd,
663 
664  inline void Upwind(
666  const Array<OneD, const NekDouble> &Fwd,
667  const Array<OneD, const NekDouble> &Bwd,
669 
670  /**
671  * Return a reference to the trace space associated with this
672  * expansion list.
673  */
674  inline boost::shared_ptr<ExpList> &GetTrace();
675 
676  inline boost::shared_ptr<AssemblyMapDG> &GetTraceMap(void);
677 
678  inline const Array<OneD, const int> &GetTraceBndMap(void);
679 
680  inline void GetNormals(Array<OneD, Array<OneD, NekDouble> > &normals);
681 
682  inline void AddTraceIntegral(
685  Array<OneD, NekDouble> &outarray);
686 
687  inline void AddTraceIntegral(
689  Array<OneD, NekDouble> &outarray);
690 
691  inline void AddFwdBwdTraceIntegral(
692  const Array<OneD, const NekDouble> &Fwd,
693  const Array<OneD, const NekDouble> &Bwd,
694  Array<OneD, NekDouble> &outarray);
695 
696  inline void GetFwdBwdTracePhys(
698  Array<OneD,NekDouble> &Bwd);
699 
700  inline void GetFwdBwdTracePhys(
701  const Array<OneD,const NekDouble> &field,
703  Array<OneD,NekDouble> &Bwd);
704 
705  inline const std::vector<bool> &GetLeftAdjacentFaces(void) const;
706 
707  inline void ExtractTracePhys(Array<OneD,NekDouble> &outarray);
708 
709  inline void ExtractTracePhys(
710  const Array<OneD, const NekDouble> &inarray,
711  Array<OneD,NekDouble> &outarray);
712 
713  inline const Array<OneD, const SpatialDomains::
715 
716  inline Array<OneD, SpatialDomains::
718 
719  inline void EvaluateBoundaryConditions(
720  const NekDouble time = 0.0,
721  const std::string varName = "",
724 
725  // Routines for continous matrix solution
726  /// This function calculates the result of the multiplication of a
727  /// matrix of type specified by \a mkey with a vector given by \a
728  /// inarray.
729  inline void GeneralMatrixOp(
730  const GlobalMatrixKey &gkey,
731  const Array<OneD,const NekDouble> &inarray,
732  Array<OneD, NekDouble> &outarray,
733  CoeffState coeffstate = eLocal);
734 
736  const GlobalMatrixKey &gkey,
737  const Array<OneD,const NekDouble> &inarray,
738  Array<OneD, NekDouble> &outarray);
739 
740  inline void SetUpPhysNormals();
741 
742  inline void GetBoundaryToElmtMap(Array<OneD, int> &ElmtID,
743  Array<OneD,int> &EdgeID);
744 
745  inline void GetBndElmtExpansion(int i,
746  boost::shared_ptr<ExpList> &result);
747 
748  inline void ExtractElmtToBndPhys(int i,
750  Array<OneD, NekDouble> &boundary);
751 
752  inline void ExtractPhysToBndElmt(int i,
753  const Array<OneD, const NekDouble> &phys,
754  Array<OneD, NekDouble> &bndElmt);
755 
756  inline void GetBoundaryNormals(int i,
757  Array<OneD, Array<OneD, NekDouble> > &normals);
758 
760  std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef,
761  int NumHomoDir = 0,
764  std::vector<NekDouble> &HomoLen =
766  bool homoStrips = false,
767  std::vector<unsigned int> &HomoSIDs =
769  std::vector<unsigned int> &HomoZIDs =
771  std::vector<unsigned int> &HomoYIDs =
773 
774 
776  {
777  return m_globalOptParam;
778  }
779 
780  std::map<int, RobinBCInfoSharedPtr> GetRobinBCInfo()
781  {
782  return v_GetRobinBCInfo();
783  }
784 
786  PeriodicMap &periodicVerts,
787  PeriodicMap &periodicEdges,
788  PeriodicMap &periodicFaces = NullPeriodicMap)
789  {
790  v_GetPeriodicEntities(periodicVerts, periodicEdges, periodicFaces);
791  }
792 
793  std::vector<LibUtilities::FieldDefinitionsSharedPtr>
795  {
796  return v_GetFieldDefinitions();
797  }
798 
799 
800  void GetFieldDefinitions(std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef)
801  {
802  v_GetFieldDefinitions(fielddef);
803  }
804 
805 
806 
807  /// Append the element data listed in elements
808  /// fielddef->m_ElementIDs onto fielddata
811  std::vector<NekDouble> &fielddata)
812  {
813  v_AppendFieldData(fielddef,fielddata);
814  }
815 
816 
817  /// Append the data in coeffs listed in elements
818  /// fielddef->m_ElementIDs onto fielddata
821  std::vector<NekDouble> &fielddata,
822  Array<OneD, NekDouble> &coeffs)
823  {
824  v_AppendFieldData(fielddef,fielddata,coeffs);
825  }
826 
827 
828  /** \brief Extract the data in fielddata into the coeffs
829  * using the basic ExpList Elemental expansions rather
830  * than planes in homogeneous case
831  */
834  std::vector<NekDouble> &fielddata,
835  std::string &field,
836  Array<OneD, NekDouble> &coeffs);
837 
838 
839  /** \brief Extract the data from fromField using
840  * fromExpList the coeffs using the basic ExpList
841  * Elemental expansions rather than planes in homogeneous
842  * case
843  */
845  const boost::shared_ptr<ExpList> &fromExpList,
846  const Array<OneD, const NekDouble> &fromCoeffs,
847  Array<OneD, NekDouble> &toCoeffs);
848 
849 
850  //Extract data in fielddata into the m_coeffs_list for the 3D stability analysis (base flow is 2D)
853  std::vector<NekDouble> &fielddata,
854  std::string &field,
855  Array<OneD, NekDouble> &coeffs);
856 
857 
858  /// Returns a shared pointer to the current object.
859  boost::shared_ptr<ExpList> GetSharedThisPtr()
860  {
861  return shared_from_this();
862  }
863 
864  /// Returns the session object
865  boost::shared_ptr<LibUtilities::SessionReader> GetSession()
866  {
867  return m_session;
868  }
869 
870  /// Returns the comm object
871  boost::shared_ptr<LibUtilities::Comm> GetComm()
872  {
873  return m_comm;
874  }
875 
877  {
878  return m_graph;
879  }
880 
881  // Wrapper functions for Homogeneous Expansions
883  {
884  return v_GetHomogeneousBasis();
885  }
886 
887  boost::shared_ptr<ExpList> &GetPlane(int n)
888  {
889  return v_GetPlane(n);
890  }
891 
892  //expansion type
894 
896  Collections::ImplementationType ImpType
897  = Collections::eNoImpType);
898 
900 
901  protected:
902  boost::shared_ptr<DNekMat> GenGlobalMatrixFull(
903  const GlobalLinSysKey &mkey,
904  const boost::shared_ptr<AssemblyMapCG> &locToGloMap);
905 
906  /// Communicator
908 
909  /// Session
911 
912  /// Mesh associated with this expansion list.
914 
915  /// The total number of local degrees of freedom. #m_ncoeffs
916  /// \f$=N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_l\f$
918 
919  /** The total number of quadrature points. #m_npoints
920  *\f$=Q_{\mathrm{tot}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_Q\f$
921  **/
923 
924  /**
925  * \brief Concatenation of all local expansion coefficients.
926  *
927  * The array of length #m_ncoeffs\f$=N_{\mathrm{eof}}\f$ which is
928  * the concatenation of the local expansion coefficients
929  * \f$\hat{u}_n^e\f$ over all \f$N_{\mathrm{el}}\f$ elements
930  * \f[\mathrm{\texttt{m\_coeffs}}=\boldsymbol{\hat{u}}_{l} =
931  * \underline{\boldsymbol{\hat{u}}}^e = \left [ \begin{array}{c}
932  * \boldsymbol{\hat{u}}^{1} \ \
933  * \boldsymbol{\hat{u}}^{2} \ \
934  * \vdots \ \
935  * \boldsymbol{\hat{u}}^{{{N_{\mathrm{el}}}}} \end{array} \right ],
936  * \quad
937  * \mathrm{where}\quad \boldsymbol{\hat{u}}^{e}[n]=\hat{u}_n^{e}\f]
938  */
940 
941  /**
942  * \brief The global expansion evaluated at the quadrature points
943  *
944  * The array of length #m_npoints\f$=Q_{\mathrm{tot}}\f$ containing
945  * the evaluation of \f$u^{\delta}(\boldsymbol{x})\f$ at the
946  * quadrature points \f$\boldsymbol{x}_i\f$.
947  * \f[\mathrm{\texttt{m\_phys}}=\boldsymbol{u}_{l} =
948  * \underline{\boldsymbol{u}}^e = \left [ \begin{array}{c}
949  * \boldsymbol{u}^{1} \ \
950  * \boldsymbol{u}^{2} \ \
951  * \vdots \ \
952  * \boldsymbol{u}^{{{N_{\mathrm{el}}}}} \end{array} \right ],\quad
953  * \mathrm{where}\quad
954  * \boldsymbol{u}^{e}[i]=u^{\delta}(\boldsymbol{x}_i)\f]
955  */
957 
958  /**
959  * \brief The state of the array #m_phys.
960  *
961  * Indicates whether the array #m_phys, created to contain the
962  * evaluation of \f$u^{\delta}(\boldsymbol{x})\f$ at the quadrature
963  * points \f$\boldsymbol{x}_i\f$, is filled with these values.
964  */
966 
967  /**
968  * \brief The list of local expansions.
969  *
970  * The (shared pointer to the) vector containing (shared pointers
971  * to) all local expansions. The fact that the local expansions are
972  * all stored as a (pointer to a) #StdExpansion, the abstract base
973  * class for all local expansions, allows a general implementation
974  * where most of the routines for the derived classes are defined
975  * in the #ExpList base class.
976  */
977  boost::shared_ptr<LocalRegions::ExpansionVector> m_exp;
978 
979  Collections::CollectionVector m_collections;
980 
981  /// Offset of elemental data into the array #m_coeffs
982  std::vector<int> m_coll_coeff_offset;
983 
984  /// Offset of elemental data into the array #m_phys
985  std::vector<int> m_coll_phys_offset;
986 
987  /// Offset of elemental data into the array #m_coeffs
989 
990  /// Offset of elemental data into the array #m_phys
992 
993  /// Array containing the element id #m_offset_elmt_id[n]
994  /// that the n^th consecutive block of data in #m_coeffs
995  /// and #m_phys is associated, i.e. for an array of
996  /// constant expansion size and single shape elements
997  /// m_phys[n*m_npoints] is the data related to
998  /// m_exp[m_offset_elmt_id[n]];
1000 
1002 
1003  BlockMatrixMapShPtr m_blockMat;
1004 
1005  //@todo should this be in ExpList or ExpListHomogeneous1D.cpp
1006  // it's a bool which determine if the expansion is in the wave space (coefficient space)
1007  // or not
1009 
1010  /// Mapping from geometry ID of element to index inside #m_exp
1011  boost::unordered_map<int, int> m_elmtToExpId;
1012 
1013  /// This function assembles the block diagonal matrix of local
1014  /// matrices of the type \a mtype.
1016  const GlobalMatrixKey &gkey);
1017 
1019  const GlobalMatrixKey &gkey);
1020 
1021  void MultiplyByBlockMatrix(
1022  const GlobalMatrixKey &gkey,
1023  const Array<OneD,const NekDouble> &inarray,
1024  Array<OneD, NekDouble> &outarray);
1025 
1026  /// Generates a global matrix from the given key and map.
1027  boost::shared_ptr<GlobalMatrix> GenGlobalMatrix(
1028  const GlobalMatrixKey &mkey,
1029  const boost::shared_ptr<AssemblyMapCG> &locToGloMap);
1030 
1031 
1032  void GlobalEigenSystem(
1033  const boost::shared_ptr<DNekMat> &Gmat,
1034  Array<OneD, NekDouble> &EigValsReal,
1035  Array<OneD, NekDouble> &EigValsImag,
1036  Array<OneD, NekDouble> &EigVecs
1038 
1039 
1040  /// This operation constructs the global linear system of type \a
1041  /// mkey.
1042  boost::shared_ptr<GlobalLinSys> GenGlobalLinSys(
1043  const GlobalLinSysKey &mkey,
1044  const boost::shared_ptr<AssemblyMapCG> &locToGloMap);
1045 
1046  /// Generate a GlobalLinSys from information provided by the key
1047  /// "mkey" and the mapping provided in LocToGloBaseMap.
1048  boost::shared_ptr<GlobalLinSys> GenGlobalBndLinSys(
1049  const GlobalLinSysKey &mkey,
1050  const AssemblyMapSharedPtr &locToGloMap);
1051 
1053  {
1055  }
1056 
1057  // Virtual prototypes
1058 
1059  virtual int v_GetNumElmts(void)
1060  {
1061  return (*m_exp).size();
1062  }
1063 
1065  &v_GetBndCondExpansions(void);
1066 
1067  virtual boost::shared_ptr<ExpList> &v_UpdateBndCondExpansion(int i);
1068 
1069  virtual void v_Upwind(
1070  const Array<OneD, const Array<OneD, NekDouble> > &Vec,
1071  const Array<OneD, const NekDouble> &Fwd,
1072  const Array<OneD, const NekDouble> &Bwd,
1074 
1075  virtual void v_Upwind(
1076  const Array<OneD, const NekDouble> &Vn,
1077  const Array<OneD, const NekDouble> &Fwd,
1078  const Array<OneD, const NekDouble> &Bwd,
1080 
1081  virtual boost::shared_ptr<ExpList> &v_GetTrace();
1082 
1083  virtual boost::shared_ptr<AssemblyMapDG> &v_GetTraceMap();
1084 
1085  virtual const Array<OneD, const int> &v_GetTraceBndMap();
1086 
1087  virtual void v_GetNormals(
1088  Array<OneD, Array<OneD, NekDouble> > &normals);
1089 
1090  virtual void v_AddTraceIntegral(
1091  const Array<OneD, const NekDouble> &Fx,
1092  const Array<OneD, const NekDouble> &Fy,
1093  Array<OneD, NekDouble> &outarray);
1094 
1095  virtual void v_AddTraceIntegral(
1096  const Array<OneD, const NekDouble> &Fn,
1097  Array<OneD, NekDouble> &outarray);
1098 
1099  virtual void v_AddFwdBwdTraceIntegral(
1100  const Array<OneD, const NekDouble> &Fwd,
1101  const Array<OneD, const NekDouble> &Bwd,
1102  Array<OneD, NekDouble> &outarray);
1103 
1104  virtual void v_GetFwdBwdTracePhys(
1105  Array<OneD,NekDouble> &Fwd,
1106  Array<OneD,NekDouble> &Bwd);
1107 
1108  virtual void v_GetFwdBwdTracePhys(
1109  const Array<OneD,const NekDouble> &field,
1110  Array<OneD,NekDouble> &Fwd,
1111  Array<OneD,NekDouble> &Bwd);
1112 
1113  virtual const std::vector<bool> &v_GetLeftAdjacentFaces(void) const;
1114 
1115  virtual void v_ExtractTracePhys(
1116  Array<OneD,NekDouble> &outarray);
1117 
1118  virtual void v_ExtractTracePhys(
1119  const Array<OneD, const NekDouble> &inarray,
1120  Array<OneD,NekDouble> &outarray);
1121 
1122  virtual void v_MultiplyByInvMassMatrix(
1123  const Array<OneD,const NekDouble> &inarray,
1124  Array<OneD, NekDouble> &outarray,
1125  CoeffState coeffstate);
1126 
1127  virtual void v_HelmSolve(
1128  const Array<OneD, const NekDouble> &inarray,
1129  Array<OneD, NekDouble> &outarray,
1130  const FlagList &flags,
1131  const StdRegions::ConstFactorMap &factors,
1132  const StdRegions::VarCoeffMap &varcoeff,
1133  const Array<OneD, const NekDouble> &dirForcing);
1134 
1136  const Array<OneD, Array<OneD, NekDouble> > &velocity,
1137  const Array<OneD, const NekDouble> &inarray,
1138  Array<OneD, NekDouble> &outarray,
1139  const NekDouble lambda,
1140  CoeffState coeffstate = eLocal,
1142  dirForcing = NullNekDouble1DArray);
1143 
1144  virtual void v_LinearAdvectionReactionSolve(
1145  const Array<OneD, Array<OneD, NekDouble> > &velocity,
1146  const Array<OneD, const NekDouble> &inarray,
1147  Array<OneD, NekDouble> &outarray,
1148  const NekDouble lambda,
1149  CoeffState coeffstate = eLocal,
1151  dirForcing = NullNekDouble1DArray);
1152 
1153  // wrapper functions about virtual functions
1154  virtual void v_ImposeDirichletConditions(Array<OneD,NekDouble>& outarray);
1155 
1156  virtual void v_FillBndCondFromField();
1157 
1158  virtual void v_Reset();
1159 
1160  virtual void v_LocalToGlobal(void);
1161 
1162  virtual void v_GlobalToLocal(void);
1163 
1164  virtual void v_BwdTrans(
1165  const Array<OneD,const NekDouble> &inarray,
1166  Array<OneD, NekDouble> &outarray,
1167  CoeffState coeffstate);
1168 
1169  virtual void v_BwdTrans_IterPerExp(
1170  const Array<OneD,const NekDouble> &inarray,
1171  Array<OneD,NekDouble> &outarray);
1172 
1173  virtual void v_FwdTrans(
1174  const Array<OneD,const NekDouble> &inarray,
1175  Array<OneD, NekDouble> &outarray,
1176  CoeffState coeffstate);
1177 
1178  virtual void v_FwdTrans_IterPerExp(
1179  const Array<OneD,const NekDouble> &inarray,
1180  Array<OneD,NekDouble> &outarray);
1181 
1182  virtual void v_SmoothField(Array<OneD,NekDouble> &field);
1183 
1184  virtual void v_IProductWRTBase(
1185  const Array<OneD, const NekDouble> &inarray,
1186  Array<OneD, NekDouble> &outarray,
1187  CoeffState coeffstate);
1188 
1189  virtual void v_IProductWRTBase_IterPerExp(
1190  const Array<OneD,const NekDouble> &inarray,
1191  Array<OneD, NekDouble> &outarray);
1192 
1193  virtual void v_GeneralMatrixOp(
1194  const GlobalMatrixKey &gkey,
1195  const Array<OneD,const NekDouble> &inarray,
1196  Array<OneD, NekDouble> &outarray,
1197  CoeffState coeffstate);
1198 
1199  virtual void v_GetCoords(
1200  Array<OneD, NekDouble> &coord_0,
1201  Array<OneD, NekDouble> &coord_1,
1203 
1204  virtual void v_PhysDeriv(
1205  const Array<OneD, const NekDouble> &inarray,
1206  Array<OneD, NekDouble> &out_d0,
1207  Array<OneD, NekDouble> &out_d1,
1208  Array<OneD, NekDouble> &out_d2);
1209 
1210  virtual void v_PhysDeriv(
1211  const int dir,
1212  const Array<OneD, const NekDouble> &inarray,
1213  Array<OneD, NekDouble> &out_d);
1214 
1215  virtual void v_PhysDeriv(
1216  Direction edir,
1217  const Array<OneD, const NekDouble> &inarray,
1218  Array<OneD, NekDouble> &out_d);
1219 
1220  virtual void v_HomogeneousFwdTrans(
1221  const Array<OneD, const NekDouble> &inarray,
1222  Array<OneD, NekDouble> &outarray,
1223  CoeffState coeffstate = eLocal,
1224  bool Shuff = true,
1225  bool UnShuff = true);
1226 
1227  virtual void v_HomogeneousBwdTrans(
1228  const Array<OneD, const NekDouble> &inarray,
1229  Array<OneD, NekDouble> &outarray,
1230  CoeffState coeffstate = eLocal,
1231  bool Shuff = true,
1232  bool UnShuff = true);
1233 
1234  virtual void v_DealiasedProd(
1235  const Array<OneD, NekDouble> &inarray1,
1236  const Array<OneD, NekDouble> &inarray2,
1237  Array<OneD, NekDouble> &outarray,
1238  CoeffState coeffstate = eLocal);
1239 
1240  virtual void v_GetBCValues(
1241  Array<OneD, NekDouble> &BndVals,
1242  const Array<OneD, NekDouble> &TotField,
1243  int BndID);
1244 
1245  virtual void v_NormVectorIProductWRTBase(
1248  Array<OneD, NekDouble> &outarray,
1249  int BndID);
1250 
1251  virtual void v_NormVectorIProductWRTBase(
1252  Array<OneD, Array<OneD, NekDouble> > &V,
1253  Array<OneD, NekDouble> &outarray);
1254 
1255  virtual void v_SetUpPhysNormals();
1256 
1257  virtual void v_GetBoundaryToElmtMap(Array<OneD, int> &ElmtID,
1258  Array<OneD,int> &EdgeID);
1259 
1260  virtual void v_GetBndElmtExpansion(int i,
1261  boost::shared_ptr<ExpList> &result);
1262 
1263  virtual void v_ExtractElmtToBndPhys(int i,
1264  Array<OneD, NekDouble> &elmt,
1265  Array<OneD, NekDouble> &boundary);
1266 
1267  virtual void v_ExtractPhysToBndElmt(int i,
1268  const Array<OneD, const NekDouble> &phys,
1269  Array<OneD, NekDouble> &bndElmt);
1270 
1271  virtual void v_GetBoundaryNormals(int i,
1272  Array<OneD, Array<OneD, NekDouble> > &normals);
1273 
1274  virtual void v_ReadGlobalOptimizationParameters();
1275 
1276  virtual std::vector<LibUtilities::FieldDefinitionsSharedPtr>
1277  v_GetFieldDefinitions(void);
1278 
1279  virtual void v_GetFieldDefinitions(
1280  std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef);
1281 
1282  virtual void v_AppendFieldData(
1284  std::vector<NekDouble> &fielddata);
1285 
1286  virtual void v_AppendFieldData(
1288  std::vector<NekDouble> &fielddata,
1289  Array<OneD, NekDouble> &coeffs);
1290 
1291  virtual void v_ExtractDataToCoeffs(
1293  std::vector<NekDouble> &fielddata, std::string &field,
1294  Array<OneD, NekDouble> &coeffs);
1295 
1296  virtual void v_ExtractCoeffsToCoeffs(const boost::shared_ptr<ExpList> &fromExpList, const Array<OneD, const NekDouble> &fromCoeffs, Array<OneD, NekDouble> &toCoeffs);
1297 
1298  virtual void v_WriteTecplotHeader(std::ostream &outfile,
1299  std::string var = "");
1300  virtual void v_WriteTecplotZone(std::ostream &outfile,
1301  int expansion);
1302  virtual void v_WriteTecplotField(std::ostream &outfile,
1303  int expansion);
1304  virtual void v_WriteTecplotConnectivity(std::ostream &outfile,
1305  int expansion);
1306  virtual void v_WriteVtkPieceHeader(
1307  std::ostream &outfile,
1308  int expansion,
1309  int istrip);
1310 
1311  virtual void v_WriteVtkPieceData(
1312  std::ostream &outfile,
1313  int expansion,
1314  std::string var);
1315 
1316  virtual NekDouble v_L2(
1317  const Array<OneD, const NekDouble> &phys,
1319 
1320  virtual NekDouble v_Integral (
1321  const Array<OneD, const NekDouble> &inarray);
1322 
1325  virtual NekDouble v_GetHomoLen(void);
1328 
1329  // 1D Scaling and projection
1330  virtual void v_PhysInterp1DScaled(
1331  const NekDouble scale, const Array<OneD, NekDouble> &inarray,
1332  Array<OneD, NekDouble> &outarray);
1333 
1334  virtual void v_PhysGalerkinProjection1DScaled(
1335  const NekDouble scale,
1336  const Array<OneD, NekDouble> &inarray,
1337  Array<OneD, NekDouble> &outarray);
1338 
1339  virtual void v_ClearGlobalLinSysManager(void);
1340 
1341  void ExtractFileBCs(const std::string &fileName,
1342  const std::string &varName,
1343  const boost::shared_ptr<ExpList> locExpList);
1344 
1345  // Utility function for a common case of retrieving a
1346  // BoundaryCondition from a boundary condition collection.
1349  GetBoundaryCondition(const SpatialDomains::
1350  BoundaryConditionCollection& collection,
1351  unsigned int index, const std::string& variable);
1352 
1353 
1354  private:
1356 
1359 
1360  virtual void v_EvaluateBoundaryConditions(
1361  const NekDouble time = 0.0,
1362  const std::string varName = "",
1365 
1366  virtual std::map<int, RobinBCInfoSharedPtr> v_GetRobinBCInfo(void);
1367 
1368 
1369  virtual void v_GetPeriodicEntities(
1370  PeriodicMap &periodicVerts,
1371  PeriodicMap &periodicEdges,
1372  PeriodicMap &periodicFaces);
1373 
1374  // Homogeneous direction wrapper functions.
1376  {
1377  ASSERTL0(false,
1378  "This method is not defined or valid for this class type");
1380  }
1381 
1382  // wrapper function to set viscosity for Homo1D expansion
1384  {
1385  ASSERTL0(false,
1386  "This method is not defined or valid for this class type");
1387  }
1388 
1389 
1390  virtual boost::shared_ptr<ExpList> &v_GetPlane(int n);
1391  };
1392 
1393 
1394  /// Shared pointer to an ExpList object.
1395  typedef boost::shared_ptr<ExpList> ExpListSharedPtr;
1396  /// An empty ExpList object.
1398  static ExpListSharedPtr NullExpListSharedPtr;
1399 
1400  // Inline routines follow.
1401 
1402  /**
1403  * Returns the total number of local degrees of freedom
1404  * \f$N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_m\f$.
1405  */
1406  inline int ExpList::GetNcoeffs() const
1407  {
1408  return m_ncoeffs;
1409  }
1410 
1411  inline int ExpList::GetNcoeffs(const int eid) const
1412  {
1413  return (*m_exp)[eid]->GetNcoeffs();
1414  }
1415 
1416  /**
1417  * Evaulates the maximum number of modes in the elemental basis
1418  * order over all elements
1419  */
1421  {
1422  unsigned int i;
1423  int returnval = 0;
1424 
1425  for(i= 0; i < (*m_exp).size(); ++i)
1426  {
1427  returnval = (std::max)(returnval,
1428  (*m_exp)[i]->EvalBasisNumModesMax());
1429  }
1430 
1431  return returnval;
1432  }
1433 
1434  /**
1435  *
1436  */
1438  const
1439  {
1440  unsigned int i;
1441  Array<OneD,int> returnval((*m_exp).size(),0);
1442 
1443  for(i= 0; i < (*m_exp).size(); ++i)
1444  {
1445  returnval[i]
1446  = (std::max)(returnval[i],(*m_exp)[i]->EvalBasisNumModesMax());
1447  }
1448 
1449  return returnval;
1450  }
1451 
1452 
1453  /**
1454  *
1455  */
1456  inline int ExpList::GetTotPoints() const
1457  {
1458  return m_npoints;
1459  }
1460 
1461  inline int ExpList::GetTotPoints(const int eid) const
1462  {
1463  return (*m_exp)[eid]->GetTotPoints();
1464  }
1465 
1466 
1467  inline int ExpList::Get1DScaledTotPoints(const NekDouble scale) const
1468  {
1469  int returnval = 0;
1470  int cnt;
1471  int nbase = (*m_exp)[0]->GetNumBases();
1472 
1473  for(int i = 0; i < (*m_exp).size(); ++i)
1474  {
1475  cnt = 1;
1476  for(int j = 0; j < nbase; ++j)
1477  {
1478  cnt *= (int)(scale*((*m_exp)[i]->GetNumPoints(j)));
1479  }
1480  returnval += cnt;
1481  }
1482  return returnval;
1483  }
1484 
1485  /**
1486  *
1487  */
1488  inline int ExpList::GetNpoints() const
1489  {
1490  return m_npoints;
1491  }
1492 
1493 
1494  /**
1495  *
1496  */
1497  inline void ExpList::SetWaveSpace(const bool wavespace)
1498  {
1499  m_WaveSpace = wavespace;
1500  }
1501 
1502  /**
1503  *
1504  */
1505  inline bool ExpList::GetWaveSpace() const
1506  {
1507  return m_WaveSpace;
1508  }
1509 
1510  /// Set the \a i th value of\a m_phys to value \a val
1511  inline void ExpList::SetPhys(int i, NekDouble val)
1512  {
1513  m_phys[i] = val;
1514  }
1515 
1516 
1517  /**
1518  * This function fills the array \f$\boldsymbol{u}_l\f$, the evaluation
1519  * of the expansion at the quadrature points (implemented as #m_phys),
1520  * with the values of the array \a inarray.
1521  *
1522  * @param inarray The array containing the values where
1523  * #m_phys should be filled with.
1524  */
1525  inline void ExpList::SetPhys(
1526  const Array<OneD, const NekDouble> &inarray)
1527  {
1528  ASSERTL0(inarray.num_elements() == m_npoints,
1529  "Input array does not have correct number of elements.");
1530 
1531  Vmath::Vcopy(m_npoints,&inarray[0],1,&m_phys[0],1);
1532  m_physState = true;
1533  }
1534 
1535 
1537  {
1538  m_phys = inarray;
1539  }
1540 
1541 
1542  /**
1543  * @param physState \a true (=filled) or \a false (=not filled).
1544  */
1545  inline void ExpList::SetPhysState(const bool physState)
1546  {
1547  m_physState = physState;
1548  }
1549 
1550 
1551  /**
1552  * @return physState \a true (=filled) or \a false (=not filled).
1553  */
1554  inline bool ExpList::GetPhysState() const
1555  {
1556  return m_physState;
1557  }
1558 
1559  /**
1560  *
1561  */
1563  const Array<OneD, const NekDouble> &inarray,
1564  Array<OneD, NekDouble> &outarray,
1565  CoeffState coeffstate)
1566  {
1567  v_IProductWRTBase(inarray,outarray, coeffstate);
1568  }
1569 
1570  /**
1571  *
1572  */
1574  const Array<OneD, const NekDouble> &inarray,
1575  Array<OneD, NekDouble> &outarray)
1576  {
1577  v_IProductWRTBase_IterPerExp(inarray,outarray);
1578  }
1579 
1580  /**
1581  *
1582  */
1583  inline void ExpList::FwdTrans(
1584  const Array<OneD, const NekDouble> &inarray,
1585  Array<OneD, NekDouble> &outarray,
1586  CoeffState coeffstate)
1587  {
1588  v_FwdTrans(inarray,outarray,coeffstate);
1589  }
1590 
1591  /**
1592  *
1593  */
1595  const Array<OneD, const NekDouble> &inarray,
1596  Array<OneD,NekDouble> &outarray)
1597  {
1598  v_FwdTrans_IterPerExp(inarray,outarray);
1599  }
1600 
1601  /**
1602  *
1603  */
1605  {
1606  v_SmoothField(field);
1607  }
1608 
1609  /**
1610  *
1611  */
1612  inline void ExpList::BwdTrans (
1613  const Array<OneD, const NekDouble> &inarray,
1614  Array<OneD, NekDouble> &outarray,
1615  CoeffState coeffstate)
1616  {
1617  v_BwdTrans(inarray,outarray,coeffstate);
1618  }
1619 
1620  /**
1621  *
1622  */
1624  const Array<OneD, const NekDouble> &inarray,
1625  Array<OneD, NekDouble> &outarray)
1626  {
1627  v_BwdTrans_IterPerExp(inarray,outarray);
1628  }
1629 
1630 
1631  /**
1632  *
1633  */
1635  const Array<OneD,const NekDouble> &inarray,
1636  Array<OneD, NekDouble> &outarray,
1637  CoeffState coeffstate)
1638  {
1639  v_MultiplyByInvMassMatrix(inarray,outarray,coeffstate);
1640  }
1641 
1642  /**
1643  *
1644  */
1645  inline void ExpList::HelmSolve(
1646  const Array<OneD, const NekDouble> &inarray,
1647  Array<OneD, NekDouble> &outarray,
1648  const FlagList &flags,
1649  const StdRegions::ConstFactorMap &factors,
1650  const StdRegions::VarCoeffMap &varcoeff,
1651  const Array<OneD, const NekDouble> &dirForcing)
1652  {
1653  v_HelmSolve(inarray, outarray, flags, factors, varcoeff, dirForcing);
1654  }
1655 
1656 
1657  /**
1658  *
1659  */
1661  const Array<OneD, Array<OneD, NekDouble> > &velocity,
1662  const Array<OneD, const NekDouble> &inarray,
1663  Array<OneD, NekDouble> &outarray,
1664  const NekDouble lambda,
1665  CoeffState coeffstate,
1666  const Array<OneD, const NekDouble>& dirForcing)
1667  {
1668  v_LinearAdvectionDiffusionReactionSolve(velocity,inarray, outarray,
1669  lambda, coeffstate,dirForcing);
1670  }
1671 
1673  const Array<OneD, Array<OneD, NekDouble> > &velocity,
1674  const Array<OneD, const NekDouble> &inarray,
1675  Array<OneD, NekDouble> &outarray,
1676  const NekDouble lambda,
1677  CoeffState coeffstate,
1678  const Array<OneD, const NekDouble>& dirForcing)
1679  {
1680  v_LinearAdvectionReactionSolve(velocity,inarray, outarray,
1681  lambda, coeffstate,dirForcing);
1682  }
1683 
1684  /**
1685  *
1686  */
1688  Array<OneD, NekDouble> &coord_1,
1689  Array<OneD, NekDouble> &coord_2)
1690 
1691  {
1692  v_GetCoords(coord_0,coord_1,coord_2);
1693  }
1694 
1695  /**
1696  *
1697  */
1699  Array<OneD, NekDouble> &out_d0,
1700  Array<OneD, NekDouble> &out_d1,
1701  Array<OneD, NekDouble> &out_d2)
1702  {
1703  v_PhysDeriv(inarray,out_d0,out_d1,out_d2);
1704  }
1705 
1706  /**
1707  *
1708  */
1709  inline void ExpList::PhysDeriv(
1710  const int dir,
1711  const Array<OneD, const NekDouble> &inarray,
1712  Array<OneD, NekDouble> &out_d)
1713  {
1714  v_PhysDeriv(dir,inarray,out_d);
1715  }
1716 
1717  inline void ExpList::PhysDeriv(
1718  Direction edir,
1719  const Array<OneD, const NekDouble> &inarray,
1720  Array<OneD, NekDouble> &out_d)
1721  {
1722  v_PhysDeriv(edir, inarray,out_d);
1723  }
1724 
1725  /**
1726  *
1727  */
1729  const Array<OneD, const NekDouble> &inarray,
1730  Array<OneD, NekDouble> &outarray,
1731  CoeffState coeffstate,
1732  bool Shuff,
1733  bool UnShuff)
1734  {
1735  v_HomogeneousFwdTrans(inarray,outarray,coeffstate,Shuff,UnShuff);
1736  }
1737 
1738  /**
1739  *
1740  */
1742  const Array<OneD, const NekDouble> &inarray,
1743  Array<OneD, NekDouble> &outarray,
1744  CoeffState coeffstate,
1745  bool Shuff,
1746  bool UnShuff)
1747  {
1748  v_HomogeneousBwdTrans(inarray,outarray,coeffstate,Shuff,UnShuff);
1749  }
1750 
1751  /**
1752  *
1753  */
1755  const Array<OneD, NekDouble> &inarray1,
1756  const Array<OneD, NekDouble> &inarray2,
1757  Array<OneD, NekDouble> &outarray,
1758  CoeffState coeffstate)
1759  {
1760  v_DealiasedProd(inarray1,inarray2,outarray,coeffstate);
1761  }
1762 
1763  /**
1764  *
1765  */
1767  Array<OneD, NekDouble> &BndVals,
1768  const Array<OneD, NekDouble> &TotField,
1769  int BndID)
1770  {
1771  v_GetBCValues(BndVals,TotField,BndID);
1772  }
1773 
1774  /**
1775  *
1776  */
1780  Array<OneD, NekDouble> &outarray,
1781  int BndID)
1782  {
1783  v_NormVectorIProductWRTBase(V1,V2,outarray,BndID);
1784  }
1785 
1788  Array<OneD, NekDouble> &outarray)
1789  {
1790  v_NormVectorIProductWRTBase(V, outarray);
1791  }
1792 
1793  /**
1794  * @param eid The index of the element to be checked.
1795  * @return The dimension of the coordinates of the specific element.
1796  */
1797  inline int ExpList::GetCoordim(int eid)
1798  {
1799  ASSERTL2(eid <= (*m_exp).size(),
1800  "eid is larger than number of elements");
1801  return (*m_exp)[eid]->GetCoordim();
1802  }
1803 
1804  /**
1805  * @param i The index of m_coeffs to be set
1806  * @param val The value which m_coeffs[i] is to be set to.
1807  */
1808  inline void ExpList::SetCoeff(int i, NekDouble val)
1809  {
1810  m_coeffs[i] = val;
1811  }
1812 
1813 
1814  /**
1815  * @param i The index of #m_coeffs to be set.
1816  * @param val The value which #m_coeffs[i] is to be set to.
1817  */
1818  inline void ExpList::SetCoeffs(int i, NekDouble val)
1819  {
1820  m_coeffs[i] = val;
1821  }
1822 
1823 
1825  {
1826  m_coeffs = inarray;
1827  }
1828 
1829  /**
1830  * As the function returns a constant reference to a
1831  * <em>const Array</em>, it is not possible to modify the
1832  * underlying data of the array #m_coeffs. In order to do
1833  * so, use the function #UpdateCoeffs instead.
1834  *
1835  * @return (A constant reference to) the array #m_coeffs.
1836  */
1838  {
1839  return m_coeffs;
1840  }
1841 
1843  Array<OneD,NekDouble>& outarray)
1844  {
1845  v_ImposeDirichletConditions(outarray);
1846  }
1847 
1849  {
1851  }
1852 
1853  inline void ExpList::LocalToGlobal(void)
1854  {
1855  v_LocalToGlobal();
1856  }
1857 
1858  inline void ExpList::GlobalToLocal(void)
1859  {
1860  v_GlobalToLocal();
1861  }
1862 
1863 
1864  /**
1865  * @param i The index of #m_coeffs to be returned
1866  * @return The NekDouble held in #m_coeffs[i].
1867  */
1869  {
1870  return m_coeffs[i];
1871  }
1872 
1873  /**
1874  * @param i The index of #m_coeffs to be returned
1875  * @return The NekDouble held in #m_coeffs[i].
1876  */
1878  {
1879  return m_coeffs[i];
1880  }
1881 
1882  /**
1883  * As the function returns a constant reference to a
1884  * <em>const Array</em> it is not possible to modify the
1885  * underlying data of the array #m_phys. In order to do
1886  * so, use the function #UpdatePhys instead.
1887  *
1888  * @return (A constant reference to) the array #m_phys.
1889  */
1891  {
1892  return m_phys;
1893  }
1894 
1895  /**
1896  * @return \f$N_{\mathrm{el}}\f$, the number of elements in the
1897  * expansion.
1898  */
1899  inline int ExpList::GetExpSize(void)
1900  {
1901  return (*m_exp).size();
1902  }
1903 
1904 
1905  /**
1906  * @param n The index of the element concerned.
1907  *
1908  * @return (A shared pointer to) the local expansion of the
1909  * \f$n^{\mathrm{th}}\f$ element.
1910  */
1912  {
1913  return (*m_exp)[n];
1914  }
1915 
1916  /**
1917  * @return (A const shared pointer to) the local expansion vector #m_exp
1918  */
1919  inline const boost::shared_ptr<LocalRegions::ExpansionVector>
1920  ExpList::GetExp(void) const
1921  {
1922  return m_exp;
1923  }
1924 
1925 
1926  /**
1927  *
1928  */
1929  inline int ExpList::GetCoeff_Offset(int n) const
1930  {
1931  return m_coeff_offset[n];
1932  }
1933 
1934  /**
1935  *
1936  */
1937  inline int ExpList::GetPhys_Offset(int n) const
1938  {
1939  return m_phys_offset[n];
1940  }
1941 
1942  /**
1943  *
1944  */
1945  inline int ExpList::GetOffset_Elmt_Id(int n) const
1946  {
1947  return m_offset_elmt_id[n];
1948  }
1949 
1950  /**
1951  * If one wants to get hold of the underlying data without modifying
1952  * them, rather use the function #GetCoeffs instead.
1953  *
1954  * @return (A reference to) the array #m_coeffs.
1955  */
1957  {
1958  return m_coeffs;
1959  }
1960 
1961  /**
1962  * If one wants to get hold of the underlying data without modifying
1963  * them, rather use the function #GetPhys instead.
1964  *
1965  * @return (A reference to) the array #m_phys.
1966  */
1968  {
1969  m_physState = true;
1970  return m_phys;
1971  }
1972 
1973 
1974  // functions associated with DisContField
1977  {
1978  return v_GetBndCondExpansions();
1979  }
1980 
1981  inline boost::shared_ptr<ExpList> &ExpList::UpdateBndCondExpansion(int i)
1982  {
1983  return v_UpdateBndCondExpansion(i);
1984  }
1985 
1986  inline void ExpList::Upwind(
1987  const Array<OneD, const Array<OneD, NekDouble> > &Vec,
1988  const Array<OneD, const NekDouble> &Fwd,
1989  const Array<OneD, const NekDouble> &Bwd,
1990  Array<OneD, NekDouble> &Upwind)
1991  {
1992  v_Upwind(Vec, Fwd, Bwd, Upwind);
1993  }
1994 
1995  inline void ExpList::Upwind(
1996  const Array<OneD, const NekDouble> &Vn,
1997  const Array<OneD, const NekDouble> &Fwd,
1998  const Array<OneD, const NekDouble> &Bwd,
1999  Array<OneD, NekDouble> &Upwind)
2000  {
2001  v_Upwind(Vn, Fwd, Bwd, Upwind);
2002  }
2003 
2004  inline boost::shared_ptr<ExpList> &ExpList::GetTrace()
2005  {
2006  return v_GetTrace();
2007  }
2008 
2009  inline boost::shared_ptr<AssemblyMapDG> &ExpList::GetTraceMap()
2010  {
2011  return v_GetTraceMap();
2012  }
2013 
2015  {
2016  return v_GetTraceBndMap();
2017  }
2018 
2019  inline void ExpList::GetNormals(
2020  Array<OneD, Array<OneD, NekDouble> > &normals)
2021  {
2022  v_GetNormals(normals);
2023  }
2024 
2026  const Array<OneD, const NekDouble> &Fx,
2027  const Array<OneD, const NekDouble> &Fy,
2028  Array<OneD, NekDouble> &outarray)
2029  {
2030  v_AddTraceIntegral(Fx,Fy,outarray);
2031  }
2032 
2034  const Array<OneD, const NekDouble> &Fn,
2035  Array<OneD, NekDouble> &outarray)
2036  {
2037  v_AddTraceIntegral(Fn,outarray);
2038  }
2039 
2041  const Array<OneD, const NekDouble> &Fwd,
2042  const Array<OneD, const NekDouble> &Bwd,
2043  Array<OneD, NekDouble> &outarray)
2044  {
2045  v_AddFwdBwdTraceIntegral(Fwd,Bwd,outarray);
2046  }
2047 
2049  Array<OneD,NekDouble> &Fwd,
2050  Array<OneD,NekDouble> &Bwd)
2051  {
2052  v_GetFwdBwdTracePhys(Fwd,Bwd);
2053  }
2054 
2056  const Array<OneD,const NekDouble> &field,
2057  Array<OneD,NekDouble> &Fwd,
2058  Array<OneD,NekDouble> &Bwd)
2059  {
2060  v_GetFwdBwdTracePhys(field,Fwd,Bwd);
2061  }
2062 
2063  inline const std::vector<bool> &ExpList::GetLeftAdjacentFaces(void) const
2064  {
2065  return v_GetLeftAdjacentFaces();
2066  }
2067 
2069  {
2070  v_ExtractTracePhys(outarray);
2071  }
2072 
2073 
2075  const Array<OneD, const NekDouble> &inarray,
2076  Array<OneD,NekDouble> &outarray)
2077  {
2078  v_ExtractTracePhys(inarray,outarray);
2079  }
2080 
2083  {
2084  return v_GetBndConditions();
2085  }
2086 
2087 
2090  {
2091  return v_UpdateBndConditions();
2092  }
2093 
2095  const NekDouble time,
2096  const std::string varName,
2097  const NekDouble x2_in,
2098  const NekDouble x3_in)
2099  {
2100  v_EvaluateBoundaryConditions(time, varName, x2_in, x3_in);
2101  }
2102 
2103  // Routines for continous matrix solution
2104  /**
2105  * This operation is equivalent to the evaluation of
2106  * \f$\underline{\boldsymbol{M}}^e\boldsymbol{\hat{u}}_l\f$, that is,
2107  * \f[ \left[
2108  * \begin{array}{cccc}
2109  * \boldsymbol{M}^1 & 0 & \hspace{3mm}0 \hspace{3mm}& 0 \\
2110  * 0 & \boldsymbol{M}^2 & 0 & 0 \\
2111  * 0 & 0 & \ddots & 0 \\
2112  * 0 & 0 & 0 & \boldsymbol{M}^{N_{\mathrm{el}}} \end{array} \right]
2113  *\left [ \begin{array}{c}
2114  * \boldsymbol{\hat{u}}^{1} \\
2115  * \boldsymbol{\hat{u}}^{2} \\
2116  * \vdots \\
2117  * \boldsymbol{\hat{u}}^{{{N_{\mathrm{el}}}}} \end{array} \right ]\f]
2118  * where \f$\boldsymbol{M}^e\f$ are the local matrices of type
2119  * specified by the key \a mkey. The decoupling of the local matrices
2120  * allows for a local evaluation of the operation. However, rather than
2121  * a local matrix-vector multiplication, the local operations are
2122  * evaluated as implemented in the function
2123  * StdRegions#StdExpansion#GeneralMatrixOp.
2124  *
2125  * @param mkey This key uniquely defines the type matrix
2126  * required for the operation.
2127  * @param inarray The vector \f$\boldsymbol{\hat{u}}_l\f$ of
2128  * size \f$N_{\mathrm{eof}}\f$.
2129  * @param outarray The resulting vector of size
2130  * \f$N_{\mathrm{eof}}\f$.
2131  */
2133  const GlobalMatrixKey &gkey,
2134  const Array<OneD,const NekDouble> &inarray,
2135  Array<OneD, NekDouble> &outarray,
2136  CoeffState coeffstate)
2137  {
2138  v_GeneralMatrixOp(gkey,inarray,outarray,coeffstate);
2139  }
2140 
2141 
2143  {
2145  }
2146 
2148  Array<OneD,int> &EdgeID)
2149  {
2150  v_GetBoundaryToElmtMap(ElmtID,EdgeID);
2151  }
2152 
2153  inline void ExpList::GetBndElmtExpansion(int i,
2154  boost::shared_ptr<ExpList> &result)
2155  {
2156  v_GetBndElmtExpansion(i, result);
2157  }
2158 
2160  Array<OneD, NekDouble> &elmt,
2161  Array<OneD, NekDouble> &boundary)
2162  {
2163  v_ExtractElmtToBndPhys(i, elmt, boundary);
2164  }
2165 
2167  const Array<OneD, const NekDouble> &phys,
2168  Array<OneD, NekDouble> &bndElmt)
2169  {
2170  v_ExtractPhysToBndElmt(i, phys, bndElmt);
2171  }
2172 
2173  inline void ExpList::GetBoundaryNormals(int i,
2174  Array<OneD, Array<OneD, NekDouble> > &normals)
2175  {
2176  v_GetBoundaryNormals(i, normals);
2177  }
2178 
2180 
2181  } //end of namespace
2182 } //end of namespace
2183 
2184 #endif // EXPLIST_H
2185 
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
Definition: ExpList.cpp:1809
virtual void v_GlobalToLocal(void)
Definition: ExpList.cpp:2543
virtual void v_AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2342
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:636
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:490
void AddTraceIntegral(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:2025
virtual void v_GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Definition: ExpList.cpp:2579
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
Definition: ExpList.cpp:814
void SetModifiedBasis(const bool modbasis)
Set Modified Basis for the stability analysis.
virtual void v_ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs)
Extract data from raw field data into expansion list.
Definition: ExpList.cpp:2158
virtual void v_GetBndElmtExpansion(int i, boost::shared_ptr< ExpList > &result)
Definition: ExpList.cpp:2660
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:1837
void SmoothField(Array< OneD, NekDouble > &field)
Smooth a field across elements.
Definition: ExpList.h:1604
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
int GetExpIndex(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0, bool returnNearestElmt=false)
Definition: ExpList.cpp:1264
virtual void v_Reset()
Reset geometry information, metrics, matrix managers and geometry information.
Definition: ExpList.cpp:1437
boost::shared_ptr< GlobalMatrix > GenGlobalMatrix(const GlobalMatrixKey &mkey, const boost::shared_ptr< AssemblyMapCG > &locToGloMap)
Generates a global matrix from the given key and map.
Definition: ExpList.cpp:897
virtual void v_SetHomo1DSpecVanVisc(Array< OneD, NekDouble > visc)
Definition: ExpList.h:1383
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
Definition: ExpList.cpp:2749
void GeneralMatrixOp_IterPerExp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:829
virtual const Array< OneD, const boost::shared_ptr< ExpList > > & v_GetBndCondExpansions(void)
Definition: ExpList.cpp:2261
boost::shared_ptr< Transposition > TranspositionSharedPtr
int GetCoeff_Offset(int n) const
Get the start offset position for a global list of m_coeffs correspoinding to element n...
Definition: ExpList.h:1929
ExpList()
The default constructor.
Definition: ExpList.cpp:95
Local coefficients.
static ExpListSharedPtr NullExpListSharedPtr
Definition: ExpList.h:1398
static Array< OneD, NekDouble > NullNekDouble1DArray
boost::unordered_map< int, int > m_elmtToExpId
Mapping from geometry ID of element to index inside m_exp.
Definition: ExpList.h:1011
void EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="", const NekDouble=NekConstants::kNekUnsetDouble, const NekDouble=NekConstants::kNekUnsetDouble)
Definition: ExpList.h:2094
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:1467
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1001
boost::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Definition: AssemblyMap.h:53
boost::shared_ptr< ExpList > & GetPlane(int n)
Definition: ExpList.h:887
boost::shared_ptr< BlockMatrixMap > BlockMatrixMapShPtr
A shared pointer to a BlockMatrixMap.
Definition: ExpList.h:97
LibUtilities::TranspositionSharedPtr GetTransposition(void)
This function returns the transposition class associaed with the homogeneous expansion.
Definition: ExpList.h:520
void MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Definition: ExpList.h:1634
virtual boost::shared_ptr< AssemblyMapDG > & v_GetTraceMap()
Definition: ExpList.cpp:2305
int GetPhys_Offset(int n) const
Get the start offset position for a global list of m_phys correspoinding to element n...
Definition: ExpList.h:1937
Array< OneD, NekDouble > & UpdateCoeffs()
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
Definition: ExpList.h:1956
virtual void v_FillBndCondFromField()
Definition: ExpList.cpp:2531
void ExtractFileBCs(const std::string &fileName, const std::string &varName, const boost::shared_ptr< ExpList > locExpList)
Definition: ExpList.cpp:1911
boost::shared_ptr< DNekMat > GenGlobalMatrixFull(const GlobalLinSysKey &mkey, const boost::shared_ptr< AssemblyMapCG > &locToGloMap)
Definition: ExpList.cpp:1034
NekDouble PhysIntegral(void)
This function integrates a function over the domain consisting of all the elements of the expansion...
Definition: ExpList.cpp:278
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:1503
void GetBndElmtExpansion(int i, boost::shared_ptr< ExpList > &result)
Definition: ExpList.h:2153
ExpansionType GetExpType(void)
Returns the type of the expansion.
Definition: ExpList.cpp:245
const Array< OneD, const int > & GetTraceBndMap(void)
Definition: ExpList.h:2014
boost::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
Definition: FieldIO.h:118
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Definition: ExpList.cpp:2564
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:1437
const boost::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition: ExpList.h:1920
std::vector< LibUtilities::FieldDefinitionsSharedPtr > GetFieldDefinitions()
Definition: ExpList.h:794
virtual void v_BwdTrans_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1231
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:1986
static BasisSharedPtr NullBasisSharedPtr
Definition: Basis.h:358
#define MULTI_REGIONS_EXPORT
boost::shared_ptr< ExpList > & UpdateBndCondExpansion(int i)
Definition: ExpList.h:1981
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Definition: ExpList.h:1612
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Definition: ExpList.cpp:2318
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:513
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:251
boost::shared_ptr< LibUtilities::SessionReader > GetSession()
Returns the session object.
Definition: ExpList.h:865
void ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Impose Dirichlet Boundary Conditions onto Array.
Definition: ExpList.h:1842
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition: ExpList.h:2147
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1003
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
void LinearAdvectionDiffusionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, CoeffState coeffstate=eLocal, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Solve Advection Diffusion Reaction.
Definition: ExpList.h:1660
virtual const std::vector< bool > & v_GetLeftAdjacentFaces(void) const
Definition: ExpList.cpp:2367
void LinearAdvectionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, CoeffState coeffstate=eLocal, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Solve Advection Diffusion Reaction.
Definition: ExpList.h:1672
void ApplyGeomInfo()
Apply geometry information to each expansion.
Definition: ExpList.cpp:1424
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
Definition: ExpList.cpp:1722
NekDouble Integral(const Array< OneD, const NekDouble > &inarray)
Definition: ExpList.h:490
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
Definition: ExpList.cpp:2468
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition(void)
Definition: ExpList.cpp:1861
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
void PhysDeriv(Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
Definition: ExpList.h:1717
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
virtual boost::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
Definition: ExpList.cpp:2269
boost::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:1194
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...
virtual void v_ExtractElmtToBndPhys(int i, Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
Definition: ExpList.cpp:2669
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:557
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:565
virtual void v_WriteTecplotHeader(std::ostream &outfile, std::string var="")
Definition: ExpList.cpp:1464
virtual NekDouble v_GetHomoLen(void)
Definition: ExpList.cpp:1869
void WriteVtkFooter(std::ostream &outfile)
Definition: ExpList.cpp:1716
boost::shared_ptr< GlobalOptParam > GlobalOptParamSharedPtr
Pointer to a GlobalOptParam object.
void SetCoeffs(int i, NekDouble val)
Set the i th coefficiient in m_coeffs to value val.
Definition: ExpList.h:1818
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
Definition: ExpList.cpp:2599
const Array< OneD, const boost::shared_ptr< ExpList > > & GetBndCondExpansions()
Definition: ExpList.h:1976
void WriteTecplotField(std::ostream &outfile, int expansion=-1)
Definition: ExpList.h:389
boost::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
Definition: ExpList.h:859
void 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.h:1986
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
Definition: ExpList.cpp:1853
virtual const Array< OneD, const int > & v_GetTraceBndMap()
Definition: ExpList.cpp:2313
virtual void v_WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var)
Definition: ExpList.cpp:1733
static std::vector< NekDouble > NullNekDoubleVector
Definition: FieldIO.h:49
void ExtractPhysToBndElmt(int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
Definition: ExpList.h:2166
virtual void v_ExtractPhysToBndElmt(int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
Definition: ExpList.cpp:2708
void GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
This function calculates the result of the multiplication of a matrix of type specified by mkey with ...
Definition: ExpList.h:2132
void NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
Definition: ExpList.h:1777
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
Definition: ExpList.cpp:2460
void GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Definition: ExpList.h:2019
void Reset()
Reset geometry information and reset matrices.
Definition: ExpList.h:371
boost::shared_ptr< LibUtilities::Comm > GetComm()
Returns the comm object.
Definition: ExpList.h:871
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
LibUtilities::BasisSharedPtr GetHomogeneousBasis(void)
Definition: ExpList.h:882
const NekOptimize::GlobalOptParamSharedPtr & GetGlobalOptParam(void)
Definition: ExpList.h:775
int GetNumElmts(void)
This function returns the number of elements in the expansion which may be different for a homogeoeno...
Definition: ExpList.h:572
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:101
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:53
boost::shared_ptr< ExpList > & GetTrace()
Definition: ExpList.h:2004
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:1687
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2523
virtual LibUtilities::BasisSharedPtr v_GetHomogeneousBasis(void)
Definition: ExpList.h:1375
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:2277
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:1770
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1456
void BwdTrans_IterPerExp(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:1623
virtual void v_FwdTrans_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:604
virtual ~ExpList()
The default destructor.
Definition: ExpList.cpp:258
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:383
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:226
boost::shared_ptr< GlobalLinSys > GenGlobalLinSys(const GlobalLinSysKey &mkey, const boost::shared_ptr< AssemblyMapCG > &locToGloMap)
This operation constructs the global linear system of type mkey.
Definition: ExpList.cpp:1175
void WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var="v")
Definition: ExpList.h:414
void AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:2040
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
void FillBndCondFromField(void)
Fill Bnd Condition expansion from the values stored in expansion.
Definition: ExpList.h:1848
void IProductWRTBase_IterPerExp(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:1573
NekDouble GetHomoLen(void)
This function returns the Width of homogeneous direction associaed with the homogeneous expansion...
Definition: ExpList.h:527
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Definition: ExpList.cpp:1839
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void)
Definition: ExpList.cpp:2094
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:965
virtual void v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:1597
static PeriodicMap NullPeriodicMap
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:917
void WriteTecplotConnectivity(std::ostream &outfile, int expansion=-1)
Definition: ExpList.h:395
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
Definition: ExpList.h:999
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
void ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:2068
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
static std::vector< unsigned int > NullUnsignedIntVector
Definition: FieldIO.h:51
virtual void v_HomogeneousFwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.cpp:2434
virtual void v_LocalToGlobal(void)
Definition: ExpList.cpp:2537
void SetWaveSpace(const bool wavespace)
Sets the wave space to the one of the possible configuration true or false.
Definition: ExpList.h:1497
void SetHomo1DSpecVanVisc(Array< OneD, NekDouble > visc)
This function sets the Spectral Vanishing Viscosity in homogeneous1D expansion.
Definition: ExpList.h:504
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:913
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:2833
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
SpatialDomains::MeshGraphSharedPtr GetGraph()
Definition: ExpList.h:876
double NekDouble
void WriteTecplotHeader(std::ostream &outfile, std::string var="")
Definition: ExpList.h:376
const DNekScalBlkMatSharedPtr GenBlockMatrix(const GlobalMatrixKey &gkey)
This function assembles the block diagonal matrix of local matrices of the type mtype.
Definition: ExpList.cpp:678
boost::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
Defines a list of flags.
std::map< int, BoundaryConditionMapShPtr > BoundaryConditionCollection
Definition: Conditions.h:215
void HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const FlagList &flags, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff=StdRegions::NullVarCoeffMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Solve helmholtz problem.
Definition: ExpList.h:1645
void FwdTrans_IterPerExp(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:1594
void GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces=NullPeriodicMap)
Definition: ExpList.h:785
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
Definition: ExpList.cpp:2823
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
virtual void v_ClearGlobalLinSysManager(void)
Definition: ExpList.cpp:1905
static const NekDouble kNekUnsetDouble
Describe a linear system.
void FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:614
virtual boost::shared_ptr< ExpList > & v_GetTrace()
Definition: ExpList.cpp:2297
void HomogeneousFwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.h:1728
virtual void v_DealiasedProd(const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Definition: ExpList.cpp:2454
virtual void v_ExtractCoeffsToCoeffs(const boost::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Definition: ExpList.cpp:2238
virtual boost::shared_ptr< ExpList > & v_GetPlane(int n)
Definition: ExpList.cpp:2878
Describes a matrix with ordering defined by a local to global map.
const std::vector< bool > & GetLeftAdjacentFaces(void) const
Definition: ExpList.h:2063
static ExpList NullExpList
An empty ExpList object.
Definition: ExpList.h:1397
void LocalToGlobal(void)
Put the coefficients into global ordering using m_coeffs.
Definition: ExpList.h:1853
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
Definition: ExpList.h:780
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:1890
int GetNpoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1488
Array< OneD, SpatialDomains::BoundaryConditionShPtr > & UpdateBndConditions()
Definition: ExpList.h:2089
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
Definition: ExpList.cpp:2855
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1894
void GlobalEigenSystem(const boost::shared_ptr< DNekMat > &Gmat, Array< OneD, NekDouble > &EigValsReal, Array< OneD, NekDouble > &EigValsImag, Array< OneD, NekDouble > &EigVecs=NullNekDouble1DArray)
Array< OneD, NekDouble > & UpdatePhys()
This function returns (a reference to) the array (implemented as m_phys) containing the function ev...
Definition: ExpList.h:1967
MultiRegions::Direction const DirCartesianMap[]
Definition: ExpList.h:86
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:907
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2325
void GetFieldDefinitions(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef)
Definition: ExpList.h:800
void ExtractCoeffsToCoeffs(const boost::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:2145
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:497
virtual void v_LinearAdvectionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, CoeffState coeffstate=eLocal, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Definition: ExpList.cpp:2422
virtual Array< OneD, const unsigned int > v_GetZIDs(void)
Definition: ExpList.cpp:1877
void ExtractElmtToBndPhys(int i, Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
Definition: ExpList.h:2159
std::map< GlobalMatrixKey, DNekScalBlkMatSharedPtr > BlockMatrixMap
A map between global matrix keys and their associated block matrices.
Definition: ExpList.h:95
void DealiasedProd(const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Definition: ExpList.h:1754
bool GetPhysState(void) const
This function indicates whether the array of physical values (implemented as m_phys) is filled or no...
Definition: ExpList.h:1554
static const Array< OneD, ExpListSharedPtr > NullExpListSharedPtrArray
Definition: ExpList.h:2179
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Definition: ExpList.h:1583
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo(void)
Definition: ExpList.cpp:2845
static Array< OneD, BasisSharedPtr > NullBasisSharedPtr1DArray
Definition: Basis.h:359
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:240
NekDouble GetCoeff(int i)
Get the i th value (coefficient) of m_coeffs.
Definition: ExpList.h:1868
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:1967
void SetCoeff(int i, NekDouble val)
Set the i th coefficiient in m_coeffs to value val.
Definition: ExpList.h:1808
int GetOffset_Elmt_Id(int n) const
Get the element id associated with the n th consecutive block of data in m_phys and m_coeffs...
Definition: ExpList.h:1945
virtual void v_IProductWRTBase_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:356
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:536
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Definition: ExpList.h:1562
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:1545
void WriteVtkPieceFooter(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:1727
void AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
Append the element data listed in elements fielddef->m_ElementIDs onto fielddata. ...
Definition: ExpList.h:809
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
Definition: ExpList.h:1406
virtual void v_LinearAdvectionDiffusionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, CoeffState coeffstate=eLocal, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Definition: ExpList.cpp:2410
virtual void v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const FlagList &flags, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const Array< OneD, const NekDouble > &dirForcing)
Definition: ExpList.cpp:2399
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:985
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
Definition: ExpList.cpp:2108
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
Definition: ExpList.cpp:2864
boost::shared_ptr< AssemblyMapDG > & GetTraceMap(void)
Definition: ExpList.h:2009
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:2956
const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & GetBndConditions()
Definition: ExpList.h:2082
void WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip=0)
Definition: ExpList.h:404
void MultiplyByBlockMatrix(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:326
void SetCoeffsArray(Array< OneD, NekDouble > &inarray)
Set the m_coeffs array to inarray.
Definition: ExpList.h:1824
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Definition: ExpList.cpp:2390
int EvalBasisNumModesMax(void) const
Evaulates the maximum number of modes in the elemental basis order over all elements.
Definition: ExpList.h:1420
void GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
Definition: ExpList.h:2173
bool GetWaveSpace(void) const
This function returns the third direction expansion condition, which can be in wave space (coefficien...
Definition: ExpList.h:1505
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:545
virtual void v_GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition: ExpList.cpp:2794
virtual Array< OneD, const unsigned int > v_GetYIDs(void)
Definition: ExpList.cpp:1885
virtual void v_SetUpPhysNormals()
Definition: ExpList.cpp:2652
void GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
Definition: ExpList.h:1766
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:1797
boost::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:208
boost::shared_ptr< Basis > BasisSharedPtr
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:819
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
Definition: ExpList.cpp:2812
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
void SetPhysArray(Array< OneD, NekDouble > &inarray)
Sets the array m_phys.
Definition: ExpList.h:1536
void WriteTecplotZone(std::ostream &outfile, int expansion=-1)
Definition: ExpList.h:382
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:982
void WriteVtkHeader(std::ostream &outfile)
Definition: ExpList.cpp:1708
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2376
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1900
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:442
void GlobalToLocal(void)
Put the coefficients into local ordering and place in m_coeffs.
Definition: ExpList.h:1858
NekDouble L2(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
This function calculates the error with respect to soln of the global spectral/hp element approximat...
Definition: ExpList.h:477
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1047
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Definition: ExpList.cpp:2550
void GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.h:2048
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:2351
void ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs)
Extract the data in fielddata into the coeffs.
Definition: ExpList.cpp:2136
void HomogeneousBwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.h:1741
void SetPhys(int i, NekDouble val)
Set the i th value of m_phys to value val.
Definition: ExpList.h:1511
virtual void v_WriteTecplotField(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:1674
virtual int v_GetNumElmts(void)
Definition: ExpList.h:1059
Collections::CollectionVector m_collections
Definition: ExpList.h:979
virtual void v_ReadGlobalOptimizationParameters()
Definition: ExpList.cpp:2803
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:227
virtual void v_HomogeneousBwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.cpp:2444
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Definition: ExpList.cpp:2557