From aa0a47bdfe8967404545ab6532796fdce13e0dc4 Mon Sep 17 00:00:00 2001
From: andy <andy>
Date: Fri, 26 Oct 2012 14:59:34 +0100
Subject: [PATCH] ENH: Updates to jump BCs

---
 .../jumpCyclic/jumpCyclicFvPatchField.C        | 18 ++++++++----------
 .../derived/fan/fanFvPatchFields.C             |  3 +--
 .../derived/fixedJump/fixedJumpFvPatchField.C  |  1 -
 .../uniformJump/uniformJumpFvPatchField.C      |  5 ++---
 .../uniformJumpAMIFvPatchField.C               |  1 -
 5 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C
index 67bc7f96dbc..db6849d2674 100644
--- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C
@@ -77,7 +77,6 @@ jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
     const jumpCyclicFvPatchField<Type>& ptf
 )
 :
-    cyclicLduInterfaceField(),
     cyclicFvPatchField<Type>(ptf)
 {}
 
@@ -105,12 +104,11 @@ tmp<Field<Type> > jumpCyclicFvPatchField<Type>::patchNeighbourField() const
     tmp<Field<Type> > tpnf(new Field<Type>(this->size()));
     Field<Type>& pnf = tpnf();
 
-    tmp<Field<Type> > tjf = jump();
+    Field<Type> jf(this->jump());
     if (!this->cyclicPatch().owner())
     {
-        tjf = -tjf;
+        jf *= -1.0;
     }
-    const Field<Type>& jf = tjf();
 
     if (this->doTransform())
     {
@@ -152,12 +150,12 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
     // for AMG solve - only apply jump to finest level
     if (psiInternal.size() == this->internalField().size())
     {
-        tmp<Field<scalar> > tjf = jump()().component(cmpt);
+        Field<scalar> jf(this->jump()().component(cmpt));
+
         if (!this->cyclicPatch().owner())
         {
-            tjf = -tjf;
+            jf *= -1.0;
         }
-        const Field<scalar>& jf = tjf();
 
         forAll(*this, facei)
         {
@@ -201,12 +199,12 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
     // for AMG solve - only apply jump to finest level
     if (psiInternal.size() == this->internalField().size())
     {
-        tmp<Field<Type> > tjf = jump();
+        Field<Type> jf(this->jump());
+
         if (!this->cyclicPatch().owner())
         {
-            tjf = -tjf;
+            jf *= -1.0;
         }
-        const Field<Type>& jf = tjf();
 
         forAll(*this, facei)
         {
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C
index 1c8e9348926..668d43483de 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C
@@ -95,11 +95,10 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
     }
     else
     {
-        // Generic input constructed from dictionary
+        // Dummy jump table
         this->jumpTable_.reset(new DataEntry<scalar>("jumpTable"));
     }
 
-
     if (dict.found("value"))
     {
         fvPatchScalarField::operator=
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C
index eb997abf365..e58270ec638 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C
@@ -72,7 +72,6 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
     const fixedJumpFvPatchField<Type>& ptf
 )
 :
-    cyclicLduInterfaceField(),
     jumpCyclicFvPatchField<Type>(ptf),
     jump_(ptf.jump_)
 {}
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C
index 88e75781415..c4ee64eaa84 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C
@@ -109,9 +109,9 @@ Foam::tmp<Foam::Field<Type> > Foam::uniformJumpFvPatchField<Type>::jump() const
 {
     if (this->cyclicPatch().owner())
     {
-        Type j = jumpTable_->value(this->db().time().value());
+        const Type value = jumpTable_->value(this->db().time().value());
 
-        return tmp<Field<Type> >(new Field<Type>(this->size(), j));
+        return tmp<Field<Type> >(new Field<Type>(this->patch().size(), value));
     }
     else
     {
@@ -134,7 +134,6 @@ void Foam::uniformJumpFvPatchField<Type>::write(Ostream& os) const
     {
         jumpTable_->writeData(os);
     }
-    this->writeEntry("value", os);
 }
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C
index cb9ff6cd901..a3e1fe65919 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C
@@ -132,7 +132,6 @@ void Foam::uniformJumpAMIFvPatchField<Type>::write(Ostream& os) const
     {
         jumpTable_->writeData(os);
     }
-    this->writeEntry("value", os);
 }
 
 
-- 
GitLab