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

Initialize the atom configuration. More...

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

Go to the source code of this file.

Data Structures

struct  AtomsSt
 Atom data. More...
 

Typedefs

typedef struct AtomsSt Atoms
 Atom data. More...
 

Functions

AtomsinitAtoms (struct LinkCellSt *boxes)
 Allocates memory to store atom data. More...
 
void destroyAtoms (struct AtomsSt *atoms)
 
void createFccLattice (int nx, int ny, int nz, real_t lat, struct SimFlatSt *s)
 Creates atom positions on a face centered cubic (FCC) lattice with nx * ny * nz unit cells and lattice constant lat. More...
 
void setVcm (struct SimFlatSt *s, real_t vcm[3])
 Sets the center of mass velocity of the system. More...
 
void setTemperature (struct SimFlatSt *s, real_t temperature)
 Sets the temperature of system. More...
 
void randomDisplacements (struct SimFlatSt *s, real_t delta)
 Add a random displacement to the atom positions. More...
 

Detailed Description

Initialize the atom configuration.

Definition in file initAtoms.h.

Typedef Documentation

typedef struct AtomsSt Atoms

Atom data.

Function Documentation

void createFccLattice ( int  nx,
int  ny,
int  nz,
real_t  lat,
SimFlat s 
)

Creates atom positions on a face centered cubic (FCC) lattice with nx * ny * nz unit cells and lattice constant lat.

Set momenta to zero.

Definition at line 64 of file initAtoms.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void destroyAtoms ( struct AtomsSt atoms)

Definition at line 52 of file initAtoms.c.

Here is the caller graph for this function:

Atoms* initAtoms ( LinkCell boxes)

Allocates memory to store atom data.

Call functions such as createFccLattice and setTemperature to set up initial atom positions and momenta.

Definition at line 23 of file initAtoms.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void randomDisplacements ( SimFlat s,
real_t  delta 
)

Add a random displacement to the atom positions.

Atoms are displaced by a random distance in the range [-delta, +delta] along each axis.

Parameters
[in]deltaThe maximum displacement (along each axis).

Definition at line 187 of file initAtoms.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void setTemperature ( SimFlat s,
real_t  temperature 
)

Sets the temperature of system.

Selects atom velocities randomly from a boltzmann (equilibrium) distribution that corresponds to the specified temperature. This random process will typically result in a small, but non zero center of mass velocity and a small difference from the specified temperature. For typical MD runs these small differences are unimportant, However, to avoid possible confusion, we set the center of mass velocity to zero and scale the velocities to exactly match the input temperature.

Definition at line 145 of file initAtoms.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void setVcm ( SimFlat s,
real_t  newVcm[3] 
)

Sets the center of mass velocity of the system.

Parameters
[in]newVcmThe desired center of mass velocity.

Definition at line 111 of file initAtoms.c.

Here is the call graph for this function:

Here is the caller graph for this function: