mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: faceAgglomerate: dict option handling
This commit is contained in:
@ -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;
|
|||||||
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")
|
|
||||||
);
|
|
||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
#include "setConstantMeshDictionaryIO.H"
|
||||||
|
|
||||||
|
// Read control dictionary
|
||||||
|
const IOdictionary agglomDict(dictIO);
|
||||||
|
|
||||||
|
bool writeAgglom = readBool(agglomDict.lookup("writeFacesAgglomeration"));
|
||||||
|
|
||||||
|
|
||||||
|
const polyBoundaryMesh& boundary = mesh.boundaryMesh();
|
||||||
|
|
||||||
labelListIOList finalAgglom
|
labelListIOList finalAgglom
|
||||||
(
|
(
|
||||||
@ -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[])
|
|||||||
|
|
||||||
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[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Info << "\nWriting facesAgglomeration" << endl;
|
Info<< "\nWriting facesAgglomeration" << endl;
|
||||||
facesAgglomeration.write();
|
facesAgglomeration.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user