#include <FeatureFloodCount.h>
Public Types | |
using | container_type = std::vector< 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 | mergeBBoxes (std::vector< BoundingBox > &bboxes, bool physical_intersection) |
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 |
Enumeration indicating boundary intersection status. More... | |
Private Member Functions | |
FeatureData (const FeatureData &)=default | |
We do not expect these objects to ever be copied. 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::vector<dof_id_type> |
The primary underlying container type used to hold the data in each FeatureData.
Supported types are std::set<dof_id_type> or std::vector<dof_id_type>.
Note: Testing has shown that vector container may be slightly faster, but I believe much more data needs to be gathered to be sure. Perhaps more work could be performed to keep sorted sets to eliminate any extra work we do by occasionally performing a linear find or resorting the vector could help. For now, vector it is.
Definition at line 150 of file FeatureFloodCount.h.
|
inline |
|
inline |
Definition at line 154 of file FeatureFloodCount.h.
|
inline |
Definition at line 163 of file FeatureFloodCount.h.
|
default |
|
privatedefault |
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 1953 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 1993 of file FeatureFloodCount.C.
void FeatureFloodCount::FeatureData::clear | ( | ) |
Definition at line 2117 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 2098 of file FeatureFloodCount.C.
|
inline |
Definition at line 313 of file FeatureFloodCount.h.
bool FeatureFloodCount::FeatureData::ghostedIntersect | ( | const FeatureData & | rhs | ) | const |
Definition at line 1977 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 1965 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 2004 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 1983 of file FeatureFloodCount.C.
Referenced by FeatureFloodCount::areFeaturesMergeable().
void FeatureFloodCount::FeatureData::mergeBBoxes | ( | std::vector< BoundingBox > & | bboxes, |
bool | physical_intersection | ||
) |
Located the overlapping bounding box between this Feature and the other Feature and expands that overlapping box accordingly.
It's possible to iterate over these disjoint elements in a way such that bounding boxes in geometrically related region won't overlap on a single pass. Imagine having three elements across a periodic boundary that represent the halo that just bleeds over. If we attempt to merge the first and third bounding boxes, they won't intersect without having the second bounding box there to link them together. We'll have to continue to merge bounding boxes until convergence.
Now copy the list back into the original vector.
Definition at line 2129 of file FeatureFloodCount.C.
Referenced by updateBBoxExtremes().
|
inline |
Comparison operator for sorting individual FeatureDatas.
Definition at line 250 of file FeatureFloodCount.h.
|
default |
|
privatedefault |
bool FeatureFloodCount::FeatureData::periodicBoundariesIntersect | ( | const FeatureData & | rhs | ) | const |
Definition at line 1971 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 region, now we need to iterate over the remaining "possible" disjoint elements and partition them into independent bboxes regions.
We no longer need to distinguish among the various halo ids in disjoint bounding boxes. We'll just merge them altogether for the remaining portions of the algorithm.
Definition at line 1872 of file FeatureFloodCount.C.
void FeatureFloodCount::FeatureData::updateBBoxExtremes | ( | BoundingBox & | bbox, |
const BoundingBox & | rhs_bbox | ||
) |
Definition at line 1943 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 292 of file FeatureFloodCount.h.
Referenced by boundingBoxesIntersect(), GrainTracker::computeMinDistancesFromGrain(), dataLoad(), dataStore(), operator<<(), updateBBoxExtremes(), and FeatureFloodCount::visitElementalNeighbors().
BoundaryIntersection FeatureFloodCount::FeatureData::_boundary_intersection |
Enumeration indicating boundary intersection status.
Definition at line 311 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 305 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 279 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 269 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 276 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 288 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 273 of file FeatureFloodCount.h.
Referenced by FeatureFloodCount::appendPeriodicNeighborNodes(), FeatureFloodCount::flood(), operator<<(), GrainTracker::swapSolutionValues(), updateBBoxExtremes(), 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 298 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 295 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 282 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 308 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 285 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 301 of file FeatureFloodCount.h.
Referenced by dataLoad(), dataStore(), and FeatureFloodCount::flood().