From 607ba21795bf93b4581bc098e3ca44f0b4bcdb4e Mon Sep 17 00:00:00 2001 From: kanschat Date: Tue, 7 Nov 2006 16:40:18 +0000 Subject: [PATCH] exception and documentation added git-svn-id: https://svn.dealii.org/trunk@14171 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe_tools.h | 51 +++++++++++++++++++++++++-- deal.II/deal.II/source/fe/fe_tools.cc | 3 +- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/deal.II/deal.II/include/fe/fe_tools.h b/deal.II/deal.II/include/fe/fe_tools.h index 2977d6f584..5021bf6424 100644 --- a/deal.II/deal.II/include/fe/fe_tools.h +++ b/deal.II/deal.II/include/fe/fe_tools.h @@ -1135,29 +1135,68 @@ class FETools * custom element that must be * added using add_fe_name() * first. + * + * @ingroup Exceptions */ DeclException1 (ExcInvalidFEName, std::string, << "Can't re-generate a finite element from the string '" << arg1 << "'."); + /** + * The string used for + * get_fe_from_name() cannot be + * translated to a finite + * element. + * + * Dimension arguments in finite + * element names should be + * avoided. If they are there, + * the dimension should be + * dim or + * d. Here, you gave a + * numeric dimension argument, + * which does not match the + * template dimension of the + * finite element class. + * + * @ingroup Exceptions + */ + DeclException2 (ExcInvalidFEDimension, + char, int, + << "The dimension " << arg1 + << " in the finite element string must match " + << "the space dimension " + << arg2 << "."); + /** * Exception + * + * @ingroup Exceptions */ DeclException0 (ExcInvalidFE); /** * The finite element must be * @ref GlossPrimitive "primitive". + * + * @ingroup Exceptions */ DeclException0 (ExcFEMustBePrimitive); /** * Exception + * + * @ingroup Exceptions */ DeclException0 (ExcTriangulationMismatch); /** - * Exception + * A continuous element is used + * on a mesh with hanging nodes, + * but the constraint matrices + * are missing. + * + * @ingroup Exceptions */ DeclException1 (ExcHangingNodesNotAllowed, int, @@ -1167,10 +1206,16 @@ class FETools << "additional ConstraintMatrix argument(s), instead."); /** * You need at least two grid levels. + * + * @ingroup Exceptions */ DeclException0 (ExcGridNotRefinedAtLeastOnce); /** - * Exception + * The dimensions of the matrix + * used did not match the + * expected dimensions. + * + * @ingroup Exceptions */ DeclException4 (ExcMatrixDimensionMismatch, int, int, int, int, @@ -1181,6 +1226,8 @@ class FETools * Exception thrown if an * embedding matrix was computed * inaccurately. + * + * @ingroup Exceptions */ DeclException1(ExcLeastSquaresError, double, << "Least squares fit leaves a gap of " << arg1); diff --git a/deal.II/deal.II/source/fe/fe_tools.cc b/deal.II/deal.II/source/fe/fe_tools.cc index 5cfde3e3c1..3b17e2ae8a 100644 --- a/deal.II/deal.II/source/fe/fe_tools.cc +++ b/deal.II/deal.II/source/fe/fe_tools.cc @@ -1526,10 +1526,9 @@ FETools::get_fe_from_name (const std::string ¶meter_name) if (pos2-pos1 == 2) { const char dimchar = '0' + dim; -//TODO: Write a more explicit exception here! if (name.at(pos1+1) != 'd') Assert (name.at(pos1+1) == dimchar, - ExcInvalidFEName(name)); + ExcInvalidFEDimension(name.at(pos1+1), dim)); } else Assert(pos2-pos1 == 4, ExcInvalidFEName(name)); -- 2.39.5