$extrastylesheet
diff_solver.C
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 #include "libmesh/libmesh_common.h"
00020 #include "libmesh/diff_solver.h"
00021 #include "libmesh/newton_solver.h"
00022 #include "libmesh/implicit_system.h"
00023 namespace libMesh
00024 {
00025 
00026 
00027 
00028 DiffSolver::DiffSolver (sys_type& s)
00029   : ParallelObject(s),
00030     max_linear_iterations(1000),
00031     max_nonlinear_iterations(100),
00032     quiet(true),
00033     verbose(false),
00034     continue_after_max_iterations(true),
00035     continue_after_backtrack_failure(false),
00036     absolute_residual_tolerance(0.),
00037     relative_residual_tolerance(0.),
00038     absolute_step_tolerance(0.),
00039     relative_step_tolerance(0.),
00040     initial_linear_tolerance(1e-12),
00041     minimum_linear_tolerance(TOLERANCE*TOLERANCE),
00042     max_solution_norm(0.),
00043     max_residual_norm(0.),
00044     _outer_iterations(0),
00045     _inner_iterations(0),
00046     _system (s),
00047     _solve_result(INVALID_SOLVE_RESULT)
00048 {
00049 }
00050 
00051 
00052 
00053 UniquePtr<DiffSolver> DiffSolver::build (sys_type& s)
00054 {
00055   return UniquePtr<DiffSolver>(new NewtonSolver(s));
00056 }
00057 
00058 
00059 
00060 void DiffSolver::reinit ()
00061 {
00062   // Reset the max_step_size and max_residual_norm for a new mesh
00063   max_solution_norm = 0.;
00064   max_residual_norm = 0.;
00065 }
00066 
00067 
00068 
00069 void DiffSolver::init ()
00070 {
00071   // Reset the max_step_size and max_residual_norm for a new problem
00072   max_solution_norm = 0.;
00073   max_residual_norm = 0.;
00074 }
00075 
00076 } // namespace libMesh