]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
introduce dimension variable in polynomial spaces and use in FE_Poly
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 24 Nov 2009 22:54:51 +0000 (22:54 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 24 Nov 2009 22:54:51 +0000 (22:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@20161 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/polynomial_space.h
deal.II/base/include/base/tensor_product_polynomials.h
deal.II/deal.II/include/fe/fe_poly.h
deal.II/deal.II/include/fe/fe_poly.templates.h

index 26413fad3ca77dd205848ae9e330ea693de81411..448301082d2e70f241197e262c0f2d02657db5d2 100644 (file)
@@ -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 <int dim>
 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. <tt>pols</tt> is a
                                      * vector of pointers to
index 7191d2a611d9020895675de75f889678ee376d12..db075ce851da4ba94b305a292dfb4f8a9d41419f 100644 (file)
@@ -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 <int dim>
 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. <tt>pols</tt> is
                                      * a vector of objects that
index 44a549144fbe55c403ae6bf2bcf4f60be17c444a..ea3d772b965ab918d340c0ddcb3075f3afd2a8c7 100644 (file)
@@ -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 <class POLY, int dim/*=POLY::dim*/, int spacedim=dim>
+template <class POLY, int dim=POLY::dimension, int spacedim=dim>
 class FE_Poly : public FiniteElement<dim,spacedim>
 {
   public:
index f75abfb8b61cf9c40f356b3e357fc10965b0c17d..24dc8bd23504600f5507f5d27d13d33c10872bfd 100644 (file)
@@ -28,7 +28,9 @@ FE_Poly<POLY,dim,spacedim>::FE_Poly (const POLY& poly_space,
                                    restriction_is_additive_flags,
                                    nonzero_components),
                 poly_space(poly_space)
-{}
+{
+  AssertDimension(dim, POLY::dimension);
+}
 
 
 template <class POLY, int dim, int spacedim>

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.