All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
surfaceCellSizeFunction.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) 2012-2019 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::surfaceCellSizeFunction
26 
27 Description
28  Abstract base class for specifying target cell sizes
29 
30 SourceFiles
31  surfaceCellSizeFunction.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef surfaceCellSizeFunction_H
36 #define surfaceCellSizeFunction_H
37 
38 #include "searchableSurface.H"
39 #include "dictionary.H"
40 #include "autoPtr.H"
41 #include "runTimeSelectionTables.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class surfaceCellSizeFunction Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public dictionary
55 {
56 
57 protected:
58 
59  // Protected data
60 
61  //- Reference to the searchableSurface that surfaceCellSizeFunction
62  // relates to
64 
65  const dictionary coeffsDict_;
66 
67  const scalar& defaultCellSize_;
68 
69  //- If cell resizing is allowed, this is the factor of the old cell size
70  // to get the new cell size
71  scalar refinementFactor_;
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("surfaceCellSizeFunction");
78 
79 
80  // Declare run-time constructor selection table
81 
83  (
84  autoPtr,
86  dictionary,
87  (
88  const dictionary& surfaceCellSizeFunctionDict,
89  const searchableSurface& surface,
90  const scalar& defaultCellSize
91  ),
92  (surfaceCellSizeFunctionDict, surface, defaultCellSize)
93  );
94 
95 
96  // Constructors
97 
98  //- Construct from components
100  (
101  const word& type,
102  const dictionary& surfaceCellSizeFunctionDict,
103  const searchableSurface& surface,
104  const scalar& defaultCellSize
105  );
106 
107  //- Disallow default bitwise copy construction
109 
110 
111  // Selectors
112 
113  //- Return a reference to the selected surfaceCellSizeFunction
115  (
116  const dictionary& surfaceCellSizeFunctionDict,
117  const searchableSurface& surface,
118  const scalar& defaultCellSize
119  );
120 
121 
122  //- Destructor
123  virtual ~surfaceCellSizeFunction();
124 
125 
126  // Member Functions
127 
128  //- Const access to the details dictionary
129  inline const dictionary& coeffsDict() const
130  {
131  return coeffsDict_;
132  }
133 
134  virtual scalar interpolate
135  (
136  const point& pt,
137  const label index
138  ) const = 0;
139 
140 
141  // Member Operators
142 
143  //- Disallow default bitwise assignment
144  void operator=(const surfaceCellSizeFunction&) = delete;
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
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
static autoPtr< surfaceCellSizeFunction > New(const dictionary &surfaceCellSizeFunctionDict, const searchableSurface &surface, const scalar &defaultCellSize)
Return a reference to the selected surfaceCellSizeFunction.
declareRunTimeSelectionTable(autoPtr, surfaceCellSizeFunction, dictionary,(const dictionary &surfaceCellSizeFunctionDict, const searchableSurface &surface, const scalar &defaultCellSize),(surfaceCellSizeFunctionDict, surface, defaultCellSize))
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual ~surfaceCellSizeFunction()
Destructor.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
virtual scalar interpolate(const point &pt, const label index) const =0
Abstract base class for specifying target cell sizes.
const searchableSurface & surface_
Reference to the searchableSurface that surfaceCellSizeFunction.
A class for handling words, derived from string.
Definition: word.H:59
TypeName("surfaceCellSizeFunction")
Runtime type information.
const dictionary & coeffsDict() const
Const access to the details dictionary.
void operator=(const surfaceCellSizeFunction &)=delete
Disallow default bitwise assignment.
scalar refinementFactor_
If cell resizing is allowed, this is the factor of the old cell size.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
surfaceCellSizeFunction(const word &type, const dictionary &surfaceCellSizeFunctionDict, const searchableSurface &surface, const scalar &defaultCellSize)
Construct from components.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
Namespace for OpenFOAM.