mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into splitCyclic
Conflicts: applications/utilities/mesh/generation/blockMesh/blockMeshApp.C applications/utilities/parallelProcessing/decomposePar/decomposeMesh.C etc/bashrc etc/cshrc src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C src/decompositionMethods/parMetisDecomp/parMetisDecomp.C src/dynamicMesh/Make/files src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C src/dynamicMesh/perfectInterface/perfectInterface.C src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.H src/finiteVolume/Make/files src/mesh/blockMesh/blockMesh/blockMesh.C src/mesh/blockMesh/blockMesh/blockMeshTopology.C src/meshTools/Make/files src/meshTools/sets/topoSets/faceSet.C
This commit is contained in:
@ -6,6 +6,7 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-ldecompositionMethods \
|
||||
-llagrangian \
|
||||
-lmeshTools
|
||||
|
||||
@ -248,7 +248,6 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
subPatchStarts[procI].setSize(nInterfaces, labelList(1, 0));
|
||||
}
|
||||
|
||||
|
||||
// Processor boundaries from split cyclics
|
||||
forAll (patches, patchi)
|
||||
{
|
||||
|
||||
@ -237,23 +237,28 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (writeCellDist)
|
||||
{
|
||||
const labelList& procIds = mesh.cellToProc();
|
||||
|
||||
// Write the decomposition as labelList for use with 'manual'
|
||||
// decomposition method.
|
||||
|
||||
// FIXME: may attempt to write to a non-existent "region0/"
|
||||
OFstream os
|
||||
labelIOList cellDecomposition
|
||||
(
|
||||
runTime.path()
|
||||
/ mesh.facesInstance()
|
||||
/ regionName
|
||||
/ "cellDecomposition"
|
||||
IOobject
|
||||
(
|
||||
"cellDecomposition",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
procIds
|
||||
);
|
||||
|
||||
os << mesh.cellToProc();
|
||||
cellDecomposition.write();
|
||||
|
||||
Info<< nl << "Wrote decomposition to "
|
||||
<< os.name() << " for use in manual decomposition."
|
||||
<< endl;
|
||||
<< cellDecomposition.objectPath()
|
||||
<< " for use in manual decomposition." << endl;
|
||||
|
||||
// Write as volScalarField for postprocessing.
|
||||
volScalarField cellDist
|
||||
@ -271,7 +276,6 @@ int main(int argc, char *argv[])
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
const labelList& procIds = mesh.cellToProc();
|
||||
forAll(procIds, celli)
|
||||
{
|
||||
cellDist[celli] = procIds[celli];
|
||||
|
||||
@ -22,6 +22,12 @@ numberOfSubdomains 4;
|
||||
//- Keep owner and neighbour on same processor for faces in zones:
|
||||
// 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 hierarchical;
|
||||
// method simple;
|
||||
|
||||
@ -44,6 +44,35 @@ void domainDecomposition::distributeCells()
|
||||
|
||||
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"))
|
||||
{
|
||||
wordList zNames(decompositionDict_.lookup("preserveFaceZones"));
|
||||
|
||||
@ -34,6 +34,7 @@ License
|
||||
#include "Map.H"
|
||||
#include "globalMeshData.H"
|
||||
#include "DynamicList.H"
|
||||
#include "fvFieldDecomposer.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -303,12 +304,29 @@ bool domainDecomposition::writeDecomposition()
|
||||
|
||||
forAll (curPatchSizes, patchi)
|
||||
{
|
||||
// Get the face labels consistent with the field mapping
|
||||
// (reuse the patch field mappers)
|
||||
const polyPatch& meshPatch =
|
||||
meshPatches[curBoundaryAddressing[patchi]];
|
||||
|
||||
fvFieldDecomposer::patchFieldDecomposer patchMapper
|
||||
(
|
||||
SubList<label>
|
||||
(
|
||||
curFaceLabels,
|
||||
curPatchSizes[patchi],
|
||||
curPatchStarts[patchi]
|
||||
),
|
||||
meshPatch.start()
|
||||
);
|
||||
|
||||
// Map existing patches
|
||||
procPatches[nPatches] =
|
||||
meshPatches[curBoundaryAddressing[patchi]].clone
|
||||
(
|
||||
procMesh.boundaryMesh(),
|
||||
nPatches,
|
||||
curPatchSizes[patchi],
|
||||
patchMapper.directAddressing(),
|
||||
curPatchStarts[patchi]
|
||||
).ptr();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user