blob: 3fd30e9f07f52b6cdc5ae057947618f911386442 [file] [log] [blame]
/// \file
/// CoMD data structures.
#ifndef __COMDTYPES_H_
#define __COMDTYPES_H_
#include <stdio.h>
#include "mytype.h"
#include "haloExchange.h"
#include "linkCells.h"
#include "decomposition.h"
#include "initAtoms.h"
struct SimFlatSt;
/// The base struct from which all potentials derive. Think of this as an
/// abstract base class.
///
/// CoMD uses the following units:
/// - distance is in Angstroms
/// - energy is in eV
/// - time is in fs
/// - force in in eV/Angstrom
///
/// The choice of distance, energy, and time units means that the unit
/// of mass is eV*fs^2/Angstrom^2. Hence, we must convert masses that
/// are input in AMU (atomic mass units) into internal mass units.
typedef struct BasePotentialSt
{
real_t cutoff; //!< potential cutoff distance in Angstroms
real_t mass; //!< mass of atoms in intenal units
real_t lat; //!< lattice spacing (angs) of unit cell
char latticeType[8]; //!< lattice type, e.g. FCC, BCC, etc.
char name[3]; //!< element name
int atomicNo; //!< atomic number
int (*force)(struct SimFlatSt* s); //!< function pointer to force routine
void (*print)(FILE* file, struct BasePotentialSt* pot);
void (*destroy)(struct BasePotentialSt** pot); //!< destruction of the potential
} BasePotential;
/// species data: chosen to match the data found in the setfl/funcfl files
typedef struct SpeciesDataSt
{
char name[3]; //!< element name
int atomicNo; //!< atomic number
real_t mass; //!< mass in internal units
} SpeciesData;
/// Simple struct to store the initial energy and number of atoms.
/// Used to check energy conservation and atom conservation.
typedef struct ValidateSt
{
double eTot0; //<! Initial total energy
int nAtoms0; //<! Initial global number of atoms
} Validate;
///
/// The fundamental simulation data structure with MAXATOMS in every
/// link cell.
///
typedef struct SimFlatSt
{
int nSteps; //<! number of time steps to run
int printRate; //<! number of steps between output
double dt; //<! time step
Domain* domain; //<! domain decomposition data
LinkCell* boxes; //<! link-cell data
Atoms* atoms; //<! atom data (positions, momenta, ...)
SpeciesData* species; //<! species data (per species, not per atom)
real_t ePotential; //!< the total potential energy of the system
real_t eKinetic; //!< the total kinetic energy of the system
BasePotential *pot; //!< the potential
HaloExchange* atomExchange;
} SimFlat;
#endif