cellShapeControlMesh.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-2017 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::cellShapeControlMesh
28 
29 Description
30 
31 SourceFiles
32  cellShapeControlMeshI.H
33  cellShapeControlMesh.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cellShapeControlMesh_H
38 #define cellShapeControlMesh_H
39 
40 #include "Time.H"
41 #include "scalar.H"
42 #include "point.H"
43 #include "tensor.H"
44 #include "triad.H"
45 #include "fileName.H"
46 #include "searchableSurfaces.H"
47 #include "conformationSurfaces.H"
51 #include "boundBox.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 // Forward Declarations
59 class cellSizeAndAlignmentControls;
60 
61 /*---------------------------------------------------------------------------*\
62  Class cellShapeControlMesh Declaration
63 \*---------------------------------------------------------------------------*/
64 
66 :
67  public DistributedDelaunayMesh<CellSizeDelaunay>
68 {
69 public:
70 
71  typedef CellSizeDelaunay::Cell_handle Cell_handle;
72  typedef CellSizeDelaunay::Vertex_handle Vertex_handle;
74 
75 
76 private:
77 
78  // Private Data
79 
80  const Time& runTime_;
81 
82  mutable Cell_handle oldCellHandle_;
83 
85 
86 
87  // Private Member Functions
88 
89  //- No copy construct
91 
92  //- No copy assignment
93  void operator=(const cellShapeControlMesh&) = delete;
94 
95 
96 public:
97 
98  //- Runtime type information
99  ClassName("cellShapeControlMesh");
100 
101  //- Return the mesh sub-directory name (usually "cellShapeControlMesh")
102  static word meshSubDir;
103 
104 
105  // Constructors
106 
107  //- Construct from runTime
108  explicit cellShapeControlMesh(const Time& runTime);
109 
110 
111  //- Destructor
112  ~cellShapeControlMesh() = default;
113 
114 
115  // Member Functions
116 
117  // Query
118 
119  const Time& time() const
120  {
121  return runTime_;
122  }
123 
124  //- Calculate and return the barycentric coordinates for
125  // interpolating quantities on the background mesh
127  (
128  const Foam::point& pt,
129  barycentric& bary,
130  Cell_handle& ch
131  ) const;
132 
133  boundBox bounds() const;
134 
135 
136  // Edit
137 
138  label removePoints();
139 
140  //- Get the centres of all the tets
142 
143  inline Vertex_handle insert
144  (
145  const Foam::point& pt,
146  const scalar& size,
147  const triad& alignment,
149  );
150 
151  inline Vertex_handle insertFar
152  (
153  const Foam::point& pt
154  );
155 
156  void distribute(const backgroundMeshDecomposition& decomposition);
157 
158  tensorField dumpAlignments() const;
159 
160  void writeTriangulation();
161 
162  void write() const;
163 
164  label estimateCellCount
165  (
166  const autoPtr<backgroundMeshDecomposition>& decomposition
167  ) const;
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #include "cellShapeControlMeshI.H"
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 #endif
181 
182 // ************************************************************************* //
Vertex_handle insertFar(const Foam::point &pt)
tmp< pointField > cellCentres() const
Get the centres of all the tets.
engineTime & runTime
Vertex_handle insert(const Foam::point &pt, const scalar &size, const triad &alignment, const Foam::indexedVertexEnum::vertexType type=Vb::vtInternal)
CellSizeDelaunay::Point Point
void barycentricCoords(const Foam::point &pt, barycentric &bary, Cell_handle &ch) const
Calculate and return the barycentric coordinates for.
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:63
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
tensorField dumpAlignments() const
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: POSIX.C:799
A class for handling words, derived from Foam::string.
Definition: word.H:63
void distribute(const backgroundMeshDecomposition &decomposition)
CellSizeDelaunay::Vertex_handle Vertex_handle
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
CGAL::Point_3< K > Point
ClassName("cellShapeControlMesh")
Runtime type information.
static word meshSubDir
Return the mesh sub-directory name (usually "cellShapeControlMesh")
Representation of a 3D Cartesian coordinate system as a Vector of row vectors.
Definition: triad.H:60
CellSizeDelaunay::Cell_handle Cell_handle
boundBox bounds() const
Store a background polyMesh to use for the decomposition of space and queries for parallel conformalV...
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
label estimateCellCount(const autoPtr< backgroundMeshDecomposition > &decomposition) const
~cellShapeControlMesh()=default
Destructor.
CGAL data structures used for 3D Delaunay meshing.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.