Add tests for Ewald surface terms
authorBerk Hess <hess@kth.se>
Wed, 11 Mar 2020 16:25:59 +0000 (17:25 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Fri, 13 Mar 2020 07:35:37 +0000 (08:35 +0100)
Note that the surface-epsilon test with flexible bonds is currently
disabled as this functionality assumes whole molecules which is
currently not possible.

Change-Id: Icfe4d41abf12c5832c0d7757eb9dbe5631338f46

src/programs/mdrun/tests/CMakeLists.txt
src/programs/mdrun/tests/ewaldsurfaceterm.cpp [new file with mode: 0644]
src/programs/mdrun/tests/refdata/EwaldSurfaceTerm_EwaldSurfaceTermTest_WithinTolerances_0.xml [new file with mode: 0644]
src/programs/mdrun/tests/refdata/EwaldSurfaceTerm_EwaldSurfaceTermTest_WithinTolerances_1.xml [new file with mode: 0644]
src/testutils/simulationdatabase/dipoles.gro [new file with mode: 0644]
src/testutils/simulationdatabase/dipoles.ndx [new file with mode: 0644]
src/testutils/simulationdatabase/dipoles.top [new file with mode: 0644]

index 12d6b2aeafa510dc7a068500110fc3d885fbfa78..68febf770805c237e6da851ad77bb9d745962256 100644 (file)
@@ -55,6 +55,7 @@ gmx_add_gtest_executable(${exename}
         compressed_x_output.cpp
         densityfittingmodule.cpp
         exactcontinuation.cpp
+        ewaldsurfaceterm.cpp
         grompp.cpp
         helpwriting.cpp
         initialconstraints.cpp
diff --git a/src/programs/mdrun/tests/ewaldsurfaceterm.cpp b/src/programs/mdrun/tests/ewaldsurfaceterm.cpp
new file mode 100644 (file)
index 0000000..0f77356
--- /dev/null
@@ -0,0 +1,190 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2020, 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
+ * Test for Ewald 3DC and epsilon-surface terms.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_mdrun_integration_tests
+ */
+#include "gmxpre.h"
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/topology/idef.h"
+#include "gromacs/topology/ifunc.h"
+#include "gromacs/trajectory/trajectoryframe.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/filestream.h"
+#include "gromacs/utility/strconvert.h"
+#include "gromacs/utility/stringutil.h"
+
+#include "testutils/mpitest.h"
+#include "testutils/refdata.h"
+#include "testutils/simulationdatabase.h"
+#include "testutils/testasserts.h"
+
+#include "energycomparison.h"
+#include "moduletest.h"
+#include "trajectoryreader.h"
+
+namespace gmx
+{
+namespace test
+{
+namespace
+{
+
+//! Helper type
+using MdpField = MdpFieldValues::value_type;
+
+/*! \brief Test fixture base for simple mdrun systems
+ *
+ * This test ensures mdrun can run a simulation, reaching reproducible
+ * energies and forces.
+ * The starting coordinates are set up such that both molecules are
+ * broken over PBC and the PBC treatment is tested.
+ */
+class EwaldSurfaceTermTest : public MdrunTestFixture, public ::testing::WithParamInterface<std::string>
+{
+};
+
+TEST_P(EwaldSurfaceTermTest, WithinTolerances)
+{
+    auto simulationName = GetParam();
+    SCOPED_TRACE(formatString("Comparing simple mdrun for '%s'", simulationName.c_str()));
+
+    int numRanksAvailable = getNumberOfTestMpiRanks();
+    /* For epsilon-surface we need whole molecules.
+     * Without constraints we can make molecules whole on a sinlge rank.
+     * With constraints molecules are whole with update groups with DD.
+     *
+     * TODO: Remove the rank=1 check when DD also runs single rank.
+     */
+    if ((simulationName == "epsilon-surface" && numRanksAvailable > 1)
+        || (simulationName == "epsilon-surface-constraint" && numRanksAvailable == 1))
+    {
+        fprintf(stdout,
+                "Test system '%s' cannot run with %d ranks.\n"
+                "The supported numbers are %s 1.\n",
+                simulationName.c_str(), numRanksAvailable, numRanksAvailable == 1 ? ">" : "=");
+        return;
+    }
+
+    std::string theMdpFile =
+            "coulombtype     = PME\n"
+            "nstcalcenergy   = 1\n"
+            "nstenergy       = 4\n"
+            "nstfout         = 4\n"
+            "rcoulomb        = 1.5\n"
+            "rvdw            = 1.5\n"
+            "pme-order       = 4\n"
+            "fourier-spacing = 0.2\n"
+            "dt              = 0.0025\n"
+            "nsteps          = 20\n";
+
+    if (simulationName == "3DC")
+    {
+        theMdpFile +=
+                "ewald-geometry = 3DC\n"
+                "pbc             = xy\n"
+                "nwall           = 2\n"
+                "wall-type       = 12-6\n"
+                "wall-atomtype   = C C\n"
+                "wall-ewald-zfac = 2\n";
+    }
+    else
+    {
+        theMdpFile += "epsilon-surface = 1\n";
+        if (simulationName == "epsilon-surface-constraint")
+        {
+            theMdpFile += "constraints = all-bonds";
+        }
+    }
+
+    // Prepare the .tpr file
+    {
+        CommandLine caller;
+        runner_.useTopGroAndNdxFromDatabase("dipoles");
+        runner_.useStringAsMdpFile(theMdpFile);
+        EXPECT_EQ(0, runner_.callGrompp(caller));
+    }
+    // Do mdrun
+    {
+        CommandLine mdrunCaller;
+        ASSERT_EQ(0, runner_.callMdrun(mdrunCaller));
+        EnergyTermsToCompare energyTermsToCompare{
+            { { interaction_function[F_EPOT].longname, relativeToleranceAsFloatingPoint(1, 1e-4) },
+              { interaction_function[F_ETOT].longname, relativeToleranceAsFloatingPoint(1, 1e-4) } }
+        };
+        TestReferenceData refData;
+        auto checker = refData.rootChecker().checkCompound("Simulation", simulationName);
+        checkEnergiesAgainstReferenceData(runner_.edrFileName_, energyTermsToCompare, &checker);
+        // Now check the forces
+        TrajectoryFrameReader reader(runner_.fullPrecisionTrajectoryFileName_);
+        checker.setDefaultTolerance(relativeToleranceAsFloatingPoint(1, 1e-3));
+        do
+        {
+            auto frame = reader.frame();
+            auto force = frame.f();
+            int  atom  = 0;
+            for (auto& f : force)
+            {
+                std::string forceName = frame.frameName() + " F[" + toString(atom) + "]";
+
+                checker.checkVector(f, forceName.c_str());
+                atom++;
+            }
+        } while (reader.readNextFrame());
+    }
+}
+
+//! Containers of systems to test.
+//! \{
+// Enable when the epsilon-surface bug is fixed
+//    std::vector<std::string> surfaceTerm = { "3DC", "epsilon-surface-constraint", "epsilon-surface" };
+std::vector<std::string> surfaceTerm = { "3DC", "epsilon-surface-constraint" };
+//! \}
+
+INSTANTIATE_TEST_CASE_P(EwaldSurfaceTerm, EwaldSurfaceTermTest, ::testing::ValuesIn(surfaceTerm));
+
+} // namespace
+} // namespace test
+} // namespace gmx
diff --git a/src/programs/mdrun/tests/refdata/EwaldSurfaceTerm_EwaldSurfaceTermTest_WithinTolerances_0.xml b/src/programs/mdrun/tests/refdata/EwaldSurfaceTerm_EwaldSurfaceTermTest_WithinTolerances_0.xml
new file mode 100644 (file)
index 0000000..047a65e
--- /dev/null
@@ -0,0 +1,142 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Simulation Name="3DC">
+    <Energy Name="Total Energy">
+      <Real Name="Time 0.000000 Step 0 in frame 0">35.954109</Real>
+      <Real Name="Time 0.010000 Step 4 in frame 1">35.93243</Real>
+      <Real Name="Time 0.020000 Step 8 in frame 2">35.888763</Real>
+      <Real Name="Time 0.030000 Step 12 in frame 3">35.851433</Real>
+      <Real Name="Time 0.040000 Step 16 in frame 4">35.843254</Real>
+      <Real Name="Time 0.050000 Step 20 in frame 5">35.868946</Real>
+    </Energy>
+    <Energy Name="Potential">
+      <Real Name="Time 0.000000 Step 0 in frame 0">35.838486</Real>
+      <Real Name="Time 0.010000 Step 4 in frame 1">31.51033</Real>
+      <Real Name="Time 0.020000 Step 8 in frame 2">22.831844</Real>
+      <Real Name="Time 0.030000 Step 12 in frame 3">15.060135</Real>
+      <Real Name="Time 0.040000 Step 16 in frame 4">12.742168</Real>
+      <Real Name="Time 0.050000 Step 20 in frame 5">16.857098</Real>
+    </Energy>
+    <Vector Name="Time 0.000000 Step 0 F[0]">
+      <Real Name="X">0.63591957</Real>
+      <Real Name="Y">519.72107</Real>
+      <Real Name="Z">387.92822</Real>
+    </Vector>
+    <Vector Name="Time 0.000000 Step 0 F[1]">
+      <Real Name="X">-0.77027768</Real>
+      <Real Name="Y">-519.39612</Real>
+      <Real Name="Z">-377.65155</Real>
+    </Vector>
+    <Vector Name="Time 0.000000 Step 0 F[2]">
+      <Real Name="X">18.781555</Real>
+      <Real Name="Y">-2.0529842</Real>
+      <Real Name="Z">14.781036</Real>
+    </Vector>
+    <Vector Name="Time 0.000000 Step 0 F[3]">
+      <Real Name="X">-18.647247</Real>
+      <Real Name="Y">1.7278194</Real>
+      <Real Name="Z">-234.13368</Real>
+    </Vector>
+    <Vector Name="Time 0.010000 Step 4 F[0]">
+      <Real Name="X">0.62046039</Real>
+      <Real Name="Y">466.01166</Real>
+      <Real Name="Z">349.07852</Real>
+    </Vector>
+    <Vector Name="Time 0.010000 Step 4 F[1]">
+      <Real Name="X">-0.75117296</Real>
+      <Real Name="Y">-465.69577</Real>
+      <Real Name="Z">-339.0498</Real>
+    </Vector>
+    <Vector Name="Time 0.010000 Step 4 F[2]">
+      <Real Name="X">11.485992</Real>
+      <Real Name="Y">-2.0129957</Real>
+      <Real Name="Z">7.3729095</Real>
+    </Vector>
+    <Vector Name="Time 0.010000 Step 4 F[3]">
+      <Real Name="X">-11.355316</Real>
+      <Real Name="Y">1.6968718</Real>
+      <Real Name="Z">-222.63599</Real>
+    </Vector>
+    <Vector Name="Time 0.020000 Step 8 F[0]">
+      <Real Name="X">0.59271532</Real>
+      <Real Name="Y">334.89679</Real>
+      <Real Name="Z">254.41725</Real>
+    </Vector>
+    <Vector Name="Time 0.020000 Step 8 F[1]">
+      <Real Name="X">-0.71474606</Real>
+      <Real Name="Y">-334.60272</Real>
+      <Real Name="Z">-244.95985</Real>
+    </Vector>
+    <Vector Name="Time 0.020000 Step 8 F[2]">
+      <Real Name="X">-6.2411346</Real>
+      <Real Name="Y">-1.9218638</Real>
+      <Real Name="Z">-10.294846</Real>
+    </Vector>
+    <Vector Name="Time 0.020000 Step 8 F[3]">
+      <Real Name="X">6.3630676</Real>
+      <Real Name="Y">1.6275122</Real>
+      <Real Name="Z">-195.02248</Real>
+    </Vector>
+    <Vector Name="Time 0.030000 Step 12 F[0]">
+      <Real Name="X">0.58192861</Real>
+      <Real Name="Y">147.74336</Real>
+      <Real Name="Z">119.82979</Real>
+    </Vector>
+    <Vector Name="Time 0.030000 Step 12 F[1]">
+      <Real Name="X">-0.69187623</Real>
+      <Real Name="Y">-147.47998</Real>
+      <Real Name="Z">-111.1104</Real>
+    </Vector>
+    <Vector Name="Time 0.030000 Step 12 F[2]">
+      <Real Name="X">-31.277664</Real>
+      <Real Name="Y">-1.8096745</Real>
+      <Real Name="Z">-34.310486</Real>
+    </Vector>
+    <Vector Name="Time 0.030000 Step 12 F[3]">
+      <Real Name="X">31.387344</Real>
+      <Real Name="Y">1.5458357</Real>
+      <Real Name="Z">-156.77382</Real>
+    </Vector>
+    <Vector Name="Time 0.040000 Step 16 F[0]">
+      <Real Name="X">0.62886125</Real>
+      <Real Name="Y">-64.947739</Real>
+      <Real Name="Z">-32.052841</Real>
+    </Vector>
+    <Vector Name="Time 0.040000 Step 16 F[1]">
+      <Real Name="X">-0.72547024</Real>
+      <Real Name="Y">65.176849</Real>
+      <Real Name="Z">40.033974</Real>
+    </Vector>
+    <Vector Name="Time 0.040000 Step 16 F[2]">
+      <Real Name="X">-59.076599</Real>
+      <Real Name="Y">-1.7106733</Real>
+      <Real Name="Z">-59.353546</Real>
+    </Vector>
+    <Vector Name="Time 0.040000 Step 16 F[3]">
+      <Real Name="X">59.172882</Real>
+      <Real Name="Y">1.4807854</Real>
+      <Real Name="Z">-115.10541</Real>
+    </Vector>
+    <Vector Name="Time 0.050000 Step 20 F[0]">
+      <Real Name="X">0.78214669</Real>
+      <Real Name="Y">-268.51788</Real>
+      <Real Name="Z">-175.65146</Real>
+    </Vector>
+    <Vector Name="Time 0.050000 Step 20 F[1]">
+      <Real Name="X">-0.86627579</Real>
+      <Real Name="Y">268.71423</Real>
+      <Real Name="Z">183.01443</Real>
+    </Vector>
+    <Vector Name="Time 0.050000 Step 20 F[2]">
+      <Real Name="X">-84.336151</Real>
+      <Real Name="Y">-1.6569676</Real>
+      <Real Name="Z">-79.859665</Real>
+    </Vector>
+    <Vector Name="Time 0.050000 Step 20 F[3]">
+      <Real Name="X">84.419815</Real>
+      <Real Name="Y">1.4594903</Real>
+      <Real Name="Z">-77.279404</Real>
+    </Vector>
+  </Simulation>
+</ReferenceData>
diff --git a/src/programs/mdrun/tests/refdata/EwaldSurfaceTerm_EwaldSurfaceTermTest_WithinTolerances_1.xml b/src/programs/mdrun/tests/refdata/EwaldSurfaceTerm_EwaldSurfaceTermTest_WithinTolerances_1.xml
new file mode 100644 (file)
index 0000000..91be5ea
--- /dev/null
@@ -0,0 +1,142 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Simulation Name="epsilon-surface-constraint">
+    <Energy Name="Total Energy">
+      <Real Name="Time 0.000000 Step 0 in frame 0">-0.34057474</Real>
+      <Real Name="Time 0.010000 Step 4 in frame 1">-0.34058204</Real>
+      <Real Name="Time 0.020000 Step 8 in frame 2">-0.34044197</Real>
+      <Real Name="Time 0.030000 Step 12 in frame 3">-0.34037</Real>
+      <Real Name="Time 0.040000 Step 16 in frame 4">-0.34102595</Real>
+      <Real Name="Time 0.050000 Step 20 in frame 5">-0.34038031</Real>
+    </Energy>
+    <Energy Name="Potential">
+      <Real Name="Time 0.000000 Step 0 in frame 0">-0.34057617</Real>
+      <Real Name="Time 0.010000 Step 4 in frame 1">-0.34064102</Real>
+      <Real Name="Time 0.020000 Step 8 in frame 2">-0.34065056</Real>
+      <Real Name="Time 0.030000 Step 12 in frame 3">-0.34082031</Real>
+      <Real Name="Time 0.040000 Step 16 in frame 4">-0.34181023</Real>
+      <Real Name="Time 0.050000 Step 20 in frame 5">-0.34159088</Real>
+    </Energy>
+    <Vector Name="Time 0.000000 Step 0 F[0]">
+      <Real Name="X">1.6149496</Real>
+      <Real Name="Y">-0.086868286</Real>
+      <Real Name="Z">-1.0419159</Real>
+    </Vector>
+    <Vector Name="Time 0.000000 Step 0 F[1]">
+      <Real Name="X">-1.8542147</Real>
+      <Real Name="Y">-0.25299072</Real>
+      <Real Name="Z">0.80174255</Real>
+    </Vector>
+    <Vector Name="Time 0.000000 Step 0 F[2]">
+      <Real Name="X">-0.064361572</Real>
+      <Real Name="Y">-0.8647213</Real>
+      <Real Name="Z">-1.2425385</Real>
+    </Vector>
+    <Vector Name="Time 0.000000 Step 0 F[3]">
+      <Real Name="X">0.30360413</Real>
+      <Real Name="Y">1.2046714</Real>
+      <Real Name="Z">1.4829559</Real>
+    </Vector>
+    <Vector Name="Time 0.010000 Step 4 F[0]">
+      <Real Name="X">1.6154348</Real>
+      <Real Name="Y">-0.087356567</Real>
+      <Real Name="Z">-1.0413895</Real>
+    </Vector>
+    <Vector Name="Time 0.010000 Step 4 F[1]">
+      <Real Name="X">-1.8548124</Real>
+      <Real Name="Y">-0.25245667</Real>
+      <Real Name="Z">0.80117035</Real>
+    </Vector>
+    <Vector Name="Time 0.010000 Step 4 F[2]">
+      <Real Name="X">-0.064651489</Real>
+      <Real Name="Y">-0.864492</Real>
+      <Real Name="Z">-1.2429199</Real>
+    </Vector>
+    <Vector Name="Time 0.010000 Step 4 F[3]">
+      <Real Name="X">0.30400085</Real>
+      <Real Name="Y">1.2044551</Real>
+      <Real Name="Z">1.4832764</Real>
+    </Vector>
+    <Vector Name="Time 0.020000 Step 8 F[0]">
+      <Real Name="X">1.6154604</Real>
+      <Real Name="Y">-0.087097168</Real>
+      <Real Name="Z">-1.0424576</Real>
+    </Vector>
+    <Vector Name="Time 0.020000 Step 8 F[1]">
+      <Real Name="X">-1.8550944</Real>
+      <Real Name="Y">-0.25256348</Real>
+      <Real Name="Z">0.80217743</Real>
+    </Vector>
+    <Vector Name="Time 0.020000 Step 8 F[2]">
+      <Real Name="X">-0.064407349</Real>
+      <Real Name="Y">-0.86516654</Real>
+      <Real Name="Z">-1.2433014</Real>
+    </Vector>
+    <Vector Name="Time 0.020000 Step 8 F[3]">
+      <Real Name="X">0.3039093</Real>
+      <Real Name="Y">1.2051598</Real>
+      <Real Name="Z">1.4837341</Real>
+    </Vector>
+    <Vector Name="Time 0.030000 Step 12 F[0]">
+      <Real Name="X">1.6158544</Real>
+      <Real Name="Y">-0.087295532</Real>
+      <Real Name="Z">-1.0429993</Real>
+    </Vector>
+    <Vector Name="Time 0.030000 Step 12 F[1]">
+      <Real Name="X">-1.8559394</Real>
+      <Real Name="Y">-0.25222778</Real>
+      <Real Name="Z">0.80271912</Real>
+    </Vector>
+    <Vector Name="Time 0.030000 Step 12 F[2]">
+      <Real Name="X">-0.065734863</Real>
+      <Real Name="Y">-0.86546493</Real>
+      <Real Name="Z">-1.2434998</Real>
+    </Vector>
+    <Vector Name="Time 0.030000 Step 12 F[3]">
+      <Real Name="X">0.30551147</Real>
+      <Real Name="Y">1.2055182</Real>
+      <Real Name="Z">1.4839935</Real>
+    </Vector>
+    <Vector Name="Time 0.040000 Step 16 F[0]">
+      <Real Name="X">1.6170367</Real>
+      <Real Name="Y">-0.08883667</Real>
+      <Real Name="Z">-1.0432281</Real>
+    </Vector>
+    <Vector Name="Time 0.040000 Step 16 F[1]">
+      <Real Name="X">-1.8577462</Real>
+      <Real Name="Y">-0.25038147</Real>
+      <Real Name="Z">0.80291748</Real>
+    </Vector>
+    <Vector Name="Time 0.040000 Step 16 F[2]">
+      <Real Name="X">-0.067520142</Real>
+      <Real Name="Y">-0.86665791</Real>
+      <Real Name="Z">-1.2446899</Real>
+    </Vector>
+    <Vector Name="Time 0.040000 Step 16 F[3]">
+      <Real Name="X">0.30763245</Real>
+      <Real Name="Y">1.2067299</Real>
+      <Real Name="Z">1.4853821</Real>
+    </Vector>
+    <Vector Name="Time 0.050000 Step 20 F[0]">
+      <Real Name="X">1.6183333</Real>
+      <Real Name="Y">-0.088378906</Real>
+      <Real Name="Z">-1.0447006</Real>
+    </Vector>
+    <Vector Name="Time 0.050000 Step 20 F[1]">
+      <Real Name="X">-1.859828</Real>
+      <Real Name="Y">-0.25050354</Real>
+      <Real Name="Z">0.80425262</Real>
+    </Vector>
+    <Vector Name="Time 0.050000 Step 20 F[2]">
+      <Real Name="X">-0.068191528</Real>
+      <Real Name="Y">-0.86807513</Real>
+      <Real Name="Z">-1.2454529</Real>
+    </Vector>
+    <Vector Name="Time 0.050000 Step 20 F[3]">
+      <Real Name="X">0.3087616</Real>
+      <Real Name="Y">1.2082047</Real>
+      <Real Name="Z">1.4863129</Real>
+    </Vector>
+  </Simulation>
+</ReferenceData>
diff --git a/src/testutils/simulationdatabase/dipoles.gro b/src/testutils/simulationdatabase/dipoles.gro
new file mode 100644 (file)
index 0000000..26234ef
--- /dev/null
@@ -0,0 +1,7 @@
+Two simple dipoles
+ 4
+    1DIP     C     1   1.000  -0.140   1.000  0.0000  0.0000  0.0000
+    1DIP     C     2   1.000   0.140   1.200  0.0000  0.0000  0.0000
+    2DIP     C     3   3.900   2.000   3.000  0.0000  0.0000  0.0000
+    2DIP     C     4   4.100   2.000   3.200  0.0000  0.0000  0.0000
+   4.00000   4.00000   4.00000
diff --git a/src/testutils/simulationdatabase/dipoles.ndx b/src/testutils/simulationdatabase/dipoles.ndx
new file mode 100644 (file)
index 0000000..779e460
--- /dev/null
@@ -0,0 +1,2 @@
+[ System ]
+   1    2    3    4
diff --git a/src/testutils/simulationdatabase/dipoles.top b/src/testutils/simulationdatabase/dipoles.top
new file mode 100644 (file)
index 0000000..aa81777
--- /dev/null
@@ -0,0 +1,28 @@
+; Simple dipoles
+
+[ defaults ]
+; nbfunc comb-rule
+  1      1
+
+[ atomtypes ]
+; name  at.num       mass    charge   ptype     sigma      epsilon
+  C     6            12.01   0.0      A         0.3        1.0
+
+[ molecule_type ]
+Dipole   1
+
+[ atoms ]
+;   nr   type  resnr residue  atom   cgnr     charge
+     1      C      1     DIP     C      1     -1
+     2      C      1     DIP     C      2     1
+
+[ bonds ]
+1  2  1  0.28 10000
+
+[ system ]
+; Name
+Dipoles
+
+[ molecules ]
+; Compound        #mols
+Dipole            2