From ee7a5233e77a6108a3babb2b939914e44b9d016b Mon Sep 17 00:00:00 2001 From: Pascal Beckstein Date: Wed, 10 Feb 2016 18:15:52 +0100 Subject: [PATCH] Added ALL option for cellSource pointToCell of meshTools --- .../cellSources/pointToCell/pointToCell.C | 62 +++++++++++++++++-- .../cellSources/pointToCell/pointToCell.H | 6 +- 2 files changed, 59 insertions(+), 9 deletions(-) diff --git a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C index 7c78a1db2..d522a722c 100644 --- a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C +++ b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C @@ -46,18 +46,21 @@ addToRunTimeSelectionTable(topoSetSource, pointToCell, istream); Foam::topoSetSource::addToUsageTable Foam::pointToCell::usage_ ( pointToCell::typeName, - "\n Usage: pointToCell any\n\n" - " Select all cells with any point in the pointSet\n\n" + "\n Usage: pointToCell any|all\n\n" + " Select cells with\n" + " -any point in the pointSet\n" + " -all points in the pointSet\n\n" ); template<> -const char* Foam::NamedEnum::names[] = +const char* Foam::NamedEnum::names[] = { - "any" + "any", + "all" }; -const Foam::NamedEnum +const Foam::NamedEnum Foam::pointToCell::pointActionNames_; @@ -69,9 +72,9 @@ void Foam::pointToCell::combine(topoSet& set, const bool add) const pointSet loadedSet(mesh_, setName_); - // Handle any selection if (option_ == ANY) { + // Add cells with any point in loadedSet for ( pointSet::const_iterator iter = loadedSet.begin(); @@ -89,6 +92,53 @@ void Foam::pointToCell::combine(topoSet& set, const bool add) const } } } + else if (option_ == ALL) + { + // Add all cells whose points are all in set. + + Map