LAMMPS Library Question

Hi again,

I’m currently trying to figure out exactly how the program flow proceeds in LAMMPS when the lammps_command(ptr, “run 0”) method is executed using the library interface.

I looked at the source files, and I see that it calls the input->one() method, which in turn calls input->execute_command(), but that method doesn’t seem to have a run action listed in its decision tree. Could someone point me to where this specific command branches so I can discover exactly what other functions, etc. get invoked along the way?

Thanks,
Thomas Allen

Hi again,

I'm currently trying to figure out exactly how the program flow proceeds in
LAMMPS when the lammps_command(ptr, "run 0") method is executed using the
library interface.

I looked at the source files, and I see that it calls the input->one()
method, which in turn calls input->execute_command(), but that method
doesn't seem to have a run action listed in its decision tree. Could someone
point me to where this specific command branches so I can discover exactly
what other functions, etc. get invoked along the way?

part of the magic happens due to this construct.

#define COMMAND_CLASS
#define CommandStyle(key,Class) \
  else if (strcmp(command,#key) == 0) { \
    Class key(lmp); \
    key.command(narg,arg); \
    return 0; \
  }
#include "style_command.h"
#undef COMMAND_CLASS

this includes additional commands that can be added at compile time
without changing a line of the remaining code. check this out:

[[email protected] src]$ grep CommandStyle *.h
balance.h:CommandStyle(balance,Balance)
change_box.h:CommandStyle(change_box,ChangeBox)
create_atoms.h:CommandStyle(create_atoms,CreateAtoms)
create_box.h:CommandStyle(create_box,CreateBox)
delete_atoms.h:CommandStyle(delete_atoms,DeleteAtoms)
delete_bonds.h:CommandStyle(delete_bonds,DeleteBonds)
displace_atoms.h:CommandStyle(displace_atoms,DisplaceAtoms)
group_ndx.h:CommandStyle(group2ndx,Group2Ndx)
minimize.h:CommandStyle(minimize,Minimize)
neb.h:CommandStyle(neb,NEB)
prd.h:CommandStyle(prd,PRD)
read_data.h:CommandStyle(read_data,ReadData)
read_dump.h:CommandStyle(read_dump,ReadDump)
read_restart.h:CommandStyle(read_restart,ReadRestart)
replicate.h:CommandStyle(replicate,Replicate)
rerun.h:CommandStyle(rerun,Rerun)
run.h:CommandStyle(run,Run)
set.h:CommandStyle(set,Set)
tad.h:CommandStyle(tad,TAD)
temper.h:CommandStyle(temper,Temper)
velocity.h:CommandStyle(velocity,Velocity)
write_data.h:CommandStyle(write_data,WriteData)
write_dump.h:CommandStyle(write_dump,WriteDump)
write_restart.h:CommandStyle(write_restart,WriteRestart)

there you see the run command.

axel.