42 std::vector<unsigned int> & grains)
const = 0;
91 virtual void execute()
override;
95 virtual bool areFeaturesMergeable(
const FeatureData & f1,
const FeatureData & f2)
const override;
97 std::size_t & current_index,
98 FeatureData *& feature,
100 unsigned int & new_id)
override;
125 bool isGraphValid(
unsigned int vertex,
unsigned int color);
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.
const InputParameters & parameters() const
This object provides the base capability for creating proper polycrystal ICs.
const unsigned int _op_num
The maximum number of order parameters (colors) available to assign to the grain structure.
virtual void initialize() override
virtual void getGrainsBasedOnElem(const Elem &elem, std::vector< unsigned int > &grains) const
This method may be defined in addition to the point based initialization to speed up lookups.
std::unique_ptr< DenseMatrix< Real > > _adjacency_matrix
The dense adjacency matrix.
static const unsigned int HALO_THICKNESS
Used to hold the thickness of the halo that should be constructed for detecting adjacency.
static std::string coloringAlgorithmDescriptions()
Returns corresponding descriptions of available coloring algorithms.
virtual bool areFeaturesMergeable(const FeatureData &f1, const FeatureData &f2) const override
Method for determining whether two features are mergeable.
void buildGrainAdjacencyMatrix()
Builds a dense adjacency matrix based on the discovery of grain neighbors and halos surrounding each ...
void assignOpsToGrains()
Method that runs a coloring algorithm to assign OPs to grains.
virtual unsigned int getNumGrains() const =0
Must be overridden by the deriving class to provide the number of grains in the polycrystal structure...
processor_id_type _num_chunks
The number of chunks (for merging the features together)
virtual void getGrainsBasedOnPoint(const Point &point, std::vector< unsigned int > &grains) const =0
Method for retrieving active grain IDs based on some point in the mesh.
std::map< dof_id_type, std::vector< unsigned int > > _entity_to_grain_cache
const bool _output_adjacency_matrix
A user controllable Boolean which can be used to print the adjacency matrix to the console.
std::vector< unsigned int > _grain_idx_to_op
A vector indicating which op is assigned to each grain (by index of the grain)
virtual Real getNodalVariableValue(unsigned int op_index, const Node &n) const
Similarly to the getVariableValue method, this method also returns values but may be optimized for re...
bool colorGraph(unsigned int vertex)
Built-in simple "back-tracking" algorithm to assign colors to a graph.
virtual void mergeSets() override
This routine is called on the primary rank only and stitches together the partial feature pieces seen...
std::map< unsigned int, unsigned int > _grain_to_op
A map of the grain_id to op.
bool isGraphValid(unsigned int vertex, unsigned int color)
Helper method for the back-tracking graph coloring algorithm.
virtual void execute() override
static MooseEnum coloringAlgorithms()
virtual bool isNewFeatureOrConnectedRegion(const DofObject *dof_object, std::size_t ¤t_index, FeatureData *&feature, Status &status, unsigned int &new_id) override
Method called during the recursive flood routine that should return whether or not the current entity...
static InputParameters validParams()
virtual void prepareDataForTransfer() override
This routine uses the local flooded data to build up the local feature data structures (_partial feat...
virtual void precomputeGrainStructure()
This callback is triggered after the object is initialized and may be optionally overridden to do pre...
void printGrainAdjacencyMatrix() const
Prints out the adjacency matrix in a nicely spaced integer format.
virtual Real getVariableValue(unsigned int op_index, const Point &p) const =0
Returns the variable value for a given op_index and mesh point.
virtual void initialSetup() override
UserObject interface overrides.
virtual void finalize() override
std::vector< unsigned int > _prealloc_tmp_grains
Temporary storage area for current grains at a point to avoid memory churn.
const MooseEnum _coloring_algorithm
The selected graph coloring algorithm used by this object.
bool _colors_assigned
A Boolean indicating whether the object has assigned colors to grains (internal use)
const unsigned int _dim
mesh dimension
virtual void restoreOriginalDataStructures(std::vector< std::list< FeatureData > > &orig) override
virtual processor_id_type numberOfDistributedMergeHelpers() const override
Returns a number indicating the number of merge helpers when running in parallel based on certain imp...
static const unsigned int INVALID_COLOR
Used to indicate an invalid coloring for the built-in back-tracking algorithm.