1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
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.
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
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/>.
28 Topology modifiers and queries useful for mesh generation
32 \*---------------------------------------------------------------------------*/
34 #ifndef helperFunctionsTopologyManipulation_H
35 #define helperFunctionsTopologyManipulation_H
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Namespace help functions Declaration
49 \*---------------------------------------------------------------------------*/
53 //- check if the faces are equal
54 template<class faceType1, class faceType2>
55 bool areFacesEqual(const faceType1& f1, const faceType2& f2);
57 //- local position of element in a list
58 template<class T, class ListType>
59 label positionInList(const T& elmt, const ListType& l);
62 template<class faceType>
63 faceType reverseFace(const faceType& f);
65 //- returns a merged face
66 template<class faceType1, class faceType2>
67 inline face mergeTwoFaces
73 //- remove edges until faces share only one edge
74 inline edgeList modifyFacesToShareOneEdge(face& f1, face& f2);
76 //- create a face from the removed part
77 inline face createFaceFromRemovedPart(const face& fOrig, const face& fCut);
79 //- remove edges from face
80 inline face removeEdgesFromFace
83 const DynList<edge>& removeEdges
86 //- find open edges for a set of faces forming a cell
87 inline void findOpenEdges
89 const faceList& cellFaces,
90 DynList<edge>& openEdges
93 //- check if two faces share an edge
94 template<class faceType1, class faceType2>
95 inline bool shareAnEdge(const faceType1& f1, const faceType2& f2);
97 //- return the edge shared by the faces
98 template<class faceType1, class faceType2>
99 inline edge sharedEdge(const faceType1& f1, const faceType2& f2);
101 //- return the position of edge in the face, -1 otherwise
102 template<class faceType>
103 inline label positionOfEdgeInFace(const edge& e, const faceType& f);
105 //- check if two faces share a vertex
106 template<class faceType1, class faceType2>
107 inline bool shareAVertex(const faceType1& f1, const faceType2& f2);
109 //- shared vertex of two faces
110 template<class faceType1, class faceType2>
111 inline label sharedVertex(const faceType1& f1, const faceType2& f2);
113 //- find a vertex label common to all faces in the list
114 template<class faceListType>
115 inline label sharedVertex(const faceListType& fcs);
117 //- check if selected elements are in one singly-connected chain
118 template<class boolListType>
119 inline bool areElementsInChain(const boolListType& sel);
121 //- sort the edge chain such that the end of one edge is the beginning
122 //- of the next one (valid for singly-connected chains, only)
123 inline labelList sortEdgeChain(const DynList<edge>& bEdges);
125 //- creates closed edge chains from the open chain
126 inline void zipOpenChain(DynList<edge>& bEdges);
128 } // End namespace help
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 } // End namespace Foam
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 #include "helperFunctionsTopologyManipulationI.H"
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 // ************************************************************************* //