preservePatches option still needed for geometric decomposition options

This commit is contained in:
mattijs
2009-09-08 17:39:01 +01:00
parent 21ba33aad1
commit 0aa0114310
3 changed files with 46 additions and 2 deletions

View File

@ -22,6 +22,12 @@ numberOfSubdomains 4;
//- Keep owner and neighbour on same processor for faces in zones: //- Keep owner and neighbour on same processor for faces in zones:
// preserveFaceZones (heater solid1 solid3); // preserveFaceZones (heater solid1 solid3);
//- Keep owner and neighbour on same processor for faces in patches:
// (makes sense only for cyclic patches)
//preservePatches (cyclic_left_right);
method scotch; method scotch;
// method hierarchical; // method hierarchical;
// method simple; // method simple;

View File

@ -45,6 +45,35 @@ void domainDecomposition::distributeCells()
labelHashSet sameProcFaces; labelHashSet sameProcFaces;
if (decompositionDict_.found("preservePatches"))
{
wordList pNames(decompositionDict_.lookup("preservePatches"));
Info<< "Keeping owner of faces in patches " << pNames
<< " on same processor. This only makes sense for cyclics." << 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"));

View File

@ -141,9 +141,18 @@ Foam::labelList Foam::decompositionMethod::decompose
const pointField& coarsePoints const pointField& coarsePoints
) )
{ {
scalarField coarseWeights(0); // Decompose based on agglomerated points
labelList coarseDistribution(decompose(coarsePoints));
return decompose(fineToCoarse, coarsePoints, coarseWeights); // Rework back into decomposition for original mesh_
labelList fineDistribution(fineToCoarse.size());
forAll(fineDistribution, i)
{
fineDistribution[i] = coarseDistribution[fineToCoarse[i]];
}
return fineDistribution;
} }