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 Foam_Bezier_H
40 #define Foam_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 "deltaBoundary.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class Bezier Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class Bezier
60 {
61 private:
62 
63  // Private Member Functions
64 
65  //- No copy construct
66  Bezier(const Bezier&) = delete;
67 
68  //- No copy assignment
69  void operator=(const Bezier&) = delete;
70 
71 
72 protected:
73 
74  // Protected data
75 
76  const fvMesh& mesh_;
77  const dictionary& dict_;
78 
79  label nBezier_;
81 
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("Bezier");
93 
94 
95  // Constructors
96 
97  //- Construct from components
98  Bezier(const fvMesh& mesh, const dictionary& dict);
99 
100 
101  //- Destructor
102  virtual ~Bezier() = default;
103 
104 
105  // Member Functions
106 
107  //- Number of Bezier control points
108  label nBezier() const;
109 
110  //- dx/db tensor for all control points
112 
113  //- Confine x movement
114  const boolList& confineXmovement() const;
115 
116  //- Confine y movement
117  const boolList& confineYmovement() const;
118 
119  //- Confine z movement
120  const boolList& confineZmovement() const;
121 
122  //- Info about confining movement in all directions
123  const boolListList& confineMovement() const;
124 
125  //- Compute derivative of the normal vector for a Bezier
126  //- parameterized patch
128  (
129  const label patchI,
130  const label cpI,
131  bool returnDimensionedNormalSens = true
132  ) const;
133 
134  //- Compute derivative of the normal vector for a Bezier parameterized
135  //- patch wrt a given component (direction) of the Bezier control point
137  (
138  const label patchI,
139  const label cpI,
140  const label idir,
141  bool returnDimensionedNormalSens = true
142  ) const;
143 
144  //- dxdb tensor for a Bezier parameterized patch
146  (
147  const label patchI,
148  const label cpI,
149  bool useChainRule = true
150  ) const;
151 
152  //- dxdb vector for a Bezier parameterized patch and a specific control point component
154  (
155  const label patchI,
156  const label cpI,
157  const label idir,
158  bool useChainRule = true
159  ) const;
160 
161  //- For a given (global) face ID, return the change of the face points
163  (
164  const label globalFaceI,
165  const label cpI
166  ) const;
167 
168  //- For a given (global) face ID, return the change of the face points
169  //- if a given component of the CP changes
171  (
172  const label globalFaceI,
173  const label cpI,
174  const label idir
175  ) const;
176 
177  //- Return active design variables
178  const labelList& getActiveDesignVariables() const;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
dictionary dict
Forwards and collection of common volume field types.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
const boolListList & confineMovement() const
Info about confining movement in all directions.
Definition: Bezier.C:150
const boolList & confineXmovement() const
Confine x movement.
Definition: Bezier.C:132
Forwards and collection of common point field types.
TypeName("Bezier")
Runtime type information.
const labelList & getActiveDesignVariables() const
Return active design variables.
Definition: Bezier.C:421
label nBezier_
Definition: Bezier.H:78
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:386
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
dynamicFvMesh & mesh
boolListList confineMovement_
Definition: Bezier.H:84
label nBezier() const
Number of Bezier control points.
Definition: Bezier.C:120
boolList confineYmovement_
Definition: Bezier.H:82
labelList activeDesignVariables_
Definition: Bezier.H:85
tmp< tensorField > dndbBasedSensitivities(const label patchI, const label cpI, bool returnDimensionedNormalSens=true) const
Compute derivative of the normal vector for a Bezier parameterized patch.
Definition: Bezier.C:157
const fvMesh & mesh_
Definition: Bezier.H:75
const boolList & confineYmovement() const
Confine y movement.
Definition: Bezier.C:138
Calculation of adjoint based sensitivities for Bezier control points.
Definition: Bezier.H:54
PtrList< pointTensorField > dxidXj_
Definition: Bezier.H:79
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
boolList confineXmovement_
Definition: Bezier.H:81
tmp< tensorField > dxdbFace(const label patchI, const label cpI, bool useChainRule=true) const
dxdb tensor for a Bezier parameterized patch
Definition: Bezier.C:272
const dictionary & dict_
Definition: Bezier.H:76
A class for managing temporary objects.
Definition: HashPtrTable.H:50
boolList confineZmovement_
Definition: Bezier.H:83
virtual ~Bezier()=default
Destructor.
Namespace for OpenFOAM.
const boolList & confineZmovement() const
Confine z movement.
Definition: Bezier.C:144
PtrList< pointTensorField > & dxidXj()
dx/db tensor for all control points
Definition: Bezier.C:126