From 67d66d106146c7998519e0a1f6d790b3bb1c260b Mon Sep 17 00:00:00 2001 From: young Date: Sun, 20 Oct 2013 16:35:51 +0000 Subject: [PATCH] Not a bug, but a feature of unsigned int. Let remaining (commented) tests on petsc-complex go through. git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@31342 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/petsc_scalar_complex/13.cc | 10 ++-- tests/petsc_scalar_complex/13/cmp/generic | 2 + .../petsc_scalar_complex/element_access_02.cc | 29 ++++------- .../element_access_02/cmp/generic | 50 +++++++++++++++++++ .../petsc_scalar_complex/sparse_matrix_02.cc | 12 ++--- tests/petsc_scalar_complex/vector_02.cc | 13 ++--- 6 files changed, 77 insertions(+), 39 deletions(-) create mode 100644 tests/petsc_scalar_complex/13/cmp/generic create mode 100644 tests/petsc_scalar_complex/element_access_02/cmp/generic diff --git a/tests/petsc_scalar_complex/13.cc b/tests/petsc_scalar_complex/13.cc index 0335f2e04b..d9c7ff0236 100644 --- a/tests/petsc_scalar_complex/13.cc +++ b/tests/petsc_scalar_complex/13.cc @@ -32,17 +32,17 @@ void test (PETScWrappers::Vector &v) std::vector pattern (v.size(), false); for (unsigned int i=0; i (1.,1.)) ) || - ( (pattern[i]==false) ), + Assert ( ( (pattern[i]==true) && (v(i).real()==i) && (v(i).imag()==i) ) || + //&& (v(i)==std::complex (1.,1.)) ) || + ( (pattern[i]==false) && (v(i).real()==0.) && (v(i).imag()==0.) ), ExcInternalError()); deallog << "OK" << std::endl; diff --git a/tests/petsc_scalar_complex/13/cmp/generic b/tests/petsc_scalar_complex/13/cmp/generic new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/petsc_scalar_complex/13/cmp/generic @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/petsc_scalar_complex/element_access_02.cc b/tests/petsc_scalar_complex/element_access_02.cc index 62d79cd28b..89e1210aff 100644 --- a/tests/petsc_scalar_complex/element_access_02.cc +++ b/tests/petsc_scalar_complex/element_access_02.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- -// $Id: +// $Id: element_access_02.cc // // Copyright (C) 2013 by the deal.II authors // @@ -24,32 +24,25 @@ #include #include -#include - -// test read/write access to matrices AS IS (no cast). -// - -// Note: this test fails where an -1.*(unsigned integer) is used as -// the input value to a matrix element. This needs to be fixed. - // sparse matrix elements -void test_matrix (PETScWrappers::SparseMatrix &m) +void test (PETScWrappers::SparseMatrix &m) { deallog << "Check matrix access" << std::endl; // fill up a matrix with some numbers for (unsigned int k=0; kl) + m.set (k,l, PetscScalar (k+l,-1.*(k+l))); + m.compress (VectorOperation::add); - // This fails, because the write above fails - see output file + // check the matrix is correctly filled for (unsigned int k=0; k @@ -47,9 +45,9 @@ void test () for (unsigned int k=0; k +#include #include #include #include @@ -42,9 +39,9 @@ void test () for (unsigned int k=0; k