[Dune] [Dune-Commit] dune-localfunctions r671 - trunk/dune/localfunctions/test

Carsten Gräser graeser at math.fu-berlin.de
Fri Jan 8 15:23:55 CET 2010


graeser at dune-project.org schrieb:
> Author: graeser
> Date: 2010-01-08 14:56:37 +0100 (Fri, 08 Jan 2010)
> New Revision: 671
> 
> Modified:
>    trunk/dune/localfunctions/test/testfem.cc
> Log:
> Test all FEs with virtual interface
> 
> Currently the following tests fail:
> *HierarchicalP2WithElementBubble* fails if DUNE_VIRT* is enabled
>  also it pretends to respect it
> *all RT* fail with the virtual wrapper as they assume a Traits class
>  in the function handed to interpolate that is not present in the base class
> 
>  Is there a reason why this Traits class can  not be avoided ?
>  If yes we should add it to Dune::Function and Dune::VirtualFunction to fix this.
OK, there might be esoteric cases where the RangeType of the function can be
converted to the RangeType of the FE, but you can't construct the functions
RangeType without knowing it. In general if you could at least use a wrapper
with the FEs RangeType - but to avoid this I added the Traits to Dune::Function.

Regards
Carsten
> 
> 
> Modified: trunk/dune/localfunctions/test/testfem.cc
> ===================================================================
> --- trunk/dune/localfunctions/test/testfem.cc	2010-01-08 13:24:47 UTC (rev 670)
> +++ trunk/dune/localfunctions/test/testfem.cc	2010-01-08 13:56:37 UTC (rev 671)
> @@ -4,6 +4,7 @@
>  #endif
>  
>  //#define DUNE_VIRTUAL_SHAPEFUNCTIONS 1
> +//#undef DUNE_VIRTUAL_SHAPEFUNCTIONS
>  
>  #include <cstddef>
>  #include <iostream>
> @@ -40,15 +41,14 @@
>  #include "../edges03d.hh"
>  #endif
>  
> +#include <dune/localfunctions/common/virtualinterface.hh>
>  
>  double TOL = 1e-10;
>  
>  template<class FE>
>  class Func :
>  #ifndef DUNE_VIRTUAL_SHAPEFUNCTIONS
> -  public Dune::Function<
> -    const typename FE::Traits::LocalBasisType::Traits::DomainType&,
> -    typename FE::Traits::LocalBasisType::Traits::RangeType&>
> +  public Dune::LocalFiniteElementFunctionBase<FE>::type
>  #else
>    public Dune::VirtualFunction<
>      typename FE::Traits::LocalBasisType::Traits::DomainType,
> @@ -85,9 +85,7 @@
>  template<class FE>
>  class LocalFEFunction :
>  #ifndef DUNE_VIRTUAL_SHAPEFUNCTIONS
> -    public Dune::Function<
> -        const typename FE::Traits::LocalBasisType::Traits::DomainType&,
> -        typename FE::Traits::LocalBasisType::Traits::RangeType&>
> +  public Dune::LocalFiniteElementFunctionBase<FE>::type
>  #else
>      public Dune::VirtualFunction<
>          typename FE::Traits::LocalBasisType::Traits::DomainType,
> @@ -200,15 +198,25 @@
>  
>      fe.localInterpolation().interpolate(Func<FE>(),c);
>  
> +    bool success = true;
>  #ifndef DUNE_VIRTUAL_SHAPEFUNCTIONS
> -    return testLocalInterpolation<FE>(fe);
> +    success = testLocalInterpolation<FE>(fe) and success;
> +
> +    typedef typename FE::Traits::LocalBasisType::Traits LBTraits;
> +    typedef typename Dune::C0LocalBasisTraitsFromOther<LBTraits>::Traits C0LBTraits;
> +    typedef typename Dune::C0LocalFiniteElementVirtualInterface<C0LBTraits> VirtualFEInterface;
> +    typedef typename Dune::C0LocalFiniteElementVirtualImp<FE> VirtualFEImp;
> +
> +    const VirtualFEImp virtualFE(fe);
> +    success = testLocalInterpolation<VirtualFEInterface>(virtualFE) and success;
>  #else
>      typedef typename FE::Traits::LocalBasisType::Traits::DomainFieldType DT;
>      typedef typename FE::Traits::LocalBasisType::Traits::RangeFieldType RT;
>      const int dim = FE::Traits::LocalBasisType::Traits::dimDomain;
>      typedef Dune::LocalFiniteElementInterface<DT, RT, dim> FEBase;
> -    return testLocalInterpolation<FEBase>(fe);
> +    success = testLocalInterpolation<FEBase>(fe) and success;
>  #endif
> +    return success;
>  }
>  
>  
> 
> 
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit
	

-- 
----------------------------------------------------------------------
Carsten Gräser           | phone: +49-30 / 838-75349
Freie Universität Berlin | fax  : +49-30 / 838-54977
Institut für Mathematik  | email: graeser at math.fu-berlin.de
Arnimallee 6             |
14195 Berlin, Germany    | URL  : http://page.mi.fu-berlin.de/graeser
----------------------------------------------------------------------




More information about the Dune mailing list