19 params.
addClassDescription(
"Object for setting up a polycrystal structure from an EBSD Datafile");
20 params.
addParam<
unsigned int>(
"phase",
"The phase to use for all queries.");
21 params.
addParam<UserObjectName>(
"ebsd_reader",
"EBSD Reader for initial condition");
27 _phase(isParamValid(
"phase") ? getParam<unsigned
int>(
"phase") :
libMesh::invalid_uint),
28 _ebsd_reader(getUserObject<
EBSDReader>(
"ebsd_reader")),
29 _node_to_grain_weight_map(_ebsd_reader.getNodeToGrainWeightMap())
35 std::vector<unsigned int> & grains)
const
70 mooseError(
"The following node id is not in the node map: ", n.id());
75 for (MooseIndex(num_grains) index = 0; index < num_grains; ++index)
82 mooseAssert(grain_index < it->second.size(),
"grain_index out of range");
83 auto value = (it->second)[grain_index];
94 std::vector<unsigned int> grain_ids;
97 if (grain_ids.empty())
100 mooseAssert(grain_ids.size() == 1,
"Expected only one grain at point in EBSDReader");
101 auto index = grain_ids[0];
registerMooseObject("PhaseFieldApp", PolycrystalEBSD)
void ErrorVector unsigned int
A GeneralUserObject that reads an EBSD file and stores the centroid data in a data structure which in...
const EBSDPointData & getData(const Point &p) const
Get the requested type of data at the point p.
virtual unsigned int getGrainNum() const
Return the total number of grains.
const EBSDAvgData & getAvgData(unsigned int i) const
Get the requested type of average data for (global) grain number i.
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.
void mooseError(Args &&... args) const
static InputParameters validParams()
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.
virtual Real getVariableValue(unsigned int op_index, const Point &p) const override
Returns the variable value for a given op_index and mesh point.
virtual unsigned int getNumGrains() const override
Must be overridden by the deriving class to provide the number of grains in the polycrystal structure...
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...
const EBSDReader & _ebsd_reader
const std::map< dof_id_type, std::vector< Real > > & _node_to_grain_weight_map
const unsigned int _phase
PolycrystalEBSD(const InputParameters ¶meters)
This object provides the base capability for creating proper polycrystal ICs.
std::map< unsigned int, unsigned int > _grain_to_op
A map of the grain_id to op.
static InputParameters validParams()
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
const unsigned int invalid_uint
unsigned int _local_id
Index in the per-phase list of global IDs.
Per element EBSD data point.