Go to the documentation of this file.
63 if( orientationGroup[triI] != -1 )
66 orientationGroup[triI] = nGroups;
70 while( front.
size() != 0 )
78 const label edgeI = facetEdges(tLabel, eI);
85 const label neiFacetI = edgeFacets(edgeI, efI);
87 if( orientationGroup[neiFacetI] != -1 )
89 if( neiFacetI == tLabel )
102 if( facet[i] == neiFacet[j] )
107 if( sharedIndices.
size() == 2 )
109 const labelPair& pair0 = sharedIndices[0];
110 const labelPair& pair1 = sharedIndices[1];
111 if( ((pair0.
first() + 1) % 3) == pair1.
first() )
115 orientationGroup[neiFacetI] = nGroups;
123 orientationGroup[neiFacetI] = nGroups;
135 Info <<
"Found " << nGroups
136 <<
" groups of triangles with consistent orientation" <<
endl;
163 const label triI = helper[i];
165 triangleInLeaves(triI, ntl[triI]++) = leafI;
175 # pragma omp parallel if( surf.size() > 1000 ) private(helper)
183 # pragma omp for schedule(dynamic, 40)
185 forAll(orientationGroup, triI)
190 const scalar magN =
mag(
n);
201 const label leafI = triangleInLeaves(triI, tlI);
207 const label leafJ = helper[i];
213 const scalar length = 3.0 * oc.
size(rootBox);
222 const point endPos =
c + length *
n;
223 const point endNeg =
c - length *
n;
228 ++localVotes[orientationGroup[triI]].first();
233 ++localVotes[orientationGroup[triI]].second();
241 # pragma omp critical(grouping)
244 forAll(localVotes, groupI)
246 groupVotes[groupI].first() += localVotes[groupI].first();
247 groupVotes[groupI].second() += localVotes[groupI].second();
252 Info <<
"Before determining of orientation" <<
endl;
257 forAll(groupVotes, groupI)
259 if( groupVotes[groupI].first() > groupVotes[groupI].second() )
261 outwardGroup[groupI] = 1;
263 else if( groupVotes[groupI].first() < groupVotes[groupI].second() )
265 outwardGroup[groupI] = 2;
269 Info <<
"Here setting orientation" <<
endl;
290 # pragma omp parallel for schedule(dynamic, 20)
294 const edge&
e = featureEdges[feI];
298 if( edges[pointEdges(
e.start(), peI)] ==
e )
305 # pragma omp parallel for schedule(dynamic, 40)
317 const label f0 = edgeFacets(edgeI, 0);
318 const label f1 = edgeFacets(edgeI, 1);
332 if( tri0[pJ] == tri1[pI] )
357 const scalar vol = tet.
mag();
367 else if( vol > VSMALL )
385 else if( vol < -VSMALL )
vector normal(const pointField &) const
Vector normal; magnitude is equal to area of face.
void checkOrientation()
check the orientation of the patches in the triangulated surface
void append(const T &e)
Append an element at the end of the list.
void findAllLeafNeighbours(const meshOctreeCubeCoordinates &, DynList< label > &neighbourLeaves) const
find neighbour leaves over nodes, edges and faces
#define forAll(list, i)
Loop across all elements in list.
List< direction > edgeTypes_
flags for surface edges
point centre(const pointField &) const
Return centre (centroid)
Template functions to aid in the implementation of demand driven data.
const pointField & points() const
access to points
void containedTriangles(const label, DynList< label > &) const
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
dimensionedScalar pMin("pMin", dimPressure, fluid)
const Type & first() const
Return first.
List< direction > facetOrientation_
orientation of facet's normal (0 - unknown, 1- outward, 2- inward)
Ostream & endl(Ostream &os)
Add newline and flush stream.
direction cubeType() const
return type
label size() const
Size of the active part of the list.
dimensioned< scalar > mag(const dimensioned< Type > &)
const edgeLongList & featureEdges() const
access to feature edges
label numberOfLeaves() const
return leaves of the octree
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
label size() const
Returns the number of rows.
const Type & second() const
Return second.
#define forAllRow(graph, rowI, index)
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
const double e
Elementary charge.
bool boundBoxLineIntersection(const point &, const point &, const boundBox &)
check if the line intersects the bounding box
scalar size(const boundBox &) const
return size
void setSize(const label)
Reset size of List.
void classifyEdgesTypes()
classify edges based on the orientation of the surface facets
const boundBox & rootBox() const
return rootBox
An ordered pair of two objects of type <T> with first() and second() elements.
label region() const
Return region label.
label size() const
return the number of triangles
void setSize(const label)
Reset size of List.
const VRWGraph & facetEdges() const
return facet-edges addressing
const LongList< edge > & edges() const
return edges
Triangle with additional region number.
A bounding box defined in terms of the points at its extremities.
const dimensionedScalar c
Speed of light in a vacuum.
const meshOctree & octree_
reference to meshOctree
const triSurf & surface() const
return a reference to the surface
void cubeBox(const boundBox &, point &, point &) const
return min and max points
scalar mag() const
Return volume.
void setRowSize(const label rowI, const label newSize)
Reset the size of the given row.
const VRWGraph & edgeFacets() const
return edge-facets addressing
const VRWGraph & pointEdges() const
return point-edges addressing
const meshOctreeCubeBasic & returnLeaf(const label) const
Pair< label > labelPair
Label pair.
void clear()
Clear the list, i.e. set next free to zero.
void append(const T &e)
Append an element at the end of the list.