CoMD
A Mini-app for Co-Design of Classical Molecular Dynamics.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
timestep.h File Reference

Leapfrog time integrator. More...

#include "CoMDTypes.h"
Include dependency graph for timestep.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double timestep (SimFlat *s, int n, real_t dt)
 Advance the simulation time to t+dt using a leap frog method (equivalent to velocity verlet). More...
 
void computeForce (SimFlat *s)
 
void kineticEnergy (SimFlat *s)
 Calculates total kinetic and potential energy across all tasks. More...
 
void redistributeAtoms (struct SimFlatSt *sim)
 Update local and remote link cells after atoms have moved. More...
 

Detailed Description

Leapfrog time integrator.

Definition in file timestep.h.

Function Documentation

void computeForce ( SimFlat s)

Definition at line 61 of file timestep.c.

Here is the caller graph for this function:

void kineticEnergy ( SimFlat s)

Calculates total kinetic and potential energy across all tasks.

The local potential energy is a by-product of the force routine.

Definition at line 97 of file timestep.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void redistributeAtoms ( SimFlat sim)

Update local and remote link cells after atoms have moved.

This function provides one-stop shopping for the sequence of events that must occur for a proper exchange of halo atoms after the atom positions have been updated by the integrator.

  • updateLinkCells: Since atoms have moved, some may be in the wrong link cells.
  • haloExchange (atom version): Sends atom data to remote tasks.
  • sort: Sort the atoms.
See Also
updateLinkCells
initAtomHaloExchange
sortAtomsInCell

Definition at line 136 of file timestep.c.

Here is the call graph for this function:

Here is the caller graph for this function:

double timestep ( SimFlat s,
int  nSteps,
real_t  dt 
)

Advance the simulation time to t+dt using a leap frog method (equivalent to velocity verlet).

Forces must be computed before calling the integrator the first time.

  • Advance velocities half time step using forces
  • Advance positions full time step using velocities
  • Update link cells and exchange remote particles
  • Compute forces
  • Update velocities half time step using forces

This leaves positions, velocities, and forces at t+dt, with the forces ready to perform the half step velocity update at the top of the next call.

After nSteps the kinetic energy is computed for diagnostic output.

Definition at line 31 of file timestep.c.

Here is the call graph for this function:

Here is the caller graph for this function: