Repository navigation
Synthetic texture generation #2631
Unanswered
karthikp161985
asked this question in
Ask Anything
Replies: 1 comment
|
Hi Karthik, this is a bug in MTEX 7.1.0: with a specimen symmetry passed explicitly to the orientation, ori_basal = orientation.byEuler(0,0,0,CS);
odf_basal = unimodalODF(ori_basal,psi_basal);
ori_basal_sample = discreteSample(odf_basal,2040); % 2040 x 1Ralf. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello MTEX developers,
I am generating a simple synthetic basal texture for α-Ti in MTEX using HCP crystal symmetry and triclinic specimen symmetry.
The ideal basal orientation is 1×1, and the unimodal ODF is also 1×1. I then request 2040 discrete orientations from this ODF using discreteSample. However, instead of obtaining 2040 orientations, MTEX returns a 2040×2040 orientation array:
2040×2040=4,161,600 orientations.
This is also reflected when I export the sampled orientations. I am attaching the code that I use for my calculation for your reference.
Could you please clarify:
Is a 2040 X 2040 orientation array expected from discreteSample when the ODF is defined using crystal symmetry and specimen symmetry?
If not, what is the correct way to obtain exactly 2040 discrete orientations from this unimodal HCP ODF?
Could this behavior be related to array expansion associated with crystal/specimen symmetry handling inside discreteSample?
Thank you in advance,
With regards,
Karthik
clc;
clear;
close all;
setMTEXpref('xAxisDirection','north');
setMTEXpref('zAxisDirection','outOfPlane');
%% =========================================================
% 1. Crystal symmetry
% ==========================================================
CS = crystalSymmetry('6/mmm',[2.95 2.95 4.68], 'X||a*','Y||b', 'Z||c', ...
'mineral','Alpha-Ti in Ti-6Al-4V');
SS = specimenSymmetry('triclinic');
%% =========================================================
% 2. one ideal crystal orientation
% ==========================================================
ori_basal = orientation.byEuler (0degree, 0degree, 0*degree, CS,SS);
%% =========================================================
% 3. Create a continuous ODF around the ideal orientation
% ==========================================================
HW_basal = 20*degree;
psi_basal = SO3vonMisesFisherKernel('halfwidth',HW_basal);
odf_basal = unimodalODF(ori_basal, psi_basal);
%% =========================================================
% 4. Create a discrete orientations from the ODF
% ==========================================================
N_basal = 2040;
rng(42);
ori_basal_sample = discreteSample(odf_basal,N_basal);
%% =========================================================
% 5. Create a ODF from the discrete orientations
% ==========================================================
odf_final = calcDensity(ori_basal_sample,'halfwidth',5*degree);
%% =========================================================
% 5. Defining Euler angles
% ==========================================================
[phi1_basal,Phi_basal,phi2_basal] = Euler(ori_basal_sample);
phi1_deg = [phi1_basal(:)] / degree;
Phi_deg = [Phi_basal(:)] / degree;
phi2_deg = [phi2_basal(:)] / degree;
%% =========================================================
% 5. Defining Euler angles
% ==========================================================
[phi1_basal,Phi_basal,phi2_basal] = Euler(ori_basal_sample);
phi1_deg = phi1_basal(:) / degree;
Phi_deg = Phi_basal(:) / degree;
phi2_deg = phi2_basal(:) / degree;
%% =========================================================
% 6. Component labels and weights
% ==========================================================
N_actual = numel(ori_basal_sample);
ID = (1:N_actual)';
component_id = repmat("Basal",N_actual,1);
Weight = ones(N_actual,1) / N_actual;
%% =========================================================
% 7. Export VPSC input CSV
% ==========================================================
OutputTable = table(ID,component_id,phi1_deg,Phi_deg,phi2_deg,Weight, ...
'VariableNames',{'ID','component_id','phi1_deg','Phi_deg','phi2_deg','Weight'});
output_filename = 'Basal_texture.csv';
writetable(OutputTable,output_filename);
fprintf('CSV written: %s\n',output_filename);
fprintf('Total orientations = %d\n',height(OutputTable));
fprintf('Sum of weights = %.10f\n\n',sum(OutputTable.Weight));
%% =========================================================
% 8. Plotting of Pole figure
% ==========================================================
h = [Miller(0,0,0,1,CS), Miller(1,0,-1,0,CS)];
plotPDF(odf_final,h, 'antipodal', 'contourf');
mtexColorbar;
All reactions