1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 template<class> class FaceList,
37 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
40 const FaceList<Face>& faces,
41 const Field<PointType>& points
44 FaceList<Face>(faces),
48 boundaryPointsPtr_(NULL),
56 meshPointMapPtr_(NULL),
58 localPointsPtr_(NULL),
59 localPointOrderPtr_(NULL),
60 faceCentresPtr_(NULL),
61 faceNormalsPtr_(NULL),
62 pointNormalsPtr_(NULL)
69 template<class> class FaceList,
73 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
76 FaceList<Face>& faces,
77 Field<PointType>& points,
81 FaceList<Face>(faces, reUse),
82 points_(points, reUse),
85 boundaryPointsPtr_(NULL),
93 meshPointMapPtr_(NULL),
95 localPointsPtr_(NULL),
96 localPointOrderPtr_(NULL),
97 faceCentresPtr_(NULL),
98 faceNormalsPtr_(NULL),
99 pointNormalsPtr_(NULL)
106 template<class> class FaceList,
110 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
113 const PrimitivePatch<Face, FaceList, PointField, PointType>& pp
116 PrimitivePatchName(),
121 boundaryPointsPtr_(NULL),
125 pointEdgesPtr_(NULL),
126 pointFacesPtr_(NULL),
127 localFacesPtr_(NULL),
128 meshPointsPtr_(NULL),
129 meshPointMapPtr_(NULL),
131 localPointsPtr_(NULL),
132 localPointOrderPtr_(NULL),
133 faceCentresPtr_(NULL),
134 faceNormalsPtr_(NULL),
135 pointNormalsPtr_(NULL)
139 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
144 template<class> class FaceList,
148 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
155 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
160 template<class> class FaceList,
165 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
168 const Field<PointType>&
173 Pout<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
175 << "recalculating PrimitivePatch geometry following mesh motion"
186 template<class> class FaceList,
190 const Foam::edgeList&
191 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
206 template<class> class FaceList,
211 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
212 nInternalEdges() const
219 return nInternalEdges_;
226 template<class> class FaceList,
230 const Foam::labelList&
231 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
232 boundaryPoints() const
234 if (!boundaryPointsPtr_)
239 return *boundaryPointsPtr_;
246 template<class> class FaceList,
250 const Foam::labelListList&
251 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
259 return *faceFacesPtr_;
266 template<class> class FaceList,
270 const Foam::labelListList&
271 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
279 return *edgeFacesPtr_;
286 template<class> class FaceList,
290 const Foam::labelListList&
291 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
299 return *faceEdgesPtr_;
306 template<class> class FaceList,
310 const Foam::labelListList&
311 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
319 return *pointEdgesPtr_;
326 template<class> class FaceList,
330 const Foam::labelListList&
331 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
339 return *pointFacesPtr_;
346 template<class> class FaceList,
350 const Foam::List<Face>&
351 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
359 return *localFacesPtr_;
366 template<class> class FaceList,
370 const Foam::labelList&
371 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
379 return *meshPointsPtr_;
386 template<class> class FaceList,
390 const Foam::Map<Foam::label>&
391 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
394 if (!meshPointMapPtr_)
399 return *meshPointMapPtr_;
406 template<class> class FaceList,
410 const Foam::Field<PointType>&
411 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
414 if (!localPointsPtr_)
419 return *localPointsPtr_;
426 template<class> class FaceList,
430 const Foam::labelList&
431 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
432 localPointOrder() const
434 if (!localPointOrderPtr_)
436 calcLocalPointOrder();
439 return *localPointOrderPtr_;
446 template<class> class FaceList,
451 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
457 Map<label>::const_iterator fnd = meshPointMap().find(gp);
459 if (fnd != meshPointMap().end())
474 template<class> class FaceList,
478 const Foam::Field<PointType>&
479 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
482 if (!faceCentresPtr_)
487 return *faceCentresPtr_;
494 template<class> class FaceList,
498 const Foam::Field<PointType>&
499 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
502 if (!faceNormalsPtr_)
507 return *faceNormalsPtr_;
514 template<class> class FaceList,
518 const Foam::Field<PointType>&
519 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
522 if (!pointNormalsPtr_)
527 return *pointNormalsPtr_;
531 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
536 template<class> class FaceList,
541 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
544 const PrimitivePatch<Face, FaceList, PointField, PointType>& pp
549 FaceList<Face>::operator=(pp);
553 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
555 #include "PrimitivePatchAddressing.C"
556 #include "PrimitivePatchEdgeLoops.C"
557 #include "PrimitivePatchClear.C"
558 #include "PrimitivePatchBdryPoints.C"
559 #include "PrimitivePatchLocalPointOrder.C"
560 #include "PrimitivePatchMeshData.C"
561 #include "PrimitivePatchMeshEdges.C"
562 #include "PrimitivePatchPointAddressing.C"
563 #include "PrimitivePatchProjectPoints.C"
564 #include "PrimitivePatchCheck.C"
566 // ************************************************************************* //