diff --git a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C index 63fa357bc9b45876fe13be6763ded94e1320d463..94f1c23a752ba0a07091ecff23b286ecee02dfc6 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C @@ -263,6 +263,68 @@ Foam::wordList Foam::ZoneMesh<ZoneType, MeshType>::names() const } +template<class ZoneType, class MeshType> +Foam::wordList Foam::ZoneMesh<ZoneType, MeshType>::names +( + const wordRe& matcher +) const +{ + wordList lst = this->names(); + + return wordList(lst, findStrings(matcher, lst)); +} + + +template<class ZoneType, class MeshType> +Foam::wordList Foam::ZoneMesh<ZoneType, MeshType>::names +( + const wordReList& matcher +) +const +{ + wordList lst = this->names(); + + return wordList(lst, findStrings(matcher, lst)); +} + + +template<class ZoneType, class MeshType> +Foam::wordList Foam::ZoneMesh<ZoneType, MeshType>::sortedNames() const +{ + wordList sortedLst = this->names(); + sort(sortedLst); + + return sortedLst; +} + + +template<class ZoneType, class MeshType> +Foam::wordList Foam::ZoneMesh<ZoneType, MeshType>::sortedNames +( + const wordRe& matcher +) const +{ + wordList sortedLst = this->names(matcher); + sort(sortedLst); + + return sortedLst; +} + + +template<class ZoneType, class MeshType> +Foam::wordList Foam::ZoneMesh<ZoneType, MeshType>::sortedNames +( + const wordReList& matcher +) +const +{ + wordList sortedLst = this->names(matcher); + sort(sortedLst); + + return sortedLst; +} + + template<class ZoneType, class MeshType> Foam::labelList Foam::ZoneMesh<ZoneType, MeshType>::findIndices ( diff --git a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.H b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.H index 06ee30f5e975e78202aa2bf2977035190d7da8bd..7d79a37a1e8237bccf670c24cd8decec59665142 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,6 +40,7 @@ SourceFiles #include "pointField.H" #include "Map.H" #include "PackedBoolList.H" +#include "wordReList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -80,10 +81,10 @@ class ZoneMesh bool read(); //- Disallow construct as copy - ZoneMesh(const ZoneMesh&); + ZoneMesh(const ZoneMesh&) = delete; //- Disallow assignment - void operator=(const ZoneMesh<ZoneType, MeshType>&); + void operator=(const ZoneMesh<ZoneType, MeshType>&) = delete; //- Create zone map @@ -141,9 +142,25 @@ public: //- Return a list of zone types wordList types() const; - //- Return a list of zone names + //- A list of the zone names wordList names() const; + //- A list of the zone names satisfying the input matcher + wordList names(const wordRe&) const; + + //- A list of the zone names satisfying the input matchers + wordList names(const wordReList&) const; + + //- Sorted list of the zone names + wordList sortedNames() const; + + //- Sorted list of the zone names satisfying the input matcher + wordList sortedNames(const wordRe&) const; + + //- Sorted list of the zone names satisfying the input matchers + wordList sortedNames(const wordReList&) const; + + //- Return zone indices for all matches labelList findIndices(const keyType&) const;