00001 #ifndef DUNE_DGFPARSERALU_HH
00002 #define DUNE_DGFPARSERALU_HH
00003
00004 #if defined ENABLE_ALUGRID
00005 #include <dune/grid/alugrid.hh>
00006 #include "dgfparser.hh"
00007 namespace Dune {
00008
00009 template <int dim,int dimworld>
00010 class MacroGrid::Impl<ALUCubeGrid<dim,dimworld> > {
00011 typedef MPIHelper::MPICommunicator MPICommunicatorType;
00012 public:
00013 static ALUCubeGrid<dim,dimworld>*
00014 generate(MacroGrid& mg,
00015 const char* filename,
00016 MPICommunicatorType MPICOMM = MPIHelper::getCommunicator() );
00017 private:
00018 inline void
00019 generateAlu3d(MacroGrid& mg,
00020 const char* filename, std::string& str, MPICommunicatorType MPICOMM );
00021 };
00022 template <int dim,int dimworld>
00023 class MacroGrid::Impl<ALUSimplexGrid<dim,dimworld> > {
00024 typedef MPIHelper::MPICommunicator MPICommunicatorType;
00025 friend class MacroGrid::Impl<ALUConformGrid<dim,dimworld> >;
00026 public:
00027 static ALUSimplexGrid<dim,dimworld>*
00028 generate(MacroGrid& mg,
00029 const char* filename,
00030 MPICommunicatorType MPICOMM = MPIHelper::getCommunicator() );
00031
00032 protected:
00033 inline void
00034 generateAlu3d(MacroGrid& mg,
00035 const char* filename, std::string& str, MPICommunicatorType MPICOMM );
00036
00037 };
00038
00039 template <int dim,int dimworld>
00040 class MacroGrid::Impl<ALUConformGrid<dim,dimworld> > {
00041 typedef MPIHelper::MPICommunicator MPICommunicatorType;
00042 public:
00043 static ALUConformGrid<dim,dimworld>*
00044 generate(MacroGrid& mg,
00045 const char* filename,
00046 MPICommunicatorType MPICOMM = MPIHelper::getCommunicator() );
00047 private:
00048 inline void
00049 generateAlu3d(MacroGrid& mg,
00050 const char* filename, std::string& str, MPICommunicatorType MPICOMM );
00051 };
00052 template <>
00053 struct DGFGridInfo<ALUCubeGrid<3,3> > {
00054 static int refineStepsForHalf() {return 1;}
00055 static double refineWeight() {return pow(0.5,3);}
00056 };
00057 template <int dimworld>
00058 struct DGFGridInfo< ALUSimplexGrid<dimworld,dimworld> > {
00059 static int refineStepsForHalf() {return 1;}
00060 static double refineWeight() {return pow(0.5,dimworld);}
00061 };
00062 template <>
00063 struct DGFGridInfo< Dune::ALUConformGrid<2,2> > {
00064 static int refineStepsForHalf() {return 2;}
00065 static double refineWeight() {return 0.5;}
00066 };
00067 }
00068 #include "dgfalu.cc"
00069 #endif
00070 #endif