mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: distributedTriSurfaceMesh: support distributed running
This commit is contained in:
@ -450,7 +450,11 @@ Foam::triSurfaceMesh::triSurfaceMesh(const IOobject& io, const readAction r)
|
|||||||
// Check where surface was found
|
// Check where surface was found
|
||||||
const fileName localFile(io.localFilePath(typeName));
|
const fileName localFile(io.localFilePath(typeName));
|
||||||
|
|
||||||
if (r == masterOnly && (actualFile != localFile))
|
if
|
||||||
|
(
|
||||||
|
r == masterOnly
|
||||||
|
&& ((actualFile.empty() || actualFile != localFile))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// Found undecomposed surface. Load on master only
|
// Found undecomposed surface. Load on master only
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
@ -563,10 +567,18 @@ Foam::triSurfaceMesh::triSurfaceMesh
|
|||||||
|
|
||||||
if (searchGlobal && Pstream::parRun())
|
if (searchGlobal && Pstream::parRun())
|
||||||
{
|
{
|
||||||
// Check where surface was found
|
// Check where surface was found. Bit tricky:
|
||||||
|
// - master will have actualFile (in parent directory)
|
||||||
|
// different from localFilePath (in processor0/)
|
||||||
|
// - slave might have actualFile empty and localFile empty
|
||||||
|
|
||||||
const fileName localFile(io.localFilePath(typeName));
|
const fileName localFile(io.localFilePath(typeName));
|
||||||
|
|
||||||
if (r == masterOnly && (actualFile != localFile))
|
if
|
||||||
|
(
|
||||||
|
r == masterOnly
|
||||||
|
&& ((actualFile.empty() || actualFile != localFile))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// Surface not loaded from processor directories -> undecomposed
|
// Surface not loaded from processor directories -> undecomposed
|
||||||
// surface. Load on master only
|
// surface. Load on master only
|
||||||
|
|||||||
@ -2642,11 +2642,16 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh(const IOobject& io)
|
|||||||
|
|
||||||
bounds().reduce();
|
bounds().reduce();
|
||||||
|
|
||||||
const fileName actualFile(triSurfaceMesh::checkFile(io, true));
|
// Try and find out where the triSurface was loaded from. On slave this
|
||||||
|
// might give empty filename.
|
||||||
|
const fileName actualFile(triSurfaceMesh::findFile(io, true));
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
actualFile != io.localFilePath(triSurfaceMesh::typeName)
|
(
|
||||||
|
actualFile.empty()
|
||||||
|
|| actualFile != io.localFilePath(triSurfaceMesh::typeName)
|
||||||
|
)
|
||||||
&& (distType_ == INDEPENDENT || distType_ == DISTRIBUTED)
|
&& (distType_ == INDEPENDENT || distType_ == DISTRIBUTED)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -2779,11 +2784,16 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
|
|||||||
|
|
||||||
bounds().reduce();
|
bounds().reduce();
|
||||||
|
|
||||||
const fileName actualFile(triSurfaceMesh::checkFile(io, dict, true));
|
// Try and find out where the triSurface was loaded from. On slave this
|
||||||
|
// might give empty filename.
|
||||||
|
const fileName actualFile(triSurfaceMesh::findFile(io, dict, true));
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
actualFile != io.localFilePath(triSurfaceMesh::typeName)
|
(
|
||||||
|
actualFile.empty()
|
||||||
|
|| actualFile != io.localFilePath(triSurfaceMesh::typeName)
|
||||||
|
)
|
||||||
&& (distType_ == INDEPENDENT || distType_ == DISTRIBUTED)
|
&& (distType_ == INDEPENDENT || distType_ == DISTRIBUTED)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user