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 -------------------------------------------------------------------------------
11 License
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 Class
28  Foam::extrudeModel
29 
30 Description
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 
40 SourceFiles
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"
51 #include "runTimeSelectionTables.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class extrudeModel Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class extrudeModel
63 {
64 protected:
65 
66  // Protected data
67 
68  label nLayers_;
69 
70  const scalar expansionRatio_;
71 
72  const dictionary& coeffDict_;
73 
74 
75  // Private Member Functions
76 
77  //- No copy construct
78  extrudeModel(const extrudeModel&) = delete;
79 
80  //- No copy assignment
81  void operator=(const extrudeModel&) = delete;
82 
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("extrudeModel");
88 
89  //- Declare runtime constructor selection table
90 
92  (
93  autoPtr,
95  dictionary,
96  (
97  const dictionary& dict
98  ),
99  (dict)
100  );
101 
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
113  static autoPtr<extrudeModel> New(const dictionary& dict);
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
Foam::extrudeModel::sumThickness
scalar sumThickness(const label layer) const
Helper: calculate cumulative relative thickness for layer.
Definition: extrudeModel.C:71
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::extrudeModel
Top level extrusion model class.
Definition: extrudeModel.H:76
point.H
Foam::extrudeModel::nLayers
label nLayers() const
Return the number of layers.
Definition: extrudeModel.C:59
Foam::extrudeModel::expansionRatio_
const scalar expansionRatio_
Definition: extrudeModel.H:84
Foam::extrudeModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, extrudeModel, dictionary,(const dictionary &dict),(dict))
Declare runtime constructor selection table.
Foam::extrudeModel::New
static autoPtr< extrudeModel > New(const dictionary &dict)
Select null constructed.
Definition: extrudeModelNew.C:34
Foam::extrudeModel::extrudeModel
extrudeModel(const extrudeModel &)=delete
No copy construct.
Foam::extrudeModel::operator=
void operator=(const extrudeModel &)=delete
No copy assignment.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::extrudeModel::nLayers_
label nLayers_
Definition: extrudeModel.H:82
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::extrudeModel::expansionRatio
scalar expansionRatio() const
Return the expansion ratio.
Definition: extrudeModel.C:65
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::Vector< scalar >
dictionary.H
Foam::extrudeModel::~extrudeModel
virtual ~extrudeModel()=default
Destructor.
Foam::extrudeModel::coeffDict_
const dictionary & coeffDict_
Definition: extrudeModel.H:86
Foam::extrudeModel::TypeName
TypeName("extrudeModel")
Runtime type information.
autoPtr.H