From c95ed5330ea33f7c94e045c2db59aca3d0ce0d69 Mon Sep 17 00:00:00 2001
From: Wenqing Wang <wenqing.wang@ufz.de>
Date: Thu, 1 Jun 2017 16:47:09 +0200
Subject: [PATCH] [PETSc] Updated the test for PETScVector

---
 Tests/MathLib/TestGlobalVectorInterface.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Tests/MathLib/TestGlobalVectorInterface.cpp b/Tests/MathLib/TestGlobalVectorInterface.cpp
index 360ceed95ed..b0baba08a8f 100644
--- a/Tests/MathLib/TestGlobalVectorInterface.cpp
+++ b/Tests/MathLib/TestGlobalVectorInterface.cpp
@@ -95,6 +95,7 @@ void checkGlobalVectorInterfacePETSc()
 
     const int r0 = x.getRangeBegin();
     //x.get(0) is expensive, only get local value. Use it for test purpose
+    x.setLocalAccessibleVector();
     ASSERT_EQ(.0, x.get(r0));
 
     set(x, 10.);
@@ -103,18 +104,22 @@ void checkGlobalVectorInterfacePETSc()
     // Value of x is not copied to y
     const bool deep_copy = false;
     T_VECTOR y(x, deep_copy);
+    y.setLocalAccessibleVector();
     ASSERT_EQ(0, y.get(r0));
 
     set(y, 10.0);
+    y.setLocalAccessibleVector();
     ASSERT_EQ(10, y.get(r0));
 
     // y += x
     axpy(y, 1., x);
+    y.setLocalAccessibleVector();
     ASSERT_EQ(20, y.get(r0));
     ASSERT_EQ(80., norm2(y));
 
     // y -= x
     axpy(y, -1., x);
+    y.setLocalAccessibleVector();
     ASSERT_EQ(10, y.get(r0));
     ASSERT_EQ(40., norm2(y));
 
-- 
GitLab