Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds functionality to output the stress tensor at user-defined intervals during molecular dynamics (MD) simulations, enabling viscosity calculations using the Green-Kubo or Einstein relations.
Details
Introduces two new keywords:
SAVE-STRESScontrols whether the full stress tensor is written during MD simulation.STRESS-FREQsets the number of MD steps between stress tensor writes.Outputs components to a formatted
.strfile with a single-line, 7-column layout: the MD step followed by the 6 unique stress tensor components with labeled headers.Adds new source files to support stress tensor output:
strvar.fdefines variables for stress tensor outputstresinit.fchecks for stress output request from userprtstres.fwrites tensor data to.strfileUpdates existing source files to integrate new functionality:
dynamic.fupdated to callstresinit.fverlet.fupdated to callprtstres.fbeeman.fupdated to callprtstres.fUpdates
CMakeLists.txtto include new source files in the build systemSample Output
Appears in the
.strfile:Performance
Potential Documentation Text for Manual
SAVE-STRESS
Causes Tinker molecular dynamics calculations to save the values of the stress tensor components to an output file with the suffix ".str". This keyword is compatible with the velocity-verlet and beeman integrators.
STRESS-FREQ
Sets the number of MD steps between stress tensor prints. A default value of 10 steps is used for STRESS-FREQ in absence of the keyword.
Notes
Manuscript in preparation describing these modifications and a companion toolkit for viscosity calculations.
Modifications have also been implemented in version 8.11.4. Separate branches are maintained for version compatibility.
Support for these additions has been implemented in the CMake build system. I can extend this to the Makefile-based build system if desired. Happy to adjust anything to better align with project conventions. Thanks for your time and consideration.