LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
[lammps-users] On multi/harmonic dihedrals
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lammps-users] On multi/harmonic dihedrals


From: Nicola Molinari <nicola.molinari89@...24...>
Date: Fri, 13 Apr 2018 12:13:16 -0400

Dear all,

I noticed this long time ago, but, as far as I read, this still seems to be an issue with the latest LAMMPS distribution I checked (16Mar18).

Very briefly, if adopting the multi/harmonic dihedrals style, when the user wants to use the usual write_data functionality, the multi/harmonic coefficients seem to be left out.

A quick fix that seemed to work is adding (to dihedral_multi_harmonic.cpp) something along the lines of:

/* ----------------------------------------------------------------------
   proc 0 writes to data file
------------------------------------------------------------------------- */

void DihedralMultiHarmonic::write_data(FILE *fp)
{
  for (int i = 1; i <= atom->ndihedraltypes; i++)
    fprintf(fp,"%d %g %g %g %g %g\n",i,a1[i],a2[i],a3[i],a4[i],a5[i]);
}

------------------------------------------------------------------------- */


And, to dihedral_multi_harmonic.h:

void write_data(FILE *);

I hope this helps :)

Best wishes,
Nicola