I am doing dpd simulation. Here I define two groups for my simulation. I want to get the no of particles in first group as a constant in pair_dpd.cpp . I tried this
That i did in compute function. But i want to get as global constant . so that i should get that in each function. (Then it will do the calculation only once,Otherwise everytime it will call the function when the program runs)
The group->count() method does return the number of atoms in the group.
If you're adding code to LAMMPS, you can store it however you wish. There
are no global variables, but you can store it yourself in whatever class you
add it to.