Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Enumerations | Functions | Variables
Nektar::StdRegions Namespace Reference

The namespace associated with the the StdRegions library (StdRegions introduction) More...

Classes

struct  cmpop
 
class  IndexMapKey
 
struct  IndexValue
 
class  StdExpansion
 The base class for all shapes. More...
 
class  StdExpansion0D
 
class  StdExpansion1D
 
class  StdExpansion2D
 
class  StdExpansion3D
 
class  StdHexExp
 Class representing a hexehedral element in reference space. More...
 
class  StdLinSysKey
 
class  StdMatrixKey
 
class  StdNodalPrismExp
 
class  StdNodalTetExp
 
class  StdNodalTriExp
 
class  StdPointExp
 
class  StdPrismExp
 Class representing a prismatic element in reference space. More...
 
class  StdPyrExp
 
class  StdQuadExp
 
class  StdSegExp
 Class representing a segment element in reference space. More...
 
class  StdTetExp
 
class  StdTriExp
 

Typedefs

typedef Array< OneD, IndexValueIndexMapValues
 
typedef boost::shared_ptr
< IndexMapKey
IndexMapKeySharedPtr
 
typedef boost::shared_ptr
< IndexMapValues
IndexMapValuesSharedPtr
 
typedef Array< OneD, Array
< OneD, NekDouble > > 
NormalVector
 
typedef boost::shared_ptr
< StdExpansion
StdExpansionSharedPtr
 
typedef std::vector
< StdExpansionSharedPtr
StdExpansionVector
 
typedef std::vector
< StdExpansionSharedPtr >
::iterator 
StdExpansionVectorIter
 
typedef boost::shared_ptr
< StdExpansion0D
StdExpansion0DSharedPtr
 
typedef boost::shared_ptr
< StdExpansion1D
StdExpansion1DSharedPtr
 
typedef boost::shared_ptr
< StdExpansion2D
StdExpansion2DSharedPtr
 
typedef boost::shared_ptr
< StdExpansion3D
StdExpansion3DSharedPtr
 
typedef boost::shared_ptr
< StdHexExp
StdHexExpSharedPtr
 
typedef boost::shared_ptr
< StdMatrixKey
StdMatrixKeySharedPtr
 
typedef boost::shared_ptr
< StdNodalPrismExp
StdNodalPrismExpSharedPtr
 
typedef boost::shared_ptr
< StdNodalTetExp
StdNodalTetExpSharedPtr
 
typedef boost::shared_ptr
< StdNodalTriExp
StdNodalTriExpSharedPtr
 
typedef boost::shared_ptr
< StdPointExp
StdPointExpSharedPtr
 
typedef boost::shared_ptr
< StdPrismExp
StdPrismExpSharedPtr
 
typedef boost::tuple< unsigned
int, unsigned int, unsigned
int, unsigned int > 
Mode
 
typedef boost::shared_ptr
< StdPyrExp
StdPyrExpSharedPtr
 
typedef boost::shared_ptr
< StdQuadExp
StdQuadExpSharedPtr
 
typedef std::map
< StdRegions::VarCoeffType,
Array< OneD, NekDouble > > 
VarCoeffMap
 
typedef std::map
< ConstFactorType, NekDouble
ConstFactorMap
 
typedef boost::shared_ptr
< StdSegExp
StdSegExpSharedPtr
 
typedef boost::shared_ptr
< StdTetExp
StdTetExpSharedPtr
 
typedef boost::shared_ptr
< StdTriExp
StdTriExpSharedPtr
 

Enumerations

enum  ElementType {
  eStdSegExp, eSegExp, eStdQuadExp, eStdTriExp,
  eStdNodalTriExp, eQuadExp, eTriExp, eNodalTriExp,
  eStdHexExp, eStdPrismExp, eStdPyrExp, eStdTetExp,
  eStdNodalTetExp, eHexExp, ePrismExp, ePyrExp,
  eTetExp, eNodalTetExp, SIZE_ElementType
}
 
enum  MatrixType {
  eMass, eInvMass, eLaplacian, eLaplacian00,
  eLaplacian01, eLaplacian02, eLaplacian10, eLaplacian11,
  eLaplacian12, eLaplacian20, eLaplacian21, eLaplacian22,
  eInvLaplacianWithUnityMean, eWeakDeriv0, eWeakDeriv1, eWeakDeriv2,
  eWeakDirectionalDeriv, eMassLevelCurvature, eLinearAdvectionReaction, eLinearAdvectionDiffusionReaction,
  eNBasisTrans, eInvNBasisTrans, eBwdTrans, eIProductWRTBase,
  eIProductWRTDerivBase0, eIProductWRTDerivBase1, eIProductWRTDerivBase2, eHelmholtz,
  eHybridDGHelmholtz, eInvHybridDGHelmholtz, eHybridDGHelmBndLam, eHybridDGLamToQ0,
  eHybridDGLamToQ1, eHybridDGLamToQ2, eHybridDGLamToU, eFwdTrans,
  ePreconR, ePreconRT, ePreconRMass, ePreconRTMass,
  ePreconLinearSpace, ePreconLinearSpaceMass, eInterpGauss, eGaussDG,
  ePhysInterpToEquiSpaced, eEquiSpacedToCoeffs, SIZE_MatrixType
}
 
enum  VarCoeffType {
  eVarCoeffMass, eVarCoeffLaplacian, eVarCoeffWeakDeriv, eVarCoeffD00,
  eVarCoeffD11, eVarCoeffD22, eVarCoeffD01, eVarCoeffD02,
  eVarCoeffD12, eVarCoeffVelX, eVarCoeffVelY
}
 
enum  ConstFactorType {
  eFactorLambda, eFactorTau, eFactorTime, eFactorSVVCutoffRatio,
  eFactorSVVDiffCoeff, eFactorGaussVertex, eFactorGaussEdge, eFactorConst
}
 
enum  IndexMapType {
  eEdgeToElement, eFaceToElement, eEdgeInterior, eFaceInterior,
  eBoundary, eVertex
}
 
enum  Orientation {
  eNoOrientation, eFwd, eBwd, eForwards,
  eBackwards, eDir1FwdDir1_Dir2FwdDir2, eDir1FwdDir1_Dir2BwdDir2, eDir1BwdDir1_Dir2FwdDir2,
  eDir1BwdDir1_Dir2BwdDir2, eDir1FwdDir2_Dir2FwdDir1, eDir1FwdDir2_Dir2BwdDir1, eDir1BwdDir2_Dir2FwdDir1,
  eDir1BwdDir2_Dir2BwdDir1, SIZE_Orientation
}
 

Functions

bool operator< (const IndexMapKey &lhs, const IndexMapKey &rhs)
 
bool operator== (const IndexMapKey &lhs, const IndexMapKey &rhs)
 
std::ostream & operator<< (std::ostream &os, const IndexMapKey &rhs)
 
LibUtilities::BasisKey EvaluateQuadFaceBasisKey (const int facedir, const LibUtilities::BasisType faceDirBasisType, const int numpoints, const int nummodes)
 
LibUtilities::BasisKey EvaluateTriFaceBasisKey (const int facedir, const LibUtilities::BasisType faceDirBasisType, const int numpoints, const int nummodes)
 
template<typename T >
NekVector< T > GetColumn (const NekMatrix< T > &matA, int n)
 
NekMatrix< NekDouble > & SetColumn (NekMatrix< NekDouble > &matA, int n, const NekVector< NekDouble > &x)
 
NekVector< NekDoubleGetE (int rows, int n)
 
NekMatrix< NekDoubleInvert (const NekMatrix< NekDouble > &matA)
 
NekMatrix< NekDoubleGetTranspose (const NekMatrix< NekDouble > &matA)
 
int GetSize (const ConstArray< OneD, NekDouble > &x)
 
int GetSize (const NekVector< NekDouble > &x)
 
NekVector< NekDoubleToVector (const ConstArray< OneD, NekDouble > &x)
 
Array< OneD, NekDoubleToArray (const NekVector< NekDouble > &x)
 
NekVector< NekDoubleHadamard (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y)
 
NekVector< NekDoubleVectorPower (const NekVector< NekDouble > &x, NekDouble p)
 
std::string MatrixToString (const NekMatrix< NekDouble > &A, int precision, NekDouble expSigFigs)
 
std::string VectorToString (const NekVector< NekDouble > &v, int precision, NekDouble expSigFigs)
 
int GetTriNumPoints (int degree)
 
int GetDegree (int nBasisFunctions)
 
int GetTetNumPoints (int degree)
 
int GetTetDegree (int nBasisFunc)
 
NekDouble MakeRound (NekDouble x)
 
NekMatrix< NekDoubleGetMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, int degree)
 
NekMatrix< NekDoubleGetMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, const NekVector< NekDouble > &z, int degree)
 
NekMatrix< NekDoubleGetMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, const NekVector< NekDouble > &z)
 
NekMatrix< NekDoubleGetMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y)
 
NekMatrix< NekDoubleGetXDerivativeOfMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, int degree)
 
NekMatrix< NekDoubleGetXDerivativeOfMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y)
 
NekMatrix< NekDoubleGetTetXDerivativeOfMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, const NekVector< NekDouble > &z, int degree)
 
NekMatrix< NekDoubleGetTetXDerivativeOfMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, const NekVector< NekDouble > &z)
 
NekMatrix< NekDoubleGetTetYDerivativeOfMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, const NekVector< NekDouble > &z, int degree)
 
NekMatrix< NekDoubleGetTetYDerivativeOfMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, const NekVector< NekDouble > &z)
 
NekMatrix< NekDoubleGetTetZDerivativeOfMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, const NekVector< NekDouble > &z, int degree)
 
NekMatrix< NekDoubleGetTetZDerivativeOfMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, const NekVector< NekDouble > &z)
 
NekMatrix< NekDoubleGetYDerivativeOfMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, int degree)
 
NekMatrix< NekDoubleGetYDerivativeOfMonomialVandermonde (const NekVector< NekDouble > &x, const NekVector< NekDouble > &y)
 
NekVector< NekDoubleGetIntegralOfMonomialVandermonde (int degree)
 
int GetSize (const Array< OneD, const NekDouble > &x)
 
NekVector< NekDoubleToVector (const Array< OneD, const NekDouble > &x)
 
bool operator< (const StdMatrixKey &lhs, const StdMatrixKey &rhs)
 
bool operator== (const StdMatrixKey &lhs, const StdMatrixKey &rhs)
 
std::ostream & operator<< (std::ostream &os, const StdMatrixKey &rhs)
 
template<class InputIterator , class EqualityComparable >
InputIterator find (InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
 

Variables

const char *const ElementTypeMap []
 
const char *const MatrixTypeMap []
 
const char *const VarCoeffTypeMap []
 
static VarCoeffMap NullVarCoeffMap
 
const char *const ConstFactorTypeMap []
 
static ConstFactorMap NullConstFactorMap
 
const char *const IndexMapTypeMap []
 
const char *const OrientationMap []
 

Detailed Description

The namespace associated with the the StdRegions library (StdRegions introduction)

Typedef Documentation

Definition at line 251 of file StdRegions.hpp.

Definition at line 125 of file IndexMapKey.h.

Definition at line 55 of file IndexMapKey.h.

Definition at line 126 of file IndexMapKey.h.

typedef boost::tuple< unsigned int, unsigned int, unsigned int, unsigned int> Nektar::StdRegions::Mode

Definition at line 49 of file StdPyrExp.h.

Definition at line 59 of file StdExpansion.h.

Definition at line 96 of file StdExpansion0D.h.

Definition at line 112 of file StdExpansion1D.h.

Definition at line 203 of file StdExpansion2D.h.

Definition at line 49 of file StdExpansion3D.h.

Definition at line 1873 of file StdExpansion.h.

Definition at line 1874 of file StdExpansion.h.

Definition at line 1875 of file StdExpansion.h.

Definition at line 286 of file StdHexExp.h.

Definition at line 196 of file StdMatrixKey.h.

Definition at line 149 of file StdNodalPrismExp.h.

Definition at line 149 of file StdNodalTetExp.h.

Definition at line 193 of file StdNodalTriExp.h.

Definition at line 131 of file StdPointExp.h.

Definition at line 253 of file StdPrismExp.h.

Definition at line 258 of file StdPyrExp.h.

Definition at line 262 of file StdQuadExp.h.

Definition at line 47 of file StdSegExp.h.

Definition at line 268 of file StdTetExp.h.

Definition at line 267 of file StdTriExp.h.

Definition at line 226 of file StdRegions.hpp.

Enumeration Type Documentation

Enumerator
eStdSegExp 
eSegExp 
eStdQuadExp 
eStdTriExp 
eStdNodalTriExp 
eQuadExp 
eTriExp 
eNodalTriExp 
eStdHexExp 
eStdPrismExp 
eStdPyrExp 
eStdTetExp 
eStdNodalTetExp 
eHexExp 
ePrismExp 
ePyrExp 
eTetExp 
eNodalTetExp 
SIZE_ElementType 

Definition at line 52 of file StdRegions.hpp.

53  {
54  //eStdPointExp,
55  eStdSegExp,
56  eSegExp,
58  eStdTriExp,
60  eQuadExp,
61  eTriExp,
63  eStdHexExp,
65  eStdPyrExp,
66  eStdTetExp,
68  eHexExp,
69  ePrismExp,
70  ePyrExp,
71  eTetExp,
74  };
Enumerator
eEdgeToElement 
eFaceToElement 
eEdgeInterior 
eFaceInterior 
eBoundary 
eVertex 

Definition at line 254 of file StdRegions.hpp.

Todo:
we need to tidy up matrix construction approach probably using a factory type approach
Enumerator
eMass 
eInvMass 
eLaplacian 
eLaplacian00 
eLaplacian01 
eLaplacian02 
eLaplacian10 
eLaplacian11 
eLaplacian12 
eLaplacian20 
eLaplacian21 
eLaplacian22 
eInvLaplacianWithUnityMean 
eWeakDeriv0 
eWeakDeriv1 
eWeakDeriv2 
eWeakDirectionalDeriv 
eMassLevelCurvature 
eLinearAdvectionReaction 
eLinearAdvectionDiffusionReaction 
eNBasisTrans 
eInvNBasisTrans 
eBwdTrans 
eIProductWRTBase 
eIProductWRTDerivBase0 
eIProductWRTDerivBase1 
eIProductWRTDerivBase2 
eHelmholtz 
eHybridDGHelmholtz 
eInvHybridDGHelmholtz 
eHybridDGHelmBndLam 
eHybridDGLamToQ0 
eHybridDGLamToQ1 
eHybridDGLamToQ2 
eHybridDGLamToU 
eFwdTrans 
ePreconR 
ePreconRT 
ePreconRMass 
ePreconRTMass 
ePreconLinearSpace 
ePreconLinearSpaceMass 
eInterpGauss 
eGaussDG 
ePhysInterpToEquiSpaced 
eEquiSpacedToCoeffs 
SIZE_MatrixType 

Definition at line 101 of file StdRegions.hpp.

102  {
103  eMass,
104  eInvMass,
105  eLaplacian,
106  eLaplacian00,
107  eLaplacian01,
108  eLaplacian02,
109  eLaplacian10,
110  eLaplacian11,
111  eLaplacian12,
112  eLaplacian20,
113  eLaplacian21,
114  eLaplacian22,
116  eWeakDeriv0,
117  eWeakDeriv1,
118  eWeakDeriv2,
123  eNBasisTrans,
125  eBwdTrans,
130  eHelmholtz,
138  eFwdTrans,
139  ePreconR,
140  ePreconRT,
141  ePreconRMass,
145  eInterpGauss,
146  eGaussDG,
150  };
Enumerator
eNoOrientation 
eFwd 
eBwd 
eForwards 
eBackwards 
eDir1FwdDir1_Dir2FwdDir2 
eDir1FwdDir1_Dir2BwdDir2 
eDir1BwdDir1_Dir2FwdDir2 
eDir1BwdDir1_Dir2BwdDir2 
eDir1FwdDir2_Dir2FwdDir1 
eDir1FwdDir2_Dir2BwdDir1 
eDir1BwdDir2_Dir2FwdDir1 
eDir1BwdDir2_Dir2BwdDir1 
SIZE_Orientation 

Definition at line 274 of file StdRegions.hpp.

275  {
277  eFwd,
278  eBwd,
279  eForwards,
280  eBackwards,
281  eDir1FwdDir1_Dir2FwdDir2, // These flags are interpreted as
282  eDir1FwdDir1_Dir2BwdDir2, // taking the second direction to the
283  eDir1BwdDir1_Dir2FwdDir2, // first direction. So Dir1FwdDir2 takes
284  eDir1BwdDir1_Dir2BwdDir2, // direction 2 and makes it backward
285  eDir1FwdDir2_Dir2FwdDir1, // to direction 1 in the mapped face.
286  eDir1FwdDir2_Dir2BwdDir1, // Note be careful not to flip this
287  eDir1BwdDir2_Dir2FwdDir1, // convention especially when using
288  eDir1BwdDir2_Dir2BwdDir1, // transposed mappings.
290  };

Function Documentation

LibUtilities::BasisKey Nektar::StdRegions::EvaluateQuadFaceBasisKey ( const int  facedir,
const LibUtilities::BasisType  faceDirBasisType,
const int  numpoints,
const int  nummodes 
)

Definition at line 351 of file StdExpansion3D.cpp.

References ASSERTL0, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::LibUtilities::eModified_C, Nektar::LibUtilities::eOrtho_A, Nektar::LibUtilities::eOrtho_B, Nektar::LibUtilities::eOrtho_C, and Nektar::LibUtilities::NullBasisKey().

Referenced by Nektar::SpatialDomains::MeshGraph3D::GetFaceBasisKey(), Nektar::StdRegions::StdPrismExp::v_DetFaceBasisKey(), Nektar::StdRegions::StdHexExp::v_DetFaceBasisKey(), and Nektar::StdRegions::StdPyrExp::v_DetFaceBasisKey().

356  {
357 
358  switch(faceDirBasisType)
359  {
361  {
362  const LibUtilities::PointsKey pkey(
364  return LibUtilities::BasisKey(
365  LibUtilities::eModified_A, nummodes, pkey);
366  }
369  {
370  const LibUtilities::PointsKey pkey(
372  return LibUtilities::BasisKey(
373  LibUtilities::eModified_A, nummodes, pkey);
374  }
376  {
377  const LibUtilities::PointsKey pkey(
379  return LibUtilities::BasisKey(
380  LibUtilities::eGLL_Lagrange, nummodes, pkey);
381  }
383  {
384  const LibUtilities::PointsKey pkey(
386  return LibUtilities::BasisKey(
387  LibUtilities::eOrtho_A, nummodes, pkey);
388  }
391  {
392  const LibUtilities::PointsKey pkey(
394  return LibUtilities::BasisKey(
395  LibUtilities::eOrtho_A, nummodes, pkey);
396  }
397  default:
398  {
399  ASSERTL0(false, "expansion type unknown");
400  break;
401  }
402  }
403 
404  // Keep things happy by returning a value.
406  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
Principle Modified Functions .
Definition: BasisType.h:51
Principle Modified Functions .
Definition: BasisType.h:49
Principle Orthogonal Functions .
Definition: BasisType.h:47
Principle Modified Functions .
Definition: BasisType.h:50
Principle Orthogonal Functions .
Definition: BasisType.h:48
Principle Orthogonal Functions .
Definition: BasisType.h:46
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
Lagrange for SEM basis .
Definition: BasisType.h:53
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:50
LibUtilities::BasisKey Nektar::StdRegions::EvaluateTriFaceBasisKey ( const int  facedir,
const LibUtilities::BasisType  faceDirBasisType,
const int  numpoints,
const int  nummodes 
)

Definition at line 408 of file StdExpansion3D.cpp.

References ASSERTL0, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGaussRadauMAlpha1Beta0, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::LibUtilities::eModified_C, Nektar::LibUtilities::eOrtho_A, Nektar::LibUtilities::eOrtho_B, Nektar::LibUtilities::eOrtho_C, and Nektar::LibUtilities::NullBasisKey().

Referenced by Nektar::SpatialDomains::MeshGraph3D::GetFaceBasisKey(), Nektar::StdRegions::StdPrismExp::v_DetFaceBasisKey(), Nektar::StdRegions::StdTetExp::v_DetFaceBasisKey(), and Nektar::StdRegions::StdPyrExp::v_DetFaceBasisKey().

413  {
414  switch(faceDirBasisType)
415  {
417  {
418  const LibUtilities::PointsKey pkey(
420  return LibUtilities::BasisKey(
421  LibUtilities::eModified_A, nummodes, pkey);
422  }
425  {
426  switch (facedir)
427  {
428  case 0:
429  {
430  const LibUtilities::PointsKey pkey(
431  numpoints+1,
433  return LibUtilities::BasisKey(
434  LibUtilities::eModified_A, nummodes, pkey);
435  }
436  case 1:
437  {
438 // const LibUtilities::PointsKey pkey(
439 // numpoints+1,
440 // LibUtilities::eGaussLobattoLegendre);
441  const LibUtilities::PointsKey pkey(
442  numpoints,
444  return LibUtilities::BasisKey(
445  LibUtilities::eModified_B, nummodes, pkey);
446  }
447  default:
448  {
449 
450  ASSERTL0(false,"invalid value to flag");
451  break;
452  }
453  }
454  }
455 
457  {
458  switch (facedir)
459  {
460  case 0:
461  {
462  const LibUtilities::PointsKey pkey(
463  numpoints,
465  return LibUtilities::BasisKey(
466  LibUtilities::eOrtho_A, nummodes, pkey);
467  }
468  case 1:
469  {
470  const LibUtilities::PointsKey pkey(
471  numpoints,
473  return LibUtilities::BasisKey(
474  LibUtilities::eOrtho_B, nummodes, pkey);
475  }
476  default:
477  {
478  ASSERTL0(false,"invalid value to flag");
479  break;
480  }
481  }
482  }
483 
487  {
488  switch (facedir)
489  {
490  case 0:
491  {
492  const LibUtilities::PointsKey pkey(
493  numpoints,
495  return LibUtilities::BasisKey(
496  LibUtilities::eOrtho_A, nummodes, pkey);
497  }
498  case 1:
499  {
500  const LibUtilities::PointsKey pkey(
501  numpoints,
503  return LibUtilities::BasisKey(
504  LibUtilities::eOrtho_B, nummodes, pkey);
505  }
506  default:
507  {
508  ASSERTL0(false,"invalid value to flag");
509  break;
510  }
511  }
512  }
513  default:
514  {
515  ASSERTL0(false,"expansion type unknown");
516  break;
517  }
518  }
519 
520  // Keep things happy by returning a value.
522  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
Principle Modified Functions .
Definition: BasisType.h:51
Principle Modified Functions .
Definition: BasisType.h:49
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:57
Principle Orthogonal Functions .
Definition: BasisType.h:47
Principle Modified Functions .
Definition: BasisType.h:50
Principle Orthogonal Functions .
Definition: BasisType.h:48
Principle Orthogonal Functions .
Definition: BasisType.h:46
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
Lagrange for SEM basis .
Definition: BasisType.h:53
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:50
template<class InputIterator , class EqualityComparable >
InputIterator Nektar::StdRegions::find ( InputIterator  first,
InputIterator  last,
InputIterator  startingpoint,
const EqualityComparable &  value 
)

Definition at line 315 of file StdRegions.hpp.

Referenced by Nektar::Utilities::Iso::condense(), Nektar::SolverUtils::FilterThresholdMax::FilterThresholdMax(), Nektar::SolverUtils::FilterThresholdMin::FilterThresholdMin(), Nektar::SpatialDomains::MeshGraph::GetCompositeList(), Nektar::LibUtilities::AnalyticExpressionEvaluator::GetConstant(), Nektar::LibUtilities::SessionReader::GetGlobalSysSolnInfo(), Nektar::Utilities::ProcessMapping::GetMapping(), Nektar::LibUtilities::SessionReader::GetSolverInfoAsEnum(), Nektar::LibUtilities::SessionReader::GetValueAsEnum(), Nektar::SpatialDomains::PointGeom::IsElmtConnected(), Nektar::NekMeshUtils::SurfaceMesh::Mesh(), Nektar::NekMeshUtils::Face::operator==(), Nektar::NekMeshUtils::operator==(), Nektar::Utilities::InputCAD::Process(), Nektar::Utilities::ProcessCyl::Process(), Nektar::SpatialDomains::Domain::Read(), Nektar::SpatialDomains::BoundaryConditions::ReadBoundaryConditions(), Nektar::SpatialDomains::MeshGraph::ReadCurves(), Nektar::SpatialDomains::MeshGraph::ReadExpansions(), Nektar::LibUtilities::SessionReader::ReadGlobalSysSolnInfo(), Nektar::LibUtilities::SessionReader::ReadVariables(), Nektar::LibUtilities::SessionReader::RegisterEnumValue(), Nektar::StdRegions::StdPyrExp::StdPyrExp(), Nektar::FilterMovingBody::v_Initialise(), Nektar::SolverUtils::FilterAeroForces::v_Initialise(), Nektar::SpatialDomains::QuadGeom::v_IsElmtConnected(), Nektar::SpatialDomains::TriGeom::v_IsElmtConnected(), Nektar::SpatialDomains::SegGeom::v_IsElmtConnected(), Nektar::SpatialDomains::Geometry3D::v_IsElmtConnected(), and Nektar::Utilities::OutputNekpp::WriteXmlComposites().

318  {
319  InputIterator val;
320 
321  if(startingpoint == first)
322  {
323  val = find(first,last,value);
324  }
325  else
326  {
327  val = find(startingpoint,last,value);
328  if(val == last)
329  {
330  val = find(first,startingpoint,value);
331  if(val == startingpoint)
332  {
333  val = last;
334  }
335  }
336  }
337  return val;
338  }
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:315
template<typename T >
NekVector< T > Nektar::StdRegions::GetColumn ( const NekMatrix< T > &  matA,
int  n 
)

Definition at line 52 of file StdExpUtil.cpp.

53  {
54  NekVector<T> v(matA.GetRows());
55  for( int i=0; i<matA.GetRows(); ++i )
56  {
57  v[i] = matA(i,n);
58  }
59  return v;
60  }
int Nektar::StdRegions::GetDegree ( int  nBasisFunctions)

Definition at line 207 of file StdExpUtil.cpp.

References ASSERTL1, GetTriNumPoints(), and MakeRound().

Referenced by GetMonomialVandermonde(), GetXDerivativeOfMonomialVandermonde(), and GetYDerivativeOfMonomialVandermonde().

208  {
209  int degree = int(MakeRound((-3.0 + sqrt(1.0 + 8.0*nBasisFunctions))/2.0));
210 
211  // TODO: Find out why ASSERTL0 and ASSERTL1 don't work
212  ASSERTL1( GetTriNumPoints(degree) == nBasisFunctions, "The number of points defines an expansion of fractional degree, which is not supported." );
213  return degree;
214  }
NekDouble MakeRound(NekDouble x)
Definition: StdExpUtil.cpp:231
int GetTriNumPoints(int degree)
Definition: StdExpUtil.cpp:202
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:218
NekVector< NekDouble > Nektar::StdRegions::GetE ( int  rows,
int  n 
)

Definition at line 72 of file StdExpUtil.cpp.

Referenced by Invert().

73  {
74  NekVector<NekDouble> e(rows, 0.0);
75  e(n) = 1;
76  return e;
77  }
NekVector< NekDouble > Nektar::StdRegions::GetIntegralOfMonomialVandermonde ( int  degree)

Definition at line 497 of file StdExpUtil.cpp.

498  {
499  int cols = (degree + 1) * (degree + 2) / 2;
500  NekVector<NekDouble>integralMVandermonde(cols, 0.0);
501 
502  for(int d=0, n=0; d <= degree; ++d)
503  {
504  for(int p=0; p <= d; ++p, ++n)
505  {
506  int q = d - p;
507  int sp = 1 - 2 * (p % 2);
508  int sq = 1 - 2 * (q % 2);
509 
510  integralMVandermonde(n) = NekDouble(sp * (p+1) + sq * (q+1) + sp * sq * (p+q+2)) / ((p+1) * (q+1) * (p+q+2));
511  }
512  }
513  return integralMVandermonde;
514  }
double NekDouble
NekMatrix< NekDouble > Nektar::StdRegions::GetMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y,
int  degree 
)

Definition at line 236 of file StdExpUtil.cpp.

References GetSize().

Referenced by GetMonomialVandermonde().

237  {
238  int rows = GetSize(x);
239  int cols = (degree + 1)*(degree + 2)/2;
240  NekMatrix<NekDouble>matV(rows,cols, 0.0);
241 
242  for(int d=0, n=0; d <= degree; ++d)
243  {
244  for(int p=0; p <= d; ++p, ++n)
245  {
246  int q = d - p;
247 
248  for(int i=0; i<rows; ++i)
249  {
250  matV(i, n) = pow(x[i], p) * pow(y[i], q);
251  }
252  }
253  }
254  return matV;
255  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekMatrix< NekDouble > Nektar::StdRegions::GetMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y,
const NekVector< NekDouble > &  z,
int  degree 
)

Definition at line 257 of file StdExpUtil.cpp.

References GetSize().

259  {
260  int rows = GetSize(x);
261  int cols = (degree + 1) * (degree + 2) * (degree + 3)/6;
262 
263  NekMatrix<NekDouble> matV(rows, cols, 0.0);
264 
265  for(int d=0, n=0; d<=degree; ++d)
266  {
267  for(int p=0; p <= d; ++p)
268  {
269  for(int q=0; q <= d - p; ++q, ++n)
270  {
271  int r = d - p - q;
272 
273  // Set n-th column of V to the monomial vector
274  for(int i=0; i<rows; ++i)
275  {
276  matV(i,n) = pow(x[i],p) * pow(y[i],q) * pow(z[i],r);
277  }
278  }
279  }
280  }
281  return matV;
282  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekMatrix< NekDouble > Nektar::StdRegions::GetMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y,
const NekVector< NekDouble > &  z 
)

Definition at line 284 of file StdExpUtil.cpp.

References GetMonomialVandermonde(), GetSize(), and GetTetDegree().

285  {
286  int rows = GetSize(x);
287  int degree = GetTetDegree(rows);
288  return GetMonomialVandermonde(x, y, z, degree);
289  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
int GetTetDegree(int nBasisFunc)
Definition: StdExpUtil.cpp:222
NekMatrix< NekDouble > GetMonomialVandermonde(const NekVector< NekDouble > &x, const NekVector< NekDouble > &y)
Definition: StdExpUtil.cpp:291
NekMatrix< NekDouble > Nektar::StdRegions::GetMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y 
)

Definition at line 291 of file StdExpUtil.cpp.

References GetDegree(), GetMonomialVandermonde(), and GetSize().

292  {
293  int rows = GetSize(x);
294  int degree = GetDegree(rows);
295  return GetMonomialVandermonde(x, y, degree);
296  }
int GetDegree(int nBasisFunctions)
Definition: StdExpUtil.cpp:207
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekMatrix< NekDouble > GetMonomialVandermonde(const NekVector< NekDouble > &x, const NekVector< NekDouble > &y)
Definition: StdExpUtil.cpp:291
int Nektar::StdRegions::GetSize ( const Array< OneD, const NekDouble > &  x)

Definition at line 111 of file NodalUtil.cpp.

Referenced by Nektar::NekMatrix< DataType, StandardMatrixTag >::CalculateIndex(), Nektar::LibUtilities::DubinerPoly(), Nektar::LibUtilities::DubinerPolyXDerivative(), Nektar::LibUtilities::DubinerPolyYDerivative(), Nektar::LibUtilities::GetInterpolationMatrix(), Nektar::LibUtilities::GetMonomialVandermonde(), Nektar::LibUtilities::GetTetInterpolationMatrix(), Nektar::LibUtilities::GetTetVandermonde(), Nektar::LibUtilities::GetTetXDerivativeMatrix(), Nektar::LibUtilities::GetTetXDerivativeOfMonomialVandermonde(), Nektar::LibUtilities::GetTetYDerivativeOfMonomialVandermonde(), Nektar::LibUtilities::GetTetZDerivativeMatrix(), Nektar::LibUtilities::GetTetZDerivativeOfMonomialVandermonde(), Nektar::LibUtilities::GetVandermonde(), Nektar::LibUtilities::GetVandermondeForTetXDerivative(), Nektar::LibUtilities::GetVandermondeForTetYDerivative(), Nektar::LibUtilities::GetVandermondeForTetZDerivative(), Nektar::LibUtilities::GetVandermondeForXDerivative(), Nektar::LibUtilities::GetVandermondeForYDerivative(), Nektar::LibUtilities::GetXDerivativeMatrix(), Nektar::LibUtilities::GetXDerivativeOfMonomialVandermonde(), Nektar::LibUtilities::GetYDerivativeMatrix(), Nektar::LibUtilities::GetYDerivativeOfMonomialVandermonde(), Nektar::LibUtilities::Hadamard(), Nektar::LibUtilities::JacobiPoly(), Nektar::LibUtilities::JacobiPolyDerivative(), Nektar::LibUtilities::LegendrePoly(), Nektar::LibUtilities::LegendrePolyDerivative(), Nektar::LibUtilities::SessionReader::PartitionMesh(), Nektar::LibUtilities::TetrahedralBasis(), Nektar::LibUtilities::TetXDerivative(), Nektar::LibUtilities::TetYDerivative(), Nektar::LibUtilities::TetZDerivative(), Nektar::LibUtilities::ToArray(), ToVector(), and Nektar::LibUtilities::VectorPower().

112  {
113  return x.num_elements();
114  }
int Nektar::StdRegions::GetSize ( const ConstArray< OneD, NekDouble > &  x)
int Nektar::StdRegions::GetSize ( const NekVector< NekDouble > &  x)

Definition at line 116 of file StdExpUtil.cpp.

References Nektar::NekVector< DataType >::GetRows().

117  {
118  return x.GetRows();
119  }
int Nektar::StdRegions::GetTetDegree ( int  nBasisFunc)

Definition at line 222 of file StdExpUtil.cpp.

References ASSERTL1, GetTetNumPoints(), and MakeRound().

Referenced by GetMonomialVandermonde(), GetTetXDerivativeOfMonomialVandermonde(), GetTetYDerivativeOfMonomialVandermonde(), and GetTetZDerivativeOfMonomialVandermonde().

223  {
224  NekDouble eq = pow( 81.0 * nBasisFunc + 3.0 * sqrt(-3.0 + 729.0 * nBasisFunc * nBasisFunc), 1.0/3.0);
225  int degree = int(MakeRound(eq/3.0 + 1.0/eq - 1.0)) - 1;
226 
227  ASSERTL1( GetTetNumPoints(degree) == nBasisFunc, "The number of points defines an expansion of fractional degree, which is not supported." );
228  return degree;
229  }
NekDouble MakeRound(NekDouble x)
Definition: StdExpUtil.cpp:231
double NekDouble
int GetTetNumPoints(int degree)
Definition: StdExpUtil.cpp:216
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:218
int Nektar::StdRegions::GetTetNumPoints ( int  degree)

Definition at line 216 of file StdExpUtil.cpp.

Referenced by GetTetDegree().

217  {
218  return (degree+1) * (degree+2) * (degree+3) / 6;
219  }
NekMatrix< NekDouble > Nektar::StdRegions::GetTetXDerivativeOfMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y,
const NekVector< NekDouble > &  z,
int  degree 
)

Definition at line 336 of file StdExpUtil.cpp.

References GetSize().

Referenced by GetTetXDerivativeOfMonomialVandermonde().

338  {
339  int rows = GetSize(x);
340  int cols = (degree + 1) * (degree + 2) * (degree + 3) / 6;
341  NekMatrix<NekDouble> matVx(rows, cols, 0.0);
342  for(int d=0, n=0; d<=degree; ++d)
343  {
344  for(int p=0; p <= d; ++p)
345  {
346  for(int q=0; q <= d - p; ++q, ++n)
347  {
348  int r = d - p - q;
349  if(p > 0)
350  {
351  // Set n-th column of V to the monomial vector
352  for(int i=0; i<rows; ++i)
353  {
354  matVx(i,n) = p * pow(x[i],p-1.0) * pow(y[i],q) * pow(z[i],r);
355  }
356  }
357  else{
358  for(int j=0; j<rows; ++j)
359  {
360  matVx(j, n) = 0.0;
361  }
362  }
363  }
364  }
365  }
366  return matVx;
367  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekMatrix< NekDouble > Nektar::StdRegions::GetTetXDerivativeOfMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y,
const NekVector< NekDouble > &  z 
)

Definition at line 369 of file StdExpUtil.cpp.

References GetSize(), GetTetDegree(), and GetTetXDerivativeOfMonomialVandermonde().

371  {
372  int rows = GetSize(x);
373  int degree = GetTetDegree(rows);
374  return GetTetXDerivativeOfMonomialVandermonde(x, y, z, degree);
375  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
int GetTetDegree(int nBasisFunc)
Definition: StdExpUtil.cpp:222
NekMatrix< NekDouble > GetTetXDerivativeOfMonomialVandermonde(const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, const NekVector< NekDouble > &z)
Definition: StdExpUtil.cpp:369
NekMatrix< NekDouble > Nektar::StdRegions::GetTetYDerivativeOfMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y,
const NekVector< NekDouble > &  z,
int  degree 
)

Definition at line 377 of file StdExpUtil.cpp.

References GetSize().

Referenced by GetTetYDerivativeOfMonomialVandermonde().

379  {
380  int rows = GetSize(x);
381  int cols = (degree + 1) * (degree + 2) * (degree + 3) / 6;
382  NekMatrix<NekDouble> matVy(rows, cols, 0.0);
383  for(int d=0, n=0; d<=degree; ++d)
384  {
385  for(int p=0; p <= d; ++p)
386  {
387  for(int q=0; q <= d - p; ++q, ++n)
388  {
389  int r = d - p - q;
390  if(q > 0)
391  {
392  // Set n-th column of V to the monomial vector
393  for(int i=0; i<rows; ++i)
394  {
395  matVy(i,n) = q * pow(x[i],p) * pow(y[i],q-1.0) * pow(z[i],r);
396  }
397  }
398  else
399  {
400  for(int j=0; j<rows; ++j)
401  {
402  matVy(j, n) = 0.0;
403  }
404  }
405  }
406  }
407  }
408  return matVy;
409  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekMatrix< NekDouble > Nektar::StdRegions::GetTetYDerivativeOfMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y,
const NekVector< NekDouble > &  z 
)

Definition at line 411 of file StdExpUtil.cpp.

References GetSize(), GetTetDegree(), and GetTetYDerivativeOfMonomialVandermonde().

413  {
414  int rows = GetSize(x);
415  int degree = GetTetDegree(rows);
416  return GetTetYDerivativeOfMonomialVandermonde(x, y, z, degree);
417  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
int GetTetDegree(int nBasisFunc)
Definition: StdExpUtil.cpp:222
NekMatrix< NekDouble > GetTetYDerivativeOfMonomialVandermonde(const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, const NekVector< NekDouble > &z)
Definition: StdExpUtil.cpp:411
NekMatrix< NekDouble > Nektar::StdRegions::GetTetZDerivativeOfMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y,
const NekVector< NekDouble > &  z,
int  degree 
)

Definition at line 419 of file StdExpUtil.cpp.

References GetSize().

Referenced by GetTetZDerivativeOfMonomialVandermonde().

421  {
422  int rows = GetSize(x);
423  int cols = (degree + 1) * (degree + 2) * (degree + 3) / 6;
424  NekMatrix<NekDouble> matVz(rows, cols, 0.0);
425  for(int d=0, n=0; d<=degree; ++d)
426  {
427  for(int p=0; p <= d; ++p)
428  {
429  for(int q=0; q <= d - p; ++q, ++n)
430  {
431  int r = d - p - q;
432  if(r > 0)
433  {
434  // Set n-th column of V to the monomial vector
435  for(int i=0; i<rows; ++i)
436  {
437  matVz(i,n) = r * pow(x[i],p) * pow(y[i],q) * pow(z[i],r-1.0);
438  }
439  }
440  else{
441  for(int j=0; j<rows; ++j)
442  {
443  matVz(j, n) = 0.0;
444  }
445  }
446  }
447  }
448  }
449  return matVz;
450  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekMatrix< NekDouble > Nektar::StdRegions::GetTetZDerivativeOfMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y,
const NekVector< NekDouble > &  z 
)

Definition at line 452 of file StdExpUtil.cpp.

References GetSize(), GetTetDegree(), and GetTetZDerivativeOfMonomialVandermonde().

454  {
455  int rows = GetSize(x);
456  int degree = GetTetDegree(rows);
457  return GetTetZDerivativeOfMonomialVandermonde(x, y, z, degree);
458  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
int GetTetDegree(int nBasisFunc)
Definition: StdExpUtil.cpp:222
NekMatrix< NekDouble > GetTetZDerivativeOfMonomialVandermonde(const NekVector< NekDouble > &x, const NekVector< NekDouble > &y, const NekVector< NekDouble > &z)
Definition: StdExpUtil.cpp:452
NekMatrix< NekDouble > Nektar::StdRegions::GetTranspose ( const NekMatrix< NekDouble > &  matA)

Definition at line 96 of file StdExpUtil.cpp.

97  {
98  int rows = matA.GetRows(), columns = matA.GetColumns();
99  NekMatrix<NekDouble> matX(rows,columns);
100 
101  for( int i=0; i<rows; ++i )
102  {
103  for( int j=0; j<columns; ++j )
104  {
105  matX(j,i) = matA(i,j);
106  }
107  }
108  return matX;
109  }
int Nektar::StdRegions::GetTriNumPoints ( int  degree)

Definition at line 202 of file StdExpUtil.cpp.

Referenced by GetDegree().

203  {
204  return (degree+1) * (degree+2) / 2;
205  }
NekMatrix< NekDouble > Nektar::StdRegions::GetXDerivativeOfMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y,
int  degree 
)

Definition at line 298 of file StdExpUtil.cpp.

References GetSize().

Referenced by GetXDerivativeOfMonomialVandermonde().

299  {
300  int rows = GetSize(x);
301  int cols = (degree + 1) * (degree + 2) / 2;
302  NekMatrix<NekDouble> matVx(rows, cols, 0.0);
303 
304  for(int d=0, n=0; d <= degree; ++d)
305  {
306  for(int p=0; p <= d; ++p, ++n)
307  {
308  int q = d - p;
309 
310  if(p > 0)
311  {
312  for(int i=0; i<rows; ++i)
313  {
314  matVx(i, n) = p * pow(x[i], p-1.0) * pow(y[i],q);
315  }
316  }
317  else
318  {
319  for(int j=0; j<rows; ++j)
320  {
321  matVx(j, n) = 0.0;
322  }
323  }
324  }
325  }
326  return matVx;
327  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekMatrix< NekDouble > Nektar::StdRegions::GetXDerivativeOfMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y 
)

Definition at line 329 of file StdExpUtil.cpp.

References GetDegree(), GetSize(), and GetXDerivativeOfMonomialVandermonde().

330  {
331  int rows = GetSize(x);
332  int degree = GetDegree(rows);
333  return GetXDerivativeOfMonomialVandermonde(x, y, degree);
334  }
int GetDegree(int nBasisFunctions)
Definition: StdExpUtil.cpp:207
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekMatrix< NekDouble > GetXDerivativeOfMonomialVandermonde(const NekVector< NekDouble > &x, const NekVector< NekDouble > &y)
Definition: StdExpUtil.cpp:329
NekMatrix< NekDouble > Nektar::StdRegions::GetYDerivativeOfMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y,
int  degree 
)

Definition at line 460 of file StdExpUtil.cpp.

References GetSize().

Referenced by GetYDerivativeOfMonomialVandermonde().

461  {
462  int rows = GetSize(x);
463  int cols = (degree + 1) * (degree + 2) / 2;
464  NekMatrix<NekDouble> matVy(rows, cols, 0.0);
465 
466  for(int d=0, n=0; d <= degree; ++d)
467  {
468  for(int p=0; p <= d; ++p, ++n)
469  {
470  int q = d - p;
471  if(q > 0)
472  {
473  for(int i=0; i<rows; ++i)
474  {
475  matVy(i, n) = q * pow(x[i], p) * pow(y[i], q-1.0);
476  }
477  }
478  else
479  {
480  for(int j=0; j<rows; ++j)
481  {
482  matVy(j, n) = 0.0;
483  }
484  }
485  }
486  }
487  return matVy;
488  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekMatrix< NekDouble > Nektar::StdRegions::GetYDerivativeOfMonomialVandermonde ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y 
)

Definition at line 490 of file StdExpUtil.cpp.

References GetDegree(), GetSize(), and GetYDerivativeOfMonomialVandermonde().

491  {
492  int rows = GetSize(x);
493  int degree = GetDegree(rows);
494  return GetYDerivativeOfMonomialVandermonde(x, y, degree);
495  }
int GetDegree(int nBasisFunctions)
Definition: StdExpUtil.cpp:207
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekMatrix< NekDouble > GetYDerivativeOfMonomialVandermonde(const NekVector< NekDouble > &x, const NekVector< NekDouble > &y)
Definition: StdExpUtil.cpp:490
NekVector< NekDouble > Nektar::StdRegions::Hadamard ( const NekVector< NekDouble > &  x,
const NekVector< NekDouble > &  y 
)

Definition at line 131 of file StdExpUtil.cpp.

References GetSize().

132  {
133  int size = GetSize(x);
134  NekVector<NekDouble> z(size);
135 
136  for( int i=0; i<size; ++i )
137  {
138  z[i] = x[i] * y[i];
139  }
140  return z;
141  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekMatrix< NekDouble > Nektar::StdRegions::Invert ( const NekMatrix< NekDouble > &  matA)

Definition at line 79 of file StdExpUtil.cpp.

References GetE(), SetColumn(), and Nektar::LinearSystem::Solve().

80  {
81  int rows = matA.GetRows(), columns = matA.GetColumns();
82  NekMatrix<NekDouble> matX(rows,columns);
83 
84  // The linear system solver
85  LinearSystem<NekMatrix<NekDouble> > matL( SharedNekMatrixPtr(new NekMatrix<NekDouble>(matA)) );
86 
87  // Solve each column for the identity matrix
88  for( int j=0; j<columns; ++j )
89  {
90  SetColumn( matX, j, matL.Solve( GetE(rows,j) ) );
91  }
92 
93  return matX;
94  }
NekMatrix< NekDouble > & SetColumn(NekMatrix< NekDouble > &matA, int n, const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:62
NekVector< NekDouble > GetE(int rows, int n)
Definition: StdExpUtil.cpp:72
boost::shared_ptr< NekMatrix< NekDouble, StandardMatrixTag > > SharedNekMatrixPtr
NekDouble Nektar::StdRegions::MakeRound ( NekDouble  x)

Definition at line 231 of file StdExpUtil.cpp.

Referenced by GetDegree(), GetTetDegree(), MatrixToString(), and VectorToString().

232  {
233  return floor(x + 0.5);
234  }
std::string Nektar::StdRegions::MatrixToString ( const NekMatrix< NekDouble > &  A,
int  precision,
NekDouble  expSigFigs 
)

Definition at line 157 of file StdExpUtil.cpp.

References MakeRound().

158  {
159  stringstream s;
160  s << setprecision(precision);
161  int M = int(A.GetRows()), N = int(A.GetColumns());
162 
163  for(int i=0; i<M; ++i )
164  {
165  for(int j=0; j<N; ++j)
166  {
167  NekDouble a = MakeRound(expSigFigs * A(i, j)) / expSigFigs;
168  s << setw(7) << right << a;
169  if( j < N-1 )
170  {
171  s << ", ";
172  }
173  }
174  if( i < M-1 )
175  {
176  s << "\n";
177  }
178  }
179  return s.str();
180  }
NekDouble MakeRound(NekDouble x)
Definition: StdExpUtil.cpp:231
double NekDouble
bool Nektar::StdRegions::operator< ( const IndexMapKey &  lhs,
const IndexMapKey &  rhs 
)

Definition at line 90 of file IndexMapKey.cpp.

References Nektar::StdRegions::IndexMapKey::m_entityID, Nektar::StdRegions::IndexMapKey::m_indexMapType, Nektar::StdRegions::IndexMapKey::m_orientation, Nektar::StdRegions::IndexMapKey::m_p, Nektar::StdRegions::IndexMapKey::m_q, Nektar::StdRegions::IndexMapKey::m_r, and Nektar::StdRegions::IndexMapKey::m_shapeType.

91  {
92  if(lhs.m_indexMapType < rhs.m_indexMapType)
93  {
94  return true;
95  }
96 
97  if(lhs.m_indexMapType > rhs.m_indexMapType)
98  {
99  return false;
100  }
101 
102  if(lhs.m_shapeType < rhs.m_shapeType)
103  {
104  return true;
105  }
106  if(lhs.m_shapeType > rhs.m_shapeType)
107  {
108  return false;
109  }
110 
111  if(lhs.m_p < rhs.m_p)
112  {
113  return true;
114  }
115  if(lhs.m_p > rhs.m_p)
116  {
117  return false;
118  }
119 
120  if(lhs.m_q < rhs.m_q)
121  {
122  return true;
123  }
124  if(lhs.m_q > rhs.m_q)
125  {
126  return false;
127  }
128 
129  if(lhs.m_r < rhs.m_r)
130  {
131  return true;
132  }
133  if(lhs.m_r > rhs.m_r)
134  {
135  return false;
136  }
137 
138  if(lhs.m_entityID < rhs.m_entityID)
139  {
140  return true;
141  }
142  if(lhs.m_entityID > rhs.m_entityID)
143  {
144  return false;
145  }
146 
147  if(lhs.m_orientation < rhs.m_orientation)
148  {
149  return true;
150  }
151  if(lhs.m_orientation > rhs.m_orientation)
152  {
153  return false;
154  }
155 
156  return false;
157  }
StandardMatrixTag & lhs
bool Nektar::StdRegions::operator< ( const StdMatrixKey &  lhs,
const StdMatrixKey &  rhs 
)

Definition at line 102 of file StdMatrixKey.cpp.

References Nektar::StdRegions::StdMatrixKey::m_base, Nektar::StdRegions::StdMatrixKey::m_factors, Nektar::StdRegions::StdMatrixKey::m_matrixType, Nektar::StdRegions::StdMatrixKey::m_ncoeffs, Nektar::StdRegions::StdMatrixKey::m_nodalPointsType, Nektar::StdRegions::StdMatrixKey::m_shapeType, Nektar::StdRegions::StdMatrixKey::m_varcoeff_hashes, Nektar::StdRegions::StdMatrixKey::m_varcoeffs, and Nektar::LibUtilities::ShapeTypeDimMap.

103  {
104  if(lhs.m_matrixType < rhs.m_matrixType)
105  {
106  return true;
107  }
108 
109  if(lhs.m_matrixType > rhs.m_matrixType)
110  {
111  return false;
112  }
113 
114  if(lhs.m_ncoeffs < rhs.m_ncoeffs) // probably do not need this check since checking the m_base below?
115  {
116  return true;
117  }
118 
119  if(lhs.m_ncoeffs > rhs.m_ncoeffs)
120  {
121  return false;
122  }
123 
124  for(unsigned int i = 0; i < LibUtilities::ShapeTypeDimMap[lhs.m_shapeType]; ++i)
125  {
126  if(lhs.m_base[i].get() < rhs.m_base[i].get())
127  {
128  return true;
129  }
130 
131  if(lhs.m_base[i].get() > rhs.m_base[i].get())
132  {
133  return false;
134  }
135  }
136 
137  if(lhs.m_factors.size() < rhs.m_factors.size())
138  {
139  return true;
140  }
141  else if(lhs.m_factors.size() > rhs.m_factors.size())
142  {
143  return false;
144  }
145  else
146  {
147  ConstFactorMap::const_iterator x, y;
148  for(x = lhs.m_factors.begin(), y = rhs.m_factors.begin();
149  x != lhs.m_factors.end(); ++x, ++y)
150  {
151  if (x->second < y->second)
152  {
153  return true;
154  }
155  if (x->second > y->second)
156  {
157  return false;
158  }
159  }
160  }
161 
162  if(lhs.m_varcoeffs.size() < rhs.m_varcoeffs.size())
163  {
164  return true;
165  }
166 
167  if(lhs.m_varcoeffs.size() > rhs.m_varcoeffs.size())
168  {
169  return false;
170  }
171 
172  for (unsigned int i = 0; i < lhs.m_varcoeff_hashes.size(); ++i)
173  {
174  if(lhs.m_varcoeff_hashes[i] < rhs.m_varcoeff_hashes[i])
175  {
176  return true;
177  }
178  if(lhs.m_varcoeff_hashes[i] > rhs.m_varcoeff_hashes[i])
179  {
180  return false;
181  }
182  }
183 
184  if(lhs.m_nodalPointsType < rhs.m_nodalPointsType)
185  {
186  return true;
187  }
188 
189  if(lhs.m_nodalPointsType > rhs.m_nodalPointsType)
190  {
191  return false;
192  }
193 
194  return false;
195  }
StandardMatrixTag & lhs
const unsigned int ShapeTypeDimMap[SIZE_ShapeType]
Definition: ShapeType.hpp:81
std::ostream & Nektar::StdRegions::operator<< ( std::ostream &  os,
const IndexMapKey &  rhs 
)

Definition at line 199 of file IndexMapKey.cpp.

References Nektar::StdRegions::IndexMapKey::GetIndexMapType(), and IndexMapTypeMap.

200  {
201  os << "IndexMapType: " << IndexMapTypeMap[rhs.GetIndexMapType()]
202  << std::endl;
203  return os;
204  }
const char *const IndexMapTypeMap[]
Definition: StdRegions.hpp:264
std::ostream & Nektar::StdRegions::operator<< ( std::ostream &  os,
const StdMatrixKey &  rhs 
)

Definition at line 278 of file StdMatrixKey.cpp.

References ConstFactorTypeMap, Nektar::StdRegions::StdMatrixKey::GetBase(), Nektar::StdRegions::StdMatrixKey::GetConstFactors(), Nektar::StdRegions::StdMatrixKey::GetMatrixType(), Nektar::StdRegions::StdMatrixKey::GetNcoeffs(), Nektar::StdRegions::StdMatrixKey::GetShapeType(), Nektar::StdRegions::StdMatrixKey::GetVarCoeffHashes(), Nektar::StdRegions::StdMatrixKey::GetVarCoeffs(), MatrixTypeMap, Nektar::LibUtilities::ShapeTypeDimMap, Nektar::LibUtilities::ShapeTypeMap, and VarCoeffTypeMap.

279  {
280  os << "MatrixType: " << MatrixTypeMap[rhs.GetMatrixType()] << ", ShapeType: "
281  << LibUtilities::ShapeTypeMap[rhs.GetShapeType()] << ", Ncoeffs: " << rhs.GetNcoeffs()
282  << std::endl;
283 
284  if(rhs.GetConstFactors().size())
285  {
286  os << "Constants: " << endl;
287  ConstFactorMap::const_iterator x;
288  for(x = rhs.GetConstFactors().begin(); x != rhs.GetConstFactors().end(); ++x)
289  {
290  os << "\t value " << ConstFactorTypeMap[x->first] <<" : " << x->second << endl;
291  }
292  }
293  if(rhs.GetVarCoeffs().size())
294  {
295  os << "Variable coefficients: " << endl;
296  VarCoeffMap::const_iterator x;
297  unsigned int i = 0;
298  for (x = rhs.GetVarCoeffs().begin(); x != rhs.GetVarCoeffs().end(); ++x)
299  {
300  os << "\t Coeff defined: " << VarCoeffTypeMap[x->first] << endl;
301  os << "\t Hash: " << rhs.GetVarCoeffHashes()[i++] << endl;
302  }
303  }
304 
305  for(unsigned int i = 0; i < LibUtilities::ShapeTypeDimMap[rhs.GetShapeType()]; ++i)
306  {
307  os << rhs.GetBase()[i]->GetBasisKey();
308  }
309 
310  return os;
311  }
const char *const ConstFactorTypeMap[]
Definition: StdRegions.hpp:241
const char *const ShapeTypeMap[]
Definition: ShapeType.hpp:66
const char *const MatrixTypeMap[]
Definition: StdRegions.hpp:152
const char *const VarCoeffTypeMap[]
Definition: StdRegions.hpp:213
const unsigned int ShapeTypeDimMap[SIZE_ShapeType]
Definition: ShapeType.hpp:81
bool Nektar::StdRegions::operator== ( const IndexMapKey &  lhs,
const IndexMapKey &  rhs 
)

Definition at line 159 of file IndexMapKey.cpp.

References Nektar::StdRegions::IndexMapKey::m_entityID, Nektar::StdRegions::IndexMapKey::m_indexMapType, Nektar::StdRegions::IndexMapKey::m_orientation, Nektar::StdRegions::IndexMapKey::m_p, Nektar::StdRegions::IndexMapKey::m_q, Nektar::StdRegions::IndexMapKey::m_r, and Nektar::StdRegions::IndexMapKey::m_shapeType.

160  {
161  if(lhs.m_indexMapType != rhs.m_indexMapType)
162  {
163  return false;
164  }
165 
166  if(lhs.m_shapeType != rhs.m_shapeType)
167  {
168  return false;
169  }
170 
171  if(lhs.m_p != rhs.m_p)
172  {
173  return false;
174  }
175 
176  if(lhs.m_q != rhs.m_q)
177  {
178  return false;
179  }
180 
181  if(lhs.m_r != rhs.m_r)
182  {
183  return false;
184  }
185 
186  if(lhs.m_entityID != rhs.m_entityID)
187  {
188  return false;
189  }
190 
191  if(lhs.m_orientation != rhs.m_orientation)
192  {
193  return false;
194  }
195 
196  return true;
197  }
StandardMatrixTag & lhs
bool Nektar::StdRegions::operator== ( const StdMatrixKey &  lhs,
const StdMatrixKey &  rhs 
)

Definition at line 197 of file StdMatrixKey.cpp.

References Nektar::StdRegions::StdMatrixKey::m_base, Nektar::StdRegions::StdMatrixKey::m_factors, Nektar::StdRegions::StdMatrixKey::m_matrixType, Nektar::StdRegions::StdMatrixKey::m_ncoeffs, Nektar::StdRegions::StdMatrixKey::m_nodalPointsType, Nektar::StdRegions::StdMatrixKey::m_shapeType, Nektar::StdRegions::StdMatrixKey::m_varcoeff_hashes, Nektar::StdRegions::StdMatrixKey::m_varcoeffs, and Nektar::LibUtilities::ShapeTypeDimMap.

198  {
199  if(lhs.m_matrixType != rhs.m_matrixType)
200  {
201  return false;
202  }
203 
204  if(lhs.m_ncoeffs != rhs.m_ncoeffs)
205  {
206  return false;
207  }
208 
209  for(unsigned int i = 0; i < LibUtilities::ShapeTypeDimMap[lhs.m_shapeType]; ++i)
210  {
211  if(lhs.m_base[i].get() != rhs.m_base[i].get())
212  {
213  return false;
214  }
215  }
216 
217  if(lhs.m_factors.size() != rhs.m_factors.size())
218  {
219  return false;
220  }
221  else
222  {
223  ConstFactorMap::const_iterator x, y;
224  for(x = lhs.m_factors.begin(), y = rhs.m_factors.begin();
225  x != lhs.m_factors.end(); ++x, ++y)
226  {
227  if (x->second != y->second)
228  {
229  return false;
230  }
231  }
232  }
233 
234  if(lhs.m_nodalPointsType != rhs.m_nodalPointsType)
235  {
236  return false;
237  }
238 
239  if(lhs.m_varcoeffs.size() != rhs.m_varcoeffs.size())
240  {
241  return false;
242  }
243 
244  for (unsigned int i = 0; i < lhs.m_varcoeff_hashes.size(); ++i)
245  {
246  if(lhs.m_varcoeff_hashes[i] != rhs.m_varcoeff_hashes[i])
247  {
248  return false;
249  }
250  }
251 
252  VarCoeffMap::const_iterator x;
253  for (x = lhs.m_varcoeffs.begin(); x != lhs.m_varcoeffs.end(); ++x)
254  {
255  VarCoeffMap::const_iterator y;
256  // Check var coeff is found
257  if ((y = rhs.m_varcoeffs.find(x->first)) == rhs.m_varcoeffs.end())
258  {
259  return false;
260  }
261 
262  if (x->second != y->second)
263  {
264  return false;
265  }
266  }
267  for (unsigned int i = 0; i < lhs.m_varcoeffs.size(); ++i)
268  {
269  if(lhs.m_varcoeff_hashes[i] != rhs.m_varcoeff_hashes[i])
270  {
271  return false;
272  }
273  }
274 
275  return true;
276  }
StandardMatrixTag & lhs
const unsigned int ShapeTypeDimMap[SIZE_ShapeType]
Definition: ShapeType.hpp:81
NekMatrix< NekDouble > & Nektar::StdRegions::SetColumn ( NekMatrix< NekDouble > &  matA,
int  n,
const NekVector< NekDouble > &  x 
)

Definition at line 62 of file StdExpUtil.cpp.

Referenced by Invert().

63  {
64  for( int i=0; i<int(matA.GetRows()); ++i )
65  {
66  matA(i,n) = x[i];
67  }
68  return matA;
69  }
Array< OneD, NekDouble > Nektar::StdRegions::ToArray ( const NekVector< NekDouble > &  x)

Definition at line 126 of file StdExpUtil.cpp.

References Nektar::NekVector< DataType >::GetPtr(), and GetSize().

127  {
128  return Array<OneD, NekDouble>( GetSize(x), x.GetPtr() );
129  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekVector<NekDouble> Nektar::StdRegions::ToVector ( const Array< OneD, const NekDouble > &  x)

Definition at line 121 of file NodalUtil.cpp.

References Nektar::LibUtilities::GetSize().

122  {
123  return NekVector<NekDouble>( GetSize(x), x.data() );
124  }
int GetSize(const NekVector< NekDouble > &x)
Definition: NodalUtil.cpp:116
NekVector<NekDouble> Nektar::StdRegions::ToVector ( const ConstArray< OneD, NekDouble > &  x)

Definition at line 121 of file StdExpUtil.cpp.

References GetSize().

122  {
123  return NekVector<NekDouble>( GetSize(x), x.data() );
124  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
NekVector< NekDouble > Nektar::StdRegions::VectorPower ( const NekVector< NekDouble > &  x,
NekDouble  p 
)

Definition at line 143 of file StdExpUtil.cpp.

References GetSize().

144  {
145  int size = GetSize(x);
146  NekVector<NekDouble> z(size);
147 
148  for( int i=0; i<size; ++i )
149  {
150  z[i] = pow( x[i], p );
151  }
152 
153  return z;
154  }
int GetSize(const NekVector< NekDouble > &x)
Definition: StdExpUtil.cpp:116
std::string Nektar::StdRegions::VectorToString ( const NekVector< NekDouble > &  v,
int  precision,
NekDouble  expSigFigs 
)

Definition at line 183 of file StdExpUtil.cpp.

References Nektar::NekVector< DataType >::GetRows(), and MakeRound().

184  {
185  stringstream s;
186  s << setprecision(precision) << "[ ";
187  int N = int(v.GetRows());
188  for(int j=0; j<N; ++j )
189  {
190  NekDouble x = MakeRound(expSigFigs * v(j)) / expSigFigs;
191  s << setw(7) << right << x;
192  if( j < N-1 )
193  {
194  s << ", ";
195  }
196  }
197  s << " ]";
198  return s.str();
199  }
NekDouble MakeRound(NekDouble x)
Definition: StdExpUtil.cpp:231
double NekDouble

Variable Documentation

const char* const Nektar::StdRegions::ConstFactorTypeMap[]
Initial value:
= {
"FactorLambda",
"FactorTau",
"FactorTime",
"FactorSVVCutoffRatio",
"FactorSVVDiffCoeff",
"FactorGaussVertex",
"FactorGaussEdge",
"FactorConstant"
}

Definition at line 241 of file StdRegions.hpp.

Referenced by Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::MultiRegions::operator<<(), and operator<<().

const char* const Nektar::StdRegions::ElementTypeMap[]
Initial value:
=
{
"StdSegExp",
"SegExp",
"StdQuadExp",
"StdTriExp",
"StdNodalTriExp",
"QuadExp",
"TriExp",
"NodalTriExp",
"StdHexExp",
"StdPrismExp",
"StdPyrExp",
"StdTetExp",
"StdNodalTetExp",
"HexExp",
"PrismExp",
"PyrExp",
"TetExp",
"NodalTetExp",
}

Definition at line 76 of file StdRegions.hpp.

const char* const Nektar::StdRegions::IndexMapTypeMap[]
Initial value:
=
{
"EdgeToElement",
"FaceToElement",
"EdgeInterior",
"FaceInterior",
"Boundary",
"Vertex"
}

Definition at line 264 of file StdRegions.hpp.

Referenced by operator<<().

const char* const Nektar::StdRegions::MatrixTypeMap[]

Definition at line 152 of file StdRegions.hpp.

Referenced by Nektar::MultiRegions::operator<<(), and operator<<().

ConstFactorMap Nektar::StdRegions::NullConstFactorMap
static
VarCoeffMap Nektar::StdRegions::NullVarCoeffMap
static
const char* const Nektar::StdRegions::OrientationMap[]
Initial value:
=
{
"NoOrientation",
"Fwd",
"Bwd",
"Forwards",
"Backwards",
"Dir1FwdDir1_Dir2FwdDir2",
"Dir1FwdDir1_Dir2BwdDir2",
"Dir1BwdDir1_Dir2FwdDir2",
"Dir1BwdDir1_Dir2BwdDir2",
"Dir1FwdDir2_Dir2FwdDir1",
"Dir1FwdDir2_Dir2BwdDir1",
"Dir1BwdDir2_Dir2FwdDir1",
"Dir1BwdDir2_Dir2BwdDir1"
}

Definition at line 292 of file StdRegions.hpp.

const char* const Nektar::StdRegions::VarCoeffTypeMap[]
Initial value:
= {
"VarCoeffMass",
"VarCoeffLaplacian",
"VarCoeffWeakDeriv",
"VarCoeffD00",
"VarCoeffD11",
"VarCoeffD22",
"VarCoeffD01",
"VarCoeffD02",
"VarCoeffD12",
"VarCoeffVelX",
"VarCoeffVelY"
}

Definition at line 213 of file StdRegions.hpp.

Referenced by Nektar::StdRegions::StdMatrixKey::GetVarCoeff(), and operator<<().