www.mooseframework.org
Public Member Functions | Public Attributes | Friends | List of all members
FeatureFloodCount::FeatureData Class Reference

#include <FeatureFloodCount.h>

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< MeshTools::BoundingBox > bboxes={MeshTools::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...
 
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 clear ()
 
bool operator< (const FeatureData &rhs) const
 Comparison operator for sorting individual FeatureDatas. More...
 
FeatureData duplicate () const
 
 FeatureData (FeatureData &&f)=default
 
FeatureDataoperator= (FeatureData &&f)=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 (MeshTools::BoundingBox &bbox, const MeshTools::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

std::set< dof_id_type > _ghosted_ids
 Holds the ghosted ids for a feature (the ids which will be used for stitching. More...
 
std::set< dof_id_type > _local_ids
 Holds the local ids in the interior of a feature. More...
 
std::set< dof_id_type > _halo_ids
 Holds the ids surrounding the feature. More...
 
std::set< dof_id_type > _disjoint_halo_ids
 Holds halo ids that extend onto a non-topologically connected surface. More...
 
std::set< dof_id_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< MeshTools::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...
 
bool _intersects_boundary
 Flag indicating whether this feature intersects a boundary. More...
 

Private Member Functions

 FeatureData (const FeatureData &f)=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 &f)=default
 

Friends

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

Detailed Description

Definition at line 113 of file FeatureFloodCount.h.

Constructor & Destructor Documentation

FeatureFloodCount::FeatureData::FeatureData ( )
inline

Definition at line 116 of file FeatureFloodCount.h.

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

Definition at line 118 of file FeatureFloodCount.h.

122  : FeatureData(var_index, status)
123  {
124  _orig_ids = {std::make_pair(rank, local_index)};
125  }
std::list< std::pair< processor_id_type, unsigned int > > _orig_ids
Original processor/local ids.
FeatureFloodCount::FeatureData::FeatureData ( std::size_t  var_index,
Status  status,
unsigned int  id = invalid_id,
std::vector< MeshTools::BoundingBox >  bboxes = {MeshTools::BoundingBox()} 
)
inline

Definition at line 127 of file FeatureFloodCount.h.

130  {MeshTools::BoundingBox()})
131  : _var_index(var_index),
132  _id(id),
133  _bboxes(bboxes), // Assume at least one bounding box
134  _min_entity_id(DofObject::invalid_id),
135  _vol_count(0),
136  _status(status),
137  _intersects_boundary(false)
138  {
139  }
std::vector< MeshTools::BoundingBox > _bboxes
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constrain...
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")
Status _status
The status of a feature (used mostly in derived classes like the GrainTracker)
bool _intersects_boundary
Flag indicating whether this feature intersects a boundary.
std::size_t _vol_count
The count of entities contributing to the volume calculation.
unsigned int _id
An ID for this feature.
FeatureFloodCount::FeatureData::FeatureData ( FeatureData &&  f)
default
FeatureFloodCount::FeatureData::FeatureData ( const FeatureData f)
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

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

1503 {
1504  // See if any of the bounding boxes in either FeatureData object intersect
1505  for (const auto & bbox_lhs : _bboxes)
1506  for (const auto & bbox_rhs : rhs._bboxes)
1507  if (bbox_lhs.intersects(bbox_rhs))
1508  return true;
1509 
1510  return false;
1511 }
std::vector< MeshTools::BoundingBox > _bboxes
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constrain...
void FeatureFloodCount::FeatureData::clear ( )

Definition at line 1654 of file FeatureFloodCount.C.

1655 {
1656  _local_ids.clear();
1657  _periodic_nodes.clear();
1658  _halo_ids.clear();
1659  _disjoint_halo_ids.clear();
1660  _ghosted_ids.clear();
1661  _bboxes.clear();
1662  _orig_ids.clear();
1663 }
std::set< dof_id_type > _local_ids
Holds the local ids in the interior of a feature.
std::set< dof_id_type > _periodic_nodes
Holds the nodes that belong to the feature on a periodic boundary.
std::vector< MeshTools::BoundingBox > _bboxes
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constrain...
std::set< dof_id_type > _disjoint_halo_ids
Holds halo ids that extend onto a non-topologically connected surface.
std::set< dof_id_type > _halo_ids
Holds the ids surrounding the feature.
std::list< std::pair< processor_id_type, unsigned int > > _orig_ids
Original processor/local ids.
std::set< dof_id_type > _ghosted_ids
Holds the ghosted ids for a feature (the ids which will be used for stitching.
FeatureData FeatureFloodCount::FeatureData::duplicate ( ) const
inline

Definition at line 262 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 1666 of file FeatureFloodCount.C.

1667 {
1668  std::vector<bool> intersected_boxes(rhs._bboxes.size(), false);
1669 
1670  auto box_expanded = false;
1671  for (auto & bbox : _bboxes)
1672  for (auto j = beginIndex(rhs._bboxes); j < rhs._bboxes.size(); ++j)
1673  if (bbox.intersects(rhs._bboxes[j]))
1674  {
1675  updateBBoxExtremes(bbox, rhs._bboxes[j]);
1676  intersected_boxes[j] = true;
1677  box_expanded = true;
1678  }
1679 
1680  // Any bounding box in the rhs vector that doesn't intersect
1681  // needs to be appended to the lhs vector
1682  for (auto j = beginIndex(intersected_boxes); j < intersected_boxes.size(); ++j)
1683  if (!intersected_boxes[j])
1684  _bboxes.push_back(rhs._bboxes[j]);
1685 
1686  // Error check
1687  if (!box_expanded)
1688  {
1689  std::ostringstream oss;
1690  oss << "LHS BBoxes:\n";
1691  for (auto i = beginIndex(_bboxes); i < _bboxes.size(); ++i)
1692  oss << "Max: " << _bboxes[i].max() << " Min: " << _bboxes[i].min() << '\n';
1693 
1694  oss << "RHS BBoxes:\n";
1695  for (auto i = beginIndex(rhs._bboxes); i < rhs._bboxes.size(); ++i)
1696  oss << "Max: " << rhs._bboxes[i].max() << " Min: " << rhs._bboxes[i].min() << '\n';
1697 
1698  ::mooseError("No Bounding Boxes Expanded - This is a catastrophic error!\n", oss.str());
1699  }
1700 }
void updateBBoxExtremes(MeshBase &mesh)
Update the minimum and maximum coordinates of a bounding box given a Point, Elem or BBox parameter...
std::vector< MeshTools::BoundingBox > _bboxes
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constrain...
bool FeatureFloodCount::FeatureData::ghostedIntersect ( const FeatureData rhs) const

Definition at line 1530 of file FeatureFloodCount.C.

1531 {
1532  return setsIntersect(
1533  _ghosted_ids.begin(), _ghosted_ids.end(), rhs._ghosted_ids.begin(), rhs._ghosted_ids.end());
1534 }
std::set< dof_id_type > _ghosted_ids
Holds the ghosted ids for a feature (the ids which will be used for stitching.
static bool setsIntersect(InputIterator first1, InputIterator last1, InputIterator first2, InputIterator last2)
This method detects whether two sets intersect without building a result set.
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 1514 of file FeatureFloodCount.C.

1515 {
1516  return setsIntersect(
1517  _halo_ids.begin(), _halo_ids.end(), rhs._halo_ids.begin(), rhs._halo_ids.end());
1518 }
std::set< dof_id_type > _halo_ids
Holds the ids surrounding the feature.
static bool setsIntersect(InputIterator first1, InputIterator last1, InputIterator first2, InputIterator last2)
This method detects whether two sets intersect without building a result set.
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 1547 of file FeatureFloodCount.C.

1548 {
1549  mooseAssert(_var_index == rhs._var_index, "Mismatched variable index in merge");
1550  mooseAssert(_id == rhs._id, "Mismatched auxiliary id in merge");
1551 
1552  std::set<dof_id_type> set_union;
1553 
1561  std::set_union(_periodic_nodes.begin(),
1562  _periodic_nodes.end(),
1563  rhs._periodic_nodes.begin(),
1564  rhs._periodic_nodes.end(),
1565  std::insert_iterator<std::set<dof_id_type>>(set_union, set_union.begin()));
1566  _periodic_nodes.swap(set_union);
1567 
1568  set_union.clear();
1569  std::set_union(_local_ids.begin(),
1570  _local_ids.end(),
1571  rhs._local_ids.begin(),
1572  rhs._local_ids.end(),
1573  std::insert_iterator<std::set<dof_id_type>>(set_union, set_union.begin()));
1574  _local_ids.swap(set_union);
1575 
1576  set_union.clear();
1577  std::set_union(_ghosted_ids.begin(),
1578  _ghosted_ids.end(),
1579  rhs._ghosted_ids.begin(),
1580  rhs._ghosted_ids.end(),
1581  std::insert_iterator<std::set<dof_id_type>>(set_union, set_union.begin()));
1582 
1583  // Was there overlap in the physical region?
1584  bool physical_intersection = (_ghosted_ids.size() + rhs._ghosted_ids.size() > set_union.size());
1585  _ghosted_ids.swap(set_union);
1586 
1591  if (physical_intersection)
1592  expandBBox(rhs);
1593  else
1594  {
1595  // set_union.clear();
1596  // std::set_difference(_halo_ids.begin(),
1597  // _halo_ids.end(),
1598  // _disjoint_halo_ids.begin(),
1599  // _disjoint_halo_ids.end(),
1600  // std::insert_iterator<std::set<dof_id_type>>(set_union,
1601  // set_union.begin()));
1602  // _halo_ids.swap(set_union);
1603  //
1604  // set_union.clear();
1605  // std::set_difference(rhs._halo_ids.begin(),
1606  // rhs._halo_ids.end(),
1607  // rhs._disjoint_halo_ids.begin(),
1608  // rhs._disjoint_halo_ids.end(),
1609  // std::insert_iterator<std::set<dof_id_type>>(set_union,
1610  // set_union.begin()));
1611  // rhs._halo_ids.swap(set_union);
1612 
1613  std::move(rhs._bboxes.begin(), rhs._bboxes.end(), std::back_inserter(_bboxes));
1614  }
1615 
1616  set_union.clear();
1617  std::set_union(_disjoint_halo_ids.begin(),
1618  _disjoint_halo_ids.end(),
1619  rhs._disjoint_halo_ids.begin(),
1620  rhs._disjoint_halo_ids.end(),
1621  std::insert_iterator<std::set<dof_id_type>>(set_union, set_union.begin()));
1622  _disjoint_halo_ids.swap(set_union);
1623 
1624  set_union.clear();
1625  std::set_union(_halo_ids.begin(),
1626  _halo_ids.end(),
1627  rhs._halo_ids.begin(),
1628  rhs._halo_ids.end(),
1629  std::insert_iterator<std::set<dof_id_type>>(set_union, set_union.begin()));
1630  _halo_ids.swap(set_union);
1631 
1632  // Keep track of the original ids so we can notify other processors of the local to global mapping
1633  _orig_ids.splice(_orig_ids.end(), std::move(rhs._orig_ids));
1634 
1635  // Update the min feature id
1636  _min_entity_id = std::min(_min_entity_id, rhs._min_entity_id);
1637 
1643  mooseAssert((_status & Status::MARKED & Status::DIRTY) == Status::CLEAR,
1644  "Flags in invalid state");
1645 
1646  // Logical AND here to combine flags (INACTIVE & INACTIVE == INACTIVE, all other combos are CLEAR)
1647  _status &= rhs._status;
1648 
1649  _vol_count += rhs._vol_count;
1650  _centroid += rhs._centroid;
1651 }
Point _centroid
The centroid of the feature (average of coordinates from entities participating in the volume calcula...
std::set< dof_id_type > _local_ids
Holds the local ids in the interior of a feature.
std::set< dof_id_type > _periodic_nodes
Holds the nodes that belong to the feature on a periodic boundary.
std::vector< MeshTools::BoundingBox > _bboxes
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constrain...
std::set< dof_id_type > _disjoint_halo_ids
Holds halo ids that extend onto a non-topologically connected surface.
void expandBBox(const FeatureData &rhs)
Located the overlapping bounding box between this Feature and the other Feature and expands that over...
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")
std::set< dof_id_type > _halo_ids
Holds the ids surrounding the feature.
std::list< std::pair< processor_id_type, unsigned int > > _orig_ids
Original processor/local ids.
Status _status
The status of a feature (used mostly in derived classes like the GrainTracker)
std::set< dof_id_type > _ghosted_ids
Holds the ghosted ids for a feature (the ids which will be used for stitching.
std::size_t _vol_count
The count of entities contributing to the volume calculation.
unsigned int _id
An ID for this feature.
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 1537 of file FeatureFloodCount.C.

Referenced by PolycrystalUserObjectBase::areFeaturesMergeable(), and FeatureFloodCount::areFeaturesMergeable().

1538 {
1539  return (_var_index == rhs._var_index && // the sets have matching variable indices and
1540  ((boundingBoxesIntersect(rhs) && // (if the feature's bboxes intersect and
1541  ghostedIntersect(rhs)) // the ghosted entities also intersect)
1542  || // or
1543  periodicBoundariesIntersect(rhs))); // periodic node sets intersect)
1544 }
bool boundingBoxesIntersect(const FeatureData &rhs) const
Determines if any of this FeatureData&#39;s bounding boxes overlap with the other FeatureData&#39;s bounding ...
bool ghostedIntersect(const FeatureData &rhs) const
std::size_t _var_index
The Moose variable where this feature was found (often the "order parameter")
bool periodicBoundariesIntersect(const FeatureData &rhs) const
bool FeatureFloodCount::FeatureData::operator< ( const FeatureData rhs) const
inline

Comparison operator for sorting individual FeatureDatas.

Definition at line 199 of file FeatureFloodCount.h.

200  {
201  if (_id != invalid_id)
202  {
203  mooseAssert(rhs._id != invalid_id, "Asymmetric setting of ids detected during sort");
204 
205  // Sort based on ids
206  return _id < rhs._id;
207  }
208  else
209  // Sort based on processor independent information (mesh and variable info)
210  return _var_index < rhs._var_index ||
211  (_var_index == rhs._var_index && _min_entity_id < rhs._min_entity_id);
212  }
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")
static const unsigned int invalid_id
unsigned int _id
An ID for this feature.
FeatureData& FeatureFloodCount::FeatureData::operator= ( FeatureData &&  f)
default
FeatureData& FeatureFloodCount::FeatureData::operator= ( const FeatureData f)
privatedefault
bool FeatureFloodCount::FeatureData::periodicBoundariesIntersect ( const FeatureData rhs) const

Definition at line 1521 of file FeatureFloodCount.C.

1522 {
1523  return setsIntersect(_periodic_nodes.begin(),
1524  _periodic_nodes.end(),
1525  rhs._periodic_nodes.begin(),
1526  rhs._periodic_nodes.end());
1527 }
std::set< dof_id_type > _periodic_nodes
Holds the nodes that belong to the feature on a periodic boundary.
static bool setsIntersect(InputIterator first1, InputIterator last1, InputIterator first2, InputIterator last2)
This method detects whether two sets intersect without building a result set.
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 1418 of file FeatureFloodCount.C.

1419 {
1420  // First update the primary bounding box (all topologically connected)
1421  for (auto & halo_id : _halo_ids)
1422  updateBBoxExtremesHelper(_bboxes[0], *mesh.elem(halo_id));
1423 
1424  // Remove all of the IDs that are in the primary region
1425  std::list<dof_id_type> disjoint_elem_id_list;
1426  std::set_difference(_disjoint_halo_ids.begin(),
1427  _disjoint_halo_ids.end(),
1428  _halo_ids.begin(),
1429  _halo_ids.end(),
1430  std::insert_iterator<std::list<dof_id_type>>(disjoint_elem_id_list,
1431  disjoint_elem_id_list.begin()));
1432 
1433  if (!disjoint_elem_id_list.empty())
1434  {
1443  std::list<std::list<dof_id_type>> disjoint_regions;
1444  for (auto elem_id : _disjoint_halo_ids)
1445  {
1446  disjoint_regions.emplace_back(std::list<dof_id_type>({elem_id}));
1447  }
1448 
1449  for (auto it1 = disjoint_regions.begin(); it1 != disjoint_regions.end(); /* No increment */)
1450  {
1451  bool merge_occured = false;
1452  for (auto it2 = disjoint_regions.begin(); it2 != disjoint_regions.end(); ++it2)
1453  {
1454  if (it1 != it2 && areElemListsMergeable(*it1, *it2, mesh))
1455  {
1456  it2->splice(it2->begin(), *it1);
1457 
1458  disjoint_regions.emplace_back(std::move(*it2));
1459  disjoint_regions.erase(it2);
1460  it1 = disjoint_regions.erase(it1);
1461 
1462  merge_occured = true;
1463 
1464  break;
1465  }
1466  }
1467 
1468  if (!merge_occured)
1469  ++it1;
1470  }
1471 
1472  // Finally create new bounding boxes for each disjoint region
1473  auto num_regions = disjoint_regions.size();
1474  // We have num_regions *new* bounding boxes plus the existing bounding box
1475  _bboxes.resize(num_regions + 1);
1476 
1477  decltype(num_regions) region = 1;
1478  for (const auto list_ref : disjoint_regions)
1479  {
1480  for (const auto elem_id : list_ref)
1481  updateBBoxExtremesHelper(_bboxes[region], *mesh.elem_ptr(elem_id));
1482 
1483  _halo_ids.insert(_disjoint_halo_ids.begin(), _disjoint_halo_ids.end());
1484  _disjoint_halo_ids.clear();
1485  ++region;
1486  }
1487  }
1488 }
bool areElemListsMergeable(const std::list< dof_id_type > &elem_list1, const std::list< dof_id_type > &elem_list2, MeshBase &mesh)
std::vector< MeshTools::BoundingBox > _bboxes
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constrain...
std::set< dof_id_type > _disjoint_halo_ids
Holds halo ids that extend onto a non-topologically connected surface.
void updateBBoxExtremesHelper(MeshTools::BoundingBox &bbox, const Point &node)
std::set< dof_id_type > _halo_ids
Holds the ids surrounding the feature.
void FeatureFloodCount::FeatureData::updateBBoxExtremes ( MeshTools::BoundingBox &  bbox,
const MeshTools::BoundingBox &  rhs_bbox 
)

Definition at line 1491 of file FeatureFloodCount.C.

1493 {
1494  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
1495  {
1496  bbox.min()(i) = std::min(bbox.min()(i), rhs_bbox.min()(i));
1497  bbox.max()(i) = std::max(bbox.max()(i), rhs_bbox.max()(i));
1498  }
1499 }

Friends And Related Function Documentation

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

stream output operator

Definition at line 1703 of file FeatureFloodCount.C.

1704 {
1705  static const bool debug = true;
1706 
1707  out << "Grain ID: ";
1708  if (feature._id != FeatureFloodCount::invalid_id)
1709  out << feature._id;
1710  else
1711  out << "invalid";
1712 
1713  if (debug)
1714  {
1715  out << "\nGhosted Entities: ";
1716  for (auto ghosted_id : feature._ghosted_ids)
1717  out << ghosted_id << " ";
1718 
1719  out << "\nLocal Entities: ";
1720  for (auto local_id : feature._local_ids)
1721  out << local_id << " ";
1722 
1723  out << "\nHalo Entities: ";
1724  for (auto halo_id : feature._halo_ids)
1725  out << halo_id << " ";
1726 
1727  out << "\nPeriodic Node IDs: ";
1728  for (auto periodic_node : feature._periodic_nodes)
1729  out << periodic_node << " ";
1730  }
1731 
1732  out << "\nBBoxes:";
1733  Real volume = 0;
1734  for (const auto & bbox : feature._bboxes)
1735  {
1736  out << "\nMax: " << bbox.max() << " Min: " << bbox.min();
1737  volume += (bbox.max()(0) - bbox.min()(0)) * (bbox.max()(1) - bbox.min()(1)) *
1738  (MooseUtils::absoluteFuzzyEqual(bbox.max()(2), bbox.min()(2))
1739  ? 1
1740  : bbox.max()(2) - bbox.min()(2));
1741  }
1742 
1743  out << "\nStatus: ";
1744  if (feature._status == FeatureFloodCount::Status::CLEAR)
1745  out << "CLEAR";
1746  if (static_cast<bool>(feature._status & FeatureFloodCount::Status::MARKED))
1747  out << " MARKED";
1748  if (static_cast<bool>(feature._status & FeatureFloodCount::Status::DIRTY))
1749  out << " DIRTY";
1750  if (static_cast<bool>(feature._status & FeatureFloodCount::Status::INACTIVE))
1751  out << " INACTIVE";
1752 
1753  if (debug)
1754  {
1755  out << "\nOrig IDs (rank, index): ";
1756  for (const auto & orig_pair : feature._orig_ids)
1757  out << '(' << orig_pair.first << ", " << orig_pair.second << ") ";
1758  out << "\nVar_index: " << feature._var_index;
1759  out << "\nMin Entity ID: " << feature._min_entity_id;
1760  }
1761  out << "\n\n";
1762 
1763  return out;
1764 }
static const unsigned int invalid_id

Member Data Documentation

std::vector<MeshTools::BoundingBox> FeatureFloodCount::FeatureData::_bboxes

The vector of bounding boxes completely enclosing this feature (multiple used with periodic constraints)

Definition at line 241 of file FeatureFloodCount.h.

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

Point FeatureFloodCount::FeatureData::_centroid

The centroid of the feature (average of coordinates from entities participating in the volume calculation)

Definition at line 254 of file FeatureFloodCount.h.

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

std::set<dof_id_type> FeatureFloodCount::FeatureData::_disjoint_halo_ids

Holds halo ids that extend onto a non-topologically connected surface.

Definition at line 228 of file FeatureFloodCount.h.

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

std::set<dof_id_type> FeatureFloodCount::FeatureData::_ghosted_ids

Holds the ghosted ids for a feature (the ids which will be used for stitching.

Definition at line 218 of file FeatureFloodCount.h.

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

std::set<dof_id_type> FeatureFloodCount::FeatureData::_halo_ids

Holds the ids surrounding the feature.

Definition at line 225 of file FeatureFloodCount.h.

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

unsigned int FeatureFloodCount::FeatureData::_id
bool FeatureFloodCount::FeatureData::_intersects_boundary

Flag indicating whether this feature intersects a boundary.

Definition at line 260 of file FeatureFloodCount.h.

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

std::set<dof_id_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 222 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::appendPeriodicNeighborNodes(), FeatureFloodCount::expandPointHalos(), FeatureFloodCount::flood(), and operator<<().

dof_id_type FeatureFloodCount::FeatureData::_min_entity_id

The minimum entity seen in the _local_ids, used for sorting features.

Definition at line 247 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 244 of file FeatureFloodCount.h.

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

std::set<dof_id_type> FeatureFloodCount::FeatureData::_periodic_nodes

Holds the nodes that belong to the feature on a periodic boundary.

Definition at line 231 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 257 of file FeatureFloodCount.h.

Referenced by 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 234 of file FeatureFloodCount.h.

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

std::size_t FeatureFloodCount::FeatureData::_vol_count

The count of entities contributing to the volume calculation.

Definition at line 250 of file FeatureFloodCount.h.

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


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