dune-gmsh4

dune-gmsh4

File reader for the Gmsh-4 file format

Requires:
dune-grid
Suggests: dune-alugrid dune-foamgrid dune-vtk dune-curvedgrid
Maintainer: Simon Praetorius, Florian Stenger
Git repository:
https://gitlab.mn.tu-dresden.de/iwr/dune-gmsh4

GMsh4-Reader

This module provides file readers and grid creators for the Gmsh .msh file format in version 4.

Example of usage

Either construct a grid directly

#include <dune/gmsh4/gmsh4reader.hh>
#include <dune/gmsh4/gridcreators/lagrangegridcreator.hh>
#include <dune/grid/uggrid.hh>

int main()
{
  using namespace Dune;
  using Grid = UGGrid<2>;
  std::unique_ptr grid = Gmsh4Reader<Grid>::createGridFromFile("filename.msh");
}

or explicitly use a grid-creator

#include <dune/foamgrid/foamgrid.hh>
#include <dune/gmsh4/gmsh4reader.hh>
#include <dune/gmsh4/gridcreators/lagrangegridcreator.hh>

int main()
{
  using namespace Dune;
  using Grid = FoamGrid<2,3>;
  GridFactory<Grid> factory;

  // The creator is responsible for filling a GridFactory from the data
  // found in the file. Additionally, it might provide a grid-function representing
  // a geometry parametrization
  Gmsh4::LagrangeGridCreator creator{factory};
  Gmsh4Reader reader{creator};

  reader.read("filename.msh");
  auto grid = factory.createGrid();
}

Note, the grid-creator itself is a grid-function.

Creative Commons License   |  Legal Statements / Impressum  |  generated with Hugo v0.69.0 (Mar 7, 23:21, 2021)