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. More... | |
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. More... | |
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. More... | |
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. More... | |
virtual | ~GlobalLinSys () |
const GlobalLinSysKey & | GetKey (void) const |
Returns the key associated with the system. More... | |
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. More... | |
boost::shared_ptr< GlobalLinSys > | GetSharedThisPtr () |
Returns a shared pointer to the current object. More... | |
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. More... | |
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. More... | |
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. More... | |
Static Public Attributes | |
static std::string | className |
Name of class. More... | |
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. More... | |
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. More... | |
void | DoConjugateGradient (const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const AssemblyMapSharedPtr &locToGloMap, const int pNumDir) |
Actual iterative solve. More... | |
void | Set_Rhs_Magnitude (const NekVector< NekDouble > &pIn) |
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. More... | |
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. More... | |
PreconditionerSharedPtr | CreatePrecon (AssemblyMapSharedPtr asmMap) |
Create a preconditioner object from the parameters defined in the supplied assembly map. More... | |
Protected Member Functions inherited from Nektar::MultiRegions::GlobalLinSysStaticCond | |
virtual int | v_GetNumBlocks () |
Get the number of blocks in this system. More... | |
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. More... | |
virtual void | v_Initialise (const boost::shared_ptr< AssemblyMap > &locToGloMap) |
Initialise this object. More... | |
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. More... | |
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. More... | |
void | PrepareLocalSchurComplement () |
Prepares local representation of Schur complement stored as a sparse block-diagonal matrix. More... | |
virtual void | v_DoMatrixMultiply (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) |
Perform a Shur-complement matrix multiply operation. More... | |
virtual void | v_UniqueMap () |
Private Attributes | |
DNekScalBlkMatSharedPtr | m_S1Blk |
std::vector< double > | m_storage |
Dense storage for block Schur complement matrix. More... | |
std::vector< const double * > | m_denseBlocks |
Vector of pointers to local matrix data. More... | |
Array< OneD, unsigned int > | m_rows |
Ranks of local matrices. More... | |
Array< OneD, NekDouble > | m_scale |
Scaling factors for local matrices. More... | |
DNekSmvBsrDiagBlkMatSharedPtr | m_sparseSchurCompl |
Sparse representation of Schur complement matrix at this level. More... | |
Static Private Attributes | |
static std::string | storagedef |
Utility strings. More... | |
static std::string | storagelookupIds [] |
Additional Inherited Members | |
Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSysIterative | |
Array< OneD, int > | m_map |
Global to universal unique map. More... | |
int | m_maxiter |
maximum iterations More... | |
NekDouble | m_tolerance |
Tolerance of iterative solver. More... | |
NekDouble | m_rhs_magnitude |
dot product of rhs to normalise stopping criterion More... | |
NekDouble | m_rhs_mag_sm |
cnt to how many times rhs_magnitude is called More... | |
PreconditionerSharedPtr | m_precon |
MultiRegions::PreconditionerType | m_precontype |
int | m_totalIterations |
bool | m_useProjection |
Whether to apply projection technique. More... | |
bool | m_root |
Provide verbose output and root if parallel. More... | |
bool | m_verbose |
boost::circular_buffer< Array < OneD, NekDouble > > | m_prevLinSol |
Storage for solutions to previous linear problems. More... | |
int | m_numPrevSols |
Total counter of previous solutions. More... | |
Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSys | |
const GlobalLinSysKey | m_linSysKey |
Key associated with this linear system. More... | |
const boost::weak_ptr< ExpList > | m_expList |
Local Matrix System. More... | |
const std::map< int, RobinBCInfoSharedPtr > | m_robinBCInfo |
Robin boundary info. More... | |
Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSysStaticCond | |
GlobalLinSysStaticCondSharedPtr | m_recursiveSchurCompl |
Schur complement for Direct Static Condensation. More... | |
DNekScalBlkMatSharedPtr | m_schurCompl |
Block Schur complement matrix. More... | |
DNekScalBlkMatSharedPtr | m_BinvD |
Block matrix. More... | |
DNekScalBlkMatSharedPtr | m_C |
Block matrix. More... | |
DNekScalBlkMatSharedPtr | m_invD |
Block matrix. More... | |
boost::shared_ptr< AssemblyMap > | m_locToGloMap |
Local to global map. More... | |
Array< OneD, NekDouble > | m_wsp |
Workspace array for matrix multiplication. More... | |
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 111 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 133 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, m_S1Blk, and Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl.
|
virtual |
Definition at line 202 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 323 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL1, Nektar::MultiRegions::eContiguous, Nektar::eFULL, Nektar::MultiRegions::eNonContiguous, Nektar::MultiRegions::eSparse, Nektar::NekConstants::kNekZeroTol, m_denseBlocks, Nektar::MultiRegions::GlobalLinSys::m_expList, m_rows, m_scale, Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl, m_sparseSchurCompl, m_storage, Vmath::Smul(), and Nektar::MultiRegions::GlobalLinSys::v_DropStaticCondBlock().
Referenced by v_AssembleSchurComplement().
|
privatevirtual |
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. |
Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.
Definition at line 230 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::convertCooToBco(), Nektar::MultiRegions::GlobalLinSys::CreatePrecon(), Nektar::eFULL, Nektar::MultiRegions::eIterativeMultiLevelStaticCond, Nektar::MultiRegions::GlobalLinSysKey::GetGlobalSysSolnType(), Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), 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, PrepareLocalSchurComplement(), and v_UniqueMap().
|
protectedvirtual |
Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.
Definition at line 564 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MultiRegions::GlobalLinSysIterative::m_precon.
|
protectedvirtual |
Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.
Definition at line 557 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MultiRegions::GlobalLinSysIterative::m_precon.
|
privatevirtual |
Perform a Shur-complement matrix multiply operation.
Implements Nektar::MultiRegions::GlobalLinSysIterative.
Definition at line 479 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 208 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::MultiRegions::GlobalLinSysStaticCond::m_locToGloMap, m_S1Blk, and Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl.
|
privatevirtual |
Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.
Definition at line 155 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::MultiRegions::GlobalLinSys::CreatePrecon(), Nektar::eDIAGONAL, Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), 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, and Nektar::MultiRegions::GlobalLinSysStaticCond::SetupTopLevel().
|
protectedvirtual |
Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.
Definition at line 529 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MultiRegions::GlobalLinSys::CreatePrecon(), Nektar::NekConstants::kNekUnsetDouble, Nektar::MultiRegions::GlobalLinSysStaticCond::m_locToGloMap, Nektar::MultiRegions::GlobalLinSysIterative::m_precon, Nektar::MultiRegions::GlobalLinSysIterative::m_rhs_magnitude, m_S1Blk, Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl, and Nektar::MultiRegions::GlobalLinSysIterative::Set_Rhs_Magnitude().
|
protectedvirtual |
Implements Nektar::MultiRegions::GlobalLinSysStaticCond.
Definition at line 570 of file GlobalLinSysIterativeStaticCond.cpp.
References Nektar::MultiRegions::GlobalLinSysIterative::m_precon.
|
privatevirtual |
Implements Nektar::MultiRegions::GlobalLinSysIterative.
Definition at line 524 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().
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 GlobalLinSysIterativeStaticCond(), 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.