Skip to content

Improper atom order incorrect in LAMMPS data writer for harmonic impropers? #899

Closed
@rsdefever

Description

@rsdefever

Bug summary

It appears that the atom ordering for harmonic impropers is incorrect in the LAMMPS data writer. Here is the code that writes the impropers. Note that the atoms are written so that the atom1.idx is written in the third position.

            # Dihedral data
            if impropers:
                data.write("\nImpropers\n\n")
                for i, improper in enumerate(impropers):
                    data.write(
                        "{:d}\t{:d}\t{:d}\t{:d}\t{:d}\t{:d}\n".format(
                            i + 1,
                            improper_types[i],
                            improper[2],
                            improper[1],
                            improper[0],
                            improper[3],
                        )
                    )

However, LAMMPS specifies that the central atom should be first see docs here, and parmed stores the central atom first see docs here.

Am I missing something, or are we reordering these atoms when we should not be.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions