From c24af51e7d608836955babcefc425e86cc9c80bd Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 22 May 2019 23:49:28 -0400 Subject: [PATCH] Fix compressing TrilinosWrappers::SparsityPattern with empty column map --- doc/news/changes/minor/20190522ArndtAnselmann | 3 +++ source/lac/trilinos_sparsity_pattern.cc | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 doc/news/changes/minor/20190522ArndtAnselmann diff --git a/doc/news/changes/minor/20190522ArndtAnselmann b/doc/news/changes/minor/20190522ArndtAnselmann new file mode 100644 index 0000000000..7ee6432e3d --- /dev/null +++ b/doc/news/changes/minor/20190522ArndtAnselmann @@ -0,0 +1,3 @@ +Fixed: TrilinosWrappers::SparsityPattern can deal with empty column maps. +
+(Daniel Arndt, Mathias Anselmann, 2019/05/22) diff --git a/source/lac/trilinos_sparsity_pattern.cc b/source/lac/trilinos_sparsity_pattern.cc index 84403175c6..c448279505 100644 --- a/source/lac/trilinos_sparsity_pattern.cc +++ b/source/lac/trilinos_sparsity_pattern.cc @@ -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) { // Insert dummy element at (row, column) that corresponds to row 0 // in local index counting. @@ -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()); -- 2.39.5