ENH: createPatchDict: renamed dictionary entry

This commit is contained in:
mattijs
2013-12-11 17:16:40 +00:00
parent 644e9f3a48
commit 6f46553895
2 changed files with 20 additions and 19 deletions

View File

@ -83,6 +83,7 @@ label addPatch
pp.inGroups().append(groupName); pp.inGroups().append(groupName);
} }
// Add patch, create calculated everywhere // Add patch, create calculated everywhere
fvMeshTools::addPatch fvMeshTools::addPatch
( (
@ -636,18 +637,17 @@ int main(int argc, char *argv[])
// Note: This is added for the particular case where we want // Note: This is added for the particular case where we want
// master and slave in different groupNames // master and slave in different groupNames
// (ie 3D thermal baffles) // (ie 3D thermal baffles)
bool groupBase = false;
if (patchSource.found("groupBase"))
{
groupBase = readBool(patchSource.lookup("groupBase"));
if (groupBase) Switch sameGroup
{ (
groupNameMaster = groupName + "Group_master"; patchSource.lookupOrDefault("sameGroup", true)
groupNameSlave = groupName + "Group_slave"; );
patchDictMaster.set("coupleGroup", groupNameMaster); if (!sameGroup)
patchDictSlave.set("coupleGroup", groupNameSlave); {
} groupNameMaster = groupName + "Group_master";
groupNameSlave = groupName + "Group_slave";
patchDictMaster.set("coupleGroup", groupNameMaster);
patchDictSlave.set("coupleGroup", groupNameSlave);
} }
addPatch(mesh, masterName, groupNameMaster, patchDictMaster); addPatch(mesh, masterName, groupNameMaster, patchDictMaster);
@ -818,11 +818,11 @@ int main(int argc, char *argv[])
else else
{ {
const dictionary& patchSource = dict.subDict("patchPairs"); const dictionary& patchSource = dict.subDict("patchPairs");
bool groupBase = false;
if (patchSource.found("groupBase")) Switch sameGroup
{ (
groupBase = readBool(patchSource.lookup("groupBase")); patchSource.lookupOrDefault("sameGroup", true)
} );
const word& groupName = selectors[selectorI].name(); const word& groupName = selectors[selectorI].name();
@ -833,7 +833,7 @@ int main(int argc, char *argv[])
"patchFields" "patchFields"
); );
if (!groupBase) if (sameGroup)
{ {
// Add coupleGroup to all entries // Add coupleGroup to all entries
forAllIter(dictionary, patchFieldsDict, iter) forAllIter(dictionary, patchFieldsDict, iter)

View File

@ -52,8 +52,9 @@ baffles
{ {
type mappedWall; type mappedWall;
sampleMode nearestPatchFace; sampleMode nearestPatchFace;
//Group master and slave in different groups. (default off) // Put master and slave patch in same group (default on)
groupBase on; // Otherwise makeup group names xxx_master and xxx_slave
sameGroup off;
patchFields patchFields
{ {
#include "./0/include/wallBafflePatches" #include "./0/include/wallBafflePatches"