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