bug fixes
This commit is contained in:
@ -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 ylo yhi
|
||||||
0 41.91 zlo zhi
|
0 41.91 zlo zhi
|
||||||
6 pitorsion types
|
6 pitorsion types
|
||||||
106 bitorsions
|
71 bitorsions
|
||||||
106 pitorsions
|
106 pitorsions
|
||||||
|
|
||||||
Masses
|
Masses
|
||||||
|
|||||||
@ -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"
|
||||||
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 "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
|
pair_coeff * * amoeba_ubiquitin.prm amoeba_ubiquitin.key
|
||||||
|
|
||||||
special_bonds lj/coul 0.5 0.5 0.5 one/five yes
|
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
|
compute virial all pressure NULL virial
|
||||||
|
|
||||||
thermo_style custom step temp epair ebond eangle edihed eimp &
|
thermo_style custom step temp epair ebond eangle edihed eimp &
|
||||||
emol etotal press c_virial[*]
|
emol etotal #press c_virial[*]
|
||||||
|
|
||||||
# zero step run
|
# zero step run
|
||||||
|
|
||||||
|
|||||||
@ -132,11 +132,9 @@ FixBiTorsion::FixBiTorsion(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
max_bitorsion_list = 0;
|
max_bitorsion_list = 0;
|
||||||
bitorsion_list = nullptr;
|
bitorsion_list = nullptr;
|
||||||
|
|
||||||
// BiTorsion grid data
|
// zero thermo energy
|
||||||
|
|
||||||
ntypes = 0;
|
ebitorsion = 0.0;
|
||||||
nxgrid,nygrid = nullptr;
|
|
||||||
btgrid = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
@ -166,7 +164,7 @@ FixBiTorsion::~FixBiTorsion()
|
|||||||
|
|
||||||
delete [] nxgrid;
|
delete [] nxgrid;
|
||||||
delete [] nygrid;
|
delete [] nygrid;
|
||||||
for (int itype = 0; itype < ntypes; itype++)
|
for (int itype = 1; itype <= ntypes; itype++)
|
||||||
memory->destroy(btgrid[itype]);
|
memory->destroy(btgrid[itype]);
|
||||||
delete [] btgrid;
|
delete [] btgrid;
|
||||||
}
|
}
|
||||||
@ -304,7 +302,7 @@ void FixBiTorsion::pre_neighbor()
|
|||||||
bitorsion_list[nbitorsion_list][2] = atom3;
|
bitorsion_list[nbitorsion_list][2] = atom3;
|
||||||
bitorsion_list[nbitorsion_list][3] = atom4;
|
bitorsion_list[nbitorsion_list][3] = atom4;
|
||||||
bitorsion_list[nbitorsion_list][4] = atom5;
|
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++;
|
nbitorsion_list++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -399,7 +397,7 @@ void FixBiTorsion::post_force(int vflag)
|
|||||||
id = bitorsion_list[n][3];
|
id = bitorsion_list[n][3];
|
||||||
ie = bitorsion_list[n][4];
|
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];
|
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);
|
MPI_Bcast(&ntypes,1,MPI_INT,0,world);
|
||||||
if (ntypes == 0) error->all(FLERR,"Fix bitorsion file has no types");
|
if (ntypes == 0) error->all(FLERR,"Fix bitorsion file has no types");
|
||||||
|
|
||||||
btgrid = new double***[ntypes];
|
btgrid = new double***[ntypes+1];
|
||||||
nxgrid = new int[ntypes];
|
nxgrid = new int[ntypes+1];
|
||||||
nygrid = new int[ntypes];
|
nygrid = new int[ntypes+1];
|
||||||
|
|
||||||
// read one array for each BiTorsion type from file
|
// read one array for each BiTorsion type from file
|
||||||
|
|
||||||
int tmp,nx,ny;
|
int tmp,nx,ny;
|
||||||
double xgrid,ygrid,value;
|
double xgrid,ygrid,value;
|
||||||
|
|
||||||
for (int itype = 0; itype < ntypes; itype++) {
|
for (int itype = 1; itype <= ntypes; itype++) {
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
eof = fgets(line,MAXLINE,fp);
|
eof = fgets(line,MAXLINE,fp);
|
||||||
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);
|
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]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|||||||
@ -95,6 +95,10 @@ FixPiTorsion::FixPiTorsion(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
// pitorsion coeff
|
// pitorsion coeff
|
||||||
|
|
||||||
kpit = nullptr;
|
kpit = nullptr;
|
||||||
|
|
||||||
|
// zero thermo energy
|
||||||
|
|
||||||
|
epitorsion = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -1384,7 +1384,7 @@ if npitorsions:
|
|||||||
d.sections["PiTorsions"] = lines
|
d.sections["PiTorsions"] = lines
|
||||||
|
|
||||||
if nbitorsions:
|
if nbitorsions:
|
||||||
d.headers["bitorsions"] = len(pitorsionlist)
|
d.headers["bitorsions"] = len(bitorsionlist)
|
||||||
|
|
||||||
# if there are bitorsions, then -bitorsion file must have been specified
|
# if there are bitorsions, then -bitorsion file must have been specified
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user