From: kronbichler Date: Fri, 31 May 2013 12:49:55 +0000 (+0000) Subject: Fix test. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd173d55afb4b1af898786fbd7a06d9f1dca1174;p=dealii-svn.git Fix test. git-svn-id: https://svn.dealii.org/trunk@29681 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/constraint_matrix.templates.h b/deal.II/include/deal.II/lac/constraint_matrix.templates.h index 24063ce28c..7bd390272e 100644 --- a/deal.II/include/deal.II/lac/constraint_matrix.templates.h +++ b/deal.II/include/deal.II/lac/constraint_matrix.templates.h @@ -989,8 +989,17 @@ namespace internal TrilinosWrappers::MPI::Vector &output, const internal::bool2type /*is_block_vector*/) { - output.reinit (needed_elements, - dynamic_cast(&vec.vector_partitioner().Comm())->GetMpiComm()); + Assert(!vec.has_ghost_elements(), + typename TrilinosWrappers::VectorBase::ExcGhostsPresent()); +#ifdef DEAL_II_WITH_MPI + const Epetra_MpiComm *mpi_comm + = dynamic_cast(&vec.trilinos_vector().Comm()); + + Assert (mpi_comm != 0, ExcInternalError()); + output.reinit (needed_elements, mpi_comm->GetMpiComm()); +#else + output.reinit (needed_elements, MPI_COMM_WORLD); +#endif output = vec; } #endif diff --git a/tests/mpi/constraint_matrix_trilinos_bug.cc b/tests/mpi/constraint_matrix_trilinos_bug.cc index e0c397d24a..a8c7445d5e 100644 --- a/tests/mpi/constraint_matrix_trilinos_bug.cc +++ b/tests/mpi/constraint_matrix_trilinos_bug.cc @@ -78,9 +78,6 @@ void test() IndexSet owned_set = dofh.locally_owned_dofs(); - IndexSet dof_set; - DoFTools::extract_locally_active_dofs (dofh, dof_set); - IndexSet relevant_set; DoFTools::extract_locally_relevant_dofs (dofh, relevant_set); diff --git a/tests/mpi/constraint_matrix_trilinos_bug/ncpu_10/cmp/generic b/tests/mpi/constraint_matrix_trilinos_bug/ncpu_10/cmp/generic index c3ced6c764..03bf519fa3 100644 --- a/tests/mpi/constraint_matrix_trilinos_bug/ncpu_10/cmp/generic +++ b/tests/mpi/constraint_matrix_trilinos_bug/ncpu_10/cmp/generic @@ -1,12 +1,12 @@ DEAL:0:2d::Exception: -------------------------------------------------------- -An error occurred in file in function - void dealii::TrilinosWrappers::VectorBase::set(unsigned int, const unsigned int*, const double*) +An error occurred in file in function + void dealii::internal::{anonymous}::import_vector_with_ghost_elements(const dealii::TrilinosWrappers::MPI::Vector&, const dealii::IndexSet&, const dealii::IndexSet&, dealii::TrilinosWrappers::MPI::Vector&, dealii::internal::bool2type) The violated condition was: - !has_ghost_elements() + !vec.has_ghost_elements() The name and call sequence of the exception was: - ExcGhostsPresent() + typename TrilinosWrappers::VectorBase::ExcGhostsPresent() Additional Information: (none) -------------------------------------------------------- diff --git a/tests/mpi/constraint_matrix_trilinos_bug/ncpu_4/cmp/generic b/tests/mpi/constraint_matrix_trilinos_bug/ncpu_4/cmp/generic index c3ced6c764..03bf519fa3 100644 --- a/tests/mpi/constraint_matrix_trilinos_bug/ncpu_4/cmp/generic +++ b/tests/mpi/constraint_matrix_trilinos_bug/ncpu_4/cmp/generic @@ -1,12 +1,12 @@ DEAL:0:2d::Exception: -------------------------------------------------------- -An error occurred in file in function - void dealii::TrilinosWrappers::VectorBase::set(unsigned int, const unsigned int*, const double*) +An error occurred in file in function + void dealii::internal::{anonymous}::import_vector_with_ghost_elements(const dealii::TrilinosWrappers::MPI::Vector&, const dealii::IndexSet&, const dealii::IndexSet&, dealii::TrilinosWrappers::MPI::Vector&, dealii::internal::bool2type) The violated condition was: - !has_ghost_elements() + !vec.has_ghost_elements() The name and call sequence of the exception was: - ExcGhostsPresent() + typename TrilinosWrappers::VectorBase::ExcGhostsPresent() Additional Information: (none) --------------------------------------------------------