[dune-pdelab] [dune-pdelab-commit] dune-pdelab r1010 - in branches/review_2011/dune/pdelab: common/typetree gridfunctionspace

Christian Engwer christi at uni-hd.de
Thu Feb 3 18:01:09 CET 2011


Hi Steffen,

On Thu, Feb 03, 2011 at 05:41:12PM +0100, muething at conan.iwr.uni-heidelberg.de wrote:
> Author: muething
> Date: Thu Feb  3 17:41:12 2011
> New Revision: 1010
> URL: http://svn.dune-project.org/websvn/listing.php?repname=dune-pdelab&path=/&rev=1010&sc=1
> 
> Log:
> [TypeTree] Move checkGridViewType() to utility header

ich würde es assertGridViewType oder ensureGridViewType nennen, da es
ja keinen bool zurück gibt, und man somit nicht auf einen Fehler
reagieren kann.

Aber alles nur ein Vorschlag ;-)

Christian

> 
> Modified:
>    branches/review_2011/dune/pdelab/common/typetree/utility.hh
>    branches/review_2011/dune/pdelab/gridfunctionspace/compositegridfunctionspace.hh
> 
> Modified: branches/review_2011/dune/pdelab/common/typetree/utility.hh
> ==============================================================================
> --- branches/review_2011/dune/pdelab/common/typetree/utility.hh	Wed Feb  2 16:49:35 2011	(r1009)
> +++ branches/review_2011/dune/pdelab/common/typetree/utility.hh	Thu Feb  3 17:41:12 2011	(r1010)
> @@ -5,6 +5,7 @@
>  #define DUNE_PDELAB_COMMON_TYPETREE_UTILITY_HH
>  
>  #include <dune/common/shared_ptr.hh>
> +#include <dune/pdelab/common/typetree/nodetags.hh>
>  
>  namespace Dune {
>    namespace PDELab {
> @@ -29,6 +30,22 @@
>          return stackobject_to_shared_ptr(t);
>        }
>  
> +      template<typename BaseType, typename T>
> +      T& checkGridViewType(T& t)
> +      {
> +        dune_static_assert((is_same<typename BaseType::Traits::GridViewType,
> +                            typename T::Traits::GridViewType>::value),
> +                           "GridViewType must be equal in all components of composite type");
> +        return t;
> +      }
> +
> +      // this partial specialization is required for the non-variadic case
> +      template<typename BaseType>
> +      TypeTree::EmptyNode checkGridViewType(TypeTree::EmptyNode e)
> +      {
> +        return e;
> +      }
> +
>  #if HAVE_RVALUE_REFERENCES
>  
>        // only bind to real rvalues
> 
> Modified: branches/review_2011/dune/pdelab/gridfunctionspace/compositegridfunctionspace.hh
> ==============================================================================
> --- branches/review_2011/dune/pdelab/gridfunctionspace/compositegridfunctionspace.hh	Wed Feb  2 16:49:35 2011	(r1009)
> +++ branches/review_2011/dune/pdelab/gridfunctionspace/compositegridfunctionspace.hh	Thu Feb  3 17:41:12 2011	(r1010)
> @@ -16,22 +16,6 @@
>      //! \ingroup PDELab
>      //! \{
>  
> -    template<typename BaseType, typename T>
> -    T& checkGridViewType(T& t)
> -    {
> -      dune_static_assert((is_same<typename BaseType::Traits::GridViewType,
> -                          typename T::Traits::GridViewType>::value),
> -                         "GridViewType must be equal in all components of composite grid function space");
> -      return t;
> -    }
> -
> -    // this partial specialization is required for the non-variadic case
> -    template<typename BaseType>
> -    TypeTree::EmptyNode checkGridViewType(TypeTree::EmptyNode e)
> -    {
> -      return e;
> -    }
> -
>      /** \brief base class for tuples of grid function spaces
>          base class that holds implementation of the methods
>          this is the default version with lexicographic ordering
> @@ -87,7 +71,7 @@
>        typedef typename Dune::PDELab::TypeTree::TransformTree<CompositeGridFunctionSpace,gfs_to_lfs>::Type LocalFunctionSpace;
>  
>        CompositeGridFunctionSpace(DUNE_TYPETREE_COMPOSITENODE_CONSTRUCTOR_SIGNATURE)
> -        : BaseT(DUNE_TYPETREE_COMPOSITENODE_CHILDVARIABLES_THROUGH_FUNCTION(checkGridViewType<typename BaseT::template Child<0>::Type>))
> +        : BaseT(DUNE_TYPETREE_COMPOSITENODE_CHILDVARIABLES_THROUGH_FUNCTION(TypeTree::checkGridViewType<typename BaseT::template Child<0>::Type>))
>        {
>          this->setup();
>        }
> @@ -185,7 +169,7 @@
>        typedef typename Dune::PDELab::TypeTree::TransformTree<CompositeGridFunctionSpace,gfs_to_lfs>::Type LocalFunctionSpace;
>  
>        CompositeGridFunctionSpace(DUNE_TYPETREE_COMPOSITENODE_CONSTRUCTOR_SIGNATURE)
> -        : BaseT(DUNE_TYPETREE_COMPOSITENODE_CHILDVARIABLES_THROUGH_FUNCTION(checkGridViewType<typename BaseT::template Child<0>::Type>))
> +        : BaseT(DUNE_TYPETREE_COMPOSITENODE_CHILDVARIABLES_THROUGH_FUNCTION(TypeTree::checkGridViewType<typename BaseT::template Child<0>::Type>))
>        {
>          this->setup();
>        }
> @@ -324,7 +308,7 @@
>        typedef typename Dune::PDELab::TypeTree::TransformTree<CompositeGridFunctionSpace,gfs_to_lfs>::Type LocalFunctionSpace;
>  
>        CompositeGridFunctionSpace(DUNE_TYPETREE_COMPOSITENODE_CONSTRUCTOR_SIGNATURE)
> -        : BaseT(DUNE_TYPETREE_COMPOSITENODE_CHILDVARIABLES_THROUGH_FUNCTION(checkGridViewType<typename BaseT::template Child<0>::Type>))
> +        : BaseT(DUNE_TYPETREE_COMPOSITENODE_CHILDVARIABLES_THROUGH_FUNCTION(TypeTree::checkGridViewType<typename BaseT::template Child<0>::Type>))
>        {
>          this->setup();
>        }
> 
> _______________________________________________
> dune-pdelab-commit mailing list
> dune-pdelab-commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-pdelab-commit
> 




More information about the dune-pdelab mailing list