From 99e3e138fa87b4ff968876bc2c394b5edcc6a3b2 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Wed, 27 Mar 2013 16:49:39 +0000 Subject: [PATCH] Fix a bug introduced in revision 29049. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29078 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/lac/trilinos_sparsity_pattern.h | 2 +- .../source/lac/trilinos_sparsity_pattern.cc | 25 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h b/deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h index fd4079e289..515eae350e 100644 --- a/deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h +++ b/deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h @@ -1038,7 +1038,7 @@ namespace TrilinosWrappers * exactly are stored locally, * use local_range(). */ - int local_size () const; + unsigned int local_size () const; /** * Return a pair of indices diff --git a/deal.II/source/lac/trilinos_sparsity_pattern.cc b/deal.II/source/lac/trilinos_sparsity_pattern.cc index d6b115c426..d7764cf939 100644 --- a/deal.II/source/lac/trilinos_sparsity_pattern.cc +++ b/deal.II/source/lac/trilinos_sparsity_pattern.cc @@ -535,8 +535,7 @@ namespace TrilinosWrappers { // Extract local indices in // the matrix. - TrilinosWrappers::types::int_type trilinos_i = - graph->LRID(static_cast(i)), + int trilinos_i = graph->LRID(static_cast(i)), trilinos_j = graph->LCID(static_cast(j)); // If the data is not on the @@ -563,8 +562,12 @@ namespace TrilinosWrappers // Generate the view and make // sure that we have not generated // an error. - int ierr = graph->ExtractGlobalRowView(trilinos_i, nnz_extracted, - col_indices); + // TODO: trilinos_i is the local row index -> it is an int but + // ExtractGlobalRowView requires trilinos_i to be the global row + // index and thus it should be a long long int + int ierr = graph->ExtractGlobalRowView( + static_cast(trilinos_i), + nnz_extracted, col_indices); Assert (ierr==0, ExcTrilinosError(ierr)); Assert (nnz_present == nnz_extracted, ExcDimensionMismatch(nnz_present, nnz_extracted)); @@ -591,7 +594,7 @@ namespace TrilinosWrappers // Generate the view and make // sure that we have not generated // an error. - int ierr = graph->ExtractMyRowView(static_cast(trilinos_i), + int ierr = graph->ExtractMyRowView(trilinos_i, nnz_extracted, col_indices); Assert (ierr==0, ExcTrilinosError(ierr)); @@ -619,12 +622,12 @@ namespace TrilinosWrappers { size_type local_b=0; TrilinosWrappers::types::int_type global_b=0; - for (int i=0; iExtractMyRowView(static_cast(i), num_entries, indices); - for (size_type j=0; j<(size_type)num_entries; ++j) + graph->ExtractMyRowView(i, num_entries, indices); + for (unsigned int j=0; j<(unsigned int)num_entries; ++j) { if (static_cast(std::abs(static_cast(i-indices[j]))) > local_b) local_b = std::abs(static_cast(i-indices[j])); @@ -659,7 +662,7 @@ namespace TrilinosWrappers - int + unsigned int SparsityPattern::local_size () const { int n_rows = graph -> NumMyRows(); @@ -763,7 +766,7 @@ namespace TrilinosWrappers SparsityPattern::print_gnuplot (std::ostream &out) const { Assert (graph->Filled() == true, ExcInternalError()); - for (int row=0; row(j))] - << " " << -static_cast(row) << std::endl; + << " " << -static_cast(row) << std::endl; } AssertThrow (out, ExcIO()); -- 2.39.5