Nektar++
Loading...
Searching...
No Matches
ExpList.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: ExpList.h
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Expansion list top class definition
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_LIBS_MULTIREGIONS_EXPLIST_H
36#define NEKTAR_LIBS_MULTIREGIONS_EXPLIST_H
37
52#include <tinyxml.h>
53
55{
56
57// Forward declarations
58class ExpList;
59class GlobalLinSys;
60class AssemblyMapDG;
61class AssemblyMapCG;
62class InterfaceMapDG;
63class GlobalLinSysKey;
64class GlobalMatrix;
65class GJPStabilisation;
66
68{
72};
73
85
87
88/// A map between global matrix keys and their associated block
89/// matrices.
90typedef std::map<GlobalMatrixKey, DNekScalBlkMatSharedPtr> BlockMatrixMap;
91/// A shared pointer to a BlockMatrixMap.
92typedef std::shared_ptr<BlockMatrixMap> BlockMatrixMapShPtr;
93/// Shared pointer to an ExpList object.
94typedef std::shared_ptr<ExpList> ExpListSharedPtr;
95
96/// Base class for all multi-elemental spectral/hp expansions.
97class ExpList : public std::enable_shared_from_this<ExpList>
98{
99public:
100 /// The default constructor using a type
102
103 /// The copy constructor.
105 const bool DeclareCoeffPhysArrays = true);
106
107 /// Constructor copying only elements defined in eIds.
109 const std::vector<unsigned int> &eIDs,
110 const bool DeclareCoeffPhysArrays = true,
111 const Collections::ImplementationType ImpType =
113
114 /// Generate an ExpList from a meshgraph \a graph and session file
118 const bool DeclareCoeffPhysArrays = true,
119 const std::string &var = "DefaultVar",
120 const Collections::ImplementationType ImpType =
122
123 /// Sets up a list of local expansions based on an expansion Map
126 const SpatialDomains::ExpansionInfoMap &expansions,
127 const bool DeclareCoeffPhysArrays = true,
128 const Collections::ImplementationType ImpType =
130
131 //---------------------------------------------------------
132 // Specialised constructors in ExpListConstructor.cpp
133 //---------------------------------------------------------
134 /// Specialised constructors for 0D Expansions
135 /// Wrapper around LocalRegion::PointExp - used in PrePacing.cpp
137
138 /// Generate expansions for the trace space expansions used in
139 /// DisContField.
142 const Array<OneD, const ExpListSharedPtr> &bndConstraint,
144 &bndCond,
145 const LocalRegions::ExpansionVector &locexp,
147 const LibUtilities::CommSharedPtr &comm,
148 const bool DeclareCoeffPhysArrays = true,
149 const std::string variable = "DefaultVar",
150 const Collections::ImplementationType ImpType =
152
153 /// Generate an trace ExpList from a meshgraph \a graph and session file
156 const LocalRegions::ExpansionVector &locexp,
158 const bool DeclareCoeffPhysArrays, const std::string variable,
159 const Collections::ImplementationType ImpType =
161
162 /// Constructor based on domain information only for 1D &
163 /// 2D boundary conditions
166 const SpatialDomains::CompositeMap &domain,
168 const bool DeclareCoeffPhysArrays = true,
169 const std::string variable = "DefaultVar",
170 bool SetToOneSpaceDimension = false,
172 const Collections::ImplementationType ImpType =
174
175 /// The default destructor.
177
178 /// Returns the total number of local degrees of freedom
179 /// \f$N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_m\f$.
180 inline int GetNcoeffs(void) const;
181
182 /// Returns the total number of local degrees of freedom
183 /// for element eid
184 MULTI_REGIONS_EXPORT int GetNcoeffs(const int eid) const;
185
186 /// Returns the type of the expansion
188
189 /// Returns the type of the expansion
191
192 /// Evaulates the maximum number of modes in the elemental basis
193 /// order over all elements
194 inline int EvalBasisNumModesMax(void) const;
195
196 /// Returns the vector of the number of modes in the elemental
197 /// basis order over all elements.
199 void) const;
200
201 /// Returns the total number of quadrature points #m_npoints
202 /// \f$=Q_{\mathrm{tot}}\f$.
203 inline int GetTotPoints(void) const;
204
205 /// Returns the total number of quadrature points for eid's element
206 /// \f$=Q_{\mathrm{tot}}\f$.
207 inline int GetTotPoints(const int eid) const;
208
209 /// Returns the total number of quadrature points #m_npoints
210 /// \f$=Q_{\mathrm{tot}}\f$.
211 inline int GetNpoints(void) const;
212
213 /// Returns the total number of qudature points scaled by
214 /// the factor scale on each 1D direction
215 inline int Get1DScaledTotPoints(const NekDouble scale) const;
216
217 /// Sets the wave space to the one of the possible configuration
218 /// true or false
219 inline void SetWaveSpace(const bool wavespace);
220
221 /// Set Modified Basis for the stability analysis
222 inline void SetModifiedBasis(const bool modbasis);
223
224 /// This function returns the third direction expansion condition,
225 /// which can be in wave space (coefficient) or not
226 /// It is stored in the variable m_WaveSpace.
227 inline bool GetWaveSpace(void) const;
228
229 /// Set the \a i th value of \a m_phys to value \a val
230 inline void SetPhys(int i, NekDouble val);
231 /// Fills the array #m_phys
232 inline void SetPhys(const Array<OneD, const NekDouble> &inarray);
233 /// Sets the array #m_phys
234 inline void SetPhysArray(Array<OneD, NekDouble> &inarray);
235 /// This function manually sets whether the array of physical
236 /// values \f$\boldsymbol{u}_l\f$ (implemented as #m_phys) is
237 /// filled or not.
238 inline void SetPhysState(const bool physState);
239 /// This function indicates whether the array of physical values
240 /// \f$\boldsymbol{u}_l\f$ (implemented as #m_phys) is filled or
241 /// not.
242 inline bool GetPhysState(void) const;
243
244 /// multiply the metric jacobi and quadrature weights
246 const Array<OneD, const NekDouble> &inarray,
247 Array<OneD, NekDouble> &outarray);
248 /// Divided by the metric jacobi and quadrature weights
250 const Array<OneD, const NekDouble> &inarray,
251 Array<OneD, NekDouble> &outarray);
252 /// This function calculates the inner product of a function
253 /// \f$f(\boldsymbol{x})\f$ with respect to all \em local
254 /// expansion modes \f$\phi_n^e(\boldsymbol{x})\f$.
255 inline void IProductWRTBase(const Array<OneD, const NekDouble> &inarray,
256 Array<OneD, NekDouble> &outarray);
257 /// This function calculates the inner product of a function
258 /// \f$f(\boldsymbol{x})\f$ with respect to the derivative (in
259 /// direction \param dir) of all \em local expansion modes
260 /// \f$\phi_n^e(\boldsymbol{x})\f$.
262 const int dir, const Array<OneD, const NekDouble> &inarray,
263 Array<OneD, NekDouble> &outarray);
264
266 const Array<OneD, const NekDouble> &direction,
267 const Array<OneD, const NekDouble> &inarray,
268 Array<OneD, NekDouble> &outarray);
269
270 /// This function calculates the inner product of a
271 /// function \f$f(\boldsymbol{x})\f$ with respect to the
272 /// derivative of all \em local expansion modes
273 /// \f$\phi_n^e(\boldsymbol{x})\f$.
275 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
276 Array<OneD, NekDouble> &outarray);
277 /// This function elementally evaluates the forward transformation
278 /// of a function \f$u(\boldsymbol{x})\f$ onto the global
279 /// spectral/hp expansion.
280 inline void FwdTransLocalElmt(const Array<OneD, const NekDouble> &inarray,
281 Array<OneD, NekDouble> &outarray);
282 ///
283 inline void FwdTrans(const Array<OneD, const NekDouble> &inarray,
284 Array<OneD, NekDouble> &outarray);
286 const NekDouble alpha,
287 const NekDouble exponent,
288 const NekDouble cutoff);
289 /// This function elementally mulplies the coefficient space of
290 /// Sin my the elemental inverse of the mass matrix.
292 const Array<OneD, const NekDouble> &inarray,
293 Array<OneD, NekDouble> &outarray);
294 inline void MultiplyByInvMassMatrix(
295 const Array<OneD, const NekDouble> &inarray,
296 Array<OneD, NekDouble> &outarray);
298 const Array<OneD, const NekDouble> &inarray,
299 Array<OneD, NekDouble> &outarray)
300 {
302 BwdTrans(inarray, tmp);
303 IProductWRTBase(tmp, outarray);
304 }
305 /// Smooth a field across elements
306 inline void SmoothField(Array<OneD, NekDouble> &field);
307
308 /// Solve helmholtz problem
310 const Array<OneD, const NekDouble> &inarray,
311 Array<OneD, NekDouble> &outarray,
312 const StdRegions::ConstFactorMap &factors,
314 const StdRegions::VarFactorsMap &varfactors =
317 const bool PhysSpaceForcing = true);
318
319 /// Solve Advection Diffusion Reaction
321 const Array<OneD, const NekDouble> &inarray,
322 Array<OneD, NekDouble> &outarray,
323 const StdRegions::ConstFactorMap &factors,
325 const StdRegions::VarFactorsMap &varfactors =
328 const bool PhysSpaceForcing = true);
329
330 /// Solve Advection Diffusion Reaction
332 const Array<OneD, const NekDouble> &inarray,
333 Array<OneD, NekDouble> &outarray,
334 const StdRegions::ConstFactorMap &factors,
336 const StdRegions::VarFactorsMap &varfactors =
339 const bool PhysSpaceForcing = true);
340 ///
342 const Array<OneD, const NekDouble> &inarray,
343 Array<OneD, NekDouble> &outarray);
344 /// This function elementally evaluates the backward transformation
345 /// of the global spectral/hp element expansion.
346 inline void BwdTrans(const Array<OneD, const NekDouble> &inarray,
347 Array<OneD, NekDouble> &outarray);
348 /// This function calculates the coordinates of all the elemental
349 /// quadrature points \f$\boldsymbol{x}_i\f$.
350 inline void GetCoords(
351 Array<OneD, NekDouble> &coord_0,
354
355 inline void GetCoords(
356 const int eid, Array<OneD, NekDouble> &coord_0,
359
360 // Homogeneous transforms
361 inline void HomogeneousFwdTrans(const int npts,
362 const Array<OneD, const NekDouble> &inarray,
363 Array<OneD, NekDouble> &outarray,
364 bool Shuff = true, bool UnShuff = true);
365 inline void HomogeneousBwdTrans(const int npts,
366 const Array<OneD, const NekDouble> &inarray,
367 Array<OneD, NekDouble> &outarray,
368 bool Shuff = true, bool UnShuff = true);
369 inline void DealiasedProd(const int num_dofs,
370 const Array<OneD, NekDouble> &inarray1,
371 const Array<OneD, NekDouble> &inarray2,
372 Array<OneD, NekDouble> &outarray);
373 inline void DealiasedDotProd(
374 const int num_dofs, const Array<OneD, Array<OneD, NekDouble>> &inarray1,
375 const Array<OneD, Array<OneD, NekDouble>> &inarray2,
376 Array<OneD, Array<OneD, NekDouble>> &outarray);
377 inline void GetBCValues(Array<OneD, NekDouble> &BndVals,
378 const Array<OneD, NekDouble> &TotField, int BndID);
381 Array<OneD, NekDouble> &outarray,
382 int BndID);
383 inline void NormVectorIProductWRTBase(
385 Array<OneD, NekDouble> &outarray);
386 /// Apply geometry information to each expansion.
388 /// Reset geometry information and reset matrices
390 {
391 v_Reset();
392 }
393
394 /// Reset matrices
396
397 // not sure we really need these in ExpList
398 void WriteTecplotHeader(std::ostream &outfile, std::string var = "")
399 {
400 v_WriteTecplotHeader(outfile, var);
401 }
402 void WriteTecplotZone(std::ostream &outfile, int expansion = -1)
403 {
404 v_WriteTecplotZone(outfile, expansion);
405 }
406 void WriteTecplotField(std::ostream &outfile, int expansion = -1)
407 {
408 v_WriteTecplotField(outfile, expansion);
409 }
410 void WriteTecplotConnectivity(std::ostream &outfile, int expansion = -1)
411 {
412 v_WriteTecplotConnectivity(outfile, expansion);
413 }
414 MULTI_REGIONS_EXPORT void WriteVtkHeader(std::ostream &outfile);
415 MULTI_REGIONS_EXPORT void WriteVtkFooter(std::ostream &outfile);
416 void WriteVtkPieceHeader(std::ostream &outfile, int expansion,
417 int istrip = 0)
418 {
419 v_WriteVtkPieceHeader(outfile, expansion, istrip);
420 }
421 MULTI_REGIONS_EXPORT void WriteVtkPieceFooter(std::ostream &outfile,
422 int expansion);
423 void WriteVtkPieceData(std::ostream &outfile, int expansion,
424 std::string var = "v")
425 {
426 v_WriteVtkPieceData(outfile, expansion, var);
427 }
428
429 /// This function returns the dimension of the coordinates of the
430 /// element \a eid.
431 // inline
432 MULTI_REGIONS_EXPORT int GetCoordim(int eid);
433
434 /// Set the \a i th coefficiient in \a m_coeffs to value \a val
435 inline void SetCoeff(int i, NekDouble val);
436 /// Set the \a i th coefficiient in #m_coeffs to value \a val
437 inline void SetCoeffs(int i, NekDouble val);
438 /// Set the #m_coeffs array to inarray
439 inline void SetCoeffsArray(Array<OneD, NekDouble> &inarray);
440 /// This function returns the dimension of the shape of the
441 /// element \a eid.
442 // inline
444 /// This function returns (a reference to) the array
445 /// \f$\boldsymbol{\hat{u}}_l\f$ (implemented as #m_coeffs)
446 /// containing all local expansion coefficients.
447 inline const Array<OneD, const NekDouble> &GetCoeffs() const;
448 /// Impose Dirichlet Boundary Conditions onto Array
450 /// Add Neumann Boundary Condition forcing to Array
451 inline void ImposeNeumannConditions(Array<OneD, NekDouble> &outarray);
452 /// Add Robin Boundary Condition forcing to Array
453 inline void ImposeRobinConditions(Array<OneD, NekDouble> &outarray);
454 /// Fill Bnd Condition expansion from the values stored in expansion
455 inline void FillBndCondFromField(const Array<OneD, NekDouble> coeffs);
456 /// Fill Bnd Condition expansion in nreg from the values
457 /// stored in expansion
458 inline void FillBndCondFromField(const int nreg,
459 const Array<OneD, NekDouble> coeffs);
460 /// Assemble the average global coefficients \f$\boldsymbol{\hat{u}}_g\f$
461 /// from the local coefficients \f$\boldsymbol{\hat{u}}_l\f$ .
462 // inline
463 MULTI_REGIONS_EXPORT inline void AvgAssemble(bool useComm = true);
465 const Array<OneD, const NekDouble> &inarray,
466 Array<OneD, NekDouble> &outarray, bool useComm = true);
467 /// Gathers the global coefficients \f$\boldsymbol{\hat{u}}_g\f$
468 /// from the local coefficients \f$\boldsymbol{\hat{u}}_l\f$.
469 // inline
470 MULTI_REGIONS_EXPORT inline void LocalToGlobal(bool useComm = true);
472 const Array<OneD, const NekDouble> &inarray,
473 Array<OneD, NekDouble> &outarray, bool useComm = true);
474 /// Scatters from the global coefficients
475 /// \f$\boldsymbol{\hat{u}}_g\f$ to the local coefficients
476 /// \f$\boldsymbol{\hat{u}}_l\f$.
477 // inline
478 MULTI_REGIONS_EXPORT inline void GlobalToLocal(void);
479 /**
480 * This operation is evaluated as:
481 * \f{tabbing}
482 * \hspace{1cm} \= Do \= $e=$ $1, N_{\mathrm{el}}$ \\
483 * > > Do \= $i=$ $0,N_m^e-1$ \\
484 * > > > $\boldsymbol{\hat{u}}^{e}[i] = \mbox{sign}[e][i] \cdot
485 * \boldsymbol{\hat{u}}_g[\mbox{map}[e][i]]$ \\
486 * > > continue \\
487 * > continue
488 * \f}
489 * where \a map\f$[e][i]\f$ is the mapping array and \a
490 * sign\f$[e][i]\f$ is an array of similar dimensions ensuring the
491 * correct modal connectivity between the different elements (both
492 * these arrays are contained in the data member #m_locToGloMap). This
493 * operation is equivalent to the scatter operation
494 * \f$\boldsymbol{\hat{u}}_l=\mathcal{A}\boldsymbol{\hat{u}}_g\f$,
495 * where \f$\mathcal{A}\f$ is the
496 * \f$N_{\mathrm{eof}}\times N_{\mathrm{dof}}\f$ permutation matrix.
497 *
498 * @param inarray An array of size \f$N_\mathrm{dof}\f$
499 * containing the global degrees of freedom
500 * \f$\boldsymbol{x}_g\f$.
501 * @param outarray The resulting local degrees of freedom
502 * \f$\boldsymbol{x}_l\f$ will be stored in this
503 * array of size \f$N_\mathrm{eof}\f$.
504 */
506 const Array<OneD, const NekDouble> &inarray,
507 Array<OneD, NekDouble> &outarray);
508 /// Get the \a i th value (coefficient) of #m_coeffs
509 inline NekDouble GetCoeff(int i);
510 /// Get the \a i th value (coefficient) of #m_coeffs
511 inline NekDouble GetCoeffs(int i);
512 /// This function returns (a reference to) the array
513 /// \f$\boldsymbol{u}_l\f$ (implemented as #m_phys) containing the
514 /// function \f$u^{\delta}(\boldsymbol{x})\f$ evaluated at the
515 /// quadrature points.
516 // inline
518 /// This function calculates the \f$L_\infty\f$ error of the global
519 /// spectral/hp element approximation.
523 /// This function calculates the \f$L_\infty\f$ error of the global
524 /// This function calculates the \f$L_2\f$ error with
525 /// respect to soln of the global
526 /// spectral/hp element approximation.
528 const Array<OneD, const NekDouble> &inarray,
530 {
531 return v_L2(inarray, soln);
532 }
533 /// Calculates the \f$H^1\f$ error of the global spectral/hp
534 /// element approximation.
538 /// Calculates the \f$H^1\f$ error of the global spectral/hp
539 /// element approximation.
540 /**
541 * The integration is evaluated locally, that is
542 * \f[\int
543 * f(\boldsymbol{x})d\boldsymbol{x}=\sum_{e=1}^{{N_{\mathrm{el}}}}
544 * \left\{\int_{\Omega_e}f(\boldsymbol{x})d\boldsymbol{x}\right\}, \f]
545 * where the integration over the separate elements is done by the
546 * function StdRegions#StdExpansion#Integral, which discretely
547 * evaluates the integral using Gaussian quadrature.
548 *
549 * Note that the array #m_phys should be filled with the values of the
550 * function \f$f(\boldsymbol{x})\f$ at the quadrature points
551 * \f$\boldsymbol{x}_i\f$.
552 *
553 * @return The value of the discretely evaluated integral
554 * \f$\int f(\boldsymbol{x})d\boldsymbol{x}\f$.
555 */
557 {
558 ASSERTL1(m_physState == true, "local physical space is not true ");
559 return Integral(m_phys);
560 }
561 /**
562 * The integration is evaluated locally, that is
563 * \f[\int
564 * f(\boldsymbol{x})d\boldsymbol{x}=\sum_{e=1}^{{N_{\mathrm{el}}}}
565 * \left\{\int_{\Omega_e}f(\boldsymbol{x})d\boldsymbol{x}\right\}, \f]
566 * where the integration over the separate elements is done by the
567 * function StdRegions#StdExpansion#Integral, which discretely
568 * evaluates the integral using Gaussian quadrature.
569 *
570 * @param inarray An array of size \f$Q_{\mathrm{tot}}\f$
571 * containing the values of the function
572 * \f$f(\boldsymbol{x})\f$ at the quadrature
573 * points \f$\boldsymbol{x}_i\f$.
574 * @return The value of the discretely evaluated integral
575 * \f$\int f(\boldsymbol{x})d\boldsymbol{x}\f$.
576 */
578 {
579 return v_Integral(inarray);
580 }
582 {
583 return v_VectorFlux(inarray);
584 }
585 /// This function calculates the energy associated with
586 /// each one of the modesof a 3D homogeneous nD expansion
591
592 /// This function sets the Spectral Vanishing Viscosity
593 /// in homogeneous1D expansion.
598
599 /// This function returns a vector containing the wave
600 /// numbers in z-direction associated
601 /// with the 3D homogenous expansion. Required if a
602 /// parellelisation is applied in the Fourier direction
604 {
605 return v_GetZIDs();
606 }
607
608 /// This function returns the transposition class
609 /// associated with the homogeneous expansion.
614
615 /// This function returns the Width of homogeneous direction
616 /// associated with the homogeneous expansion.
618 {
619 return v_GetHomoLen();
620 }
621
622 /// This function sets the Width of homogeneous direction
623 /// associated with the homogeneous expansion.
624 void SetHomoLen(const NekDouble lhom)
625 {
626 return v_SetHomoLen(lhom);
627 }
628
629 /// This function returns a vector containing the wave
630 /// numbers in y-direction associated
631 /// with the 3D homogenous expansion. Required if a
632 /// parellelisation is applied in the Fourier direction
634 {
635 return v_GetYIDs();
636 }
637
638 /// This function interpolates the physical space points in
639 /// \a inarray to \a outarray using the same points defined in the
640 /// expansion but where the number of points are rescaled
641 /// by \a 1DScale
643 const Array<OneD, NekDouble> &inarray,
644 Array<OneD, NekDouble> &outarray)
645 {
646 v_PhysInterp1DScaled(scale, inarray, outarray);
647 }
648
649 /// This function Galerkin projects the physical space points in
650 /// \a inarray to \a outarray where inarray is assumed to
651 /// be defined in the expansion but where the number of
652 /// points are rescaled by \a 1DScale
654 const Array<OneD, NekDouble> &inarray,
655 Array<OneD, NekDouble> &outarray)
656 {
657 v_PhysGalerkinProjection1DScaled(scale, inarray, outarray);
658 }
659
660 /// This function returns the number of elements in the expansion.
661 inline int GetExpSize(void);
662
663 /// This function returns the number of elements in the
664 /// expansion which may be different for a homogeoenous extended
665 /// expansionp.
666 inline size_t GetNumElmts(void)
667 {
668 return v_GetNumElmts();
669 }
670
671 /// This function returns the vector of elements in the expansion.
672 inline const std::shared_ptr<LocalRegions::ExpansionVector> GetExp() const;
673
674 /// This function returns (a shared pointer to) the local elemental
675 /// expansion of the \f$n^{\mathrm{th}}\f$ element.
676 inline LocalRegions::ExpansionSharedPtr &GetExp(int n) const;
677
678 /// This function returns (a shared pointer to) the local elemental
679 /// expansion of the \f$n^{\mathrm{th}}\f$ element given a global
680 /// geometry ID.
682
683 /// This function returns (a shared pointer to) the local elemental
684 /// expansion containing the arbitrary point given by \a gloCoord.
686 const Array<OneD, const NekDouble> &gloCoord);
687
688 /**
689 * @brief This function returns the index of the local elemental
690 * expansion containing the arbitrary point given by \a gloCoord,
691 * within a distance tolerance of tol.
692 *
693 * If returnNearestElmt is true and no element contains the point,
694 * this function returns the nearest element whose bounding box contains
695 * the point. The bounding box has a 10% margin in each direction.
696 *
697 * @param gloCoord (input) coordinate in physics space
698 * @param locCoords (output) local coordinate xi in the returned element
699 * @param tol distance tolerance to judge if a point lies in an
700 * element
701 * @param returnNearestElmt if true and no element contains this point, the
702 * nearest element whose bounding box contains this
703 * point is returned
704 * @param cachedId an initial guess of the most possible element index
705 * @param maxDistance if returnNearestElmt is set as true, the nearest
706 * element will be returned. But the distance of the
707 * nearest element and this point should be <=
708 * maxDistance.
709 *
710 * @return element index; if no element is found, -1 is returned.
711 */
713 const Array<OneD, const NekDouble> &gloCoord, NekDouble tol = 0.0,
714 bool returnNearestElmt = false, int cachedId = -1,
715 NekDouble maxDistance = 1e6);
716
717 /** This function returns the index and the Local
718 * Cartesian Coordinates \a locCoords of the local
719 * elemental expansion containing the arbitrary point
720 * given by \a gloCoords.
721 **/
723 const Array<OneD, const NekDouble> &gloCoords,
724 Array<OneD, NekDouble> &locCoords, NekDouble tol = 0.0,
725 bool returnNearestElmt = false, int cachedId = -1,
726 NekDouble maxDistance = 1e6);
727
728 /** This function return the expansion field value
729 * at the coordinates given as input.
730 **/
733 const Array<OneD, const NekDouble> &phys);
734
735 /// Get the start offset position for a local contiguous list of
736 /// coeffs correspoinding to element n.
737 inline int GetCoeff_Offset(int n) const;
738
739 /// Get the start offset position for a local contiguous list of
740 /// quadrature points in a full array correspoinding to element n.
741 inline int GetPhys_Offset(int n) const;
742
743 /// This function returns (a reference to) the array
744 /// \f$\boldsymbol{\hat{u}}_l\f$ (implemented as #m_coeffs)
745 /// containing all local expansion coefficients.
747 /// This function returns (a reference to) the array
748 /// \f$\boldsymbol{u}_l\f$ (implemented as #m_phys) containing the
749 /// function \f$u^{\delta}(\boldsymbol{x})\f$ evaluated at the
750 /// quadrature points.
752 inline void PhysDeriv(Direction edir,
753 const Array<OneD, const NekDouble> &inarray,
755 /// This function discretely evaluates the derivative of a function
756 /// \f$f(\boldsymbol{x})\f$ on the domain consisting of all
757 /// elements of the expansion.
758 inline void PhysDeriv(
759 const Array<OneD, const NekDouble> &inarray,
763 inline void PhysDeriv(const int dir,
764 const Array<OneD, const NekDouble> &inarray,
766 inline void CurlCurl(Array<OneD, Array<OneD, NekDouble>> &Vel,
768 inline void PhysDirectionalDeriv(
769 const Array<OneD, const NekDouble> &direction,
770 const Array<OneD, const NekDouble> &inarray,
771 Array<OneD, NekDouble> &outarray);
772 inline void GetMovingFrames(const SpatialDomains::GeomMMF MMFdir,
773 const Array<OneD, const NekDouble> &CircCentre,
774 Array<OneD, Array<OneD, NekDouble>> &outarray);
775 // functions associated with DisContField
778 /// Get the weight value for boundary conditions
780 /// Set the weight value for boundary conditions
781 inline void SetBndCondBwdWeight(const int index, const NekDouble value);
782 inline std::shared_ptr<ExpList> &UpdateBndCondExpansion(int i);
783 inline void Upwind(const Array<OneD, const NekDouble> &Vn,
787 inline void Upwind(const Array<OneD, const Array<OneD, NekDouble>> &Vec,
791 /**
792 * Return a reference to the trace space associated with this
793 * expansion list.
794 */
795 inline std::shared_ptr<ExpList> &GetTrace();
796 inline std::shared_ptr<AssemblyMapDG> &GetTraceMap(void);
797 inline std::shared_ptr<InterfaceMapDG> &GetInterfaceMap(void);
798 inline const Array<OneD, const int> &GetTraceBndMap(void);
799 inline void GetNormals(Array<OneD, Array<OneD, NekDouble>> &normals);
800 /// Get the length of elements in boundary normal direction
802 Array<OneD, NekDouble> &lengthsFwd, Array<OneD, NekDouble> &lengthsBwd);
803 /// Get the weight value for boundary conditions
804 /// for boundary average and jump calculations
806 Array<OneD, NekDouble> &weightJump);
808 Array<OneD, NekDouble> &outarray);
811 Array<OneD, NekDouble> &outarray);
814 inline void GetFwdBwdTracePhys(const Array<OneD, const NekDouble> &field,
817 bool FillBnd = true,
818 bool PutFwdInBwdOnBCs = false,
819 bool DoExchange = true);
820 inline void FillBwdWithBoundCond(const Array<OneD, NekDouble> &Fwd,
822 bool PutFwdInBwdOnBCs = false);
823 /// Add Fwd and Bwd value to field,
824 /// a reverse procedure of GetFwdBwdTracePhys
831 {
832 v_AddTraceQuadPhysToOffDiag(Fwd, Bwd, field);
833 }
836 Array<OneD, NekDouble> &locTraceFwd,
837 Array<OneD, NekDouble> &locTraceBwd);
838 /// Fill Bwd with boundary conditions
839 inline void FillBwdWithBwdWeight(Array<OneD, NekDouble> &weightave,
840 Array<OneD, NekDouble> &weightjmp);
841 /// Copy and fill the Periodic boundaries
842 inline void PeriodicBwdCopy(const Array<OneD, const NekDouble> &Fwd,
844 /// Rotate Bwd trace for rotational periodicity boundaries
845 /// when the flow is perpendicular to the rotation axis
847 /// Rotate Bwd trace derivative for rotational periodicity boundaries
848 /// when the flow is perpendicular to the rotation axis
850 /// Rotate local Bwd trace across a rotational interface
851 /// when the flow is perpendicular to the rotation axis
853 /// Rotate local Bwd trace derivatives across a rotational interface
854 /// when the flow is perpendicular to the rotation axis
856 inline const std::vector<bool> &GetLeftAdjacentFaces(void) const;
857 inline void ExtractTracePhys(Array<OneD, NekDouble> &outarray);
858 inline void ExtractTracePhys(const Array<OneD, const NekDouble> &inarray,
859 Array<OneD, NekDouble> &outarray,
860 bool gridVelocity = false);
865 inline void EvaluateBoundaryConditions(
866 const NekDouble time = 0.0, const std::string varName = "",
869 /// Set boundary conditions to be homogeneous
870 inline void SetBCsToHomogeneous(void);
871
872 // Routines for continous matrix solution
873 /// This function calculates the result of the multiplication of a
874 /// matrix of type specified by \a mkey with a vector given by \a
875 /// inarray.
877 const GlobalMatrixKey &gkey,
878 const Array<OneD, const NekDouble> &inarray,
879 Array<OneD, NekDouble> &outarray);
880 inline void SetUpPhysNormals();
881 inline void GetBoundaryToElmtMap(Array<OneD, int> &ElmtID,
882 Array<OneD, int> &EdgeID);
883 virtual void GetBndElmtExpansion(int i, std::shared_ptr<ExpList> &result,
884 const bool DeclareCoeffPhysArrays = true);
885
886 inline void ExtractElmtToBndPhys(int i, const Array<OneD, NekDouble> &elmt,
887 Array<OneD, NekDouble> &boundary);
888
889 inline void ExtractPhysToBndElmt(int i,
891 Array<OneD, NekDouble> &bndElmt);
892
893 inline void ExtractPhysToBnd(int i,
896
897 inline void GetBoundaryNormals(
898 int i, Array<OneD, Array<OneD, NekDouble>> &normals);
899
901 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef,
902 int NumHomoDir = 0,
905 std::vector<NekDouble> &HomoLen = LibUtilities::NullNekDoubleVector,
906 bool homoStrips = false,
907 std::vector<unsigned int> &HomoSIDs =
909 std::vector<unsigned int> &HomoZIDs =
911 std::vector<unsigned int> &HomoYIDs =
913
914 std::map<int, RobinBCInfoSharedPtr> GetRobinBCInfo()
915 {
916 return v_GetRobinBCInfo();
917 }
918
919 void GetPeriodicEntities(PeriodicMap &periodicVerts,
920 PeriodicMap &periodicEdges,
921 PeriodicMap &periodicFaces = NullPeriodicMap)
922 {
923 v_GetPeriodicEntities(periodicVerts, periodicEdges, periodicFaces);
924 }
925
926 std::vector<LibUtilities::FieldDefinitionsSharedPtr> GetFieldDefinitions()
927 {
928 return v_GetFieldDefinitions();
929 }
930
932 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef)
933 {
934 v_GetFieldDefinitions(fielddef);
935 }
936
937 /// Append the element data listed in elements
938 /// fielddef->m_ElementIDs onto fielddata
940 std::vector<NekDouble> &fielddata)
941 {
942 v_AppendFieldData(fielddef, fielddata);
943 }
944 /// Append the data in coeffs listed in elements
945 /// fielddef->m_ElementIDs onto fielddata
947 std::vector<NekDouble> &fielddata,
949 {
950 v_AppendFieldData(fielddef, fielddata, coeffs);
951 }
952 /** \brief Extract the data in fielddata into the coeffs
953 * using the basic ExpList Elemental expansions rather
954 * than planes in homogeneous case
955 */
958 std::vector<NekDouble> &fielddata, std::string &field,
959 Array<OneD, NekDouble> &coeffs);
960 /** \brief Extract the data from fromField using
961 * fromExpList the coeffs using the basic ExpList
962 * Elemental expansions rather than planes in homogeneous
963 * case
964 */
966 const std::shared_ptr<ExpList> &fromExpList,
967 const Array<OneD, const NekDouble> &fromCoeffs,
968 Array<OneD, NekDouble> &toCoeffs);
969 // Extract data in fielddata into the m_coeffs_list for the 3D stability
970 // analysis (base flow is 2D)
973 std::vector<NekDouble> &fielddata, std::string &field,
975 std::unordered_map<int, int> zIdToPlane =
976 std::unordered_map<int, int>());
977 // Extract data from file fileName and put coefficents into array coefffs
979 const std::string &fileName, LibUtilities::CommSharedPtr comm,
980 const std::string &varName, Array<OneD, NekDouble> &coeffs);
982 const int ElementID, const NekDouble scalar1, const NekDouble scalar2,
983 Array<OneD, NekDouble> &outarray);
984 /// Returns a shared pointer to the current object.
985 std::shared_ptr<ExpList> GetSharedThisPtr()
986 {
987 return shared_from_this();
988 }
989 /// Returns the session object
990 std::shared_ptr<LibUtilities::SessionReader> GetSession() const
991 {
992 return m_session;
993 }
994 /// Returns the comm object
995 std::shared_ptr<LibUtilities::Comm> GetComm() const
996 {
997 return m_comm;
998 }
1003 // Wrapper functions for Homogeneous Expansions
1008 std::shared_ptr<ExpList> &GetPlane(int n)
1009 {
1010 return v_GetPlane(n);
1011 }
1012
1013 inline const std::shared_ptr<GJPStabilisation> GetGJPData(void)
1014 {
1015 return v_GetGJPData();
1016 }
1017
1021
1023
1025
1027 GlobalLinSys> &
1029
1030 /// Get m_coeffs to elemental value map
1032 GetCoeffsToElmt() const;
1038 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
1039 const int nDirctn, Array<OneD, DNekMatSharedPtr> &mtxPerVar);
1041 const TensorOfArray3D<NekDouble> &inarray,
1044 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
1047 const Array<OneD, const NekDouble> &FwdFlux,
1048 const Array<OneD, const NekDouble> &BwdFlux,
1049 Array<OneD, NekDouble> &outarray)
1050 {
1051 v_AddTraceIntegralToOffDiag(FwdFlux, BwdFlux, outarray);
1052 }
1054 const int dir, const Array<OneD, const DNekMatSharedPtr> ElmtJacQuad,
1055 Array<OneD, DNekMatSharedPtr> ElmtJacCoef);
1057 const Array<OneD, const DNekMatSharedPtr> ElmtJacQuad,
1058 Array<OneD, DNekMatSharedPtr> ElmtJacCoef);
1060 GetLocTraceToTraceMap() const;
1061 // Return the internal vector which identifieds if trace
1062 // is left adjacent definiing which trace the normal
1063 // points otwards from
1064 MULTI_REGIONS_EXPORT std::vector<bool> &GetLeftAdjacentTraces(void);
1065
1066 /// This function returns the map of index inside m_exp to geom id
1067 MULTI_REGIONS_EXPORT inline const std::unordered_map<int, int> &GetElmtToExpId(
1068 void)
1069 {
1070 return m_elmtToExpId;
1071 }
1072
1073 /// This function returns the index inside m_exp for a given geom id
1075 {
1076 auto it = m_elmtToExpId.find(elmtId);
1077 ASSERTL0(it != m_elmtToExpId.end(), "Global geometry ID " +
1078 std::to_string(elmtId) +
1079 " not found in element ID to "
1080 "expansion ID map.")
1081 return it->second;
1082 }
1083
1085 const Array<OneD, const NekDouble> &inarray,
1086 Array<OneD, NekDouble> &outarray,
1087 bool Transpose = false);
1088
1089 /// This function returns collections
1092 {
1093 return m_collections;
1094 }
1095
1097 {
1098 return m_coll_coeff_offset[n];
1099 }
1100
1102 {
1103 return m_coll_phys_offset[n];
1104 }
1105
1106 MULTI_REGIONS_EXPORT inline const Array<OneD,
1107 const Array<OneD, NekDouble>> &
1109 {
1110 return m_gridVelocity;
1111 }
1112
1113protected:
1114 /// Pointer holder for PulseWaveSolver
1116 /// Expansion type
1118 std::shared_ptr<DNekMat> GenGlobalMatrixFull(
1119 const GlobalLinSysKey &mkey,
1120 const std::shared_ptr<AssemblyMapCG> &locToGloMap);
1121 /// Communicator
1123 /// Session
1125 /// Mesh associated with this expansion list.
1127 /// The total number of local degrees of freedom. #m_ncoeffs
1128 /// \f$=N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_l\f$
1130 /** The total number of quadrature points. #m_npoints
1131 *\f$=Q_{\mathrm{tot}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_Q\f$
1132 **/
1134 /**
1135 * \brief Concatenation of all local expansion coefficients.
1136 *
1137 * The array of length #m_ncoeffs\f$=N_{\mathrm{eof}}\f$ which is
1138 * the concatenation of the local expansion coefficients
1139 * \f$\hat{u}_n^e\f$ over all \f$N_{\mathrm{el}}\f$ elements
1140 * \f[\mathrm{\texttt{m\_coeffs}}=\boldsymbol{\hat{u}}_{l} =
1141 * \underline{\boldsymbol{\hat{u}}}^e = \left [ \begin{array}{c}
1142 * \boldsymbol{\hat{u}}^{1} \ \
1143 * \boldsymbol{\hat{u}}^{2} \ \
1144 * \vdots \ \
1145 * \boldsymbol{\hat{u}}^{{{N_{\mathrm{el}}}}} \end{array} \right ],
1146 * \quad
1147 * \mathrm{where}\quad \boldsymbol{\hat{u}}^{e}[n]=\hat{u}_n^{e}\f]
1148 */
1150 /**
1151 * \brief The global expansion evaluated at the quadrature points
1152 *
1153 * The array of length #m_npoints\f$=Q_{\mathrm{tot}}\f$ containing
1154 * the evaluation of \f$u^{\delta}(\boldsymbol{x})\f$ at the
1155 * quadrature points \f$\boldsymbol{x}_i\f$.
1156 * \f[\mathrm{\texttt{m\_phys}}=\boldsymbol{u}_{l} =
1157 * \underline{\boldsymbol{u}}^e = \left [ \begin{array}{c}
1158 * \boldsymbol{u}^{1} \ \
1159 * \boldsymbol{u}^{2} \ \
1160 * \vdots \ \
1161 * \boldsymbol{u}^{{{N_{\mathrm{el}}}}} \end{array} \right ],\quad
1162 * \mathrm{where}\quad
1163 * \boldsymbol{u}^{e}[i]=u^{\delta}(\boldsymbol{x}_i)\f]
1164 */
1166 /**
1167 * \brief The state of the array #m_phys.
1168 *
1169 * Indicates whether the array #m_phys, created to contain the
1170 * evaluation of \f$u^{\delta}(\boldsymbol{x})\f$ at the quadrature
1171 * points \f$\boldsymbol{x}_i\f$, is filled with these values.
1172 */
1174 /**
1175 * \brief The list of local expansions.
1176 *
1177 * The (shared pointer to the) vector containing (shared pointers
1178 * to) all local expansions. The fact that the local expansions are
1179 * all stored as a (pointer to a) #StdExpansion, the abstract base
1180 * class for all local expansions, allows a general implementation
1181 * where most of the routines for the derived classes are defined
1182 * in the #ExpList base class.
1183 */
1184 std::shared_ptr<LocalRegions::ExpansionVector> m_exp;
1186 /// Vector of bools to act as an initialise on first call flag
1187 std::vector<bool> m_collectionsDoInit;
1188 /// Offset of elemental data into the array #m_coeffs
1189 std::vector<int> m_coll_coeff_offset;
1190 /// Offset of elemental data into the array #m_phys
1191 std::vector<int> m_coll_phys_offset;
1192 /// Offset of elemental data into the array #m_coeffs
1194 /// Offset of elemental data into the array #m_phys
1196 /// m_coeffs to elemental value map
1199 //@todo should this be in ExpList or
1200 // ExpListHomogeneous1D.cpp it's a bool which determine if
1201 // the expansion is in the wave space (coefficient space)
1202 // or not
1204 /// Mapping from geometry ID of element to index inside #m_exp
1205 std::unordered_map<int, int> m_elmtToExpId;
1206 /// Grid velocity at quadrature points
1208 /// This function assembles the block diagonal matrix of local
1209 /// matrices of the type \a mtype.
1212
1213 /// Generates a global matrix from the given key and map.
1214 std::shared_ptr<GlobalMatrix> GenGlobalMatrix(
1215 const GlobalMatrixKey &mkey,
1216 const std::shared_ptr<AssemblyMapCG> &locToGloMap);
1218 const std::shared_ptr<DNekMat> &Gmat,
1219 Array<OneD, NekDouble> &EigValsReal,
1220 Array<OneD, NekDouble> &EigValsImag,
1222 /// This operation constructs the global linear system of type \a
1223 /// mkey.
1224 std::shared_ptr<GlobalLinSys> GenGlobalLinSys(
1225 const GlobalLinSysKey &mkey,
1226 const std::shared_ptr<AssemblyMapCG> &locToGloMap);
1227 /// Generate a GlobalLinSys from information provided by the key
1228 /// "mkey" and the mapping provided in LocToGloBaseMap.
1229 std::shared_ptr<GlobalLinSys> GenGlobalBndLinSys(
1230 const GlobalLinSysKey &mkey, const AssemblyMapSharedPtr &locToGloMap);
1231 // Virtual prototypes
1232 virtual size_t v_GetNumElmts(void)
1233 {
1234 return (*m_exp).size();
1235 }
1239 virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value);
1240 virtual std::shared_ptr<ExpList> &v_UpdateBndCondExpansion(int i);
1241 virtual void v_Upwind(const Array<OneD, const Array<OneD, NekDouble>> &Vec,
1249 virtual std::shared_ptr<ExpList> &v_GetTrace();
1250 virtual std::shared_ptr<AssemblyMapDG> &v_GetTraceMap();
1251 virtual std::shared_ptr<InterfaceMapDG> &v_GetInterfaceMap();
1253 virtual const std::shared_ptr<LocTraceToTraceMap> &v_GetLocTraceToTraceMap(
1254 void) const;
1255 virtual std::vector<bool> &v_GetLeftAdjacentTraces(void);
1256 /// Populate \a normals with the normals of all expansions.
1259 Array<OneD, NekDouble> &outarray);
1263 Array<OneD, NekDouble> &outarray);
1269 bool FillBnd = true,
1270 bool PutFwdInBwdOnBCs = false,
1271 bool DoExchange = true);
1274 bool PutFwdInBwdOnBCs);
1284 Array<OneD, NekDouble> &locTraceFwd,
1285 Array<OneD, NekDouble> &locTraceBwd);
1287 Array<OneD, NekDouble> &weightjmp);
1291
1294
1296
1297 virtual const std::vector<bool> &v_GetLeftAdjacentFaces(void) const;
1300 Array<OneD, NekDouble> &outarray,
1301 bool gridVelocity = false);
1303 const Array<OneD, const NekDouble> &inarray,
1304 Array<OneD, NekDouble> &outarray);
1305
1307 const Array<OneD, const NekDouble> &inarray,
1308 Array<OneD, NekDouble> &outarray,
1309 const StdRegions::ConstFactorMap &factors,
1310 const StdRegions::VarCoeffMap &varcoeff,
1311 const StdRegions::VarFactorsMap &varfactors,
1312 const Array<OneD, const NekDouble> &dirForcing,
1313 const bool PhysSpaceForcing);
1314
1316 const Array<OneD, const NekDouble> &inarray,
1317 Array<OneD, NekDouble> &outarray,
1318 const StdRegions::ConstFactorMap &factors,
1319 const StdRegions::VarCoeffMap &varcoeff,
1320 const StdRegions::VarFactorsMap &varfactors,
1321 const Array<OneD, const NekDouble> &dirForcing,
1322 const bool PhysSpaceForcing);
1323
1325 const Array<OneD, const NekDouble> &inarray,
1326 Array<OneD, NekDouble> &outarray,
1327 const StdRegions::ConstFactorMap &factors,
1328 const StdRegions::VarCoeffMap &varcoeff,
1329 const StdRegions::VarFactorsMap &varfactors,
1330 const Array<OneD, const NekDouble> &dirForcing,
1331 const bool PhysSpaceForcing);
1332
1333 // wrapper functions about virtual functions
1338 virtual void v_FillBndCondFromField(const int nreg,
1339 const Array<OneD, NekDouble> coeffs);
1340 virtual void v_Reset();
1341 virtual void v_AvgAssemble(bool UseComm);
1342 virtual void v_AvgAssemble(const Array<OneD, const NekDouble> &inarray,
1343 Array<OneD, NekDouble> &outarray, bool UseComm);
1344 virtual void v_LocalToGlobal(bool UseComm);
1346 Array<OneD, NekDouble> &outarray,
1347 bool UseComm);
1348 virtual void v_GlobalToLocal(void);
1350 Array<OneD, NekDouble> &outarray);
1351 virtual void v_BwdTrans(const Array<OneD, const NekDouble> &inarray,
1352 Array<OneD, NekDouble> &outarray);
1353 virtual void v_FwdTrans(const Array<OneD, const NekDouble> &inarray,
1354 Array<OneD, NekDouble> &outarray);
1356 const Array<OneD, const NekDouble> &inarray,
1357 Array<OneD, NekDouble> &outarray);
1359 const Array<OneD, const NekDouble> &inarray,
1360 Array<OneD, NekDouble> &outarray);
1363 Array<OneD, NekDouble> &outarray);
1364
1365 // Define ExpList::IProductWRTDerivBase as virtual function
1367 const int dir, const Array<OneD, const NekDouble> &inarray,
1368 Array<OneD, NekDouble> &outarray);
1369
1371 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
1372 Array<OneD, NekDouble> &outarray);
1373
1374 virtual void v_GetCoords(
1375 Array<OneD, NekDouble> &coord_0,
1378
1379 virtual void v_GetCoords(const int eid, Array<OneD, NekDouble> &xc0,
1382
1383 virtual void v_PhysDeriv(const Array<OneD, const NekDouble> &inarray,
1384 Array<OneD, NekDouble> &out_d0,
1385 Array<OneD, NekDouble> &out_d1,
1386 Array<OneD, NekDouble> &out_d2);
1387 virtual void v_PhysDeriv(const int dir,
1388 const Array<OneD, const NekDouble> &inarray,
1389 Array<OneD, NekDouble> &out_d);
1390 virtual void v_PhysDeriv(Direction edir,
1391 const Array<OneD, const NekDouble> &inarray,
1392 Array<OneD, NekDouble> &out_d);
1393
1396
1399
1401 const Array<OneD, const NekDouble> &direction,
1402 const Array<OneD, const NekDouble> &inarray,
1403 Array<OneD, NekDouble> &outarray);
1404 virtual void v_GetMovingFrames(
1405 const SpatialDomains::GeomMMF MMFdir,
1406 const Array<OneD, const NekDouble> &CircCentre,
1407 Array<OneD, Array<OneD, NekDouble>> &outarray);
1409 const int npts, const Array<OneD, const NekDouble> &inarray,
1410 Array<OneD, NekDouble> &outarray, bool Shuff = true,
1411 bool UnShuff = true);
1413 const int npts, const Array<OneD, const NekDouble> &inarray,
1414 Array<OneD, NekDouble> &outarray, bool Shuff = true,
1415 bool UnShuff = true);
1416 virtual void v_DealiasedProd(const int num_dofs,
1417 const Array<OneD, NekDouble> &inarray1,
1418 const Array<OneD, NekDouble> &inarray2,
1419 Array<OneD, NekDouble> &outarray);
1421 const int num_dofs, const Array<OneD, Array<OneD, NekDouble>> &inarray1,
1422 const Array<OneD, Array<OneD, NekDouble>> &inarray2,
1423 Array<OneD, Array<OneD, NekDouble>> &outarray);
1425 const Array<OneD, NekDouble> &TotField,
1426 int BndID);
1429 Array<OneD, NekDouble> &outarray,
1430 int BndID);
1433 Array<OneD, NekDouble> &outarray);
1434 virtual void v_SetUpPhysNormals();
1436 Array<OneD, int> &EdgeID);
1437 virtual void v_GetBndElmtExpansion(int i, std::shared_ptr<ExpList> &result,
1438 const bool DeclareCoeffPhysArrays);
1439
1440 virtual void v_ExtractElmtToBndPhys(const int i,
1441 const Array<OneD, NekDouble> &elmt,
1442 Array<OneD, NekDouble> &boundary);
1443
1445 const int i, const Array<OneD, const NekDouble> &phys,
1446 Array<OneD, NekDouble> &bndElmt);
1447
1448 virtual void v_ExtractPhysToBnd(const int i,
1449 const Array<OneD, const NekDouble> &phys,
1451
1453 int i, Array<OneD, Array<OneD, NekDouble>> &normals);
1454
1455 virtual std::vector<LibUtilities::FieldDefinitionsSharedPtr>
1457
1459 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef);
1460
1461 virtual void v_AppendFieldData(
1463 std::vector<NekDouble> &fielddata);
1464 virtual void v_AppendFieldData(
1466 std::vector<NekDouble> &fielddata, Array<OneD, NekDouble> &coeffs);
1469 std::vector<NekDouble> &fielddata, std::string &field,
1470 Array<OneD, NekDouble> &coeffs,
1471 std::unordered_map<int, int> zIdToPlane);
1473 const std::shared_ptr<ExpList> &fromExpList,
1474 const Array<OneD, const NekDouble> &fromCoeffs,
1475 Array<OneD, NekDouble> &toCoeffs);
1476 virtual void v_WriteTecplotHeader(std::ostream &outfile,
1477 std::string var = "");
1478 virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion);
1479 virtual void v_WriteTecplotField(std::ostream &outfile, int expansion);
1480 virtual void v_WriteTecplotConnectivity(std::ostream &outfile,
1481 int expansion);
1482 virtual void v_WriteVtkPieceData(std::ostream &outfile, int expansion,
1483 std::string var);
1484 virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion,
1485 int istrip);
1486
1488 const Array<OneD, const NekDouble> &phys,
1490
1493 const Array<OneD, Array<OneD, NekDouble>> &inarray);
1494
1496
1499 virtual void v_SetHomoLen(const NekDouble lhom);
1502
1503 // 1D Scaling and projection
1504 virtual void v_PhysInterp1DScaled(const NekDouble scale,
1505 const Array<OneD, NekDouble> &inarray,
1506 Array<OneD, NekDouble> &outarray);
1507
1509 const NekDouble scale, const Array<OneD, NekDouble> &inarray,
1510 Array<OneD, NekDouble> &outarray);
1511
1512 virtual void v_ClearGlobalLinSysManager(void);
1513
1514 virtual int v_GetPoolCount(std::string);
1515
1517
1520
1521 void ExtractFileBCs(const std::string &fileName,
1523 const std::string &varName,
1524 const std::shared_ptr<ExpList> locExpList);
1525
1526 // Utility function for a common case of retrieving a
1527 // BoundaryCondition from a boundary condition collection.
1531 unsigned int index, const std::string &variable);
1532
1535
1538
1540 const NekDouble time = 0.0, const std::string varName = "",
1543
1544 virtual void v_SetBCsToHomogeneous(void);
1545
1546 virtual std::map<int, RobinBCInfoSharedPtr> v_GetRobinBCInfo(void);
1547
1548 virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts,
1549 PeriodicMap &periodicEdges,
1550 PeriodicMap &periodicFaces);
1551
1552 // Homogeneous direction wrapper functions.
1554 {
1556 "This method is not defined or valid for this class type");
1558 }
1559
1560 // wrapper function to set viscosity for Homo1D expansion
1562 [[maybe_unused]] Array<OneD, NekDouble> visc)
1563 {
1565 "This method is not defined or valid for this class type");
1566 }
1567
1568 virtual std::shared_ptr<ExpList> &v_GetPlane(int n);
1569
1571 const Array<OneD, const NekDouble> &FwdFlux,
1572 const Array<OneD, const NekDouble> &BwdFlux,
1573 Array<OneD, NekDouble> &outarray);
1574
1575 virtual const std::shared_ptr<GJPStabilisation> v_GetGJPData(void)
1576 {
1577 // default is to return empty pointer
1578 return nullptr; // std::shared_ptr<GJPStabilisation>();
1579 }
1580
1581private:
1582 /// Definition of the total number of degrees of freedom and
1583 /// quadrature points and offsets to access data
1584 void SetupCoeffPhys(bool DeclareCoeffPhysArrays = true,
1585 bool SetupOffsets = true);
1586
1587 /// Define a list of elements using the geometry and basis
1588 /// key information in expmap;
1590};
1591
1592/// An empty ExpList object.
1595
1596// An empty GlobaLinSysManager object
1600
1601// Inline routines follow.
1602
1603/**
1604 * Returns the total number of local degrees of freedom
1605 * \f$N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_m\f$.
1606 */
1607inline int ExpList::GetNcoeffs() const
1608{
1609 return m_ncoeffs;
1610}
1611
1612inline int ExpList::GetNcoeffs(const int eid) const
1613{
1614 return (*m_exp)[eid]->GetNcoeffs();
1615}
1616
1617/**
1618 * Evaulates the maximum number of modes in the elemental basis
1619 * order over all elements
1620 */
1622{
1623 int returnval = 0;
1624
1625 for (size_t i = 0; i < (*m_exp).size(); ++i)
1626 {
1627 returnval = (std::max)(returnval, (*m_exp)[i]->EvalBasisNumModesMax());
1628 }
1629
1630 return returnval;
1631}
1632
1633/**
1634 *
1635 */
1637{
1638 Array<OneD, int> returnval((*m_exp).size(), 0);
1639
1640 for (size_t i = 0; i < (*m_exp).size(); ++i)
1641 {
1642 returnval[i] =
1643 (std::max)(returnval[i], (*m_exp)[i]->EvalBasisNumModesMax());
1644 }
1645
1646 return returnval;
1647}
1648
1649/**
1650 *
1651 */
1652inline int ExpList::GetTotPoints() const
1653{
1654 return m_npoints;
1655}
1656
1657inline int ExpList::GetTotPoints(const int eid) const
1658{
1659 return (*m_exp)[eid]->GetTotPoints();
1660}
1661
1662inline int ExpList::Get1DScaledTotPoints(const NekDouble scale) const
1663{
1664 int returnval = 0;
1665 size_t cnt;
1666 size_t nbase = (*m_exp)[0]->GetNumBases();
1667
1668 for (size_t i = 0; i < (*m_exp).size(); ++i)
1669 {
1670 int npt0 = (*m_exp)[i]->GetNumPoints(0);
1671 cnt = 1;
1672
1673 for (size_t j = 0; j < nbase; ++j)
1674 {
1675 int npt = (*m_exp)[i]->GetNumPoints(j);
1676 cnt *= (npt0 - npt == 1) ? (size_t)(scale * npt0 - 1)
1677 : (size_t)(scale * npt);
1678 }
1679 returnval += cnt;
1680 }
1681 return returnval;
1682}
1683
1684/**
1685 *
1686 */
1687inline int ExpList::GetNpoints() const
1688{
1689 return m_npoints;
1690}
1691
1692/**
1693 *
1694 */
1695inline void ExpList::SetWaveSpace(const bool wavespace)
1696{
1697 m_WaveSpace = wavespace;
1698}
1699
1700/**
1701 *
1702 */
1703inline bool ExpList::GetWaveSpace() const
1704{
1705 return m_WaveSpace;
1706}
1707
1708/// Set the \a i th value of\a m_phys to value \a val
1709inline void ExpList::SetPhys(int i, NekDouble val)
1710{
1711 m_phys[i] = val;
1712}
1713/**
1714 * This function fills the array \f$\boldsymbol{u}_l\f$, the evaluation
1715 * of the expansion at the quadrature points (implemented as #m_phys),
1716 * with the values of the array \a inarray.
1717 *
1718 * @param inarray The array containing the values where
1719 * #m_phys should be filled with.
1720 */
1722{
1723 ASSERTL0((int)inarray.size() == m_npoints,
1724 "Input array does not have correct number of elements.");
1725 Vmath::Vcopy(m_npoints, &inarray[0], 1, &m_phys[0], 1);
1726 m_physState = true;
1727}
1729{
1730 m_phys = inarray;
1731}
1732/**
1733 * @param physState \a true (=filled) or \a false (=not filled).
1734 */
1735inline void ExpList::SetPhysState(const bool physState)
1736{
1737 m_physState = physState;
1738}
1739/**
1740 * @return physState \a true (=filled) or \a false (=not filled).
1741 */
1742inline bool ExpList::GetPhysState() const
1743{
1744 return m_physState;
1745}
1746/**
1747 *
1748 */
1750 const Array<OneD, const NekDouble> &inarray,
1751 Array<OneD, NekDouble> &outarray)
1752{
1753 v_IProductWRTBase(inarray, outarray);
1754}
1755/**
1756 *
1757 */
1759 const int dir, const Array<OneD, const NekDouble> &inarray,
1760 Array<OneD, NekDouble> &outarray)
1761{
1762 v_IProductWRTDerivBase(dir, inarray, outarray);
1763}
1764
1765/**
1766 *
1767 */
1769 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
1770 Array<OneD, NekDouble> &outarray)
1771{
1772 v_IProductWRTDerivBase(inarray, outarray);
1773}
1774
1775/**
1776 *
1777 */
1779 Array<OneD, NekDouble> &outarray)
1780{
1781 v_FwdTrans(inarray, outarray);
1782}
1783/**
1784 *
1785 */
1787 const Array<OneD, const NekDouble> &inarray,
1788 Array<OneD, NekDouble> &outarray)
1789{
1790 v_FwdTransLocalElmt(inarray, outarray);
1791}
1792/**
1793 *
1794 */
1796 const Array<OneD, const NekDouble> &inarray,
1797 Array<OneD, NekDouble> &outarray)
1798{
1799 v_FwdTransBndConstrained(inarray, outarray);
1800}
1801/**
1802 *
1803 */
1805{
1806 v_SmoothField(field);
1807}
1808/**
1809 *
1810 */
1811/**
1812 * Given the coefficients of an expansion, this function evaluates the
1813 * spectral/hp expansion \f$u^{\delta}(\boldsymbol{x})\f$ at the
1814 * quadrature points \f$\boldsymbol{x}_i\f$.
1815 */
1817 Array<OneD, NekDouble> &outarray)
1818{
1819 v_BwdTrans(inarray, outarray);
1820}
1821/**
1822 *
1823 */
1825 const Array<OneD, const NekDouble> &inarray,
1826 Array<OneD, NekDouble> &outarray)
1827{
1828 v_MultiplyByInvMassMatrix(inarray, outarray);
1829}
1830/**
1831 *
1832 */
1834 const Array<OneD, const NekDouble> &inarray,
1835 Array<OneD, NekDouble> &outarray, const StdRegions::ConstFactorMap &factors,
1836 const StdRegions::VarCoeffMap &varcoeff,
1837 const StdRegions::VarFactorsMap &varfactors,
1838 const Array<OneD, const NekDouble> &dirForcing, const bool PhysSpaceForcing)
1839{
1840 return v_HelmSolve(inarray, outarray, factors, varcoeff, varfactors,
1841 dirForcing, PhysSpaceForcing);
1842}
1843/**
1844 *
1845 */
1847 const Array<OneD, const NekDouble> &inarray,
1848 Array<OneD, NekDouble> &outarray, const StdRegions::ConstFactorMap &factors,
1849 const StdRegions::VarCoeffMap &varcoeff,
1850 const StdRegions::VarFactorsMap &varfactors,
1851 const Array<OneD, const NekDouble> &dirForcing, const bool PhysSpaceForcing)
1852{
1854 inarray, outarray, factors, varcoeff, varfactors, dirForcing,
1855 PhysSpaceForcing);
1856}
1857
1859 const Array<OneD, const NekDouble> &inarray,
1860 Array<OneD, NekDouble> &outarray, const StdRegions::ConstFactorMap &factors,
1861 const StdRegions::VarCoeffMap &varcoeff,
1862 const StdRegions::VarFactorsMap &varfactors,
1863 const Array<OneD, const NekDouble> &dirForcing, const bool PhysSpaceForcing)
1864{
1865 return v_LinearAdvectionReactionSolve(inarray, outarray, factors, varcoeff,
1866 varfactors, dirForcing,
1867 PhysSpaceForcing);
1868}
1869/**
1870 *
1871 */
1873 Array<OneD, NekDouble> &coord_1,
1874 Array<OneD, NekDouble> &coord_2)
1875{
1876 v_GetCoords(coord_0, coord_1, coord_2);
1877}
1878
1879inline void ExpList::GetCoords(const int eid, Array<OneD, NekDouble> &xc0,
1882{
1883 v_GetCoords(eid, xc0, xc1, xc2);
1884}
1885
1886/**
1887 *
1888 */
1890 const SpatialDomains::GeomMMF MMFdir,
1891 const Array<OneD, const NekDouble> &CircCentre,
1892 Array<OneD, Array<OneD, NekDouble>> &outarray)
1893{
1894 v_GetMovingFrames(MMFdir, CircCentre, outarray);
1895}
1896/**
1897 *
1898 */
1900 Array<OneD, NekDouble> &out_d0,
1901 Array<OneD, NekDouble> &out_d1,
1902 Array<OneD, NekDouble> &out_d2)
1903{
1904 v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
1905}
1906/**
1907 *
1908 */
1909inline void ExpList::PhysDeriv(const int dir,
1910 const Array<OneD, const NekDouble> &inarray,
1912{
1913 v_PhysDeriv(dir, inarray, out_d);
1914}
1916 const Array<OneD, const NekDouble> &inarray,
1918{
1919 v_PhysDeriv(edir, inarray, out_d);
1920}
1921/**
1922 *
1923 */
1925 const Array<OneD, const NekDouble> &direction,
1926 const Array<OneD, const NekDouble> &inarray,
1927 Array<OneD, NekDouble> &outarray)
1928{
1929 v_PhysDirectionalDeriv(direction, inarray, outarray);
1930}
1931/**
1932 *
1933 */
1936{
1937 v_CurlCurl(Vel, Q);
1938}
1939/**
1940 *
1941 */
1943 const int npts, const Array<OneD, const NekDouble> &inarray,
1944 Array<OneD, NekDouble> &outarray, bool Shuff, bool UnShuff)
1945{
1946 v_HomogeneousFwdTrans(npts, inarray, outarray, Shuff, UnShuff);
1947}
1948/**
1949 *
1950 */
1952 const int npts, const Array<OneD, const NekDouble> &inarray,
1953 Array<OneD, NekDouble> &outarray, bool Shuff, bool UnShuff)
1954{
1955 v_HomogeneousBwdTrans(npts, inarray, outarray, Shuff, UnShuff);
1956}
1957/**
1958 *
1959 */
1960inline void ExpList::DealiasedProd(const int num_dofs,
1961 const Array<OneD, NekDouble> &inarray1,
1962 const Array<OneD, NekDouble> &inarray2,
1963 Array<OneD, NekDouble> &outarray)
1964{
1965 v_DealiasedProd(num_dofs, inarray1, inarray2, outarray);
1966}
1967/**
1968 *
1969 */
1971 const int num_dofs, const Array<OneD, Array<OneD, NekDouble>> &inarray1,
1972 const Array<OneD, Array<OneD, NekDouble>> &inarray2,
1973 Array<OneD, Array<OneD, NekDouble>> &outarray)
1974{
1975 v_DealiasedDotProd(num_dofs, inarray1, inarray2, outarray);
1976}
1977/**
1978 *
1979 */
1981 const Array<OneD, NekDouble> &TotField,
1982 int BndID)
1983{
1984 v_GetBCValues(BndVals, TotField, BndID);
1985}
1986/**
1987 *
1988 */
1991 Array<OneD, NekDouble> &outarray,
1992 int BndID)
1993{
1994 v_NormVectorIProductWRTBase(V1, V2, outarray, BndID);
1995}
2001/**
2002 * @param eid The index of the element to be checked.
2003 * @return The dimension of the coordinates of the specific element.
2004 */
2005inline int ExpList::GetCoordim(int eid)
2006{
2007 ASSERTL2(eid <= (*m_exp).size(), "eid is larger than number of elements");
2008 return (*m_exp)[eid]->GetCoordim();
2009}
2010/**
2011 * @param eid The index of the element to be checked.
2012 * @return The dimension of the shape of the specific element.
2013 */
2015{
2016 return (*m_exp)[0]->GetShapeDimension();
2017}
2018/**
2019 * @param i The index of m_coeffs to be set
2020 * @param val The value which m_coeffs[i] is to be set to.
2021 */
2022inline void ExpList::SetCoeff(int i, NekDouble val)
2023{
2024 m_coeffs[i] = val;
2025}
2026/**
2027 * @param i The index of #m_coeffs to be set.
2028 * @param val The value which #m_coeffs[i] is to be set to.
2029 */
2030inline void ExpList::SetCoeffs(int i, NekDouble val)
2031{
2032 m_coeffs[i] = val;
2033}
2035{
2036 m_coeffs = inarray;
2037}
2038/**
2039 * As the function returns a constant reference to a
2040 * <em>const Array</em>, it is not possible to modify the
2041 * underlying data of the array #m_coeffs. In order to do
2042 * so, use the function #UpdateCoeffs instead.
2043 *
2044 * @return (A constant reference to) the array #m_coeffs.
2045 */
2047{
2048 return m_coeffs;
2049}
2059{
2060 v_ImposeRobinConditions(outarray);
2061}
2063{
2064 v_FillBndCondFromField(coeffs);
2065}
2066inline void ExpList::FillBndCondFromField(const int nreg,
2067 const Array<OneD, NekDouble> coeffs)
2068{
2069 v_FillBndCondFromField(nreg, coeffs);
2070}
2071inline void ExpList::AvgAssemble(bool useComm)
2072{
2073 v_AvgAssemble(useComm);
2074}
2076 Array<OneD, NekDouble> &outarray, bool useComm)
2077{
2078 v_AvgAssemble(inarray, outarray, useComm);
2079}
2080inline void ExpList::LocalToGlobal(bool useComm)
2081{
2082 v_LocalToGlobal(useComm);
2083}
2085 Array<OneD, NekDouble> &outarray,
2086 bool useComm)
2087{
2088 v_LocalToGlobal(inarray, outarray, useComm);
2089}
2090inline void ExpList::GlobalToLocal(void)
2091{
2093}
2094/**
2095 * This operation is evaluated as:
2096 * \f{tabbing}
2097 * \hspace{1cm} \= Do \= $e=$ $1, N_{\mathrm{el}}$ \\
2098 * > > Do \= $i=$ $0,N_m^e-1$ \\
2099 * > > > $\boldsymbol{\hat{u}}^{e}[i] = \mbox{sign}[e][i] \cdot
2100 * \boldsymbol{\hat{u}}_g[\mbox{map}[e][i]]$ \\
2101 * > > continue \\
2102 * > continue
2103 * \f}
2104 * where \a map\f$[e][i]\f$ is the mapping array and \a
2105 * sign\f$[e][i]\f$ is an array of similar dimensions ensuring the
2106 * correct modal connectivity between the different elements (both
2107 * these arrays are contained in the data member #m_locToGloMap). This
2108 * operation is equivalent to the scatter operation
2109 * \f$\boldsymbol{\hat{u}}_l=\mathcal{A}\boldsymbol{\hat{u}}_g\f$, where
2110 * \f$\mathcal{A}\f$ is the
2111 * \f$N_{\mathrm{eof}}\times N_{\mathrm{dof}}\f$ permutation matrix.
2112 *
2113 * @param inarray An array of size \f$N_\mathrm{dof}\f$
2114 * containing the global degrees of freedom
2115 * \f$\boldsymbol{x}_g\f$.
2116 * @param outarray The resulting local degrees of freedom
2117 * \f$\boldsymbol{x}_l\f$ will be stored in this
2118 * array of size \f$N_\mathrm{eof}\f$.
2119 */
2121 Array<OneD, NekDouble> &outarray)
2122{
2123 v_GlobalToLocal(inarray, outarray);
2124}
2125/**
2126 * @param i The index of #m_coeffs to be returned
2127 * @return The NekDouble held in #m_coeffs[i].
2128 */
2130{
2131 return m_coeffs[i];
2132}
2133/**
2134 * @param i The index of #m_coeffs to be returned
2135 * @return The NekDouble held in #m_coeffs[i].
2136 */
2138{
2139 return m_coeffs[i];
2140}
2141/**
2142 * As the function returns a constant reference to a
2143 * <em>const Array</em> it is not possible to modify the
2144 * underlying data of the array #m_phys. In order to do
2145 * so, use the function #UpdatePhys instead.
2146 *
2147 * @return (A constant reference to) the array #m_phys.
2148 */
2150{
2151 return m_phys;
2152}
2153/**
2154 * @return \f$N_{\mathrm{el}}\f$, the number of elements in the
2155 * expansion.
2156 */
2157inline int ExpList::GetExpSize(void)
2158{
2159 return (*m_exp).size();
2160}
2161/**
2162 * @param n The index of the element concerned.
2163 *
2164 * @return (A shared pointer to) the local expansion of the
2165 * \f$n^{\mathrm{th}}\f$ element.
2166 */
2168{
2169 return (*m_exp)[n];
2170}
2171/**
2172 * @param n The global id of the element concerned.
2173 *
2174 * @return (A shared pointer to) the local expansion of the
2175 * \f$n^{\mathrm{th}}\f$ element.
2176 */
2178{
2179 auto it = m_elmtToExpId.find(n);
2180 ASSERTL0(it != m_elmtToExpId.end(), "Global geometry ID " +
2181 std::to_string(n) +
2182 " not found in element ID to "
2183 "expansion ID map.")
2184 return (*m_exp)[it->second];
2185}
2186/**
2187 * @return (A const shared pointer to) the local expansion vector #m_exp
2188 */
2189inline const std::shared_ptr<LocalRegions::ExpansionVector> ExpList::GetExp(
2190 void) const
2191{
2192 return m_exp;
2193}
2194/**
2195 *
2196 */
2197inline int ExpList::GetCoeff_Offset(int n) const
2198{
2199 return m_coeff_offset[n];
2200}
2201/**
2202 *
2203 */
2204inline int ExpList::GetPhys_Offset(int n) const
2205{
2206 return m_phys_offset[n];
2207}
2208/**
2209 * If one wants to get hold of the underlying data without modifying
2210 * them, rather use the function #GetCoeffs instead.
2211 *
2212 * @return (A reference to) the array #m_coeffs.
2213 */
2215{
2216 return m_coeffs;
2217}
2218/**
2219 * If one wants to get hold of the underlying data without modifying
2220 * them, rather use the function #GetPhys instead.
2221 *
2222 * @return (A reference to) the array #m_phys.
2223 */
2225{
2226 m_physState = true;
2227 return m_phys;
2228}
2229// functions associated with DisContField
2235/// Get m_coeffs to elemental value map
2250inline void ExpList::SetBndCondBwdWeight(const int index, const NekDouble value)
2251{
2252 v_SetBndCondBwdWeight(index, value);
2253}
2254inline std::shared_ptr<ExpList> &ExpList::UpdateBndCondExpansion(int i)
2255{
2256 return v_UpdateBndCondExpansion(i);
2257}
2259 const Array<OneD, const Array<OneD, NekDouble>> &Vec,
2262{
2263 v_Upwind(Vec, Fwd, Bwd, Upwind);
2264}
2268 Array<OneD, NekDouble> &Upwind)
2269{
2270 v_Upwind(Vn, Fwd, Bwd, Upwind);
2271}
2272inline std::shared_ptr<ExpList> &ExpList::GetTrace()
2273{
2274 return v_GetTrace();
2275}
2276inline std::shared_ptr<AssemblyMapDG> &ExpList::GetTraceMap()
2277{
2278 return v_GetTraceMap();
2279}
2280inline std::shared_ptr<InterfaceMapDG> &ExpList::GetInterfaceMap()
2281{
2282 return v_GetInterfaceMap();
2283}
2285{
2286 return v_GetTraceBndMap();
2287}
2289{
2290 v_GetNormals(normals);
2291}
2293 Array<OneD, NekDouble> &outarray)
2294{
2295 v_AddTraceIntegral(Fn, outarray);
2296}
2300{
2301 v_AddFwdBwdTraceIntegral(Fwd, Bwd, outarray);
2302}
2310 Array<OneD, NekDouble> &Bwd, bool FillBnd, bool PutFwdInBwdOnBCs,
2311 bool DoExchange)
2312{
2313 v_GetFwdBwdTracePhys(field, Fwd, Bwd, FillBnd, PutFwdInBwdOnBCs,
2314 DoExchange);
2315}
2318 bool PutFwdInBwdOnBCs)
2319{
2320 v_FillBwdWithBoundCond(Fwd, Bwd, PutFwdInBwdOnBCs);
2321}
2325{
2326 v_AddTraceQuadPhysToField(Fwd, Bwd, field);
2327}
2331 Array<OneD, NekDouble> &locTraceFwd, Array<OneD, NekDouble> &locTraceBwd)
2332{
2333 v_GetLocTraceFromTracePts(Fwd, Bwd, locTraceFwd, locTraceBwd);
2334}
2336 Array<OneD, NekDouble> &weightjmp)
2337{
2338 v_FillBwdWithBwdWeight(weightave, weightjmp);
2339}
2342{
2343 v_PeriodicBwdCopy(Fwd, Bwd);
2344}
2349
2354
2359
2364
2365inline const std::vector<bool> &ExpList::GetLeftAdjacentFaces(void) const
2366{
2367 return v_GetLeftAdjacentFaces();
2368}
2370{
2371 v_ExtractTracePhys(outarray);
2372}
2374 const Array<OneD, const NekDouble> &inarray,
2375 Array<OneD, NekDouble> &outarray, bool gridVelocity)
2376{
2377 v_ExtractTracePhys(inarray, outarray, gridVelocity);
2378}
2390 const std::string varName,
2391 const NekDouble x2_in,
2392 const NekDouble x3_in)
2393{
2394 v_EvaluateBoundaryConditions(time, varName, x2_in, x3_in);
2395}
2396
2398{
2400}
2401
2403{
2405}
2407 Array<OneD, int> &EdgeID)
2408{
2409 v_GetBoundaryToElmtMap(ElmtID, EdgeID);
2410}
2412 std::shared_ptr<ExpList> &result,
2413 const bool DeclareCoeffPhysArrays)
2414{
2415 v_GetBndElmtExpansion(i, result, DeclareCoeffPhysArrays);
2416}
2417
2419 const Array<OneD, NekDouble> &elmt,
2420 Array<OneD, NekDouble> &boundary)
2421{
2422 v_ExtractElmtToBndPhys(i, elmt, boundary);
2423}
2424
2426 int i, const Array<OneD, const NekDouble> &phys,
2427 Array<OneD, NekDouble> &bndElmt)
2428{
2429 v_ExtractPhysToBndElmt(i, phys, bndElmt);
2430}
2431
2433 const Array<OneD, const NekDouble> &phys,
2435{
2436 v_ExtractPhysToBnd(i, phys, bnd);
2437}
2438
2440 int i, Array<OneD, Array<OneD, NekDouble>> &normals)
2441{
2442 v_GetBoundaryNormals(i, normals);
2443}
2444
2445inline std::vector<bool> &ExpList::GetLeftAdjacentTraces(void)
2446{
2447 return v_GetLeftAdjacentTraces();
2448}
2449
2451
2452} // namespace Nektar::MultiRegions
2453
2454#endif // EXPLIST_H
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
#define MULTI_REGIONS_EXPORT
Base class for all multi-elemental spectral/hp expansions.
Definition ExpList.h:98
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition ExpList.h:1149
Array< OneD, NekDouble > & UpdateCoeffs()
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
Definition ExpList.h:2214
void AddTraceJacToElmtJac(const Array< OneD, const DNekMatSharedPtr > &FwdMat, const Array< OneD, const DNekMatSharedPtr > &BwdMat, Array< OneD, DNekMatSharedPtr > &fieldMat)
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the inner product of a function with respect to all local expansion modes .
Definition ExpList.h:1749
virtual void v_DealiasedDotProd(const int num_dofs, const Array< OneD, Array< OneD, NekDouble > > &inarray1, const Array< OneD, Array< OneD, NekDouble > > &inarray2, Array< OneD, Array< OneD, NekDouble > > &outarray)
const Array< OneD, const std::shared_ptr< ExpList > > & GetBndCondExpansions()
Definition ExpList.h:2231
std::shared_ptr< ExpList > & GetTrace()
Definition ExpList.h:2272
virtual std::shared_ptr< ExpList > & v_GetTrace()
void WriteTecplotConnectivity(std::ostream &outfile, int expansion=-1)
Definition ExpList.h:410
virtual void v_PeriodicBwdCopy(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
Definition ExpList.h:1607
std::shared_ptr< GlobalLinSys > GenGlobalLinSys(const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
This operation constructs the global linear system of type mkey.
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & GetGlobalLinSysManager(void)
ExpList(const ExpansionType Type=eNoType)
The default constructor using a type.
virtual void v_ImposeNeumannConditions(Array< OneD, NekDouble > &outarray)
void SetCoeffs(int i, NekDouble val)
Set the i th coefficiient in m_coeffs to value val.
Definition ExpList.h:2030
virtual void v_FillBndCondFromField(const Array< OneD, NekDouble > coeffs)
ExpList(const ExpList &in, const std::vector< unsigned int > &eIDs, const bool DeclareCoeffPhysArrays=true, const Collections::ImplementationType ImpType=Collections::eNoImpType)
Constructor copying only elements defined in eIds.
virtual ~ExpList()
The default destructor.
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
void ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
virtual void v_AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
virtual void v_WriteTecplotHeader(std::ostream &outfile, std::string var="")
virtual void v_SetHomoLen(const NekDouble lhom)
void MultiplyByMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition ExpList.h:297
void GlobalEigenSystem(const std::shared_ptr< DNekMat > &Gmat, Array< OneD, NekDouble > &EigValsReal, Array< OneD, NekDouble > &EigValsImag, Array< OneD, NekDouble > &EigVecs=NullNekDouble1DArray)
void FillBwdWithBoundCond(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs=false)
Definition ExpList.h:2316
virtual void v_RotLocalBwdTrace(Array< OneD, Array< OneD, NekDouble > > &Bwd)
void AddRightIPTPhysDerivBase(const int dir, const Array< OneD, const DNekMatSharedPtr > ElmtJacQuad, Array< OneD, DNekMatSharedPtr > ElmtJacCoef)
void ExtractPhysToBndElmt(int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
Definition ExpList.h:2425
virtual void v_SetUpPhysNormals()
void Reset()
Reset geometry information and reset matrices.
Definition ExpList.h:389
int GetExpIndex(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0, bool returnNearestElmt=false, int cachedId=-1, NekDouble maxDistance=1e6)
This function returns the index of the local elemental expansion containing the arbitrary point given...
void GetFieldDefinitions(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef)
Definition ExpList.h:931
virtual const std::shared_ptr< GJPStabilisation > v_GetGJPData(void)
Definition ExpList.h:1575
BlockMatrixMapShPtr m_blockMat
Definition ExpList.h:1198
virtual void v_UnsetGlobalLinSys(GlobalLinSysKey, bool)
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
multiply the metric jacobi and quadrature weights
void SetPhys(int i, NekDouble val)
Set the i th value of m_phys to value val.
Definition ExpList.h:1709
void ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Definition ExpList.h:2369
LocalRegions::ExpansionSharedPtr & GetExp(const Array< OneD, const NekDouble > &gloCoord)
This function returns (a shared pointer to) the local elemental expansion containing the arbitrary po...
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition ExpList.h:2406
void PeriodicBwdCopy(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Copy and fill the Periodic boundaries.
Definition ExpList.h:2340
void WriteVtkPieceFooter(std::ostream &outfile, int expansion)
GlobalLinSysKey HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff=StdRegions::NullVarCoeffMap, const StdRegions::VarFactorsMap &varfactors=StdRegions::NullVarFactorsMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray, const bool PhysSpaceForcing=true)
Solve helmholtz problem.
Definition ExpList.h:1833
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition(void)
std::shared_ptr< DNekMat > GenGlobalMatrixFull(const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
std::shared_ptr< InterfaceMapDG > & GetInterfaceMap(void)
Definition ExpList.h:2280
void GetBwdWeight(Array< OneD, NekDouble > &weightAver, Array< OneD, NekDouble > &weightJump)
Get the weight value for boundary conditions for boundary average and jump calculations.
virtual void v_WriteTecplotField(std::ostream &outfile, int expansion)
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)
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo(void)
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
virtual void v_WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var)
void InitialiseExpVector(const SpatialDomains::ExpansionInfoMap &expmap)
Define a list of elements using the geometry and basis key information in expmap;.
void SetupCoeffPhys(bool DeclareCoeffPhysArrays=true, bool SetupOffsets=true)
Definition of the total number of degrees of freedom and quadrature points and offsets to access data...
void RotLocalBwdTrace(Array< OneD, Array< OneD, NekDouble > > &Bwd)
Rotate local Bwd trace across a rotational interface when the flow is perpendicular to the rotation a...
Definition ExpList.h:2355
virtual LibUtilities::BasisSharedPtr v_GetHomogeneousBasis(void)
Definition ExpList.h:1553
virtual void v_ExtractPhysToBndElmt(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
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:2046
const Array< OneD, const Array< OneD, NekDouble > > & GetGridVelocity()
Definition ExpList.h:1108
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays=true)
Definition ExpList.h:2411
void SetPhysArray(Array< OneD, NekDouble > &inarray)
Sets the array m_phys.
Definition ExpList.h:1728
const Collections::CollectionVector & GetCollections() const
This function returns collections.
Definition ExpList.h:1091
virtual void v_ClearGlobalLinSysManager(void)
void FillBndCondFromField(const Array< OneD, NekDouble > coeffs)
Fill Bnd Condition expansion from the values stored in expansion.
Definition ExpList.h:2062
const Array< OneD, const std::pair< int, int > > & GetCoeffsToElmt() const
Get m_coeffs to elemental value map.
Definition ExpList.h:2237
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:2149
ExpList(const LibUtilities::SessionReaderSharedPtr &pSession, const LocalRegions::ExpansionVector &locexp, const SpatialDomains::MeshGraphSharedPtr &graph, const bool DeclareCoeffPhysArrays, const std::string variable, const Collections::ImplementationType ImpType=Collections::eNoImpType)
Generate an trace ExpList from a meshgraph graph and session file.
std::shared_ptr< ExpList > & UpdateBndCondExpansion(int i)
Definition ExpList.h:2254
void NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
Definition ExpList.h:1989
int GetCoeff_Offset(int n) const
Get the start offset position for a local contiguous list of coeffs correspoinding to element n.
Definition ExpList.h:2197
virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value)
virtual void v_NormVectorIProductWRTBase(Array< OneD, Array< OneD, NekDouble > > &V, Array< OneD, NekDouble > &outarray)
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition ExpList.h:2157
virtual void v_CurlCurl(Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
SpatialDomains::EntityHolder1D m_holder
Pointer holder for PulseWaveSolver.
Definition ExpList.h:1115
std::shared_ptr< LibUtilities::SessionReader > GetSession() const
Returns the session object.
Definition ExpList.h:990
std::shared_ptr< GlobalLinSys > GenGlobalBndLinSys(const GlobalLinSysKey &mkey, const AssemblyMapSharedPtr &locToGloMap)
Generate a GlobalLinSys from information provided by the key "mkey" and the mapping provided in LocTo...
void GetMatIpwrtDeriveBase(const TensorOfArray3D< NekDouble > &inarray, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
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)
virtual void v_PhysDeriv(Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
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.h:1758
void SetCoeffsArray(Array< OneD, NekDouble > &inarray)
Set the m_coeffs array to inarray.
Definition ExpList.h:2034
LibUtilities::TranspositionSharedPtr GetTransposition(void)
This function returns the transposition class associated with the homogeneous expansion.
Definition ExpList.h:610
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
void SetBndCondBwdWeight(const int index, const NekDouble value)
Set the weight value for boundary conditions.
Definition ExpList.h:2250
void SetHomoLen(const NekDouble lhom)
This function sets the Width of homogeneous direction associated with the homogeneous expansion.
Definition ExpList.h:624
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
virtual void v_IProductWRTDerivBase(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
int GetNpoints(void) const
Returns the total number of quadrature points m_npoints .
Definition ExpList.h:1687
SpatialDomains::MeshGraphSharedPtr GetGraph()
Definition ExpList.h:999
virtual const std::shared_ptr< LocTraceToTraceMap > & v_GetLocTraceToTraceMap(void) const
void GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition ExpList.h:2303
int GetElmtToExpId(int elmtId)
This function returns the index inside m_exp for a given geom id.
Definition ExpList.h:1074
const Array< OneD, const int > & GetTraceBndMap(void)
Definition ExpList.h:2284
virtual GlobalLinSysKey v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const StdRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
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)
Array< OneD, Array< OneD, NekDouble > > m_gridVelocity
Grid velocity at quadrature points.
Definition ExpList.h:1207
int GetPoolCount(std::string)
void FwdTransLocalElmt(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function elementally evaluates the forward transformation of a function onto the global spectra...
Definition ExpList.h:1786
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:603
const std::shared_ptr< GJPStabilisation > GetGJPData(void)
Definition ExpList.h:1013
void FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition ExpList.h:1795
virtual size_t v_GetNumElmts(void)
Definition ExpList.h:1232
virtual std::shared_ptr< AssemblyMapDG > & v_GetTraceMap()
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition ExpList.h:1193
int EvalBasisNumModesMax(void) const
Evaulates the maximum number of modes in the elemental basis order over all elements.
Definition ExpList.h:1621
void AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
Definition ExpList.h:2297
virtual void v_GetLocTraceFromTracePts(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
std::shared_ptr< AssemblyMapDG > & GetTraceMap(void)
Definition ExpList.h:2276
void WriteTecplotField(std::ostream &outfile, int expansion=-1)
Definition ExpList.h:406
virtual void v_AddTraceQuadPhysToOffDiag(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
size_t GetNumElmts(void)
This function returns the number of elements in the expansion which may be different for a homogeoeno...
Definition ExpList.h:666
virtual LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & v_GetGlobalLinSysManager(void)
Array< OneD, std::pair< int, int > > m_coeffsToElmt
m_coeffs to elemental value map
Definition ExpList.h:1197
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)
NekDouble PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &phys)
const std::unordered_map< int, int > & GetElmtToExpId(void)
This function returns the map of index inside m_exp to geom id.
Definition ExpList.h:1067
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
virtual GlobalLinSysKey v_LinearAdvectionReactionSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const StdRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
void PhysDirectionalDeriv(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition ExpList.h:1924
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
Definition ExpList.h:2439
virtual void v_RotLocalBwdDeriveTrace(TensorOfArray3D< NekDouble > &Bwd)
GlobalLinSysKey LinearAdvectionDiffusionReactionSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff=StdRegions::NullVarCoeffMap, const StdRegions::VarFactorsMap &varfactors=StdRegions::NullVarFactorsMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray, const bool PhysSpaceForcing=true)
Solve Advection Diffusion Reaction.
Definition ExpList.h:1846
virtual void v_LocalToGlobal(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseComm)
void ExtractFileBCs(const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, const std::shared_ptr< ExpList > locExpList)
virtual const Array< OneD, const std::shared_ptr< ExpList > > & v_GetBndCondExpansions(void)
void GetMovingFrames(const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition ExpList.h:1889
const LocTraceToTraceMapSharedPtr & GetLocTraceToTraceMap() const
Definition ExpList.h:2242
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:587
void SetHomo1DSpecVanVisc(Array< OneD, NekDouble > visc)
This function sets the Spectral Vanishing Viscosity in homogeneous1D expansion.
Definition ExpList.h:594
virtual void v_HomogeneousFwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
void ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Extract the data from fromField using fromExpList the coeffs using the basic ExpList Elemental expans...
virtual void v_GlobalToLocal(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
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:1872
void ResetMatrices()
Reset matrices.
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:1636
void PeriodicBwdRot(Array< OneD, Array< OneD, NekDouble > > &Bwd)
Rotate Bwd trace for rotational periodicity boundaries when the flow is perpendicular to the rotation...
Definition ExpList.h:2345
virtual void v_HomogeneousBwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
virtual std::shared_ptr< InterfaceMapDG > & v_GetInterfaceMap()
void UnsetGlobalLinSys(GlobalLinSysKey, bool)
ExpList(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::CompositeMap &domain, const SpatialDomains::MeshGraphSharedPtr &graph, const bool DeclareCoeffPhysArrays=true, const std::string variable="DefaultVar", bool SetToOneSpaceDimension=false, const LibUtilities::CommSharedPtr comm=LibUtilities::CommSharedPtr(), const Collections::ImplementationType ImpType=Collections::eNoImpType)
Constructor based on domain information only for 1D & 2D boundary conditions.
void DealiasedProd(const int num_dofs, const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
Definition ExpList.h:1960
void GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Definition ExpList.h:2288
void ExtractPhysToBnd(int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
Definition ExpList.h:2432
virtual void v_GlobalToLocal(void)
std::vector< bool > m_collectionsDoInit
Vector of bools to act as an initialise on first call flag.
Definition ExpList.h:1187
NekDouble GetCoeff(int i)
Get the i th value (coefficient) of m_coeffs.
Definition ExpList.h:2129
bool m_physState
The state of the array m_phys.
Definition ExpList.h:1173
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
void ExtractCoeffsFromFile(const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, Array< OneD, NekDouble > &coeffs)
NekDouble Integral()
Calculates the error of the global spectral/hp element approximation.
Definition ExpList.h:556
std::shared_ptr< ExpList > & GetPlane(int n)
Definition ExpList.h:1008
void AddRightIPTBaseMatrix(const Array< OneD, const DNekMatSharedPtr > ElmtJacQuad, Array< OneD, DNekMatSharedPtr > ElmtJacCoef)
virtual std::vector< bool > & v_GetLeftAdjacentTraces(void)
void GetLocTraceFromTracePts(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
Definition ExpList.h:2328
virtual void v_PeriodicBwdRot(Array< OneD, Array< OneD, NekDouble > > &Bwd)
std::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
Definition ExpList.h:985
int GetShapeDimension()
This function returns the dimension of the shape of the element eid.
Definition ExpList.h:2014
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...
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.
virtual void v_ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
Definition ExpList.h:1191
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition ExpList.h:1122
void WriteVtkHeader(std::ostream &outfile)
bool GetPhysState(void) const
This function indicates whether the array of physical values (implemented as m_phys) is filled or no...
Definition ExpList.h:1742
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition ExpList.h:1184
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &inarray)
ExpList(const ExpList &in, const bool DeclareCoeffPhysArrays=true)
The copy constructor.
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition ExpList.h:1129
virtual void v_AddTraceQuadPhysToField(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
void GenerateElementVector(const int ElementID, const NekDouble scalar1, const NekDouble scalar2, Array< OneD, NekDouble > &outarray)
NekDouble VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &inarray)
Definition ExpList.h:581
void AddTraceIntegralToOffDiag(const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
Definition ExpList.h:1046
virtual void v_ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs, std::unordered_map< int, int > zIdToPlane)
const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & GetBndConditions()
Definition ExpList.h:2380
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
LocalRegions::ExpansionSharedPtr & GetExpFromGeomId(int n)
This function returns (a shared pointer to) the local elemental expansion of the element given a glo...
Definition ExpList.h:2177
virtual void v_DealiasedProd(const int num_dofs, const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
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:1735
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:653
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
void CurlCurl(Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
Definition ExpList.h:1934
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
Definition ExpList.h:914
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
virtual void v_AvgAssemble(bool UseComm)
int Get_coll_coeff_offset(int n) const
Definition ExpList.h:1096
void EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="", const NekDouble=NekConstants::kNekUnsetDouble, const NekDouble=NekConstants::kNekUnsetDouble)
Definition ExpList.h:2389
std::vector< LibUtilities::FieldDefinitionsSharedPtr > GetFieldDefinitions()
Definition ExpList.h:926
virtual void v_PeriodicDeriveBwdRot(TensorOfArray3D< NekDouble > &Bwd)
Array< OneD, NekDouble > & UpdatePhys()
This function returns (a reference to) the array (implemented as m_phys) containing the function ev...
Definition ExpList.h:2224
void ImposeRobinConditions(Array< OneD, NekDouble > &outarray)
Add Robin Boundary Condition forcing to Array.
Definition ExpList.h:2058
virtual const Array< OneD, const int > & v_GetTraceBndMap()
void GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the result of the multiplication of a matrix of type specified by mkey with ...
void ExtractElmtToBndPhys(int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
Definition ExpList.h:2418
virtual void v_GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
void HomogeneousBwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
Definition ExpList.h:1951
void SetWaveSpace(const bool wavespace)
Sets the wave space to the one of the possible configuration true or false.
Definition ExpList.h:1695
virtual void v_AvgAssemble(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseComm)
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition ExpList.h:2189
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition ExpList.h:1126
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
virtual void v_GetCoords(const int eid, Array< OneD, NekDouble > &xc0, Array< OneD, NekDouble > &xc1, Array< OneD, NekDouble > &xc2)
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
void GlobalToLocal(void)
Scatters from the global coefficients to the local coefficients .
Definition ExpList.h:2090
const Array< OneD, const NekDouble > & GetBndCondBwdWeight()
Get the weight value for boundary conditions.
Definition ExpList.h:2246
void WriteVtkFooter(std::ostream &outfile)
virtual void v_PhysDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
void AvgAssemble(bool useComm=true)
Assemble the average global coefficients from the local coefficients .
Definition ExpList.h:2071
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
virtual void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GetElmtNormalLength(Array< OneD, NekDouble > &lengthsFwd, Array< OneD, NekDouble > &lengthsBwd)
Get the length of elements in boundary normal direction.
virtual void v_ExtractPhysToBnd(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
virtual void v_ExtractTracePhys(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool gridVelocity=false)
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:1662
ExpList(SpatialDomains::PointGeom *geom)
Specialised constructors for 0D Expansions Wrapper around LocalRegion::PointExp - used in PrePacing....
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, Array< OneD, NekDouble > &coeffs)
virtual void v_FillBndCondFromField(const int nreg, const Array< OneD, NekDouble > coeffs)
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:642
NekDouble L2(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
This function calculates the error of the global This function calculates the error with respect to...
Definition ExpList.h:527
void PeriodicDeriveBwdRot(TensorOfArray3D< NekDouble > &Bwd)
Rotate Bwd trace derivative for rotational periodicity boundaries when the flow is perpendicular to t...
Definition ExpList.h:2350
virtual void v_FwdTransLocalElmt(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition ExpList.h:1189
void IProductWRTDirectionalDerivBase(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var="v")
Definition ExpList.h:423
void FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Fill Bwd with boundary conditions.
Definition ExpList.h:2335
void SetCoeff(int i, NekDouble val)
Set the i th coefficiient in m_coeffs to value val.
Definition ExpList.h:2022
void GetMatIpwrtDeriveBase(const Array< OneD, const Array< OneD, NekDouble > > &inarray, const int nDirctn, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
void LocalToGlobal(bool useComm=true)
Gathers the global coefficients from the local coefficients .
Definition ExpList.h:2080
void GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces=NullPeriodicMap)
Definition ExpList.h:919
void MultiplyByBlockMatrix(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Transpose=false)
NekDouble Integral(const Array< OneD, const NekDouble > &inarray)
Definition ExpList.h:577
virtual std::shared_ptr< ExpList > & v_GetPlane(int n)
virtual void v_AddTraceIntegralToOffDiag(const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
ExpList(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &graph, const bool DeclareCoeffPhysArrays=true, const std::string &var="DefaultVar", const Collections::ImplementationType ImpType=Collections::eNoImpType)
Generate an ExpList from a meshgraph graph and session file.
Collections::CollectionVector m_collections
Definition ExpList.h:1185
virtual const Array< OneD, const NekDouble > & v_GetBndCondBwdWeight()
void AddTraceQuadPhysToField(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Add Fwd and Bwd value to field, a reverse procedure of GetFwdBwdTracePhys.
Definition ExpList.h:2322
virtual void v_SetBCsToHomogeneous(void)
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetPoolCount(std::string)
int GetExpIndex(const Array< OneD, const NekDouble > &gloCoords, Array< OneD, NekDouble > &locCoords, NekDouble tol=0.0, bool returnNearestElmt=false, int cachedId=-1, NekDouble maxDistance=1e6)
virtual void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void ApplyGeomInfo()
Apply geometry information to each expansion.
void AddTraceIntegral(const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
Definition ExpList.h:2292
virtual void v_GetFieldDefinitions(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef)
std::unordered_map< int, int > m_elmtToExpId
Mapping from geometry ID of element to index inside m_exp.
Definition ExpList.h:1205
virtual GlobalLinSysKey v_LinearAdvectionDiffusionReactionSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const StdRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition ExpList.h:1778
virtual void v_ImposeRobinConditions(Array< OneD, NekDouble > &outarray)
virtual void v_GetFwdBwdTracePhys(const Array< OneD, const NekDouble > &field, Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool FillBnd=true, bool PutFwdInBwdOnBCs=false, bool DoExchange=true)
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_ExtractElmtToBndPhys(const int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
void SmoothField(Array< OneD, NekDouble > &field)
Smooth a field across elements.
Definition ExpList.h:1804
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
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:633
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void)
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition ExpList.h:1124
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
virtual void v_FillBwdWithBoundCond(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs)
virtual void v_GetMovingFrames(const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble > > &outarray)
void MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition ExpList.h:1824
void SetBCsToHomogeneous(void)
Set boundary conditions to be homogeneous.
Definition ExpList.h:2397
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Populate normals with the normals of all expansions.
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:946
virtual Array< OneD, const unsigned int > v_GetZIDs(void)
void DivideByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Divided by the metric jacobi and quadrature weights.
void ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Impose Dirichlet Boundary Conditions onto Array.
Definition ExpList.h:2050
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_Upwind(const Array< OneD, const NekDouble > &Vn, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition ExpList.h:1195
void Upwind(const Array< OneD, const NekDouble > &Vn, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
Definition ExpList.h:2265
void RotLocalBwdDeriveTrace(TensorOfArray3D< NekDouble > &Bwd)
Rotate local Bwd trace derivatives across a rotational interface when the flow is perpendicular to th...
Definition ExpList.h:2360
Array< OneD, SpatialDomains::BoundaryConditionShPtr > & UpdateBndConditions()
Definition ExpList.h:2385
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
const DNekScalBlkMatSharedPtr GenBlockMatrix(const GlobalMatrixKey &gkey)
This function assembles the block diagonal matrix of local matrices of the type mtype.
void PhysDeriv(Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
Definition ExpList.h:1915
int Get_coll_phys_offset(int n) const
Definition ExpList.h:1101
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 ...
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function elementally evaluates the backward transformation of the global spectral/hp element exp...
Definition ExpList.h:1816
virtual NekDouble v_GetHomoLen(void)
NekDouble GetHomoLen(void)
This function returns the Width of homogeneous direction associated with the homogeneous expansion.
Definition ExpList.h:617
virtual void v_LocalToGlobal(bool UseComm)
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
ExpList(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::ExpansionInfoMap &expansions, const bool DeclareCoeffPhysArrays=true, const Collections::ImplementationType ImpType=Collections::eNoImpType)
Sets up a list of local expansions based on an expansion Map.
GlobalLinSysKey LinearAdvectionReactionSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff=StdRegions::NullVarCoeffMap, const StdRegions::VarFactorsMap &varfactors=StdRegions::NullVarFactorsMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray, const bool PhysSpaceForcing=true)
Solve Advection Diffusion Reaction.
Definition ExpList.h:1858
bool GetWaveSpace(void) const
This function returns the third direction expansion condition, which can be in wave space (coefficien...
Definition ExpList.h:1703
int GetPhys_Offset(int n) const
Get the start offset position for a local contiguous list of quadrature points in a full array corres...
Definition ExpList.h:2204
void ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs, std::unordered_map< int, int > zIdToPlane=std::unordered_map< int, int >())
void SetModifiedBasis(const bool modbasis)
Set Modified Basis for the stability analysis.
ExpansionType m_expType
Expansion type.
Definition ExpList.h:1117
void WriteTecplotHeader(std::ostream &outfile, std::string var="")
Definition ExpList.h:398
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
const std::vector< bool > & GetLeftAdjacentFaces(void) const
Definition ExpList.h:2365
void DealiasedDotProd(const int num_dofs, const Array< OneD, Array< OneD, NekDouble > > &inarray1, const Array< OneD, Array< OneD, NekDouble > > &inarray2, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition ExpList.h:1970
std::shared_ptr< GlobalMatrix > GenGlobalMatrix(const GlobalMatrixKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
Generates a global matrix from the given key and map.
void AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
Append the element data listed in elements fielddef->m_ElementIDs onto fielddata.
Definition ExpList.h:939
std::shared_ptr< LibUtilities::Comm > GetComm() const
Returns the comm object.
Definition ExpList.h:995
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition ExpList.h:1165
std::vector< bool > & GetLeftAdjacentTraces(void)
Definition ExpList.h:2445
ExpansionType GetExpType(void)
Returns the type of the expansion.
void AddTraceQuadPhysToOffDiag(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition ExpList.h:828
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.
void HomogeneousFwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
Definition ExpList.h:1942
virtual void v_Curl(Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
void WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip=0)
Definition ExpList.h:416
virtual void v_FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
void ImposeNeumannConditions(Array< OneD, NekDouble > &outarray)
Add Neumann Boundary Condition forcing to Array.
Definition ExpList.h:2054
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
Definition ExpList.h:1652
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
virtual Array< OneD, const unsigned int > v_GetYIDs(void)
LibUtilities::BasisSharedPtr GetHomogeneousBasis(void)
Definition ExpList.h:1004
void WriteTecplotZone(std::ostream &outfile, int expansion=-1)
Definition ExpList.h:402
ExpList(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, const ExpListSharedPtr > &bndConstraint, const Array< OneD, const SpatialDomains ::BoundaryConditionShPtr > &bndCond, const LocalRegions::ExpansionVector &locexp, const SpatialDomains::MeshGraphSharedPtr &graph, const LibUtilities::CommSharedPtr &comm, const bool DeclareCoeffPhysArrays=true, const std::string variable="DefaultVar", const Collections::ImplementationType ImpType=Collections::eNoImpType)
Generate expansions for the trace space expansions used in DisContField.
virtual const std::vector< bool > & v_GetLeftAdjacentFaces(void) const
virtual void v_SetHomo1DSpecVanVisc(Array< OneD, NekDouble > visc)
Definition ExpList.h:1561
void GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
Definition ExpList.h:1980
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition ExpList.h:2005
void GetDiagMatIpwrtBase(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
A global linear system.
Describes a matrix with ordering defined by a local to global map.
std::vector< Collection > CollectionVector
Definition Collection.h:142
static BasisSharedPtr NullBasisSharedPtr
Definition Basis.h:350
static std::vector< unsigned int > NullUnsignedIntVector
std::shared_ptr< Basis > BasisSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
Definition FieldIO.h:184
static std::vector< NekDouble > NullNekDoubleVector
std::shared_ptr< Transposition > TranspositionSharedPtr
static Array< OneD, BasisSharedPtr > NullBasisSharedPtr1DArray
Definition Basis.h:351
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition Comm.h:55
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition Expansion.h:66
std::vector< ExpansionSharedPtr > ExpansionVector
Definition Expansion.h:68
static ExpList NullExpList
An empty ExpList object.
Definition ExpList.h:1593
static PeriodicMap NullPeriodicMap
MultiRegions::Direction const DirCartesianMap[]
Definition ExpList.h:86
std::shared_ptr< BlockMatrixMap > BlockMatrixMapShPtr
A shared pointer to a BlockMatrixMap.
Definition ExpList.h:92
static ExpListSharedPtr NullExpListSharedPtr
Definition ExpList.h:1594
static LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > NullGlobalLinSysManager
Definition ExpList.h:1598
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
static GlobalLinSysKey NullGlobalLinSysKey(StdRegions::eNoMatrixType)
std::shared_ptr< LocTraceToTraceMap > LocTraceToTraceMapSharedPtr
static const Array< OneD, ExpListSharedPtr > NullExpListSharedPtrArray
Definition ExpList.h:2450
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Definition AssemblyMap.h:50
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
std::map< GlobalMatrixKey, DNekScalBlkMatSharedPtr > BlockMatrixMap
A map between global matrix keys and their associated block matrices.
Definition ExpList.h:90
static const NekDouble kNekUnsetDouble
GeomMMF
Principle direction for MMF.
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition Conditions.h:251
std::map< int, BoundaryConditionMapShPtr > BoundaryConditionCollection
Definition Conditions.h:258
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition MeshGraph.h:224
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
Definition MeshGraph.h:191
std::map< int, CompositeSharedPtr > CompositeMap
Definition MeshGraph.h:186
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
static VarFactorsMap NullVarFactorsMap
std::map< ConstFactorType, NekDouble > ConstFactorMap
static VarCoeffMap NullVarCoeffMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
static Array< OneD, NekDouble > NullNekDouble1DArray
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition Vmath.hpp:825