DAFunctionPatchMean.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v4
5 
6  Description:
7  Child class for mean variable on patches
8 
9 \*---------------------------------------------------------------------------*/
10 
11 #ifndef DAFunctionPatchMean_H
12 #define DAFunctionPatchMean_H
13 
14 #include "DAFunction.H"
15 #include "addToRunTimeSelectionTable.H"
16 
17 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
18 
19 namespace Foam
20 {
21 
22 /*---------------------------------------------------------------------------*\
23  Class DAFunctionPatchMean Declaration
24 \*---------------------------------------------------------------------------*/
25 
27  : public DAFunction
28 {
29 
30 protected:
32  scalar areaSum_ = -9999.0;
33 
35  word varName_;
36 
38  word varType_;
39 
41  label index_;
42 
43 public:
44  TypeName("patchMean");
45  // Constructors
46 
47  //- Construct from components
49  const fvMesh& mesh,
50  const DAOption& daOption,
51  const DAModel& daModel,
52  const DAIndex& daIndex,
53  const word functionName);
54 
55  //- Destructor
57  {
58  }
59 
61  virtual scalar calcFunction();
62 };
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 } // End namespace Foam
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 #endif
71 
72 // ************************************************************************* //
Foam::DAFunctionPatchMean::varType_
word varType_
type of the variable either vector or scalar
Definition: DAFunctionPatchMean.H:38
Foam::DAOption
Definition: DAOption.H:29
DAFunction.H
Foam::DAFunctionPatchMean::varName_
word varName_
name of the variable
Definition: DAFunctionPatchMean.H:35
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAFunctionPatchMean::TypeName
TypeName("patchMean")
Foam::DAFunctionPatchMean
Definition: DAFunctionPatchMean.H:26
Foam::DAIndex
Definition: DAIndex.H:32
Foam::DAModel
Definition: DAModel.H:57
Foam::DAFunction
Definition: DAFunction.H:31
Foam::DAFunctionPatchMean::calcFunction
virtual scalar calcFunction()
calculate the value of objective function
Definition: DAFunctionPatchMean.C:40
Foam
Definition: checkGeometry.C:32
Foam::DAFunctionPatchMean::DAFunctionPatchMean
DAFunctionPatchMean(const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex, const word functionName)
Definition: DAFunctionPatchMean.C:19
Foam::DAFunctionPatchMean::index_
label index_
if vector which element/index?
Definition: DAFunctionPatchMean.H:41
Foam::DAFunctionPatchMean::~DAFunctionPatchMean
virtual ~DAFunctionPatchMean()
Definition: DAFunctionPatchMean.H:56
Foam::DAFunctionPatchMean::areaSum_
scalar areaSum_
the area of all total pressure patches
Definition: DAFunctionPatchMean.H:32