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 "cellToCell.H"
30 #include "addToRunTimeSelectionTable.H"
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 defineTypeNameAndDebug(cellToCell, 0);
39 addToRunTimeSelectionTable(topoSetSource, cellToCell, word);
41 addToRunTimeSelectionTable(topoSetSource, cellToCell, istream);
46 Foam::topoSetSource::addToUsageTable Foam::cellToCell::usage_
49 "\n Usage: cellToCell <cellSet>\n\n"
50 " Select all cells in the cellSet\n\n"
54 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
56 // Construct from components
57 Foam::cellToCell::cellToCell
68 // Construct from dictionary
69 Foam::cellToCell::cellToCell
72 const dictionary& dict
76 setName_(dict.lookup("set"))
80 // Construct from Istream
81 Foam::cellToCell::cellToCell
92 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
94 Foam::cellToCell::~cellToCell()
98 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100 void Foam::cellToCell::applyToSet
102 const topoSetSource::setAction action,
106 if ((action == topoSetSource::ADD) || (action == topoSetSource::NEW))
108 Info<< " Adding all elements of cellSet " << setName_ << " ..."
112 cellSet loadedSet(mesh_, setName_);
114 set.addSet(loadedSet);
116 else if (action == topoSetSource::DELETE)
118 Info<< " Removing all elements of cellSet " << setName_ << " ..."
122 cellSet loadedSet(mesh_, setName_);
124 set.deleteSet(loadedSet);
129 // ************************************************************************* //