Chi-Tech
lbs::WGSLinearSolver< MatType, VecType, SolverType > Class Template Reference

#include <wgs_linear_solver.h>

Inheritance diagram for lbs::WGSLinearSolver< MatType, VecType, SolverType >:
chi_math::LinearSolver< MatType, VecType, SolverType >

Public Types

typedef std::shared_ptr< WGSContext< MatType, VecType, SolverType > > WGSContextPtr
 
- Public Types inherited from chi_math::LinearSolver< MatType, VecType, SolverType >
typedef LinearSolverContext< MatType, VecType > LinSolveContext
 
typedef std::shared_ptr< LinSolveContextLinSolveContextPtr
 

Public Member Functions

 WGSLinearSolver (WGSContextPtr gs_context_ptr)
 
virtual ~WGSLinearSolver () override
 
 ~WGSLinearSolver ()
 
- Public Member Functions inherited from chi_math::LinearSolver< MatType, VecType, SolverType >
 LinearSolver (const std::string &iterative_method, LinSolveContextPtr context_ptr)
 
 LinearSolver (std::string solver_name, std::string iterative_method, LinSolveContextPtr context_ptr)
 
virtual ~LinearSolver ()
 
ToleranceOptionsToleranceOptions ()
 
void ApplyToleranceOptions ()
 
LinSolveContextPtrGetContext ()
 
void SetKSPSolveSuppressionFlag (bool flag)
 
bool GetKSPSolveSuppressionFlag () const
 
virtual void Setup ()
 
virtual void Solve ()
 
 ~LinearSolver ()
 
void ApplyToleranceOptions ()
 
void Setup ()
 
void Solve ()
 

Protected Member Functions

void PreSetupCallback () override
 
void SetConvergenceTest () override
 
virtual void SetSystemSize () override
 
virtual void SetSystem () override
 
void SetPreconditioner () override
 
void PostSetupCallback () override
 
void PreSolveCallback () override
 
void SetRHS () override
 
void SetInitialGuess () override
 
void PostSolveCallback () override
 
void PreSetupCallback ()
 
void SetConvergenceTest ()
 
void SetSystemSize ()
 
void SetSystem ()
 
void SetPreconditioner ()
 
void PostSetupCallback ()
 
void PreSolveCallback ()
 
void SetInitialGuess ()
 
void SetRHS ()
 
void PostSolveCallback ()
 
- Protected Member Functions inherited from chi_math::LinearSolver< MatType, VecType, SolverType >
bool IsSystemSet () const
 
virtual void PreSetupCallback ()
 
virtual void SetOptions ()
 
virtual void SetSolverContext ()
 
virtual void SetConvergenceTest ()
 
virtual void SetMonitor ()
 
virtual void SetPreconditioner ()
 
virtual void SetSystemSize ()=0
 
virtual void SetSystem ()=0
 
virtual void PostSetupCallback ()
 
virtual void PreSolveCallback ()
 
virtual void SetInitialGuess ()=0
 
virtual void SetRHS ()=0
 
virtual void PostSolveCallback ()
 
void PreSetupCallback ()
 
void SetOptions ()
 
void SetSolverContext ()
 
void SetConvergenceTest ()
 
void SetMonitor ()
 
void SetPreconditioner ()
 
void PostSetupCallback ()
 
void PreSolveCallback ()
 
void PostSolveCallback ()
 

Protected Attributes

std::vector< double > saved_q_moments_local_
 
- Protected Attributes inherited from chi_math::LinearSolver< MatType, VecType, SolverType >
const std::string solver_name_
 
const std::string iterative_method_
 
LinSolveContextPtr context_ptr_ = nullptr
 
MatType A_
 
VecType b_
 
VecType x_
 
SolverType solver_
 
int64_t num_local_dofs_ = 0
 
int64_t num_globl_dofs_ = 0
 
struct chi_math::LinearSolver::ToleranceOptions tolerance_options_
 

Detailed Description

template<class MatType, class VecType, class SolverType>
class lbs::WGSLinearSolver< MatType, VecType, SolverType >

Linear Solver specialization for Within GroupSet (WGS) solves.

Definition at line 18 of file wgs_linear_solver.h.

Member Typedef Documentation

◆ WGSContextPtr

template<class MatType , class VecType , class SolverType >
typedef std::shared_ptr<WGSContext<MatType,VecType,SolverType> > lbs::WGSLinearSolver< MatType, VecType, SolverType >::WGSContextPtr

Definition at line 25 of file wgs_linear_solver.h.

Constructor & Destructor Documentation

◆ WGSLinearSolver()

template<class MatType , class VecType , class SolverType >
lbs::WGSLinearSolver< MatType, VecType, SolverType >::WGSLinearSolver ( WGSContextPtr  gs_context_ptr)
inlineexplicit

Constructor.

Parameters
gs_context_ptrContext Pointer to abstract context.

Definition at line 29 of file wgs_linear_solver.h.

◆ ~WGSLinearSolver() [1/2]

template<class MatType , class VecType , class SolverType >
virtual lbs::WGSLinearSolver< MatType, VecType, SolverType >::~WGSLinearSolver ( )
overridevirtual

◆ ~WGSLinearSolver() [2/2]

Definition at line 246 of file wgs_linear_solver.cc.

Member Function Documentation

◆ PostSetupCallback() [1/2]

void lbs::WGSLinearSolver< Mat, Vec, KSP >::PostSetupCallback ( )
protectedvirtual

Reimplemented from chi_math::LinearSolver< MatType, VecType, SolverType >.

Definition at line 90 of file wgs_linear_solver.cc.

◆ PostSetupCallback() [2/2]

template<class MatType , class VecType , class SolverType >
void lbs::WGSLinearSolver< MatType, VecType, SolverType >::PostSetupCallback ( )
overrideprotectedvirtual

◆ PostSolveCallback() [1/2]

void lbs::WGSLinearSolver< Mat, Vec, KSP >::PostSolveCallback ( )
protectedvirtual

For this callback we simply restore the q_moments_local vector.

Reimplemented from chi_math::LinearSolver< MatType, VecType, SolverType >.

Definition at line 213 of file wgs_linear_solver.cc.

◆ PostSolveCallback() [2/2]

template<class MatType , class VecType , class SolverType >
void lbs::WGSLinearSolver< MatType, VecType, SolverType >::PostSolveCallback ( )
overrideprotectedvirtual

◆ PreSetupCallback() [1/2]

void lbs::WGSLinearSolver< Mat, Vec, KSP >::PreSetupCallback ( )
protectedvirtual

Reimplemented from chi_math::LinearSolver< MatType, VecType, SolverType >.

Definition at line 28 of file wgs_linear_solver.cc.

◆ PreSetupCallback() [2/2]

template<class MatType , class VecType , class SolverType >
void lbs::WGSLinearSolver< MatType, VecType, SolverType >::PreSetupCallback ( )
overrideprotectedvirtual

◆ PreSolveCallback() [1/2]

void lbs::WGSLinearSolver< Mat, Vec, KSP >::PreSolveCallback ( )
protectedvirtual

Reimplemented from chi_math::LinearSolver< MatType, VecType, SolverType >.

Definition at line 98 of file wgs_linear_solver.cc.

◆ PreSolveCallback() [2/2]

template<class MatType , class VecType , class SolverType >
void lbs::WGSLinearSolver< MatType, VecType, SolverType >::PreSolveCallback ( )
overrideprotectedvirtual

◆ SetConvergenceTest() [1/2]

void lbs::WGSLinearSolver< Mat, Vec, KSP >::SetConvergenceTest ( )
protectedvirtual

Reimplemented from chi_math::LinearSolver< MatType, VecType, SolverType >.

Definition at line 36 of file wgs_linear_solver.cc.

◆ SetConvergenceTest() [2/2]

template<class MatType , class VecType , class SolverType >
void lbs::WGSLinearSolver< MatType, VecType, SolverType >::SetConvergenceTest ( )
overrideprotectedvirtual

◆ SetInitialGuess() [1/2]

void lbs::WGSLinearSolver< Mat, Vec, KSP >::SetInitialGuess ( )
protectedvirtual

Sets the initial guess for a gs solver. If the initial guess's norm is large enough the initial guess will be used, otherwise it is assumed zero.

Implements chi_math::LinearSolver< MatType, VecType, SolverType >.

Definition at line 109 of file wgs_linear_solver.cc.

◆ SetInitialGuess() [2/2]

template<class MatType , class VecType , class SolverType >
void lbs::WGSLinearSolver< MatType, VecType, SolverType >::SetInitialGuess ( )
overrideprotectedvirtual

◆ SetPreconditioner() [1/2]

void lbs::WGSLinearSolver< Mat, Vec, KSP >::SetPreconditioner ( )
protectedvirtual

Reimplemented from chi_math::LinearSolver< MatType, VecType, SolverType >.

Definition at line 81 of file wgs_linear_solver.cc.

◆ SetPreconditioner() [2/2]

template<class MatType , class VecType , class SolverType >
void lbs::WGSLinearSolver< MatType, VecType, SolverType >::SetPreconditioner ( )
overrideprotectedvirtual

◆ SetRHS() [1/2]

void lbs::WGSLinearSolver< Mat, Vec, KSP >::SetRHS ( )
protectedvirtual

◆ SetRHS() [2/2]

template<class MatType , class VecType , class SolverType >
void lbs::WGSLinearSolver< MatType, VecType, SolverType >::SetRHS ( )
overrideprotectedvirtual

◆ SetSystem() [1/2]

void lbs::WGSLinearSolver< Mat, Vec, KSP >::SetSystem ( )
protectedvirtual

◆ SetSystem() [2/2]

template<class MatType , class VecType , class SolverType >
virtual void lbs::WGSLinearSolver< MatType, VecType, SolverType >::SetSystem ( )
overrideprotectedvirtual

◆ SetSystemSize() [1/2]

void lbs::WGSLinearSolver< Mat, Vec, KSP >::SetSystemSize ( )
protectedvirtual

◆ SetSystemSize() [2/2]

template<class MatType , class VecType , class SolverType >
virtual void lbs::WGSLinearSolver< MatType, VecType, SolverType >::SetSystemSize ( )
overrideprotectedvirtual

Field Documentation

◆ saved_q_moments_local_

template<class MatType , class VecType , class SolverType >
std::vector<double> lbs::WGSLinearSolver< MatType, VecType, SolverType >::saved_q_moments_local_
protected

Definition at line 22 of file wgs_linear_solver.h.


The documentation for this class was generated from the following file: