View Issue Details

IDProjectCategoryView StatusLast Update
0003962OpenFOAMBugpublic2024-07-10 16:33
Reportercgoessni Assigned Tochris  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformamd64OSCentOSOS Version7
Product Versiondev 
Summary0003962: meshToMesh constructor: wrong order of patchMap content?
DescriptionAccording to the documentation, the patchMap HashTable contains pairs of <srgPatchName> <tgtPatchName>. Could it be that the parsing inside meshToMesh constructor does reverse this order?
Suggested patch attached.
TagsNo tags attached.

Activities

cgoessni

2023-03-15 15:34

reporter  

diff_meshToMesh_C.txt (656 bytes)   
diff --git a/src/meshTools/meshToMesh/meshToMesh.C b/src/meshTools/meshToMesh/meshToMesh.C
index 5a6745a..eef8cd5 100644
--- a/src/meshTools/meshToMesh/meshToMesh.C
+++ b/src/meshTools/meshToMesh/meshToMesh.C
@@ -107,8 +107,8 @@ Foam::meshToMesh::meshToMesh
         label i = 0;
         forAllConstIter(HashTable<word>, patchMap, iter)
         {
-            const word& tgtPatchName = iter.key();
-            const word& srcPatchName = iter();
+            const word& tgtPatchName = iter();
+            const word& srcPatchName = iter.key();
 
             const label srcPatchi =
                 srcMesh_.boundaryMesh().findPatchID(srcPatchName);
diff_meshToMesh_C.txt (656 bytes)   

henry

2023-03-15 16:25

manager   ~0012959

It is not clear what documentation you are referring to, nor how to reproduce the problem, or even what the problem is. Could you please provide a more complete bug-report?

cgoessni

2023-03-15 19:18

reporter   ~0012960

from https://doc.cfd.direct/openfoam/user-guide-v10/mapfields:

"The first list is patchMap that specifies mapping of data between pairs of source and target patches that are geometrically coincident, as shown in Figure 5.16. The list contains each pair of names of source and target patch."

However, if I map from source patch nameA to target patch nameB, i.e.

patchMap (nameA nameB);

it would complain that nameB does not exist in source mesh, suggesting that the code reads it in different order than the user guide would suggest.

chris

2023-05-22 17:55

manager   ~0013020

The documentation does not mention the order. The verb "contain" does not imply order by the sequence of what follows it.
The example was taken from the cavity tutorial where the order is correct for the cases involved: "lid" is from target, "movingWall" from source.
https://doc.cfd.direct/openfoam/user-guide-v10/cavity

chris

2023-05-22 18:08

manager   ~0013021

I have updated the documentation to make the ordering clear:
https://doc.cfd.direct/openfoam/user-guide-v10/mapfields

Cache takes 24 hours to update for the pages, so wait 24 hours before checking.

cgoessni

2023-05-30 12:24

reporter   ~0013031

Thank you for the update. Now it reads very clearly!

Issue History

Date Modified Username Field Change
2023-03-15 15:34 cgoessni New Issue
2023-03-15 15:34 cgoessni File Added: diff_meshToMesh_C.txt
2023-03-15 16:25 henry Note Added: 0012959
2023-03-15 19:18 cgoessni Note Added: 0012960
2023-05-22 17:55 chris Note Added: 0013020
2023-05-22 18:08 chris Note Added: 0013021
2023-05-30 12:24 cgoessni Note Added: 0013031
2024-07-10 16:33 will Assigned To => chris
2024-07-10 16:33 will Status new => resolved
2024-07-10 16:33 will Resolution open => fixed