triSurfAddressing.H
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 Class
25  triSurfAddressing
26 
27 Description
28  Provides topology addressing of the triangulated surface
29 
30 SourceFiles
31  triSurfAddressing.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef triSurfAddressing_H
36 #define triSurfAddressing_H
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 #include "VRWGraph.H"
41 #include "edgeLongList.H"
42 #include "triSurfFacets.H"
43 #include "labelledTri.H"
44 #include "DynList.H"
45 
46 #include <map>
47 
48 namespace Foam
49 {
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
54 {
55  // Private data
56  //- const reference to the points
57  const pointField& points_;
58 
59  // Topology addressing
60  //- const reference to the facets
62 
63  //- facets connected to a point
64  mutable VRWGraph* pointFacetsPtr_;
65 
66  //- edges in the triangulation
67  mutable edgeLongList* edgesPtr_;
68 
69  //- labels of edges in the triangles
70  mutable VRWGraph* facetEdgesPtr_;
71 
72  //- labels of triangles connected to an edge
73  mutable VRWGraph* edgeFacetsPtr_;
74 
75  //- labels of edges connected to a point
76  mutable VRWGraph* pointEdgesPtr_;
77 
78  //- facets connected tp a facet via edges
80 
81  // Geometry data
82  //- point normals
84 
85  //- face normals
87 
88  //- face centres
90 
91  // Private member functions
92  //- calculate point-facets addressing
93  void calculatePointFacets() const;
94 
95  //- calculate edges, facet-edges and edge-facets addressing
96  void calculateEdges() const;
97 
98  //- calculate facet-edges addresing
99  void calculateFacetEdges() const;
100 
101  //- calculate edge-facets addressing
102  void calculateEdgeFacets() const;
103 
104  //- calculate point-edges addressing
105  void calculatePointEdges() const;
106 
107  //- calculate facet-faceys addressing
108  void calculateFacetFacetsEdges() const;
109 
110  //- calculate point normals
111  void calculatePointNormals() const;
112 
113  //- calculate normals of facets
114  void calculateFacetNormals() const;
115 
116  //- calculate centres of facets
117  void calculateFacetCentres() const;
118 
119  // Disallow bitwise assignment
120  void operator=(const triSurfAddressing&);
121 
123 
124 public:
125 
126  // Constructors
127  //- Construct from surface triangles
129  (
130  const pointField& points,
131  const LongList<labelledTri>& triangles
132  );
133 
134  // Destructor
136 
137  // Member functions
138  //- return point-facets addressing
139  inline const VRWGraph& pointFacets() const;
140 
141  //- return edges
142  inline const LongList<edge>& edges() const;
143 
144  //- return facet-edges addressing
145  inline const VRWGraph& facetEdges() const;
146 
147  //- return edge-facets addressing
148  inline const VRWGraph& edgeFacets() const;
149 
150  //- return point-edges addressing
151  inline const VRWGraph& pointEdges() const;
152 
153  //- return facet-facets addressing
154  inline const VRWGraph& facetFacets() const;
155 
156  //- return point normals
157  inline const pointField& pointNormals() const;
158 
159  //- return normals of facets
160  inline const vectorField& facetNormals() const;
161 
162  //- return centres of facets
163  inline const vectorField& facetCentres() const;
164 
165  //- delete all data
166  void clearAddressing();
167 
168  //- delete geometry data
169  void clearGeometry();
170 };
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace Foam
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #include "triSurfAddressingI.H"
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::triSurfAddressing::points_
const pointField & points_
const reference to the points
Definition: triSurfAddressing.H:56
Foam::triSurfAddressing::facetNormals
const vectorField & facetNormals() const
return normals of facets
Definition: triSurfAddressingI.H:170
Foam::triSurfAddressing::pointNormalsPtr_
vectorField * pointNormalsPtr_
point normals
Definition: triSurfAddressing.H:82
VRWGraph.H
Foam::triSurfAddressing::calculateFacetFacetsEdges
void calculateFacetFacetsEdges() const
calculate facet-faceys addressing
Definition: triSurfAddressing.C:222
Foam::triSurfAddressing::edgesPtr_
edgeLongList * edgesPtr_
edges in the triangulation
Definition: triSurfAddressing.H:66
Foam::triSurfAddressing::edgeFacetsPtr_
VRWGraph * edgeFacetsPtr_
labels of triangles connected to an edge
Definition: triSurfAddressing.H:72
Foam::triSurfAddressing::calculatePointEdges
void calculatePointEdges() const
calculate point-edges addressing
Definition: triSurfAddressing.C:213
Foam::triSurfAddressing::facetCentres
const vectorField & facetCentres() const
return centres of facets
Definition: triSurfAddressingI.H:189
Foam::triSurfAddressing::facetCentresPtr_
vectorField * facetCentresPtr_
face centres
Definition: triSurfAddressing.H:88
Foam::triSurfAddressing::facets_
const LongList< labelledTri > & facets_
const reference to the facets
Definition: triSurfAddressing.H:60
Foam::triSurfAddressing::operator=
void operator=(const triSurfAddressing &)
Foam::triSurfAddressing::calculateFacetCentres
void calculateFacetCentres() const
calculate centres of facets
Definition: triSurfAddressing.C:298
Foam::LongList
Definition: LongList.H:55
Foam::triSurfAddressing::clearAddressing
void clearAddressing()
delete all data
Definition: triSurfAddressing.C:340
Foam::triSurfAddressing::triSurfAddressing
triSurfAddressing(const triSurfAddressing &)
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::triSurfAddressing::pointFacetsPtr_
VRWGraph * pointFacetsPtr_
facets connected to a point
Definition: triSurfAddressing.H:63
edgeLongList.H
Foam::triSurfAddressing::clearGeometry
void clearGeometry()
delete geometry data
Definition: triSurfAddressing.C:350
Foam::triSurfAddressing::pointFacets
const VRWGraph & pointFacets() const
return point-facets addressing
Definition: triSurfAddressingI.H:43
Foam::triSurfAddressing::facetEdgesPtr_
VRWGraph * facetEdgesPtr_
labels of edges in the triangles
Definition: triSurfAddressing.H:69
Foam::triSurfAddressing::facetFacetsEdgesPtr_
VRWGraph * facetFacetsEdgesPtr_
facets connected tp a facet via edges
Definition: triSurfAddressing.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::triSurfAddressing::calculateEdges
void calculateEdges() const
calculate edges, facet-edges and edge-facets addressing
Definition: triSurfAddressing.C:48
Foam::triSurfAddressing::calculateFacetEdges
void calculateFacetEdges() const
calculate facet-edges addresing
Definition: triSurfAddressing.C:144
Foam::triSurfAddressing::calculateEdgeFacets
void calculateEdgeFacets() const
calculate edge-facets addressing
Definition: triSurfAddressing.C:203
Foam::triSurfAddressing::facetEdges
const VRWGraph & facetEdges() const
return facet-edges addressing
Definition: triSurfAddressingI.H:79
triSurfAddressingI.H
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::triSurfAddressing::edges
const LongList< edge > & edges() const
return edges
Definition: triSurfAddressingI.H:61
triSurfFacets.H
Foam::triSurfAddressing::facetNormalsPtr_
vectorField * facetNormalsPtr_
face normals
Definition: triSurfAddressing.H:85
Foam::triSurfAddressing::calculateFacetNormals
void calculateFacetNormals() const
calculate normals of facets
Definition: triSurfAddressing.C:283
Foam::triSurfAddressing::calculatePointFacets
void calculatePointFacets() const
calculate point-facets addressing
Definition: triSurfAddressing.C:41
Foam::triSurfAddressing::pointNormals
const pointField & pointNormals() const
return point normals
Definition: triSurfAddressingI.H:151
labelledTri.H
Foam::VRWGraph
Definition: VRWGraph.H:101
Foam::triSurfAddressing::edgeFacets
const VRWGraph & edgeFacets() const
return edge-facets addressing
Definition: triSurfAddressingI.H:97
Foam::triSurfAddressing::pointEdges
const VRWGraph & pointEdges() const
return point-edges addressing
Definition: triSurfAddressingI.H:115
Foam::triSurfAddressing::facetFacets
const VRWGraph & facetFacets() const
return facet-facets addressing
Definition: triSurfAddressingI.H:133
Foam::triSurfAddressing::calculatePointNormals
void calculatePointNormals() const
calculate point normals
Definition: triSurfAddressing.C:251
Foam::triSurfAddressing
Definition: triSurfAddressing.H:52
DynList.H
Foam::triSurfAddressing::~triSurfAddressing
~triSurfAddressing()
Definition: triSurfAddressing.C:332
Foam::triSurfAddressing::pointEdgesPtr_
VRWGraph * pointEdgesPtr_
labels of edges connected to a point
Definition: triSurfAddressing.H:75