Nektar++
|
A global linear system. More...
#include <GlobalLinSysIterativeFull.h>
Public Member Functions | |
GlobalLinSysIterativeFull (const GlobalLinSysKey &pLinSysKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap) | |
Constructor for full direct matrix solve. More... | |
~GlobalLinSysIterativeFull () override=default | |
Public Member Functions inherited from Nektar::MultiRegions::GlobalLinSysIterative | |
GlobalLinSysIterative (const GlobalLinSysKey &pKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap) | |
Constructor for full direct matrix solve. More... | |
~GlobalLinSysIterative () override | |
void | DoMatrixMultiply (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) |
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... | |
Static Public Member Functions | |
static GlobalLinSysSharedPtr | create (const GlobalLinSysKey &pLinSysKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap) |
Creates an instance of this class. More... | |
Static Public Attributes | |
static std::string | className |
Name of class. More... | |
Protected Member Functions | |
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_DoMatrixMultiply (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override |
void | v_UniqueMap () override |
Protected Member Functions inherited from Nektar::MultiRegions::GlobalLinSysIterative | |
void | DoProjection (const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const int pNumDir, const NekDouble tol, const bool isAconjugate) |
projection technique More... | |
void | Set_Rhs_Magnitude (const NekVector< NekDouble > &pIn) |
virtual void | v_UniqueMap ()=0 |
virtual void | v_DoMatrixMultiply (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)=0 |
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... | |
Private Member Functions | |
void | v_SolveLinearSystem (const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const AssemblyMapSharedPtr &locToGloMap, const int pNumDir) override |
Solve the matrix system. More... | |
Private Attributes | |
std::weak_ptr< AssemblyMap > | m_locToGloMap |
Additional Inherited Members | |
Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSysIterative | |
Array< OneD, int > | m_map |
Global to universal unique map. 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 |
std::string | m_precontype |
int | m_totalIterations |
bool | m_useProjection |
Whether to apply projection technique. More... | |
bool | m_root |
Root if parallel. More... | |
std::string | m_linSysIterSolver |
Iterative solver: Conjugate Gradient, GMRES. More... | |
std::vector< Array< OneD, NekDouble > > | m_prevLinSol |
Storage for solutions to previous linear problems. More... | |
std::vector< Array< OneD, NekDouble > > | m_prevBasis |
DNekMatSharedPtr | m_coeffMatrix |
Array< OneD, NekDouble > | m_coeffMatrixFactor |
Array< OneD, int > | m_ipivot |
int | m_numSuccessiveRHS |
bool | m_isAconjugate |
std::string | m_matrixType |
bool | m_isNonSymmetricLinSys |
int | m_numPrevSols |
bool | m_isAbsoluteTolerance |
LibUtilities::NekSysOperators | m_NekSysOp |
LibUtilities::NekLinSysIterSharedPtr | m_linsol |
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 |
Static Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSysIterative | |
static std::string | IteratSolverlookupIds [] |
static std::string | IteratSolverdef |
A global linear system.
Definition at line 45 of file GlobalLinSysIterativeFull.h.
Nektar::MultiRegions::GlobalLinSysIterativeFull::GlobalLinSysIterativeFull | ( | const GlobalLinSysKey & | pKey, |
const std::weak_ptr< ExpList > & | pExp, | ||
const std::shared_ptr< AssemblyMap > & | pLocToGloMap | ||
) |
Constructor for full direct matrix solve.
Constructor for full direct matrix solve.
pKey | Key specifying matrix to solve. |
pExp | Shared pointer to expansion list for applying matrix evaluations. |
pLocToGloMap | Local to global mapping. |
Definition at line 66 of file GlobalLinSysIterativeFull.cpp.
References ASSERTL1, Nektar::MultiRegions::eIterativeFull, Nektar::MultiRegions::GlobalLinSysKey::GetGlobalSysSolnType(), and Nektar::MultiRegions::GlobalLinSys::m_linSysKey.
|
overridedefault |
|
inlinestatic |
Creates an instance of this class.
Definition at line 49 of file GlobalLinSysIterativeFull.h.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr().
|
overrideprotectedvirtual |
Implements Nektar::MultiRegions::GlobalLinSysIterative.
Definition at line 179 of file GlobalLinSysIterativeFull.cpp.
References Nektar::MultiRegions::GlobalLinSys::m_expList, Nektar::MultiRegions::GlobalLinSysIterative::m_linsol, Nektar::MultiRegions::GlobalLinSys::m_linSysKey, m_locToGloMap, and Nektar::MultiRegions::GlobalLinSys::m_robinBCInfo.
|
overrideprotectedvirtual |
Solve the linear system for given input and output vectors using a specified local to global map.
Solve a global linear system with Dirichlet forcing using a conjugate gradient method. This routine performs handling of the Dirichlet forcing terms and wraps the underlying iterative solver used for the remaining degrees of freedom.
Consider solving for \(x\), the matrix system \(Ax=b\), where \(b\) is known. To enforce the Dirichlet terms we instead solve
\[A(x-x_0) = b - Ax_0 \]
where \(x_0\) is the Dirichlet forcing.
pInput | RHS of linear system, \(b\). |
pOutput | On input, values of dirichlet degrees of freedom with initial guess on other values. On output, the solution \(x\). |
pLocToGloMap | Local to global mapping. |
pDirForcing | Precalculated Dirichlet forcing. |
Implements Nektar::MultiRegions::GlobalLinSys.
Definition at line 95 of file GlobalLinSysIterativeFull.cpp.
References ASSERTL0, Nektar::MultiRegions::GlobalLinSys::m_expList, Nektar::MultiRegions::GlobalLinSys::m_linSysKey, m_locToGloMap, Nektar::MultiRegions::GlobalLinSys::m_robinBCInfo, Nektar::LibUtilities::ReduceSum, Nektar::MultiRegions::GlobalLinSys::SolveLinearSystem(), Vmath::Vadd(), and Vmath::Vsub().
|
overrideprivatevirtual |
Solve the matrix system.
Implements Nektar::MultiRegions::GlobalLinSys.
Definition at line 247 of file GlobalLinSysIterativeFull.cpp.
References ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::MultiRegions::GlobalLinSys::CreatePrecon(), Nektar::MultiRegions::GlobalLinSysIterative::DoProjection(), Nektar::LibUtilities::GetNekLinSysIterFactory(), Nektar::MultiRegions::GlobalLinSys::m_expList, Nektar::MultiRegions::GlobalLinSysIterative::m_isAbsoluteTolerance, Nektar::MultiRegions::GlobalLinSysIterative::m_isAconjugate, Nektar::MultiRegions::GlobalLinSysIterative::m_linsol, Nektar::MultiRegions::GlobalLinSysIterative::m_linSysIterSolver, Nektar::MultiRegions::GlobalLinSysIterative::m_map, Nektar::MultiRegions::GlobalLinSysIterative::m_NekSysOp, Nektar::MultiRegions::GlobalLinSysIterative::m_precon, Nektar::MultiRegions::GlobalLinSysIterative::m_rhs_magnitude, Nektar::MultiRegions::GlobalLinSysIterative::m_tolerance, Nektar::MultiRegions::GlobalLinSysIterative::m_useProjection, v_UniqueMap(), and Vmath::Zero().
|
overrideprotectedvirtual |
Implements Nektar::MultiRegions::GlobalLinSysIterative.
Definition at line 239 of file GlobalLinSysIterativeFull.cpp.
References m_locToGloMap, and Nektar::MultiRegions::GlobalLinSysIterative::m_map.
Referenced by v_SolveLinearSystem().
|
static |
Name of class.
Registers the class with the Factory.
Definition at line 59 of file GlobalLinSysIterativeFull.h.
|
private |
Definition at line 85 of file GlobalLinSysIterativeFull.h.
Referenced by v_DoMatrixMultiply(), v_Solve(), and v_UniqueMap().