From c2e58dca64a86f8e32347a916fc8c6ee8090f830 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 29 Oct 2018 12:54:30 +0000 Subject: [PATCH 01/10] ENH: support multiple zones for topo set sources (#1060) - uses the keywords 'zones' and 'zone' to avoid potential conflicts with a named topoSet action, but accepts 'name' for compatibility. --- .../mesh/manipulation/topoSet/topoSetDict | 4 ++- .../faceZoneToCell/faceZoneToCell.C | 33 ++++++++++++------ .../faceZoneToCell/faceZoneToCell.H | 21 +++++++----- .../sets/cellSources/zoneToCell/zoneToCell.C | 31 +++++++++++------ .../sets/cellSources/zoneToCell/zoneToCell.H | 27 ++++++++------- .../setToCellZone/setToCellZone.H | 2 +- .../sets/faceSources/zoneToFace/zoneToFace.C | 34 ++++++++++++------- .../sets/faceSources/zoneToFace/zoneToFace.H | 27 ++++++++------- .../pointSources/zoneToPoint/zoneToPoint.C | 31 +++++++++++------ .../pointSources/zoneToPoint/zoneToPoint.H | 27 ++++++++------- .../sets/topoSetSource/topoSetSource.C | 6 +--- .../heatExchanger/system/air/topoSetDict.1 | 2 +- .../heatExchanger/system/air/topoSetDict.2 | 12 +------ .../flange/system/topoSetDict-background | 10 +++--- .../laminar/sphereDrop/system/topoSetDict | 6 ++-- .../RAS/mixerVessel2D/system/topoSetDict | 2 +- .../laminar/mixerVessel2D/system/topoSetDict | 2 +- .../mixerVessel2D/system/topoSetDict | 2 +- .../laminar/mixerVessel2D/system/topoSetDict | 2 +- .../boatAndPropeller/system/topoSetDictHull | 22 ++++++------ .../system/topoSetDictPropeller | 22 ++++++------ .../boatAndPropeller/system/topoSetDictRudder | 22 ++++++------ .../laminar/mixerVessel2D/system/topoSetDict | 2 +- .../laminar/mixerVessel2D/system/topoSetDict | 2 +- .../laminar/mixerVessel2D/system/topoSetDict | 2 +- 25 files changed, 195 insertions(+), 158 deletions(-) diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSetDict b/applications/utilities/mesh/manipulation/topoSet/topoSetDict index 66302acdfa..d3eb9f805f 100644 --- a/applications/utilities/mesh/manipulation/topoSet/topoSetDict +++ b/applications/utilities/mesh/manipulation/topoSet/topoSetDict @@ -63,7 +63,9 @@ FoamFile // source faceZoneToCell; // sourceInfo // { -// name ".*Zone"; // Name of faceZone, regular expressions allowed +// zones (".*Zone"); // Name of faceZone, regular expressions allowed +// // OR zone ".*Zone"; // Name of faceZone, regular expressions allowed +// // OR name ".*Zone"; // Name of faceZone, regular expressions allowed // option master; // master/slave // } // diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C index 8b10efb06a..68c81f2267 100644 --- a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C +++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C @@ -65,7 +65,7 @@ void Foam::faceZoneToCell::combine(topoSet& set, const bool add) const for (const faceZone& zone : mesh_.faceZones()) { - if (zoneName_.match(zone.name())) + if (selectedZones_.match(zone.name())) { hasMatched = true; @@ -77,8 +77,8 @@ void Foam::faceZoneToCell::combine(topoSet& set, const bool add) const ); Info<< " Found matching zone " << zone.name() - << " with " << cellLabels.size() << " cells on selected side." - << endl; + << " with " << cellLabels.size() << " cells on " + << faceActionNames_[option_] << " side" << endl; for (const label celli : cellLabels) { @@ -94,7 +94,8 @@ void Foam::faceZoneToCell::combine(topoSet& set, const bool add) const if (!hasMatched) { WarningInFunction - << "Cannot find any faceZone named " << zoneName_ << nl + << "Cannot find any faceZone matching " + << flatOutput(selectedZones_) << nl << "Valid names: " << flatOutput(mesh_.faceZones().names()) << endl; } @@ -106,12 +107,12 @@ void Foam::faceZoneToCell::combine(topoSet& set, const bool add) const Foam::faceZoneToCell::faceZoneToCell ( const polyMesh& mesh, - const word& zoneName, + const wordRe& zoneName, const faceAction option ) : topoSetSource(mesh), - zoneName_(zoneName), + selectedZones_(one(), zoneName), option_(option) {} @@ -123,9 +124,17 @@ Foam::faceZoneToCell::faceZoneToCell ) : topoSetSource(mesh), - zoneName_(dict.get("name")), + selectedZones_(), option_(faceActionNames_.get("option", dict)) -{} +{ + // Look for 'zones' and 'zone', but accept 'name' as well + if (!dict.readIfPresent("zones", selectedZones_)) + { + selectedZones_.resize(1); + selectedZones_.first() = + dict.getCompat("zone", {{"name", 1806}}); + } +} Foam::faceZoneToCell::faceZoneToCell @@ -135,7 +144,7 @@ Foam::faceZoneToCell::faceZoneToCell ) : topoSetSource(mesh), - zoneName_(checkIs(is)), + selectedZones_(one(), wordRe(checkIs(is))), option_(faceActionNames_.read(checkIs(is))) {} @@ -151,14 +160,16 @@ void Foam::faceZoneToCell::applyToSet if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) { Info<< " Adding all " << faceActionNames_[option_] - << " cells of faceZone " << zoneName_ << " ..." << endl; + << " cells of face zones " + << flatOutput(selectedZones_) << " ..." << endl; combine(set, true); } else if (action == topoSetSource::DELETE) { Info<< " Removing all " << faceActionNames_[option_] - << " cells of faceZone " << zoneName_ << " ..." << endl; + << " cells of face zones " + << flatOutput(selectedZones_) << " ..." << endl; combine(set, false); } diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.H b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.H index 3096d7ddf7..33f24e706b 100644 --- a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.H +++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.H @@ -29,11 +29,16 @@ Description \heading Dictionary parameters \table - Property | Description | Required | Default - name | The face zone name or regex | yes | - option | Selection type (master / slave) | yes | + Property | Description | Required | Default + option | Selection type (master / slave) | yes | + zone | The face zone name or regex | possibly | + zones | The face zone names or regexs | possibly | + name | Older specification for 'zone' | no | \endtable +Note + Selection of multiple zones has precedence. + SourceFiles faceZoneToCell.C @@ -43,7 +48,7 @@ SourceFiles #define faceZoneToCell_H #include "topoSetSource.H" -#include "wordRe.H" +#include "wordRes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -75,8 +80,8 @@ private: //- Add usage string static addToUsageTable usage_; - //- Name/regular expression of faceZone - wordRe zoneName_; + //- Matcher for face zones + wordRes selectedZones_; //- Option faceAction option_; @@ -98,7 +103,7 @@ public: faceZoneToCell ( const polyMesh& mesh, - const word& zoneName, + const wordRe& zoneName, const faceAction option ); @@ -115,7 +120,7 @@ public: // Member Functions - virtual sourceType setType() const + virtual topoSetSource::sourceType setType() const { return CELLSETSOURCE; } diff --git a/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C b/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C index ee3e616b25..8170f94c13 100644 --- a/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C +++ b/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C @@ -54,7 +54,7 @@ void Foam::zoneToCell::combine(topoSet& set, const bool add) const for (const cellZone& zone : mesh_.cellZones()) { - if (zoneName_.match(zone.name())) + if (selectedZones_.match(zone.name())) { hasMatched = true; @@ -77,7 +77,8 @@ void Foam::zoneToCell::combine(topoSet& set, const bool add) const if (!hasMatched) { WarningInFunction - << "Cannot find any cellZone named " << zoneName_ << nl + << "Cannot find any cellZone matching " + << flatOutput(selectedZones_) << nl << "Valid names: " << flatOutput(mesh_.cellZones().names()) << endl; } @@ -89,11 +90,11 @@ void Foam::zoneToCell::combine(topoSet& set, const bool add) const Foam::zoneToCell::zoneToCell ( const polyMesh& mesh, - const word& zoneName + const wordRe& zoneName ) : topoSetSource(mesh), - zoneName_(zoneName) + selectedZones_(one(), zoneName) {} @@ -104,8 +105,16 @@ Foam::zoneToCell::zoneToCell ) : topoSetSource(mesh), - zoneName_(dict.get("name")) -{} + selectedZones_() +{ + // Look for 'zones' and 'zone', but accept 'name' as well + if (!dict.readIfPresent("zones", selectedZones_)) + { + selectedZones_.resize(1); + selectedZones_.first() = + dict.getCompat("zone", {{"name", 1806}}); + } +} Foam::zoneToCell::zoneToCell @@ -115,7 +124,7 @@ Foam::zoneToCell::zoneToCell ) : topoSetSource(mesh), - zoneName_(checkIs(is)) + selectedZones_(one(), wordRe(checkIs(is))) {} @@ -129,15 +138,15 @@ void Foam::zoneToCell::applyToSet { if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) { - Info<< " Adding all cells of cellZone " << zoneName_ << " ..." - << endl; + Info<< " Adding all cells of cell zones " + << flatOutput(selectedZones_) << " ..." << endl; combine(set, true); } else if (action == topoSetSource::DELETE) { - Info<< " Removing all cells of cellZone " << zoneName_ << " ..." - << endl; + Info<< " Removing all cells of cell zones " + << flatOutput(selectedZones_) << " ..." << endl; combine(set, false); } diff --git a/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.H b/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.H index d687226798..fe86baaccc 100644 --- a/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.H +++ b/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.H @@ -25,14 +25,19 @@ Class Foam::zoneToCell Description - A topoSetSource to select cells based on cellZone. + A topoSetSource to select cells based on one or more cellZones. \heading Dictionary parameters \table - Property | Description | Required | Default - name | The cell zone name or regex | yes | + Property | Description | Required | Default + zone | The cell zone name or regex | possibly | + zones | The cell zone names or regexs | possibly | + name | Older specification for 'zone' | no | \endtable +Note + Selection of multiple zones has precedence. + SourceFiles zoneToCell.C @@ -42,7 +47,7 @@ SourceFiles #define zoneToCell_H #include "topoSetSource.H" -#include "wordRe.H" +#include "wordRes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,7 +55,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class zoneToCell Declaration + Class zoneToCell Declaration \*---------------------------------------------------------------------------*/ class zoneToCell @@ -63,8 +68,8 @@ class zoneToCell //- Add usage string static addToUsageTable usage_; - //- Name/regular expression of cellZone - wordRe zoneName_; + //- Matcher for zones + wordRes selectedZones_; // Private Member Functions @@ -80,11 +85,7 @@ public: // Constructors //- Construct from components - zoneToCell - ( - const polyMesh& mesh, - const word& zoneName - ); + zoneToCell(const polyMesh& mesh, const wordRe& zoneName); //- Construct from dictionary zoneToCell(const polyMesh& mesh, const dictionary& dict); @@ -99,7 +100,7 @@ public: // Member Functions - virtual sourceType setType() const + virtual topoSetSource::sourceType setType() const { return CELLSETSOURCE; } diff --git a/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.H b/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.H index aadde9c799..af0695ec32 100644 --- a/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.H +++ b/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.H @@ -82,7 +82,7 @@ public: setToCellZone(const polyMesh& mesh, const dictionary& dict); //- Construct from Istream - setToCellZone(const polyMesh& mesh, Istream& is ); + setToCellZone(const polyMesh& mesh, Istream& is); //- Destructor diff --git a/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C b/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C index ea9090c056..b19f28403c 100644 --- a/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C +++ b/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C @@ -54,7 +54,7 @@ void Foam::zoneToFace::combine(topoSet& set, const bool add) const for (const faceZone& zone : mesh_.faceZones()) { - if (zoneName_.match(zone.name())) + if (selectedZones_.match(zone.name())) { hasMatched = true; @@ -77,8 +77,10 @@ void Foam::zoneToFace::combine(topoSet& set, const bool add) const if (!hasMatched) { WarningInFunction - << "Cannot find any faceZone named " << zoneName_ << endl - << "Valid names are " << mesh_.faceZones().names() << endl; + << "Cannot find any faceZone matching " + << flatOutput(selectedZones_) << nl + << "Valid names are " << flatOutput(mesh_.faceZones().names()) + << endl; } } @@ -88,11 +90,11 @@ void Foam::zoneToFace::combine(topoSet& set, const bool add) const Foam::zoneToFace::zoneToFace ( const polyMesh& mesh, - const word& zoneName + const wordRe& zoneName ) : topoSetSource(mesh), - zoneName_(zoneName) + selectedZones_(one(), zoneName) {} @@ -103,8 +105,16 @@ Foam::zoneToFace::zoneToFace ) : topoSetSource(mesh), - zoneName_(dict.get("name")) -{} + selectedZones_() +{ + // Look for 'zones' and 'zone', but accept 'name' as well + if (!dict.readIfPresent("zones", selectedZones_)) + { + selectedZones_.resize(1); + selectedZones_.first() = + dict.getCompat("zone", {{"name", 1806}}); + } +} Foam::zoneToFace::zoneToFace @@ -114,7 +124,7 @@ Foam::zoneToFace::zoneToFace ) : topoSetSource(mesh), - zoneName_(checkIs(is)) + selectedZones_(one(), wordRe(checkIs(is))) {} @@ -128,15 +138,15 @@ void Foam::zoneToFace::applyToSet { if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) { - Info<< " Adding all faces of faceZone " << zoneName_ << " ..." - << endl; + Info<< " Adding all faces of face zones " + << flatOutput(selectedZones_) << " ..." << endl; combine(set, true); } else if (action == topoSetSource::DELETE) { - Info<< " Removing all faces of faceZone " << zoneName_ << " ..." - << endl; + Info<< " Removing all faces of face zones " + << flatOutput(selectedZones_) << " ..." << endl; combine(set, false); } diff --git a/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.H b/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.H index 35d9c23ebe..f236d3e870 100644 --- a/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.H +++ b/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.H @@ -25,14 +25,19 @@ Class Foam::zoneToFace Description - A topoSetSource to select faces based on faceZone. + A topoSetSource to select faces based on one of more faceZones. \heading Dictionary parameters \table - Property | Description | Required | Default - name | The face zone name or regex | yes | + Property | Description | Required | Default + zone | The face zone name or regex | possibly | + zones | The face zone names or regexs | possibly | + name | Older specification for 'zone' | no | \endtable +Note + Selection of multiple zones has precedence. + SourceFiles zoneToFace.C @@ -42,7 +47,7 @@ SourceFiles #define zoneToFace_H #include "topoSetSource.H" -#include "wordRe.H" +#include "wordRes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,7 +55,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class zoneToFace Declaration + Class zoneToFace Declaration \*---------------------------------------------------------------------------*/ class zoneToFace @@ -63,8 +68,8 @@ class zoneToFace //- Add usage string static addToUsageTable usage_; - //- Name/regular expression of the faceZone - wordRe zoneName_; + //- Matcher for zones + wordRes selectedZones_; // Private Member Functions @@ -80,11 +85,7 @@ public: // Constructors //- Construct from components - zoneToFace - ( - const polyMesh& mesh, - const word& zoneName - ); + zoneToFace(const polyMesh& mesh, const wordRe& zoneName); //- Construct from dictionary zoneToFace(const polyMesh& mesh, const dictionary& dict); @@ -99,7 +100,7 @@ public: // Member Functions - virtual sourceType setType() const + virtual topoSetSource::sourceType setType() const { return FACESETSOURCE; } diff --git a/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C b/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C index 69d6ab31af..99e45aefdb 100644 --- a/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C +++ b/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C @@ -54,7 +54,7 @@ void Foam::zoneToPoint::combine(topoSet& set, const bool add) const for (const pointZone& zone : mesh_.pointZones()) { - if (zoneName_.match(zone.name())) + if (selectedZones_.match(zone.name())) { hasMatched = true; @@ -77,7 +77,8 @@ void Foam::zoneToPoint::combine(topoSet& set, const bool add) const if (!hasMatched) { WarningInFunction - << "Cannot find any pointZone named " << zoneName_ << nl + << "Cannot find any pointZone matching " + << flatOutput(selectedZones_) << nl << "Valid names: " << flatOutput(mesh_.pointZones().names()) << endl; } @@ -89,11 +90,11 @@ void Foam::zoneToPoint::combine(topoSet& set, const bool add) const Foam::zoneToPoint::zoneToPoint ( const polyMesh& mesh, - const word& zoneName + const wordRe& zoneName ) : topoSetSource(mesh), - zoneName_(zoneName) + selectedZones_(one(), zoneName) {} @@ -104,8 +105,16 @@ Foam::zoneToPoint::zoneToPoint ) : topoSetSource(mesh), - zoneName_(dict.get("name")) -{} + selectedZones_() +{ + // Look for 'zones' and 'zone', but accept 'name' as well + if (!dict.readIfPresent("zones", selectedZones_)) + { + selectedZones_.resize(1); + selectedZones_.first() = + dict.getCompat("zone", {{"name", 1806}}); + } +} Foam::zoneToPoint::zoneToPoint @@ -115,7 +124,7 @@ Foam::zoneToPoint::zoneToPoint ) : topoSetSource(mesh), - zoneName_(checkIs(is)) + selectedZones_(one(), wordRe(checkIs(is))) {} @@ -129,15 +138,15 @@ void Foam::zoneToPoint::applyToSet { if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) { - Info<< " Adding all points of pointZone " << zoneName_ << " ..." - << endl; + Info<< " Adding all points of point zones " + << flatOutput(selectedZones_) << " ..." << endl; combine(set, true); } else if (action == topoSetSource::DELETE) { - Info<< " Removing all points of pointZone " << zoneName_ << " ..." - << endl; + Info<< " Removing all points of point zones " + << flatOutput(selectedZones_) << " ..." << endl; combine(set, false); } diff --git a/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.H b/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.H index ea7c0eaee1..8933052076 100644 --- a/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.H +++ b/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.H @@ -25,14 +25,19 @@ Class Foam::zoneToPoint Description - A topoSetSource to select points based on pointZone. + A topoSetSource to select points based on one or more pointZones. \heading Dictionary parameters \table - Property | Description | Required | Default - name | The point zone name or regex | yes | + Property | Description | Required | Default + zone | The point zone name or regex | possibly | + zones | The point zone names or regexs | possibly | + name | Older specification for 'zone' | no | \endtable +Note + Selection of multiple zones has precedence. + SourceFiles zoneToPoint.C @@ -42,7 +47,7 @@ SourceFiles #define zoneToPoint_H #include "topoSetSource.H" -#include "wordRe.H" +#include "wordRes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,7 +55,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class zoneToPoint Declaration + Class zoneToPoint Declaration \*---------------------------------------------------------------------------*/ class zoneToPoint @@ -63,8 +68,8 @@ class zoneToPoint //- Add usage string static addToUsageTable usage_; - //- Name/regular expression of zone - wordRe zoneName_; + //- Matcher for zones + wordRes selectedZones_; // Private Member Functions @@ -80,11 +85,7 @@ public: // Constructors //- Construct from components - zoneToPoint - ( - const polyMesh& mesh, - const word& zoneName - ); + zoneToPoint(const polyMesh& mesh, const wordRe& zoneName); //- Construct from dictionary zoneToPoint(const polyMesh& mesh, const dictionary& dict); @@ -99,7 +100,7 @@ public: // Member Functions - virtual sourceType setType() const + virtual topoSetSource::sourceType setType() const { return POINTSETSOURCE; } diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.C b/src/meshTools/sets/topoSetSource/topoSetSource.C index 2bd6225e19..fa95d9d27b 100644 --- a/src/meshTools/sets/topoSetSource/topoSetSource.C +++ b/src/meshTools/sets/topoSetSource/topoSetSource.C @@ -148,11 +148,7 @@ Foam::autoPtr Foam::topoSetSource::New Foam::Istream& Foam::topoSetSource::checkIs(Istream& is) { - if (is.good() && !is.eof()) - { - return is; - } - else + if (!is.good() || is.eof()) { FatalErrorInFunction << exit(FatalError); diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/topoSetDict.1 b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/topoSetDict.1 index 55431121f3..73cbe27a8d 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/topoSetDict.1 +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/topoSetDict.1 @@ -25,7 +25,7 @@ actions source zoneToCell; sourceInfo { - name cylinder; + zone cylinder; } } { diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/topoSetDict.2 b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/topoSetDict.2 index c49ab1e2d8..2ab44cc7d5 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/topoSetDict.2 +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/topoSetDict.2 @@ -25,17 +25,7 @@ actions source zoneToCell; sourceInfo { - name cylinder; - } - } - { - name rotorCells; - type cellSet; - action add; - source zoneToCell; - sourceInfo - { - name innerCylinder; + zones (cylinder innerCylinder); } } { diff --git a/tutorials/mesh/foamyHexMesh/flange/system/topoSetDict-background b/tutorials/mesh/foamyHexMesh/flange/system/topoSetDict-background index 1ce14c127c..141b615cce 100644 --- a/tutorials/mesh/foamyHexMesh/flange/system/topoSetDict-background +++ b/tutorials/mesh/foamyHexMesh/flange/system/topoSetDict-background @@ -46,13 +46,15 @@ FoamFile // // Cells in cell zone // source zoneToCell; // { -// name ".*Zone"; // Name of cellZone, regular expressions allowed +// zones (".*Zone"); // Name of cellZones, regular expressions allowed +// zone ".*Zone"; // Name of cellZone, regular expressions allowed // } // // // Cells on master or slave side of faceZone // source faceZoneToCell; // { -// name ".*Zone"; // Name of faceZone, regular expressions allowed +// zones (".*Zone"); // Name of faceZones, regular expressions allowed +// zone ".*Zone"; // Name of faceZone, regular expressions allowed // option master; // master/slave // } // @@ -190,7 +192,7 @@ FoamFile // // All faces of faceZone // source zoneToFace; // { -// name ".*Zone1"; // Name of faceZone, regular expressions allowed +// zone ".*Zone1"; // Name of faceZone, regular expressions allowed // } // // // Faces with face centre within box @@ -240,7 +242,7 @@ FoamFile // // All points in pointzone // source zoneToPoint; // { -// name ".*Zone"; // name of pointZone, regular expressions allowed +// zone ".*Zone"; // name of pointZone, regular expressions allowed // } // // // Points nearest to coordinates diff --git a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/system/topoSetDict b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/system/topoSetDict index 562cea0746..40cd58f308 100644 --- a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/system/topoSetDict +++ b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/system/topoSetDict @@ -27,7 +27,7 @@ actions source zoneToCell; sourceInfo { - name topBlock; + zone topBlock; } } @@ -39,7 +39,7 @@ actions source zoneToCell; sourceInfo { - name centralBlock; + zone centralBlock; } } @@ -51,7 +51,7 @@ actions source zoneToCell; sourceInfo { - name bottomBlock; + zone bottomBlock; } } diff --git a/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/system/topoSetDict b/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/system/topoSetDict index 00bdad762d..1aa54cc819 100644 --- a/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/system/topoSetDict +++ b/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/system/topoSetDict @@ -24,7 +24,7 @@ actions source zoneToCell; sourceInfo { - name rotor; + zone rotor; } } ); diff --git a/tutorials/multiphase/interFoam/laminar/mixerVessel2D/system/topoSetDict b/tutorials/multiphase/interFoam/laminar/mixerVessel2D/system/topoSetDict index 00bdad762d..1aa54cc819 100644 --- a/tutorials/multiphase/interFoam/laminar/mixerVessel2D/system/topoSetDict +++ b/tutorials/multiphase/interFoam/laminar/mixerVessel2D/system/topoSetDict @@ -24,7 +24,7 @@ actions source zoneToCell; sourceInfo { - name rotor; + zone rotor; } } ); diff --git a/tutorials/multiphase/multiphaseEulerFoam/mixerVessel2D/system/topoSetDict b/tutorials/multiphase/multiphaseEulerFoam/mixerVessel2D/system/topoSetDict index 00bdad762d..1aa54cc819 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/mixerVessel2D/system/topoSetDict +++ b/tutorials/multiphase/multiphaseEulerFoam/mixerVessel2D/system/topoSetDict @@ -24,7 +24,7 @@ actions source zoneToCell; sourceInfo { - name rotor; + zone rotor; } } ); diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/system/topoSetDict b/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/system/topoSetDict index 00bdad762d..1aa54cc819 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/system/topoSetDict +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/system/topoSetDict @@ -24,7 +24,7 @@ actions source zoneToCell; sourceInfo { - name rotor; + zone rotor; } } ); diff --git a/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/system/topoSetDictHull b/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/system/topoSetDictHull index 5533f402e5..13a0176bd4 100644 --- a/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/system/topoSetDictHull +++ b/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/system/topoSetDictHull @@ -17,14 +17,14 @@ FoamFile actions ( { - name bgr0; // all around bgr - type cellSet; - action new; - source zoneToCell; - sourceInfo - { - name background; - } + name bgr0; // all around bgr + type cellSet; + action new; + source zoneToCell; + sourceInfo + { + zone background; + } } { name hullBox0; // all around bgr @@ -33,7 +33,7 @@ actions source zoneToCell; sourceInfo { - name hullBox; + zone hullBox; } } { @@ -43,7 +43,7 @@ actions source zoneToCell; sourceInfo { - name propeller; + zone propeller; } } { @@ -53,7 +53,7 @@ actions source zoneToCell; sourceInfo { - name rudder; + zone rudder; } } diff --git a/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/system/topoSetDictPropeller b/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/system/topoSetDictPropeller index f1dd3a613d..cd94103ab2 100644 --- a/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/system/topoSetDictPropeller +++ b/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/system/topoSetDictPropeller @@ -17,14 +17,14 @@ FoamFile actions ( { - name bgr0; // all around bgr - type cellSet; - action new; - source zoneToCell; - sourceInfo - { - name background; - } + name bgr0; // all around bgr + type cellSet; + action new; + source zoneToCell; + sourceInfo + { + zone background; + } } { name hullBox0; // all around hull @@ -33,7 +33,7 @@ actions source zoneToCell; sourceInfo { - name hullBox; + zone hullBox; } } { @@ -43,7 +43,7 @@ actions source zoneToCell; sourceInfo { - name propeller; + zone propeller; } } { @@ -53,7 +53,7 @@ actions source zoneToCell; sourceInfo { - name rudder; + zone rudder; } } diff --git a/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/system/topoSetDictRudder b/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/system/topoSetDictRudder index 4e79efeb1d..b70cb4fee3 100644 --- a/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/system/topoSetDictRudder +++ b/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/system/topoSetDictRudder @@ -17,14 +17,14 @@ FoamFile actions ( { - name bgr0; // all around bgr - type cellSet; - action new; - source zoneToCell; - sourceInfo - { - name background; - } + name bgr0; // all around bgr + type cellSet; + action new; + source zoneToCell; + sourceInfo + { + zone background; + } } { name hullBox0; // all around hull @@ -33,7 +33,7 @@ actions source zoneToCell; sourceInfo { - name hullBox; + zone hullBox; } } { @@ -43,7 +43,7 @@ actions source zoneToCell; sourceInfo { - name propeller; + zone propeller; } } { @@ -53,7 +53,7 @@ actions source zoneToCell; sourceInfo { - name rudder; + zone rudder; } } diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict index 00bdad762d..1aa54cc819 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict @@ -24,7 +24,7 @@ actions source zoneToCell; sourceInfo { - name rotor; + zone rotor; } } ); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict index 00bdad762d..1aa54cc819 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict @@ -24,7 +24,7 @@ actions source zoneToCell; sourceInfo { - name rotor; + zone rotor; } } ); diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict b/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict index 00bdad762d..1aa54cc819 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict @@ -24,7 +24,7 @@ actions source zoneToCell; sourceInfo { - name rotor; + zone rotor; } } ); From 50fe19537442c5498d5e37e8f68728e8bb2051c0 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 29 Oct 2018 15:51:05 +0000 Subject: [PATCH 02/10] ENH: use "origin" for searchable sphere etc. (#1060) - replaces "centre", using the same keyword as other objects (eg, plane, rotatedBox, coordinateSystem etc). --- .../mesh/manipulation/topoSet/topoSetDict | 4 +- .../setAlphaField/setAlphaField.C | 18 +++---- ...lindricalInletVelocityFvPatchVectorField.C | 2 +- .../searchableSphere/searchableSphere.C | 47 +++++++++---------- .../searchableSphere/searchableSphere.H | 13 ++--- .../cellSources/sphereToCell/sphereToCell.C | 25 +++++----- .../cellSources/sphereToCell/sphereToCell.H | 13 ++--- .../simplifiedSiwek/system/topoSetDict | 4 +- .../mesh/foamyHexMesh/blob/system/topoSetDict | 2 +- .../flange/system/topoSetDict-background | 2 +- .../depthCharge2D/system/setFieldsDict | 5 +- .../depthCharge3D/system/setFieldsDict | 5 +- 12 files changed, 72 insertions(+), 68 deletions(-) diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSetDict b/applications/utilities/mesh/manipulation/topoSet/topoSetDict index d3eb9f805f..cc78c31090 100644 --- a/applications/utilities/mesh/manipulation/topoSet/topoSetDict +++ b/applications/utilities/mesh/manipulation/topoSet/topoSetDict @@ -129,7 +129,7 @@ FoamFile // source sphereToCell; // sourceInfo // { -// centre (0.2 0.2 -10); +// origin (0.2 0.2 -10); // radius 5.0; // } // @@ -394,7 +394,7 @@ FoamFile // sourceInfo // { // surface searchableSphere; -// centre (0.05 0.05 0.005); +// origin (0.05 0.05 0.005); // radius 0.025; // //name sphere.stl; // Optional name if surface triSurfaceMesh // } diff --git a/applications/utilities/preProcessing/setAlphaField/setAlphaField.C b/applications/utilities/preProcessing/setAlphaField/setAlphaField.C index 37bc94df27..44001f4dd8 100644 --- a/applications/utilities/preProcessing/setAlphaField/setAlphaField.C +++ b/applications/utilities/preProcessing/setAlphaField/setAlphaField.C @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) ( shapeSelector::shapeTypeNames.get("type", dict) ); - const vector centre(dict.get("centre")); + const vector origin(dict.getCompat("origin", {{"centre", 1806}})); const word fieldName(dict.get("field")); Info<< "Reading field " << fieldName << "\n" << endl; @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) mesh ); - scalar f0 = 0.0; + scalar f0 = 0; scalarField f(mesh.points().size()); Info<< "Processing type '" << shapeSelector::shapeTypeNames[surfType] @@ -126,15 +126,15 @@ int main(int argc, char *argv[]) { const vector direction(dict.get("direction")); - f = -(mesh.points() - centre) & (direction/mag(direction)); - f0 = 0.0; + f = -(mesh.points() - origin) & (direction/mag(direction)); + f0 = 0; break; } case shapeSelector::shapeType::SPHERE: { const scalar radius(dict.get("radius")); - f = -mag(mesh.points() - centre); + f = -mag(mesh.points() - origin); f0 = -radius; break; } @@ -145,8 +145,8 @@ int main(int argc, char *argv[]) f = -sqrt ( - sqr(mag(mesh.points() - centre)) - - sqr(mag((mesh.points() - centre) & direction)) + sqr(mag(mesh.points() - origin)) + - sqr(mag((mesh.points() - origin) & direction)) ); f0 = -radius; break; @@ -160,9 +160,9 @@ int main(int argc, char *argv[]) const scalarField xx ( - (mesh.points() - centre) & direction/mag(direction) + (mesh.points() - origin) & direction/mag(direction) ); - const scalarField zz((mesh.points() - centre) & up/mag(up)); + const scalarField zz((mesh.points() - origin) & up/mag(up)); f = amplitude*Foam::sin(2*mathematical::pi*xx/period) - zz; f0 = 0; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C index 87e782dc4b..138d2d0af0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C @@ -75,7 +75,7 @@ cylindricalInletVelocityFvPatchVectorField ) : fixedValueFvPatchField(p, iF, dict), - origin_(dict.lookupCompat("origin", {{"centre", 1712}})), + origin_(dict.getCompat("origin", {{"centre", 1712}})), axis_(dict.lookup("axis")), axialVelocity_(Function1::New("axialVelocity", dict)), radialVelocity_(Function1::New("radialVelocity", dict)), diff --git a/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.C b/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.C index 5691a89e31..fc7cebeda1 100644 --- a/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.C +++ b/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.C @@ -57,18 +57,18 @@ Foam::pointIndexHit Foam::searchableSphere::findNearest { pointIndexHit info(false, sample, -1); - const vector n(sample - centre_); + const vector n(sample - origin_); scalar magN = mag(n); if (nearestDistSqr >= sqr(magN - radius_)) { if (magN < ROOTVSMALL) { - info.rawPoint() = centre_ + vector(1,0,0)*radius_; + info.rawPoint() = origin_ + vector(1,0,0)*radius_; } else { - info.rawPoint() = centre_ + n/magN*radius_; + info.rawPoint() = origin_ + n/magN*radius_; } info.setHit(); info.setIndex(0); @@ -95,7 +95,7 @@ void Foam::searchableSphere::findLineAll if (magSqrDir > ROOTVSMALL) { - const vector toCentre(centre_-start); + const vector toCentre(origin_ - start); scalar magSqrToCentre = magSqr(toCentre); dir /= Foam::sqrt(magSqrDir); @@ -135,18 +135,18 @@ void Foam::searchableSphere::findLineAll Foam::searchableSphere::searchableSphere ( const IOobject& io, - const point& centre, + const point& origin, const scalar radius ) : searchableSurface(io), - centre_(centre), + origin_(origin), radius_(radius) { bounds() = boundBox ( - centre_ - radius_*vector::one, - centre_ + radius_*vector::one + origin_ - radius_*vector::one, + origin_ + radius_*vector::one ); } @@ -157,23 +157,20 @@ Foam::searchableSphere::searchableSphere const dictionary& dict ) : - searchableSurface(io), - centre_(dict.get("centre")), - radius_(dict.get("radius")) -{ - bounds() = boundBox + searchableSphere ( - centre_ - radius_*vector::one, - centre_ + radius_*vector::one - ); -} + io, + dict.getCompat("origin", {{"centre", 1806}}), + dict.get("radius") + ) +{} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::searchableSphere::overlaps(const boundBox& bb) const { - return bb.overlaps(centre_, sqr(radius_)); + return bb.overlaps(origin_, sqr(radius_)); } @@ -181,8 +178,8 @@ const Foam::wordList& Foam::searchableSphere::regions() const { if (regions_.empty()) { - regions_.setSize(1); - regions_[0] = "region0"; + regions_.resize(1); + regions_.first() = "region0"; } return regions_; } @@ -195,10 +192,10 @@ void Foam::searchableSphere::boundingSpheres scalarField& radiusSqr ) const { - centres.setSize(1); - centres[0] = centre_; + centres.resize(1); + centres[0] = origin_; - radiusSqr.setSize(1); + radiusSqr.resize(1); radiusSqr[0] = Foam::sqr(radius_); // Add a bit to make sure all points are tested inside @@ -336,7 +333,7 @@ void Foam::searchableSphere::getNormal { if (info[i].hit()) { - normal[i] = normalised(info[i].hitPoint() - centre_); + normal[i] = normalised(info[i].hitPoint() - origin_); } else { @@ -362,7 +359,7 @@ void Foam::searchableSphere::getVolumeType volType[pointi] = ( - (magSqr(pt - centre_) <= rad2) + (magSqr(pt - origin_) <= rad2) ? volumeType::INSIDE : volumeType::OUTSIDE ); } diff --git a/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.H b/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.H index 69ee3ce22a..6978a90c1c 100644 --- a/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.H +++ b/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.H @@ -29,10 +29,11 @@ Description \heading Dictionary parameters \table - Property | Description | Required | Default - type | sphere / searchableSphere | selector | - centre | The sphere centre | yes | - radius | The (outside) radius of sphere | yes | + Property | Description | Required | Default + type | sphere / searchableSphere | selector | + origin | The origin (centre) of the sphere | yes | + radius | The (outside) radius of sphere | yes | + centre | Alternative for 'origin' | no | \endtable SourceFiles @@ -64,7 +65,7 @@ private: // Private Member Data //- Centre point of the sphere - const point centre_; + const point origin_; //- The outer radius of the sphere const scalar radius_; @@ -151,7 +152,7 @@ public: // Usually the element centres (should be of length size()). virtual tmp coordinates() const { - return tmp::New(1, centre_); + return tmp::New(1, origin_); } //- Get bounding spheres (centre and radius squared), one per element. diff --git a/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C b/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C index 3f640426e1..9dcf09ad52 100644 --- a/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C +++ b/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C @@ -55,7 +55,7 @@ void Foam::sphereToCell::combine(topoSet& set, const bool add) const forAll(ctrs, celli) { - if (magSqr(ctrs[celli] - centre_) <= rad2) + if (magSqr(ctrs[celli] - origin_) <= rad2) { addOrDelete(set, celli, add); } @@ -68,12 +68,12 @@ void Foam::sphereToCell::combine(topoSet& set, const bool add) const Foam::sphereToCell::sphereToCell ( const polyMesh& mesh, - const point& centre, + const point& origin, const scalar radius ) : topoSetSource(mesh), - centre_(centre), + origin_(origin), radius_(radius) {} @@ -84,9 +84,12 @@ Foam::sphereToCell::sphereToCell const dictionary& dict ) : - topoSetSource(mesh), - centre_(dict.get("centre")), - radius_(dict.get("radius")) + sphereToCell + ( + mesh, + dict.getCompat("origin", {{"centre", 1806}}), + dict.get("radius") + ) {} @@ -97,7 +100,7 @@ Foam::sphereToCell::sphereToCell ) : topoSetSource(mesh), - centre_(checkIs(is)), + origin_(checkIs(is)), radius_(readScalar(checkIs(is))) {} @@ -112,15 +115,15 @@ void Foam::sphereToCell::applyToSet { if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) { - Info<< " Adding cells with centre within sphere, with centre = " - << centre_ << " and radius = " << radius_ << endl; + Info<< " Adding cells within a sphere with centre = " + << origin_ << " and radius = " << radius_ << endl; combine(set, true); } else if (action == topoSetSource::DELETE) { - Info<< " Removing cells with centre within sphere, with centre = " - << centre_ << " and radius = " << radius_ << endl; + Info<< " Removing cells within a sphere with centre = " + << origin_ << " and radius = " << radius_ << endl; combine(set, false); } diff --git a/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.H b/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.H index 200b9f68b2..0da213707c 100644 --- a/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.H +++ b/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.H @@ -29,9 +29,10 @@ Description \heading Dictionary parameters \table - Property | Description | Required | Default - centre | The sphere centre | yes | - radius | The (outside) radius of sphere | yes | + Property | Description | Required | Default + origin | The origin (centre) of the sphere | yes | + radius | The (outside) radius of sphere | yes | + centre | Alternative for 'origin' | no | \endtable SourceFiles @@ -64,7 +65,7 @@ class sphereToCell static addToUsageTable usage_; //- Centre point of the sphere - point centre_; + point origin_; //- The outer radius of the sphere scalar radius_; @@ -87,7 +88,7 @@ public: sphereToCell ( const polyMesh& mesh, - const point& centre, + const point& origin, const scalar radius ); @@ -104,7 +105,7 @@ public: // Member Functions - virtual sourceType setType() const + virtual topoSetSource::sourceType setType() const { return CELLSETSOURCE; } diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/topoSetDict b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/topoSetDict index bcf459bfb8..58ff35ed4a 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/topoSetDict +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/topoSetDict @@ -25,8 +25,8 @@ actions source sphereToCell; sourceInfo { - centre (0.125 0.375 0.05); - radius 0.005; + origin (0.125 0.375 0.05); + radius 0.005; } } ); diff --git a/tutorials/mesh/foamyHexMesh/blob/system/topoSetDict b/tutorials/mesh/foamyHexMesh/blob/system/topoSetDict index afa9c6971c..8d1ac69992 100644 --- a/tutorials/mesh/foamyHexMesh/blob/system/topoSetDict +++ b/tutorials/mesh/foamyHexMesh/blob/system/topoSetDict @@ -110,7 +110,7 @@ actions source sphereToCell; sourceInfo { - centre (-0.3 -0.3 -0.3); + origin (-0.3 -0.3 -0.3); radius 0.4; } } diff --git a/tutorials/mesh/foamyHexMesh/flange/system/topoSetDict-background b/tutorials/mesh/foamyHexMesh/flange/system/topoSetDict-background index 141b615cce..8fd3b95a97 100644 --- a/tutorials/mesh/foamyHexMesh/flange/system/topoSetDict-background +++ b/tutorials/mesh/foamyHexMesh/flange/system/topoSetDict-background @@ -110,7 +110,7 @@ FoamFile // // Cells with centre within sphere // source sphereToCell; // { -// centre (0.2 0.2 -10); +// origin (0.2 0.2 -10); // radius 5.0; // } // diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/setFieldsDict b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/setFieldsDict index 1743e4fe18..ee905dc545 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/setFieldsDict +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/setFieldsDict @@ -27,8 +27,9 @@ regions ( sphereToCell { - centre (0.5 0.5 0); - radius 0.1; + centre (0.5 0.5 0); + radius 0.1; + fieldValues ( volScalarFieldValue alpha.water 0 diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/setFieldsDict b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/setFieldsDict index b9d9566b3e..1ac3bd391b 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/setFieldsDict +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/setFieldsDict @@ -27,8 +27,9 @@ regions ( sphereToCell { - centre (0.5 0.5 0.5); - radius 0.1; + origin (0.5 0.5 0.5); + radius 0.1; + fieldValues ( volScalarFieldValue alpha.water 0 From de1832abdd333e8148de7c1fad561bab5a4c1faa Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 30 Oct 2018 12:01:36 +0000 Subject: [PATCH 03/10] ENH: consistency update for box topoSetSources (#1060) - "boxes" has precedence over "box" (similar to treatment of "zones" vs "zone") --- src/meshTools/sets/cellSources/boxToCell/boxToCell.C | 7 ++----- src/meshTools/sets/cellSources/boxToCell/boxToCell.H | 9 +++++---- src/meshTools/sets/faceSources/boxToFace/boxToFace.C | 7 ++----- src/meshTools/sets/faceSources/boxToFace/boxToFace.H | 9 +++++---- src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C | 7 ++----- src/meshTools/sets/pointSources/boxToPoint/boxToPoint.H | 9 +++++---- 6 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/meshTools/sets/cellSources/boxToCell/boxToCell.C b/src/meshTools/sets/cellSources/boxToCell/boxToCell.C index 7714d038da..377a36d455 100644 --- a/src/meshTools/sets/cellSources/boxToCell/boxToCell.C +++ b/src/meshTools/sets/cellSources/boxToCell/boxToCell.C @@ -87,15 +87,12 @@ Foam::boxToCell::boxToCell topoSetSource(mesh), bbs_() { - if (dict.found("box")) + // Look for 'boxes' or 'box' + if (!dict.readIfPresent("boxes", bbs_)) { bbs_.resize(1); dict.readEntry("box", bbs_.first()); } - else - { - dict.readEntry("boxes", bbs_); - } } diff --git a/src/meshTools/sets/cellSources/boxToCell/boxToCell.H b/src/meshTools/sets/cellSources/boxToCell/boxToCell.H index 7360bd0e90..ce69cda4eb 100644 --- a/src/meshTools/sets/cellSources/boxToCell/boxToCell.H +++ b/src/meshTools/sets/cellSources/boxToCell/boxToCell.H @@ -29,13 +29,14 @@ Description \heading Dictionary parameters \table - Property | Description | Required | Default - box | A single bounding box | partly | - boxes | Multiple bounding boxes | partly | + Property | Description | Required | Default + box | A single bounding box | partly | + boxes | Multiple bounding boxes | partly | \endtable Note - Must specify either "box" or "boxes" + Must specify either "box" or "boxes". + The selection of multiple boxes has precedence. SourceFiles boxToCell.C diff --git a/src/meshTools/sets/faceSources/boxToFace/boxToFace.C b/src/meshTools/sets/faceSources/boxToFace/boxToFace.C index c589fcecb0..2c388468c6 100644 --- a/src/meshTools/sets/faceSources/boxToFace/boxToFace.C +++ b/src/meshTools/sets/faceSources/boxToFace/boxToFace.C @@ -87,15 +87,12 @@ Foam::boxToFace::boxToFace topoSetSource(mesh), bbs_() { - if (dict.found("box")) + // Look for 'boxes' or 'box' + if (!dict.readIfPresent("boxes", bbs_)) { bbs_.resize(1); dict.readEntry("box", bbs_.first()); } - else - { - dict.readEntry("boxes", bbs_); - } } diff --git a/src/meshTools/sets/faceSources/boxToFace/boxToFace.H b/src/meshTools/sets/faceSources/boxToFace/boxToFace.H index 6a9bc01cea..96c17c4e83 100644 --- a/src/meshTools/sets/faceSources/boxToFace/boxToFace.H +++ b/src/meshTools/sets/faceSources/boxToFace/boxToFace.H @@ -29,13 +29,14 @@ Description \heading Dictionary parameters \table - Property | Description | Required | Default - box | A single bounding box | partly | - boxes | Multiple bounding boxes | partly | + Property | Description | Required | Default + box | A single bounding box | partly | + boxes | Multiple bounding boxes | partly | \endtable Note - Must specify either "box" or "boxes" + Must specify either "box" or "boxes". + The selection of multiple boxes has precedence. SourceFiles boxToFace.C diff --git a/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C b/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C index b907152dcc..3987f7373a 100644 --- a/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C +++ b/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C @@ -87,15 +87,12 @@ Foam::boxToPoint::boxToPoint topoSetSource(mesh), bbs_() { - if (dict.found("box")) + // Look for 'boxes' or 'box' + if (!dict.readIfPresent("boxes", bbs_)) { bbs_.resize(1); dict.readEntry("box", bbs_.first()); } - else - { - dict.readEntry("boxes", bbs_); - } } diff --git a/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.H b/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.H index 474c1538ff..545418f257 100644 --- a/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.H +++ b/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.H @@ -29,13 +29,14 @@ Description \heading Dictionary parameters \table - Property | Description | Required | Default - box | A single bounding box | partly | - boxes | Multiple bounding boxes | partly | + Property | Description | Required | Default + box | A single bounding box | partly | + boxes | Multiple bounding boxes | partly | \endtable Note - Must specify either "box" or "boxes" + Must specify either "box" or "boxes". + The selection of multiple boxes has precedence. SourceFiles boxToPoint.C From 9a87a043d6dac4b503ebc20b005019e985005d58 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 30 Oct 2018 12:01:36 +0000 Subject: [PATCH 04/10] ENH: consistency updates for patchToFace topoSetSource (#1060) - Support specification with "patches" and "patch" keywords (similar to zone selection). Keyword "name" for compatibility. --- .../faceSources/patchToFace/patchToFace.C | 33 ++++++++++++------- .../faceSources/patchToFace/patchToFace.H | 23 ++++++------- .../LES/compartmentFire/system/topoSetDict | 2 +- .../system/topoSetDict | 2 +- .../LES/simplePMMApanel/system/topoSetDict | 2 +- .../oscillatingInletACMI2D/system/topoSetDict | 4 +-- .../system/createInletOutletSets.topoSetDict | 2 +- .../mixerVesselAMI2D/system/topoSetDict | 2 +- .../simpleFoam/pipeCyclic/system/topoSetDict | 4 +-- .../cylinder/system/topoSetDict | 2 +- .../system/wallFilmRegion.topoSet | 2 +- .../splashPanel/system/wallFilmRegion.topoSet | 2 +- .../flange/system/topoSetDict-background | 2 +- .../simple-cube1/system/topoSetDict.patches | 2 +- .../laminar/sphereDrop/system/topoSetDict | 4 +-- .../system/topoSetDict.createCollector | 2 +- .../system/createInletOutletSets.topoSetDict | 2 +- .../mixerVesselAMI2D/system/topoSetDict | 2 +- .../oscillatingBox/system/topoSetDict | 2 +- .../system/topoSetDict-selectBottom | 2 +- .../oscillatingBox/system/topoSetDict | 2 +- 21 files changed, 56 insertions(+), 44 deletions(-) diff --git a/src/meshTools/sets/faceSources/patchToFace/patchToFace.C b/src/meshTools/sets/faceSources/patchToFace/patchToFace.C index 9694a42fa4..a7a502d54f 100644 --- a/src/meshTools/sets/faceSources/patchToFace/patchToFace.C +++ b/src/meshTools/sets/faceSources/patchToFace/patchToFace.C @@ -51,7 +51,7 @@ void Foam::patchToFace::combine(topoSet& set, const bool add) const { labelHashSet patchIDs = mesh_.boundaryMesh().patchSet ( - List(1, patchName_), + selectedPatches_, true, // warn if not found true // use patch groups if available ); @@ -77,8 +77,10 @@ void Foam::patchToFace::combine(topoSet& set, const bool add) const if (patchIDs.empty()) { WarningInFunction - << "Cannot find any patch named " << patchName_ << endl - << "Valid names are " << mesh_.boundaryMesh().names() << endl; + << "Cannot find any patches matching " + << flatOutput(selectedPatches_) << nl + << "Valid names are " << flatOutput(mesh_.boundaryMesh().names()) + << endl; } } @@ -88,11 +90,11 @@ void Foam::patchToFace::combine(topoSet& set, const bool add) const Foam::patchToFace::patchToFace ( const polyMesh& mesh, - const word& patchName + const wordRe& patchName ) : topoSetSource(mesh), - patchName_(patchName) + selectedPatches_(one(), patchName) {} @@ -103,8 +105,16 @@ Foam::patchToFace::patchToFace ) : topoSetSource(mesh), - patchName_(dict.get("name")) -{} + selectedPatches_() +{ + // Look for 'patches' and 'patch', but accept 'name' as well + if (!dict.readIfPresent("patches", selectedPatches_)) + { + selectedPatches_.resize(1); + selectedPatches_.first() = + dict.getCompat("patch", {{"name", 1806}}); + } +} Foam::patchToFace::patchToFace @@ -114,7 +124,7 @@ Foam::patchToFace::patchToFace ) : topoSetSource(mesh), - patchName_(checkIs(is)) + selectedPatches_(one(), wordRe(checkIs(is))) {} @@ -128,14 +138,15 @@ void Foam::patchToFace::applyToSet { if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) { - Info<< " Adding all faces of patch " << patchName_ << " ..." << endl; + Info<< " Adding all faces of patches " + << flatOutput(selectedPatches_) << " ..." << endl; combine(set, true); } else if (action == topoSetSource::DELETE) { - Info<< " Removing all faces of patch " << patchName_ << " ..." - << endl; + Info<< " Removing all faces of patches " + << flatOutput(selectedPatches_) << " ..." << endl; combine(set, false); } diff --git a/src/meshTools/sets/faceSources/patchToFace/patchToFace.H b/src/meshTools/sets/faceSources/patchToFace/patchToFace.H index e956cc516c..98d8addd72 100644 --- a/src/meshTools/sets/faceSources/patchToFace/patchToFace.H +++ b/src/meshTools/sets/faceSources/patchToFace/patchToFace.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,10 +29,15 @@ Description \heading Dictionary parameters \table - Property | Description | Required | Default - name | Patch name or regex to select | yes | + Property | Description | Required | Default + patch | The face zone name or regex | possibly | + patches | The face zone names or regexs | possibly | + name | Older specification for 'patch' | no | \endtable +Note + Selection of multiple patches has precedence. + SourceFiles patchToFace.C @@ -42,7 +47,7 @@ SourceFiles #define patchToFace_H #include "topoSetSource.H" -#include "wordRe.H" +#include "wordRes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -63,8 +68,8 @@ class patchToFace //- Add usage string static addToUsageTable usage_; - //- Name/regular expression of patch - wordRe patchName_; + //- Matcher for patches + wordRes selectedPatches_; // Private Member Functions @@ -80,11 +85,7 @@ public: // Constructors //- Construct from components - patchToFace - ( - const polyMesh& mesh, - const word& patchName - ); + patchToFace(const polyMesh& mesh, const wordRe& patchName); //- Construct from dictionary patchToFace(const polyMesh& mesh, const dictionary& dict); diff --git a/tutorials/combustion/fireFoam/LES/compartmentFire/system/topoSetDict b/tutorials/combustion/fireFoam/LES/compartmentFire/system/topoSetDict index e9154fd75f..a4c7c7240b 100644 --- a/tutorials/combustion/fireFoam/LES/compartmentFire/system/topoSetDict +++ b/tutorials/combustion/fireFoam/LES/compartmentFire/system/topoSetDict @@ -67,7 +67,7 @@ actions source patchToFace; sourceInfo { - name inlet; + patch inlet; } } diff --git a/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/system/topoSetDict b/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/system/topoSetDict index ad3c8e2985..492c5bd72f 100644 --- a/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/system/topoSetDict +++ b/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/system/topoSetDict @@ -36,7 +36,7 @@ actions source patchToFace; sourceInfo { - name coupledWallTmp; + patch coupledWallTmp; } } diff --git a/tutorials/combustion/fireFoam/LES/simplePMMApanel/system/topoSetDict b/tutorials/combustion/fireFoam/LES/simplePMMApanel/system/topoSetDict index 2c47e07f5e..b1abf7f6bc 100644 --- a/tutorials/combustion/fireFoam/LES/simplePMMApanel/system/topoSetDict +++ b/tutorials/combustion/fireFoam/LES/simplePMMApanel/system/topoSetDict @@ -24,7 +24,7 @@ actions source patchToFace; sourceInfo { - name coupledPatch; + patch coupledPatch; } } diff --git a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/topoSetDict b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/topoSetDict index 6fdbf32173..efe8b3f4c6 100644 --- a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/topoSetDict +++ b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/topoSetDict @@ -27,7 +27,7 @@ actions source patchToFace; sourceInfo { - name couple1; + patch couple1; } } { @@ -49,7 +49,7 @@ actions source patchToFace; sourceInfo { - name couple2; + patch couple2; } } { diff --git a/tutorials/incompressible/pimpleFoam/RAS/propeller/system/createInletOutletSets.topoSetDict b/tutorials/incompressible/pimpleFoam/RAS/propeller/system/createInletOutletSets.topoSetDict index 0149316d52..a1aea929c5 100644 --- a/tutorials/incompressible/pimpleFoam/RAS/propeller/system/createInletOutletSets.topoSetDict +++ b/tutorials/incompressible/pimpleFoam/RAS/propeller/system/createInletOutletSets.topoSetDict @@ -24,7 +24,7 @@ actions source patchToFace; sourceInfo { - name outerCylinder; + patch outerCylinder; } } diff --git a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/system/topoSetDict b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/system/topoSetDict index ec5a253e51..c89d90af46 100644 --- a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/system/topoSetDict +++ b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/system/topoSetDict @@ -27,7 +27,7 @@ actions source patchToFace; sourceInfo { - name "AMI.*"; + patch "AMI.*"; } } ); diff --git a/tutorials/incompressible/simpleFoam/pipeCyclic/system/topoSetDict b/tutorials/incompressible/simpleFoam/pipeCyclic/system/topoSetDict index dbcaeb4865..17030d220d 100644 --- a/tutorials/incompressible/simpleFoam/pipeCyclic/system/topoSetDict +++ b/tutorials/incompressible/simpleFoam/pipeCyclic/system/topoSetDict @@ -24,7 +24,7 @@ actions source patchToFace; sourceInfo { - name "side1"; + patch side1; } } { @@ -57,7 +57,7 @@ actions source patchToFace; sourceInfo { - name "walls"; + patch walls; } } { diff --git a/tutorials/lagrangian/reactingParcelFoam/cylinder/system/topoSetDict b/tutorials/lagrangian/reactingParcelFoam/cylinder/system/topoSetDict index e0d4da9cfa..f237aab344 100644 --- a/tutorials/lagrangian/reactingParcelFoam/cylinder/system/topoSetDict +++ b/tutorials/lagrangian/reactingParcelFoam/cylinder/system/topoSetDict @@ -24,7 +24,7 @@ actions source patchToFace; sourceInfo { - name filmWalls; + patch filmWalls; } } { diff --git a/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/system/wallFilmRegion.topoSet b/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/system/wallFilmRegion.topoSet index 03646e0139..8b7edbdfbf 100644 --- a/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/system/wallFilmRegion.topoSet +++ b/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/system/wallFilmRegion.topoSet @@ -24,7 +24,7 @@ actions source patchToFace; sourceInfo { - name filmWalls; + patch filmWalls; } } { diff --git a/tutorials/lagrangian/reactingParcelFoam/splashPanel/system/wallFilmRegion.topoSet b/tutorials/lagrangian/reactingParcelFoam/splashPanel/system/wallFilmRegion.topoSet index e0d4da9cfa..f237aab344 100644 --- a/tutorials/lagrangian/reactingParcelFoam/splashPanel/system/wallFilmRegion.topoSet +++ b/tutorials/lagrangian/reactingParcelFoam/splashPanel/system/wallFilmRegion.topoSet @@ -24,7 +24,7 @@ actions source patchToFace; sourceInfo { - name filmWalls; + patch filmWalls; } } { diff --git a/tutorials/mesh/foamyHexMesh/flange/system/topoSetDict-background b/tutorials/mesh/foamyHexMesh/flange/system/topoSetDict-background index 8fd3b95a97..16a72497f1 100644 --- a/tutorials/mesh/foamyHexMesh/flange/system/topoSetDict-background +++ b/tutorials/mesh/foamyHexMesh/flange/system/topoSetDict-background @@ -186,7 +186,7 @@ FoamFile // // All faces of patch // source patchToFace; // { -// name ".*Wall"; // Name of patch, regular expressions allowed +// patch ".*Wall"; // Name of patch, regular expressions allowed // } // // // All faces of faceZone diff --git a/tutorials/mesh/stitchMesh/simple-cube1/system/topoSetDict.patches b/tutorials/mesh/stitchMesh/simple-cube1/system/topoSetDict.patches index f4e1ce6430..c5d0a898eb 100644 --- a/tutorials/mesh/stitchMesh/simple-cube1/system/topoSetDict.patches +++ b/tutorials/mesh/stitchMesh/simple-cube1/system/topoSetDict.patches @@ -21,7 +21,7 @@ newFromPatch source patchToFace; sourceInfo { - name outer; + patch outer; } } diff --git a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/system/topoSetDict b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/system/topoSetDict index 40cd58f308..04f2b19299 100644 --- a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/system/topoSetDict +++ b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/system/topoSetDict @@ -66,7 +66,7 @@ actions source patchToFace; sourceInfo { - name top; + patch top; } } @@ -192,7 +192,7 @@ actions source patchToFace; sourceInfo { - name bottom; + patch bottom; } } diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/system/topoSetDict.createCollector b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/system/topoSetDict.createCollector index da5d1cfd6c..5d45a4ed6d 100644 --- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/system/topoSetDict.createCollector +++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/system/topoSetDict.createCollector @@ -24,7 +24,7 @@ actions source patchToFace; sourceInfo { - name sides; + patch sides; } } diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/createInletOutletSets.topoSetDict b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/createInletOutletSets.topoSetDict index 0149316d52..a1aea929c5 100644 --- a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/createInletOutletSets.topoSetDict +++ b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/createInletOutletSets.topoSetDict @@ -24,7 +24,7 @@ actions source patchToFace; sourceInfo { - name outerCylinder; + patch outerCylinder; } } diff --git a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/system/topoSetDict b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/system/topoSetDict index ec5a253e51..c89d90af46 100644 --- a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/system/topoSetDict +++ b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/system/topoSetDict @@ -27,7 +27,7 @@ actions source patchToFace; sourceInfo { - name "AMI.*"; + patch "AMI.*"; } } ); diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/topoSetDict b/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/topoSetDict index 6dfb30f4ec..8e258e26d3 100644 --- a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/topoSetDict +++ b/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/topoSetDict @@ -41,7 +41,7 @@ actions source patchToFace; sourceInfo { - name freeSurface; + patch freeSurface; } } diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/topoSetDict-selectBottom b/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/topoSetDict-selectBottom index ca30f92595..f1f9c23861 100644 --- a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/topoSetDict-selectBottom +++ b/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/topoSetDict-selectBottom @@ -24,7 +24,7 @@ actions source patchToFace; sourceInfo { - name floatingObject; + patch floatingObject; } } diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/topoSetDict b/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/topoSetDict index 6dfb30f4ec..8e258e26d3 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/topoSetDict +++ b/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/topoSetDict @@ -41,7 +41,7 @@ actions source patchToFace; sourceInfo { - name freeSurface; + patch freeSurface; } } From 9b638f9a7106c765e54048b133e2c02b3b295014 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 30 Oct 2018 12:01:36 +0000 Subject: [PATCH 05/10] ENH: distinguish between cell/face/point topoSetSource (#1060) - add intermediate classes topoSetCellSource, topoSetFaceSource, topoSetPointSource and corresponding New() factories --- .../badQualityToCell/badQualityToCell.C | 43 +++--- .../badQualityToCell/badQualityToCell.H | 27 +--- .../badQualityToFace/badQualityToFace.C | 43 +++--- .../badQualityToFace/badQualityToFace.H | 15 +- ...irectionalPressureGradientExplicitSource.H | 4 +- .../meanVelocityForce/meanVelocityForce.H | 2 - src/meshTools/Make/files | 56 ++++---- .../sets/cellSources/boxToCell/boxToCell.C | 35 ++++- .../sets/cellSources/boxToCell/boxToCell.H | 22 ++- .../sets/cellSources/cellToCell/cellToCell.C | 13 +- .../sets/cellSources/cellToCell/cellToCell.H | 17 +-- .../cylinderAnnulusToCell.C | 43 +++++- .../cylinderAnnulusToCell.H | 13 +- .../cylinderToCell/cylinderToCell.C | 31 +++- .../cylinderToCell/cylinderToCell.H | 11 +- .../sets/cellSources/faceToCell/faceToCell.C | 15 +- .../sets/cellSources/faceToCell/faceToCell.H | 11 +- .../faceZoneToCell/faceZoneToCell.C | 8 +- .../faceZoneToCell/faceZoneToCell.H | 11 +- .../cellSources/fieldToCell/fieldToCell.C | 31 +++- .../cellSources/fieldToCell/fieldToCell.H | 11 +- .../cellSources/labelToCell/labelToCell.C | 34 ++++- .../cellSources/labelToCell/labelToCell.H | 22 ++- .../sets/cellSources/nbrToCell/nbrToCell.C | 23 ++- .../sets/cellSources/nbrToCell/nbrToCell.H | 17 +-- .../cellSources/nearestToCell/nearestToCell.C | 38 ++++- .../cellSources/nearestToCell/nearestToCell.H | 22 ++- .../cellSources/pointToCell/pointToCell.C | 15 +- .../cellSources/pointToCell/pointToCell.H | 11 +- .../cellSources/regionToCell/regionToCell.C | 8 +- .../cellSources/regionToCell/regionToCell.H | 21 ++- .../rotatedBoxToCell/rotatedBoxToCell.C | 33 ++++- .../rotatedBoxToCell/rotatedBoxToCell.H | 11 +- .../cellSources/shapeToCell/shapeToCell.C | 17 +-- .../cellSources/shapeToCell/shapeToCell.H | 17 +-- .../cellSources/sphereToCell/sphereToCell.C | 20 ++- .../cellSources/sphereToCell/sphereToCell.H | 11 +- .../cellSources/surfaceToCell/surfaceToCell.C | 34 +++-- .../cellSources/surfaceToCell/surfaceToCell.H | 11 +- .../targetVolumeToCell/targetVolumeToCell.C | 40 ++++-- .../targetVolumeToCell/targetVolumeToCell.H | 14 +- .../topoSetCellSource/topoSetCellSource.C | 95 +++++++++++++ .../topoSetCellSource/topoSetCellSource.H | 133 ++++++++++++++++++ .../sets/cellSources/zoneToCell/zoneToCell.C | 22 ++- .../sets/cellSources/zoneToCell/zoneToCell.H | 11 +- .../setToCellZone/setToCellZone.C | 4 +- .../setToCellZone/setToCellZone.H | 6 +- .../boundaryToFace/boundaryToFace.C | 22 ++- .../boundaryToFace/boundaryToFace.H | 11 +- .../sets/faceSources/boxToFace/boxToFace.C | 35 ++++- .../sets/faceSources/boxToFace/boxToFace.H | 22 ++- .../sets/faceSources/cellToFace/cellToFace.C | 15 +- .../sets/faceSources/cellToFace/cellToFace.H | 11 +- .../cylinderAnnulusToFace.C | 43 +++++- .../cylinderAnnulusToFace.H | 11 +- .../cylinderToFace/cylinderToFace.C | 31 +++- .../cylinderToFace/cylinderToFace.H | 11 +- .../sets/faceSources/faceToFace/faceToFace.C | 13 +- .../sets/faceSources/faceToFace/faceToFace.H | 17 +-- .../faceSources/labelToFace/labelToFace.C | 38 ++++- .../faceSources/labelToFace/labelToFace.H | 22 ++- .../faceSources/normalToFace/normalToFace.C | 33 +++-- .../faceSources/normalToFace/normalToFace.H | 11 +- .../faceSources/patchToFace/patchToFace.C | 22 ++- .../faceSources/patchToFace/patchToFace.H | 11 +- .../faceSources/pointToFace/pointToFace.C | 29 +++- .../faceSources/pointToFace/pointToFace.H | 11 +- .../faceSources/regionToFace/regionToFace.C | 22 ++- .../faceSources/regionToFace/regionToFace.H | 13 +- .../topoSetFaceSource/topoSetFaceSource.C | 95 +++++++++++++ .../topoSetFaceSource/topoSetFaceSource.H | 133 ++++++++++++++++++ .../sets/faceSources/zoneToFace/zoneToFace.C | 22 ++- .../sets/faceSources/zoneToFace/zoneToFace.H | 11 +- .../setToFaceZone/setToFaceZone.H | 4 +- .../setsToFaceZone/setsToFaceZone.H | 8 +- .../sets/pointSources/boxToPoint/boxToPoint.C | 35 ++++- .../sets/pointSources/boxToPoint/boxToPoint.H | 22 ++- .../pointSources/cellToPoint/cellToPoint.C | 15 +- .../pointSources/cellToPoint/cellToPoint.H | 11 +- .../pointSources/faceToPoint/faceToPoint.C | 15 +- .../pointSources/faceToPoint/faceToPoint.H | 11 +- .../pointSources/labelToPoint/labelToPoint.C | 34 ++++- .../pointSources/labelToPoint/labelToPoint.H | 22 ++- .../nearestToPoint/nearestToPoint.C | 34 ++++- .../nearestToPoint/nearestToPoint.H | 22 ++- .../pointSources/pointToPoint/pointToPoint.C | 9 +- .../pointSources/pointToPoint/pointToPoint.H | 11 +- .../surfaceToPoint/surfaceToPoint.C | 8 +- .../surfaceToPoint/surfaceToPoint.H | 11 +- .../topoSetPointSource/topoSetPointSource.C | 95 +++++++++++++ .../topoSetPointSource/topoSetPointSource.H | 133 ++++++++++++++++++ .../pointSources/zoneToPoint/zoneToPoint.C | 22 ++- .../pointSources/zoneToPoint/zoneToPoint.H | 11 +- .../sets/topoSetSource/topoSetSource.H | 3 +- src/overset/regionsToCell/regionsToCell.C | 57 ++++---- src/overset/regionsToCell/regionsToCell.H | 35 ++--- .../foamyHexMesh/flange/system/faceSetDict | 2 +- 97 files changed, 1756 insertions(+), 741 deletions(-) create mode 100644 src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C create mode 100644 src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.H create mode 100644 src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C create mode 100644 src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.H create mode 100644 src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C create mode 100644 src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.H diff --git a/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C b/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C index c31e2606b9..81788a5703 100644 --- a/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C +++ b/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,13 +33,25 @@ License namespace Foam { - -defineTypeNameAndDebug(badQualityToCell, 0); - -addToRunTimeSelectionTable(topoSetSource, badQualityToCell, word); - -addToRunTimeSelectionTable(topoSetSource, badQualityToCell, istream); - + defineTypeNameAndDebug(badQualityToCell, 0); + addToRunTimeSelectionTable(topoSetSource, badQualityToCell, word); + addToRunTimeSelectionTable(topoSetSource, badQualityToCell, istream); + addToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word); + addToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, istream); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + badQualityToCell, + word, + badQuality + ); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + badQualityToCell, + istream, + badQuality + ); } @@ -59,9 +71,8 @@ void Foam::badQualityToCell::combine(topoSet& set, const bool add) const motionSmoother::checkMesh(false, mesh_, dict_, faces); faces.sync(mesh_); - forAllConstIter(faceSet, faces, iter) + for (const label facei : faces) { - label facei = iter.key(); addOrDelete(set, mesh_.faceOwner()[facei], add); if (mesh_.isInternalFace(facei)) { @@ -73,36 +84,28 @@ void Foam::badQualityToCell::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from dictionary Foam::badQualityToCell::badQualityToCell ( const polyMesh& mesh, const dictionary& dict ) : - topoSetSource(mesh), + topoSetCellSource(mesh), dict_(dict) {} -// Construct from Istream Foam::badQualityToCell::badQualityToCell ( const polyMesh& mesh, Istream& is ) : - topoSetSource(mesh), + topoSetCellSource(mesh), dict_(is) {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::badQualityToCell::~badQualityToCell() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::badQualityToCell::applyToSet diff --git a/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.H b/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.H index 98f6be7a19..942ace2c4a 100644 --- a/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.H +++ b/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,7 +35,7 @@ SourceFiles #ifndef badQualityToCell_H #define badQualityToCell_H -#include "topoSetSource.H" +#include "topoSetCellSource.H" #include "bitSet.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,7 +49,7 @@ namespace Foam class badQualityToCell : - public topoSetSource + public topoSetCellSource { // Private data @@ -74,35 +74,22 @@ public: // Constructors //- Construct from dictionary - badQualityToCell - ( - const polyMesh& mesh, - const dictionary& dict - ); + badQualityToCell(const polyMesh& mesh, const dictionary& dict); //- Construct from Istream - badQualityToCell - ( - const polyMesh& mesh, - Istream& - ); + badQualityToCell(const polyMesh& mesh, Istream& is); //- Destructor - virtual ~badQualityToCell(); + virtual ~badQualityToCell() = default; // Member Functions - virtual sourceType setType() const - { - return CELLSETSOURCE; - } - virtual void applyToSet ( const topoSetSource::setAction action, - topoSet& + topoSet& set ) const; }; diff --git a/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.C b/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.C index dd76d0b0c8..d98621d524 100644 --- a/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.C +++ b/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,13 +33,25 @@ License namespace Foam { - -defineTypeNameAndDebug(badQualityToFace, 0); - -addToRunTimeSelectionTable(topoSetSource, badQualityToFace, word); - -addToRunTimeSelectionTable(topoSetSource, badQualityToFace, istream); - + defineTypeNameAndDebug(badQualityToFace, 0); + addToRunTimeSelectionTable(topoSetSource, badQualityToFace, word); + addToRunTimeSelectionTable(topoSetSource, badQualityToFace, istream); + addToRunTimeSelectionTable(topoSetFaceSource, badQualityToFace, word); + addToRunTimeSelectionTable(topoSetFaceSource, badQualityToFace, istream); + addNamedToRunTimeSelectionTable + ( + topoSetFaceSource, + badQualityToFace, + word, + badQuality + ); + addNamedToRunTimeSelectionTable + ( + topoSetFaceSource, + badQualityToFace, + istream, + badQuality + ); } @@ -59,9 +71,8 @@ void Foam::badQualityToFace::combine(topoSet& set, const bool add) const motionSmoother::checkMesh(false, mesh_, dict_, faces); faces.sync(mesh_); - forAllConstIter(faceSet, faces, iter) + for (const label facei : faces) { - label facei = iter.key(); addOrDelete(set, facei, add); } } @@ -69,36 +80,28 @@ void Foam::badQualityToFace::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from dictionary Foam::badQualityToFace::badQualityToFace ( const polyMesh& mesh, const dictionary& dict ) : - topoSetSource(mesh), + topoSetFaceSource(mesh), dict_(dict) {} -// Construct from Istream Foam::badQualityToFace::badQualityToFace ( const polyMesh& mesh, Istream& is ) : - topoSetSource(mesh), + topoSetFaceSource(mesh), dict_(is) {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::badQualityToFace::~badQualityToFace() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::badQualityToFace::applyToSet diff --git a/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.H b/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.H index e48fe2e030..92ce3a058a 100644 --- a/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.H +++ b/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,7 +35,7 @@ SourceFiles #ifndef badQualityToFace_H #define badQualityToFace_H -#include "topoSetSource.H" +#include "topoSetFaceSource.H" #include "bitSet.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,7 +49,7 @@ namespace Foam class badQualityToFace : - public topoSetSource + public topoSetFaceSource { // Private data @@ -89,20 +89,15 @@ public: //- Destructor - virtual ~badQualityToFace(); + virtual ~badQualityToFace() = default; // Member Functions - virtual sourceType setType() const - { - return CELLSETSOURCE; - } - virtual void applyToSet ( const topoSetSource::setAction action, - topoSet& + topoSet& set ) const; }; diff --git a/src/fvOptions/sources/derived/directionalPressureGradientExplicitSource/directionalPressureGradientExplicitSource.H b/src/fvOptions/sources/derived/directionalPressureGradientExplicitSource/directionalPressureGradientExplicitSource.H index e5831682df..8741de56d1 100644 --- a/src/fvOptions/sources/derived/directionalPressureGradientExplicitSource/directionalPressureGradientExplicitSource.H +++ b/src/fvOptions/sources/derived/directionalPressureGradientExplicitSource/directionalPressureGradientExplicitSource.H @@ -84,13 +84,11 @@ SourceFiles #ifndef directionalPressureGradientExplicitSource_H #define directionalPressureGradientExplicitSource_H -#include "cellSetOption.H" #include "autoPtr.H" -#include "topoSetSource.H" -#include "cellSet.H" #include "fvMesh.H" #include "volFields.H" #include "fvOption.H" +#include "cellSetOption.H" #include "interpolationTable.H" diff --git a/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.H b/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.H index fac0740aed..051888aa9b 100644 --- a/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.H +++ b/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.H @@ -51,8 +51,6 @@ SourceFiles #define meanVelocityForce_H #include "autoPtr.H" -#include "topoSetSource.H" -#include "cellSet.H" #include "fvMesh.H" #include "volFields.H" #include "cellSetOption.H" diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index 58c3fa156f..4fcdeafb7a 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -144,49 +144,55 @@ $(topoSets)/pointZoneSet.C sets/topoSetSource/topoSetSource.C -cellSources = sets/cellSources -$(cellSources)/faceToCell/faceToCell.C -$(cellSources)/fieldToCell/fieldToCell.C -$(cellSources)/pointToCell/pointToCell.C -$(cellSources)/shapeToCell/shapeToCell.C +cellSources = sets/cellSources +$(cellSources)/topoSetCellSource/topoSetCellSource.C $(cellSources)/boxToCell/boxToCell.C +$(cellSources)/cellToCell/cellToCell.C +$(cellSources)/cylinderAnnulusToCell/cylinderAnnulusToCell.C +$(cellSources)/cylinderToCell/cylinderToCell.C +$(cellSources)/faceToCell/faceToCell.C +$(cellSources)/faceZoneToCell/faceZoneToCell.C +$(cellSources)/fieldToCell/fieldToCell.C +$(cellSources)/labelToCell/labelToCell.C +$(cellSources)/nbrToCell/nbrToCell.C +$(cellSources)/nearestToCell/nearestToCell.C +$(cellSources)/noneToCell/noneToCell.C +$(cellSources)/pointToCell/pointToCell.C $(cellSources)/regionToCell/regionToCell.C $(cellSources)/rotatedBoxToCell/rotatedBoxToCell.C -$(cellSources)/labelToCell/labelToCell.C -$(cellSources)/surfaceToCell/surfaceToCell.C -$(cellSources)/cellToCell/cellToCell.C -$(cellSources)/nearestToCell/nearestToCell.C -$(cellSources)/nbrToCell/nbrToCell.C -$(cellSources)/zoneToCell/zoneToCell.C +$(cellSources)/shapeToCell/shapeToCell.C $(cellSources)/sphereToCell/sphereToCell.C -$(cellSources)/cylinderToCell/cylinderToCell.C -$(cellSources)/faceZoneToCell/faceZoneToCell.C -$(cellSources)/cylinderAnnulusToCell/cylinderAnnulusToCell.C +$(cellSources)/surfaceToCell/surfaceToCell.C $(cellSources)/targetVolumeToCell/targetVolumeToCell.C +$(cellSources)/zoneToCell/zoneToCell.C faceSources = sets/faceSources +$(faceSources)/topoSetFaceSource/topoSetFaceSource.C +$(faceSources)/boundaryToFace/boundaryToFace.C +$(faceSources)/boxToFace/boxToFace.C +$(faceSources)/cellToFace/cellToFace.C +$(faceSources)/cylinderAnnulusToFace/cylinderAnnulusToFace.C +$(faceSources)/cylinderToFace/cylinderToFace.C $(faceSources)/faceToFace/faceToFace.C $(faceSources)/labelToFace/labelToFace.C -$(faceSources)/cellToFace/cellToFace.C +$(faceSources)/noneToFace/noneToFace.C $(faceSources)/normalToFace/normalToFace.C -$(faceSources)/pointToFace/pointToFace.C $(faceSources)/patchToFace/patchToFace.C -$(faceSources)/boundaryToFace/boundaryToFace.C -$(faceSources)/zoneToFace/zoneToFace.C -$(faceSources)/boxToFace/boxToFace.C +$(faceSources)/pointToFace/pointToFace.C $(faceSources)/regionToFace/regionToFace.C -$(faceSources)/cylinderToFace/cylinderToFace.C -$(faceSources)/cylinderAnnulusToFace/cylinderAnnulusToFace.C +$(faceSources)/zoneToFace/zoneToFace.C pointSources = sets/pointSources -$(pointSources)/labelToPoint/labelToPoint.C -$(pointSources)/pointToPoint/pointToPoint.C +$(pointSources)/topoSetPointSource/topoSetPointSource.C +$(pointSources)/boxToPoint/boxToPoint.C $(pointSources)/cellToPoint/cellToPoint.C $(pointSources)/faceToPoint/faceToPoint.C -$(pointSources)/boxToPoint/boxToPoint.C +$(pointSources)/labelToPoint/labelToPoint.C +$(pointSources)/nearestToPoint/nearestToPoint.C +$(pointSources)/noneToPoint/noneToPoint.C +$(pointSources)/pointToPoint/pointToPoint.C $(pointSources)/surfaceToPoint/surfaceToPoint.C $(pointSources)/zoneToPoint/zoneToPoint.C -$(pointSources)/nearestToPoint/nearestToPoint.C faceZoneSources = sets/faceZoneSources $(faceZoneSources)/faceZoneToFaceZone/faceZoneToFaceZone.C diff --git a/src/meshTools/sets/cellSources/boxToCell/boxToCell.C b/src/meshTools/sets/cellSources/boxToCell/boxToCell.C index 377a36d455..5d4b7bcd4c 100644 --- a/src/meshTools/sets/cellSources/boxToCell/boxToCell.C +++ b/src/meshTools/sets/cellSources/boxToCell/boxToCell.C @@ -34,6 +34,22 @@ namespace Foam defineTypeNameAndDebug(boxToCell, 0); addToRunTimeSelectionTable(topoSetSource, boxToCell, word); addToRunTimeSelectionTable(topoSetSource, boxToCell, istream); + addToRunTimeSelectionTable(topoSetCellSource, boxToCell, word); + addToRunTimeSelectionTable(topoSetCellSource, boxToCell, istream); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + boxToCell, + word, + box + ); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + boxToCell, + istream, + box + ); } @@ -73,18 +89,29 @@ Foam::boxToCell::boxToCell const treeBoundBoxList& bbs ) : - topoSetSource(mesh), + topoSetCellSource(mesh), bbs_(bbs) {} +Foam::boxToCell::boxToCell +( + const polyMesh& mesh, + treeBoundBoxList&& bbs +) +: + topoSetCellSource(mesh), + bbs_(std::move(bbs)) +{} + + Foam::boxToCell::boxToCell ( const polyMesh& mesh, const dictionary& dict ) : - topoSetSource(mesh), + topoSetCellSource(mesh), bbs_() { // Look for 'boxes' or 'box' @@ -102,8 +129,8 @@ Foam::boxToCell::boxToCell Istream& is ) : - topoSetSource(mesh), - bbs_(1, treeBoundBox(checkIs(is))) + topoSetCellSource(mesh), + bbs_(one(), treeBoundBox(checkIs(is))) {} diff --git a/src/meshTools/sets/cellSources/boxToCell/boxToCell.H b/src/meshTools/sets/cellSources/boxToCell/boxToCell.H index ce69cda4eb..09a7920f11 100644 --- a/src/meshTools/sets/cellSources/boxToCell/boxToCell.H +++ b/src/meshTools/sets/cellSources/boxToCell/boxToCell.H @@ -25,7 +25,7 @@ Class Foam::boxToCell Description - A topoSetSource to select cells based on cell centres inside box(es). + A topoSetCellSource to select cells based on cell centres inside box(es). \heading Dictionary parameters \table @@ -46,7 +46,7 @@ SourceFiles #ifndef boxToCell_H #define boxToCell_H -#include "topoSetSource.H" +#include "topoSetCellSource.H" #include "treeBoundBoxList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -60,7 +60,7 @@ namespace Foam class boxToCell : - public topoSetSource + public topoSetCellSource { // Private data @@ -83,12 +83,11 @@ public: // Constructors - //- Construct from components - boxToCell - ( - const polyMesh& mesh, - const treeBoundBoxList& bbs - ); + //- Construct from components, copying bounding boxes + boxToCell(const polyMesh& mesh, const treeBoundBoxList& bbs); + + //- Construct from components, moving bounding boxes + boxToCell(const polyMesh& mesh, treeBoundBoxList&& bbs); //- Construct from dictionary boxToCell(const polyMesh& mesh, const dictionary& dict); @@ -103,11 +102,6 @@ public: // Member Functions - virtual sourceType setType() const - { - return CELLSETSOURCE; - } - virtual void applyToSet ( const topoSetSource::setAction action, diff --git a/src/meshTools/sets/cellSources/cellToCell/cellToCell.C b/src/meshTools/sets/cellSources/cellToCell/cellToCell.C index 6761dab811..565ad65e34 100644 --- a/src/meshTools/sets/cellSources/cellToCell/cellToCell.C +++ b/src/meshTools/sets/cellSources/cellToCell/cellToCell.C @@ -35,6 +35,8 @@ namespace Foam defineTypeNameAndDebug(cellToCell, 0); addToRunTimeSelectionTable(topoSetSource, cellToCell, word); addToRunTimeSelectionTable(topoSetSource, cellToCell, istream); + addToRunTimeSelectionTable(topoSetCellSource, cellToCell, word); + addToRunTimeSelectionTable(topoSetCellSource, cellToCell, istream); } @@ -54,7 +56,7 @@ Foam::cellToCell::cellToCell const word& setName ) : - topoSetSource(mesh), + topoSetCellSource(mesh), setName_(setName) {} @@ -65,8 +67,11 @@ Foam::cellToCell::cellToCell const dictionary& dict ) : - topoSetSource(mesh), - setName_(dict.get("set")) + cellToCell + ( + mesh, + dict.get("set") + ) {} @@ -76,7 +81,7 @@ Foam::cellToCell::cellToCell Istream& is ) : - topoSetSource(mesh), + topoSetCellSource(mesh), setName_(checkIs(is)) {} diff --git a/src/meshTools/sets/cellSources/cellToCell/cellToCell.H b/src/meshTools/sets/cellSources/cellToCell/cellToCell.H index 23fb8be3d8..2b619f12f0 100644 --- a/src/meshTools/sets/cellSources/cellToCell/cellToCell.H +++ b/src/meshTools/sets/cellSources/cellToCell/cellToCell.H @@ -25,7 +25,7 @@ Class Foam::cellToCell Description - A topoSetSource to select the cells from another cellSet. + A topoSetCellSource to select the cells from another cellSet. \heading Dictionary parameters \table @@ -41,7 +41,7 @@ SourceFiles #ifndef cellToCell_H #define cellToCell_H -#include "topoSetSource.H" +#include "topoSetCellSource.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,7 +54,7 @@ namespace Foam class cellToCell : - public topoSetSource + public topoSetCellSource { // Private data @@ -72,11 +72,7 @@ public: // Constructors //- Construct from components - cellToCell - ( - const polyMesh& mesh, - const word& setName - ); + cellToCell(const polyMesh& mesh, const word& setName); //- Construct from dictionary cellToCell(const polyMesh& mesh, const dictionary& dict); @@ -91,11 +87,6 @@ public: // Member Functions - virtual sourceType setType() const - { - return CELLSETSOURCE; - } - virtual void applyToSet ( const topoSetSource::setAction action, diff --git a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C index 6a88cfb80e..033b7602ce 100644 --- a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C +++ b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C @@ -34,6 +34,32 @@ namespace Foam defineTypeNameAndDebug(cylinderAnnulusToCell, 0); addToRunTimeSelectionTable(topoSetSource, cylinderAnnulusToCell, word); addToRunTimeSelectionTable(topoSetSource, cylinderAnnulusToCell, istream); + addToRunTimeSelectionTable + ( + topoSetCellSource, + cylinderAnnulusToCell, + word + ); + addToRunTimeSelectionTable + ( + topoSetCellSource, + cylinderAnnulusToCell, + istream + ); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + cylinderAnnulusToCell, + word, + cylinderAnnulus + ); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + cylinderAnnulusToCell, + istream, + cylinderAnnulus + ); } @@ -85,7 +111,7 @@ Foam::cylinderAnnulusToCell::cylinderAnnulusToCell const scalar innerRadius ) : - topoSetSource(mesh), + topoSetCellSource(mesh), point1_(point1), point2_(point2), outerRadius_(outerRadius), @@ -99,11 +125,14 @@ Foam::cylinderAnnulusToCell::cylinderAnnulusToCell const dictionary& dict ) : - topoSetSource(mesh), - point1_(dict.get("p1")), - point2_(dict.get("p2")), - outerRadius_(dict.get("outerRadius")), - innerRadius_(dict.get("innerRadius")) + cylinderAnnulusToCell + ( + mesh, + dict.get("p1"), + dict.get("p2"), + dict.get("outerRadius"), + dict.get("innerRadius") + ) {} @@ -113,7 +142,7 @@ Foam::cylinderAnnulusToCell::cylinderAnnulusToCell Istream& is ) : - topoSetSource(mesh), + topoSetCellSource(mesh), point1_(checkIs(is)), point2_(checkIs(is)), outerRadius_(readScalar(checkIs(is))), diff --git a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.H b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.H index af8bd0bad2..9c02f64dfd 100644 --- a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.H +++ b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.H @@ -25,7 +25,7 @@ Class Foam::cylinderAnnulusToCell Description - A topoSetSource to select cells based on cell centres inside a + A topoSetCellSource to select cells based on cell centres inside a cylinder annulus. \heading Dictionary parameters @@ -45,7 +45,7 @@ SourceFiles #ifndef cylinderAnnulusToCell_H #define cylinderAnnulusToCell_H -#include "topoSetSource.H" +#include "topoSetCellSource.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,7 +58,7 @@ namespace Foam class cylinderAnnulusToCell : - public topoSetSource + public topoSetCellSource { // Private data @@ -99,7 +99,7 @@ public: const point& point1, const point& point2, const scalar outerRadius, - const scalar innerRadius + const scalar innerRadius = 0 ); //- Construct from dictionary @@ -115,11 +115,6 @@ public: // Member Functions - virtual sourceType setType() const - { - return CELLSETSOURCE; - } - virtual void applyToSet ( const topoSetSource::setAction action, diff --git a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C index a8ceeb408b..910868d171 100644 --- a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C +++ b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C @@ -34,6 +34,22 @@ namespace Foam defineTypeNameAndDebug(cylinderToCell, 0); addToRunTimeSelectionTable(topoSetSource, cylinderToCell, word); addToRunTimeSelectionTable(topoSetSource, cylinderToCell, istream); + addToRunTimeSelectionTable(topoSetCellSource, cylinderToCell, word); + addToRunTimeSelectionTable(topoSetCellSource, cylinderToCell, istream); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + cylinderToCell, + word, + cylinder + ); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + cylinderToCell, + istream, + cylinder + ); } @@ -82,7 +98,7 @@ Foam::cylinderToCell::cylinderToCell const scalar radius ) : - topoSetSource(mesh), + topoSetCellSource(mesh), point1_(point1), point2_(point2), radius_(radius) @@ -95,10 +111,13 @@ Foam::cylinderToCell::cylinderToCell const dictionary& dict ) : - topoSetSource(mesh), - point1_(dict.get("p1")), - point2_(dict.get("p2")), - radius_(dict.get("radius")) + cylinderToCell + ( + mesh, + dict.get("p1"), + dict.get("p2"), + dict.get("radius") + ) {} @@ -108,7 +127,7 @@ Foam::cylinderToCell::cylinderToCell Istream& is ) : - topoSetSource(mesh), + topoSetCellSource(mesh), point1_(checkIs(is)), point2_(checkIs(is)), radius_(readScalar(checkIs(is))) diff --git a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.H b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.H index 0d3db7640a..f87bd7dbdc 100644 --- a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.H +++ b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.H @@ -25,7 +25,7 @@ Class Foam::cylinderToCell Description - A topoSetSource to select cells based on cell centres inside a cylinder. + A topoSetCellSource to select cells with their centres inside a cylinder. \heading Dictionary parameters \table @@ -43,7 +43,7 @@ SourceFiles #ifndef cylinderToCell_H #define cylinderToCell_H -#include "topoSetSource.H" +#include "topoSetCellSource.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -56,7 +56,7 @@ namespace Foam class cylinderToCell : - public topoSetSource + public topoSetCellSource { // Private data @@ -109,11 +109,6 @@ public: // Member Functions - virtual sourceType setType() const - { - return CELLSETSOURCE; - } - virtual void applyToSet ( const topoSetSource::setAction action, diff --git a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C index 5499aaa963..5966d80fa2 100644 --- a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C +++ b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C @@ -35,6 +35,8 @@ namespace Foam defineTypeNameAndDebug(faceToCell, 0); addToRunTimeSelectionTable(topoSetSource, faceToCell, word); addToRunTimeSelectionTable(topoSetSource, faceToCell, istream); + addToRunTimeSelectionTable(topoSetCellSource, faceToCell, word); + addToRunTimeSelectionTable(topoSetCellSource, faceToCell, istream); } @@ -133,7 +135,7 @@ Foam::faceToCell::faceToCell const faceAction option ) : - topoSetSource(mesh), + topoSetCellSource(mesh), setName_(setName), option_(option) {} @@ -145,9 +147,12 @@ Foam::faceToCell::faceToCell const dictionary& dict ) : - topoSetSource(mesh), - setName_(dict.get("set")), - option_(faceActionNames_.get("option", dict)) + faceToCell + ( + mesh, + dict.get("set"), + faceActionNames_.get("option", dict) + ) {} @@ -157,7 +162,7 @@ Foam::faceToCell::faceToCell Istream& is ) : - topoSetSource(mesh), + topoSetCellSource(mesh), setName_(checkIs(is)), option_(faceActionNames_.read(checkIs(is))) {} diff --git a/src/meshTools/sets/cellSources/faceToCell/faceToCell.H b/src/meshTools/sets/cellSources/faceToCell/faceToCell.H index ced05a8f4e..64e85b3817 100644 --- a/src/meshTools/sets/cellSources/faceToCell/faceToCell.H +++ b/src/meshTools/sets/cellSources/faceToCell/faceToCell.H @@ -25,7 +25,7 @@ Class Foam::faceToCell Description - A topoSetSource to select cells based on usage in a face set. + A topoSetCellSource to select cells based on usage in a face set. \heading Dictionary parameters \table @@ -42,7 +42,7 @@ SourceFiles #ifndef faceToCell_H #define faceToCell_H -#include "topoSetSource.H" +#include "topoSetCellSource.H" #include "Enum.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -56,7 +56,7 @@ namespace Foam class faceToCell : - public topoSetSource + public topoSetCellSource { public: //- Enumeration defining the valid options @@ -118,11 +118,6 @@ public: // Member Functions - virtual sourceType setType() const - { - return CELLSETSOURCE; - } - virtual void applyToSet ( const topoSetSource::setAction action, diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C index 68c81f2267..8079cd72d0 100644 --- a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C +++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C @@ -34,6 +34,8 @@ namespace Foam defineTypeNameAndDebug(faceZoneToCell, 0); addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, word); addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, istream); + addToRunTimeSelectionTable(topoSetCellSource, faceZoneToCell, word); + addToRunTimeSelectionTable(topoSetCellSource, faceZoneToCell, istream); } @@ -111,7 +113,7 @@ Foam::faceZoneToCell::faceZoneToCell const faceAction option ) : - topoSetSource(mesh), + topoSetCellSource(mesh), selectedZones_(one(), zoneName), option_(option) {} @@ -123,7 +125,7 @@ Foam::faceZoneToCell::faceZoneToCell const dictionary& dict ) : - topoSetSource(mesh), + topoSetCellSource(mesh), selectedZones_(), option_(faceActionNames_.get("option", dict)) { @@ -143,7 +145,7 @@ Foam::faceZoneToCell::faceZoneToCell Istream& is ) : - topoSetSource(mesh), + topoSetCellSource(mesh), selectedZones_(one(), wordRe(checkIs(is))), option_(faceActionNames_.read(checkIs(is))) {} diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.H b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.H index 33f24e706b..e082198271 100644 --- a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.H +++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.H @@ -25,7 +25,7 @@ Class Foam::faceZoneToCell Description - A topoSetSource to select cells based on side of faceZone. + A topoSetCellSource to select cells based on side of faceZone. \heading Dictionary parameters \table @@ -47,7 +47,7 @@ SourceFiles #ifndef faceZoneToCell_H #define faceZoneToCell_H -#include "topoSetSource.H" +#include "topoSetCellSource.H" #include "wordRes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -61,7 +61,7 @@ namespace Foam class faceZoneToCell : - public topoSetSource + public topoSetCellSource { public: //- Enumeration defining the valid options @@ -120,11 +120,6 @@ public: // Member Functions - virtual topoSetSource::sourceType setType() const - { - return CELLSETSOURCE; - } - virtual void applyToSet ( const topoSetSource::setAction action, diff --git a/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C b/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C index 150eeb2ab9..c12bbab2c4 100644 --- a/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C +++ b/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C @@ -38,6 +38,22 @@ namespace Foam defineTypeNameAndDebug(fieldToCell, 0); addToRunTimeSelectionTable(topoSetSource, fieldToCell, word); addToRunTimeSelectionTable(topoSetSource, fieldToCell, istream); + addToRunTimeSelectionTable(topoSetCellSource, fieldToCell, word); + addToRunTimeSelectionTable(topoSetCellSource, fieldToCell, istream); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + fieldToCell, + word, + field + ); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + fieldToCell, + istream, + field + ); } @@ -100,7 +116,7 @@ Foam::fieldToCell::fieldToCell const scalar max ) : - topoSetSource(mesh), + topoSetCellSource(mesh), fieldName_(fieldName), min_(min), max_(max) @@ -113,10 +129,13 @@ Foam::fieldToCell::fieldToCell const dictionary& dict ) : - topoSetSource(mesh), - fieldName_(dict.get("field")), - min_(dict.get("min")), - max_(dict.get("max")) + fieldToCell + ( + mesh, + dict.get("field"), + dict.get("min"), + dict.get("max") + ) {} @@ -126,7 +145,7 @@ Foam::fieldToCell::fieldToCell Istream& is ) : - topoSetSource(mesh), + topoSetCellSource(mesh), fieldName_(checkIs(is)), min_(readScalar(checkIs(is))), max_(readScalar(checkIs(is))) diff --git a/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.H b/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.H index c09e2773c8..6b596f166e 100644 --- a/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.H +++ b/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.H @@ -25,7 +25,7 @@ Class Foam::fieldToCell Description - A topoSetSource to select cells based on field values. + A topoSetCellSource to select cells based on field values. \heading Dictionary parameters \table @@ -43,7 +43,7 @@ SourceFiles #ifndef fieldToCell_H #define fieldToCell_H -#include "topoSetSource.H" +#include "topoSetCellSource.H" #include "scalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,7 +57,7 @@ namespace Foam class fieldToCell : - public topoSetSource + public topoSetCellSource { // Private data @@ -115,11 +115,6 @@ public: // Member Functions - virtual sourceType setType() const - { - return CELLSETSOURCE; - } - virtual void applyToSet ( const topoSetSource::setAction action, diff --git a/src/meshTools/sets/cellSources/labelToCell/labelToCell.C b/src/meshTools/sets/cellSources/labelToCell/labelToCell.C index 13fda7b6d9..a314644f5e 100644 --- a/src/meshTools/sets/cellSources/labelToCell/labelToCell.C +++ b/src/meshTools/sets/cellSources/labelToCell/labelToCell.C @@ -34,6 +34,22 @@ namespace Foam defineTypeNameAndDebug(labelToCell, 0); addToRunTimeSelectionTable(topoSetSource, labelToCell, word); addToRunTimeSelectionTable(topoSetSource, labelToCell, istream); + addToRunTimeSelectionTable(topoSetCellSource, labelToCell, word); + addToRunTimeSelectionTable(topoSetCellSource, labelToCell, istream); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + labelToCell, + word, + label + ); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + labelToCell, + istream, + label + ); } @@ -53,19 +69,29 @@ Foam::labelToCell::labelToCell const labelList& labels ) : - topoSetSource(mesh), + topoSetCellSource(mesh), labels_(labels) {} +Foam::labelToCell::labelToCell +( + const polyMesh& mesh, + labelList&& labels +) +: + topoSetCellSource(mesh), + labels_(std::move(labels)) +{} + + Foam::labelToCell::labelToCell ( const polyMesh& mesh, const dictionary& dict ) : - topoSetSource(mesh), - labels_(dict.get("value")) + labelToCell(mesh, dict.get("value")) {} @@ -75,7 +101,7 @@ Foam::labelToCell::labelToCell Istream& is ) : - topoSetSource(mesh), + topoSetCellSource(mesh), labels_(checkIs(is)) { check(labels_, mesh.nCells()); diff --git a/src/meshTools/sets/cellSources/labelToCell/labelToCell.H b/src/meshTools/sets/cellSources/labelToCell/labelToCell.H index ca9c12e1ff..d9f1c06b3c 100644 --- a/src/meshTools/sets/cellSources/labelToCell/labelToCell.H +++ b/src/meshTools/sets/cellSources/labelToCell/labelToCell.H @@ -25,7 +25,7 @@ Class Foam::labelToCell Description - A topoSetSource to select cells based on explicitly given labels. + A topoSetCellSource to select cells based on explicitly given labels. \heading Dictionary parameters \table @@ -41,7 +41,7 @@ SourceFiles #ifndef labelToCell_H #define labelToCell_H -#include "topoSetSource.H" +#include "topoSetCellSource.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,7 +54,7 @@ namespace Foam class labelToCell : - public topoSetSource + public topoSetCellSource { // Private data @@ -73,12 +73,11 @@ public: // Constructors - //- Construct from components - labelToCell - ( - const polyMesh& mesh, - const labelList& labels - ); + //- Construct from components, copying labels + labelToCell(const polyMesh& mesh, const labelList& labels); + + //- Construct from components, moving labels + labelToCell(const polyMesh& mesh, labelList&& labels); //- Construct from dictionary labelToCell(const polyMesh& mesh, const dictionary& dict); @@ -93,11 +92,6 @@ public: // Member Functions - virtual sourceType setType() const - { - return CELLSETSOURCE; - } - virtual void applyToSet ( const topoSetSource::setAction action, diff --git a/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C b/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C index e4c55b966b..7201163abc 100644 --- a/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C +++ b/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C @@ -34,6 +34,22 @@ namespace Foam defineTypeNameAndDebug(nbrToCell, 0); addToRunTimeSelectionTable(topoSetSource, nbrToCell, word); addToRunTimeSelectionTable(topoSetSource, nbrToCell, istream); + addToRunTimeSelectionTable(topoSetCellSource, nbrToCell, word); + addToRunTimeSelectionTable(topoSetCellSource, nbrToCell, istream); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + nbrToCell, + word, + nbr + ); + addNamedToRunTimeSelectionTable + ( + topoSetCellSource, + nbrToCell, + istream, + nbr + ); } @@ -101,7 +117,7 @@ Foam::nbrToCell::nbrToCell const label minNbrs ) : - topoSetSource(mesh), + topoSetCellSource(mesh), minNbrs_(minNbrs) {} @@ -112,8 +128,7 @@ Foam::nbrToCell::nbrToCell const dictionary& dict ) : - topoSetSource(mesh), - minNbrs_(dict.get