region option for decomposePar

This commit is contained in:
mattijs
2009-04-16 17:59:34 +01:00
parent 676b7bfe73
commit 485ea4c84f
3 changed files with 19 additions and 41 deletions

View File

@ -94,11 +94,12 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
word regionName = fvMesh::defaultRegion; word regionName = fvMesh::defaultRegion;
word regionDir = word::null;
if (args.options().found("region")) if (args.options().found("region"))
{ {
regionName = args.options()["region"]; regionName = args.options()["region"];
regionDir = regionName;
Info<< "Decomposing mesh " << regionName << nl << endl; Info<< "Decomposing mesh " << regionName << nl << endl;
} }
@ -116,7 +117,17 @@ int main(int argc, char *argv[])
// determine the existing processor count directly // determine the existing processor count directly
label nProcs = 0; label nProcs = 0;
while (isDir(runTime.path()/(word("processor") + name(nProcs)))) while
(
isDir
(
runTime.path()
/(word("processor") + name(nProcs))
/runTime.constant()
/regionDir
/polyMesh::meshSubDir
)
)
{ {
++nProcs; ++nProcs;
} }
@ -130,7 +141,7 @@ int main(int argc, char *argv[])
( (
"decomposeParDict", "decomposeParDict",
runTime.time().system(), runTime.time().system(),
regionName, regionDir, // use region if non-standard
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,

View File

@ -19,7 +19,7 @@ FoamFile
numberOfSubdomains 4; numberOfSubdomains 4;
// preservePatches (inlet); //- Keep owner and neighbour on same processor for faces in zones:
// preserveFaceZones (heater solid1 solid3); // preserveFaceZones (heater solid1 solid3);
method simple; method simple;

View File

@ -45,35 +45,6 @@ void domainDecomposition::distributeCells()
labelHashSet sameProcFaces; labelHashSet sameProcFaces;
if (decompositionDict_.found("preservePatches"))
{
wordList pNames(decompositionDict_.lookup("preservePatches"));
Info<< "Keeping owner and neighbour of faces in patches " << pNames
<< " on same processor" << endl;
const polyBoundaryMesh& patches = boundaryMesh();
forAll(pNames, i)
{
label patchI = patches.findPatchID(pNames[i]);
if (patchI == -1)
{
FatalErrorIn("domainDecomposition::distributeCells()")
<< "Unknown preservePatch " << pNames[i]
<< endl << "Valid patches are " << patches.names()
<< exit(FatalError);
}
const polyPatch& pp = patches[patchI];
forAll(pp, i)
{
sameProcFaces.insert(pp.start() + i);
}
}
}
if (decompositionDict_.found("preserveFaceZones")) if (decompositionDict_.found("preserveFaceZones"))
{ {
wordList zNames(decompositionDict_.lookup("preserveFaceZones")); wordList zNames(decompositionDict_.lookup("preserveFaceZones"));
@ -104,14 +75,6 @@ void domainDecomposition::distributeCells()
} }
} }
if (sameProcFaces.size())
{
Info<< "Selected " << sameProcFaces.size()
<< " faces whose owner and neighbour cell should be kept on the"
<< " same processor" << endl;
}
// Construct decomposition method and either do decomposition on // Construct decomposition method and either do decomposition on
// cell centres or on agglomeration // cell centres or on agglomeration
@ -129,6 +92,10 @@ void domainDecomposition::distributeCells()
} }
else else
{ {
Info<< "Selected " << sameProcFaces.size()
<< " faces whose owner and neighbour cell should be kept on the"
<< " same processor" << endl;
// Faces where owner and neighbour are not 'connected' (= all except // Faces where owner and neighbour are not 'connected' (= all except
// sameProcFaces) // sameProcFaces)
boolList blockedFace(nFaces(), true); boolList blockedFace(nFaces(), true);