Skip to content
Snippets Groups Projects
Commit 12fc4171 authored by Philippose Rajan's avatar Philippose Rajan
Browse files

triSurface mesh also now supports finding patches using regular expressions

parent 24593943
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@ Description
#include "pointIOField.H"
#include "IOobjectList.H"
#include "pointSet.H"
#include "stringListOps.H"
namespace Foam
{
......@@ -72,6 +73,33 @@ triSurfFacets::~triSurfFacets()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
wordList triSurfFacets::patchNames() const
{
wordList t(patches_.size());
forAll(patches_, patchI)
{
t[patchI] = patches_[patchI].name();
}
return t;
}
labelList triSurfFacets::findPatches(const word& patchName) const
{
wordList allPatches = patchNames();
labelList patchIDs = findStrings(patchName, allPatches);
if(patchIDs.empty())
{
WarningIn("triSurfFacets::findPatches(const word&)")
<< "Cannot find any patch names matching " << patchName << endl;
}
return patchIDs;
}
label triSurfFacets::addFacetSubset(const word& subsetName)
{
label id = facetSubsetIndex(subsetName);
......
......@@ -98,6 +98,13 @@ public:
//- access to patches
inline const geometricSurfacePatchList& patches() const;
//- return list of patches in the boundary
wordList patchNames() const;
//- return a list of patch indices corresponding to the given
// name, expanding regular expressions
labelList findPatches(const word& patchName) const;
//- append a triangle to the end of the list
inline void appendTriangle(const labelledTri& tria);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment