From: kronbichler Date: Fri, 22 Aug 2008 16:31:46 +0000 (+0000) Subject: Hide a compress() call within the collect_sizes operation, so compres() will only... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=476717499d1fb11a33e49cc910f0b019c411ec08;p=dealii-svn.git Hide a compress() call within the collect_sizes operation, so compres() will only be needed after assembly. git-svn-id: https://svn.dealii.org/trunk@16654 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/trilinos_block_sparse_matrix.h b/deal.II/lac/include/lac/trilinos_block_sparse_matrix.h index c9a5a81552..99f2caab4c 100644 --- a/deal.II/lac/include/lac/trilinos_block_sparse_matrix.h +++ b/deal.II/lac/include/lac/trilinos_block_sparse_matrix.h @@ -182,14 +182,13 @@ namespace TrilinosWrappers /** * This function calls the compress() * command of all matrices after - * the sparsity pattern has been - * generated or the assembly is + * the assembly is * completed. Note that all MPI * processes need to call this - * command (in contrast to sparsity - * pattern generation, which is - * probably only called on one - * single process) before any + * command (whereas the individual + * assembly routines will most probably + * only be called on each processor + * individually) before any * can complete it. */ void compress (); @@ -204,7 +203,10 @@ namespace TrilinosWrappers * subobjects. You *must* call * this function each time after * you have changed the size of - * the sub-objects. + * the sub-objects. Note that + * this is a collective + * operation, i.e., it needs to + * be called on all MPI processes. */ void collect_sizes (); diff --git a/deal.II/lac/source/trilinos_block_sparse_matrix.cc b/deal.II/lac/source/trilinos_block_sparse_matrix.cc index 314c8a158d..6d486470e8 100644 --- a/deal.II/lac/source/trilinos_block_sparse_matrix.cc +++ b/deal.II/lac/source/trilinos_block_sparse_matrix.cc @@ -97,6 +97,7 @@ namespace TrilinosWrappers void BlockSparseMatrix::collect_sizes () { + compress(); BaseClass::collect_sizes (); } diff --git a/deal.II/lac/source/trilinos_sparse_matrix.cc b/deal.II/lac/source/trilinos_sparse_matrix.cc index f8f8872550..0e9789f71c 100755 --- a/deal.II/lac/source/trilinos_sparse_matrix.cc +++ b/deal.II/lac/source/trilinos_sparse_matrix.cc @@ -275,15 +275,6 @@ namespace TrilinosWrappers matrix = std::auto_ptr (new Epetra_FECrsMatrix(Copy, row_map, col_map, &n_entries_per_row[0], true)); - -// Assert (matrix->NumGlobalCols() == col_map.NumGlobalElements(), -// ExcInternalError()); -// Assert (matrix->NumGlobalRows() == row_map.NumGlobalElements(), -// ExcInternalError()); -// Assert (matrix->NumGlobalCols() == sparsity_pattern.n_cols(), -// ExcInternalError()); -// Assert (matrix->NumGlobalRows() == sparsity_pattern.n_rows(), -// ExcInternalError()); const unsigned int n_max_entries_per_row = *std::max_element ( &n_entries_per_row[0], &n_entries_per_row[n_rows-1]);