Loading...
Searching...
No Matches
noConstraint.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) 2021 PCOpt/NTUA
9 Copyright (C) 2021 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::noConstraint
29
30Description
31 Applies no constraints to the control points.
32 Enforces the non-overlapping bounds, if present.
33
34SourceFiles
35 noConstraint.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef noConstraint_H
40#define noConstraint_H
41
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
49/*---------------------------------------------------------------------------*\
50 Class noConstraint Declaration
51\*---------------------------------------------------------------------------*/
52
53class noConstraint
54:
55 public morphingBoxConstraint
56{
57
58protected:
59
60 // Protected Member Functions
61
62 //- Compute sensitivities wrt the design variables (chain rule)
63 void virtual computeDVsSensitivities
64 (
65 scalarField& dvSens,
66 const scalarField& cpSens
67 );
68
69 //- Update the bounds of the internal control points
71 (
72 autoPtr<scalarField>& lowerBounds,
73 autoPtr<scalarField>& upperBounds,
74 const NURBS3DVolume& boxI,
75 const label passed
76 );
77
78 //- Update the bounds of the boundary control points
80 (
81 autoPtr<scalarField>& lowerBounds,
82 autoPtr<scalarField>& upperBounds,
83 const NURBS3DVolume& boxI,
84 const label passed
85 );
86
87
88private:
89
90 // Private Member Functions
91
92 //- Disallow default bitwise copy construct
93 noConstraint(const noConstraint&) = delete;
94
95 //- Disallow default bitwise assignment
96 void operator=(const noConstraint&) = delete;
97
98
99public:
100
101 //- Runtime type information
102 TypeName("none");
103
104
105 // Constructors
106
107 //- Construct from components
108 noConstraint
110 const fvMesh& mesh,
111 const dictionary& dict,
113 );
114
115
116 //- Destructor
117 virtual ~noConstraint() = default;
118
119
120 // Member Functions
121
122 //- Compute the active design variables based on the IDs of the
123 //- active control point coordinates
125 (
126 const labelList& activeCPCoors
127 );
129 //- Transform bounds from control points to design variables
130 // Does nothing in this case
131 virtual void computeBounds
132 (
133 autoPtr<scalarField>& lowerBounds,
134 autoPtr<scalarField>& upperBounds
135 );
136
137 //- Update the bounds of the design variables
138 // Will update the bound values if nonOverlappingCPs is active
139 virtual void updateBounds
140 (
141 autoPtr<scalarField>& lowerBounds,
142 autoPtr<scalarField>& upperBounds
143 );
144
145 //- Convert design variables to control points, stored in a scalarField
147 (
149 );
150
151 //- Return the design variables corresponding to the given control
152 //- points
154 (
155 const scalarField& cps
156 );
157
158 //- Convert the correction of the design variables to the correction of
159 //- the control points
161 (
162 const scalarField& correctionDVs
163 );
164};
165
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169} // End namespace Foam
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173#endif
174
175// ************************************************************************* //
NURBS3DVolume morpher. Includes support functions for gradient computations Base class providing supp...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
Abstract base class for defining design variables.
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
virtual void computeBounds(autoPtr< scalarField > &lowerBounds, autoPtr< scalarField > &upperBounds)
Transform bounds from control points to design variables.
virtual ~noConstraint()=default
Destructor.
void updateInternalBounds(autoPtr< scalarField > &lowerBounds, autoPtr< scalarField > &upperBounds, const NURBS3DVolume &boxI, const label passed)
Update the bounds of the internal control points.
TypeName("none")
Runtime type information.
virtual void computeDVsSensitivities(scalarField &dvSens, const scalarField &cpSens)
Compute sensitivities wrt the design variables (chain rule).
virtual void updateBounds(autoPtr< scalarField > &lowerBounds, autoPtr< scalarField > &upperBounds)
Update the bounds of the design variables.
void updateBoundaryBounds(autoPtr< scalarField > &lowerBounds, autoPtr< scalarField > &upperBounds, const NURBS3DVolume &boxI, const label passed)
Update the bounds of the boundary control points.
virtual labelList computeActiveDesignVariables(const labelList &activeCPCoors)
Compute the active design variables based on the IDs of the active control point coordinates.
virtual tmp< scalarField > correctionCPs(const scalarField &correctionDVs)
Convert the correction of the design variables to the correction of the control points.
virtual tmp< scalarField > controlPointsToDesignVariables(const scalarField &cps)
Return the design variables corresponding to the given control points.
virtual tmp< scalarField > designVariablesToControlPoints(const scalarField &designVariables)
Convert design variables to control points, stored in a scalarField.
A class for managing temporary objects.
Definition tmp.H:75
Volumetric B-Splines design variables for shape optimisation.
dynamicFvMesh & mesh
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68