|
ESyS-Particle
2.3.4
|
Graph class, partially based on Sedgewick, "Alg. in C++", progs. 17.1, 17.9 and 17.10. More...
#include <graph.h>

Classes | |
| struct | Edge |
| struct | Node |
Public Types | |
| typedef list< int >::iterator | adjIterator |
Public Member Functions | |
| Graph () | |
| ~Graph () | |
| int | numV () const |
| int | numE () const |
| int | getGrainID (int) const |
| double | getParticleMass (int) const |
| void | insert (const Edge &) |
| void | insert (const pair< int, int > &) |
| void | setVertexData (int, const pdata &) |
| pdata | getVertexData (int i) const |
| void | remove (const Edge &) |
| bool | isEdge (int, int) |
| void | removeDoubles () |
| adjIterator | IterBegin (int) |
| adjIterator | IterEnd (int) |
| map< int, int >::const_iterator | cid_begin () const |
| map< int, int >::const_iterator | cid_end () const |
| void | makeConnComp () |
| void | printGrainPCount (ostream &) |
| void | printGrainMass (ostream &) |
| void | printIdList (const string &) |
| void | printRotList (const string &) |
| void | printGrainCountDist (const string &) |
| void | printGrainDiamDist (const string &, double, int) |
| void | printGrainMassDist (const string &, double, int) |
| void | printSieveDist (const string &, double) |
| double | getPercentile (double) |
| void | writeAvgGrainSizeProfile (const string &, double, double, int) |
| void | writeAvgGrainSizeGrid (const string &, double, double, double, double, double, double, double) |
| void | writeMatrixFractionProfile (const string &, double, double, int, double) |
| void | writeMatrixFractionGrid (const string &, double, double, double, double, double, double, double, double) |
| void | printGrainsAsVtk (const string &, double) |
| void | printAllAsVtk (const string &) |
| void | printCrossSection (const Vec3 &, const Vec3 &, const Vec3 &, const string &, int, int, double, double, double, double, bool, bool) |
| void | printGrainCenterPosition (const string &) |
Private Member Functions | |
| void | ccR (int) |
| void | dfsIter (int) |
Private Attributes | |
| map< int, list< int > > | m_data |
| map< int, int > | cid |
| map< int, pdata > | m_vertex_data |
| map< int, double > | m_grain_mass |
| map< int, Vec3 > | m_grain_rot |
| int | ccnt |
Graph class, partially based on Sedgewick, "Alg. in C++", progs. 17.1, 17.9 and 17.10.
| typedef list<int>::iterator Graph::adjIterator |
| Graph::Graph | ( | ) |
| Graph::~Graph | ( | ) |
|
private |
|
inline |
References cid.
Referenced by Frac::Frac(), and printRotList().

|
inline |
References cid.
Referenced by Frac::Frac(), and printRotList().

|
private |
Iterative depth first search. Avoids possible issues with recursion depth in very large components
| u | starting node |
References ccnt, cid, esys::lsm::bpu::iter(), and m_data.
Referenced by makeConnComp().


| int Graph::getGrainID | ( | int | i | ) | const |
References cid.
| double Graph::getParticleMass | ( | int | i | ) | const |
| double Graph::getPercentile | ( | double | p | ) |
get the sieving size of the x-th percentile
| p | the percentile (in percent!) |
References ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, and pdata::mass.
Referenced by main().


| pdata Graph::getVertexData | ( | int | i | ) | const |
References esys::lsm::bpu::iter(), and m_vertex_data.
Referenced by Frac::Frac(), Frac::get_grain_mass(), Frac::get_move_vectors(), Frac::getSplitAbrasion(), and Frac::writeAsVtk().


| void Graph::insert | ( | const Edge & | E | ) |
insert a new edge
| E | the edge |
References Graph::Edge::i, Graph::Edge::j, and m_data.
Referenced by readGeo(), and readSnap().

| void Graph::insert | ( | const pair< int, int > & | p | ) |
| bool Graph::isEdge | ( | int | i, |
| int | j | ||
| ) |
References esys::lsm::bpu::iter(), and m_data.
Referenced by Frac::getSplitAbrasion(), and printCrossSection().


| Graph::adjIterator Graph::IterBegin | ( | int | i | ) |
References m_data.
| Graph::adjIterator Graph::IterEnd | ( | int | i | ) |
References m_data.
| void Graph::makeConnComp | ( | ) |
| int Graph::numE | ( | ) | const |
get number of egdes
References esys::lsm::bpu::iter(), and m_data.
Referenced by readGeo(), and readSnap().


| int Graph::numV | ( | ) | const |
get number of vertices
References m_data.
Referenced by printAllAsVtk(), readGeo(), and readSnap().

| void Graph::printAllAsVtk | ( | const string & | filename | ) |
write out all grains larger than a certain size as VTK-XML files
| filename | ile name |
References ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, pdata::mass, and numV().
Referenced by main().


| void Graph::printCrossSection | ( | const Vec3 & | Pos, |
| const Vec3 & | W, | ||
| const Vec3 & | V, | ||
| const string & | filename, | ||
| int | xdim, | ||
| int | ydim, | ||
| double | xmin, | ||
| double | xmax, | ||
| double | ymin, | ||
| double | ymax, | ||
| bool | write_ppm, | ||
| bool | filter_singles | ||
| ) |
generate cross section
| Pos | the position of the plane |
| W | spanning vector in-plane |
| V | spanning vector in-plane |
| filename | the filename |
| xdim | image width |
| ydim | image height |
| write_ppm | if true, output PPM file |
| filter_singles | if true, filter out single particle grains |
References ccnt, cid, cross(), pdata2d::gid, Matrix3::invert(), isEdge(), Triangle2D::isIn(), esys::lsm::bpu::iter(), m_data, m_vertex_data, pdata::pos, pdata2d::pos2d, pdata::rad, pdata2d::rad, Vec3::unit(), and Vec3::Z().
Referenced by main().


| void Graph::printGrainCenterPosition | ( | const string & | filename | ) |
Write a list of grain id / grain center position (x,y,z) pairs to a file
| filename | the name of the output file |
References ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, pdata::mass, and pdata::pos.
Referenced by main().


| void Graph::printGrainCountDist | ( | const string & | filename | ) |
References ProbDist::AddSample(), ccnt, cid, esys::lsm::bpu::iter(), and ProbDist::Write().
Referenced by main().


| void Graph::printGrainDiamDist | ( | const string & | filename, |
| double | base, | ||
| int | cum | ||
| ) |
print grain size distribution - cumulative mass over diameter
| filename | the output filename |
| base | the base for the exponential bin size |
| cum | cumulative or not |
References ProbDist::AddSample(), ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, pdata::mass, and ProbDist::Write().
Referenced by main().


| void Graph::printGrainMass | ( | ostream & | ost | ) |
References ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, and pdata::mass.
Referenced by main().


| void Graph::printGrainMassDist | ( | const string & | filename, |
| double | base, | ||
| int | cum | ||
| ) |
output grain mass distribution
| filename | the output filename |
| base | the base for the exponential bin size |
| cum | cumulative or not |
References ProbDist::AddSample(), ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, pdata::mass, and ProbDist::Write().
Referenced by main().


| void Graph::printGrainPCount | ( | ostream & | ost | ) |
References ccnt, cid, and esys::lsm::bpu::iter().
Referenced by main().


| void Graph::printGrainsAsVtk | ( | const string & | basefilename, |
| double | min_mass | ||
| ) |
write out all grains larger than a certain size as VTK-XML files
| basefilename | base file name, files written are basefilename.N.xml |
| min_mass | minimum mass above which grains are saved |
References ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, pdata::mass, pdata::pos, and pdata::rad.
Referenced by main().


| void Graph::printIdList | ( | const string & | filename | ) |
References ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, and pdata::mass.
Referenced by main().


| void Graph::printRotList | ( | const string & | filename | ) |
print grain list with per-grain rotation vectors
| filename | the name of the file written |
References ccnt, cid, cid_begin(), cid_end(), cross(), esys::lsm::bpu::iter(), m_vertex_data, pdata::mass, pdata::pos, Vec3::unit(), pdata::vel, and Vec3::Z().
Referenced by main().


| void Graph::printSieveDist | ( | const string & | filename, |
| double | base | ||
| ) |
print grain size distribution - cumulative mass over diameter
| filename | the output filename |
| base | the base for the exponential bin size |
| cum | cumulative or not |
References ProbDist::AddSample(), ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, pdata::mass, and ProbDist::Write().
Referenced by main().


| void Graph::remove | ( | const Edge & | E | ) |
| void Graph::removeDoubles | ( | ) |
References esys::lsm::bpu::iter(), and m_data.
Referenced by readGeo(), and readSnap().


| void Graph::setVertexData | ( | int | n, |
| const pdata & | pd | ||
| ) |
References cid, m_data, and m_vertex_data.
Referenced by readGeo(), and readSnap().

| void Graph::writeAvgGrainSizeGrid | ( | const string & | filename, |
| double | xmin, | ||
| double | xmax, | ||
| double | ymin, | ||
| double | ymax, | ||
| double | zmin, | ||
| double | zmax, | ||
| double | cellsize | ||
| ) |
write distribution of average grain size (mass, equiv. diameter) as VTK regular grid file (3D)
| filename | the output file name |
| xmin | minimum of the x-range |
| xmax | maximum of the x-range |
| ymin | minimum of the y-range |
| ymax | maximum of the y-range |
| zmin | minimum of the z-range |
| zmax | maximum of the z-range |
| cellsize | the size of a grid cell (1 dimension, cells are (roughly) cubes) |
References ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, pdata::mass, pdata::pos, write_vtk_header(), Vec3::X(), Vec3::Y(), and Vec3::Z().
Referenced by main().


| void Graph::writeAvgGrainSizeProfile | ( | const string & | filename, |
| double | ymin, | ||
| double | ymax, | ||
| int | nbin | ||
| ) |
write y-profile of average grain size (mass, equiv. diameter)
| filename | |
| ymin | |
| ymax | |
| nbin |
References ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, pdata::mass, pdata::pos, and Vec3::Y().
Referenced by main().


| void Graph::writeMatrixFractionGrid | ( | const string & | filename, |
| double | xmin, | ||
| double | xmax, | ||
| double | ymin, | ||
| double | ymax, | ||
| double | zmin, | ||
| double | zmax, | ||
| double | cellsize, | ||
| double | size_limit | ||
| ) |
write spatial distribution of matrix percentage (mass fraction of grains below threshold) as VTK regular grid file (3D)
| filename | the output file name |
| xmin | minimum of the x-range |
| xmax | maximum of the x-range |
| ymin | minimum of the y-range |
| ymax | maximum of the y-range |
| zmin | minimum of the z-range |
| zmax | maximum of the z-range |
| cellsize | the size of a grid cell (1 dimension, cells are (roughly) cubes) |
| size_limit | the size limit below which a grain counts as "matrix" |
References ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, pdata::mass, pdata::pos, write_vtk_header(), Vec3::X(), Vec3::Y(), and Vec3::Z().
Referenced by main().


| void Graph::writeMatrixFractionProfile | ( | const string & | filename, |
| double | ymin, | ||
| double | ymax, | ||
| int | nbin, | ||
| double | size_limit | ||
| ) |
write y-profile of average grain size (mass, equiv. diameter)
| filename | |
| ymin | |
| ymax | |
| nbin | |
| size_limit | matrix cutoff (mass) |
References ccnt, cid, esys::lsm::bpu::iter(), m_vertex_data, pdata::mass, pdata::pos, and Vec3::Y().
Referenced by main().


|
private |
Referenced by ccR(), dfsIter(), getPercentile(), makeConnComp(), printAllAsVtk(), printCrossSection(), printGrainCenterPosition(), printGrainCountDist(), printGrainDiamDist(), printGrainMass(), printGrainMassDist(), printGrainPCount(), printGrainsAsVtk(), printIdList(), printRotList(), printSieveDist(), writeAvgGrainSizeGrid(), writeAvgGrainSizeProfile(), writeMatrixFractionGrid(), and writeMatrixFractionProfile().
|
private |
Referenced by ccR(), cid_begin(), cid_end(), dfsIter(), getGrainID(), getPercentile(), makeConnComp(), printAllAsVtk(), printCrossSection(), printGrainCenterPosition(), printGrainCountDist(), printGrainDiamDist(), printGrainMass(), printGrainMassDist(), printGrainPCount(), printGrainsAsVtk(), printIdList(), printRotList(), printSieveDist(), setVertexData(), writeAvgGrainSizeGrid(), writeAvgGrainSizeProfile(), writeMatrixFractionGrid(), and writeMatrixFractionProfile().
|
private |
Referenced by ccR(), dfsIter(), insert(), isEdge(), IterBegin(), IterEnd(), makeConnComp(), numE(), numV(), printCrossSection(), removeDoubles(), and setVertexData().
|
private |
|
private |
|
private |
Referenced by getParticleMass(), getPercentile(), getVertexData(), printAllAsVtk(), printCrossSection(), printGrainCenterPosition(), printGrainDiamDist(), printGrainMass(), printGrainMassDist(), printGrainsAsVtk(), printIdList(), printRotList(), printSieveDist(), setVertexData(), writeAvgGrainSizeGrid(), writeAvgGrainSizeProfile(), writeMatrixFractionGrid(), and writeMatrixFractionProfile().