LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
[lammps-users] about the commend "fix_langevin.cpp"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lammps-users] about the commend "fix_langevin.cpp"


From: "htc" <619771202@...1204...>
Date: Sun, 5 Nov 2017 16:48:34 +0800

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!!