Go to the documentation of this file.
20 params.addClassDescription(
"Object for setting up a polycrystal structure from an EBSD Datafile");
21 params.addParam<
unsigned int>(
"phase",
"The phase to use for all queries.");
22 params.addParam<UserObjectName>(
"ebsd_reader",
"EBSD Reader for initial condition");
28 _phase(isParamValid(
"phase") ? getParam<unsigned int>(
"phase") :
libMesh::invalid_uint),
29 _ebsd_reader(getUserObject<
EBSDReader>(
"ebsd_reader")),
30 _node_to_grain_weight_map(_ebsd_reader.getNodeToGrainWeightMap())
36 std::vector<unsigned int> & grains)
const
52 grains[0] =
_phase != libMesh::invalid_uint ? local_id : global_id;
58 if (
_phase != libMesh::invalid_uint)
71 mooseError(
"The following node id is not in the node map: ", n.id());
76 for (MooseIndex(num_grains) index = 0; index < num_grains; ++index)
83 mooseAssert(grain_index < it->second.size(),
"grain_index out of range");
84 auto value = (it->second)[grain_index];
95 std::vector<unsigned int> grain_ids;
98 if (grain_ids.empty())
101 mooseAssert(grain_ids.size() == 1,
"Expected only one grain at point in EBSDReader");
102 auto index = grain_ids[0];
103 mooseAssert(index <
_grain_to_op.size(),
"Index out of range");
virtual unsigned int getNumGrains() const override
Must be overridden by the deriving class to provide the number of grains in the polycrystal structure...
virtual unsigned int getGlobalID(unsigned int phase, unsigned int local_id) const
Return the (global) grain id for a given phase and (local) grain number.
std::vector< unsigned int > _grain_to_op
A vector indicating which op is assigned to each grain.
const std::map< dof_id_type, std::vector< Real > > & _node_to_grain_weight_map
const EBSDReader & _ebsd_reader
virtual void getGrainsBasedOnPoint(const Point &point, std::vector< unsigned int > &grains) const override
Method for retrieving active grain IDs based on some point in the mesh.
This object provides the base capability for creating proper polycrystal ICs.
virtual unsigned int getGrainNum() const
Return the total number of grains.
const unsigned int _phase
registerMooseObject("PhaseFieldApp", PolycrystalEBSD)
A GeneralUserObject that reads an EBSD file and stores the centroid data in a data structure which in...
virtual Real getVariableValue(unsigned int op_index, const Point &p) const override
Returns the variable value for a given op_index and mesh point.
unsigned int _feature_id
EBSD feature id, (gklobal) grain number, symmetry, and phase data.
Per element EBSD data point.
const EBSDAvgData & getAvgData(unsigned int i) const
Get the requested type of average data for (global) grain number i.
InputParameters validParams< PolycrystalUserObjectBase >()
const EBSDPointData & getData(const Point &p) const
Get the requested type of data at the point p.
virtual Real getNodalVariableValue(unsigned int op_index, const Node &n) const override
Similarly to the getVariableValue method, this method also returns values but may be optimized for re...
PolycrystalEBSD(const InputParameters ¶meters)
InputParameters validParams< PolycrystalEBSD >()
unsigned int _local_id
Index in the per-phase list of global IDs.