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

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

Inheritance diagram for Dune::MacroGrid:
Dune::DuneGridFormatParser

Classes

struct  Impl
 container for the actual grid generation method

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,
BoundaryParameter
BndParam
typedef std::map< DGFEntityKey
< unsigned int >, BndParam
facemap_t

Protected Member Functions

 MacroGrid (const char *filename, MPICommunicatorType MPICOMM=MPIHelper::getCommunicator())
 constructor given the name of a DGF file
 MacroGrid (MPICommunicatorType MPICOMM=MPIHelper::getCommunicator())
 constructor given the name of a DGF file
template<class GridType >
GridType * createGrid ()
 returns pointer to a new instance of type GridType created from a DGF file
bool readDuneGrid (std::istream &input, int dimG, int dimW)
 parse dune grid format from stream
bool readDuneGrid (std::istream &input, int dimG=-1)
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)
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
static bool isDuneGridFormat (const std::string &filename)
 check whether a file is in dune grid format
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_

Friends

class DGFGridFactory

Member Typedef Documentation

typedef std::pair< int, BoundaryParameter > Dune::DuneGridFormatParser::BndParam
protectedinherited
typedef std::map< DGFEntityKey< unsigned int >, BndParam > Dune::DuneGridFormatParser::facemap_t
protectedinherited
typedef MPIHelper::MPICommunicator Dune::MacroGrid::MPICommunicatorType

Member Enumeration Documentation

Enumerator:
Simplex 
Cube 
General 
Enumerator:
counterclockwise 
clockwise 

Constructor & Destructor Documentation

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

constructor given the name of a DGF file

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

constructor given the name of a DGF file

Member Function Documentation

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

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

void Dune::DuneGridFormatParser::generateBoundaries ( std::istream &  gridin,
bool  bndseg 
)
protectedinherited
void Dune::DuneGridFormatParser::generateSimplexGrid ( std::istream &  gridin)
protectedinherited
std::vector< double > & Dune::DuneGridFormatParser::getElParam ( int  i,
std::vector< double > &  coord 
)
protectedinherited
std::vector< double > & Dune::DuneGridFormatParser::getVtxParam ( int  i,
std::vector< double > &  coord 
)
protectedinherited
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

References Dune::dgfid(), and Dune::dgf::makeupcase().

Referenced by Dune::DuneGridFormatParser::isDuneGridFormat(), and Dune::DuneGridFormatParser::readDuneGrid().

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

References Dune::DuneGridFormatParser::isDuneGridFormat().

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

References Dune::DGFPrintInfo::automatic(), Dune::DGFPrintInfo::block(), Dune::DuneGridFormatParser::Cube, Dune::DGFPrintInfo::cube2simplex(), Dune::DuneGridFormatParser::cube2simplex, Dune::dgfid(), Dune::DuneGridFormatParser::dimgrid, Dune::dgf::IntervalBlock::dimw(), Dune::DuneGridFormatParser::dimw, Dune::DuneGridFormatParser::element, Dune::DuneGridFormatParser::elements, Dune::DuneGridFormatParser::elParams, Dune::DGFPrintInfo::finish(), Dune::DuneGridFormatParser::General, Dune::DuneGridFormatParser::generateBoundaries(), Dune::DuneGridFormatParser::generateSimplexGrid(), Dune::dgf::VertexBlock::get(), Dune::dgf::SimplexBlock::get(), Dune::dgf::CubeBlock::get(), Dune::dgf::IntervalBlock::get(), Dune::DuneGridFormatParser::info, Dune::dgf::BasicBlock::isactive(), Dune::DuneGridFormatParser::isDuneGridFormat(), Dune::DuneGridFormatParser::nofelements, Dune::DuneGridFormatParser::nofelparams, Dune::DuneGridFormatParser::nofvtx, Dune::DuneGridFormatParser::nofvtxparams, Dune::dgf::IntervalBlock::numIntervals(), Dune::dgf::VertexBlock::offset(), Dune::DuneGridFormatParser::removeCopies(), Dune::DuneGridFormatParser::Simplex, Dune::DuneGridFormatParser::simplexgrid, Dune::DGFPrintInfo::step1(), Dune::DuneGridFormatParser::testTriang(), Dune::DuneGridFormatParser::vtx, Dune::DuneGridFormatParser::vtxoffset, and Dune::DuneGridFormatParser::vtxParams.

Referenced by Dune::DuneGridFormatParser::readDuneGrid().

bool Dune::DuneGridFormatParser::readDuneGrid ( std::istream &  input,
int  dimG = -1 
)
inlineinherited
void Dune::DuneGridFormatParser::readTetgenTriangle ( const std::string &  name)
protectedinherited
void Dune::DuneGridFormatParser::removeCopies ( )
protectedinherited
void Dune::DuneGridFormatParser::setOrientation ( int  use1,
int  use2,
orientation_t  orientation = counterclockwise 
)
protectedinherited

References Dune::simplex.

void Dune::DuneGridFormatParser::setRefinement ( int  use1,
int  use2,
int  is1 = -1,
int  is2 = -1 
)
protectedinherited
std::string Dune::DuneGridFormatParser::temporaryFileName ( )
inlinestaticprotectedinherited
double Dune::DuneGridFormatParser::testTriang ( int  snr)
protectedinherited
void Dune::DuneGridFormatParser::writeTetgenPoly ( const std::string &  prefixname,
std::string &  extension,
std::string &  params 
)
inherited

method to write in Tetgen/Triangle Poly Format

Referenced by Dune::DuneGridFormatParser::generateSimplexGrid().

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

Friends And Related Function Documentation

friend class DGFGridFactory
friend

Member Data Documentation

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

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