From 800c87d3b188b77756590e5be83dd89bedfc09d0 Mon Sep 17 00:00:00 2001 From: turcksin Date: Mon, 25 Mar 2013 22:38:21 +0000 Subject: [PATCH] Fix test 52 of Trilinos to use 64 bits and fix a bug in trilinos_vector. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29031 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/lac/trilinos_vector.h | 8 ++++---- deal.II/include/deal.II/lac/trilinos_vector_base.h | 4 ++-- deal.II/source/lac/trilinos_sparse_matrix.cc | 2 +- deal.II/source/lac/trilinos_sparsity_pattern.cc | 4 ++-- tests/trilinos/52.cc | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/deal.II/include/deal.II/lac/trilinos_vector.h b/deal.II/include/deal.II/lac/trilinos_vector.h index 86930ab101..592815da7b 100644 --- a/deal.II/include/deal.II/lac/trilinos_vector.h +++ b/deal.II/include/deal.II/lac/trilinos_vector.h @@ -515,13 +515,13 @@ namespace TrilinosWrappers has_ghosts = vector->Map().UniqueGIDs()==false; - const TrilinosWrappers::types::int_type size = parallel_partitioner.NumMyElements(); + const int size = parallel_partitioner.NumMyElements(); // Need to copy out values, since the // deal.II might not use doubles, so // that a direct access is not possible. - for (TrilinosWrappers::types::int_type i=0; i(v.size()), 0, + (static_cast(v.size()), 0, #ifdef DEAL_II_WITH_MPI Epetra_MpiComm(MPI_COMM_SELF) #else diff --git a/deal.II/include/deal.II/lac/trilinos_vector_base.h b/deal.II/include/deal.II/lac/trilinos_vector_base.h index 2f66baca89..f38ba80582 100644 --- a/deal.II/include/deal.II/lac/trilinos_vector_base.h +++ b/deal.II/include/deal.II/lac/trilinos_vector_base.h @@ -1470,8 +1470,8 @@ namespace TrilinosWrappers VectorBase::size_type VectorBase::size () const { - return (size_type) (vector->Map().MaxAllGID() + 1 - - vector->Map().MinAllGID()); + return (size_type) (vector->Map().MaxAllGID64() + 1 - + vector->Map().MinAllGID64()); } diff --git a/deal.II/source/lac/trilinos_sparse_matrix.cc b/deal.II/source/lac/trilinos_sparse_matrix.cc index 4d97382db3..e19e1d8a61 100644 --- a/deal.II/source/lac/trilinos_sparse_matrix.cc +++ b/deal.II/source/lac/trilinos_sparse_matrix.cc @@ -1377,7 +1377,7 @@ namespace TrilinosWrappers { matrix->ExtractMyRowView (i, num_entries, values, indices); for (TrilinosWrappers::types::int_type j=0; jGRID(i) << "," << matrix->GCID(indices[j]) << ") " + out << "(" << matrix->GRID64(i) << "," << matrix->GCID64(indices[j]) << ") " << values[j] << std::endl; } } diff --git a/deal.II/source/lac/trilinos_sparsity_pattern.cc b/deal.II/source/lac/trilinos_sparsity_pattern.cc index 5a172195db..5c5d4acf76 100644 --- a/deal.II/source/lac/trilinos_sparsity_pattern.cc +++ b/deal.II/source/lac/trilinos_sparsity_pattern.cc @@ -654,7 +654,7 @@ namespace TrilinosWrappers { graph->ExtractMyRowView (i, num_entries, indices); for (TrilinosWrappers::types::int_type j=0; jGRID(j)] << ") " + out << "(" << i << "," << indices[graph->GRID64(j)] << ") " << std::endl; } } @@ -680,7 +680,7 @@ namespace TrilinosWrappers // j horizontal, gnuplot output is // x-y, that is we have to exchange // the order of output - out << indices[graph->GRID(static_cast(j))] + out << indices[graph->GRID64(static_cast(j))] << " " << -static_cast(row) << std::endl; } diff --git a/tests/trilinos/52.cc b/tests/trilinos/52.cc index df522f69c8..ed469755c3 100644 --- a/tests/trilinos/52.cc +++ b/tests/trilinos/52.cc @@ -64,10 +64,10 @@ int main (int argc,char **argv) try { { - std::vector row_lengths (5, - static_cast(3)); + std::vector row_lengths (5,3U); row_lengths.back() = 2; - TrilinosWrappers::SparseMatrix m (5U,5U,row_lengths); + TrilinosWrappers::SparseMatrix m (static_cast(5U), + static_cast(5U),row_lengths); test (m); } } -- 2.39.5