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-2018 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 private:
75 
76  // Private Member Functions
77 
78  //- Disallow default bitwise copy construct
80 
81  //- Disallow default bitwise assignment
82  void operator=(const surfaceCellSizeFunction&);
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("surfaceCellSizeFunction");
89 
90 
91  // Declare run-time constructor selection table
92 
94  (
95  autoPtr,
97  dictionary,
98  (
99  const dictionary& surfaceCellSizeFunctionDict,
100  const searchableSurface& surface,
101  const scalar& defaultCellSize
102  ),
103  (surfaceCellSizeFunctionDict, surface, defaultCellSize)
104  );
105 
106 
107  // Constructors
108 
109  //- Construct from components
111  (
112  const word& type,
113  const dictionary& surfaceCellSizeFunctionDict,
114  const searchableSurface& surface,
115  const scalar& defaultCellSize
116  );
117 
118 
119  // Selectors
120 
121  //- Return a reference to the selected surfaceCellSizeFunction
123  (
124  const dictionary& surfaceCellSizeFunctionDict,
125  const searchableSurface& surface,
126  const scalar& defaultCellSize
127  );
128 
129 
130  //- Destructor
131  virtual ~surfaceCellSizeFunction();
132 
133 
134  // Member Functions
135 
136  //- Const access to the details dictionary
137  inline const dictionary& coeffsDict() const
138  {
139  return coeffsDict_;
140  }
141 
142  virtual scalar interpolate
143  (
144  const point& pt,
145  const label index
146  ) const = 0;
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
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:137
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.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:481
scalar refinementFactor_
If cell resizing is allowed, this is the factor of the old cell size.
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.