1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 template<class> class FaceList,
39 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
42 debug::optimisationSwitch("nSquaredProjection", 0) > 0
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 template<class> class FaceList,
55 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
58 const FaceList<Face>& faces,
59 const Field<PointType>& points
62 FaceList<Face>(faces),
66 boundaryPointsPtr_(NULL),
74 meshPointMapPtr_(NULL),
76 localPointsPtr_(NULL),
77 localPointOrderPtr_(NULL),
78 faceCentresPtr_(NULL),
79 faceNormalsPtr_(NULL),
80 pointNormalsPtr_(NULL)
87 template<class> class FaceList,
91 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
94 FaceList<Face>& faces,
95 Field<PointType>& points,
99 FaceList<Face>(faces, reUse),
100 points_(points, reUse),
103 boundaryPointsPtr_(NULL),
107 pointEdgesPtr_(NULL),
108 pointFacesPtr_(NULL),
109 localFacesPtr_(NULL),
110 meshPointsPtr_(NULL),
111 meshPointMapPtr_(NULL),
113 localPointsPtr_(NULL),
114 localPointOrderPtr_(NULL),
115 faceCentresPtr_(NULL),
116 faceNormalsPtr_(NULL),
117 pointNormalsPtr_(NULL)
124 template<class> class FaceList,
128 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
131 const PrimitivePatch<Face, FaceList, PointField, PointType>& pp
134 PrimitivePatchName(),
139 boundaryPointsPtr_(NULL),
143 pointEdgesPtr_(NULL),
144 pointFacesPtr_(NULL),
145 localFacesPtr_(NULL),
146 meshPointsPtr_(NULL),
147 meshPointMapPtr_(NULL),
149 localPointsPtr_(NULL),
150 localPointOrderPtr_(NULL),
151 faceCentresPtr_(NULL),
152 faceNormalsPtr_(NULL),
153 pointNormalsPtr_(NULL)
157 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
162 template<class> class FaceList,
166 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
173 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
178 template<class> class FaceList,
183 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
186 const Field<PointType>&
191 Pout<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
193 << "recalculating PrimitivePatch geometry following mesh motion"
204 template<class> class FaceList,
208 const Foam::edgeList&
209 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
224 template<class> class FaceList,
229 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
230 nInternalEdges() const
237 return nInternalEdges_;
244 template<class> class FaceList,
248 const Foam::labelList&
249 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
250 boundaryPoints() const
252 if (!boundaryPointsPtr_)
257 return *boundaryPointsPtr_;
264 template<class> class FaceList,
268 const Foam::labelListList&
269 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
277 return *faceFacesPtr_;
284 template<class> class FaceList,
288 const Foam::labelListList&
289 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
297 return *edgeFacesPtr_;
304 template<class> class FaceList,
308 const Foam::labelListList&
309 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
317 return *faceEdgesPtr_;
324 template<class> class FaceList,
328 const Foam::labelListList&
329 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
337 return *pointEdgesPtr_;
344 template<class> class FaceList,
348 const Foam::labelListList&
349 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
357 return *pointFacesPtr_;
364 template<class> class FaceList,
368 const Foam::List<Face>&
369 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
377 return *localFacesPtr_;
384 template<class> class FaceList,
388 const Foam::labelList&
389 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
397 return *meshPointsPtr_;
404 template<class> class FaceList,
408 const Foam::Map<Foam::label>&
409 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
412 if (!meshPointMapPtr_)
417 return *meshPointMapPtr_;
424 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,
448 const Foam::labelList&
449 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
450 localPointOrder() const
452 if (!localPointOrderPtr_)
454 calcLocalPointOrder();
457 return *localPointOrderPtr_;
464 template<class> class FaceList,
469 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
475 Map<label>::const_iterator fnd = meshPointMap().find(gp);
477 if (fnd != meshPointMap().end())
492 template<class> class FaceList,
496 const Foam::Field<PointType>&
497 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
500 if (!faceCentresPtr_)
505 return *faceCentresPtr_;
512 template<class> class FaceList,
516 const Foam::Field<PointType>&
517 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
520 if (!faceNormalsPtr_)
525 return *faceNormalsPtr_;
532 template<class> class FaceList,
536 const Foam::Field<PointType>&
537 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
540 if (!pointNormalsPtr_)
545 return *pointNormalsPtr_;
549 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
554 template<class> class FaceList,
559 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
562 const PrimitivePatch<Face, FaceList, PointField, PointType>& pp
567 FaceList<Face>::operator=(pp);
571 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
573 #include "PrimitivePatchAddressing.C"
574 #include "PrimitivePatchEdgeLoops.C"
575 #include "PrimitivePatchClear.C"
576 #include "PrimitivePatchBdryPoints.C"
577 #include "PrimitivePatchLocalPointOrder.C"
578 #include "PrimitivePatchMeshData.C"
579 #include "PrimitivePatchMeshEdges.C"
580 #include "PrimitivePatchPointAddressing.C"
581 #include "PrimitivePatchProjectPoints.C"
582 #include "PrimitivePatchCheck.C"
584 // ************************************************************************* //