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 /*! \brief Return a string from a list of strings
51 * If index if within 0 .. max_index-1 returns the corresponding string
52 * or "no name defined" otherwise, in other words this is a range-check that does
54 * \param[in] index The index in the array
55 * \param[in] max_index The length of the array
56 * \param[in] names The array
57 * \return the correct string or "no name defined"
59 const char* enum_name(int index, int max_index, const char* const names[]);
61 /*! \brief Enum for setting answer to yes or no
63 enum class Boolean : int
71 //! Return name of boolean selection.
72 const char* enumValueToString(Boolean enumValue);
73 //! Return name of boolean selection for actual bool.
74 const char* booleanValueToString(bool value);
76 //! \brief The two compartments for CompEL setups.
77 enum class Compartment : int
84 /*! \brief The channels that define with their COM the compartment boundaries in CompEL setups.
86 * In principle one could also use modified setups with more than two channels.
88 enum class Channel : int
95 /*! \brief Temperature coupling type
97 * yes is an alias for berendsen
99 * Note: Keep `Count` as the second-to-last entry, and `Default` as the last entry -
100 * this is needed to keep EnumerationWrapper, EnumerationArray and (de)serialization
103 enum class TemperatureCoupling : int
115 //! Return names of temperature coupling schemes
116 const char* enumValueToString(TemperatureCoupling enumValue);
117 //! Return whether this is andersen coupling
118 #define ETC_ANDERSEN(e) \
119 (((e) == TemperatureCoupling::AndersenMassive) || ((e) == TemperatureCoupling::Andersen))
121 /*! \brief Pressure coupling types
123 * isotropic is an alias for berendsen
125 * Note: Keep `Count` as the second-to-last entry, and `Default` as the last entry -
126 * this is needed to keep EnumerationWrapper, EnumerationArray and (de)serialization
129 enum class PressureCoupling : int
140 //! Return names of pressure coupling schemes
141 const char* enumValueToString(PressureCoupling enumValue);
143 //! Flat-bottom posres geometries
158 //! Relative coordinate scaling type for position restraints.
159 enum class RefCoordScaling : int
168 //! String corresponding to relative coordinate scaling.
169 const char* enumValueToString(RefCoordScaling enumValue);
171 //! Trotter decomposition extended variable parts.
188 //! Sequenced parts of the trotter decomposition.
189 enum class TrotterSequence : int
199 //! Pressure coupling type
200 enum class PressureCouplingType : int
209 //! String corresponding to pressure coupling type
210 const char* enumValueToString(PressureCouplingType enumValue);
212 //! \\brief Cutoff scheme
213 enum class CutoffScheme : int
220 //! String corresponding to cutoff scheme
221 const char* enumValueToString(CutoffScheme enumValue);
223 /*! \brief Coulomb / VdW interaction modifiers.
225 * grompp replaces eintmodPOTSHIFT_VERLET_UNSUPPORTED by eintmodPOTSHIFT.
226 * Exactcutoff is only used by Reaction-field-zero, and is not user-selectable.
228 enum class InteractionModifiers : int
230 PotShiftVerletUnsupported,
237 Default = PotShiftVerletUnsupported
239 //! String corresponding to interaction modifiers
240 const char* enumValueToString(InteractionModifiers enumValue);
242 /*! \brief Cut-off treatment for Coulomb */
243 enum class CoulombInteractionType : int
265 //! String corresponding to Coulomb treatment
266 const char* enumValueToString(CoulombInteractionType enumValue);
269 enum class EwaldGeometry : int
276 //! String corresponding to Ewald geometry
277 const char* enumValueToString(EwaldGeometry enumValue);
279 //! Macro telling us whether we use reaction field
281 ((e) == CoulombInteractionType::RF || (e) == CoulombInteractionType::GRFNotused \
282 || (e) == CoulombInteractionType::RFNecUnsupported || (e) == CoulombInteractionType::RFZero)
284 //! Macro telling us whether we use PME
286 ((e) == CoulombInteractionType::Pme || (e) == CoulombInteractionType::PmeSwitch \
287 || (e) == CoulombInteractionType::PmeUser || (e) == CoulombInteractionType::PmeUserSwitch \
288 || (e) == CoulombInteractionType::P3mAD)
289 //! Macro telling us whether we use PME or full Ewald
290 #define EEL_PME_EWALD(e) (EEL_PME(e) || (e) == CoulombInteractionType::Ewald)
291 //! Macro telling us whether we use full electrostatics of any sort
292 #define EEL_FULL(e) (EEL_PME_EWALD(e) || (e) == CoulombInteractionType::Poisson)
293 //! Macro telling us whether we use user defined electrostatics
294 #define EEL_USER(e) \
295 ((e) == CoulombInteractionType::User || (e) == CoulombInteractionType::PmeUser \
296 || (e) == (CoulombInteractionType::PmeUserSwitch))
298 //! Van der Waals interaction treatment
299 enum class VanDerWaalsType : int
310 //! String corresponding to Van der Waals treatment
311 const char* enumValueToString(VanDerWaalsType enumValue);
313 //! Type of long-range VdW treatment of combination rules
314 enum class LongRangeVdW : int
321 //! String for LJPME combination rule treatment
322 const char* enumValueToString(LongRangeVdW enumValue);
324 //! Macro to tell us whether we use LJPME
325 #define EVDW_PME(e) ((e) == VanDerWaalsType::Pme)
327 /*! \brief Integrator algorithm
329 * eiSD2 has been removed, but we keep a renamed enum entry,
330 * so we can refuse to do MD with such .tpr files.
331 * eiVV is normal velocity verlet
332 * eiVVAK uses 1/2*(KE(t-dt/2)+KE(t+dt/2)) as the kinetic energy,
333 * and the half step kinetic energy for temperature control
335 enum class IntegrationAlgorithm : int
353 //! Name of the integrator algorithm
354 const char* enumValueToString(IntegrationAlgorithm enumValue);
355 //! Do we use MiMiC QM/MM?
356 #define EI_MIMIC(e) ((e) == IntegrationAlgorithm::Mimic)
357 //! Do we use velocity Verlet
358 #define EI_VV(e) ((e) == IntegrationAlgorithm::VV || (e) == IntegrationAlgorithm::VVAK)
359 //! Do we use molecular dynamics
360 #define EI_MD(e) ((e) == IntegrationAlgorithm::MD || EI_VV(e) || EI_MIMIC(e))
361 //! Do we use stochastic dynamics
362 #define EI_SD(e) ((e) == IntegrationAlgorithm::SD1)
363 //! Do we use any stochastic integrator
364 #define EI_RANDOM(e) (EI_SD(e) || (e) == IntegrationAlgorithm::BD)
365 /*above integrators may not conserve momenta*/
366 //! Do we use any type of dynamics
367 #define EI_DYNAMICS(e) (EI_MD(e) || EI_RANDOM(e))
368 //! Or do we use minimization
369 #define EI_ENERGY_MINIMIZATION(e) \
370 ((e) == IntegrationAlgorithm::Steep || (e) == IntegrationAlgorithm::CG \
371 || (e) == IntegrationAlgorithm::LBFGS)
372 //! Do we apply test particle insertion
373 #define EI_TPI(e) ((e) == IntegrationAlgorithm::TPI || (e) == IntegrationAlgorithm::TPIC)
374 //! Do we deal with particle velocities
375 #define EI_STATE_VELOCITY(e) (EI_MD(e) || EI_SD(e))
377 //! Constraint algorithm
378 enum class ConstraintAlgorithm : int
385 //! String corresponding to constraint algorithm
386 const char* enumValueToString(ConstraintAlgorithm enumValue);
388 //! Distance restraint refinement algorithm
389 enum class DistanceRestraintRefinement : int
397 //! String corresponding to distance restraint algorithm
398 const char* enumValueToString(DistanceRestraintRefinement enumValue);
400 //! Distance restraints weighting type
401 enum class DistanceRestraintWeighting : int
406 Default = Conservative
408 //! String corresponding to distance restraint weighting
409 const char* enumValueToString(DistanceRestraintWeighting enumValue);
411 //! Combination rule algorithm.
412 enum class CombinationRule : int
421 //! String for combination rule algorithm
422 const char* enumValueToString(CombinationRule enumValue);
424 //! Van der Waals potential.
425 enum class VanDerWaalsPotential : int
433 //! String corresponding to Van der Waals potential
434 const char* enumValueToString(VanDerWaalsPotential enumValue);
436 //! Simulated tempering methods.
437 enum class SimulatedTempering : int
445 //! String corresponding to simulated tempering
446 const char* enumValueToString(SimulatedTempering enumValue);
448 /*! \brief Free energy perturbation type
450 enum class FreeEnergyPerturbationType : int
452 //! there are no evaluations at other states
454 //! treated equivalently to Static
456 //! then lambdas do not change during the simulation
458 //! then the states change monotonically throughout the simulation
460 //! then expanded ensemble simulations are occuring
465 //! String corresponding to FEP type.
466 const char* enumValueToString(FreeEnergyPerturbationType enumValue);
468 //! Free energy pertubation coupling types.
469 enum class FreeEnergyPerturbationCouplingType : int
481 //! String for FEP coupling type
482 const char* enumValueToString(FreeEnergyPerturbationCouplingType enumValue);
483 //! String for FEP coupling type, singular mention.
484 const char* enumValueToStringSingular(FreeEnergyPerturbationCouplingType enumValue);
486 /*! \brief What to print for free energy calculations
488 * Printing the energy to the free energy dhdl file.
489 * Yes is an alias to Total, and
490 * will be converted in readir, so we never have to account for it in code.
492 enum class FreeEnergyPrintEnergy : int
501 //! String corresponding to printing of free energy
502 const char* enumValueToString(FreeEnergyPrintEnergy enumValue);
504 /*! \brief How the lambda weights are calculated
506 enum class LambdaWeightCalculation : int
510 //! using the metropolis criteria
512 //! using the Barker critera for transition weights, also called unoptimized Bennett
514 //! using Barker + minimum variance for weights
516 //! Wang-Landu (using visitation counts)
518 //! Weighted Wang-Landau (using optimized Gibbs weighted visitation counts)
523 //! String corresponding to lambda weights
524 const char* enumValueToString(LambdaWeightCalculation enumValue);
525 //! Macro telling us whether we use expanded ensemble
526 #define ELAMSTATS_EXPANDED(e) ((e) > LambdaWeightCalculation::No)
527 //! Macro telling us whether we use some kind of Wang-Landau
528 #define EWL(e) ((e) == LambdaWeightCalculation::WL || (e) == LambdaWeightCalculation::WWL)
530 /*! \brief How moves in lambda are calculated
532 enum class LambdaMoveCalculation : int
534 //! don't calculate move
536 //! using the Metropolis criteria, and 50% up and down
538 //! using the Barker criteria, and 50% up and down
540 //! computing the transition using the marginalized probabilities of the lambdas
543 * using the metropolized version of Gibbs
545 * Monte Carlo Strategies in Scientific computing, Liu, p. 134
551 //! String corresponding to lambda moves
552 const char* enumValueToString(LambdaMoveCalculation enumValue);
554 /*! \brief How we decide whether weights have reached equilibrium
556 enum class LambdaWeightWillReachEquilibrium : int
558 //! never stop, weights keep going
560 //! fix the weights from the beginning; no movement
562 //! stop when the WL-delta falls below a certain level
564 //! stop when we have a certain number of samples at every step
566 //! stop when we've run a certain total number of steps
568 //! stop when we've run a certain total number of samples
570 //! stop when the ratio of samples (lowest to highest) is sufficiently large
575 //! String corresponding to equilibrium algorithm
576 const char* enumValueToString(LambdaWeightWillReachEquilibrium enumValue);
578 /*! \brief separate_dhdl_file selection
580 * NOTE: YES is the first one. Do NOT interpret this one as a gmx_bool
581 * Why was this done this way, just .........
583 enum class SeparateDhdlFile : int
590 //! String corresponding to separate DHDL file selection
591 const char* enumValueToString(SeparateDhdlFile enumValue);
593 /*! \brief dhdl_derivatives selection \
595 * NOTE: YES is the first one. Do NOT interpret this one as a gmx_bool
596 * Why was this done this way, just .........
598 enum class DhDlDerivativeCalculation : int
605 //! String for DHDL derivatives
606 const char* enumValueToString(DhDlDerivativeCalculation enumValue);
608 /*! \brief Solvent model
610 * Distinguishes classical water types with 3 or 4 particles
612 enum class SolventModel : int
620 //! String corresponding to solvent type
621 const char* enumValueToString(SolventModel enumValue);
623 //! Dispersion correction.
624 enum class DispersionCorrectionType : int
634 //! String corresponding to dispersion corrections
635 const char* enumValueToString(DispersionCorrectionType enumValue);
637 //! Algorithm for simulated annealing.
638 enum class SimulatedAnnealing : int
646 //! String for simulated annealing
647 const char* enumValueToString(SimulatedAnnealing enumValue);
650 enum class WallType : int
659 //! String corresponding to wall type
660 const char* enumValueToString(WallType enumValue);
662 //! Pulling algorithm.
663 enum class PullingAlgorithm : int
674 //! String for pulling algorithm
675 const char* enumValueToString(PullingAlgorithm enumValue);
677 //! Control of pull groups
678 enum class PullGroupGeometry : int
692 //! String for pull groups
693 const char* enumValueToString(PullGroupGeometry enumValue);
695 //! Enforced rotation groups.
696 enum class EnforcedRotationGroupType : int
713 //! Rotation group names
714 const char* enumValueToString(EnforcedRotationGroupType enumValue);
715 //! String for rotation group origin names
716 const char* enumValueToLongString(EnforcedRotationGroupType enumValue);
718 //! Rotation group fitting type
719 enum class RotationGroupFitting : int
727 //! String corresponding to rotation group fitting
728 const char* enumValueToString(RotationGroupFitting enumValue);
730 /*! \brief Direction along which ion/water swaps happen
732 * Part of "Computational Electrophysiology" (CompEL) setups
734 enum class SwapType : int
743 //! Names for swapping
744 const char* enumValueToString(SwapType enumValue);
746 /*! \brief Swap group splitting type
748 * These are just the fixed groups we need for any setup. In t_swap's grp
749 * entry after that follows the variable number of swap groups.
751 enum class SwapGroupSplittingType : int
759 //! String for swap group splitting
760 const char* enumValueToString(SwapGroupSplittingType enumValue);
762 /*! \brief Types of electrostatics calculations
764 * Types of electrostatics calculations available inside nonbonded kernels.
765 * Note that these do NOT necessarily correspond to the user selections
766 * in the MDP file; many interactions for instance map to tabulated kernels.
768 enum class NbkernelElecType : int
778 //! String corresponding to electrostatics kernels
779 const char* enumValueToString(NbkernelElecType enumValue);
781 /*! \brief Types of vdw calculations available
783 * Types of vdw calculations available inside nonbonded kernels.
784 * Note that these do NOT necessarily correspond to the user selections
785 * in the MDP file; many interactions for instance map to tabulated kernels.
787 enum class NbkernelVdwType : int
797 //! String corresponding to VdW kernels
798 const char* enumValueToString(NbkernelVdwType enumValue);
800 #endif /* GMX_MDTYPES_MD_ENUMS_H */