Skip to content
Snippets Groups Projects
Commit 036d8ab2 authored by Laura Nervo's avatar Laura Nervo
Browse files

gtDisorientation : fixed bug if lattice parameters are provided. Applied the...

gtDisorientation : fixed bug if lattice parameters are provided. Applied the same to gtMisorientation

Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>
parent fcbe3a90
No related branches found
No related tags found
No related merge requests found
......@@ -3,12 +3,11 @@ function [mis_angle, mis_axis, info] = gtDisorientation(ori1, ori2, symm, vararg
% between two sets of grains
%
% [mis_angle, mis_axis] = gtDisorientation(ori1, ori2, symm, [varargin])
% -------------------------------------------------------------------------
% ----------------------------------------------------------------------
% INPUT:
% ori1 = <double> Orientations for grains set 1
% ori2 = <double> Orientations for grains set 2
% symm = <struct> Symmetry operators list from gtCrystGetSymmetryOperators
% latticepar = <double> Lattice parameters (1x6 for hexagonal crystals)
%
% OPTIONAL INPUT (varargin as a list of pairs, see parse_pv_pairs.m):
% input = <string> Input orientation ({'rod'}, 'orimat', or 'euler')
......@@ -19,6 +18,7 @@ function [mis_angle, mis_axis, info] = gtDisorientation(ori1, ori2, symm, vararg
% sort = <string> Sort disorientation axis components after taking
% absolute values (if empty, do nothing at all)
% ({''}, 'ascend' or 'descend')
% latticepar = <double> Lattice parameters (1x6 for hexagonal crystals)
%
% OUTPUT:
% mis_angle = <double> Misorientation angles between the 2 grain sets
......@@ -74,16 +74,11 @@ mis_angle = zeros(Ngrain1, 1);
% Compute orientation matrices for sets 1 and 2
g1 = oriConversion(ori1);
g2 = oriConversion(ori2);
if nargout > 1
if (~isempty(par.latticepar))
mis_axis = zeros(Ngrain1, 4);
else
mis_axis = zeros(Ngrain1, 3);
end
end
% Compute active/passive disorientation angle/axis
if nargout > 1
mis_axis = zeros(Ngrain1, 3);
tmp_info(Ngrain1).g1 = [];
tmp_info(Ngrain1).g2 = [];
tmp_info(Ngrain1).index_i = [];
......@@ -97,8 +92,8 @@ if nargout > 1
gB = g2(:, :, ii);
[mis_angle(ii), mis_axis(ii, :), tmp_info(ii)] = calcDisorientation(gA, gB, Symm);
end
if (~isempty(par.latticepar))
mis_axis = gtCart2Hex(mis_axis, latticepar);
if (~isempty(par.latticepar)) && par.latticepar(6) == 120 % it must be hexagonal
mis_axis = gtCart2Hex(mis_axis, par.latticepar);
end
if nargout > 2
info = tmp_info;
......
......@@ -32,6 +32,9 @@ end
if ~exist('symm', 'var') || isempty(symm)
gtError('gtMisorientation:missingArgument','Symmetry operators are missing... Use gtCrystGetSymmetryOperators to calculate them')
end
if ~exist('latticepar','var')
latticepar = [];
end
if size(r_vector1,2) == 4
r_vector1 = r_vector1(2:4);
......@@ -63,7 +66,7 @@ mis_angle = mis_angles(dummy);
if nargout > 1
mis_axis = misorientation_axes{dummy};
if (~isempty(latticepar))
if (~isempty(latticepar)) && latticepar(6) == 120
mis_axis = gtCart2Hex(mis_axis, latticepar);
end
......@@ -77,6 +80,9 @@ if nargout > 1
symm(ii).netG = netGs{ii};
symm(ii).mis_angle = mis_angles(ii);
symm(ii).mis_axis = misorientation_axes{ii};
if (~isempty(latticepar))
symm(ii).mis_axis_hex = gtCart2Hex(misorientation_axes{ii}, latticepar);
end
end
Gsymm.symm = symm;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment