Added QM input file name as command-line parameter for grompp
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / grompp.cpp
index d33220a6f68ae93ad370141f7051cc94afcf0c83..394143e8e68a1b5bfbe22972117da07782947e97 100644 (file)
@@ -1858,7 +1858,9 @@ int gmx_grompp(int argc, char* argv[])
                        { efEDR, "-e", nullptr, ffOPTRD },
                        /* This group is needed by the VMD viewer as the start configuration for IMD sessions: */
                        { efGRO, "-imd", "imdgroup", ffOPTWR },
-                       { efTRN, "-ref", "rotref", ffOPTRW | ffALLOW_MISSING } };
+                       { efTRN, "-ref", "rotref", ffOPTRW | ffALLOW_MISSING },
+                       /* This group is needed by the QMMM MDModule: */
+                       { efQMI, "-qmi", nullptr, ffOPTRD } };
 #define NFILE asize(fnm)
 
     /* Command line options */
@@ -1930,9 +1932,15 @@ int gmx_grompp(int argc, char* argv[])
     // to eventual notifications during pre-processing their data
     mdModules.subscribeToPreProcessingNotifications();
 
-    // And notify MdModules of existing logger
+    // Notify MDModules of existing logger
     mdModules.notifiers().preProcessingNotifier_.notify(logger);
 
+    // Notify QMMM MDModule of external QM input file command-line option
+    {
+        gmx::QMInputFileName qmInputFileName = { ftp2bSet(efQMI, NFILE, fnm), ftp2fn(efQMI, NFILE, fnm) };
+        mdModules.notifiers().preProcessingNotifier_.notify(qmInputFileName);
+    }
+
     if (bVerbose)
     {
         GMX_LOG(logger.info)