extrudeModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::extrudeModel
26 
27 Description
28  Top level extrusion model class
29 
30 SourceFiles
31  extrudeModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef extrudeModel_H
36 #define extrudeModel_H
37 
38 #include "dictionary.H"
39 #include "point.H"
40 #include "autoPtr.H"
41 #include "runTimeSelectionTables.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class extrudeModel Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class extrudeModel
53 {
54 protected:
55 
56  // Protected data
57 
59 
60  const scalar expansionRatio_;
61 
62 
63 public:
64 
65  //- Runtime type information
66  TypeName("extrudeModel");
67 
68  //- Declare runtime constructor selection table
69 
71  (
72  autoPtr,
74  dictionary,
75  (
76  const dictionary& dict
77  ),
78  (dict)
79  );
80 
81 
82  // Constructors
83 
84  //- Construct from dictionary
85  extrudeModel(const dictionary&, const bool single = false);
86 
87  //- Disallow default bitwise copy construction
88  extrudeModel(const extrudeModel&) = delete;
89 
90 
91  // Selectors
92 
93  //- Select null constructed
94  static autoPtr<extrudeModel> New(const dictionary&);
95 
96 
97  //- Destructor
98  virtual ~extrudeModel();
99 
100 
101  // Member Functions
102 
103  //- Return the number of layers in the extrusion
104  label nLayers() const;
105 
106  //- Return the extrusion expansion ratio
107  scalar expansionRatio() const;
108 
109 
110  // Member Operators
111 
112  //- Disallow default bitwise assignment
113  void operator=(const extrudeModel&) = delete;
114 
115  //- Helper: calculate cumulative relative thickness for layer.
116  // (layer=0 -> 0; layer=nLayers -> 1)
117  scalar sumThickness(const label layer) const;
118 
119  virtual point operator()
120  (
121  const point& surfacePoint,
122  const vector& surfaceNormal,
123  const label layer
124  ) const = 0;
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace Foam
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #endif
135 
136 // ************************************************************************* //
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Top level extrusion model class.
Definition: extrudeModel.H:52
extrudeModel(const dictionary &, const bool single=false)
Construct from dictionary.
Definition: extrudeModel.C:38
const scalar expansionRatio_
Definition: extrudeModel.H:59
static autoPtr< extrudeModel > New(const dictionary &)
Select null constructed.
declareRunTimeSelectionTable(autoPtr, extrudeModel, dictionary,(const dictionary &dict),(dict))
Declare runtime constructor selection table.
TypeName("extrudeModel")
Runtime type information.
label nLayers() const
Return the number of layers in the extrusion.
Definition: extrudeModel.C:53
virtual ~extrudeModel()
Destructor.
Definition: extrudeModel.C:47
scalar expansionRatio() const
Return the extrusion expansion ratio.
Definition: extrudeModel.C:59
scalar sumThickness(const label layer) const
Helper: calculate cumulative relative thickness for layer.
Definition: extrudeModel.C:65
void operator=(const extrudeModel &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Macros to ease declaration of run-time selection tables.
dictionary dict