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