Bezier.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-------------------------------------------------------------------------------
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::Bezier
30
31Description
32 Calculation of adjoint based sensitivities for Bezier control points
33
34SourceFiles
35 Bezier.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef Bezier_H
40#define Bezier_H
41
42#include "primitiveFieldsFwd.H"
43#include "volFieldsFwd.H"
44#include "pointFieldsFwd.H"
45#include "surfaceFieldsFwd.H"
48#include "PrimitivePatch.H"
49#include "deltaBoundary.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56/*---------------------------------------------------------------------------*\
57 Class Bezier Declaration
58\*---------------------------------------------------------------------------*/
60class Bezier
61{
62private:
63
64 // Private Member Functions
65
66 //- No copy construct
67 Bezier(const Bezier&) = delete;
68
69 //- No copy assignment
70 void operator=(const Bezier&) = delete;
71
72
73protected:
74
75 // Protected data
77 const fvMesh& mesh_;
78 const dictionary& dict_;
80 label nBezier_;
88
89
90public:
91
92 //- Runtime type information
93 TypeName("Bezier");
94
95
96 // Constructors
97
98 //- Construct from components
99 Bezier(const fvMesh& mesh, const dictionary& dict);
100
101
102 //- Destructor
103 virtual ~Bezier() = default;
104
105
106 // Member Functions
107
108 //- Number of Bezier control points
109 label nBezier() const;
110
111 //- dx/db tensor for all control points
113
114 //- Confine x movement
115 const boolList& confineXmovement() const;
116
117 //- Confine y movement
118 const boolList& confineYmovement() const;
119
120 //- Confine z movement
121 const boolList& confineZmovement() const;
122
123 //- Info about confining movement in all directions
124 const boolListList& confineMovement() const;
125
126 //- Compute derivative of the normal vector for a Bezier
127 //- parameterized patch
129 (
130 const label patchI,
131 const label cpI,
132 bool returnDimensionedNormalSens = true
133 ) const;
134
135 //- Compute derivative of the normal vector for a Bezier parameterized
136 //- patch wrt a given component (direction) of the Bezier control point
138 (
139 const label patchI,
140 const label cpI,
141 const label idir,
142 bool returnDimensionedNormalSens = true
143 ) const;
144
145 //- dxdb tensor for a Bezier parameterized patch
147 (
148 const label patchI,
149 const label cpI,
150 bool useChainRule = true
151 ) const;
152
153 //- dxdb vector for a Bezier parameterized patch and a specific control point component
155 (
156 const label patchI,
157 const label cpI,
158 const label idir,
159 bool useChainRule = true
160 ) const;
161
162 //- For a given (global) face ID, return the change of the face points
164 (
165 const label globalFaceI,
166 const label cpI
167 ) const;
168
169 //- For a given (global) face ID, return the change of the face points
170 //- if a given component of the CP changes
172 (
173 const label globalFaceI,
174 const label cpI,
175 const label idir
176 ) const;
177
178 //- Return active design variables
179 const labelList& getActiveDesignVariables() const;
180};
181
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185} // End namespace Foam
186
187// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188
189#endif
190
191// ************************************************************************* //
Calculation of adjoint based sensitivities for Bezier control points.
Definition: Bezier.H:60
boolList confineYmovement_
Definition: Bezier.H:83
PtrList< pointTensorField > dxidXj_
Definition: Bezier.H:80
const fvMesh & mesh_
Definition: Bezier.H:76
label nBezier() const
Number of Bezier control points.
Definition: Bezier.C:127
const boolList & confineZmovement() const
Confine z movement.
Definition: Bezier.C:151
label nBezier_
Definition: Bezier.H:79
boolListList confineMovement_
Definition: Bezier.H:85
virtual ~Bezier()=default
Destructor.
const boolList & confineYmovement() const
Confine y movement.
Definition: Bezier.C:145
const boolListList & confineMovement() const
Info about confining movement in all directions.
Definition: Bezier.C:157
boolList confineXmovement_
Definition: Bezier.H:82
TypeName("Bezier")
Runtime type information.
const dictionary & dict_
Definition: Bezier.H:77
const boolList & confineXmovement() const
Confine x movement.
Definition: Bezier.C:139
labelList activeDesignVariables_
Definition: Bezier.H:86
tmp< tensorField > dxdbFace(const label patchI, const label cpI, bool useChainRule=true) const
dxdb tensor for a Bezier parameterized patch
Definition: Bezier.C:279
tmp< tensorField > dndbBasedSensitivities(const label patchI, const label cpI, bool returnDimensionedNormalSens=true) const
Definition: Bezier.C:164
boolList confineZmovement_
Definition: Bezier.H:84
tensorField facePoints_d(const label globalFaceI, const label cpI) const
For a given (global) face ID, return the change of the face points.
Definition: Bezier.C:393
PtrList< pointTensorField > & dxidXj()
dx/db tensor for all control points
Definition: Bezier.C:133
const labelList & getActiveDesignVariables() const
Return active design variables.
Definition: Bezier.C:428
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
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
A class for managing temporary objects.
Definition: tmp.H:65
dynamicFvMesh & mesh
Namespace for OpenFOAM.
Forwards and collection of common point field types.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73