Use the current mass instead of massA in density fitting code.
authorChristian Blau <cblau@gwdg.de>
Tue, 10 Sep 2019 09:35:10 +0000 (11:35 +0200)
committerChristian Blau <cblau@gwdg.de>
Tue, 10 Sep 2019 12:07:39 +0000 (14:07 +0200)
When using masses to determine the weights of the spread amplitudes,
massA instead of the correct massT was used. This commit fixes this
behavior.

refs #2282

Change-Id: I58deb14b4b45c122ab3c9caf3f6b76c89f9ae739

src/gromacs/applied_forces/densityfittingamplitudelookup.cpp
src/gromacs/applied_forces/tests/densityfittingamplitudelookup.cpp

index d8bfb95b0bbd1f0f3cfe30faabdc24aacca075ac..f05a1d6f353034a99ccf6181ae9dcdd0a8a60873 100644 (file)
@@ -159,7 +159,7 @@ const std::vector<real> &MassesAsAmplitudes::operator()(const t_mdatoms    &atom
     }
 
     std::transform(std::begin(localIndex), std::end(localIndex), std::begin(amplitude_),
-                   [&atoms](gmx::index index) { return atoms.massA[index]; });
+                   [&atoms](gmx::index index) { return atoms.massT[index]; });
     return amplitude_;
 }
 
index adf2e686dfef438e995fba1385faa2fe70c50d22..7fb4b6f9be9a89618cdb07851687b9dddcb6a83f 100644 (file)
@@ -58,7 +58,7 @@ class DensityFittingAmplitudeLookupTest : public ::testing::Test
         DensityFittingAmplitudeLookupTest()
         {
             atoms_.nr      = numberOfAtoms_;
-            atoms_.massA   = masses_.data();
+            atoms_.massT   = masses_.data();
             atoms_.chargeA = charges_.data();
         }
     protected: