[Dune] [Dune-Commit] dune-grid r6666 - trunk/dune/grid/geometrygrid
Oliver Sander
sander at mi.fu-berlin.de
Fri Apr 30 16:38:52 CEST 2010
Hi Martin!
I am curious. What is this numbering thing about?
best,
Oliver
Am 30.04.2010 15:44, schrieb mnolte at dune-project.org:
> Author: mnolte
> Date: 2010-04-30 15:44:09 +0200 (Fri, 30 Apr 2010)
> New Revision: 6666
>
> Modified:
> trunk/dune/grid/geometrygrid/grid.hh
> trunk/dune/grid/geometrygrid/intersection.hh
> trunk/dune/grid/geometrygrid/numbering.hh
> Log:
> add a renumbering for intersections, too
> (this way, we don't need the outside entity for identical mapping)
>
>
> Modified: trunk/dune/grid/geometrygrid/grid.hh
> ===================================================================
> --- trunk/dune/grid/geometrygrid/grid.hh 2010-04-30 13:24:05 UTC (rev 6665)
> +++ trunk/dune/grid/geometrygrid/grid.hh 2010-04-30 13:44:09 UTC (rev 6666)
> @@ -145,6 +145,8 @@
> typedef Dune::Intersection< const Grid, GeoGrid::LeafIntersection> LeafIntersection;
> typedef Dune::Intersection< const Grid, GeoGrid::LevelIntersection> LevelIntersection;
>
> + typedef typename Numbering::IntersectionNumbering IntersectionNumbering;
> +
> typedef Dune::IntersectionIterator
> < const Grid, GeoGrid::LeafIntersectionIterator, GeoGrid::LeafIntersection>
> LeafIntersectionIterator;
>
> Modified: trunk/dune/grid/geometrygrid/intersection.hh
> ===================================================================
> --- trunk/dune/grid/geometrygrid/intersection.hh 2010-04-30 13:24:05 UTC (rev 6665)
> +++ trunk/dune/grid/geometrygrid/intersection.hh 2010-04-30 13:44:09 UTC (rev 6666)
> @@ -62,17 +62,21 @@
>
> typedef MakeableInterfaceObject< Geometry> MakeableGeometry;
> typedef typename MakeableGeometry::ImplementationType GeometryImpl;
> -
> +
> + typedef typename Grid::Traits::IntersectionNumbering IntersectionNumbering;
> +
> public:
> Intersection ( const EntityPointer&inside, const HostIntersection&hostIntersection )
> : inside_(&inside ),
> hostIntersection_(&hostIntersection ),
> + numbering_( grid().numbering()[ hostIntersection ] ),
> geo_( GeometryImpl( grid().allocator() ) )
> {}
>
> Intersection ( const Intersection&other )
> : inside_( other.inside_ ),
> hostIntersection_( other.hostIntersection_ ),
> + numbering_( other.numbering_ ),
> geo_( GeometryImpl( grid().allocator() ) )
> {}
>
> @@ -210,6 +214,7 @@
> private:
> const EntityPointer *inside_;
> const HostIntersection *hostIntersection_;
> + IntersectionNumbering numbering_;
> mutable MakeableGeometry geo_;
> };
>
>
> Modified: trunk/dune/grid/geometrygrid/numbering.hh
> ===================================================================
> --- trunk/dune/grid/geometrygrid/numbering.hh 2010-04-30 13:24:05 UTC (rev 6665)
> +++ trunk/dune/grid/geometrygrid/numbering.hh 2010-04-30 13:44:09 UTC (rev 6666)
> @@ -12,18 +12,19 @@
> template< int codim>
> struct EntityNumbering;
>
> - template< class Entity>
> - EntityNumbering< Entity::codimension>
> - operator[] ( const Entity&entity ) const
> - {
> - return EntityNumbering< Entity::codimension>();
> - }
> + struct IntersectionNumbering;
> +
> + template< int codim, int dim, class G, template< int, int, class> class I>
> + EntityNumbering< codim> operator[] ( const Entity< codim, dim, G, I> &entity ) const;
> +
> + template< class G, template< class> class I>
> + IntersectionNumbering operator[] ( const Intersection< G, I> &intersection ) const;
> };
>
>
>
> - // IdenticalNumbering
> - // ------------------
> + // IdenticalNumbering::EntityNumbering
> + // -----------------------------------
>
> template< int codim>
> struct IdenticalNumbering::EntityNumbering
> @@ -37,6 +38,42 @@
> }
> };
>
> +
> +
> + // IdenticalNumbering::EntityNumbering
> + // -----------------------------------
> +
> + struct IdenticalNumbering::IntersectionNumbering
> + {
> + enum Side { Inside, Outside };
> +
> + template< Side side>
> + unsigned int map ( const unsigned int face ) const
> + {
> + return face;
> + }
> + };
> +
> +
> +
> + // Implementation of IdenticalNumbering
> + // ------------------------------------
> +
> + template< int codim, int dim, class G, template< int, int, class> class I>
> + IdenticalNumbering::EntityNumbering< codim>
> + IdenticalNumbering::operator[] ( const Entity< codim, dim, G, I> &entity ) const
> + {
> + return EntityNumbering< codim>();
> + }
> +
> +
> + template< class G, template< class> class I>
> + IdenticalNumbering::IntersectionNumbering
> + IdenticalNumbering::operator[] ( const Intersection< G, I> &intersection ) const
> + {
> + return IntersectionNumbering();
> + }
> +
> }
>
> #endif // #ifndef DUNE_GEOGRID_NUMBERING_HH
>
>
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit
>
--
************************************************************************
* Oliver Sander ** email: sander at mi.fu-berlin.de *
* Freie Universität Berlin ** phone: + 49 (30) 838 75348 *
* Institut für Mathematik ** URL : page.mi.fu-berlin.de/~sander *
* Arnimallee 6 ** -------------------------------------*
* 14195 Berlin, Germany ** Member of MATHEON (www.matheon.de) *
************************************************************************
More information about the Dune
mailing list