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 \*---------------------------------------------------------------------------*/
28 #include "mapPolyMesh.H"
30 #include "syncTools.H"
32 #include "addToRunTimeSelectionTable.H"
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 defineTypeNameAndDebug(pointSet, 0);
43 addToRunTimeSelectionTable(topoSet, pointSet, word);
44 addToRunTimeSelectionTable(topoSet, pointSet, size);
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 pointSet::pointSet(const IOobject& obj)
51 topoSet(obj, typeName)
63 topoSet(mesh, typeName, name, r, w)
65 check(mesh.nPoints());
77 topoSet(mesh, name, size, w)
85 const labelHashSet& set,
89 topoSet(mesh, name, set, w)
93 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 void pointSet::sync(const polyMesh& mesh)
103 // Convert to boolList
105 boolList contents(mesh.nPoints(), false);
107 forAllConstIter(pointSet, *this, iter)
109 contents[iter.key()] = true;
111 syncTools::syncPointList
117 false // no separation
120 // Convert back to labelHashSet
122 labelHashSet newContents(size());
124 forAll(contents, pointI)
126 if (contents[pointI])
128 newContents.insert(pointI);
132 transfer(newContents);
136 label pointSet::maxSize(const polyMesh& mesh) const
138 return mesh.nPoints();
142 void pointSet::updateMesh(const mapPolyMesh& morphMap)
144 updateLabels(morphMap.reversePointMap());
148 void pointSet::writeDebug
151 const primitiveMesh& mesh,
155 topoSet::writeDebug(os, mesh.points(), maxLen);
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
162 // ************************************************************************* //