Dear Lammps users,
I was wondering if there is a way to write down the energy and force values for angles and dihedrals that lammps calculate when we use the table style (with linear or spline method of interpolation) for these degrees of freedom.
Basically I am searching for a command similar to the pair_write or bond_write for angles and dihedrals.
Any help would be much appreciated,
the commands bond_write and pair_write depend on a “single()” function in the corresponding bond and pair styles that computes the interaction energy and forces for a single pair of particles at a particular distance. for angles, the “single()” function exists but only returns the energy and it is not based on a provided angle but requires indices of 3 specific atoms, to include the force and make it equivalent in functionality to the single functions in pair and bond styles, a new suitable API would need to be added and implementations need to be adjusted. for dihedrals (and impropers) a “single()” function does not even exist. Thus there currently cannot be an angle_write or dihedral_write command. Adding those functions would require modifying a significant chunk of LAMMPS, but it would be mostly busy work.
you can approximate the behavior of pair_write and bond_write by defining a system with fixed boundaries and just two atoms. then you can run a loop with “run 0 post no” commands and in between output (total) energy and force (on one of the particles) with print. for angles and dihedrals an equivalent procedure would be possible. it is probably
easier to implement through the python interface and do the looping and output in python.