1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM 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 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 template<class> class FaceList,
38 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
41 const FaceList<Face>& faces,
42 const Field<PointType>& points
45 FaceList<Face>(faces),
49 boundaryPointsPtr_(NULL),
57 meshPointMapPtr_(NULL),
59 localPointsPtr_(NULL),
60 localPointOrderPtr_(NULL),
61 faceCentresPtr_(NULL),
62 faceNormalsPtr_(NULL),
63 pointNormalsPtr_(NULL)
70 template<class> class FaceList,
74 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
77 FaceList<Face>& faces,
78 Field<PointType>& points,
82 FaceList<Face>(faces, reUse),
83 points_(points, reUse),
86 boundaryPointsPtr_(NULL),
94 meshPointMapPtr_(NULL),
96 localPointsPtr_(NULL),
97 localPointOrderPtr_(NULL),
98 faceCentresPtr_(NULL),
99 faceNormalsPtr_(NULL),
100 pointNormalsPtr_(NULL)
107 template<class> class FaceList,
111 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
114 const PrimitivePatch<Face, FaceList, PointField, PointType>& pp
117 PrimitivePatchName(),
122 boundaryPointsPtr_(NULL),
126 pointEdgesPtr_(NULL),
127 pointFacesPtr_(NULL),
128 localFacesPtr_(NULL),
129 meshPointsPtr_(NULL),
130 meshPointMapPtr_(NULL),
132 localPointsPtr_(NULL),
133 localPointOrderPtr_(NULL),
134 faceCentresPtr_(NULL),
135 faceNormalsPtr_(NULL),
136 pointNormalsPtr_(NULL)
140 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
145 template<class> class FaceList,
149 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
156 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
161 template<class> class FaceList,
166 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
169 const Field<PointType>&
174 Pout<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
176 << "recalculating PrimitivePatch geometry following mesh motion"
187 template<class> class FaceList,
191 const Foam::edgeList&
192 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
207 template<class> class FaceList,
212 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
213 nInternalEdges() const
220 return nInternalEdges_;
227 template<class> class FaceList,
231 const Foam::labelList&
232 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
233 boundaryPoints() const
235 if (!boundaryPointsPtr_)
240 return *boundaryPointsPtr_;
247 template<class> class FaceList,
251 const Foam::labelListList&
252 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
260 return *faceFacesPtr_;
267 template<class> class FaceList,
271 const Foam::labelListList&
272 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
280 return *edgeFacesPtr_;
287 template<class> class FaceList,
291 const Foam::labelListList&
292 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
300 return *faceEdgesPtr_;
307 template<class> class FaceList,
311 const Foam::labelListList&
312 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
320 return *pointEdgesPtr_;
327 template<class> class FaceList,
331 const Foam::labelListList&
332 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
340 return *pointFacesPtr_;
347 template<class> class FaceList,
351 const Foam::List<Face>&
352 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
360 return *localFacesPtr_;
367 template<class> class FaceList,
371 const Foam::labelList&
372 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
380 return *meshPointsPtr_;
387 template<class> class FaceList,
391 const Foam::Map<Foam::label>&
392 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
395 if (!meshPointMapPtr_)
400 return *meshPointMapPtr_;
407 template<class> class FaceList,
411 const Foam::Field<PointType>&
412 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
415 if (!localPointsPtr_)
420 return *localPointsPtr_;
427 template<class> class FaceList,
431 const Foam::labelList&
432 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
433 localPointOrder() const
435 if (!localPointOrderPtr_)
437 calcLocalPointOrder();
440 return *localPointOrderPtr_;
447 template<class> class FaceList,
452 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
458 Map<label>::const_iterator fnd = meshPointMap().find(gp);
460 if (fnd != meshPointMap().end())
475 template<class> class FaceList,
479 const Foam::Field<PointType>&
480 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
483 if (!faceCentresPtr_)
488 return *faceCentresPtr_;
495 template<class> class FaceList,
499 const Foam::Field<PointType>&
500 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
503 if (!faceNormalsPtr_)
508 return *faceNormalsPtr_;
515 template<class> class FaceList,
519 const Foam::Field<PointType>&
520 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
523 if (!pointNormalsPtr_)
528 return *pointNormalsPtr_;
532 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
537 template<class> class FaceList,
542 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
545 const PrimitivePatch<Face, FaceList, PointField, PointType>& pp
550 FaceList<Face>::operator=(pp);
554 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
556 #include "PrimitivePatchAddressing.C"
557 #include "PrimitivePatchEdgeLoops.C"
558 #include "PrimitivePatchClear.C"
559 #include "PrimitivePatchBdryPoints.C"
560 #include "PrimitivePatchLocalPointOrder.C"
561 #include "PrimitivePatchMeshData.C"
562 #include "PrimitivePatchMeshEdges.C"
563 #include "PrimitivePatchPointAddressing.C"
564 #include "PrimitivePatchProjectPoints.C"
565 #include "PrimitivePatchCheck.C"
567 // ************************************************************************* //