Skip to content
Snippets Groups Projects
Commit 4ccbe81e authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3982 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent f68adcfe
No related branches found
No related tags found
No related merge requests found
......@@ -29,21 +29,26 @@ end
i=1;
while feof(dump) == 0
id = fgetl(dump);
switch id
case 'ITEM: TIMESTEP'
if (strcmpi(id,'ITEM: TIMESTEP'))
timestep(i) = str2num(fgetl(dump));
case 'ITEM: NUMBER OF ATOMS'
else
if (strcmpi(id,'ITEM: NUMBER OF ATOMS'))
Natoms(i) = str2num(fgetl(dump));
case 'ITEM: BOX BOUNDS'
else
if (strcmpi(id,'ITEM: BOX BOUNDS'))
x_bound(i,:) = str2num(fgetl(dump));
y_bound(i,:) = str2num(fgetl(dump));
z_bound(i,:) = str2num(fgetl(dump));
case 'ITEM: ATOMS'
else
if (strcmpi(id(1:11),'ITEM: ATOMS'))
for j = 1 : 1: Natoms
atom_data(j,:,i) = str2num(fgetl(dump));
end
i=i+1;
end
end
end
end
end
end
%----------Outputs-------------
%OUTPUTS IN SAME VARIABLE STRUCTURE
......
......@@ -46,25 +46,30 @@ else
end
while done == 0 & last_status == 0
id = fgetl(dump);
switch id
case 'ITEM: TIMESTEP'
if (strcmpi(id,'ITEM: TIMESTEP'))
if t == 0
timestep(i) = str2num(fgetl(dump));
t=1;
end
case 'ITEM: NUMBER OF ATOMS'
else
if (strcmpi(id,'ITEM: NUMBER OF ATOMS'))
Natoms = str2num(fgetl(dump));
case 'ITEM: BOX BOUNDS'
else
if (strcmpi(id,'ITEM: BOX BOUNDS'))
x_bound(1,:) = str2num(fgetl(dump));
y_bound(1,:) = str2num(fgetl(dump));
z_bound(1,:) = str2num(fgetl(dump));
case 'ITEM: ATOMS'
else
if (strcmpi(id(1:11),'ITEM: ATOMS'))
atom_data = zeros(Natoms,ncol);%Allocate memory for atom data
for j = 1 : 1: Natoms
atom_data(j,:) = str2num(fgetl(dump));
end
done = 1;
p = ftell(dump);
end
end
end
end
end
......@@ -88,20 +93,26 @@ if last_status == 1
while ~feof(dump)
id = fgetl(dump);
switch id
case 'ITEM: NUMBER OF ATOMS'
Natoms = str2num(fgetl(dump));
case 'ITEM: BOX BOUNDS'
x_bound(1,:) = str2num(fgetl(dump));
y_bound(1,:) = str2num(fgetl(dump));
z_bound(1,:) = str2num(fgetl(dump));
case 'ITEM: ATOMS'
atom_data = zeros(Natoms,ncol);%Allocate memory for atom data
for j = 1 : 1: Natoms
atom_data(j,:) = str2num(fgetl(dump));
end
end
if (strcmpi(id,'ITEM: NUMBER OF ATOMS'))
Natoms = str2num(fgetl(dump));
else
if (strcmpi(id,'ITEM: BOX BOUNDS'))
x_bound(1,:) = str2num(fgetl(dump));
y_bound(1,:) = str2num(fgetl(dump));
z_bound(1,:) = str2num(fgetl(dump));
else
if (strcmpi(id(1:11),'ITEM: ATOMS'))
atom_data = zeros(Natoms,ncol);%Allocate memory for atom data
for j = 1 : 1: Natoms
atom_data(j,:) = str2num(fgetl(dump));
end
end
end
end
end
end
%----------Outputs-------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment