initialPointsMethod.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 | Copyright (C) 2012-2015 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 private:
87 
88  // Private Member Functions
89 
90  //- Disallow default bitwise copy construct
92 
93  //- Disallow default bitwise assignment
94  void operator=(const initialPointsMethod&);
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("initialPointsMethod");
101 
102 
103  // Declare run-time constructor selection table
104 
106  (
107  autoPtr,
109  dictionary,
110  (
111  const dictionary& initialPointsDict,
112  const Time& runTime,
113  Random& rndGen,
117  ),
118  (
119  initialPointsDict,
120  runTime,
121  rndGen,
122  geometryToConformTo,
123  cellShapeControls,
124  decomposition
125  )
126  );
127 
128 
129  // Constructors
130 
131  //- Construct from components
133  (
134  const word& type,
135  const dictionary& initialPointsDict,
136  const Time& runTime,
137  Random& rndGen,
138  const conformationSurfaces& geometryToConformTo,
139  const cellShapeControl& cellShapeControls,
140  const autoPtr<backgroundMeshDecomposition>& decomposition
141  );
142 
143 
144  // Selectors
145 
146  //- Return a reference to the selected initialPointsMethod
148  (
149  const dictionary& initialPointsDict,
150  const Time& runTime,
151  Random& rndGen,
152  const conformationSurfaces& geometryToConformTo,
153  const cellShapeControl& cellShapeControls,
154  const autoPtr<backgroundMeshDecomposition>& decomposition
155  );
156 
157 
158  //- Destructor
159  virtual ~initialPointsMethod();
160 
161 
162  // Member Functions
163 
164  // Access
166  const Time& time() const
167  {
168  return runTime_;
169  }
171  Random& rndGen() const
172  {
173  return rndGen_;
174  }
177  {
178  return geometryToConformTo_;
179  }
181  const cellShapeControl& cellShapeControls() const
182  {
183  return cellShapeControls_;
184  }
187  {
188  return decomposition_;
189  }
190 
191  //- Const access to the details dictionary
192  const dictionary& detailsDict() const
193  {
194  return detailsDict_;
195  }
197  Switch fixInitialPoints() const
198  {
199  return fixInitialPoints_;
200  }
201 
202 
203  // Queries
204 
205  //- Return the initial points for the conformalVoronoiMesh
206  virtual List<Vb::Point> initialPoints() const = 0;
207 };
208 
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 } // End namespace Foam
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #endif
217 
218 // ************************************************************************* //
const cellShapeControl & cellShapeControls() const
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
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.
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:68
const autoPtr< backgroundMeshDecomposition > & decomposition_
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.
dictionary detailsDict_
Method details dictionary.
Simple random number generator.
Definition: Random.H:49
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:461
virtual List< Vb::Point > initialPoints() const =0
Return the initial points for the conformalVoronoiMesh.
const conformationSurfaces & geometryToConformTo() const
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))
const Time & time() const
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:53
Macros to ease declaration of run-time selection tables.
const backgroundMeshDecomposition & decomposition() const
scalar minimumSurfaceDistanceCoeffSqr_
Only allow the placement of initial points that are within the.
Namespace for OpenFOAM.