trilinos_nox_nonlinear_solver.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 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_TRILINOS_NOX_NONLINEAR_SOLVER_H
21 #define LIBMESH_TRILINOS_NOX_NONLINEAR_SOLVER_H
22 
23 #ifdef LIBMESH_HAVE_NOX
24 
25 // Local includes
27 
28 //trilinos includes
29 #include "Epetra_Vector.h"
30 #include "Epetra_Operator.h"
31 #include "Epetra_RowMatrix.h"
32 #include "NOX_Epetra_Interface_Required.H" // base class
33 #include "NOX_Epetra_Interface_Jacobian.H" // base class
34 #include "NOX_Epetra_Interface_Preconditioner.H" // base class
35 #include "NOX.H"
36 
37 // C++ includes
38 #include <cstddef>
39 
40 namespace libMesh
41 {
42 
43 // Forward declarations
44 class Problem_Interface;
45 
46 
55 template <typename T>
57 {
58 public:
63 
67  explicit
69 
73  virtual ~NoxNonlinearSolver ();
74 
78  virtual void clear ();
79 
83  virtual void init ();
84 
89  virtual std::pair<unsigned int, Real> solve (SparseMatrix<T> &, // System Jacobian Matrix
90  NumericVector<T> &, // Solution vector
91  NumericVector<T> &, // Residual vector
92  const double, // Stopping tolerance
93  const unsigned int); // N. Iterations
97  virtual int get_total_linear_iterations();
98 
104  virtual unsigned get_current_nonlinear_iteration_number() const { libmesh_not_implemented(); return 0; }
105 
106 private:
107 
111  NOX::Solver::Generic * _solver;
112 
117 
122 };
123 
124 
125 /*----------------------- functions ----------------------------------*/
126 template <typename T>
127 inline
129  NonlinearSolver<T>(system),
130  _solver(NULL),
131  _interface(NULL),
132  _n_linear_iterations(0)
133 {
134 }
135 
136 
137 
138 template <typename T>
139 inline
141 {
142  this->clear ();
143 }
144 
145 
146 } // namespace libMesh
147 
148 
149 #endif // #ifdef LIBMESH_HAVE_NOX
150 #endif // LIBMESH_TRILINOS_NOX_NONLINEAR_SOLVER_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:07 UTC

Hosted By:
SourceForge.net Logo