Debian Codegraph @

packages/nox/test/epetra/MultiPhysics/Burgers.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 (F) and Jacobian evaluations for the following equation
12 * via a 1D linear finite element discretization with Epetra objects.
13 *
14 * d2u
15 * --- - k * u**2 = 0
16 * dx2
17 *
18 * subject to @ x=0, u=1
19 */
20
21 #ifndef _NOX_TEST_EPETRA_MULTIPHYSICS_BURGERS_H
22 #define _NOX_TEST_EPETRA_MULTIPHYSICS_BURGERS_H
23
24 #include "GenericEpetraProblem.H"
25
26 // Forward Declarations
27 //class Epetra_Comm;
28 //class Epetra_Map;
29 //class Epetra_Vector;
30 //class Epetra_Import;
31 //class Epetra_CrsGraph;
32 //class Epetra_CrsMatrix;
33
34 // Finite Element Problem Class
35 class Burgers : public GenericEpetraProblem {
36
37 public:
38
39 // Constructor
40 Burgers(Epetra_Comm& Comm, int NumGlobalNodes, std::string name);
41
42 // Destructor
43 ~Burgers();
44
45 // Reset problem for next parameter (time) step.
46 // For now, this simply updates oldsoln with the given Epetra_Vector
47 void reset(const Epetra_Vector& x);
48
49 void reset(); // Empty reset method needed here to prevent hiding base
50 // class method.
51
52 // Set initial condition for solution vector
53 bool initializeSoln();
54
55 // Evaluates the function (F) and/or the Jacobian using the solution
56 // values in solnVector.
57 bool evaluate( NOX::Epetra::Interface::Required::FillType fill,
58 const Epetra_Vector *solnVector,
59 Epetra_Vector *rhsVector);
60
61 // Return a reference to the Epetra_Vector with the exact analytic solution
62 Epetra_Vector& getExactSoln(double time);
63
64 // Return a reference to the Epetra_Vector with the initial guess
65 // that is generated by the FiniteElementProblem class.
66 Teuchos::RCP<Epetra_Vector> getSolution();
67
68 // Accesor function for time step
69 double getdt() const { return dt; }
70
71 // Accesor function for setting time step
72 void setdt( double dt_ ) { dt = dt_;}
73
74 // Return a reference to the Epetra_Vector with the old solution
75 Epetra_Vector& getOldSoln();
76
77 protected:
78
79 // inserts the global column indices into the Graph
80 void generateGraph();
81
82 protected:
83
84 double xFactor;
85 double viscosity;
86 double xmin;
87 double xmax;
88 double dx;
89 double dt;
90
91 Epetra_Import *ColumnToOverlapImporter;
92 Epetra_Vector *oldSolution;
93 Epetra_Vector *rhs;
94 Epetra_Vector *exactSolution;
95 };
96 #endif
97