Loading...
Searching...
No Matches
dynamicTopODesignVariables.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) 2020-2023 PCOpt/NTUA
9 Copyright (C) 2020-2023 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
27
28Class
29 Foam::dynamicTopODesignVariables
30
31Description
32 Design variables for topology optimisation problems.
33 Active design variables are added gradually, to help the optimiser from
34 being trapped to a sub-optimal solution track in the first optimisation
35 cycles.
36
37SourceFiles
38 dynamicTopODesignVariables.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef dynamicTopODesignVariables_H
43#define dynamicTopODesignVariables_H
44
45#include "topODesignVariables.H"
46#include "marchingCells.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
53/*---------------------------------------------------------------------------*\
54 Class dynamicTopODesignVariables Declaration
55\*---------------------------------------------------------------------------*/
56
57class dynamicTopODesignVariables
58:
59 public topODesignVariables
60{
61protected:
62
63 // Protected data
64
65 //- Mechanism for gradually activating design variables
67
68 //- Number of times the design variables have evolved
69 label evolvedCount_;
70
71
72 // Protected Member Functions
73
74 //- Set active design variables
75 virtual void setActiveDesignVariables
76 (
77 const label fluidID = 0,
78 const bool activeIO = false
79 );
80
81
82private:
83
84 // Private Member Functions
85
86 //- Disallow default bitwise copy construct
87 dynamicTopODesignVariables
88 (
89 const dynamicTopODesignVariables&
90 ) = delete;
91
92 //- Disallow default bitwise assignment
93 void operator=(const dynamicTopODesignVariables&) = delete;
94
95
96public:
97
98 //- Runtime type information
99 TypeName("dynamicTopO");
100
101
102 // Constructors
103
104 //- Construct from dictionary
105 dynamicTopODesignVariables
107 fvMesh& mesh,
108 const dictionary& dict
109 );
110
111 //- Construct from dictionary and size
112 dynamicTopODesignVariables
113 (
114 fvMesh& mesh,
115 const dictionary& dict,
116 const label size
117 );
118
119
120 // Selectors
121
122 //- Construct and return the selected design variables
124 (
125 fvMesh& mesh,
126 const dictionary& dict
127 );
128
129
130 //- Destructor
131 virtual ~dynamicTopODesignVariables() = default;
132
133
134 // Member Functions
135
136 //- Update the active design variables
137 virtual void evolveNumber();
138
139 //- The writeData function required by the regIOobject write operation
140 virtual bool writeData(Ostream&) const;
141};
142
143
144// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145
146} // End namespace Foam
147
148// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149
150#endif
151
152// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
void size(const label n)
Definition UList.H:118
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
virtual void evolveNumber()
Update the active design variables.
label evolvedCount_
Number of times the design variables have evolved.
virtual bool writeData(Ostream &) const
The writeData function required by the regIOobject write operation.
virtual ~dynamicTopODesignVariables()=default
Destructor.
TypeName("dynamicTopO")
Runtime type information.
virtual void setActiveDesignVariables(const label fluidID=0, const bool activeIO=false)
Set active design variables.
marchingCells marchCells_
Mechanism for gradually activating design variables.
static autoPtr< dynamicTopODesignVariables > New(fvMesh &mesh, const dictionary &dict)
Construct and return the selected design variables.
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
dynamicFvMesh & mesh
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68