[Dune] [Dune-Commit] dune-grid r5935 - trunk/dune/grid/io/file/test
Oliver Sander
sander at mi.fu-berlin.de
Fri Nov 13 15:54:15 CET 2009
Hi Robert!
If gmshtest-alberta works with other grids now (which is nice!),
why not just integrate it with the existing gmshtest?
yrs,
Oliver
robertk at dune-project.org schrieb:
> Author: robertk
> Date: 2009-11-13 15:33:50 +0100 (Fri, 13 Nov 2009)
> New Revision: 5935
>
> Modified:
> trunk/dune/grid/io/file/test/gmshtest-alberta.cc
> Log:
> cna use with ALUGrid and UG now.
>
>
>
> Modified: trunk/dune/grid/io/file/test/gmshtest-alberta.cc
> ===================================================================
> --- trunk/dune/grid/io/file/test/gmshtest-alberta.cc 2009-11-13 12:44:06 UTC (rev 5934)
> +++ trunk/dune/grid/io/file/test/gmshtest-alberta.cc 2009-11-13 14:33:50 UTC (rev 5935)
> @@ -2,7 +2,18 @@
>
> #include <memory>
>
> -#include <dune/grid/albertagrid.hh>
> +#ifdef ENABLE_ALBERTA
> +//#include <dune/grid/albertagrid.hh>
> +#endif
> +
> +#ifdef ENABLE_ALUGRID
> +#include <dune/grid/alugrid.hh>
> +#endif
> +
> +#ifdef ENABLE_UG
> +#include <dune/grid/uggrid.hh>
> +#endif
> +
> #include <dune/grid/io/file/gmshreader.hh>
>
> #if HAVE_GRAPE
> @@ -13,8 +24,19 @@
> #define GRIDDIM ALBERTA_DIM
> #endif
>
> -typedef Dune::AlbertaGrid< GRIDDIM > GridType;
> +template <class GridType>
> +void checkGmshReader(const char* filename, const int refinements)
> +{
> + std::auto_ptr< GridType > grid( Dune::GmshReader< GridType >::read( filename ) );
> + if( refinements > 0 )
> + grid->globalRefine( refinements );
>
> +#if HAVE_GRAPE
> + Dune::GrapeGridDisplay< GridType > grape( *grid );
> + grape.display();
> +#endif
> +}
> +
> int main ( int argc, char **argv )
> try
> {
> @@ -24,15 +46,25 @@
> return 1;
> }
>
> - std::auto_ptr< GridType > grid( Dune::GmshReader< GridType >::read( argv[ 1 ] ) );
> - if( argc >= 3 )
> - grid->globalRefine( atoi( argv[ 2 ] ) );
> + int refinements = 0;
> + if( argc >= 3 )
> + refinements = atoi( argv[2] );
>
> -#if HAVE_GRAPE
> - Dune::GrapeGridDisplay< GridType > grape( *grid );
> - grape.display();
> +#ifdef ENABLE_ALBERTA
> + std::cout << "Checking AlbertaGrid \n";
> + //checkGmshReader< Dune::AlbertaGrid< GRIDDIM > > ( argv[1], refinements );
> #endif
>
> +#ifdef ENABLE_ALUGRID
> + std::cout << "Checking ALUGrid \n";
> + checkGmshReader< Dune::ALUSimplexGrid< 3, 3 > > ( argv[1], refinements );
> +#endif
> +
> +#ifdef ENABLE_UG
> + std::cout << "Checking UG \n";
> + checkGmshReader< Dune::UGGrid< 3 > > ( argv[1], refinements );
> +#endif
> +
> 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
>
--
************************************************************************
* 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