Importing Tensor Data edit page

Single crystal tensor are imported using the command tensor.load. This function automatically detect the file format and imports the data. In dependency of the specific format it might be necessary to specify the crystal symmetry seperately

% define crystal symmetry
CS = crystalSymmetry('32', [4.916 4.916 5.4054],...
  'X||a*', 'Z||c', 'mineral', 'Quartz');

% define the file name
fname = fullfile(mtexDataPath,'tensor', 'Single_RH_quartz_poly.P');

% import the single crystal tensor
P = tensor.load(fname,CS,'propertyname','piecoelectricity','unit','C/N','DoubleConvention')
P = tensor (Quartz)
  propertyname    : piecoelectricity
  unit            : C/N             
  rank            : 3 (3 x 3 x 3)   
  doubleConvention: true            
 
  tensor in compact matrix form:
     0     0     0 -0.67     0   4.6
   2.3  -2.3     0     0  0.67     0
     0     0     0     0     0     0

For specific types of tensors, e.g. stiffness tensors there exist dedicated import functions that have the form tensorName.load

fname = fullfile(mtexDataPath,'tensor','Olivine1997PC.GPa');

cs = crystalSymmetry('mmm',[4.7646 10.2296 5.9942],'mineral','Olivin');

C = stiffnessTensor.load(fname,cs)
C = stiffnessTensor (Olivin)
  unit: GPa              
  rank: 4 (3 x 3 x 3 x 3)
 
  tensor in Voigt matrix representation:
 320.5  68.2  71.6     0     0     0
  68.2 196.5  76.8     0     0     0
  71.6  76.8 233.5     0     0     0
     0     0     0    64     0     0
     0     0     0     0    77     0
     0     0     0     0     0  78.7