sensitivityMultiple.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-2020 PCOpt/NTUA
9  Copyright (C) 2013-2020 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 Class
29  Foam::sensitivityMultiple
30 
31 Description
32  Calculation of adjoint based sensitivities of multiple types
33 
34 SourceFiles
35  sensitivityMultiple.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef sensitivityMultiple_H
40 #define sensitivityMultiple_H
41 
42 #include "adjointSensitivity.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class sensitivityMultiple Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public adjointSensitivity
56 {
57 protected:
58 
59  // Protected data
60 
62 
64 
65 
66 private:
67 
68  // Private Member Functions
69 
70  //- No copy construct
72 
73  //- No copy assignment
74  void operator=(const sensitivityMultiple&) = delete;
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("multiple");
81 
82 
83  // Constructors
84 
85  //- Construct from components
87  (
88  const fvMesh& mesh,
89  const dictionary& dict,
91  );
92 
93 
94  //- Destructor
95  virtual ~sensitivityMultiple() = default;
96 
97 
98  // Member Functions
99 
100  //- Read dict if changed
101  virtual bool readDict(const dictionary& dict);
102 
103  //- Accumulate sensitivity integrands
104  virtual void accumulateIntegrand(const scalar dt);
105 
106  //- Assemble sensitivities
107  virtual void assembleSensitivities(autoPtr<designVariables>& designVars);
108 
109  //- Calculates sensitivities at wall surface points
111  (
112  autoPtr<designVariables>& designVars
113  );
114 
115  //- Zero sensitivity fields and their constituents
116  virtual void clearSensitivities();
117 
118  //- Write sensitivities to file
119  virtual void write(const word& baseName = word::null);
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #endif
130 
131 // ************************************************************************* //
virtual void assembleSensitivities(autoPtr< designVariables > &designVars)
Assemble sensitivities.
virtual void clearSensitivities()
Zero sensitivity fields and their constituents.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual void write(const word &baseName=word::null)
Write sensitivities to file.
Abstract base class for adjoint-based sensitivities.
Base class for adjoint solvers.
Definition: adjointSolver.H:53
const fvMesh & mesh() const
Return reference to mesh.
Definition: sensitivity.H:121
A class for handling words, derived from Foam::string.
Definition: word.H:63
static const word null
An empty word.
Definition: word.H:84
Calculation of adjoint based sensitivities of multiple types.
virtual void accumulateIntegrand(const scalar dt)
Accumulate sensitivity integrands.
virtual bool readDict(const dictionary &dict)
Read dict if changed.
const dictionary & dict() const
Return the construction dictionary.
Definition: sensitivity.H:129
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const scalarField & calculateSensitivities(autoPtr< designVariables > &designVars)
Calculates sensitivities at wall surface points.
PtrList< adjointSensitivity > sens_
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual ~sensitivityMultiple()=default
Destructor.
TypeName("multiple")
Runtime type information.
Namespace for OpenFOAM.