15#include "libmesh/bounding_box.h"
30 virtual void execute()
override;
61 std::size_t var_index = 0)
const override;
62 virtual const std::vector<unsigned int> &
64 virtual unsigned int getFeatureVar(
unsigned int feature_id)
const override;
74 virtual Real
getThreshold(std::size_t current_index)
const override;
126 std::vector<std::list<GrainDistance>> & min_distances);
140 std::size_t new_var_index,
141 std::vector<std::map<Node *, CacheValues>> & cache,
148 std::size_t curr_var_index,
149 std::size_t new_var_index,
150 std::vector<std::map<Node *, CacheValues>> & cache,
158 std::vector<BoundingBox> & bboxes2)
const;
165 std::vector<BoundingBox> & bboxes2)
const;
262 std::size_t var_index,
263 std::size_t grain_index,
264 unsigned int grain_id);
Real f(Real x)
Test function for Brents method.
void dataLoad(std::istream &stream, GrainTracker::PartialFeatureData &feature, void *context)
void dataStore(std::ostream &stream, GrainTracker::PartialFeatureData &feature, void *context)
This object will mark nodes or elements of continuous regions all with a unique number for the purpos...
Status
This enumeration is used to indicate status of the grains in the _unique_grains data structure.
BoundaryIntersection
This enumeration is used to inidacate status of boundary intersections.
This class defines the interface for the GrainTracking objects.
virtual Real getEntityValue(dof_id_type node_id, FieldType field_type, std::size_t var_index=0) const override
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.
bool & _first_time
Boolean to indicate the first time this object executes.
void remapGrains()
This method is called after trackGrains to remap grains that are too close to each other.
unsigned int _old_max_grain_id
The previous max grain id (needed to figure out which ids are new in a given step)
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)
static InputParameters validParams()
virtual void execute() override
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 bool _error_on_grain_creation
Boolean to terminate with an error if a new grain is created during the simulation.
const PolycrystalUserObjectBase *const _poly_ic_uo
An optional IC UserObject which can provide initial data structures to this object.
virtual void updateFieldInfo() override
This method is used to populate any of the data structures used for storing field data (nodal or elem...
bool attemptGrainRenumber(FeatureData &grain, unsigned int depth, unsigned int max_depth)
This is the recursive part of the remapping algorithm.
const Real _reserve_op_threshold
The threshold above (or below) where a grain may be found on a reserve op field.
Real boundingRegionDistance(std::vector< BoundingBox > &bboxes1, std::vector< BoundingBox > &bboxes2) const
This method returns the minimum periodic distance between two vectors of bounding boxes.
void assignGrains()
When the tracking phase starts (_t_step == _tracking_step) it assigns a unique id to every FeatureDat...
unsigned int & _max_curr_grain_id
Holds the next "regular" grain ID (a grain found or remapped to the standard op vars)
virtual std::vector< unsigned int > getNewGrainIDs() const override
This method returns all of the new ids generated in an invocation of the GrainTracker.
virtual std::size_t getTotalFeatureCount() const override
Returns the total feature count (active and inactive ids, useful for sizing vectors)
const unsigned short _n_reserve_ops
The number of reserved order parameters.
const int _tracking_step
The timestep to begin tracking grains.
unsigned int getNextUniqueID()
Retrieve the next unique grain number if a new grain is detected during trackGrains.
void prepopulateState(const FeatureFloodCount &ffc_object)
This method extracts the necessary state from the passed in object necessary to continue tracking gra...
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.
const bool _remap
Inidicates whether remapping should be done or not (remapping is independent of tracking)
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.
void communicateHaloMap()
std::vector< FeatureData > _feature_sets_old
This data structure holds the map of unique grains from the previous time step.
void trackGrains()
On subsequent time_steps, incoming FeatureData objects are compared to previous time_step information...
virtual void meshChanged() override
virtual unsigned int getFeatureVar(unsigned int feature_id) const override
Returns the variable representing the passed in feature.
void broadcastAndUpdateGrainData()
Broadcast essential Grain information to all processors.
virtual void initialize() override
virtual Point getGrainCentroid(unsigned int grain_id) const override
Returns the centroid for the given grain number.
const Real _bound_value
Absolute value of the lower bound used to represent a region not assigned to this grain,...
const std::size_t _reserve_op_index
The cutoff index where if variable index >= this number, no remapping TO that variable will occur.
virtual std::size_t getNumberActiveGrains() const override
Returns the number of active grains current stored in the GrainTracker.
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...
const bool _is_transient
Boolean to indicate whether this is a Steady or Transient solve.
const short _verbosity_level
Verbosity level controlling the amount of information printed to the console.
const unsigned short _max_remap_recursion_depth
Depth of renumbering recursion (a depth of zero means no recursion)
virtual void finalize() override
virtual bool isFeaturePercolated(unsigned int feature_id) const override
Returns a Boolean indicating whether this feature is percolated (e.g.
virtual bool doesFeatureIntersectBoundary(unsigned int feature_id) const override
Returns a Boolean indicating whether this feature intersects any boundary.
const bool _tolerate_failure
Indicates whether we should continue after a remap failure (will result in non-physical results)
virtual void newGrainCreated(unsigned int new_grain_id)
This method is called when a new grain is detected.
unsigned int _reserve_grain_first_index
Holds the first unique grain index when using _reserve_op (all the remaining indices are sequential)
virtual bool doesFeatureIntersectSpecifiedBoundary(unsigned int feature_id) const override
Returns a Boolean indicating whether this feature intersects boundaries in a user-supplied list.
const unsigned short _halo_level
The thickness of the halo surrounding each grain.
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...
const InputParameters & parameters() const
This object provides the base capability for creating proper polycrystal ICs.
This struct is used to hold distance information to other grains in the simulation.
bool operator<(const GrainDistance &rhs) const
GrainDistance(GrainDistance &&f)=default
GrainDistance(const GrainDistance &f)=default
GrainDistance & operator=(const GrainDistance &f)=default
GrainDistance & operator=(GrainDistance &&f)=default
BoundaryIntersection boundary_intersection
Real distance(const Point &p)