dune-grid 2.9.0
|
#include <dune/grid/io/file/gmshwriter.hh>
Public Member Functions | |
GmshWriter (const GridView &gridView, int numDigits=6) | |
Constructor expecting GridView of Grid to be written. More... | |
void | setPrecision (int numDigits) |
Set the number of digits to be used when writing the vertices. By default is 6. More... | |
void | write (const std::string &fileName, const std::vector< int > &physicalEntities=std::vector< int >(), const std::vector< int > &physicalBoundaries=std::vector< int >()) const |
Write given grid in Gmsh 2.0 compatible ASCII file. More... | |
Write Gmsh mesh file.
Write a grid using the given GridView as an ASCII Gmsh file of version 2.0.
If the grid contains an element type not supported by gmsh an IOError exception is thrown.
All grids in a gmsh file live in three-dimensional Euclidean space. If the world dimension of the grid type that you are writing is less than three, the remaining coordinates are set to zero.
|
inline |
|
inline |
Set the number of digits to be used when writing the vertices. By default is 6.
numDigits Number of digits to use.
|
inline |
Write given grid in Gmsh 2.0 compatible ASCII file.
fileName | Path of file. This method does not attach a ".msh"-extension by itself. |
physicalEntities | Physical entities for each element (optional). |
physicalBoundaries | Physical boundaries (optional). |
Opens the file with given name and path, stores the element data of the grid and closes the file when done.
If the optional parameter physicalEntities
is provided, each element is written with a tag representing its physical id.
If the optional parameter physicalBoundaries
is provided, also the boundaries are written on file with the corresponding physical value.
The physicalBoundaries vector need to be sorted according to the interesection boundary segment index.
Throws an IOError if file could not be opened or an unsupported element type is encountered.