dune-grid  2.3.1-rc1
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 
116  static GridType* read(const std::string& filename,
117  const shared_ptr<PSurfaceBoundary<dim-1> >& boundary);
118 
128  static void read(GridType& grid,
129  const std::string& filename,
130  const std::string& domainFilename)
131  DUNE_DEPRECATED_MSG("Use the corresponding method taking a filename and a shared pointer \
132  to a PSurfaceBoundary object instead!");
133 
134  private:
144  static void read(GridType& grid,
145  const std::string& filename,
146  const shared_ptr<PSurfaceBoundary<dim-1> >& boundary);
147 
148  public:
156  template<class DiscFuncType>
157  static void readFunction(DiscFuncType& f, const std::string& filename);
158 
159  };
160 
161 }
162 
163 #if HAVE_AMIRAMESH
165 #endif
166 
167 #endif // #if HAVE_PSURFACE
168 #endif
Provide a generic factory class for unstructured grids.
A domain boundary implemented by the psurface library.