Closed bondrewd closed 1 year ago
Patch coverage: 92.98
% and project coverage change: +0.16
:tada:
Comparison is base (
38dec32
) 72.90% compared to head (e0425c8
) 73.06%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Nice one! Something to consider is constructing it with a SVector
instead, e.g.
MonteCarloAnisotropicBarostat(
SVector(1.0u"bar", 1.0u"bar", 1.0u"bar"),
temperature,
boundary
)
This gives a little more consistency between the 3D/2D calls and may reduce code reuse internally by allowing one constructor to be defined.
Thank you for the comment! I have refactored the constructor, using a SVector
for the pressure. It helps to simplify the interface since the dimension of the pressure vector becomes available.
I also added some tests following the current examples. They are designed to check for regressions. In the future, implementing more rigorous tests might be of interest.
The implementation seems good from a quick look.
As you say there is the question of how to test this since we don't currently allow logging pressure in one axis. It might be nice to test with a pressure other than SVector(1.0u"bar", 1.0u"bar", 1.0u"bar")
though. Maybe you could test with SVector(1.5u"bar", 0.5u"bar", 1.0u"bar")
or similar, and update the ranges for testing as appropriate. Perhaps the box size in each dimension is available to test and shows a difference in this scheme too?
Thank you for the suggestion! I added more cases for testing the pressure combination you suggested and different couplings: only X-axis, only Y-axis, only Z-axis, and uncoupled.
Great, thanks.
This PR adds an implementation for the anisotropic Monte Carlo barostat following OpenMM's implementation.
The new interface for using this barostat in 3D and 2D systems is:
and
respectively.
If you set any pressure value as 'nothing', the barostat is uncoupled in that axis. For example, for coupling only the Y-axis, you could do the following:
After discussing and merging this PR, I will start working on the constant surface tension MC barostat for membrane simulations.