mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: redistributePar: create dummy sets on non-existing processors
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -29,6 +29,10 @@ License
|
|||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
//#include "IOPtrList.H"
|
//#include "IOPtrList.H"
|
||||||
#include "polyBoundaryMeshEntries.H"
|
#include "polyBoundaryMeshEntries.H"
|
||||||
|
#include "IOobjectList.H"
|
||||||
|
#include "pointSet.H"
|
||||||
|
#include "faceSet.H"
|
||||||
|
#include "cellSet.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -375,6 +379,41 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Determine sets
|
||||||
|
// ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
wordList pointSetNames;
|
||||||
|
wordList faceSetNames;
|
||||||
|
wordList cellSetNames;
|
||||||
|
if (Pstream::master())
|
||||||
|
{
|
||||||
|
// Read sets
|
||||||
|
IOobjectList objects(mesh, mesh.facesInstance(), "polyMesh/sets");
|
||||||
|
pointSetNames = objects.sortedNames(pointSet::typeName);
|
||||||
|
faceSetNames = objects.sortedNames(faceSet::typeName);
|
||||||
|
cellSetNames = objects.sortedNames(cellSet::typeName);
|
||||||
|
}
|
||||||
|
Pstream::scatter(pointSetNames);
|
||||||
|
Pstream::scatter(faceSetNames);
|
||||||
|
Pstream::scatter(cellSetNames);
|
||||||
|
|
||||||
|
if (!haveMesh)
|
||||||
|
{
|
||||||
|
forAll(pointSetNames, i)
|
||||||
|
{
|
||||||
|
pointSet(mesh, pointSetNames[i], 0).write();
|
||||||
|
}
|
||||||
|
forAll(faceSetNames, i)
|
||||||
|
{
|
||||||
|
faceSet(mesh, faceSetNames[i], 0).write();
|
||||||
|
}
|
||||||
|
forAll(cellSetNames, i)
|
||||||
|
{
|
||||||
|
cellSet(mesh, cellSetNames[i], 0).write();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// if (!haveMesh)
|
// if (!haveMesh)
|
||||||
// {
|
// {
|
||||||
// // We created a dummy mesh file above. Delete it.
|
// // We created a dummy mesh file above. Delete it.
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -1348,7 +1348,15 @@ Foam::labelList Foam::decompositionMethod::decompose
|
|||||||
{
|
{
|
||||||
// If no processor specified use the one from the
|
// If no processor specified use the one from the
|
||||||
// 0th element
|
// 0th element
|
||||||
proci = finalDecomp[mesh.faceOwner()[set[0]]];
|
if (set.size())
|
||||||
|
{
|
||||||
|
proci = finalDecomp[mesh.faceOwner()[set[0]]];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Zero-sized processor (e.g. from redistributePar)
|
||||||
|
proci = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(set, fI)
|
forAll(set, fI)
|
||||||
|
|||||||
Reference in New Issue
Block a user