DAObjFuncVariableVolSum.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 variable volume sum
8 
9 \*---------------------------------------------------------------------------*/
10 
11 #ifndef DAObjFuncVariableVolSum_H
12 #define DAObjFuncVariableVolSum_H
13 
14 #include "DAObjFunc.H"
15 #include "addToRunTimeSelectionTable.H"
16 
17 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
18 
19 namespace Foam
20 {
21 
22 /*---------------------------------------------------------------------------*\
23  Class DAObjFuncVariableVolSum Declaration
24 \*---------------------------------------------------------------------------*/
25 
27  : public DAObjFunc
28 {
29 
30 protected:
31 
33  word varName_;
34 
36  word varType_;
37 
39  label component_;
40 
42  label isSquare_;
43 
46 
47 public:
48  TypeName("variableVolSum");
49  // Constructors
50 
51  //- Construct from components
53  const fvMesh& mesh,
54  const DAOption& daOption,
55  const DAModel& daModel,
56  const DAIndex& daIndex,
57  const DAResidual& daResidual,
58  const word objFuncName,
59  const word objFuncPart,
60  const dictionary& objFuncDict);
61 
62  //- Destructor
64  {
65  }
66 
68  virtual void calcObjFunc(
69  const labelList& objFuncFaceSources,
70  const labelList& objFuncCellSources,
71  scalarList& objFuncFaceValues,
72  scalarList& objFuncCellValues,
73  scalar& objFuncValue);
74 };
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 } // End namespace Foam
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 #endif
83 
84 // ************************************************************************* //
Foam::DAObjFuncVariableVolSum::divByTotalVol_
label divByTotalVol_
whether to normalize the volume sum with the total volume
Definition: DAObjFuncVariableVolSum.H:45
Foam::DAObjFuncVariableVolSum::calcObjFunc
virtual void calcObjFunc(const labelList &objFuncFaceSources, const labelList &objFuncCellSources, scalarList &objFuncFaceValues, scalarList &objFuncCellValues, scalar &objFuncValue)
calculate the value of objective function
Definition: DAObjFuncVariableVolSum.C:61
Foam::DAObjFuncVariableVolSum::varName_
word varName_
name of the variable
Definition: DAObjFuncVariableVolSum.H:33
Foam::DAOption
Definition: DAOption.H:29
Foam::DAObjFuncVariableVolSum::DAObjFuncVariableVolSum
DAObjFuncVariableVolSum(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: DAObjFuncVariableVolSum.C:19
daOption
DAOption daOption(mesh, pyOptions_)
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAIndex
Definition: DAIndex.H:32
Foam::DAObjFuncVariableVolSum::~DAObjFuncVariableVolSum
virtual ~DAObjFuncVariableVolSum()
Definition: DAObjFuncVariableVolSum.H:63
Foam::DAModel
Definition: DAModel.H:59
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::DAObjFuncVariableVolSum::varType_
word varType_
type of the variable either vector or scalar
Definition: DAObjFuncVariableVolSum.H:36
Foam::DAObjFuncVariableVolSum
Definition: DAObjFuncVariableVolSum.H:26
Foam::DAResidual
Definition: DAResidual.H:35
Foam::DAObjFuncVariableVolSum::isSquare_
label isSquare_
whether to take a square of the variable
Definition: DAObjFuncVariableVolSum.H:42
daModel
DAModel daModel(mesh, daOption)
daIndex
DAIndex daIndex(mesh, daOption, daModel)
DAObjFunc.H
Foam::DAObjFuncVariableVolSum::component_
label component_
if vector which element?
Definition: DAObjFuncVariableVolSum.H:39
Foam::DAObjFuncVariableVolSum::TypeName
TypeName("variableVolSum")
Foam::DAObjFunc
Definition: DAObjFunc.H:33