LCOV - code coverage report
Current view: top level - src/solvers - diff_solver.C (source / functions) Hit Total Coverage
Test: libMesh/libmesh: #4481 (67a8c4) with base cc8438 Lines: 31 31 100.0 %
Date: 2026-06-12 15:24:28 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : // The libMesh Finite Element Library.
       2             : // Copyright (C) 2002-2026 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             : 
      24             : // C++ Includes
      25             : #include <memory>
      26             : 
      27             : namespace libMesh
      28             : {
      29             : 
      30         662 : DiffSolver::DiffSolver (sys_type & s) :
      31             :   ParallelObject(s),
      32         274 :   max_linear_iterations(1000),
      33         274 :   max_nonlinear_iterations(100),
      34         274 :   quiet(true),
      35         274 :   verbose(false),
      36         274 :   continue_after_max_iterations(true),
      37         274 :   continue_after_backtrack_failure(false),
      38         274 :   absolute_residual_tolerance(0.),
      39         274 :   relative_residual_tolerance(0.),
      40         274 :   absolute_step_tolerance(0.),
      41         274 :   relative_step_tolerance(0.),
      42         274 :   initial_linear_tolerance(1e-12),
      43         274 :   minimum_linear_tolerance(TOLERANCE*TOLERANCE),
      44         274 :   _exact_constraint_enforcement(true),
      45         274 :   max_solution_norm(0.),
      46         274 :   max_residual_norm(0.),
      47         274 :   _outer_iterations(0),
      48         274 :   _inner_iterations(0),
      49         274 :   _system (s),
      50         856 :   _solve_result(INVALID_SOLVE_RESULT)
      51             : {
      52         662 : }
      53             : 
      54             : 
      55             : 
      56         485 : std::unique_ptr<DiffSolver> DiffSolver::build (sys_type & s)
      57             : {
      58         485 :   return std::make_unique<NewtonSolver>(s);
      59             : }
      60             : 
      61             : 
      62             : 
      63         564 : void DiffSolver::reinit ()
      64             : {
      65             :   // Reset the max_step_size and max_residual_norm for a new mesh
      66         564 :   max_solution_norm = 0.;
      67         564 :   max_residual_norm = 0.;
      68         564 : }
      69             : 
      70             : 
      71             : 
      72         662 : void DiffSolver::init ()
      73             : {
      74             :   // Reset the max_step_size and max_residual_norm for a new problem
      75         662 :   max_solution_norm = 0.;
      76         662 :   max_residual_norm = 0.;
      77         662 : }
      78             : 
      79             : } // namespace libMesh

Generated by: LCOV version 1.14