ENH: snappyHexMesh: rename switch from keepHex to mergePatchFaces

This commit is contained in:
mattijs
2014-02-28 12:35:34 +00:00
parent 3de471ae4e
commit f4e5a15e1b
5 changed files with 30 additions and 26 deletions

View File

@ -1431,12 +1431,16 @@ int main(int argc, char *argv[])
const Switch wantSnap(meshDict.lookup("snap"));
const Switch wantLayers(meshDict.lookup("addLayers"));
const Switch keepHex(meshDict.lookupOrDefault("keepHex", false));
const Switch mergePatchFaces
(
meshDict.lookupOrDefault("mergePatchFaces", true)
);
if (keepHex)
if (!mergePatchFaces)
{
Info<< "Avoiding generating non-(split)hex cells." << nl
<< endl;
Info<< "Not merging patch-faces of cell to preserve"
<< " (split)hex cell shape."
<< nl << endl;
}
@ -1466,7 +1470,7 @@ int main(int argc, char *argv[])
refineParams,
snapParams,
refineParams.handleSnapProblems(),
keepHex, // keepHex
mergePatchFaces, // merge co-planar faces
motionDict
);
@ -1506,7 +1510,7 @@ int main(int argc, char *argv[])
(
snapDict,
motionDict,
!keepHex, // mergePatchFaces
mergePatchFaces
curvature,
planarAngle,
snapParams
@ -1556,7 +1560,7 @@ int main(int argc, char *argv[])
layerDict,
motionDict,
layerParams,
!keepHex, //mergePatchFaces
mergePatchFaces,
preBalance,
decomposer,
distributor

View File

@ -74,8 +74,7 @@ geometry
// Optional: avoid patch-face merging. Allows mesh to be used for
// refinement/unrefinement
//keepHex true;
//mergePatchFaces off; // default on
// Settings for the castellatedMesh generation.
castellatedMeshControls

View File

@ -1182,7 +1182,7 @@ void Foam::autoRefineDriver::addFaceZones
void Foam::autoRefineDriver::mergePatchFaces
(
const bool keepHex,
const bool geometricMerge,
const refinementParameters& refineParams,
const dictionary& motionDict
)
@ -1194,17 +1194,7 @@ void Foam::autoRefineDriver::mergePatchFaces
const fvMesh& mesh = meshRefiner_.mesh();
if (keepHex)
{
meshRefiner_.mergePatchFaces
(
Foam::cos(degToRad(45.0)),
Foam::cos(degToRad(45.0)),
4, // only merge faces split into 4
meshRefiner_.meshedPatches()
);
}
else
if (geometricMerge)
{
meshRefiner_.mergePatchFacesUndo
(
@ -1215,6 +1205,17 @@ void Foam::autoRefineDriver::mergePatchFaces
labelList(mesh.nFaces(), -1)
);
}
else
{
// Still merge refined boundary faces if all four are on same patch
meshRefiner_.mergePatchFaces
(
Foam::cos(degToRad(45.0)),
Foam::cos(degToRad(45.0)),
4, // only merge faces split into 4
meshRefiner_.meshedPatches()
);
}
if (debug)
{
@ -1236,7 +1237,7 @@ void Foam::autoRefineDriver::doRefine
const refinementParameters& refineParams,
const snapParameters& snapParams,
const bool prepareForSnapping,
const bool keepHex,
const bool doMergePatchFaces,
const dictionary& motionDict
)
{
@ -1328,7 +1329,7 @@ void Foam::autoRefineDriver::doRefine
// Do something about cells with refined faces on the boundary
if (prepareForSnapping)
{
mergePatchFaces(keepHex, refineParams, motionDict);
mergePatchFaces(doMergePatchFaces, refineParams, motionDict);
}

View File

@ -147,7 +147,7 @@ class autoRefineDriver
//- Merge refined boundary faces (from exposing coarser cell)
void mergePatchFaces
(
const bool keepHex,
const bool geometricMerge,
const refinementParameters& refineParams,
const dictionary& motionDict
);
@ -187,7 +187,7 @@ public:
const refinementParameters& refineParams,
const snapParameters& snapParams,
const bool prepareForSnapping,
const bool keepHexOnly,
const bool mergePatchFaces,
const dictionary& motionDict
);

View File

@ -38,7 +38,7 @@ geometry
// Optional: avoid patch-face merging. Allows mesh to be used for
// refinement/unrefinement
keepHex true;
mergePatchFaces off; // default on