DOLFIN
DOLFIN C++ interface
NonlinearProblem.h
1 // Copyright (C) 2005-2008 Garth N. Wells
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // Modified by Anders Logg, 2008.
19 //
20 // First added: 2005-10-24
21 // Last changed: 2011-01-14
22 
23 #ifndef __NONLINEAR_PROBLEM_H
24 #define __NONLINEAR_PROBLEM_H
25 
26 namespace dolfin
27 {
28 
29  // Forward declarations
30  class GenericMatrix;
31  class GenericVector;
32 
35 
37  {
38  public:
39 
42 
44  virtual ~NonlinearProblem() {}
45 
49  virtual void form(GenericMatrix& A, GenericMatrix& P, GenericVector& b,
50  const GenericVector& x)
51  {
52  // Do nothing if not supplied by the user
53  }
54 
56  virtual void F(GenericVector& b, const GenericVector& x) = 0;
57 
59  virtual void J(GenericMatrix& A, const GenericVector& x) = 0;
60 
68  virtual void J_pc(GenericMatrix& P, const GenericVector& x)
69  {
70  // Do nothing if not supplied by the user
71  }
72 
73  };
74 
75 }
76 
77 #endif
Definition: adapt.h:29
virtual void J_pc(GenericMatrix &P, const GenericVector &x)
Definition: NonlinearProblem.h:68
Definition: NonlinearProblem.h:36
virtual ~NonlinearProblem()
Destructor.
Definition: NonlinearProblem.h:44
virtual void J(GenericMatrix &A, const GenericVector &x)=0
Compute J = F&#39; at current point x.
This class defines a common interface for matrices.
Definition: GenericMatrix.h:46
NonlinearProblem()
Constructor.
Definition: NonlinearProblem.h:41
This class defines a common interface for vectors.
Definition: GenericVector.h:47
virtual void F(GenericVector &b, const GenericVector &x)=0
Compute F at current point x.
virtual void form(GenericMatrix &A, GenericMatrix &P, GenericVector &b, const GenericVector &x)
Definition: NonlinearProblem.h:49