DAObjFuncFieldInversion.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 state error L2 norm sum[(state-stateRef)^2]
8 
9 \*---------------------------------------------------------------------------*/
10 
11 #ifndef DAObjFuncFieldInversion_H
12 #define DAObjFuncFieldInversion_H
13 
14 #include "DAObjFunc.H"
15 #include "addToRunTimeSelectionTable.H"
16 
17 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
18 
19 namespace Foam
20 {
21 
22 /*---------------------------------------------------------------------------*\
23  Class DAObjFuncFieldInversion Declaration
24 \*---------------------------------------------------------------------------*/
25 
27  : public DAObjFunc
28 {
29 
30 protected:
31 
33  word data_;
34 
35  word stateName_;
36 
38 
39  scalar scale_;
40 
42  bool weightedSum_; // switch
43  scalar weight_;
44 
47 
48 public:
49  TypeName("fieldInversion");
50  // Constructors
51 
52  //- Construct from components
54  const fvMesh& mesh,
55  const DAOption& daOption,
56  const DAModel& daModel,
57  const DAIndex& daIndex,
58  const DAResidual& daResidual,
59  const word objFuncName,
60  const word objFuncPart,
61  const dictionary& objFuncDict);
62 
63  //- Destructor
65  {
66  }
67 
69  virtual void calcObjFunc(
70  const labelList& objFuncFaceSources,
71  const labelList& objFuncCellSources,
72  scalarList& objFuncFaceValues,
73  scalarList& objFuncCellValues,
74  scalar& objFuncValue);
75 };
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 } // End namespace Foam
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 #endif
84 
85 // ************************************************************************* //
Foam::DAObjFuncFieldInversion::weightedSum_
bool weightedSum_
weighted objective function (especially useful when performing weighted sum multi-objective optimisat...
Definition: DAObjFuncFieldInversion.H:42
Foam::DAObjFuncFieldInversion::~DAObjFuncFieldInversion
virtual ~DAObjFuncFieldInversion()
Definition: DAObjFuncFieldInversion.H:64
Foam::DAObjFuncFieldInversion::TypeName
TypeName("fieldInversion")
Foam::DAObjFuncFieldInversion::data_
word data_
name of the state variable to compute the error norm
Definition: DAObjFuncFieldInversion.H:33
Foam::DAOption
Definition: DAOption.H:29
Foam::DAObjFuncFieldInversion::scale_
scalar scale_
Definition: DAObjFuncFieldInversion.H:39
Foam::DAObjFuncFieldInversion::DAObjFuncFieldInversion
DAObjFuncFieldInversion(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: DAObjFuncFieldInversion.C:19
daOption
DAOption daOption(mesh, pyOptions_)
Foam::DAObjFuncFieldInversion::calcObjFunc
virtual void calcObjFunc(const labelList &objFuncFaceSources, const labelList &objFuncCellSources, scalarList &objFuncFaceValues, scalarList &objFuncCellValues, scalar &objFuncValue)
calculate the value of objective function
Definition: DAObjFuncFieldInversion.C:80
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAObjFuncFieldInversion::stateName_
word stateName_
Definition: DAObjFuncFieldInversion.H:35
Foam::DAObjFuncFieldInversion::stateRefName_
word stateRefName_
Definition: DAObjFuncFieldInversion.H:37
Foam::DAIndex
Definition: DAIndex.H:32
Foam::DAModel
Definition: DAModel.H:59
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::DAObjFuncFieldInversion::weight_
scalar weight_
Definition: DAObjFuncFieldInversion.H:43
Foam::DAResidual
Definition: DAResidual.H:35
Foam::DATurbulenceModel
Definition: DATurbulenceModel.H:61
daModel
DAModel daModel(mesh, daOption)
daIndex
DAIndex daIndex(mesh, daOption, daModel)
DAObjFunc.H
Foam::DAObjFuncFieldInversion
Definition: DAObjFuncFieldInversion.H:26
Foam::DAObjFunc
Definition: DAObjFunc.H:33
Foam::DAObjFuncFieldInversion::daTurb_
const DATurbulenceModel & daTurb_
DATurbulenceModel object.
Definition: DAObjFuncFieldInversion.H:46