libMesh
petsc_diff_solver.h
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 
20 #ifndef LIBMESH_PETSC_DIFF_SOLVER_H
21 #define LIBMESH_PETSC_DIFF_SOLVER_H
22 
23 #include "libmesh/libmesh_common.h"
24 
25 #ifdef LIBMESH_HAVE_PETSC
26 
27 // Local includes
28 #include "libmesh/diff_solver.h"
29 #include "libmesh/petsc_macro.h"
30 
31 // PETSc includes
32 # include <petscsnes.h>
33 
34 namespace libMesh
35 {
36 
49 {
50 public:
55  explicit
57 
61  virtual ~PetscDiffSolver ();
62 
63  typedef DiffSolver Parent;
64 
69  virtual void reinit () libmesh_override;
70 
75  virtual void init () libmesh_override;
76 
81  void clear ();
82 
88  virtual unsigned int solve () libmesh_override;
89 
90 protected:
91 
95  SNES _snes;
96 };
97 
98 } // namespace libMesh
99 
100 #endif // #ifdef LIBMESH_HAVE_PETSC
101 
102 #endif // LIBMESH_PETSC_DIFF_SOLVER_H
virtual void reinit() libmesh_override
The reinitialization function.
void clear()
The clear function.
virtual ~PetscDiffSolver()
Destructor.
virtual void init() libmesh_override
The initialization function.
The libMesh namespace provides an interface to certain functionality in the library.
PetscDiffSolver(sys_type &system)
Constructor.
This is a generic class that defines a solver to handle ImplicitSystem classes, including NonlinearIm...
Definition: diff_solver.h:70
This class defines a solver which uses a PETSc SNES context to handle a DifferentiableSystem.
const sys_type & system() const
Definition: diff_solver.h:137
virtual unsigned int solve() libmesh_override
This method performs a solve.
SNES _snes
Nonlinear solver context.
This class provides a specific system class.