Angle and Dihedral Issues with IBI and LAMMPS

205 views
Skip to first unread message

Joshua Moore

unread,
Mar 3, 2017, 9:34:52 PM3/3/17
to votca
Hello,

I am seeing some issues with angle and dihedral translation issues.

1) Angles

In the attached ANGLE_ISSUE.PNG, I illustrate the issue.

On step000, the initial angle potential is inverted correctly from the angle distribution.  The unit conversion appears to be correct.  On step001, it also is translated corrected during the scale, smoothing, extrapolation, interpolation, and shifting steps.  However, it appears when the LAMMPS table file is written for the angle, something goes wrong.  Here I compare to the initial inversion by hand which is shifted in step000, which accounts for the difference.  The smoothing, extrapolation, interpolation steps fall on top of one another, and the shifting step is shifted of course.

Again here the issue appears to be the lammps table writing step, although I haven't been able to find the issue in the code.  Any ideas? 

2) Dihedrals

See attached DIHEDRAL_ISSUE.PNG

Here, there may very well be a LAMMPS table writing issue as with the angles, but on step001 the first issue that occurs is on the smoothing steps, where it drops most of the data points and fits only 11 points.  This is the cause for the difference.  This is then populated through to the next steps including writing the LAMMPS table file.  Although the smooth, extrapolation, interpolation, and shifting steps are in radians, the scaling step writes the file in degrees, although it appears this is not subsequently used.  This scaling step is correct in the translation of the potential and the number of points.  The next step I think after this is the smoothing step which again drops most of the points and appears to be the major issue here. 

I think the dihedral issue might be a general issue in VOTCA and not necessarily a problem with interfacing with LAMMPS?


Thanks in advance.

Josh


ANGLE_ISSUE.PNG
DIHEDRAL_ISSUE.PNG

Joshua Moore

unread,
Mar 4, 2017, 1:26:02 PM3/4/17
to votca
1) Angles

I realized I was not using the development version.  Sorry about this.  This issue seems to have been corrected in the development version.  I'm still not exactly what the change was to fix this, but it is correct in the development version.  

2) Dihedrals

I found two issues

a) In potential_to_lammps.sh, there was a scaling to degrees for the "scale" step.  This seems to be the cause of it dropping points in the smoothing step.  If you remove this being applied to the $bondtype="dihedral", this issue goes away.

However, there was a second issue related to the units LAMMPS expects for the dihedral.  I originally thought the default was radians, but it appears it is degrees.  We need to add this to table_to_tab.pl so that LAMMPS knows the table is in radians.  Then remove the previous check for dihedrals when it is scaling.

} elsif ($type eq "dihedral" ) {
  printf(OUTFILE "VOTCA"\n");
  printf(OUTFILE "N %i RADIANS\n\n",$#r+1);
  .
  .
  .

LAMMPS seems to be finicky for the derivative for the dihedrals, and I think the amount of noise in the distribution is causing an issue for short runs and LAMMPS is complaining that the dihedral table has inconsistent forces.  I'm assuming VOTCA is generating these from a spline?  The issue seems to be alleviated with longer runs.  However, LAMMPS has an option to leave off the forces for the dihedral table and let LAMMPS calculate them.  I'll look into this some more to see if this helps.

I'll work on a pull request if you agree.

Thanks.

Josh

Christoph Junghans

unread,
Mar 4, 2017, 11:45:23 PM3/4/17
to vo...@googlegroups.com
2017-03-04 11:26 GMT-07:00 Joshua Moore <jdm...@ncsu.edu>:
> 1) Angles
>
> I realized I was not using the development version. Sorry about this. This
> issue seems to have been corrected in the development version. I'm still
> not exactly what the change was to fix this, but it is correct in the
> development version.
>
> 2) Dihedrals
>
> I found two issues
>
> a) In potential_to_lammps.sh, there was a scaling to degrees for the "scale"
> step. This seems to be the cause of it dropping points in the smoothing
> step. If you remove this being applied to the $bondtype="dihedral", this
> issue goes away.
The issue is that the table beginning and ending should be converted
to degrees as well in the case of dihedral potentials. For the "angle"
type this issue doesn't appear as the table always goes from 0 to 180
(both in degrees already.)

>
> However, there was a second issue related to the units LAMMPS expects for
> the dihedral. I originally thought the default was radians, but it appears
> it is degrees. We need to add this to table_to_tab.pl so that LAMMPS knows
> the table is in radians. Then remove the previous check for dihedrals when
> it is scaling.
>
> } elsif ($type eq "dihedral" ) {
> printf(OUTFILE "VOTCA"\n");
> printf(OUTFILE "N %i RADIANS\n\n",$#r+1);
> .
> .
> .
>
> LAMMPS seems to be finicky for the derivative for the dihedrals, and I think
> the amount of noise in the distribution is causing an issue for short runs
> and LAMMPS is complaining that the dihedral table has inconsistent forces.
> I'm assuming VOTCA is generating these from a spline? The issue seems to be
> alleviated with longer runs. However, LAMMPS has an option to leave off the
> forces for the dihedral table and let LAMMPS calculate them. I'll look into
> this some more to see if this helps.
>
> I'll work on a pull request if you agree.
Thanks Josh! Your pull request at
<https://github.com/votca/csg/pull/202> seems to fix the two issues
above.

Christoph
> --
> You received this message because you are subscribed to the Google Groups
> "votca" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to votca+un...@googlegroups.com.
> To post to this group, send email to vo...@googlegroups.com.
> Visit this group at https://groups.google.com/group/votca.
> For more options, visit https://groups.google.com/d/optout.



--
Christoph Junghans
Web: http://www.compphys.de

Joshua Moore

unread,
Mar 7, 2017, 10:35:54 AM3/7/17
to votca
The current calculation is causing a discontinuity in the dihedral at the ends, and I think this is occasionally leading to issues in the simulation, at least I think this is the reason.  Please see attached.

Do we need to add back in the end calculation as you were mentioning?  Maybe that was needed.

Thanks.

Josh
dihedral.png

Joshua Moore

unread,
Mar 7, 2017, 11:12:13 AM3/7/17
to votca
Nevermind.  That was in my original distribution, so VOTCA was inverting it.

How can you measure the dihedral distribution during the IBI without having a discontinuity at the end? Otherwise the dpot would try to include this discontinuity. 

Do you measure just a bit less than 3.1415?

Christoph Junghans

unread,
Mar 8, 2017, 4:02:08 PM3/8/17
to vo...@googlegroups.com
2017-03-07 9:12 GMT-07:00 Joshua Moore <jdm...@ncsu.edu>:
> Nevermind. That was in my original distribution, so VOTCA was inverting it.
>
> How can you measure the dihedral distribution during the IBI without having
> a discontinuity at the end? Otherwise the dpot would try to include this
> discontinuity.
Sorry, my experience with dihedral interactions are pretty limited.

In the case of gromacs we force the table to be periodic:
https://github.com/votca/csg/blob/master/share/scripts/inverse/table_to_xvg.pl#L99
You might want to copy that part for LAMMPS as well.

Christoph

CHRISTINA-ANNA GATSIOU

unread,
Nov 21, 2019, 8:33:16 AM11/21/19
to votca
Hi all,

I have come across the same problem with angles, dihedrals in IBI/LAMMPS. My settings.xml input is in radians but there seems that some weird conversions to degrees in the potential postprocessing scripts. I am afraid that there might be a bug there. Is this something fixed in the latest VOTCA release.
Please find attached my potential file for the dihedral, the inverse.log and the settings.xml.

Thanks in advance,
Christianna

PS. In the highlighted line I believe the step is in degrees and the range in radians. 

Running subscript 'table_linearop.pl --on-x C1-EO-EO-EO.pot.cur C1-EO-EO-EO.pot.scale.Cj25u 57.2957795 0' (from tags table linearop) dir /opt/Scienomics/V
OTCA/share/votca/scripts/inverse
table_linearop.pl: C1-EO-EO-EO.pot.cur to C1-EO-EO-EO.pot.scale.Cj25u with x' = 57.2957795*x + 0
Running critical command 'mktemp C1-EO-EO-EO.pot.smooth.XXXXX'
Running critical command 'csg_resample --in C1-EO-EO-EO.pot.scale.Cj25u --out C1-EO-EO-EO.pot.smooth.Ht0SG --grid -3.14:2.86479:3.14'
Running critical command 'mktemp C1-EO-EO-EO.pot.extrapol.XXXXX'
Running subscript 'potential_extrapolate.sh --type dihedral C1-EO-EO-EO.pot.smooth.Ht0SG C1-EO-EO-EO.pot.extrapol.rE0wI' (from tags potential extrapolate)

settings.xml
inverse.log
C1-EO-EO-EO.dist.tgt

Christoph Junghans

unread,
Nov 22, 2019, 1:41:03 PM11/22/19
to vo...@googlegroups.com
On Thu, Nov 21, 2019 at 6:33 AM CHRISTINA-ANNA GATSIOU
<christian...@gmail.com> wrote:
>
> Hi all,
>
> I have come across the same problem with angles, dihedrals in IBI/LAMMPS. My settings.xml input is in radians but there seems that some weird conversions to degrees in the potential postprocessing scripts. I am afraid that there might be a bug there. Is this something fixed in the latest VOTCA release.
> Please find attached my potential file for the dihedral, the inverse.log and the settings.xml.
I ran:
$ csg_call --options settings.xml --ia-name C1-EO-EO-EO --ia-type
dihedral convert_potential lammps C1-EO-EO-EO.dist.tgt foo.pot
outside to csg_inverse to reproduce the issue, but it didn't show up,
so I believe this was fixed by: https://github.com/votca/csg/pull/202
Let me know if it didn't! (And if so please attach C1-EO-EO-EO.pot.cur).

Btw, what version of VOTCA are you using?

Christoph

>
> Thanks in advance,
> Christianna
>
> PS. In the highlighted line I believe the step is in degrees and the range in radians.
>
> Running subscript 'table_linearop.pl --on-x C1-EO-EO-EO.pot.cur C1-EO-EO-EO.pot.scale.Cj25u 57.2957795 0' (from tags table linearop) dir /opt/Scienomics/V
> OTCA/share/votca/scripts/inverse
> table_linearop.pl: C1-EO-EO-EO.pot.cur to C1-EO-EO-EO.pot.scale.Cj25u with x' = 57.2957795*x + 0
> Running critical command 'mktemp C1-EO-EO-EO.pot.smooth.XXXXX'
> Running critical command 'csg_resample --in C1-EO-EO-EO.pot.scale.Cj25u --out C1-EO-EO-EO.pot.smooth.Ht0SG --grid -3.14:2.86479:3.14'
> Running critical command 'mktemp C1-EO-EO-EO.pot.extrapol.XXXXX'
> Running subscript 'potential_extrapolate.sh --type dihedral C1-EO-EO-EO.pot.smooth.Ht0SG C1-EO-EO-EO.pot.extrapol.rE0wI' (from tags potential extrapolate)
>
> --
> You received this message because you are subscribed to the Google Groups "votca" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to votca+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/votca/b64fd306-d19a-472c-a52f-9b0ef9eb5884%40googlegroups.com.

CHRISTINA-ANNA GATSIOU

unread,
Nov 28, 2019, 6:51:36 AM11/28/19
to vo...@googlegroups.com
Hi Christoph,

We are using VOTCA-1.4.1. Probably we should switch to the latest version.

Best regards,
Christianna

Reply all
Reply to author
Forward
0 new messages