Small update to mdrun tests.
authorDavid van der Spoel <spoel@xray.bmc.uu.se>
Fri, 30 Nov 2018 14:10:57 +0000 (15:10 +0100)
committerDavid van der Spoel <spoel@xray.bmc.uu.se>
Tue, 4 Dec 2018 21:41:04 +0000 (22:41 +0100)
To be able to run tests with different cut-offs new
variable rcoulomb and rvdw are introduced.

To be able to do high precision tests (normal mode
analysis) g96 files can be read now.
Change-Id: I9265022f516b66815aa7bc516b71918fdc6f417a

src/programs/mdrun/tests/moduletest.cpp
src/programs/mdrun/tests/moduletest.h
src/programs/mdrun/tests/simulationdatabase.cpp

index 88e64ffd8db114b7ea3b6698e4ea76b3699d2e25..5733d41d64f67780a468f289a74e50f044519b25 100644 (file)
@@ -136,6 +136,14 @@ SimulationRunner::useStringAsNdxFile(const char *ndxString)
     gmx::TextWriter::writeFileFromString(ndxFileName_, ndxString);
 }
 
+void
+SimulationRunner::useTopG96AndNdxFromDatabase(const std::string &name)
+{
+    topFileName_ = gmx::test::TestFileManager::getInputFilePath(name + ".top");
+    groFileName_ = gmx::test::TestFileManager::getInputFilePath(name + ".g96");
+    ndxFileName_ = gmx::test::TestFileManager::getInputFilePath(name + ".ndx");
+}
+
 void
 SimulationRunner::useTopGroAndNdxFromDatabase(const std::string &name)
 {
index edba08915b5e30da553d19beda86fbbace90a4f3..e10be452669636880e4cdb8131ba347222bfa4c6 100644 (file)
@@ -98,6 +98,8 @@ class SimulationRunner
         void useStringAsMdpFile(const std::string &mdpString);
         //! Use a string as -n input to grompp
         void useStringAsNdxFile(const char *ndxString);
+        //! Use a standard .top and .g96 file as input to grompp
+        void useTopG96AndNdxFromDatabase(const std::string &name);
         //! Use a standard .top and .gro file as input to grompp
         void useTopGroAndNdxFromDatabase(const std::string &name);
         //! Use a standard .gro file as input to grompp
index bc25a861399e0f1c38fbf8ffcf8817b5a218cd62..a4d87197f79f4c38ecc680187729e70b90b8d536 100644 (file)
@@ -229,6 +229,8 @@ MdpFieldValues prepareDefaultMdpFieldValues(const char *simulationName)
     mdpFieldValues.insert(MdpField("compressibility", "5e-5"));
     mdpFieldValues.insert(MdpField("constraints", "none"));
     mdpFieldValues.insert(MdpField("other", ""));
+    mdpFieldValues.insert(MdpField("rcoulomb", "0.7"));
+    mdpFieldValues.insert(MdpField("rvdw", "0.7"));
 
     return mdpFieldValues;
 }
@@ -289,8 +291,8 @@ prepareMdpFileContents(const MdpFieldValues &mdpFieldValues)
      * energies were not computed with those from rerun on the same
      * coordinates.
      */
-    return formatString(R"(rcoulomb                = 0.7
-                           rvdw                    = 0.7
+    return formatString(R"(rcoulomb                = %s
+                           rvdw                    = %s
                            rlist                   = -1
                            bd-fric                 = 1000
                            verlet-buffer-tolerance = 0.000001
@@ -316,6 +318,8 @@ prepareMdpFileContents(const MdpFieldValues &mdpFieldValues)
                            lincs-order             = 2
                            lincs-iter              = 5
                            %s)",
+                        mdpFieldValues.at("rcoulomb").c_str(),
+                        mdpFieldValues.at("rvdw").c_str(),
                         mdpFieldValues.at("nsteps").c_str(),
                         mdpFieldValues.at("integrator").c_str(),
                         mdpFieldValues.at("tcoupl").c_str(),