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;
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;
265 std::size_t var_index,
266 std::size_t grain_index,
267 unsigned int grain_id);
void remapGrains()
This method is called after trackGrains to remap grains that are too close to each other...
virtual bool doesFeatureIntersectBoundary(unsigned int feature_id) const override
Returns a Boolean indicating whether this feature intersects any boundary.
void dataLoad(std::istream &stream, GrainTracker::PartialFeatureData &feature, void *context)
virtual std::vector< unsigned int > getNewGrainIDs() const override
This method returns all of the new ids generated in an invocation of the GrainTracker.
This class defines the interface for the GrainTracking objects.
virtual void execute() override
virtual bool isFeaturePercolated(unsigned int feature_id) const override
Returns a Boolean indicating whether this feature is percolated (e.g.
virtual void meshChanged() override
Status
This enumeration is used to indicate status of the grains in the _unique_grains data structure...
bool & _first_time
Boolean to indicate the first time this object executes.
std::vector< FeatureData > _feature_sets_old
This data structure holds the map of unique grains from the previous time step.
const bool _error_on_grain_creation
Boolean to terminate with an error if a new grain is created during the simulation.
void trackGrains()
On subsequent time_steps, incoming FeatureData objects are compared to previous time_step information...
This object provides the base capability for creating proper polycrystal ICs.
unsigned int _old_max_grain_id
The previous max grain id (needed to figure out which ids are new in a given step) ...
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.
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) ...
virtual std::size_t getTotalFeatureCount() const override
Returns the total feature count (active and inactive ids, useful for sizing vectors) ...
Real distance(const Point &p)
const PolycrystalUserObjectBase *const _poly_ic_uo
An optional IC UserObject which can provide initial data structures to this object.
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...
This struct is used to hold distance information to other grains in the simulation.
NonlinearSystemBase & _nl
A reference to the nonlinear system (used for retrieving solution vectors)
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...
const Real _bound_value
Absolute value of the lower bound used to represent a region not assigned to this grain...
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.
void communicateHaloMap()
GrainTracker(const InputParameters ¶meters)
BoundaryIntersection boundary_intersection
GrainDistance & operator=(const GrainDistance &f)=default
Real f(Real x)
Test function for Brents method.
void prepopulateState(const FeatureFloodCount &ffc_object)
This method extracts the necessary state from the passed in object necessary to continue tracking gra...
void broadcastAndUpdateGrainData()
Broadcast essential Grain information to all processors.
GrainDistance(Real distance, std::size_t var_index)
BoundaryIntersection
This enumeration is used to inidacate status of boundary intersections.
This object will mark nodes or elements of continuous regions all with a unique number for the purpos...
const Real _reserve_op_threshold
The threshold above (or below) where a grain may be found on a reserve op field.
virtual void initialize() override
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...
const short _verbosity_level
Verbosity level controlling the amount of information printed to the console.
void dataStore(std::ostream &stream, GrainTracker::PartialFeatureData &feature, void *context)
virtual std::size_t getNumberActiveGrains() const override
Returns the number of active grains current stored in the GrainTracker.
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) ...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const bool _remap
Inidicates whether remapping should be done or not (remapping is independent of tracking) ...
bool attemptGrainRenumber(FeatureData &grain, unsigned int depth, unsigned int max_depth)
This is the recursive part of the remapping algorithm.
static InputParameters validParams()
const bool _is_transient
Boolean to indicate whether this is a Steady or Transient solve.
virtual bool doesFeatureIntersectSpecifiedBoundary(unsigned int feature_id) const override
Returns a Boolean indicating whether this feature intersects boundaries in a user-supplied list...
const InputParameters & parameters() const
void assignGrains()
When the tracking phase starts (_t_step == _tracking_step) it assigns a unique id to every FeatureDat...
bool operator<(const GrainDistance &rhs) const
const int _tracking_step
The timestep to begin tracking grains.
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
const unsigned short _halo_level
The thickness of the halo surrounding each grain.
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 unsigned int getFeatureVar(unsigned int feature_id) const override
Returns the variable representing the passed in feature.
virtual void newGrainCreated(unsigned int new_grain_id)
This method is called when a new grain is detected.
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 _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.
const unsigned short _n_reserve_ops
The number of reserved order parameters.