From e4dc526995964b408e89b764aa4596c58b38042a Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 18 Feb 2014 22:28:57 +0000 Subject: [PATCH] add exception to DataOut::add_data_vector if DataVectorType::type_automatic can not uniquely determine the type git-svn-id: https://svn.dealii.org/trunk@32510 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/numerics/data_out_dof_data.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deal.II/source/numerics/data_out_dof_data.cc b/deal.II/source/numerics/data_out_dof_data.cc index db456bc6eb..2693a91a52 100644 --- a/deal.II/source/numerics/data_out_dof_data.cc +++ b/deal.II/source/numerics/data_out_dof_data.cc @@ -740,6 +740,11 @@ add_data_vector (const VECTOR &vec, DataVectorType actual_type = type; if (type == type_automatic) { + // in the rare case that someone has a DGP(0) attached, we can not decide what she wants here: + Assert((dofs == 0) || (triangulation->n_active_cells() != dofs->n_dofs()), + ExcMessage("Unable to determine the type of vector automatically because the number of DoFs " + "is equal to the number of cells. Please specify DataVectorType.")); + if (vec.size() == triangulation->n_active_cells()) actual_type = type_cell_data; else -- 2.39.5