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 | 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::initialPointsMethod
28 
29 Description
30  Abstract base class for generating initial points for a conformalVoronoiMesh
31 
32 SourceFiles
33  initialPointsMethod.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef initialPointsMethod_H
38 #define initialPointsMethod_H
39 
40 #include "point.H"
41 #include "conformalVoronoiMesh.H"
43 #include "dictionary.H"
44 #include "Random.H"
45 #include "autoPtr.H"
46 #include "runTimeSelectionTables.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class initialPointsMethod Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public dictionary
60 {
61 
62 protected:
63 
64  // Protected data
65 
66  const Time& runTime_;
67 
68  Random& rndGen_;
69 
71 
73 
75 
76  //- Method details dictionary
78 
79  //- Only allow the placement of initial points that are within the
80  // surfaces to be meshed by minimumSurfaceDistanceCoeff multiplied by
81  // the local target cell size. Store square of value.
83 
84  bool fixInitialPoints_;
85 
86 
87 private:
88 
89  // Private Member Functions
90 
91  //- No copy construct
93 
94  //- No copy assignment
95  void operator=(const initialPointsMethod&) = delete;
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("initialPointsMethod");
102 
103 
104  // Declare run-time constructor selection table
105 
107  (
108  autoPtr,
110  dictionary,
111  (
112  const dictionary& initialPointsDict,
113  const Time& runTime,
114  Random& rndGen,
118  ),
119  (
120  initialPointsDict,
121  runTime,
122  rndGen,
126  )
127  );
128 
129 
130  // Constructors
131 
132  //- Construct from components
134  (
135  const word& type,
136  const dictionary& initialPointsDict,
137  const Time& runTime,
138  Random& rndGen,
142  );
143 
144 
145  // Selectors
146 
147  //- Return a reference to the selected initialPointsMethod
149  (
150  const dictionary& initialPointsDict,
151  const Time& runTime,
152  Random& rndGen,
156  );
157 
158 
159  //- Destructor
160  virtual ~initialPointsMethod() = default;
161 
162 
163  // Member Functions
164 
165  // Access
166 
167  const Time& time() const
168  {
169  return runTime_;
170  }
171 
172  Random& rndGen() const
173  {
174  return rndGen_;
175  }
176 
178  {
179  return geometryToConformTo_;
180  }
181 
182  const cellShapeControl& cellShapeControls() const
183  {
184  return cellShapeControls_;
185  }
186 
188  {
189  return *decomposition_;
190  }
191 
192  //- Const access to the details dictionary
193  const dictionary& detailsDict() const
194  {
195  return detailsDict_;
196  }
197 
198  bool fixInitialPoints() const
199  {
200  return fixInitialPoints_;
201  }
202 
203 
204  // Queries
205 
206  //- Return the initial points for the conformalVoronoiMesh
207  virtual List<Vb::Point> initialPoints() const = 0;
208 };
209 
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 } // End namespace Foam
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #endif
218 
219 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Random
Random number generator.
Definition: Random.H:59
Foam::initialPointsMethod::declareRunTimeSelectionTable
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))
Foam::initialPointsMethod::geometryToConformTo_
const conformationSurfaces & geometryToConformTo_
Definition: initialPointsMethod.H:69
Foam::initialPointsMethod::runTime_
const Time & runTime_
Definition: initialPointsMethod.H:65
Foam::initialPointsMethod::cellShapeControls
const cellShapeControl & cellShapeControls() const
Definition: initialPointsMethod.H:181
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::initialPointsMethod::decomposition
const backgroundMeshDecomposition & decomposition() const
Definition: initialPointsMethod.H:186
Foam::initialPointsMethod::cellShapeControls_
const cellShapeControl & cellShapeControls_
Definition: initialPointsMethod.H:71
Foam::initialPointsMethod::fixInitialPoints_
bool fixInitialPoints_
Definition: initialPointsMethod.H:83
Foam::initialPointsMethod::rndGen_
Random & rndGen_
Definition: initialPointsMethod.H:67
point.H
Foam::initialPointsMethod::TypeName
TypeName("initialPointsMethod")
Runtime type information.
Foam::initialPointsMethod::decomposition_
const autoPtr< backgroundMeshDecomposition > & decomposition_
Definition: initialPointsMethod.H:73
Foam::initialPointsMethod::detailsDict_
dictionary detailsDict_
Method details dictionary.
Definition: initialPointsMethod.H:76
Foam::conformationSurfaces
Definition: conformationSurfaces.H:55
backgroundMeshDecomposition.H
Foam::initialPointsMethod::geometryToConformTo
const conformationSurfaces & geometryToConformTo() const
Definition: initialPointsMethod.H:176
Foam::initialPointsMethod::fixInitialPoints
bool fixInitialPoints() const
Definition: initialPointsMethod.H:197
Foam::initialPointsMethod::initialPoints
virtual List< Vb::Point > initialPoints() const =0
Return the initial points for the conformalVoronoiMesh.
Foam::initialPointsMethod::detailsDict
const dictionary & detailsDict() const
Const access to the details dictionary.
Definition: initialPointsMethod.H:192
Foam::initialPointsMethod::New
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.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::cellShapeControl
Definition: cellShapeControl.H:64
Foam::initialPointsMethod::time
const Time & time() const
Definition: initialPointsMethod.H:166
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::initialPointsMethod
Abstract base class for generating initial points for a conformalVoronoiMesh.
Definition: initialPointsMethod.H:56
Foam::initialPointsMethod::~initialPointsMethod
virtual ~initialPointsMethod()=default
Destructor.
Random.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::initialPointsMethod::minimumSurfaceDistanceCoeffSqr_
scalar minimumSurfaceDistanceCoeffSqr_
Only allow the placement of initial points that are within the.
Definition: initialPointsMethod.H:81
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::initialPointsMethod::rndGen
Random & rndGen() const
Definition: initialPointsMethod.H:171
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
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
Foam::backgroundMeshDecomposition
Store a background polyMesh to use for the decomposition of space and queries for parallel conformalV...
Definition: backgroundMeshDecomposition.H:94
dictionary.H
conformalVoronoiMesh.H
autoPtr.H