DAOutput.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v4
5 
6  Description:
7  Assign the output array to the OF variables
8 
9 \*---------------------------------------------------------------------------*/
10 
11 #ifndef DAOutput_H
12 #define DAOutput_H
13 
14 #include "runTimeSelectionTables.H"
15 #include "fvOptions.H"
16 #include "DAOption.H"
17 #include "DAModel.H"
18 #include "DAIndex.H"
19 #include "DAStateInfo.H"
20 #include "DAFunction.H"
21 #include "DAResidual.H"
22 
23 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
24 
25 namespace Foam
26 {
27 
28 /*---------------------------------------------------------------------------*\
29  Class DAOutput Declaration
30 \*---------------------------------------------------------------------------*/
31 
32 class DAOutput
33 {
34 
35 private:
37  DAOutput(const DAOutput&);
38 
40  void operator=(const DAOutput&);
41 
42 protected:
44  const word outputName_;
45 
47  const word outputType_;
48 
50  fvMesh& mesh_;
51 
54 
57 
59  const DAIndex& daIndex_;
60 
62 
63  UPtrList<DAFunction>& daFunctionList_;
64 
66  HashTable<wordList> stateInfo_;
67 
68 public:
70  TypeName("DAOutput");
71 
72  // Declare run-time constructor selection table
74  autoPtr,
75  DAOutput,
76  dictionary,
77  (
78  const word outputName,
79  const word outputType,
80  fvMesh& mesh,
81  const DAOption& daOption,
82  DAModel& daModel,
83  const DAIndex& daIndex,
84  DAResidual& daResidual,
85  UPtrList<DAFunction>& daFunctionList),
86  (
87  outputName,
88  outputType,
89  mesh,
90  daOption,
91  daModel,
92  daIndex,
93  daResidual,
94  daFunctionList));
95 
96  // Constructors
97 
98  //- Construct from components
99  DAOutput(
100  const word outputName,
101  const word outputType,
102  fvMesh& mesh,
103  const DAOption& daOption,
104  DAModel& daModel,
105  const DAIndex& daIndex,
106  DAResidual& daResidual,
107  UPtrList<DAFunction>& daFunctionList);
108 
109  // Selectors
110 
111  //- Return a reference to the selected model
112  static autoPtr<DAOutput> New(
113  const word outputName,
114  const word outputType,
115  fvMesh& mesh,
116  const DAOption& daOption,
117  DAModel& daModel,
118  const DAIndex& daIndex,
119  DAResidual& daResidual,
120  UPtrList<DAFunction>& daFunctionList);
121 
122  //- Destructor
123  virtual ~DAOutput()
124  {
125  }
126 
127  virtual void run(scalarList& output) = 0;
128 
129  virtual label size() = 0;
130 
131  virtual label distributed() = 0;
132 };
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
Foam::DAOutput::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, DAOutput, dictionary,(const word outputName, const word outputType, fvMesh &mesh, const DAOption &daOption, DAModel &daModel, const DAIndex &daIndex, DAResidual &daResidual, UPtrList< DAFunction > &daFunctionList),(outputName, outputType, mesh, daOption, daModel, daIndex, daResidual, daFunctionList))
DAOption.H
Foam::DAOutput::TypeName
TypeName("DAOutput")
Runtime type information.
DAIndex.H
Foam::DAOutput::daResidual_
DAResidual & daResidual_
Definition: DAOutput.H:61
Foam::DAOption
Definition: DAOption.H:29
DAFunction.H
Foam::DAOutput::size
virtual label size()=0
Foam::DAOutput::run
virtual void run(scalarList &output)=0
Foam::DAOutput::stateInfo_
HashTable< wordList > stateInfo_
the stateInfo_ list from DAStateInfo object
Definition: DAOutput.H:66
DAResidual.H
Foam::DAOutput::daFunctionList_
UPtrList< DAFunction > & daFunctionList_
Definition: DAOutput.H:63
DAModel.H
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAOutput::outputName_
const word outputName_
name of the output
Definition: DAOutput.H:44
Foam::DAOutput::daModel_
DAModel & daModel_
DAIndex object.
Definition: DAOutput.H:56
Foam::DAIndex
Definition: DAIndex.H:32
Foam::DAOutput::New
static autoPtr< DAOutput > New(const word outputName, const word outputType, fvMesh &mesh, const DAOption &daOption, DAModel &daModel, const DAIndex &daIndex, DAResidual &daResidual, UPtrList< DAFunction > &daFunctionList)
Definition: DAOutput.C:48
Foam::DAOutput
Definition: DAOutput.H:32
Foam::DAOutput::outputType_
const word outputType_
type of the output
Definition: DAOutput.H:47
Foam::DAModel
Definition: DAModel.H:57
Foam::DAOutput::daOption_
const DAOption & daOption_
DAOption object.
Definition: DAOutput.H:53
Foam
Definition: checkGeometry.C:32
Foam::DAResidual
Definition: DAResidual.H:36
Foam::DAOutput::~DAOutput
virtual ~DAOutput()
Definition: DAOutput.H:123
DAStateInfo.H
Foam::DAOutput::distributed
virtual label distributed()=0
Foam::DAOutput::daIndex_
const DAIndex & daIndex_
DAIndex object.
Definition: DAOutput.H:59
Foam::DAOutput::mesh_
fvMesh & mesh_
fvMesh
Definition: DAOutput.H:50