From ea4e23eedf591bb1974acc882184cbbb9aed1bd7 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Mon, 23 Jul 2012 15:11:42 +0100
Subject: [PATCH] BUG: atmBoundaryLayer: missing mapping functions

---
 ...ndaryLayerInletEpsilonFvPatchScalarField.C |  6 ++--
 ...daryLayerInletVelocityFvPatchVectorField.C | 35 +++++++++++++++++--
 ...daryLayerInletVelocityFvPatchVectorField.H | 23 ++++++++++--
 3 files changed, 56 insertions(+), 8 deletions(-)

diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C
index 4862689fabe..51f4aae20c0 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C
@@ -71,9 +71,9 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
     kappa_(ptf.kappa_),
     Uref_(ptf.Uref_),
     Href_(ptf.Href_),
-    z0_(ptf.z0_),
-    zGround_(ptf.zGround_),
-    Ustar_(ptf.Ustar_)
+    z0_(ptf.z0_, mapper),
+    zGround_(ptf.zGround_, mapper),
+    Ustar_(ptf.Ustar_, mapper)
 {}
 
 
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C
index d5943dda5e1..3a336770253 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C
@@ -68,14 +68,14 @@ atmBoundaryLayerInletVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchVectorField(ptf, p, iF, mapper),
-    Ustar_(ptf.Ustar_),
+    Ustar_(ptf.Ustar_, mapper),
     n_(ptf.n_),
     z_(ptf.z_),
-    z0_(ptf.z0_),
+    z0_(ptf.z0_, mapper),
     kappa_(ptf.kappa_),
     Uref_(ptf.Uref_),
     Href_(ptf.Href_),
-    zGround_(ptf.zGround_)
+    zGround_(ptf.zGround_, mapper)
 {}
 
 
@@ -145,6 +145,35 @@ atmBoundaryLayerInletVelocityFvPatchVectorField
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
+void atmBoundaryLayerInletVelocityFvPatchVectorField::autoMap
+(
+    const fvPatchFieldMapper& m
+)
+{
+    fixedValueFvPatchVectorField::autoMap(m);
+    z0_.autoMap(m);
+    zGround_.autoMap(m);
+    Ustar_.autoMap(m);
+}
+
+
+void atmBoundaryLayerInletVelocityFvPatchVectorField::rmap
+(
+    const fvPatchVectorField& ptf,
+    const labelList& addr
+)
+{
+    fixedValueFvPatchVectorField::rmap(ptf, addr);
+
+    const atmBoundaryLayerInletVelocityFvPatchVectorField& blptf =
+        refCast<const atmBoundaryLayerInletVelocityFvPatchVectorField>(ptf);
+
+    z0_.rmap(blptf.z0_, addr);
+    zGround_.rmap(blptf.zGround_, addr);
+    Ustar_.rmap(blptf.Ustar_, addr);
+}
+
+
 void atmBoundaryLayerInletVelocityFvPatchVectorField::updateCoeffs()
 {
     const vectorField& c = patch().Cf();
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H
index 16c05dcee54..68a6408f2b2 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H
@@ -198,8 +198,27 @@ public:
             return z_;
         }
 
-        //- Update coefficients
-        virtual void updateCoeffs();
+        // Mapping functions
+
+            //- Map (and resize as needed) from self given a mapping object
+            virtual void autoMap
+            (
+                const fvPatchFieldMapper&
+            );
+
+            //- Reverse map the given fvPatchField onto this fvPatchField
+            virtual void rmap
+            (
+                const fvPatchVectorField&,
+                const labelList&
+            );
+
+
+        // Evaluation functions
+
+            //- Update coefficients
+            virtual void updateCoeffs();
+
 
         //- Write
         virtual void write(Ostream&) const;
-- 
GitLab