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-2019 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  const scalar defaultCellSize_;
82 
83 
84 public:
85 
86  //- Runtime type information
87  ClassName("cellShapeControlMesh");
88 
89  //- Return the mesh sub-directory name (usually "cellShapeControlMesh")
90  static word meshSubDir;
91 
92 
93  // Constructors
94 
95  explicit cellShapeControlMesh(const Time& runTime);
96 
97  //- Disallow default bitwise copy construction
99 
100 
101  //- Destructor
103 
104 
105  // Member Functions
106 
107  // Query
109  const Time& time() const
110  {
111  return runTime_;
112  }
113 
114  //- Calculate and return the barycentric coordinates for
115  // interpolating quantities on the background mesh
116  void barycentricCoords
117  (
118  const Foam::point& pt,
119  barycentric& bary,
120  Cell_handle& ch
121  ) const;
122 
123  boundBox bounds() const;
124 
125 
126  // Edit
127 
129 
130  //- Get the centres of all the tets
132 
133  inline Vertex_handle insert
134  (
135  const Foam::point& pt,
136  const scalar& size,
137  const triad& alignment,
139  );
140 
141  inline Vertex_handle insertFar
142  (
143  const Foam::point& pt
144  );
145 
146  void distribute(const backgroundMeshDecomposition& decomposition);
147 
148  tensorField dumpAlignments() const;
149 
150  void writeTriangulation();
151 
152  void write() const;
153 
155  (
156  const autoPtr<backgroundMeshDecomposition>& decomposition
157  ) const;
158 
159 
160  // Member Operators
161 
162  //- Disallow default bitwise assignment
163  void operator=(const cellShapeControlMesh&) = delete;
164 };
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #include "cellShapeControlMeshI.H"
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 #endif
177 
178 // ************************************************************************* //
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.