From: kronbichler Date: Sat, 18 Jan 2014 22:41:19 +0000 (+0000) Subject: Fix at least one issue with my commit: The flux sparsity pattern needs to include... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=559c60ce783d9267231c2688a5b1a3aefa55cf5f;p=dealii-svn.git Fix at least one issue with my commit: The flux sparsity pattern needs to include other-other coupling when using MeshWorker git-svn-id: https://svn.dealii.org/trunk@32251 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 13571aa507..92d4d816f8 100644 --- a/deal.II/include/deal.II/lac/trilinos_sparse_matrix.h +++ b/deal.II/include/deal.II/lac/trilinos_sparse_matrix.h @@ -2756,10 +2756,18 @@ namespace TrilinosWrappers std::cout << col_index_ptr[i] << " "; 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(static_cast(row)), - n_indices, - indices); + std::vector indices; + const Epetra_CrsGraph* graph = + (nonlocal_matrix.get() != 0 && + row_partitioner().MyGID(static_cast(row)) == false) ? + &nonlocal_matrix->Graph() : &matrix->Graph(); + + indices.resize(graph->NumGlobalIndices(static_cast(row))); + int n_indices = 0; + graph->ExtractGlobalRowCopy(static_cast(row), + indices.size(), n_indices, &indices[0]); + AssertDimension(static_cast(n_indices), indices.size()); + for (TrilinosWrappers::types::int_type i=0; ineighbor(face)->subdomain_id() != cell->subdomain_id())) - constraints.add_entries_local_to_global - (dofs_on_other_cell, dofs_on_this_cell, - sparsity, keep_constrained_dofs); + { + constraints.add_entries_local_to_global + (dofs_on_other_cell, dofs_on_this_cell, + sparsity, keep_constrained_dofs); + if (cell->neighbor(face)->active()) + constraints.add_entries_local_to_global + (dofs_on_other_cell, dofs_on_other_cell, + sparsity, keep_constrained_dofs); + } } } }