libMesh
diff_solver.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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 #include "libmesh/libmesh_common.h"
20 #include "libmesh/diff_solver.h"
21 #include "libmesh/newton_solver.h"
22 #include "libmesh/implicit_system.h"
23 namespace libMesh
24 {
25 
26 
27 
29  ParallelObject(s),
30  max_linear_iterations(1000),
31  max_nonlinear_iterations(100),
32  quiet(true),
33  verbose(false),
34  continue_after_max_iterations(true),
35  continue_after_backtrack_failure(false),
36  absolute_residual_tolerance(0.),
37  relative_residual_tolerance(0.),
38  absolute_step_tolerance(0.),
39  relative_step_tolerance(0.),
40  initial_linear_tolerance(1e-12),
41  minimum_linear_tolerance(TOLERANCE*TOLERANCE),
42  max_solution_norm(0.),
43  max_residual_norm(0.),
44  _outer_iterations(0),
45  _inner_iterations(0),
46  _system (s),
47  _solve_result(INVALID_SOLVE_RESULT)
48 {
49 }
50 
51 
52 
54 {
55  return UniquePtr<DiffSolver>(new NewtonSolver(s));
56 }
57 
58 
59 
61 {
62  // Reset the max_step_size and max_residual_norm for a new mesh
63  max_solution_norm = 0.;
64  max_residual_norm = 0.;
65 }
66 
67 
68 
70 {
71  // Reset the max_step_size and max_residual_norm for a new problem
72  max_solution_norm = 0.;
73  max_residual_norm = 0.;
74 }
75 
76 } // namespace libMesh
static UniquePtr< DiffSolver > build(sys_type &s)
Factory method.
Definition: diff_solver.C:53
Real max_solution_norm
The largest solution norm which the DiffSolver has yet seen will be stored here, to be used for stopp...
Definition: diff_solver.h:296
Real max_residual_norm
The largest nonlinear residual which the DiffSolver has yet seen will be stored here, to be used for stopping criteria based on relative_residual_tolerance.
Definition: diff_solver.h:303
virtual void reinit()
The reinitialization function.
Definition: diff_solver.C:60
static const Real TOLERANCE
The libMesh namespace provides an interface to certain functionality in the library.
This class defines a solver which uses the default libMesh linear solver in a quasiNewton method to h...
Definition: newton_solver.h:46
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual void init()
The initialization function.
Definition: diff_solver.C:69
This class forms the base class for all other classes that are expected to be implemented in parallel...
DiffSolver(sys_type &s)
Constructor.
Definition: diff_solver.C:28
This class provides a specific system class.