34 template<
class>
class FaceList,
44 Pout<<
"PrimitivePatch<Face, FaceList, PointField, PointType>::"
46 "calculating mesh data in PrimitivePatch"
52 if (meshPointsPtr_ || localFacesPtr_)
55 <<
"meshPointsPtr_ or localFacesPtr_already allocated"
61 Map<label> markedPoints(4*this->size());
97 DynamicList<label> meshPoints(2*this->size());
100 const Face& curPoints = this->operator[](facei);
104 if (markedPoints.insert(curPoints[pointi], meshPoints.size()))
106 meshPoints.append(curPoints[pointi]);
111 meshPointsPtr_ =
new labelList(meshPoints,
true);
122 const Face& curFace = this->operator[](facei);
123 lf[facei].setSize(curFace.size());
127 lf[facei][
labelI] = markedPoints.find(curFace[
labelI])();
133 Pout<<
"PrimitivePatch<Face, FaceList, PointField, PointType>::"
135 "finished calculating mesh data in PrimitivePatch"
144 template<
class>
class FaceList,
154 Pout<<
"PrimitivePatch<Face, FaceList, PointField, PointType>::"
155 "calcMeshPointMap() : "
156 "calculating mesh point map in PrimitivePatch"
162 if (meshPointMapPtr_)
165 <<
"meshPointMapPtr_ already allocated"
171 meshPointMapPtr_ =
new Map<label>(2*
mp.size());
172 Map<label>& mpMap = *meshPointMapPtr_;
176 mpMap.insert(
mp[i], i);
181 Pout<<
"PrimitivePatch<Face, FaceList, PointField, PointType>::"
182 "calcMeshPointMap() : "
183 "finished calculating mesh point map in PrimitivePatch"
192 template<
class>
class FaceList,
202 Pout<<
"PrimitivePatch<Face, FaceList, PointField, PointType>::"
203 "calcLocalPoints() : "
204 "calculating localPoints in PrimitivePatch"
213 <<
"localPointsPtr_already allocated"
219 localPointsPtr_ =
new Field<PointType>(meshPts.size());
221 Field<PointType>& locPts = *localPointsPtr_;
225 locPts[pointi] = points_[meshPts[pointi]];
230 Pout<<
"PrimitivePatch<Face, FaceList, PointField, PointType>::"
231 <<
"calcLocalPoints() : "
232 <<
"finished calculating localPoints in PrimitivePatch"
241 template<
class>
class FaceList,
251 Pout<<
"PrimitivePatch<Face, FaceList, PointField, PointType>::"
252 "calcPointNormals() : "
253 "calculating pointNormals in PrimitivePatch"
259 if (pointNormalsPtr_)
262 <<
"pointNormalsPtr_already allocated"
266 const Field<PointType>& faceUnitNormals = faceNormals();
270 pointNormalsPtr_ =
new Field<PointType>
276 Field<PointType>&
n = *pointNormalsPtr_;
280 PointType& curNormal =
n[pointi];
286 curNormal += faceUnitNormals[curFaces[facei]];
289 curNormal /=
mag(curNormal) + VSMALL;
294 Pout<<
"PrimitivePatch<Face, FaceList, PointField, PointType>::"
295 "calcPointNormals() : "
296 "finished calculating pointNormals in PrimitivePatch"
305 template<
class>
class FaceList,
315 Pout<<
"PrimitivePatch<Face, FaceList, PointField, PointType>::"
316 "calcFaceCentres() : "
317 "calculating faceCentres in PrimitivePatch"
326 <<
"faceCentresPtr_already allocated"
330 faceCentresPtr_ =
new Field<PointType>(this->size());
332 Field<PointType>&
c = *faceCentresPtr_;
336 c[facei] = this->operator[](facei).centre(points_);
341 Pout<<
"PrimitivePatch<Face, FaceList, PointField, PointType>::"
342 "calcFaceCentres() : "
343 "finished calculating faceCentres in PrimitivePatch"
352 template<
class>
class FaceList,
362 Pout<<
"PrimitivePatch<Face, FaceList, PointField, PointType>::"
363 "calcFaceNormals() : "
364 "calculating faceNormals in PrimitivePatch"
373 <<
"faceNormalsPtr_already allocated"
377 faceNormalsPtr_ =
new Field<PointType>(this->size());
379 Field<PointType>&
n = *faceNormalsPtr_;
383 n[facei] = this->operator[](facei).normal(points_);
384 n[facei] /=
mag(
n[facei]) + VSMALL;
389 Pout<<
"PrimitivePatch<Face, FaceList, PointField, PointType>::"
390 "calcFaceNormals() : "
391 "finished calculating faceNormals in PrimitivePatch"