OGS
|
Definition at line 36 of file GMSHPolygonTree.h.
#include <GMSHPolygonTree.h>
Public Member Functions | |
GMSHPolygonTree (GeoLib::PolygonWithSegmentMarker *polygon, GMSHPolygonTree *parent, GeoLib::GEOObjects &geo_objs, std::string const &geo_name, GMSHMeshDensityStrategy &mesh_density_strategy) | |
~GMSHPolygonTree () override | |
void | markSharedSegments () |
bool | insertStation (GeoLib::Point const *station) |
void | insertPolyline (GeoLib::PolylineWithSegmentMarker *ply) |
void | initMeshDensityStrategy () |
void | createGMSHPoints (std::vector< GMSHPoint * > &gmsh_pnts) const |
virtual void | writeLineLoop (std::size_t &line_offset, std::size_t &sfc_offset, std::ostream &out, bool const write_physical) const |
void | writeSubPolygonsAsLineConstraints (std::size_t &line_offset, std::size_t sfc_number, std::ostream &out) const |
virtual void | writeLineConstraints (std::size_t &line_offset, std::size_t sfc_number, std::ostream &out) const |
void | writeStations (std::size_t &pnt_id_offset, std::size_t sfc_number, std::ostream &out) const |
void | writeAdditionalPointData (std::size_t &pnt_id_offset, std::size_t sfc_number, std::ostream &out) const |
Public Member Functions inherited from GeoLib::SimplePolygonTree | |
SimplePolygonTree (Polygon *polygon, SimplePolygonTree *parent) | |
virtual | ~SimplePolygonTree () |
bool | isRoot () const |
bool | isPolygonInside (const SimplePolygonTree *polygon_hierarchy) const |
void | insertSimplePolygonTree (SimplePolygonTree *polygon_hierarchy) |
Polygon const & | polygon () const |
Polygon & | polygon () |
const SimplePolygonTree * | parent () const |
std::size_t | getNumberOfChildren () const |
decltype(_children) ::const_iterator | begin () const |
decltype(_children) ::const_iterator | end () const |
Private Member Functions | |
void | getPointsFromSubPolygons (std::vector< GeoLib::Point const * > &pnts) const |
void | getStationsInsideSubPolygons (std::vector< GeoLib::Point const * > &stations) const |
void | checkIntersectionsSegmentExistingPolylines (GeoLib::PolylineWithSegmentMarker *ply, GeoLib::Polyline::SegmentIterator const &seg_it) |
Private Attributes | |
GeoLib::GEOObjects & | _geo_objs |
std::string const & | _geo_name |
std::vector< GeoLib::Point const * > | _stations |
std::vector< GeoLib::PolylineWithSegmentMarker * > | _plys |
std::vector< GMSHLine * > | _gmsh_lines_for_constraints |
GMSHMeshDensityStrategy & | _mesh_density_strategy |
FileIO::GMSH::GMSHPolygonTree::GMSHPolygonTree | ( | GeoLib::PolygonWithSegmentMarker * | polygon, |
GMSHPolygonTree * | parent, | ||
GeoLib::GEOObjects & | geo_objs, | ||
std::string const & | geo_name, | ||
GMSHMeshDensityStrategy & | mesh_density_strategy ) |
Definition at line 31 of file GMSHPolygonTree.cpp.
|
override |
Definition at line 43 of file GMSHPolygonTree.cpp.
References _plys, BaseLib::cleanupVectorElements(), and GeoLib::SimplePolygonTree::isRoot().
|
private |
Definition at line 213 of file GMSHPolygonTree.cpp.
References _geo_name, _geo_objs, _plys, GeoLib::Polyline::getPointID(), GeoLib::GEOObjects::getPointVecObj(), GeoLib::Polyline::SegmentIterator::getSegmentNumber(), GeoLib::PolylineWithSegmentMarker::insertPoint(), GeoLib::lineSegmentIntersect(), GeoLib::PointVec::push_back(), and GeoLib::TemplateVec< T >::size().
Referenced by insertPolyline().
void FileIO::GMSH::GMSHPolygonTree::createGMSHPoints | ( | std::vector< GMSHPoint * > & | gmsh_pnts | ) | const |
Method creates the gmsh point data structures - including the mesh density.
gmsh_pnts | a vector of pointers to instances of class GMSHPoint |
Definition at line 292 of file GMSHPolygonTree.cpp.
References _mesh_density_strategy, _plys, createGMSHPoints(), FileIO::GMSH::GMSHMeshDensityStrategy::getMeshDensityAtPoint(), OGS_FATAL, GeoLib::SimplePolygonTree::parent(), and GeoLib::SimplePolygonTree::polygon().
Referenced by createGMSHPoints().
|
private |
Definition at line 505 of file GMSHPolygonTree.cpp.
References getPointsFromSubPolygons().
Referenced by getPointsFromSubPolygons(), and initMeshDensityStrategy().
|
private |
Definition at line 515 of file GMSHPolygonTree.cpp.
References _stations, and getStationsInsideSubPolygons().
Referenced by getStationsInsideSubPolygons(), and initMeshDensityStrategy().
void FileIO::GMSH::GMSHPolygonTree::initMeshDensityStrategy | ( | ) |
Initialize the mesh density strategy with data. In case of GMSHAdaptiveMeshDensity an instance of class QuadTree will be set up with the points within the top level bounding polygon.
Definition at line 258 of file GMSHPolygonTree.cpp.
References _mesh_density_strategy, _plys, _stations, getPointsFromSubPolygons(), getStationsInsideSubPolygons(), and GeoLib::SimplePolygonTree::polygon().
void FileIO::GMSH::GMSHPolygonTree::insertPolyline | ( | GeoLib::PolylineWithSegmentMarker * | ply | ) |
If at least one (end) point (of a line segment) of the polyline is inside the polygon the polyline is inserted to the internal vector of polylines.
Intersection points are inserted into the points vector the polygon and the polyline are based on. The id of the intersection point is inserted in both the polygon and the polyline, i.e. the two intersecting line segments are splitt into four line segment.
Line segments of the polyline that are completely within the polygon are inserted into the internal vector _gmsh_lines_for_constraints. The children of this GMSHPolygonTree node are checked recursively.
ply | the polyline that should be inserted |
Definition at line 103 of file GMSHPolygonTree.cpp.
References _geo_name, _geo_objs, _gmsh_lines_for_constraints, _plys, GeoLib::Polyline::begin(), checkIntersectionsSegmentExistingPolylines(), GeoLib::Polygon::containsSegment(), GeoLib::Polyline::end(), GeoLib::GEOObjects::getPointVecObj(), GeoLib::Polyline::insertPoint(), GeoLib::PolylineWithSegmentMarker::insertPoint(), insertPolyline(), GeoLib::Polygon::isPntInPolygon(), GeoLib::Polyline::isPointIDInPolyline(), GeoLib::PolylineWithSegmentMarker::isSegmentMarked(), GeoLib::PolylineWithSegmentMarker::markSegment(), GeoLib::SimplePolygonTree::polygon(), GeoLib::PointVec::push_back(), and GeoLib::TemplateVec< T >::size().
Referenced by insertPolyline().
bool FileIO::GMSH::GMSHPolygonTree::insertStation | ( | GeoLib::Point const * | station | ) |
If the station point is inside the polygon, the method inserts the station into the internal vector of stations. This method works recursive!
station | the station point |
Definition at line 76 of file GMSHPolygonTree.cpp.
References _stations, insertStation(), and GeoLib::SimplePolygonTree::polygon().
Referenced by insertStation().
void FileIO::GMSH::GMSHPolygonTree::markSharedSegments | ( | ) |
Mark the segments shared by several polygons.
Definition at line 53 of file GMSHPolygonTree.cpp.
References GeoLib::containsEdge(), GeoLib::SimplePolygonTree::isRoot(), GeoLib::SimplePolygonTree::parent(), and GeoLib::SimplePolygonTree::polygon().
void FileIO::GMSH::GMSHPolygonTree::writeAdditionalPointData | ( | std::size_t & | pnt_id_offset, |
std::size_t | sfc_number, | ||
std::ostream & | out ) const |
Definition at line 460 of file GMSHPolygonTree.cpp.
References _geo_objs, _mesh_density_strategy, FileIO::GMSH::GMSHMeshDensityStrategy::getMeshDensityAtPoint(), GeoLib::GEOObjects::getPointVecObj(), GeoLib::GEOObjects::getPolylineVecObj(), GeoLib::TemplateVec< T >::getVector(), GeoLib::SimplePolygonTree::polygon(), and GeoLib::resetPointIDs().
|
virtual |
Definition at line 391 of file GMSHPolygonTree.cpp.
References _plys, GeoLib::containsEdge(), and GeoLib::SimplePolygonTree::polygon().
|
virtual |
Definition at line 355 of file GMSHPolygonTree.cpp.
References GeoLib::Polyline::getPointID(), and GeoLib::SimplePolygonTree::polygon().
void FileIO::GMSH::GMSHPolygonTree::writeStations | ( | std::size_t & | pnt_id_offset, |
std::size_t | sfc_number, | ||
std::ostream & | out ) const |
Definition at line 443 of file GMSHPolygonTree.cpp.
References _mesh_density_strategy, _stations, FileIO::GMSH::GMSHMeshDensityStrategy::getMeshDensityAtStation(), and getName().
void FileIO::GMSH::GMSHPolygonTree::writeSubPolygonsAsLineConstraints | ( | std::size_t & | line_offset, |
std::size_t | sfc_number, | ||
std::ostream & | out ) const |
Definition at line 417 of file GMSHPolygonTree.cpp.
References GeoLib::Polyline::getPointID(), GeoLib::SimplePolygonTree::isRoot(), GeoLib::SimplePolygonTree::polygon(), and writeSubPolygonsAsLineConstraints().
Referenced by writeSubPolygonsAsLineConstraints().
|
private |
Definition at line 101 of file GMSHPolygonTree.h.
Referenced by checkIntersectionsSegmentExistingPolylines(), and insertPolyline().
|
private |
Definition at line 100 of file GMSHPolygonTree.h.
Referenced by checkIntersectionsSegmentExistingPolylines(), insertPolyline(), and writeAdditionalPointData().
|
private |
Definition at line 104 of file GMSHPolygonTree.h.
Referenced by insertPolyline().
|
private |
Definition at line 106 of file GMSHPolygonTree.h.
Referenced by createGMSHPoints(), initMeshDensityStrategy(), writeAdditionalPointData(), and writeStations().
|
private |
Definition at line 103 of file GMSHPolygonTree.h.
Referenced by ~GMSHPolygonTree(), checkIntersectionsSegmentExistingPolylines(), createGMSHPoints(), initMeshDensityStrategy(), insertPolyline(), and writeLineConstraints().
|
private |
Definition at line 102 of file GMSHPolygonTree.h.
Referenced by getStationsInsideSubPolygons(), initMeshDensityStrategy(), insertStation(), and writeStations().