dune-grid  2.4.1
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 
66  static GridType* read(const std::string& filename,
67  const shared_ptr<PSurfaceBoundary<dim-1> >& boundary);
68 
69  private:
79  static void read(GridType& grid,
80  const std::string& filename,
81  const shared_ptr<PSurfaceBoundary<dim-1> >& boundary);
82 
83  public:
91  template<class DiscFuncType>
92  static void readFunction(DiscFuncType& f, const std::string& filename);
93 
94  };
95 
96 }
97 
98 #if HAVE_AMIRAMESH
100 #endif
101 
102 #endif // #if HAVE_PSURFACE
103 #endif
Provide a generic factory class for unstructured grids.
A domain boundary implemented by the psurface library.
Include standard header files.
Definition: agrid.hh:59