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 \*---------------------------------------------------------------------------*/
27 #include "labelToCell.H"
30 #include "addToRunTimeSelectionTable.H"
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 defineTypeNameAndDebug(labelToCell, 0);
39 addToRunTimeSelectionTable(topoSetSource, labelToCell, word);
41 addToRunTimeSelectionTable(topoSetSource, labelToCell, istream);
46 Foam::topoSetSource::addToUsageTable Foam::labelToCell::usage_
48 labelToCell::typeName,
49 "\n Usage: labelToCell (i0 i1 .. in)\n\n"
50 " Select cells by cellLabel\n\n"
54 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
56 void Foam::labelToCell::combine(topoSet& set, const bool add) const
58 forAll(labels_, labelI)
60 addOrDelete(set, labels_[labelI], add);
65 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
67 // Construct from components
68 Foam::labelToCell::labelToCell
71 const labelList& labels
79 // Construct from dictionary
80 Foam::labelToCell::labelToCell
83 const dictionary& dict
87 labels_(dict.lookup("value"))
91 // Construct from Istream
92 Foam::labelToCell::labelToCell
103 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
105 Foam::labelToCell::~labelToCell()
109 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
111 void Foam::labelToCell::applyToSet
113 const topoSetSource::setAction action,
117 if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
119 Info<< " Adding cells mentioned in dictionary" << " ..." << endl;
123 else if (action == topoSetSource::DELETE)
125 Info<< " Removing cells mentioned in dictionary" << " ..." << endl;
132 // ************************************************************************* //