dgfalu.hh

00001 #ifndef DUNE_DGFPARSERALU_HH
00002 #define DUNE_DGFPARSERALU_HH
00003 
00004 // only include if ALUGrid is used
00005 #if defined ENABLE_ALUGRID
00006 #include <dune/grid/alugrid.hh>
00007 #include "dgfparser.hh"
00008 namespace Dune {
00009 //*********************************
00010 template <int dim,int dimworld>
00011 class MacroGrid::Impl<ALUCubeGrid<dim,dimworld> > {
00012   typedef MPIHelper::MPICommunicator MPICommunicatorType;
00013 public:
00014   static ALUCubeGrid<dim,dimworld>* 
00015   generate(MacroGrid& mg,
00016            const char* filename, 
00017      MPICommunicatorType MPICOMM = MPIHelper::getCommunicator() );
00018  private:
00019   inline void
00020   generateAlu3d(MacroGrid& mg,
00021                 const char* filename, std::string& str, MPICommunicatorType MPICOMM );
00022 };
00023 template <int dim,int dimworld>
00024 class MacroGrid::Impl<ALUSimplexGrid<dim,dimworld> > {
00025   typedef MPIHelper::MPICommunicator MPICommunicatorType;
00026   friend class MacroGrid::Impl<ALUConformGrid<dim,dimworld> >;
00027 public:
00028   static ALUSimplexGrid<dim,dimworld>* 
00029   generate(MacroGrid& mg,
00030            const char* filename,
00031      MPICommunicatorType MPICOMM = MPIHelper::getCommunicator() );
00032  protected:
00033   inline void
00034   generateAlu3d(MacroGrid& mg,
00035                 const char* filename, std::string& str, MPICommunicatorType MPICOMM );
00036   // friend MacroGrid::Impl<ALUConformGrid<dim,dimworld> >;
00037 }; 
00038 /* needs new version of alulib */
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 
00071 #endif

Generated on 9 Apr 2008 with Doxygen (ver 1.5.2) [logfile].