dune-grid 2.10
Loading...
Searching...
No Matches
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>

Inheritance diagram for Dune::DuneGridFormatParser:
Inheritance graph

Public Types

enum  element_t { Simplex , Cube , General }
enum  orientation_t { counterclockwise =1 , clockwise =-1 }

Public Member Functions

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

Static Public Member Functions

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

Protected Types

typedef DGFBoundaryParameter::type BoundaryParameter
typedef std::pair< int, BoundaryParameterBndParam
typedef std::map< DGFEntityKey< unsigned int >, BndParamfacemap_t

Protected Member Functions

void generateBoundaries (std::istream &, bool)
void generateSimplexGrid (std::istream &)
void readTetgenTriangle (const std::string &)
void removeCopies ()
void setOrientation (int use1, int use2, orientation_t orientation=counterclockwise)
void setRefinement (int use1, int use2, int is1=-1, int is2=-1)
double testTriang (int snr)
std::vector< double > & getElParam (int i, std::vector< double > &coord)
std::vector< double > & getVtxParam (int i, std::vector< double > &coord)

Static Protected Member Functions

static std::string temporaryFileName ()

Protected Attributes

int dimw
int dimgrid
std::vector< std::vector< double > > vtx
int nofvtx
int vtxoffset
double minVertexDistance
std ::vector< std ::vector< unsigned int > > elements
int nofelements
std::vector< std::vector< int > > bound
int nofbound
facemap_t facemap
bool haveBndParameters
element_t element
bool simplexgrid
bool cube2simplex
int nofvtxparams
int nofelparams
std::vector< std::vector< double > > vtxParams
std::vector< std::vector< double > > elParams
DGFPrintInfoinfo
std::vector< double > emptyParam_

Detailed Description

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

Member Typedef Documentation

◆ BndParam

typedef std::pair< int, BoundaryParameter > Dune::DuneGridFormatParser::BndParam
protected

◆ BoundaryParameter

◆ facemap_t

typedef std::map< DGFEntityKey< unsigned int >, BndParam > Dune::DuneGridFormatParser::facemap_t
protected

Member Enumeration Documentation

◆ element_t

Enumerator
Simplex 
Cube 
General 

◆ orientation_t

Enumerator
counterclockwise 
clockwise 

Constructor & Destructor Documentation

◆ DuneGridFormatParser()

Dune::DuneGridFormatParser::DuneGridFormatParser ( int rank,
int size )

constructor

Member Function Documentation

◆ generateBoundaries()

void Dune::DuneGridFormatParser::generateBoundaries ( std::istream & ,
bool  )
protected

◆ generateSimplexGrid()

void Dune::DuneGridFormatParser::generateSimplexGrid ( std::istream & )
protected

◆ getElParam()

std::vector< double > & Dune::DuneGridFormatParser::getElParam ( int i,
std::vector< double > & coord )
protected

◆ getVtxParam()

std::vector< double > & Dune::DuneGridFormatParser::getVtxParam ( int i,
std::vector< double > & coord )
protected

◆ 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

◆ 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

◆ 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

◆ readTetgenTriangle()

void Dune::DuneGridFormatParser::readTetgenTriangle ( const std::string & )
protected

◆ removeCopies()

void Dune::DuneGridFormatParser::removeCopies ( )
protected

◆ setOrientation()

void Dune::DuneGridFormatParser::setOrientation ( int use1,
int use2,
orientation_t orientation = counterclockwise )
protected

◆ setRefinement()

void Dune::DuneGridFormatParser::setRefinement ( int use1,
int use2,
int is1 = -1,
int is2 = -1 )
protected

◆ temporaryFileName()

std::string Dune::DuneGridFormatParser::temporaryFileName ( )
inlinestaticprotected

◆ testTriang()

double Dune::DuneGridFormatParser::testTriang ( int snr)
protected

◆ writeTetgenPoly() [1/2]

void Dune::DuneGridFormatParser::writeTetgenPoly ( const std::string & prefixname,
std::string & extension,
std::string & params )

method to write in Tetgen/Triangle Poly Format

◆ writeTetgenPoly() [2/2]

void Dune::DuneGridFormatParser::writeTetgenPoly ( std::ostream & out,
const bool writeSegments = true )

Member Data Documentation

◆ bound

std::vector< std::vector < int > > Dune::DuneGridFormatParser::bound
protected

◆ cube2simplex

bool Dune::DuneGridFormatParser::cube2simplex
protected

◆ dimgrid

int Dune::DuneGridFormatParser::dimgrid
protected

◆ dimw

int Dune::DuneGridFormatParser::dimw
protected

◆ element

element_t Dune::DuneGridFormatParser::element
protected

◆ elements

std :: vector< std :: vector< unsigned int > > Dune::DuneGridFormatParser::elements
protected

◆ elParams

std::vector< std::vector< double > > Dune::DuneGridFormatParser::elParams
protected

◆ emptyParam_

std::vector< double > Dune::DuneGridFormatParser::emptyParam_
protected

◆ facemap

facemap_t Dune::DuneGridFormatParser::facemap
protected

◆ haveBndParameters

bool Dune::DuneGridFormatParser::haveBndParameters
protected

◆ info

DGFPrintInfo* Dune::DuneGridFormatParser::info
protected

◆ minVertexDistance

double Dune::DuneGridFormatParser::minVertexDistance
protected

◆ nofbound

int Dune::DuneGridFormatParser::nofbound
protected

◆ nofelements

int Dune::DuneGridFormatParser::nofelements
protected

◆ nofelparams

int Dune::DuneGridFormatParser::nofelparams
protected

◆ nofvtx

int Dune::DuneGridFormatParser::nofvtx
protected

◆ nofvtxparams

int Dune::DuneGridFormatParser::nofvtxparams
protected

◆ simplexgrid

bool Dune::DuneGridFormatParser::simplexgrid
protected

◆ vtx

std::vector< std::vector < double > > Dune::DuneGridFormatParser::vtx
protected

◆ vtxoffset

int Dune::DuneGridFormatParser::vtxoffset
protected

◆ vtxParams

std::vector< std::vector< double > > Dune::DuneGridFormatParser::vtxParams
protected

The documentation for this class was generated from the following files: