From: Peter Munch Date: Tue, 10 Aug 2021 19:18:02 +0000 (+0200) Subject: Add assert to DataOut to force users to use block vectors for non-contiguous indexsets X-Git-Tag: v9.4.0-rc1~1075^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=847250e1c3f3df50b6403303b4cf7344e033e203;p=dealii.git Add assert to DataOut to force users to use block vectors for non-contiguous indexsets --- 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);