diff --git a/examples/amoeba/data.ubiquitin b/examples/amoeba/data.ubiquitin index 2e4836880a..6b51695efb 100644 --- a/examples/amoeba/data.ubiquitin +++ b/examples/amoeba/data.ubiquitin @@ -14,7 +14,7 @@ LAMMPS data file created from Tinker ubiquitin.xyz and amoeba_ubiquitin.prm file 0 41.91 ylo yhi 0 41.91 zlo zhi 6 pitorsion types -106 bitorsions +71 bitorsions 106 pitorsions Masses diff --git a/examples/amoeba/in.ubiquitin b/examples/amoeba/in.ubiquitin index f53a3c87c8..dbf544b402 100644 --- a/examples/amoeba/in.ubiquitin +++ b/examples/amoeba/in.ubiquitin @@ -26,9 +26,10 @@ fix extra2 all property/atom i_polaxe #read_data data.ubiquitin fix amtype NULL "Tinker Types" read_data data.ubiquitin fix amtype NULL "Tinker Types" & fix pitorsion "pitorsion types" "PiTorsion Coeffs" & - fix pitorsion pitorsions PiTorsions + fix pitorsion pitorsions PiTorsions & + fix bitorsion bitorsions BiTorsions -pair_style amoeba include bitorsion +pair_style amoeba exclude bitorsion pair_coeff * * amoeba_ubiquitin.prm amoeba_ubiquitin.key special_bonds lj/coul 0.5 0.5 0.5 one/five yes @@ -38,7 +39,7 @@ special_bonds lj/coul 0.5 0.5 0.5 one/five yes compute virial all pressure NULL virial thermo_style custom step temp epair ebond eangle edihed eimp & - emol etotal press c_virial[*] + emol etotal #press c_virial[*] # zero step run diff --git a/src/AMOEBA/fix_bitorsion.cpp b/src/AMOEBA/fix_bitorsion.cpp index 44669cb68e..a1bb149872 100644 --- a/src/AMOEBA/fix_bitorsion.cpp +++ b/src/AMOEBA/fix_bitorsion.cpp @@ -132,11 +132,9 @@ FixBiTorsion::FixBiTorsion(LAMMPS *lmp, int narg, char **arg) : max_bitorsion_list = 0; bitorsion_list = nullptr; - // BiTorsion grid data + // zero thermo energy - ntypes = 0; - nxgrid,nygrid = nullptr; - btgrid = nullptr; + ebitorsion = 0.0; } /* --------------------------------------------------------------------- */ @@ -166,7 +164,7 @@ FixBiTorsion::~FixBiTorsion() delete [] nxgrid; delete [] nygrid; - for (int itype = 0; itype < ntypes; itype++) + for (int itype = 1; itype <= ntypes; itype++) memory->destroy(btgrid[itype]); delete [] btgrid; } @@ -304,7 +302,7 @@ void FixBiTorsion::pre_neighbor() bitorsion_list[nbitorsion_list][2] = atom3; bitorsion_list[nbitorsion_list][3] = atom4; bitorsion_list[nbitorsion_list][4] = atom5; - bitorsion_list[nbitorsion_list][6] = bitorsion_type[i][m]; + bitorsion_list[nbitorsion_list][5] = bitorsion_type[i][m]; nbitorsion_list++; } } @@ -399,7 +397,7 @@ void FixBiTorsion::post_force(int vflag) id = bitorsion_list[n][3]; ie = bitorsion_list[n][4]; - // NOTE: is a btype ever needed, maybe as index into spline tables? + // NOTE: is a btype ever used, i.e. as index into spline tables? btype = bitorsion_list[n][5]; @@ -721,16 +719,16 @@ void FixBiTorsion::read_grid_data(char *bitorsion_file) MPI_Bcast(&ntypes,1,MPI_INT,0,world); if (ntypes == 0) error->all(FLERR,"Fix bitorsion file has no types"); - btgrid = new double***[ntypes]; - nxgrid = new int[ntypes]; - nygrid = new int[ntypes]; + btgrid = new double***[ntypes+1]; + nxgrid = new int[ntypes+1]; + nygrid = new int[ntypes+1]; // read one array for each BiTorsion type from file int tmp,nx,ny; double xgrid,ygrid,value; - for (int itype = 0; itype < ntypes; itype++) { + for (int itype = 1; itype <= ntypes; itype++) { if (me == 0) { eof = fgets(line,MAXLINE,fp); eof = fgets(line,MAXLINE,fp); @@ -766,20 +764,6 @@ void FixBiTorsion::read_grid_data(char *bitorsion_file) } if (me == 0) fclose(fp); - - // DEBUG - - for (int i = 0; i < ntypes; i++) { - printf("ITYPE %d NXY %d %d\n",i+1,nxgrid[i],nygrid[i]); - for (int iy = 0; iy < ny; iy++) { - for (int ix = 0; ix < nx; ix++) { - printf(" IXY %d %d, values %g %g %g\n",ix+1,iy+1, - btgrid[i][ix][iy][0], - btgrid[i][ix][iy][1], - btgrid[i][ix][iy][2]); - } - } - } } // ---------------------------------------------------------------------- diff --git a/src/AMOEBA/fix_pitorsion.cpp b/src/AMOEBA/fix_pitorsion.cpp index b66ffa0525..689097df99 100644 --- a/src/AMOEBA/fix_pitorsion.cpp +++ b/src/AMOEBA/fix_pitorsion.cpp @@ -95,6 +95,10 @@ FixPiTorsion::FixPiTorsion(LAMMPS *lmp, int narg, char **arg) : // pitorsion coeff kpit = nullptr; + + // zero thermo energy + + epitorsion = 0.0; } /* --------------------------------------------------------------------- */ diff --git a/tools/tinker/tinker2lmp.py b/tools/tinker/tinker2lmp.py index b09ec6e031..fec9f8a506 100644 --- a/tools/tinker/tinker2lmp.py +++ b/tools/tinker/tinker2lmp.py @@ -1384,7 +1384,7 @@ if npitorsions: d.sections["PiTorsions"] = lines if nbitorsions: - d.headers["bitorsions"] = len(pitorsionlist) + d.headers["bitorsions"] = len(bitorsionlist) # if there are bitorsions, then -bitorsion file must have been specified