cellShapeControlMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2020 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::cellShapeControlMesh
26 
27 Description
28 
29 SourceFiles
30  cellShapeControlMeshI.H
31  cellShapeControlMesh.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cellShapeControlMesh_H
36 #define cellShapeControlMesh_H
37 
38 #include "Time.H"
39 #include "scalar.H"
40 #include "point.H"
41 #include "tensor.H"
42 #include "triad.H"
43 #include "fileName.H"
44 #include "searchableSurfaces.H"
45 #include "conformationSurfaces.H"
49 #include "boundBox.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 class cellSizeAndAlignmentControls;
57 
58 /*---------------------------------------------------------------------------*\
59  Class cellShapeControlMesh Declaration
60 \*---------------------------------------------------------------------------*/
61 
63 :
64  public DistributedDelaunayMesh<CellSizeDelaunay>
65 {
66 public:
67 
68  typedef CellSizeDelaunay::Cell_handle Cell_handle;
69  typedef CellSizeDelaunay::Vertex_handle Vertex_handle;
70  typedef CellSizeDelaunay::Point Point;
71 
72 
73 private:
74 
75  // Private Data
76 
77  const Time& runTime_;
78 
79  mutable Cell_handle oldCellHandle_;
80 
81 
82 public:
83 
84  //- Runtime type information
85  ClassName("cellShapeControlMesh");
86 
87  //- Return the mesh sub-directory name (usually "cellShapeControlMesh")
88  static word meshSubDir;
89 
90 
91  // Constructors
92 
93  explicit cellShapeControlMesh(const Time& runTime);
94 
95  //- Disallow default bitwise copy construction
97 
98 
99  //- Destructor
101 
102 
103  // Member Functions
104 
105  // Query
107  const Time& time() const
108  {
109  return runTime_;
110  }
111 
112  //- Calculate and return the barycentric coordinates for
113  // interpolating quantities on the background mesh
114  void barycentricCoords
115  (
116  const Foam::point& pt,
117  barycentric& bary,
118  Cell_handle& ch
119  ) const;
120 
121  boundBox bounds() const;
122 
123 
124  // Edit
125 
127 
128  //- Get the centres of all the tets
130 
131  inline Vertex_handle insert
132  (
133  const Foam::point& pt,
134  const scalar& size,
135  const triad& alignment,
137  );
138 
139  inline Vertex_handle insertFar
140  (
141  const Foam::point& pt
142  );
143 
144  void distribute(const backgroundMeshDecomposition& decomposition);
145 
146  tensorField dumpAlignments() const;
147 
148  void writeTriangulation();
149 
150  void write() const;
151 
153  (
154  const autoPtr<backgroundMeshDecomposition>& decomposition
155  ) const;
156 
157 
158  // Member Operators
159 
160  //- Disallow default bitwise assignment
161  void operator=(const cellShapeControlMesh&) = delete;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #include "cellShapeControlMeshI.H"
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 #endif
175 
176 // ************************************************************************* //
Vertex_handle insertFar(const Foam::point &pt)
~cellShapeControlMesh()
Destructor.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
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 the points at its extremities.
Definition: boundBox.H:58
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
tensorField dumpAlignments() const
A class for handling words, derived from string.
Definition: word.H:59
void distribute(const backgroundMeshDecomposition &decomposition)
CellSizeDelaunay::Vertex_handle Vertex_handle
cellShapeControlMesh(const Time &runTime)
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 vectors.
Definition: triad.H:65
CellSizeDelaunay::Cell_handle Cell_handle
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
boundBox bounds() 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:52
label estimateCellCount(const autoPtr< backgroundMeshDecomposition > &decomposition) const
CGAL data structures used for 3D Delaunay meshing.
A class for managing temporary objects.
Definition: PtrList.H:53
void operator=(const cellShapeControlMesh &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.