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

Re: [lammps-users] On multi/harmonic dihedrals


From: Axel Kohlmeyer <akohlmey@...24...>
Date: Fri, 13 Apr 2018 14:07:39 -0400

On Fri, Apr 13, 2018 at 12:13 PM, Nicola Molinari
<nicola.molinari89@...24...> wrote:
> 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.

yes, there should be a comment in the write_data documentation, noting
that not all styles (pair and other) support this functionality.
the LAMMPS developers hope, that users like you then report when they
are missing this kind of functionality.

> 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 :)

it would help more, if you just submit this as a pull request on
github and thus make it easy to add to the next LAMMPS patch release.

and while you are at it, it would help *even* more and make you a
"LAMMPS hero", if you would check, if there are other dihedral styles,
that are missing the write_data() method and add write_data support
for those as well, provided it makes sense (it doesn't for table or
hybrid styles).

axel.

>
> Best wishes,
> Nicola
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> lammps-users mailing list
> lammps-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lammps-users
>



-- 
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.