3 #ifndef DUNE_AMIRAMESH_WRITER_HH 4 #define DUNE_AMIRAMESH_WRITER_HH 10 #include <amiramesh/AmiraMesh.h> 19 template<
class Gr
idView>
45 template <
class Gr
idType2>
46 void addLevelGrid(
const GridType2& grid,
int level,
bool splitAll=
false);
56 template <
class Gr
idType2>
57 void addLeafGrid(
const GridType2& grid,
bool splitAll=
false);
65 template <
class DataContainer>
66 void addCellData(
const DataContainer& data,
const GridView& gridView,
bool GridSplitUp=
false);
74 template <
class DataContainer>
81 void write(
const std::string& filename,
bool ascii=
false)
const;
85 template <
class DataContainer>
87 const std::array<unsigned int, dim>& n,
88 const DataContainer& data);
102 const std::string& filename);
106 #if HAVE_AMIRAMESH // better: use a pointer here and forward-declare AmiraMesh 107 AmiraMesh amiramesh_;
115 template<
class Gr
idType>
127 this->
addGrid(grid.levelGridView(level));
137 const std::string& filename,
140 amiramesh.
write(filename);
151 template <
class VectorType>
154 const std::string& filename,
156 bool GridSplitUp=
false) {
158 if (f.size()==grid.size(level,GridType::dimension))
159 amiramesh.
addVertexData(f, grid.levelGridView(level),GridSplitUp);
161 amiramesh.
addCellData(f, grid.levelGridView(level),GridSplitUp);
162 amiramesh.
write(filename);
171 template<
class Gr
idType>
192 const std::string& filename) {
194 amiramesh.
write(filename);
203 template <
class VectorType>
206 const std::string& filename,
207 bool GridSplitUp =
false) {
209 if (f.size()==grid.size(GridType::dimension))
212 amiramesh.
addCellData(f, grid.leafGridView(),GridSplitUp);
214 amiramesh.
write(filename);
static void writeBlockVector(const GridType &grid, const VectorType &f, const std::string &filename, bool GridSplitUp=false)
Writes an ISTL block vector in AmiraMesh format.
Definition: amirameshwriter.hh:204
void write(const std::string &filename, bool ascii=false) const
Write AmiraMesh object to disk.
Definition: amirameshwriter.cc:551
void addLevelGrid(const GridType2 &grid, int level, bool splitAll=false)
Add level grid.
Definition: amirameshwriter.cc:308
void addLeafGrid(const GridType2 &grid, bool splitAll=false)
Add leaf grid.
Definition: amirameshwriter.cc:318
Provides file writing facilities in the AmiraMesh format for leaf grids.
Definition: amirameshwriter.hh:172
LevelAmiraMeshWriter(const GridType &grid, int level)
Constructor which initializes the AmiraMesh object with a given level grid.
Definition: amirameshwriter.hh:126
void addCellData(const DataContainer &data, const GridView &gridView, bool GridSplitUp=false)
Add cell data.
Definition: amirameshwriter.cc:326
static void writeBlockVector(const GridType &grid, const VectorType &f, const std::string &filename, int level, bool GridSplitUp=false)
Writes an ISTL block vector in AmiraMesh format.
Definition: amirameshwriter.hh:152
void addUniformData(const GridView &gridView, const std::array< unsigned int, dim > &n, const DataContainer &data)
Write data on a uniform grid into an AmiraMesh file.
Definition: amirameshwriter.cc:564
void addVertexData(const DataContainer &data, const GridView &gridView, bool GridSplitUp=false)
Add vertex data.
Definition: amirameshwriter.cc:449
LevelAmiraMeshWriter()
Default constructor.
Definition: amirameshwriter.hh:123
Provides file writing facilities in the AmiraMesh format for level grids.
Definition: amirameshwriter.hh:116
static void writeGrid(const GridType &grid, const std::string &filename)
Write a grid in AmiraMesh format.
Definition: amirameshwriter.hh:191
void addGrid(const GridView &gridView, bool splitAll=false)
Add a grid view to the file.
Definition: amirameshwriter.cc:12
Provides file writing facilities in the AmiraMesh format.
Definition: amirameshwriter.hh:20
static void writeGrid(const GridType &grid, const std::string &filename, int level)
Write a grid in AmiraMesh format.
Definition: amirameshwriter.hh:136
Output to the file is in ascii.
Definition: common.hh:42
Grid view abstract base class.
Definition: common/gridview.hh:59
LeafAmiraMeshWriter()
Default constructor.
Definition: amirameshwriter.hh:179
The dimension of the grid.
Definition: common/gridview.hh:127
LeafAmiraMeshWriter(const GridType &grid)
Constructor which initializes the AmiraMesh object with a given leaf grid.
Definition: amirameshwriter.hh:182
static void writeSurfaceGrid(const GridView &gridView, const std::string &filename)
Write a 2d grid in a 3d world.
Definition: amirameshwriter.cc:632
Include standard header files.
Definition: agrid.hh:58