View Issue Details

IDProjectCategoryView StatusLast Update
0004152OpenFOAMPatchpublic2024-09-17 19:51
Reportertniemi Assigned Towill  
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Product Versiondev 
Fixed in Version12 
Summary0004152: Fix for mapped patches in case of a single face in a parallel case
DescriptionIf a mapped boundary is decomposed in such a way that some processor has only one neighbour face and the default tree mapping method is used, the creation of the bounding box fails. This is quite rare, but can occur in realistic cases when large number of cores is used.

I have attached a trivial example case and a minimal patch to handle such a case.
Steps To ReproduceRun ./Allrun, the parallel version fails
TagsNo tags attached.

Activities

tniemi

2024-09-17 12:43

reporter  

treeBug.tar.gz (2,760 bytes)
diff.patch (1,052 bytes)   
diff --git a/src/meshTools/mappedPatches/mappedPatchBase/mappedPatchBase.C b/src/meshTools/mappedPatches/mappedPatchBase/mappedPatchBase.C
index 8af798f460..c87645af9d 100644
--- a/src/meshTools/mappedPatches/mappedPatchBase/mappedPatchBase.C
+++ b/src/meshTools/mappedPatches/mappedPatchBase/mappedPatchBase.C
@@ -184,6 +184,18 @@ void Foam::mappedPatchBase::calcMapping() const
                     allNearest[alli].data = Foam::sqr(great);
                 }
             }
+            else if (nbrPolyPatch().size() == 1)
+            {
+                const pointField nbrPoints(nbrPatchFaceCentres());
+
+                forAll(allPoints, alli)
+                {
+                    const point& p = allPoints[alli];
+                    allNearest[alli].proci = Pstream::myProcNo();
+                    allNearest[alli].elementi = 0;
+                    allNearest[alli].data = magSqr(nbrPoints[0] - p);
+                }
+            }
             else
             {
                 const pointField nbrPoints(nbrPatchFaceCentres());
diff.patch (1,052 bytes)   

will

2024-09-17 19:51

manager   ~0013414

Thanks for the report and patch. Fixed in v12 and dev:

https://github.com/OpenFOAM/OpenFOAM-12/commit/4bcbc284000f17e6b12d55a1e592e311626f6f32
https://github.com/OpenFOAM/OpenFOAM-dev/commit/ed4e43bad4ea7e255a053ada3ac4941bb32600e7

Issue History

Date Modified Username Field Change
2024-09-17 12:43 tniemi New Issue
2024-09-17 12:43 tniemi File Added: treeBug.tar.gz
2024-09-17 12:43 tniemi File Added: diff.patch
2024-09-17 19:51 will Assigned To => will
2024-09-17 19:51 will Status new => resolved
2024-09-17 19:51 will Resolution open => fixed
2024-09-17 19:51 will Fixed in Version => 12
2024-09-17 19:51 will Note Added: 0013414