2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team.
6 * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
7 * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
8 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
9 * and including many others, as listed in the AUTHORS file in the
10 * top-level source directory and at http://www.gromacs.org.
12 * GROMACS is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public License
14 * as published by the Free Software Foundation; either version 2.1
15 * of the License, or (at your option) any later version.
17 * GROMACS is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with GROMACS; if not, see
24 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 * If you want to redistribute modifications to GROMACS, please
28 * consider that scientific software is very special. Version
29 * control is crucial - bugs must be traceable. We will be happy to
30 * consider code for inclusion in the official distribution, but
31 * derived work must not be called official GROMACS. Details are found
32 * in the README & COPYING files - if they are missing, get the
33 * official version at http://www.gromacs.org.
35 * To help us fund GROMACS development, we humbly ask that you cite
36 * the research papers on the package. Check out http://www.gromacs.org.
40 * Declares enumerated types used throughout the code.
42 * \author David van der Spoel <david.vanderspoel@icm.uu.se>
44 * \ingroup module_mdtypes
46 #ifndef GMX_MDTYPES_MD_ENUMS_H
47 #define GMX_MDTYPES_MD_ENUMS_H
49 #include "gromacs/utility/basedefinitions.h"
51 /*! \brief Return a string from a list of strings
53 * If index if within 0 .. max_index-1 returns the corresponding string
54 * or "no name defined" otherwise, in other words this is a range-check that does
56 * \param[in] index The index in the array
57 * \param[in] max_index The length of the array
58 * \param[in] names The array
59 * \return the correct string or "no name defined"
61 const char* enum_name(int index, int max_index, const char* const names[]);
63 /*! \brief Enum for setting answer to yes or no
65 enum class Boolean : int
73 //! Return name of boolean selection.
74 const char* enumValueToString(Boolean enumValue);
75 //! Return name of boolean selection for actual bool.
76 const char* booleanValueToString(bool value);
78 //! \brief The two compartments for CompEL setups.
86 /*! \brief The channels that define with their COM the compartment boundaries in CompEL setups.
88 * In principle one could also use modified setups with more than two channels.
97 /*! \brief Temperature coupling type
99 * yes is an alias for berendsen
101 * Note: Keep `Count` as the second-to-last entry, and `Default` as the last entry -
102 * this is needed to keep EnumerationWrapper, EnumerationArray and (de)serialization
105 enum class TemperatureCoupling : int
117 //! Return names of temperature coupling schemes
118 const char* enumValueToString(TemperatureCoupling enumValue);
119 //! Return whether this is andersen coupling
120 #define ETC_ANDERSEN(e) \
121 (((e) == TemperatureCoupling::AndersenMassive) || ((e) == TemperatureCoupling::Andersen))
123 /*! \brief Pressure coupling types
125 * isotropic is an alias for berendsen
127 * Note: Keep `Count` as the second-to-last entry, and `Default` as the last entry -
128 * this is needed to keep EnumerationWrapper, EnumerationArray and (de)serialization
131 enum class PressureCoupling : int
142 //! Return names of pressure coupling schemes
143 const char* enumValueToString(PressureCoupling enumValue);
145 //! Flat-bottom posres geometries
160 //! Relative coordinate scaling type for position restraints.
161 enum class RefCoordScaling : int
170 //! String corresponding to relative coordinate scaling.
171 const char* enumValueToString(RefCoordScaling enumValue);
173 //! Trotter decomposition extended variable parts.
190 //! Sequenced parts of the trotter decomposition.
201 //! Pressure coupling type
202 enum class PressureCouplingType : int
211 //! String corresponding to pressure coupling type
212 const char* enumValueToString(PressureCouplingType enumValue);
214 //! \\brief Cutoff scheme
215 enum class CutoffScheme : int
222 //! String corresponding to cutoff scheme
223 const char* enumValueToString(CutoffScheme enumValue);
225 /*! \brief Coulomb / VdW interaction modifiers.
227 * grompp replaces eintmodPOTSHIFT_VERLET_UNSUPPORTED by eintmodPOTSHIFT.
228 * Exactcutoff is only used by Reaction-field-zero, and is not user-selectable.
230 enum class InteractionModifiers : int
232 PotShiftVerletUnsupported,
239 Default = PotShiftVerletUnsupported
241 //! String corresponding to interaction modifiers
242 const char* enumValueToString(InteractionModifiers enumValue);
244 /*! \brief Cut-off treatment for Coulomb */
245 enum class CoulombInteractionType : int
267 //! String corresponding to Coulomb treatment
268 const char* enumValueToString(CoulombInteractionType enumValue);
271 enum class EwaldGeometry : int
278 //! String corresponding to Ewald geometry
279 const char* enumValueToString(EwaldGeometry enumValue);
281 //! Macro telling us whether we use reaction field
283 ((e) == CoulombInteractionType::RF || (e) == CoulombInteractionType::GRFNotused \
284 || (e) == CoulombInteractionType::RFNecUnsupported || (e) == CoulombInteractionType::RFZero)
286 //! Macro telling us whether we use PME
288 ((e) == CoulombInteractionType::Pme || (e) == CoulombInteractionType::PmeSwitch \
289 || (e) == CoulombInteractionType::PmeUser || (e) == CoulombInteractionType::PmeUserSwitch \
290 || (e) == CoulombInteractionType::P3mAD)
291 //! Macro telling us whether we use PME or full Ewald
292 #define EEL_PME_EWALD(e) (EEL_PME(e) || (e) == CoulombInteractionType::Ewald)
293 //! Macro telling us whether we use full electrostatics of any sort
294 #define EEL_FULL(e) (EEL_PME_EWALD(e) || (e) == CoulombInteractionType::Poisson)
295 //! Macro telling us whether we use user defined electrostatics
296 #define EEL_USER(e) \
297 ((e) == CoulombInteractionType::User || (e) == CoulombInteractionType::PmeUser \
298 || (e) == (CoulombInteractionType::PmeUserSwitch))
300 //! Van der Waals interaction treatment
301 enum class VanDerWaalsType : int
312 //! String corresponding to Van der Waals treatment
313 const char* enumValueToString(VanDerWaalsType enumValue);
315 //! Type of long-range VdW treatment of combination rules
316 enum class LongRangeVdW : int
323 //! String for LJPME combination rule treatment
324 const char* enumValueToString(LongRangeVdW enumValue);
326 //! Macro to tell us whether we use LJPME
327 #define EVDW_PME(e) ((e) == VanDerWaalsType::Pme)
329 /*! \brief Integrator algorithm
331 * eiSD2 has been removed, but we keep a renamed enum entry,
332 * so we can refuse to do MD with such .tpr files.
333 * eiVV is normal velocity verlet
334 * eiVVAK uses 1/2*(KE(t-dt/2)+KE(t+dt/2)) as the kinetic energy,
335 * and the half step kinetic energy for temperature control
337 enum class IntegrationAlgorithm : int
355 //! Name of the integrator algorithm
356 const char* enumValueToString(IntegrationAlgorithm enumValue);
357 //! Do we use MiMiC QM/MM?
358 #define EI_MIMIC(e) ((e) == IntegrationAlgorithm::Mimic)
359 //! Do we use velocity Verlet
360 #define EI_VV(e) ((e) == IntegrationAlgorithm::VV || (e) == IntegrationAlgorithm::VVAK)
361 //! Do we use molecular dynamics
362 #define EI_MD(e) ((e) == IntegrationAlgorithm::MD || EI_VV(e) || EI_MIMIC(e))
363 //! Do we use stochastic dynamics
364 #define EI_SD(e) ((e) == IntegrationAlgorithm::SD1)
365 //! Do we use any stochastic integrator
366 #define EI_RANDOM(e) (EI_SD(e) || (e) == IntegrationAlgorithm::BD)
367 /*above integrators may not conserve momenta*/
368 //! Do we use any type of dynamics
369 #define EI_DYNAMICS(e) (EI_MD(e) || EI_RANDOM(e))
370 //! Or do we use minimization
371 #define EI_ENERGY_MINIMIZATION(e) \
372 ((e) == IntegrationAlgorithm::Steep || (e) == IntegrationAlgorithm::CG \
373 || (e) == IntegrationAlgorithm::LBFGS)
374 //! Do we apply test particle insertion
375 #define EI_TPI(e) ((e) == IntegrationAlgorithm::TPI || (e) == IntegrationAlgorithm::TPIC)
376 //! Do we deal with particle velocities
377 #define EI_STATE_VELOCITY(e) (EI_MD(e) || EI_SD(e))
379 //! Constraint algorithm
380 enum class ConstraintAlgorithm : int
387 //! String corresponding to constraint algorithm
388 const char* enumValueToString(ConstraintAlgorithm enumValue);
390 //! Distance restraint refinement algorithm
391 enum class DistanceRestraintRefinement : int
399 //! String corresponding to distance restraint algorithm
400 const char* enumValueToString(DistanceRestraintRefinement enumValue);
402 //! Distance restraints weighting type
403 enum class DistanceRestraintWeighting : int
408 Default = Conservative
410 //! String corresponding to distance restraint weighting
411 const char* enumValueToString(DistanceRestraintWeighting enumValue);
413 //! Combination rule algorithm.
414 enum class CombinationRule : int
423 //! String for combination rule algorithm
424 const char* enumValueToString(CombinationRule enumValue);
426 //! Van der Waals potential.
427 enum class VanDerWaalsPotential : int
435 //! String corresponding to Van der Waals potential
436 const char* enumValueToString(VanDerWaalsPotential enumValue);
438 //! Simulated tempering methods.
439 enum class SimulatedTempering : int
447 //! String corresponding to simulated tempering
448 const char* enumValueToString(SimulatedTempering enumValue);
450 /*! \brief Free energy perturbation type
452 enum class FreeEnergyPerturbationType : int
454 //! there are no evaluations at other states
456 //! treated equivalently to Static
458 //! then lambdas do not change during the simulation
460 //! then the states change monotonically throughout the simulation
462 //! then expanded ensemble simulations are occuring
467 //! String corresponding to FEP type.
468 const char* enumValueToString(FreeEnergyPerturbationType enumValue);
470 //! Free energy pertubation coupling types.
471 enum class FreeEnergyPerturbationCouplingType : int
483 //! String for FEP coupling type
484 const char* enumValueToString(FreeEnergyPerturbationCouplingType enumValue);
485 //! String for FEP coupling type, singular mention.
486 const char* enumValueToStringSingular(FreeEnergyPerturbationCouplingType enumValue);
488 /*! \brief What to print for free energy calculations
490 * Printing the energy to the free energy dhdl file.
491 * Yes is an alias to Total, and
492 * will be converted in readir, so we never have to account for it in code.
494 enum class FreeEnergyPrintEnergy : int
503 //! String corresponding to printing of free energy
504 const char* enumValueToString(FreeEnergyPrintEnergy enumValue);
506 /*! \brief How the lambda weights are calculated
508 enum class LambdaWeightCalculation : int
512 //! using the metropolis criteria
514 //! using the Barker critera for transition weights, also called unoptimized Bennett
516 //! using Barker + minimum variance for weights
518 //! Wang-Landu (using visitation counts)
520 //! Weighted Wang-Landau (using optimized Gibbs weighted visitation counts)
525 //! String corresponding to lambda weights
526 const char* enumValueToString(LambdaWeightCalculation enumValue);
527 //! Macro telling us whether we use expanded ensemble
528 #define ELAMSTATS_EXPANDED(e) ((e) > LambdaWeightCalculation::No)
529 //! Macro telling us whether we use some kind of Wang-Landau
530 #define EWL(e) ((e) == LambdaWeightCalculation::WL || (e) == LambdaWeightCalculation::WWL)
532 /*! \brief How moves in lambda are calculated
534 enum class LambdaMoveCalculation : int
536 //! don't calculate move
538 //! using the Metropolis criteria, and 50% up and down
540 //! using the Barker criteria, and 50% up and down
542 //! computing the transition using the marginalized probabilities of the lambdas
545 * using the metropolized version of Gibbs
547 * Monte Carlo Strategies in Scientific computing, Liu, p. 134
553 //! String corresponding to lambda moves
554 const char* enumValueToString(LambdaMoveCalculation enumValue);
556 /*! \brief How we decide whether weights have reached equilibrium
558 enum class LambdaWeightWillReachEquilibrium : int
560 //! never stop, weights keep going
562 //! fix the weights from the beginning; no movement
564 //! stop when the WL-delta falls below a certain level
566 //! stop when we have a certain number of samples at every step
568 //! stop when we've run a certain total number of steps
570 //! stop when we've run a certain total number of samples
572 //! stop when the ratio of samples (lowest to highest) is sufficiently large
577 //! String corresponding to equilibrium algorithm
578 const char* enumValueToString(LambdaWeightWillReachEquilibrium enumValue);
580 /*! \brief separate_dhdl_file selection
582 * NOTE: YES is the first one. Do NOT interpret this one as a gmx_bool
583 * Why was this done this way, just .........
585 enum class SeparateDhdlFile : int
592 //! String corresponding to separate DHDL file selection
593 const char* enumValueToString(SeparateDhdlFile enumValue);
595 /*! \brief dhdl_derivatives selection \
597 * NOTE: YES is the first one. Do NOT interpret this one as a gmx_bool
598 * Why was this done this way, just .........
600 enum class DhDlDerivativeCalculation : int
607 //! String for DHDL derivatives
608 const char* enumValueToString(DhDlDerivativeCalculation enumValue);
610 /*! \brief Solvent model
612 * Distinguishes classical water types with 3 or 4 particles
614 enum class SolventModel : int
622 //! String corresponding to solvent type
623 const char* enumValueToString(SolventModel enumValue);
625 //! Dispersion correction.
626 enum class DispersionCorrectionType : int
636 //! String corresponding to dispersion corrections
637 const char* enumValueToString(DispersionCorrectionType enumValue);
639 //! Center of mass motion removal algorithm.
640 enum class ComRemovalAlgorithm : int
645 LinearAccelerationCorrection,
649 //! String corresponding to COM removal
650 const char* enumValueToString(ComRemovalAlgorithm enumValue);
652 //! Algorithm for simulated annealing.
653 enum class SimulatedAnnealing : int
661 //! String for simulated annealing
662 const char* enumValueToString(SimulatedAnnealing enumValue);
665 enum class WallType : int
674 //! String corresponding to wall type
675 const char* enumValueToString(WallType enumValue);
677 //! Pulling algorithm.
678 enum class PullingAlgorithm : int
689 //! String for pulling algorithm
690 const char* enumValueToString(PullingAlgorithm enumValue);
692 //! Control of pull groups
693 enum class PullGroupGeometry : int
706 //! String for pull groups
707 const char* enumValueToString(PullGroupGeometry enumValue);
709 //! Enforced rotation groups.
710 enum class EnforcedRotationGroupType : int
727 //! Rotation group names
728 const char* enumValueToString(EnforcedRotationGroupType enumValue);
729 //! String for rotation group origin names
730 const char* enumValueToLongString(EnforcedRotationGroupType enumValue);
732 //! Rotation group fitting type
733 enum class RotationGroupFitting : int
741 //! String corresponding to rotation group fitting
742 const char* enumValueToString(RotationGroupFitting enumValue);
744 /*! \brief Direction along which ion/water swaps happen
746 * Part of "Computational Electrophysiology" (CompEL) setups
748 enum class SwapType : int
757 //! Names for swapping
758 const char* enumValueToString(SwapType enumValue);
760 /*! \brief Swap group splitting type
762 * These are just the fixed groups we need for any setup. In t_swap's grp
763 * entry after that follows the variable number of swap groups.
765 enum class SwapGroupSplittingType : int
773 //! String for swap group splitting
774 const char* enumValueToString(SwapGroupSplittingType enumValue);
776 /*! \brief Types of electrostatics calculations
778 * Types of electrostatics calculations available inside nonbonded kernels.
779 * Note that these do NOT necessarily correspond to the user selections
780 * in the MDP file; many interactions for instance map to tabulated kernels.
782 enum class NbkernelElecType : int
792 //! String corresponding to electrostatics kernels
793 const char* enumValueToString(NbkernelElecType enumValue);
795 /*! \brief Types of vdw calculations available
797 * Types of vdw calculations available inside nonbonded kernels.
798 * Note that these do NOT necessarily correspond to the user selections
799 * in the MDP file; many interactions for instance map to tabulated kernels.
801 enum class NbkernelVdwType : int
811 //! String corresponding to VdW kernels
812 const char* enumValueToString(NbkernelVdwType enumValue);
814 #endif /* GMX_MDTYPES_MD_ENUMS_H */