Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compressing TrilinosWrappers::SparsityPattern with empty column map #8277

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/news/changes/minor/20190522ArndtAnselmann
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixed: TrilinosWrappers::SparsityPattern can deal with empty column maps.
<br>
(Daniel Arndt, Mathias Anselmann, 2019/05/22)
4 changes: 3 additions & 1 deletion source/lac/trilinos_sparsity_pattern.cc
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,8 @@ namespace TrilinosWrappers
if (nonlocal_graph.get() != nullptr)
{
if (nonlocal_graph->IndicesAreGlobal() == false &&
nonlocal_graph->RowMap().NumMyElements() > 0)
nonlocal_graph->RowMap().NumMyElements() > 0 &&
column_space_map->NumMyElements() > 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you want to check for column_space_map->NumGlobalElements() > 0? We have a switch for an empty column space map on the local process in line 811 below. See also #7833.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed that.

{
// Insert dummy element at (row, column) that corresponds to row 0
// in local index counting.
Expand All @@ -813,6 +814,7 @@ namespace TrilinosWrappers
AssertThrow(ierr == 0, ExcTrilinosError(ierr));
}
Assert(nonlocal_graph->RowMap().NumMyElements() == 0 ||
column_space_map->NumMyElements() == 0 ||
nonlocal_graph->IndicesAreGlobal() == true,
ExcInternalError());

Expand Down