Go to the documentation of this file.
22 InputParameters params = validParams<AuxKernel>();
23 params.addClassDescription(
"Output RGB representation of crystal orientation from user object to "
24 "an AuxVariable. The entire domain must have the same crystal "
26 params.addParam<
unsigned int>(
"phase",
"The phase to use for all queries.");
27 MooseEnum sd_enum = MooseEnum(
"100=1 010=2 001=3",
"001");
28 params.addParam<MooseEnum>(
"sd", sd_enum,
"Reference sample direction");
29 MooseEnum structure_enum = MooseEnum(
30 "cubic=43 hexagonal=62 tetragonal=42 trigonal=32 orthorhombic=22 monoclinic=2 triclinic=1");
31 params.addRequiredParam<MooseEnum>(
32 "crystal_structure", structure_enum,
"Crystal structure of the material");
33 MooseEnum output_types = MooseEnum(
"red green blue scalar",
"scalar");
34 params.addParam<MooseEnum>(
"output_type", output_types,
"Type of value that will be outputted");
35 params.addRequiredParam<UserObjectName>(
"euler_angle_provider",
36 "Name of Euler angle provider user object");
37 params.addRequiredParam<UserObjectName>(
"grain_tracker",
38 "The GrainTracker UserObject to get values from.");
39 params.addParam<Point>(
42 "RGB value of color used to represent area with no grains, defaults to black");
47 : AuxKernel(parameters),
48 _phase(isParamValid(
"phase") ? getParam<unsigned int>(
"phase") :
libMesh::invalid_uint),
49 _sd(getParam<MooseEnum>(
"sd")),
50 _xtal_class(getParam<MooseEnum>(
"crystal_structure")),
51 _output_type(getParam<MooseEnum>(
"output_type")),
53 _ebsd_reader(isParamValid(
"phase") ? dynamic_cast<const
EBSDReader *>(&_euler) : nullptr),
55 _no_grain_color(getParam<Point>(
"no_grain_color"))
62 if (
_phase != libMesh::invalid_uint)
92 if (global_id > num_grns)
93 mooseError(
" global_id ", global_id,
" out of index range");
100 angles(0) / 180.0 * libMesh::pi,
101 angles(1) / 180.0 * libMesh::pi,
102 angles(2) / 180.0 * libMesh::pi,
113 for (
unsigned int i = 0; i < 3; ++i)
114 RGBint = 256 * RGBint + (RGB(i) >= 1 ? 255 : std::floor(RGB(i) * 256.0));
118 mooseError(
"Incorrect value for output_type in EulerAngleProvider2RGBAux");
This class defines the interface for the GrainTracking objects.
const GrainTrackerInterface & _grain_tracker
Grain tracker object.
virtual unsigned int getNumGrains() const
InputParameters validParams< EulerAngleProvider2RGBAux >()
const EBSDReader * _ebsd_reader
EBSDReader Object.
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.
const Point _no_grain_color
Vector containing values for color in regions without grains.
const unsigned int _output_type
Type of value to be outputted.
const unsigned int _phase
Optional phase number needed for global grain index retrieval.
registerMooseObject("PhaseFieldApp", EulerAngleProvider2RGBAux)
virtual unsigned int getGrainNum() const
Return the total number of grains.
Abstract base class for user objects that implement the Euler Angle provider interface.
A GeneralUserObject that reads an EBSD file and stores the centroid data in a data structure which in...
Real _value
precalculated element value
virtual unsigned int getGrainNum() const =0
virtual Real computeValue()
const unsigned int _xtal_class
Crystal structure of the sample.
Point euler2RGB(unsigned int sd, Real phi1, Real PHI, Real phi2, unsigned int phase, unsigned int sym)
This function rotates a set of three Bunge Euler angles into the standard Stereographic triangle,...
virtual Real getEntityValue(dof_id_type entity_id, FeatureFloodCount::FieldType, std::size_t var_index=0) const =0
Accessor for retrieving either nodal or elemental information (unique grains or variable indicies)
Output euler angles from user object to an AuxVariable.
EulerAngleProvider2RGBAux(const InputParameters ¶meters)
const EulerAngleProvider & _euler
Object providing the Euler angles.
const unsigned int _sd
Reference direction of the sample.
virtual const EulerAngles & getEulerAngles(unsigned int) const =0
virtual void precalculateValue()