boundaryAdjointContributionIncompressible.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) 2007-2019 PCOpt/NTUA
9  Copyright (C) 2013-2019 FOSS GP
10  Copyright (C) 2019 OpenCFD Ltd.
11 -------------------------------------------------------------------------------
12 License
13  This file is part of OpenFOAM.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 
29 Class
30  Foam::boundaryAdjointContributionIncompressible
31 
32 Description
33  Contributions of objective function differentiation to adjoint
34  boundary conditions for incompressible flows
35 
36 
37 SourceFiles
38  boundaryAdjointContributionIncompressible.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef boundaryAdjointContributionIncompressible_H
43 #define boundaryAdjointContributionIncompressible_H
44 
46 #include "IOdictionary.H"
47 #include "autoPtr.H"
48 #include "runTimeSelectionTables.H"
49 #include "objectiveManager.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class boundaryAdjointContributionIncompressible Declaration
60 \*---------------------------------------------------------------------------*/
61 
63 :
65 {
66 private:
67 
68  // Private Member Functions
69 
70  //- No copy construct
72  (
74  ) = delete;
75 
76  //- No copy assignment
77  void operator=
78  (
80  ) = delete;
81 
82 
83 protected:
84 
85  // Protected data
86 
88 
90 
91  //- Note: getting a reference to the adjoint vars in the constructor of
92  //- boundaryAdjointContributionIncompressible is dangerous since the
93  //- autoPtr that holds them has not been completed yet. Instead, get
94  //- a reference to the solver and grab the adjoint vars from there,
95  //- when necessary
97 
98 
99  // Protected Member Functions
100 
101  template<class returnType, class sourceType, class castType>
103  (
104  PtrList<sourceType>& sourceList,
105  const fvPatchField<returnType>&(castType::*boundaryFunction)
106  (const label)
107  );
108 
109 
110 public:
111 
112  //- Runtime type information
113  TypeName("incompressible");
114 
115 
116  // Constructors
117 
118  //- Construct from components
120  (
121  const word& managerName,
122  const word& adjointSolverName,
123  const word& simulationType,
124  const fvPatch& patch
125  );
126 
127 
128  //- Destructor
129  virtual ~boundaryAdjointContributionIncompressible() = default;
130 
131 
132  // Member Functions
133 
134 // tmp<vectorField> boundarydJtotdv();
144 
149 
154 
155  const fvPatchVectorField& Ub() const;
156  const fvPatchScalarField& pb() const;
157  const fvsPatchScalarField& phib() const;
159  const fvPatchVectorField& Uab() const;
160  const fvPatchScalarField& pab() const;
161  const fvsPatchScalarField& phiab() const;
162 
163  const word primalSolverName() const;
164  const word adjointSolverName() const;
165 
166  const incompressibleVars& primalVars() const;
167  const incompressibleAdjointVars& adjointVars() const;
169 };
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace Foam
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #ifdef NoRepository
180 #endif
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
class for managing incompressible objective functions.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:68
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Class including all adjoint fields for incompressible flows.
Base class for incompressibleAdjoint solvers.
virtual ~boundaryAdjointContributionIncompressible()=default
Destructor.
Base class for solution control classes.
Contributions of objective function differentiation to adjoint boundary conditions for incompressible...
A class for handling words, derived from Foam::string.
Definition: word.H:63
const incompressibleAdjointSolver & adjointSolver_
Note: getting a reference to the adjoint vars in the constructor of boundaryAdjointContributionIncomp...
tmp< Field< returnType > > sumContributions(PtrList< sourceType > &sourceList, const fvPatchField< returnType > &(castType::*boundaryFunction)(const label))
Abstract base class for computing contributions of the objective functions to the adjoint boundary co...
TypeName("incompressible")
Runtime type information.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
const std::string patch
OpenFOAM patch number as a std::string.
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Namespace for OpenFOAM.