extrudeModel.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) 2011-2015 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
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::extrudeModel
29
30Description
31 Top level extrusion model class
32
33 Dictionary entries
34 \table
35 Property | Description | Required | Default
36 nLayer | Number of extrusion layers | no | 1
37 expansionRatio | Expansion ratio | no | 1
38 \endtable
39
40SourceFiles
41 extrudeModel.C
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef extrudeModel_H
46#define extrudeModel_H
47
48#include "dictionary.H"
49#include "point.H"
50#include "autoPtr.H"
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54
55namespace Foam
56{
57
58/*---------------------------------------------------------------------------*\
59 Class extrudeModel Declaration
60\*---------------------------------------------------------------------------*/
61
62class extrudeModel
63{
64protected:
65
66 // Protected data
67
68 label nLayers_;
69
70 const scalar expansionRatio_;
71
72 const dictionary& coeffDict_;
73
74
75 // Private Member Functions
77 //- No copy construct
78 extrudeModel(const extrudeModel&) = delete;
79
80 //- No copy assignment
81 void operator=(const extrudeModel&) = delete;
83
84public:
85
86 //- Runtime type information
87 TypeName("extrudeModel");
88
89 //- Declare runtime constructor selection table
90
92 (
93 autoPtr,
96 (
97 const dictionary& dict
98 ),
99 (dict)
100 );
102
103 // Constructors
104
105 //- Construct from dictionary for given model type
106 // The corresponding model Coeffs dictionary must exist.
107 extrudeModel(const word& modelType, const dictionary& dict);
108
109
110 // Selectors
111
112 //- Select null constructed
114
115
116 //- Destructor
117 virtual ~extrudeModel() = default;
118
119
120 // Member Functions
121
122 // Access
123
124 //- Return the number of layers
125 label nLayers() const;
126
127 //- Return the expansion ratio
128 scalar expansionRatio() const;
129
130
131 // Member Operators
132
133 //- Helper: calculate cumulative relative thickness for layer.
134 // (layer=0 -> 0; layer=nLayers -> 1)
135 scalar sumThickness(const label layer) const;
136
137 virtual point operator()
138 (
139 const point& surfacePoint,
140 const vector& surfaceNormal,
141 const label layer
142 ) const = 0;
143};
144
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147
148} // End namespace Foam
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152#endif
153
154// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Top level extrusion model class.
Definition: extrudeModel.H:77
virtual ~extrudeModel()=default
Destructor.
static autoPtr< extrudeModel > New(const dictionary &dict)
Select null constructed.
const scalar expansionRatio_
Definition: extrudeModel.H:84
declareRunTimeSelectionTable(autoPtr, extrudeModel, dictionary,(const dictionary &dict),(dict))
Declare runtime constructor selection table.
TypeName("extrudeModel")
Runtime type information.
extrudeModel(const extrudeModel &)=delete
No copy construct.
const dictionary & coeffDict_
Definition: extrudeModel.H:86
label nLayers() const
Return the number of layers.
Definition: extrudeModel.C:59
scalar expansionRatio() const
Return the expansion ratio.
Definition: extrudeModel.C:65
scalar sumThickness(const label layer) const
Helper: calculate cumulative relative thickness for layer.
Definition: extrudeModel.C:71
void operator=(const extrudeModel &)=delete
No copy assignment.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73