initialPointsMethod.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-2020 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::initialPointsMethod
26 
27 Description
28  Abstract base class for generating initial points for a conformalVoronoiMesh
29 
30 SourceFiles
31  initialPointsMethod.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef initialPointsMethod_H
36 #define initialPointsMethod_H
37 
38 #include "point.H"
39 #include "conformalVoronoiMesh.H"
41 #include "dictionary.H"
42 #include "Random.H"
43 #include "Switch.H"
44 #include "autoPtr.H"
45 #include "runTimeSelectionTables.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class initialPointsMethod Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
58  public dictionary
59 {
60 
61 protected:
62 
63  // Protected data
64 
65  const Time& runTime_;
66 
67  Random& rndGen_;
68 
70 
72 
74 
75  //- Method details dictionary
77 
78  //- Only allow the placement of initial points that are within the
79  // surfaces to be meshed by minimumSurfaceDistanceCoeff multiplied by
80  // the local target cell size. Store square of value.
82 
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("initialPointsMethod");
90 
91 
92  // Declare run-time constructor selection table
93 
95  (
96  autoPtr,
98  dictionary,
99  (
100  const dictionary& initialPointsDict,
101  const Time& runTime,
102  Random& rndGen,
106  ),
107  (
108  initialPointsDict,
109  runTime,
110  rndGen,
111  geometryToConformTo,
112  cellShapeControls,
113  decomposition
114  )
115  );
116 
117 
118  // Constructors
119 
120  //- Construct from components
122  (
123  const word& type,
124  const dictionary& initialPointsDict,
125  const Time& runTime,
126  Random& rndGen,
127  const conformationSurfaces& geometryToConformTo,
128  const cellShapeControl& cellShapeControls,
129  const autoPtr<backgroundMeshDecomposition>& decomposition
130  );
131 
132  //- Disallow default bitwise copy construction
133  initialPointsMethod(const initialPointsMethod&) = delete;
134 
135 
136  // Selectors
137 
138  //- Return a reference to the selected initialPointsMethod
140  (
141  const dictionary& initialPointsDict,
142  const Time& runTime,
143  Random& rndGen,
144  const conformationSurfaces& geometryToConformTo,
145  const cellShapeControl& cellShapeControls,
146  const autoPtr<backgroundMeshDecomposition>& decomposition
147  );
148 
149 
150  //- Destructor
151  virtual ~initialPointsMethod();
152 
153 
154  // Member Functions
155 
156  // Access
158  const Time& time() const
159  {
160  return runTime_;
161  }
163  Random& rndGen() const
164  {
165  return rndGen_;
166  }
169  {
170  return geometryToConformTo_;
171  }
173  const cellShapeControl& cellShapeControls() const
174  {
175  return cellShapeControls_;
176  }
179  {
180  return decomposition_;
181  }
182 
183  //- Const access to the details dictionary
184  const dictionary& detailsDict() const
185  {
186  return detailsDict_;
187  }
189  Switch fixInitialPoints() const
190  {
191  return fixInitialPoints_;
192  }
193 
194 
195  // Queries
196 
197  //- Return the initial points for the conformalVoronoiMesh
198  virtual List<Vb::Point> initialPoints() const = 0;
199 
200 
201  // Member Operators
202 
203  //- Disallow default bitwise assignment
204  void operator=(const initialPointsMethod&) = delete;
205 };
206 
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 } // End namespace Foam
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 #endif
215 
216 // ************************************************************************* //
void operator=(const initialPointsMethod &)=delete
Disallow default bitwise assignment.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
virtual ~initialPointsMethod()
Destructor.
const conformationSurfaces & geometryToConformTo_
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
static autoPtr< initialPointsMethod > New(const dictionary &initialPointsDict, const Time &runTime, Random &rndGen, const conformationSurfaces &geometryToConformTo, const cellShapeControl &cellShapeControls, const autoPtr< backgroundMeshDecomposition > &decomposition)
Return a reference to the selected initialPointsMethod.
const dictionary & detailsDict() const
Const access to the details dictionary.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
const cellShapeControl & cellShapeControls() const
const autoPtr< backgroundMeshDecomposition > & decomposition_
initialPointsMethod(const word &type, const dictionary &initialPointsDict, const Time &runTime, Random &rndGen, const conformationSurfaces &geometryToConformTo, const cellShapeControl &cellShapeControls, const autoPtr< backgroundMeshDecomposition > &decomposition)
Construct from components.
TypeName("initialPointsMethod")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
Abstract base class for generating initial points for a conformalVoronoiMesh.
const backgroundMeshDecomposition & decomposition() const
dictionary detailsDict_
Method details dictionary.
Random number generator.
Definition: Random.H:57
const conformationSurfaces & geometryToConformTo() const
virtual List< Vb::Point > initialPoints() const =0
Return the initial points for the conformalVoronoiMesh.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
const cellShapeControl & cellShapeControls_
declareRunTimeSelectionTable(autoPtr, initialPointsMethod, dictionary,(const dictionary &initialPointsDict, const Time &runTime, Random &rndGen, const conformationSurfaces &geometryToConformTo, const cellShapeControl &cellShapeControls, const autoPtr< backgroundMeshDecomposition > &decomposition),(initialPointsDict, runTime, rndGen, geometryToConformTo, cellShapeControls, decomposition))
Store a background polyMesh to use for the decomposition of space and queries for parallel conformalV...
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.
scalar minimumSurfaceDistanceCoeffSqr_
Only allow the placement of initial points that are within the.
Namespace for OpenFOAM.