From 847250e1c3f3df50b6403303b4cf7344e033e203 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Tue, 10 Aug 2021 21:18:02 +0200 Subject: [PATCH] Add assert to DataOut to force users to use block vectors for non-contiguous indexsets --- include/deal.II/numerics/data_out_dof_data.templates.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/deal.II/numerics/data_out_dof_data.templates.h b/include/deal.II/numerics/data_out_dof_data.templates.h index 17cfd07cb9..62cc452ade 100644 --- a/include/deal.II/numerics/data_out_dof_data.templates.h +++ b/include/deal.II/numerics/data_out_dof_data.templates.h @@ -866,6 +866,12 @@ namespace internal const VectorType & src, LinearAlgebra::distributed::BlockVector &dst) { + Assert(dof_handler.locally_owned_dofs().is_contiguous(), + ExcMessage( + "You are trying to add a non-block vector with non-contiguous " + "locally-owned index sets. This is not possible. Please " + "consider to use an adequate block vector!")); + IndexSet locally_relevant_dofs; DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); -- 2.39.5