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

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


From: Axel Kohlmeyer <akohlmey@...24...>
Date: Sun, 5 Nov 2017 06:04:32 -0500



On Sun, Nov 5, 2017 at 3:48 AM, htc <619771202@...1204...> wrote:
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.

​why don't you just use fix viscous?

axel.​

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

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
lammps-users mailing list
lammps-users@...6297....sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lammps-users




--
Dr. Axel Kohlmeyer  akohlmey@...12...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.