Debian Codegraph @

packages/nox/test/epetra/DS6.5.1/DennisSchnabel.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 // Finite Element Problem Class
11 /* Provides function (RHS) and Jacobian evaluations for the
12 * 2 equation test for quadratic and cubic line searches
13 * from Dennis & Schnabel's book, chp 6. example 6.5.1
14 *
15 * U0**2 + U1**2 - 2 = 0
16 * exp(U0-1) + U1**3 -2 = 0
17 */
18
19 #ifndef _NOX_EXAMPLE_DENNIS_SCHNABEL_651_H
20 #define _NOX_EXAMPLE_DENNIS_SCHNABEL_651_H
21
22 #include "NOX_Epetra_Interface_Required.H"
23 #include "Teuchos_RCP.hpp"
24
25 // Forward Declarations
26 class Epetra_Comm;
27 class Epetra_Map;
28 class Epetra_Vector;
29 class Epetra_Import;
30 class Epetra_CrsGraph;
31 class Epetra_CrsMatrix;
32
33 // Flag to tell the evaluate routine what objects to fill
34 enum FillType {F_ONLY, MATRIX_ONLY, ALL};
35
36 // Finite Element Problem Class
37 class DennisSchnabel {
38
39 public:
40
41 // Constructor
42 DennisSchnabel(int NumGlobalElements, Epetra_Comm& Comm);
43
44 // Destructor
45 ~DennisSchnabel();
46
47 // Evaluates the function (RHS) and/or the Jacobian using the solution
48 // values in solnVector.
49 bool evaluate( NOX::Epetra::Interface::Required::FillType fillType,
50 const Epetra_Vector *solnVector, Epetra_Vector *rhsVector);
51
52 // Return a reference to the Epetra_Vector with the initial guess
53 // that is generated by this class.
54 Teuchos::RCP<Epetra_Vector> getSolution();
55
56 // Return a reference to the Epetra_Vector with the Jacobian
57 // that is generated by this class.
58 Teuchos::RCP<Epetra_CrsMatrix> getJacobian();
59
60 private:
61
62 // inserts the global column indices into the Graph
63 Epetra_CrsGraph& generateGraph(Epetra_CrsGraph& AA);
64
65 private:
66
67 FillType flag;
68 Epetra_Map* StandardMap;
69 Epetra_Map* OverlapMap;
70 Epetra_Import* Importer;
71 Teuchos::RCP<Epetra_Vector> initialSolution;
72 Epetra_Vector* soln;
73 Epetra_Vector* rhs;
74 Epetra_CrsGraph* AA;
75 Teuchos::RCP<Epetra_CrsMatrix> A;
76 Epetra_Comm* Comm;
77
78 int MyPID; // Process number
79 int NumProc; // Total number of processes
80 int NumMyElements; // Number of elements owned by this process
81 int NumGlobalElements; // Total Number of elements
82
83 };
84 #endif
85
86
87
88