DAObjFuncPatchMean.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6  Description:
7  Child class for mean variable on patches
8 
9 \*---------------------------------------------------------------------------*/
10 
11 #ifndef DAObjFuncPatchMean_H
12 #define DAObjFuncPatchMean_H
13 
14 #include "DAObjFunc.H"
15 #include "addToRunTimeSelectionTable.H"
16 
17 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
18 
19 namespace Foam
20 {
21 
22 /*---------------------------------------------------------------------------*\
23  Class DAObjFuncPatchMean Declaration
24 \*---------------------------------------------------------------------------*/
25 
27  : public DAObjFunc
28 {
29 
30 protected:
31 
33  scalar areaSum_ = -9999.0;
34 
36  word varName_;
37 
39  word varType_;
40 
42  label component_;
43 
44 public:
45  TypeName("patchMean");
46  // Constructors
47 
48  //- Construct from components
50  const fvMesh& mesh,
51  const DAOption& daOption,
52  const DAModel& daModel,
53  const DAIndex& daIndex,
54  const DAResidual& daResidual,
55  const word objFuncName,
56  const word objFuncPart,
57  const dictionary& objFuncDict);
58 
59  //- Destructor
61  {
62  }
63 
65  virtual void calcObjFunc(
66  const labelList& objFuncFaceSources,
67  const labelList& objFuncCellSources,
68  scalarList& objFuncFaceValues,
69  scalarList& objFuncCellValues,
70  scalar& objFuncValue);
71 };
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 } // End namespace Foam
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 #endif
80 
81 // ************************************************************************* //
Foam::DAObjFuncPatchMean::component_
label component_
if vector which element?
Definition: DAObjFuncPatchMean.H:42
Foam::DAObjFuncPatchMean::calcObjFunc
virtual void calcObjFunc(const labelList &objFuncFaceSources, const labelList &objFuncCellSources, scalarList &objFuncFaceValues, scalarList &objFuncCellValues, scalar &objFuncValue)
calculate the value of objective function
Definition: DAObjFuncPatchMean.C:51
Foam::DAOption
Definition: DAOption.H:29
daOption
DAOption daOption(mesh, pyOptions_)
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAObjFuncPatchMean
Definition: DAObjFuncPatchMean.H:26
Foam::DAIndex
Definition: DAIndex.H:32
Foam::DAModel
Definition: DAModel.H:59
Foam::DAObjFuncPatchMean::varName_
word varName_
name of the variable
Definition: DAObjFuncPatchMean.H:36
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::DAObjFuncPatchMean::TypeName
TypeName("patchMean")
Foam::DAResidual
Definition: DAResidual.H:35
Foam::DAObjFuncPatchMean::areaSum_
scalar areaSum_
the area of all total pressure patches
Definition: DAObjFuncPatchMean.H:33
daModel
DAModel daModel(mesh, daOption)
Foam::DAObjFuncPatchMean::varType_
word varType_
type of the variable either vector or scalar
Definition: DAObjFuncPatchMean.H:39
daIndex
DAIndex daIndex(mesh, daOption, daModel)
DAObjFunc.H
Foam::DAObjFuncPatchMean::~DAObjFuncPatchMean
virtual ~DAObjFuncPatchMean()
Definition: DAObjFuncPatchMean.H:60
Foam::DAObjFuncPatchMean::DAObjFuncPatchMean
DAObjFuncPatchMean(const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex, const DAResidual &daResidual, const word objFuncName, const word objFuncPart, const dictionary &objFuncDict)
Definition: DAObjFuncPatchMean.C:19
Foam::DAObjFunc
Definition: DAObjFunc.H:33