dune-grid  2.3beta2
amirameshreader.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_AMIRAMESH_READER_HH
4 #define DUNE_AMIRAMESH_READER_HH
5 
6 #include <string>
7 
9 
10 #if HAVE_PSURFACE
12 
13 #if HAVE_AMIRAMESH
14 #include <amiramesh/AmiraMesh.h>
15 #else
16 // forward declaration so we can at least compile the header without libamiramesh
17 class AmiraMesh;
18 #endif
19 
20 namespace Dune {
21 
26  template<class GridType>
27  class AmiraMeshReader {
28 
30  enum {dim = GridType::dimension};
31 
33  static void createDomain(GridFactory<GridType>& factory, const shared_ptr<PSurfaceBoundary<dim-1> >& boundary);
34 
36  static void buildGrid(GridFactory<GridType>& factory, AmiraMesh* am);
37 
39  static void build2dGrid(GridFactory<GridType>& factory, AmiraMesh* am);
40 
41  public:
42 
47  static GridType* read(const std::string& filename);
48 
54  static void read(GridType& grid,
55  const std::string& filename);
56 
79  static GridType* read(const std::string& filename,
80  const std::string& domainFilename)
81  DUNE_DEPRECATED_MSG("Use the corresponding method taking a filename and a shared pointer \
82  to a PSurfaceBoundary object instead!");
83 
104  static shared_ptr<PSurfaceBoundary<GridType::dimension-1> > readPSurfaceBoundary(const std::string& filename)
105  DUNE_DEPRECATED_MSG("Use the corresponding static method from the PSurfaceBoundary class instead!");
106 
119  static GridType* read(const std::string& filename,
120  const shared_ptr<PSurfaceBoundary<dim-1> >& boundary);
121 
131  static void read(GridType& grid,
132  const std::string& filename,
133  const std::string& domainFilename)
134  DUNE_DEPRECATED_MSG("Use the corresponding method taking a filename and a shared pointer \
135  to a PSurfaceBoundary object instead!");
136 
137  private:
147  static void read(GridType& grid,
148  const std::string& filename,
149  const shared_ptr<PSurfaceBoundary<dim-1> >& boundary);
150 
151  public:
159  template<class DiscFuncType>
160  static void readFunction(DiscFuncType& f, const std::string& filename);
161 
162  };
163 
164 }
165 
166 #if HAVE_AMIRAMESH
168 #endif
169 
170 #endif // #if HAVE_PSURFACE
171 #endif