Gromacs  2027.0-dev-20261113-fb41eee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Enumerations | Functions | Variables
ifunc.h File Reference
#include "gromacs/libgromacs_export.h"
#include "gromacs/utility/enumerationhelpers.h"
#include "gromacs/utility/vectypes.h"
+ Include dependency graph for ifunc.h:
+ This graph shows which files directly or indirectly include this file:

Description

Declares interaction function types and related things.

Classes

struct  t_interaction_function
 Interaction function. More...
 

Typedefs

typedef int t_iatom
 
typedef real rvec4 [4]
 
using InteractionFunctionCategoryFlags = unsigned int
 Type for specifying a set of interaction categories. More...
 

Enumerations

enum  InteractionFunctionCategory : int {
  InteractionFunctionCategory::Null, InteractionFunctionCategory::BondedForce, InteractionFunctionCategory::VirtualSite, InteractionFunctionCategory::Constraint,
  InteractionFunctionCategory::ChemicalBond, InteractionFunctionCategory::BType, InteractionFunctionCategory::Angle, InteractionFunctionCategory::Dihedral,
  InteractionFunctionCategory::Pair, InteractionFunctionCategory::Tabulated, InteractionFunctionCategory::ZeroAtLargeDistances, Count
}
 These flags tell some of the routines what can be done with particular kinds of interaction functions. More...
 
enum  InteractionFunction : int {
  Bonds, GROMOS96Bonds, MorsePotential, CubicBonds,
  ConnectBonds, HarmonicPotential, FENEBonds, TabulatedBonds,
  TabulatedBondsNoCoupling, RestraintBonds, Angles, GROMOS96Angles,
  RestrictedBendingPotential, LinearAngles, CrossBondBonds, CrossBondAngles,
  UreyBradleyPotential, QuarticAngles, TabulatedAngles, ProperDihedrals,
  RyckaertBellemansDihedrals, RestrictedTorsionPotential, CombinedBendingTorsionPotential, FourierDihedrals,
  ImproperDihedrals, PeriodicImproperDihedrals, TabulatedDihedrals, DihedralEnergyCorrectionMap,
  GeneralizedBorn12PolarizationUnused, GeneralizedBorn13PolarizationUnused, GeneralizedBorn14PolarizationUnused, GeneralizedBornPolarizationUnused,
  NonpolarSolvationUnused, LennardJones14, Coulomb14, LennardJonesCoulomb14Q,
  LennardJonesCoulombNonBondedPairs, LennardJonesShortRange, BuckinghamShortRange, LennardJonesLongRangeUnused,
  BuckinghamLongRangeUnused, DispersionCorrection, CoulombShortRange, CoulombLongRangeUnused,
  ReactionFieldExclusion, CoulombReciprocalSpace, LennardJonesReciprocalSpace, DissipativeParticleDynamics,
  Polarization, WaterPolarization, TholePolarization, AnharmonicPolarization,
  PositionRestraints, FlatBottomedPositionRestraints, DistanceRestraints, DistanceRestraintViolations,
  OrientationRestraints, OrientationRestraintDeviations, AngleRestraints, AngleZAxisRestraints,
  DihedralRestraints, DihedralRestraintViolations, Constraints, ConstraintsNoCoupling,
  SETTLE, VirtualSite1, VirtualSite2, VirtualSite2FixedDistance,
  VirtualSite3, VirtualSite3FixedDistance, VirtualSite3FixedAngleDistance, VirtualSite3Outside,
  VirtualSite4FixedDistance, VirtualSite4FixedDistanceNormalization, VirtualSiteN, CenterOfMassPullingEnergy,
  DensityFitting, QuantumMechanicalRegionEnergy, NeuralNetworkPotentialEnergy, PotentialEnergy,
  KineticEnergy, TotalEnergy, ConservedEnergy, Temperature,
  VirialTemperatureUnused, PressureDispersionCorrection, Pressure, dHdLambdaConstraint,
  dVremainingdLambda, dEkineticdLambda, dVCoulombdLambda, dVvanderWaalsdLambda,
  dVbondeddLambda, dVrestraintdLambda, InteractionFunction::dVtemperaturedLambda, InteractionFunction::Count
}
 Interaction function enums. More...
 

Functions

static bool IS_RESTRAINT_TYPE (InteractionFunction ifunc)
 
static int NRFPA (InteractionFunction iftype)
 
static int NRFPB (InteractionFunction iftype)
 
static int NRFP (InteractionFunction iftype)
 
static int NRAL (InteractionFunction iftype)
 
static bool IS_CHEMBOND (InteractionFunction iftype)
 Tells if function type ftype represents a two-bond Lewis-style chemical bond.
 
static bool IS_ANGLE (InteractionFunction iftype)
 Tells if a function type ftype represents an angle. More...
 
static bool IS_VSITE (InteractionFunction iftype)
 
static bool IS_TABULATED (InteractionFunction iftype)
 

Variables

constexpr int MAXATOMLIST = 6
 Maximum allowed number of atoms.
 
constexpr int MAXFORCEPARAM = 12
 Maximum allowed number of parameters.
 
constexpr int NR_RBDIHS = 6
 Maximum terms in interaction_function. Check src/gromacs/gmxpreprocess/toppush.cpp when you change these numbers.
 
constexpr int NR_CBTDIHS = 6
 
constexpr int NR_FOURDIHS = 4
 
LIBGROMACS_EXPORT const
gmx::EnumerationArray
< InteractionFunction,
t_interaction_function > 
interaction_function
 Initialised interaction functions descriptor. More...
 
static constexpr
InteractionFunctionCategoryFlags 
sc_ifcNull = 0
 Flags describing categories of interaction functions. More...
 
static constexpr
InteractionFunctionCategoryFlags 
sc_ifcBondedForce = 1 << static_cast<int>(InteractionFunctionCategory::BondedForce)
 
static constexpr
InteractionFunctionCategoryFlags 
sc_ifcVirtualSite = 1 << static_cast<int>(InteractionFunctionCategory::VirtualSite)
 
static constexpr
InteractionFunctionCategoryFlags 
sc_ifcConstraint = 1 << static_cast<int>(InteractionFunctionCategory::Constraint)
 
static constexpr
InteractionFunctionCategoryFlags 
sc_ifcChemicalBond = 1 << static_cast<int>(InteractionFunctionCategory::ChemicalBond)
 
static constexpr
InteractionFunctionCategoryFlags 
sc_ifcBType = 1 << static_cast<int>(InteractionFunctionCategory::BType)
 
static constexpr
InteractionFunctionCategoryFlags 
sc_ifcAngle = 1 << static_cast<int>(InteractionFunctionCategory::Angle)
 
static constexpr
InteractionFunctionCategoryFlags 
sc_ifcDihedral = 1 << static_cast<int>(InteractionFunctionCategory::Dihedral)
 
static constexpr
InteractionFunctionCategoryFlags 
sc_ifcPair = 1 << static_cast<int>(InteractionFunctionCategory::Pair)
 
static constexpr
InteractionFunctionCategoryFlags 
sc_ifcTabulated = 1 << static_cast<int>(InteractionFunctionCategory::Tabulated)
 
static constexpr
InteractionFunctionCategoryFlags 
sc_ifcZeroAtLargeDistances = 1 << static_cast<int>(InteractionFunctionCategory::ZeroAtLargeDistances)
 

Typedef Documentation

using InteractionFunctionCategoryFlags = unsigned int

Type for specifying a set of interaction categories.

A std::bitset might be nice in C++23, but until then it is not constexpr enough.

Enumeration Type Documentation

enum InteractionFunction : int
strong

Interaction function enums.

This MUST correspond to the t_interaction_function array in src/gromacs/topology/ifunc.cpp.

Enumerator
dVtemperaturedLambda 

Not calculated for now, but should just be the energy (NVT) or enthalpy (NPT), or 0 (NVE).

Count 

This number is for the total number of energies.

enum InteractionFunctionCategory : int
strong

These flags tell some of the routines what can be done with particular kinds of interaction functions.

These are used to define the values used for InteractionFunctionCategoryFlags.

Enumerator
Null 

Indicates the intent to set no category.

A bonded force interaction will be calculated, e.g. bond, angle, dihedral, etc.

BondedForce 

A virtual site.

VirtualSite 

Either a constraint or a SETTLE.

Constraint 

A bond, constraint, or SETTLE that expresses connectivity.

ChemicalBond 

A two-body bond that grompp can manipulate in topology preparation.

Originally IF_BYTPE was introduced to describe all kinds of bonds that were then supported in GROMACS, and used in preparing virtual sites and in conversions to either constraints or Morse bonds. Later other kinds of two-body interactions were introduced, and sometimes they were added to sc_ifcBType. Then the descriptor sc_ifcChemicalBond was introduced to describe all kinds of connective two-body associations, including constraints.

Bond would be a better name, but that word was originally used in IF_BOND to refer to all kinds of bonded interactions, so should be avoided here.

This category is used in preprocessing for handling the above three roles. There are other two-body bonded interactions that could perhaps have this category added. Or those three roles could be differentiated when we have a use case for that.

This category should be avoided in mdrun, to avoid making the mulptiple use cases even more complex. Prefer ChemicalBond or checking the number of particles in the interaction.

BType 

Angle interactions.

Angle 

Dihedral interactions.

Dihedral 

Pair interactions.

Pair 

Tabulated interactions.

Tabulated 

Indicates that for a bonded interaction the potential does goes to zero for large distances, thus if such an interaction is not assigned to any rank by the domain decomposition, the simulation may continue, when mdrun has been told to permit that.

ZeroAtLargeDistances 

Conventional final delimiter for an enum class.

Function Documentation

static bool IS_ANGLE ( InteractionFunction  iftype)
inlinestatic

Tells if a function type ftype represents an angle.

Per Larsson, 2007-11-06.

Variable Documentation

LIBGROMACS_EXPORT const gmx::EnumerationArray<InteractionFunction, t_interaction_function> interaction_function

Initialised interaction functions descriptor.

Initialised interaction functions descriptor.

This MUST correspond to the enum in api/legacy/include/gromacs/topology/ifunc.h.

Note also that the longname field of the interaction is used for printing e.g. the mdrun log file in a columnar style, and pr_ebin makes available only 14 printing characters (ie not including the terminating '\0'). So please abbreviate accordingly, e.g. "Conserved En."

constexpr InteractionFunctionCategoryFlags sc_ifcNull = 0
static

Flags describing categories of interaction functions.

These values can be used (individually or in groups) in bitwise operations to see e.g. if an interaction type is either a constraint or a bond.