[Dune] [Dune-Commit] dune-grid r7581 - trunk/dune/grid/test
Oliver Sander
sander at mi.fu-berlin.de
Wed Mar 30 15:47:24 CEST 2011
I hit the wrong button and svn ate my commit message. Here it is:
Add infrastructure to test GeometryGrid with the PoolAllocator from
dune-common.
The actual call to the test is out-commented, because it leads to a lot
of compiler
errors. It is not clear whether these are due to a bug in GeometryGrid,
in the
PoolAllocator, in possibly even in the test itself.
Am 30.03.2011 15:45, schrieb sander at dune-project.org:
> Author: sander
> Date: 2011-03-30 15:45:20 +0200 (Wed, 30 Mar 2011)
> New Revision: 7581
>
> Modified:
> trunk/dune/grid/test/test-geogrid.cc
> Log:
>
>
> Modified: trunk/dune/grid/test/test-geogrid.cc
> ===================================================================
> --- trunk/dune/grid/test/test-geogrid.cc 2011-03-30 13:28:00 UTC (rev 7580)
> +++ trunk/dune/grid/test/test-geogrid.cc 2011-03-30 13:45:20 UTC (rev 7581)
> @@ -2,6 +2,7 @@
>
> #ifdef COORDFUNCTION
>
> +#include<dune/common/poolallocator.hh>
> #include<dune/grid/geometrygrid.hh>
> #include<dune/grid/geometrygrid/cachedcoordfunction.hh>
> #include<dune/grid/io/file/dgfparser/dgfgeogrid.hh>
> @@ -50,23 +51,16 @@
> #endif
>
> typedef Dune::GeometryGrid< Grid, CoordFunction> GeometryGrid;
> +// I guess PoolAllocator<void... is correct, because the default parameter is std::allocator<void>
> +typedef Dune::GeometryGrid< Grid, CoordFunction, Dune::PoolAllocator<void,10> > GeometryGridWithPoolAllocator;
>
>
> -
> -int main ( int argc, char **argv )
> -try
> +template<class GeometryGridType>
> +void test(const std::string& gridfile)
> {
> - Dune::MPIHelper::instance( argc, argv );
> + Dune::GridPtr< GeometryGridType> pgeogrid(gridfile);
> + GeometryGridType&geogrid = *pgeogrid;
>
> - std::string gridfile = DUNE_GRID_EXAMPLE_GRIDS_PATH "dgf/cube-2.dgf";
> - if(argc>= 2)
> - {
> - gridfile = argv[1];
> - }
> -
> - Dune::GridPtr< GeometryGrid> pgeogrid(gridfile);
> - GeometryGrid&geogrid = *pgeogrid;
> -
> geogrid.globalRefine( 1 );
> geogrid.loadBalance();
>
> @@ -98,7 +92,24 @@
> for( int i = 0; i<= geogrid.maxLevel(); ++i )
> checkCommunication( geogrid, i, std::cout );
> }
> +
> +}
>
> +int main ( int argc, char **argv )
> +try
> +{
> + Dune::MPIHelper::instance( argc, argv );
> +
> + std::string gridfile = DUNE_GRID_EXAMPLE_GRIDS_PATH "dgf/cube-2.dgf";
> + if(argc>= 2)
> + {
> + gridfile = argv[1];
> + }
> +
> + test<GeometryGrid>(gridfile);
> + // commented out, because it is not working
> + //test<GeometryGridWithPoolAllocator>(gridfile);
> +
> return 0;
> }
> catch( const Dune::Exception&e )
>
>
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit
>
More information about the Dune
mailing list