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 -------------------------------------------------------------------------------
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::Bezier
30 
31 Description
32  Calculation of adjoint based sensitivities for Bezier control points
33 
34 SourceFiles
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"
46 #include "volPointInterpolation.H"
48 #include "PrimitivePatch.H"
49 #include "deltaBoundary.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class Bezier Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class Bezier
61 {
62 private:
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 
73 protected:
74 
75  // Protected data
76 
77  const fvMesh& mesh_;
78  const dictionary& dict_;
79 
80  label nBezier_;
82 
88 
89 
90 public:
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 // ************************************************************************* //
Foam::Bezier::dict_
const dictionary & dict_
Definition: Bezier.H:77
volFieldsFwd.H
Foam::Bezier::dxidXj_
PtrList< pointTensorField > dxidXj_
Definition: Bezier.H:80
Foam::Bezier::confineMovement_
boolListList confineMovement_
Definition: Bezier.H:85
primitiveFieldsFwd.H
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
Foam::Bezier::confineXmovement_
boolList confineXmovement_
Definition: Bezier.H:82
Foam::Bezier
Calculation of adjoint based sensitivities for Bezier control points.
Definition: Bezier.H:59
Foam::Bezier::confineXmovement
const boolList & confineXmovement() const
Confine x movement.
Definition: Bezier.C:139
PrimitivePatchInterpolation.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Bezier::getActiveDesignVariables
const labelList & getActiveDesignVariables() const
Return active design variables.
Definition: Bezier.C:430
Foam::Bezier::confineYmovement_
boolList confineYmovement_
Definition: Bezier.H:83
Foam::Bezier::confineZmovement
const boolList & confineZmovement() const
Confine z movement.
Definition: Bezier.C:151
Foam::Bezier::activeDesignVariables_
labelList activeDesignVariables_
Definition: Bezier.H:86
Foam::Bezier::confineZmovement_
boolList confineZmovement_
Definition: Bezier.H:84
Foam::Bezier::~Bezier
virtual ~Bezier()=default
Destructor.
Foam::Bezier::dxidXj
PtrList< pointTensorField > & dxidXj()
dx/db tensor for all control points
Definition: Bezier.C:133
Foam::Bezier::nBezier
label nBezier() const
Number of Bezier control points.
Definition: Bezier.C:127
Foam::Field< tensor >
PrimitivePatch.H
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::Bezier::dxdbFace
tmp< tensorField > dxdbFace(const label patchI, const label cpI, bool useChainRule=true) const
dxdb tensor for a Bezier parameterized patch
Definition: Bezier.C:281
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
volPointInterpolation.H
deltaBoundary.H
Foam::Bezier::facePoints_d
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:395
Foam::Bezier::TypeName
TypeName("Bezier")
Runtime type information.
Foam::List< bool >
pointFieldsFwd.H
Forwards and collection of common point field types.
Foam::Bezier::mesh_
const fvMesh & mesh_
Definition: Bezier.H:76
surfaceFieldsFwd.H
Foam::Bezier::confineYmovement
const boolList & confineYmovement() const
Confine y movement.
Definition: Bezier.C:145
Foam::Bezier::confineMovement
const boolListList & confineMovement() const
Info about confining movement in all directions.
Definition: Bezier.C:157
Foam::Bezier::dndbBasedSensitivities
tmp< tensorField > dndbBasedSensitivities(const label patchI, const label cpI, bool returnDimensionedNormalSens=true) const
Definition: Bezier.C:164
Foam::Bezier::nBezier_
label nBezier_
Definition: Bezier.H:79