objectiveGeometric.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2023 PCOpt/NTUA
9  Copyright (C) 2023 FOSS GP
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 
28 Class
29  Foam::objectiveGeometric
30 
31 Description
32  Abstract base class for objective functions that contain only geometric
33  quantities
34 
35 SourceFiles
36  objectiveGeometric.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef objectiveGeometric_H
41 #define objectiveGeometric_H
42 
43 #include "objective.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class objectiveGeometric Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public objective
57 {
58 
59 private:
60 
61  // Private Member Functions
62 
63  //- No copy construct
64  objectiveGeometric(const objectiveGeometric&) = delete;
65 
66  //- No copy assignment
67  void operator=(const objectiveGeometric&) = delete;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("geometric");
74 
75 
76  // Declare run-time constructor selection table
77 
79  (
80  autoPtr,
82  dictionary,
83  (
84  const fvMesh& mesh,
85  const dictionary& dict,
86  const word& adjointSolverName,
87  const word& primalSolverName
88  ),
89  (mesh, dict, adjointSolverName, primalSolverName)
90  );
91 
92 
93  // Constructors
94 
95  //- Construct from components
97  (
98  const fvMesh& mesh,
99  const dictionary& dict,
100  const word& adjointSolverName,
101  const word& primalSolverName
102  );
103 
104 
105  // Selectors
106 
107  //- Return a reference to the selected turbulence model
109  (
110  const fvMesh& mesh,
111  const dictionary& dict,
112  const word& adjointSolverName,
113  const word& primalSolverName
114  );
115 
116 
117  //- Destructor
118  virtual ~objectiveGeometric() = default;
119 
120 
121  // Member Functions
122 
123  //- Return the objective function value
124  virtual scalar J() = 0;
125 
126  //- Update objective function derivatives
127  virtual void update();
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
TypeName("geometric")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, objectiveGeometric, dictionary,(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName),(mesh, dict, adjointSolverName, primalSolverName))
const dictionary & dict() const
Return objective dictionary.
Definition: objective.C:91
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Abstract base class for objective functions that contain only geometric quantities.
static autoPtr< objectiveGeometric > New(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
Return a reference to the selected turbulence model.
dynamicFvMesh & mesh
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual ~objectiveGeometric()=default
Destructor.
virtual scalar J()=0
Return the objective function value.
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
Definition: objective.H:55
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual void update()
Update objective function derivatives.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Namespace for OpenFOAM.