1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Copyright held by the original author
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
11 cfMesh 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 cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "polyMeshGenAddressing.H"
27 #include "VRWGraphSMPModifier.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
36 void polyMeshGenAddressing::calcPointFaces() const
40 FatalErrorIn("polyMeshGenAddressing::calcPointFaces()")
41 << "pointFaces already calculated"
46 const faceListPMG& faces = mesh_.faces();
47 const label nPoints = mesh_.points().size();
49 //- create the addressing
50 pfPtr_ = new VRWGraph();
51 VRWGraph& pointFaceAddr = *pfPtr_;
53 VRWGraphSMPModifier(pointFaceAddr).reverseAddressing(faces);
54 pointFaceAddr.setSize(nPoints);
58 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
60 const VRWGraph& polyMeshGenAddressing::pointFaces() const
65 if( omp_in_parallel() )
68 "const VRWGraph& polyMeshGenAddressing::pointFaces() const"
69 ) << "Calculating addressing inside a parallel region."
70 << " This is not thread safe" << exit(FatalError);
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 } // End namespace Foam
84 // ************************************************************************* //