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 * * * * * * * * * * * * * * //
31 // Construct from components
35 template<class> class FaceList,
40 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
43 const FaceList<Face>& faces,
44 const Field<PointType>& points
47 FaceList<Face>(faces),
51 boundaryPointsPtr_(NULL),
59 meshPointMapPtr_(NULL),
61 localPointsPtr_(NULL),
62 localPointOrderPtr_(NULL),
63 faceNormalsPtr_(NULL),
64 pointNormalsPtr_(NULL)
68 // Construct from components
72 template<class> class FaceList,
77 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
80 FaceList<Face>& faces,
81 Field<PointType>& points,
85 FaceList<Face>(faces, reUse),
86 points_(points, reUse),
89 boundaryPointsPtr_(NULL),
97 meshPointMapPtr_(NULL),
99 localPointsPtr_(NULL),
100 localPointOrderPtr_(NULL),
101 faceNormalsPtr_(NULL),
102 pointNormalsPtr_(NULL)
110 template<class> class FaceList,
115 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
118 const PrimitivePatch<Face, FaceList, PointField, PointType>& pp
121 PrimitivePatchName(),
126 boundaryPointsPtr_(NULL),
130 pointEdgesPtr_(NULL),
131 pointFacesPtr_(NULL),
132 localFacesPtr_(NULL),
133 meshPointsPtr_(NULL),
134 meshPointMapPtr_(NULL),
136 localPointsPtr_(NULL),
137 localPointOrderPtr_(NULL),
138 faceNormalsPtr_(NULL),
139 pointNormalsPtr_(NULL)
143 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
148 template<class> class FaceList,
153 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::~PrimitivePatch()
159 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
161 // Correct patch after moving points
165 template<class> class FaceList,
171 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
174 const Field<PointType>&
179 Pout<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
181 << "recalculating PrimitivePatch geometry following mesh motion"
192 template<class> class FaceList,
197 const Foam::edgeList&
198 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
213 template<class> class FaceList,
219 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
220 nInternalEdges() const
227 return nInternalEdges_;
234 template<class> class FaceList,
239 const Foam::labelList&
240 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
241 boundaryPoints() const
243 if (!boundaryPointsPtr_)
248 return *boundaryPointsPtr_;
255 template<class> class FaceList,
260 const Foam::labelListList&
261 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
269 return *faceFacesPtr_;
276 template<class> class FaceList,
281 const Foam::labelListList&
282 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
290 return *edgeFacesPtr_;
297 template<class> class FaceList,
302 const Foam::labelListList&
303 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
311 return *faceEdgesPtr_;
318 template<class> class FaceList,
323 const Foam::labelListList&
324 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
332 return *pointEdgesPtr_;
339 template<class> class FaceList,
344 const Foam::labelListList&
345 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
353 return *pointFacesPtr_;
360 template<class> class FaceList,
365 const Foam::List<Face>&
366 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
374 return *localFacesPtr_;
381 template<class> class FaceList,
386 const Foam::labelList&
387 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
395 return *meshPointsPtr_;
402 template<class> class FaceList,
407 const Foam::Map<Foam::label>&
408 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
411 if (!meshPointMapPtr_)
416 return *meshPointMapPtr_;
423 template<class> class FaceList,
428 const Foam::Field<PointType>&
429 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
432 if (!localPointsPtr_)
437 return *localPointsPtr_;
444 template<class> class FaceList,
449 const Foam::labelList&
450 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
451 localPointOrder() const
453 if (!localPointOrderPtr_)
455 calcLocalPointOrder();
458 return *localPointOrderPtr_;
465 template<class> class FaceList,
471 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
477 Map<label>::const_iterator fnd = meshPointMap().find(gp);
479 if (fnd != meshPointMap().end())
494 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,
520 const Foam::Field<PointType>&
521 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
524 if (!pointNormalsPtr_)
529 return *pointNormalsPtr_;
533 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
538 template<class> class FaceList,
544 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
547 const PrimitivePatch<Face, FaceList, PointField, PointType>& pp
552 FaceList<Face>::operator=(pp);
555 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
557 #include "PrimitivePatchAddressing.C"
558 #include "PrimitivePatchEdgeLoops.C"
559 #include "PrimitivePatchClear.C"
560 #include "PrimitivePatchBdryPoints.C"
561 #include "PrimitivePatchLocalPointOrder.C"
562 #include "PrimitivePatchMeshData.C"
563 #include "PrimitivePatchMeshEdges.C"
564 #include "PrimitivePatchPointAddressing.C"
565 #include "PrimitivePatchProjectPoints.C"
566 #include "PrimitivePatchCheck.C"
568 // ************************************************************************* //