diff_solver.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_DIFF_SOLVER_H
21 #define LIBMESH_DIFF_SOLVER_H
22 
23 // Local includes
24 #include "libmesh/auto_ptr.h"
25 #include "libmesh/libmesh_common.h"
28 
29 // C++ includes
30 #include <vector>
31 
32 namespace libMesh
33 {
34 
35 // Forward Declarations
36 class DiffSolver;
37 class ImplicitSystem;
38 class ParameterVector;
39 template <typename T> class NumericVector;
40 
45 public:
46  virtual void operator() (const NumericVector<Number>& delta_u, const double &norm_delta_u,
47  const NumericVector<Number>& u, const double &norm_u,
48  const NumericVector<Number>& res, const double &norm_res,
49  const unsigned int iteration) = 0;
50  virtual ~LinearSolutionMonitor();
51 };
52 
54 
68 // ------------------------------------------------------------
69 // Solver class definition
70 class DiffSolver : public ReferenceCountedObject<DiffSolver>,
71  public ParallelObject
72 {
73 public:
78 
83  DiffSolver (sys_type& s);
84 
90 
94  virtual ~DiffSolver () {}
95 
100  virtual void init ();
101 
106  virtual void reinit ();
107 
113  virtual unsigned int solve () = 0;
114 
119  unsigned int total_outer_iterations() { return _outer_iterations; }
120 
125  unsigned int total_inner_iterations() { return _inner_iterations; }
126 
130  unsigned int solve_result() { return _solve_result; }
131 
135  const sys_type & system () const { return _system; }
136 
140  sys_type & system () { return _system; }
141 
146  unsigned int max_linear_iterations;
147 
155 
160  bool quiet;
161 
166  bool verbose;
167 
173 
179 
191 
203 
209 
214 
220  enum SolveResult {
226 
232 
238 
244 
250 
256 
262 
269 
275  };
276 
281 
282 protected:
283 
289 
296 
300  unsigned int _outer_iterations;
301 
305  unsigned int _inner_iterations;
306 
311 
318  unsigned int _solve_result;
319 };
320 
321 
322 } // namespace libMesh
323 
324 
325 #endif // LIBMESH_DIFF_SOLVER_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:04 UTC

Hosted By:
SourceForge.net Logo