Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "PrimitivePatch_.H"
00027
00028
00029
00030
00031 template
00032 <
00033 class Face,
00034 template<class> class FaceList,
00035 class PointField,
00036 class PointType
00037 >
00038 Foam::labelList
00039 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00040 meshEdges
00041 (
00042 const edgeList& allEdges,
00043 const labelListList& cellEdges,
00044 const labelList& faceCells
00045 ) const
00046 {
00047 if (debug)
00048 {
00049 Info<< "labelList PrimitivePatch<Face, FaceList, PointField, PointType>"
00050 << "::meshEdges() : "
00051 << "calculating labels of patch edges in mesh edge list"
00052 << endl;
00053 }
00054
00055
00056 const edgeList& PatchEdges = edges();
00057
00058 const labelListList& EdgeFaces = edgeFaces();
00059
00060
00061 labelList meshEdges(PatchEdges.size());
00062
00063 register bool found = false;
00064
00065
00066 const labelList& pp = meshPoints();
00067
00068
00069
00070 forAll (PatchEdges, edgeI)
00071 {
00072 const edge curEdge
00073 (pp[PatchEdges[edgeI].start()], pp[PatchEdges[edgeI].end()]);
00074
00075 found = false;
00076
00077
00078 const labelList& curFaces = EdgeFaces[edgeI];
00079
00080 forAll (curFaces, faceI)
00081 {
00082
00083 label curCell = faceCells[curFaces[faceI]];
00084
00085
00086 const labelList& ce = cellEdges[curCell];
00087
00088 forAll (ce, cellEdgeI)
00089 {
00090 if (allEdges[ce[cellEdgeI]] == curEdge)
00091 {
00092 found = true;
00093
00094 meshEdges[edgeI] = ce[cellEdgeI];
00095
00096 break;
00097 }
00098 }
00099
00100 if (found) break;
00101 }
00102 }
00103
00104 return meshEdges;
00105 }
00106
00107
00108 template
00109 <
00110 class Face,
00111 template<class> class FaceList,
00112 class PointField,
00113 class PointType
00114 >
00115 Foam::labelList
00116 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00117 meshEdges
00118 (
00119 const edgeList& allEdges,
00120 const labelListList& pointEdges
00121 ) const
00122 {
00123 if (debug)
00124 {
00125 Info<< "labelList PrimitivePatch<Face, FaceList, PointField, PointType>"
00126 << "::meshEdges() : "
00127 << "calculating labels of patch edges in mesh edge list"
00128 << endl;
00129 }
00130
00131
00132 const edgeList& PatchEdges = edges();
00133
00134
00135 labelList meshEdges(PatchEdges.size());
00136
00137
00138 const labelList& pp = meshPoints();
00139
00140
00141
00142 forAll (PatchEdges, edgeI)
00143 {
00144 const label globalPointI = pp[PatchEdges[edgeI].start()];
00145 const edge curEdge(globalPointI, pp[PatchEdges[edgeI].end()]);
00146
00147 const labelList& pe = pointEdges[globalPointI];
00148
00149 forAll (pe, i)
00150 {
00151 if (allEdges[pe[i]] == curEdge)
00152 {
00153 meshEdges[edgeI] = pe[i];
00154 break;
00155 }
00156 }
00157 }
00158
00159 return meshEdges;
00160 }
00161
00162
00163
00164
00165 template
00166 <
00167 class Face,
00168 template<class> class FaceList,
00169 class PointField,
00170 class PointType
00171 >
00172 Foam::label
00173 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00174 whichEdge
00175 (
00176 const edge& e
00177 ) const
00178 {
00179
00180 const edgeList& Edges = edges();
00181
00182 if (e.start() > -1 && e.start() < nPoints())
00183 {
00184 const labelList& pe = pointEdges()[e.start()];
00185
00186 forAll (pe, peI)
00187 {
00188 if (e == Edges[pe[peI]])
00189 {
00190 return pe[peI];
00191 }
00192 }
00193 }
00194
00195
00196 return -1;
00197 }
00198
00199
00200