Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Typedefs | Functions | Variables
#include "gmxpre.h"
#include "bonded.h"
#include "config.h"
#include <cassert>
#include <cmath>
#include <algorithm>
#include "gromacs/gmxlib/nrnb.h"
#include "gromacs/listed_forces/disre.h"
#include "gromacs/listed_forces/orires.h"
#include "gromacs/math/functions.h"
#include "gromacs/math/units.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
#include "gromacs/mdtypes/fcdata.h"
#include "gromacs/mdtypes/mdatom.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/pbcutil/mshift.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pbcutil/pbc_simd.h"
#include "gromacs/simd/simd.h"
#include "gromacs/simd/simd_math.h"
#include "gromacs/simd/vector_operations.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/enumerationhelpers.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/real.h"
#include "gromacs/utility/smalloc.h"
#include "listed_internal.h"
#include "restcbt.h"
+ Include dependency graph for bonded.cpp:

Description

This file defines low-level functions necessary for computing energies and forces for listed interactions.

Author
Mark Abraham mark..nosp@m.j.ab.nosp@m.raham.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Typedefs

using anonymous_namespace{bonded.cpp}::BondedFunction = real(*)(int nbonds, const t_iatom iatoms[], const t_iparams iparams[], const rvec x[], rvec4 f[], rvec fshift[], const t_pbc *pbc, const t_graph *g, real lambda, real *dvdlambda, const t_mdatoms *md, t_fcdata *fcd, int *ddgatindex)
 Type of CPU function to compute a bonded interaction.
 

Functions

int anonymous_namespace{bonded.cpp}::pbc_rvec_sub (const t_pbc *pbc, const rvec xi, const rvec xj, rvec dx)
 Compute dx = xi - xj, modulo PBC if non-NULL. More...
 
void make_dp_periodic (real *dp)
 Make a dihedral fall in the range (-pi,pi)
 
template<BondedKernelFlavor flavor>
void anonymous_namespace{bonded.cpp}::spreadBondForces (const real bondForce, const rvec dx, const int ai, const int aj, rvec4 *f, int shiftIndex, const t_graph *g, rvec *fshift)
 Spreads and accumulates the bonded forces to the two atoms and adds the virial contribution when needed. More...
 
template<BondedKernelFlavor flavor>
real anonymous_namespace{bonded.cpp}::morse_bonds (int nbonds, const t_iatom forceatoms[], const t_iparams forceparams[], const rvec x[], rvec4 f[], rvec fshift[], const t_pbc *pbc, const t_graph *g, real lambda, real *dvdlambda, const t_mdatoms *md, t_fcdata *fcd, int *global_atom_index)
 Morse potential bond. More...
 
int anonymous_namespace{bonded.cpp}::cmap_setup_grid_index (int ip, int grid_spacing, int *ipm1, int *ipp1, int *ipp2)
 Mysterious undocumented function.
 
real cmap_dihs (int nbonds, const t_iatom forceatoms[], const t_iparams forceparams[], const gmx_cmap_t *cmap_grid, const rvec x[], rvec4 f[], rvec fshift[], const struct t_pbc *pbc, const struct t_graph *g, real lambda, real *dvdlambda, const t_mdatoms *md, t_fcdata *fcd, int *global_atom_index)
 Compute CMAP dihedral energies and forces.
 
real calculateSimpleBond (const int ftype, const int numForceatoms, const t_iatom forceatoms[], const t_iparams forceparams[], const rvec x[], rvec4 f[], rvec fshift[], const struct t_pbc *pbc, const struct t_graph *g, const real lambda, real *dvdlambda, const t_mdatoms *md, t_fcdata *fcd, int *global_atom_index, const BondedKernelFlavor bondedKernelFlavor)
 Calculates bonded interactions for simple bonded types. More...
 
int nrnbIndex (int ftype)
 Getter for finding the flop count for an ftype interaction.
 

Variables

const int anonymous_namespace{bonded.cpp}::cmap_coeff_matrix []
 Mysterious CMAP coefficient matrix. More...
 

Function Documentation

real calculateSimpleBond ( int  ftype,
int  numForceatoms,
const t_iatom  forceatoms[],
const t_iparams  forceparams[],
const rvec  x[],
rvec4  f[],
rvec  fshift[],
const struct t_pbc pbc,
const struct t_graph *  g,
real  lambda,
real dvdlambda,
const t_mdatoms md,
t_fcdata *  fcd,
int *  global_atom_index,
BondedKernelFlavor  bondedKernelFlavor 
)

Calculates bonded interactions for simple bonded types.

Exits with an error when the bonded type is not simple All pointers should be non-null, except for pbc and g which can be nullptr.

Returns
the energy or 0 when bondedKernelFlavor did not request the energy.