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
00027
00028
00029 #include "PrimitivePatch_.H"
00030 #include <OpenFOAM/SLList.H>
00031
00032
00033
00034
00035 template
00036 <
00037 class Face,
00038 template<class> class FaceList,
00039 class PointField,
00040 class PointType
00041 >
00042 void
00043 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00044 calcPointEdges() const
00045 {
00046 if (debug)
00047 {
00048 Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
00049 << "calcPointEdges() : calculating pointEdges"
00050 << endl;
00051 }
00052
00053 if (pointEdgesPtr_)
00054 {
00055
00056
00057 FatalErrorIn
00058 (
00059 "PrimitivePatch<Face, FaceList, PointField, PointType>::"
00060 "calcPointEdges()"
00061 ) << "pointEdges already calculated"
00062 << abort(FatalError);
00063 }
00064
00065 const edgeList& e = edges();
00066
00067
00068 List<SLList<label> > pointEdges(meshPoints().size());
00069
00070 forAll (e, edgeI)
00071 {
00072 pointEdges[e[edgeI].start()].append(edgeI);
00073 pointEdges[e[edgeI].end()].append(edgeI);
00074 }
00075
00076
00077 pointEdgesPtr_ = new labelListList(pointEdges.size());
00078
00079 labelListList& pe = *pointEdgesPtr_;
00080
00081 forAll (pointEdges, pointI)
00082 {
00083 pe[pointI].setSize(pointEdges[pointI].size());
00084
00085 label i = 0;
00086 for
00087 (
00088 SLList<label>::iterator curEdgesIter = pointEdges[pointI].begin();
00089 curEdgesIter != pointEdges[pointI].end();
00090 ++curEdgesIter, ++i
00091 )
00092 {
00093 pe[pointI][i] = curEdgesIter();
00094 }
00095 }
00096
00097 if (debug)
00098 {
00099 Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
00100 << "calcPointEdges() finished calculating pointEdges"
00101 << endl;
00102 }
00103 }
00104
00105
00106 template
00107 <
00108 class Face,
00109 template<class> class FaceList,
00110 class PointField,
00111 class PointType
00112 >
00113 void
00114 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00115 calcPointFaces() const
00116 {
00117 if (debug)
00118 {
00119 Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
00120 << "calcPointFaces() : calculating pointFaces"
00121 << endl;
00122 }
00123
00124 if (pointFacesPtr_)
00125 {
00126
00127
00128 FatalErrorIn
00129 (
00130 "PrimitivePatch<Face, FaceList, PointField, PointType>::"
00131 "calcPointFaces()"
00132 ) << "pointFaces already calculated"
00133 << abort(FatalError);
00134 }
00135
00136 const List<Face>& f = localFaces();
00137
00138
00139 List<SLList<label> > pointFcs(meshPoints().size());
00140
00141 forAll (f, faceI)
00142 {
00143 const Face& curPoints = f[faceI];
00144
00145 forAll (curPoints, pointI)
00146 {
00147 pointFcs[curPoints[pointI]].append(faceI);
00148 }
00149 }
00150
00151
00152 pointFacesPtr_ = new labelListList(pointFcs.size());
00153
00154 labelListList& pf = *pointFacesPtr_;
00155
00156 forAll (pointFcs, pointI)
00157 {
00158 pf[pointI].setSize(pointFcs[pointI].size());
00159
00160 label i = 0;
00161 for
00162 (
00163 SLList<label>::iterator curFacesIter = pointFcs[pointI].begin();
00164 curFacesIter != pointFcs[pointI].end();
00165 ++curFacesIter, ++i
00166 )
00167 {
00168 pf[pointI][i] = curFacesIter();
00169 }
00170 }
00171
00172 if (debug)
00173 {
00174 Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
00175 << "calcPointFaces() finished calculating pointFaces"
00176 << endl;
00177 }
00178 }
00179
00180
00181