forked from tori-miller/Ti64-VPSC-CoRotation-Analysis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
InitializeParameters.m
59 lines (43 loc) · 1.8 KB
/
InitializeParameters.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
%% Add Dependency Folders to Matlab Path
% Path addition with addpath only adds to the path for the current Matlab
% session.
addpath(genpath([pwd filesep 'Analysis']));
addpath(genpath([pwd filesep 'ExternalTools']));
%% Set Crystal Symmetries for alpha and beta phases
CSa = crystalSymmetry('622', [2.95 2.95 4.68], 'X||a', 'Y||b*', 'Z||c', 'color', 'light blue');
CSb = crystalSymmetry('432', [3.24 3.24 3.24], 'mineral', 'Titanium - Beta', 'color', 'light green');
SS = specimenSymmetry('-1');
%Preset Starting Orientations
ori_a0 = orientation('Euler',135*degree,90*degree,325*degree,CSa);
ori_b0 = orientation('Euler',0*degree,0*degree,0*degree,CSb);
% Number of strain states in str_str file
segments = 22;
%If ODF is used instead of deterministic approach
%psi = deLaValeePoussinKernel('halfwidth',5*degree);
%% Generate all loading directions
% In reality, what I am doing is generating rotation matrices to be applied
% to the initial orientation, *not* actually generating a bunch of loading
% directions.
%Set number of degrees between each data point in hemisphere.
% 333 rotations = 10
% 915 rotations = 6
% 1387 rotations = 5
% 2093 rotations = 4
resolution = 10; %degrees
r = plotS2Grid('resolution',resolution*degree,'upper');
%r = equispacedS2Grid('resolution', resolution*degree, 'upper');
rot = rotation('map',zvector,r);
rot2 = rotation('map',r,zvector);
dataSet = length(r(:));
%% Initialize matrices to run faster later
a_prism1 = zeros(41,dataSet);
a_prism2 = zeros(41,dataSet);
a_prism3 = zeros(41,dataSet);
a_basal1 = zeros(41,dataSet);
a_basal2 = zeros(41,dataSet);
a_basal3 = zeros(41,dataSet);
a_pyr = zeros(41,dataSet);
%a_mix2 = zeros(41,dataSet);
%% Initialize Color Maps
white2red = customcolormap([0 1], {'#ff0000', '#ffffff'});
white2blue = customcolormap([0 1], {'#0000ff', '#ffffff'});