Action: UNITS
Module | setup |
---|---|
Description | Usage |
This command sets the internal units for the code. |
Further details and examples
This command sets the internal units for the code.
The default units in the plumed input and output files are discussed here. If you would like to use units that are different from these defaults you can use the UNITS command. This directive MUST appear at the BEGINNING of the plumed.dat file and same units must be used throughout the plumed.dat file.
The following input demonstrates one way that you can use the UNITS command to change the units.
# this is using Angstrom - kj/mol - fs UNITSThis command sets the internal units for the code. More details LENGTHthe units of lengths=A TIMEthe units of time=fs # compute distance between atoms 1 and 4 d : DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,4 # print time and distance on a COLVAR file # times and distances in this file will be in fs and A respectively PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d FILEthe name of the file on which to output these quantities=COLVAR # dump atoms 1 to 100 on a 'out.gro' file # The positions in the gro file here will be written # in nm because this is the convention for gro files. DUMPATOMSDump selected atoms on a file. More details FILEfile on which to output coordinates; extension is automatically detected=out.gro STRIDE the frequency with which the atoms should be output=10 ATOMSthe atom indices whose positions you would like to print out=1-100 # dump atoms 1 to 100 on a 'out.xyz' file # The position in the xyz file here will be written # in A as there is no conventional units for xyz files # and the plumed length units has been set to Angstroms. DUMPATOMSDump selected atoms on a file. More details FILEfile on which to output coordinates; extension is automatically detected=out.xyz STRIDE the frequency with which the atoms should be output=10 ATOMSthe atom indices whose positions you would like to print out=1-100
In the example input above strings are used to set the units. The following table details all the strings that can be used when setting units. Note that the strings are case sensitive.
Quantity | Default | Alternatives |
---|---|---|
Length | nm | A (for Angstrom), um (for micrometer), Bohr (0.052917721067 nm) |
Energy | kj/mol | j/mol, kcal/mol (4.184 kj/mol), eV (96.48530749925792 kj/mol), Ha (for Hartree, 2625.499638 kj/mol) |
Time | ps | fs, ns, atomic (2.418884326509e-5 ps) |
Mass | amu | |
Charge | e |
If you want to use a unit that is not specified in the table above you can specify a factor for converting the default unit to your chosen unit. As an example of how this works in practice the example below converts lengths and times into A and fs by giving explicit values for the conversion factors.
UNITSThis command sets the internal units for the code. More details LENGTHthe units of lengths=0.1 TIMEthe units of time=0.001
The input above tells PLUMED that lengths in nm should be divided by 0.1 so as to convert them to Anstroms. Times in ps should be divded by 0.001 to convert them from ps to fs.
To reitterate, the default or the units specified in the UNITS command are used in all input and output files. The only exceptions are file formats for which there is a specific convention concerning the units. For example, trajectories written in .gro format (with DUMPATOMS) will always in nm.
Syntax
The following table describes the keywords and options that can be used with this action
Keyword | Type | Default | Description |
---|---|---|---|
LENGTH | optional | not used | the units of lengths |
ENERGY | optional | not used | the units of energy |
TIME | optional | not used | the units of time |
MASS | optional | not used | the units of masses |
CHARGE | optional | not used | the units of charges |
NATURAL | optional | false | use natural units |