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-2018 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  // Private Member Functions
85 
86  //- Disallow default bitwise copy construct
88 
89  //- Disallow default bitwise assignment
90  void operator=(const cellShapeControlMesh&);
91 
92 
93 public:
94 
95  //- Runtime type information
96  ClassName("cellShapeControlMesh");
97 
98  //- Return the mesh sub-directory name (usually "cellShapeControlMesh")
99  static word meshSubDir;
100 
101 
102  // Constructors
103 
104  explicit cellShapeControlMesh(const Time& runTime);
105 
106 
107  //- Destructor
109 
110 
111  // Member Functions
112 
113  // Query
115  const Time& time() const
116  {
117  return runTime_;
118  }
119 
120  //- Calculate and return the barycentric coordinates for
121  // interpolating quantities on the background mesh
122  void barycentricCoords
123  (
124  const Foam::point& pt,
125  barycentric& bary,
126  Cell_handle& ch
127  ) const;
128 
129  boundBox bounds() const;
130 
131 
132  // Edit
133 
135 
136  //- Get the centres of all the tets
138 
139  inline Vertex_handle insert
140  (
141  const Foam::point& pt,
142  const scalar& size,
143  const triad& alignment,
145  );
146 
147  inline Vertex_handle insertFar
148  (
149  const Foam::point& pt
150  );
151 
152  void distribute(const backgroundMeshDecomposition& decomposition);
153 
154  tensorField dumpAlignments() const;
155 
156  void writeTriangulation();
157 
158  void write() const;
159 
161  (
162  const autoPtr<backgroundMeshDecomposition>& decomposition
163  ) const;
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
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:481
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
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
Namespace for OpenFOAM.