Go to the documentation of this file.
15 #include "libmesh/bounding_box.h"
32 virtual void execute()
override;
63 std::size_t var_index = 0)
const override;
64 virtual const std::vector<unsigned int> &
66 virtual unsigned int getFeatureVar(
unsigned int feature_id)
const override;
76 virtual Real
getThreshold(std::size_t current_index)
const override;
128 std::vector<std::list<GrainDistance>> & min_distances);
142 std::size_t new_var_index,
143 std::vector<std::map<Node *, CacheValues>> & cache,
150 std::size_t curr_var_index,
151 std::size_t new_var_index,
152 std::vector<std::map<Node *, CacheValues>> & cache,
160 std::vector<BoundingBox> & bboxes2)
const;
167 std::vector<BoundingBox> & bboxes2)
const;
206 NonlinearSystemBase &
_nl;
249 std::vector<std::pair<dof_id_type, dof_id_type>>
_all_ranges;
268 std::size_t var_index,
269 std::size_t grain_index,
270 unsigned int grain_id);
unsigned int _reserve_grain_first_index
Holds the first unique grain index when using _reserve_op (all the remaining indices are sequential)
virtual Real getEntityValue(dof_id_type node_id, FieldType field_type, std::size_t var_index=0) const override
This class defines the interface for the GrainTracking objects.
const unsigned short _halo_level
The thickness of the halo surrounding each grain.
void assignGrains()
When the tracking phase starts (_t_step == _tracking_step) it assigns a unique id to every FeatureDat...
const bool _error_on_grain_creation
Boolean to terminate with an error if a new grain is created during the simulation.
std::vector< FeatureData > _feature_sets_old
This data structure holds the map of unique grains from the previous time step.
unsigned int _old_max_grain_id
The previous max grain id (needed to figure out which ids are new in a given step)
virtual std::size_t getTotalFeatureCount() const override
Returns the total feature count (active and inactive ids, useful for sizing vectors)
Status
This enumeration is used to indicate status of the grains in the _unique_grains data structure.
virtual void newGrainCreated(unsigned int new_grain_id)
This method is called when a new grain is detected.
const unsigned short _n_reserve_ops
The number of reserved order parameters.
Real boundingRegionDistance(std::vector< BoundingBox > &bboxes1, std::vector< BoundingBox > &bboxes2) const
This method returns the minimum periodic distance between two vectors of bounding boxes.
virtual void updateFieldInfo() override
This method is used to populate any of the data structures used for storing field data (nodal or elem...
virtual bool doesFeatureIntersectBoundary(unsigned int feature_id) const override
Returns a Boolean indicating whether this feature intersects any boundary.
const PerfID _broadcast_update
This struct is used to hold distance information to other grains in the simulation.
This object will mark nodes or elements of continuous regions all with a unique number for the purpos...
virtual std::vector< unsigned int > getNewGrainIDs() const override
This method returns all of the new ids generated in an invocation of the GrainTracker.
void broadcastAndUpdateGrainData()
Broadcast essential Grain information to all processors.
const PolycrystalUserObjectBase * _poly_ic_uo
An optional IC UserObject which can provide initial data structures to this object.
This object provides the base capability for creating proper polycrystal ICs.
void prepopulateState(const FeatureFloodCount &ffc_object)
This method extracts the necessary state from the passed in object necessary to continue tracking gra...
virtual void execute() override
void dataStore(std::ostream &stream, GrainTracker::PartialFeatureData &feature, void *context)
void computeMinDistancesFromGrain(FeatureData &grain, std::vector< std::list< GrainDistance >> &min_distances)
Populates and sorts a min_distances vector with the minimum distances to all grains in the simulation...
void swapSolutionValues(FeatureData &grain, std::size_t new_var_index, std::vector< std::map< Node *, CacheValues >> &cache, RemapCacheMode cache_mode)
A routine for moving all of the solution values from a given grain to a new variable number.
GrainDistance(Real distance, std::size_t var_index)
void dataLoad(std::istream &stream, GrainTracker::PartialFeatureData &feature, void *context)
void swapSolutionValuesHelper(Node *curr_node, std::size_t curr_var_index, std::size_t new_var_index, std::vector< std::map< Node *, CacheValues >> &cache, RemapCacheMode cache_mode)
Helper method for actually performing the swaps.
void trackGrains()
On subsequent time_steps, incoming FeatureData objects are compared to previous time_step information...
virtual void finalize() override
unsigned int & _max_curr_grain_id
Holds the next "regular" grain ID (a grain found or remapped to the standard op vars)
BoundaryIntersection
This enumeration is used to inidacate status of boundary intersections.
const PerfID _finalize_timer
Timers.
std::vector< std::pair< dof_id_type, dof_id_type > > _all_ranges
Data structure to hold element ID ranges when using Distributed Mesh (populated on rank 0 only)
const bool _remap
Inidicates whether remapping should be done or not (remapping is independent of tracking)
InputParameters validParams< GrainTracker >()
NonlinearSystemBase & _nl
A reference to the nonlinear system (used for retrieving solution vectors)
Real centroidRegionDistance(std::vector< BoundingBox > &bboxes1, std::vector< BoundingBox > &bboxes2) const
This method returns the minimum periodic distance between the centroids of two vectors of bounding bo...
bool attemptGrainRenumber(FeatureData &grain, unsigned int depth, unsigned int max_depth)
This is the recursive part of the remapping algorithm.
BoundaryIntersection boundary_intersection
const PerfID _update_field_info
virtual const std::vector< unsigned int > & getVarToFeatureVector(dof_id_type elem_id) const override
Returns a list of active unique feature ids for a particular element.
const bool _is_transient
Boolean to indicate whether this is a Steady or Transient solve.
bool operator<(const GrainDistance &rhs) const
void communicateHaloMap()
GrainTracker(const InputParameters ¶meters)
const int _tracking_step
The timestep to begin tracking grains.
const std::size_t _reserve_op_index
The cutoff index where if variable index >= this number, no remapping TO that variable will occur.
const unsigned short _max_remap_recursion_depth
Depth of renumbering recursion (a depth of zero means no recursion)
virtual Point getGrainCentroid(unsigned int grain_id) const override
Returns the centroid for the given grain number.
virtual void initialize() override
GrainDistance & operator=(const GrainDistance &f)=default
virtual Real getThreshold(std::size_t current_index) const override
Return the starting comparison threshold to use when inspecting an entity during the flood stage.
const Real _reserve_op_threshold
The threshold above (or below) where a grain may be found on a reserve op field.
virtual unsigned int getFeatureVar(unsigned int feature_id) const override
Returns the variable representing the passed in feature.
const PerfID _track_grains
const short _verbosity_level
Verbosity level controlling the amount of information printed to the console.
void remapGrains()
This method is called after trackGrains to remap grains that are too close to each other.
const bool _tolerate_failure
Indicates whether we should continue after a remap failure (will result in non-physical results)
unsigned int getNextUniqueID()
Retrieve the next unique grain number if a new grain is detected during trackGrains.
virtual std::size_t getNumberActiveGrains() const override
Returns the number of active grains current stored in the GrainTracker.
const PerfID _remap_timer
virtual bool isFeaturePercolated(unsigned int feature_id) const override
Returns a Boolean indicating whether this feature is percolated (e.g.
virtual bool doesFeatureIntersectSpecifiedBoundary(unsigned int feature_id) const override
Returns a Boolean indicating whether this feature intersects boundaries in a user-supplied list.
virtual void meshChanged() override
bool & _first_time
Boolean to indicate the first time this object executes.