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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::surfaceCellSizeFunction
28 
29 Description
30  Abstract base class for specifying target cell sizes
31 
32 SourceFiles
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"
43 #include "runTimeSelectionTables.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class surfaceCellSizeFunction Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public dictionary
57 {
58 
59 protected:
60 
61  // Protected data
62 
63  //- Reference to the searchableSurface that surfaceCellSizeFunction
64  // relates to
66 
67  const dictionary coeffsDict_;
68 
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 
76 private:
77 
78  // Private Member Functions
79 
80  //- No copy construct
82 
83  //- No copy assignment
84  void operator=(const surfaceCellSizeFunction&) = delete;
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("surfaceCellSizeFunction");
91 
92 
93  // Declare run-time constructor selection table
94 
96  (
97  autoPtr,
99  dictionary,
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  }
143 
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 // ************************************************************************* //
Foam::surfaceCellSizeFunction::defaultCellSize_
const scalar & defaultCellSize_
Definition: surfaceCellSizeFunction.H:68
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
searchableSurface.H
Foam::surfaceCellSizeFunction::interpolate
virtual scalar interpolate(const point &pt, const label index) const =0
Foam::surfaceCellSizeFunction::New
static autoPtr< surfaceCellSizeFunction > New(const dictionary &surfaceCellSizeFunctionDict, const searchableSurface &surface, const scalar &defaultCellSize)
Return a reference to the selected surfaceCellSizeFunction.
Foam::surfaceCellSizeFunction::refinementFactor_
scalar refinementFactor_
If cell resizing is allowed, this is the factor of the old cell size.
Definition: surfaceCellSizeFunction.H:72
Foam::surfaceCellSizeFunction::~surfaceCellSizeFunction
virtual ~surfaceCellSizeFunction()=default
Destructor.
Foam::surfaceCellSizeFunction::TypeName
TypeName("surfaceCellSizeFunction")
Runtime type information.
Foam::surfaceCellSizeFunction::surface_
const searchableSurface & surface_
Reference to the searchableSurface that surfaceCellSizeFunction.
Definition: surfaceCellSizeFunction.H:64
Foam::searchableSurface
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Definition: searchableSurface.H:69
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::surfaceCellSizeFunction::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, surfaceCellSizeFunction, dictionary,(const dictionary &surfaceCellSizeFunctionDict, const searchableSurface &surface, const scalar &defaultCellSize),(surfaceCellSizeFunctionDict, surface, defaultCellSize))
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::Vector< scalar >
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
dictionary.H
Foam::surfaceCellSizeFunction::coeffsDict_
const dictionary coeffsDict_
Definition: surfaceCellSizeFunction.H:66
Foam::surfaceCellSizeFunction
Abstract base class for specifying target cell sizes.
Definition: surfaceCellSizeFunction.H:53
Foam::surfaceCellSizeFunction::coeffsDict
const dictionary & coeffsDict() const
Const access to the details dictionary.
Definition: surfaceCellSizeFunction.H:138
autoPtr.H