Dune Core Modules (2.6.0)

Dune::DuneGridFormatParser Class Reference

The DuneGridFormatParser class: reads a DGF file and stores build information in vector structures used by the MacroGrid class. More...

#include <dune/grid/io/file/dgfparser/parser.hh>

Public Member Functions

 DuneGridFormatParser (int rank, int size)
 constructor
 
bool readDuneGrid (std::istream &input, int dimG, int dimW)
 parse dune grid format from stream More...
 
void writeTetgenPoly (const std::string &, std::string &, std::string &)
 method to write in Tetgen/Triangle Poly Format
 

Static Public Member Functions

static bool isDuneGridFormat (std::istream &input)
 check whether a stream is in DUNE grid format More...
 
static bool isDuneGridFormat (const std::string &filename)
 check whether a file is in dune grid format More...
 

Detailed Description

The DuneGridFormatParser class: reads a DGF file and stores build information in vector structures used by the MacroGrid class.

Member Function Documentation

◆ isDuneGridFormat() [1/2]

bool Dune::DuneGridFormatParser::isDuneGridFormat ( const std::string &  filename)
static

check whether a file is in dune grid format

This is just a convenience method. It calls isDuneGridFormat with a std::ifstream.

Parameters
filenamefile to check
Returns
whether the keyword 'DGF' was found

References isDuneGridFormat().

◆ isDuneGridFormat() [2/2]

bool Dune::DuneGridFormatParser::isDuneGridFormat ( std::istream &  input)
static

check whether a stream is in DUNE grid format

Actually checks whether the stream starts with the keyword 'DGF'.

Parameters
inputstd::istream to check
Note
The stream must support seeking.
Returns
whether the keyword 'DGF' was found

Referenced by isDuneGridFormat(), and readDuneGrid().

◆ readDuneGrid()

bool Dune::DuneGridFormatParser::readDuneGrid ( std::istream &  input,
int  dimG,
int  dimW 
)

parse dune grid format from stream

This method actually fills the vtx, element, and bound vectors.

Parameters
inputstd::istream to read the grid from
[in]dimGdimension of the grid (i.e., Grid::dimension)
[in]dimWdimension of the world (i.e., Grid::dimensionworld)
Note
The stream must support seeking.
Returns
whether reading succeeded

References DUNE_THROW, and isDuneGridFormat().


The documentation for this class was generated from the following files:
  • dune/grid/io/file/dgfparser/parser.hh
  • dune/grid/io/file/dgfparser/dgfparser.cc
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 19, 22:31, 2024)