/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
#include "zoneToPoint.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(zoneToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, zoneToPoint, word);
addToRunTimeSelectionTable(topoSetSource, zoneToPoint, istream);
addToRunTimeSelectionTable(topoSetPointSource, zoneToPoint, word);
addToRunTimeSelectionTable(topoSetPointSource, zoneToPoint, istream);
addNamedToRunTimeSelectionTable
(
topoSetPointSource,
zoneToPoint,
word,
zone
);
addNamedToRunTimeSelectionTable
(
topoSetPointSource,
zoneToPoint,
istream,
zone
);
}
Foam::topoSetSource::addToUsageTable Foam::zoneToPoint::usage_
(
zoneToPoint::typeName,
"\n Usage: zoneToPoint zone\n\n"
" Select all points in the pointZone."
" Note:accepts wildcards for zone.\n\n"
);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::zoneToPoint::combine
(
topoSet& set,
const labelUList& zoneIDs,
const bool add,
const bool verbosity
) const
{
const label nZones = mesh_.pointZones().size();
if (zoneIDs.empty() || !nZones)
{
return; // Nothing to do
}
for (const label zonei : zoneIDs)
{
if (zonei < 0 || zonei >= nZones)
{
continue;
}
const auto& zone = mesh_.pointZones()[zonei];
if (verbosity)
{
Info<< " Using zone " << zone.name() << " with "
<< returnReduce(zone.size(), sumOp