Skip to content
Snippets Groups Projects
Commit f2f67fba authored by Peter Reischig's avatar Peter Reischig Committed by Nicola Vigano
Browse files

Modified grain.strain field names and function help.

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@572 4c865b51-4357-4376-afb4-474e03ccb993
parent 240dd8c2
No related branches found
No related tags found
No related merge requests found
......@@ -169,10 +169,10 @@ end
ggrain = Rod2g(grain.R_vector);
grain_vertices = ga*cube_vertices*ggrain';
if isfield(grain,'strain') && ~any(isnan(grain.strain.ST(:)))
if isfield(grain,'strain') && ~any(isnan(grain.strain.strainT(:)))
grain_vertices_st = repmat(gc,8,1) + ...
((eye(3) + grain.strain.ST*strainscale)*grain_vertices')';
facecolor = grain.strain.ST(3,3);
((eye(3) + grain.strain.strainT*strainscale)*grain_vertices')';
facecolor = grain.strain.strainT(3,3);
else
grain_vertices_st = repmat(gc,8,1) + (eye(3)*grain_vertices')';
facecolor = 0;
......
......@@ -37,12 +37,12 @@ parfor ii = 1:length(grain)
% Strain tensor
ST = gtStrainSingleGrain(grain{ii}, cryst, lambda, Bmat);
grain{ii}.strain.ST = ST;
grain{ii}.strain.strainT = ST;
grain{ii}.strain.Eps = [ST(1,1) ST(2,2) ST(3,3) ST(2,3) ST(1,3) ST(1,2)];
% Principal strains - eigenvalues and eigenvectors
[ivec, ival] = eig(grain{ii}.strain.ST);
[ivec, ival] = eig(grain{ii}.strain.strainT);
[ivalsort, ivalinds] = sort([ival(1,1), ival(2,2), ival(3,3)], 2, 'descend');
......@@ -68,7 +68,7 @@ parfor ii = 1:length(grain)
if (grain{ii}.strain.pstrain(1) > med_ps + stdlim*std_ps) || ...
(grain{ii}.strain.pstrain(1) < med_ps - stdlim*std_ps)
grain{ii}.strain.ST(:) = NaN;
grain{ii}.strain.strainT(:) = NaN;
grain{ii}.strain.Eps(:) = NaN(1,6);
grain{ii}.strain.pstrain(:) = NaN;
grain{ii}.strain.pstraindir(:) = NaN;
......
function [pldef, drel] = gtStrainPlaneNormals(pl, G)
% FUNCTION [pldef, drel] = gtStrainPlaneNormals(pl, G)
% GTSTRAINPLANENORMALS Given a deformation tensor, calculates new plane
% normals with no approximations.
%
% [pldef, drel] = gtStrainPlaneNormals(pl, G)
%
% Returns the new orientations of plane normals 'pl' after a deformation
% described by the deformation tensor 'G' (9 distinct components).
% Also returns the elongations 'drel' due to the deformation in the
% directions of the plane normals. In a crystal this equals to the ratios
% of the d-spacings after and before the deformation.
% The results are exact, no linear approximation is used.
% The results are exact, no approximation is used.
% The 'pl' and 'G' coordinates must be given in the same reference frame.
%
% INPUT
% pl - normalised coordinates of plane normals (3xn)
% G - deformation tensor (3x3)
%
% OUTPUT
% pldef - plane normals in deformed state
% drel - relative elongations along the (deformed) plane normals
%
% Get an arbitrary vector e1 perpendicular to n:
......
function ST = gtStrainSingleGrain(grain, cryst, lambda, Bmat)
% GTSTRAINSINGLEGRAIN ST = gtStrainSingleGrain(grain, cryst, lambda, Bmat)
% GTSTRAINSINGLEGRAIN Computes the strain tensor for a single grain.
%
% ST = gtStrainSingleGrain(grain, cryst, lambda, Bmat)
%
% Computes the strain tensor 'ST' for a single indexed grain
% (crystal system is irrelevant). The 6 strain matrix components are
% computed in the same reference as the plane normals.
% The deformation components are found by fitting all the interplanar
% angles and distances observed (no weighting of the equations). No linear
% angles and distances observed (no weighting of the equations).
%
% Small deformations are assumed so that the strain tensor is considered to
% be the symmetric part of the deformation tensor, but no further
% approximation is used.
% If 'Bmat' is empty, it will be calculated inside the function.
%
% It uses the function 'lsqnonlin' from Matlab's Optimization Toolbox.
%
%
% INPUT
% grain - a single grain data as from Indexter
% cryst - crystallography data as in parameters file
% lambda - X-ray beam wavelength
% Bmat - matrix to transform HKL indices into Cartesian coordinates
% (if empty, it will be calculated inside the function)
% OUTPUT
% ST - strain tensor (approximated as the symmetric part of the
% deformation tensor)
%
......
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