From 5292ba7934ef6aa912050ebd85dc25b27c10cbeb Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 24 Nov 2016 11:48:37 -0700 Subject: [PATCH] Add a couple more static assertions. --- include/deal.II/grid/manifold.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/deal.II/grid/manifold.h b/include/deal.II/grid/manifold.h index a1fda6dfb2..8e97d71509 100644 --- a/include/deal.II/grid/manifold.h +++ b/include/deal.II/grid/manifold.h @@ -298,6 +298,14 @@ class Manifold : public Subscriptor { public: + // explicitly check for sensible template arguments +#ifdef DEAL_II_WITH_CXX11 + static_assert (dim<=spacedim, + "The dimension of a Manifold must be less than or " + "equal to the space dimension in which it lives."); +#endif + + /** * Type keeping information about the normals at the vertices of a face of a * cell. Thus, there are GeometryInfo::vertices_per_face @@ -879,6 +887,13 @@ template class ChartManifold : public Manifold { public: + // explicitly check for sensible template arguments +#ifdef DEAL_II_WITH_CXX11 + static_assert (dim<=spacedim, + "The dimension of a ChartManifold must be less than or " + "equal to the space dimension in which it lives."); +#endif + /** * Constructor. The optional argument can be used to specify the periodicity * of the chartdim-dimensional manifold (one period per direction). A -- 2.39.5