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
27 \*---------------------------------------------------------------------------*/
29 #include "labelToPoint.H"
32 #include "addToRunTimeSelectionTable.H"
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 defineTypeNameAndDebug(labelToPoint, 0);
41 addToRunTimeSelectionTable(topoSetSource, labelToPoint, word);
43 addToRunTimeSelectionTable(topoSetSource, labelToPoint, istream);
48 Foam::topoSetSource::addToUsageTable Foam::labelToPoint::usage_
50 labelToPoint::typeName,
51 "\n Usage: labelToPoint (i0 i1 .. in)\n\n"
52 " Select points by label\n\n"
56 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
58 void Foam::labelToPoint::combine(topoSet& set, const bool add) const
60 forAll(labels_, labelI)
62 addOrDelete(set, labels_[labelI], add);
67 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
69 // Construct from components
70 Foam::labelToPoint::labelToPoint
73 const labelList& labels
81 // Construct from dictionary
82 Foam::labelToPoint::labelToPoint
85 const dictionary& dict
89 labels_(dict.lookup("value"))
93 // Construct from Istream
94 Foam::labelToPoint::labelToPoint
105 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
107 Foam::labelToPoint::~labelToPoint()
111 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
113 void Foam::labelToPoint::applyToSet
115 const topoSetSource::setAction action,
119 if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
121 Info<< " Adding points mentioned in dictionary" << " ..." << endl;
125 else if (action == topoSetSource::DELETE)
127 Info<< " Removing points mentioned in dictionary" << " ..."
135 // ************************************************************************* //