Compare commits

...

419 Commits

Author SHA1 Message Date
02bfa898ee adjustments to balancing weights and factors, also XOR op for formulas, if, dump_modify thresh 2016-10-05 15:46:20 -06:00
030df745bc Merge pull request #193 from akohlmey/eam-bugfix
bugfix for eam/alloy/omp and eam/fs/omp
2016-10-05 10:54:36 -06:00
6a97211932 Merge pull request #192 from rbberger/python-interface-bugfix
Revert type checking commit from July
2016-10-05 10:54:08 -06:00
c46be7db62 changes to imbalance weight factors 2016-10-05 10:33:39 -06:00
4381db846b correct the bug discovered by stan due to uninitialized scale factors for eam/alloy/omp and eam/fs/omp 2016-10-04 14:33:26 -04:00
e2caf5c105 Fix code path which allows passing a C++ ptr to PyLammps 2016-10-04 13:57:21 -04:00
11c2892e54 Merge branch 'restrict-weights-and-weight-factors' of https://github.com/akohlmey/lammps 2016-10-04 09:49:09 -06:00
91be47a0d0 Revert type checking commit from July
0aebb2eabe
2016-10-04 11:43:12 -04:00
ab92529b19 Merge pull request #191 from akohlmey/updated-charmm2lammps
Updated charmm2lammps
2016-10-03 17:59:21 -06:00
e079362776 Merge pull request #190 from akohlmey/small-bufixes-and-enhancements
Small bufixes and enhancements
2016-10-03 17:58:36 -06:00
c3ff8812b3 added XOR operator to variable command 2016-10-03 17:57:33 -06:00
03766dbda7 apply bugfix for MEAM provided by Wolfgang Verestek on lammps-users
this closes lammps/#188
2016-10-03 16:28:59 -04:00
6e719f2d94 remove trailing whitespace 2016-10-03 07:07:28 -04:00
45d2cc2895 permission update for ch2lmp tool folder 2016-10-03 07:03:42 -04:00
690f91300b rebuild charmm2lammps example output files with updated tools 2016-10-03 06:58:51 -04:00
3b94627dfe properly handle -nohints flag, make -cmap flag take version as option. step version number 2016-10-03 06:52:30 -04:00
c2e11dffa2 import updated charmm2lammps.pl script from Rober Latour 2016-10-02 20:33:20 -04:00
1985db4fb1 correct designation of meam supporting USER-OMP and meam/spline not 2016-10-01 23:05:05 -04:00
a3e05a2bac permission cleanup 2016-10-01 06:34:45 -04:00
035279de87 correct logic bug in bufix for fix tmd
(cherry picked from commit 267c1ec957)
2016-10-01 06:26:52 -04:00
e2c7acabac Merge pull request #187 from akohlmey/colvars-update-2016-09-30
update colvars library to version 2016-09-30
2016-09-30 09:21:00 -06:00
91edee2530 Merge pull request #186 from akohlmey/small-bugfixes
Collected small bugfixes and enhancements
2016-09-30 09:20:25 -06:00
b9d0f96a19 change purge target in Makefile, also fixed one issue with Make.py 2016-09-30 09:17:55 -06:00
d45e333f7c restrict choice of weight factors and guarantee that weights are >= 0.001 2016-09-30 11:11:32 -04:00
5bb85b482d remove unused variable 2016-09-30 09:38:50 -04:00
d4b074d85b enable dynamic groups for fix dt/reset 2016-09-30 09:09:44 -04:00
6d200061ca update colvars library to version 2016-09-30 2016-09-30 08:15:44 -04:00
cb7bd2799e flag header as C++ to emacs 2016-09-30 07:39:45 -04:00
4337f2c240 include charmm22 and charmm36 cmap files and include date added signature 2016-09-30 07:39:12 -04:00
0eeb240730 whitespace cleanup, fix bug in looking for empty strings, improve read performance and handling of comments 2016-09-30 07:22:47 -04:00
c88acc9613 make reader for target geometry file more resilient 2016-09-29 22:59:46 -04:00
f7b5afee82 Merge pull request #184 from akohlmey/dynamic-groups-for-respa
Dynamic groups for respa
2016-09-29 15:51:34 -06:00
a315dcda9b remove dead code
(cherry picked from commit 7f0994aac0)
2016-09-29 15:13:46 -04:00
f6c77c3aba support dynamic groups with run style respa
(cherry picked from commit b7baa1680d)
2016-09-29 15:13:46 -04:00
5b2becd09b Merge branch 'integration' into new-master 2016-09-29 10:37:09 -04:00
596b260f5d Merge pull request #45 from akohlmey/small-bugfixes
Small bugfixes
2016-09-28 16:36:04 -06:00
446e7e7369 patch for allowing prd command to work with sorted atoms 2016-09-28 16:33:30 -06:00
8c1d0031c9 correct typo in Make.py 2016-09-27 18:20:06 -04:00
829d11e88b Merge pull request #44 from rbberger/doc-fixes
Some documentation fixes and IPython updates
2016-09-27 15:36:10 -06:00
1adf3858a9 correct bug and synchronize fix addforce respa level init with other fixes 2016-09-27 17:36:02 -04:00
96f31d6dad Merge pull request #43 from akohlmey/doc-fixes
Documentation fixes
2016-09-27 15:35:41 -06:00
35705217f4 enable multi-processor NEB replicas 2016-09-27 15:34:08 -06:00
9a2f738673 sync with SVN 2016-09-27 15:32:57 -06:00
f9c2049724 need to ignore new fix cmap sources 2016-09-27 17:12:17 -04:00
e1c6b6b7d1 correctly handle exceptions raised from subprocess module 2016-09-27 17:01:45 -04:00
a3a3af691c Merge branch 'balance' into integration 2016-09-27 10:53:56 -06:00
f9677e6d7b released version of weighted balancing 2016-09-27 10:52:27 -06:00
a3277117e2 Add filter which merges preformatted sections 2016-09-26 18:52:43 -04:00
67d4c07689 Do not escape underscore inside preformat blocks 2016-09-26 18:52:31 -04:00
877a504933 Fix typo in Section_howto.txt 2016-09-26 18:44:25 -04:00
8a951f9d79 fix typo 2016-09-26 18:43:03 -04:00
69a8842ecb update load balance weights documentation for fix balance and balance 2016-09-26 18:33:50 -04:00
2af5c75f42 correct issue from merge 2016-09-26 18:32:01 -04:00
158599fca2 Merge branch 'balance2' into weighted-balancing 2016-09-26 18:25:36 -04:00
7732548b3c correct issues related to the addition of fix cmap 2016-09-26 18:14:32 -04:00
2c5f6e1a99 fix a broken link that slipped through the cracks in the previous cleanup 2016-09-26 18:13:18 -04:00
d0aa13b543 Fix broken link in Section_packages.txt 2016-09-26 16:53:18 -04:00
c31b026797 Merge branch 'integration' into weighted-balancing 2016-09-26 15:20:22 -04:00
47b52ed2dd Merge branch 'integration' into balance2 2016-09-26 15:19:48 -04:00
c87f9aeb9f Merge remote-tracking branch 'akohlmey/integration' into ipython-update-and-cleanup 2016-09-26 11:59:30 -04:00
b97b9dd661 new fix cmap command 2016-09-26 08:40:53 -06:00
86d17a5784 Merge pull request #42 from akohlmey/redo-fix-ti-spring-fixes
Redo fix ti/spring bugfixes and updates
2016-09-23 15:12:24 -06:00
c00cd6192d Merge pull request #41 from akohlmey/doc-fixes
Documentation updates and corrections
2016-09-23 14:57:23 -06:00
fc031c34bd Merge pull request #40 from akohlmey/eam-fixes-for-scale
Eam fixes for scale
2016-09-23 14:56:04 -06:00
d730cda248 Merge pull request #37 from rbberger/library_interface_abort
Allow detection of MPI_Abort condition in library call
2016-09-23 14:54:43 -06:00
6f4b7268de sync with SVN 2016-09-23 14:52:45 -06:00
08f0bf9025 new verion of balance weighting 2016-09-23 14:37:53 -06:00
3d5f5bf40e a few more consolidations of link anchors 2016-09-23 10:25:10 -04:00
065d35eefa update kokkos compilation instructions to use provided preset makefiles 2016-09-22 23:53:19 -04:00
3785249033 use "make mpi" instead of "make g++" in examples 2016-09-22 23:52:52 -04:00
e18941e865 delete bogus line (how did this get into the docs?) 2016-09-22 23:41:53 -04:00
c6cebe66c7 making more links and anchors consistent and correct errors 2016-09-22 22:26:17 -04:00
08d9792ec8 add an additional explanation to compute XXX/tally docs and fix a typo 2016-09-22 21:46:45 -04:00
c10aa55fc1 Merge branch 'integration' into doc-fixes 2016-09-22 09:19:45 -04:00
2bf6688388 fix bug in fix_modify respa reported by steven early strong on lammps-users 2016-09-22 06:03:49 -04:00
b3217218d6 doc page sync with SVN 2016-09-21 20:54:20 -06:00
d3406df6a0 Updated instructions in IPython notebooks
Make.py is now used to enable exceptions support
2016-09-21 12:07:59 -04:00
a4c8c9b1f9 Strip IPython notebooks of output 2016-09-21 11:35:00 -04:00
f1183cb97c Remove old copies of IPython notebooks 2016-09-21 11:28:15 -04:00
68d6f105d0 need to add removed fix ti/rs to purge list 2016-09-21 07:28:27 -04:00
b27179bbef restore bugfixes and updates that were lost. flag time dependet. correct use of citeme. 2016-09-21 07:27:37 -04:00
90ff54c44f Ensure all library functions capture exceptions 2016-09-20 19:19:38 -04:00
2943dd5c12 correct another broken link in fix ti/spring 2016-09-20 19:02:13 -04:00
33d9a55d35 remove references to docs for fix ti/rs 2016-09-20 19:01:58 -04:00
5345efb5b8 correct broken link in updated fix ti/spring docs 2016-09-20 18:57:01 -04:00
9bedb8a1c9 ignore generated files in html folder 2016-09-20 18:54:51 -04:00
0d7e4f1e88 update docs for pair style gauss/cut to document optional per pair cutoff 2016-09-20 18:51:50 -04:00
9ef748bbaa remvoing doc/html 2016-09-20 16:46:59 -06:00
259177630a whitespace cleanup 2016-09-20 16:47:04 -04:00
10034ce336 port support for scale[] factor with fix adapt to OPT and USER-OMP 2016-09-20 16:46:54 -04:00
281ace327f we should scale energies as well as forces 2016-09-20 16:46:05 -04:00
c6ee5065ed allow to override PairEAM::extract() 2016-09-20 16:45:30 -04:00
04eadb6341 Merge remote-tracking branch 'akohlmey/integration' into library_interface_abort 2016-09-20 16:41:36 -04:00
f4263e3849 Simplify MPI abort code path, make C++ exceptions optional 2016-09-20 16:16:36 -04:00
b4e2876776 Fix typo 2016-09-20 16:13:14 -04:00
3a73a1476e disable use of fix adapt with EAM for GPU+KOKKOS and CDEAM 2016-09-20 15:06:39 -04:00
5c37fccf49 fix ti/spring for eam/allow and eam/fs 2016-09-20 12:10:58 -06:00
b9b044e180 new fix ti/spring command, remove fix ti/rs 2016-09-20 10:44:12 -06:00
7dc8746f9e Merge pull request #39 from akohlmey/small-bugfixes
Collected small changes and bugfixes
2016-09-20 08:51:42 -06:00
5d89493a10 Merge pull request #38 from akohlmey/consolidate-pycache
consolidate ignoring python bytecompiled cache files
2016-09-20 08:49:38 -06:00
7bb880f0a8 remove debug code
(cherry picked from commit 1dbd52a30c)
2016-09-20 09:06:03 -04:00
849ff25d92 demote OMP_NUM_THREAD "warning" to "message" in the hope to be less confusing for inexperienced users 2016-09-20 08:57:04 -04:00
faa0b401aa fix argument indexing bug in fix ave/atom
(cherry picked from commit bc11518960)
2016-09-19 23:24:37 -04:00
aa9fe38c5c consolidate ignoring python bytecompiled cache files 2016-09-17 09:50:49 -04:00
719d7c65b6 Make exceptions control flow and functions optional 2016-09-16 18:57:37 -04:00
8db7ef4364 Merge remote-tracking branch 'akohlmey/integration' into library_interface_abort 2016-09-16 18:46:43 -04:00
d17421eb7c Merge pull request #36 from akohlmey/small_bugfixes_and_cleanups
Small bugfixes and cleanups
2016-09-16 13:19:39 -06:00
60dfdbc063 Merge pull request #35 from akohlmey/lj_sf_dipole_sf_correction
corrections for pair style lj/sf/dipole/sf and its /omp variant
2016-09-16 13:19:23 -06:00
e4bd63759b Merge pull request #34 from rbberger/make_py_fixes
Update Make.py
2016-09-16 13:19:05 -06:00
ca558f6712 Merge pull request #33 from rbberger/pylammps_additions
PyLammps additions
2016-09-16 13:18:17 -06:00
abf05eed61 comm tiled bug fix 2016-09-16 10:31:52 -06:00
72ce8ff89f Merge pull request #31 from akohlmey/doc-cleanups-and-updates
More documentation cleanups and updates
2016-09-16 10:05:53 -06:00
76d876f861 Allow detection of MPI_Abort condition in library call
The return value of `lammps_get_last_error_message` now encodes if the last
error was recoverable or should cause an `MPI_Abort`. The driving code is
responsible of reacting to the error and calling `MPI_Abort` on the
communicator it passed to the LAMMPS instance.
2016-09-15 22:11:58 -04:00
9637a5b530 colvars bugfix. updates colvars library to version 2016-09-14 2016-09-15 19:44:26 -04:00
4149413057 reduce global name space pollution in pair style meam 2016-09-15 16:32:41 -04:00
400ef87c05 make certain, that -log() doesn't overflow and assign a suitable maximum number instead. 2016-09-15 14:55:32 -04:00
e9e9790d6e corrections for pair style lj/sf/dipole/sf and its /omp variant
(cherry picked from commit f0c8b2af28a58485f6795cf85c7d88eaafa3e52a)
2016-09-15 09:30:40 -04:00
319b160752 Add exceptions setting to help message of Make.py 2016-09-14 19:26:03 -04:00
cddc1dbb11 Added exceptions flag to Make.py 2016-09-14 19:21:52 -04:00
2831f50790 Merge branch 'integration' into doc-cleanups-and-updates 2016-09-14 19:02:45 -04:00
62bf307d3c Fix bug introduced into Make.py by latest changes 2016-09-14 18:15:50 -04:00
5cdc48dd0c Update ipython example to show interface usage 2016-09-14 16:26:19 -04:00
0ec8fa02e0 Make thermo output accessable through PyLammps
Thermo data of the last run is now accessable through the `last_run.thermo`
property. This is a dictionary containing the data columns of thermo output.
All run data is kept as list and can be found in the `runs` property.
See issue #144
2016-09-14 16:14:41 -04:00
2fb666dc69 Merge branch 'doc' into integration 2016-09-14 13:32:39 -06:00
6e3705f380 Allow writing input script from Python session
This implements the requested feature in issue #145. The `write_script`
method now gives you a way of dumping out all used commands into a
LAMMPS input script file.

Note: this also dumps all commands which are indirectly issued by PyLammps
2016-09-14 14:24:19 -04:00
40b68820d9 update html docs to be used with latest version of converter tools 2016-09-14 14:06:25 -04:00
90e22a7909 Merge branch 'integration' into weighted-balancing 2016-09-14 14:04:02 -04:00
2f298951cf resolved conflicts 2016-09-14 10:22:46 -06:00
717e719b83 HTML update 2016-09-14 09:35:03 -06:00
523c70e0be regenerate html files one more time 2016-09-14 10:01:13 -04:00
77e0a84877 fix an inconsistency and a typo 2016-09-14 09:59:36 -04:00
9779911cea regenerate html files from scratch after merging from upstream and including richard's last updates to the converter tools 2016-09-14 09:54:06 -04:00
1ad15b8711 Merge branch 'integration' into doc-cleanups-and-updates 2016-09-14 09:48:46 -04:00
7025a3f5d1 Merge pull request #32 from rbberger/doc-cleanups-and-updates
Various updates to tools and some minor documentation fixes
2016-09-14 09:46:05 -04:00
df304f8ca1 Updated HTML after latest tool changes and corrections 2016-09-13 20:22:17 -04:00
3c88fa1436 Fix bug introduced in latest changes 2016-09-13 20:18:36 -04:00
b7ddc860c7 Fix error in Manual.txt 2016-09-13 20:00:17 -04:00
c61d5a1a29 Raise exception and output error if ulb,ule and olb,ole are unbalanced 2016-09-13 19:53:57 -04:00
10b4411d5b Merge branch 'integration' of github.com:akohlmey/lammps into integration 2016-09-13 17:22:14 -06:00
c744b23c4c doc updates 2016-09-13 17:15:15 -06:00
a69e059be3 Merge pull request #27 from akohlmey/small-bugfixes
Collected small changes and bugfixes
2016-09-13 17:11:23 -06:00
dbc548dd88 Merge pull request #26 from rbberger/is_available_feature
Extend is_available() function to query optional features
2016-09-13 17:10:10 -06:00
1dc19eceb2 Update unit tests to reflect new behavior 2016-09-13 19:03:57 -04:00
ae6b540d3c Add indentation to multi-paragraph entries 2016-09-13 19:03:46 -04:00
25e518a4f4 added options to compute bond/local 2016-09-13 17:03:37 -06:00
fe2fca4e9b clean-up of example files 2016-09-13 14:58:02 -06:00
ed52f9ea5e pair vashishta/table 2016-09-13 14:54:12 -06:00
944289b018 final version of pair vashishta/table 2016-09-13 14:45:53 -06:00
80c5b01bfc flag 'allocated' must be initialized in constructor 2016-09-13 14:33:00 -04:00
51e4a568c9 Merge branch 'small-bugfixes' of github.com:akohlmey/lammps into small-bugfixes 2016-09-13 14:32:27 -04:00
300d1ef52e Remove references to former empty file 2016-09-13 14:17:27 -04:00
633840c876 remove empty file 2016-09-13 13:46:45 -04:00
c44228b0cc Created more complete TOC and indices
This adds index sections on the main navigation bar and finally silences the
missing TOC warnings.
2016-09-13 13:40:18 -04:00
90f6395ddc Filter out more header numbers 2016-09-13 13:31:30 -04:00
a8081d4507 fix qeq Kokkos bug fix by Stan 2016-09-13 10:54:04 -06:00
14bed44743 ignore Makefile.lammps in lib tree 2016-09-13 09:36:48 -04:00
18cacb8e1d ignore *.mod generated by fortran compilers 2016-09-13 09:36:19 -04:00
546582ea02 Escape pipe characters 2016-09-12 23:18:38 -04:00
b76a42d3e0 making a few more in-page links unique. some more small corrections and clenups 2016-09-12 19:57:37 -04:00
54d5a14fe3 more doc formatting issues triggering errors/warnings in sphinx 2016-09-12 14:48:47 -04:00
f6efde3730 some more smaller doc file cleanups. almost there... 2016-09-12 13:37:08 -04:00
4c399fc553 more typesetting corrections in docs indicated by sphinx warnings 2016-09-12 12:23:53 -04:00
328b7abeaa correct various formatting issues flagged by sphinx 2016-09-11 23:24:32 -04:00
c3de3c142f correct references to Howto subsections 2016-09-11 23:01:16 -04:00
80f94c7d02 avoid bad typesetting of include images 2016-09-11 20:09:46 -04:00
e11bfcf117 updates in "Getting Started" for running on Windows. 2016-09-11 20:09:25 -04:00
be1cf40f2b update html files with recent changes 2016-09-11 19:34:04 -04:00
555a02786d correct and improve typesetting for various sub-sub-subsections in "Getting started" 2016-09-11 19:28:56 -04:00
cf6f504977 update description of Windows support in "Getting started" Section 2016-09-11 19:07:45 -04:00
b698f389bc correct and improve links to PyMol and MATLAB 2016-09-11 18:46:06 -04:00
e53862ca4a update html file updated boundary.txt file 2016-09-11 14:55:13 -04:00
a64eb330e3 document how using shrink-wrap boundaries can cause lost atoms in parallel 2016-09-11 14:48:37 -04:00
e96a8a4677 regenerate html pages with the updated content from the corrections 2016-09-10 21:15:44 -04:00
f8d5488409 correct section link descriptions 2016-09-10 21:03:38 -04:00
4d298ccf2f Give credit to Richard for being the lammps.org and senior jenkins wrangler 2016-09-10 20:18:05 -04:00
cb3044091c place ellipses in square brackets to avoid sphinx choking on them 2016-09-10 20:05:50 -04:00
d70e051ecd update docs for lj/sf/dipole/sf 2016-09-09 10:00:15 -04:00
37833b537b restore c++ marker in header comment 2016-09-09 09:43:21 -04:00
5fcbfa8248 simplify phonon code some more
(cherry picked from commit 1c54dc77ea)
2016-09-09 09:40:52 -04:00
c437195928 simplify code
(cherry picked from commit 3575913379)
2016-09-09 09:40:52 -04:00
8b1ef1c686 import updated pair lj/sf/dipole/sf files from sam genheden
(cherry picked from commit ae691ab786)
2016-09-09 09:37:17 -04:00
c3e8cb2f30 fix typo in comments
(cherry picked from commit 7875009218)
2016-09-09 09:34:17 -04:00
365707704c update error message to be consistent with other styles 2016-09-09 09:19:15 -04:00
16323ba391 require an atom map for compute voronoi/atom occupation
(cherry picked from commit 2b53f80392)
2016-09-09 07:39:09 -04:00
e27869daf6 Add updated HTML documentation about new is_available feature category 2016-09-09 05:56:24 -04:00
dc0c0ab214 Add documentation about new is_available feature category 2016-09-09 05:55:28 -04:00
4b22443b25 Add feature category to is_available function
This allows checking if the LAMMPS binary/library was compiled with PNG, JPEG,
FFMPEG, GZIP, or exceptions support.

Usage:
```
is_available(feature,gzip)
is_available(feature,png)
is_available(feature,jpeg)
is_available(feature,ffmpeg)
is_available(feature,exceptions)
```
2016-09-09 05:09:45 -04:00
956af8cebb update html file 2016-09-08 17:41:46 -04:00
5c927ca839 Merge remote-tracking branch 'lammps-rw/integration' into vashishta-tabulation 2016-09-08 17:22:21 -04:00
4bb42be3cc implement vashishta/table/omp in USER-OMP 2016-09-08 17:22:03 -04:00
7de5143050 update vashishta pair style example 2016-09-08 17:21:14 -04:00
71eed1d612 update documentation for vashishta pair style 2016-09-08 17:20:52 -04:00
dd34feb2bd Merge branch 'small' into integration 2016-09-08 14:35:36 -06:00
2524c5b526 Merge branch 'small-bugfixes' of https://github.com/akohlmey/lammps into small 2016-09-08 14:31:27 -06:00
fe581e8ced Merge remote-tracking branch 'lammps-rw/integration' into vashishta-tabulation 2016-09-08 16:21:05 -04:00
b866e0663b Merge pull request #24 from rbberger/info_command_styles
Info command extensions
2016-09-08 14:16:41 -06:00
5d0da95a0b Merge pull request #23 from akohlmey/doc-corrections-and-updates
Doc corrections and updates
2016-09-08 14:15:56 -06:00
07e55ef61e Merge pull request #22 from akohlmey/colvars-update
accumulated colvars library update and lib "make clean" improvement
2016-09-08 14:14:49 -06:00
236ebf7fab Kokkos lib update 2016-09-08 13:56:18 -06:00
a6df1e53b4 ignore all variants of the vashishta pair styles in src/ 2016-09-08 14:46:09 -04:00
9b2d5ff3e7 remove executable permissions on non-executables and non-scripts 2016-09-08 14:45:07 -04:00
c33e1049d8 delete duplicate fclose() in fix ttm/mod constructor 2016-09-08 11:51:22 -04:00
1f901c9b2d Update generated HTML docs of info command 2016-09-08 09:53:57 -04:00
79b8f6320d Update docs of info command 2016-09-08 09:53:14 -04:00
2dcfb51d18 Change info command styles syntax
Change to `info styles [all|atom|pair|compute|...]`.
By default, `info styles` will print all styles.
2016-09-08 09:38:52 -04:00
ba2b523bf4 Use factory for region style creation 2016-09-08 09:38:51 -04:00
fd2b886422 Use factory for dump style creation 2016-09-08 09:38:51 -04:00
9952d8a210 Use factory for minimize style creation 2016-09-08 09:38:51 -04:00
85c132943e Use factory for integrate style creation 2016-09-08 09:38:48 -04:00
55260ad53e Add missing delete in destructor 2016-09-08 09:32:48 -04:00
a1e5fc0fca Use factory for AtomVec style creation 2016-09-08 09:32:48 -04:00
88e10b401d Cleanup force.h after refactoring 2016-09-08 09:32:48 -04:00
1d03913aa3 Use factory for kspace style creation 2016-09-08 09:32:48 -04:00
0745a9f33f Use factory for improper style creation 2016-09-08 09:32:48 -04:00
906c50223a Use factory for dihedral style creation 2016-09-08 09:32:47 -04:00
35bdeb63e2 Use factory for angle style creation 2016-09-08 09:32:47 -04:00
69c58ef0d5 Use factory for bond style creation 2016-09-08 09:32:47 -04:00
95ee6440ad Use pair_map to list pair styles 2016-09-08 09:32:47 -04:00
00b08bb5e1 Use compute_map and fix_map to list compute and fix styles 2016-09-08 09:32:47 -04:00
e483cb9ef9 Use command_map to list command styles 2016-09-08 09:32:47 -04:00
06e3a11c2d Add styles output to info command
Adds the ability to list all available styles in LAMMPS with:

```
info styles
```

Each style can also be printed separately using one of the following:

```
info atom_styles
info integrate_styles
info minimize_styles
info pair_styles
info bond_styles
info angle_styles
info dihedral_styles
info improper_styles
info kspace_styles
info fix_styles
info compute_styles
info region_styles
info dump_styles
```
2016-09-08 09:32:46 -04:00
7e8440cbab undo changes to vashishita/omp 2016-09-07 12:02:38 -06:00
43b05a60c7 created vashishta/table variant 2016-09-07 11:56:38 -06:00
0fe7d1d361 correct internal links for Modify LAMMPS section 2016-09-07 10:13:34 -04:00
346ff42498 correct reference in modify section 2016-09-07 10:10:12 -04:00
5feedbd829 regenerate html pages with new txt2rst tool 2016-09-07 10:09:53 -04:00
44ce6fac4b replace backquote with regular quote and `` + '' with double quote. 2016-09-07 08:29:16 -04:00
70d6718aa3 Update discussion on parallel python packages. There seem to be only two left. 2016-09-07 07:42:06 -04:00
348b677148 Make formatting and links more consistent and unique 2016-09-07 07:41:17 -04:00
4c783ea3b7 Enforce l,ule or l,ole command order for RST
(cherry picked from commit 79e867c213)
2016-09-07 02:16:55 -04:00
9e8256aeb0 Refactored code and escape RST special character '_'
(cherry picked from commit 4629a464f7)
2016-09-07 02:16:55 -04:00
925f1bfb6f Escape RST special character '^' and take care of special math cases
(cherry picked from commit 453521c8e6)
2016-09-07 02:16:55 -04:00
3f312244a0 Escape RST special character '*' in final output
(cherry picked from commit 7cb39811d4)
2016-09-07 02:16:54 -04:00
55022d1263 replace :l,ule and :l,ole with :l :ule or :l :ole 2016-09-07 02:11:59 -04:00
0d491d483c avoid Inline substitution_reference start-string without end-string 2016-09-07 02:10:49 -04:00
a31c507370 correct error message text, sync with source 2016-09-06 22:15:49 -04:00
3a74ccffa2 update colvars library to version 2016-09-03
(cherry picked from commit 4181f5ac9d)
2016-09-06 21:28:59 -04:00
c8cfd53c1b adjust makefiles in lib tree, so they don't return an error exit code on "make clean" targets.
(cherry picked from commit 4117218ca3)
2016-09-06 21:28:55 -04:00
16607a0132 update colvars library to version 2016-08-19
(cherry picked from commit c67326be6d)
2016-09-06 21:27:46 -04:00
3b476d914f update colvars to version 2016-08-10
(cherry picked from commit eba3ad9abb)
2016-09-06 21:27:46 -04:00
977b9e542f update colvars to another set of changes from the upstream repo
(cherry picked from commit cb816f8cba)
2016-09-06 21:27:45 -04:00
1b33d00785 update colvars makefile dependencies
(cherry picked from commit df99a85930)
2016-09-06 21:27:45 -04:00
3d2e5d0a50 suppress compiler warning
(cherry picked from commit 6f227e194e)
2016-09-06 21:27:45 -04:00
ec2a6b9f0d update colvars to version 2016-08-10
(cherry picked from commit f2ddf828e4)
2016-09-06 21:27:41 -04:00
77620106a4 update colvars library to version 2016-08-05
(cherry picked from commit 459db2eb6b)

# Conflicts:
#	doc/src/PDF/colvars-refman-lammps.pdf
2016-09-06 21:26:50 -04:00
f56c41eec0 update with correct error description. sync with manual. 2016-09-06 21:21:28 -04:00
fc2d878305 update manual introduction to represent current status. correct some markup to better pass through sphinx 2016-09-06 21:20:47 -04:00
1c17b98500 Merge branch 'integration' into doc-corrections-and-updates 2016-09-06 20:19:02 -04:00
9138152563 Merge branch 'integration' into small-bugfixes 2016-09-06 20:17:07 -04:00
ace5dc3c7c Merge remote-tracking branch 'lammps-rw/clean-up-docs-for-sphinx' into clean-up-docs-for-sphinx 2016-09-06 19:54:35 -04:00
0252347d43 sync with 7Sep16 patch 2016-09-06 17:00:32 -06:00
c9455c90de Merge pull request #20 from akohlmey/lammps-contribute
Update description of submitting contributions to LAMMPS
2016-09-06 16:55:16 -06:00
1e4d6fee93 Merge pull request #19 from akohlmey/clean-up-docs-for-sphinx
Clean up docs for sphinx (redo)
2016-09-06 16:54:39 -06:00
42db93e198 one more small correction to document recent fix ave/time changes 2016-09-06 16:10:16 -04:00
906bd24543 fix typos 2016-09-06 16:03:16 -04:00
4f88c75401 update the discussion on how to submit modifications 2016-09-06 16:02:59 -04:00
4314299be9 harden fix shear/history against use-after-delete and from incorrect use of reverse communication 2016-09-06 14:50:04 -04:00
1a7b04e8a6 generate updated html files for corrected .txt files
(cherry picked from commit 7de57ffd94)
2016-09-06 13:40:11 -04:00
fbc955e549 correct link targets
(cherry picked from commit ff75cf51bb)
2016-09-06 13:40:11 -04:00
3bb3c1a45c add pppm/kk and fix reax/c issues 2016-09-06 10:46:51 -06:00
c543cba95c Merge pull request #18 from akohlmey/clean-up-docs-for-sphinx
Clean up incorrect link targets in documentation
2016-09-06 10:31:33 -06:00
0f7873c0b8 Merge branch 'integration' into weighted-balancing 2016-09-01 08:26:08 -04:00
b12ad2cecf Merge branch 'integration' into vashishta-tabulation 2016-09-01 08:25:31 -04:00
431d1a6dae mention stable releases 2016-09-01 02:37:55 -04:00
ab84acc2cd synchronize LAMMPS developer list with webpage and move ray to "past" 2016-09-01 02:26:49 -04:00
fc093a0aab replace :ule,l and :ole,l with :l<br>:ule and :l<br>:ole 2016-09-01 02:07:16 -04:00
5e6dff36e4 add new commands to lammps.book 2016-09-01 02:01:47 -04:00
7de57ffd94 generate updated html files for corrected .txt files 2016-09-01 00:02:40 -04:00
ff75cf51bb correct link targets 2016-09-01 00:01:26 -04:00
fb2c18ee88 Merge pull request #17 from akohlmey/small-doc-fixes
corrections for various compute something/chunk examples
2016-08-31 19:57:36 -06:00
b5c758f22c Merge branch 'goo' into integration 2016-08-31 19:53:50 -06:00
de0036fafd removing searchindex.js 2016-08-31 19:52:28 -06:00
c3c9788dc7 include autogenerated html code 2016-08-31 21:49:06 -04:00
2abd5ad28a Merge branch 'integration' into small-doc-fixes 2016-08-31 21:42:22 -04:00
1c3302d1db Merge pull request #15 from rbberger/pylammps-improvements
PyLammps improvements
2016-08-31 16:34:59 -06:00
24409b6178 Merge branch 'error' into integration 2016-08-31 16:16:47 -06:00
de21cb2cd5 small changes to doc page 2016-08-31 16:16:43 -06:00
639ab0fd3e Merge branch 'core/cpp_exceptions' of https://github.com/rbberger/lammps into error 2016-08-31 16:11:08 -06:00
6c65af710c bad file? 2016-08-31 16:10:20 -06:00
29e480ad66 corrections for various compute something/chunk examples 2016-08-31 17:31:14 -04:00
7c01ef57ee sync with SVN 2016-08-31 15:17:00 -06:00
0316bb579b Merge pull request #3 from akohlmey/fix-flow-gauss
Fix flow/gauss for USER-MISC package
2016-08-31 15:03:27 -06:00
f89448d73c Merge pull request #6 from akohlmey/manifold-doc-update
Small update for USER-MANIFOLD docs.
2016-08-31 14:53:16 -06:00
eac7217720 Merge remote-tracking branch 'lammps-rw/integration' into weighted-balancing 2016-08-31 16:34:51 -04:00
ad879d97db sync w/ SVN 2016-08-31 14:29:44 -06:00
93401a83c6 reintroduce pointer nullification for fix balance 2016-08-31 15:58:33 -04:00
4051aedf2c Merge branch 'small' into integration
Conflicts:
	src/compute_omega_chunk.cpp
2016-08-31 13:58:12 -06:00
82859c4e25 Merge branch 'integration' into weighted-balancing 2016-08-31 15:57:02 -04:00
ec8b9e21db sync with SVN 2016-08-31 13:28:26 -06:00
10edfa297b Merge branch 'integration' into weighted-balancing 2016-08-31 06:42:00 -04:00
1986eda4d5 Remove no longer needed generated files in doc
If we use the Google Custom Search API, we do not need to keep the
generated searchindex.js file anymore. We also can safely remove
the _sources directory for good.

Since these get generated during each Sphinx build, additional
steps have been added to the Makefile to get rid of them. They
are also added to .gitignore to avoid commiting them by accident.
2016-08-31 00:36:56 -04:00
e71fafdd25 Use Google Custom Search API for searching in docs 2016-08-31 00:28:27 -04:00
6cbdad7a97 Add utility function to IPyLammps for embedding videos 2016-08-30 11:34:16 -04:00
a08cf7a4b6 Add verbose option in PyLammps methods
This option allows forcing LAMMPS output to be printed to the console.
2016-08-30 11:34:16 -04:00
691de01b33 Allow setting the position of atoms 2016-08-30 11:34:16 -04:00
33a87a470a Return 2D vectors in 2D cases 2016-08-30 11:34:15 -04:00
59dc83eadb Fix resource leak 2016-08-30 11:34:15 -04:00
a2ea263652 remove vector/array class members shadowing the base class 2016-08-30 07:04:54 -04:00
493613b495 avoid NaNs in MEAM 2016-08-30 06:54:36 -04:00
021ade199a null-ing of pointers and a couple select integers for fix ave/chunk 2016-08-30 06:41:50 -04:00
b7749ab212 individual computes do not need to set vector/array to NULL. reordering fixes to silence compiler warnings 2016-08-30 06:41:02 -04:00
554ac7dd12 Use MPI_Allreduce values instead of each processor's values
(cherry picked from commit f30232b41e)
2016-08-30 06:38:15 -04:00
ef86d11729 Merge branch 'integration' into small-bugfixes 2016-08-30 06:29:41 -04:00
62b7b69a87 Merge branch 'init' into integration 2016-08-29 17:45:56 -06:00
1c1c9c3101 use correct order when initializing arrays 2016-08-28 22:23:22 -04:00
48ba812f0a Fixed initialization of arrays in computes/fixes in MC package 2016-08-28 22:23:22 -04:00
f9a21ae654 Fixed initialization of arrays in computes/fixes in MANYBODY package 2016-08-28 22:23:22 -04:00
d6b9d0b9b6 Fixed initialization of arrays in fixes 2016-08-28 22:23:22 -04:00
36e085e393 Fixed initialization of arrays in fixes 2016-08-28 22:23:22 -04:00
425142ba2e Fixed initialization of arrays in fixes 2016-08-28 22:23:22 -04:00
07eb1d443b Fixed initialization of arrays in fixes 2016-08-28 22:23:22 -04:00
265cc14125 Fixed initialization of arrays in fixes 2016-08-28 22:23:22 -04:00
fd05a1325e Fixed initialization of arrays in fixes 2016-08-28 22:23:22 -04:00
b5a562788b Fixed initialization of arrays in fixes 2016-08-28 22:23:22 -04:00
2c7241bfe2 Fixed initialization of arrays in fixes 2016-08-28 22:23:22 -04:00
ee2f6ded29 Fixed initialization of arrays in fixes 2016-08-28 22:23:22 -04:00
db077ef186 Fixed initialization of arrays in fixes 2016-08-28 22:23:22 -04:00
fc5db8a737 fix off-by one bug when looking for bonds. 2016-08-28 14:20:43 -04:00
56d0ab9474 updated doc build readme for current Fedora and RHEL/CentOS 2016-08-28 14:20:23 -04:00
f8d6b979ec Merge branch 'integration' into small-bugfixes 2016-08-28 14:16:14 -04:00
4e03df2d19 Merge branch 'integration' into fix-flow-gauss 2016-08-28 06:55:12 -04:00
e1045851c0 incorporate bugfix and cleanup from lammps-icms and upstream 2016-08-28 06:52:03 -04:00
cdf06646ef Update documentation for tabulation in vashista pair style 2016-08-27 23:05:17 -04:00
490b3402a7 optimize twobody term by passing a const reference instead of a pointer 2016-08-27 23:05:17 -04:00
ebce76c7f0 updated and slightly refactored tabulation for vashishta pair style
- tables are now dimensioned by nelements instead of ntypes
- tables are only created if used
- correctly identify max size of table
- add test for illegal cutoff for tabulation
- allocated memory for tables is accounted for
- add example input using 16-bit tables
2016-08-27 23:05:17 -04:00
bf59c976f8 Added curly brackets and spaces for better code readability 2016-08-27 23:05:17 -04:00
06cc38e16c Fixed so tabulated pair_vashishta uses same pair_modify command style as other pair styles 2016-08-27 23:05:17 -04:00
10ec14f0fd Remembering to clean up memory with new arrays in vashishta. 2016-08-27 23:05:17 -04:00
82d9f5f5e6 Added 3-body neighbor list building for faster short range 3 body forces. 2016-08-27 23:05:17 -04:00
944ebdcf44 Added tabulated version of vashishta potential 2016-08-27 23:05:17 -04:00
f5a50c3cd1 Added documentation about -DLAMMPS_EXCEPTIONS flag 2016-08-27 22:13:36 -04:00
0192d2e359 Merge pull request #5 from akohlmey/initialize-pointers
enforce initializing pointers in constructors to NULL
2016-08-27 17:14:27 -06:00
3a1397dc7c sync with SVN 2016-08-27 17:11:16 -06:00
bb721db8de Merge branch 'integration' into fix-flow-gauss 2016-08-27 19:02:33 -04:00
0c2e643062 Merge pull request #9 from rbberger/remove_sha1sum_dependency
Remove sha1sum dependency for doc generation
2016-08-27 17:02:17 -06:00
ef69bf8695 Merge pull request #11 from akohlmey/python3-for-make-py
Python 3 support for Make.py with Python 2.7 compatibility
2016-08-27 17:01:29 -06:00
6a4633af0a Merge pull request #12 from akohlmey/shell-script-paranoia
Disable custom locale and grep options in shell scripts
2016-08-27 16:59:43 -06:00
c80dad0028 new fix flow/gauss command 2016-08-27 16:25:01 -06:00
1c13b30a70 small cleanup and generalization of fix flow/gauss
- remove unused or unneeded class members
- make the code compatible with per-atom masses
- test for and abend in case of an invalid group mass

(cherry picked from commit e017b33898)
2016-08-27 17:33:46 -04:00
c570bf26e0 enforce C or POSIX locale in all shell scripts and turn of enforced global grep options 2016-08-27 01:57:45 -04:00
742c853775 need to ignore src/Make.py.last as well 2016-08-26 17:48:59 -04:00
9932b73227 Merge branch 'integration' into python3-for-make-py 2016-08-26 17:48:06 -04:00
90272f6c71 some more tweaks needed to improve python2/3 compatibility 2016-08-26 17:46:57 -04:00
8dd42789f8 correct for futurize not being able to fully convert functionality of the commands module 2016-08-26 17:15:39 -04:00
a0592d1b64 Merge branch 'gitignore-improvements' into integration 2016-08-26 13:54:29 -06:00
9be235d872 improved .gitignore files to show only changes in relevant folders and files 2016-08-26 14:34:42 -04:00
2beecd1e73 removal of doc/html/_sources and minor sync with SVN 2016-08-26 11:34:37 -06:00
95aabdf51a Add MacOS X instructions to doc generation README 2016-08-26 10:08:22 -04:00
ea368919f3 Remove sha1sum dependency for doc generation
On MacOS X there is no sha1sum. So to simplify doc generation on those systems
use a Python script instead to generate a unique string from the repository
path.
2016-08-26 00:01:34 -04:00
74516b571e port Make.py so it is compatible with python 2.7 *and* python 3.x 2016-08-25 06:30:53 -04:00
b06fa5670a find functions in atom.cpp checks for id/name being NULL
(cherry picked from commit f7e741f344)
2016-08-25 06:00:58 -04:00
a635c70a26 Fixed so we test for compute,fix and variable id's being NULL in find_ functions
(cherry picked from commit 12e1857e30)
2016-08-25 06:00:58 -04:00
b8e7f53017 Small update for USER-MANIFOLD docs.
(cherry picked from commit d188bdbd86)
2016-08-24 23:36:04 -04:00
849cec3400 fix memory leak in compute omega/chunk
(cherry picked from commit e8d0342503)
2016-08-24 23:15:08 -04:00
a692398b6c fix bug in reserving sufficient space for special atoms
assigning atom->maxspecial will not work, since it will be reset, e.g. when reading from a data file that doesn't have any special neighbors.
instead we need to set force->special_extra so this is going to be preserved.
2016-08-24 23:08:03 -04:00
ff541e9a84 fix typo in compute omega/chunk usage example 2016-08-24 23:04:27 -04:00
7d43f349e6 Fixed initialization of arrays in computes 2016-08-24 17:26:04 -04:00
5e811f16e8 Fixed initialization of arrays in computes 2016-08-24 17:26:03 -04:00
fcd54f02e6 Fixed initialization of arrays in computes 2016-08-24 17:26:03 -04:00
1f3ef8e0ee Fixed initialization of arrays in computes 2016-08-24 17:26:03 -04:00
3e793d6eb7 Fixed initialization of arrays in computes 2016-08-24 17:26:03 -04:00
95dde5c041 Fixed initialization of arrays in computes 2016-08-24 17:26:02 -04:00
d09a85733b Fixed initialization of arrays in computes 2016-08-24 17:26:02 -04:00
0e7ce194eb Fixed initialization of arrays in computes 2016-08-24 17:26:02 -04:00
e5c37bc7cb Implemented optional C++ exceptions in Error class
These can be activated using the -DLAMMPS_EXCEPTIONS compiler flag.
It has no effect for regular execution. However, while using
it as a library, any issued command will capture the exception
and save its error message. This can be queried using the
lammps_has_error() and lammps_get_last_error_message() methods.

The Python wrapper checks these in order to rethrow these errors
as Python exceptions. See issue #146.

(cherry picked from commit 6c154bb0b67a13d38968bc42d31013b97f87db75)
2016-08-24 15:31:30 -04:00
e27196e91c doc files 2016-08-23 16:28:36 -06:00
268fdab71b Merge branch 'small-bugfixes' into integration 2016-08-23 15:39:27 -06:00
8750515cc4 changed dump.cpp back to the way it was 2016-08-23 15:38:38 -06:00
270b07b035 Merge branch 'integration' into small-bugfixes 2016-08-23 15:35:31 -06:00
abc5a32c8a gpu lib sync 2016-08-23 15:30:01 -06:00
0a3464eb30 test 2016-08-23 15:27:02 -06:00
1ab3891caf Merge branch 'merge-pull-153' into lammps-icms
Submitted by Steven E. Strong via github
Contributing authors: Steven E. Strong and Joel D. Eaves   Joel.Eaves@Colorado.edu

This branch implements Gaussian dynamics (GD), which is a method to do
nonequilibrium molecular dynamics simulations of steady-state flow. See
http://dx.doi.org/10.1021/acs.jpclett.6b00748. It is simple to implement
and derives rigorously from Gauss's principle of least constraint.

(cherry picked from commit 75929ee01b)
2016-08-23 15:33:16 -04:00
50a82bb345 address uninitialized variable issues pointed out by valgrind/coverity 2016-08-22 15:49:33 -04:00
74b1caf2e6 undo changes that belong to a different branch or are redundant 2016-08-22 15:46:01 -04:00
243137d552 undo obsoleted changes to group command by iain bethune 2016-08-22 15:23:16 -04:00
40fd97bd4c silence warnings about cases, that cannot happen
(cherry picked from commit 60bf26bad9)
2016-08-22 15:12:24 -04:00
8492212c4b fix bug found by coverity scan
(cherry picked from commit 63b41cb139)
2016-08-22 15:12:24 -04:00
1976314f40 improve the weight assignment algorithm for compute time based balancing
(cherry picked from commit 2b052c2a9c)
2016-08-22 15:12:23 -04:00
17c1d3a941 Fix typo
(cherry picked from commit 3b8ecd5c06)
2016-08-22 15:12:23 -04:00
fec59ee3b9 update documentation for refactored load-balancing
(cherry picked from commit 7abc061bf7)
2016-08-22 15:12:23 -04:00
33a98d79fe remove upper limit for weigh factor on neighbor list and time weights
(cherry picked from commit 797c6dc2dd)
2016-08-22 15:12:23 -04:00
0902b600fb add new imbalance module store, which allows to store weights in an atom property
(cherry picked from commit 5405622f3b)
2016-08-22 15:12:23 -04:00
7f20afe122 convert from using fix property/atom to using fix store
(cherry picked from commit 280aef55d2)
2016-08-22 15:12:22 -04:00
7e0dc7a74d whitespace cleanup
(cherry picked from commit b3bd35c7be)
2016-08-22 15:12:22 -04:00
b954283ec2 properly handle the case of neighbor lists never been computed before
(cherry picked from commit fcba14a0aa)
2016-08-22 15:12:22 -04:00
ecc136b6dc plug small memory leak
(cherry picked from commit c00aa3c600)
2016-08-22 15:12:22 -04:00
4a536d71eb simplify and correct logic to pass weight to balancer algorithms
(cherry picked from commit 529417f86c)
2016-08-22 15:12:22 -04:00
460bc14822 correct string hanlding with building custom property label
(cherry picked from commit 6a519e5eef)
2016-08-22 15:12:21 -04:00
bb40f63a34 we cannot add a fix while creating a fix. move fix addintion to Fix::init()
(cherry picked from commit 4c26534245)
2016-08-22 15:12:21 -04:00
c6699e19e6 rewrote balancing to use per-atom data stored via fix property/atom
(cherry picked from commit 1da862b440)
2016-08-22 15:12:21 -04:00
2574891160 fix optional argument scanning bug
(cherry picked from commit 2a90afe7e9)
2016-08-22 15:12:21 -04:00
332d6821ca remove unused class member
(cherry picked from commit f884bb2c92)
2016-08-22 15:12:20 -04:00
b20108bddb incorporate refactored weighting into fix balance
(cherry picked from commit 71ef6fb4d9)
2016-08-22 15:12:20 -04:00
8d38db07c7 convert weight array from class member to local pointer to temporary storage
(cherry picked from commit ecbbdc2e7f)
2016-08-22 15:12:20 -04:00
4114bafc28 proof-of-concept implementation for neighbor list based balancing with yet unsolved problems
(cherry picked from commit d40de42af8)
2016-08-22 15:12:20 -04:00
23a48916d7 re-factored balance command now works with group and time weights
(cherry picked from commit 3f674e5062)
2016-08-22 15:12:20 -04:00
34b34d8410 complete implementation for group based imbalance class
(cherry picked from commit 8ff0085cba)
2016-08-22 15:12:19 -04:00
a5d38c0875 prototype implementation for extensible imbalance scheme
(cherry picked from commit 362a26a3de)
2016-08-22 15:12:19 -04:00
eb273ab9ea fix elusive uninitialized data bug reported by valgrind
(cherry picked from commit b44492ee05)
2016-08-22 15:12:19 -04:00
3cf6715d40 be a bit more paranoid about initializing data structures
(cherry picked from commit bda51f2bac)
2016-08-22 15:12:19 -04:00
0b0db201d1 make it so that dynamic load balancing only uses the timing since the last balancing
(cherry picked from commit f758a4f4d0)
2016-08-22 15:12:18 -04:00
f76f2c881b minor tweaks and comment fixes
(cherry picked from commit f14e9cee83)
2016-08-22 15:12:18 -04:00
7d08d9991e improve c++-11 compliance. replace variable size stack allocation.
(cherry picked from commit af224028a9)
2016-08-22 15:12:18 -04:00
85cafde77c whitespace cleanup
(cherry picked from commit 2e0b9cae29)
2016-08-22 15:12:18 -04:00
db734c3003 disable debug output and include bond cost as well
(cherry picked from commit 9ea86965c5)
2016-08-22 15:12:18 -04:00
cc77679851 implement wall clock based load balancing cost function support
(cherry picked from commit 2a57dc6db4)
2016-08-22 15:12:17 -04:00
b8ae885de8 update documentation according to the modified implementation based on iain bethune's contributed code
(cherry picked from commit 76b8bbca8e)
2016-08-22 15:12:17 -04:00
66b4c9b847 implement modified version of balance and fix balance according to steve's suggestions and requirements
(cherry picked from commit 5a81288329)
2016-08-22 15:12:17 -04:00
85f58624a7 Comments
(cherry picked from commit 638fb5c119)
2016-08-22 15:12:17 -04:00
fc6270e590 Docs for load balance changes
(cherry picked from commit fc7afc2242)
2016-08-22 15:12:17 -04:00
f784f07b87 Set up branch with load balancing code from master
(cherry picked from commit fd8794f52a)
2016-08-22 15:12:16 -04:00
5909bd5429 correct bug in tracking atom->nlocal vs. atom->nmax when allocating pbc enforcement buffers
(cherry picked from commit 45a2dd36d0)
2016-08-22 14:36:47 -04:00
1383684048 fix bug in recent dump changes for -DLAMMPS_BIGBIG
(cherry picked from commit a507936878)
2016-08-22 14:36:47 -04:00
587bafdf2d Remove memory leak and unnecessary allocation
(cherry picked from commit c998f7b81f)
2016-08-22 14:36:46 -04:00
c8fe3799ed Add missing initialization
(cherry picked from commit 054256cf0a)
2016-08-22 14:36:46 -04:00
9babb7a4c2 fix indexing bugs in accessing compute and fix labels in fix ave/histo
(cherry picked from commit 579c527718)
2016-08-22 14:35:32 -04:00
c88e9b46cf thread timing summare needs to be marked as preformatted
(cherry picked from commit b745636a67)
2016-08-22 14:35:11 -04:00
730e3cb4ac correct small (but harmless) logic error.
(cherry picked from commit ac6f4f8a56)
2016-08-22 14:34:43 -04:00
2a6561e52a add run 0 to USER-TALLY examples to enforce shake constraints on step 0
(cherry picked from commit 433741564d)
2016-08-22 14:32:47 -04:00
303 changed files with 12442 additions and 8805 deletions

34
.gitignore vendored Normal file
View File

@ -0,0 +1,34 @@
*~
*.o
*.so
*.cu_o
*.ptx
*_ptx.h
*.a
*.d
*.x
*.exe
*.dll
*.pyc
__pycache__
Obj_*
log.lammps
log.cite
*.bz2
*.gz
*.tar
.*.swp
*.orig
*.rej
.vagrant
\#*#
.#*
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

1
doc/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/html

View File

@ -1,7 +1,7 @@
<!-- HTML_ONLY -->
<HEAD>
<TITLE>LAMMPS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="29 Sep 2016 version">
<META NAME="docnumber" CONTENT="5 Oct 2016 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
@ -21,7 +21,7 @@
<H1></H1>
LAMMPS Documentation :c,h3
29 Sep 2016 version :c,h4
5 Oct 2016 version :c,h4
Version info: :h4

View File

@ -896,7 +896,7 @@ KOKKOS, o = USER-OMP, t = OPT.
"lubricate/poly (o)"_pair_lubricate.html,
"lubricateU"_pair_lubricateU.html,
"lubricateU/poly"_pair_lubricateU.html,
"meam (o)"_pair_meam.html,
"meam"_pair_meam.html,
"mie/cut (o)"_pair_mie.html,
"morse (got)"_pair_morse.html,
"nb3b/harmonic (o)"_pair_nb3b_harmonic.html,
@ -956,7 +956,7 @@ package"_Section_start.html#start_3.
"lj/sdk/coul/long (go)"_pair_sdk.html,
"lj/sdk/coul/msm (o)"_pair_sdk.html,
"lj/sf (o)"_pair_lj_sf.html,
"meam/spline"_pair_meam_spline.html,
"meam/spline (o)"_pair_meam_spline.html,
"meam/sw/spline"_pair_meam_sw_spline.html,
"mgpt"_pair_mgpt.html,
"morse/smooth/linear"_pair_morse.html,

View File

@ -319,14 +319,16 @@ accurately would be impractical and slow down the computation.
Instead the {weight} keyword implements several ways to influence the
per-particle weights empirically by properties readily available or
using the user's knowledge of the system. Note that the absolute
value of the weights are not important; their ratio is what is used to
assign particles to processors. A particle with a weight of 2.5 is
assumed to require 5x more computational than a particle with a weight
of 0.5.
value of the weights are not important; only their relative ratios
affect which particle is assigned to which processor. A particle with
a weight of 2.5 is assumed to require 5x more computational than a
particle with a weight of 0.5. For all the options below the weight
assigned to a particle must be a positive value; an error will be be
generated if a weight is <= 0.0.
Below is a list of possible weight options with a short description of
their usage and some example scenarios where they might be applicable.
It is possible to apply multiple weight flags and the weightins they
It is possible to apply multiple weight flags and the weightings they
induce will be combined through multiplication. Most of the time,
however, it is sufficient to use just one method.
@ -346,13 +348,24 @@ the computational cost for each group remains constant over time.
This is a purely empirical weighting, so a series test runs to tune
the assigned weight factors for optimal performance is recommended.
The {neigh} weight style assigns a weight to each particle equal to
its number of neighbors divided by the avergage number of neighbors
for all particles. The {factor} setting is then appied as an overall
scale factor to all the {neigh} weights which allows tuning of the
impact of this style. A {factor} smaller than 1.0 (e.g. 0.8) often
results in the best performance, since the number of neighbors is
likely to overestimate the ideal weight.
The {neigh} weight style assigns the same weight to each particle
owned by a processor based on the total count of neighbors in the
neighbor list owned by that processor. The motivation is that more
neighbors means a higher computational cost. The style does not use
neighbors per atom to assign a unique weight to each atom, because
that value can vary depending on how the neighbor list is built.
The {factor} setting is applied as an overall scale factor to the
{neigh} weights which allows adjustment of their impact on the
balancing operation. The specified {factor} value must be positive.
A value > 1.0 will increase the weights so that the ratio of max
weight to min weight increases by {factor}. A value < 1.0 will
decrease the weights so that the ratio of max weight to min weight
decreases by {factor}. In both cases the intermediate weight values
increase/decrease proportionally as well. A value = 1.0 has no effect
on the {neigh} weights. As a rule of thumb, we have found a {factor}
of about 0.8 often results in the best performance, since the number
of neighbors is likely to overestimate the ideal weight.
This weight style is useful for systems where there are different
cutoffs used for different pairs of interations, or the density
@ -368,35 +381,48 @@ weights are computed. Inserting a "run 0 post no"_run.html command
before issuing the {balance} command, may be a workaround for this
case, as it will induce the neighbor list to be built.
The {time} weight style uses "timer data"_timer.html to estimate a
weight for each particle. It uses the same information as is used for
the "MPI task timing breakdown"_Section_start.html#start_8, namely,
the timings for sections {Pair}, {Bond}, {Kspace}, and {Neigh}. The
time spent in these sections of the timestep are measured for each MPI
rank, summed up, then converted into a cost for each MPI rank relative
to the average cost over all MPI ranks for the same sections. That
cost then evenly distributed over all the particles owned by that
rank. Finally, the {factor} setting is then appied as an overall
scale factor to all the {time} weights as a way to fine tune the
impact of this weight style. Good {factor} values to use are
typically between 0.5 and 1.2.
The {time} weight style uses "timer data"_timer.html to estimate
weights. It assigns the same weight to each particle owned by a
processor based on the total computational time spent by that
processor. See details below on what time window is used. It uses
the same timing information as is used for the "MPI task timing
breakdown"_Section_start.html#start_8, namely, for sections {Pair},
{Bond}, {Kspace}, and {Neigh}. The time spent in those portions of
the timestep are measured for each MPI rank, summed, then divided by
the number of particles owned by that processor. I.e. the weight is
an effective CPU time/particle averaged over the particles on that
processor.
For the {balance} command the timing data is taken from the preceding
run command, i.e. the timings are for the entire previous run. For
the {fix balance} command the timing data is for only the timesteps
since the last balancing operation was performed. If timing
information for the required sections is not available, e.g. at the
beginning of a run, or when the "timer"_timer.html command is set to
either {loop} or {off}, a warning is issued. In this case no weights
are computed.
The {factor} setting is applied as an overall scale factor to the
{time} weights which allows adjustment of their impact on the
balancing operation. The specified {factor} value must be positive.
A value > 1.0 will increase the weights so that the ratio of max
weight to min weight increases by {factor}. A value < 1.0 will
decrease the weights so that the ratio of max weight to min weight
decreases by {factor}. In both cases the intermediate weight values
increase/decrease proportionally as well. A value = 1.0 has no effect
on the {time} weights. As a rule of thumb, effective values to use
are typicall between 0.5 and 1.2. Note that the timer quantities
mentioned above can be affected by communication which occurs in the
middle of the operations, e.g. pair styles with intermediate exchange
of data witin the force computation, and likewise for KSpace solves.
This weight style is the most generic one, and should be tried first,
if neither the {group} or {neigh} styles are easily applicable.
However, since the computed cost function is averaged over all local
particles this weight style may not be highly accurate. This style
can also be effective as a secondary weight in combination with either
{group} or {neigh} to offset some of inaccuracies in either of those
heuristics.
When using the {time} weight style with the {balance} command, the
timing data is taken from the preceding run command, i.e. the timings
are for the entire previous run. For the {fix balance} command the
timing data is for only the timesteps since the last balancing
operation was performed. If timing information for the required
sections is not available, e.g. at the beginning of a run, or when the
"timer"_timer.html command is set to either {loop} or {off}, a warning
is issued. In this case no weights are computed.
NOTE: The {time} weight style is the most generic option, and should
be tried first, unless the {group} style is easily applicable.
However, since the computed cost function is averaged over all
particles on a processor, the weights may not be highly accurate.
This style can also be effective as a secondary weight in combination
with either {group} or {neigh} to offset some of inaccuracies in
either of those heuristics.
The {var} weight style assigns per-particle weights by evaluating an
"atom-style variable"_variable.html specified by {name}. This is

View File

@ -49,8 +49,8 @@ keyword = {append} or {buffer} or {element} or {every} or {fileper} or {first} o
-N = sort per-atom lines in descending order by the Nth column
{thresh} args = attribute operation value
attribute = same attributes (x,fy,etotal,sxx,etc) used by dump custom style
operation = "<" or "<=" or ">" or ">=" or "==" or "!="
value = numeric value to compare to
operation = "<" or "<=" or ">" or ">=" or "==" or "!=" or "|^"
value = numeric value to compare to, or LAST
these 3 args can be replaced by the word "none" to turn off thresholding
{unwrap} arg = {yes} or {no} :pre
these keywords apply only to the {image} and {movie} "styles"_dump_image.html :l
@ -458,16 +458,59 @@ as well as memory, versus unsorted output.
The {thresh} keyword only applies to the dump {custom}, {cfg},
{image}, and {movie} styles. Multiple thresholds can be specified.
Specifying "none" turns off all threshold criteria. If thresholds are
Specifying {none} turns off all threshold criteria. If thresholds are
specified, only atoms whose attributes meet all the threshold criteria
are written to the dump file or included in the image. The possible
attributes that can be tested for are the same as those that can be
specified in the "dump custom"_dump.html command, with the exception
of the {element} attribute, since it is not a numeric value. Note
that different attributes can be output by the dump custom command
than are used as threshold criteria by the dump_modify command.
E.g. you can output the coordinates and stress of atoms whose energy
is above some threshold.
that a different attributes can be used than those output by the "dump
custom"_dump.html command. E.g. you can output the coordinates and
stress of atoms whose energy is above some threshold.
If an atom-style variable is used as the attribute, then it can
produce continuous numeric values or effective Boolean 0/1 values
which may be useful for the comparision operation. Boolean values can
be generated by variable formulas that use comparison or Boolean math
operators or special functions like gmask() and rmask() and grmask().
See the "variable"_variable.html command doc page for details.
NOTE: The LAST option, discussed below, is not yet implemented. It
will be soon.
The specified value must be a simple numeric value or the word LAST.
If LAST is used, it refers to the value of the attribute the last time
the dump command was invoked to produce a snapshot. This is a way to
only dump atoms whose attribute has changed (or not changed).
Three examples follow.
dump_modify ... thresh ix != LAST :pre
This will dump atoms which have crossed the periodic x boundary of the
simulation box since the last dump. (Note that atoms that crossed
once and then crossed back between the two dump timesteps would not be
included.)
region foo sphere 10 20 10 15
variable inregion atom rmask(foo)
dump_modify ... thresh v_inregion |^ LAST
This will dump atoms which crossed the boundary of the spherical
region since the last dump.
variable charge atom "(q > 0.5) || (q < -0.5)"
dump_modify ... thresh v_charge |^ LAST
This will dump atoms whose charge has changed from an absolute value
less than 1/2 to greater than 1/2 (or vice versa) since the last dump.
E.g. due to reactions and subsequent charge equilibration in a
reactive force field.
The choice of operations are the usual comparison operators. The XOR
operation (exclusive or) is also included as "|^". In this context,
XOR means that if either the attribute or value is 0.0 and the other
is non-zero, then the result is "true" and the threshold criterion is
met. Otherwise it is not met.
:line

View File

@ -39,8 +39,8 @@ metadynamics, Steered Molecular Dynamics (SMD) and Umbrella Sampling
(US) via a flexible harmonic restraint bias. The colvars library is
hosted at "http://colvars.github.io/"_http://colvars.github.io/
This documentation describes only the fix colvars command itself and
LAMMPS specific parts of the code. The full documentation of the
This documentation describes only the fix colvars command itself and
LAMMPS specific parts of the code. The full documentation of the
colvars library is available as "this supplementary PDF document"_PDF/colvars-refman-lammps.pdf
A detailed discussion of the implementation of the portable collective
@ -122,7 +122,7 @@ not a limitation of functionality.
[Default:]
The default options are input = NULL, output = out, seed = 1966, unwrap yes,
The default options are input = NULL, output = out, seed = 1966, unwrap yes,
and tstat = NULL.
:line

View File

@ -139,7 +139,7 @@ InP, myString, a123, ab_23_cd, etc :pre
and Boolean operators:
A == B, A != B, A < B, A <= B, A > B, A >= B, A && B, A || B, !A :pre
A == B, A != B, A < B, A <= B, A > B, A >= B, A && B, A || B, A |^ B, !A :pre
Each A and B is a number or string or a variable reference like $a or
$\{abc\}, or A or B can be another Boolean expression.
@ -155,9 +155,10 @@ precedence: the unary logical NOT operator "!" has the highest
precedence, the 4 relational operators "<", "<=", ">", and ">=" are
next; the two remaining relational operators "==" and "!=" are next;
then the logical AND operator "&&"; and finally the logical OR
operator "||" has the lowest precedence. Parenthesis can be used to
group one or more portions of an expression and/or enforce a different
order of evaluation than what would occur with the default precedence.
operator "||" and logical XOR (exclusive or) operator "|^" have the
lowest precedence. Parenthesis can be used to group one or more
portions of an expression and/or enforce a different order of
evaluation than what would occur with the default precedence.
When the 6 relational operators (first 6 in list above) compare 2
numbers, they return either a 1.0 or 0.0 depending on whether the
@ -171,9 +172,11 @@ relationship between A and B is TRUE or FALSE (or just A). The
logical AND operator will return 1.0 if both its arguments are
non-zero, else it returns 0.0. The logical OR operator will return
1.0 if either of its arguments is non-zero, else it returns 0.0. The
logical NOT operator returns 1.0 if its argument is 0.0, else it
returns 0.0. The 3 logical operators can only be used to operate on
numbers, not on strings.
logical XOR operator will return 1.0 if one of its arguments is zero
and the other non-zero, else it returns 0.0. The logical NOT operator
returns 1.0 if its argument is 0.0, else it returns 0.0. The 3
logical operators can only be used to operate on numbers, not on
strings.
The overall Boolean expression produces a TRUE result if the result is
non-zero. If the result is zero, the expression result is FALSE.

View File

@ -47,7 +47,7 @@ style = {delete} or {index} or {loop} or {world} or {universe} or {uloop} or {st
constants = PI, version, on, off, true, false, yes, no
thermo keywords = vol, ke, press, etc from "thermo_style"_thermo_style.html
math operators = (), -x, x+y, x-y, x*y, x/y, x^y, x%y,
x == y, x != y, x < y, x <= y, x > y, x >= y, x && y, x || y, !x
x == y, x != y, x < y, x <= y, x > y, x >= y, x && y, x || y, x |^ y, !x
math functions = sqrt(x), exp(x), ln(x), log(x), abs(x),
sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x),
random(x,y,z), normal(x,y,z), ceil(x), floor(x), round(x)
@ -450,7 +450,7 @@ Number: 0.2, 100, 1.0e20, -15.4, etc
Constant: PI, version, on, off, true, false, yes, no
Thermo keywords: vol, pe, ebond, etc
Math operators: (), -x, x+y, x-y, x*y, x/y, x^y, x%y, \
x == y, x != y, x < y, x <= y, x > y, x >= y, x && y, x || y, !x
x == y, x != y, x < y, x <= y, x > y, x >= y, x && y, x || y, x |^ y, !x
Math functions: sqrt(x), exp(x), ln(x), log(x), abs(x), \
sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), \
random(x,y,z), normal(x,y,z), ceil(x), floor(x), round(x), \
@ -551,9 +551,10 @@ division and the modulo operator "%" are next; addition and
subtraction are next; the 4 relational operators "<", "<=", ">", and
">=" are next; the two remaining relational operators "==" and "!="
are next; then the logical AND operator "&&"; and finally the logical
OR operator "||" has the lowest precedence. Parenthesis can be used
to group one or more portions of a formula and/or enforce a different
order of evaluation than what would occur with the default precedence.
OR operator "||" and logical XOR (exclusive or) operator "|^" have the
lowest precedence. Parenthesis can be used to group one or more
portions of a formula and/or enforce a different order of evaluation
than what would occur with the default precedence.
NOTE: Because a unary minus is higher precedence than exponentiation,
the formula "-2^2" will evaluate to 4, not -4. This convention is
@ -568,8 +569,10 @@ return 1.0 for all atoms whose x-coordinate is less than 10.0, and 0.0
for the others. The logical AND operator will return 1.0 if both its
arguments are non-zero, else it returns 0.0. The logical OR operator
will return 1.0 if either of its arguments is non-zero, else it
returns 0.0. The logical NOT operator returns 1.0 if its argument is
0.0, else it returns 0.0.
returns 0.0. The logical XOR operator will return 1.0 if one of its
arguments is zero and the other non-zero, else it returns 0.0. The
logical NOT operator returns 1.0 if its argument is 0.0, else it
returns 0.0.
These relational and logical operators can be used as a masking or
selection operation in a formula. For example, the number of atoms

View File

@ -1,2 +1 @@
__pycache__
*.egg-info

1
examples/COUPLE/fortran2/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.mod

0
examples/USER/misc/ti/in.ti_spring Executable file → Normal file
View File

View File

@ -43,7 +43,7 @@ fix 2 all wall/lj93 xlo 0.0 1 1 2.5 xhi $x 1 1 2.5
fix 3 all wall/lj93 ylo 0.0 1 1 2.5 yhi $y 1 1 2.5
comm_style tiled
comm_modify cutoff 7.5
comm_modify cutoff 10.0 # because bonds stretch a long ways
fix 10 all balance 50 0.9 rcb
#compute 1 all property/atom proc

View File

@ -52,4 +52,3 @@ fix 0 all balance 50 1.0 shift x 5 1.0 &
weight neigh 0.5 weight time 0.66 weight store WEIGHT
run 500
run 500

View File

@ -11,13 +11,19 @@ velocity all create 1.44 87287 loop geom
pair_style body 5.0
pair_coeff * * 1.0 1.0
neighbor 0.3 bin
neighbor 0.5 bin
neigh_modify every 1 delay 0 check yes
fix 1 all nve/body
#fix 1 all nvt/body temp 1.44 1.44 1.0
fix 2 all enforce2d
#compute 1 all body/local type 1 2 3
#dump 1 all local 100 dump.body index c_1[1] c_1[2] c_1[3] c_1[4]
thermo 500
#dump 2 all image 1000 image.*.jpg type type &
# zoom 1.6 adiam 1.5 body type 1.0 0
#dump_modify 2 pad 5
thermo 100
run 10000

View File

@ -1,4 +1,5 @@
# Title: charmm correction map
# DATE: 2016-09-26 CONTRIBUTOR: Robert Latour, latourr@clemson.edu CITATION: TBA
# Title: charmm22/charmm27 dihedral correction map
# alanine map, type 1

View File

@ -1,5 +1,5 @@
Run this example as:
mpirun -np 3 lmp_linux -partition 3x1 -in in.tad
mpirun -np 3 lmp_g++ -partition 3x1 -in in.tad
You should be able to use any number of replicas >= 3.

0
examples/vashishta/InP.vashishta Executable file → Normal file
View File

0
examples/vashishta/SiO.1990.vashishta Executable file → Normal file
View File

1
lib/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
Makefile.lammps

View File

@ -150,7 +150,7 @@ colvar::colvar(std::string const &conf)
feature_states[f_cv_linear]->enabled = lin;
}
// Colvar is homogeneous iff:
// Colvar is homogeneous if:
// - it is linear (hence not scripted)
// - all cvcs have coefficient 1 or -1
// i.e. sum or difference of cvcs
@ -375,28 +375,16 @@ colvar::colvar(std::string const &conf)
{
bool temp;
if (get_keyval(conf, "outputSystemForce", temp, false)) {
cvm::error("Colvar option outputSystemForce is deprecated.\n"
"Please use outputTotalForce, or outputSystemForce within an ABF bias.");
if (get_keyval(conf, "outputSystemForce", temp, false, colvarparse::parse_silent)) {
cvm::error("Option outputSystemForce is deprecated: only outputTotalForce is supported instead.\n"
"The two are NOT identical: see http://colvars.github.io/totalforce.html.\n", INPUT_ERROR);
return;
}
}
{
bool b_output_total_force;
get_keyval(conf, "outputTotalForce", b_output_total_force, false);
if (b_output_total_force) {
enable(f_cv_output_total_force);
}
}
{
bool b_output_applied_force;
get_keyval(conf, "outputAppliedForce", b_output_applied_force, false);
if (b_output_applied_force) {
enable(f_cv_output_applied_force);
}
}
get_keyval_feature(this, conf, "outputTotalForce", f_cv_output_total_force, false);
get_keyval_feature(this, conf, "outputAppliedForce", f_cv_output_applied_force, false);
get_keyval_feature(this, conf, "subtractAppliedForce", f_cv_subtract_applied_force, false);
// Start in active state by default
enable(f_cv_active);
@ -409,6 +397,8 @@ colvar::colvar(std::string const &conf)
fj.type(value());
ft.type(value());
ft_reported.type(value());
f_old.type(value());
f_old.reset();
if (cvm::b_analysis)
parse_analysis(conf);
@ -519,6 +509,8 @@ int colvar::init_components(std::string const &conf)
"number", "coordNum");
error_code |= init_components_type<selfcoordnum>(conf, "self-coordination "
"number", "selfCoordNum");
error_code |= init_components_type<groupcoordnum>(conf, "group-coordination "
"number", "groupCoord");
error_code |= init_components_type<angle>(conf, "angle", "angle");
error_code |= init_components_type<dipole_angle>(conf, "dipole angle", "dipoleAngle");
error_code |= init_components_type<dihedral>(conf, "dihedral", "dihedral");
@ -1104,6 +1096,14 @@ int colvar::calc_colvar_properties()
} else {
if (is_enabled(f_cv_subtract_applied_force)) {
// correct the total force only if it has been measured
// TODO add a specific test instead of relying on sq norm
if (ft.norm2() > 0.0) {
ft -= f_old;
}
}
x_reported = x;
ft_reported = ft;
}
@ -1210,6 +1210,10 @@ cvm::real colvar::update_forces_energy()
x_old = x;
}
if (is_enabled(f_cv_subtract_applied_force)) {
f_old = f;
}
if (cvm::debug())
cvm::log("Done updating colvar \""+this->name+"\".\n");
return (potential_energy + kinetic_energy);
@ -1640,15 +1644,9 @@ std::ostream & colvar::write_traj(std::ostream &os)
}
if (is_enabled(f_cv_output_applied_force)) {
if (is_enabled(f_cv_extended_Lagrangian)) {
os << " "
<< std::setprecision(cvm::cv_prec) << std::setw(cvm::cv_width)
<< fr;
} else {
os << " "
<< std::setprecision(cvm::cv_prec) << std::setw(cvm::cv_width)
<< f;
}
os << " "
<< std::setprecision(cvm::cv_prec) << std::setw(cvm::cv_width)
<< applied_force();
}
return os;

View File

@ -175,6 +175,9 @@ public:
/// (if defined) contribute to it
colvarvalue f;
/// Applied force at the previous step (to be subtracted from total force if needed)
colvarvalue f_old;
/// \brief Total force, as derived from the atomic trajectory;
/// should equal the system force plus \link f \endlink
colvarvalue ft;
@ -272,10 +275,13 @@ public:
/// \brief Calculate the quantities associated to the colvar (but not to the CVCs)
int calc_colvar_properties();
/// Get the current biasing force
inline colvarvalue bias_force() const
/// Get the current applied force
inline colvarvalue const applied_force() const
{
return fb;
if (is_enabled(f_cv_extended_Lagrangian)) {
return fr;
}
return f;
}
/// Set the total biasing force to zero
@ -482,6 +488,7 @@ public:
class dihedral;
class coordnum;
class selfcoordnum;
class groupcoordnum;
class h_bond;
class rmsd;
class orientation_angle;

View File

@ -67,7 +67,7 @@ int colvarbias_histogram::init(std::string const &conf)
if (colvar_array_size > 0) {
weights.assign(colvar_array_size, 1.0);
get_keyval(conf, "weights", weights, weights, colvarparse::parse_silent);
get_keyval(conf, "weights", weights, weights);
}
for (i = 0; i < colvars.size(); i++) {
@ -79,7 +79,7 @@ int colvarbias_histogram::init(std::string const &conf)
{
std::string grid_conf;
if (key_lookup(conf, "grid", grid_conf)) {
if (key_lookup(conf, "histogramGrid", grid_conf)) {
grid->parse_params(grid_conf);
}
}

View File

@ -92,7 +92,11 @@ int colvarbias_meta::init(std::string const &conf)
get_keyval(conf, "keepHills", keep_hills, false);
if (! get_keyval(conf, "writeFreeEnergyFile", dump_fes, true))
get_keyval(conf, "dumpFreeEnergyFile", dump_fes, true, colvarparse::parse_silent);
get_keyval(conf, "saveFreeEnergyFile", dump_fes_save, false);
if (get_keyval(conf, "saveFreeEnergyFile", dump_fes_save, false, colvarparse::parse_silent)) {
cvm::log("Option \"saveFreeEnergyFile\" is deprecated, "
"please use \"keepFreeEnergyFiles\" instead.");
}
get_keyval(conf, "keepFreeEnergyFiles", dump_fes_save, dump_fes_save);
hills_energy = new colvar_grid_scalar(colvars);
hills_energy_gradients = new colvar_grid_gradient(colvars);

View File

@ -612,3 +612,250 @@ cvm::real colvarbias_restraint_linear::restraint_convert_k(cvm::real k,
colvarbias_restraint_histogram::colvarbias_restraint_histogram(char const *key)
: colvarbias(key)
{
lower_boundary = 0.0;
upper_boundary = 0.0;
width = 0.0;
gaussian_width = 0.0;
}
int colvarbias_restraint_histogram::init(std::string const &conf)
{
colvarbias::init(conf);
get_keyval(conf, "lowerBoundary", lower_boundary, lower_boundary);
get_keyval(conf, "upperBoundary", upper_boundary, upper_boundary);
get_keyval(conf, "width", width, width);
if (width <= 0.0) {
cvm::error("Error: \"width\" must be positive.\n", INPUT_ERROR);
}
get_keyval(conf, "gaussianWidth", gaussian_width, 2.0 * width, colvarparse::parse_silent);
get_keyval(conf, "gaussianSigma", gaussian_width, 2.0 * width);
if (lower_boundary >= upper_boundary) {
cvm::error("Error: the upper boundary, "+
cvm::to_str(upper_boundary)+
", is not higher than the lower boundary, "+
cvm::to_str(lower_boundary)+".\n",
INPUT_ERROR);
}
cvm::real const nbins = (upper_boundary - lower_boundary) / width;
int const nbins_round = (int)(nbins);
if (std::fabs(nbins - cvm::real(nbins_round)) > 1.0E-10) {
cvm::log("Warning: grid interval ("+
cvm::to_str(lower_boundary, cvm::cv_width, cvm::cv_prec)+" - "+
cvm::to_str(upper_boundary, cvm::cv_width, cvm::cv_prec)+
") is not commensurate to its bin width ("+
cvm::to_str(width, cvm::cv_width, cvm::cv_prec)+").\n");
}
p.resize(nbins_round);
ref_p.resize(nbins_round);
p_diff.resize(nbins_round);
bool const inline_ref_p =
get_keyval(conf, "refHistogram", ref_p.data_array(), ref_p.data_array());
std::string ref_p_file;
get_keyval(conf, "refHistogramFile", ref_p_file, std::string(""));
if (ref_p_file.size()) {
if (inline_ref_p) {
cvm::error("Error: cannot specify both refHistogram and refHistogramFile at the same time.\n",
INPUT_ERROR);
} else {
std::ifstream is(ref_p_file.c_str());
std::string data_s = "";
std::string line;
while (getline_nocomments(is, line)) {
data_s.append(line+"\n");
}
if (data_s.size() == 0) {
cvm::error("Error: file \""+ref_p_file+"\" empty or unreadable.\n", FILE_ERROR);
}
is.close();
cvm::vector1d<cvm::real> data;
if (data.from_simple_string(data_s) != 0) {
cvm::error("Error: could not read histogram from file \""+ref_p_file+"\".\n");
}
if (data.size() == 2*ref_p.size()) {
// file contains both x and p(x)
size_t i;
for (i = 0; i < ref_p.size(); i++) {
ref_p[i] = data[2*i+1];
}
} else if (data.size() == ref_p.size()) {
ref_p = data;
} else {
cvm::error("Error: file \""+ref_p_file+"\" contains a histogram of different length.\n",
INPUT_ERROR);
}
}
}
cvm::real const ref_integral = ref_p.sum() * width;
if (std::fabs(ref_integral - 1.0) > 1.0e-03) {
cvm::log("Reference distribution not normalized, normalizing to unity.\n");
ref_p /= ref_integral;
}
get_keyval(conf, "writeHistogram", b_write_histogram, false);
get_keyval(conf, "forceConstant", force_k, 1.0);
return COLVARS_OK;
}
colvarbias_restraint_histogram::~colvarbias_restraint_histogram()
{
p.resize(0);
ref_p.resize(0);
p_diff.resize(0);
}
int colvarbias_restraint_histogram::update()
{
if (cvm::debug())
cvm::log("Updating the histogram restraint bias \""+this->name+"\".\n");
size_t vector_size = 0;
size_t icv;
for (icv = 0; icv < colvars.size(); icv++) {
vector_size += colvars[icv]->value().size();
}
cvm::real const norm = 1.0/(std::sqrt(2.0*PI)*gaussian_width*vector_size);
// calculate the histogram
p.reset();
for (icv = 0; icv < colvars.size(); icv++) {
colvarvalue const &cv = colvars[icv]->value();
if (cv.type() == colvarvalue::type_scalar) {
cvm::real const cv_value = cv.real_value;
size_t igrid;
for (igrid = 0; igrid < p.size(); igrid++) {
cvm::real const x_grid = (lower_boundary + (igrid+0.5)*width);
p[igrid] += norm * std::exp(-1.0 * (x_grid - cv_value) * (x_grid - cv_value) /
(2.0 * gaussian_width * gaussian_width));
}
} else if (cv.type() == colvarvalue::type_vector) {
size_t idim;
for (idim = 0; idim < cv.vector1d_value.size(); idim++) {
cvm::real const cv_value = cv.vector1d_value[idim];
size_t igrid;
for (igrid = 0; igrid < p.size(); igrid++) {
cvm::real const x_grid = (lower_boundary + (igrid+0.5)*width);
p[igrid] += norm * std::exp(-1.0 * (x_grid - cv_value) * (x_grid - cv_value) /
(2.0 * gaussian_width * gaussian_width));
}
}
} else {
// TODO
}
}
cvm::real const force_k_cv = force_k * vector_size;
// calculate the difference between current and reference
p_diff = p - ref_p;
bias_energy = 0.5 * force_k_cv * p_diff * p_diff;
// calculate the forces
for (icv = 0; icv < colvars.size(); icv++) {
colvarvalue const &cv = colvars[icv]->value();
colvarvalue &cv_force = colvar_forces[icv];
cv_force.type(cv);
cv_force.reset();
if (cv.type() == colvarvalue::type_scalar) {
cvm::real const cv_value = cv.real_value;
cvm::real &force = cv_force.real_value;
size_t igrid;
for (igrid = 0; igrid < p.size(); igrid++) {
cvm::real const x_grid = (lower_boundary + (igrid+0.5)*width);
force += force_k_cv * p_diff[igrid] *
norm * std::exp(-1.0 * (x_grid - cv_value) * (x_grid - cv_value) /
(2.0 * gaussian_width * gaussian_width)) *
(-1.0 * (x_grid - cv_value) / (gaussian_width * gaussian_width));
}
} else if (cv.type() == colvarvalue::type_vector) {
size_t idim;
for (idim = 0; idim < cv.vector1d_value.size(); idim++) {
cvm::real const cv_value = cv.vector1d_value[idim];
cvm::real &force = cv_force.vector1d_value[idim];
size_t igrid;
for (igrid = 0; igrid < p.size(); igrid++) {
cvm::real const x_grid = (lower_boundary + (igrid+0.5)*width);
force += force_k_cv * p_diff[igrid] *
norm * std::exp(-1.0 * (x_grid - cv_value) * (x_grid - cv_value) /
(2.0 * gaussian_width * gaussian_width)) *
(-1.0 * (x_grid - cv_value) / (gaussian_width * gaussian_width));
}
}
} else {
// TODO
}
}
return COLVARS_OK;
}
std::ostream & colvarbias_restraint_histogram::write_restart(std::ostream &os)
{
if (b_write_histogram) {
std::string file_name(cvm::output_prefix+"."+this->name+".hist.dat");
std::ofstream os(file_name.c_str());
os << "# " << cvm::wrap_string(colvars[0]->name, cvm::cv_width)
<< " " << "p(" << cvm::wrap_string(colvars[0]->name, cvm::cv_width-3)
<< ")\n";
size_t igrid;
for (igrid = 0; igrid < p.size(); igrid++) {
cvm::real const x_grid = (lower_boundary + (igrid+1)*width);
os << " "
<< std::setprecision(cvm::cv_prec)
<< std::setw(cvm::cv_width)
<< x_grid
<< " "
<< std::setprecision(cvm::cv_prec)
<< std::setw(cvm::cv_width)
<< p[igrid] << "\n";
}
os.close();
}
return os;
}
std::istream & colvarbias_restraint_histogram::read_restart(std::istream &is)
{
return is;
}
std::ostream & colvarbias_restraint_histogram::write_traj_label(std::ostream &os)
{
os << " ";
if (b_output_energy) {
os << " E_"
<< cvm::wrap_string(this->name, cvm::en_width-2);
}
return os;
}
std::ostream & colvarbias_restraint_histogram::write_traj(std::ostream &os)
{
os << " ";
if (b_output_energy) {
os << " "
<< std::setprecision(cvm::en_prec) << std::setw(cvm::en_width)
<< bias_energy;
}
return os;
}

View File

@ -168,4 +168,52 @@ protected:
};
/// Restrain the 1D histogram of a set of variables (or of a multidimensional one)
// TODO this could be reimplemented more cleanly as a derived class of both restraint and histogram
class colvarbias_restraint_histogram : public colvarbias {
public:
colvarbias_restraint_histogram(char const *key);
int init(std::string const &conf);
~colvarbias_restraint_histogram();
virtual int update();
virtual std::istream & read_restart(std::istream &is);
virtual std::ostream & write_restart(std::ostream &os);
virtual std::ostream & write_traj_label(std::ostream &os);
virtual std::ostream & write_traj(std::ostream &os);
protected:
/// Probability density
cvm::vector1d<cvm::real> p;
/// Reference probability density
cvm::vector1d<cvm::real> ref_p;
/// Difference between probability density and reference
cvm::vector1d<cvm::real> p_diff;
/// Lower boundary of the grid
cvm::real lower_boundary;
/// Upper boundary of the grid
cvm::real upper_boundary;
/// Resolution of the grid
cvm::real width;
/// Width of the Gaussians
cvm::real gaussian_width;
/// Restraint force constant
cvm::real force_k;
/// Write the histogram to a file
bool b_write_histogram;
};
#endif

View File

@ -54,6 +54,21 @@ colvar::cvc::cvc(std::string const &conf)
}
int colvar::cvc::init_total_force_params(std::string const &conf)
{
if (get_keyval_feature(this, conf, "oneSiteSystemForce",
f_cvc_one_site_total_force, is_enabled(f_cvc_one_site_total_force))) {
cvm::log("Warning: keyword \"oneSiteSystemForce\" is deprecated: "
"please use \"oneSiteTotalForce\" instead.\n");
}
if (get_keyval_feature(this, conf, "oneSiteTotalForce",
f_cvc_one_site_total_force, is_enabled(f_cvc_one_site_total_force))) {
cvm::log("Computing total force on group 1 only");
}
return COLVARS_OK;
}
cvm::atom_group *colvar::cvc::parse_group(std::string const &conf,
char const *group_key,
bool optional)
@ -77,8 +92,6 @@ cvm::atom_group *colvar::cvc::parse_group(std::string const &conf,
if (is_enabled(f_cvc_scalable)) {
cvm::log("Will enable scalable calculation for group \""+group->key+"\".\n");
} else {
cvm::log("Scalable calculation is not available for group \""+group->key+"\" with the current configuration.\n");
}
}

View File

@ -108,6 +108,9 @@ public:
char const *group_key,
bool optional = false);
/// \brief Parse options pertaining to total force calculation
virtual int init_total_force_params(std::string const &conf);
/// \brief After construction, set data related to dependency handling
int setup();
@ -306,9 +309,6 @@ protected:
cvm::rvector dist_v;
/// Use absolute positions, ignoring PBCs when present
bool b_no_PBC;
/// Compute total force on first site only to avoid unwanted
/// coupling to other colvars (see e.g. Ciccotti et al., 2005)
bool b_1site_force;
public:
distance(std::string const &conf);
distance();
@ -388,9 +388,6 @@ protected:
cvm::atom_group *ref2;
/// Use absolute positions, ignoring PBCs when present
bool b_no_PBC;
/// Compute total force on one site only to avoid unwanted
/// coupling to other colvars (see e.g. Ciccotti et al., 2005)
bool b_1site_force;
/// Vector on which the distance vector is projected
cvm::rvector axis;
/// Norm of the axis
@ -854,6 +851,62 @@ public:
colvarvalue const &x2) const;
};
/// \brief Colvar component: coordination number between two groups
/// (colvarvalue::type_scalar type, range [0:N1*N2])
class colvar::groupcoordnum
: public colvar::distance
{
protected:
/// \brief "Cutoff" for isotropic calculation (default)
cvm::real r0;
/// \brief "Cutoff vector" for anisotropic calculation
cvm::rvector r0_vec;
/// \brief Wheter dist/r0 or \vec{dist}*\vec{1/r0_vec} should ne be
/// used
bool b_anisotropic;
/// Integer exponent of the function numerator
int en;
/// Integer exponent of the function denominator
int ed;
public:
/// Constructor
groupcoordnum(std::string const &conf);
groupcoordnum();
virtual inline ~groupcoordnum() {}
virtual void calc_value();
virtual void calc_gradients();
virtual void apply_force(colvarvalue const &force);
template<bool b_gradients>
/// \brief Calculate a coordination number through the function
/// (1-x**n)/(1-x**m), x = |A1-A2|/r0 \param r0 "cutoff" for the
/// coordination number \param exp_num \i n exponent \param exp_den
/// \i m exponent \param A1 atom \param A2 atom
static cvm::real switching_function(cvm::real const &r0,
int const &exp_num, int const &exp_den,
cvm::atom &A1, cvm::atom &A2);
/*
template<bool b_gradients>
/// \brief Calculate a coordination number through the function
/// (1-x**n)/(1-x**m), x = |(A1-A2)*(r0_vec)^-|1 \param r0_vec
/// vector of different cutoffs in the three directions \param
/// exp_num \i n exponent \param exp_den \i m exponent \param A1
/// atom \param A2 atom
static cvm::real switching_function(cvm::rvector const &r0_vec,
int const &exp_num, int const &exp_den,
cvm::atom &A1, cvm::atom &A2);
virtual cvm::real dist2(colvarvalue const &x1,
colvarvalue const &x2) const;
virtual colvarvalue dist2_lgrad(colvarvalue const &x1,
colvarvalue const &x2) const;
virtual colvarvalue dist2_rgrad(colvarvalue const &x1,
colvarvalue const &x2) const;
*/
};
/// \brief Colvar component: hydrogen bond, defined as the product of
/// a colvar::coordnum and 1/2*(1-cos((180-ang)/ang_tol))
/// (colvarvalue::type_scalar type, range [0:1])

View File

@ -18,9 +18,9 @@ colvar::angle::angle(std::string const &conf)
group1 = parse_group(conf, "group1");
group2 = parse_group(conf, "group2");
group3 = parse_group(conf, "group3");
if (get_keyval(conf, "oneSiteSystemForce", b_1site_force, false)) {
cvm::log("Computing total force on group 1 only");
}
init_total_force_params(conf);
x.type(colvarvalue::type_scalar);
}
@ -33,7 +33,6 @@ colvar::angle::angle(cvm::atom const &a1,
provide(f_cvc_inv_gradient);
provide(f_cvc_Jacobian);
provide(f_cvc_com_based);
b_1site_force = false;
group1 = new cvm::atom_group(std::vector<cvm::atom>(1, a1));
group2 = new cvm::atom_group(std::vector<cvm::atom>(1, a2));
@ -94,7 +93,7 @@ void colvar::angle::calc_force_invgrads()
// centered on group2, which means group2 is kept fixed
// when propagating changes in the angle)
if (b_1site_force) {
if (is_enabled(f_cvc_one_site_total_force)) {
group1->read_total_forces();
cvm::real norm_fact = 1.0 / dxdr1.norm2();
ft.real_value = norm_fact * dxdr1 * group1->total_force();
@ -140,9 +139,8 @@ colvar::dipole_angle::dipole_angle(std::string const &conf)
group2 = parse_group(conf, "group2");
group3 = parse_group(conf, "group3");
if (get_keyval(conf, "oneSiteSystemForce", b_1site_force, false)) {
cvm::log("Computing total force on group 1 only");
}
init_total_force_params(conf);
x.type(colvarvalue::type_scalar);
}
@ -152,7 +150,6 @@ colvar::dipole_angle::dipole_angle(cvm::atom const &a1,
cvm::atom const &a3)
{
function_type = "dipole_angle";
b_1site_force = false;
group1 = new cvm::atom_group(std::vector<cvm::atom>(1, a1));
group2 = new cvm::atom_group(std::vector<cvm::atom>(1, a2));
@ -250,14 +247,13 @@ colvar::dihedral::dihedral(std::string const &conf)
provide(f_cvc_Jacobian);
provide(f_cvc_com_based);
if (get_keyval(conf, "oneSiteSystemForce", b_1site_force, false)) {
cvm::log("Computing total force on group 1 only");
}
group1 = parse_group(conf, "group1");
group2 = parse_group(conf, "group2");
group3 = parse_group(conf, "group3");
group4 = parse_group(conf, "group4");
init_total_force_params(conf);
x.type(colvarvalue::type_scalar);
}
@ -422,7 +418,7 @@ void colvar::dihedral::calc_force_invgrads()
cvm::real const fact4 = d34 * std::sqrt(1.0 - dot4 * dot4);
group1->read_total_forces();
if ( b_1site_force ) {
if (is_enabled(f_cvc_one_site_total_force)) {
// This is only measuring the force on group 1
ft.real_value = PI/180.0 * fact1 * (cross1 * group1->total_force());
} else {

View File

@ -338,3 +338,151 @@ void colvar::selfcoordnum::apply_force(colvarvalue const &force)
}
}
// groupcoordnum member functions
colvar::groupcoordnum::groupcoordnum(std::string const &conf)
: distance(conf), b_anisotropic(false)
{
function_type = "groupcoordnum";
x.type(colvarvalue::type_scalar);
// group1 and group2 are already initialized by distance()
if (group1->b_dummy || group2->b_dummy)
cvm::fatal_error("Error: neither group can be a dummy atom\n");
bool const b_scale = get_keyval(conf, "cutoff", r0,
cvm::real(4.0 * cvm::unit_angstrom()));
if (get_keyval(conf, "cutoff3", r0_vec,
cvm::rvector(4.0, 4.0, 4.0), parse_silent)) {
if (b_scale)
cvm::fatal_error("Error: cannot specify \"scale\" and "
"\"scale3\" at the same time.\n");
b_anisotropic = true;
// remove meaningless negative signs
if (r0_vec.x < 0.0) r0_vec.x *= -1.0;
if (r0_vec.y < 0.0) r0_vec.y *= -1.0;
if (r0_vec.z < 0.0) r0_vec.z *= -1.0;
}
get_keyval(conf, "expNumer", en, int(6) );
get_keyval(conf, "expDenom", ed, int(12));
if ( (en%2) || (ed%2) ) {
cvm::fatal_error("Error: odd exponents provided, can only use even ones.\n");
}
}
colvar::groupcoordnum::groupcoordnum()
: b_anisotropic(false)
{
function_type = "groupcoordnum";
x.type(colvarvalue::type_scalar);
}
template<bool calculate_gradients>
cvm::real colvar::groupcoordnum::switching_function(cvm::real const &r0,
int const &en,
int const &ed,
cvm::atom &A1,
cvm::atom &A2)
{
cvm::rvector const diff = cvm::position_distance(A1.pos, A2.pos);
cvm::real const l2 = diff.norm2()/(r0*r0);
// Assume en and ed are even integers, and avoid sqrt in the following
int const en2 = en/2;
int const ed2 = ed/2;
cvm::real const xn = std::pow(l2, en2);
cvm::real const xd = std::pow(l2, ed2);
cvm::real const func = (1.0-xn)/(1.0-xd);
if (calculate_gradients) {
cvm::real const dFdl2 = (1.0/(1.0-xd))*(en2*(xn/l2) - func*ed2*(xd/l2))*(-1.0);
cvm::rvector const dl2dx = (2.0/(r0*r0))*diff;
A1.grad += (-1.0)*dFdl2*dl2dx;
A2.grad += dFdl2*dl2dx;
}
return func;
}
#if 0 // AMG: I don't think there's any reason to support anisotropic,
// and I don't have those flags below in calc_value, but
// if I need them, I'll also need to uncomment this method
template<bool calculate_gradients>
cvm::real colvar::groupcoordnum::switching_function(cvm::rvector const &r0_vec,
int const &en,
int const &ed,
cvm::atom &A1,
cvm::atom &A2)
{
cvm::rvector const diff = cvm::position_distance(A1.pos, A2.pos);
cvm::rvector const scal_diff(diff.x/r0_vec.x, diff.y/r0_vec.y, diff.z/r0_vec.z);
cvm::real const l2 = scal_diff.norm2();
// Assume en and ed are even integers, and avoid sqrt in the following
int const en2 = en/2;
int const ed2 = ed/2;
cvm::real const xn = std::pow(l2, en2);
cvm::real const xd = std::pow(l2, ed2);
cvm::real const func = (1.0-xn)/(1.0-xd);
if (calculate_gradients) {
cvm::real const dFdl2 = (1.0/(1.0-xd))*(en2*(xn/l2) - func*ed2*(xd/l2))*(-1.0);
cvm::rvector const dl2dx((2.0/(r0_vec.x*r0_vec.x))*diff.x,
(2.0/(r0_vec.y*r0_vec.y))*diff.y,
(2.0/(r0_vec.z*r0_vec.z))*diff.z);
A1.grad += (-1.0)*dFdl2*dl2dx;
A2.grad += dFdl2*dl2dx;
}
return func;
}
#endif
void colvar::groupcoordnum::calc_value()
{
// create fake atoms to hold the com coordinates
cvm::atom group1_com_atom;
cvm::atom group2_com_atom;
group1_com_atom.pos = group1->center_of_mass();
group2_com_atom.pos = group2->center_of_mass();
x.real_value = coordnum::switching_function<false>(r0, en, ed,
group1_com_atom, group2_com_atom);
}
void colvar::groupcoordnum::calc_gradients()
{
cvm::atom group1_com_atom;
cvm::atom group2_com_atom;
group1_com_atom.pos = group1->center_of_mass();
group2_com_atom.pos = group2->center_of_mass();
coordnum::switching_function<true>(r0, en, ed, group1_com_atom, group2_com_atom);
group1->set_weighted_gradient(group1_com_atom.grad);
group2->set_weighted_gradient(group2_com_atom.grad);
}
void colvar::groupcoordnum::apply_force(colvarvalue const &force)
{
if (!group1->noforce)
group1->apply_colvar_force(force.real_value);
if (!group2->noforce)
group2->apply_colvar_force(force.real_value);
}

View File

@ -18,14 +18,14 @@ colvar::distance::distance(std::string const &conf)
provide(f_cvc_Jacobian);
provide(f_cvc_com_based);
group1 = parse_group(conf, "group1");
group2 = parse_group(conf, "group2");
if (get_keyval(conf, "forceNoPBC", b_no_PBC, false)) {
cvm::log("Computing distance using absolute positions (not minimal-image)");
}
if (get_keyval(conf, "oneSiteSystemForce", b_1site_force, false)) {
cvm::log("Computing total force on group 1 only");
}
group1 = parse_group(conf, "group1");
group2 = parse_group(conf, "group2");
init_total_force_params(conf);
x.type(colvarvalue::type_scalar);
}
@ -38,7 +38,6 @@ colvar::distance::distance()
provide(f_cvc_inv_gradient);
provide(f_cvc_Jacobian);
provide(f_cvc_com_based);
b_1site_force = false;
b_no_PBC = false;
x.type(colvarvalue::type_scalar);
}
@ -67,7 +66,7 @@ void colvar::distance::calc_gradients()
void colvar::distance::calc_force_invgrads()
{
group1->read_total_forces();
if ( b_1site_force ) {
if (is_enabled(f_cvc_one_site_total_force)) {
ft.real_value = -1.0 * (group1->total_force() * dist_v.unit());
} else {
group2->read_total_forces();
@ -97,6 +96,7 @@ colvar::distance_vec::distance_vec(std::string const &conf)
: distance(conf)
{
function_type = "distance_vec";
provide(f_cvc_com_based);
x.type(colvarvalue::type_3vector);
}
@ -105,6 +105,7 @@ colvar::distance_vec::distance_vec()
: distance()
{
function_type = "distance_vec";
provide(f_cvc_com_based);
x.type(colvarvalue::type_3vector);
}
@ -185,9 +186,9 @@ colvar::distance_z::distance_z(std::string const &conf)
if (get_keyval(conf, "forceNoPBC", b_no_PBC, false)) {
cvm::log("Computing distance using absolute positions (not minimal-image)");
}
if (get_keyval(conf, "oneSiteSystemForce", b_1site_force, false)) {
cvm::log("Computing total force on group \"main\" only");
}
init_total_force_params(conf);
}
colvar::distance_z::distance_z()
@ -251,7 +252,7 @@ void colvar::distance_z::calc_force_invgrads()
{
main->read_total_forces();
if (fixed_axis && !b_1site_force) {
if (fixed_axis && !is_enabled(f_cvc_one_site_total_force)) {
ref1->read_total_forces();
ft.real_value = 0.5 * ((main->total_force() - ref1->total_force()) * axis);
} else {
@ -351,7 +352,7 @@ void colvar::distance_xy::calc_force_invgrads()
{
main->read_total_forces();
if (fixed_axis && !b_1site_force) {
if (fixed_axis && !is_enabled(f_cvc_one_site_total_force)) {
ref1->read_total_forces();
ft.real_value = 0.5 / x.real_value * ((main->total_force() - ref1->total_force()) * dist_v_ortho);
} else {
@ -382,6 +383,7 @@ colvar::distance_dir::distance_dir(std::string const &conf)
: distance(conf)
{
function_type = "distance_dir";
provide(f_cvc_com_based);
x.type(colvarvalue::type_unit3vector);
}
@ -390,6 +392,7 @@ colvar::distance_dir::distance_dir()
: distance()
{
function_type = "distance_dir";
provide(f_cvc_com_based);
x.type(colvarvalue::type_unit3vector);
}
@ -461,7 +464,6 @@ colvar::distance_inv::distance_inv()
{
function_type = "distance_inv";
exponent = 6;
b_1site_force = false;
x.type(colvarvalue::type_scalar);
}

View File

@ -293,6 +293,9 @@ void colvardeps::init_cv_requires() {
f_description(f_cv_output_total_force, "output total force");
f_req_self(f_cv_output_total_force, f_cv_total_force);
f_description(f_cv_subtract_applied_force, "subtract applied force from total force");
f_req_self(f_cv_subtract_applied_force, f_cv_total_force);
f_description(f_cv_lower_boundary, "lower boundary");
f_req_self(f_cv_lower_boundary, f_cv_scalar);
@ -376,6 +379,11 @@ void colvardeps::init_cvc_requires() {
f_description(f_cvc_com_based, "depends on group centers of mass");
// Compute total force on first site only to avoid unwanted
// coupling to other colvars (see e.g. Ciccotti et al., 2005)
f_description(f_cvc_one_site_total_force, "compute total collective force only from one group center");
f_req_self(f_cvc_one_site_total_force, f_cvc_com_based);
f_description(f_cvc_scalable, "scalable calculation");
f_req_self(f_cvc_scalable, f_cvc_scalable_com);

View File

@ -176,6 +176,8 @@ public:
f_cv_total_force,
/// \brief Calculate total force from atomic forces
f_cv_total_force_calc,
/// \brief Subtract the applied force from the total force
f_cv_subtract_applied_force,
/// \brief Estimate Jacobian derivative
f_cv_Jacobian,
/// \brief Do not report the Jacobian force as part of the total force
@ -236,6 +238,7 @@ public:
/// \brief If enabled, calc_gradients() will call debug_gradients() for every group needed
f_cvc_debug_gradient,
f_cvc_Jacobian,
f_cvc_one_site_total_force,
f_cvc_com_based,
f_cvc_scalable,
f_cvc_scalable_com,

View File

@ -382,8 +382,8 @@ public:
inline int current_bin_scalar(int const i, int const iv) const
{
return value_to_bin_scalar(actual_value[i] ?
cv[i]->actual_value().vector1d_value[iv] :
cv[i]->value().vector1d_value[iv], i);
cv[i]->actual_value().vector1d_value[iv] :
cv[i]->value().vector1d_value[iv], i);
}
/// \brief Use the lower boundary and the width to report which bin
@ -395,8 +395,8 @@ public:
/// \brief Same as the standard version, but uses another grid definition
inline int value_to_bin_scalar(colvarvalue const &value,
colvarvalue const &new_offset,
cvm::real const &new_width) const
colvarvalue const &new_offset,
cvm::real const &new_width) const
{
return (int) std::floor( (value.real_value - new_offset.real_value) / new_width );
}
@ -410,22 +410,22 @@ public:
/// \brief Same as the standard version, but uses different parameters
inline colvarvalue bin_to_value_scalar(int const &i_bin,
colvarvalue const &new_offset,
cvm::real const &new_width) const
colvarvalue const &new_offset,
cvm::real const &new_width) const
{
return new_offset.real_value + new_width * (0.5 + i_bin);
}
/// Set the value at the point with index ix
inline void set_value(std::vector<int> const &ix,
T const &t,
size_t const &imult = 0)
T const &t,
size_t const &imult = 0)
{
data[this->address(ix)+imult] = t;
has_data = true;
}
/// \brief Get the change from this to other_grid
/// \brief Get the change from this to other_grid
/// and store the result in this.
/// this_grid := other_grid - this_grid
/// Grids must have the same dimensions.
@ -434,13 +434,13 @@ public:
if (other_grid.multiplicity() != this->multiplicity()) {
cvm::error("Error: trying to subtract two grids with "
"different multiplicity.\n");
"different multiplicity.\n");
return;
}
if (other_grid.data.size() != this->data.size()) {
cvm::error("Error: trying to subtract two grids with "
"different size.\n");
"different size.\n");
return;
}
@ -457,13 +457,13 @@ public:
{
if (other_grid.multiplicity() != this->multiplicity()) {
cvm::error("Error: trying to copy two grids with "
"different multiplicity.\n");
"different multiplicity.\n");
return;
}
if (other_grid.data.size() != this->data.size()) {
cvm::error("Error: trying to copy two grids with "
"different size.\n");
"different size.\n");
return;
}
@ -493,7 +493,7 @@ public:
/// \brief Get the binned value indexed by ix, or the first of them
/// if the multiplicity is larger than 1
inline T const & value(std::vector<int> const &ix,
size_t const &imult = 0) const
size_t const &imult = 0) const
{
return data[this->address(ix) + imult];
}
@ -541,7 +541,7 @@ public:
/// boundaries; a negative number is returned if the given point is
/// off-grid
inline cvm::real bin_distance_from_boundaries(std::vector<colvarvalue> const &values,
bool skip_hard_boundaries = false)
bool skip_hard_boundaries = false)
{
cvm::real minimum = 1.0E+16;
for (size_t i = 0; i < nd; i++) {
@ -574,7 +574,7 @@ public:
{
if (other_grid.multiplicity() != this->multiplicity()) {
cvm::error("Error: trying to merge two grids with values of "
"different multiplicity.\n");
"different multiplicity.\n");
return;
}
@ -593,8 +593,8 @@ public:
for (size_t i = 0; i < nd; i++) {
oix[i] =
value_to_bin_scalar(bin_to_value_scalar(ix[i], gb[i], gw[i]),
ogb[i],
ogw[i]);
ogb[i],
ogw[i]);
}
if (! other_grid.index_ok(oix)) {
@ -614,11 +614,11 @@ public:
/// \brief Add data from another grid of the same type, AND
/// identical definition (boundaries, widths)
void add_grid(colvar_grid<T> const &other_grid,
cvm::real scale_factor = 1.0)
cvm::real scale_factor = 1.0)
{
if (other_grid.multiplicity() != this->multiplicity()) {
cvm::error("Error: trying to sum togetehr two grids with values of "
"different multiplicity.\n");
"different multiplicity.\n");
return;
}
if (scale_factor != 1.0)
@ -636,7 +636,7 @@ public:
/// \brief Return the value suitable for output purposes (so that it
/// may be rescaled or manipulated without changing it permanently)
virtual inline T value_output(std::vector<int> const &ix,
size_t const &imult = 0)
size_t const &imult = 0)
{
return value(ix, imult);
}
@ -645,9 +645,9 @@ public:
/// into the internal representation (the two may be different,
/// e.g. when using colvar_grid_count)
virtual inline void value_input(std::vector<int> const &ix,
T const &t,
size_t const &imult = 0,
bool add = false)
T const &t,
size_t const &imult = 0,
bool add = false)
{
if ( add )
data[address(ix) + imult] += t;
@ -737,7 +737,8 @@ public:
}
/// Read a grid definition from a config string
int parse_params(std::string const &conf)
int parse_params(std::string const &conf,
colvarparse::Parse_Mode const parse_mode = colvarparse::parse_normal)
{
if (cvm::debug()) cvm::log("Reading grid configuration from string.\n");
@ -746,30 +747,33 @@ public:
{
size_t nd_in = 0;
// this is only used in state files
colvarparse::get_keyval(conf, "n_colvars", nd_in, nd, colvarparse::parse_silent);
if (nd_in != nd) {
cvm::error("Error: trying to read data for a grid "
"that contains a different number of colvars ("+
cvm::to_str(nd_in)+") than the grid defined "
"in the configuration file("+cvm::to_str(nd)+
").\n");
"that contains a different number of colvars ("+
cvm::to_str(nd_in)+") than the grid defined "
"in the configuration file("+cvm::to_str(nd)+
").\n");
return COLVARS_ERROR;
}
}
// underscore keywords are used in state file
colvarparse::get_keyval(conf, "lower_boundaries",
lower_boundaries, lower_boundaries, colvarparse::parse_silent);
lower_boundaries, lower_boundaries, colvarparse::parse_silent);
colvarparse::get_keyval(conf, "upper_boundaries",
upper_boundaries, upper_boundaries, colvarparse::parse_silent);
upper_boundaries, upper_boundaries, colvarparse::parse_silent);
// support also camel case
// camel case keywords are used in config file
colvarparse::get_keyval(conf, "lowerBoundaries",
lower_boundaries, lower_boundaries, colvarparse::parse_silent);
lower_boundaries, lower_boundaries, parse_mode);
colvarparse::get_keyval(conf, "upperBoundaries",
upper_boundaries, upper_boundaries, colvarparse::parse_silent);
upper_boundaries, upper_boundaries, parse_mode);
colvarparse::get_keyval(conf, "widths", widths, widths, colvarparse::parse_silent);
colvarparse::get_keyval(conf, "widths", widths, widths, parse_mode);
// only used in state file
colvarparse::get_keyval(conf, "sizes", nx, nx, colvarparse::parse_silent);
if (nd < lower_boundaries.size()) nd = lower_boundaries.size();
@ -808,13 +812,13 @@ public:
{
for (size_t i = 0; i < nd; i++) {
if ( (std::sqrt(cv[i]->dist2(cv[i]->lower_boundary,
lower_boundaries[i])) > 1.0E-10) ||
lower_boundaries[i])) > 1.0E-10) ||
(std::sqrt(cv[i]->dist2(cv[i]->upper_boundary,
upper_boundaries[i])) > 1.0E-10) ||
upper_boundaries[i])) > 1.0E-10) ||
(std::sqrt(cv[i]->dist2(cv[i]->width,
widths[i])) > 1.0E-10) ) {
widths[i])) > 1.0E-10) ) {
cvm::error("Error: restart information for a grid is "
"inconsistent with that of its colvars.\n");
"inconsistent with that of its colvars.\n");
return;
}
}
@ -830,19 +834,19 @@ public:
// matter: boundaries should be EXACTLY the same (otherwise,
// map_grid() should be used)
if ( (std::fabs(other_grid.lower_boundaries[i] -
lower_boundaries[i]) > 1.0E-10) ||
lower_boundaries[i]) > 1.0E-10) ||
(std::fabs(other_grid.upper_boundaries[i] -
upper_boundaries[i]) > 1.0E-10) ||
upper_boundaries[i]) > 1.0E-10) ||
(std::fabs(other_grid.widths[i] -
widths[i]) > 1.0E-10) ||
widths[i]) > 1.0E-10) ||
(data.size() != other_grid.data.size()) ) {
cvm::error("Error: inconsistency between "
"two grids that are supposed to be equal, "
"aside from the data stored.\n");
return;
cvm::error("Error: inconsistency between "
"two grids that are supposed to be equal, "
"aside from the data stored.\n");
return;
}
}
}
}
/// \brief Read grid entry in restart file
@ -853,7 +857,7 @@ public:
if ((is >> key) && (key == std::string("grid_parameters"))) {
is.seekg(start_pos, std::ios::beg);
is >> colvarparse::read_block("grid_parameters", conf);
parse_params(conf);
parse_params(conf, colvarparse::parse_silent);
} else {
cvm::log("Grid parameters are missing in the restart file, using those from the configuration.\n");
is.seekg(start_pos, std::ios::beg);
@ -871,11 +875,11 @@ public:
}
/// \brief Write the grid data without labels, as they are
/// represented in memory
/// \param buf_size Number of values per line
/// \brief Write the grid data without labels, as they are
/// represented in memory
/// \param buf_size Number of values per line
std::ostream & write_raw(std::ostream &os,
size_t const buf_size = 3)
size_t const buf_size = 3)
{
std::streamsize const w = os.width();
std::streamsize const p = os.precision();
@ -935,10 +939,10 @@ public:
os << std::setw(2) << "# " << nd << "\n";
for (size_t i = 0; i < nd; i++) {
os << "# "
<< std::setw(10) << lower_boundaries[i]
<< std::setw(10) << widths[i]
<< std::setw(10) << nx[i] << " "
<< periodic[i] << "\n";
<< std::setw(10) << lower_boundaries[i]
<< std::setw(10) << widths[i]
<< std::setw(10) << nx[i] << " "
<< periodic[i] << "\n";
}
@ -951,14 +955,14 @@ public:
for (size_t i = 0; i < nd; i++) {
os << " "
<< std::setw(w) << std::setprecision(p)
<< bin_to_value_scalar(ix[i], i);
<< std::setw(w) << std::setprecision(p)
<< bin_to_value_scalar(ix[i], i);
}
os << " ";
for (size_t imult = 0; imult < mult; imult++) {
os << " "
<< std::setw(w) << std::setprecision(p)
<< value_output(ix, imult);
<< std::setw(w) << std::setprecision(p)
<< value_output(ix, imult);
}
os << "\n";
}
@ -986,7 +990,7 @@ public:
if ( !(is >> hash) || (hash != "#") ) {
cvm::error("Error reading grid at position "+
cvm::to_str(is.tellg())+" in stream(read \"" + hash + "\")\n");
cvm::to_str(is.tellg())+" in stream(read \"" + hash + "\")\n");
return is;
}
@ -1008,7 +1012,7 @@ public:
for (size_t i = 0; i < nd; i++ ) {
if ( !(is >> hash) || (hash != "#") ) {
cvm::error("Error reading grid at position "+
cvm::to_str(is.tellg())+" in stream(read \"" + hash + "\")\n");
cvm::to_str(is.tellg())+" in stream(read \"" + hash + "\")\n");
return is;
}
@ -1016,10 +1020,10 @@ public:
if ( (std::fabs(lower - lower_boundaries[i].real_value) > 1.0e-10) ||
(std::fabs(width - widths[i] ) > 1.0e-10) ||
(nx_read[i] != nx[i]) ) {
(std::fabs(width - widths[i] ) > 1.0e-10) ||
(nx_read[i] != nx[i]) ) {
cvm::log("Warning: reading from different grid definition (colvar "
+ cvm::to_str(i+1) + "); remapping data on new grid.\n");
+ cvm::to_str(i+1) + "); remapping data on new grid.\n");
remap = true;
}
}
@ -1063,7 +1067,6 @@ public:
/// \brief Write the grid data without labels, as they are
/// represented in memory
/// \param buf_size Number of values per line
std::ostream & write_opendx(std::ostream &os)
{
// write the header
@ -1122,11 +1125,11 @@ public:
/// Constructor
colvar_grid_count(std::vector<int> const &nx_i,
size_t const &def_count = 0);
size_t const &def_count = 0);
/// Constructor from a vector of colvars
colvar_grid_count(std::vector<colvar *> &colvars,
size_t const &def_count = 0);
size_t const &def_count = 0);
/// Increment the counter at given position
inline void incr_count(std::vector<int> const &ix)
@ -1136,7 +1139,7 @@ public:
/// \brief Get the binned count indexed by ix from the newly read data
inline size_t const & new_count(std::vector<int> const &ix,
size_t const &imult = 0)
size_t const &imult = 0)
{
return new_data[address(ix) + imult];
}
@ -1145,9 +1148,9 @@ public:
/// into the internal representation (it may have been rescaled or
/// manipulated)
virtual inline void value_input(std::vector<int> const &ix,
size_t const &t,
size_t const &imult = 0,
bool add = false)
size_t const &t,
size_t const &imult = 0,
bool add = false)
{
if (add) {
data[address(ix)] += t;
@ -1164,7 +1167,7 @@ public:
/// \brief Return the log-gradient from finite differences
/// on the *same* grid for dimension n
inline const cvm::real log_gradient_finite_diff( const std::vector<int> &ix0,
int n = 0)
int n = 0)
{
cvm::real A0, A1;
std::vector<int> ix;
@ -1377,7 +1380,7 @@ public:
/// \brief Return the value of the function at ix divided by its
/// number of samples (if the count grid is defined)
virtual inline cvm::real value_output(std::vector<int> const &ix,
size_t const &imult = 0)
size_t const &imult = 0)
{
if (samples)
return (samples->value(ix) > 0) ?
@ -1391,9 +1394,9 @@ public:
/// into the internal representation (it may have been rescaled or
/// manipulated)
virtual inline void value_input(std::vector<int> const &ix,
cvm::real const &new_value,
size_t const &imult = 0,
bool add = false)
cvm::real const &new_value,
size_t const &imult = 0,
bool add = false)
{
if (add) {
if (samples)

View File

@ -293,6 +293,9 @@ int colvarmodule::parse_biases(std::string const &conf)
/// initialize histograms
parse_biases_type<colvarbias_histogram>(conf, "histogram", n_histo_biases);
/// initialize histogram restraints
parse_biases_type<colvarbias_restraint_histogram>(conf, "histogramRestraint", n_rest_biases);
/// initialize linear restraints
parse_biases_type<colvarbias_restraint_linear>(conf, "linear", n_rest_biases);

View File

@ -4,7 +4,7 @@
#define COLVARMODULE_H
#ifndef COLVARS_VERSION
#define COLVARS_VERSION "2016-09-14"
#define COLVARS_VERSION "2016-09-30"
#endif
#ifndef COLVARS_DEBUG

View File

@ -243,11 +243,17 @@ int colvarscript::proc_colvar(int argc, char const *argv[]) {
}
if (subcmd == "getappliedforce") {
result = (cv->bias_force()).to_simple_string();
result = (cv->applied_force()).to_simple_string();
return COLVARS_OK;
}
if (subcmd == "getsystemforce") {
// TODO warning here
result = (cv->total_force()).to_simple_string();
return COLVARS_OK;
}
if (subcmd == "gettotalforce") {
result = (cv->total_force()).to_simple_string();
return COLVARS_OK;
}

View File

@ -57,6 +57,12 @@ public:
}
}
/// Return a reference to the data
inline std::vector<T> &data_array()
{
return data;
}
inline ~vector1d()
{
data.clear();
@ -203,6 +209,16 @@ public:
return std::sqrt(this->norm2());
}
inline cvm::real sum() const
{
cvm::real result = 0.0;
size_t i;
for (i = 0; i < this->size(); i++) {
result += (*this)[i];
}
return result;
}
/// Slicing
inline vector1d<T> const slice(size_t const i1, size_t const i2) const
{
@ -295,11 +311,23 @@ public:
{
std::stringstream stream(s);
size_t i = 0;
while ((stream >> (*this)[i]) && (i < this->size())) {
i++;
}
if (i < this->size()) {
return COLVARS_ERROR;
if (this->size()) {
while ((stream >> (*this)[i]) && (i < this->size())) {
i++;
}
if (i < this->size()) {
return COLVARS_ERROR;
}
} else {
T input;
while (stream >> input) {
if ((i % 100) == 0) {
data.reserve(data.size()+100);
}
data.resize(data.size()+1);
data[i] = input;
i++;
}
}
return COLVARS_OK;
}
@ -434,6 +462,12 @@ public:
this->clear();
}
/// Return a reference to the data
inline std::vector<T> &data_array()
{
return data;
}
inline row & operator [] (size_t const i)
{
return rows[i];

View File

@ -1,8 +1,8 @@
// -------------------------------------------------------------
// CUDPP -- CUDA Data Parallel Primitives library
// -------------------------------------------------------------
// $Revision$
// $Date$
// $Revision: 5289 $
// $Date: 2010-11-23 13:04:43 -0700 (Tue, 23 Nov 2010) $
// -------------------------------------------------------------
// This source code is distributed under the terms of license.txt in
// the root directory of this source distribution.

View File

@ -1,8 +1,8 @@
// -------------------------------------------------------------
// cuDPP -- CUDA Data Parallel Primitives library
// -------------------------------------------------------------
// $Revision$
// $Date$
// $Revision: 5289 $
// $Date: 2010-11-23 13:04:43 -0700 (Tue, 23 Nov 2010) $
// -------------------------------------------------------------
// This source code is distributed under the terms of license.txt in
// the root directory of this source distribution.

View File

@ -1,8 +1,8 @@
// -------------------------------------------------------------
// cuDPP -- CUDA Data Parallel Primitives library
// -------------------------------------------------------------
// $Revision$
// $Date$
// $Revision: 5289 $
// $Date: 2010-11-23 13:04:43 -0700 (Tue, 23 Nov 2010) $
// -------------------------------------------------------------
// This source code is distributed under the terms of license.txt
// in the root directory of this source distribution.

View File

@ -2,7 +2,7 @@
// CUDPP -- CUDA Data Parallel Primitives library
// -------------------------------------------------------------
// $Revision: 3572$
// $Date$
// $Date: 2010-11-23 13:04:43 -0700 (Tue, 23 Nov 2010) $
// -------------------------------------------------------------
// This source code is distributed under the terms of license.txt
// in the root directory of this source distribution.

View File

@ -2,7 +2,7 @@
// cuDPP -- CUDA Data Parallel Primitives library
// -------------------------------------------------------------
// $Revision: 3572$
// $Date$
// $Date: 2010-11-23 13:04:43 -0700 (Tue, 23 Nov 2010) $
// -------------------------------------------------------------
// This source code is distributed under the terms of license.txt
// in the root directory of this source distribution.

View File

@ -1,8 +1,8 @@
// -------------------------------------------------------------
// cuDPP -- CUDA Data Parallel Primitives library
// -------------------------------------------------------------
// $Revision$
// $Date$
// $Revision: 5289 $
// $Date: 2010-11-23 13:04:43 -0700 (Tue, 23 Nov 2010) $
// -------------------------------------------------------------
// This source code is distributed under the terms of license.txt
// in the root directory of this source distribution.

View File

@ -1,8 +1,8 @@
// -------------------------------------------------------------
// cuDPP -- CUDA Data Parallel Primitives library
// -------------------------------------------------------------
// $Revision$
// $Date$
// $Revision: 5289 $
// $Date: 2010-11-23 13:04:43 -0700 (Tue, 23 Nov 2010) $
// -------------------------------------------------------------
// This source code is distributed under the terms of license.txt
// in the root directory of this source distribution.

View File

@ -1,8 +1,8 @@
// -------------------------------------------------------------
// cuDPP -- CUDA Data Parallel Primitives library
// -------------------------------------------------------------
// $Revision$
// $Date$
// $Revision: 5289 $
// $Date: 2010-11-23 13:04:43 -0700 (Tue, 23 Nov 2010) $
// -------------------------------------------------------------
// This source code is distributed under the terms of license.txt in
// the root directory of this source distribution.

View File

@ -1,8 +1,8 @@
// -------------------------------------------------------------
// cuDPP -- CUDA Data Parallel Primitives library
// -------------------------------------------------------------
// $Revision$
// $Date$
// $Revision: 5289 $
// $Date: 2010-11-23 13:04:43 -0700 (Tue, 23 Nov 2010) $
// -------------------------------------------------------------
// This source code is distributed under the terms of license.txt
// in the root directory of this source distribution.

0
lib/linalg/Makefile.gfortran Executable file → Normal file
View File

0
lib/linalg/Makefile.mingw32-cross Executable file → Normal file
View File

0
lib/linalg/Makefile.mingw64-cross Executable file → Normal file
View File

1
lib/meam/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.mod

0
lib/meam/Makefile.tbird Executable file → Normal file
View File

0
lib/meam/meam_data.F Executable file → Normal file
View File

0
lib/meam/meam_dens_final.F Executable file → Normal file
View File

0
lib/meam/meam_dens_init.F Executable file → Normal file
View File

0
lib/meam/meam_force.F Executable file → Normal file
View File

10
lib/meam/meam_setup_done.F Executable file → Normal file
View File

@ -183,6 +183,16 @@ c
real*8, external :: zbl
real*8, external :: compute_phi
c check for previously allocated arrays and free them
if(allocated(phir)) deallocate(phir)
if(allocated(phirar)) deallocate(phirar)
if(allocated(phirar1)) deallocate(phirar1)
if(allocated(phirar2)) deallocate(phirar2)
if(allocated(phirar3)) deallocate(phirar3)
if(allocated(phirar4)) deallocate(phirar4)
if(allocated(phirar5)) deallocate(phirar5)
if(allocated(phirar6)) deallocate(phirar6)
c allocate memory for array that defines the potential
allocate(phir(nr,(neltypes*(neltypes+1))/2))

0
lib/meam/meam_setup_global.F Executable file → Normal file
View File

0
lib/meam/meam_setup_param.F Executable file → Normal file
View File

0
lib/reax/Makefile.g95 Executable file → Normal file
View File

0
lib/reax/Makefile.gfortran Executable file → Normal file
View File

1023
potentials/charmm22.cmap Normal file

File diff suppressed because it is too large Load Diff

1023
potentials/charmm36.cmap Normal file

File diff suppressed because it is too large Load Diff

4
python/.gitignore vendored
View File

@ -1,3 +1 @@
*.pyc
__pycache__
build
/build

1
python/examples/ipython/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.orig

View File

@ -53,6 +53,7 @@ class lammps(object):
def __init__(self,name="",cmdargs=None,ptr=None,comm=None):
self.comm = comm
self.opened = 0
# determine module location
@ -133,21 +134,20 @@ class lammps(object):
# self.lmp = self.lib.lammps_open_no_mpi(0,None)
else:
if isinstance(ptr,lammps):
# magic to convert ptr to ctypes ptr
pythonapi.PyCObject_AsVoidPtr.restype = c_void_p
pythonapi.PyCObject_AsVoidPtr.argtypes = [py_object]
self.lmp = c_void_p(pythonapi.PyCObject_AsVoidPtr(ptr))
else:
self.lmp = None
raise TypeError('Unsupported type passed as "ptr"')
# magic to convert ptr to ctypes ptr
pythonapi.PyCObject_AsVoidPtr.restype = c_void_p
pythonapi.PyCObject_AsVoidPtr.argtypes = [py_object]
self.lmp = c_void_p(pythonapi.PyCObject_AsVoidPtr(ptr))
def __del__(self):
if self.lmp and self.opened: self.lib.lammps_close(self.lmp)
if self.lmp and self.opened:
self.lib.lammps_close(self.lmp)
self.opened = 0
def close(self):
if self.opened: self.lib.lammps_close(self.lmp)
self.lmp = None
self.opened = 0
def version(self):
return self.lib.lammps_version(self.lmp)
@ -507,8 +507,7 @@ class PyLammps(object):
elif isinstance(ptr,lammps):
self.lmp = ptr
else:
self.lmp = None
raise TypeError('Unsupported type passed as "ptr"')
self.lmp = lammps(name=name,cmdargs=cmdargs,ptr=ptr,comm=comm)
else:
self.lmp = lammps(name=name,cmdargs=cmdargs,ptr=None,comm=comm)
print("LAMMPS output is captured by PyLammps wrapper")

1031
src/.gitignore vendored

File diff suppressed because it is too large Load Diff

0
src/ASPHERE/compute_temp_asphere.cpp Executable file → Normal file
View File

0
src/ASPHERE/compute_temp_asphere.h Executable file → Normal file
View File

0
src/ASPHERE/fix_npt_asphere.cpp Executable file → Normal file
View File

0
src/ASPHERE/fix_npt_asphere.h Executable file → Normal file
View File

0
src/ASPHERE/fix_nve_asphere.cpp Executable file → Normal file
View File

0
src/ASPHERE/fix_nve_asphere.h Executable file → Normal file
View File

0
src/ASPHERE/fix_nve_asphere_noforce.h Executable file → Normal file
View File

0
src/ASPHERE/fix_nvt_asphere.cpp Executable file → Normal file
View File

0
src/ASPHERE/fix_nvt_asphere.h Executable file → Normal file
View File

0
src/ASPHERE/pair_gayberne.cpp Executable file → Normal file
View File

0
src/ASPHERE/pair_gayberne.h Executable file → Normal file
View File

0
src/ASPHERE/pair_resquared.cpp Executable file → Normal file
View File

0
src/ASPHERE/pair_resquared.h Executable file → Normal file
View File

0
src/BODY/compute_temp_body.cpp Executable file → Normal file
View File

0
src/BODY/compute_temp_body.h Executable file → Normal file
View File

0
src/BODY/fix_npt_body.cpp Executable file → Normal file
View File

0
src/BODY/fix_npt_body.h Executable file → Normal file
View File

0
src/BODY/fix_nvt_body.cpp Executable file → Normal file
View File

0
src/BODY/fix_nvt_body.h Executable file → Normal file
View File

0
src/COLLOID/pair_brownian.cpp Executable file → Normal file
View File

0
src/COLLOID/pair_lubricate.cpp Executable file → Normal file
View File

0
src/DIPOLE/pair_lj_cut_dipole_cut.cpp Executable file → Normal file
View File

0
src/DIPOLE/pair_lj_cut_dipole_cut.h Executable file → Normal file
View File

0
src/DIPOLE/pair_lj_cut_dipole_long.cpp Executable file → Normal file
View File

0
src/DIPOLE/pair_lj_cut_dipole_long.h Executable file → Normal file
View File

0
src/DIPOLE/pair_lj_long_dipole_long.cpp Executable file → Normal file
View File

0
src/DIPOLE/pair_lj_long_dipole_long.h Executable file → Normal file
View File

0
src/GPU/pair_lj_cut_dipole_cut_gpu.cpp Executable file → Normal file
View File

0
src/GPU/pair_lj_cut_dipole_cut_gpu.h Executable file → Normal file
View File

0
src/GPU/pair_lj_sf_dipole_sf_gpu.cpp Executable file → Normal file
View File

0
src/GPU/pair_lj_sf_dipole_sf_gpu.h Executable file → Normal file
View File

0
src/KOKKOS/angle_charmm_kokkos.cpp Executable file → Normal file
View File

Some files were not shown because too many files have changed in this diff Show More