Reference documentation for deal.II version 9.3.3
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Classes | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
GinkgoWrappers::SolverFCG< ValueType, IndexType > Class Template Reference

#include <deal.II/lac/ginkgo_solver.h>

Inheritance diagram for GinkgoWrappers::SolverFCG< ValueType, IndexType >:
[legend]

Classes

struct  AdditionalData
 

Public Member Functions

 SolverFCG (SolverControl &solver_control, const std::string &exec_type, const AdditionalData &data=AdditionalData())
 
 SolverFCG (SolverControl &solver_control, const std::string &exec_type, const std::shared_ptr< gko::LinOpFactory > &preconditioner, const AdditionalData &data=AdditionalData())
 
void initialize (const SparseMatrix< double > &matrix)
 
void apply (Vector< double > &solution, const Vector< double > &rhs)
 
void solve (const SparseMatrix< double > &matrix, Vector< double > &solution, const Vector< double > &rhs)
 
SolverControlcontrol () const
 

Protected Attributes

const AdditionalData additional_data
 
SolverControlsolver_control
 
std::shared_ptr< gko::LinOpFactory > solver_gen
 
std::shared_ptr< gko::stop::ResidualNormReduction<>::Factory > residual_criterion
 
std::shared_ptr< gko::log::Convergence<> > convergence_logger
 
std::shared_ptr< gko::stop::Combined::Factory > combined_factory
 
std::shared_ptr< gko::Executor > executor
 

Private Member Functions

void initialize_ginkgo_log ()
 

Private Attributes

std::shared_ptr< gko::matrix::Csr< double, int32_t > > system_matrix
 
const std::string exec_type
 

Detailed Description

template<typename ValueType = double, typename IndexType = int32_t>
class GinkgoWrappers::SolverFCG< ValueType, IndexType >

An implementation of the solver interface using the Ginkgo FCG solver.

FCG or the flexible conjugate gradient method is an iterative type Krylov subspace method which is suitable for symmetric positive definite methods.

Though this method performs very well for symmetric positive definite matrices, it is in general not suitable for general matrices.

In contrast to the standard CG based on the Polack-Ribiere formula, the flexible CG uses the Fletcher-Reeves formula for creating the orthonormal vectors spanning the Krylov subspace. This increases the computational cost of every Krylov solver iteration but allows for non-constant preconditioners.

Definition at line 396 of file ginkgo_solver.h.

Constructor & Destructor Documentation

◆ SolverFCG() [1/2]

template<typename ValueType , typename IndexType >
GinkgoWrappers::SolverFCG< ValueType, IndexType >::SolverFCG ( SolverControl solver_control,
const std::string &  exec_type,
const AdditionalData data = AdditionalData() 
)

Constructor.

Parameters
[in,out]solver_controlThe solver control object is then used to set the parameters and setup the FCG solver from the FCG factory which solves the linear system.
[in]exec_typeThe execution paradigm for the FCG solver.
[in]dataThe additional data required by the solver.

Definition at line 405 of file ginkgo_solver.cc.

◆ SolverFCG() [2/2]

template<typename ValueType , typename IndexType >
GinkgoWrappers::SolverFCG< ValueType, IndexType >::SolverFCG ( SolverControl solver_control,
const std::string &  exec_type,
const std::shared_ptr< gko::LinOpFactory > &  preconditioner,
const AdditionalData data = AdditionalData() 
)

Constructor.

Parameters
[in,out]solver_controlThe solver control object is then used to set the parameters and setup the FCG solver from the FCG factory which solves the linear system.
[in]exec_typeThe execution paradigm for the FCG solver.
[in]preconditionerThe preconditioner for the solver.
[in]dataThe additional data required by the solver.

Definition at line 419 of file ginkgo_solver.cc.

Member Function Documentation

◆ initialize()

void SolverBase< double , int32_t >::initialize ( const SparseMatrix< double > &  matrix)
inherited

Initialize the matrix and copy over its data to Ginkgo's data structures.

Definition at line 116 of file ginkgo_solver.cc.

◆ apply()

void SolverBase< double , int32_t >::apply ( Vector< double > &  solution,
const Vector< double > &  rhs 
)
inherited

Solve the linear system Ax=b. Dependent on the information provided by derived classes one of Ginkgo's linear solvers is chosen.

Definition at line 124 of file ginkgo_solver.cc.

◆ solve()

void SolverBase< double , int32_t >::solve ( const SparseMatrix< double > &  matrix,
Vector< double > &  solution,
const Vector< double > &  rhs 
)
inherited

Solve the linear system Ax=b. Dependent on the information provided by derived classes one of Ginkgo's linear solvers is chosen.

Definition at line 132 of file ginkgo_solver.cc.

◆ control()

SolverControl & SolverBase< double , int32_t >::control
inherited

Access to the object that controls convergence.

Definition at line 140 of file ginkgo_solver.cc.

◆ initialize_ginkgo_log()

void SolverBase< double , int32_t >::initialize_ginkgo_log
privateinherited

Initialize the Ginkgo logger object with event masks. Refer to Ginkgo's logging event masks.

Definition at line 189 of file ginkgo_solver.cc.

Member Data Documentation

◆ additional_data

template<typename ValueType = double, typename IndexType = int32_t>
const AdditionalData GinkgoWrappers::SolverFCG< ValueType, IndexType >::additional_data
protected

Store a copy of the settings for this particular solver.

Definition at line 442 of file ginkgo_solver.h.

◆ solver_control

SolverControl& GinkgoWrappers::SolverBase< double , int32_t >::solver_control
protectedinherited

Reference to the object that controls convergence of the iterative solvers.

Definition at line 148 of file ginkgo_solver.h.

◆ solver_gen

std::shared_ptr<gko::LinOpFactory> GinkgoWrappers::SolverBase< double , int32_t >::solver_gen
protectedinherited

The Ginkgo generated solver factory object.

Definition at line 153 of file ginkgo_solver.h.

◆ residual_criterion

std::shared_ptr<gko::stop::ResidualNormReduction<>::Factory> GinkgoWrappers::SolverBase< double , int32_t >::residual_criterion
protectedinherited

The residual criterion object that controls the reduction of the residual based on the tolerance set in the solver_control member.

Definition at line 160 of file ginkgo_solver.h.

◆ convergence_logger

std::shared_ptr<gko::log::Convergence<> > GinkgoWrappers::SolverBase< double , int32_t >::convergence_logger
protectedinherited

The Ginkgo convergence logger used to check for convergence and other solver data if needed.

Definition at line 166 of file ginkgo_solver.h.

◆ combined_factory

std::shared_ptr<gko::stop::Combined::Factory> GinkgoWrappers::SolverBase< double , int32_t >::combined_factory
protectedinherited

The Ginkgo combined factory object is used to create a combined stopping criterion to be passed to the solver.

Definition at line 172 of file ginkgo_solver.h.

◆ executor

std::shared_ptr<gko::Executor> GinkgoWrappers::SolverBase< double , int32_t >::executor
protectedinherited

The execution paradigm in Ginkgo. The choices are between gko::OmpExecutor, gko::CudaExecutor and gko::ReferenceExecutor and more details can be found in Ginkgo's documentation.

Definition at line 179 of file ginkgo_solver.h.

◆ system_matrix

std::shared_ptr<gko::matrix::Csr<double , int32_t > > GinkgoWrappers::SolverBase< double , int32_t >::system_matrix
privateinherited

Ginkgo matrix data structure. First template parameter is for storing the array of the non-zeros of the matrix. The second is for the row pointers and the column indices.

Todo:
Templatize based on Matrix type.

Definition at line 198 of file ginkgo_solver.h.

◆ exec_type

const std::string GinkgoWrappers::SolverBase< double , int32_t >::exec_type
privateinherited

The execution paradigm as a string to be set by the user. The choices are between omp, cuda and reference and more details can be found in Ginkgo's documentation.

Definition at line 205 of file ginkgo_solver.h.


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