Nektar++
|
A global linear system. More...
#include <GlobalLinSysStaticCond.h>
Public Member Functions | |
GlobalLinSysStaticCond (const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &locToGloMap) | |
Constructor for full direct matrix solve. More... | |
~GlobalLinSysStaticCond () override | |
Public Member Functions inherited from Nektar::MultiRegions::GlobalLinSys | |
GlobalLinSys (const GlobalLinSysKey &pKey, const std::weak_ptr< ExpList > &pExpList, const std::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 std::weak_ptr< ExpList > & | GetLocMat (void) const |
void | InitObject () |
void | Initialise (const std::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... | |
std::shared_ptr< GlobalLinSys > | GetSharedThisPtr () |
Returns a shared pointer to the current object. More... | |
int | GetNumBlocks () |
DNekScalMatSharedPtr | GetBlock (unsigned int n) |
void | DropBlock (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... | |
Protected Member Functions | |
virtual void | v_PreSolve (int scLevel, Array< OneD, NekDouble > &F_bnd) |
virtual void | v_BasisFwdTransform (Array< OneD, NekDouble > &pInOut) |
virtual void | v_CoeffsBwdTransform (Array< OneD, NekDouble > &pInOut) |
virtual void | v_CoeffsFwdTransform (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) |
virtual void | v_AssembleSchurComplement (std::shared_ptr< AssemblyMap > pLoctoGloMap) |
int | v_GetNumBlocks () override |
Get the number of blocks in this system. More... | |
virtual GlobalLinSysStaticCondSharedPtr | v_Recurse (const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const DNekScalBlkMatSharedPtr pSchurCompl, const DNekScalBlkMatSharedPtr pBinvD, const DNekScalBlkMatSharedPtr pC, const DNekScalBlkMatSharedPtr pInvD, const std::shared_ptr< AssemblyMap > &locToGloMap)=0 |
void | v_Solve (const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out, const AssemblyMapSharedPtr &locToGloMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray) override |
Solve the linear system for given input and output vectors using a specified local to global map. More... | |
void | v_InitObject () override |
void | v_Initialise (const std::shared_ptr< AssemblyMap > &locToGloMap) override |
Initialise this object. More... | |
void | SetupTopLevel (const std::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 std::shared_ptr< AssemblyMap > &locToGloMap) |
Protected Member Functions inherited from Nektar::MultiRegions::GlobalLinSys | |
virtual void | v_Solve (const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out, const AssemblyMapSharedPtr &locToGloMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)=0 |
Solve a linear system based on mapping. More... | |
virtual void | v_SolveLinearSystem (const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const AssemblyMapSharedPtr &locToGloMap, const int pNumDir)=0 |
Solve a basic matrix system. More... | |
virtual void | v_InitObject () |
virtual void | v_Initialise (const std::shared_ptr< AssemblyMap > &pLocToGloMap) |
virtual int | v_GetNumBlocks () |
Get the number of blocks in this system. More... | |
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_DropBlock (unsigned int n) |
Releases the local block matrix from NekManager of n-th expansion using the matrix key provided by the m_linSysKey. More... | |
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 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 Attributes | |
GlobalLinSysStaticCondSharedPtr | m_recursiveSchurCompl |
Schur complement for Direct Static Condensation. More... | |
DNekScalBlkMatSharedPtr | m_schurCompl |
Block Schur complement matrix. More... | |
DNekScalBlkMatSharedPtr | m_BinvD |
Block \( BD^{-1} \) matrix. More... | |
DNekScalBlkMatSharedPtr | m_C |
Block \( C \) matrix. More... | |
DNekScalBlkMatSharedPtr | m_invD |
Block \( D^{-1} \) matrix. More... | |
std::weak_ptr< AssemblyMap > | m_locToGloMap |
Local to global map. More... | |
Array< OneD, NekDouble > | m_wsp |
Workspace array for matrix multiplication. More... | |
Array< OneD, const NekDouble > | m_sign |
Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSys | |
const GlobalLinSysKey | m_linSysKey |
Key associated with this linear system. More... | |
const std::weak_ptr< ExpList > | m_expList |
Local Matrix System. More... | |
const std::map< int, RobinBCInfoSharedPtr > | m_robinBCInfo |
Robin boundary info. More... | |
bool | m_verbose |
A global linear system.
Solves a linear system using single- or multi-level static condensation.
Definition at line 51 of file GlobalLinSysStaticCond.h.
Nektar::MultiRegions::GlobalLinSysStaticCond::GlobalLinSysStaticCond | ( | const GlobalLinSysKey & | pKey, |
const std::weak_ptr< ExpList > & | pExpList, | ||
const std::shared_ptr< AssemblyMap > & | pLocToGloMap | ||
) |
Constructor for full direct matrix solve.
For a matrix system of the form
\[ \left[ \begin{array}{cc} \boldsymbol{A} & \boldsymbol{B}\\ \boldsymbol{C} & \boldsymbol{D} \end{array} \right] \left[ \begin{array}{c} \boldsymbol{x_1}\\ \boldsymbol{x_2} \end{array}\right] = \left[ \begin{array}{c} \boldsymbol{y_1}\\ \boldsymbol{y_2} \end{array}\right], \]
where \(\boldsymbol{D}\) and \((\boldsymbol{A-BD^{-1}C})\) 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 72 of file GlobalLinSysStaticCond.cpp.
|
override |
Definition at line 91 of file GlobalLinSysStaticCond.cpp.
|
protected |
Definition at line 311 of file GlobalLinSysStaticCond.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Blas::Dgemm(), Nektar::eDIAGONAL, Nektar::eFULL, Nektar::StdRegions::eHelmholtz, Nektar::StdRegions::eLaplacian, Nektar::StdRegions::eMass, Nektar::eSYMMETRIC, Nektar::eWrapper, Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), Nektar::MultiRegions::GlobalLinSys::m_expList, Nektar::MultiRegions::GlobalLinSys::m_linSysKey, m_recursiveSchurCompl, m_schurCompl, sign, and v_Recurse().
Referenced by v_Initialise().
|
protected |
Set up the storage for the Schur complement or the top level of the multi-level Schur complement.
For the first level in multi-level static condensation, or the only level in the case of single-level static condensation, allocate the condensed matrices and populate them with the local matrices retrieved from the expansion list.
Definition at line 266 of file GlobalLinSysStaticCond.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::eDIAGONAL, Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), m_BinvD, m_C, Nektar::MultiRegions::GlobalLinSys::m_expList, m_invD, Nektar::MultiRegions::GlobalLinSys::m_linSysKey, m_schurCompl, Nektar::MultiRegions::GlobalLinSys::v_GetBlock(), and Nektar::MultiRegions::GlobalLinSys::v_GetStaticCondBlock().
Referenced by Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_InitObject(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_InitObject(), and v_InitObject().
|
inlineprotectedvirtual |
Reimplemented in Nektar::MultiRegions::GlobalLinSysIterativeStaticCond, Nektar::MultiRegions::GlobalLinSysPETScStaticCond, Nektar::MultiRegions::GlobalLinSysXxtStaticCond, and Nektar::MultiRegions::GlobalLinSysDirectStaticCond.
Definition at line 83 of file GlobalLinSysStaticCond.h.
Referenced by v_Initialise().
|
inlineprotectedvirtual |
Reimplemented in Nektar::MultiRegions::GlobalLinSysIterativeStaticCond, and Nektar::MultiRegions::GlobalLinSysPETScStaticCond.
Definition at line 67 of file GlobalLinSysStaticCond.h.
Referenced by v_Solve().
|
inlineprotectedvirtual |
Reimplemented in Nektar::MultiRegions::GlobalLinSysIterativeStaticCond, and Nektar::MultiRegions::GlobalLinSysPETScStaticCond.
Definition at line 72 of file GlobalLinSysStaticCond.h.
Referenced by v_Solve().
|
inlineprotectedvirtual |
Reimplemented in Nektar::MultiRegions::GlobalLinSysIterativeStaticCond, and Nektar::MultiRegions::GlobalLinSysPETScStaticCond.
Definition at line 77 of file GlobalLinSysStaticCond.h.
Referenced by v_Solve().
|
overrideprotectedvirtual |
Get the number of blocks in this system.
At the top level this corresponds to the number of elements in the expansion list.
Reimplemented from Nektar::MultiRegions::GlobalLinSys.
Definition at line 254 of file GlobalLinSysStaticCond.cpp.
References m_schurCompl.
|
overrideprotectedvirtual |
Initialise this object.
If at the last level of recursion (or the only level in the case of single-level static condensation), assemble the Schur complement. For other levels, in the case of multi-level static condensation, the next level of the condensed system is computed.
pLocToGloMap | Local to global mapping. |
Reimplemented from Nektar::MultiRegions::GlobalLinSys.
Definition at line 236 of file GlobalLinSysStaticCond.cpp.
References ConstructNextLevelCondensedSystem(), m_locToGloMap, m_wsp, and v_AssembleSchurComplement().
|
overrideprotectedvirtual |
Reimplemented from Nektar::MultiRegions::GlobalLinSys.
Definition at line 79 of file GlobalLinSysStaticCond.cpp.
References Nektar::MultiRegions::GlobalLinSys::Initialise(), m_locToGloMap, and SetupTopLevel().
|
inlineprotectedvirtual |
Reimplemented in Nektar::MultiRegions::GlobalLinSysPETScStaticCond, and Nektar::MultiRegions::GlobalLinSysIterativeStaticCond.
Definition at line 62 of file GlobalLinSysStaticCond.h.
Referenced by v_Solve().
|
protectedpure virtual |
|
overrideprotectedvirtual |
Solve the linear system for given input and output vectors using a specified local to global map.
Implements Nektar::MultiRegions::GlobalLinSys.
Definition at line 98 of file GlobalLinSysStaticCond.cpp.
References ASSERTL1, Nektar::eWrapper, m_BinvD, m_C, m_invD, m_locToGloMap, m_recursiveSchurCompl, m_schurCompl, m_wsp, Nektar::Multiply(), Nektar::MultiRegions::GlobalLinSys::SolveLinearSystem(), v_BasisFwdTransform(), v_CoeffsBwdTransform(), v_CoeffsFwdTransform(), v_PreSolve(), Vmath::Vadd(), and Vmath::Vsub().
|
protected |
Block \( BD^{-1} \) matrix.
Definition at line 102 of file GlobalLinSysStaticCond.h.
Referenced by Nektar::MultiRegions::GlobalLinSysDirectStaticCond::GlobalLinSysDirectStaticCond(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::GlobalLinSysIterativeStaticCond(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::GlobalLinSysPETScStaticCond(), Nektar::MultiRegions::GlobalLinSysXxtStaticCond::GlobalLinSysXxtStaticCond(), SetupTopLevel(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_AssembleSchurComplement(), Nektar::MultiRegions::GlobalLinSysDirectStaticCond::v_AssembleSchurComplement(), and v_Solve().
|
protected |
Block \( C \) matrix.
Definition at line 104 of file GlobalLinSysStaticCond.h.
Referenced by Nektar::MultiRegions::GlobalLinSysDirectStaticCond::GlobalLinSysDirectStaticCond(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::GlobalLinSysIterativeStaticCond(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::GlobalLinSysPETScStaticCond(), Nektar::MultiRegions::GlobalLinSysXxtStaticCond::GlobalLinSysXxtStaticCond(), SetupTopLevel(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_AssembleSchurComplement(), Nektar::MultiRegions::GlobalLinSysDirectStaticCond::v_AssembleSchurComplement(), and v_Solve().
|
protected |
Block \( D^{-1} \) matrix.
Definition at line 106 of file GlobalLinSysStaticCond.h.
Referenced by Nektar::MultiRegions::GlobalLinSysDirectStaticCond::GlobalLinSysDirectStaticCond(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::GlobalLinSysIterativeStaticCond(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::GlobalLinSysPETScStaticCond(), Nektar::MultiRegions::GlobalLinSysXxtStaticCond::GlobalLinSysXxtStaticCond(), SetupTopLevel(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_AssembleSchurComplement(), Nektar::MultiRegions::GlobalLinSysDirectStaticCond::v_AssembleSchurComplement(), and v_Solve().
|
protected |
Local to global map.
Definition at line 108 of file GlobalLinSysStaticCond.h.
Referenced by Nektar::MultiRegions::GlobalLinSysXxtStaticCond::GlobalLinSysXxtStaticCond(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_AssembleSchurComplement(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_AssembleSchurComplement(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_DoMatrixMultiply(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_DoMatrixMultiply(), v_Initialise(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_InitObject(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_InitObject(), v_InitObject(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_PreSolve(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_PreSolve(), v_Solve(), and Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_UniqueMap().
|
protected |
Schur complement for Direct Static Condensation.
Definition at line 98 of file GlobalLinSysStaticCond.h.
Referenced by ConstructNextLevelCondensedSystem(), and v_Solve().
|
protected |
Block Schur complement matrix.
Definition at line 100 of file GlobalLinSysStaticCond.h.
Referenced by ConstructNextLevelCondensedSystem(), Nektar::MultiRegions::GlobalLinSysDirectStaticCond::GlobalLinSysDirectStaticCond(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::GlobalLinSysIterativeStaticCond(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::GlobalLinSysPETScStaticCond(), Nektar::MultiRegions::GlobalLinSysXxtStaticCond::GlobalLinSysXxtStaticCond(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::PrepareLocalSchurComplement(), SetupTopLevel(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_AssembleSchurComplement(), Nektar::MultiRegions::GlobalLinSysXxtStaticCond::v_AssembleSchurComplement(), Nektar::MultiRegions::GlobalLinSysDirectStaticCond::v_AssembleSchurComplement(), v_GetNumBlocks(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_GetStaticCondBlock(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_GetStaticCondBlock(), Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_InitObject(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_InitObject(), and v_Solve().
Definition at line 112 of file GlobalLinSysStaticCond.h.
Workspace array for matrix multiplication.
Definition at line 110 of file GlobalLinSysStaticCond.h.
Referenced by Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_DoMatrixMultiply(), v_Initialise(), and v_Solve().