[Dune] [Dune-Commit] dune-grid r5010 - trunk/grid/test

Martin Nolte nolte at mathematik.uni-freiburg.de
Thu Apr 2 12:50:04 CEST 2009


Hi Oliver,

I thought we agreed in Heidelberg that the subIndex / subId method with 
variable codimension should use the generic subentity numbering instead of the 
current DUNE numbering. If that is so, the test is wrong since the renumbering 
should be taken into account.

The AlbertaGrid implementation already switches the numbering accordingly and 
hence the test fails.

Maybe we should agree on the semantics before the weekend.

Yours,

Martin

sander at dune-project.org wrote:
> Author: sander
> Date: 2009-04-02 12:02:35 +0200 (Thu, 02 Apr 2009)
> New Revision: 5010
> 
> Modified:
>    trunk/grid/test/checkindexset.cc
>    trunk/grid/test/gridcheck.cc
> Log:
> test whether subIndex methods with dynamic codimension return the same result as their old counterparts with static codim.  Patch by Carsten Gr?\195?\164ser
> 
> Modified: trunk/grid/test/checkindexset.cc
> ===================================================================
> --- trunk/grid/test/checkindexset.cc	2009-04-02 09:45:47 UTC (rev 5009)
> +++ trunk/grid/test/checkindexset.cc	2009-04-02 10:02:35 UTC (rev 5010)
> @@ -448,6 +448,9 @@
>          
>          // the subIndex and the index for subEntity must be the same 
>          assert( vxidx == lset.index( *vxp ));
> +
> +        // static and dynamic method must yield the same result
> +        assert( vxidx == lset.subIndex(*it,i,dim));
>            
>          // check whether the coordinates are the same 
>        	assert(vertexCoordsMap.find(vxidx)!=vertexCoordsMap.end());
> 
> Modified: trunk/grid/test/gridcheck.cc
> ===================================================================
> --- trunk/grid/test/gridcheck.cc	2009-04-02 09:45:47 UTC (rev 5009)
> +++ trunk/grid/test/gridcheck.cc	2009-04-02 10:02:35 UTC (rev 5010)
> @@ -578,6 +578,26 @@
>                       << " ... subIndex(e,i)=" << subid_e_i
>              );
>          }
> +        
> +        if( g.levelIndexSet(e.level()).subIndex(e,i,cd)
> +            != g.levelIndexSet(e.level()).template subIndex<cd>(e,i) )
> +        {
> +          int id_e =
> +            g.levelIndexSet(e.level()).index(e);
> +          int subid_e_i =
> +            g.levelIndexSet(e.level()).template subIndex<cd>(e,i);
> +          int subid_e_i_cd =
> +              g.levelIndexSet(e.level()).subIndex(e,i,cd);
> +          DUNE_THROW(CheckError,
> +                     "g.levelIndexSet.subIndex(e,i,cd) "
> +                     << "== g.levelIndexSet.template subIndex<cd>(e,i) failed "
> +                     << "[with cd=" << cd << ", i=" << i << "]"
> +                     << " ... index(e)=" << id_e
> +                     << " ... subIndex<cd>(e,i)=" << subid_e_i
> +                     << " ... subIndex(e,i,cd)=" << subid_e_i_cd
> +            );
> +        }
> + 
>        }
>        subIndexCheck<cd-1,Grid,Entity,
>          Dune::Capabilities::hasEntity<Grid,cd-1>::v> sick(g,e);
> 
> 
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit

-- 
Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5642
Abteilung für angewandte Mathematik                    fax:   +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany




More information about the Dune mailing list