Bridge++  Ver. 2.0.2
Solver_CG Class Reference

Standard Conjugate Gradient solver algorithm. More...

#include <solver_CG.h>

Inheritance diagram for Solver_CG:
Solver Solver_CGNE Solver_CGNR

Public Member Functions

 Solver_CG (Fopr *fopr)
 
 Solver_CG (Fopr *fopr, const Parameters &params)
 
 ~Solver_CG ()
 
void set_parameters (const Parameters &params)
 
void set_parameters (const int Niter, const int Nrestart, const double Stop_cond)
 
void set_parameters (const int Niter, const int Nrestart, const double Stop_cond, const bool use_init_guess)
 
void get_parameters (Parameters &params) const
 
void solve (Field &solution, const Field &source, int &Nconv, double &diff)
 
Foprget_fopr ()
 
double flop_count ()
 
- Public Member Functions inherited from Solver
 Solver ()
 
virtual ~Solver ()
 

Static Public Attributes

static const std::string class_name = "Solver_CG"
 

Protected Attributes

Bridge::VerboseLevel m_vl
 

Private Member Functions

void reset_field (const Field &)
 
void solve_init (const Field &, double &)
 
void solve_step (double &)
 

Private Attributes

Foprm_fopr
 
int m_Niter
 
int m_Nrestart
 
double m_Stop_cond
 
bool m_use_init_guess
 
Field m_s
 
Field m_r
 
Field m_x
 
Field m_p
 
int m_Nrestart_count
 
int m_Nconv_count
 

Detailed Description

Standard Conjugate Gradient solver algorithm.

This solver class implements the standard Conjugate Gradient solver algorithm. 22 Dec H.Matsufuru YAML is implemented. [14 Nov 2012 Y.Namekawa] Multi-threaded. [17 Jul 2014 Y.Namekawa] Introduce unique_ptr to avoid memory leaks. [21 Mar 2015 Y.Namekawa] Add restart. [22 Feb 2016 Y.Namekawa] Add flop_count. [ 8 Aug 2016 Y.Namekawa] Add use_init_guess. [ 7 Jul 2017 Y.Namekawa]

Definition at line 38 of file solver_CG.h.

Constructor & Destructor Documentation

◆ Solver_CG() [1/2]

Solver_CG::Solver_CG ( Fopr fopr)
inline

Definition at line 61 of file solver_CG.h.

◆ Solver_CG() [2/2]

Solver_CG::Solver_CG ( Fopr fopr,
const Parameters params 
)
inline

Definition at line 69 of file solver_CG.h.

◆ ~Solver_CG()

Solver_CG::~Solver_CG ( )
inline

Definition at line 79 of file solver_CG.h.

Member Function Documentation

◆ flop_count()

double Solver_CG::flop_count ( )
virtual

Implements Solver.

Reimplemented in Solver_CGNE, and Solver_CGNR.

Definition at line 271 of file solver_CG.cpp.

◆ get_fopr()

Fopr* Solver_CG::get_fopr ( )
inlinevirtual

Implements Solver.

Reimplemented in Solver_CGNE, and Solver_CGNR.

Definition at line 91 of file solver_CG.h.

◆ get_parameters()

void Solver_CG::get_parameters ( Parameters params) const
virtual

Implements Solver.

Reimplemented in Solver_CGNE, and Solver_CGNR.

Definition at line 53 of file solver_CG.cpp.

◆ reset_field()

void Solver_CG::reset_field ( const Field b)
private

Definition at line 213 of file solver_CG.cpp.

◆ set_parameters() [1/3]

void Solver_CG::set_parameters ( const int  Niter,
const int  Nrestart,
const double  Stop_cond 
)
virtual

Implements Solver.

Definition at line 65 of file solver_CG.cpp.

◆ set_parameters() [2/3]

void Solver_CG::set_parameters ( const int  Niter,
const int  Nrestart,
const double  Stop_cond,
const bool  use_init_guess 
)

Definition at line 94 of file solver_CG.cpp.

◆ set_parameters() [3/3]

void Solver_CG::set_parameters ( const Parameters params)
virtual

Implements Solver.

Reimplemented in Solver_CGNE, and Solver_CGNR.

Definition at line 25 of file solver_CG.cpp.

◆ solve()

void Solver_CG::solve ( Field solution,
const Field source,
int &  Nconv,
double &  diff 
)
virtual

Implements Solver.

Reimplemented in Solver_CGNE, and Solver_CGNR.

Definition at line 125 of file solver_CG.cpp.

◆ solve_init()

void Solver_CG::solve_init ( const Field b,
double &  rr 
)
private

Definition at line 236 of file solver_CG.cpp.

◆ solve_step()

void Solver_CG::solve_step ( double &  rr)
private

Definition at line 251 of file solver_CG.cpp.

Member Data Documentation

◆ class_name

const std::string Solver_CG::class_name = "Solver_CG"
static

Definition at line 41 of file solver_CG.h.

◆ m_fopr

Fopr* Solver_CG::m_fopr
private

Definition at line 47 of file solver_CG.h.

◆ m_Nconv_count

int Solver_CG::m_Nconv_count
private

Definition at line 58 of file solver_CG.h.

◆ m_Niter

int Solver_CG::m_Niter
private

Definition at line 49 of file solver_CG.h.

◆ m_Nrestart

int Solver_CG::m_Nrestart
private

Definition at line 50 of file solver_CG.h.

◆ m_Nrestart_count

int Solver_CG::m_Nrestart_count
private

Definition at line 57 of file solver_CG.h.

◆ m_p

Field Solver_CG::m_p
private

Definition at line 55 of file solver_CG.h.

◆ m_r

Field Solver_CG::m_r
private

Definition at line 55 of file solver_CG.h.

◆ m_s

Field Solver_CG::m_s
private

Definition at line 55 of file solver_CG.h.

◆ m_Stop_cond

double Solver_CG::m_Stop_cond
private

Definition at line 51 of file solver_CG.h.

◆ m_use_init_guess

bool Solver_CG::m_use_init_guess
private

Definition at line 52 of file solver_CG.h.

◆ m_vl

Bridge::VerboseLevel Solver_CG::m_vl
protected

Definition at line 44 of file solver_CG.h.

◆ m_x

Field Solver_CG::m_x
private

Definition at line 55 of file solver_CG.h.


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