From: Timo Heister Date: Tue, 18 Feb 2014 22:28:57 +0000 (+0000) Subject: add exception to DataOut::add_data_vector if DataVectorType::type_automatic can not... X-Git-Tag: v8.2.0-rc1~805 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4dc526995964b408e89b764aa4596c58b38042a;p=dealii.git 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 --- 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