Gromacs
2021.6
|
#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/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"
This file defines low-level functions necessary for computing energies and forces for listed interactions.
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, 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, 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, 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, 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 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 EnumerationArray < BondedKernelFlavor, std::string > | c_bondedKernelFlavorStrings |
Helper strings for human-readable messages. More... | |
const int | anonymous_namespace{bonded.cpp}::cmap_coeff_matrix [] |
Mysterious CMAP coefficient matrix. More... | |
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, | ||
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.
bondedKernelFlavor
did not request the energy. const EnumerationArray<BondedKernelFlavor, std::string> c_bondedKernelFlavorStrings |
Helper strings for human-readable messages.