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 \*---------------------------------------------------------------------------*/
26 #include "labelToPoint.H"
29 #include "addToRunTimeSelectionTable.H"
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
36 defineTypeNameAndDebug(labelToPoint, 0);
38 addToRunTimeSelectionTable(topoSetSource, labelToPoint, word);
40 addToRunTimeSelectionTable(topoSetSource, labelToPoint, istream);
45 Foam::topoSetSource::addToUsageTable Foam::labelToPoint::usage_
47 labelToPoint::typeName,
48 "\n Usage: labelToPoint (i0 i1 .. in)\n\n"
49 " Select points by label\n\n"
53 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
55 void Foam::labelToPoint::combine(topoSet& set, const bool add) const
57 forAll(labels_, labelI)
59 addOrDelete(set, labels_[labelI], add);
64 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
66 // Construct from components
67 Foam::labelToPoint::labelToPoint
70 const labelList& labels
78 // Construct from dictionary
79 Foam::labelToPoint::labelToPoint
82 const dictionary& dict
86 labels_(dict.lookup("value"))
90 // Construct from Istream
91 Foam::labelToPoint::labelToPoint
102 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
104 Foam::labelToPoint::~labelToPoint()
108 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
110 void Foam::labelToPoint::applyToSet
112 const topoSetSource::setAction action,
116 if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
118 Info<< " Adding points mentioned in dictionary" << " ..." << endl;
122 else if (action == topoSetSource::DELETE)
124 Info<< " Removing points mentioned in dictionary" << " ..."
132 // ************************************************************************* //