// ------------------------------ Utility functions used in tests -----------------------
+/**
+ * A function to return real part of the number and check that
+ * its imaginary part is zero.
+ */
+#ifdef DEAL_II_WITH_PETSC
+#include <deal.II/lac/petsc_vector_base.h>
+PetscReal get_real_assert_zero_imag(const PETScWrappers::internal::VectorReference &a)
+{
+ Assert (a.imag() == 0.0, ExcInternalError());
+ return a.real();
+}
+#endif
+
+template<typename number>
+number get_real_assert_zero_imag(const number &a)
+{
+ return a;
+}
+
+
// Cygwin has a different implementation for rand() which causes many tests to fail.
// This here is a reimplementation that gives the same sequence of numbers as a program
// that uses rand() on a typical linux machine.