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
0e5c9356
Commit
0e5c9356
authored
6 years ago
by
mattijs
Committed by
Andrew Heather
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
BUG: overset: out-of-range indexing. Fixes
#1321
parent
5f9b6d7a
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/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.C
+49
-36
49 additions, 36 deletions
src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.C
with
49 additions
and
36 deletions
src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.C
+
49
−
36
View file @
0e5c9356
...
...
@@ -106,13 +106,14 @@ bool Foam::dynamicOversetFvMesh::updateAddressing() const
forAll
(
stencil
,
celli
)
{
const
labelList
&
nbrs
=
stencil
[
celli
];
stencilPatches_
[
celli
].
setSize
(
nbrs
.
size
(),
-
1
);
stencilPatches_
[
celli
].
setSize
(
nbrs
.
size
());
stencilPatches_
[
celli
]
=
-
1
;
forAll
(
nbrs
,
nbri
)
{
const
label
nbrCelli
=
nbrs
[
nbri
];
if
(
stencilFaces_
[
celli
][
nbri
]
==
-
1
)
{
const
label
nbrCelli
=
nbrs
[
nbri
];
label
globalNbr
=
globalCellIDs
[
nbrCelli
];
label
proci
=
globalNumbering
.
whichProcID
(
globalNbr
);
label
remoteCelli
=
globalNumbering
.
toLocal
(
proci
,
globalNbr
);
...
...
@@ -164,10 +165,12 @@ bool Foam::dynamicOversetFvMesh::updateAddressing() const
{
if
(
proci
<
Pstream
::
myProcNo
()
&&
procOwner
[
proci
].
size
())
{
//Pout<< "Adding interface " << nbri
// << " to receive my " << procOwner[proci]
// << " from " << proci << endl;
if
(
debug
)
{
Pout
<<
"Adding interface "
<<
nbri
<<
" to receive my "
<<
procOwner
[
proci
].
size
()
<<
" from "
<<
proci
<<
endl
;
}
procToInterface
[
proci
]
=
nbri
;
remoteStencilInterfaces_
.
set
(
...
...
@@ -184,9 +187,12 @@ bool Foam::dynamicOversetFvMesh::updateAddressing() const
}
else
if
(
proci
>
Pstream
::
myProcNo
()
&&
mySendCells
[
proci
].
size
())
{
//Pout<< "Adding interface " << nbri
// << " to send my " << mySendCells[proci]
// << " to " << proci << endl;
if
(
debug
)
{
Pout
<<
"Adding interface "
<<
nbri
<<
" to send my "
<<
mySendCells
[
proci
].
size
()
<<
" to "
<<
proci
<<
endl
;
}
remoteStencilInterfaces_
.
set
(
nbri
++
,
...
...
@@ -205,9 +211,12 @@ bool Foam::dynamicOversetFvMesh::updateAddressing() const
{
if
(
proci
>
Pstream
::
myProcNo
()
&&
procOwner
[
proci
].
size
())
{
//Pout<< "Adding interface " << nbri
// << " to receive my " << procOwner[proci]
// << " from " << proci << endl;
if
(
debug
)
{
Pout
<<
"Adding interface "
<<
nbri
<<
" to receive my "
<<
procOwner
[
proci
].
size
()
<<
" from "
<<
proci
<<
endl
;
}
procToInterface
[
proci
]
=
nbri
;
remoteStencilInterfaces_
.
set
(
...
...
@@ -224,9 +233,12 @@ bool Foam::dynamicOversetFvMesh::updateAddressing() const
}
else
if
(
proci
<
Pstream
::
myProcNo
()
&&
mySendCells
[
proci
].
size
())
{
//Pout<< "Adding interface " << nbri
// << " to send my " << mySendCells[proci]
// << " to " << proci << endl;
if
(
debug
)
{
Pout
<<
"Adding interface "
<<
nbri
<<
" to send my "
<<
mySendCells
[
proci
].
size
()
<<
" to "
<<
proci
<<
endl
;
}
remoteStencilInterfaces_
.
set
(
nbri
++
,
...
...
@@ -634,28 +646,13 @@ bool Foam::dynamicOversetFvMesh::writeObject
const
labelIOList
&
zoneID
=
overlap
.
zoneID
();
const
labelListList
&
cellStencil
=
overlap
.
cellStencil
();
// Get remote zones
labelList
donorZoneID
(
zoneID
);
overlap
.
cellInterpolationMap
().
distribute
(
donorZoneID
);
forAll
(
cellStencil
,
cellI
)
{
const
labelList
&
stencil
=
cellStencil
[
cellI
];
if
(
stencil
.
size
())
{
donorZoneID
[
cellI
]
=
zoneID
[
stencil
[
0
]];
for
(
label
i
=
1
;
i
<
stencil
.
size
();
i
++
)
{
if
(
zoneID
[
stencil
[
i
]]
!=
donorZoneID
[
cellI
])
{
WarningInFunction
<<
"Mixed donor meshes for cell "
<<
cellI
<<
" at "
<<
C
()[
cellI
]
<<
" donors:"
<<
UIndirectList
<
point
>
(
C
(),
stencil
)
<<
endl
;
donorZoneID
[
cellI
]
=
-
2
;
}
}
}
}
// Get remote cellCentres
pointField
cc
(
C
());
overlap
.
cellInterpolationMap
().
distribute
(
cc
);
volScalarField
volDonorZoneID
(
...
...
@@ -672,9 +669,25 @@ bool Foam::dynamicOversetFvMesh::writeObject
dimensionedScalar
(
"minOne"
,
dimless
,
scalar
(
-
1
)),
zeroGradientFvPatchScalarField
::
typeName
);
forAll
(
donorZoneID
,
celli
)
forAll
(
cellStencil
,
cellI
)
{
volDonorZoneID
[
celli
]
=
donorZoneID
[
celli
];
const
labelList
&
stencil
=
cellStencil
[
cellI
];
if
(
stencil
.
size
())
{
volDonorZoneID
[
cellI
]
=
donorZoneID
[
stencil
[
0
]];
for
(
label
i
=
1
;
i
<
stencil
.
size
();
i
++
)
{
if
(
donorZoneID
[
stencil
[
i
]]
!=
volDonorZoneID
[
cellI
])
{
WarningInFunction
<<
"Mixed donor meshes for cell "
<<
cellI
<<
" at "
<<
C
()[
cellI
]
<<
" donors:"
<<
UIndirectList
<
point
>
(
cc
,
stencil
)
<<
endl
;
volDonorZoneID
[
cellI
]
=
-
2
;
}
}
}
}
//- Do not correctBoundaryConditions since re-interpolates!
//volDonorZoneID.correctBoundaryConditions();
...
...
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