Merge branch release-2021 into merge-2021-into-master
[alexxy/gromacs.git] / src / gromacs / applied_forces / electricfield.cpp
index 6d4a45a34b65a415412990056c25cdf3efa78ba8..ab3a5f0b8f16e7f4fc7c372e18c48ac20f8f45fc 100644 (file)
@@ -94,6 +94,12 @@ public:
         section.addOption(RealOption("omega").store(&omega_));
         section.addOption(RealOption("t0").store(&t0_));
         section.addOption(RealOption("sigma").store(&sigma_));
+        if (sigma_ <= 0 && t0_ != 0.0)
+        {
+            GMX_THROW(
+                    InvalidInputError("Non-pulsed field (sigma = 0) ignores the value of t0. "
+                                      "Please, set t0 to 0 to avoid this error."));
+        }
     }
     /*! \brief
      * Creates mdp parameters for this field component.