Reference configuration of SPC/E water in non-cuboid domain

[1]:
import unittest

script="""
MonteCarlo
Configuration side_length0 30.0 side_length1 28.97777478867205 side_length2 29.51512917398008 \
    xy 7.764571353075622 xz -2.6146722824297473 yz -4.692615336756641 \
    xyz_file /feasst/plugin/charge/test/data/spce_triclinic_sample_periodic1.xyz \
    particle_type0 /feasst/particle/spce.fstprt
Potential Model LennardJones
Potential VisitModel LongRangeCorrections
Potential VisitModel Ewald alpha 0.2850 kxmax 7 kymax 7 kzmax 7
Potential Model ChargeScreened
Potential Model ChargeScreenedIntra VisitModel VisitModelBond
Potential Model ChargeSelf
ThermoParams beta 1000000
Metropolis
Log file_name en.csv max_precision true clear_file true
Run num_trials 1
"""

with open('script.txt', 'w') as file: file.write(script)
import subprocess
syscode = subprocess.call("../../../build/bin/fst < script.txt > script.log", shell=True, executable='/bin/bash')
with open('script.log', 'r') as file: print(file.read(), '\n', 'exit:', syscode)
# FEASST version: v0.19.0-85-gdff8cb12e2-dirty-hwh/newtutorials
Configuration particle_type0 /home/hwh/feasst/particle/spce.fstprt side_length0 30.0 side_length1 28.97777478867205 side_length2 29.51512917398008 xy 7.764571353075622 xyz_file /home/hwh/feasst/plugin/charge/test/data/spce_triclinic_sample_periodic1.xyz xz -2.6146722824297473 yz -4.692615336756641
Potential Model LennardJones
Potential VisitModel LongRangeCorrections
Potential VisitModel Ewald alpha 0.2850 kxmax 7 kymax 7 kzmax 7
# Info 0 [plugin/charge/src/ewald.cpp:190] alpha: 0.285
# Info 0 [plugin/charge/src/ewald.cpp:191] kmax_squared 2.3037
# Info 0 [plugin/charge/src/ewald.cpp:190] alpha: 0.285
# Info 0 [plugin/charge/src/ewald.cpp:191] kmax_squared 2.3037
Potential Model ChargeScreened
# Info 0 [plugin/charge/src/ewald.cpp:190] alpha: 0.285
# Info 0 [plugin/charge/src/ewald.cpp:191] kmax_squared 2.3037
Potential Model ChargeScreenedIntra VisitModel VisitModelBond
# Info 0 [plugin/charge/src/ewald.cpp:190] alpha: 0.285
# Info 0 [plugin/charge/src/ewald.cpp:191] kmax_squared 2.3037
Potential Model ChargeSelf
# Info 0 [plugin/charge/src/ewald.cpp:190] alpha: 0.285
# Info 0 [plugin/charge/src/ewald.cpp:191] kmax_squared 2.3037
ThermoParams beta 1000000
Metropolis
# Info 0 [plugin/charge/src/ewald.cpp:190] alpha: 0.285
# Info 0 [plugin/charge/src/ewald.cpp:191] kmax_squared 2.3037
Log clear_file true file_name en.csv max_precision true
Run num_trials 1

 exit: 0

If the test passes, the energy is within the tolerance of the SRSW value and the two ensemble average methods agreed.

[2]:
import pandas as pd
class TestEwald0SPCE(unittest.TestCase):
    def test_srsw(self):
        df=pd.read_csv('en.csv')
        self.assertAlmostEqual(df['LennardJones'][0], 931.15451, delta=1e-4)
        self.assertAlmostEqual(df['LongRangeCorrections'][0], -34.16569, delta=1e-4)
        self.assertAlmostEqual(df['Ewald'][0], 371.46525, delta=1e-4)
        self.assertAlmostEqual(df['ChargeScreened'][0], -6046.43627, delta=1e-4)
        self.assertAlmostEqual(df['ChargeScreenedIntra'][0], 95078.89447, delta=1e-4)
        self.assertAlmostEqual(df['ChargeSelf'][0], -96297.75579, delta=1e-4)
unittest.main(argv=[''], verbosity=2, exit=False)
test_srsw (__main__.TestEwald0SPCE) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.004s

OK
[2]:
<unittest.main.TestProgram at 0x7ff5484bd850>

Did this tutorial work as expected? Did you find any inconsistencies or have any comments? Please contact us. Any feedback is appreciated!