https://mooseframework.inl.gov
Loading...
Searching...
No Matches
EBSDAccessFunctors.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "MooseObject.h"
13#include "MooseEnum.h"
14#include "EulerAngles.h"
15
16#include "libmesh/point.h"
17
24{
25public:
28 {
30 Real _phi1;
31 Real _Phi;
32 Real _phi2;
34
36 Point _p;
37
39 unsigned int _feature_id;
40 unsigned int _phase;
41 unsigned int _symmetry;
43
45 std::vector<Real> _custom;
46 };
47
50 {
53
55 unsigned int _feature_id;
56 unsigned int _phase;
57 unsigned int _symmetry;
59
61 unsigned int _local_id;
62
64 unsigned int _n;
65
67 Point _p;
68
70 std::vector<Real> _custom;
71 };
72
75
78 {
79 virtual Real operator()(const EBSDPointData &) = 0;
81 };
84 {
85 virtual Real operator()(const EBSDAvgData &) = 0;
87 };
88
89 // List of specialized access functors (one for each field in EBSDPointData)
91 {
92 virtual Real operator()(const EBSDPointData & d) { return d._phi1; };
93 };
95 {
96 virtual Real operator()(const EBSDPointData & d) { return d._Phi; };
97 };
99 {
100 virtual Real operator()(const EBSDPointData & d) { return d._phi2; };
101 };
103 {
104 virtual Real operator()(const EBSDPointData & d) { return d._feature_id; };
105 };
107 {
108 virtual Real operator()(const EBSDPointData & d) { return d._phase; };
109 };
111 {
112 virtual Real operator()(const EBSDPointData & d) { return d._symmetry; };
113 };
115 {
116 EBSDPointDataCustom(unsigned int index) : _index(index) {}
117 virtual Real operator()(const EBSDPointData & d)
118 {
119 mooseAssert(_index < d._custom.size(),
120 "Requesting out of bounds index in EBSDPointDataCustom.");
121 return d._custom[_index];
122 };
123 const unsigned int _index;
124 };
125
126 // List of specialized access functors (one for each field in EBSDAvgData)
128 {
129 virtual Real operator()(const EBSDAvgData & a) { return a._angles->phi1; };
130 };
132 {
133 virtual Real operator()(const EBSDAvgData & a) { return a._angles->Phi; };
134 };
136 {
137 virtual Real operator()(const EBSDAvgData & a) { return a._angles->phi2; };
138 };
140 {
141 virtual Real operator()(const EBSDAvgData & a) { return a._phase; };
142 };
144 {
145 virtual Real operator()(const EBSDAvgData & a) { return a._symmetry; };
146 };
148 {
149 virtual Real operator()(const EBSDAvgData & a) { return a._local_id; };
150 };
152 {
153 virtual Real operator()(const EBSDAvgData & a) { return a._feature_id; };
154 };
156 {
157 EBSDAvgDataCustom(unsigned int index) : _index(index) {}
158 virtual Real operator()(const EBSDAvgData & a)
159 {
160 mooseAssert(_index < a._custom.size(),
161 "Requesting out of bounds index in EBSDPointDataCustom.");
162 return a._custom[_index];
163 };
164 const unsigned int _index;
165 };
166};
Mix-in class that adds so called access functors to select a field from an EBSDPointData or EBSDPoint...
static MooseEnum getPointDataFieldType()
static MooseEnum getAvgDataFieldType()
Euler angle triplet.
Definition EulerAngles.h:25
virtual Real operator()(const EBSDAvgData &a)
virtual Real operator()(const EBSDAvgData &a)
Access functor base class for EBSDAvgData.
virtual Real operator()(const EBSDAvgData &)=0
virtual Real operator()(const EBSDAvgData &a)
virtual Real operator()(const EBSDAvgData &a)
virtual Real operator()(const EBSDAvgData &a)
virtual Real operator()(const EBSDAvgData &a)
virtual Real operator()(const EBSDAvgData &a)
virtual Real operator()(const EBSDAvgData &a)
unsigned int _n
Number of EBSD data points in the global grain.
EulerAngles * _angles
Averaged Euler angles.
unsigned int _local_id
Index in the per-phase list of global IDs.
std::vector< Real > _custom
Grain averaged custom data columns.
unsigned int _feature_id
EBSD grain, symmetry, and phase data.
Point _p
Center of mass for the global grain.
virtual Real operator()(const EBSDPointData &d)
virtual Real operator()(const EBSDPointData &d)
Access functor base class for EBSDPointData.
virtual Real operator()(const EBSDPointData &)=0
virtual Real operator()(const EBSDPointData &d)
virtual Real operator()(const EBSDPointData &d)
virtual Real operator()(const EBSDPointData &d)
virtual Real operator()(const EBSDPointData &d)
virtual Real operator()(const EBSDPointData &d)
Per element EBSD data point.
unsigned int _feature_id
EBSD feature id, (gklobal) grain number, symmetry, and phase data.
std::vector< Real > _custom
Custom data columns.
Point _p
Element centroid position.