Debian Codegraph @

packages/nox/test/epetra/Brusselator/Problem_Interface.H

raw
1 // @HEADER
2 // *****************************************************************************
3 // NOX: An Object-Oriented Nonlinear Solver Package
4 //
5 // Copyright 2002 NTESS and the NOX contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 //-----------------------------------------------------------------------------
11 #ifndef Problem_Interface_H
12 #define Problem_Interface_H
13
14 // Interface to the NOX_Epetra_Group to provide for
15 // residual and matrix fill routines.
16
17 // ---------- Standard Includes ----------
18 #include <iostream>
19 #include "Epetra_Vector.h"
20 #include "Epetra_Operator.h"
21 #include "Epetra_RowMatrix.h"
22 #include "NOX_Epetra_Interface_Required.H" // base class
23 #include "NOX_Epetra_Interface_Jacobian.H" // base class
24 #include "NOX_Epetra_Interface_Preconditioner.H" // base class
25
26 // ---------- Forward Declarations ----------
27 class Brusselator;
28
29 class Problem_Interface : public NOX::Epetra::Interface::Required,
30 public NOX::Epetra::Interface::Jacobian,
31 public NOX::Epetra::Interface::Preconditioner
32 {
33 public:
34 Problem_Interface(Brusselator& Problem);
35 ~Problem_Interface();
36
37 //! Compute and return F
38 bool computeF(const Epetra_Vector& x, Epetra_Vector& FVec,
39 NOX::Epetra::Interface::Required::FillType fillType);
40
41 //! Compute an explicit Jacobian
42 bool computeJacobian(const Epetra_Vector& x, Epetra_Operator& Jac);
43
44 //! Compute the Epetra_RowMatrix M, that will be used by the Aztec preconditioner instead of the Jacobian. This is used when there is no explicit Jacobian present (i.e. Matrix-Free Newton-Krylov). This MUST BE an Epetra_RowMatrix since the Aztec preconditioners need to know the sparsity pattern of the matrix. Returns true if computation was successful.
45 bool computePrecMatrix(const Epetra_Vector& x, Epetra_RowMatrix& M);
46
47 //! Computes a user supplied preconditioner based on input vector x. Returns true if computation was successful.
48 bool computePreconditioner(const Epetra_Vector& x, Epetra_Operator& Prec,
49 Teuchos::ParameterList* p);
50
51 //! Application Operator: Object that points to the user's evaluation routines.
52 /*! This is used to point to the actual routines and to store
53 * auxiliary data required by the user's application for function/Jacobian
54 * evaluations that NOX does not need to know about. This is type of
55 * passdown class design by the application code.
56 */
57 Brusselator& problem;
58 };
59
60 #endif
61