Skip to content

Commit

Permalink
docu
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfHielscher committed Nov 7, 2024
1 parent 5b0c588 commit 0a594c5
Show file tree
Hide file tree
Showing 19 changed files with 225 additions and 185 deletions.
10 changes: 4 additions & 6 deletions doc/CrystalGeometry/CrystalReferenceSystem.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,21 @@

close all
figure(1)
plot(cS_x2a,'figSize','small')
plot(cS_x2a,'figSize','small','colored')
hold on
arrow3d(0.5*[xvector,yvector,zvector],'labeled')
arrow3d(0.6*[xvector,yvector,zvector],'labeled')
hold off

%%

cS_y2a = crystalShape.quartz(cs_y2a);

figure(2)
plot(cS_y2a,'figSize','small')
plot(cS_y2a,'figSize','small','colored')
hold on
arrow3d(0.5*[xvector,yvector,zvector],'labeled')
arrow3d(0.6*[xvector,yvector,zvector],'labeled')
hold off


%%
% Most important is the difference if Euler angles are used to describe
% orientation. Lets consider the following two orientations
Expand Down Expand Up @@ -144,7 +143,6 @@

ori_x2a.transformReferenceFrame(cs_y2a)


%% Triclinic and monoclinic symmetries
%
% In triclinic and monoclinic symmetries even more different setups are
Expand Down
35 changes: 10 additions & 25 deletions doc/CrystalGeometry/CrystalShapes.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,25 +183,25 @@
plot(cS)

%%
% i.e. we see only the positive and negative rhomboedrons, but the
% i.e. we see only the positive and negative rhododendrons, but the
% hexagonal prism are to far away from the origin to cut the shape. We may
% decrease the distance, by multiplying the corresponding normal with a
% factor larger then 1.

N = [2*m,r,z];

cS = crystalShape(N);
plot(cS)
plot(cS,'colored')

%%
% Next in a typical Quartz crystal the negative rhomboedron is a bit smaller
% then the positive rhomboedron. Lets correct for this.
% Next in a typical Quartz crystal the negative rhododendron is a bit smaller
% then the positive rhododendron. Lets correct for this.

% collect the face normal with the right scaling
N = [2*m,r,0.9*z];

cS = crystalShape(N);
plot(cS)
plot(cS,'colored')

%%
% Finally, we add the tridiagonal bipyramid and the positive Trapezohedron
Expand All @@ -210,26 +210,8 @@
N = [2*m,r,0.9*z,0.7*s1,0.3*x1];

cS = crystalShape(N);
plot(cS)

%% Marking crystal faces
% We may colorize the faces according to their lattice planes using the
% command

plot(cS,'colored')

%%
% or even label the faces directly

plot(cS)
N = unique(cS.N.symmetrise,'noSymmetry','stable');
fC = cS.faceCenter;

for i = 1:length(N)
text3(fC(i),char(round(N(i)),'latex'),'scaling',1.1,'interpreter','latex')
end



%% Defining complicated crystals more simple
% We see that defining a complicated crystal shape is a tedious work. To
Expand All @@ -252,9 +234,9 @@
%%
% The scale parameter models the inverse extension of the crystal in each
% dimension. In order to make the crystal a bit longer and the negative
% rhomboedrons smaller we could do
% rhododendrons smaller we could do

extension = [0.9 1.1 1];
extension = [1 1.2 1.1];
cS = crystalShape(N,habitus,extension);
plot(cS,'colored')

Expand Down Expand Up @@ -283,6 +265,9 @@
plot(cS(Miller(0,-1,1,0,cs)),'FaceColor','DarkRed')
hold off

% zoom a bit out to fit the screen
camzoom(0.7)

%% Gallery of hardcoded crystal shapes

plot(crystalShape.olivine,'colored')
Expand Down
1 change: 1 addition & 0 deletions doc/CrystalOrientations/OrientationFundamentalRegion.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

close all
plot(oR_all)
axis off
hold on
plot(oR,'color','r')
hold off
Expand Down
2 changes: 1 addition & 1 deletion doc/EBSDAnalysis/EBSDIPFMap.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
%%
% Instead of colorizing which crystal axis is pointing out of the specimen
% surface we may also colorizing which crystal axis is pointing towards the
% rolling or folliation direction or any other specimen fixed direction.
% rolling or foliation direction or any other specimen fixed direction.
% This reference direction is stored as the property
% |inversePoleFigureDirection| in the color key.

Expand Down
8 changes: 4 additions & 4 deletions doc/EBSDAnalysis/EBSDKAM.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
% been reconstructed and the property |ebsd.grainId| has been set (as we
% did above) only misorientations within the same grain are considered. As
% a consequence the resulting KAM map is dominated by the orientation
% gradients at the subgrain boundaries.
% gradients at the sub-grain boundaries.
%
% Specifying a reasonable small threshold angle $\delta=2.5^{\circ}$ the
% subgrain boundaries can be effectively removed from the KAM.
% sub-grain boundaries can be effectively removed from the KAM.

plot(ebsd,ebsd.KAM('threshold',2.5*degree) ./ degree,'micronbar','off')
setColorRange([0,2])
Expand All @@ -103,7 +103,7 @@
hold off

%%
% Although this reduced noise it also smooths away local dislocation
% Although this reduces noise it also smooths away local dislocation
% structures. A much more effective way to reduce the effect of measurement
% errors to the kernel average misorientation is to denoise the EBSD map
% first and compute than the KAM from the first order neighbors.
Expand All @@ -125,7 +125,7 @@
hold off

%%
% We observe that the KAM is not longer related to subgrain boundaries and
% We observe that the KAM is not longer related to sub-grain boundaries and
% nicely reveals local dislocation structures of the deformed material.
%
%% Some helper functions
Expand Down
43 changes: 22 additions & 21 deletions doc/EBSDAnalysis/EBSDOrientationAnalysis.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,26 @@
%
%%
% Here we discuss tools for the analysis of EBSD data which are independent
% of its spatial coordinates. For spatial analysis, we refer to <xxx.html
% this page>. Let us first import some EBSD data:
%
% of its spatial coordinates. For spatial analysis, we refer to
% <EBSDProfile.html this page>. Let us first import some EBSD data:

plotx2east
ebsd = EBSD.load(fullfile(mtexDataPath,'EBSD','Forsterite.ctf'),...
'convertEuler2SpatialReferenceFrame');
mtexdata forsterite silent

plotx2east
plot(ebsd)

%% Orientation plot
%
% We start our investigations of the Forsterite phase by plotting some
% pole figures
% We start our investigations of the Forsterite phase by plotting some pole
% figures

cs = ebsd('Forsterite').CS % the crystal symmetry of the forsterite phase
h = [Miller(1,0,0,cs),Miller(0,1,0,cs),Miller(0,0,1,cs)];
plotPDF(ebsd('Forsterite').orientations,h,'antipodal')

%%
% From the {100} pole figure, we might suspect a fibre texture present in our
% data. Let's check this. First, we determine the vector orthogonal to fibre
% in the {100} pole figure
% From the {100} pole figure, we might suspect a fibre texture present in
% our data. Let's check this. First, we determine the vector orthogonal to
% fibre in the {100} pole figure

% the orientations of the Forsterite phase
ori = ebsd('Forsterite').orientations
Expand All @@ -35,17 +32,21 @@
rOrth = perp(r)

% output
hold on
plot(rOrth)
hold off
plot(rOrth,'add2all','Marker','square','markerColor','DarkRed')


%%
% we can check how large is the number of orientations that are in the
% (100) pole figure within a 10-degree fibre around the great circle with
% center |rOrth|. The following line gives the result in percent
% center |rOrth|, i.e., in the region bounded by the two small circles

100 * sum(angle(r,rOrth)>80*degree) / length(ori)
nextAxis(1)
circle(rOrth,80 * degree,'lineColor','darkred','linewidth',5,'EdgeAlpha',0.5)

%%
% The following line gives the result in percent

100 * sum(angle(r,rOrth)>80*degree) / length(ori)

%%
% Next, we want to answer the question which crystal direction is mapped to
Expand All @@ -55,9 +56,9 @@
mtexColorbar

%%
%From the inverse pole figure, it becomes clear that the orientations are
% close to the fibre |Miller(0,1,0)|, |rOrth|. Let's check this by computing
% the fibre volume in percent
% From the inverse pole figure, it becomes clear that the orientations are
% close to the fibre |Miller(0,1,0)|, |rOrth|. Let's check this by
% computing the fibre volume in percent

% define the fibre
f = fibre(Miller(0,1,0,cs),rOrth);
Expand All @@ -73,7 +74,7 @@
odf = calcDensity(ebsd('Forsterite').orientations)

% plot the odf along the fibre
plot(odf,f)
plot(odf,f,'linewidth',2)
ylim([0,26])

%%
Expand Down
21 changes: 11 additions & 10 deletions doc/EBSDAnalysis/EBSDPlotting.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

%%
% These values are RGB values which can be altered to any other RGB triple.
% A more convinient way for changing the color is the function
% A more convenient way for changing the color is the function
% <str2rgb.html str2rgb> which converts color names into RGB triplets

ebsd('Diopside').color = str2rgb('salmon');
Expand All @@ -44,7 +44,7 @@

plot(ebsd,ebsd.bc)

colormap gray % make the image grayscale
colormap gray % make the image gray-scale
mtexColorbar

%% Visualizing orientations
Expand All @@ -58,9 +58,9 @@
mtexColorbar

%%
% Obviously, the rotational angle is not a very distintive representative
% Obviously, the rotational angle is not a very distinctive representative
% for orientations. A more common approach is to define a colorization of
% the fundamental secor of the inverse pole figure, a so called ipf color
% the fundamental sector of the inverse pole figure, a so called ipf color
% key, and to colorize orientations according to their position in a fixed
% inverse pole figure. Let's consider the following standard key.

Expand All @@ -73,27 +73,28 @@

%%
% Next we may utilize this key to turn the orientations into colors, which
% are than passed to the <EBSD.plot.html plot> command.
% are than passed to the <EBSD.plot.html |plot|> command.

colors = ipfKey.orientation2color(ebsd('Forsterite').orientations);
plot(ebsd('Forsterite'),colors)

%%
% The above ipf color key can be largely customizied. This is explained in
% The above ipf color key can be largely customized. This is explained in
% more detail in <EBSDIPFMap IPF Maps>. Beside IPF maps there are also more
% specific ways to colorize orientations as they are discussed in
% <EBSDAdvancedMaps.html Advanced Plotting>.
%
%% Superposing different plots
% Combining different plots can be done either by plotting only subsets of
% the EBSD data or via the option |'faceAlpha'|. Note that the option
% |'faceAlpha'| requires the renderer of the figure to be set to
% |'opengl'|.
% the EBSD data or using the option |'faceAlpha'| to control transparency.

close all;
plot(ebsd,ebsd.bc)
mtexColorMap black2white

hold on
plot(ebsd('fo'),'FaceAlpha',0.5)
plot(ebsd('Forsterite'),colors,'FaceAlpha',0.5)
hold off



8 changes: 4 additions & 4 deletions doc/Elasticity/IsotropicTheory.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
%
% An isotropic Albite material we assume here to consist of randomly
% oriented grains forming an uniform (isotropic) texture. In this case the
% Voigt and Reuss avarages provide upper and lower bounds for the elastic
% Voigt and Reuss averages provide upper and lower bounds for the elastic
% properties of the material.

[C_iso_Voigt,C_iso_Reuss,C_iso_Hill] = mean(C,uniformODF(C.CS))
Expand Down Expand Up @@ -94,7 +94,7 @@

%% Lame constants
%
% The second way to represent the elastic behaviour of an isotropic medium
% The second way to represent the elastic behavior of an isotropic medium
% is by means of the Lame constants

lambda = nu/(1-2*nu) /(1+nu) * E;
Expand Down Expand Up @@ -135,7 +135,7 @@
%
%%
% The upper and lower Hashin-Shtrikman bounds for the bulk and shear
% moduli are found as a solution of an optimzation problem. Lets first set
% moduli are found as a solution of an optimization problem. Lets first set
% up the search domain

% define a 2 dimensional domain of bulk and shear moduli
Expand All @@ -147,7 +147,7 @@

%%
% Next the initial stiffness tensor is updated such that the residual
% stiffness tensor |R| remains either possitve or negative definite.
% stiffness tensor |R| remains either positive or negative definite.
%

tic
Expand Down
Loading

0 comments on commit 0a594c5

Please sign in to comment.