Modifying LAMMPS / accessing variable from another fix

Dear LAMMPS users,

We recently introduced EChemDID to equilibrate voltage during reactive MD (by adjusting the electronegativity used for charge equilibration).
The method is detailed in the JCP http://aip.scitation.org/doi/10.1063/1.4927562
I am working on updating our code to make it more consistent with latest LAMMPS versions and also trying to keep LAMMPS’s code untouched.

I noticed a new variable (chizj) in the recent version of QEq which is set to zero by default and, added to the electronegativity (chi) then used to optimize charges.
I don’t know why this (chizj) variable has been introduced but it looks to me as a variable to include an external potential to the QEq?

I have a fix_echemdid that equilibrates the voltage and I was thinking using chizj to pass the external potential to the QEq.
This would allow echemdid to work directly with QEq regardless of the potential (as long as there is a potential consistent with QEq).
However, I have hard time to access the chizj variable from my fix_echemdid class.

I would like to know

  • if I am proceeding the right way. Does it make sense to use chizj to pass an external potential?
  • if yes, what is the best way to access chizj from my echemdid class?

Thank you,
Nicolas

www.polyu.edu.hk/80anniversary

Disclaimer:

This message (including any attachments) contains confidential information intended for a specific individual and purpose. If you are not the intended recipient, you should delete this message and notify the sender and The Hong Kong Polytechnic University (the University) immediately. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited and may be unlawful.

The University specifically denies any responsibility for the accuracy or quality of information obtained through University E-mail Facilities. Any views and opinions expressed are only those of the author(s) and do not necessarily represent those of the University and the University accepts no liability whatsoever for any losses or damages incurred or caused to any party as a result of the use of such information.

Dear LAMMPS users,

We recently introduced EChemDID to equilibrate voltage during reactive MD
(by adjusting the electronegativity used for charge equilibration).
The method is detailed in the JCP http://aip.scitation.org/
doi/10.1063/1.4927562
I am working on updating our code to make it more consistent with latest
LAMMPS versions and also trying to keep LAMMPS's code untouched.

I noticed a new variable (chizj) in the recent version of QEq which is set
to zero by default and, added to the electronegativity (chi) then used to
optimize charges.
I don't know why this (chizj) variable has been introduced but it looks to
me as a variable to include an external potential to the QEq?

​according to the source code management system, the chizj pointer has been
included in the QEQ package based class since its inception in ​september
2014.
also, it is set and used in fix qeq/slater. it is not at all present in fix
qeq/reax of the USER-REAXC package.

I have a fix_echemdid that equilibrates the voltage and I was thinking
using chizj to pass the external potential to the QEq.
This would allow echemdid to work directly with QEq regardless of the
potential (as long as there is a potential consistent with QEq).
However, I have hard time to access the chizj variable from my
fix_echemdid class.

I would like to know
- if I am proceeding the right way. Does it make sense to use chizj to
pass an external potential?

​no.​

- if yes, what is the best way to access chizj from my echemdid class?

​the common way in LAMMPS to expose internal data to other classes without
having to know its particular type ​is through adding an "extract()" method
to the class holding the data and adding the corresponding code to it.

axel.