dune-grid
2.1.1
|
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/dgfparser.hh>
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 &, int dimG, int dimW) |
method which reads the dgf file | |
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) |
Static Public Member Functions | |
static bool | isDuneGridFormat (std::istream &) |
Protected Types | |
typedef std::map< DGFEntityKey < unsigned int >, int > | facemap_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 |
element_t | element |
bool | simplexgrid |
bool | cube2simplex |
int | nofvtxparams |
int | nofelparams |
std::vector< std::vector < double > > | vtxParams |
std::vector< std::vector < double > > | elParams |
DGFPrintInfo * | info |
int | rank_ |
int | size_ |
Friends | |
class | DGFGridFactory |
class | DGFBaseFactory |
The DuneGridFormatParser class: reads a DGF file and stores build information in vector structures used by the MacroGrid class.
typedef std :: map< DGFEntityKey< unsigned int >, int > Dune::DuneGridFormatParser::facemap_t [protected] |
Dune::DuneGridFormatParser::DuneGridFormatParser | ( | int | rank, |
int | size | ||
) |
void Dune::DuneGridFormatParser::generateBoundaries | ( | std::istream & | gridin, |
bool | bndseg | ||
) | [protected] |
References Dune::dgf::BoundaryDomBlock::defaultValue(), Dune::dgf::BoundaryDomBlock::defaultValueGiven(), Dune::ElementFaceUtil::generateFace(), Dune::dgf::BoundarySegBlock::get(), Dune::dgf::BoundaryDomBlock::id(), Dune::dgf::BoundaryDomBlock::inside(), Dune::dgf::BasicBlock::isactive(), Dune::dgf::BoundaryDomBlock::next(), Dune::ElementFaceUtil::nofFaces(), and Dune::dgf::BoundaryDomBlock::ok().
Referenced by readDuneGrid().
void Dune::DuneGridFormatParser::generateSimplexGrid | ( | std::istream & | gridin | ) | [protected] |
References Dune::DGFPrintInfo::block(), Dune::dgf::SimplexGenerationBlock::dimension(), dimw, Dune::dgf::SimplexGenerationBlock::display(), Dune::dgf::SimplexGenerationBlock::dumpFileName(), Dune::dgf::SimplexGenerationBlock::filename(), Dune::dgf::SimplexGenerationBlock::filetype(), Dune::dgf::SimplexGenerationBlock::hasfile(), Dune::dgf::SimplexGenerationBlock::haspath(), info, Dune::dgf::SimplexGenerationBlock::maxArea(), Dune::dgf::SimplexGenerationBlock::minAngle(), Dune::dgf::SimplexGenerationBlock::parameter(), Dune::dgf::SimplexGenerationBlock::path(), Dune::DGFPrintInfo::print(), readTetgenTriangle(), temporaryFileName(), and writeTetgenPoly().
Referenced by readDuneGrid().
std::vector< double > & Dune::DuneGridFormatParser::getElParam | ( | int | i, |
std::vector< double > & | coord | ||
) | [protected] |
std::vector< double > & Dune::DuneGridFormatParser::getVtxParam | ( | int | i, |
std::vector< double > & | coord | ||
) | [protected] |
bool Dune::DuneGridFormatParser::isDuneGridFormat | ( | std::istream & | gridin | ) | [static] |
References Dune::dgfid(), and Dune::dgf::makeupcase().
Referenced by readDuneGrid().
bool Dune::DuneGridFormatParser::readDuneGrid | ( | std::istream & | gridin, |
int | dimG, | ||
int | dimW | ||
) |
method which reads the dgf file
fills the vtx,element, and bound vectors returns true if reading succeded
References Dune::DGFPrintInfo::automatic(), Dune::DGFPrintInfo::block(), Cube, Dune::DGFPrintInfo::cube2simplex(), cube2simplex, Dune::dgfid(), dimgrid, dimw, Dune::dgf::IntervalBlock::dimw(), element, elements, elParams, Dune::DGFPrintInfo::finish(), General, generateBoundaries(), generateSimplexGrid(), Dune::dgf::VertexBlock::get(), Dune::dgf::SimplexBlock::get(), Dune::dgf::CubeBlock::get(), Dune::dgf::IntervalBlock::get(), info, Dune::dgf::BasicBlock::isactive(), isDuneGridFormat(), nofelements, nofelparams, nofvtx, nofvtxparams, Dune::dgf::IntervalBlock::numIntervals(), Dune::dgf::VertexBlock::offset(), removeCopies(), Simplex, simplexgrid, Dune::DGFPrintInfo::step1(), testTriang(), vtx, vtxoffset, and vtxParams.
Referenced by Dune::MacroGrid::Impl< OneDGrid >::generate(), and readDuneGrid().
bool Dune::DuneGridFormatParser::readDuneGrid | ( | std::istream & | input, |
int | dimG = -1 |
||
) | [inline] |
References readDuneGrid().
void Dune::DuneGridFormatParser::readTetgenTriangle | ( | const std::string & | name | ) | [protected] |
References dimw, elements, elParams, facemap, nofelements, nofelparams, nofvtx, nofvtxparams, vtx, and vtxParams.
Referenced by generateSimplexGrid().
void Dune::DuneGridFormatParser::removeCopies | ( | ) | [protected] |
References Dune::Alberta::abs(), dimw, elements, minVertexDistance, nofvtx, and vtx.
Referenced by readDuneGrid().
void Dune::DuneGridFormatParser::setOrientation | ( | int | use1, |
int | use2, | ||
orientation_t | orientation = counterclockwise |
||
) | [protected] |
void Dune::DuneGridFormatParser::setRefinement | ( | int | use1, |
int | use2, | ||
int | is1 = -1 , |
||
int | is2 = -1 |
||
) | [protected] |
std::string Dune::DuneGridFormatParser::temporaryFileName | ( | ) | [inline, static, protected] |
Referenced by generateSimplexGrid().
double Dune::DuneGridFormatParser::testTriang | ( | int | snr | ) | [protected] |
Referenced by readDuneGrid().
void Dune::DuneGridFormatParser::writeTetgenPoly | ( | const std::string & | prefixname, |
std::string & | extension, | ||
std::string & | params | ||
) |
method to write in Tetgen/Triangle Poly Format
Referenced by generateSimplexGrid().
void Dune::DuneGridFormatParser::writeTetgenPoly | ( | std::ostream & | out, |
const bool | writeSegments = true |
||
) |
References dimw, elements, elParams, facemap, nofelparams, nofvtx, nofvtxparams, vtx, and vtxParams.
friend class DGFBaseFactory [friend] |
friend class DGFGridFactory [friend] |
Reimplemented in Dune::MacroGrid.
std::vector< std::vector <int> > Dune::DuneGridFormatParser::bound [protected] |
bool Dune::DuneGridFormatParser::cube2simplex [protected] |
Referenced by readDuneGrid().
int Dune::DuneGridFormatParser::dimgrid [protected] |
Referenced by readDuneGrid(), and setRefinement().
int Dune::DuneGridFormatParser::dimw [protected] |
Referenced by generateSimplexGrid(), getElParam(), getVtxParam(), readDuneGrid(), readTetgenTriangle(), removeCopies(), setRefinement(), and writeTetgenPoly().
element_t Dune::DuneGridFormatParser::element [protected] |
Referenced by Dune::MacroGrid::Impl< OneDGrid >::generate(), readDuneGrid(), and setRefinement().
std :: vector< std :: vector< unsigned int > > Dune::DuneGridFormatParser::elements [protected] |
std::vector<std::vector<double> > Dune::DuneGridFormatParser::elParams [protected] |
facemap_t Dune::DuneGridFormatParser::facemap [protected] |
Referenced by readTetgenTriangle(), and writeTetgenPoly().
DGFPrintInfo* Dune::DuneGridFormatParser::info [protected] |
Referenced by generateSimplexGrid(), and readDuneGrid().
double Dune::DuneGridFormatParser::minVertexDistance [protected] |
Referenced by removeCopies().
int Dune::DuneGridFormatParser::nofbound [protected] |
int Dune::DuneGridFormatParser::nofelements [protected] |
Referenced by readDuneGrid(), readTetgenTriangle(), and setRefinement().
int Dune::DuneGridFormatParser::nofelparams [protected] |
int Dune::DuneGridFormatParser::nofvtx [protected] |
Referenced by readDuneGrid(), readTetgenTriangle(), removeCopies(), and writeTetgenPoly().
int Dune::DuneGridFormatParser::nofvtxparams [protected] |
int Dune::DuneGridFormatParser::rank_ [protected] |
Referenced by DuneGridFormatParser().
bool Dune::DuneGridFormatParser::simplexgrid [protected] |
Referenced by readDuneGrid().
int Dune::DuneGridFormatParser::size_ [protected] |
Referenced by DuneGridFormatParser().
std::vector< std::vector <double> > Dune::DuneGridFormatParser::vtx [protected] |
int Dune::DuneGridFormatParser::vtxoffset [protected] |
Referenced by readDuneGrid().
std::vector<std::vector<double> > Dune::DuneGridFormatParser::vtxParams [protected] |