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 class cellSizeAndAlignmentControls;
59 
60 /*---------------------------------------------------------------------------*\
61  Class cellShapeControlMesh Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 :
66  public DistributedDelaunayMesh<CellSizeDelaunay>
67 {
68 public:
69 
70  typedef CellSizeDelaunay::Cell_handle Cell_handle;
71  typedef CellSizeDelaunay::Vertex_handle Vertex_handle;
73 
74 
75 private:
76 
77  // Private data
78 
79  const Time& runTime_;
80 
81  mutable Cell_handle oldCellHandle_;
82 
83  const scalar defaultCellSize_;
84 
85 
86  // Private Member Functions
87 
88  //- No copy construct
90 
91  //- No copy assignment
92  void operator=(const cellShapeControlMesh&) = delete;
93 
94 
95 public:
96 
97  //- Runtime type information
98  ClassName("cellShapeControlMesh");
99 
100  //- Return the mesh sub-directory name (usually "cellShapeControlMesh")
101  static word meshSubDir;
102 
103 
104  // Constructors
105 
106  explicit cellShapeControlMesh(const Time& runTime);
107 
108 
109  //- Destructor
111 
112 
113  // Member Functions
114 
115  // Query
116 
117  const Time& time() const
118  {
119  return runTime_;
120  }
121 
122  //- Calculate and return the barycentric coordinates for
123  // interpolating quantities on the background mesh
124  void barycentricCoords
125  (
126  const Foam::point& pt,
127  barycentric& bary,
128  Cell_handle& ch
129  ) const;
130 
131  boundBox bounds() const;
132 
133 
134  // Edit
135 
136  label removePoints();
137 
138  //- Get the centres of all the tets
140 
141  inline Vertex_handle insert
142  (
143  const Foam::point& pt,
144  const scalar& size,
145  const triad& alignment,
146  const Foam::indexedVertexEnum::vertexType type = Vb::vtInternal
147  );
148 
149  inline Vertex_handle insertFar
150  (
151  const Foam::point& pt
152  );
153 
154  void distribute(const backgroundMeshDecomposition& decomposition);
155 
156  tensorField dumpAlignments() const;
157 
158  void writeTriangulation();
159 
160  void write() const;
161 
162  label estimateCellCount
163  (
164  const autoPtr<backgroundMeshDecomposition>& decomposition
165  ) const;
166 };
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #include "cellShapeControlMeshI.H"
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 #endif
179 
180 // ************************************************************************* //
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:62
Foam::cellShapeControlMesh::~cellShapeControlMesh
~cellShapeControlMesh()
Destructor.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::cellShapeControlMesh::estimateCellCount
label estimateCellCount(const autoPtr< backgroundMeshDecomposition > &decomposition) const
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:116
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:71
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:70
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:66
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:100
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:69
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:63
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