Skip to content

Drop TRZ reading forces, and change DL_Poly units #2393

Open
@lilyminium

Description

@lilyminium

MDAnalysis is supposed to have force units of kJ/mol.A.

DL_Poly

The DLPoly format seems to work in 10 J/mol.A :

Last but not least, it is worth pointing out that composite entities, such as velocities and forces, have their units expressed as composites of the default DL POLY units as shown in Section 1.3.7.

(manual: ftp://ftp.dl.ac.uk/ccp5/DL_POLY/DL_POLY_4.0/DOCUMENTS/USRMAN4.pdf)

Section 1.3.7:

Internally all DL POLY 4 subroutines and functions assume the use of the following defined molecular units:
• The unit of time (to) is 1 × 10−12 seconds (i.e. picoseconds)
The unit of length (lo) is 1 × 10−10 metres (i.e. ̊Angstroms)
• The unit of mass (mo) is 1.6605402 × 10−27 kilograms (i.e. Daltons - atomic mass units)
• The unit of charge (qo) is 1.60217733 × 10−19 Coulombs (i.e. electrons - units of proton charge)
The unit of energy (Eo = mo(lo/to)2) is 1.6605402 × 10−23 Joules (10 J mol−1)
• The unit of pressure (P = E l−3) is 1.6605402 × 107 Pascals (163.882576 atmospheres) ooo
• Planck’s constant ( ̄h) which is 6.350780668 × Eoto .

But the ConfigReader and HistoryReader don't appear to convert units.

if has_forces:
forces = np.array(forces, dtype=np.float32, order='F')

We probably need to change this to

     forces = np.array(forces, dtype=np.float32, order='F') /100

and write according tests.

TRZ (IBIsCO, YASP)

Similarly, IBIsCO trajectories have force units of kJ/mol.nm , but TRZParser doesn't seem to convert units. Edit: From discussion below, force-reading should be dropped. So we should remove considerations of force in the TRZReader, including below:

forces=self.has_force,

if self.has_force:
ts._forces[:, 0] = data['fx']
ts._forces[:, 1] = data['fy']
ts._forces[:, 2] = data['fz']

if not self.has_force:
frame_contents += [('pad7', '<i4')]
else:
frame_contents += [
('pad7', '<2i4'),
('fx', readarg),
('pad8', '<2i4'),
('fy', readarg),
('pad9', '<2i4'),
('fz', readarg),
('pad10', '<i4')]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions