surfaceCellSizeFunction.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) 2012-2015 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::surfaceCellSizeFunction
28
29Description
30 Abstract base class for specifying target cell sizes
31
32SourceFiles
33 surfaceCellSizeFunction.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef surfaceCellSizeFunction_H
38#define surfaceCellSizeFunction_H
39
40#include "searchableSurface.H"
41#include "dictionary.H"
42#include "autoPtr.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class surfaceCellSizeFunction Declaration
52\*---------------------------------------------------------------------------*/
55:
56 public dictionary
57{
58
59protected:
60
61 // Protected data
62
63 //- Reference to the searchableSurface that surfaceCellSizeFunction
64 // relates to
69 const scalar& defaultCellSize_;
70
71 //- If cell resizing is allowed, this is the factor of the old cell size
72 // to get the new cell size
73 scalar refinementFactor_;
74
75
76private:
77
78 // Private Member Functions
79
80 //- No copy construct
82
83 //- No copy assignment
84 void operator=(const surfaceCellSizeFunction&) = delete;
85
86
87public:
88
89 //- Runtime type information
90 TypeName("surfaceCellSizeFunction");
91
92
93 // Declare run-time constructor selection table
96 (
97 autoPtr,
100 (
101 const dictionary& surfaceCellSizeFunctionDict,
102 const searchableSurface& surface,
103 const scalar& defaultCellSize
104 ),
105 (surfaceCellSizeFunctionDict, surface, defaultCellSize)
106 );
107
108
109 // Constructors
110
111 //- Construct from components
113 (
114 const word& type,
115 const dictionary& surfaceCellSizeFunctionDict,
116 const searchableSurface& surface,
117 const scalar& defaultCellSize
118 );
119
120
121 // Selectors
122
123 //- Return a reference to the selected surfaceCellSizeFunction
125 (
126 const dictionary& surfaceCellSizeFunctionDict,
127 const searchableSurface& surface,
128 const scalar& defaultCellSize
129 );
130
131
132 //- Destructor
133 virtual ~surfaceCellSizeFunction() = default;
134
135
136 // Member Functions
137
138 //- Const access to the details dictionary
139 inline const dictionary& coeffsDict() const
140 {
141 return coeffsDict_;
142 }
144 virtual scalar interpolate
145 (
146 const point& pt,
147 const label index
148 ) const = 0;
149};
150
151
152// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153
154} // End namespace Foam
155
156// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157
158#endif
159
160// ************************************************************************* //
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
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Abstract base class for specifying target cell sizes.
TypeName("surfaceCellSizeFunction")
Runtime type information.
virtual scalar interpolate(const point &pt, const label index) const =0
static autoPtr< surfaceCellSizeFunction > New(const dictionary &surfaceCellSizeFunctionDict, const searchableSurface &surface, const scalar &defaultCellSize)
Return a reference to the selected surfaceCellSizeFunction.
const searchableSurface & surface_
Reference to the searchableSurface that surfaceCellSizeFunction.
declareRunTimeSelectionTable(autoPtr, surfaceCellSizeFunction, dictionary,(const dictionary &surfaceCellSizeFunctionDict, const searchableSurface &surface, const scalar &defaultCellSize),(surfaceCellSizeFunctionDict, surface, defaultCellSize))
scalar refinementFactor_
If cell resizing is allowed, this is the factor of the old cell size.
virtual ~surfaceCellSizeFunction()=default
Destructor.
surfaceCellSizeFunction(const word &type, const dictionary &surfaceCellSizeFunctionDict, const searchableSurface &surface, const scalar &defaultCellSize)
Construct from components.
const dictionary & coeffsDict() const
Const access to the details dictionary.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
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)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73