[Dune] [Dune-CVS] dune-grid r3135 - trunk/grid/utility (fwd)

Sreejith Pulloor Kuttanikkad sreejith at hal.iwr.uni-heidelberg.de
Mon Oct 9 16:29:40 CEST 2006


I would also like to know the use of twistutility and it would be great
if explained with an example code. 
infact due to the inconsistency of intersection methods in the grids (I
guess this has not been resolved yet) I wanted to use the twist utility
(otherwise my code works only with S and Yasp grid) but so far couldnt
see how this utility can be used clearly.
thanks,
Sreejith

On Mon, Oct 09, 2006 at 04:13:38PM +0200, Oliver Sander wrote:
> Dear Dune!
> Seeing this commit brings an issue to mind that I have been
> wondering about for quite a while.  What is this TwistUtility
> good for?  I thought it was needed to related quadrature
> points on IntersectionNeighborLocal() with quad points on
> IntersectionSelfLocal().  But AFAIK that has been solved
> by the convention embodied in the test code at
> checkintersectionit.cc, lines 124 and following.  So what
> does the TwistUtility do?  Please could someone be so
> kind and document it?
> 
> Thanks,
> Oliver
> 
> ************************************************************************
> * Oliver Sander                ** email: sander at mi.fu-berlin.de        *
> * Freie Universit?t Berlin     ** phone: + 49 (30) 838 75217           *
> * Institut f?r Mathematik II   ** URL  : page.mi.fu-berlin.de/~sander  *
> * Arnimallee 6                 ** -------------------------------------*
> * 14195 Berlin, Germany        ** Member of MATHEON (www.matheon.de)   *
> ************************************************************************
> 
> ---------- Forwarded message ----------
> Date: Mon, 09 Oct 2006 16:04:04 +0200
> From: Andreas Dedner <dedner at hal.iwr.uni-heidelberg.de>
> To: dune-cvs at hal.iwr.uni-heidelberg.de
> Subject: [Dune-CVS] dune-grid r3135 - trunk/grid/utility
> 
> Author: dedner
> Date: 2006-10-09 16:04:03 +0200 (Mon, 09 Oct 2006)
> New Revision: 3135
> 
> Modified:
>    trunk/grid/utility/twistutility.hh
> Log:
> using ALUSimplexGrid...
> 
> Modified: trunk/grid/utility/twistutility.hh
> ===================================================================
> --- trunk/grid/utility/twistutility.hh	2006-10-09 14:03:25 UTC (rev 3134)
> +++ trunk/grid/utility/twistutility.hh	2006-10-09 14:04:03 UTC (rev 3135)
> @@ -24,16 +24,19 @@
>  #endif
> 
>  #include <dune/grid/sgrid.hh>
> +#include <dune/grid/yaspgrid.hh>
> 
>  namespace Dune {
> 
> +  template <class GridImp>
> +  class TwistUtility;
>    // for structured grids, the twist is always zero
>    // ? is this correct
> -  template <class GridImp>
> -  class TwistUtility
> +  template <int dim,int dimw>
> +  class TwistUtility<SGrid<dim,dimw> >
>    {
>    public:
> -    typedef GridImp GridType;
> +    typedef SGrid<dim,dimw> GridType;
>    public:
>      TwistUtility(const GridType& grid) :
>        grid_(grid)
> @@ -54,7 +57,31 @@
>    private:
>      const GridType& grid_;
>    };
> +  template <int dim,int dimw>
> +  class TwistUtility<YaspGrid<dim,dimw> >
> +  {
> +  public:
> +    typedef YaspGrid<dim,dimw> GridType;
> +  public:
> +    TwistUtility(const GridType& grid) :
> +      grid_(grid)
> +    {}
> 
> +    // default twist is zero
> +    template <class IntersectionIterator>
> +    int twistInSelf(const IntersectionIterator& it) const {
> +      return 0;
> +    }
> +
> +    // default twist is zero
> +    template <class IntersectionIterator>
> +    int twistInNeighbor(const IntersectionIterator& it) const {
> +      return 0;
> +    }
> +
> +  private:
> +    const GridType& grid_;
> +  };
>  #if HAVE_ALBERTA_FOUND
>    template <int dim, int dimW>
>    class TwistUtility<AlbertaGrid<dim, dimW> >
> @@ -90,13 +117,13 @@
>  #endif
> 
>  #if HAVE_ALUGRID_FOUND
> -  template <int dim, int dimW, ALU3dGridElementType elType>
> -  class TwistUtility<ALU3dGrid<dim, dimW, elType>  >
> +  template <>
> +  class TwistUtility<ALUSimplexGrid<3,3>  >
>    {
>    public:
> -    typedef ALU3dGrid<dim, dimW, elType> GridType;
> -    typedef typename GridType::Traits::LeafIntersectionIterator 
> LeafIntersectionIterator;
> -    typedef typename GridType::Traits::LevelIntersectionIterator 
> LevelIntersectionIterator;
> +    typedef ALUSimplexGrid<3,3> GridType;
> +    typedef GridType::Traits::LeafIntersectionIterator 
> LeafIntersectionIterator;
> +    typedef GridType::Traits::LevelIntersectionIterator 
> LevelIntersectionIterator;
>    public:
>      TwistUtility(const GridType& grid) :
>        grid_(grid)
> @@ -125,6 +152,76 @@
>    private:
>      const GridType& grid_;
>    };
> +  template <>
> +  class TwistUtility<ALUCubeGrid<3,3>  >
> +  {
> +  public:
> +    typedef ALUCubeGrid<3,3> GridType;
> +    typedef GridType::Traits::LeafIntersectionIterator 
> LeafIntersectionIterator;
> +    typedef GridType::Traits::LevelIntersectionIterator 
> LevelIntersectionIterator;
> +  public:
> +    TwistUtility(const GridType& grid) :
> +      grid_(grid)
> +    {}
> +
> +    int twistInSelf(const LeafIntersectionIterator& it) const {
> +      return grid_.getRealIntersectionIterator(it).twistInSelf();
> +    }
> +
> +    int twistInSelf(const LevelIntersectionIterator& it) const {
> +      return grid_.getRealIntersectionIterator(it).twistInSelf();
> +    }
> +
> +    int twistInNeighbor(const LeafIntersectionIterator& it) const {
> +      return grid_.getRealIntersectionIterator(it).twistInNeighbor();
> +    }
> +
> +    int twistInNeighbor(const LevelIntersectionIterator& it) const {
> +      return grid_.getRealIntersectionIterator(it).twistInNeighbor();
> +    }
> +
> +  private:
> +    TwistUtility(const TwistUtility&);
> +    TwistUtility& operator=(const TwistUtility&);
> +
> +  private:
> +    const GridType& grid_;
> +  };
> +  template <>
> +  class TwistUtility<ALUSimplexGrid<2,2>  >
> +  {
> +  public:
> +    typedef ALUSimplexGrid<2, 2> GridType;
> +    typedef GridType::Traits::LeafIntersectionIterator 
> LeafIntersectionIterator;
> +    typedef GridType::Traits::LevelIntersectionIterator 
> LevelIntersectionIterator;
> +  public:
> +    TwistUtility(const GridType& grid) :
> +      grid_(grid)
> +    {}
> +
> +    int twistInSelf(const LeafIntersectionIterator& it) const {
> +      return 0;
> +    }
> +
> +    int twistInSelf(const LevelIntersectionIterator& it) const {
> +      return 0;
> +    }
> +
> +    int twistInNeighbor(const LeafIntersectionIterator& it) const {
> +      return 1;
> +    }
> +
> +    int twistInNeighbor(const LevelIntersectionIterator& it) const {
> +      return 1;
> +    }
> +
> +  private:
> +    TwistUtility(const TwistUtility&);
> +    TwistUtility& operator=(const TwistUtility&);
> +
> +  private:
> +    const GridType& grid_;
> +  };
>  #endif
> 
>  #undef HAVE_ALBERTA_FOUND
> 
> 
> _______________________________________________
> Dune-CVS mailing list
> Dune-CVS at dune-project.org
> http://www.dune-project.org/cgi-bin/mailman/listinfo/dune-cvs

> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://www.dune-project.org/cgi-bin/mailman/listinfo/dune


-- 
Sreejith P. Kuttanikkad                       
IWR, University of Heidelberg       
Room:009, Im Neuenheimer Feld-348                         
69120 Heidelberg,Germany.                      
Ph :+49-6221-54-5689/4412(Office)
   :+49-(0)17624228904(Mob)
http://hal.iwr.uni-heidelberg.de/~sreejith/
-------------------------------------------




More information about the Dune mailing list