https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
FeatureFloodCount::FeatureData Class Reference

#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.
 

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.
 
bool mergeable (const FeatureData &rhs) const
 The routine called to see if two features are mergeable:
 
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.
 
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.
 
void merge (FeatureData &&rhs)
 Merges another Feature Data into this one.
 
void consolidate (FeatureData &&rhs)
 Consolidates features, i.e.
 
void clear ()
 
bool operator< (const FeatureData &rhs) const
 Comparison operator for sorting individual FeatureDatas.
 
FeatureData duplicate () const
 
 FeatureData (FeatureData &&)=default
 
FeatureDataoperator= (FeatureData &&)=default
 
void updateBBoxExtremes (MeshBase &mesh)
 Update the minimum and maximum coordinates of a bounding box given a Point, Elem or BBox parameter.
 
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.
 
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.
 
container_type _local_ids
 Holds the local ids in the interior of a feature.
 
container_type _halo_ids
 Holds the ids surrounding the feature.
 
container_type _disjoint_halo_ids
 Holds halo ids that extend onto a non-topologically connected surface.
 
container_type _periodic_nodes
 Holds the nodes that belong to the feature on a periodic boundary.
 
std::size_t _var_index
 The Moose variable where this feature was found (often the "order parameter")
 
unsigned int _id
 An ID for this feature.
 
std::vector< BoundingBox > _bboxes
 The vector of bounding boxes completely enclosing this feature (multiple used with periodic constraints)
 
std::list< std::pair< processor_id_type, unsigned int > > _orig_ids
 Original processor/local ids.
 
dof_id_type _min_entity_id
 The minimum entity seen in the _local_ids, used for sorting features.
 
std::size_t _vol_count
 The count of entities contributing to the volume calculation.
 
Point _centroid
 The centroid of the feature (average of coordinates from entities participating in the volume calculation)
 
Status _status
 The status of a feature (used mostly in derived classes like the GrainTracker)
 
BoundaryIntersection _boundary_intersection
 Enumeration indicating boundary intersection status.
 

Private Member Functions

 FeatureData (const FeatureData &)=default
 We do not expect these objects to ever be copied.
 
FeatureDataoperator= (const FeatureData &)=default
 

Friends

std::ostream & operator<< (std::ostream &out, const FeatureData &feature)
 stream output operator
 

Detailed Description

Definition at line 138 of file FeatureFloodCount.h.

Member Typedef Documentation

◆ container_type

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.

Constructor & Destructor Documentation

◆ FeatureData() [1/5]

FeatureFloodCount::FeatureData::FeatureData ( )
inline

Definition at line 152 of file FeatureFloodCount.h.

152: FeatureData(std::numeric_limits<std::size_t>::max(), Status::INACTIVE) {}

Referenced by duplicate().

◆ FeatureData() [2/5]

FeatureFloodCount::FeatureData::FeatureData ( std::size_t  var_index,
unsigned int  local_index,
processor_id_type  rank,
Status  status 
)
inline

Definition at line 154 of file FeatureFloodCount.h.

158 : FeatureData(var_index, status)
159 {
160 _orig_ids = {std::make_pair(rank, local_index)};
161 }
std::list< std::pair< processor_id_type, unsigned int > > _orig_ids
Original processor/local ids.

◆ FeatureData() [3/5]

FeatureFloodCount::FeatureData::FeatureData ( std::size_t  var_index,
Status  status,
unsigned int  id = invalid_id,
std::vector< BoundingBox >  bboxes = {BoundingBox()} 
)
inline

Definition at line 163 of file FeatureFloodCount.h.

166 {BoundingBox()})
167 : _var_index(var_index),
168 _id(id),
169 _bboxes(bboxes), // Assume at least one bounding box
170 _min_entity_id(DofObject::invalid_id),
171 _vol_count(0),
174 {
175 }
Status _status
The status of a feature (used mostly in derived classes like the GrainTracker)
std::vector< BoundingBox > _bboxes
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constrain...
BoundaryIntersection _boundary_intersection
Enumeration indicating boundary intersection status.
dof_id_type _min_entity_id
The minimum entity seen in the _local_ids, used for sorting features.
std::size_t _var_index
The Moose variable where this feature was found (often the "order parameter")
unsigned int _id
An ID for this feature.
std::size_t _vol_count
The count of entities contributing to the volume calculation.
static const unsigned int invalid_id
BoundaryIntersection
This enumeration is used to inidacate status of boundary intersections.
MPI_Status status

◆ FeatureData() [4/5]

FeatureFloodCount::FeatureData::FeatureData ( FeatureData &&  )
default

◆ FeatureData() [5/5]

FeatureFloodCount::FeatureData::FeatureData ( const FeatureData )
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".

Member Function Documentation

◆ boundingBoxesIntersect()

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 1955 of file FeatureFloodCount.C.

1956{
1957 // See if any of the bounding boxes in either FeatureData object intersect
1958 for (const auto & bbox_lhs : _bboxes)
1959 for (const auto & bbox_rhs : rhs._bboxes)
1960 if (bbox_lhs.intersects(bbox_rhs, libMesh::TOLERANCE * libMesh::TOLERANCE))
1961 return true;
1962
1963 return false;
1964}
for(PetscInt i=0;i< nvars;++i)
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
if(subdm)

◆ canConsolidate()

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 1995 of file FeatureFloodCount.C.

1996{
1997 for (const auto & orig_id_pair1 : _orig_ids)
1998 for (const auto & orig_id_pair2 : rhs._orig_ids)
1999 if (orig_id_pair1 == orig_id_pair2)
2000 return true;
2001
2002 return false;
2003}

◆ clear()

void FeatureFloodCount::FeatureData::clear ( )

Definition at line 2119 of file FeatureFloodCount.C.

2120{
2121 _local_ids.clear();
2122 _periodic_nodes.clear();
2123 _halo_ids.clear();
2124 _disjoint_halo_ids.clear();
2125 _ghosted_ids.clear();
2126 _bboxes.clear();
2127 _orig_ids.clear();
2128}
container_type _halo_ids
Holds the ids surrounding the feature.
container_type _disjoint_halo_ids
Holds halo ids that extend onto a non-topologically connected surface.
container_type _local_ids
Holds the local ids in the interior of a feature.
container_type _periodic_nodes
Holds the nodes that belong to the feature on a periodic boundary.
container_type _ghosted_ids
Holds the ghosted ids for a feature (the ids which will be used for stitching.

◆ consolidate()

void FeatureFloodCount::FeatureData::consolidate ( FeatureData &&  rhs)

Consolidates features, i.e.

merges local entities but leaves everything else untouched.

Definition at line 2100 of file FeatureFloodCount.C.

2101{
2102 mooseAssert(_var_index == rhs._var_index, "Mismatched variable index in merge");
2103 mooseAssert(_id == rhs._id, "Mismatched auxiliary id in merge");
2104
2106 FeatureFloodCount::reserve(_local_ids, _local_ids.size() + rhs._local_ids.size());
2107 std::set_union(_local_ids.begin(),
2108 _local_ids.end(),
2109 rhs._local_ids.begin(),
2110 rhs._local_ids.end(),
2111 std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
2112 _local_ids.swap(set_union);
2113
2115 "Flags in invalid state");
2116}
std::vector< dof_id_type > container_type
The primary underlying container type used to hold the data in each FeatureData.
static void reserve(std::set< T > &, std::size_t)

◆ duplicate()

FeatureData FeatureFloodCount::FeatureData::duplicate ( ) const
inline

Definition at line 313 of file FeatureFloodCount.h.

313{ return FeatureData(*this); }

◆ ghostedIntersect()

bool FeatureFloodCount::FeatureData::ghostedIntersect ( const FeatureData rhs) const

Definition at line 1979 of file FeatureFloodCount.C.

1980{
1981 return MooseUtils::setsIntersect(_ghosted_ids, rhs._ghosted_ids);
1982}

◆ halosIntersect()

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 1967 of file FeatureFloodCount.C.

1968{
1969 return MooseUtils::setsIntersect(_halo_ids, rhs._halo_ids);
1970}

Referenced by GrainTracker::attemptGrainRenumber().

◆ merge()

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 2006 of file FeatureFloodCount.C.

2007{
2008 mooseAssert(_var_index == rhs._var_index, "Mismatched variable index in merge");
2009 mooseAssert(_id == rhs._id, "Mismatched auxiliary id in merge");
2010
2012
2013 FeatureFloodCount::reserve(set_union, _local_ids.size() + rhs._local_ids.size());
2014 std::set_union(_local_ids.begin(),
2015 _local_ids.end(),
2016 rhs._local_ids.begin(),
2017 rhs._local_ids.end(),
2018 std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
2019 _local_ids.swap(set_union);
2020
2021 set_union.clear();
2022 FeatureFloodCount::reserve(set_union, _periodic_nodes.size() + rhs._periodic_nodes.size());
2023 std::set_union(_periodic_nodes.begin(),
2024 _periodic_nodes.end(),
2025 rhs._periodic_nodes.begin(),
2026 rhs._periodic_nodes.end(),
2027 std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
2028 _periodic_nodes.swap(set_union);
2029
2030 set_union.clear();
2031 FeatureFloodCount::reserve(set_union, _ghosted_ids.size() + rhs._ghosted_ids.size());
2032 std::set_union(_ghosted_ids.begin(),
2033 _ghosted_ids.end(),
2034 rhs._ghosted_ids.begin(),
2035 rhs._ghosted_ids.end(),
2036 std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
2037
2045 bool physical_intersection = (_ghosted_ids.size() + rhs._ghosted_ids.size() > set_union.size());
2046 _ghosted_ids.swap(set_union);
2047
2052 _bboxes.reserve(_bboxes.size() + rhs._bboxes.size());
2053 std::copy(rhs._bboxes.begin(), rhs._bboxes.end(), std::back_inserter(_bboxes));
2054
2055 mergeBBoxes(_bboxes, physical_intersection);
2056
2057 set_union.clear();
2058 FeatureFloodCount::reserve(set_union, _disjoint_halo_ids.size() + rhs._disjoint_halo_ids.size());
2059 std::set_union(_disjoint_halo_ids.begin(),
2060 _disjoint_halo_ids.end(),
2061 rhs._disjoint_halo_ids.begin(),
2062 rhs._disjoint_halo_ids.end(),
2063 std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
2064 _disjoint_halo_ids.swap(set_union);
2065
2066 set_union.clear();
2067 FeatureFloodCount::reserve(set_union, _halo_ids.size() + rhs._halo_ids.size());
2068 std::set_union(_halo_ids.begin(),
2069 _halo_ids.end(),
2070 rhs._halo_ids.begin(),
2071 rhs._halo_ids.end(),
2072 std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
2073 _halo_ids.swap(set_union);
2074
2075 // Keep track of the original ids so we can notify other processors of the local to global mapping
2076 _orig_ids.splice(_orig_ids.end(), std::move(rhs._orig_ids));
2077
2078 // Update the min feature id
2079 _min_entity_id = std::min(_min_entity_id, rhs._min_entity_id);
2080
2087 "Flags in invalid state");
2088
2089 // Logical AND here to combine flags (INACTIVE & INACTIVE == INACTIVE, all other combos are CLEAR)
2090 _status &= rhs._status;
2091
2092 // Logical OR here to make sure we maintain boundary intersection attribute when joining
2093 _boundary_intersection |= rhs._boundary_intersection;
2094
2095 _vol_count += rhs._vol_count;
2096 _centroid += rhs._centroid;
2097}
void mergeBBoxes(std::vector< BoundingBox > &bboxes, bool physical_intersection)
Located the overlapping bounding box between this Feature and the other Feature and expands that over...
Point _centroid
The centroid of the feature (average of coordinates from entities participating in the volume calcula...

◆ mergeable()

bool FeatureFloodCount::FeatureData::mergeable ( const FeatureData rhs) const

The routine called to see if two features are mergeable:

  • Features must be represented by the same variable (_var_index)
  • Features must either intersect on halos or
  • Features must intersect on a periodic BC

Optimization: We may use the bounding boxes as a coarse-level check before checking halo intersection.

Definition at line 1985 of file FeatureFloodCount.C.

1986{
1987 return (_var_index == rhs._var_index && // the sets have matching variable indices and
1988 ((boundingBoxesIntersect(rhs) && // (if the feature's bboxes intersect and
1989 ghostedIntersect(rhs)) // the ghosted entities also intersect)
1990 || // or
1991 periodicBoundariesIntersect(rhs))); // periodic node sets intersect)
1992}
bool boundingBoxesIntersect(const FeatureData &rhs) const
Determines if any of this FeatureData's bounding boxes overlap with the other FeatureData's bounding ...
bool ghostedIntersect(const FeatureData &rhs) const
bool periodicBoundariesIntersect(const FeatureData &rhs) const

Referenced by FeatureFloodCount::areFeaturesMergeable().

◆ mergeBBoxes()

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 2131 of file FeatureFloodCount.C.

2133{
2142 std::list<BoundingBox> box_list(bboxes.begin(), bboxes.end());
2143
2144 auto box_expanded = false;
2145 for (auto it1 = box_list.begin(); it1 != box_list.end(); /* No increment on it1 */)
2146 {
2147 auto merge_occured = false;
2148 for (auto it2 = box_list.begin(); it2 != box_list.end(); ++it2)
2149 {
2150 if (it1 != it2 && it1->intersects(*it2, TOLERANCE))
2151 {
2152 updateBBoxExtremes(*it2, *it1);
2153 box_list.emplace_back(std::move(*it2));
2154
2155 box_list.erase(it2);
2156 it1 = box_list.erase(it1); // it1 is incremented here!
2157
2158 box_expanded = true;
2159 merge_occured = true;
2160
2161 break;
2162 }
2163 }
2164
2165 if (!merge_occured)
2166 ++it1;
2167 }
2168
2172 bboxes.resize(box_list.size());
2173 std::copy(box_list.begin(), box_list.end(), bboxes.begin());
2174
2175 // Error check
2176 if (physical_intersection && !box_expanded)
2177 {
2178 std::ostringstream oss;
2179 oss << "LHS BBoxes:\n";
2180 for (const auto i : index_range(_bboxes))
2181 oss << "Max: " << _bboxes[i].max() << " Min: " << _bboxes[i].min() << '\n';
2182
2183 ::mooseError("No Bounding Boxes Expanded - This is a catastrophic error!\n", oss.str());
2184 }
2185}
void updateBBoxExtremes(MeshBase &mesh)
Update the minimum and maximum coordinates of a bounding box given a Point, Elem or BBox parameter.
void mooseError(Args &&... args) const
auto max(const L &left, const R &right)
auto min(const L &left, const R &right)
auto index_range(const T &sizable)

Referenced by updateBBoxExtremes().

◆ operator<()

bool FeatureFloodCount::FeatureData::operator< ( const FeatureData rhs) const
inline

Comparison operator for sorting individual FeatureDatas.

Definition at line 250 of file FeatureFloodCount.h.

251 {
252 if (_id != invalid_id)
253 {
254 mooseAssert(rhs._id != invalid_id, "Asymmetric setting of ids detected during sort");
255
256 // Sort based on ids
257 return _id < rhs._id;
258 }
259 else
260 // Sort based on processor independent information (mesh and variable info)
261 return _var_index < rhs._var_index ||
262 (_var_index == rhs._var_index && _min_entity_id < rhs._min_entity_id);
263 }

◆ operator=() [1/2]

FeatureData & FeatureFloodCount::FeatureData::operator= ( const FeatureData )
privatedefault

◆ operator=() [2/2]

FeatureData & FeatureFloodCount::FeatureData::operator= ( FeatureData &&  )
default

◆ periodicBoundariesIntersect()

bool FeatureFloodCount::FeatureData::periodicBoundariesIntersect ( const FeatureData rhs) const

Definition at line 1973 of file FeatureFloodCount.C.

1974{
1975 return MooseUtils::setsIntersect(_periodic_nodes, rhs._periodic_nodes);
1976}

◆ updateBBoxExtremes() [1/2]

void FeatureFloodCount::FeatureData::updateBBoxExtremes ( BoundingBox &  bbox,
const BoundingBox &  rhs_bbox 
)

Definition at line 1945 of file FeatureFloodCount.C.

1946{
1947 for (const auto i : make_range(Moose::dim))
1948 {
1949 bbox.min()(i) = std::min(bbox.min()(i), rhs_bbox.min()(i));
1950 bbox.max()(i) = std::max(bbox.max()(i), rhs_bbox.max()(i));
1951 }
1952}
unsigned int dim
IntRange< T > make_range(T beg, T end)

◆ updateBBoxExtremes() [2/2]

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 1874 of file FeatureFloodCount.C.

1875{
1876 // First update the primary bounding box (all topologically connected)
1877 for (auto & halo_id : _halo_ids)
1878 updateBBoxExtremesHelper(_bboxes[0], mesh.elem_ref(halo_id));
1879 for (auto & ghost_id : _ghosted_ids)
1880 updateBBoxExtremesHelper(_bboxes[0], mesh.elem_ref(ghost_id));
1881
1882 FeatureData::container_type all_primary_region_ids;
1883 FeatureFloodCount::reserve(all_primary_region_ids, _local_ids.size() + _halo_ids.size());
1884 std::set_union(_local_ids.begin(),
1885 _local_ids.end(),
1886 _halo_ids.begin(),
1887 _halo_ids.end(),
1888 std::insert_iterator<FeatureData::container_type>(all_primary_region_ids,
1889 all_primary_region_ids.begin()));
1890
1891 // Remove all of the IDs that are in the primary region
1892 std::list<dof_id_type> disjoint_elem_id_list;
1893 std::set_difference(_disjoint_halo_ids.begin(),
1894 _disjoint_halo_ids.end(),
1895 all_primary_region_ids.begin(),
1896 all_primary_region_ids.end(),
1897 std::insert_iterator<std::list<dof_id_type>>(disjoint_elem_id_list,
1898 disjoint_elem_id_list.begin()));
1899
1906 constexpr auto TOLERANCE = libMesh::TOLERANCE * libMesh::TOLERANCE;
1907 for (auto elem_id : disjoint_elem_id_list)
1908 {
1909 BoundingBox elem_bbox;
1910 updateBBoxExtremesHelper(elem_bbox, *mesh.elem_ptr(elem_id));
1911
1912 bool found_match = false;
1913 for (auto & bbox : _bboxes)
1914 {
1915 if (bbox.intersects(elem_bbox, TOLERANCE))
1916 {
1917 updateBBoxExtremes(bbox, elem_bbox);
1918 found_match = true;
1919 break;
1920 }
1921 }
1922
1923 if (!found_match)
1924 _bboxes.push_back(elem_bbox);
1925 }
1926
1927 mergeBBoxes(_bboxes, false);
1928
1934 FeatureFloodCount::reserve(set_union, _halo_ids.size() + _disjoint_halo_ids.size());
1935 std::set_union(_halo_ids.begin(),
1936 _halo_ids.end(),
1937 _disjoint_halo_ids.begin(),
1938 _disjoint_halo_ids.end(),
1939 std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
1940 _halo_ids.swap(set_union);
1941 _disjoint_halo_ids.clear();
1942}
void updateBBoxExtremesHelper(BoundingBox &bbox, const Point &node)
MeshBase & mesh
static constexpr Real TOLERANCE

Referenced by updateBBoxExtremes().

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
const FeatureData feature 
)
friend

stream output operator

Definition at line 2187 of file FeatureFloodCount.C.

2189{
2190 static const bool debug = true;
2191
2192 out << "Grain ID: ";
2193 if (feature._id != FeatureFloodCount::invalid_id)
2194 out << feature._id;
2195 else
2196 out << "invalid";
2197
2198 if (debug)
2199 {
2200 out << "\nGhosted Entities: ";
2201 for (auto ghosted_id : feature._ghosted_ids)
2202 out << ghosted_id << " ";
2203
2204 out << "\nLocal Entities: ";
2205 for (auto local_id : feature._local_ids)
2206 out << local_id << " ";
2207
2208 out << "\nHalo Entities: ";
2209 for (auto halo_id : feature._halo_ids)
2210 out << halo_id << " ";
2211
2212 out << "\nPeriodic Node IDs: ";
2213 for (auto periodic_node : feature._periodic_nodes)
2214 out << periodic_node << " ";
2215 }
2216
2217 out << "\nBBoxes:";
2218 for (const auto & bbox : feature._bboxes)
2219 {
2220 out << "\nMax: " << bbox.max() << " Min: " << bbox.min();
2221 }
2222
2223 out << "\nStatus: ";
2224 if (feature._status == FeatureFloodCount::Status::CLEAR)
2225 out << "CLEAR";
2226 if (static_cast<bool>(feature._status & FeatureFloodCount::Status::MARKED))
2227 out << " MARKED";
2228 if (static_cast<bool>(feature._status & FeatureFloodCount::Status::DIRTY))
2229 out << " DIRTY";
2230 if (static_cast<bool>(feature._status & FeatureFloodCount::Status::INACTIVE))
2231 out << " INACTIVE";
2232
2233 if (debug)
2234 {
2235 out << "\nOrig IDs (rank, index): ";
2236 for (const auto & orig_pair : feature._orig_ids)
2237 out << '(' << orig_pair.first << ", " << orig_pair.second << ") ";
2238 out << "\nVar_index: " << feature._var_index;
2239 out << "\nMin Entity ID: " << feature._min_entity_id;
2240 }
2241 out << "\n" << std::endl;
2242
2243 return out;
2244}
OStreamProxy out(std::cout)

Member Data Documentation

◆ _bboxes

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(), updateBBoxExtremes(), and FeatureFloodCount::visitElementalNeighbors().

◆ _boundary_intersection

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().

◆ _centroid

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().

◆ _disjoint_halo_ids

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().

◆ _ghosted_ids

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(), updateBBoxExtremes(), and FeatureFloodCount::visitNeighborsHelper().

◆ _halo_ids

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(), updateBBoxExtremes(), and FeatureFloodCount::visitNeighborsHelper().

◆ _id

unsigned int FeatureFloodCount::FeatureData::_id

◆ _local_ids

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(), GrainTracker::swapSolutionValues(), updateBBoxExtremes(), FeatureFloodCount::updateBoundaryIntersections(), and FeatureFloodCount::visitNeighborsHelper().

◆ _min_entity_id

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(), and operator<().

◆ _orig_ids

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(), and FeatureData().

◆ _periodic_nodes

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(), and periodicBoundariesIntersect().

◆ _status

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(), and FeatureFloodCount::isNewFeatureOrConnectedRegion().

◆ _var_index

std::size_t FeatureFloodCount::FeatureData::_var_index

◆ _vol_count

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().


The documentation for this class was generated from the following files: