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 "faceToPoint.H"
33 #include "addToRunTimeSelectionTable.H"
35 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 defineTypeNameAndDebug(faceToPoint, 0);
42 addToRunTimeSelectionTable(topoSetSource, faceToPoint, word);
44 addToRunTimeSelectionTable(topoSetSource, faceToPoint, istream);
49 Foam::topoSetSource::addToUsageTable Foam::faceToPoint::usage_
51 faceToPoint::typeName,
52 "\n Usage: faceToPoint <faceSet> all\n\n"
53 " Select all points of faces in the faceSet\n\n"
57 const char* Foam::NamedEnum<Foam::faceToPoint::faceAction, 1>::names[] =
62 const Foam::NamedEnum<Foam::faceToPoint::faceAction, 1>
63 Foam::faceToPoint::faceActionNames_;
66 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
68 void Foam::faceToPoint::combine(topoSet& set, const bool add) const
71 faceSet loadedSet(mesh_, setName_);
73 // Add all points from faces in loadedSet
76 faceSet::const_iterator iter = loadedSet.begin();
77 iter != loadedSet.end();
81 const face& f = mesh_.faces()[iter.key()];
85 addOrDelete(set, f[fp], add);
91 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
93 // Construct from components
94 Foam::faceToPoint::faceToPoint
98 const faceAction option
107 // Construct from dictionary
108 Foam::faceToPoint::faceToPoint
110 const polyMesh& mesh,
111 const dictionary& dict
115 setName_(dict.lookup("set")),
116 option_(faceActionNames_.read(dict.lookup("option")))
120 // Construct from Istream
121 Foam::faceToPoint::faceToPoint
123 const polyMesh& mesh,
128 setName_(checkIs(is)),
129 option_(faceActionNames_.read(checkIs(is)))
133 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
135 Foam::faceToPoint::~faceToPoint()
139 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
141 void Foam::faceToPoint::applyToSet
143 const topoSetSource::setAction action,
147 if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
149 Info<< " Adding points from face in faceSet " << setName_
154 else if (action == topoSetSource::DELETE)
156 Info<< " Removing points from face in faceSet " << setName_
164 // ************************************************************************* //