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  // Protected Member Functions
64 
65  //- Backward compatibility function
66  // to return the model Coeffs dictionary
67  const dictionary& coeffDict(const dictionary& dict) const;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("extrudeModel");
74 
75  //- Declare runtime constructor selection table
76 
78  (
79  autoPtr,
81  dictionary,
82  (
83  const dictionary& dict
84  ),
85  (dict)
86  );
87 
88 
89  // Constructors
90 
91  //- Construct from dictionary
92  extrudeModel(const dictionary&);
93 
94  //- Disallow default bitwise copy construction
95  extrudeModel(const extrudeModel&) = delete;
96 
97 
98  // Selectors
99 
100  //- Select null constructed
101  static autoPtr<extrudeModel> New(const dictionary&);
102 
103 
104  //- Destructor
105  virtual ~extrudeModel();
106 
107 
108  // Member Functions
109 
110  //- Return the number of layers in the extrusion
111  label nLayers() const;
112 
113  //- Return the extrusion expansion ratio
114  scalar expansionRatio() const;
115 
116 
117  // Member Operators
118 
119  //- Disallow default bitwise assignment
120  void operator=(const extrudeModel&) = delete;
121 
122  //- Helper: calculate cumulative relative thickness for layer.
123  // (layer=0 -> 0; layer=nLayers -> 1)
124  scalar sumThickness(const label layer) const;
125 
126  virtual point operator()
127  (
128  const point& surfacePoint,
129  const vector& surfaceNormal,
130  const label layer
131  ) const = 0;
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
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
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:62
virtual ~extrudeModel()
Destructor.
Definition: extrudeModel.C:47
scalar expansionRatio() const
Return the extrusion expansion ratio.
Definition: extrudeModel.C:68
extrudeModel(const dictionary &)
Construct from dictionary.
Definition: extrudeModel.C:38
scalar sumThickness(const label layer) const
Helper: calculate cumulative relative thickness for layer.
Definition: extrudeModel.C:74
void operator=(const extrudeModel &)=delete
Disallow default bitwise assignment.
const dictionary & coeffDict(const dictionary &dict) const
Backward compatibility function.
Definition: extrudeModel.C:54
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