https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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,
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)

◆ dataLoad() [2/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.

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}
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...
container_type _halo_ids
Holds the ids surrounding the feature.
BoundaryIntersection _boundary_intersection
Enumeration indicating boundary intersection status.
container_type _disjoint_halo_ids
Holds halo ids that extend onto a non-topologically connected surface.
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 _var_index
The Moose variable where this feature was found (often the "order parameter")
Point _centroid
The centroid of the feature (average of coordinates from entities participating in the volume calcula...
unsigned int _id
An ID for this feature.
std::size_t _vol_count
The count of entities contributing to the volume calculation.
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.

Referenced by FeatureFloodCount::deserialize().

◆ dataStore() [1/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)

◆ dataStore() [2/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.

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}

Referenced by FeatureFloodCount::serialize().

◆ operator<<()

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

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: ";
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}
static const unsigned int invalid_id
OStreamProxy out(std::cout)

◆ registerMooseObject()

registerMooseObject ( "PhaseFieldApp"  ,
FeatureFloodCount   
)

◆ updateBBoxExtremesHelper() [1/2]

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

Definition at line 2261 of file FeatureFloodCount.C.

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

◆ updateBBoxExtremesHelper() [2/2]

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

Definition at line 2251 of file FeatureFloodCount.C.

2252{
2253 for (const auto i : make_range(Moose::dim))
2254 {
2255 bbox.min()(i) = std::min(bbox.min()(i), node(i));
2256 bbox.max()(i) = std::max(bbox.max()(i), node(i));
2257 }
2258}
unsigned int dim

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