This is a simple example using the Diffusion decorator to set the coordinates and translational diffusion coefficient of some particles
20 p0 = m.add_particle(
"diffusion0")
24 print(
"D automatically set to {:.2e} A^2/fs for radius {:.1f} A"
25 .format(d0.get_diffusion_coefficient(), xyzr0.get_radius()))
28 d0.set_diffusion_coefficient(d0.get_diffusion_coefficient()/2.0)
29 print(
"D reset to {:.2e} A^2/fs".format(d0.get_diffusion_coefficient()))
32 p1 = m.add_particle(
"diffusion1")
34 print(
"D explicitly set to {:.2e} A^2/fs for coordinates {} A"
35 .format(d1.get_diffusion_coefficient(), d1.get_coordinates()))