Implemented nbnxn LJ switch functions
[alexxy/gromacs.git] / src / gromacs / mdlib / tables.c
index dc6dea54d81c7d006c844dbe88da5cb7d7930d10..7cfce0bc24d6c72942b62c0e3f18b23153c88932 100644 (file)
@@ -1160,6 +1160,33 @@ static void set_table_type(int tabsel[], const t_forcerec *fr, gmx_bool b14only)
                 gmx_fatal(FARGS, "Invalid vdwtype %d in %s line %d", vdwtype,
                           __FILE__, __LINE__);
         }
+
+        if (!b14only && fr->vdw_modifier != eintmodNONE)
+        {
+            if (fr->vdwtype != evdwCUT)
+            {
+                gmx_incons("Potential modifiers only implemented for LJ cut-off");
+            }
+
+            switch (fr->vdw_modifier)
+            {
+                case eintmodNONE:
+                case eintmodPOTSHIFT:
+                case eintmodEXACTCUTOFF:
+                    /* No modification */
+                    break;
+                case eintmodPOTSWITCH:
+                    tabsel[etiLJ6]  = etabLJ6Switch;
+                    tabsel[etiLJ12] = etabLJ12Switch;
+                    break;
+                case eintmodFORCESWITCH:
+                    tabsel[etiLJ6]  = etabLJ6Shift;
+                    tabsel[etiLJ12] = etabLJ12Shift;
+                    break;
+                default:
+                    gmx_incons("Unsupported vdw_modifier");
+            }
+        }
     }
 }