extendedEdgeMeshI.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) 2011-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 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
27 
29 {
30  return convexStart_;
31 }
32 
33 
35 {
36  return concaveStart_;
37 }
38 
39 
41 {
42  return mixedStart_;
43 }
44 
45 
47 {
48  return nonFeatureStart_;
49 }
50 
51 
53 {
54  return externalStart_;
55 }
56 
57 
59 {
60  return internalStart_;
61 }
62 
63 
65 {
66  return flatStart_;
67 }
68 
69 
71 {
72  return openStart_;
73 }
74 
75 
77 {
78  return multipleStart_;
79 }
80 
81 
83 {
84  return ptI < nonFeatureStart_;
85 }
86 
87 
89 {
90  return normals_;
91 }
92 
93 
96 {
97  return normalVolumeTypes_;
98 }
99 
100 
102 const
103 {
104  return edgeDirections_;
105 }
106 
107 
108 inline const Foam::labelListList&
110 {
111  return normalDirections_;
112 }
113 
114 
116 (
117  label edgeI,
118  label ptI
119 ) const
120 {
121  const edge& e = edges()[edgeI];
122 
123  if (ptI == e.start())
124  {
125  return edgeDirections()[edgeI];
126  }
127  else if (ptI == e.end())
128  {
129  return -edgeDirections()[edgeI];
130  }
131  else
132  {
134  << "Requested ptI " << ptI << " is not a point on the requested "
135  << "edgeI " << edgeI << ". edgeI start and end: "
136  << e.start() << " " << e.end()
137  << exit(FatalError);
138 
139  return Zero;
140  }
141 }
142 
143 
145 const
146 {
147  return edgeNormals_;
148 }
149 
150 
152 (
153  const labelList& edgeNormIs
154 ) const
155 {
156  vectorField norms(edgeNormIs.size());
157 
158  forAll(edgeNormIs, i)
159  {
160  norms[i] = normals_[edgeNormIs[i]];
161  }
162 
163  return norms;
164 }
165 
166 
168 const
169 {
170  return edgeNormals(edgeNormals_[edgeI]);
171 }
172 
173 
174 inline const Foam::labelListList&
176 {
177  return featurePointNormals_;
178 }
179 
180 
182 (
183  label ptI
184 ) const
185 {
186  if (!featurePoint(ptI))
187  {
189  << "Requesting the normals of a non-feature point. "
190  << "Returned zero length vectorField."
191  << endl;
192 
193  return vectorField(0);
194  }
195 
196  labelList featPtNormIs(featurePointNormals_[ptI]);
197 
198  vectorField norms(featPtNormIs.size());
199 
200  forAll(featPtNormIs, i)
201  {
202  norms[i] = normals_[featPtNormIs[i]];
203  }
204 
205  return norms;
206 }
207 
208 
209 inline const Foam::labelListList&
211 {
212  return featurePointEdges_;
213 }
214 
215 
217 {
218  return regionEdges_;
219 }
220 
221 
224 {
225  if (ptI < concaveStart_)
226  {
227  return CONVEX;
228  }
229  else if (ptI < mixedStart_)
230  {
231  return CONCAVE;
232  }
233  else if (ptI < nonFeatureStart_)
234  {
235  return MIXED;
236  }
237  else
238  {
239  return NONFEATURE;
240  }
241 }
242 
243 
246 {
247  if (edgeI < internalStart_)
248  {
249  return EXTERNAL;
250  }
251  else if (edgeI < flatStart_)
252  {
253  return INTERNAL;
254  }
255  else if (edgeI < openStart_)
256  {
257  return FLAT;
258  }
259  else if (edgeI < multipleStart_)
260  {
261  return OPEN;
262  }
263  else
264  {
265  return MULTIPLE;
266  }
267 }
268 
269 
271 (
272  label edgeI
273 ) const
274 {
275  const labelList& eNormals = edgeNormals_[edgeI];
276 
277  DynamicList<label> edgeBaffles(eNormals.size());
278 
279  forAll(eNormals, enI)
280  {
281  const label normI = eNormals[enI];
282 
283  if (normalVolumeTypes_[normI])
284  {
285  edgeBaffles.append(normI);
286  }
287  }
288 
289  return PackedList<2>(edgeBaffles);
290 }
291 
292 
293 // ************************************************************************* //
label nonFeatureStart() const
Return the index of the start of the non-feature points.
pointStatus getPointStatus(label ptI) const
Return the pointStatus of a specified point.
label convexStart() const
Return the index of the start of the convex feature points.
const labelListList & featurePointNormals() const
Return the indices of the normals that are adjacent to the.
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
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
vectorField normals_
Normals of the features, to be referred to by index by both feature.
const labelListList & edgeNormals() const
Return the indices of the normals that are adjacent to the.
const labelListList & normalDirections() const
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:323
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
label mixedStart_
Index of the start of the mixed type feature points.
const List< sideVolumeType > & normalVolumeTypes() const
Return.
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
label multipleStart() const
Return the index of the start of the multiply-connected feature.
label openStart_
Index of the start of the open feature edges.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
bool featurePoint(label ptI) const
Return whether or not the point index is a feature point.
const vectorField & normals() const
Return the normals of the surfaces adjacent to the feature edges.
label concaveStart_
Index of the start of the concave feature points.
label openStart() const
Return the index of the start of the open feature edges.
List< sideVolumeType > normalVolumeTypes_
Type per normal: which side of normal to mesh.
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
edgeStatus getEdgeStatus(label edgeI) const
Return the edgeStatus of a specified edge.
label internalStart_
Index of the start of the internal feature edges.
labelListList normalDirections_
Starting directions for the edges.
label flatStart() const
Return the index of the start of the flat feature edges.
labelList regionEdges_
Feature edges which are on the boundary between regions.
static label convexStart_
Index of the start of the convex feature points - static as 0.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:58
label internalStart() const
Return the index of the start of the internal feature edges.
label flatStart_
Index of the start of the flat feature edges.
const edgeList & edges() const
Return edges.
Definition: edgeMeshI.H:68
static label externalStart_
Index of the start of the external feature edges - static as 0.
static const zero Zero
Definition: zero.H:97
label mixedStart() const
Return the index of the start of the mixed type feature points.
label externalStart() const
Return the index of the start of the external feature edges.
PackedList< 2 > edgeBaffles(label edgeI) const
Return the baffle faces of a specified edge.
const labelListList & featurePointEdges() const
Return the edge labels for a given feature point. Edges are.
PackedList< nBits > & append(const unsigned int val)
Append a value at the end of the list.
Definition: PackedListI.H:1022
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
label multipleStart_
Index of the start of the multiply-connected feature edges.
#define WarningInFunction
Report a warning using Foam::Warning.
label end() const
Return end vertex label.
Definition: edgeI.H:92
labelListList featurePointEdges_
Indices of feature edges attached to feature points. The edges are.
Field< vector > vectorField
Specialisation of Field<T> for vector.
const doubleScalar e
Elementary charge.
Definition: doubleScalar.H:105
labelListList featurePointNormals_
Indices of the normals that are adjacent to the feature points.
labelListList edgeNormals_
Indices of the normals that are adjacent to the feature edges.
label nonFeatureStart_
Index of the start of the non-feature points.
vector edgeDirection(label edgeI, label ptI) const
Return the direction of edgeI, pointing away from ptI.
vectorField edgeDirections_
Flat and open edges require the direction of the edge.
label start() const
Return start vertex label.
Definition: edgeI.H:81
label concaveStart() const
Return the index of the start of the concave feature points.