LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] Run one atom under "addforce"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] Run one atom under "addforce"


From: Axel Kohlmeyer <akohlmey@...24...>
Date: Tue, 22 Aug 2017 16:58:27 -0400



On Tue, Aug 22, 2017 at 4:57 PM, Zheng, Xuechen <xuechen_zheng@...802...> wrote:
Thank you! I tried to use it and it told me that " ERROR: Replacing a fix, but new style != old style."

http://lammps.sandia.gov/doc/Section_errors.html
 

On Tue, Aug 22, 2017 at 4:52 PM, Michał Kański <michal.kanski@...2460...> wrote:
You need fix nve or similar.

Michal

From: Zheng, Xuechen
Sent: ‎2017-‎08-‎22 22:48
To: lammps-users@...655....net
Subject: [lammps-users] Run one atom under "addforce"


Dear all.

   I set one atom and give it an initial velocity, I tried to make it move according to "fix addforce" The fx, fy, fz will change according to the coordinate. However, when I tried to run it, the coordinate and velocity will not change and the atom is always at the initial position in the output file. I have no idea where is the problem.Could you please help me with it? 
   Thanks!


--
Xuechen Zheng

# 3D Gay Berne on Surface simulation

units                real
atom_style           ellipsoid
dimension            3
boundary             p p f 
atom_modify          id yes

atom_modify          map array


atom_modify          sort 100 25
lattice              fcc 5.0
region               box block 0.0 5.0 0.0 5.0 0.0 5.0
create_box           1 box
create_atoms         1 single 2 2 2 

set                  type 1 mass 16.04
set                  type 1 shape 1 1 1
velocity             all set 0.001 0.0053 -0.008
set                  group all quat/random 18238


compute              rot all temp/asphere
group                spheroid type 1
variable             dof equal count(spheroid)+2

compute_modify       rot extra ${dof}



neighbor     3.0 bin

neigh_modify     delay 0 every 1

timestep             0.0002

variable             z_atom atom z

variable             x_atom atom x

variable             y_atom atom y



# Get Constants of the Energy That Don't Change Upon Taking Directional Derivatives

variable         energy_x atom (1.47025e-06*v_x_atom^4+-0.000598126*v_x_atom^2+0.0156679+0.00012389*v_x_atom^3+-0.0128309*v_x_atom)*sin(1.04344*v_x_atom)+-1098.47+sin(-10.7193*v_x_atom+0.464616)*0.000818385+0.24923*cos(0.0319159*v_x_atom+0.106606)

variable         energy_y atom (1.47025e-06*v_y_atom^4+-0.000598126*v_y_atom^2+0.0156679+0.00012389*v_y_atom^3+-0.0128309*v_y_atom)*sin(1.04344*v_y_atom)+-1098.47+sin(-10.7193*v_y_atom+0.464616)*0.000818385+0.24923*cos(0.0319159*v_y_atom+0.106606)

variable         energy_z atom 6602.67*exp(-2.41063*v_z_atom)-176.047*v_z_atom^(-3)-1829.08*v_z_atom^(-6)+2866.59*v_z_atom^(-8)    

variable         energy_total atom v_energy_x*v_energy_y*v_energy_z



#Trans Forces

#(-5.881*10^(-6)*x**3+1.19624*10**(-3)*x-3.7167*10**(-4)*x**2+.0128309)*sin(1.04344*x)+(-1.47025*10**(-6)*x**(4)+.00059812*x**2-.0156679-.00012399*x**3+.0128309*x)*1.04344*cos(1.04344*x)+8.772139*10**(-3)*cos(-10.7193*x+.464616)+7.954399*10**(-3)*sin(.0319159*x+.106606)


variable        fx_2 atom v_energy_y*v_energy_z*(-5.881*10^(-6)*v_x_atom^3+1.19624*10^(-3)*v_x_atom-3.7167*10^(-4)*v_x_atom^2+.0128309)*sin(1.04344*v_x_atom)+(-1.47025*10^(-6)*v_x_atom^(4)+.00059812*v_x_atom^2-.0156679-.00012399*v_x_atom^3+.0128309*v_x_atom)*1.04344*cos(1.04344*v_x_atom)+8.772139*10^(-3)*cos(-10.713*v_x_atom+.464616)+7.954399*10^(-3)*sin(.0319159*v_x_atom+.106606)    


variable        fy_2 atom v_energy_x*v_energy_z*(-5.881*10^(-6)*v_y_atom^3+1.19624*10^(-3)*v_y_atom-3.7167*10^(-4)*v_y_atom^2+.0128309)*sin(1.04344*v_y_atom)+(-1.47025*10^(-6)*v_y_atom^(4)+.00059812*v_y_atom^2-.0156679-.00012399*v_y_atom^3+.0128309*v_y_atom)*1.04344*cos(1.04344*v_y_atom)+8.772139*10^(-3)*cos(-10.7193*v_y_atom+.464616)+7.954399*10^(-3)*sin(.0319159*v_y_atom+.106606)


#Perp Forces


#Force Methane Perp: 15917*e(-2.41063*x)-528.14*x**(-4)+10974*x**(-7)+22932.7*x**(-9) 


variable         fz_2 atom  v_energy_x*v_energy_y*15917.0*exp(-2.41063*v_z_atom)-528.14*v_z_atom^(-4)+10974*v_z_atom^(-7)+22932.7*v_z_atom^(-9)
 


#Add Forces

fix              1 all addforce v_fx_2 v_fy_2 v_fz_2 energy v_energy_total 


#fix              1 all setforce v_fx_2 v_fy_2 v_fz_2 energy v_energy_total 



compute          q all property/atom quatw quati quatj quatk


compute          ken all ke/atom
compute          pot all pe/atom
  

dump             1 all custom 100000 dump.ellipse.gayberne &
             id type x y z c_q[1] c_q[2] c_q[3] c_q[4]


dump 2 all image 100000 image.*.jpg type type adiam 1.2

dump_modify 2 pad 5


dump             4 all custom 100000 dump.force.test &
             id v_fx_2 v_fy_2 v_fz_2 v_energy_x v_energy_y v_energy_z 

dump             5 all custom 100000 dump.x.test &
             id x c_ken c_pot x y z vx vy vz 
                  

#dump 3 all movie 1000 movie.mpg type type adiam 1.2

#dump_modify 3 pad 5


thermo 10000


#thermo_style     custom step temp ke pe etotal press vol


run 50000000



--
Xuechen Zheng


------------------------------------------------------------------------------
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@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.