Allow MdModules to access the topology during simulation setup.
authorHubert Santuz <hubert.santuz@gmail.com>
Fri, 29 Jan 2021 18:08:25 +0000 (18:08 +0000)
committerArtem Zhmurov <zhmurov@gmail.com>
Fri, 29 Jan 2021 18:08:25 +0000 (18:08 +0000)
src/gromacs/mdrun/runner.cpp
src/gromacs/utility/mdmodulenotification.h

index 8ce13dfff4d52f3934b0041b9545605b740c2053..46fd7ad5ff0c087657892aee3f6c06cf5639a045 100644 (file)
@@ -1580,6 +1580,7 @@ int Mdrunner::mdrunner()
     {
         mdModulesNotifier.notify(*cr);
         mdModulesNotifier.notify(&atomSets);
+        mdModulesNotifier.notify(mtop);
         mdModulesNotifier.notify(inputrec->pbcType);
         mdModulesNotifier.notify(SimulationTimeStep{ inputrec->delta_t });
         /* Initiate forcerecord */
index 8854152fe68347d92ae830fd434bec3f2561f09c..aa30111cfdc9df6184925d1dd5bad2b08f9901cc 100644 (file)
@@ -50,6 +50,7 @@
 #include "gromacs/utility/mdmodulenotification-impl.h"
 
 struct t_commrec;
+struct gmx_mtop_t;
 enum class PbcType : int;
 
 namespace gmx
@@ -198,6 +199,7 @@ struct MdModulesNotifier
      *                           wrote to .tpr files
      * LocalAtomSetManager* enables modules to add atom indices to local atom sets
      *                      to be managed
+     * const gmx_mtop_t& provides the topology of the system to the modules
      * MdModulesEnergyOutputToDensityFittingRequestChecker* enables modules to
      *                      report if they want to write their energy output
      *                      to the density fitting field in the energy files
@@ -213,6 +215,7 @@ struct MdModulesNotifier
      */
     registerMdModuleNotification<const KeyValueTreeObject&,
                                  LocalAtomSetManager*,
+                                 const gmx_mtop_t&,
                                  MdModulesEnergyOutputToDensityFittingRequestChecker*,
                                  SeparatePmeRanksPermitted*,
                                  const PbcType&,