Debian Codegraph @

packages/nox/test/epetra/MultiPhysics/HMX_PDE.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_HMX_PDE_EQUATION_H
22 #define _NOX_TEST_HMX_PDE_EQUATION_H
23
24 #include "GenericEpetraProblem.H" // Base class
25
26 // Single PDE Equation Problem Class for HMX Cook-off problem
27
28 class HMX_PDE : public GenericEpetraProblem {
29
30 public:
31
32 // Constructor
33 HMX_PDE(Epetra_Comm& Comm,
34 double diffCoef,
35 double Const_R,
36 double Steric_C,
37 double PreExp_A,
38 double ActEnergy,
39 map<string, double> SrcTermExponent,
40 map<string, double> SrcTermWeight,
41 int NumGlobalUnknowns = 0,
42 std::string name = "");
43
44 // Destructor
45 ~HMX_PDE();
46
47 // Reset problem for next parameter (time) step.
48 // For now, this simply updates oldsoln with the given Epetra_Vector
49 void reset(const Epetra_Vector& x);
50
51 void reset(); // Empty reset method needed here to prevent hiding base
52 // class method.
53
54 // Set initial condition for solution vector
55 void initializeSolution(double val = 0.0);
56
57 // Evaluates the function (F) and/or the Jacobian using the solution
58 // values in solnVector.
59 bool evaluate( NOX::Epetra::Interface::Required::FillType fill,
60 const Epetra_Vector *solnVector,
61 Epetra_Vector *rhsVector);
62
63 // Set name of field to use for temperature field
64 void setTempFieldName(std::string name)
65 { tempFieldName = name; };
66
67 // Compute my Source term - Epetra_Vector arguments
68 void computeSourceTerm(map<string, Epetra_Vector*>, Epetra_Vector&);
69
70 // Compute my Source term - double* arguments
71 void computeSourceTerm(int arraySize, map<string, double*>,
72 double*&);
73
74 // FUTURE stuff....
75 // Compute dependence of Rxn rate on Temperature
76 void compute_dRdT();
77
78 // FUTURE stuff....
79 // Compute dependence of Rxn rate on Self-Species
80 void compute_dRdN();
81
82 // Accesor function for time step
83 double getdt() const;
84
85 // Return a reference to the Epetra_Vector with the old solution
86 Epetra_Vector& getOldSoln();
87
88
89 protected:
90
91 // inserts the global column indices into the Graph
92 void generateGraph();
93
94 protected:
95
96 double xmin;
97 double xmax;
98 double dx;
99 double dt;
100
101 double diffCoef;
102 double Const_R;
103 double StericCoef;
104 double PreExp_A;
105 double ActEnergy;
106 map<string, double> SrcTermExponent;
107 map<string, double> SrcTermWeight;
108
109 std::string tempFieldName; // Needed to id temp field
110
111 FillType flag;
112 Epetra_Import *ColumnToOverlapImporter;
113 Epetra_Vector *oldSolution;
114 Epetra_Vector *rhs;
115 };
116 #endif
117
118
119
120