From a3b52a5f748a4fb6954a84c54bb0c46278137cad Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Thu, 12 Sep 2013 16:02:02 +0100
Subject: [PATCH] ENH: basic fvPatchFields: added mapping warning

---
 .../directionMixedFvPatchField.C              | 22 +++++++++++++++++--
 .../fixedGradient/fixedGradientFvPatchField.C | 22 +++++++++++++++++--
 .../basic/fixedValue/fixedValueFvPatchField.C | 22 +++++++++++++++++--
 .../basic/mixed/mixedFvPatchField.C           | 22 +++++++++++++++++--
 4 files changed, 80 insertions(+), 8 deletions(-)

diff --git a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C
index 1a185a514f1..ec66616b441 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 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -55,7 +55,25 @@ Foam::directionMixedFvPatchField<Type>::directionMixedFvPatchField
     refValue_(ptf.refValue_, mapper),
     refGrad_(ptf.refGrad_, mapper),
     valueFraction_(ptf.valueFraction_, mapper)
-{}
+{
+    if (mapper.hasUnmapped())
+    {
+        WarningIn
+        (
+            "directionMixedFvPatchField<Type>::directionMixedFvPatchField\n"
+            "(\n"
+            "    const directionMixedFvPatchField<Type>&,\n"
+            "    const fvPatch&,\n"
+            "    const DimensionedField<Type, volMesh>&,\n"
+            "    const fvPatchFieldMapper&\n"
+            ")\n"
+        )   << "On field " << iF.name() << " patch " << p.name()
+            << " patchField " << this->type()
+            << " : mapper does not map all values." << nl
+            << "    To avoid this warning fully specify the mapping in derived"
+            << " patch fields." << endl;
+    }
+}
 
 
 template<class Type>
diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C
index dd10411a4f3..9c46ecb089d 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 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -56,7 +56,25 @@ fixedGradientFvPatchField<Type>::fixedGradientFvPatchField
 :
     fvPatchField<Type>(ptf, p, iF, mapper),
     gradient_(ptf.gradient_, mapper)
-{}
+{
+    if (mapper.hasUnmapped())
+    {
+        WarningIn
+        (
+            "fixedGradientFvPatchField<Type>::fixedGradientFvPatchField\n"
+            "(\n"
+            "    const fixedGradientFvPatchField<Type>&,\n"
+            "    const fvPatch&,\n"
+            "    const DimensionedField<Type, volMesh>&,\n"
+            "    const fvPatchFieldMapper&\n"
+            ")\n"
+        )   << "On field " << iF.name() << " patch " << p.name()
+            << " patchField " << this->type()
+            << " : mapper does not map all values." << nl
+            << "    To avoid this warning fully specify the mapping in derived"
+            << " patch fields." << endl;
+    }
+}
 
 
 template<class Type>
diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C
index a401ede3ef4..4fcf0863aa5 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 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -65,7 +65,25 @@ fixedValueFvPatchField<Type>::fixedValueFvPatchField
 )
 :
     fvPatchField<Type>(ptf, p, iF, mapper)
-{}
+{
+    if (mapper.hasUnmapped())
+    {
+        WarningIn
+        (
+            "fixedValueFvPatchField<Type>::fixedValueFvPatchField\n"
+            "(\n"
+            "    const fixedGradientFvPatchField<Type>&,\n"
+            "    const fvPatch&,\n"
+            "    const DimensionedField<Type, volMesh>&,\n"
+            "    const fvPatchFieldMapper&\n"
+            ")\n"
+        )   << "On field " << iF.name() << " patch " << p.name()
+            << " patchField " << this->type()
+            << " : mapper does not map all values." << nl
+            << "    To avoid this warning fully specify the mapping in derived"
+            << " patch fields." << endl;
+    }
+}
 
 
 template<class Type>
diff --git a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C
index b716d486864..378b5bbcf78 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 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -59,7 +59,25 @@ mixedFvPatchField<Type>::mixedFvPatchField
     refValue_(ptf.refValue_, mapper),
     refGrad_(ptf.refGrad_, mapper),
     valueFraction_(ptf.valueFraction_, mapper)
-{}
+{
+    if (mapper.hasUnmapped())
+    {
+        WarningIn
+        (
+            "mixedFvPatchField<Type>::mixedFvPatchField\n"
+            "(\n"
+            "    const mixedFvPatchField<Type>&,\n"
+            "    const fvPatch&,\n"
+            "    const DimensionedField<Type, volMesh>&,\n"
+            "    const fvPatchFieldMapper&\n"
+            ")\n"
+        )   << "On field " << iF.name() << " patch " << p.name()
+            << " patchField " << this->type()
+            << " : mapper does not map all values." << nl
+            << "    To avoid this warning fully specify the mapping in derived"
+            << " patch fields." << endl;
+    }
+}
 
 
 template<class Type>
-- 
GitLab