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