Hermes2D  3.0
picard_solver.h
1 // This file is part of Hermes2D
2 //
3 // Copyright (c) 2009 hp-FEM group at the University of Nevada, Reno (UNR).
4 // Email: hpfem-group@unr.edu, home page: http://www.hpfem.org/.
5 //
6 // Hermes2D is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published
8 // by the Free Software Foundation; either version 2 of the License,
9 // or (at your option) any later version.
10 //
11 // Hermes2D is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with Hermes2D; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef __H2D_SOLVER_PICARD_H_
23 #define __H2D_SOLVER_PICARD_H_
24 
25 #include "solvers/picard_matrix_solver.h"
26 #include "solver.h"
27 
28 namespace Hermes
29 {
30  namespace Hermes2D
31  {
49  // Call solve with the initial guess.<br>
53  // Get the solution vector from the solver.<br>
57  // Translate the solution vector into the previously initialized Solution<std::complex<double> > using the static method vector_to_solution.<br>
73  template<typename Scalar>
74  class HERMES_API PicardSolver :
75  public Hermes::Hermes2D::Solver<Scalar>,
76  public Hermes::Solvers::PicardMatrixSolver < Scalar >
77  {
78  public:
79  PicardSolver();
83  virtual ~PicardSolver();
84 
85  // See the base class for details, the following serves only for avoiding C++ name-hiding.
87 
90  virtual void solve(Scalar* coeff_vec);
91 
93  Scalar* get_sln_vector();
94 
96  virtual void set_spaces(std::vector<SpaceSharedPtr<Scalar> > spaces);
97 
99  virtual void set_verbose_output(bool to_set);
100 
102  virtual void set_weak_formulation(WeakFormSharedPtr<Scalar> wf);
103 
104  virtual void assemble_residual(bool store_previous_residual);
105  virtual bool assemble_jacobian(bool store_previous_jacobian);
106  virtual bool assemble(bool store_previous_jacobian, bool store_previous_residual);
107 
109  virtual void init_solving(Scalar* coeff_vec);
110 
112  virtual bool isOkay() const;
113  inline std::string getClassName() const { return "PicardSolver"; }
114  };
115  }
116 }
117 #endif
Definition: adapt.h:24
Used to pass the instances of Space around.
Definition: space.h:34
Used to pass the instances of WeakForm around.
Definition: weakform.h:55
General solver functionality.
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.