DAStateInfo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6  Description:
7  Register the names of state variables and how do they connect
8  with their residuals
9 
10 \*---------------------------------------------------------------------------*/
11 
12 #ifndef DAStateInfo_H
13 #define DAStateInfo_H
14 
15 #include "runTimeSelectionTables.H"
16 #include "fvOptions.H"
17 #include "surfaceFields.H"
18 #include "DAOption.H"
19 #include "DAModel.H"
20 
21 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
22 
23 namespace Foam
24 {
25 
26 /*---------------------------------------------------------------------------*\
27  Class DAStateInfo Declaration
28 \*---------------------------------------------------------------------------*/
29 
31 {
32 
33 private:
35  DAStateInfo(const DAStateInfo&);
36 
38  void operator=(const DAStateInfo&);
39 
40 protected:
42  const fvMesh& mesh_;
43 
46 
48  const DAModel& daModel_;
49 
51  HashTable<wordList> stateInfo_;
52 
54  HashTable<List<List<word>>> stateResConInfo_;
55 
56 public:
58  TypeName("DAStateInfo");
59 
60  // Declare run-time constructor selection table
62  autoPtr,
64  dictionary,
65  (const word modelType,
66  const fvMesh& mesh,
67  const DAOption& daOption,
68  const DAModel& daModel),
69  (modelType, mesh, daOption, daModel));
70 
71  // Constructors
72 
73  //- Construct from components
75  const word modelType,
76  const fvMesh& mesh,
77  const DAOption& daOption,
78  const DAModel& daModel);
79 
80  // Selectors
81 
82  //- Return a reference to the selected model
83  static autoPtr<DAStateInfo> New(
84  const word modelType,
85  const fvMesh& mesh,
86  const DAOption& daOption,
87  const DAModel& daModel);
88 
89  //- Destructor
90  virtual ~DAStateInfo()
91  {
92  }
93 
95  const HashTable<wordList>& getStateInfo() const
96  {
97  return stateInfo_;
98  }
99 
101  const HashTable<List<List<word>>>& getStateResConInfo() const
102  {
103  return stateResConInfo_;
104  }
105 };
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 } // End namespace Foam
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 #endif
114 
115 // ************************************************************************* //
DAOption.H
Foam::DAStateInfo::getStateResConInfo
const HashTable< List< List< word > > > & getStateResConInfo() const
return the reference of stateResConInfo_
Definition: DAStateInfo.H:101
Foam::DAStateInfo::New
static autoPtr< DAStateInfo > New(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel)
Definition: DAStateInfo.C:43
Foam::DAStateInfo::TypeName
TypeName("DAStateInfo")
Runtime type information.
Foam::DAOption
Definition: DAOption.H:29
daOption
DAOption daOption(mesh, pyOptions_)
DAModel.H
Foam::DAStateInfo::mesh_
const fvMesh & mesh_
fvMesh
Definition: DAStateInfo.H:42
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAStateInfo::daOption_
const DAOption & daOption_
DAOption object.
Definition: DAStateInfo.H:45
Foam::DAModel
Definition: DAModel.H:59
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::DAStateInfo::stateResConInfo_
HashTable< List< List< word > > > stateResConInfo_
table to specify how the states are connected to the residuals for a given solver
Definition: DAStateInfo.H:54
Foam::DAStateInfo::~DAStateInfo
virtual ~DAStateInfo()
Definition: DAStateInfo.H:90
daModel
DAModel daModel(mesh, daOption)
Foam::DAStateInfo::getStateInfo
const HashTable< wordList > & getStateInfo() const
return the reference of stateInfo_
Definition: DAStateInfo.H:95
Foam::DAStateInfo
Definition: DAStateInfo.H:30
Foam::DAStateInfo::daModel_
const DAModel & daModel_
DAModel object.
Definition: DAStateInfo.H:48
Foam::DAStateInfo::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, DAStateInfo, dictionary,(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel),(modelType, mesh, daOption, daModel))
Foam::DAStateInfo::stateInfo_
HashTable< wordList > stateInfo_
registered states 1st hash: solverName, 2nd hash: fieldType, 3nd list, stateNames
Definition: DAStateInfo.H:51