3#ifndef DUNE_DGF_MACROGRID_HH
4#define DUNE_DGF_MACROGRID_HH
9#include <dune/common/parallel/mpihelper.hh>
10#include <dune/grid/io/file/dgfparser/parser.hh>
17 class DuneGridFormatParser;
20 :
protected DuneGridFormatParser
22 template<
class Gr
idType >
23 friend struct DGFGridFactory;
26 typedef MPIHelper::MPICommunicator MPICommunicatorType;
30 MacroGrid(
const char* filename, MPICommunicatorType MPICOMM = MPIHelper::getCommunicator())
33 , MPICOMM_(MPICOMM) {}
36 MacroGrid(MPICommunicatorType MPICOMM = MPIHelper::getCommunicator())
39 , MPICOMM_(MPICOMM) {}
42 template <
class Gr
idType>
43 inline GridType * createGrid ()
45 return Impl<GridType>::generate(*
this,filename_,MPICOMM_);
48 static int rank( [[maybe_unused]] MPICommunicatorType MPICOMM )
52 MPI_Comm_rank( MPICOMM, &rank );
56 static int size( [[maybe_unused]] MPICommunicatorType MPICOMM )
60 MPI_Comm_size( MPICOMM, &size );
75 template<
class Gr
idType >
78 static GridType* generate(MacroGrid& mg,
79 const char* filename, MPICommunicatorType MPICOMM = MPIHelper::getCommunicator() )
82 static_assert( GridType::dimension<0,
"DGF grid factory missing. Did you forget to add the corresponding dgf header or config.h?");
86 const char* filename_;
87 MPICommunicatorType MPICOMM_;
Include standard header files.
Definition: agrid.hh:58