Dune Core Modules (2.4.2)

Dune::GmshWriter< GridView > Class Template Reference

Write Gmsh mesh file. More...

#include <dune/grid/io/file/gmshwriter.hh>

Public Member Functions

 GmshWriter (const GridView &gridView)
 Constructor expecting GridView of Grid to be written. More...
 
void write (const std::string &fileName) const
 Write given grid in Gmsh 2.0 compatible ASCII file. More...
 
void write (const std::string &fileName, const std::vector< int > &physicalEntities) const
 Write given grid in Gmsh 2.0 compatible ASCII file. More...
 

Detailed Description

template<class GridView>
class Dune::GmshWriter< GridView >

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.

Boundary segments are ignored.

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.

Constructor & Destructor Documentation

◆ GmshWriter()

template<class GridView >
Dune::GmshWriter< GridView >::GmshWriter ( const GridView gridView)
inline

Constructor expecting GridView of Grid to be written.

Parameters
gridViewGridView that will be used in write(const std::string&).

Member Function Documentation

◆ write() [1/2]

template<class GridView >
void Dune::GmshWriter< GridView >::write ( const std::string &  fileName) const
inline

Write given grid in Gmsh 2.0 compatible ASCII file.

Parameters
fileNamePath of file. write(const std::string&) does not attach a ".msh"-extension by itself.

Opens the file with given name and path, stores the element data of the grid and closes the file when done.

Boundary-Segments of the grid are ignored.

Throws an IOError if file could not be opened or an unsupported element type is encountered.

◆ write() [2/2]

template<class GridView >
void Dune::GmshWriter< GridView >::write ( const std::string &  fileName,
const std::vector< int > &  physicalEntities 
) const
inline

Write given grid in Gmsh 2.0 compatible ASCII file.

Parameters
fileNamePath of file. write(const std::string&) does not attach a ".msh"-extension by itself.
physicalEntitiesPhysical entities for each element.

Opens the file with given name and path, stores the element data of the grid and closes the file when done.

Boundary-Segments of the grid are ignored.

The physical entity is stored along the element in its first tag, using the MultipleCodimMultipleGeomTypeMapper with the MCMGElementLayout.

Throws an IOError if file could not be opened or an unsupported element type is encountered.


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 2, 22:35, 2024)