dune-grid 2.9.0
Classes | Public Types | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Dune::MacroGrid Class Reference

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

Inheritance diagram for Dune::MacroGrid:
Inheritance graph

Public Types

typedef MPIHelper::MPICommunicator MPICommunicatorType
 

Protected Types

enum  element_t { Simplex , Cube , General }
 
enum  orientation_t { counterclockwise =1 , clockwise =-1 }
 
typedef DGFBoundaryParameter::type BoundaryParameter
 
typedef std::pair< int, BoundaryParameterBndParam
 
typedef std::map< DGFEntityKey< unsigned int >, BndParamfacemap_t
 

Protected Member Functions

 MacroGrid (const char *filename, MPICommunicatorType MPICOMM=MPIHelper::getCommunicator())
 constructor given the name of a DGF file More...
 
 MacroGrid (MPICommunicatorType MPICOMM=MPIHelper::getCommunicator())
 constructor given the name of a DGF file More...
 
template<class GridType >
GridType * createGrid ()
 returns pointer to a new instance of type GridType created from a DGF file More...
 
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 More...
 
void writeTetgenPoly (std::ostream &out, const bool writeSegments=true)
 
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 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...
 
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_
 

Member Typedef Documentation

◆ BndParam

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

◆ BoundaryParameter

◆ facemap_t

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

◆ MPICommunicatorType

typedef MPIHelper::MPICommunicator Dune::MacroGrid::MPICommunicatorType

Member Enumeration Documentation

◆ element_t

Enumerator
Simplex 
Cube 
General 

◆ orientation_t

Enumerator
counterclockwise 
clockwise 

Constructor & Destructor Documentation

◆ MacroGrid() [1/2]

Dune::MacroGrid::MacroGrid ( const char *  filename,
MPICommunicatorType  MPICOMM = MPIHelper::getCommunicator() 
)
inlineprotected

constructor given the name of a DGF file

◆ MacroGrid() [2/2]

Dune::MacroGrid::MacroGrid ( MPICommunicatorType  MPICOMM = MPIHelper::getCommunicator())
inlineprotected

constructor given the name of a DGF file

Member Function Documentation

◆ createGrid()

template<class GridType >
GridType * Dune::MacroGrid::createGrid ( )
inlineprotected

returns pointer to a new instance of type GridType created from a DGF file

◆ generateBoundaries()

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

◆ generateSimplexGrid()

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

◆ getElParam()

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

◆ getVtxParam()

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

◆ isDuneGridFormat() [1/2]

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

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)
staticinherited

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 
)
inherited

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 &  )
protectedinherited

◆ removeCopies()

void Dune::DuneGridFormatParser::removeCopies ( )
protectedinherited

◆ setOrientation()

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

◆ setRefinement()

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

◆ temporaryFileName()

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

◆ testTriang()

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

◆ writeTetgenPoly() [1/2]

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

method to write in Tetgen/Triangle Poly Format

◆ writeTetgenPoly() [2/2]

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

Member Data Documentation

◆ bound

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

◆ cube2simplex

bool Dune::DuneGridFormatParser::cube2simplex
protectedinherited

◆ dimgrid

int Dune::DuneGridFormatParser::dimgrid
protectedinherited

◆ dimw

int Dune::DuneGridFormatParser::dimw
protectedinherited

◆ element

element_t Dune::DuneGridFormatParser::element
protectedinherited

◆ elements

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

◆ elParams

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

◆ emptyParam_

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

◆ facemap

facemap_t Dune::DuneGridFormatParser::facemap
protectedinherited

◆ haveBndParameters

bool Dune::DuneGridFormatParser::haveBndParameters
protectedinherited

◆ info

DGFPrintInfo* Dune::DuneGridFormatParser::info
protectedinherited

◆ minVertexDistance

double Dune::DuneGridFormatParser::minVertexDistance
protectedinherited

◆ nofbound

int Dune::DuneGridFormatParser::nofbound
protectedinherited

◆ nofelements

int Dune::DuneGridFormatParser::nofelements
protectedinherited

◆ nofelparams

int Dune::DuneGridFormatParser::nofelparams
protectedinherited

◆ nofvtx

int Dune::DuneGridFormatParser::nofvtx
protectedinherited

◆ nofvtxparams

int Dune::DuneGridFormatParser::nofvtxparams
protectedinherited

◆ simplexgrid

bool Dune::DuneGridFormatParser::simplexgrid
protectedinherited

◆ vtx

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

◆ vtxoffset

int Dune::DuneGridFormatParser::vtxoffset
protectedinherited

◆ vtxParams

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

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