Go to the documentation of this file.
45 template<
class faceType1,
class faceType2>
49 if(
f1.size() != f2.size() )
55 bool equalOrientation(
false);
63 if(
f1[1] == f2[(pI+1)%
s] )
66 equalOrientation =
true;
68 else if(
f1[1] != f2[(
s-1+pI)%
s] )
79 if( equalOrientation )
84 if(
f1[pI] != f2[(pI+start)%
s] )
93 if(
f1[pI] != f2[(start+
s-pI)%
s] )
102 template<
class T,
class ListType >
105 for(
label i=0;i<l.size();++i)
112 template<
class faceType>
116 rf.setSize(
f.size());
120 const label size =
f.size();
121 for(
label i=1;i<size;++i)
122 rf[
f.size()-i] =
f[i];
127 template<
class faceType1,
class faceType2>
142 const edge e2(f2[eJ], f2[f2.fcIndex(eJ)]);
167 const edge e2(f2[eI], f2[f2.fcIndex(eI)]);
184 label nSharedEdges(0);
188 if( edg1[eI] == edg2[eJ] )
190 sharedEdges.
newElmt(nSharedEdges++) = edg1[eI];
200 if( !(she1[pI] && she1[(pI-1+
f1.size())%
f1.size()]) )
209 if( !(she2[pI] && she2[(pI-1+f2.
size())%f2.
size()]) )
215 sharedEdges.
setSize(nSharedEdges);
221 if( fCut.
size() == 0 )
231 if( eOrig[eI] == eCut[eJ] )
241 if( !(usedEdge[pI] && usedEdge[(pI-1+fOrig.
size())%fOrig.
size()]) )
261 if( removeEdges[reI] == fOrig.
faceEdge(eI) )
263 foundEdge[eI] =
true;
271 if( !(foundEdge[pI] && foundEdge[fOrig.rcIndex(pI)]) )
272 newF[i++] = fOrig[pI];
286 const edgeList edges = cellFaces[fI].edges();
294 cellEdges.
append(edges[eI]);
308 if( nAppearances[eI] == 1 )
310 openEdges.
append(cellEdges[eI]);
312 else if( nAppearances[eI] > 2 )
316 "void findOpenEdges(const faceList& cellFaces,"
317 "DynList<edge>& openEdges)"
318 ) <<
"More than two faces in " << cellFaces
323 template<
class faceType1,
class faceType2>
332 const edge e2(f2[eJ], f2[f2.fcIndex(eJ)]);
342 template<
class faceType1,
class faceType2>
351 const edge e2(f2[eJ], f2[f2.fcIndex(eJ)]);
361 template<
class faceType>
366 const edge fe(
f[eI],
f[
f.fcIndex(eI)]);
375 template<
class faceType1,
class faceType2>
380 if(
f1[pI] == f2[pJ] )
386 template<
class faceType1,
class faceType2>
391 if(
f1[pI] == f2[pJ] )
397 template<
class faceListType>
404 for(
label i=1;i<fcs.size();++i)
408 if( fcs[0][pI] == fcs[i][pJ] )
425 template<
class boolListType>
434 selInChain[eI] =
true;
441 !selInChain[eJ] && sel[eJ] &&
443 selInChain[sel.fcIndex(eJ)] ||
444 selInChain[sel.rcIndex(eJ)]
449 selInChain[eJ] =
true;
459 if( sel[eI] && !selInChain[eI] )
473 const edge&
e = bEdges[eI];
480 nAppearances[chainVertices.
size()] = 1;
493 if( nAppearances[pI] == 1 )
496 openVertices.
append(chainVertices[pI]);
499 if( !closed && (openVertices.
size() == 2) )
502 if( bEdges[eI].end() == openVertices[0] )
504 bEdges.
append(
edge(openVertices[0], openVertices[1]));
507 else if( bEdges[eI].end() == openVertices[1] )
509 bEdges.
append(
edge(openVertices[1], openVertices[0]));
517 "void dualMeshExtractor::decomposeCreatedPoly::"
518 "createMissingFaces(List<faceList>& cFaces)"
519 ) <<
"Chain has " << openVertices <<
" open vertices"
529 sortedEdges.
append(bEdges[0]);
541 if( sortedEdges[i].end() == bEdges[eI].start() )
545 sortedEdges.
append(bEdges[eI]);
548 else if( sortedEdges[i].end() == bEdges[eI].end() )
552 "labelList sortEdgeChain("
553 "const DynList<edge>& bEdges)"
554 ) <<
"Chain is not oriented correctly!"
558 }
while( !finished );
562 sortPoints[eI] = sortedEdges[eI].start();
edge sharedEdge(const faceType1 &f1, const faceType2 &f2)
return the edge shared by the faces
label positionInList(const T &elmt, const ListType &l)
local position of element in a list
#define forAll(list, i)
Loop across all elements in list.
edge faceEdge(const label n) const
Return n-th face edge.
bool areFacesEqual(const faceType1 &f1, const faceType2 &f2)
check if the faces are equal
T & newElmt(const label)
Return subscript-checked element of UList.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
labelList sortEdgeChain(const DynList< edge > &bEdges)
bool shareAVertex(const faceType1 &f1, const faceType2 &f2)
check if two faces share a vertex
face createFaceFromRemovedPart(const face &fOrig, const face &fCut)
create a face from the removed part
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
edgeList modifyFacesToShareOneEdge(face &f1, face &f2)
remove edges until faces share only one edge
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
face removeEdgesFromFace(const face &fOrig, const DynList< edge > &removeEdges)
remove edges from face
label sharedVertex(const faceType1 &f1, const faceType2 &f2)
shared vertex of two faces
face mergeTwoFaces(const faceType1 &f1, const faceType2 &f2)
returns a merged face
edgeList edges() const
Return edges in face point ordering,.
bool areElementsInChain(const boolListType &sel)
check if selected elements are in one singly-connected chain
errorManip< error > abort(error &err)
const double e
Elementary charge.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
void setSize(const label)
Reset size of List.
label containsAtPosition(const T &e) const
void zipOpenChain(DynList< edge > &bEdges)
creates closed edge chains from the open chain
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label)
Reset size of List.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
void findOpenEdges(const faceList &cellFaces, DynList< edge > &openEdges)
find open edges for a set of faces forming a cell
faceType reverseFace(const faceType &f)
reverse the face
void clear()
Clear the list, i.e. set next free to zero.
label positionOfEdgeInFace(const edge &e, const faceType &f)
return the position of edge in the face, -1 otherwise
bool shareAnEdge(const faceType1 &f1, const faceType2 &f2)
check if two faces share an edge
void append(const T &e)
Append an element at the end of the list.
dimensionedScalar pos(const dimensionedScalar &ds)