Gromacs  2016.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
pull_rotation.h File Reference
#include "gromacs/math/vectypes.h"
#include "gromacs/timing/wallcycle.h"

Description

Declares functions to enforce rotational motion upon a group of particles.

Author
Carsten Kutzner ckutz.nosp@m.ne@g.nosp@m.wdg.d.nosp@m.e

Functions

void init_rot (FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[], struct t_commrec *cr, rvec *x, matrix box, gmx_mtop_t *mtop, const gmx_output_env_t *oenv, gmx_bool bVerbose, unsigned long Flags)
 Initializes the enforced rotation groups. More...
 
void dd_make_local_rotation_groups (struct gmx_domdec_t *dd, t_rot *rot)
 Make a selection of the home atoms for all enforced rotation groups. More...
 
void do_rotation (struct t_commrec *cr, t_inputrec *ir, matrix box, rvec x[], real t, gmx_int64_t step, gmx_wallcycle_t wcycle, gmx_bool bNS)
 Calculates the enforced rotation potential(s). More...
 
real add_rot_forces (t_rot *rot, rvec f[], struct t_commrec *cr, gmx_int64_t step, real t)
 Add the enforced rotation forces to the official force array. More...
 
void finish_rot (t_rot *rot)
 Close the enforced rotation output files. More...
 

Function Documentation

real add_rot_forces ( t_rot *  rot,
rvec  f[],
struct t_commrec *  cr,
gmx_int64_t  step,
real  t 
)

Add the enforced rotation forces to the official force array.

Adds the forces from enforced rotation potential to the local forces and sums up the contributions to the rotation potential from all the nodes. Since this needs communication, this routine should be called after the short range forces have been evaluated (in order not to spoil cycle counts). This routine also outputs data to the rotation output files (e.g. the potential, the angle of the group(s), and torques).

Parameters
rotPointer to all the enforced rotation data.
fThe local forces to which the rotational forces have to be added.
crPointer to MPI communication data.
stepThe time step, used for output.
tTime, used for output.
Returns
The potential energy of the rotation potentials.
void dd_make_local_rotation_groups ( struct gmx_domdec_t *  dd,
t_rot *  rot 
)

Make a selection of the home atoms for all enforced rotation groups.

This routine is similar to dd_make_local_pull_groups, but works only with domain decomposition. It should be called at every domain decomposition.

Parameters
ddStructure containing domain decomposition data.
rotPointer to all the enforced rotation data.
void do_rotation ( struct t_commrec *  cr,
t_inputrec *  ir,
matrix  box,
rvec  x[],
real  t,
gmx_int64_t  step,
gmx_wallcycle_t  wcycle,
gmx_bool  bNS 
)

Calculates the enforced rotation potential(s).

This is the main enforced rotation module which is called during every time step. Here the rotation potential as well as the resulting forces are calculated.

Parameters
crPointer to MPI communication data.
irStruct containing MD input parameters, among those
boxSimulation box, needed to make group whole.
xThe positions of all the local particles.
tTime.
stepThe time step.
wcycleDuring the potential calculation the wallcycles are counted. Later they enter the dynamic load balancing.
bNSAfter domain decomposition / neighbor searching several local arrays have to be updated (masses, shifts)
void finish_rot ( t_rot *  rot)

Close the enforced rotation output files.

Parameters
rotPointer to all the enforced rotation data.
void init_rot ( FILE *  fplog,
t_inputrec *  ir,
int  nfile,
const t_filenm  fnm[],
struct t_commrec *  cr,
rvec *  x,
matrix  box,
gmx_mtop_t *  mtop,
const gmx_output_env_t *  oenv,
gmx_bool  bVerbose,
unsigned long  Flags 
)

Initializes the enforced rotation groups.

This routine does the memory allocation for various helper arrays, opens the output files etc.

Parameters
fplogGeneral output file, normally md.log.
irStruct containing MD input parameters, among those also the enforced rotation parameters.
nfileNumber of entries in the fnm structure.
fnmThe filenames struct containing also the names of the rotation output files.
crPointer to MPI communication data.
xThe positions of all MD particles.
boxThe simulation box.
mtopMolecular topology.
oenvNeeded to open the rotation output xvgr file.
bVerboseWhether to print extra status information.
FlagsFlags passed over from main, used to determine whether or not we are doing a rerun.