MTEX stuff

In this example, EBSD are loaded from the dataset named 'small', provided along with the MTEX toolbox. Once loaded, they can used for reconstructing grains (of class grain2d ).

mtexdata small
ebsd = ebsd('indexed');		% Remove unindexed points
grains = calcGrains(ebsd);	% Compute grains
SMALL data loaded in variables

ebsd = EBSD (<a href="matlab:docmethods(ebsd)">show methods</a>, <a href="matlab:plot(ebsd)">plot</a>)
 Phase  Orientations     Mineral        Color  Symmetry  Crystal reference frame
     0    1197 (32%)  notIndexed                                                
     1    1952 (52%)  Forsterite   light blue       mmm                         
     2    290 (7.8%)   Enstatite  light green       mmm                         
     3    282 (7.6%)    Diopside    light red     12/m1       X||a*, Y||b*, Z||c
 Properties: bands, bc, bs, error, mad, x, y
 Scan unit : um

Compute the meshable geometry and plot it

The command below converts the grain geometries into a Gmsh-like description of the domains:


The variable G is an object of class gmshGeo . It fully describes the geometries of all grains and their intrisic properties.

Plot the geometry

One can easily plot the geometry using the usual plot fonction.


Mesh the gemetry


This command runs Gmsh within Matlab and exports the mesh into the specified format (Abaqus INP here). Extensive tweaks are available for meshing, as detailed in the corresponding section .

Export the grain properties

In order to retrieve the grain properties when importing the mesh into the FEM code (for assigning materials and orientations), one can export the properties of each grain as Comma-separated values (CSV).


Go back to documentation index