View Issue Details

IDProjectCategoryView StatusLast Update
0002165OpenFOAMPatchpublic2016-08-01 14:31
ReporterLievenAssigned Tohenry 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Fixed in Version 
Summary0002165: Patch for meshToMesh related to new .ref()
DescriptionA number of compilation errors appear when using the mapTgtToSrc(field) function of a meshToMesh object, e.g.:

OpenFOAM-4.x/src/sampling/lnInclude/meshToMeshTemplates.C:566:72: error: invalid initialization of reference of type ‘Foam::fvPatchField<double>&’ from expression of type ‘const Foam::fvPatchField<double>’
         fvPatchField<Type>& srcField = result.boundaryField()[srcPatchi];

This seems related to the new .ref(), and it looks to me that it should be corrected as:
result.boundaryFieldRef()[srcPatchi];
Additional InformationThe attached patch resolves this issue at three locations inside meshToMeshTemplates.C (although their might be others)
TagsNo tags attached.

Activities

Lieven

2016-08-01 11:56

reporter  

meshToMeshTemplates.patch (912 bytes)
@@ -554,7 +554,7 @@
     GeometricField<Type, fvPatchField, volMesh>& result
 ) const
 {
-    mapTgtToSrc(field, cop, result.primitiveField());
+    mapTgtToSrc(field, cop, result.primitiveFieldRef());
 
     const PtrList<AMIPatchToPatchInterpolation>& AMIList = patchAMIs();
 
@@ -563,7 +563,7 @@
         label srcPatchi = srcPatchID_[i];
         label tgtPatchi = tgtPatchID_[i];
 
-        fvPatchField<Type>& srcField = result.boundaryField()[srcPatchi];
+        fvPatchField<Type>& srcField = result.boundaryFieldRef()[srcPatchi];
         const fvPatchField<Type>& tgtField = field.boundaryField()[tgtPatchi];
 
 
@@ -602,7 +602,7 @@
     forAll(cuttingPatches_, i)
     {
         label patchi = cuttingPatches_[i];
-        fvPatchField<Type>& pf = result.boundaryField()[patchi];
+        fvPatchField<Type>& pf = result.boundaryFieldRef()[patchi];
         pf == pf.patchInternalField();
     }
 }

henry

2016-08-01 14:31

manager   ~0006589

Thanks for the patch

Resolved in OpenFOAM-dev by commit d394cec0dccefa2c7bbe12259f0066fe825e7529
Resolved in OpenFOAM-4.x commit b6498a8c05ea44ba78ed24ac9799586229947572

Issue History

Date Modified Username Field Change
2016-08-01 11:56 Lieven New Issue
2016-08-01 11:56 Lieven File Added: meshToMeshTemplates.patch
2016-08-01 14:31 henry Note Added: 0006589
2016-08-01 14:31 henry Status new => resolved
2016-08-01 14:31 henry Fixed in Version => 4.x
2016-08-01 14:31 henry Resolution open => fixed
2016-08-01 14:31 henry Assigned To => henry