function Datastruct = datastruct()
% DATASTRUCT defines the data structure used in sw object It defines the
% data structure with initial values all are necessary for valid data
% structure.
%

% $Name: SpinW$ ($Version: 2.1$)
% $Author: S. Toth$ ($Contact: sandor.toth@psi.ch$)
% $Revision: 238 $ ($Date: 07-Feb-2015 $)
% $License: GNU GENERAL PUBLIC LICENSE$

Datastruct.mainfield = {...
    'lattice' 'unit_cell' 'twin' 'matrix' 'single_ion' 'coupling' 'mag_str' 'unit'};
Datastruct.subfield = {...
    'angle' 'lat_const' 'sym'   ''        ''   ;... % LATTICE
    'r'     'S'         'label' 'color'   ''   ;... % UNIT_CELL
    'vol'   'rotc'      ''      ''        ''   ;... % TWIN
    'mat'   'color'     'label' ''        ''   ;... % MATRIX
    'aniso' 'g'         'field' 'T'       ''   ;... % SINGLE_ION
    'dl'    'atom1'     'atom2' 'mat_idx' 'idx';... % COUPLING
    'N_ext' 'k'         'S'     'n'       ''   ;... % MAG_STR
    'kB'    'muB'       ''      ''        ''   };   % UNIT
Datastruct.sizefield = {...
    {1 3}           {1 3}           {1 1}           {}              {};...
    {3 'nAtom'}     {1 'nAtom'}     {1 'nAtom'}     {3 'nAtom'}     {};...
    {1 'nTwin'}     {3 3 'nTwin'}   {}              {}              {};...
    {3 3 'nJ'}      {3 'nJ'}        {1 'nJ'}        {}              {};...
    {1 'nMagAtom'}  {1 'nMagAtom'}  {1 3}           {1 1}           {};...
    {3 'nCoupling'} {1 'nCoupling'} {1 'nCoupling'} {3 'nCoupling'} {1 'nCoupling'};...
    {1 3}           {1 3}           {3 'nMagExt'}   {1 3}           {};...
    {1 1}           {1 1}           {}              {}              {}};
Datastruct.typefield = {...
    'double'  'double'  'integer' ''        ''       ;...
    'double'  'double'  'char'    'integer' ''       ;...
    'double'  'double'  ''        ''        ''       ;...
    'double'  'integer' 'char'    ''        ''       ;...
    'integer' 'integer' 'double'  'double'  ''       ;...
    'integer' 'integer' 'integer' 'integer' 'integer';...
    'integer' 'double'  'double'  'double'  ''       ;...
    'double'  'double'  ''        ''        ''       };

Datastruct.defval = {...
    'pi/2*ones(1,3)'    '[3 3 3]'           'int32(0)'  ''   '';...
    'zeros(3,0)'        'zeros(1,0)'        'cell(1,0)' 'int32(zeros(3,0))' '';...
    '1'                 'eye(3)'            ''          ''   '';...
    'zeros(3,3,0)'      'int32(zeros(3,0))' 'cell(1,0)' ''   '';...
    'int32(zeros(1,0))' 'int32(zeros(1,0))' '[0 0 0]'   '0'  '';...
    'int32(zeros(3,0))' 'int32(zeros(1,0))' 'int32(zeros(1,0))' 'int32(zeros(3,0))' 'int32(zeros(1,0))';...
    'int32([1 1 1])'    '[0 0 0]'           'zeros(3,0)' '[0 0 1]' '';...
    '0.086173324'       '0.057883818066'    ''           ''  ''};
% 0.086173324     Boltzmann constant: k_B [meV/K]
% 0.057883818066  Bohr magneton: mu_B [meV/T]
% g-tensor is given separately

end