Go to the documentation of this file.
14 #include "libmesh/dense_matrix.h"
45 std::vector<unsigned int> & grains)
const = 0;
69 virtual Real
getVariableValue(
unsigned int op_index,
const Point & p)
const = 0;
100 virtual void execute()
override;
104 virtual bool areFeaturesMergeable(
const FeatureData & f1,
const FeatureData & f2)
const override;
106 std::size_t & current_index,
107 FeatureData *& feature,
109 unsigned int & new_id)
override;
131 bool isGraphValid(
unsigned int vertex,
unsigned int color);
145 const unsigned int _dim;
virtual bool areFeaturesMergeable(const FeatureData &f1, const FeatureData &f2) const override
Method for determining whether two features are mergeable.
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...
virtual void mergeSets() override
This routine is called on the master rank only and stitches together the partial feature pieces seen ...
virtual void finalize() override
virtual void initialize() override
virtual void execute() override
static MooseEnum coloringAlgorithms()
Returns all available coloring algorithms as an enumeration type for input files.
Status
This enumeration is used to indicate status of the grains in the _unique_grains data structure.
std::vector< unsigned int > _grain_to_op
A vector indicating which op is assigned to each grain.
const unsigned int _op_num
The maximum number of order parameters (colors) available to assign to the grain structure.
bool colorGraph(unsigned int vertex)
Built-in simple "back-tracking" algorithm to assign colors to a graph.
This object will mark nodes or elements of continuous regions all with a unique number for the purpos...
virtual void initialSetup() override
UserObject interface overrides.
PolycrystalUserObjectBase(const InputParameters ¶meters)
std::map< dof_id_type, std::vector< unsigned int > > _entity_to_grain_cache
void assignOpsToGrains()
Method that runs a coloring algorithm to assign OPs to grains.
This object provides the base capability for creating proper polycrystal ICs.
const PerfID _finalize_timer
std::vector< unsigned int > _prealloc_tmp_grains
Temporary storage area for current grains at a point to avoid memory churn.
const bool _output_adjacency_matrix
A user controllable Boolean which can be used to print the adjacency matrix to the console.
virtual unsigned int getNumGrains() const =0
Must be overridden by the deriving class to provide the number of grains in the polycrystal structure...
const PerfID _execute_timer
Timers.
void buildGrainAdjacencyMatrix()
Builds a dense adjacency matrix based on the discovery of grain neighbors and halos surrounding each ...
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.
virtual void precomputeGrainStructure()
This callback is triggered after the object is initialized and may be optionally overridden to do pre...
const MooseEnum _coloring_algorithm
The selected graph coloring algorithm used by this object.
void printGrainAdjacencyMatrix() const
Prints out the adjacency matrix in a nicely spaced integer format.
std::unique_ptr< DenseMatrix< Real > > _adjacency_matrix
The dense adjacency matrix.
static const unsigned int INVALID_COLOR
Used to indicate an invalid coloring for the built-in back-tracking algorithm.
const unsigned int _dim
mesh dimension
InputParameters validParams< PolycrystalUserObjectBase >()
bool isGraphValid(unsigned int vertex, unsigned int color)
Helper method for the back-tracking graph coloring algorithm.
virtual Real getVariableValue(unsigned int op_index, const Point &p) const =0
Returns the variable value for a given op_index and mesh point.
bool _colors_assigned
A Boolean indicating whether the object has assigned colors to grains (internal use)
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...
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.
static const unsigned int HALO_THICKNESS
Used to hold the thickness of the halo that should be constructed for detecting adjacency.
virtual const std::vector< unsigned int > & getGrainToOps() const
Method for retrieving the initial grain OP assignments.
static std::string coloringAlgorithmDescriptions()
Returns corresponding descriptions of available coloring algorithms.