7 #ifndef HPP_CASESUTILS_H 8 #define HPP_CASESUTILS_H 32 F(0,1) = shear_rate*t;
66 F(0,0) = std::exp(-0.5*comp_rate*t);
67 F(1,1) = std::exp(-0.5*comp_rate*t);
68 F(2,2) = std::exp(1.0*comp_rate*t);
86 L(0,0) = -0.5*comp_rate;
87 L(1,1) = -0.5*comp_rate;
88 L(2,2) = 1.0*comp_rate;
103 template <
typename U>
106 F(0,0) = std::exp(1.0*comp_rate*t);
108 F(2,2) = std::exp(-1.0*comp_rate*t);
122 template <
typename U>
125 L(0,0) = 1.0*comp_rate;
126 L(2,2) = -1.0*comp_rate;
137 template <
typename U>
150 template <
typename U>
164 template <
typename U>
197 template <
typename U>
224 template <
typename U>
240 U theta = iTheta*dTheta;
249 iTheta = iTheta % nTheta;
279 template <
typename U>
287 explicit Experiment(std::string experimentName);
291 std::function<Tensor2<U>(U)> F_of_t;
296 std::function<Tensor2<U>(U)> L_of_t;
305 this->orientationGenerator->generateNext(angles);
313 std::function<Tensor2<U>(U)>
getF_of_t()
const {
return F_of_t;}
314 std::function<Tensor2<U>(U)>
getL_of_t()
const {
return L_of_t;}
Tensor2< U > staticDeformationGradient(U t)
The deformation gradient for no deformation.
Definition: casesUtils.h:138
virtual void generateNext(Tensor2< U > &rotMatrix)
Generate the next orientation in the sequence.
Definition: casesUtils.h:257
U getTEnd() const
Definition: casesUtils.h:311
Tensor2< U > simpleCompressionDeformationGradient(U t, U comp_rate)
The deformation gradient from a simple compression.
Definition: casesUtils.h:64
An abstract class for reproducibly generating a sequence of orientations.
Definition: casesUtils.h:165
virtual void generateNext(Tensor2< U > &rotMatrix)=0
Generate the next orientation in the sequence.
U getStrainRate() const
Definition: casesUtils.h:312
RandomOrientationGenerator()
Default constructor.
Definition: casesUtils.h:203
Definition: casesUtils.cpp:4
Tensor2< T > EulerZXZRotationMatrix(T alpha, T beta, T gamma)
Definition: rotation.h:118
virtual void generateNext(EulerAngles< U > &angles)
Generate the next orientation in the sequence.
Definition: casesUtils.h:238
U dTheta
the spacing between azimuthal angles on the grid
Definition: casesUtils.h:268
Generates orientations on a fixed grid over an azimuthal angle of and a zenithal angle of ...
Definition: casesUtils.h:225
EulerAngles< U > generateNextOrientationAngles()
Definition: casesUtils.h:303
Tensor2< U > planeStrainCompressionDeformationGradient(U t, U comp_rate)
The deformation gradient from a plane strain compression.
Definition: casesUtils.h:104
Header file for rotation classes and functions.
int nPhi
the number of grid points for the zenithal angle
Definition: casesUtils.h:265
U strainRate
Definition: casesUtils.h:290
Header file for tensor classes.
std::function< Tensor2< U >U)> getF_of_t() const
Definition: casesUtils.h:313
A class for reproducibly generating a sequence of random orientations.
Definition: casesUtils.h:198
virtual void generateNext(EulerAngles< U > &angles)
Generate the next orientation in the sequence.
Definition: casesUtils.h:178
U tEnd
the end time of the experiment
Definition: casesUtils.h:289
Tensor2< U > simpleCompressionVelocityGradient(U t, U comp_rate)
The velocity gradient from a simple compression.
Definition: casesUtils.h:84
Tensor2< U > planeStrainCompressionVelocityGradient(U t, U comp_rate)
The velocity gradient from a plane strain compression.
Definition: casesUtils.h:123
void generateNextOrientationInPlace(Tensor2< U > &rotMatrix)
Definition: casesUtils.h:301
EulerAngles< T > polarToEuler(T theta, T phi)
Convert polar angles to Euler angles.
Definition: rotation.h:76
void generateNextOrientationInPlace(EulerAngles< U > &angles)
Definition: casesUtils.h:302
U tStart
the start time of the experiment
Definition: casesUtils.h:288
Tensor2< U > simpleShearDeformationGradient(U t, U shear_rate)
The deformation gradient from a simple shear.
Definition: casesUtils.h:30
virtual void generateNext(Tensor2< U > &rotMatrix)
Generate the next orientation in the sequence.
Definition: casesUtils.h:209
std::shared_ptr< OrientationGenerator< U > > orientationGenerator
the generator of crystal orientations for the experiment
Definition: casesUtils.h:298
int nTheta
the number of grid points for the azimuthal angle
Definition: casesUtils.h:261
Tensor2< U > simpleShearVelocityGradient(U t, U shear_rate)
The velocity gradient from a simple shear.
Definition: casesUtils.h:46
std::function< Tensor2< U >U)> getL_of_t() const
Definition: casesUtils.h:314
U getTStart() const
Definition: casesUtils.h:310
Tensor2< U > staticVelocityGradient(U t)
The velocity gradient for no deformation.
Definition: casesUtils.h:151
U dPhi
the spacing between zenithal angles on the grid
Definition: casesUtils.h:269
EulerAngles< T > getEulerZXZAngles(Tensor2< T > R)
Get Euler angles from rotation matrix.
Definition: rotation.h:149
Definition: casesUtils.h:280
void randomRotationTensorInPlace(unsigned int dim, Tensor2< T > &A, bool defaultSeed=false)
Generate a random rotation tensor.
Definition: rotation.h:321
Definition: rotation.h:43
virtual ~OrientationGenerator()
Default destructor.
Definition: casesUtils.h:186