#include <FeatureFloodCount.h>
Public Types | |
using | container_type = std::set< dof_id_type > |
The primary underlying container type used to hold the data in each FeatureData. More... | |
Public Member Functions | |
FeatureData () | |
FeatureData (std::size_t var_index, unsigned int local_index, processor_id_type rank, Status status) | |
FeatureData (std::size_t var_index, Status status, unsigned int id=invalid_id, std::vector< BoundingBox > bboxes={BoundingBox()}) | |
bool | boundingBoxesIntersect (const FeatureData &rhs) const |
Determines if any of this FeatureData's bounding boxes overlap with the other FeatureData's bounding boxes. More... | |
bool | mergeable (const FeatureData &rhs) const |
The routine called to see if two features are mergeable: More... | |
bool | canConsolidate (const FeatureData &rhs) const |
This routine indicates whether two features can be consolidated, that is, one feature is reasonably expected to be part of another. More... | |
void | expandBBox (const FeatureData &rhs) |
Located the overlapping bounding box between this Feature and the other Feature and expands that overlapping box accordingly. More... | |
void | merge (FeatureData &&rhs) |
Merges another Feature Data into this one. More... | |
void | consolidate (FeatureData &&rhs) |
Consolidates features, i.e. More... | |
void | clear () |
bool | operator< (const FeatureData &rhs) const |
Comparison operator for sorting individual FeatureDatas. More... | |
FeatureData | duplicate () const |
FeatureData (FeatureData &&)=default | |
FeatureData & | operator= (FeatureData &&)=default |
void | updateBBoxExtremes (MeshBase &mesh) |
Update the minimum and maximum coordinates of a bounding box given a Point, Elem or BBox parameter. More... | |
void | updateBBoxExtremes (BoundingBox &bbox, const BoundingBox &rhs_bbox) |
bool | halosIntersect (const FeatureData &rhs) const |
Determine if one of this FeaturesData's member sets intersects the other FeatureData's corresponding set. More... | |
bool | periodicBoundariesIntersect (const FeatureData &rhs) const |
bool | ghostedIntersect (const FeatureData &rhs) const |
Public Attributes | |
container_type | _ghosted_ids |
Holds the ghosted ids for a feature (the ids which will be used for stitching. More... | |
container_type | _local_ids |
Holds the local ids in the interior of a feature. More... | |
container_type | _halo_ids |
Holds the ids surrounding the feature. More... | |
container_type | _disjoint_halo_ids |
Holds halo ids that extend onto a non-topologically connected surface. More... | |
container_type | _periodic_nodes |
Holds the nodes that belong to the feature on a periodic boundary. More... | |
std::size_t | _var_index |
The Moose variable where this feature was found (often the "order parameter") More... | |
unsigned int | _id |
An ID for this feature. More... | |
std::vector< BoundingBox > | _bboxes |
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constraints) More... | |
std::list< std::pair< processor_id_type, unsigned int > > | _orig_ids |
Original processor/local ids. More... | |
dof_id_type | _min_entity_id |
The minimum entity seen in the _local_ids, used for sorting features. More... | |
std::size_t | _vol_count |
The count of entities contributing to the volume calculation. More... | |
Point | _centroid |
The centroid of the feature (average of coordinates from entities participating in the volume calculation) More... | |
Status | _status |
The status of a feature (used mostly in derived classes like the GrainTracker) More... | |
BoundaryIntersection | _boundary_intersection |
Enumaration indicating boundary intersection status. More... | |
Private Member Functions | |
FeatureData (const FeatureData &)=default | |
2016-07-14 The INTEL compiler we are currently using (2013 with GCC 4.8) appears to have a bug introduced by the addition of the Point member in this structure. More... | |
FeatureData & | operator= (const FeatureData &)=default |
Friends | |
std::ostream & | operator<< (std::ostream &out, const FeatureData &feature) |
stream output operator More... | |
Definition at line 138 of file FeatureFloodCount.h.
using FeatureFloodCount::FeatureData::container_type = std::set<dof_id_type> |
The primary underlying container type used to hold the data in each FeatureData.
Supported types are std::set<dof_id_type> (with minor adjustmnets) or std::vector<dof_id_type>.
Note: Testing has shown that the vector container is nearly 10x faster. There's really no reason to use sets.
Definition at line 149 of file FeatureFloodCount.h.
|
inline |
|
inline |
Definition at line 153 of file FeatureFloodCount.h.
|
inline |
Definition at line 162 of file FeatureFloodCount.h.
|
default |
|
privatedefault |
2016-07-14 The INTEL compiler we are currently using (2013 with GCC 4.8) appears to have a bug introduced by the addition of the Point member in this structure.
Even though it supports move semantics on other non-POD types like libMesh::BoundingBox, it fails to compile this class with the "centroid" member. Specifically, it supports the move operation into the vector type but fails to work with the bracket operator on std::map and the std::sort algorithm used in this class. It does work with std::map::emplace() but that syntax is much less appealing and still doesn't work around the issue. For now, I'm allowing the copy constructor to be called where it shouldn't so that this class works under the Intel compiler but there may be a degradation in performance in that case. We do not expect these objects to ever be copied. This is important since they are stored in standard containers directly. To enforce this, we are explicitly marking these methods private. They can be triggered through an explicit call to "duplicate".
bool FeatureFloodCount::FeatureData::boundingBoxesIntersect | ( | const FeatureData & | rhs | ) | const |
Determines if any of this FeatureData's bounding boxes overlap with the other FeatureData's bounding boxes.
Definition at line 1918 of file FeatureFloodCount.C.
bool FeatureFloodCount::FeatureData::canConsolidate | ( | const FeatureData & | rhs | ) | const |
This routine indicates whether two features can be consolidated, that is, one feature is reasonably expected to be part of another.
This is different than mergable in that a portion of the feature is expected to be completely identical. This happens in the distributed work scenario when a feature that is partially owned by a processor is merged on a different processor (where local entities are not sent or available). However, later that feature ends back up on the original processor and just needs to be consolidated.
Definition at line 1963 of file FeatureFloodCount.C.
void FeatureFloodCount::FeatureData::clear | ( | ) |
Definition at line 2087 of file FeatureFloodCount.C.
void FeatureFloodCount::FeatureData::consolidate | ( | FeatureData && | rhs | ) |
Consolidates features, i.e.
merges local entities but leaves everything else untouched.
Definition at line 2068 of file FeatureFloodCount.C.
|
inline |
Definition at line 312 of file FeatureFloodCount.h.
void FeatureFloodCount::FeatureData::expandBBox | ( | const FeatureData & | rhs | ) |
Located the overlapping bounding box between this Feature and the other Feature and expands that overlapping box accordingly.
Definition at line 2099 of file FeatureFloodCount.C.
bool FeatureFloodCount::FeatureData::ghostedIntersect | ( | const FeatureData & | rhs | ) | const |
Definition at line 1946 of file FeatureFloodCount.C.
bool FeatureFloodCount::FeatureData::halosIntersect | ( | const FeatureData & | rhs | ) | const |
Determine if one of this FeaturesData's member sets intersects the other FeatureData's corresponding set.
Definition at line 1930 of file FeatureFloodCount.C.
Referenced by GrainTracker::attemptGrainRenumber().
void FeatureFloodCount::FeatureData::merge | ( | FeatureData && | rhs | ) |
Merges another Feature Data into this one.
This method leaves rhs in an inconsistent state.
Even though we've determined that these two partial regions need to be merged, we don't necessarily know if the _ghost_ids intersect. We could be in this branch because the periodic boundaries intersect but that doesn't tell us anything about whether or not the ghost_region also intersects. If the _ghost_ids intersect, that means that we are merging along a periodic boundary, not across one. In this case the bounding box(s) need to be expanded.
If we had a physical intersection, we need to expand boxes. If we had a virtual (periodic) intersection we need to preserve all of the boxes from each of the regions' sets.
Combine the status flags: Currently we only expect to combine CLEAR and INACTIVE. Any other combination is currently a logic error. In this case of CLEAR and INACTIVE though, we want to make sure that CLEAR wins.
Definition at line 1974 of file FeatureFloodCount.C.
bool FeatureFloodCount::FeatureData::mergeable | ( | const FeatureData & | rhs | ) | const |
The routine called to see if two features are mergeable:
Optimization: We may use the bounding boxes as a coarse-level check before checking halo intersection.
Definition at line 1953 of file FeatureFloodCount.C.
Referenced by FeatureFloodCount::areFeaturesMergeable().
|
inline |
Comparison operator for sorting individual FeatureDatas.
Definition at line 249 of file FeatureFloodCount.h.
|
privatedefault |
|
default |
bool FeatureFloodCount::FeatureData::periodicBoundariesIntersect | ( | const FeatureData & | rhs | ) | const |
Definition at line 1937 of file FeatureFloodCount.C.
void FeatureFloodCount::FeatureData::updateBBoxExtremes | ( | BoundingBox & | bbox, |
const BoundingBox & | rhs_bbox | ||
) |
Definition at line 1908 of file FeatureFloodCount.C.
void FeatureFloodCount::FeatureData::updateBBoxExtremes | ( | MeshBase & | mesh | ) |
Update the minimum and maximum coordinates of a bounding box given a Point, Elem or BBox parameter.
Now we need to find how many distinct topologically disconnected sets of elements we have. We've already removed elements that are part of the primary halo, we'll start by assuming that element left is part of the same disjoint set. For each element, we'll see if it is a neighbor of any other element in the current set. If it's not, then it must be part of yet another set. The process repeats until every element is processed and put in the right bucket.
Definition at line 1824 of file FeatureFloodCount.C.
|
friend |
std::vector<BoundingBox> FeatureFloodCount::FeatureData::_bboxes |
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constraints)
Definition at line 291 of file FeatureFloodCount.h.
Referenced by boundingBoxesIntersect(), GrainTracker::computeMinDistancesFromGrain(), dataLoad(), dataStore(), expandBBox(), operator<<(), updateBBoxExtremes(), and FeatureFloodCount::visitElementalNeighbors().
BoundaryIntersection FeatureFloodCount::FeatureData::_boundary_intersection |
Enumaration indicating boundary intersection status.
Definition at line 310 of file FeatureFloodCount.h.
Referenced by dataLoad(), dataStore(), and FeatureFloodCount::updateBoundaryIntersections().
Point FeatureFloodCount::FeatureData::_centroid |
The centroid of the feature (average of coordinates from entities participating in the volume calculation)
Definition at line 304 of file FeatureFloodCount.h.
Referenced by dataLoad(), dataStore(), and FeatureFloodCount::flood().
container_type FeatureFloodCount::FeatureData::_disjoint_halo_ids |
Holds halo ids that extend onto a non-topologically connected surface.
Definition at line 278 of file FeatureFloodCount.h.
Referenced by dataLoad(), dataStore(), updateBBoxExtremes(), and FeatureFloodCount::visitNeighborsHelper().
container_type FeatureFloodCount::FeatureData::_ghosted_ids |
Holds the ghosted ids for a feature (the ids which will be used for stitching.
Definition at line 268 of file FeatureFloodCount.h.
Referenced by dataLoad(), dataStore(), ghostedIntersect(), operator<<(), updateBBoxExtremes(), and FeatureFloodCount::visitNeighborsHelper().
container_type FeatureFloodCount::FeatureData::_halo_ids |
Holds the ids surrounding the feature.
Definition at line 275 of file FeatureFloodCount.h.
Referenced by dataLoad(), dataStore(), FeatureFloodCount::flood(), halosIntersect(), operator<<(), updateBBoxExtremes(), and FeatureFloodCount::visitNeighborsHelper().
unsigned int FeatureFloodCount::FeatureData::_id |
An ID for this feature.
Definition at line 287 of file FeatureFloodCount.h.
Referenced by PolycrystalUserObjectBase::areFeaturesMergeable(), GrainTracker::attemptGrainRenumber(), dataLoad(), dataStore(), FeatureFloodCount::flood(), PolycrystalUserObjectBase::isNewFeatureOrConnectedRegion(), operator<(), and operator<<().
container_type FeatureFloodCount::FeatureData::_local_ids |
Holds the local ids in the interior of a feature.
This data structure is only maintained on the local processor
Definition at line 272 of file FeatureFloodCount.h.
Referenced by FeatureFloodCount::appendPeriodicNeighborNodes(), FeatureFloodCount::flood(), operator<<(), GrainTracker::swapSolutionValues(), FeatureFloodCount::updateBoundaryIntersections(), and FeatureFloodCount::visitNeighborsHelper().
dof_id_type FeatureFloodCount::FeatureData::_min_entity_id |
The minimum entity seen in the _local_ids, used for sorting features.
Definition at line 297 of file FeatureFloodCount.h.
Referenced by dataLoad(), dataStore(), operator<(), and operator<<().
std::list<std::pair<processor_id_type, unsigned int> > FeatureFloodCount::FeatureData::_orig_ids |
Original processor/local ids.
Definition at line 294 of file FeatureFloodCount.h.
Referenced by canConsolidate(), dataLoad(), dataStore(), FeatureData(), and operator<<().
container_type FeatureFloodCount::FeatureData::_periodic_nodes |
Holds the nodes that belong to the feature on a periodic boundary.
Definition at line 281 of file FeatureFloodCount.h.
Referenced by FeatureFloodCount::appendPeriodicNeighborNodes(), dataLoad(), dataStore(), operator<<(), and periodicBoundariesIntersect().
Status FeatureFloodCount::FeatureData::_status |
The status of a feature (used mostly in derived classes like the GrainTracker)
Definition at line 307 of file FeatureFloodCount.h.
Referenced by GrainTracker::attemptGrainRenumber(), dataLoad(), dataStore(), FeatureFloodCount::isNewFeatureOrConnectedRegion(), and operator<<().
std::size_t FeatureFloodCount::FeatureData::_var_index |
The Moose variable where this feature was found (often the "order parameter")
Definition at line 284 of file FeatureFloodCount.h.
Referenced by PolycrystalUserObjectBase::areFeaturesMergeable(), GrainTracker::attemptGrainRenumber(), GrainTracker::computeMinDistancesFromGrain(), dataLoad(), dataStore(), mergeable(), operator<(), operator<<(), GrainTracker::swapSolutionValues(), and GrainTracker::trackGrains().
std::size_t FeatureFloodCount::FeatureData::_vol_count |
The count of entities contributing to the volume calculation.
Definition at line 300 of file FeatureFloodCount.h.
Referenced by dataLoad(), dataStore(), and FeatureFloodCount::flood().