Skip to content
Snippets Groups Projects
Commit 4d6a8cbd authored by mattijs's avatar mattijs
Browse files

ENH: faceAgglomerate: dict option handling

parent 483d4007
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -48,22 +48,22 @@ using namespace Foam;
int main(int argc, char *argv[])
{
#include "addRegionOption.H"
argList::addOption
(
"dict",
"word",
"name of dictionary to provide patch agglomeration controls"
);
#include "addDictOption.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createNamedMesh.H"
word agglomDictName
(
args.optionLookupOrDefault<word>("dict", "faceAgglomerateDict")
);
const word dictName("faceAgglomerateDict");
#include "setConstantMeshDictionaryIO.H"
// Read control dictionary
const IOdictionary agglomDict(dictIO);
bool writeAgglom = readBool(agglomDict.lookup("writeFacesAgglomeration"));
const polyBoundaryMesh& patches = mesh.boundaryMesh();
const polyBoundaryMesh& boundary = mesh.boundaryMesh();
labelListIOList finalAgglom
(
......@@ -76,27 +76,9 @@ int main(int argc, char *argv[])
IOobject::NO_WRITE,
false
),
patches.size()
);
// Read control dictionary
IOdictionary agglomDict
(
IOobject
(
agglomDictName,
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
boundary.size()
);
bool writeAgglom = readBool(agglomDict.lookup("writeFacesAgglomeration"));
const polyBoundaryMesh& boundary = mesh.boundaryMesh();
forAll(boundary, patchId)
{
const polyPatch& pp = boundary[patchId];
......@@ -178,7 +160,6 @@ int main(int argc, char *argv[])
forAll(boundary, patchId)
{
fvPatchScalarField& bFacesAgglomeration =
facesAgglomeration.boundaryField()[patchId];
......@@ -188,7 +169,7 @@ int main(int argc, char *argv[])
}
}
Info << "\nWriting facesAgglomeration" << endl;
Info<< "\nWriting facesAgglomeration" << endl;
facesAgglomeration.write();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment