voronoiMeshExtractor.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Description
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "voronoiMeshExtractor.H"
29 #include "demandDrivenData.H"
30 
31 // #define DEBUGTets
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 label voronoiMeshExtractor::sameOrientation_[6] = {3, 1, 2, 2, 3, 0};
41 
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
47 {
52 }
53 
54 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
55 
56 // Construct from octree and mesh data
58 (
59  const meshOctree& octree,
60  const IOdictionary& meshDict,
62 )
63 :
64  tetCreator_(octree, meshDict),
65  mesh_(mesh),
66  pointEdgesPtr_(NULL),
67  edgesPtr_(NULL),
68  edgeTetsPtr_(NULL),
69  boundaryEdgePtr_(NULL)
70 {}
71 
72 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
73 
75 {
76  clearOut();
77 }
78 
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 
82 {
83  Info << "Extracting voronoi mesh" << endl;
84 
85  //- copy tet points into the mesh
86  createPoints();
87 
88  //- create the mesh
90 
93 
94  Info << "Mesh has :" << nl
95  << mesh_.points().size() << " vertices " << nl
96  << mesh_.faces().size() << " faces" << nl
97  << mesh_.cells().size() << " cells" << endl;
98 
99  Info << "Finished extracting voronoi mesh" << endl;
100 }
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 } // End namespace Foam
105 
106 // ************************************************************************* //
Foam::voronoiMeshExtractor::sameOrientation_
static label sameOrientation_[6]
positive orientation
Definition: voronoiMeshExtractor.H:99
Foam::voronoiMeshExtractor::voronoiMeshExtractor
voronoiMeshExtractor(const voronoiMeshExtractor &)
Disallow default bitwise copy construct.
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
Foam::voronoiMeshExtractor::mesh_
polyMeshGen & mesh_
reference to the mesh
Definition: voronoiMeshExtractor.H:58
voronoiMeshExtractor.H
Foam::voronoiMeshExtractor::edgesPtr_
LongList< edge > * edgesPtr_
edges of the tetrahedrization
Definition: voronoiMeshExtractor.H:64
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::polyMeshGen
Definition: polyMeshGen.H:46
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::polyMeshGenPoints::points
const pointFieldPMG & points() const
access to points
Definition: polyMeshGenPointsI.H:44
Foam::voronoiMeshExtractor::createPoints
void createPoints()
create points of the voronoi mesh
Definition: voronoiMeshExtractorCreateMesh.C:44
Foam::polyMeshGenFaces::faces
const faceListPMG & faces() const
access to faces
Definition: polyMeshGenFacesI.H:43
Foam::voronoiMeshExtractor::clearOut
void clearOut()
delete all pointer data
Definition: voronoiMeshExtractor.C:46
Foam::voronoiMeshExtractor::createMesh
void createMesh()
Definition: voronoiMeshExtractor.C:81
Foam::voronoiMeshExtractor::edgeTetsPtr_
VRWGraph * edgeTetsPtr_
tets around each edge
Definition: voronoiMeshExtractor.H:67
Foam::deleteDemandDrivenData
void deleteDemandDrivenData(DataPtr &dataPtr)
Definition: demandDrivenData.H:40
Foam::label
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
Foam::polyMeshGenModifier::reorderBoundaryFaces
void reorderBoundaryFaces()
Definition: polyMeshGenModifierReorderBoundaryFaces.C:44
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
Foam::polyMeshGenCells::cells
const cellListPMG & cells() const
access to cells
Definition: polyMeshGenCellsI.H:39
Foam::voronoiMeshExtractor::createPolyMesh
void createPolyMesh()
create mesh data
Definition: voronoiMeshExtractorCreateMesh.C:72
Foam::pointFieldPMG::size
label size() const
return the number of used elements
Definition: pointFieldPMGI.H:71
Foam::polyMeshGenModifier::removeUnusedVertices
void removeUnusedVertices()
remove unused vertices
Definition: polyMeshGenModifierRemoveUnusedVertices.C:37
Foam::voronoiMeshExtractor::oppositeOrientation_
static label oppositeOrientation_[6]
opposite orientation
Definition: voronoiMeshExtractor.H:102
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::voronoiMeshExtractor::~voronoiMeshExtractor
~voronoiMeshExtractor()
Definition: voronoiMeshExtractor.C:74
Foam::polyMeshGenModifier
Definition: polyMeshGenModifier.H:52
Foam::faceListPMG::size
label size() const
return the number of used elements
Definition: faceListPMGI.H:73
Foam::voronoiMeshExtractor::pointEdgesPtr_
VRWGraph * pointEdgesPtr_
edges connected to a vertex in the tet mesh
Definition: voronoiMeshExtractor.H:61
Foam::meshOctree
Definition: meshOctree.H:55
Foam::cellListPMG::size
label size() const
return the number of used elements
Definition: cellListPMGI.H:56
Foam::voronoiMeshExtractor::boundaryEdgePtr_
boolList * boundaryEdgePtr_
is edge at the boundary
Definition: voronoiMeshExtractor.H:70