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.
 GlobalMatrixKey (const GlobalMatrixKey &key)
 Copy constructor.
virtual ~GlobalMatrixKey ()
 Destructor.
StdRegions::MatrixType GetMatrixType () const
 Return the matrix type.
LibUtilities::ShapeType GetShapeType () const
 Return the expansion type associated with key.
bool LocToGloMapIsDefined () const
 Returns true if a local to global map is defined.
int GetNConstFactors () const
 Returns the number of constants defined for this matrix.
NekDouble GetConstFactor (const StdRegions::ConstFactorType &factor) const
 Returns the requested constant.
const StdRegions::ConstFactorMapGetConstFactors () const
 Returns all the constants.
int GetNVarCoeffs () const
const Array< OneD, const
NekDouble > & 
GetVarCoeff (const StdRegions::VarCoeffType &coeff) const
const StdRegions::VarCoeffMapGetVarCoeffs () const

Protected Member Functions

 GlobalMatrixKey ()
 Default constructor.

Protected Attributes

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

Friends

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

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 43 of file GlobalMatrixKey.cpp.

:
m_matrixType(matrixType),
m_constFactors(factors),
m_varCoeffs(varCoeffs),
m_locToGloMap(locToGloMap)
{
}
Nektar::MultiRegions::GlobalMatrixKey::GlobalMatrixKey ( const GlobalMatrixKey key,
const LibUtilities::ShapeType  shapeType 
)

Copy constructor with change in expansion type.

Definition at line 55 of file GlobalMatrixKey.cpp.

:
m_matrixType(key.m_matrixType),
m_shapeType(shapeType),
m_constFactors(key.m_constFactors),
m_varCoeffs(key.m_varCoeffs),
m_locToGloMap(key.m_locToGloMap)
{
}
Nektar::MultiRegions::GlobalMatrixKey::GlobalMatrixKey ( const GlobalMatrixKey key)

Copy constructor.

Definition at line 65 of file GlobalMatrixKey.cpp.

:
m_matrixType(key.m_matrixType),
m_shapeType(key.m_shapeType),
m_constFactors(key.m_constFactors),
m_varCoeffs(key.m_varCoeffs),
m_locToGloMap(key.m_locToGloMap)
{
}
Nektar::MultiRegions::GlobalMatrixKey::~GlobalMatrixKey ( )
virtual

Destructor.

Definition at line 74 of file GlobalMatrixKey.cpp.

{
}
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.

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

Returns all the constants.

Definition at line 150 of file GlobalMatrixKey.h.

References m_constFactors.

Referenced by Nektar::MultiRegions::ExpList::GenBlockMatrix(), Nektar::MultiRegions::ExpList::GeneralMatrixOp_IterPerExp(), Nektar::MultiRegions::ExpList::GenGlobalMatrix(), Nektar::MultiRegions::ExpList::GenGlobalMatrixFull(), Nektar::MultiRegions::operator<<(), Nektar::MultiRegions::PreconditionerLowEnergy::SetUpReferenceElements(), Nektar::MultiRegions::GlobalLinSys::v_DropStaticCondBlock(), Nektar::MultiRegions::GlobalLinSys::v_GetBlock(), and Nektar::MultiRegions::GlobalLinSys::v_GetStaticCondBlock().

{
}
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::DisContField3D::GetGlobalBndLinSys(), Nektar::MultiRegions::DisContField2D::GetGlobalBndLinSys(), Nektar::MultiRegions::DisContField1D::GetGlobalBndLinSys(), Nektar::MultiRegions::operator<<(), Nektar::MultiRegions::PreconditionerLowEnergy::SetUpReferenceElements(), Nektar::MultiRegions::GlobalLinSysStaticCond::SetupTopLevel(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_AssembleSchurComplement(), 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(), and Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_InitObject().

{
return m_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<<().

{
return m_constFactors.size();
}
int Nektar::MultiRegions::GlobalMatrixKey::GetNVarCoeffs ( ) const
inline

Definition at line 155 of file GlobalMatrixKey.h.

References m_varCoeffs.

Referenced by Nektar::MultiRegions::ExpList::GenBlockMatrix(), Nektar::MultiRegions::ExpList::GeneralMatrixOp_IterPerExp(), Nektar::MultiRegions::ExpList::GenGlobalMatrix(), Nektar::MultiRegions::ExpList::GenGlobalMatrixFull(), Nektar::MultiRegions::operator<<(), Nektar::MultiRegions::PreconditionerLowEnergy::SetUpReferenceElements(), Nektar::MultiRegions::GlobalLinSys::v_DropStaticCondBlock(), Nektar::MultiRegions::GlobalLinSys::v_GetBlock(), and Nektar::MultiRegions::GlobalLinSys::v_GetStaticCondBlock().

{
return m_varCoeffs.size();
}
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<<().

{
return m_shapeType;
}
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.

{
StdRegions::VarCoeffMap::const_iterator found = m_varCoeffs.find(coeff);
return (*found).second;
}
const StdRegions::VarCoeffMap & Nektar::MultiRegions::GlobalMatrixKey::GetVarCoeffs ( ) const
inline

Definition at line 166 of file GlobalMatrixKey.h.

References m_varCoeffs.

Referenced by Nektar::MultiRegions::ExpList::GenBlockMatrix(), Nektar::MultiRegions::ExpList::GeneralMatrixOp_IterPerExp(), Nektar::MultiRegions::ExpList::GenGlobalMatrix(), Nektar::MultiRegions::ExpList::GenGlobalMatrixFull(), Nektar::MultiRegions::PreconditionerLowEnergy::SetUpReferenceElements(), Nektar::MultiRegions::GlobalLinSys::v_DropStaticCondBlock(), Nektar::MultiRegions::GlobalLinSys::v_GetBlock(), and Nektar::MultiRegions::GlobalLinSys::v_GetStaticCondBlock().

{
return m_varCoeffs;
}
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().

{
if( m_locToGloMap.get() == 0) //NullAssemblyMapSharedPtr)
{
return false;
}
return true;
}

Friends And Related Function Documentation

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

Provides ordering of GlobalMatrixKey objects.

Definition at line 78 of file GlobalMatrixKey.cpp.

{
if(lhs.m_matrixType < rhs.m_matrixType)
{
return true;
}
if(lhs.m_matrixType > rhs.m_matrixType)
{
return false;
}
if(lhs.m_shapeType < rhs.m_shapeType)
{
return true;
}
if(lhs.m_shapeType > rhs.m_shapeType)
{
return false;
}
if(lhs.m_constFactors.size() < rhs.m_constFactors.size())
{
return true;
}
else if(lhs.m_constFactors.size() > rhs.m_constFactors.size())
{
return false;
}
else
{
StdRegions::ConstFactorMap::const_iterator x, y;
for(x = lhs.m_constFactors.begin(), y = rhs.m_constFactors.begin();
x != lhs.m_constFactors.end(); ++x, ++y)
{
if (x->second < y->second)
{
return true;
}
if (x->second > y->second)
{
return false;
}
}
}
if(lhs.m_varCoeffs.size() < rhs.m_varCoeffs.size())
{
return true;
}
else if(lhs.m_varCoeffs.size() > rhs.m_varCoeffs.size())
{
return false;
}
// else
// {
// StdRegions::VarCoeffMap::const_iterator x, y;
// for (x = lhs.m_varCoeffs.begin(), y = rhs.m_varCoeffs.begin();
// x != lhs.m_varCoeffs.end(); ++x, ++y)
// {
// if (x->second.get() < y->second.get())
// {
// return true;
// }
// if (x->second.get() > y->second.get())
// {
// return false;
// }
// }
// }
if(!rhs.m_locToGloMap.get())
{
return false;
}
else if(!lhs.m_locToGloMap.get() && rhs.m_locToGloMap.get() )
{
return true;
}
if(lhs.m_locToGloMap->GetHash() < rhs.m_locToGloMap->GetHash())
{
return true;
}
return false;
}

Member Data Documentation

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

Definition at line 99 of file GlobalMatrixKey.h.

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

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

Definition at line 100 of file GlobalMatrixKey.h.

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