1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
27 #include "mapPolyMesh.H"
29 #include "syncTools.H"
31 #include "addToRunTimeSelectionTable.H"
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 defineTypeNameAndDebug(pointSet, 0);
42 addToRunTimeSelectionTable(topoSet, pointSet, word);
43 addToRunTimeSelectionTable(topoSet, pointSet, size);
44 addToRunTimeSelectionTable(topoSet, pointSet, set);
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)
89 topoSet(mesh, name, set, w)
97 const labelHashSet& set,
101 topoSet(mesh, name, set, w)
105 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
107 pointSet::~pointSet()
111 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
113 void pointSet::sync(const polyMesh& mesh)
115 // Convert to boolList
117 boolList contents(mesh.nPoints(), false);
119 forAllConstIter(pointSet, *this, iter)
121 contents[iter.key()] = true;
123 syncTools::syncPointList
131 // Convert back to labelHashSet
133 labelHashSet newContents(size());
135 forAll(contents, pointI)
137 if (contents[pointI])
139 newContents.insert(pointI);
143 transfer(newContents);
147 label pointSet::maxSize(const polyMesh& mesh) const
149 return mesh.nPoints();
153 void pointSet::updateMesh(const mapPolyMesh& morphMap)
155 updateLabels(morphMap.reversePointMap());
159 void pointSet::writeDebug
162 const primitiveMesh& mesh,
166 topoSet::writeDebug(os, mesh.points(), maxLen);
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 } // End namespace Foam
173 // ************************************************************************* //