Gromacs
2016.6
|
#include "gmxpre.h"
#include "listed-forces.h"
#include <assert.h>
#include <algorithm>
#include "gromacs/gmxlib/network.h"
#include "gromacs/gmxlib/nrnb.h"
#include "gromacs/listed-forces/bonded.h"
#include "gromacs/listed-forces/disre.h"
#include "gromacs/listed-forces/orires.h"
#include "gromacs/listed-forces/pairs.h"
#include "gromacs/listed-forces/position-restraints.h"
#include "gromacs/math/vec.h"
#include "gromacs/mdlib/force.h"
#include "gromacs/mdlib/force_flags.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/fcdata.h"
#include "gromacs/mdtypes/forcerec.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/simd/simd.h"
#include "gromacs/timing/wallcycle.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "listed-internal.h"
This file defines high-level functions for mdrun to compute energies and forces for listed interactions.
Macros | |
#define | MAX_BONDED_THREADS 256 |
The max thread number is arbitrary, we used a fixed number to avoid memory management. Using more than 16 threads is probably never useful performance wise. | |
Functions | |
bool | anonymous_namespace{listed-forces.cpp}::isPairInteraction (int ftype) |
Return true if ftype is an explicit pair-listed LJ or COULOMB interaction type: bonded LJ (usually 1-4), or special listed non-bonded for FEP. | |
static void | anonymous_namespace{listed-forces.cpp}::zero_thread_output (struct bonded_threading_t *bt, int thread) |
Zero thread-local output buffers. | |
static void | anonymous_namespace{listed-forces.cpp}::reduce_thread_forces (int n, rvec *f, struct bonded_threading_t *bt, int nthreads) |
Reduce thread-local force buffers. | |
static void | anonymous_namespace{listed-forces.cpp}::reduce_thread_output (int n, rvec *f, rvec *fshift, real *ener, gmx_grppairener_t *grpp, real *dvdl, struct bonded_threading_t *bt, gmx_bool bCalcEnerVir, gmx_bool bDHDL) |
Reduce thread-local forces, shift forces and energies. | |
real | anonymous_namespace{listed-forces.cpp}::calc_one_bond (int thread, int ftype, const t_idef *idef, const rvec x[], rvec4 f[], rvec fshift[], t_forcerec *fr, const t_pbc *pbc, const t_graph *g, gmx_grppairener_t *grpp, t_nrnb *nrnb, real *lambda, real *dvdl, const t_mdatoms *md, t_fcdata *fcd, gmx_bool bCalcEnerVir, int *global_atom_index) |
Calculate one element of the list of bonded interactions for this thread. | |
gmx_bool | ftype_is_bonded_potential (int ftype) |
Return whether this is an interaction that actually calculates a potential and works on multiple atoms (not e.g. a connection or a position restraint). More... | |
void | calc_listed (const t_commrec *cr, struct gmx_wallcycle *wcycle, const t_idef *idef, const rvec x[], history_t *hist, rvec f[], t_forcerec *fr, const struct t_pbc *pbc, const struct t_pbc *pbc_full, const struct t_graph *g, gmx_enerdata_t *enerd, t_nrnb *nrnb, real *lambda, const t_mdatoms *md, t_fcdata *fcd, int *global_atom_index, int force_flags) |
Calculates all listed force interactions. More... | |
void | calc_listed_lambda (const t_idef *idef, const rvec x[], t_forcerec *fr, const struct t_pbc *pbc, const struct t_graph *g, gmx_grppairener_t *grpp, real *epot, t_nrnb *nrnb, real *lambda, const t_mdatoms *md, t_fcdata *fcd, int *global_atom_index) |
As calc_listed(), but only determines the potential energy for the perturbed interactions. More... | |
void | do_force_listed (struct gmx_wallcycle *wcycle, matrix box, const t_lambda *fepvals, const t_commrec *cr, const t_idef *idef, const rvec x[], history_t *hist, rvec f[], t_forcerec *fr, const struct t_pbc *pbc, const struct t_graph *graph, gmx_enerdata_t *enerd, t_nrnb *nrnb, real *lambda, const t_mdatoms *md, t_fcdata *fcd, int *global_atom_index, int flags) |
Do all aspects of energy and force calculations for mdrun on the set of listed interactions. | |
void calc_listed | ( | const t_commrec * | cr, |
struct gmx_wallcycle * | wcycle, | ||
const t_idef * | idef, | ||
const rvec | x[], | ||
history_t * | hist, | ||
rvec | f[], | ||
t_forcerec * | fr, | ||
const struct t_pbc * | pbc, | ||
const struct t_pbc * | pbc_full, | ||
const struct t_graph * | g, | ||
gmx_enerdata_t * | enerd, | ||
t_nrnb * | nrnb, | ||
real * | lambda, | ||
const t_mdatoms * | md, | ||
struct t_fcdata * | fcd, | ||
int * | ddgatindex, | ||
int | force_flags | ||
) |
Calculates all listed force interactions.
Note that pbc_full is used only for position restraints, and is not initialized if there are none.
void calc_listed_lambda | ( | const t_idef * | idef, |
const rvec | x[], | ||
t_forcerec * | fr, | ||
const struct t_pbc * | pbc, | ||
const struct t_graph * | g, | ||
gmx_grppairener_t * | grpp, | ||
real * | epot, | ||
t_nrnb * | nrnb, | ||
real * | lambda, | ||
const t_mdatoms * | md, | ||
struct t_fcdata * | fcd, | ||
int * | global_atom_index | ||
) |
As calc_listed(), but only determines the potential energy for the perturbed interactions.
The shift forces in fr are not affected.