Skip to content

Commit

Permalink
lammpstrj2xyz_car_mdf_arc is updated
Browse files Browse the repository at this point in the history
lammpstrj2xyz_car_mdf_arc is updated
  • Loading branch information
dadaoqiuzhi committed Oct 6, 2021
1 parent a0e4147 commit a5b9ca6
Show file tree
Hide file tree
Showing 43 changed files with 1,336 additions and 91 deletions.
4 changes: 3 additions & 1 deletion ReaxFF_Gen/ReaxFF_Gen.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
%scrit file name ReaxFF_Gen
%purpose:
%Generation of standard file with ReaxFF force field parameters from literatures

disp('##################################################################################################################################')
disp('Welcome!--by Qiang Liu @Institute of Nuclear Physics and Chemistry, China Academy of Engineering Physics; Email: liubinqiang@163.com');
disp('Repository adress of the Source code on github: https://github.com/dadaoqiuzhi/RMD_Digging');
disp('References: 1.Fuel 287 (2021) 119484. 2.ACS Appl. Mat. Interfaces 13(34) (2021) 41287-41302. More work is coming!')
disp('##################################################################################################################################')

fprintf('Paste data from literatures into the input.txt, one blank Line for each block without the initio lines of pure character string\n');
fidin=fopen('input.txt','r');
Expand Down
Binary file added bonds_analysis/.bonds_analysis_speedup.m.un~
Binary file not shown.
2 changes: 1 addition & 1 deletion bonds_analysis/atomnummolecule_strcat.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%to form a molecular formula, only for single molecule with two columns.
function atomnummolecule=atomnummolecule_strcat(tarelenummatch)
atomnummolecule={};%initialization
[tarelenumrow,tarelenumcol]=size(tarelenummatch);
[tarelenumrow,~]=size(tarelenummatch);
strcatbin={};%temporary data
for j=1:tarelenumrow
if tarelenummatch{j,2}==1%1 is not shown in the molecular formula
Expand Down
4 changes: 3 additions & 1 deletion bonds_analysis/bondanamain.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
%reaxc package in LAMMPS.
%include functions:bonds_analysis bondorder_capture and bondorder_deepmining
%version 1;2018.6.29
disp('##################################################################################################################################')
disp('Welcome!--by Qiang Liu @Institute of Nuclear Physics and Chemistry, China Academy of Engineering Physics; Email: liubinqiang@163.com');
disp('Repository adress of the Source code on github: https://github.com/dadaoqiuzhi/RMD_Digging');

disp('References: 1.Fuel 287 (2021) 119484. 2.ACS Appl. Mat. Interfaces 13(34) (2021) 41287-41302. More work is coming!')
disp('##################################################################################################################################')
fprintf('\nThis program is the integration of: \n1.bonds_analysis (BO read)\n2.bonds_analysis with acceleration algorithm.')
fprintf('\n3.bondorder_capture (simple analysis)\n4.bondorder_deepmining (deep mining and classification)')
fprintf('\n5.speciesbond_classify (clustering and sorting)\n6.bondedatom_tracking (specific atom tracking)\n')
Expand Down
4 changes: 3 additions & 1 deletion bonds_analysis/bondedatom_tracking.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
%degradation of macromolecule.
%include bonds_analysis, bondorder_deepmining and bond_classify program
%version 1;2018.6.30
disp('##################################################################################################################################')
disp('Welcome!--by Qiang Liu @Institute of Nuclear Physics and Chemistry, China Academy of Engineering Physics; Email: liubinqiang@163.com');
disp('Repository adress of the Source code on github: https://github.com/dadaoqiuzhi/RMD_Digging');

disp('References: 1.Fuel 287 (2021) 119484. 2.ACS Appl. Mat. Interfaces 13(34) (2021) 41287-41302. More work is coming!')
disp('##################################################################################################################################')
fprintf('\nThis program is intended to track the specific atom in a species, the BO information is returned\n')
atomid=input('\nPlease input the interested atom id: \n');
fprintf('\nbondedatom_tracking is running, please wait...')
Expand Down
4 changes: 3 additions & 1 deletion bonds_analysis/bondorder_capture.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
%This program is used to analyze bond order information of simple molecule
%in a specific trajectory.
%version 1;2018.6.26
disp('##################################################################################################################################')
disp('Welcome!--by Qiang Liu @Institute of Nuclear Physics and Chemistry, China Academy of Engineering Physics; Email: liubinqiang@163.com');
disp('Repository adress of the Source code on github: https://github.com/dadaoqiuzhi/RMD_Digging');

disp('References: 1.Fuel 287 (2021) 119484. 2.ACS Appl. Mat. Interfaces 13(34) (2021) 41287-41302. More work is coming!')
disp('##################################################################################################################################')
fprintf('This program will analysis the BO information in bondoutdata of specified trajectory, helping to obtain the structure information')
fprintf('\nRepeated refine should considered for some complex case and the obtained last BO information should overwrite these in bondoutdata in advance')

Expand Down
4 changes: 3 additions & 1 deletion bonds_analysis/bondorder_deepmining.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
%This program is used to analyze bond order information of complex molecule
%in a specific trajectory.
%version 1;2018.6.29
disp('##################################################################################################################################')
disp('Welcome!--by Qiang Liu @Institute of Nuclear Physics and Chemistry, China Academy of Engineering Physics; Email: liubinqiang@163.com');
disp('Repository adress of the Source code on github: https://github.com/dadaoqiuzhi/RMD_Digging');

disp('References: 1.Fuel 287 (2021) 119484. 2.ACS Appl. Mat. Interfaces 13(34) (2021) 41287-41302. More work is coming!')
disp('##################################################################################################################################')
fprintf('This program is will analyze the BO information in bondoutdata, classifiec by molecular formula')
speciestrjnum=input('\nPlease input the trajectory timestep. It can be obtained from the analysis results of species files: \n');
elementsequence=input('Please input the atom type, e.g.C H O N etc with space interval, should be in line with the in.* or data file, especially for these with elements mapping to different elements.: \n','s');
Expand Down
4 changes: 3 additions & 1 deletion bonds_analysis/bonds_analysis.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
%purpose:
%This program is used to analyze bonds file
%version 1;2018.6.25
disp('##################################################################################################################################')
disp('Welcome!--by Qiang Liu @Institute of Nuclear Physics and Chemistry, China Academy of Engineering Physics; Email: liubinqiang@163.com');
disp('Repository adress of the Source code on github: https://github.com/dadaoqiuzhi/RMD_Digging');

disp('References: 1.Fuel 287 (2021) 119484. 2.ACS Appl. Mat. Interfaces 13(34) (2021) 41287-41302. More work is coming!')
disp('##################################################################################################################################')
fprintf('This program will read the BO information of a specified or all (not recommended) trajectories, the text in the 2-4 rows of each trajectory is omitted.\n')
dataname=input('Please input the file name to be processed: \n','s');
readmethod=input('Please select the way to read BO information: 1.specified trajectory 2.all trajectories. Select the No.: \n');
Expand Down
8 changes: 5 additions & 3 deletions bonds_analysis/bonds_analysis_speedup.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
%This program is used to analyze bonds file and is more fast than
%bonds_analysis program
%version 1;2018.6.25
disp('##################################################################################################################################')
disp('Welcome!--by Qiang Liu @Institute of Nuclear Physics and Chemistry, China Academy of Engineering Physics; Email: liubinqiang@163.com');
disp('Repository adress of the Source code on github: https://github.com/dadaoqiuzhi/RMD_Digging');

disp('References: 1.Fuel 287 (2021) 119484. 2.ACS Appl. Mat. Interfaces 13(34) (2021) 41287-41302. More work is coming!')
disp('##################################################################################################################################')
fprintf('This program will read the BO information of a specified or all (not recommended) trajectories, the text in the 2-4 rows of each trajectory is omitted.\n')
dataname=input('Please input the file name to be processed: \n','s');
trajper=input('Please input the output frequency of BO information (Positive integer): \n');
Expand Down Expand Up @@ -57,7 +59,7 @@
control=0;
end
else
disp('not timestep row, please check it!!!')
disp('Not timestep row, please check it!!!')
return;
end
end
Expand Down Expand Up @@ -137,4 +139,4 @@
fprintf('\nbonds_analysis is successfully finished. BO information is saved inbondoutdata.\n')

clear ans atomnum bondnumdata control datacell datacellchar datadel dataline dataname datarep datasplit found gap i j k kk line
clear outputans rawdata tartrajectory trajper unfound dataoutrow dataoutcol dataoutputrow dataoutcolchar dataoutputcol filename
clear outputans rawdata tartrajectory trajper unfound dataoutrow dataoutcol dataoutputrow dataoutcolchar dataoutputcol filename
142 changes: 142 additions & 0 deletions bonds_analysis/bonds_analysis_speedup.m~
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
%scrit file name bonds_analysis_speedup
%purpose:
%This program is used to analyze bonds file and is more fast than
%bonds_analysis program
%version 1;2018.6.25
disp('##################################################################################################################################')
disp('Welcome!--by Qiang Liu @Institute of Nuclear Physics and Chemistry, China Academy of Engineering Physics; Email: liubinqiang@163.com');
disp('Repository adress of the Source code on github: https://github.com/dadaoqiuzhi/RMD_Digging');
disp('References: 1.Fuel 287 (2021) 119484. 2.ACS Appl. Mat. Interfaces 13(34) (2021) 41287-41302. More work is coming!')
disp('##################################################################################################################################')
fprintf('This program will read the BO information of a specified or all (not recommended) trajectories, the text in the 2-4 rows of each trajectory is omitted.\n')
dataname=input('Please input the file name to be processed: \n','s');
trajper=input('Please input the output frequency of BO information (Positive integer): \n');
tartrajectory=input('\nPlease input the timestep of the specified trajectory: \n');
atomnum=input('Please input atom number: \n');
disp('bonds_analysis_speedup is running, please wait...')
tartrajectory={tartrajectory(1)};
if mod(tartrajectory{1},trajper)~=0
control=0;
fprintf('\nThis trajectory is not existed, please check it!!!\n')
return;
else
control=1;
end


readline=0;
gap=8+atomnum;
rawdata=fopen(dataname,'r');
dataline=fgetl(rawdata);
readline=readline+1;
datacell=textscan(dataline,'%s','delimiter','\n');
datacellchar=char(datacell{1});
datadel=strrep(datacellchar,'#','');
datarep=strtrim(datadel);
datasplit=strsplit(datarep);
if str2num(datasplit{1,2})==tartrajectory{1}
control=0;
else
while control
i=1;
unfound=1;
while unfound
dataline=fgetl(rawdata);
readline=readline+1;
i=i+1;
if i==gap+1
unfound=0;
break;
end
end
if mod(readline-1,gap)==0
datacell=textscan(dataline,'%s','delimiter','\n');
datacellchar=char(datacell{1});
datadel=strrep(datacellchar,'#','');
datarep=strtrim(datadel);
datasplit=strsplit(datarep);
if str2num(datasplit{1,2})==tartrajectory{1}
control=0;
end
else
disp('not timestep row, please check it!!!')
return;
end
end
end

found=6;
while found
dataline=fgetl(rawdata);
readline=readline+1;
found=found-1;
end

bondoutdata={};
bondoutdata{1,1}='Timestep';
bondoutdata{1,2}=tartrajectory{1};
for i=3:15
bondoutdata{1,i}=[];
end

line=2;
while atomnum
dataline=fgetl(rawdata);
readline=readline+1;
atomnum=atomnum-1;
if atomnum<=0
break;
end
datacell=textscan(dataline,'%s','delimiter','\n');
datacellchar=char(datacell{1});
datarep=strtrim(datacellchar);
datasplit=strsplit(datarep);
bondnumdata={};
bondnumdata(1,1:3)=datasplit(1,1:3);
if ~strcmp(datasplit{1,3},'0')
for i=1:str2num(datasplit{1,3})
bondnumdata(1,i+3)=datasplit(1,i+3);
end
bondnumdata(1,8)=datasplit(1,i+4);
k=i+5;
for j=1:str2num(datasplit{1,3})
bondnumdata(1,j+8)=datasplit(1,k);
k=k+1;
end
bondnumdata(1,13:15)=datasplit(1,k:k+2);
else
bondnumdata(1,8)=datasplit(1,4);
bondnumdata(1,13)=datasplit(1,5);
bondnumdata(1,14)=datasplit(1,6);
bondnumdata(1,15)=datasplit(1,7);
end
for kk=1:length(bondnumdata)
if isempty(bondnumdata{kk})
bondnumdata{kk}='NaN';
else
bondnumdata{kk}=str2num(bondnumdata{kk});
end
end
for kk=1:length(bondnumdata)
bondoutdata{line,kk}=bondnumdata{kk};
end
line=line+1;
end
fclose(rawdata);
fprintf('\nbonds_analysis is successfully finished, BO information is saved inbondoutdata')

outputans=input('Export results? y/n?: \n','s');
outputans=lower(outputans);
if outputans=='y'
[dataoutrow,dataoutcol]=size(bondoutdata);
dataoutputrow=strcat('A','1');
dataoutcolchar=char(65+dataoutcol-1);
dataoutputcol=strcat(dataoutcolchar,num2str(dataoutrow));
filename='output_mydata.xlsx';
xlswrite(filename,bondoutdata,dataoutputrow:dataoutputcol)
fprintf('\nbonds_analysis is successfully finished. BO information is exported into the excel:output_mydata\n')
end
fprintf('\nbonds_analysis is successfully finished. BO information is saved inbondoutdata.\n')

clear ans atomnum bondnumdata control datacell datacellchar datadel dataline dataname datarep datasplit found gap i j k kk line
clear outputans rawdata tartrajectory trajper unfound dataoutrow dataoutcol dataoutputrow dataoutcolchar dataoutputcol filename
4 changes: 3 additions & 1 deletion bonds_analysis/speciesbond_classify.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
%This program is used to rearrange the molecule and corresponding bond boder information processed and generated
%the by bondorder_deepmining program
%version 1;2018.6.29
disp('##################################################################################################################################')
disp('Welcome!--by Qiang Liu @Institute of Nuclear Physics and Chemistry, China Academy of Engineering Physics; Email: liubinqiang@163.com');
disp('Repository adress of the Source code on github: https://github.com/dadaoqiuzhi/RMD_Digging');

disp('References: 1.Fuel 287 (2021) 119484. 2.ACS Appl. Mat. Interfaces 13(34) (2021) 41287-41302. More work is coming!')
disp('##################################################################################################################################')
fprintf('\nThis program takes the following preferential options into consideration: elements (C,H,O, etc), total atom number (atsum). multi-step refinement can be performed\n')
elementsort=input('\nPlease input the ranking priority, seperated by white space\n','s');
elementsort=upper(elementsort);
Expand Down
Binary file added chemi_mechanism/.bonds_analysis_speedup.m.un~
Binary file not shown.
4 changes: 3 additions & 1 deletion chemi_mechanism/bondorder_deepmining.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
%This program is used to analyze bond order information of complex molecule
%in a specific trajectory.
%version 1;2018.6.29

disp('##################################################################################################################################')
disp('Welcome!--by Qiang Liu @Institute of Nuclear Physics and Chemistry, China Academy of Engineering Physics; Email: liubinqiang@163.com');
disp('Repository adress of the Source code on github: https://github.com/dadaoqiuzhi/RMD_Digging');
disp('References: 1.Fuel 287 (2021) 119484. 2.ACS Appl. Mat. Interfaces 13(34) (2021) 41287-41302. More work is coming!')
disp('##################################################################################################################################')
fprintf('\nbondorder_deepmining is running, please wait...')
element=elementsequence;
numseq={};
Expand Down
8 changes: 5 additions & 3 deletions chemi_mechanism/bonds_analysis_speedup.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
%This program is used to analyze bonds file and is more fast than
%bonds_analysis program
%version 1;2018.6.25
disp('##################################################################################################################################')
disp('Welcome!--by Qiang Liu @Institute of Nuclear Physics and Chemistry, China Academy of Engineering Physics; Email: liubinqiang@163.com');
disp('Repository adress of the Source code on github: https://github.com/dadaoqiuzhi/RMD_Digging');

disp('References: 1.Fuel 287 (2021) 119484. 2.ACS Appl. Mat. Interfaces 13(34) (2021) 41287-41302. More work is coming!')
disp('##################################################################################################################################')
tartrajectory={tartrajectory(1)};
if mod(tartrajectory{1,1},trajper)~=0
control=0;
Expand Down Expand Up @@ -115,7 +117,7 @@
end
fclose(rawdata);

fprintf('\nbonds_analysis_speedup is successfully finished, BO information is saved inbondoutdata, search line number is recorded in readline,')
fprintf('\nbonds_analysis_speedup is successfully finished, BO information is saved in bondoutdata, search line number is recorded in readline,')

clear atomnumcopy ans bondnumdata control datacell datacellchar datadel dataline datarep datasplit found gap i j k kk line
clear outputans unfound dataoutrow dataoutcol dataoutputrow dataoutcolchar dataoutputcol filename
clear outputans unfound dataoutrow dataoutcol dataoutputrow dataoutcolchar dataoutputcol filename
Loading

0 comments on commit a5b9ca6

Please sign in to comment.