From a87debefec8342345e9f8900d7ff27c627e2163a Mon Sep 17 00:00:00 2001
From: andy <andy>
Date: Mon, 3 Feb 2014 12:36:04 +0000
Subject: [PATCH] ENH: base fv fields - check that internal field != null when
 mapping

---
 .../basic/directionMixed/directionMixedFvPatchField.C       | 4 ++--
 .../basic/fixedGradient/fixedGradientFvPatchField.C         | 4 ++--
 .../fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C | 6 +++---
 .../fields/fvPatchFields/basic/mixed/mixedFvPatchField.C    | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C
index ec66616b441..486087e86a4 100644
--- a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -56,7 +56,7 @@ Foam::directionMixedFvPatchField<Type>::directionMixedFvPatchField
     refGrad_(ptf.refGrad_, mapper),
     valueFraction_(ptf.valueFraction_, mapper)
 {
-    if (mapper.hasUnmapped())
+    if (&iF && mapper.hasUnmapped())
     {
         WarningIn
         (
diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C
index 9c46ecb089d..18af2c4db33 100644
--- a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -57,7 +57,7 @@ fixedGradientFvPatchField<Type>::fixedGradientFvPatchField
     fvPatchField<Type>(ptf, p, iF, mapper),
     gradient_(ptf.gradient_, mapper)
 {
-    if (mapper.hasUnmapped())
+    if (&iF && mapper.hasUnmapped())
     {
         WarningIn
         (
diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C
index 4fcf0863aa5..526fc41672e 100644
--- a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -66,13 +66,13 @@ fixedValueFvPatchField<Type>::fixedValueFvPatchField
 :
     fvPatchField<Type>(ptf, p, iF, mapper)
 {
-    if (mapper.hasUnmapped())
+    if (&iF && mapper.hasUnmapped())
     {
         WarningIn
         (
             "fixedValueFvPatchField<Type>::fixedValueFvPatchField\n"
             "(\n"
-            "    const fixedGradientFvPatchField<Type>&,\n"
+            "    const fixedValueFvPatchField<Type>&,\n"
             "    const fvPatch&,\n"
             "    const DimensionedField<Type, volMesh>&,\n"
             "    const fvPatchFieldMapper&\n"
diff --git a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C
index 378b5bbcf78..eba0a0a8519 100644
--- a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -60,7 +60,7 @@ mixedFvPatchField<Type>::mixedFvPatchField
     refGrad_(ptf.refGrad_, mapper),
     valueFraction_(ptf.valueFraction_, mapper)
 {
-    if (mapper.hasUnmapped())
+    if (&iF && mapper.hasUnmapped())
     {
         WarningIn
         (
-- 
GitLab