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 \*---------------------------------------------------------------------------*/
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);
45 addToRunTimeSelectionTable(topoSet, pointSet, set);
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 pointSet::pointSet(const IOobject& obj)
52 topoSet(obj, typeName)
64 topoSet(mesh, typeName, name, r, w)
66 check(mesh.nPoints());
78 topoSet(mesh, name, size, w)
90 topoSet(mesh, name, set, w)
98 const labelHashSet& set,
102 topoSet(mesh, name, set, w)
106 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
108 pointSet::~pointSet()
112 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
114 void pointSet::sync(const polyMesh& mesh)
116 // Convert to boolList
118 boolList contents(mesh.nPoints(), false);
120 forAllConstIter(pointSet, *this, iter)
122 contents[iter.key()] = true;
124 syncTools::syncPointList
130 false // no separation
133 // Convert back to labelHashSet
135 labelHashSet newContents(size());
137 forAll(contents, pointI)
139 if (contents[pointI])
141 newContents.insert(pointI);
145 transfer(newContents);
149 label pointSet::maxSize(const polyMesh& mesh) const
151 return mesh.nPoints();
155 void pointSet::updateMesh(const mapPolyMesh& morphMap)
157 updateLabels(morphMap.reversePointMap());
161 void pointSet::writeDebug
164 const primitiveMesh& mesh,
168 topoSet::writeDebug(os, mesh.points(), maxLen);
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 } // End namespace Foam
175 // ************************************************************************* //