Add tests for gmx mindist
authorKevin Boyd <kevin.boyd@uconn.edu>
Tue, 15 Jan 2019 02:18:49 +0000 (21:18 -0500)
committerChristian Blau <cblau@gwdg.de>
Fri, 18 Jan 2019 10:37:44 +0000 (11:37 +0100)
Freed up some memory in gmx_mindist

Changed some static variables to normal variables, as
their values were propagating between tests and messing
with the options

Change-Id: Ideb0341659ad2d8a66769e671e1fafadd6ea8d02

15 files changed:
src/gromacs/gmxana/gmx_mindist.cpp
src/gromacs/gmxana/tests/CMakeLists.txt
src/gromacs/gmxana/tests/gmx_mindist.cpp [new file with mode: 0644]
src/gromacs/gmxana/tests/refdata/MindistTest_groupWorks.xml [new file with mode: 0644]
src/gromacs/gmxana/tests/refdata/MindistTest_matrixWorks.xml [new file with mode: 0644]
src/gromacs/gmxana/tests/refdata/MindistTest_maxDistWorks.xml [new file with mode: 0644]
src/gromacs/gmxana/tests/refdata/MindistTest_mindistDoesNotPickUpContacts.xml [new file with mode: 0644]
src/gromacs/gmxana/tests/refdata/MindistTest_mindistPicksUpContacts.xml [new file with mode: 0644]
src/gromacs/gmxana/tests/refdata/MindistTest_mindistWorksWithMultipleAtoms.xml [new file with mode: 0644]
src/gromacs/gmxana/tests/refdata/MindistTest_mindistWorksWithSingleAtoms.xml [new file with mode: 0644]
src/gromacs/gmxana/tests/refdata/MindistTest_ngWorks.xml [new file with mode: 0644]
src/gromacs/gmxana/tests/refdata/MindistTest_noPbcWorks.xml [new file with mode: 0644]
src/gromacs/gmxana/tests/refdata/MindistTest_resPerTimeWorks.xml [new file with mode: 0644]
src/testutils/simulationdatabase/mindist.ndx [new file with mode: 0644]
src/testutils/simulationdatabase/mindist_coords.gro [new file with mode: 0644]

index 9ce1732513998f81d27c582046e1bf5767c00a1c..52cd5148f0fbe05c0ce5c177348c2599b7302df5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -593,7 +593,17 @@ static void dist_plot(const char *fn, const char *afile, const char *dfile,
         xvgrclose(res);
     }
 
-    sfree(x0);
+    if (x0)
+    {
+        sfree(x0);
+    }
+
+    int freeLeg = bMat ? (ng == 1 ? 1 : (ng*(ng-1))/2)  : ng - 1;
+    for (int i = 0; i < freeLeg; i++)
+    {
+        sfree(leg[i]);
+    }
+    sfree(leg);
 }
 
 static int find_residues(const t_atoms *atoms, int n, const int index[], int **resindex)
@@ -667,11 +677,11 @@ int gmx_mindist(int argc, char *argv[])
         "Also [gmx-distance] and [gmx-pairdist] calculate distances."
     };
 
-    static gmx_bool   bMat             = FALSE, bPI = FALSE, bSplit = FALSE, bMax = FALSE, bPBC = TRUE;
-    static gmx_bool   bGroup           = FALSE;
-    static real       rcutoff          = 0.6;
-    static int        ng               = 1;
-    static gmx_bool   bEachResEachTime = FALSE, bPrintResName = FALSE;
+    gmx_bool          bMat             = FALSE, bPI = FALSE, bSplit = FALSE, bMax = FALSE, bPBC = TRUE;
+    gmx_bool          bGroup           = FALSE;
+    real              rcutoff          = 0.6;
+    int               ng               = 1;
+    gmx_bool          bEachResEachTime = FALSE, bPrintResName = FALSE;
     t_pargs           pa[]             = {
         { "-matrix", FALSE, etBOOL, {&bMat},
           "Calculate half a matrix of group-group distances" },
@@ -697,7 +707,7 @@ int gmx_mindist(int argc, char *argv[])
     gmx_output_env_t *oenv;
     t_topology       *top  = nullptr;
     int               ePBC = -1;
-    rvec             *x;
+    rvec             *x    = nullptr;
     matrix            box;
     gmx_bool          bTop = FALSE;
 
@@ -823,5 +833,17 @@ int gmx_mindist(int argc, char *argv[])
         do_view(oenv, numfnm, "-nxy");
     }
 
+    output_env_done(oenv);
+    done_top(top);
+    for (int i = 0; i < ng; i++)
+    {
+        sfree(index[i]);
+    }
+    sfree(index);
+    sfree(gnx);
+    sfree(x);
+    sfree(grpname);
+    sfree(top);
+
     return 0;
 }
index e8db2e4fc21cdc001bdcbbc935b7d53ce339abb8..4738db4f77206b9f01356c5788caa20bfd38a63f 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -39,6 +39,7 @@ gmx_add_gtest_executable(
     entropy.cpp
     gmx_traj.cpp
     gmx_trjconv.cpp
+    gmx_mindist.cpp
     gmx_msd.cpp
     )
 gmx_register_gtest_test(GmxAnaTest ${exename} INTEGRATION_TEST)
diff --git a/src/gromacs/gmxana/tests/gmx_mindist.cpp b/src/gromacs/gmxana/tests/gmx_mindist.cpp
new file mode 100644 (file)
index 0000000..b2e5459
--- /dev/null
@@ -0,0 +1,209 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2019, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for gmx mindist.
+ *
+ * \author Kevin Boyd <kevin.boyd@uconn.edu>
+ */
+
+#include "gmxpre.h"
+
+#include <cstdio>
+#include <cstdlib>
+
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/path.h"
+#include "gromacs/utility/textreader.h"
+
+#include "testutils/cmdlinetest.h"
+#include "testutils/refdata.h"
+#include "testutils/stdiohelper.h"
+#include "testutils/testfilemanager.h"
+#include "testutils/textblockmatchers.h"
+#include "testutils/xvgtest.h"
+
+namespace
+{
+
+using gmx::test::CommandLine;
+using gmx::test::XvgMatch;
+using gmx::test::StdioTestHelper;
+
+class MindistTest : public gmx::test::CommandLineTestBase
+{
+    public:
+        MindistTest()
+        {
+            setInputFile("-f", "mindist_coords.gro");
+            setInputFile("-s", "mindist_coords.gro");
+            setInputFile("-n", "mindist.ndx");
+        }
+
+        void runTest(const CommandLine &args, const char * stringForStdin)
+        {
+            StdioTestHelper stdioHelper(&fileManager());
+            stdioHelper.redirectStringToStdin(stringForStdin);
+
+            CommandLine &cmdline = commandLine();
+            cmdline.merge(args);
+            ASSERT_EQ(0, gmx_mindist(cmdline.argc(), cmdline.argv()));
+            checkOutputFiles();
+        }
+};
+
+/* mindist_coords.pdb has 3 beads spaced out in a 5 nm box, with the same yz coordinates
+ * and x coordinates of 1, 4, and 4.5. Indices are as follows
+ * index 0 : atom 1
+ * index 1 : atom 2
+ * index 2 : atom 3
+ * index 3 : atoms (1 ,2)
+ * index 4 : atoms (2, 3)
+ * index 5 : atoms (1, 2, 3)
+ */
+
+// Mindist between beads 0 and 1 should = 2 (across periodic boundaries)
+TEST_F(MindistTest, mindistWorksWithSingleAtoms)
+{
+    setOutputFile("-od", "mindist.xvg", XvgMatch());
+    const char *const  cmdline[] = {
+        "mindist"
+    };
+    const char * const stdIn = "0 1";
+    runTest(CommandLine(cmdline), stdIn);
+}
+
+// Mindist between group (0, 1) and bead 2 should = 0.5
+TEST_F(MindistTest, mindistWorksWithMultipleAtoms)
+{
+    setOutputFile("-od", "mindist.xvg", XvgMatch());
+    const char *const  cmdline[] = {
+        "mindist"
+    };
+    const char * const stdIn = "2 3";
+    runTest(CommandLine(cmdline), stdIn);
+}
+
+/* Should have 0 contacts with default cutoff */
+TEST_F(MindistTest, mindistDoesNotPickUpContacts)
+{
+    setOutputFile("-on", "ncontacts.xvg", XvgMatch());
+    const char * const cmdline[] = {
+        "mindist"
+    };
+    const char * const stdIn = "0 1";
+    runTest(CommandLine(cmdline), stdIn);
+}
+
+/* Should pick up one contact with 2.5 nm cutoff */
+TEST_F(MindistTest, mindistPicksUpContacts)
+{
+    setOutputFile("-on", "ncontacts.xvg", XvgMatch());
+    const char *const  cmdline[] = {
+        "mindist", "-d", "2.5",
+    };
+    const char * const stdIn = "0 1";
+    runTest(CommandLine(cmdline), stdIn);
+}
+
+TEST_F(MindistTest, ngWorks)
+{
+    setOutputFile("-od", "mindist.xvg", XvgMatch());
+    const char *const  cmdline[] = {
+        "mindist", "-ng", "2",
+    };
+    const char * const stdIn = "0 1 2";
+    runTest(CommandLine(cmdline), stdIn);
+}
+
+// 2 contacts within this cutoff, but only one should be reported
+TEST_F(MindistTest, groupWorks)
+{
+    setOutputFile("-on", "ncontacts.xvg", XvgMatch());
+    const char *const  cmdline[] = {
+        "mindist", "-group", "-d", "3"
+    };
+    const char * const stdIn = "3, 2";
+    runTest(CommandLine(cmdline), stdIn);
+}
+
+// Maximum distance between group (1, 2) and atom 3
+TEST_F(MindistTest, maxDistWorks)
+{
+    setOutputFile("-od", "mindist.xvg", XvgMatch());
+    const char *const  cmdline[] = {
+        "mindist", "-max"
+    };
+    const char * const stdIn = "2 3";
+    runTest(CommandLine(cmdline), stdIn);
+}
+
+/* Particles 1 and 2 are 2 nm away through pbc, but
+   should be 3 nm away with no pbc */
+TEST_F(MindistTest, noPbcWorks)
+{
+    setOutputFile("-od", "mindist.xvg", XvgMatch());
+    const char *const  cmdline[] = {
+        "mindist", "-nopbc"
+    };
+    const char * const stdIn = "0 1";
+    runTest(CommandLine(cmdline), stdIn);
+}
+
+// Group (1, 2), each res compared to particle 3
+TEST_F(MindistTest, resPerTimeWorks)
+{
+    setOutputFile("-or", "respertime.xvg", XvgMatch());
+    const char *const  cmdline[] = {
+        "mindist", "-respertime"
+    };
+    const char * const stdIn = "3 2";
+    runTest(CommandLine(cmdline), stdIn);
+}
+
+TEST_F(MindistTest, matrixWorks)
+{
+    setOutputFile("-od", "mindist.xvg", XvgMatch());
+    const char *const  cmdline[] = {
+        "mindist", "-matrix"
+    };
+    const char * const stdIn = "5";
+    runTest(CommandLine(cmdline), stdIn);
+}
+
+// TODO test periodic image - needs a tpr?
+
+} //namespace
diff --git a/src/gromacs/gmxana/tests/refdata/MindistTest_groupWorks.xml b/src/gromacs/gmxana/tests/refdata/MindistTest_groupWorks.xml
new file mode 100644 (file)
index 0000000..9082586
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-on">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Number of Contacts < 3 nm"
+xaxis  label "Time (ps)"
+yaxis  label "Number"
+TYPE xy
+s0 legend "atoms12-atom3"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>0.000000e+00</Real>
+          <Real>1</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/gmxana/tests/refdata/MindistTest_matrixWorks.xml b/src/gromacs/gmxana/tests/refdata/MindistTest_matrixWorks.xml
new file mode 100644 (file)
index 0000000..26f206f
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-od">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Minimum Distance"
+xaxis  label "Time (ps)"
+yaxis  label "Distance (nm)"
+TYPE xy
+s0 legend "atoms123-atoms123"
+s1 legend "atoms123-atoms123"
+s2 legend "atoms123-atoms123"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">4</Int>
+          <Real>0.000000e+00</Real>
+          <Real>2.000000e+00</Real>
+          <Real>1.500000e+00</Real>
+          <Real>5.000000e-01</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/gmxana/tests/refdata/MindistTest_maxDistWorks.xml b/src/gromacs/gmxana/tests/refdata/MindistTest_maxDistWorks.xml
new file mode 100644 (file)
index 0000000..b697a2b
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-od">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Maximum Distance"
+xaxis  label "Time (ps)"
+yaxis  label "Distance (nm)"
+TYPE xy
+s0 legend "atom3-atoms12"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>0.000000e+00</Real>
+          <Real>1.500000e+00</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/gmxana/tests/refdata/MindistTest_mindistDoesNotPickUpContacts.xml b/src/gromacs/gmxana/tests/refdata/MindistTest_mindistDoesNotPickUpContacts.xml
new file mode 100644 (file)
index 0000000..4a3dd3b
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-on">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Number of Contacts < 0.6 nm"
+xaxis  label "Time (ps)"
+yaxis  label "Number"
+TYPE xy
+s0 legend "atom1-atom2"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>0.000000e+00</Real>
+          <Real>0</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/gmxana/tests/refdata/MindistTest_mindistPicksUpContacts.xml b/src/gromacs/gmxana/tests/refdata/MindistTest_mindistPicksUpContacts.xml
new file mode 100644 (file)
index 0000000..3716b7c
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-on">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Number of Contacts < 2.5 nm"
+xaxis  label "Time (ps)"
+yaxis  label "Number"
+TYPE xy
+s0 legend "atom1-atom2"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>0.000000e+00</Real>
+          <Real>1</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/gmxana/tests/refdata/MindistTest_mindistWorksWithMultipleAtoms.xml b/src/gromacs/gmxana/tests/refdata/MindistTest_mindistWorksWithMultipleAtoms.xml
new file mode 100644 (file)
index 0000000..7b1c5cf
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-od">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Minimum Distance"
+xaxis  label "Time (ps)"
+yaxis  label "Distance (nm)"
+TYPE xy
+s0 legend "atom3-atoms12"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>0.000000e+00</Real>
+          <Real>5.000000e-01</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/gmxana/tests/refdata/MindistTest_mindistWorksWithSingleAtoms.xml b/src/gromacs/gmxana/tests/refdata/MindistTest_mindistWorksWithSingleAtoms.xml
new file mode 100644 (file)
index 0000000..4e9a41d
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-od">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Minimum Distance"
+xaxis  label "Time (ps)"
+yaxis  label "Distance (nm)"
+TYPE xy
+s0 legend "atom1-atom2"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>0.000000e+00</Real>
+          <Real>2.000000e+00</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/gmxana/tests/refdata/MindistTest_ngWorks.xml b/src/gromacs/gmxana/tests/refdata/MindistTest_ngWorks.xml
new file mode 100644 (file)
index 0000000..29b3c08
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-od">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Minimum Distance"
+xaxis  label "Time (ps)"
+yaxis  label "Distance (nm)"
+TYPE xy
+s0 legend "atom1-atom2"
+s1 legend "atom1-atom3"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">3</Int>
+          <Real>0.000000e+00</Real>
+          <Real>2.000000e+00</Real>
+          <Real>1.500000e+00</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/gmxana/tests/refdata/MindistTest_noPbcWorks.xml b/src/gromacs/gmxana/tests/refdata/MindistTest_noPbcWorks.xml
new file mode 100644 (file)
index 0000000..f9cbb06
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-od">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Minimum Distance"
+xaxis  label "Time (ps)"
+yaxis  label "Distance (nm)"
+TYPE xy
+s0 legend "atom1-atom2"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>0.000000e+00</Real>
+          <Real>3.000000e+00</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/gmxana/tests/refdata/MindistTest_resPerTimeWorks.xml b/src/gromacs/gmxana/tests/refdata/MindistTest_resPerTimeWorks.xml
new file mode 100644 (file)
index 0000000..eeeab60
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-or">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Minimum Distance"
+xaxis  label "Time (ps)"
+yaxis  label "Distance (nm)"
+TYPE xy
+s0 legend "atoms12-atom3"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">3</Int>
+          <Real>0.000000e+00</Real>
+          <Real>1.5</Real>
+          <Real>0.5</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/testutils/simulationdatabase/mindist.ndx b/src/testutils/simulationdatabase/mindist.ndx
new file mode 100644 (file)
index 0000000..3b54e32
--- /dev/null
@@ -0,0 +1,12 @@
+[ atom1 ]
+1
+[ atom2 ]
+2
+[ atom3 ]
+3
+[ atoms12 ]
+1 2
+[ atoms23 ]
+2 3
+[ atoms123 ]
+1 2 3
diff --git a/src/testutils/simulationdatabase/mindist_coords.gro b/src/testutils/simulationdatabase/mindist_coords.gro
new file mode 100644 (file)
index 0000000..5205564
--- /dev/null
@@ -0,0 +1,6 @@
+mindist_beads
+    3
+    1A        A    1   1.000   3.000   3.000
+    2A        A    2   4.000   3.000   3.000
+    2B        B    3   4.500   3.000   3.000
+   5.00000   5.00000   5.00000
\ No newline at end of file