gridenums.hh

Go to the documentation of this file.
00001 // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002 // vi: set et ts=8 sw=2 sts=2:
00003 #ifndef DUNE_GRIDENUMS_HH
00004 #define DUNE_GRIDENUMS_HH
00005 
00006 #include <iostream>
00007 
00008 #include <dune/common/exceptions.hh>
00009 
00010 namespace Dune {
00011  
00012   
00024   enum PartitionType { 
00025         InteriorEntity=0, 
00026         BorderEntity=1  , 
00027         OverlapEntity=2 , 
00028         FrontEntity=3  ,  
00029         GhostEntity=4     
00030   };
00031 
00040   inline std::string PartitionName(PartitionType type)
00041   {
00042     switch(type) {
00043     case InteriorEntity:
00044       return "interior";
00045     case BorderEntity:
00046       return "border";
00047     case OverlapEntity:
00048       return "overlap";
00049     case FrontEntity:
00050       return "front";
00051     case GhostEntity:
00052       return "ghost";
00053     default:
00054       DUNE_THROW(NotImplemented, "name of unknown partition type requested");
00055     }
00056   }
00057 
00059 
00066   inline std::ostream &operator<< ( std::ostream &out, const PartitionType &type )
00067   {
00068     return out << PartitionName( type );
00069   }
00070 
00071 
00080   enum InterfaceType { 
00081         InteriorBorder_InteriorBorder_Interface=0, 
00082         InteriorBorder_All_Interface=1,            
00083         Overlap_OverlapFront_Interface=2,          
00084         Overlap_All_Interface=3,                   
00085         All_All_Interface=4                        
00086   };
00087 
00088 
00090 
00097   inline std::ostream &operator<< ( std::ostream &out, const InterfaceType &type )
00098   {
00099     switch( type )
00100     {
00101     case InteriorBorder_InteriorBorder_Interface:
00102       return out << "interior-border / interior-border interface";
00103       
00104     case InteriorBorder_All_Interface:
00105       return out << "interior-border / all interface";
00106 
00107     case Overlap_OverlapFront_Interface:
00108       return out << "overlap / overlap-front interface";
00109 
00110     case Overlap_All_Interface:
00111       return out << "overlap / all interface";
00112     
00113     case All_All_Interface:
00114       return out << "all / all interface";
00115       
00116     default:
00117       return out << "unknown interface";
00118     }
00119   }
00120 
00121 
00130   enum PartitionIteratorType {
00131         Interior_Partition=0,       
00132         InteriorBorder_Partition=1, 
00133         Overlap_Partition=2,        
00134         OverlapFront_Partition=3,   
00135         All_Partition=4,            
00136         Ghost_Partition=5           
00137   };
00138 
00139 
00141 
00148   inline std::ostream &operator<< ( std::ostream &out, const PartitionIteratorType &type )
00149   {
00150     static std::string name[ 6 ] = { "interior partition", "interior-border partition", "overlap partition",
00151                                      "overlap-front partition", "all partition", "ghost partition" };
00152     return out << name[ type ];
00153   }
00154 
00155 
00164   enum CommunicationDirection {
00165         ForwardCommunication,     
00166         BackwardCommunication     
00167   };
00168 
00169 }
00170 #endif

Generated on Fri Apr 29 2011 with Doxygen (ver 1.7.1) [doxygen-log,error-log].