Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
8cf757da
Commit
8cf757da
authored
1 year ago
by
mattijs
Committed by
Mark OLESEN
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
BUG: GAMG: processorAgglomeration not merging proc coeffs. Fixes
#3172
parent
6581c579
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverAgglomerateMatrix.C
+63
-74
63 additions, 74 deletions
...ices/lduMatrix/solvers/GAMG/GAMGSolverAgglomerateMatrix.C
with
63 additions
and
74 deletions
src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverAgglomerateMatrix.C
+
63
−
74
View file @
8cf757da
...
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd.
Copyright (C) 2023
-2024
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -310,13 +310,7 @@ void Foam::GAMGSolver::gatherMatrices
const
auto
&
boundaryMap
=
agglomeration_
.
boundaryMap
(
destLevel
);
// Use PstreamBuffers
PstreamBuffers
pBufs
(
UPstream
::
commsTypes
::
nonBlocking
,
UPstream
::
msgType
(),
comm
);
PstreamBuffers
pBufs
(
comm
);
// Send to master
if
(
!
UPstream
::
master
(
comm
))
...
...
@@ -332,35 +326,49 @@ void Foam::GAMGSolver::gatherMatrices
const
label
proci
=
UPstream
::
myProcNo
(
comm
);
labelList
validInterface
(
interfaces
.
size
(),
-
1
);
// All interfaceBouCoeffs need to be sent across
bitSet
validCoeffs
(
interfaces
.
size
());
forAll
(
interfaceBouCoeffs
,
intI
)
{
if
(
interfaceBouCoeffs
.
set
(
intI
))
{
validCoeffs
.
set
(
intI
);
}
}
// Only preserved interfaces need to be sent across
bitSet
validInterface
(
interfaces
.
size
());
forAll
(
interfaces
,
intI
)
{
const
label
allIntI
=
boundaryMap
[
proci
][
intI
];
if
(
interfaces
.
set
(
intI
)
&&
allIntI
!=
-
1
)
{
validInterface
[
intI
]
=
intI
;
validInterface
.
set
(
intI
)
;
}
}
UOPstream
toMaster
(
UPstream
::
masterNo
(),
pBufs
);
toMaster
<<
mat
<<
token
::
SPACE
<<
validInterface
;
toMaster
<<
mat
<<
token
::
SPACE
<<
validCoeffs
<<
token
::
SPACE
<<
validInterface
;
for
All
(
validInterface
,
intI
)
for
(
const
label
intI
:
validCoeffs
)
{
if
(
validInterface
[
intI
]
!=
-
1
)
{
const
auto
&
interface
=
refCast
<
const
GAMGInterfaceField
>
(
interfaces
[
intI
]
);
toMaster
<<
interfaceBouCoeffs
[
intI
]
<<
interfaceIntCoeffs
[
intI
];
}
for
(
const
label
intI
:
validInterface
)
{
const
auto
&
interface
=
refCast
<
const
GAMGInterfaceField
>
(
interfaces
[
intI
]
);
toMaster
<<
interfaceBouCoeffs
[
intI
]
<<
interfaceIntCoeffs
[
intI
]
<<
interface
.
type
();
interface
.
write
(
toMaster
);
}
toMaster
<<
interface
.
type
();
interface
.
write
(
toMaster
);
}
}
...
...
@@ -376,10 +384,10 @@ void Foam::GAMGSolver::gatherMatrices
lduInterfacePtrsList
destInterfaces
=
destMesh
.
interfaces
();
// Master.
otherMats
.
setS
ize
(
nProcs
-
1
);
otherBouCoeffs
.
setS
ize
(
nProcs
-
1
);
otherIntCoeffs
.
setS
ize
(
nProcs
-
1
);
otherInterfaces
.
setS
ize
(
nProcs
-
1
);
otherMats
.
res
ize
(
nProcs
-
1
);
otherBouCoeffs
.
res
ize
(
nProcs
-
1
);
otherIntCoeffs
.
res
ize
(
nProcs
-
1
);
otherInterfaces
.
res
ize
(
nProcs
-
1
);
for
(
const
int
proci
:
UPstream
::
subProcs
(
comm
))
{
...
...
@@ -389,60 +397,41 @@ void Foam::GAMGSolver::gatherMatrices
otherMats
.
set
(
otherI
,
new
lduMatrix
(
destMesh
,
fromProc
));
// Receive number of/valid interfaces
// >= 0 : remote interface index
// -1 : invalid interface
const
labelList
validInterface
(
fromProc
);
// Receive bit-sets of valid interfaceCoeffs/interfaces
const
bitSet
validCoeffs
(
fromProc
);
const
bitSet
validInterface
(
fromProc
);
otherBouCoeffs
.
set
(
otherI
,
new
FieldField
<
Field
,
scalar
>
(
validInterface
.
size
())
);
otherIntCoeffs
.
set
(
otherI
,
new
FieldField
<
Field
,
scalar
>
(
validInterface
.
size
())
);
otherInterfaces
.
set
(
otherI
,
new
PtrList
<
lduInterfaceField
>
(
validInterface
.
size
())
);
otherBouCoeffs
.
emplace_set
(
otherI
,
validCoeffs
.
size
());
otherIntCoeffs
.
emplace_set
(
otherI
,
validCoeffs
.
size
());
otherInterfaces
.
emplace_set
(
otherI
,
validInterface
.
size
());
forAll
(
validInterface
,
intI
)
// Receive individual interface contributions
for
(
const
label
intI
:
validCoeffs
)
{
if
(
validInterface
[
intI
]
!=
-
1
)
{
otherBouCoeffs
[
otherI
].
set
(
intI
,
new
scalarField
(
fromProc
)
);
otherIntCoeffs
[
otherI
].
set
(
intI
,
new
scalarField
(
fromProc
)
);
otherBouCoeffs
[
otherI
].
emplace_set
(
intI
,
fromProc
);
otherIntCoeffs
[
otherI
].
emplace_set
(
intI
,
fromProc
);
}
const
word
coupleType
(
fromProc
);
// Receive individual interface contributions
for
(
const
label
intI
:
validInterface
)
{
const
word
coupleType
(
fromProc
);
const
label
allIntI
=
boundaryMap
[
proci
][
intI
];
const
label
allIntI
=
boundaryMap
[
proci
][
intI
];
otherInterfaces
[
otherI
].
set
otherInterfaces
[
otherI
].
set
(
intI
,
GAMGInterfaceField
::
New
(
intI
,
GAMGInterface
Field
::
New
coupleType
,
refCast
<
const
GAMGInterface
>
(
coupleType
,
refCast
<
const
GAMGInterface
>
(
destInterfaces
[
allIntI
]
),
fromProc
).
release
()
);
}
destInterfaces
[
allIntI
]
),
fromProc
).
release
()
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment