Bridge++  Ver. 2.0.2
solver_CGNE.h
Go to the documentation of this file.
1 
14 #ifndef SOLVER_CGNE_INCLUDED
15 #define SOLVER_CGNE_INCLUDED
16 
17 #include "solver_CG.h"
18 
20 
35 class Solver_CGNE : public Solver_CG
36 {
37  private:
39 
40  public:
41  static const std::string class_name;
42 
44  : Solver_CG(fopr) {}
45 
46  Solver_CGNE(Fopr *fopr, const Parameters& params)
47  : Solver_CG(fopr, params)
48  {
49  // set_parameters delegate to Solver_CG.
50  }
51 
53 
54  void set_parameters(const Parameters& params);
55 
56  void get_parameters(Parameters& params) const;
57 
58  void solve(Field& solution, const Field& source, int& Nconv, double& diff);
59 
60  Fopr *get_fopr() { return this->Solver_CG::get_fopr(); }
61 
62  double flop_count();
63 
64 #ifdef USE_FACTORY
65  private:
66  static Solver *create_object(Fopr *fopr)
67  {
68  return new Solver_CGNE(fopr);
69  }
70 
71  static Solver *create_object_with_params(Fopr *fopr, const Parameters& params)
72  {
73  return new Solver_CGNE(fopr, params);
74  }
75 
76  public:
77  static bool register_factory()
78  {
79  bool init = true;
80  init &= Solver::Factory::Register("CGNE", create_object);
81  init &= Solver::Factory_params::Register("CGNE", create_object_with_params);
82  return init;
83  }
84 #endif
85 };
86 #endif
AFopr< Field >
Parameters
Class for parameters.
Definition: parameters.h:46
Solver_CGNE::Solver_CGNE
Solver_CGNE(Fopr *fopr)
Definition: solver_CGNE.h:43
Solver_CGNE::solve
void solve(Field &solution, const Field &source, int &Nconv, double &diff)
Definition: solver_CGNE.cpp:40
Solver_CGNE::get_parameters
void get_parameters(Parameters &params) const
Definition: solver_CGNE.cpp:33
Solver_CGNE::Solver_CGNE
Solver_CGNE(Fopr *fopr, const Parameters &params)
Definition: solver_CGNE.h:46
Solver
Base class for linear solver class family.
Definition: solver.h:36
Solver_CGNE
CGNE solver.
Definition: solver_CGNE.h:35
Solver_CGNE::~Solver_CGNE
~Solver_CGNE()
Definition: solver_CGNE.h:52
Solver_CGNE::m_y
Field m_y
Definition: solver_CGNE.h:38
Solver_CG::get_fopr
Fopr * get_fopr()
Definition: solver_CG.h:91
Solver_CGNE::set_parameters
void set_parameters(const Parameters &params)
Definition: solver_CGNE.cpp:26
Solver_CGNE::class_name
static const std::string class_name
Definition: solver_CGNE.h:41
Solver_CGNE::flop_count
double flop_count()
Definition: solver_CGNE.cpp:91
solver_CG.h
Solver_CG
Standard Conjugate Gradient solver algorithm.
Definition: solver_CG.h:38
Field
Container of Field-type object.
Definition: field.h:46
Solver_CGNE::get_fopr
Fopr * get_fopr()
Definition: solver_CGNE.h:60