Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
OpenFOAM-plus
Commits
9b5400d1
Commit
9b5400d1
authored
Oct 26, 2017
by
mattijs
Browse files
ENH: redistributePar: create dummy sets on non-existing processors
parent
f5cb4f97
Changes
2
Hide whitespace changes
Inline
Side-by-side
applications/utilities/parallelProcessing/redistributePar/loadOrCreateMesh.C
View file @
9b5400d1
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015
-2017
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -29,6 +29,10 @@ License
#include "Time.H"
//#include "IOPtrList.H"
#include "polyBoundaryMeshEntries.H"
#include "IOobjectList.H"
#include "pointSet.H"
#include "faceSet.H"
#include "cellSet.H"
// * * * * * * * * * * * * * * * 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)
// {
// // We created a dummy mesh file above. Delete it.
...
...
src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C
View file @
9b5400d1
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015
-2017
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -1348,7 +1348,15 @@ Foam::labelList Foam::decompositionMethod::decompose
{
// If no processor specified use the one from the
// 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
)
...
...
Mattijs Janssens
@Mattijs
mentioned in issue
#624 (closed)
·
Oct 26, 2017
mentioned in issue
#624 (closed)
mentioned in issue #624
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment