#include "mdapi/mdtypes.h"
#include "random/random.h"
Go to the source code of this file.
Classes | |
struct | StepParam_tag |
Helper class to configure parameters. More... | |
struct | StepSystem_tag |
Helper class providing system data. More... | |
struct | Step_tag |
Time stepping class. More... | |
Defines | |
#define | STEP_FAIL (-1) |
#define | STEP_TRUE (1) |
#define | STEP_FALSE (0) |
Typedefs | |
typedef StepParam_tag | StepParam |
Helper class to configure parameters. | |
typedef StepSystem_tag | StepSystem |
Helper class providing system data. | |
typedef Step_tag | Step |
Time stepping class. | |
Functions | |
int | step_init (Step *, StepParam *param) |
Constructor. | |
int | step_compute (Step *, StepSystem *sys, int32 numsteps) |
Perform time stepping. | |
int | step_find_reductions (Step *, StepSystem *sys) |
Calculate reductions. | |
int | step_set_random_velocities (Step *, StepSystem *sys, double init_temp) |
Set initial velocities. | |
int | step_remove_com_motion (Step *, StepSystem *sys) |
Remove center of mass motion. | |
void | step_done (Step *) |
Destructor. |
Step_tag
class computes time integration using leapfrog (velocity Verlet) integration. Also provided are routines for random velocity initialization from an initial temperature distribution and computation of kinetic energy and temperature reductions.
Two helper classes are required. The StepParam_tag
class is used for setup. Its fields are set to fixed simulation parameters that should not change during the simulation. Among these parameters is a generic force routine that should by design accept the current positions and provide the forces. The StepSystem_tag
class is used for input and output data that is updated throughout the simulation. Input data includes the initial position and velocity arrays, and output data includes updated position and veolcity arrays along with current forces.
The units are as outlined by the MDAPI documentation:
|
Return value indicating an error occurred. |
|
Indicates |
|
Indicates |
|
Time stepping class. Members should be treated as private. |
|
Helper class to configure parameters.
The user is expected to fill in these values. User retains ownership of the atom array. The only thing that might be modified as a side-effect is |
|
Helper class providing system data.
The user is expected to provide buffer space for the |
|
Perform time stepping.
sys is integrated for numsteps time steps using leapfrog (velocity Verlet). The force routine provided to StepParam_tag::force_compute() is called once per time step and optionally once initially depending on the value of StepSystem_tag::is_force_valid . The buffer space provided to StepSystem_tag is updated in place.Note that calls to the force routine account for the majority of the computational cost.
|
|
Destructor.
Frees memory allocations made internally during |
|
Calculate reductions.
StepSystem_tag .
|
|
Constructor.
Step_tag object. Must call this routine first.
|
|
Remove center of mass motion.
StepParam_tag::ndegfreedom should be set accordingly. |
|
Set initial velocities.
|