Loading...
Searching...
No Matches
sensitivitySurfacePoints.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-------------------------------------------------------------------------------
12License
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
28Class
29 Foam::sensitivitySurfacePoints
30
31Description
32 Calculation of adjoint-based sensitivities at wall points using the
33 E-SI formulation
34
35SourceFiles
36 sensitivitySurfacePoints.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef sensitivitySurfacePoints_H
41#define sensitivitySurfacePoints_H
42
43#include "sensitivityShapeESI.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
50/*---------------------------------------------------------------------------*\
51 Class sensitivitySurfacePoints Declaration
52\*---------------------------------------------------------------------------*/
53
54class sensitivitySurfacePoints
55:
56 public sensitivityShapeESI
57{
58protected:
59
60 // Protected data
61
62 //- Write geometric info for use by external programs
64
65 //- Include surface area in sens computation
67
68 //- Is point belonging to a symmetry{Plane}
71 //- Local point normal per symmetry point
73
74 //- Extended patchIDs
75 // Sensitivities from patches adjacent to the sensitivityPatchIDs_
76 // should also be taken into consideration in order to compute the
77 // correct values at points in their interfaces
79
80
81 // Protected Member Functions
82
83 //- Set suffix name for sensitivity fields
85
86 //- Converts face sensitivities to point sensitivities and adds the
87 //- ones directly computed in points (i.e. dSf/db and dnf/db).
89
90 //- Construct globally correct point normals and point areas
92 (
93 vectorField& pointNormals,
94 scalarField& pointMagSf
95 );
96
97 //- Set suffix name for sensitivity fields
98 void setSuffixName();
99
100 //- Allocate the proper size for the point-based sensitivities
102
103
104private:
105
106 // Private Member Functions
107
108 //- No copy construct
109 sensitivitySurfacePoints(const sensitivitySurfacePoints&) = delete;
110
111 //- No copy assignment
112 void operator=(const sensitivitySurfacePoints&) = delete;
113
114
115public:
116
117 //- Runtime type information
118 TypeName("surfacePoints");
119
120
121 // Constructors
122
123 //- Construct from components
124 sensitivitySurfacePoints
125 (
126 const fvMesh& mesh,
127 const dictionary& dict,
129 );
130
131
132 //- Destructor
133 virtual ~sensitivitySurfacePoints() = default;
134
135
136 // Member Functions
137
138 //- Read controls and update solver pointers if necessary
139 void read();
141 //- Read dict if changed
142 virtual bool readDict(const dictionary& dict);
143
144 //- Return set of patches on which to compute direct sensitivities
146
147 //- Assemble sensitivities
148 virtual void assembleSensitivities
149 (
150 autoPtr<designVariables>& designVars
151 );
152
153 //- Write sensitivity fields.
154 // If valid, copies boundaryFields to pointFields and writes them.
155 virtual void write(const word& baseName = word::null);
156};
157
158
159// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160
161} // End namespace Foam
162
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165#endif
166
167// ************************************************************************* //
Base class for adjoint solvers.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
void computePointDerivativesSize()
Allocate the proper size for the point-based sensitivities.
void constructGlobalPointNormalsAndAreas(vectorField &pointNormals, scalarField &pointMagSf)
Construct globally correct point normals and point areas.
void setSuffixName()
Set suffix name for sensitivity fields.
virtual bool readDict(const dictionary &dict)
Read dict if changed.
bool includeSurfaceArea_
Include surface area in sens computation.
bool writeGeometricInfo_
Write geometric info for use by external programs.
void read()
Read controls and update solver pointers if necessary.
virtual ~sensitivitySurfacePoints()=default
Destructor.
boolList isSymmetryPoint_
Is point belonging to a symmetry{Plane}.
labelHashSet extendedPatchIDs_
Extended patchIDs.
labelHashSet populateExtendedIDs() const
Set suffix name for sensitivity fields.
vectorField symmPointNormal_
Local point normal per symmetry point.
void finalisePointSensitivities()
Converts face sensitivities to point sensitivities and adds the ones directly computed in points (i....
virtual const labelHashSet & geometryVariationIntegrationPatches() const
Return set of patches on which to compute direct sensitivities.
TypeName("surfacePoints")
Runtime type information.
virtual void assembleSensitivities(autoPtr< designVariables > &designVars)
Assemble sensitivities.
A class for handling words, derived from Foam::string.
Definition word.H:66
static const word null
An empty word.
Definition word.H:84
dynamicFvMesh & mesh
Namespace for OpenFOAM.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition HashSet.H:85
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< bool > boolList
A List of bools.
Definition List.H:60
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68