Geometrically Necessary Dislocations in MTEX #59
-
Hi, Azdiar |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @wuwuhd, I understand you are trying to replicate the worked example shown on this webpage. It is commendable that you are finding things out on your own. Here is the script outputting GND data for the fcc phase: % clear variables
clc; clear all; clear hidden; close all;
% start Mtex
startup_mtex;
% define Mtex plotting convention as X = right, Y = up
setMTEXpref('xAxisDirection','east');
setMTEXpref('zAxisDirection','outOfPlane');
setMTEXpref('FontSize', 14);
% Import the dataset
ebsd = EBSD.load('Duplex.ctf','interface','ctf',...
'convertEuler2SpatialReferenceFrame');
ebsd = ebsd('indexed');
%% calculate the grains
% identify grains
[grains,ebsd.grainId,ebsd.mis2mean] = calcGrains(ebsd,'angle',5*degree);
% remove small clusters
ebsd(grains(grains.grainSize <= 5)) = [];
% re-calculate grains
[grains,ebsd.grainId,ebsd.mis2mean] = calcGrains(ebsd,'angle',5*degree);
% denoise orientation data
F = halfQuadraticFilter;
ebsd = smooth(ebsd,F,'fill',grains);
% calculate the grain boundaries
gB = grains.boundary;
% define the fcc phase variables
ebsd_fcc = ebsd('Fe-FCC');
grains_fcc = grains('Fe-FCC');
% grid the ebsd data
ebsd_fcc = ebsd_fcc.gridify;
% compute the curvature tensor
kappa_fcc = ebsd_fcc.curvature;
% define the dislocation system
dS_fcc = dislocationSystem.fcc(ebsd_fcc.CS);
% define the energy of the edge dislocations as per the Hull & Bacon assumption (check for applicability to fcc)
dS_fcc(dS_fcc.isEdge).u = 1;
% define the energy of the screw dislocations as per the Hull & Bacon assumption (check for applicability to fcc)
dS_fcc(dS_fcc.isScrew).u = 1 - 0.3;
% rotate the dislocation tensors into the specimen reference frame
dSRot_fcc = ebsd_fcc.orientations * dS_fcc;
% fit dislocations to the incomplete dislocation density tensor
[rho_fcc,~] = fitDislocationSystems(kappa_fcc,dSRot_fcc);
% plot the data
factor = 1E16;
gnd_fcc = factor * sum(abs(rho_fcc .* dSRot_fcc.u),2);
plot(ebsd_fcc,gnd_fcc);
hold all
plot(grains_fcc.boundary,'linewidth',1);
hold off
mtexColorMap(flipud(hot));
mtexColorbar;
set(gca,'ColorScale','log');
set(gca,'CLim',[min(gnd_fcc) max(gnd_fcc)]); Hope this helps. **Lastly, and importantly, if an explanation from the maintainers resolves your issue, please press the "Mark as answer" button on the appropriate response. Your help in this regard enables us to close discussions as complete. ** Warm regards, |
Beta Was this translation helpful? Give feedback.
Hi @wuwuhd,
I understand you are trying to replicate the worked example shown on this webpage.
It is commendable that you are finding things out on your own.
However, I do have some sincere advice that I hope you will take on board for future.
Please do not be in a hurry to simply copy the commands from a webpage into a script.
Please spend some time reading the accompanying explanations on the webpage.
Here is the script outputting GND data for the fcc phase: