From 5b20c525754ab98f7225f31922033edfbb57c742 Mon Sep 17 00:00:00 2001 From: Julian Roth Date: Mon, 25 May 2020 16:51:05 +0200 Subject: [PATCH] Added nullptr check before applying user constraints to transfer matrices. --- doc/news/changes/minor/20200525Roth | 4 ++++ source/multigrid/mg_transfer_prebuilt.cc | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 doc/news/changes/minor/20200525Roth diff --git a/doc/news/changes/minor/20200525Roth b/doc/news/changes/minor/20200525Roth new file mode 100644 index 0000000000..cfeef832e7 --- /dev/null +++ b/doc/news/changes/minor/20200525Roth @@ -0,0 +1,4 @@ +New: Applying user constraints +after prolongation and restriction in MGTransferPrebuilt. +
+(Julian Roth, 2020/05/25) diff --git a/source/multigrid/mg_transfer_prebuilt.cc b/source/multigrid/mg_transfer_prebuilt.cc index 99130d4c94..7295d243b1 100644 --- a/source/multigrid/mg_transfer_prebuilt.cc +++ b/source/multigrid/mg_transfer_prebuilt.cc @@ -86,8 +86,9 @@ MGTransferPrebuilt::prolongate(const unsigned int to_level, ExcIndexRange(to_level, 1, prolongation_matrices.size() + 1)); prolongation_matrices[to_level - 1]->vmult(dst, src); - this->mg_constrained_dofs->get_user_constraint_matrix(to_level).distribute( - dst); + if (this->mg_constrained_dofs != nullptr) + this->mg_constrained_dofs->get_user_constraint_matrix(to_level).distribute( + dst); } @@ -103,8 +104,9 @@ MGTransferPrebuilt::restrict_and_add(const unsigned int from_level, (void)from_level; prolongation_matrices[from_level - 1]->Tvmult_add(dst, src); - this->mg_constrained_dofs->get_user_constraint_matrix(from_level - 1) - .distribute(dst); + if (this->mg_constrained_dofs != nullptr) + this->mg_constrained_dofs->get_user_constraint_matrix(from_level - 1) + .distribute(dst); } -- 2.39.5