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

Local Refinement now supports specification of patches in the meshDict file...

Local Refinement now supports specification of patches in the meshDict file using regular expressions

Signed-off-by: default avatarPhilippose Rajan <sarith@rocketmail.com>
parent 12fc4171
Branches
Tags
No related merge requests found
...@@ -168,8 +168,9 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters() ...@@ -168,8 +168,9 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
{ {
const dictionary& dict = meshDictPtr_->subDict("patchCellSize"); const dictionary& dict = meshDictPtr_->subDict("patchCellSize");
const wordList patchNames = dict.toc(); const wordList patchNames = dict.toc();
const wordList allPatches = surface.patchNames();
refPatches.setSize(patchNames.size()); refPatches.setSize(allPatches.size());
label counter(0); label counter(0);
forAll(patchNames, patchI) forAll(patchNames, patchI)
...@@ -180,8 +181,12 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters() ...@@ -180,8 +181,12 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
const dictionary& patchDict = dict.subDict(patchNames[patchI]); const dictionary& patchDict = dict.subDict(patchNames[patchI]);
const scalar cs = readScalar(patchDict.lookup("cellSize")); const scalar cs = readScalar(patchDict.lookup("cellSize"));
refPatches[counter] = patchRefinement(patchNames[patchI], cs); labelList matchedIDs = surface.findPatches(patchNames[patchI]);
++counter; forAll(matchedIDs, matchI)
{
refPatches[counter] = patchRefinement(allPatches[matchI], cs);
++counter;
}
} }
refPatches.setSize(counter); refPatches.setSize(counter);
...@@ -317,11 +322,6 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters() ...@@ -317,11 +322,6 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
const dictionary& dict = meshDictPtr_->subDict("localRefinement"); const dictionary& dict = meshDictPtr_->subDict("localRefinement");
const wordList entries = dict.toc(); const wordList entries = dict.toc();
//- map patch name to its index
std::map<word, label> patchToIndex;
forAll(surface.patches(), patchI)
patchToIndex[surface.patches()[patchI].name()] = patchI;
//- map a facet subset name to its index //- map a facet subset name to its index
std::map<word, label> setToIndex; std::map<word, label> setToIndex;
DynList<label> setIDs; DynList<label> setIDs;
...@@ -369,10 +369,12 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters() ...@@ -369,10 +369,12 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
const direction level = globalRefLevel_ + nLevel; const direction level = globalRefLevel_ + nLevel;
if( patchToIndex.find(pName) != patchToIndex.end() ) labelList matchedPatches = surface.findPatches(pName);
forAll(matchedPatches, matchI)
{ {
//- patch-based refinement //- patch-based refinement
const label patchI = patchToIndex[pName]; const label patchI = matchedPatches[matchI];
forAll(surface, triI) forAll(surface, triI)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment