Skip to content

Commit

Permalink
Recognize Drude particles, improve handling of lone pairs (#1099)
Browse files Browse the repository at this point in the history
* Start reading lone pairs

* Add check for zero total mass when using mass weighting for distance

* Check for zero mass in masks for angle/dihedral calcs

* Read and store lone pairs

* Read the lone pair atoms

* Add bonds from lone pair info

* Prefer https, more portable

* Check for zero mass last to preserve backwards compat. as much as possible.

* Add Drude element. Add support for detecting Drude particles from charmm PSF

* Add geom keyword to vector, check for zero mass in masks

* Hide some debug info

* Version 6.29.0. Minor version bump for recognition of Drude particles and checks for zero mass in distance/angle/dihedral/vector

* Add bondparminfo command

* Add angle

* If adding a duplicate bond, if the existing bond has no parameter but there is a parameter being passed in, use the passed in parameter.

* Add some defaults for lone pair bonds

* Save dihedrals. Not sure if saving torsion in phase is ok for lone pairs...

* Add 'debye' keyword to report 'vector dipole' units as Debye

* Add drude versions of ala3

* Add Drude PSF read test

* Fix help

* Document bondparminfo

* Document vector geom and debye

* Add old Atom constructor back for pytraj

* Increase tag size by 1 for storing null for sscanf("%10s")

* Add PDF versions of the manual and dev guide.

* Disable automatic build of the manual until lyx on Jenkins is updated.

* Change documentation URLs to GitHub for now until Jenkins is updated.
  • Loading branch information
drroe authored Aug 29, 2024
1 parent 285e008 commit 6666588
Show file tree
Hide file tree
Showing 28 changed files with 995 additions and 90 deletions.
102 changes: 51 additions & 51 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -191,56 +191,56 @@ pipeline {
}
}

stage("Post-test steps") {
parallel {
stage("Publish the manual") {
stages {
stage("Build the manual") {
agent {
docker {
image 'ambermd/lyx:latest'
alwaysPull true
}
}

steps {
unstash "source"
sh """#!/bin/sh -ex
make docs
cd doc
lyx -batch --export pdf2 CpptrajManual.lyx
lyx -batch --export pdf2 CpptrajDevelopmentGuide.lyx
"""
stash includes: "doc/**", name: "documentation"
}

post { cleanup { deleteDir() } }
}
stage("Publish the manual") {
agent { label 'linux' }

steps {
unstash 'documentation'
// Eventually it would be nice to do something better than simply archive
// and make the artifacts available from Jenkins.
archiveArtifacts 'doc/CpptrajManual.pdf,doc/CpptrajDevelopmentGuide.pdf'
// It would be nice to get this in a better place, but for now this
// will suffice.
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: false,
reportDir: 'doc/html',
reportFiles: 'index.html',
reportName: 'Doxygen Documentation',
reportTitles: ''])
}

post { cleanup { deleteDir() } }
}
}
}
}
}
//stage("Post-test steps") {
// parallel {
// stage("Publish the manual") {
// stages {
// stage("Build the manual") {
// agent {
// docker {
// image 'ambermd/lyx:latest'
// alwaysPull true
// }
// }

// steps {
// unstash "source"
// sh """#!/bin/sh -ex
// make docs
// cd doc
// lyx -batch --export pdf2 CpptrajManual.lyx
// lyx -batch --export pdf2 CpptrajDevelopmentGuide.lyx
// """
// stash includes: "doc/**", name: "documentation"
// }

// post { cleanup { deleteDir() } }
// }
// stage("Publish the manual") {
// agent { label 'linux' }

// steps {
// unstash 'documentation'
// // Eventually it would be nice to do something better than simply archive
// // and make the artifacts available from Jenkins.
// archiveArtifacts 'doc/CpptrajManual.pdf,doc/CpptrajDevelopmentGuide.pdf'
// // It would be nice to get this in a better place, but for now this
// // will suffice.
// publishHTML([
// allowMissing: false,
// alwaysLinkToLastBuild: false,
// keepAll: false,
// reportDir: 'doc/html',
// reportFiles: 'index.html',
// reportName: 'Doxygen Documentation',
// reportTitles: ''])
// }

// post { cleanup { deleteDir() } }
// }
// }
// }
// }
//}
}
}
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,14 @@ specified in the file LICENSE.
Documentation
=============
The `/doc` subdirectory contains PDF and LyX versions of the CPPTRAJ manual.
The latest version of the manual is compiled each time new code is merged
and is available for download
[here.](https://jenkins.jasonswails.com/job/amber-github/job/cpptraj/job/master/lastSuccessfulBuild/artifact/doc/CpptrajManual.pdf)
The latest version of the manual is available for download
[here.](https://raw.githubusercontent.com/Amber-MD/cpptraj/master/doc/CpptrajManual.pdf)
An HTML version can be found [here](https://amber-md.github.io/cpptraj/). There
is also limited help for commands in interactive mode via `help [<command>]`;
`help` with no arguments lists all known commands.

Code documentation generated by doxygen are available
[here.](https://jenkins.jasonswails.com/job/amber-github/job/cpptraj/job/PR-773/Doxygen_20Documentation/)
You can generate the documentation yourself with the command `make docs`. A
limited developers guide is available [here](https://jenkins.jasonswails.com/job/amber-github/job/cpptraj/job/master/lastSuccessfulBuild/artifact/doc/CpptrajDevelopmentGuide.pdf)
Code documentation generated by Doxygen can be generated with the command `make docs`. A
limited developers guide is available [here](https://raw.githubusercontent.com/Amber-MD/cpptraj/master/doc/CpptrajDevelopmentGuide.pdf)
and limited HTML-formatted documentation is available
[here](https://amber-md.github.io/cpptraj/).

Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ PNETCDF_OPTS='--disable-fortran --disable-cxx'

FFTW_SRCTAR='fftw-3.3.9.tar.gz'
FFTW_SRCDIR='fftw-3.3.9'
FFTW_URL="ftp://ftp.fftw.org/pub/fftw/$FFTW_SRCTAR"
FFTW_URL="https://fftw.org/pub/fftw/$FFTW_SRCTAR"
FFTW_OPTS='--enable-threads --with-combined-threads --with-pic --disable-fortran'

# ----- Variables for downloading MPI ------------
Expand Down
Binary file added doc/CpptrajDevelopmentGuide.pdf
Binary file not shown.
Binary file added doc/CpptrajManual.pdf
Binary file not shown.
107 changes: 103 additions & 4 deletions doc/cpptraj.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -14247,7 +14247,7 @@ The following topology related commands are available:
\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="22" columns="2">
<lyxtabular version="3" rows="23" columns="2">
<features tabularvalignment="middle">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
Expand Down Expand Up @@ -14345,6 +14345,26 @@ Print bond info for selected atoms.
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
bondparminfo
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Print the bond parameter table.
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
change
\end_layout
Expand Down Expand Up @@ -15057,6 +15077,67 @@ If 2 masks are given instead of 1,
print info for bonds with first atom in <mask1> and second atom in <mask2>.
\end_layout

\begin_layout Subsection
bondparminfo
\end_layout

\begin_layout LyX-Code
bondparminfo [parm <name> | crdset <set> | parmindex <#> | <#>] [out <file>]
\end_layout

\begin_deeper
\begin_layout Description
[parm
\begin_inset space ~
\end_inset

<name>
\begin_inset space ~
\end_inset

|
\begin_inset space ~
\end_inset

parmindex
\begin_inset space ~
\end_inset

<#>
\begin_inset space ~
\end_inset

|
\begin_inset space ~
\end_inset

<#>] Name/tag or index of topology.
Default is first loaded topology.
\end_layout

\begin_layout Description
[out
\begin_inset space ~
\end_inset

<file>] File to print to (default STDOUT).
\end_layout

\end_deeper
\begin_layout Standard
Print the bond parameter table with format:
\end_layout

\begin_layout LyX-Code
#Idx Rk Req
\end_layout

\begin_layout Standard
Where Idx is the internal bond parameter index,
Rk is the bond force constant (in kcal/mol*Ang^2),
and Req is the bond equilibrium value (in Ang.).
\end_layout

\begin_layout Subsection
change
\end_layout
Expand Down Expand Up @@ -43023,7 +43104,7 @@ vector [<name>] <Type> [out <filename> [ptrajoutput]] [<mask1>] [<mask2>]
\end_layout

\begin_layout LyX-Code
[magnitude] [ired] [gridset <grid>]
[magnitude] [geom] [ired] [gridset <grid>] [debye]
\end_layout

\begin_layout LyX-Code
Expand Down Expand Up @@ -43103,6 +43184,11 @@ ptraj
[magnitude] Store the magnitude of the vector with aspect [Mag].
\end_layout

\begin_layout Description
[geom] If specified,
use geometric centers instead of centers of mass.
\end_layout

\begin_layout Description
[ired] Mark this vector for subsequent IRED analysis with commands 'matrix ired' and 'ired'.
\end_layout
Expand All @@ -43129,6 +43215,14 @@ ucell[x|y|z]
.
\end_layout

\begin_layout Description
[debye] (
\series bold
'dipole'
\series default
vector only) Report dipole vector in units of Debye instead of e-*Ang.
\end_layout

\begin_layout Standard
Data Sets Created:
\end_layout
Expand Down Expand Up @@ -43186,8 +43280,13 @@ dipole Store the dipole and center of mass of the atoms specified in
<mask1>
\series default
.
The vector is not converted to appropriate units,
nor is the value well-defined if the atoms in the mask are not overall charge neutral.
The dipole vector has units of e-*Ang unless
\series bold
'debye'
\series default
is specified for units of Debye.
The center is always stored as simply Ang (since it is just coordinates).
Note that the value may not be well-defined if the atoms in the mask are not overall charge neutral.
\end_layout

\begin_layout Description
Expand Down
6 changes: 6 additions & 0 deletions src/Action_Angle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ Action::RetType Action_Angle::Setup(ActionSetup& setup) {
mprintf("Warning: angle: One or more masks contain 0 atoms.\n");
return Action::SKIP;
}
// Check if center of mass is possible
if (useMass_) {
if (setup.Top().MaskHasZeroMass(Mask1_)) useMass_ = false;
if (setup.Top().MaskHasZeroMass(Mask2_)) useMass_ = false;
if (setup.Top().MaskHasZeroMass(Mask3_)) useMass_ = false;
}
return Action::OK;
}

Expand Down
8 changes: 7 additions & 1 deletion src/Action_Dihedral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ Action::RetType Action_Dihedral::Setup(ActionSetup& setup) {
mprintf("Warning: One or more masks have no atoms.\n");
return Action::SKIP;
}

// Check if center of mass is possible
if (useMass_) {
if (setup.Top().MaskHasZeroMass(M1_)) useMass_ = false;
if (setup.Top().MaskHasZeroMass(M2_)) useMass_ = false;
if (setup.Top().MaskHasZeroMass(M3_)) useMass_ = false;
if (setup.Top().MaskHasZeroMass(M4_)) useMass_ = false;
}
return Action::OK;
}

Expand Down
7 changes: 7 additions & 0 deletions src/Action_Distance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ Action::RetType Action_Distance::Setup(ActionSetup& setup) {
else
mprintf(", imaging off");
mprintf(".\n");
// Check if center of mass not possible
if (useMass_) {
if (setup.Top().MaskHasZeroMass( Mask1_ )) useMass_ = false;
if (mode_ == NORMAL) {
if (setup.Top().MaskHasZeroMass( Mask2_ )) useMass_ = false;
}
}

return Action::OK;
}
Expand Down
Loading

0 comments on commit 6666588

Please sign in to comment.