Commit 82713fb5 authored by Robert Klöfkorn's avatar Robert Klöfkorn

use dgf parser.


[[Imported from SVN: r175]]
parent fa8b470c
......@@ -8,6 +8,10 @@
#include <dune/grid/io/file/vtk/vtkwriter.hh> // VTK output routines
#include <dune/common/mpihelper.hh> // include mpi helper class
// checks for defined gridtype and inlcudes appropriate dgfparser implementation
#include <dune/grid/io/file/dgfparser/gridtype.hh>
#include "unitcube.hh"
#include "functors.hh"
#include "integrateentity.hh"
......@@ -119,26 +123,18 @@ int main(int argc, char **argv)
// start try/catch block to get error messages from dune
try {
UnitCube<Dune::OneDGrid,1> uc0;
UnitCube<Dune::YaspGrid<3,3>,1> uc1;
UnitCube<Dune::YaspGrid<2,2>,1> uc2;
UnitCube<Dune::SGrid<1,1>,1> uc3;
UnitCube<Dune::SGrid<2,2>,1> uc4;
UnitCube<Dune::SGrid<3,3>,1> uc5;
#if HAVE_UG
UnitCube<Dune::UGGrid<3>,2> uc6;
#endif
#if HAVE_ALBERTA
#if ALBERTA_DIM==2
UnitCube<Dune::AlbertaGrid<2,2>,1> uc7;
#endif
#endif
#if HAVE_UG
dowork(uc6.grid()); // Use UGGrid
#else
dowork(uc0.grid()); // Use OneDGrid
#endif
using namespace Dune;
// use unitcube from grids
std::stringstream dgfFileName;
dgfFileName << "grids/unitcube" << GridType :: dimension << ".dgf";
// create grid pointer, GridType is defined by gridtype.hh
GridPtr<GridType> gridPtr( dgfFileName.str() );
// do the adaptive integration
// NOTE: for structured grids global refinement will be used
dowork( *gridPtr );
}
catch (std::exception & e) {
std::cout << "STL ERROR: " << e.what() << std::endl;
......
......@@ -7,6 +7,9 @@
#include <dune/grid/sgrid.hh> // load sgrid definition
#include <dune/common/mpihelper.hh> // include mpi helper class
// checks for defined gridtype and inlcudes appropriate dgfparser implementation
#include <dune/grid/io/file/dgfparser/gridtype.hh>
#include "unitcube.hh"
#include "functors.hh"
#include "integrateentity.hh"
......@@ -56,14 +59,17 @@ int main(int argc, char **argv)
// start try/catch block to get error messages from dune
try {
// make a grid
UnitCube<Dune::OneDGrid,1> uc0;
UnitCube<Dune::SGrid<2,2>,1> uc1;
UnitCube<Dune::YaspGrid<2,2>,1> uc2;
UnitCube<Dune::YaspGrid<3,3>,1> uc3;
using namespace Dune;
// use unitcube from grids
std::stringstream dgfFileName;
dgfFileName << "grids/unitcube" << GridType :: dimension << ".dgf";
// create grid pointer, GridType is defined by gridtype.hh
GridPtr<GridType> gridPtr( dgfFileName.str() );
// integrate and compute error with extrapolation
uniformintegration(uc2.grid());
uniformintegration( *gridPtr );
}
catch (std::exception & e) {
std::cout << "STL ERROR: " << e.what() << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment