From: wolf Date: Sun, 1 Nov 1998 22:25:19 +0000 (+0000) Subject: Add a message. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=452c79fc60b96ff042c32ea55c7b36f3563c3f6b;p=dealii-svn.git Add a message. git-svn-id: https://svn.dealii.org/trunk@620 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/numerics/data_io.h b/deal.II/deal.II/include/numerics/data_io.h index 1502aebc01..cd84fd0546 100644 --- a/deal.II/deal.II/include/numerics/data_io.h +++ b/deal.II/deal.II/include/numerics/data_io.h @@ -399,6 +399,14 @@ class DataOut { << "The vector has size " << arg1 << " but the DoFHandler objects says there are " << arg2 << " degrees of freedom."); + /** + * Exception + */ + DeclException1 (ExcInvalidCharacter, + string, + << "Please use only the characters [a-zA-Z0-9_] for" << endl + << "description strings since AVS will only accept these." << endl + << "The string you gave was <" << arg1 << ">."); private: diff --git a/deal.II/deal.II/source/numerics/data_io.cc b/deal.II/deal.II/source/numerics/data_io.cc index 1e6fb16dec..2f36c119f8 100644 --- a/deal.II/deal.II/source/numerics/data_io.cc +++ b/deal.II/deal.II/source/numerics/data_io.cc @@ -211,6 +211,15 @@ void DataOut::add_data_vector (const dVector &vec, Assert (dofs != 0, ExcNoDoFHandlerSelected ()); Assert (vec.size() == dofs->n_dofs(), ExcInvalidVectorSize (vec.size(), dofs->n_dofs())); + Assert (name.find_first_not_of("abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789_") == string::npos, + ExcInvalidCharacter (name)); + Assert (units.find_first_not_of("abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789_") == string::npos, + ExcInvalidCharacter (units)); + DataEntry new_entry (&vec, name, units); data.push_back (new_entry); };