Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Nektar::MultiRegions::GlobalMatrixKey Class Reference

Describes a matrix with ordering defined by a local to global map. More...

#include <GlobalMatrixKey.h>

Inheritance diagram for Nektar::MultiRegions::GlobalMatrixKey:
Inheritance graph
[legend]
Collaboration diagram for Nektar::MultiRegions::GlobalMatrixKey:
Collaboration graph
[legend]

Public Member Functions

 GlobalMatrixKey (const StdRegions::MatrixType matrixType, const AssemblyMapSharedPtr &locToGloMap=NullAssemblyMapSharedPtr, const StdRegions::ConstFactorMap &factors=StdRegions::NullConstFactorMap, const StdRegions::VarCoeffMap &varCoeffs=StdRegions::NullVarCoeffMap)
 
 GlobalMatrixKey (const GlobalMatrixKey &key, const LibUtilities::ShapeType shapeType)
 Copy constructor with change in expansion type. More...
 
 GlobalMatrixKey (const GlobalMatrixKey &key)
 Copy constructor. More...
 
virtual ~GlobalMatrixKey ()
 Destructor. More...
 
StdRegions::MatrixType GetMatrixType () const
 Return the matrix type. More...
 
LibUtilities::ShapeType GetShapeType () const
 Return the expansion type associated with key. More...
 
bool LocToGloMapIsDefined () const
 Returns true if a local to global map is defined. More...
 
int GetNConstFactors () const
 Returns the number of constants defined for this matrix. More...
 
NekDouble GetConstFactor (const StdRegions::ConstFactorType &factor) const
 Returns the requested constant. More...
 
const StdRegions::ConstFactorMapGetConstFactors () const
 Returns all the constants. More...
 
int GetNVarCoeffs () const
 
const Array< OneD, const
NekDouble > & 
GetVarCoeff (const StdRegions::VarCoeffType &coeff) const
 
const StdRegions::VarCoeffMapGetVarCoeffs () const
 

Protected Member Functions

 GlobalMatrixKey ()
 Default constructor. More...
 

Protected Attributes

StdRegions::MatrixType m_matrixType
 Stores the matrix type based on the enum StdRegions::MatrixType. More...
 
LibUtilities::ShapeType m_shapeType
 Stores the expansion/shape type that the matrix is to be based on. More...
 
StdRegions::ConstFactorMap m_constFactors
 
StdRegions::VarCoeffMap m_varCoeffs
 
AssemblyMapSharedPtr m_locToGloMap
 Pointer to the local to global mapping. More...
 

Friends

bool operator< (const GlobalMatrixKey &lhs, const GlobalMatrixKey &rhs)
 Provides ordering of GlobalMatrixKey objects. More...
 

Detailed Description

Describes a matrix with ordering defined by a local to global map.

Definition at line 48 of file GlobalMatrixKey.h.

Constructor & Destructor Documentation

Nektar::MultiRegions::GlobalMatrixKey::GlobalMatrixKey ( const StdRegions::MatrixType  matrixType,
const AssemblyMapSharedPtr locToGloMap = NullAssemblyMapSharedPtr,
const StdRegions::ConstFactorMap factors = StdRegions::NullConstFactorMap,
const StdRegions::VarCoeffMap varCoeffs = StdRegions::NullVarCoeffMap 
)

Definition at line 45 of file GlobalMatrixKey.cpp.

48  :
49  m_matrixType(matrixType),
51  m_constFactors(factors),
52  m_varCoeffs(varCoeffs),
53  m_locToGloMap(locToGloMap)
54  {
55  }
StdRegions::ConstFactorMap m_constFactors
AssemblyMapSharedPtr m_locToGloMap
Pointer to the local to global mapping.
LibUtilities::ShapeType m_shapeType
Stores the expansion/shape type that the matrix is to be based on.
StdRegions::MatrixType m_matrixType
Stores the matrix type based on the enum StdRegions::MatrixType.
Nektar::MultiRegions::GlobalMatrixKey::GlobalMatrixKey ( const GlobalMatrixKey key,
const LibUtilities::ShapeType  shapeType 
)

Copy constructor with change in expansion type.

Definition at line 57 of file GlobalMatrixKey.cpp.

58  :
59  m_matrixType(key.m_matrixType),
60  m_shapeType(shapeType),
61  m_constFactors(key.m_constFactors),
62  m_varCoeffs(key.m_varCoeffs),
63  m_locToGloMap(key.m_locToGloMap)
64  {
65  }
StdRegions::ConstFactorMap m_constFactors
AssemblyMapSharedPtr m_locToGloMap
Pointer to the local to global mapping.
LibUtilities::ShapeType m_shapeType
Stores the expansion/shape type that the matrix is to be based on.
StdRegions::MatrixType m_matrixType
Stores the matrix type based on the enum StdRegions::MatrixType.
Nektar::MultiRegions::GlobalMatrixKey::GlobalMatrixKey ( const GlobalMatrixKey key)

Copy constructor.

Definition at line 67 of file GlobalMatrixKey.cpp.

67  :
68  m_matrixType(key.m_matrixType),
69  m_shapeType(key.m_shapeType),
70  m_constFactors(key.m_constFactors),
71  m_varCoeffs(key.m_varCoeffs),
72  m_locToGloMap(key.m_locToGloMap)
73  {
74  }
StdRegions::ConstFactorMap m_constFactors
AssemblyMapSharedPtr m_locToGloMap
Pointer to the local to global mapping.
LibUtilities::ShapeType m_shapeType
Stores the expansion/shape type that the matrix is to be based on.
StdRegions::MatrixType m_matrixType
Stores the matrix type based on the enum StdRegions::MatrixType.
Nektar::MultiRegions::GlobalMatrixKey::~GlobalMatrixKey ( )
virtual

Destructor.

Definition at line 76 of file GlobalMatrixKey.cpp.

77  {
78  }
Nektar::MultiRegions::GlobalMatrixKey::GlobalMatrixKey ( )
protected

Default constructor.

Member Function Documentation

NekDouble Nektar::MultiRegions::GlobalMatrixKey::GetConstFactor ( const StdRegions::ConstFactorType factor) const
inline

Returns the requested constant.

error checking

Definition at line 143 of file GlobalMatrixKey.h.

References m_constFactors.

144  {
145  StdRegions::ConstFactorMap::const_iterator found = m_constFactors.find(factor);
146  return (*found).second;
147  }
StdRegions::ConstFactorMap m_constFactors
const StdRegions::ConstFactorMap & Nektar::MultiRegions::GlobalMatrixKey::GetConstFactors ( ) const
inline
StdRegions::MatrixType Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType ( ) const
inline

Return the matrix type.

Definition at line 116 of file GlobalMatrixKey.h.

References m_matrixType.

Referenced by Nektar::MultiRegions::GlobalLinSysDirectFull::AssembleFullMatrix(), Nektar::MultiRegions::GlobalLinSysXxtFull::AssembleMatrixArrays(), Nektar::MultiRegions::GlobalLinSysDirectStaticCond::DetermineMatrixStorage(), Nektar::MultiRegions::ExpList::GenBlockMatrix(), Nektar::MultiRegions::ExpList::GeneralMatrixOp_IterPerExp(), Nektar::MultiRegions::ExpList::GenGlobalMatrix(), Nektar::MultiRegions::ExpList::GenGlobalMatrixFull(), Nektar::MultiRegions::DisContField2D::GetGlobalBndLinSys(), Nektar::MultiRegions::DisContField3D::GetGlobalBndLinSys(), Nektar::MultiRegions::DisContField1D::GetGlobalBndLinSys(), Nektar::MultiRegions::operator<<(), Nektar::MultiRegions::PreconditionerLowEnergy::SetUpReferenceElements(), Nektar::MultiRegions::GlobalLinSysStaticCond::SetupTopLevel(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_AssembleSchurComplement(), Nektar::MultiRegions::PreconditionerBlock::v_BuildPreconditioner(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_DoMatrixMultiply(), Nektar::MultiRegions::GlobalLinSys::v_DropStaticCondBlock(), Nektar::MultiRegions::ContField3D::v_GeneralMatrixOp(), Nektar::MultiRegions::ContField2D::v_GeneralMatrixOp(), Nektar::MultiRegions::GlobalLinSys::v_GetBlock(), Nektar::MultiRegions::GlobalLinSys::v_GetStaticCondBlock(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_InitObject(), and Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_InitObject().

117  {
118  return m_matrixType;
119  }
StdRegions::MatrixType m_matrixType
Stores the matrix type based on the enum StdRegions::MatrixType.
int Nektar::MultiRegions::GlobalMatrixKey::GetNConstFactors ( ) const
inline

Returns the number of constants defined for this matrix.

Definition at line 137 of file GlobalMatrixKey.h.

References m_constFactors.

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

138  {
139  return m_constFactors.size();
140  }
StdRegions::ConstFactorMap m_constFactors
int Nektar::MultiRegions::GlobalMatrixKey::GetNVarCoeffs ( ) const
inline
LibUtilities::ShapeType Nektar::MultiRegions::GlobalMatrixKey::GetShapeType ( void  ) const
inline

Return the expansion type associated with key.

Definition at line 122 of file GlobalMatrixKey.h.

References m_shapeType.

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

123  {
124  return m_shapeType;
125  }
LibUtilities::ShapeType m_shapeType
Stores the expansion/shape type that the matrix is to be based on.
const Array< OneD, const NekDouble > & Nektar::MultiRegions::GlobalMatrixKey::GetVarCoeff ( const StdRegions::VarCoeffType coeff) const
inline

Definition at line 160 of file GlobalMatrixKey.h.

References m_varCoeffs.

161  {
162  StdRegions::VarCoeffMap::const_iterator found = m_varCoeffs.find(coeff);
163  return (*found).second;
164  }
const StdRegions::VarCoeffMap & Nektar::MultiRegions::GlobalMatrixKey::GetVarCoeffs ( ) const
inline
bool Nektar::MultiRegions::GlobalMatrixKey::LocToGloMapIsDefined ( void  ) const
inline

Returns true if a local to global map is defined.

Definition at line 127 of file GlobalMatrixKey.h.

References m_locToGloMap.

Referenced by Nektar::MultiRegions::ContField3D::GenGlobalLinSys(), Nektar::MultiRegions::ContField1D::GenGlobalLinSys(), Nektar::MultiRegions::ContField2D::GenGlobalLinSys(), Nektar::MultiRegions::ContField3D::GetGlobalMatrix(), Nektar::MultiRegions::ContField2D::GetGlobalMatrix(), Nektar::MultiRegions::ContField3D::GetGlobalMatrixNnz(), and Nektar::MultiRegions::ContField2D::GetGlobalMatrixNnz().

128  {
129  if( m_locToGloMap.get() == 0) //NullAssemblyMapSharedPtr)
130  {
131  return false;
132  }
133 
134  return true;
135  }
AssemblyMapSharedPtr m_locToGloMap
Pointer to the local to global mapping.

Friends And Related Function Documentation

bool operator< ( const GlobalMatrixKey lhs,
const GlobalMatrixKey rhs 
)
friend

Provides ordering of GlobalMatrixKey objects.

Definition at line 80 of file GlobalMatrixKey.cpp.

81  {
82  if(lhs.m_matrixType < rhs.m_matrixType)
83  {
84  return true;
85  }
86 
87  if(lhs.m_matrixType > rhs.m_matrixType)
88  {
89  return false;
90  }
91 
92 
93  if(lhs.m_shapeType < rhs.m_shapeType)
94  {
95  return true;
96  }
97 
98 
99  if(lhs.m_shapeType > rhs.m_shapeType)
100  {
101  return false;
102  }
103 
104  if(lhs.m_constFactors.size() < rhs.m_constFactors.size())
105  {
106  return true;
107  }
108  else if(lhs.m_constFactors.size() > rhs.m_constFactors.size())
109  {
110  return false;
111  }
112  else
113  {
114  StdRegions::ConstFactorMap::const_iterator x, y;
115  for(x = lhs.m_constFactors.begin(), y = rhs.m_constFactors.begin();
116  x != lhs.m_constFactors.end(); ++x, ++y)
117  {
118  if (x->second < y->second)
119  {
120  return true;
121  }
122  if (x->second > y->second)
123  {
124  return false;
125  }
126  }
127  }
128 
129  if(lhs.m_varCoeffs.size() < rhs.m_varCoeffs.size())
130  {
131  return true;
132  }
133  else if(lhs.m_varCoeffs.size() > rhs.m_varCoeffs.size())
134  {
135  return false;
136  }
137 // else
138 // {
139 // StdRegions::VarCoeffMap::const_iterator x, y;
140 // for (x = lhs.m_varCoeffs.begin(), y = rhs.m_varCoeffs.begin();
141 // x != lhs.m_varCoeffs.end(); ++x, ++y)
142 // {
143 // if (x->second.get() < y->second.get())
144 // {
145 // return true;
146 // }
147 // if (x->second.get() > y->second.get())
148 // {
149 // return false;
150 // }
151 // }
152 // }
153 
154  if(!rhs.m_locToGloMap.get())
155  {
156  return false;
157  }
158  else if(!lhs.m_locToGloMap.get() && rhs.m_locToGloMap.get() )
159  {
160  return true;
161  }
162  if(lhs.m_locToGloMap->GetHash() < rhs.m_locToGloMap->GetHash())
163  {
164  return true;
165  }
166 
167  return false;
168  }
StandardMatrixTag & lhs

Member Data Documentation

StdRegions::ConstFactorMap Nektar::MultiRegions::GlobalMatrixKey::m_constFactors
protected
AssemblyMapSharedPtr Nektar::MultiRegions::GlobalMatrixKey::m_locToGloMap
protected

Pointer to the local to global mapping.

Definition at line 103 of file GlobalMatrixKey.h.

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

StdRegions::MatrixType Nektar::MultiRegions::GlobalMatrixKey::m_matrixType
protected

Stores the matrix type based on the enum StdRegions::MatrixType.

Definition at line 93 of file GlobalMatrixKey.h.

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

LibUtilities::ShapeType Nektar::MultiRegions::GlobalMatrixKey::m_shapeType
protected

Stores the expansion/shape type that the matrix is to be based on.

Definition at line 97 of file GlobalMatrixKey.h.

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

StdRegions::VarCoeffMap Nektar::MultiRegions::GlobalMatrixKey::m_varCoeffs
protected