www.mooseframework.org
Functions
FeatureFloodCount.C File Reference

Go to the source code of this file.

Functions

template<>
void dataStore (std::ostream &stream, FeatureFloodCount::FeatureData &feature, void *context)
 
template<>
void dataStore (std::ostream &stream, BoundingBox &bbox, void *context)
 
template<>
void dataLoad (std::istream &stream, FeatureFloodCount::FeatureData &feature, void *context)
 
template<>
void dataLoad (std::istream &stream, BoundingBox &bbox, void *context)
 
void updateBBoxExtremesHelper (BoundingBox &bbox, const Point &node)
 
void updateBBoxExtremesHelper (BoundingBox &bbox, const Elem &elem)
 
 registerMooseObject ("PhaseFieldApp", FeatureFloodCount)
 
std::ostream & operator<< (std::ostream &out, const FeatureFloodCount::FeatureData &feature)
 

Function Documentation

◆ dataLoad() [1/2]

template<>
void dataLoad ( std::istream &  stream,
FeatureFloodCount::FeatureData feature,
void context 
)

Note that _local_ids is not loaded here. It's not needed for restart, and not needed during the parallel merge operation

Definition at line 63 of file FeatureFloodCount.C.

Referenced by FeatureFloodCount::deserialize(), XFEM::loadMaterialPropertiesForElementHelper(), and TEST().

64 {
69  loadHelper(stream, feature._ghosted_ids, context);
70  loadHelper(stream, feature._halo_ids, context);
71  loadHelper(stream, feature._disjoint_halo_ids, context);
72  loadHelper(stream, feature._periodic_nodes, context);
73  loadHelper(stream, feature._var_index, context);
74  loadHelper(stream, feature._id, context);
75  loadHelper(stream, feature._bboxes, context);
76  loadHelper(stream, feature._orig_ids, context);
77  loadHelper(stream, feature._min_entity_id, context);
78  loadHelper(stream, feature._vol_count, context);
79  loadHelper(stream, feature._centroid, context);
80  loadHelper(stream, feature._status, context);
81  loadHelper(stream, feature._boundary_intersection, context);
82 }
Point _centroid
The centroid of the feature (average of coordinates from entities participating in the volume calcula...
std::vector< BoundingBox > _bboxes
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constrain...
container_type _halo_ids
Holds the ids surrounding the feature.
container_type _ghosted_ids
Holds the ghosted ids for a feature (the ids which will be used for stitching.
container_type _disjoint_halo_ids
Holds halo ids that extend onto a non-topologically connected surface.
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")
container_type _periodic_nodes
Holds the nodes that belong to the feature on a periodic boundary.
std::list< std::pair< processor_id_type, unsigned int > > _orig_ids
Original processor/local ids.
BoundaryIntersection _boundary_intersection
Enumeration indicating boundary intersection status.
Status _status
The status of a feature (used mostly in derived classes like the GrainTracker)
void loadHelper(std::istream &stream, P &data, void *context)
std::size_t _vol_count
The count of entities contributing to the volume calculation.
unsigned int _id
An ID for this feature.

◆ dataLoad() [2/2]

template<>
void dataLoad ( std::istream &  stream,
BoundingBox &  bbox,
void context 
)

Definition at line 86 of file FeatureFloodCount.C.

87 {
88  loadHelper(stream, bbox.min(), context);
89  loadHelper(stream, bbox.max(), context);
90 }
void loadHelper(std::istream &stream, P &data, void *context)

◆ dataStore() [1/2]

template<>
void dataStore ( std::ostream &  stream,
FeatureFloodCount::FeatureData feature,
void context 
)

Note that _local_ids is not stored here. It's not needed for restart, and not needed during the parallel merge operation

Definition at line 32 of file FeatureFloodCount.C.

Referenced by FeatureFloodCount::serialize(), XFEM::storeMaterialPropertiesForElementHelper(), and TEST().

33 {
38  storeHelper(stream, feature._ghosted_ids, context);
39  storeHelper(stream, feature._halo_ids, context);
40  storeHelper(stream, feature._disjoint_halo_ids, context);
41  storeHelper(stream, feature._periodic_nodes, context);
42  storeHelper(stream, feature._var_index, context);
43  storeHelper(stream, feature._id, context);
44  storeHelper(stream, feature._bboxes, context);
45  storeHelper(stream, feature._orig_ids, context);
46  storeHelper(stream, feature._min_entity_id, context);
47  storeHelper(stream, feature._vol_count, context);
48  storeHelper(stream, feature._centroid, context);
49  storeHelper(stream, feature._status, context);
50  storeHelper(stream, feature._boundary_intersection, context);
51 }
Point _centroid
The centroid of the feature (average of coordinates from entities participating in the volume calcula...
std::vector< BoundingBox > _bboxes
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constrain...
container_type _halo_ids
Holds the ids surrounding the feature.
container_type _ghosted_ids
Holds the ghosted ids for a feature (the ids which will be used for stitching.
container_type _disjoint_halo_ids
Holds halo ids that extend onto a non-topologically connected surface.
void storeHelper(std::ostream &stream, P &data, void *context)
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")
container_type _periodic_nodes
Holds the nodes that belong to the feature on a periodic boundary.
std::list< std::pair< processor_id_type, unsigned int > > _orig_ids
Original processor/local ids.
BoundaryIntersection _boundary_intersection
Enumeration indicating boundary intersection status.
Status _status
The status of a feature (used mostly in derived classes like the GrainTracker)
std::size_t _vol_count
The count of entities contributing to the volume calculation.
unsigned int _id
An ID for this feature.

◆ dataStore() [2/2]

template<>
void dataStore ( std::ostream &  stream,
BoundingBox &  bbox,
void context 
)

Definition at line 55 of file FeatureFloodCount.C.

56 {
57  storeHelper(stream, bbox.min(), context);
58  storeHelper(stream, bbox.max(), context);
59 }
void storeHelper(std::ostream &stream, P &data, void *context)

◆ operator<<()

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

Definition at line 2186 of file FeatureFloodCount.C.

2187 {
2188  static const bool debug = true;
2189 
2190  out << "Grain ID: ";
2191  if (feature._id != FeatureFloodCount::invalid_id)
2192  out << feature._id;
2193  else
2194  out << "invalid";
2195 
2196  if (debug)
2197  {
2198  out << "\nGhosted Entities: ";
2199  for (auto ghosted_id : feature._ghosted_ids)
2200  out << ghosted_id << " ";
2201 
2202  out << "\nLocal Entities: ";
2203  for (auto local_id : feature._local_ids)
2204  out << local_id << " ";
2205 
2206  out << "\nHalo Entities: ";
2207  for (auto halo_id : feature._halo_ids)
2208  out << halo_id << " ";
2209 
2210  out << "\nPeriodic Node IDs: ";
2211  for (auto periodic_node : feature._periodic_nodes)
2212  out << periodic_node << " ";
2213  }
2214 
2215  out << "\nBBoxes:";
2216  for (const auto & bbox : feature._bboxes)
2217  {
2218  out << "\nMax: " << bbox.max() << " Min: " << bbox.min();
2219  }
2220 
2221  out << "\nStatus: ";
2223  out << "CLEAR";
2224  if (static_cast<bool>(feature._status & FeatureFloodCount::Status::MARKED))
2225  out << " MARKED";
2226  if (static_cast<bool>(feature._status & FeatureFloodCount::Status::DIRTY))
2227  out << " DIRTY";
2228  if (static_cast<bool>(feature._status & FeatureFloodCount::Status::INACTIVE))
2229  out << " INACTIVE";
2230 
2231  if (debug)
2232  {
2233  out << "\nOrig IDs (rank, index): ";
2234  for (const auto & orig_pair : feature._orig_ids)
2235  out << '(' << orig_pair.first << ", " << orig_pair.second << ") ";
2236  out << "\nVar_index: " << feature._var_index;
2237  out << "\nMin Entity ID: " << feature._min_entity_id;
2238  }
2239  out << "\n" << std::endl;
2240 
2241  return out;
2242 }
std::vector< BoundingBox > _bboxes
The vector of bounding boxes completely enclosing this feature (multiple used with periodic constrain...
container_type _halo_ids
Holds the ids surrounding the feature.
container_type _ghosted_ids
Holds the ghosted ids for a feature (the ids which will be used for stitching.
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")
container_type _periodic_nodes
Holds the nodes that belong to the feature on a periodic boundary.
static const unsigned int invalid_id
container_type _local_ids
Holds the local ids in the interior of a feature.
OStreamProxy out
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)
unsigned int _id
An ID for this feature.

◆ registerMooseObject()

registerMooseObject ( "PhaseFieldApp"  ,
FeatureFloodCount   
)

◆ updateBBoxExtremesHelper() [1/2]

void updateBBoxExtremesHelper ( BoundingBox &  bbox,
const Point &  node 
)

Definition at line 2249 of file FeatureFloodCount.C.

Referenced by FeatureFloodCount::prepareDataForTransfer(), FeatureFloodCount::FeatureData::updateBBoxExtremes(), updateBBoxExtremesHelper(), and FeatureFloodCount::visitElementalNeighbors().

2250 {
2251  for (const auto i : make_range(Moose::dim))
2252  {
2253  bbox.min()(i) = std::min(bbox.min()(i), node(i));
2254  bbox.max()(i) = std::max(bbox.max()(i), node(i));
2255  }
2256 }
static constexpr std::size_t dim
IntRange< T > make_range(T beg, T end)

◆ updateBBoxExtremesHelper() [2/2]

void updateBBoxExtremesHelper ( BoundingBox &  bbox,
const Elem &  elem 
)

Definition at line 2259 of file FeatureFloodCount.C.

2260 {
2261  for (const auto node_n : make_range(elem.n_nodes()))
2262  updateBBoxExtremesHelper(bbox, *(elem.node_ptr(node_n)));
2263 }
IntRange< T > make_range(T beg, T end)
void updateBBoxExtremesHelper(BoundingBox &bbox, const Point &node)