From ae3b2d91920747bc47f54246e0d2a273feb92aa8 Mon Sep 17 00:00:00 2001
From: andy <andy>
Date: Thu, 25 Oct 2012 10:02:42 +0100
Subject: [PATCH] ENH: Updated fixedJump boundary conditions

---
 .../derived/fixedJump/fixedJumpFvPatchField.C | 17 ++++++++++++++++
 .../derived/fixedJump/fixedJumpFvPatchField.H | 17 ++--------------
 .../fixedJumpAMI/fixedJumpAMIFvPatchField.C   | 20 +++++++++++++++++++
 .../fixedJumpAMI/fixedJumpAMIFvPatchField.H   | 20 ++-----------------
 4 files changed, 41 insertions(+), 33 deletions(-)

diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C
index fd2050ffcc0..6d692c48879 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C
@@ -92,6 +92,23 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
+template<class Type>
+Foam::tmp<Foam::Field<Type> > Foam::fixedJumpFvPatchField<Type>::jump() const
+{
+    if (this->cyclicPatch().owner())
+    {
+        return jump_;
+    }
+    else
+    {
+        return refCast<const fixedJumpFvPatchField<Type> >
+        (
+            this->neighbourPatchField()
+        ).jump();
+    }
+}
+
+
 template<class Type>
 void Foam::fixedJumpFvPatchField<Type>::autoMap
 (
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H
index 1beef6b3b1f..ba2fdc9aeb7 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H
@@ -141,21 +141,8 @@ public:
 
         // Access
 
-            //- Return the "jump" across the patch.
-            virtual tmp<Field<Type> > jump() const
-            {
-                if (this->cyclicPatch().owner())
-                {
-                    return jump_;
-                }
-                else
-                {
-                    return refCast<const fixedJumpFvPatchField<Type> >
-                    (
-                        this->neighbourPatchField()
-                    ).jump();
-                }
-            }
+            //- Return the "jump" across the patch
+            virtual tmp<Field<Type> > jump() const;
 
 
         // Mapping functions
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C
index ec60f11bc22..689981c20d6 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C
@@ -91,6 +91,26 @@ Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
+template<class Type>
+Foam::tmp<Foam::Field<Type> > Foam::fixedJumpAMIFvPatchField<Type>::jump() const
+{
+    if (this->cyclicAMIPatch().owner())
+    {
+        return jump_;
+    }
+    else
+    {
+        const fixedJumpAMIFvPatchField& nbrPatch =
+            refCast<const fixedJumpAMIFvPatchField<Type> >
+            (
+                this->neighbourPatchField()
+            );
+
+        return this->cyclicAMIPatch().interpolate(nbrPatch.jump());
+    }
+}
+
+
 template<class Type>
 void Foam::fixedJumpAMIFvPatchField<Type>::autoMap
 (
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H
index d785ad5289a..9e9d1a91d10 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H
@@ -135,24 +135,8 @@ public:
 
         // Access
 
-            //- Return the "jump" across the patch.
-            virtual tmp<Field<Type> > jump() const
-            {
-                if (this->cyclicAMIPatch().owner())
-                {
-                    return jump_;
-                }
-                else
-                {
-                    tmp<Field<Type> > nbrJump =
-                        refCast<const fixedJumpAMIFvPatchField<Type> >
-                        (
-                            this->neighbourPatchField()
-                        ).jump();
-
-                    return this->cyclicAMIPatch().interpolate(nbrJump);
-                }
-            }
+            //- Return the "jump" across the patch
+            virtual tmp<Field<Type> > jump() const;
 
 
         // Mapping functions
-- 
GitLab