Because of some reasons, i have to erase the random force in Langevin Dynamics .
what i want is to type a specific number just as “666” into the “seed” command,and when i type"666",the lammps will erase all the random force in Langevin Dynamic.
I found the orgin code as follows.
fix_langevin.cpp
78 seed = force->inumeric(FLERR,arg[6]);
if (t_period <= 0.0) error->all(FLERR,“Fix langevin period must be > 0.0”);
if (seed <= 0) error->all(FLERR,“Illegal fix langevin command”);
// initialize Marsaglia RNG with processor-unique seed
random = new RanMars(lmp,seed + comm->me);
540 fran[0] = gamma2*(random->uniform()-0.5);
fran[1] = gamma2*(random->uniform()-0.5);
fran[2] = gamma2*(random->uniform()-0.5);
i am a new learner of c++,and i guess i should add these codes?
if (seed==666)
random->uniform()=0.5??
how does the “-0.5” come from? And if it is complex to explain and will take you a long time ,it is ok not to explain.
Can you tell me how to modify the code ?
thanks a lot!!