dune-grid  2.2.1
amirameshreader.hh
Go to the documentation of this file.
1 #ifndef DUNE_AMIRAMESH_READER_HH
2 #define DUNE_AMIRAMESH_READER_HH
3 
4 #include <string>
5 
7 
8 #if HAVE_PSURFACE
10 
11 #if HAVE_AMIRAMESH
12 #include <amiramesh/AmiraMesh.h>
13 #else
14 // forward declaration so we can at least compile the header without libamiramesh
15 class AmiraMesh;
16 #endif
17 
18 namespace Dune {
19 
24  template<class GridType>
25  class AmiraMeshReader {
26 
28  enum {dim = GridType::dimension};
29 
31  static void createDomain(GridFactory<GridType>& factory, const shared_ptr<PSurfaceBoundary<dim-1> >& boundary);
32 
34  static void buildGrid(GridFactory<GridType>& factory, AmiraMesh* am);
35 
37  static void build2dGrid(GridFactory<GridType>& factory, AmiraMesh* am);
38 
39  public:
40 
45  static GridType* read(const std::string& filename);
46 
52  static void read(GridType& grid,
53  const std::string& filename);
54 
74  static GridType* read(const std::string& filename,
75  const std::string& domainFilename);
76 
95  static shared_ptr<PSurfaceBoundary<GridType::dimension-1> > readPSurfaceBoundary(const std::string& filename);
96 
97  static GridType* read(const std::string& filename,
98  const shared_ptr<PSurfaceBoundary<dim-1> >& boundary);
99 
106  static void read(GridType& grid,
107  const std::string& filename,
108  const std::string& domainFilename);
109 
110  private:
120  static void read(GridType& grid,
121  const std::string& filename,
122  const shared_ptr<PSurfaceBoundary<dim-1> >& boundary);
123 
124  public:
132  template<class DiscFuncType>
133  static void readFunction(DiscFuncType& f, const std::string& filename);
134 
135  };
136 
137 }
138 
139 #if HAVE_AMIRAMESH
141 #endif
142 
143 #endif // #if HAVE_PSURFACE
144 #endif