function lmp2cfg(varargin) % Converts LAMMPS dump file to Extended CFG Format (No velocity) to be used % with AtomEye (http://164.107.79.177/Archive/Graphics/A/) % Input : % Necessary (in order) % timestep,Natoms,x_bound,y_bound,z_bound,H,atom_data,mass, % cfg file name, dumpfile name % Optional % 'vel' --> 'yes' (if velocity data needs to be written) % --> Default is 'no' % 'atomtype' --> {Atom symbol} % 'autonumber' --> 'yes' (default) numbers cfgfiles consecutively based on timestep % 'autolog' --> 'on' (default) writes details of conversion to a log file % 'rotation' --> To specify rotation (Transform in cfg file) say 'rotation' followed by % number of rotations,the axes of rotation ('X' or 'Y' or 'Z')and the % angle in degrees. CAUTION : Do remember that rotations are % non-commutative and hence the order of rotations must be the same as % intended % 'aux' --> Auxiliary data must be a two column array with Quantity and Type in each % column % % % THE DATA MUST BE SCALED (0 to 1)IN ORDER FOR ATOMEYE TO READ PROPERLY % Real coordinates x = s * H, x, s are 1x3 row vectors % % Example % lmp2cfg_all(data.timestep,data.Natoms,data.xbound,data.ybound,... % data.zbound,H,data.atom_data,mass,cfgfile,dumpfile,... % 'vel','no','aux',{'sxx' 'Lammps O/P' % 'syy' 'Lammps O/P' % 'szz' 'Lammps O/P' % 'sxy' 'Lammps O/P' % 'sxz' 'Lammps O/P' % 'syz' 'Lammps O/P'},... % 'atomtype',{'Ni' % 'Al'},... % 'autonumber','on',... % 'autolog','on',... % 'rotation',2,'X',45,'Y',30); % % See also readdump_all, readdump_one, scandump % % Author : Arun K. Subramaniyan % sarunkarthi@gmail.com % http://web.ics.purdue.edu/~asubrama/pages/Research_Main.htm % School of Aeronautics and Astronautics % Purdue University, West Lafayette, IN - 47907, USA. %------------ Defaults vel = 'no'; auxstatus = 0; atom_typestatus = 0; rotstatus = 0; autonumber_status = 1; % default is ON autolog_status = 1; %---------------------------------- %-----Required Input -------------- timestep = varargin{1} Natoms = varargin{2}; x_bound = varargin{3}; y_bound = varargin{4}; z_bound = varargin{5}; H = varargin{6}; atom_data = varargin{7}; mass = varargin{8}; %arrange it in order of atom type , ie 1 - mass1 etc filename = varargin{9}; %Just give one file name if length(varargin) < 10 dumpfilename = ['dump.' filename]; else dumpfilename = varargin{10}; end if length(varargin) > 10 i=11; while i \t\t %s \n',timestep(i),name{i}); end fclose(flog); end %---------- Function to calculate beta function b = beta(angle,axes) switch axes case 'X' % X axes b = [1 0 0 0 cos(angle) sin(angle) 0 -sin(angle) cos(angle)]; case 'Y' % Y axes b = [cos(angle) 0 sin(angle) 0 1 0 -sin(angle) 0 cos(angle)]; case 'Z' % Z axes b = [cos(angle) sin(angle) 0 -sin(angle) cos(angle) 0 0 0 1]; end end % -------------------------------------------------- end % For main function