// $Id: gettingstarted.cc 152 2007-07-29 15:01:21Z robertk $ // Dune includes #include // file constructed by ./configure script /*@\label{gs:inc0}@*/ #include // load sgrid definition #include // definition of gridinfo /*@\label{gs:inc1}@*/ #include // include mpi helper class int main(int argc, char **argv) { // initialize MPI, finalize is done automatically on exit Dune::MPIHelper::instance(argc,argv); // start try/catch block to get error messages from dune try{ // make a grid const int dim=3; /*@\label{gs:dim}@*/ typedef Dune::SGrid GridType; /*@\label{gs:gridtype}@*/ Dune::FieldVector N(3);; /*@\label{gs:par0}@*/ Dune::FieldVector L(-1.0); Dune::FieldVector H(1.0);; /*@\label{gs:par1}@*/ GridType grid(N,L,H); /*@\label{gs:grid}@*/ // print some information about the grid Dune::gridinfo(grid); } catch (std::exception & e) { std::cout << "STL ERROR: " << e.what() << std::endl; return 1; } catch (Dune::Exception & e) { std::cout << "DUNE ERROR: " << e.what() << std::endl; return 1; } catch (...) { std::cout << "Unknown ERROR" << std::endl; return 1; } // done return 0; }