dune-grid  2.7.0
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 <memory>
7 #include <string>
8 
9 #include <dune/common/to_unique_ptr.hh>
11 
12 #if HAVE_PSURFACE
14 
15 #if HAVE_AMIRAMESH
16 #include <amiramesh/AmiraMesh.h>
17 #else
18 // forward declaration so we can at least compile the header without libamiramesh
19 class AmiraMesh;
20 #endif
21 
22 namespace Dune {
23 
28  template<class GridType>
29  class AmiraMeshReader {
30 
31  using ctype = typename GridType::ctype;
32 
34  enum {dim = GridType::dimension};
35 
37  static void createDomain(GridFactory<GridType>& factory, const std::shared_ptr<PSurfaceBoundary<dim-1, ctype> >& boundary);
38 
40  static void buildGrid(GridFactory<GridType>& factory, AmiraMesh* am);
41 
43  static void build2dGrid(GridFactory<GridType>& factory, AmiraMesh* am);
44 
45  public:
46 
55  static ToUniquePtr<GridType> read(const std::string& filename);
56 
62  static void read(GridType& grid,
63  const std::string& filename);
64 
78  static ToUniquePtr<GridType> read(const std::string& filename,
79  const std::shared_ptr<PSurfaceBoundary<dim-1, ctype> >& boundary);
80 
81  private:
91  static void read(GridType& grid,
92  const std::string& filename,
93  const std::shared_ptr<PSurfaceBoundary<dim-1, ctype> >& boundary);
94 
95  public:
103  template<class DiscFuncType>
104  static void readFunction(DiscFuncType& f, const std::string& filename);
105 
106  };
107 
108 }
109 
110 #if HAVE_AMIRAMESH
112 #endif
113 
114 #endif // #if HAVE_PSURFACE
115 #endif
gridfactory.hh
Provide a generic factory class for unstructured grids.
amirameshreader.cc
psurfaceboundary.hh
A domain boundary implemented by the psurface library.
Dune
Include standard header files.
Definition: agrid.hh:58