[Towhee-bugs] Bug Fixed: Incorect EAM Setfl file from towhee forcefield
Brought to you by:
marcus_martin
|
From: Oloriegbe, S. <olo...@mi...> - 2011-06-02 20:08:28
|
To those who may be using LAMMPS and towhee and needs to convert LAMMPS setfl file to towhee forcefiled format. There is a bug you need to clean up before getting the correct forcefield file for towhee.
In the file ffreadsetflfile.F subroutine ffreadsetflfile, some arguments of the to the subroutine twh_table_pair were not properly set, making forcefield to print the wrong bond distances for the embedding fundtion.
The original code look like this from line 148 to line 175.
do itype = 1,nbtype
do jtype= 1,itype
cross = twh_getnbtype(itype,jtype)
read(10,9902) (tableread(ir),ir=1,nr)
c --- need to convert this by dividing out the distance
c --- this is not valid for the first point, which we are
c --- going to remove
do ir = 2,nr
c --- set the second index of table_pair
call twh_table_pair(GLB_SET,1,cross,ir,dtemp) ------> Correction call twh_table_pair(GLB_GET,1,cross,ir,dtemp)
dvalue = CON_EVTOK*tableread(ir) / dtemp
call twh_table_pair(GLB_SET,2,cross,ir-1,dvalue)
c --- shift the value down one slot for the first index
call twh_table_pair(GLB_SET,1,cross,ir-1,dtemp) ------> Correction call twh_table_pair(GLB_GET,1,cross,ir-1,dtemp)
if ( itype .eq. 1 .and. jtype .eq. 1 ) then
write(12,*) dtemp,dvalue/CON_EVTOK
elseif ( itype .eq. 2 .and. jtype .eq. 1 ) then
write(13,*) dtemp,dvalue/CON_EVTOK
else
write(14,*) dtemp,dvalue/CON_EVTOK
endif
enddo
c --- reduce table_npair by 1
call twh_table_npair(GLB_GET,cross,ipair)
ipair = ipair - 1
call twh_table_npair(GLB_SET,cross,ipair)
enddo
enddo
The correction to this is to set the argument of twh_table_pair correctly as shown above (with arrows) and recompile forcefield.
Suleiman.
________________________________________
From: Oloriegbe, Suleiman
Sent: Friday, May 27, 2011 11:07 AM
To: mar...@us...
Cc: tow...@li...
Subject: Incorect Setfl file from towhee forcefield
Hello,
Please could anyone help me figure out why towhee forcefiled routine ffreadsetflfile.F is printing out incorrect distances after converting from setfl EAM file to tohwee_ff_* file. I check the code and the read format is
***** ignore line
***** ignore line
***** ignore line
number_of_atom_type
nrho, drho, nr, dr, rcutall
atomic_number atomic_mass
----- from here down it reads the data files for F(rho), V(r) and rho(r)
The current setfl files looks like this. Even after changing my setfl to conform to towhee read input, I still have alll the bond lengths coming out as the same ,in fact it is printing the atomic mass of the atoms, instead of incremental bond distance from zero to the cutoff distance.
I don't want to modify and recompile the forcefield code if there is no need for it, but towhee read format doesn't seems to conform to the current version of the EAM setfl files. Any help would be appreciated.
Suleiman.
___________________________________________________________________________________________________________________
#Potential generated by PoCo (FE) on 12/05/97 at 10.59.13
#Traj. : 2 C|2 C|2 C|2 C|1 C|1 C|sig|sig|sig|sig|Al |Al |Al |the|the|thet
#Aluminum (Z= 13)Copper (Z= 29)
2 Al Cu
500 0.1202404809619238E-01 500 0.1139742685370741E-01 0.5687316000000000E+01
13 26.982 4.0320 FCC
0.0000000000000000E+00 -0.1955308516385325E+00 -0.3709428419507702E+00 -0.5273976809256672E+00 -0.6660570785521777E+00
-0.7880827448192556E+00 -0.8946363897158549E+00 -0.9868796963197619E+00 -0.1065974238118134E+01 -0.1133082803697506E+01
-0.1189483618538492E+01 -0.1236684804602630E+01 -0.1276221658909149E+01 -0.1309629478477275E+01 -0.1338443547804706E+01
-0.1364199170700185E+01 -0.1388431699193629E+01 -0.1412676430304264E+01 -0.1438433576273574E+01 -0.1466328323264702E+01
-0.1496071075447100E+01 -0.1527329201951728E+01 -0.1559770061755740E+01 -0.1593061001677873E+01 -0.1626869383585991E+01
------------------------------------------- file truncated -------------------------------------------------
|