shapeSensitivitiesIncompressible.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) 2020 PCOpt/NTUA
9 Copyright (C) 2020 FOSS GP
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::incompressible::shapeSensitivitiesBase
29
30Description
31 Base class supporting shape sensitivity derivatives for
32 incompressible flows
33
34SourceFiles
35 shapeSensitivitiesBase.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef shapeSensitivitiesIncompressible_H
40#define shapeSensitivitiesIncompressible_H
41
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49namespace incompressible
50{
51
52/*---------------------------------------------------------------------------*\
53 Class shapeSensitivities Declaration
54\*---------------------------------------------------------------------------*/
57:
58 public adjointSensitivity,
60{
61protected:
62
63 // Protected data
64
65 //- Fields related to direct sensitivities
70
71
72 // Protected Member Fuctions
73
74 //- Accumulate direct sensitivities
75 virtual void accumulateDirectSensitivityIntegrand(const scalar dt);
76
77 //- Accumulate sensitivities enamating from the boundary conditions
78 virtual void accumulateBCSensitivityIntegrand(const scalar dt);
79
80 //- Compute multiplier of dv_i/db
82
83
84private:
85
86 // Private Member Functions
87
88 //- No copy construct
90
91 //- No copy assignment
92 void operator=(const shapeSensitivities&) = delete;
93
94
95public:
96
97 //- Runtime type information
98 TypeName("shapeSensitivities");
99
100
101 // Constructors
102
103 //- Construct from components
105 (
106 const fvMesh& mesh,
107 const dictionary& dict,
109 );
110
111
112 //- Destructor
113 virtual ~shapeSensitivities() = default;
114
115
116 // Member Functions
117
118 //- Accumulate sensitivity integrands
119 virtual void accumulateIntegrand(const scalar dt) = 0;
120
121 //- Assemble sensitivities
122 virtual void assembleSensitivities() = 0;
123
124 //- Zero sensitivity fields and their constituents
125 virtual void clearSensitivities();
126
127 //- Write sensitivity fields.
128 virtual void write(const word& baseName = word::null);
129};
130
131
132// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133
134} // End namespace incompressible
135} // End namespace Foam
136
137// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138
139#endif
140
141// ************************************************************************* //
Base class for adjoint solvers.
Definition: adjointSolver.H:60
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Base class for incompressibleAdjoint solvers.
Abstract base class for adjoint-based sensitivities in incompressible flows.
virtual void clearSensitivities()
Zero sensitivity fields and their constituents.
virtual void accumulateBCSensitivityIntegrand(const scalar dt)
Accumulate sensitivities enamating from the boundary conditions.
TypeName("shapeSensitivities")
Runtime type information.
virtual void assembleSensitivities()=0
Assemble sensitivities.
virtual void accumulateIntegrand(const scalar dt)=0
Accumulate sensitivity integrands.
virtual ~shapeSensitivities()=default
Destructor.
autoPtr< boundaryVectorField > dSfdbMult_
Fields related to direct sensitivities.
virtual void accumulateDirectSensitivityIntegrand(const scalar dt)
Accumulate direct sensitivities.
tmp< boundaryVectorField > dvdbMult() const
Compute multiplier of dv_i/db.
const dictionary & dict() const
Return the construction dictionary.
Definition: sensitivity.C:57
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73