1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 template<class> class FaceList,
38 const Foam::debug::optimisationSwitch
39 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52 template<class> class FaceList,
56 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
59 const FaceList<Face>& faces,
60 const Field<PointType>& points
63 FaceList<Face>(faces),
67 boundaryPointsPtr_(NULL),
75 meshPointMapPtr_(NULL),
77 localPointsPtr_(NULL),
78 localPointOrderPtr_(NULL),
79 faceCentresPtr_(NULL),
80 faceNormalsPtr_(NULL),
81 pointNormalsPtr_(NULL)
89 template<class> class FaceList,
93 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
96 FaceList<Face>& faces,
97 Field<PointType>& points,
101 FaceList<Face>(faces, reUse),
102 points_(points, reUse),
105 boundaryPointsPtr_(NULL),
109 pointEdgesPtr_(NULL),
110 pointFacesPtr_(NULL),
111 localFacesPtr_(NULL),
112 meshPointsPtr_(NULL),
113 meshPointMapPtr_(NULL),
115 localPointsPtr_(NULL),
116 localPointOrderPtr_(NULL),
117 faceCentresPtr_(NULL),
118 faceNormalsPtr_(NULL),
119 pointNormalsPtr_(NULL)
126 template<class> class FaceList,
130 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
133 const PrimitivePatch<Face, FaceList, PointField, PointType>& pp
136 PrimitivePatchName(),
141 boundaryPointsPtr_(NULL),
145 pointEdgesPtr_(NULL),
146 pointFacesPtr_(NULL),
147 localFacesPtr_(NULL),
148 meshPointsPtr_(NULL),
149 meshPointMapPtr_(NULL),
151 localPointsPtr_(NULL),
152 localPointOrderPtr_(NULL),
153 faceCentresPtr_(NULL),
154 faceNormalsPtr_(NULL),
155 pointNormalsPtr_(NULL)
159 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
164 template<class> class FaceList,
168 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
175 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
180 template<class> class FaceList,
185 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
188 const Field<PointType>&
193 Pout<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
195 << "recalculating PrimitivePatch geometry following mesh motion"
206 template<class> class FaceList,
210 const Foam::edgeList&
211 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
226 template<class> class FaceList,
231 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
232 nInternalEdges() const
239 return nInternalEdges_;
246 template<class> class FaceList,
250 const Foam::labelList&
251 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
252 boundaryPoints() const
254 if (!boundaryPointsPtr_)
259 return *boundaryPointsPtr_;
266 template<class> class FaceList,
270 const Foam::labelListList&
271 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
279 return *faceFacesPtr_;
286 template<class> class FaceList,
290 const Foam::labelListList&
291 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
299 return *edgeFacesPtr_;
306 template<class> class FaceList,
310 const Foam::labelListList&
311 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
319 return *faceEdgesPtr_;
326 template<class> class FaceList,
330 const Foam::labelListList&
331 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
339 return *pointEdgesPtr_;
346 template<class> class FaceList,
350 const Foam::labelListList&
351 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
359 return *pointFacesPtr_;
366 template<class> class FaceList,
370 const Foam::List<Face>&
371 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
379 return *localFacesPtr_;
386 template<class> class FaceList,
390 const Foam::labelList&
391 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
399 return *meshPointsPtr_;
406 template<class> class FaceList,
410 const Foam::Map<Foam::label>&
411 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
414 if (!meshPointMapPtr_)
419 return *meshPointMapPtr_;
426 template<class> class FaceList,
430 const Foam::Field<PointType>&
431 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
434 if (!localPointsPtr_)
439 return *localPointsPtr_;
446 template<class> class FaceList,
450 const Foam::labelList&
451 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
452 localPointOrder() const
454 if (!localPointOrderPtr_)
456 calcLocalPointOrder();
459 return *localPointOrderPtr_;
466 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,
498 const Foam::Field<PointType>&
499 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
502 if (!faceCentresPtr_)
507 return *faceCentresPtr_;
514 template<class> class FaceList,
518 const Foam::Field<PointType>&
519 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
522 if (!faceNormalsPtr_)
527 return *faceNormalsPtr_;
534 template<class> class FaceList,
538 const Foam::Field<PointType>&
539 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
542 if (!pointNormalsPtr_)
547 return *pointNormalsPtr_;
551 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
556 template<class> class FaceList,
561 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
564 const PrimitivePatch<Face, FaceList, PointField, PointType>& pp
569 FaceList<Face>::operator=(pp);
573 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
575 #include "PrimitivePatchAddressing.C"
576 #include "PrimitivePatchEdgeLoops.C"
577 #include "PrimitivePatchClear.C"
578 #include "PrimitivePatchBdryPoints.C"
579 #include "PrimitivePatchLocalPointOrder.C"
580 #include "PrimitivePatchMeshData.C"
581 #include "PrimitivePatchMeshEdges.C"
582 #include "PrimitivePatchPointAddressing.C"
583 #include "PrimitivePatchProjectPoints.C"
584 #include "PrimitivePatchCheck.C"
586 // ************************************************************************* //