From: Wolfgang Bangerth Date: Tue, 26 May 1998 12:58:41 +0000 (+0000) Subject: Add a bit of error checking. X-Git-Tag: v8.0.0~22887 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e976fc38d5681054f3432699e6ed97cf4ccd934f;p=dealii.git Add a bit of error checking. git-svn-id: https://svn.dealii.org/trunk@367 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/Todo b/deal.II/deal.II/Todo index 7d41e06ac6..79ea4e7166 100644 --- a/deal.II/deal.II/Todo +++ b/deal.II/deal.II/Todo @@ -103,6 +103,9 @@ Remove the this-> coding in tria_iterator.templates.h. These were egcs snapshot. +Re-enable printing of a preamble to ucd files in data_io.cc. + + DEAL: diff --git a/deal.II/deal.II/include/numerics/data_io.h b/deal.II/deal.II/include/numerics/data_io.h index d781afaaf3..ccdfe0204a 100644 --- a/deal.II/deal.II/include/numerics/data_io.h +++ b/deal.II/deal.II/include/numerics/data_io.h @@ -425,6 +425,15 @@ class DataOut { * Exception */ DeclException0 (ExcNoDoFHandlerSelected); + /** + * Exception + */ + DeclException2 (ExcInvalidVectorSize, + int, int, + << "The vector has size " << arg1 + << " but the DoFHandler objects says there are " << arg2 + << " degrees of freedom."); + private: /** diff --git a/deal.II/deal.II/source/numerics/data_io.cc b/deal.II/deal.II/source/numerics/data_io.cc index 44eb3a8700..b3d2d57135 100644 --- a/deal.II/deal.II/source/numerics/data_io.cc +++ b/deal.II/deal.II/source/numerics/data_io.cc @@ -212,6 +212,9 @@ template void DataOut::add_data_vector (const dVector &vec, const string &name, const string &units) { + Assert (dofs != 0, ExcNoDoFHandlerSelected ()); + Assert (vec.size() == dofs->n_dofs(), + ExcInvalidVectorSize (vec.size(), dofs->n_dofs())); DataEntry new_entry (&vec, name, units); data.push_back (new_entry); };