From 4dab6c274a1fb74ba67288e6e646dbdfd55b9345 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Tue, 24 Nov 2009 22:54:51 +0000 Subject: [PATCH] introduce dimension variable in polynomial spaces and use in FE_Poly git-svn-id: https://svn.dealii.org/trunk@20161 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/polynomial_space.h | 10 +++++++++- deal.II/base/include/base/tensor_product_polynomials.h | 10 +++++++++- deal.II/deal.II/include/fe/fe_poly.h | 8 ++------ deal.II/deal.II/include/fe/fe_poly.templates.h | 4 +++- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/deal.II/base/include/base/polynomial_space.h b/deal.II/base/include/base/polynomial_space.h index 26413fad3c..448301082d 100644 --- a/deal.II/base/include/base/polynomial_space.h +++ b/deal.II/base/include/base/polynomial_space.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -85,6 +85,14 @@ template class PolynomialSpace { public: + /** + * Access to the dimension of + * this object, for checking and + * automatic setting of dimension + * in other classes. + */ + static const unsigned int dimension = dim; + /** * Constructor. pols is a * vector of pointers to diff --git a/deal.II/base/include/base/tensor_product_polynomials.h b/deal.II/base/include/base/tensor_product_polynomials.h index 7191d2a611..db075ce851 100644 --- a/deal.II/base/include/base/tensor_product_polynomials.h +++ b/deal.II/base/include/base/tensor_product_polynomials.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -62,6 +62,14 @@ template class TensorProductPolynomials { public: + /** + * Access to the dimension of + * this object, for checking and + * automatic setting of dimension + * in other classes. + */ + static const unsigned int dimension = dim; + /** * Constructor. pols is * a vector of objects that diff --git a/deal.II/deal.II/include/fe/fe_poly.h b/deal.II/deal.II/include/fe/fe_poly.h index 44a549144f..ea3d772b96 100644 --- a/deal.II/deal.II/include/fe/fe_poly.h +++ b/deal.II/deal.II/include/fe/fe_poly.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors +// Copyright (C) 2004, 2005, 2006, 2007, 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -55,13 +55,9 @@ DEAL_II_NAMESPACE_OPEN * functions depend on the cells in real space, the update_once() and * update_each() functions must be overloaded. * - * Todos: - * - checke dim of POLY - * - templatisiere nur auf POLY, dim ergibt sich durch POLY::dim - * * @author Ralf Hartmann 2004 **/ -template +template class FE_Poly : public FiniteElement { public: diff --git a/deal.II/deal.II/include/fe/fe_poly.templates.h b/deal.II/deal.II/include/fe/fe_poly.templates.h index f75abfb8b6..24dc8bd235 100644 --- a/deal.II/deal.II/include/fe/fe_poly.templates.h +++ b/deal.II/deal.II/include/fe/fe_poly.templates.h @@ -28,7 +28,9 @@ FE_Poly::FE_Poly (const POLY& poly_space, restriction_is_additive_flags, nonzero_components), poly_space(poly_space) -{} +{ + AssertDimension(dim, POLY::dimension); +} template -- 2.39.5