]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Tests: Fix lac/linear_operator_04a 2819/head
authorMatthias Maier <tamiko@43-1.org>
Tue, 12 Jul 2016 19:15:32 +0000 (14:15 -0500)
committerMatthias Maier <tamiko@43-1.org>
Tue, 12 Jul 2016 19:15:32 +0000 (14:15 -0500)
Always use an initialized and compressed matrix object in this test. This
avoids a regression when deal.II is compiled with 64bit mode: unitialized
trilinos objects are not guaranteed to work at all.

tests/lac/linear_operator_04a.cc

index 8b4e9f1ea1f1b8714bc9052936ab43ada9f19b4e..b2deba04eec70bdec6eae6a25ed2de6bf4e04c11 100644 (file)
@@ -13,8 +13,8 @@
 //
 // ---------------------------------------------------------------------
 
-// Test that it is possible to use a operator*() of LinearOperator object for
-// Trilinos matrices and vectors
+// Test that it is possible to use a PackagedOperation created by
+// operator*() of a LinearOperator object for Trilinos matrices and vectors
 
 #include "../tests.h"
 
@@ -35,13 +35,14 @@ int main(int argc, char *argv[])
   typedef TrilinosWrappers::MPI::Vector vector_t;
   typedef TrilinosWrappers::SparseMatrix matrix_t;
 
-  matrix_t a;
+  matrix_t a(5U, 5U, 3U);
+  a.compress (VectorOperation::add);
 
   auto op_a  = linear_operator<vector_t>(a);
   vector_t u,res;
+  op_a.reinit_domain_vector(u, false);
   res = op_a * u;
-  // ^^ this was not working, whereas
-  // op_a.vmult(res,u) did.
+  // ^^ this was not working, whereas op_a.vmult(res,u) did.
 
   deallog << "OK" << std::endl;
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.