Gromacs  2021-beta3-UNCHECKED
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
pull_rotation.h File Reference
#include <stdio.h>
#include <memory>
#include "gromacs/math/vectypes.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/classhelpers.h"
+ Include dependency graph for pull_rotation.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

std::unique_ptr
< gmx::EnforcedRotation > 
init_rot (FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[], const t_commrec *cr, gmx::LocalAtomSetManager *atomSets, const t_state *globalState, gmx_mtop_t *mtop, const gmx_output_env_t *oenv, const gmx::MdrunOptions &mdrunOptions, gmx::StartingBehavior startingBehavior)
 Initializes the enforced rotation groups. More...
 
void do_rotation (const t_commrec *cr, gmx_enfrot *er, const matrix box, rvec x[], real t, int64_t step, gmx_bool bNS)
 Calculates the enforced rotation potential(s). More...
 
real add_rot_forces (gmx_enfrot *er, rvec f[], const t_commrec *cr, int64_t step, real t)
 Add the enforced rotation forces to the official force array. More...
 

Function Documentation

real add_rot_forces ( gmx_enfrot *  er,
rvec  f[],
const t_commrec *  cr,
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
erPointer to the enforced rotation working 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 do_rotation ( const t_commrec *  cr,
gmx_enfrot *  er,
const matrix  box,
rvec  x[],
real  t,
int64_t  step,
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.
erPointer to the enforced rotation working data.
boxSimulation box, needed to make group whole.
xThe positions of all the local particles.
tTime.
stepThe time step.
bNSAfter domain decomposition / neighbor searching several local arrays have to be updated (masses, shifts)
std::unique_ptr<gmx::EnforcedRotation> init_rot ( FILE *  fplog,
t_inputrec *  ir,
int  nfile,
const t_filenm  fnm[],
const t_commrec *  cr,
gmx::LocalAtomSetManager atomSets,
const t_state globalState,
gmx_mtop_t *  mtop,
const gmx_output_env_t *  oenv,
const gmx::MdrunOptions &  mdrunOptions,
gmx::StartingBehavior  startingBehavior 
)

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.
atomSetsTracks indices of atoms subject to enforced rotation for each DD rank.
crPointer to MPI communication data.
globalStateThe global state, only used on the master rank.
mtopMolecular topology.
oenvNeeded to open the rotation output xvgr file.
mdrunOptionsOptions for mdrun.
startingBehaviorDescribes whether this is a restart appending to output files
Returns
An enforced rotation module.