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 "faceToPoint.H"
31 #include "addToRunTimeSelectionTable.H"
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
38 defineTypeNameAndDebug(faceToPoint, 0);
40 addToRunTimeSelectionTable(topoSetSource, faceToPoint, word);
42 addToRunTimeSelectionTable(topoSetSource, faceToPoint, istream);
47 Foam::topoSetSource::addToUsageTable Foam::faceToPoint::usage_
49 faceToPoint::typeName,
50 "\n Usage: faceToPoint <faceSet> all\n\n"
51 " Select all points of faces in the faceSet\n\n"
55 const char* Foam::NamedEnum<Foam::faceToPoint::faceAction, 1>::names[] =
60 const Foam::NamedEnum<Foam::faceToPoint::faceAction, 1>
61 Foam::faceToPoint::faceActionNames_;
64 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
66 void Foam::faceToPoint::combine(topoSet& set, const bool add) const
69 faceSet loadedSet(mesh_, setName_);
71 // Add all points from faces in loadedSet
74 faceSet::const_iterator iter = loadedSet.begin();
75 iter != loadedSet.end();
79 const face& f = mesh_.faces()[iter.key()];
83 addOrDelete(set, f[fp], add);
89 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
91 // Construct from components
92 Foam::faceToPoint::faceToPoint
96 const faceAction option
105 // Construct from dictionary
106 Foam::faceToPoint::faceToPoint
108 const polyMesh& mesh,
109 const dictionary& dict
113 setName_(dict.lookup("set")),
114 option_(faceActionNames_.read(dict.lookup("option")))
118 // Construct from Istream
119 Foam::faceToPoint::faceToPoint
121 const polyMesh& mesh,
126 setName_(checkIs(is)),
127 option_(faceActionNames_.read(checkIs(is)))
131 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
133 Foam::faceToPoint::~faceToPoint()
137 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
139 void Foam::faceToPoint::applyToSet
141 const topoSetSource::setAction action,
145 if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
147 Info<< " Adding points from face in faceSet " << setName_
152 else if (action == topoSetSource::DELETE)
154 Info<< " Removing points from face in faceSet " << setName_
162 // ************************************************************************* //