dune-grid
2.4.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/parser.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 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) |
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... | |
Protected Types | |
typedef DGFBoundaryParameter::type | BoundaryParameter |
typedef std::pair< int, BoundaryParameter > | BndParam |
typedef std::map< DGFEntityKey< unsigned int >, BndParam > | 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 |
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 |
DGFPrintInfo * | info |
std::vector< double > | emptyParam_ |
The DuneGridFormatParser class: reads a DGF file and stores build information in vector structures used by the MacroGrid class.
|
protected |
|
protected |
|
protected |
Dune::DuneGridFormatParser::DuneGridFormatParser | ( | int | rank, |
int | size | ||
) |
constructor
References writeTetgenPoly().
|
protected |
References Dune::dgf::BoundaryDomBlock::contains(), Dune::DGFBoundaryParameter::defaultValue(), dimw, elements, facemap, Dune::ElementFaceUtil::generateFace(), Dune::dgf::BoundarySegBlock::get(), Dune::dgf::BoundaryDomBlock::hasParameter(), haveBndParameters, Dune::dgf::DomainData::id(), Dune::dgf::BasicBlock::isactive(), nofbound, nofelements, Dune::ElementFaceUtil::nofFaces(), nofvtx, simplexgrid, vtx, and vtxoffset.
Referenced by readDuneGrid(), and removeCopies().
|
protected |
References 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(), Dune::dgf::SimplexGenerationBlock::maxArea(), Dune::dgf::SimplexGenerationBlock::minAngle(), Dune::dgf::SimplexGenerationBlock::parameter(), Dune::dgf::SimplexGenerationBlock::path(), readTetgenTriangle(), temporaryFileName(), and writeTetgenPoly().
Referenced by readDuneGrid().
|
protected |
|
protected |
|
static |
check whether a stream is in DUNE grid format
Actually checks whether the stream starts with the keyword 'DGF'.
input | std::istream to check |
References Dune::dgfid(), and Dune::dgf::makeupcase().
Referenced by isDuneGridFormat(), and readDuneGrid().
|
static |
check whether a file is in dune grid format
This is just a convenience method. It calls isDuneGridFormat with a std::ifstream.
filename | file to check |
References isDuneGridFormat().
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.
input | std::istream to read the grid from | |
[in] | dimG | dimension of the grid (i.e., Grid::dimension) |
[in] | dimW | dimension of the world (i.e., Grid::dimensionworld) |
References Cube, Dune::dgf::SimplexBlock::cube2simplex(), cube2simplex, Dune::dgfid(), dimgrid, Dune::dgf::IntervalBlock::dimw(), dimw, element, elements, elParams, 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, testTriang(), vtx, vtxoffset, and vtxParams.
|
protected |
References dimw, elements, elParams, facemap, nofelements, nofelparams, nofvtx, nofvtxparams, setOrientation(), vtx, and vtxParams.
Referenced by generateSimplexGrid().
|
protected |
References Dune::Alberta::abs(), dimw, elements, generateBoundaries(), minVertexDistance, nofvtx, and vtx.
Referenced by readDuneGrid().
|
protected |
References Cube, dimgrid, dimw, element, elements, facemap, nofelements, Dune::simplex, testTriang(), and vtx.
Referenced by readTetgenTriangle().
|
protected |
|
inlinestaticprotected |
Referenced by generateSimplexGrid().
|
protected |
Referenced by readDuneGrid(), and setOrientation().
void Dune::DuneGridFormatParser::writeTetgenPoly | ( | const std::string & | prefixname, |
std::string & | extension, | ||
std::string & | params | ||
) |
method to write in Tetgen/Triangle Poly Format
References dimw, elements, elParams, facemap, and nofelparams.
Referenced by DuneGridFormatParser(), and generateSimplexGrid().
void Dune::DuneGridFormatParser::writeTetgenPoly | ( | std::ostream & | out, |
const bool | writeSegments = true |
||
) |
References dimw, elements, elParams, facemap, nofelparams, nofvtx, nofvtxparams, vtx, and vtxParams.
|
protected |
|
protected |
Referenced by readDuneGrid().
|
protected |
Referenced by readDuneGrid(), setOrientation(), and setRefinement().
|
protected |
|
protected |
Referenced by readDuneGrid(), setOrientation(), and setRefinement().
|
protected |
|
protected |
Referenced by getElParam(), Dune::DGFGridFactory< HostGrid >::parameter(), readDuneGrid(), readTetgenTriangle(), and writeTetgenPoly().
|
protected |
|
protected |
Referenced by generateBoundaries(), readTetgenTriangle(), setOrientation(), and writeTetgenPoly().
|
protected |
Referenced by generateBoundaries().
|
protected |
Referenced by readDuneGrid().
|
protected |
Referenced by removeCopies().
|
protected |
Referenced by generateBoundaries().
|
protected |
Referenced by generateBoundaries(), readDuneGrid(), readTetgenTriangle(), setOrientation(), and setRefinement().
|
protected |
|
protected |
Referenced by generateBoundaries(), readDuneGrid(), readTetgenTriangle(), removeCopies(), and writeTetgenPoly().
|
protected |
|
protected |
Referenced by generateBoundaries(), and readDuneGrid().
|
protected |
|
protected |
Referenced by generateBoundaries(), and readDuneGrid().
|
protected |