From f1a61a9fde1f34e70e2d6924655254731388f86c Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 28 Jul 2015 14:49:40 -0400 Subject: [PATCH] avoid using Trilinos col/row_partitioner --- include/deal.II/lac/trilinos_sparse_matrix.h | 2 +- source/lac/trilinos_sparse_matrix.cc | 30 ++++++++++---------- source/lac/trilinos_vector.cc | 7 +++-- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/include/deal.II/lac/trilinos_sparse_matrix.h b/include/deal.II/lac/trilinos_sparse_matrix.h index 9d7a7a9950..b9157880b0 100644 --- a/include/deal.II/lac/trilinos_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_sparse_matrix.h @@ -2449,7 +2449,7 @@ namespace TrilinosWrappers { int ierr; ierr = matrix->GlobalAssemble(*column_space_map, - row_partitioner(), false); + matrix->RowMap(), false); Assert (ierr == 0, ExcTrilinosError(ierr)); (void)ierr; // removes -Wunused-but-set-variable in optimized mode diff --git a/source/lac/trilinos_sparse_matrix.cc b/source/lac/trilinos_sparse_matrix.cc index 66bc09313b..63f27345bd 100644 --- a/source/lac/trilinos_sparse_matrix.cc +++ b/source/lac/trilinos_sparse_matrix.cc @@ -1399,7 +1399,7 @@ namespace TrilinosWrappers // one is when the pattern is already fixed. In the former case, we add // the possibility to insert new values, and in the second we just replace // data. - if (row_partitioner().MyGID(static_cast(row)) == true) + if (matrix->RowMap().MyGID(static_cast(row)) == true) { if (matrix->Filled() == false) { @@ -1589,7 +1589,7 @@ namespace TrilinosWrappers // If the calling processor owns the row to which we want to add values, we // can directly call the Epetra_CrsMatrix input function, which is much // faster than the Epetra_FECrsMatrix function. - if (row_partitioner().MyGID(static_cast(row)) == true) + if (matrix->RowMap().MyGID(static_cast(row)) == true) { ierr = matrix->Epetra_CrsMatrix::SumIntoGlobalValues(row, n_columns, col_value_ptr, @@ -1632,18 +1632,18 @@ namespace TrilinosWrappers std::cout << "------------------------------------------" << std::endl; std::cout << "Got error " << ierr << " in row " << row - << " of proc " << row_partitioner().Comm().MyPID() + << " of proc " << matrix->RowMap().Comm().MyPID() << " when trying to add the columns:" << std::endl; for (TrilinosWrappers::types::int_type i=0; i(row)) == false ? "(nonlocal part)" : "") + << (matrix->RowMap().MyGID(static_cast(row)) == false ? "(nonlocal part)" : "") << " has the following indices:" << std::endl; std::vector indices; const Epetra_CrsGraph *graph = (nonlocal_matrix.get() != 0 && - row_partitioner().MyGID(static_cast(row)) == false) ? + matrix->RowMap().MyGID(static_cast(row)) == false) ? &nonlocal_matrix->Graph() : &matrix->Graph(); indices.resize(graph->NumGlobalIndices(static_cast(row))); @@ -1974,7 +1974,7 @@ namespace TrilinosWrappers TrilinosScalar SparseMatrix::matrix_norm_square (const VectorBase &v) const { - Assert (row_partitioner().SameAs(domain_partitioner()), + Assert (matrix->RowMap().SameAs(matrix->ColMap()), ExcNotQuadratic()); VectorBase temp_vector; @@ -1990,7 +1990,7 @@ namespace TrilinosWrappers SparseMatrix::matrix_scalar_product (const VectorBase &u, const VectorBase &v) const { - Assert (row_partitioner().SameAs(domain_partitioner()), + Assert (matrix->RowMap().SameAs(matrix->ColMap()), ExcNotQuadratic()); VectorBase temp_vector; @@ -2119,14 +2119,14 @@ namespace TrilinosWrappers indices); Assert (num_entries >= 0, ExcInternalError()); #ifndef DEAL_II_WITH_64BIT_INDICES - const size_type GID = inputleft.row_partitioner().GID(i); + const size_type GID = inputleft.trilinos_matrix().RowMap().GID(i); for (TrilinosWrappers::types::int_type j=0; j= 0, ExcInternalError()); #ifndef DEAL_II_WITH_64BIT_INDICES - const size_type GID = inputleft.row_partitioner().GID(i); + const size_type GID = inputleft.trilinos_matrix().RowMap().GID(i); for (TrilinosWrappers::types::int_type j=0; jRowMap().GID64(i); for (TrilinosWrappers::types::int_type j=0; jMap().SameAs(m.col_partitioner()) == false) + if (vector->Map().SameAs(m.trilinos_matrix().ColMap()) == false) { - Epetra_Map map = m.col_partitioner(); - vector.reset (new Epetra_FEVector(map)); + vector.reset (new Epetra_FEVector( + m.trilinos_matrix().ColMap() + )); } Epetra_Import data_exchange (vector->Map(), v.vector->Map()); -- 2.39.5