Progam units

I realize what I am going to ask is going to sound like a really stupid question, it might actually be a dumb question but it is not as crazy as it first sounds. What units does the program think it is using? By that I mean if I am programming a new pair style, what units should the energy and the forces be in? My guess would be kcal/mol and grams/mole * Angstroms/femtosecond^2. Is this correct?

thanks much
matthew

Usually in a pair style there are no predefined units for energy, force and everything else. LAMMPS chooses what units to output your results based on the units (http://lammps.sandia.gov/doc/units.html) you specify in your input script. It would be best not to assume any units in your pair_style (and so the parameter file) so that it can be flexible. That said, many pair_styles have to be used with a particular unit style, not because of how the pair style was coded, but because of the parameter file.

HTH,
Ray

I realize what I am going to ask is going to sound like a really stupid
question, it might actually be a dumb question but it is not as crazy as it
first sounds. What units does the program think it is using? By that I mean
if I am programming a new pair style, what units should the energy and the
forces be in? My guess would be kcal/mol and grams/mole *
Angstroms/femtosecond^2. Is this correct?

as ray already pointed out, ‚Äčif you provide‚Äč consistent units for your
potential parameters, then you don't need to do anything inside the pair
style. please also look at the function Update::set_units() and the force.h
header, where necessary conversion parameters are defined for a given
choice of units that LAMMPS supports.

axel.

Here is one simple example. If you look at pair_lj_cut_coul_cut.cpp

(or any of the pair styles that do both LJ and Coulombics), you will

see use of force->qqrd2e to convert Coulombic terms to energy (or force).

That variable name stands for convert qq/rd to energy and is pre-computed

by LAMMPS behind the scenes to be an appropriate scale factor in

whatever LAMMPS units the user selects at run time.

So long as you right your pair style using it, then your pair style will

work in whatever units the user selects. Ditto for other similar

conversion factors defined in Update::set_units().

Steve