DAFunctionLocation.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 location of a select patch, e.g., maxRadius
8 
9 \*---------------------------------------------------------------------------*/
10 
11 #ifndef DAFunctionLocation_H
12 #define DAFunctionLocation_H
13 
14 #include "DAFunction.H"
15 #include "addToRunTimeSelectionTable.H"
16 
17 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
18 
19 namespace Foam
20 {
21 
22 /*---------------------------------------------------------------------------*\
23  Class DAFunctionLocation Declaration
24 \*---------------------------------------------------------------------------*/
25 
27  : public DAFunction
28 {
29 
30 protected:
32  scalar coeffKS_ = 1.0;
33 
35  word mode_;
36 
38  vector axis_ = {1, 0, 0};
39 
41  vector center_ = {0, 0, 0};
42 
44  label maxRPatchI_ = -1;
45 
47  label maxRFaceI_ = -1;
48 
50  label snapCenter2Cell_ = 0;
51 
53  label snappedCenterCellI_ = -1;
54 
55 public:
56  TypeName("location");
57  // Constructors
58 
59  //- Construct from components
61  const fvMesh& mesh,
62  const DAOption& daOption,
63  const DAModel& daModel,
64  const DAIndex& daIndex,
65  const word functionName);
66 
67  //- Destructor
69  {
70  }
71 
73  virtual scalar calcFunction();
74 
76  label snappedCenterCellI,
77  vector& center);
78 };
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 } // End namespace Foam
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 #endif
87 
88 // ************************************************************************* //
Foam::DAFunctionLocation::snapCenter2Cell_
label snapCenter2Cell_
whether to snap the center to a cell in the mesh if yes the center will move with the mesh
Definition: DAFunctionLocation.H:50
Foam::DAFunctionLocation::snappedCenterCellI_
label snappedCenterCellI_
the cell index for the center if snapCenter2Cell_ = 1
Definition: DAFunctionLocation.H:53
Foam::DAFunctionLocation
Definition: DAFunctionLocation.H:26
Foam::DAFunctionLocation::center_
vector center_
center for radius computation
Definition: DAFunctionLocation.H:41
Foam::DAOption
Definition: DAOption.H:29
DAFunction.H
Foam::DAFunctionLocation::maxRPatchI_
label maxRPatchI_
maxRadius patchI
Definition: DAFunctionLocation.H:44
Foam::DAFunctionLocation::TypeName
TypeName("location")
Foam::DAFunctionLocation::axis_
vector axis_
axis for radius computation
Definition: DAFunctionLocation.H:38
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAFunctionLocation::maxRFaceI_
label maxRFaceI_
maxRadius patchI
Definition: DAFunctionLocation.H:47
Foam::DAIndex
Definition: DAIndex.H:32
Foam::DAFunctionLocation::mode_
word mode_
location mode to use
Definition: DAFunctionLocation.H:35
Foam::DAFunctionLocation::calcFunction
virtual scalar calcFunction()
calculate the value of objective function
Definition: DAFunctionLocation.C:153
Foam::DAFunctionLocation::findGlobalSnappedCenter
void findGlobalSnappedCenter(label snappedCenterCellI, vector &center)
Definition: DAFunctionLocation.C:129
Foam::DAModel
Definition: DAModel.H:57
Foam::DAFunction
Definition: DAFunction.H:31
Foam
Definition: checkGeometry.C:32
Foam::DAFunctionLocation::DAFunctionLocation
DAFunctionLocation(const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex, const word functionName)
Definition: DAFunctionLocation.C:19
Foam::DAFunctionLocation::coeffKS_
scalar coeffKS_
coefficient for the KS function
Definition: DAFunctionLocation.H:32
Foam::DAFunctionLocation::~DAFunctionLocation
virtual ~DAFunctionLocation()
Definition: DAFunctionLocation.H:68