Nektar++
|
A global linear system. More...
#include <GlobalLinSysIterativeStaticCond.h>
Public Types | |
typedef NekSparseDiagBlkMatrix < StorageSmvBsr< NekDouble > > | DNekSmvBsrDiagBlkMat |
typedef boost::shared_ptr < DNekSmvBsrDiagBlkMat > | DNekSmvBsrDiagBlkMatSharedPtr |
Public Member Functions | |
GlobalLinSysIterativeStaticCond (const GlobalLinSysKey &mkey, const boost::weak_ptr< ExpList > &pExpList, const boost::shared_ptr< AssemblyMap > &locToGloMap) | |
Constructor for full direct matrix solve. | |
GlobalLinSysIterativeStaticCond (const GlobalLinSysKey &mkey, const boost::weak_ptr< ExpList > &pExpList, const DNekScalBlkMatSharedPtr pSchurCompl, const DNekScalBlkMatSharedPtr pBinvD, const DNekScalBlkMatSharedPtr pC, const DNekScalBlkMatSharedPtr pInvD, const boost::shared_ptr< AssemblyMap > &locToGloMap, const PreconditionerSharedPtr pPrecon) | |
Constructor for full direct matrix solve. | |
virtual | ~GlobalLinSysIterativeStaticCond () |
Public Member Functions inherited from Nektar::MultiRegions::GlobalLinSysIterative | |
GlobalLinSysIterative (const GlobalLinSysKey &pKey, const boost::weak_ptr< ExpList > &pExpList, const boost::shared_ptr< AssemblyMap > &pLocToGloMap) | |
Constructor for full direct matrix solve. | |
virtual | ~GlobalLinSysIterative () |
Public Member Functions inherited from Nektar::MultiRegions::GlobalLinSys | |
GlobalLinSys (const GlobalLinSysKey &pKey, const boost::weak_ptr< ExpList > &pExpList, const boost::shared_ptr< AssemblyMap > &pLocToGloMap) | |
Constructor for full direct matrix solve. | |
virtual | ~GlobalLinSys () |
const GlobalLinSysKey & | GetKey (void) const |
Returns the key associated with the system. | |
const boost::weak_ptr< ExpList > & | GetLocMat (void) const |
void | InitObject () |
void | Initialise (const boost::shared_ptr< AssemblyMap > &pLocToGloMap) |
void | Solve (const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out, const AssemblyMapSharedPtr &locToGloMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray) |
Solve the linear system for given input and output vectors using a specified local to global map. | |
boost::shared_ptr< GlobalLinSys > | GetSharedThisPtr () |
Returns a shared pointer to the current object. | |
int | GetNumBlocks () |
DNekScalMatSharedPtr | GetBlock (unsigned int n) |
DNekScalBlkMatSharedPtr | GetStaticCondBlock (unsigned int n) |
void | DropStaticCondBlock (unsigned int n) |
void | SolveLinearSystem (const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const AssemblyMapSharedPtr &locToGloMap, const int pNumDir=0) |
Solve the linear system for given input and output vectors. | |
Public Member Functions inherited from Nektar::MultiRegions::GlobalLinSysStaticCond | |
GlobalLinSysStaticCond (const GlobalLinSysKey &mkey, const boost::weak_ptr< ExpList > &pExpList, const boost::shared_ptr< AssemblyMap > &locToGloMap) | |
Constructor for full direct matrix solve. | |
virtual | ~GlobalLinSysStaticCond () |
Static Public Member Functions | |
static GlobalLinSysSharedPtr | create (const GlobalLinSysKey &pLinSysKey, const boost::weak_ptr< ExpList > &pExpList, const boost::shared_ptr< AssemblyMap > &pLocToGloMap) |
Creates an instance of this class. |
Static Public Attributes | |
static std::string | className |
Name of class. | |
static std::string | className2 |
Protected Member Functions | |
virtual DNekScalBlkMatSharedPtr | v_GetStaticCondBlock (unsigned int n) |
Retrieves a the static condensation block matrices from n-th expansion using the matrix key provided by the m_linSysKey. | |
virtual GlobalLinSysStaticCondSharedPtr | v_Recurse (const GlobalLinSysKey &mkey, const boost::weak_ptr< ExpList > &pExpList, const DNekScalBlkMatSharedPtr pSchurCompl, const DNekScalBlkMatSharedPtr pBinvD, const DNekScalBlkMatSharedPtr pC, const DNekScalBlkMatSharedPtr pInvD, const boost::shared_ptr< AssemblyMap > &locToGloMap) |
virtual DNekScalBlkMatSharedPtr | v_PreSolve (int scLevel, NekVector< NekDouble > &F_GlobBnd) |
virtual void | v_BasisTransform (Array< OneD, NekDouble > &pInOut, int offset) |
virtual void | v_BasisInvTransform (Array< OneD, NekDouble > &pInOut) |
Protected Member Functions inherited from Nektar::MultiRegions::GlobalLinSysIterative | |
void | DoAconjugateProjection (const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const AssemblyMapSharedPtr &locToGloMap, const int pNumDir) |
A-conjugate projection technique. | |
void | DoConjugateGradient (const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const AssemblyMapSharedPtr &locToGloMap, const int pNumDir) |
Actual iterative solve. | |
void | Set_Rhs_Magnitude (const NekVector< NekDouble > &pIn) |
virtual void | v_UniqueMap ()=0 |
Protected Member Functions inherited from Nektar::MultiRegions::GlobalLinSys | |
virtual DNekScalMatSharedPtr | v_GetBlock (unsigned int n) |
Retrieves the block matrix from n-th expansion using the matrix key provided by the m_linSysKey. | |
virtual void | v_DropStaticCondBlock (unsigned int n) |
Releases the static condensation block matrices from NekManager of n-th expansion using the matrix key provided by the m_linSysKey. | |
Protected Member Functions inherited from Nektar::MultiRegions::GlobalLinSysStaticCond | |
virtual void | v_AssembleSchurComplement (boost::shared_ptr< AssemblyMap > pLoctoGloMap) |
virtual int | v_GetNumBlocks () |
Get the number of blocks in this system. | |
virtual void | v_Solve (const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out, const AssemblyMapSharedPtr &locToGloMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray) |
Solve the linear system for given input and output vectors using a specified local to global map. | |
virtual void | v_InitObject () |
virtual void | v_Initialise (const boost::shared_ptr< AssemblyMap > &locToGloMap) |
Initialise this object. | |
void | SetupTopLevel (const boost::shared_ptr< AssemblyMap > &locToGloMap) |
Set up the storage for the Schur complement or the top level of the multi-level Schur complement. | |
void | ConstructNextLevelCondensedSystem (const boost::shared_ptr< AssemblyMap > &locToGloMap) |
Private Member Functions | |
virtual void | v_InitObject () |
void | v_AssembleSchurComplement (const boost::shared_ptr< AssemblyMap > locToGloMap) |
Assemble the Schur complement matrix. | |
void | PrepareLocalSchurComplement () |
Prepares local representation of Schur complement stored as a sparse block-diagonal matrix. | |
virtual void | v_DoMatrixMultiply (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) |
Perform a Shur-complement matrix multiply operation. | |
virtual void | v_UniqueMap () |
Private Attributes | |
DNekScalBlkMatSharedPtr | m_S1Blk |
std::vector< double > | m_storage |
Dense storage for block Schur complement matrix. | |
std::vector< const double * > | m_denseBlocks |
Vector of pointers to local matrix data. | |
Array< OneD, unsigned int > | m_rows |
Ranks of local matrices. | |
Array< OneD, NekDouble > | m_scale |
Scaling factors for local matrices. | |
DNekSmvBsrDiagBlkMatSharedPtr | m_sparseSchurCompl |
Sparse representation of Schur complement matrix at this level. |
Static Private Attributes | |
static std::string | storagedef |
Utility strings. | |
static std::string | storagelookupIds [] |
Additional Inherited Members | |
Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSysIterative | |
Array< OneD, int > | m_map |
Global to universal unique map. | |
NekDouble | m_tolerance |
Tolerance of iterative solver. | |
NekDouble | m_rhs_magnitude |
dot product of rhs to normalise stopping criterion | |
PreconditionerSharedPtr | m_precon |
MultiRegions::PreconditionerType | m_precontype |
int | m_totalIterations |
bool | m_useProjection |
Whether to apply projection technique. | |
bool | m_root |
Provide verbose output and root if parallel. | |
bool | m_verbose |
boost::circular_buffer< Array < OneD, NekDouble > > | m_prevLinSol |
Storage for solutions to previous linear problems. | |
int | m_numPrevSols |
Total counter of previous solutions. | |
Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSysStaticCond | |
GlobalLinSysStaticCondSharedPtr | m_recursiveSchurCompl |
Schur complement for Direct Static Condensation. | |
DNekScalBlkMatSharedPtr | m_schurCompl |
Block Schur complement matrix. | |
DNekScalBlkMatSharedPtr | m_BinvD |
Block matrix. | |
DNekScalBlkMatSharedPtr | m_C |
Block matrix. | |
DNekScalBlkMatSharedPtr | m_invD |
Block matrix. | |
boost::shared_ptr< AssemblyMap > | m_locToGloMap |
Local to global map. | |
Array< OneD, NekDouble > | m_wsp |
Workspace array for matrix multiplication. |
A global linear system.
Solves a linear system iteratively using single- or multi-level static condensation.
Definition at line 72 of file GlobalLinSysIterativeStaticCond.h.
typedef NekSparseDiagBlkMatrix<StorageSmvBsr<NekDouble> > Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::DNekSmvBsrDiagBlkMat |
Definition at line 77 of file GlobalLinSysIterativeStaticCond.h.
typedef boost::shared_ptr<DNekSmvBsrDiagBlkMat> Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::DNekSmvBsrDiagBlkMatSharedPtr |
Definition at line 79 of file GlobalLinSysIterativeStaticCond.h.
Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::GlobalLinSysIterativeStaticCond | ( | const GlobalLinSysKey & | pKey, |
const boost::weak_ptr< ExpList > & | pExpList, | ||
const boost::shared_ptr< AssemblyMap > & | pLocToGloMap | ||
) |
Constructor for full direct matrix solve.
For a matrix system of the form
where and are invertible, store and assemble a static condensation system, according to a given local to global mapping. #m_linSys is constructed by AssembleSchurComplement().
mKey | Associated matrix key. |
pLocMatSys | LocalMatrixSystem |
locToGloMap | Local to global mapping. |
Definition at line 109 of file GlobalLinSysIterativeStaticCond.cpp.
References ASSERTL1, Nektar::MultiRegions::eIterativeMultiLevelStaticCond, Nektar::MultiRegions::eIterativeStaticCond, and Nektar::MultiRegions::GlobalLinSysKey::GetGlobalSysSolnType().
Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::GlobalLinSysIterativeStaticCond | ( | const GlobalLinSysKey & | mkey, |
const boost::weak_ptr< ExpList > & | pExpList, | ||
const DNekScalBlkMatSharedPtr | pSchurCompl, | ||
const DNekScalBlkMatSharedPtr | pBinvD, | ||
const DNekScalBlkMatSharedPtr | pC, | ||
const DNekScalBlkMatSharedPtr | pInvD, | ||
const boost::shared_ptr< AssemblyMap > & | locToGloMap, | ||
const PreconditionerSharedPtr | pPrecon | ||
) |
Constructor for full direct matrix solve.
Definition at line 131 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MultiRegions::GlobalLinSysStaticCond::m_BinvD, Nektar::MultiRegions::GlobalLinSysStaticCond::m_C, Nektar::MultiRegions::GlobalLinSysStaticCond::m_invD, Nektar::MultiRegions::GlobalLinSysIterative::m_precon, and Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl.
|
virtual |
Definition at line 204 of file GlobalLinSysIterativeStaticCond.cpp.
|
inlinestatic |
Creates an instance of this class.
Definition at line 82 of file GlobalLinSysIterativeStaticCond.h.
|
private |
Prepares local representation of Schur complement stored as a sparse block-diagonal matrix.
Populates sparse block-diagonal schur complement matrix from the block matrices stored in #m_blkMatrices.
Definition at line 329 of file GlobalLinSysIterativeStaticCond.cpp.
References ASSERTL1, Nektar::MultiRegions::eContiguous, Nektar::eFULL, Nektar::MultiRegions::eNonContiguous, Nektar::MultiRegions::eSparse, m_denseBlocks, Nektar::MultiRegions::GlobalLinSys::m_expList, m_rows, m_scale, Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl, m_sparseSchurCompl, m_storage, and Nektar::MultiRegions::GlobalLinSys::v_DropStaticCondBlock().
Referenced by v_AssembleSchurComplement().
|
private |
Assemble the Schur complement matrix.
Assemble the schur complement matrix from the block matrices stored in #m_blkMatrices and the given local to global mapping information.
locToGloMap | Local to global mapping information. |
Definition at line 232 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::convertCooToBco(), Nektar::LibUtilities::NekFactory< tKey, tBase, >::CreateInstance(), Nektar::eFULL, Nektar::MultiRegions::eIterativeMultiLevelStaticCond, Nektar::MultiRegions::GlobalLinSysKey::GetGlobalSysSolnType(), Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), Nektar::MultiRegions::GetPreconFactory(), Nektar::MultiRegions::GlobalLinSys::GetSharedThisPtr(), Nektar::MultiRegions::GlobalLinSys::m_expList, Nektar::MultiRegions::GlobalLinSys::m_linSysKey, Nektar::MultiRegions::GlobalLinSysStaticCond::m_locToGloMap, Nektar::MultiRegions::GlobalLinSysIterative::m_precon, Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl, m_sparseSchurCompl, Nektar::MultiRegions::PreconditionerTypeMap, PrepareLocalSchurComplement(), and v_UniqueMap().
|
protectedvirtual |
Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.
Definition at line 546 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MultiRegions::GlobalLinSysIterative::m_precon.
|
protectedvirtual |
Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.
Definition at line 539 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MultiRegions::GlobalLinSysIterative::m_precon.
|
privatevirtual |
Perform a Shur-complement matrix multiply operation.
Definition at line 474 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), m_denseBlocks, Nektar::MultiRegions::GlobalLinSys::m_expList, Nektar::MultiRegions::GlobalLinSys::m_linSysKey, Nektar::MultiRegions::GlobalLinSysStaticCond::m_locToGloMap, m_rows, m_scale, m_sparseSchurCompl, and Nektar::MultiRegions::GlobalLinSysStaticCond::m_wsp.
|
protectedvirtual |
Retrieves a the static condensation block matrices from n-th expansion using the matrix key provided by the m_linSysKey.
n | Number of the expansion |
Reimplemented from Nektar::MultiRegions::GlobalLinSys.
Definition at line 210 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MultiRegions::GlobalLinSysStaticCond::m_locToGloMap, m_S1Blk, and Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl.
|
privatevirtual |
Definition at line 152 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::LibUtilities::NekFactory< tKey, tBase, >::CreateInstance(), Nektar::eDIAGONAL, Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), Nektar::MultiRegions::GetPreconFactory(), Nektar::MultiRegions::GlobalLinSys::GetSharedThisPtr(), Nektar::MultiRegions::GlobalLinSys::Initialise(), Nektar::MultiRegions::GlobalLinSys::m_expList, Nektar::MultiRegions::GlobalLinSys::m_linSysKey, Nektar::MultiRegions::GlobalLinSysStaticCond::m_locToGloMap, Nektar::MultiRegions::GlobalLinSysIterative::m_precon, m_S1Blk, Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl, Nektar::MultiRegions::PreconditionerTypeMap, and Nektar::MultiRegions::GlobalLinSysStaticCond::SetupTopLevel().
|
protectedvirtual |
Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.
Definition at line 524 of file GlobalLinSysIterativeStaticCond.cpp.
References m_S1Blk, Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl, and Nektar::MultiRegions::GlobalLinSysIterative::Set_Rhs_Magnitude().
|
protectedvirtual |
Implements Nektar::MultiRegions::GlobalLinSysStaticCond.
Definition at line 552 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MultiRegions::GlobalLinSysIterative::m_precon.
|
privatevirtual |
Definition at line 519 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MultiRegions::GlobalLinSysStaticCond::m_locToGloMap, and Nektar::MultiRegions::GlobalLinSysIterative::m_map.
Referenced by v_AssembleSchurComplement().
|
static |
Name of class.
Registers the class with the Factory.
Definition at line 95 of file GlobalLinSysIterativeStaticCond.h.
|
static |
Definition at line 96 of file GlobalLinSysIterativeStaticCond.h.
|
private |
Vector of pointers to local matrix data.
Definition at line 142 of file GlobalLinSysIterativeStaticCond.h.
Referenced by PrepareLocalSchurComplement(), and v_DoMatrixMultiply().
|
private |
Ranks of local matrices.
Definition at line 144 of file GlobalLinSysIterativeStaticCond.h.
Referenced by PrepareLocalSchurComplement(), and v_DoMatrixMultiply().
|
private |
Definition at line 138 of file GlobalLinSysIterativeStaticCond.h.
Referenced by v_GetStaticCondBlock(), v_InitObject(), and v_PreSolve().
Scaling factors for local matrices.
Definition at line 146 of file GlobalLinSysIterativeStaticCond.h.
Referenced by PrepareLocalSchurComplement(), and v_DoMatrixMultiply().
|
private |
Sparse representation of Schur complement matrix at this level.
Definition at line 148 of file GlobalLinSysIterativeStaticCond.h.
Referenced by PrepareLocalSchurComplement(), v_AssembleSchurComplement(), and v_DoMatrixMultiply().
|
private |
Dense storage for block Schur complement matrix.
Definition at line 140 of file GlobalLinSysIterativeStaticCond.h.
Referenced by PrepareLocalSchurComplement().
|
staticprivate |
Utility strings.
Definition at line 150 of file GlobalLinSysIterativeStaticCond.h.
|
staticprivate |
Definition at line 151 of file GlobalLinSysIterativeStaticCond.h.