Adapt testcases for gapsys softcore
[alexxy/gromacs.git] / src / gromacs / listed_forces / tests / pairs.cpp
index 196af1d57c729f66c16b8c361cea450dfa3feb53..f35e98d17a742989dd1746f34eede23efe7b232c 100644 (file)
@@ -169,7 +169,7 @@ public:
         fepVals_.sc_sigma                = 0.3;
         fepVals_.sc_sigma_min            = 0.3;
         fepVals_.bScCoul                 = true;
-        fepVals_.scGapsysScaleLinpointLJ = 0.3;
+        fepVals_.scGapsysScaleLinpointLJ = 0.85;
         fepVals_.scGapsysScaleLinpointQ  = 0.3;
         fepVals_.scGapsysSigmaLJ         = 0.3;
         fepVals_.softcoreFunction        = SoftcoreType::Beutler;
@@ -318,7 +318,7 @@ protected:
         checker_.setDefaultTolerance(tolerance);
     }
 
-    void testOneIfunc(TestReferenceChecker* checker, const real lambda)
+    void testOneIfunc(TestReferenceChecker* checker, const real lambda, const SoftcoreType softcoreType)
     {
         SCOPED_TRACE(std::string("Testing PBC type: ") + c_pbcTypeNames[pbcType_]);
 
@@ -342,6 +342,7 @@ protected:
 
         t_forcerec* fr = frHelper.get();
         fr->efep = input_.fep ? FreeEnergyPerturbationType::Yes : FreeEnergyPerturbationType::No;
+        fr->ic->softCoreParameters->softcoreType = softcoreType;
         if (pbcType_ != PbcType::No)
         {
             fr->bMolPBC = true;
@@ -422,14 +423,18 @@ protected:
             const int numLambdas = 3;
             for (int i = 0; i < numLambdas; ++i)
             {
-                const real lambda        = i / (numLambdas - 1.0);
-                auto       lambdaChecker = thisChecker.checkCompound("Lambda", toString(lambda));
-                testOneIfunc(&lambdaChecker, lambda);
+                const real lambda = i / (numLambdas - 1.0);
+                for (SoftcoreType c : EnumerationWrapper<SoftcoreType>{})
+                {
+                    auto lambdaChecker = thisChecker.checkCompound("Lambda", toString(lambda));
+                    auto softcoreChecker = lambdaChecker.checkCompound("Sofcore", enumValueToString(c));
+                    testOneIfunc(&softcoreChecker, lambda, c);
+                }
             }
         }
         else
         {
-            testOneIfunc(&thisChecker, 0.0);
+            testOneIfunc(&thisChecker, 0.0, SoftcoreType::Beutler);
         }
     }
 };