]> https://gitweb.dealii.org/ - dealii.git/commitdiff
extend gla/mat_01 to complex-valued PETSc
authorDenis Davydov <davydden@gmail.com>
Tue, 29 Mar 2016 05:33:03 +0000 (07:33 +0200)
committerDenis Davydov <davydden@gmail.com>
Tue, 29 Mar 2016 18:48:46 +0000 (20:48 +0200)
tests/gla/mat_01.cc
tests/tests.h

index 199bafda83be48aa97d9135ba656f36781e5130e..a690c32e115caeadf6158789a7c46580ad8ee7ae 100644 (file)
@@ -72,9 +72,9 @@ void test ()
   // check local values
   if (myid==0)
     {
-      deallog << myid*2 << ": " << mat(myid*2,myid*2) << std::endl;
-      deallog << myid*2+1 << ": " << mat(myid*2+1,myid*2+1) << std::endl;
-      deallog << "0,1 : " << mat(0,1) << std::endl;
+      deallog << myid*2 << ": " << get_real_assert_zero_imag(mat(myid*2,myid*2)) << std::endl;
+      deallog << myid*2+1 << ": " << get_real_assert_zero_imag(mat(myid*2+1,myid*2+1)) << std::endl;
+      deallog << "0,1 : " << get_real_assert_zero_imag(mat(0,1)) << std::endl;
     }
 
   // done
index 3525a34384924fbc3cff79e44d8bfad345d80fe8..086ef88cab3a1d35de85898623ce67f553bc1048 100644 (file)
@@ -77,6 +77,13 @@ PetscReal get_real_assert_zero_imag(const PETScWrappers::internal::VectorReferen
 }
 #endif
 
+template<typename number>
+number get_real_assert_zero_imag(const std::complex<number> &a)
+{
+  Assert (a.imag() == 0.0, ExcInternalError());
+  return a.real();
+}
+
 template<typename number>
 number get_real_assert_zero_imag(const number &a)
 {

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.