From: Timo Heister Date: Mon, 22 Oct 2012 21:05:40 +0000 (+0000) Subject: fixes for trilinos 11. EPetra now supports long and int which causes ambiguous calls... X-Git-Tag: v8.0.0~1933 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef978bd2f3b444af75e7220b3a590f15ba6d7ec6;p=dealii.git fixes for trilinos 11. EPetra now supports long and int which causes ambiguous calls when using unsigned int. git-svn-id: https://svn.dealii.org/trunk@27170 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/trilinos_sparse_matrix.h b/deal.II/include/deal.II/lac/trilinos_sparse_matrix.h index beb6b1515e..dad014f8ac 100644 --- a/deal.II/include/deal.II/lac/trilinos_sparse_matrix.h +++ b/deal.II/include/deal.II/lac/trilinos_sparse_matrix.h @@ -2775,7 +2775,7 @@ namespace TrilinosWrappers // add the possibility to insert new values, // and in the second we just replace // data. - if (row_partitioner().MyGID(row) == true) + if (row_partitioner().MyGID(static_cast(row)) == true) { if (matrix->Filled() == false) { @@ -2992,7 +2992,7 @@ namespace TrilinosWrappers // can directly call the Epetra_CrsMatrix // input function, which is much faster // than the Epetra_FECrsMatrix function. - if (row_partitioner().MyGID(row) == true) + if (row_partitioner().MyGID(static_cast(row)) == true) { ierr = matrix->Epetra_CrsMatrix::SumIntoGlobalValues(row, n_columns, const_cast(col_value_ptr), @@ -3031,7 +3031,7 @@ namespace TrilinosWrappers std::cout << std::endl << std::endl; std::cout << "Matrix row has the following indices:" << std::endl; int n_indices, *indices; - trilinos_sparsity_pattern().ExtractMyRowView(row_partitioner().LID(row), + trilinos_sparsity_pattern().ExtractMyRowView(row_partitioner().LID(static_cast(row)), n_indices, indices); for (int i=0; iMap().LID(indices[i]); + const int local_row = vector->Map().LID(static_cast(row)); if (local_row == -1) { const int ierr = vector->ReplaceGlobalValues (1, @@ -1429,7 +1429,7 @@ namespace TrilinosWrappers for (unsigned int i=0; iMap().LID(row); + const int local_row = vector->Map().LID(static_cast(row)); if (local_row == -1) { const int ierr = vector->SumIntoGlobalValues (1, diff --git a/deal.II/source/base/index_set.cc b/deal.II/source/base/index_set.cc index 3e51051a27..cc40d2b0c9 100644 --- a/deal.II/source/base/index_set.cc +++ b/deal.II/source/base/index_set.cc @@ -381,8 +381,8 @@ IndexSet::make_trilinos_map (const MPI_Comm &communicator, compress (); if ((is_contiguous() == true) && (!overlapping)) - return Epetra_Map (size(), - n_elements(), + return Epetra_Map (static_cast(size()), + static_cast(n_elements()), 0, #ifdef DEAL_II_COMPILER_SUPPORTS_MPI Epetra_MpiComm(communicator)); @@ -395,7 +395,7 @@ IndexSet::make_trilinos_map (const MPI_Comm &communicator, fill_index_vector(indices); return Epetra_Map (-1, - n_elements(), + static_cast(n_elements()), (n_elements() > 0 ? reinterpret_cast(&indices[0]) diff --git a/deal.II/source/lac/trilinos_block_sparse_matrix.cc b/deal.II/source/lac/trilinos_block_sparse_matrix.cc index e6452b6b8f..6908edc845 100644 --- a/deal.II/source/lac/trilinos_block_sparse_matrix.cc +++ b/deal.II/source/lac/trilinos_block_sparse_matrix.cc @@ -148,7 +148,7 @@ namespace TrilinosWrappers std::vector parallel_partitioning; for (unsigned int i=0; i(block_sparsity_pattern.block(i,0).n_rows()), 0, Utilities::Trilinos::comm_self())); @@ -240,7 +240,7 @@ namespace TrilinosWrappers std::vector parallel_partitioning; for (unsigned int i=0; i(dealii_block_sparse_matrix.block(i,0).m()), 0, trilinos_communicator)); diff --git a/deal.II/source/lac/trilinos_precondition.cc b/deal.II/source/lac/trilinos_precondition.cc index 0f53f7bc00..d7ac5d4612 100644 --- a/deal.II/source/lac/trilinos_precondition.cc +++ b/deal.II/source/lac/trilinos_precondition.cc @@ -662,7 +662,7 @@ namespace TrilinosWrappers // equidistributed map; avoid // storing the nonzero // elements. - vector_distributor.reset (new Epetra_Map(n_rows, 0, communicator)); + vector_distributor.reset (new Epetra_Map(static_cast(n_rows), 0, communicator)); if (trilinos_matrix.get() == 0) trilinos_matrix.reset (new SparseMatrix()); diff --git a/deal.II/source/lac/trilinos_sparse_matrix.cc b/deal.II/source/lac/trilinos_sparse_matrix.cc index 2534911edc..449562d108 100644 --- a/deal.II/source/lac/trilinos_sparse_matrix.cc +++ b/deal.II/source/lac/trilinos_sparse_matrix.cc @@ -169,7 +169,7 @@ namespace TrilinosWrappers const unsigned int n, const unsigned int n_max_entries_per_row) : - column_space_map (new Epetra_Map (n, 0, + column_space_map (new Epetra_Map (static_cast(n), 0, Utilities::Trilinos::comm_self())), // on one processor only, we know how the @@ -181,7 +181,7 @@ namespace TrilinosWrappers // information from columns is only // available when entries have been added matrix (new Epetra_FECrsMatrix(Copy, - Epetra_Map (m, 0, + Epetra_Map (static_cast(m), 0, Utilities::Trilinos::comm_self()), *column_space_map, n_max_entries_per_row, @@ -196,10 +196,10 @@ namespace TrilinosWrappers const unsigned int n, const std::vector &n_entries_per_row) : - column_space_map (new Epetra_Map (n, 0, + column_space_map (new Epetra_Map (static_cast(n), 0, Utilities::Trilinos::comm_self())), matrix (new Epetra_FECrsMatrix(Copy, - Epetra_Map (m, 0, + Epetra_Map (static_cast(m), 0, Utilities::Trilinos::comm_self()), *column_space_map, (int*)const_cast(&(n_entries_per_row[0])), @@ -339,10 +339,10 @@ namespace TrilinosWrappers void SparseMatrix::reinit (const SparsityType &sparsity_pattern) { - const Epetra_Map rows (sparsity_pattern.n_rows(), + const Epetra_Map rows (static_cast(sparsity_pattern.n_rows()), 0, Utilities::Trilinos::comm_self()); - const Epetra_Map columns (sparsity_pattern.n_cols(), + const Epetra_Map columns (static_cast(sparsity_pattern.n_cols()), 0, Utilities::Trilinos::comm_self()); @@ -527,10 +527,10 @@ namespace TrilinosWrappers const bool copy_values, const ::dealii::SparsityPattern *use_this_sparsity) { - const Epetra_Map rows (dealii_sparse_matrix.m(), + const Epetra_Map rows (static_cast(dealii_sparse_matrix.m()), 0, Utilities::Trilinos::comm_self()); - const Epetra_Map columns (dealii_sparse_matrix.n(), + const Epetra_Map columns (static_cast(dealii_sparse_matrix.n()), 0, Utilities::Trilinos::comm_self()); reinit (rows, columns, dealii_sparse_matrix, drop_tolerance, @@ -621,7 +621,7 @@ namespace TrilinosWrappers std::size_t in_index, index; for (unsigned int row=0; row(row))) { index = rowstart_indices[row]; in_index = in_rowstart_indices[row]; @@ -718,7 +718,7 @@ namespace TrilinosWrappers // Only do this on the rows owned // locally on this processor. - int local_row = matrix->LRID(row); + int local_row = matrix->LRID(static_cast(row)); if (local_row >= 0) { TrilinosScalar *values; @@ -770,7 +770,7 @@ namespace TrilinosWrappers { // Extract local indices in // the matrix. - int trilinos_i = matrix->LRID(i), trilinos_j = matrix->LCID(j); + int trilinos_i = matrix->LRID(static_cast(i)), trilinos_j = matrix->LCID(static_cast(j)); TrilinosScalar value = 0.; // If the data is not on the @@ -844,7 +844,7 @@ namespace TrilinosWrappers { // Extract local indices in // the matrix. - int trilinos_i = matrix->LRID(i), trilinos_j = matrix->LCID(j); + int trilinos_i = matrix->LRID(static_cast(i)), trilinos_j = matrix->LCID(static_cast(j)); TrilinosScalar value = 0.; // If the data is not on the @@ -936,7 +936,7 @@ namespace TrilinosWrappers // get a representation of the // present row int ncols = -1; - int local_row = matrix->LRID(row); + int local_row = matrix->LRID(static_cast(row)); // on the processor who owns this // row, we'll have a non-negative @@ -1210,7 +1210,7 @@ namespace TrilinosWrappers ExcDimensionMismatch(matrix->NumGlobalEntries(row), rhs.matrix->NumGlobalEntries(row))); - const int row_local = matrix->RowMap().LID(row); + const int row_local = matrix->RowMap().LID(static_cast(row)); int n_entries, rhs_n_entries; TrilinosScalar *value_ptr, *rhs_value_ptr; @@ -1272,7 +1272,7 @@ namespace TrilinosWrappers for (unsigned int row=local_range.first; row < local_range.second; ++row) { - const int row_local = matrix->RowMap().LID(row); + const int row_local = matrix->RowMap().LID(static_cast(row)); int n_entries; ierr = rhs.matrix->ExtractMyRowCopy (row_local, max_row_length, diff --git a/deal.II/source/lac/trilinos_sparsity_pattern.cc b/deal.II/source/lac/trilinos_sparsity_pattern.cc index 22e6117fed..60a144b79b 100644 --- a/deal.II/source/lac/trilinos_sparsity_pattern.cc +++ b/deal.II/source/lac/trilinos_sparsity_pattern.cc @@ -177,8 +177,8 @@ namespace TrilinosWrappers const unsigned int n, const unsigned int n_entries_per_row) { - const Epetra_Map rows (m, 0, Utilities::Trilinos::comm_self()); - const Epetra_Map columns (n, 0, Utilities::Trilinos::comm_self()); + const Epetra_Map rows (static_cast(m), 0, Utilities::Trilinos::comm_self()); + const Epetra_Map columns (static_cast(n), 0, Utilities::Trilinos::comm_self()); reinit (rows, columns, n_entries_per_row); } @@ -227,8 +227,8 @@ namespace TrilinosWrappers const unsigned int n, const std::vector &n_entries_per_row) { - const Epetra_Map rows (m, 0, Utilities::Trilinos::comm_self()); - const Epetra_Map columns (n, 0, Utilities::Trilinos::comm_self()); + const Epetra_Map rows (static_cast(m), 0, Utilities::Trilinos::comm_self()); + const Epetra_Map columns (static_cast(n), 0, Utilities::Trilinos::comm_self()); reinit (rows, columns, n_entries_per_row); } @@ -368,8 +368,8 @@ namespace TrilinosWrappers void SparsityPattern::copy_from (const SparsityType &sp) { - const Epetra_Map rows (sp.n_rows(), 0, Utilities::Trilinos::comm_self()); - const Epetra_Map columns (sp.n_cols(), 0, Utilities::Trilinos::comm_self()); + const Epetra_Map rows (static_cast(sp.n_rows()), 0, Utilities::Trilinos::comm_self()); + const Epetra_Map columns (static_cast(sp.n_cols()), 0, Utilities::Trilinos::comm_self()); reinit (rows, columns, sp); } @@ -417,7 +417,7 @@ namespace TrilinosWrappers { // Extract local indices in // the matrix. - int trilinos_i = graph->LRID(i), trilinos_j = graph->LCID(j); + int trilinos_i = graph->LRID(static_cast(i)), trilinos_j = graph->LCID(static_cast(j)); // If the data is not on the // present processor, we throw @@ -587,7 +587,7 @@ namespace TrilinosWrappers // get a representation of the // present row int ncols = -1; - int local_row = graph->LRID(row); + int local_row = graph->LRID(static_cast(row)); // on the processor who owns this // row, we'll have a non-negative @@ -652,7 +652,7 @@ namespace TrilinosWrappers // j horizontal, gnuplot output is // x-y, that is we have to exchange // the order of output - out << indices[graph->GRID(j)] << " " << -static_cast(row) + out << indices[graph->GRID(static_cast(j))] << " " << -static_cast(row) << std::endl; } diff --git a/deal.II/source/lac/trilinos_vector.cc b/deal.II/source/lac/trilinos_vector.cc index 3d8f1a05ad..2f4611cc64 100644 --- a/deal.II/source/lac/trilinos_vector.cc +++ b/deal.II/source/lac/trilinos_vector.cc @@ -397,7 +397,7 @@ namespace TrilinosWrappers const MPI_Comm &communicator) { last_action = Zero; - Epetra_LocalMap map (partitioning.size(), + Epetra_LocalMap map (static_cast(partitioning.size()), 0, #ifdef DEAL_II_COMPILER_SUPPORTS_MPI Epetra_MpiComm(communicator)); @@ -489,7 +489,7 @@ namespace TrilinosWrappers if (vector->Map().NumGlobalElements() != static_cast(partitioning.size())) { - Epetra_LocalMap map (partitioning.size(), + Epetra_LocalMap map (static_cast(partitioning.size()), 0, #ifdef DEAL_II_COMPILER_SUPPORTS_MPI Epetra_MpiComm(communicator)); diff --git a/deal.II/source/lac/trilinos_vector_base.cc b/deal.II/source/lac/trilinos_vector_base.cc index a90bb9e0ae..7e545c4f17 100644 --- a/deal.II/source/lac/trilinos_vector_base.cc +++ b/deal.II/source/lac/trilinos_vector_base.cc @@ -40,7 +40,7 @@ namespace TrilinosWrappers // we can use []. Note that we // can only get local values. - const int local_index = vector.vector->Map().LID(index); + const int local_index = vector.vector->Map().LID(static_cast(index)); Assert (local_index >= 0, ExcAccessToNonLocalElement (index, vector.vector->Map().MinMyGID(), @@ -167,7 +167,7 @@ namespace TrilinosWrappers { // Extract local indices in // the vector. - int trilinos_i = vector->Map().LID(index); + int trilinos_i = vector->Map().LID(static_cast(index)); TrilinosScalar value = 0.; // If the element is not @@ -195,7 +195,7 @@ namespace TrilinosWrappers { // Extract local indices in // the vector. - int trilinos_i = vector->Map().LID(index); + int trilinos_i = vector->Map().LID(static_cast(index)); TrilinosScalar value = 0.; // If the element is not present