From 2969c01859bf2d13faa711e7f547c776afd6bdc1 Mon Sep 17 00:00:00 2001
From: Thomas Witkowski <thomas.witkowski@gmx.de>
Date: Fri, 1 Jun 2012 10:52:10 +0000
Subject: [PATCH] Added bddc_download_solution to bddcml code.

---
 AMDiS/src/parallel/BddcMlSolver.cc | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/AMDiS/src/parallel/BddcMlSolver.cc b/AMDiS/src/parallel/BddcMlSolver.cc
index 6ad4bbdb..eeac4beb 100644
--- a/AMDiS/src/parallel/BddcMlSolver.cc
+++ b/AMDiS/src/parallel/BddcMlSolver.cc
@@ -199,7 +199,7 @@ namespace AMDiS {
     double rhs[ndofs];
     for (int i = 0; i < nComponents; i++) {
       DOFVector<double>& dofvec = *(rhsVec->getDOFVector(i));
-      for (int j = 0; j < ndofs; j++)
+      for (int j = 0; j < nnods; j++)
 	rhs[j * nComponents + i] = dofvec[j];
     }
 
@@ -340,7 +340,7 @@ namespace AMDiS {
 
     int method = 1;
     double tol = 1.e-6;
-    int maxit = 1000;
+    int maxit = 10;
     int ndecrmax = 30;
     int num_iter = 0;
     int converged_reason = 0;
@@ -358,6 +358,14 @@ namespace AMDiS {
     MSG("BDDCML converged reason: %d within %d iterations \n", 
 	converged_reason, num_iter);
 
+    bddcml_download_local_solution(&isub, rhs, &ndofs);
+
+    for (int i = 0; i < nComponents; i++) {
+      DOFVector<double>& dofvec = *(vec.getDOFVector(i));
+      for (int j = 0; j < nnods; j++)
+	dofvec[j] = rhs[j * nComponents + i];
+    }
+
     bddcml_finalize();
   }
 
-- 
GitLab