From 95bab6dd14a61cc422b435d1b5a935ff66292abe Mon Sep 17 00:00:00 2001
From: Andreas Lauser <and@poware.org>
Date: Tue, 7 Dec 2010 13:45:38 +0000
Subject: [PATCH] partial reassemble: Smarter way to calculate the reassemble
 tolerance

divide the relative tolerance by 10 to get the minimum reassemble
error. for the next newton iteration, reassemble all vertices which
exhibit a relative error which is larger than the geometric mean of
the minimum reassemble tolerance and the relative error of the last
iteration.

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@4825 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/boxmodels/2p2c/2p2cnewtoncontroller.hh         | 5 ++---
 dumux/boxmodels/richards/richardsnewtoncontroller.hh | 5 ++---
 dumux/nonlinear/newtoncontroller.hh                  | 4 ++--
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/dumux/boxmodels/2p2c/2p2cnewtoncontroller.hh b/dumux/boxmodels/2p2c/2p2cnewtoncontroller.hh
index 28c3c673c0..7bbfd42c7d 100644
--- a/dumux/boxmodels/2p2c/2p2cnewtoncontroller.hh
+++ b/dumux/boxmodels/2p2c/2p2cnewtoncontroller.hh
@@ -108,9 +108,8 @@ public:
         // compute the vertex and element colors for partial
         // reassembly
         if (enablePartialReassemble) {
-            Scalar reassembleTol = 0.3*Dumux::geometricMean(this->error_, 
-                                                            this->tolerance_);
-            reassembleTol = std::max(reassembleTol, this->tolerance_);
+            Scalar reassembleTol = Dumux::geometricMean(this->error_, 0.1*this->tolerance_);
+            reassembleTol = std::max(reassembleTol, 0.1*this->tolerance_);
             this->model_().jacobianAssembler().updateDiscrepancy(uOld, deltaU);
             this->model_().jacobianAssembler().computeColors(reassembleTol);
         }
diff --git a/dumux/boxmodels/richards/richardsnewtoncontroller.hh b/dumux/boxmodels/richards/richardsnewtoncontroller.hh
index 6ae77dca3c..aefe528d15 100644
--- a/dumux/boxmodels/richards/richardsnewtoncontroller.hh
+++ b/dumux/boxmodels/richards/richardsnewtoncontroller.hh
@@ -87,9 +87,8 @@ public:
         // compute the vertex and element colors for partial
         // reassembly
         if (enablePartialReassemble) {
-            Scalar reassembleTol = 0.3*Dumux::geometricMean(this->error_, 
-                                                            this->tolerance_);
-            reassembleTol = std::max(reassembleTol, this->tolerance_);
+            Scalar reassembleTol = Dumux::geometricMean(this->error_, 0.1*this->tolerance_);
+            reassembleTol = std::max(reassembleTol, 0.1*this->tolerance_);
             this->model_().jacobianAssembler().updateDiscrepancy(uOld, deltaU);
             this->model_().jacobianAssembler().computeColors(reassembleTol);
         }
diff --git a/dumux/nonlinear/newtoncontroller.hh b/dumux/nonlinear/newtoncontroller.hh
index 2523a9bd8c..38d1d26fe0 100644
--- a/dumux/nonlinear/newtoncontroller.hh
+++ b/dumux/nonlinear/newtoncontroller.hh
@@ -489,8 +489,8 @@ public:
         // compute the vertex and element colors for partial
         // reassembly
         if (enablePartialReassemble) {
-            Scalar reassembleTol = 0.3*Dumux::geometricMean(error_, tolerance_);
-            reassembleTol = std::max(reassembleTol, tolerance_);
+            Scalar reassembleTol = Dumux::geometricMean(error_, 0.1*tolerance_);
+            reassembleTol = std::max(reassembleTol, 0.1*tolerance_);
             this->model_().jacobianAssembler().updateDiscrepancy(uOld, deltaU);
             this->model_().jacobianAssembler().computeColors(reassembleTol);
         }
-- 
GitLab