Skip to content
Snippets Groups Projects
Commit 485ea4c8 authored by mattijs's avatar mattijs
Browse files

region option for decomposePar

parent 676b7bfe
No related branches found
No related tags found
No related merge requests found
......@@ -94,11 +94,12 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
word regionName = fvMesh::defaultRegion;
word regionDir = word::null;
if (args.options().found("region"))
{
regionName = args.options()["region"];
regionDir = regionName;
Info<< "Decomposing mesh " << regionName << nl << endl;
}
......@@ -116,7 +117,17 @@ int main(int argc, char *argv[])
// determine the existing processor count directly
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;
}
......@@ -130,7 +141,7 @@ int main(int argc, char *argv[])
(
"decomposeParDict",
runTime.time().system(),
regionName,
regionDir, // use region if non-standard
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
......
......@@ -19,7 +19,7 @@ FoamFile
numberOfSubdomains 4;
// preservePatches (inlet);
//- Keep owner and neighbour on same processor for faces in zones:
// preserveFaceZones (heater solid1 solid3);
method simple;
......
......@@ -45,35 +45,6 @@ void domainDecomposition::distributeCells()
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"))
{
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
// cell centres or on agglomeration
......@@ -129,6 +92,10 @@ void domainDecomposition::distributeCells()
}
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
// sameProcFaces)
boolList blockedFace(nFaces(), true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment