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
126  void barycentricCoords
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,
148  const Foam::indexedVertexEnum::vertexType type = Vb::vtInternal
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 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::cellShapeControlMesh::dumpAlignments
tensorField dumpAlignments() const
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::cellShapeControlMesh::estimateCellCount
label estimateCellCount(const autoPtr< backgroundMeshDecomposition > &decomposition) const
Foam::cellShapeControlMesh::~cellShapeControlMesh
~cellShapeControlMesh()=default
Destructor.
point.H
Foam::cellShapeControlMesh::insertFar
Vertex_handle insertFar(const Foam::point &pt)
Definition: cellShapeControlMeshI.H:53
triad.H
Foam::cellShapeControlMesh::time
const Time & time() const
Definition: cellShapeControlMesh.H:118
Foam::cellShapeControlMesh::write
void write() const
Foam::indexedVertexEnum::vertexType
vertexType
Definition: indexedVertexEnum.H:52
tensor.H
Foam::cellShapeControlMesh::removePoints
label removePoints()
searchableSurfaces.H
backgroundMeshDecomposition.H
Foam::Field< tensor >
Foam::cellShapeControlMesh::barycentricCoords
void barycentricCoords(const Foam::point &pt, barycentric &bary, Cell_handle &ch) const
Calculate and return the barycentric coordinates for.
conformationSurfaces.H
Foam::cellShapeControlMesh::Point
CellSizeDelaunay::Point Point
Definition: cellShapeControlMesh.H:72
fileName.H
cellShapeControlMeshI.H
DistributedDelaunayMesh.H
Foam::Barycentric< scalar >
Foam::DistributedDelaunayMesh
Definition: DistributedDelaunayMesh.H:58
Foam::cellShapeControlMesh::Vertex_handle
CellSizeDelaunay::Vertex_handle Vertex_handle
Definition: cellShapeControlMesh.H:71
scalar.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cellShapeControlMesh::distribute
void distribute(const backgroundMeshDecomposition &decomposition)
Foam::cellShapeControlMesh::bounds
boundBox bounds() const
Foam::triad
Representation of a 3D Cartesian coordinate system as a Vector of row vectors.
Definition: triad.H:64
Foam::cellShapeControlMesh::ClassName
ClassName("cellShapeControlMesh")
Runtime type information.
boundBox.H
Time.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::cellShapeControlMesh::meshSubDir
static word meshSubDir
Return the mesh sub-directory name (usually "cellShapeControlMesh")
Definition: cellShapeControlMesh.H:101
Foam::Vector< scalar >
Foam::cellShapeControlMesh::writeTriangulation
void writeTriangulation()
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
Foam::cellShapeControlMesh::Cell_handle
CellSizeDelaunay::Cell_handle Cell_handle
Definition: cellShapeControlMesh.H:70
Foam::boundBox
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:63
Point
CGAL::Point_3< K > Point
Definition: CGALIndexedPolyhedron.H:53
Foam::cellShapeControlMesh::cellCentres
tmp< pointField > cellCentres() const
Get the centres of all the tets.
CGALTriangulation3Ddefs.H
CGAL data structures used for 3D Delaunay meshing.
Foam::cellShapeControlMesh
Definition: cellShapeControlMesh.H:64
Foam::cellShapeControlMesh::insert
Vertex_handle insert(const Foam::point &pt, const scalar &size, const triad &alignment, const Foam::indexedVertexEnum::vertexType type=Vb::vtInternal)
Definition: cellShapeControlMeshI.H:31