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
......@@ -168,8 +168,9 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
{
const dictionary& dict = meshDictPtr_->subDict("patchCellSize");
const wordList patchNames = dict.toc();
const wordList allPatches = surface.patchNames();
refPatches.setSize(patchNames.size());
refPatches.setSize(allPatches.size());
label counter(0);
forAll(patchNames, patchI)
......@@ -180,9 +181,13 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
const dictionary& patchDict = dict.subDict(patchNames[patchI]);
const scalar cs = readScalar(patchDict.lookup("cellSize"));
refPatches[counter] = patchRefinement(patchNames[patchI], cs);
labelList matchedIDs = surface.findPatches(patchNames[patchI]);
forAll(matchedIDs, matchI)
{
refPatches[counter] = patchRefinement(allPatches[matchI], cs);
++counter;
}
}
refPatches.setSize(counter);
}
......@@ -317,11 +322,6 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
const dictionary& dict = meshDictPtr_->subDict("localRefinement");
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
std::map<word, label> setToIndex;
DynList<label> setIDs;
......@@ -369,10 +369,12 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
const direction level = globalRefLevel_ + nLevel;
if( patchToIndex.find(pName) != patchToIndex.end() )
labelList matchedPatches = surface.findPatches(pName);
forAll(matchedPatches, matchI)
{
//- patch-based refinement
const label patchI = patchToIndex[pName];
const label patchI = matchedPatches[matchI];
forAll(surface, triI)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment