Home > lattice > atindex.m

atindex

PURPOSE ^

ATINDEX extracts the information about element families and

SYNOPSIS ^

function indexstruct = atindex(lattice)

DESCRIPTION ^

ATINDEX extracts the information about element families and
 indexes from AT lattice

ATI=ATINDEX(LATTICE)
  returns a srtucture with fields named after element family
  containing an array of their AT indexes;

   ATI.QF = [...]
   ATI.QD = [...];
   ...

ATI=ATINDEX() Uses the global variable THERING

 See also ATGETCELLS

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function indexstruct = atindex(lattice)
0002 %ATINDEX extracts the information about element families and
0003 % indexes from AT lattice
0004 %
0005 %ATI=ATINDEX(LATTICE)
0006 %  returns a srtucture with fields named after element family
0007 %  containing an array of their AT indexes;
0008 %
0009 %   ATI.QF = [...]
0010 %   ATI.QD = [...];
0011 %   ...
0012 %
0013 %ATI=ATINDEX() Uses the global variable THERING
0014 %
0015 % See also ATGETCELLS
0016 global THERING
0017 
0018 if nargin < 1    
0019     indexstruct=ati(THERING);
0020 else
0021     indexstruct=ati(lattice);
0022 end
0023 
0024     function ids=ati(lattice)
0025         ids=struct();
0026         for i=1:length(lattice);
0027             try
0028                 famname=lattice{i}.FamName;
0029                 try
0030                     a.(famname)=0;
0031                 catch %#ok<CTCH>
0032                     try
0033                         famname=['x' famname]; %#ok<AGROW>
0034                         a.(famname)=0;
0035                     catch
0036                         famname='badname';
0037                     end
0038                 end
0039             catch
0040                 famname='unnamed';
0041             end
0042             if isfield(ids,famname)
0043                 ids.(famname)(end+1)=i;
0044             else
0045                 ids.(famname)(1)=i;
0046             end
0047         end
0048     end
0049 end

Generated on Thu 24-Aug-2017 18:47:33 by m2html © 2005