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

Minor changes in strain functions.

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@473 4c865b51-4357-4376-afb4-474e03ccb993
parent f0a0fbcb
No related branches found
No related tags found
No related merge requests found
function gtINDEXDrawGrainCubes(grains, parameters, numbered, hlight) function gtINDEXDrawGrainCubes(grains, parameters, numbered, hlight, strainscale)
% function gtINDEXDrawGrainCubes(grains, sample, numbered, hlight) % function gtINDEXDrawGrainCubes(grains, sample, numbered, hlight)
% %
% Draws a figure representing grain size and orientation by cubes % Draws a figure representing grain size and orientation by cubes
...@@ -25,6 +25,9 @@ if ~exist('numbered','var') ...@@ -25,6 +25,9 @@ if ~exist('numbered','var')
numbered = []; numbered = [];
end end
if ~exist('strainscale','var')
strainscale = 50;
end
sample.rad = parameters.labgeo.samenvrad; sample.rad = parameters.labgeo.samenvrad;
sample.bot = parameters.labgeo.samenvbot; sample.bot = parameters.labgeo.samenvbot;
...@@ -36,10 +39,10 @@ sample.top = parameters.labgeo.samenvtop; ...@@ -36,10 +39,10 @@ sample.top = parameters.labgeo.samenvtop;
nof_grains = length(grains); nof_grains = length(grains);
strainscale = 100; % 50 %strainscale = 100; % 50
fs = 14; fs = 20;
samradmargin = 0.1; samradmargin = 0.05;
samtopmargin = 0.1; samtopmargin = 0.2;
pixelsize = (parameters.labgeo.pixelsizeu + parameters.labgeo.pixelsizev)/2; pixelsize = (parameters.labgeo.pixelsizeu + parameters.labgeo.pixelsizev)/2;
...@@ -57,6 +60,9 @@ set(gca,'xtick',[],'xcolor','w') ...@@ -57,6 +60,9 @@ set(gca,'xtick',[],'xcolor','w')
set(gca,'ytick',[],'ycolor','w') set(gca,'ytick',[],'ycolor','w')
set(gca,'ztick',[],'zcolor','w') set(gca,'ztick',[],'zcolor','w')
%set(gca,'Position',[0.1 0 0.9 1])
set(gca,'Position',[0 0 1 1])
view(3); view(3);
axhor = 0.01*floor((sample.rad*(1+samradmargin))/0.01); axhor = 0.01*floor((sample.rad*(1+samradmargin))/0.01);
......
...@@ -21,19 +21,20 @@ function Srot = gtMathsRotationTensor(om, rotcomp) ...@@ -21,19 +21,20 @@ function Srot = gtMathsRotationTensor(om, rotcomp)
% OUTPUT % OUTPUT
% Srot - rotation matrix % Srot - rotation matrix
if (length(om) == 1) if (length(om) == 1)
Srot = rotcomp.const + rotcomp.cos*cosd(om) + rotcomp.sin*sind(om); Srot = rotcomp.const + rotcomp.cos*cosd(om) + rotcomp.sin*sind(om);
else else
n = length(om); n = length(om);
omcol(1,1,:) = om; omcol(1,1,:) = om;
cosOmcol = cosd(omcol); cosOmcol = cosd(omcol);
sinOmcol = sind(omcol); sinOmcol = sind(omcol);
Srot = rotcomp.const(:, :, ones(n,1)) ... Srot = rotcomp.const(:, :, ones(n,1)) ...
+ rotcomp.cos(:, :, ones(n,1)) ... + rotcomp.cos(:, :, ones(n,1)) ...
.* cosOmcol(ones(3, 1), ones(3,1), :) ... .* cosOmcol(ones(3, 1), ones(3,1), :) ...
+ rotcomp.sin(:, :, ones(n,1)) ... + rotcomp.sin(:, :, ones(n,1)) ...
.* sinOmcol(ones(3, 1), ones(3,1), :); .* sinOmcol(ones(3, 1), ones(3,1), :);
end end
end end
...@@ -63,17 +63,17 @@ cfBarEAllgrains(6) ...@@ -63,17 +63,17 @@ cfBarEAllgrains(6)
% edges_st.E11=-0.007; % edges_st.E11=-0.007;
% edges_end.E11=0.007; % edges_end.E11=0.007;
binw.E12=0.0005; binw.E12=0.0002;
edges_st.E12=-0.01; edges_st.E12=-0.004;
edges_end.E12=0.01; edges_end.E12=0.004;
binw.E33=0.0005; binw.E33=0.0002;
edges_st.E33=-0.01; edges_st.E33=-0.004;
edges_end.E33=0.01; edges_end.E33=0.004;
binw.E11=0.0005; binw.E11=0.0002;
edges_st.E11=-0.01; edges_st.E11=-0.004;
edges_end.E11=0.01; edges_end.E11=0.004;
%keyboard %keyboard
pause(10) pause(10)
......
...@@ -35,7 +35,11 @@ end ...@@ -35,7 +35,11 @@ end
parfor ii = 1:length(grain) parfor ii = 1:length(grain)
% Strain tensor % Strain tensor
grain{ii}.strain.ST = gtStrainSingleGrain(grain{ii}, cryst, lambda, Bmat); ST = gtStrainSingleGrain(grain{ii}, cryst, lambda, Bmat);
grain{ii}.strain.ST = 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 % Principal strains - eigenvalues and eigenvectors
[ivec, ival] = eig(grain{ii}.strain.ST); [ivec, ival] = eig(grain{ii}.strain.ST);
...@@ -65,6 +69,7 @@ parfor ii = 1:length(grain) ...@@ -65,6 +69,7 @@ parfor ii = 1:length(grain)
(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.ST(:) = NaN;
grain{ii}.strain.Eps(:) = NaN(1,6);
grain{ii}.strain.pstrain(:) = NaN; grain{ii}.strain.pstrain(:) = NaN;
grain{ii}.strain.pstraindir(:) = NaN; grain{ii}.strain.pstraindir(:) = NaN;
......
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