Hello
I am working on creating a Hybrid Monte Carlo (HMC) code in LAMMPS using C programming language for running a NPT system.
I have a working HMC code for a NVT system. I am trying to make it into a NPT system but am facing difficulty in passing the changed box length into lammps.
In HMC using python we are able to pass on variables from the code to lammps directly as shown below:
lmp.command(“change_box all x final 0.0 %.10f y final 0.0 .%10f z final 0.0 %.10f units box” % (box_new, box_new, box_new))
But I can’t find a similar command to use in C. In the LAMMPS documentation for C we have a similar command to above as
lammps_command(void *handle, const char *cmd)
where *handle is the loaded lammps instance and *cmd is the lammps command input we want to execute, Here the lammps command input given as argument should be a char string with lammps commands like “run 0” .So as you can see I cannot pass the box_new variable similar to the way done in python
The problem I face is that I want to pass a variable from the code box_new to lammps to change box dimensions. I tried writing the lammps_command in the syntax similar to the python lmp.command but it returned error saying lammps_command takes in only two arguments.
Basically I want a command equivalent to the lmp.command (used for python) I shared above for C.
I hope I have been able to explain my problem properly, if not please do ask.
Hope someone can help me regarding this.