triSurfAddressingI.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 Description
25 
26 
27 \*---------------------------------------------------------------------------*/
28 
29 
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 
32 #include "triSurfAddressing.H"
33 
34 # ifdef USE_OMP
35 #include <omp.h>
36 # endif
37 
38 namespace Foam
39 {
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
44 {
45  if( !pointFacetsPtr_ )
46  {
47  # ifdef USE_OMP
48  if( omp_in_parallel() )
50  (
51  "inline const VRWGraph& triSurfAddressing::pointFacets() const"
52  ) << "Cannot calculate pointFacets" << abort(FatalError);
53  # endif
54 
56  }
57 
58  return *pointFacetsPtr_;
59 }
60 
62 {
63  if( !edgesPtr_ )
64  {
65  # ifdef USE_OMP
66  if( omp_in_parallel() )
68  (
69  "inline const edgeLongList& triSurfAddressing::edges() const"
70  ) << "Cannot calculate edges" << abort(FatalError);
71  # endif
72 
74  }
75 
76  return *edgesPtr_;
77 }
78 
80 {
81  if( !facetEdgesPtr_ )
82  {
83  # ifdef USE_OMP
84  if( omp_in_parallel() )
86  (
87  "inline const VRWGraph& triSurfAddressing::facetEdges() const"
88  ) << "Cannot calculate facetEdges" << abort(FatalError);
89  # endif
90 
92  }
93 
94  return *facetEdgesPtr_;
95 }
96 
98 {
99  if( !edgeFacetsPtr_ )
100  {
101  # ifdef USE_OMP
102  if( omp_in_parallel() )
104  (
105  "inline const VRWGraph& triSurfAddressing::edgeFacets() const"
106  ) << "Cannot calculate edgeFacets" << abort(FatalError);
107  # endif
108 
110  }
111 
112  return *edgeFacetsPtr_;
113 }
114 
116 {
117  if( !pointEdgesPtr_ )
118  {
119  # ifdef USE_OMP
120  if( omp_in_parallel() )
122  (
123  "inline const VRWGraph& triSurfAddressing::pointEdges() const"
124  ) << "Cannot calculate pointEdges" << abort(FatalError);
125  # endif
126 
128  }
129 
130  return *pointEdgesPtr_;
131 }
132 
134 {
135  if( !facetFacetsEdgesPtr_ )
136  {
137  # ifdef USE_OMP
138  if( omp_in_parallel() )
140  (
141  "inline const VRWGraph& triSurfAddressing::facetFacets() const"
142  ) << "Cannot calculate facetFacets" << abort(FatalError);
143  # endif
144 
146  }
147 
148  return *facetFacetsEdgesPtr_;
149 }
150 
152 {
153  if( !pointNormalsPtr_ )
154  {
155  # ifdef USE_OMP
156  if( omp_in_parallel() )
158  (
159  "inline const vectorField&"
160  " triSurfAddressing::pointNormals() const"
161  ) << "Cannot calculate pointNormals" << abort(FatalError);
162  # endif
163 
165  }
166 
167  return *pointNormalsPtr_;
168 }
169 
171 {
172  if( !facetNormalsPtr_ )
173  {
174  # ifdef USE_OMP
175  if( omp_in_parallel() )
177  (
178  "inline const vectorField&"
179  " triSurfAddressing::facetNormals() const"
180  ) << "Cannot calculate facetNormals" << abort(FatalError);
181  # endif
182 
184  }
185 
186  return *facetNormalsPtr_;
187 }
188 
190 {
191  if( !facetCentresPtr_ )
192  {
193  # ifdef USE_OMP
194  if( omp_in_parallel() )
196  (
197  "inline const vectorField&"
198  " triSurfAddressing::facetCentres() const"
199  ) << "Cannot calculate facetCentres" << abort(FatalError);
200  # endif
201 
203  }
204 
205  return *facetCentresPtr_;
206 }
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 } // End namespace Foam
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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
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::calculateFacetCentres
void calculateFacetCentres() const
calculate centres of facets
Definition: triSurfAddressing.C:298
Foam::LongList< edge >
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
triSurfAddressing.H
Foam::triSurfAddressing::pointFacetsPtr_
VRWGraph * pointFacetsPtr_
facets connected to a point
Definition: triSurfAddressing.H:63
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::FatalError
error FatalError
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::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:131
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
Foam::triSurfAddressing::edges
const LongList< edge > & edges() const
return edges
Definition: triSurfAddressingI.H:61
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
FatalErrorIn
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:313
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::pointEdgesPtr_
VRWGraph * pointEdgesPtr_
labels of edges connected to a point
Definition: triSurfAddressing.H:75