Issuing commands from within source modules

Hi Folks,

Are there any guidelines for issuing commands from within my own newly created source modules (.cpp files)? I haven’t been able to find what I’m looking for in the mailing-list archive or in the Developer Guide.

For example, because of the unusual way I’m manipulating my simulation after a certain number of steps or cycles, I want to issue the “velocity dna set 0.0 0.0 0.0 units box” command from within my source code, rather than doing it from an input script.

Basically, I’m trying to figure out what the correct syntax for issuing the command in my .cpp file should look like.

Any suggestions would be appreciated.

Thanks!

Hi Folks,

Are there any guidelines for issuing commands from within my own newly
created source modules (.cpp files)? I haven't been able to find what I'm
looking for in the mailing-list archive or in the Developer Guide.

For example, because of the unusual way I'm manipulating my simulation
after a certain number of steps or cycles, I want to issue the "velocity
dna set 0.0 0.0 0.0 units box" command from within my source code, rather
than doing it from an input script.

​why on earth would you want to go through the text interface. just insert
the few lines of code that are needed to set the velocities for a group of
atoms to zero​.

Basically, I'm trying to figure out what the correct syntax for issuing
the command in my .cpp file should look like.

​without knowing what you are doing in your added code, ​it is difficult to
make any specific suggestions, but ​it is rarely a good idea to issue
LAMMPS script commands from within a running simulation. because LAMMPS is
at the very core a distributed memory parallel program, those commands have
to make certain assumptions and often have to be followed by specific
operations that are not always available at all times during the process of
time integration. so unless you use the library interface, you need to be
extremely careful and better know what you are doing...

axel.