mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
preservePatches option still needed for geometric decomposition options
This commit is contained in:
@ -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;
|
||||||
|
|||||||
@ -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"));
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user