Re: Schmid factor mapping

1,171 views
Skip to first unread message

Ralf Hielscher

unread,
May 12, 2013, 4:27:29 PM5/12/13
to mtex...@googlegroups.com
Hi Daniel Breton,

thank you for this good question. We should include this definitely into the documentation. For MTEX 3.4 the procedure is as follows.

First extract the orientations from your ebsd variable
ori = get(ebsd('myPhase'),'orientations')

Next transform the stress tensor from specimen to crystal coordinates. Remember that an orientation transforms from crystal to specimen coordinates, hence we have to take the inverse
sigmaCS = rotate(sigmaZ,inverse(ori))

This gives you a long list of tensors, one for each orientation within the ebsd data set. Next we can compute for all these stress tensors the Schmid factor for the slip system given by m and n
[tauMax,m,n,tau] = calcShearStress(sigmaCS,m,n);

In order to plot the Schmid factor you can follow your approach to create a custom property. But more simply is to directly specify the data to be plotted, i.e.,
plot(ebsd('myPhase'),'property',tauMax)

The same works for grains as well. Here the code in short
ori = get(grains('myPhase'),'orientation')

sigmaCS
= rotate(sigmaZ,inverse(ori))

[tauMax,m,n,tau] = calcShearStress(sigmaCS,m,n);

plot
(grains('myPhase'),'property',tauMax(:))

I hope this helps,

Ralf.

Daniel Breton

unread,
May 14, 2013, 9:24:19 AM5/14/13
to
Dr. Hielscher,

Thanks for your rapid and thorough reply -- I have been able to get things working for grains (which is the important part) but have had less luck with the individual EBSD data points.

I think the problem with individual data points is that the sizes of the 'ebsd' and 'ori' variables are not the same because my EBSD data set has some non-indexed points:
 
>> ebsd
ebsd
= EBSD (show methods, plot)
 
Comment: /home/xyz/ebsd/S27FEB13D/S27FEB13D.cp
 
Properties: bands, bc, bs, error, mad, reliabilityindex, x, y
 
Phase Orientations     Mineral      Color Symmetry Crystal reference frame
     
0         1490  notIndexed                                            
     
4        29195 Ice Ih 100K light blue    6/mmm      X||a*, Y||b, Z||c*
 
>> ori = get(ebsd,'orientations')
 
ori
= orientation (show methods, plot)
  size
: 29195 x 1
  crystal symmetry
: Ice Ih 100K (6/mmm, X||a*, Y||b, Z||c*)
  sample symmetry
: triclinic

so that when I do this, I run into problems:
 
>> sigmaCS = rotate(sigmaY,inverse(ori));
>> [tauMax,m,n,tau] = calcShearStress(sigmaCS,m,n);
>> plot(ebsd,'property',tauMax)
Index exceeds matrix dimensions.

Error in calcColorCode (line 86)
  d
= prop(subset,:);

Error in EBSD/plotspatial (line 70)
   
[d{k},property,opts{k}] = calcColorCode(ebsd,currentPhase,varargin{:});

Error in EBSD/plot (line 26)
  plotspatial
(ax{:},ebsd,varargin{:});


I tried to collect the orientation data with the "keepNotIndexed" option, but this was not the solution.

The mapping of grains, however, works nicely.  I'll document what I have working so far, in case this is of use to future users, see resulting map attached -- this is the same dataset as the map in the first post...

%%%%%% Schmid Factor mapping of GRAINS %%%%%%
%% Load in EBSD dataset
import27FEB13

%% Define crystal symmetry
icecs
=symmetry('6/mmm', [4.4961 4.4961 7.3198], 'X||a*', 'Y||b', 'Z||c*', 'mineral', 'Ice Ih 100K');

%% Generate grains from EBSD data and get mean grain orientations
grains
= calcGrains(ebsd,'threshold',10*degree); origrain = get(grains,'orientation');
% I do not specify a phase here, since I have only ice

%% Define slip system for analysis
m
= Miller(0,0,0,1,icecs); % normal to the slip plane
n
= Miller(1,1,-2,0,icecs); % slip direction in the slip plane

%% Define applied stress
MY
=zeros(3); MY(2,2)=-1; sigmaY = tensor(MY,'name','stress'); % stress parallel to Y specimen axis
 
%% Calculate applied stress in crystal coordinate system for each grain
sigmaCSgrain
= rotate(sigmaY,inverse(origrain));

%% calculate Schmid factors for each grain
[tauMaxgrain,m,n,taugrain] = calcShearStress(sigmaCSgrain,m,n);

%% plot resulting map -- here I use the absolute value of the Schmid factor, since I am only
%  interested in magnitude, not direction
plot
(grains,'property',abs(tauMaxgrain(:)))
colorbar

%% adjust colorbar range as necessary to get 0.5 as maximum and 0 as minimum
%% I did not have much luck with 'colorrange' or 'setcolorrange' in doing these adjustments, so I just used the plot editor -- no doubt there is a better way to do this


Thanks again for your kind assistance,
DAN
iceSchmidmap.png

Ralf Hielscher

unread,
May 13, 2013, 1:35:40 PM5/13/13
to mtex...@googlegroups.com
If you read my post carefully you see that in the plot command restricted the EBSD data set to a specific phase

plot(ebsd('myPhase'),'property',tauMax)

This is exactly for the reason you observed - that the EBSD also contains no indexed data for which we do not have computed a value. In your case this would be

plot(ebsd('Ice'),'property',abs(tauMax))

As for your problem with the colorbar range. Indeed setcolorrange does not yet work for this type of plot. You can use instead

caxis([0,0.5])


Daniel Breton

unread,
May 14, 2013, 9:15:35 AM5/14/13
to
Dr. Hielscher,

First, my apologies for misspelling your name in my last post.

Second, after more carefully following your previous post, I now have things working for individual EBSD datapoints, which I will detail at the end of this post.  This is a most helpful visualization for us, thank you.

Third, I am able to create bitmap versions of the resulting figure, but color is not written to the vector versions.... maybe this should be the subject of a different question though.  I am running MTEX 3.4.1 on MATLAB2012b on Fedora 18 and can generate both PNG and PDF versions of other figures (pole figures, EBSD maps using IPF coloration, etc) with full color, but the only thing that appears on the PDF version of Schmid factor maps are the axes and a blank, white, map.  This is true whether I am doing grains or individual EBSD datapoints.

%% this is what usually happens when I can successfully create PDF version:
plot
(ebsd)
savefigure
('newfile.pdf')

CData =

   
[29195x1x3 double]

%% this is what happens when trying to make a PDF version of Schmid factor maps:
plot
(ebsd('Ice Ih 100K'),'property',abs(tauMax(:)))
savefigure
('newfile.pdf')

CData =

     
{}


CData =

     
{}

The "Save As..." feature of the MATLAB plot window simply embeds a bitmap version inside a PDF document, which is not helpful.  Any thoughts you may have on the matter would be appreciated.


Anyway, here for posterity is the process of creating Schmid factor maps for individual EBSD data points:
%%%% Schmid factor mapping for INDIVIDUAL data points %%%%%
%% import EBSD data
import27FEB13
%% get orientations for each EBSD data point
ori
= get(ebsd('Ice Ih 100K'),'orientations');
%% set up applied stress || macroscopic Y direction
MY
=zeros(3); MY(2,2)=-1; sigmaY=tensor(MY,'name','stress');
%% applied stress in crystal coordinate system
sigmaCS
= rotate(sigmaY,inverse(ori));
%% define slip system
icecs
=symmetry('6/mmm', [4.4961 4.4961 7.3198], 'X||a*', 'Y||b', 'Z||c*', 'mineral', 'Ice Ih 100K');

m
= Miller(0,0,0,1,icecs); % normal to the slip plane
n
= Miller(1,1,-2,0,icecs); % slip direction in the slip plane
%% calculate Schmid factors
[tauMax,m,n,tau] = calcShearStress(sigmaCS,m,n,'symmetrise');
%% plot map
plot
(ebsd('Ice Ih 100K'),'property',abs(tauMax(:)))
colorbar


The resulting map is attached and is the same dataset shown in the first post.  The horizontal "lines" in the orientation data are misorientations induced by SEM stage movements during data collection -- we suffer a large change in working distance during moves in the Y direction, but these are unavoidable since the grains in ice are so large.

Thank you again for your help with all of this and, of course, for the toolbox itself.
DAN
iceSchmidFinemap.png

Ralf Hielscher

unread,
May 14, 2013, 9:52:05 AM5/14/13
to mtex...@googlegroups.com
Hi,

as for the export this is actually a bug in MTEX. In order to export the Schmid factor please type before exporting

set(gcf,'renderer','painters')

I hope this helps,

Ralf.

Daniel Breton

unread,
May 14, 2013, 10:02:15 AM5/14/13
to mtex...@googlegroups.com
Dr. Hielscher,

Hooray!  It works like a champ!  Thank you for answering my many questions.

DAN
Reply all
Reply to author
Forward
0 new messages