function crystalSystem = abbreviateCrystalSystem(crystalSystem)
% abbreviate name of crystal system (or write out abbreviation)
%
% Syntax: crystalSystem = abbreviateCrystalSystem(crystalSystem)
%
% This function takes an abbreviation (or full name) of a crystal system
%   and converts this into the full name (or abbreviation). The conversions
%   are:    a - triclinic (anorthic)
%           m - monoclinic
%           o - orthorhombic
%           t - tetragonal
%           h - hexagonal/trigonal
%           r - rhombohedral (not used, is an alternative to trigonal)
%           c - cubic
%
% See also: obtainCrystal, viewCrystal, extendCdef

% The elk-library: convex geometry applied to crystallization modeling.
%   Copyright (C) 2012 Alexander Reinhold
%
% This program is free software: you can redistribute it and/or modify it 
%   under the terms of the GNU General Public License as published by the 
%   Free Software Foundation, either version 3 of the License, or (at your 
%   option) any later version.
%
% This program is distributed in the hope that it will be useful, but 
%   WITHOUT ANY WARRANTY; without even the implied warranty of 
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
%   General Public License for more details.
%
% You should have received a copy of the GNU General Public License along 
%   with this program.  If not, see <http://www.gnu.org/licenses/>.

crystalSystem = lower(crystalSystem);
switch crystalSystem
    case 'a'
        crystalSystem = 'triclinic';
    case 'm'
        crystalSystem = 'monoclinic';
    case 'o'
        crystalSystem = 'orthorhombic';
    case 't'
        crystalSystem = 'tetragonal';
    case 'h'
        crystalSystem = 'hexagonal/trigonal';
    case 'r'
        crystalSystem = 'rhombohedral';
    case 'c'
        crystalSystem = 'cubic';
    case 'triclinic'
        crystalSystem = 'a';
    case 'anorthic'
        crystalSystem = 'a';
    case 'monoclinic'
        crystalSystem = 'm';
    case 'orthorhombic'
        crystalSystem = 'o';
    case 'tetragonal'
        crystalSystem = 't';
    case 'hexagonal'
        crystalSystem = 'h';
    case 'hexagonal/trigonal'
        crystalSystem = 'h';
    case 'trigonal'
        crystalSystem = 'h';
    case 'rhombohedral'
        crystalSystem = 'r';
    case 'cubic'
        crystalSystem = 'c';    
end
