www.mooseframework.org
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::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
 
FeatureDataoperator= (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...
 
FeatureDataoperator= (const FeatureData &)=default
 

Friends

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

Detailed Description

Definition at line 138 of file FeatureFloodCount.h.

Member Typedef Documentation

◆ container_type

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.

Constructor & Destructor Documentation

◆ FeatureData() [1/5]

FeatureFloodCount::FeatureData::FeatureData ( )
inline

Definition at line 151 of file FeatureFloodCount.h.

151 : 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 153 of file FeatureFloodCount.h.

157  : FeatureData(var_index, status)
158  {
159  _orig_ids = {std::make_pair(rank, local_index)};
160  }

◆ 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 162 of file FeatureFloodCount.h.

165  {BoundingBox()})
166  : _var_index(var_index),
167  _id(id),
168  _bboxes(bboxes), // Assume at least one bounding box
169  _min_entity_id(DofObject::invalid_id),
170  _vol_count(0),
171  _status(status),
173  {
174  }

◆ FeatureData() [4/5]

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

◆ FeatureData() [5/5]

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

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

1919 {
1920  // See if any of the bounding boxes in either FeatureData object intersect
1921  for (const auto & bbox_lhs : _bboxes)
1922  for (const auto & bbox_rhs : rhs._bboxes)
1923  if (bbox_lhs.intersects(bbox_rhs, libMesh::TOLERANCE * libMesh::TOLERANCE))
1924  return true;
1925 
1926  return false;
1927 }

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

1964 {
1965  for (const auto & orig_id_pair1 : _orig_ids)
1966  for (const auto & orig_id_pair2 : rhs._orig_ids)
1967  if (orig_id_pair1 == orig_id_pair2)
1968  return true;
1969 
1970  return false;
1971 }

◆ clear()

void FeatureFloodCount::FeatureData::clear ( )

Definition at line 2087 of file FeatureFloodCount.C.

2088 {
2089  _local_ids.clear();
2090  _periodic_nodes.clear();
2091  _halo_ids.clear();
2092  _disjoint_halo_ids.clear();
2093  _ghosted_ids.clear();
2094  _bboxes.clear();
2095  _orig_ids.clear();
2096 }

◆ consolidate()

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.

2069 {
2070  mooseAssert(_var_index == rhs._var_index, "Mismatched variable index in merge");
2071  mooseAssert(_id == rhs._id, "Mismatched auxiliary id in merge");
2072 
2073  FeatureData::container_type set_union;
2074  FeatureFloodCount::reserve(_local_ids, _local_ids.size() + rhs._local_ids.size());
2075  std::set_union(_local_ids.begin(),
2076  _local_ids.end(),
2077  rhs._local_ids.begin(),
2078  rhs._local_ids.end(),
2079  std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
2080  _local_ids.swap(set_union);
2081 
2082  mooseAssert((_status & Status::MARKED & Status::DIRTY) == Status::CLEAR,
2083  "Flags in invalid state");
2084 }

◆ duplicate()

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

Definition at line 312 of file FeatureFloodCount.h.

312 { return FeatureData(*this); }

◆ expandBBox()

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.

2100 {
2101  std::vector<bool> intersected_boxes(rhs._bboxes.size(), false);
2102 
2103  auto box_expanded = false;
2104  for (auto & bbox : _bboxes)
2105  for (MooseIndex(rhs._bboxes) j = 0; j < rhs._bboxes.size(); ++j)
2106  {
2107  if (bbox.intersects(rhs._bboxes[j], libMesh::TOLERANCE * libMesh::TOLERANCE))
2108  {
2109  updateBBoxExtremes(bbox, rhs._bboxes[j]);
2110  intersected_boxes[j] = true;
2111  box_expanded = true;
2112  }
2113  }
2114 
2115  // Error check
2116  if (!box_expanded)
2117  {
2118  std::ostringstream oss;
2119  oss << "LHS BBoxes:\n";
2120  for (MooseIndex(_bboxes) i = 0; i < _bboxes.size(); ++i)
2121  oss << "Max: " << _bboxes[i].max() << " Min: " << _bboxes[i].min() << '\n';
2122 
2123  oss << "RHS BBoxes:\n";
2124  for (MooseIndex(rhs._bboxes) i = 0; i < rhs._bboxes.size(); ++i)
2125  oss << "Max: " << rhs._bboxes[i].max() << " Min: " << rhs._bboxes[i].min() << '\n';
2126 
2127  ::mooseError("No Bounding Boxes Expanded - This is a catastrophic error!\n", oss.str());
2128  }
2129 
2130  // Any bounding box in the rhs vector that doesn't intersect
2131  // needs to be appended to the lhs vector
2132  for (MooseIndex(intersected_boxes) j = 0; j < intersected_boxes.size(); ++j)
2133  if (!intersected_boxes[j])
2134  _bboxes.push_back(rhs._bboxes[j]);
2135 }

◆ ghostedIntersect()

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

Definition at line 1946 of file FeatureFloodCount.C.

1947 {
1948  return setsIntersect(
1949  _ghosted_ids.begin(), _ghosted_ids.end(), rhs._ghosted_ids.begin(), rhs._ghosted_ids.end());
1950 }

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

1931 {
1932  return setsIntersect(
1933  _halo_ids.begin(), _halo_ids.end(), rhs._halo_ids.begin(), rhs._halo_ids.end());
1934 }

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

1975 {
1976  mooseAssert(_var_index == rhs._var_index, "Mismatched variable index in merge");
1977  mooseAssert(_id == rhs._id, "Mismatched auxiliary id in merge");
1978 
1979  FeatureData::container_type set_union;
1980 
1981  FeatureFloodCount::reserve(set_union, _local_ids.size() + rhs._local_ids.size());
1982  std::set_union(_local_ids.begin(),
1983  _local_ids.end(),
1984  rhs._local_ids.begin(),
1985  rhs._local_ids.end(),
1986  std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
1987  _local_ids.swap(set_union);
1988 
1989  set_union.clear();
1990  FeatureFloodCount::reserve(set_union, _periodic_nodes.size() + rhs._periodic_nodes.size());
1991  std::set_union(_periodic_nodes.begin(),
1992  _periodic_nodes.end(),
1993  rhs._periodic_nodes.begin(),
1994  rhs._periodic_nodes.end(),
1995  std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
1996  _periodic_nodes.swap(set_union);
1997 
1998  set_union.clear();
1999  FeatureFloodCount::reserve(set_union, _ghosted_ids.size() + rhs._ghosted_ids.size());
2000  std::set_union(_ghosted_ids.begin(),
2001  _ghosted_ids.end(),
2002  rhs._ghosted_ids.begin(),
2003  rhs._ghosted_ids.end(),
2004  std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
2005 
2013  bool physical_intersection = (_ghosted_ids.size() + rhs._ghosted_ids.size() > set_union.size());
2014  _ghosted_ids.swap(set_union);
2015 
2020  if (physical_intersection)
2021  expandBBox(rhs);
2022  else
2023  std::move(rhs._bboxes.begin(), rhs._bboxes.end(), std::back_inserter(_bboxes));
2024 
2025  set_union.clear();
2026  FeatureFloodCount::reserve(set_union, _disjoint_halo_ids.size() + rhs._disjoint_halo_ids.size());
2027  std::set_union(_disjoint_halo_ids.begin(),
2028  _disjoint_halo_ids.end(),
2029  rhs._disjoint_halo_ids.begin(),
2030  rhs._disjoint_halo_ids.end(),
2031  std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
2032  _disjoint_halo_ids.swap(set_union);
2033 
2034  set_union.clear();
2035  FeatureFloodCount::reserve(set_union, _halo_ids.size() + rhs._halo_ids.size());
2036  std::set_union(_halo_ids.begin(),
2037  _halo_ids.end(),
2038  rhs._halo_ids.begin(),
2039  rhs._halo_ids.end(),
2040  std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
2041  _halo_ids.swap(set_union);
2042 
2043  // Keep track of the original ids so we can notify other processors of the local to global mapping
2044  _orig_ids.splice(_orig_ids.end(), std::move(rhs._orig_ids));
2045 
2046  // Update the min feature id
2047  _min_entity_id = std::min(_min_entity_id, rhs._min_entity_id);
2048 
2054  mooseAssert((_status & Status::MARKED & Status::DIRTY) == Status::CLEAR,
2055  "Flags in invalid state");
2056 
2057  // Logical AND here to combine flags (INACTIVE & INACTIVE == INACTIVE, all other combos are CLEAR)
2058  _status &= rhs._status;
2059 
2060  // Logical OR here to make sure we maintain boundary intersection attribute when joining
2061  _boundary_intersection |= rhs._boundary_intersection;
2062 
2063  _vol_count += rhs._vol_count;
2064  _centroid += rhs._centroid;
2065 }

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

1954 {
1955  return (_var_index == rhs._var_index && // the sets have matching variable indices and
1956  ((boundingBoxesIntersect(rhs) && // (if the feature's bboxes intersect and
1957  ghostedIntersect(rhs)) // the ghosted entities also intersect)
1958  || // or
1959  periodicBoundariesIntersect(rhs))); // periodic node sets intersect)
1960 }

Referenced by FeatureFloodCount::areFeaturesMergeable().

◆ operator<()

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

Comparison operator for sorting individual FeatureDatas.

Definition at line 249 of file FeatureFloodCount.h.

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

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

1938 {
1939  return setsIntersect(_periodic_nodes.begin(),
1940  _periodic_nodes.end(),
1941  rhs._periodic_nodes.begin(),
1942  rhs._periodic_nodes.end());
1943 }

◆ updateBBoxExtremes() [1/2]

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

Definition at line 1908 of file FeatureFloodCount.C.

1909 {
1910  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
1911  {
1912  bbox.min()(i) = std::min(bbox.min()(i), rhs_bbox.min()(i));
1913  bbox.max()(i) = std::max(bbox.max()(i), rhs_bbox.max()(i));
1914  }
1915 }

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

1825 {
1826  // First update the primary bounding box (all topologically connected)
1827  for (auto & halo_id : _halo_ids)
1828  updateBBoxExtremesHelper(_bboxes[0], mesh.elem_ref(halo_id));
1829  for (auto & ghost_id : _ghosted_ids)
1830  updateBBoxExtremesHelper(_bboxes[0], mesh.elem_ref(ghost_id));
1831 
1832  // Remove all of the IDs that are in the primary region
1833  std::list<dof_id_type> disjoint_elem_id_list;
1834  std::set_difference(_disjoint_halo_ids.begin(),
1835  _disjoint_halo_ids.end(),
1836  _halo_ids.begin(),
1837  _halo_ids.end(),
1838  std::insert_iterator<std::list<dof_id_type>>(disjoint_elem_id_list,
1839  disjoint_elem_id_list.begin()));
1840 
1841  if (!disjoint_elem_id_list.empty())
1842  {
1851  std::list<std::list<dof_id_type>> disjoint_regions;
1852  for (auto elem_id : _disjoint_halo_ids)
1853  {
1854  disjoint_regions.emplace_back(std::list<dof_id_type>({elem_id}));
1855  }
1856 
1857  for (auto it1 = disjoint_regions.begin(); it1 != disjoint_regions.end(); /* No increment */)
1858  {
1859  bool merge_occured = false;
1860  for (auto it2 = disjoint_regions.begin(); it2 != disjoint_regions.end(); ++it2)
1861  {
1862  if (it1 != it2 && areElemListsMergeable(*it1, *it2, mesh))
1863  {
1864  it2->splice(it2->begin(), *it1);
1865 
1866  disjoint_regions.emplace_back(std::move(*it2));
1867  disjoint_regions.erase(it2);
1868  it1 = disjoint_regions.erase(it1);
1869 
1870  merge_occured = true;
1871 
1872  break;
1873  }
1874  }
1875 
1876  if (!merge_occured)
1877  ++it1;
1878  }
1879 
1880  // Finally create new bounding boxes for each disjoint region
1881  auto num_regions = disjoint_regions.size();
1882  // We have num_regions *new* bounding boxes plus the existing bounding box
1883  _bboxes.resize(num_regions + 1);
1884 
1885  decltype(num_regions) region = 1;
1886  for (const auto list_ref : disjoint_regions)
1887  {
1888  for (const auto elem_id : list_ref)
1889  updateBBoxExtremesHelper(_bboxes[region], *mesh.elem_ptr(elem_id));
1890 
1891  FeatureData::container_type set_union;
1892  FeatureFloodCount::reserve(set_union, _halo_ids.size() + _disjoint_halo_ids.size());
1893  std::set_union(
1894  _halo_ids.begin(),
1895  _halo_ids.end(),
1896  _disjoint_halo_ids.begin(),
1897  _disjoint_halo_ids.end(),
1898  std::insert_iterator<FeatureData::container_type>(set_union, set_union.begin()));
1899  _halo_ids.swap(set_union);
1900 
1901  _disjoint_halo_ids.clear();
1902  ++region;
1903  }
1904  }
1905 }

Friends And Related Function Documentation

◆ operator<<

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

stream output operator

Definition at line 2138 of file FeatureFloodCount.C.

2139 {
2140  static const bool debug = true;
2141 
2142  out << "Grain ID: ";
2143  if (feature._id != FeatureFloodCount::invalid_id)
2144  out << feature._id;
2145  else
2146  out << "invalid";
2147 
2148  if (debug)
2149  {
2150  out << "\nGhosted Entities: ";
2151  for (auto ghosted_id : feature._ghosted_ids)
2152  out << ghosted_id << " ";
2153 
2154  out << "\nLocal Entities: ";
2155  for (auto local_id : feature._local_ids)
2156  out << local_id << " ";
2157 
2158  out << "\nHalo Entities: ";
2159  for (auto halo_id : feature._halo_ids)
2160  out << halo_id << " ";
2161 
2162  out << "\nPeriodic Node IDs: ";
2163  for (auto periodic_node : feature._periodic_nodes)
2164  out << periodic_node << " ";
2165  }
2166 
2167  out << "\nBBoxes:";
2168  Real volume = 0;
2169  for (const auto & bbox : feature._bboxes)
2170  {
2171  out << "\nMax: " << bbox.max() << " Min: " << bbox.min();
2172  volume += (bbox.max()(0) - bbox.min()(0)) * (bbox.max()(1) - bbox.min()(1)) *
2173  (MooseUtils::absoluteFuzzyEqual(bbox.max()(2), bbox.min()(2))
2174  ? 1
2175  : bbox.max()(2) - bbox.min()(2));
2176  }
2177 
2178  out << "\nStatus: ";
2179  if (feature._status == FeatureFloodCount::Status::CLEAR)
2180  out << "CLEAR";
2181  if (static_cast<bool>(feature._status & FeatureFloodCount::Status::MARKED))
2182  out << " MARKED";
2183  if (static_cast<bool>(feature._status & FeatureFloodCount::Status::DIRTY))
2184  out << " DIRTY";
2185  if (static_cast<bool>(feature._status & FeatureFloodCount::Status::INACTIVE))
2186  out << " INACTIVE";
2187 
2188  if (debug)
2189  {
2190  out << "\nOrig IDs (rank, index): ";
2191  for (const auto & orig_pair : feature._orig_ids)
2192  out << '(' << orig_pair.first << ", " << orig_pair.second << ") ";
2193  out << "\nVar_index: " << feature._var_index;
2194  out << "\nMin Entity ID: " << feature._min_entity_id;
2195  }
2196  out << "\n\n";
2197 
2198  return out;
2199 }

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 291 of file FeatureFloodCount.h.

Referenced by boundingBoxesIntersect(), GrainTracker::computeMinDistancesFromGrain(), dataLoad(), dataStore(), expandBBox(), operator<<(), updateBBoxExtremes(), and FeatureFloodCount::visitElementalNeighbors().

◆ _boundary_intersection

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

◆ _centroid

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

◆ _disjoint_halo_ids

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

◆ _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 268 of file FeatureFloodCount.h.

Referenced by dataLoad(), dataStore(), ghostedIntersect(), operator<<(), updateBBoxExtremes(), and FeatureFloodCount::visitNeighborsHelper().

◆ _halo_ids

container_type FeatureFloodCount::FeatureData::_halo_ids

◆ _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 272 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::appendPeriodicNeighborNodes(), FeatureFloodCount::flood(), operator<<(), GrainTracker::swapSolutionValues(), 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 297 of file FeatureFloodCount.h.

Referenced by dataLoad(), dataStore(), operator<(), and operator<<().

◆ _orig_ids

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

◆ _periodic_nodes

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

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

◆ _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 300 of file FeatureFloodCount.h.

Referenced by dataLoad(), dataStore(), and FeatureFloodCount::flood().


The documentation for this class was generated from the following files:
FeatureFloodCount::FeatureData::_id
unsigned int _id
An ID for this feature.
Definition: FeatureFloodCount.h:287
FeatureFloodCount::FeatureData::_disjoint_halo_ids
container_type _disjoint_halo_ids
Holds halo ids that extend onto a non-topologically connected surface.
Definition: FeatureFloodCount.h:278
FeatureFloodCount::FeatureData::container_type
std::set< dof_id_type > container_type
The primary underlying container type used to hold the data in each FeatureData.
Definition: FeatureFloodCount.h:149
FeatureFloodCount::FeatureData::periodicBoundariesIntersect
bool periodicBoundariesIntersect(const FeatureData &rhs) const
Definition: FeatureFloodCount.C:1937
FeatureFloodCount::FeatureData::_boundary_intersection
BoundaryIntersection _boundary_intersection
Enumaration indicating boundary intersection status.
Definition: FeatureFloodCount.h:310
FeatureFloodCount::FeatureData::_min_entity_id
dof_id_type _min_entity_id
The minimum entity seen in the _local_ids, used for sorting features.
Definition: FeatureFloodCount.h:297
FeatureFloodCount::Status::CLEAR
FeatureFloodCount::FeatureData::expandBBox
void expandBBox(const FeatureData &rhs)
Located the overlapping bounding box between this Feature and the other Feature and expands that over...
Definition: FeatureFloodCount.C:2099
areElemListsMergeable
bool areElemListsMergeable(const std::list< dof_id_type > &elem_list1, const std::list< dof_id_type > &elem_list2, MeshBase &mesh)
Definition: FeatureFloodCount.C:2222
FeatureFloodCount::FeatureData::_ghosted_ids
container_type _ghosted_ids
Holds the ghosted ids for a feature (the ids which will be used for stitching.
Definition: FeatureFloodCount.h:268
FeatureFloodCount::FeatureData::_halo_ids
container_type _halo_ids
Holds the ids surrounding the feature.
Definition: FeatureFloodCount.h:275
FeatureFloodCount::FeatureData::_orig_ids
std::list< std::pair< processor_id_type, unsigned int > > _orig_ids
Original processor/local ids.
Definition: FeatureFloodCount.h:294
FeatureFloodCount::FeatureData::FeatureData
FeatureData()
Definition: FeatureFloodCount.h:151
FeatureFloodCount::FeatureData::boundingBoxesIntersect
bool boundingBoxesIntersect(const FeatureData &rhs) const
Determines if any of this FeatureData's bounding boxes overlap with the other FeatureData's bounding ...
Definition: FeatureFloodCount.C:1918
updateBBoxExtremesHelper
void updateBBoxExtremesHelper(BoundingBox &bbox, const Point &node)
Definition: FeatureFloodCount.C:2205
FeatureFloodCount::FeatureData::ghostedIntersect
bool ghostedIntersect(const FeatureData &rhs) const
Definition: FeatureFloodCount.C:1946
FeatureFloodCount::invalid_id
static const unsigned int invalid_id
Definition: FeatureFloodCount.h:94
FeatureFloodCount::Status::INACTIVE
FeatureFloodCount::FeatureData::_periodic_nodes
container_type _periodic_nodes
Holds the nodes that belong to the feature on a periodic boundary.
Definition: FeatureFloodCount.h:281
FeatureFloodCount::FeatureData::_var_index
std::size_t _var_index
The Moose variable where this feature was found (often the "order parameter")
Definition: FeatureFloodCount.h:284
FeatureFloodCount::FeatureData::_centroid
Point _centroid
The centroid of the feature (average of coordinates from entities participating in the volume calcula...
Definition: FeatureFloodCount.h:304
FeatureFloodCount::FeatureData::_local_ids
container_type _local_ids
Holds the local ids in the interior of a feature.
Definition: FeatureFloodCount.h:272
FeatureFloodCount::reserve
static void reserve(std::set< T > &, std::size_t)
Definition: FeatureFloodCount.h:748
FeatureFloodCount::Status::DIRTY
FeatureFloodCount::FeatureData::updateBBoxExtremes
void updateBBoxExtremes(MeshBase &mesh)
Update the minimum and maximum coordinates of a bounding box given a Point, Elem or BBox parameter.
Definition: FeatureFloodCount.C:1824
FeatureFloodCount::FeatureData::_vol_count
std::size_t _vol_count
The count of entities contributing to the volume calculation.
Definition: FeatureFloodCount.h:300
FeatureFloodCount::BoundaryIntersection::NONE
FeatureFloodCount::FeatureData::_bboxes
std::vector< BoundingBox > _bboxes
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constrain...
Definition: FeatureFloodCount.h:291
FeatureFloodCount::setsIntersect
static bool setsIntersect(InputIterator first1, InputIterator last1, InputIterator first2, InputIterator last2)
This method detects whether two sets intersect without building a result set.
Definition: FeatureFloodCount.h:543
FeatureFloodCount::FeatureData::_status
Status _status
The status of a feature (used mostly in derived classes like the GrainTracker)
Definition: FeatureFloodCount.h:307
FeatureFloodCount::Status::MARKED