From: 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-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c57290188c0c72b88ed857e2faa707faf63b05c0;p=dealii-svn.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