diff -Naur lammps-10Nov09/doc/Eqs/fix_wall_colloid.jpg lammps-11Nov09/doc/Eqs/fix_wall_colloid.jpg --- lammps-10Nov09/doc/Eqs/fix_wall_colloid.jpg 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/doc/Eqs/fix_wall_colloid.jpg 2009-11-06 15:16:55.000000000 -0700 @@ -0,0 +1,50 @@ +JFIFHHC  !"$"$ t&G +!"1A2Qa#$BWqu357RSrUbstv?˥)JR)JR)JR)JR)JR)JR)JR)JR)JR)JRWj{ؚjyx ]{m3gYܺJ…%eB +p0Jd{y^u[ά!T@&ncSFlDr;2qP)t()9BBI8ŽU5.ۜ(q +۔ri_v + $+k:oa.\b7PۅA +PF B95>qu })I*I)RT)P @"RnrM* TPV>Ǻ=ȮzkvqieneJJG̐=63Zl:4퓀JsXҔek:oa.\b7PۅA +PF B95>qu })I*I)RT)P @"R;u11ӐvB7|;^.KD";\RFĞvJ$W[UtvK0aZ۬2P +H#HU:~.oσ")pۑKVKnX=BpR@)JR)JR)JR)JR)JRWUwa<N78@ʎ5`%hJРe* g]h__dX4o%Ib lmxbJ+ 8ut^lם` Wes ſVCmy$-iU#ji+)*Yyx&E1/7ɋF+xqyZG޵$}+GYӚ^di=qoyq|Ե,rk+Ҳ.Z]"e㨞<<$>~7Gz Aܙn *2f:9ˣޮ.lKuuZOCp|\SlCdZ L8).1cPف1L| s/ +6 +qHP/QsPjۙ/]v-!C_TԍkC:Ktj +XKE,HYH$S*V|d\&ՋDѷQ򾕹+Pt3Q$\˖a.9T@8Ay',m㎔ '{*V2O׺fÒܦ%+nemPZY=Q:^i缈sInL}ذ-';w|@\qP|once~hqDpo:HuNuݑݡc';% +<>t:)w$x +sʖr@JGT@$2HOo14ܻF;P8L1%)M%kXР0Q}oG#w(he$$$f*~( +J)|@><^iM,%Ce' >꡷h5қDk{gf#q{)Dɭ +@JBR`JU5K3$KM)-(ghq PKd0ճ@&܂+c[m>BVۨBNyT1 !.l fqSjZ޵퐮p݋1ӛT7!@FG?~~4g(O?K?F3o֫ѽ3j-;dM 2EC̣};]+uNVRBZ/E%Mލ݌̷0Ͳ*5(RAJh(At:W!$Y ڰ>,3zw?}-8@ZĝYV7 Y4џGo"r9цS ʇ緃Q7ޞt~n39m3iM(%ӒR֔2j Etv=+ZJRaҴ'skII'M47ӹz3܍9(-(dˆF@mW3醑K.uvPZ/ 8*l, +<^ ʹ:b.="vvSkQIPq\5e] +"tg{Bsܡ_C>ZԵ<(J6I'խlDtHv2$JR)JR)JR)JR)JPH$ARk?cEuiҮ j0^}™CBBYl]OQ[W{$i;\ !!ڜ\PK e3(׾36uk%"NLӷWK .5qZHcgReRy6 zd4-Ȗ8%)[d&u2;6Kn H.?Hm A*hkKؓcCmi +I*3v\:7(mӖjuԥ&D9N J"sqb2ԉlnUԗRP!/ Za '*NJdVC5q[eK@J-)NQʏԚ)X%JeNۚ%|(cҫMfXژ2u Z;Cr]CN mkV}+Qީ*кtٺøH +oSym(vVQ!0wq}#<}k%~-> xzn8KUK˻B^{-nIP)ړ6GFn:X"&\Lf~ёq Îf3}Ĥ*QQ;r ]'vuE}&׈_>YrB$'vݩCN8>=\"qJڂ;8Ϻs5ָ7;&.ICJBXiOw!kV_(7[-I7rzV+uJR)JR)JR)JR)JR)T [`ݕ.!kiIH$rxygFS3mk ) [*Z;KZq99陴)YjdͰ j/J9Jؠ6)JR쭗C8i*I ChG&Bf*{L)Z!*$O95>,0+[BF%%E)'ԀT5ҔVwY.w"3X)[l򧁀=wqeY7iL%a+qy׃9=)JR)JR)JR)JR)JR9ZAIFy%IYt-Ao|UmR }Igrw dflT\KE\lfd<\ T䖗0 ^k 5BE#HAK?-BIVxN REgE!2fGFR8RT39<][2/1Saˁ"RyR)Cpmbڹ}-# SeM(%E*NGP b3&$') +ZYl% O* kL-+ mL2[@J;(PJԤd yw)єLZWł[p|Ҭ(gPSWؕQ^m@q[PR29Un+o¤> +ؑ@Q?L j4M\me êPiW''9)[WH1Gv$u8'jw7q2C +F#6KGml$0véA  2CFl9!AZ[ +qA J Jr}ʈ{tY +Lv,BnPlL袯.N˝Z,klvR/*cϝ -nܴlmG>Fyp_vgmfARy-(iT/nrRRpr q:ȍ!˭(e*Aޛm]X?jEʻw)ʲx8Uq!1!=)HRee))2yQHݻ\kv]=d"So 48)''PrHRcJ+\ȶKPi,-IIA88'7[LD?$]y6:'$D-]"tYʐ3#B#)EלKm)I*Pߙ) +TbAC< R6ӂFHJm\Ėˑm'#(GT{ŘJCE_qiN7 pԀcۖ7k !V[QJCv*JB8S[U{~c -%K(%jR +2H=f\mЏ BPp|†p|P5M;UHkE1-MKF[aJqpKyܡR@Luk0e.uh. (*nǭSiYO^ބ2]Li1t-dG*)JR)JR)JtW;ܝի;ӛ +g8K 3"GӖHZ:NC djmyW7AgI_P|n,8YqMIHWm*H|ڜv Ԯ@>.ZCn D)R ӘW!%W\햫-KCM3lwUG1'*YrIʏ#5_b- Jۊ1쵟Ro]*sQCOĀJ_ϐ +fZ 7Vj#gy70gYu6wÐ%xRe~\p;cjT{s=Mh.mvJj<,(8%bRQw0񿏟Zy\Ry*l倅qk;ҧ.'a/ň>NjJS)@5Wּ\a"Vo<}c&[|#λN_6!n%ut8"Gd#y8m!#Ԃ Ԏ[E@ {y6}slk]ϑ<[7%P" 񴭗V?կJbT;梸z+Ÿ7X 5E +\Sâ!ŪwtIG,Ly+*[yNJ:;Re1bSqDvaI#!ϭv蔘Wm>Z{&R%5C2G6P<; -(6^j>Ga8}l#5L[QPJ Wi#~i]N-RWsCj.U4U8}x-@Dn-}S*I5êћ{AQie&45Ϩ~j^ĎTmn\ډ$Sw%6Tzԭ!zO%9{x?W:kra-ζ;QiےjqLȂ +څdQŷn _yd($`S8ξߪZMWIϢck?dCһTꆟ.q!  +aG@o?F3o,a +Ͽʳ9rl!BKFsޤQPvy뫖=r6]a.JXwb%BpHBNP3+zn3QMv2&uWmյ%+yd$6A$jT{s=Mh.mvJj<,(8%bRQw0񿏟ShZe HRUf2죊褂ޕsLY(䖚!Q8~}%l7%hJR)JR)JRSnluMjKl$#. !*8M!]"kVM#4kZS +Cm')GLH%au}(XcsI}b/RMCv;pu ڲed' +* = nQHkuӊb|H%$ q!y-oZ}t^Z7-q7.ء#r z^ɕ\u^a\DRIIVSRxH +hKnɝN+;/ъZWmdN=\H&^=}"["`F5#(aގBBR2\$N)sOeHhۯ]!h*oHa3ه- [Br}NjyҦ5]Jˇtitw/.mKo*F(fяC0C-aӨť7ٹBFFY~:YKџcG/WbgQcHz8q. 粐Cr*Gc77_i闏wOݿ~9sLDߧKxaںK̠KJc['5zdy̆JQ*t:Zy#$ԫQAfB[[ +:#~JPWp=jHkN,6F:nmx^"[Rd@㚚iДI՝7 } ,!괍(5".F:4E9nQ!bБ+"#q~gOK?Iz3o~p@В80_DZW\z$ HVyK 8n!0P1Umc,bYm"d+msJVVds+!;SioSU]_jR=|2 >AҾJR)JR+'5߬42> YaJڴyi?30eż͍WÀOBU A)CnUE^zj6HKq(S:edjݷd.zB#R! Qm2CKJ+%*m8V9ikME-ZpDfcv@Zr=+&E)zJҚJ9rqDZ?ŒqmN!ImD%#p8HΨ}on78vR쩠KJA7y#,u5 XCwB֦H!( +#cdǴkt%XȷxHf,J D@ +8 [Y>)JR)JRެ2jBiopVMF=aT* nkfu;S@aTC/?5v +Yj..KCkpq$:@%XY[[47>K2d uKIWTzJYiZuszuA㽤6[KM'WђdןTVͻ,4Qs6ITJpIW)JR+ֽ>(aMTy-cܨ$W5kN_#4[Tm`-$osjW )n! ~`]YKԝ9ZmwSYPu۸U:n}IpܖHZAA*R)JR+mk{ooXۃ߳R]u䒌 >İ\.Mx*heQm$8ߔDT5wFMX`NyVmqaN:^ %A9J/Sݷ͍xzG-lDp %k )*ۻjIP-Q-vKbLX,`h@B1GQY%nI\d~:itn3ô\' Jʏs_<^udFj{}p*nSME$cqZRe$ Gu9%Sw͗$2k,pV +HVJN몲bC VqڋPBN=pq=+qJR)JRyu4uiChIR=I>±=ani9:n[p{.c?Z_"V)JR)JR)JR4ݖ]rf; #> jQ9R0A)JR)JRVlkjԇ ,e#nQ*?5(sSiJR +u4e޳ ju6w +vT8@"m)JR)JRGlYj!\=ǘS@Qy9iǒ6hR*>Gҩ WS.a%-ERNZ'}JR)JR)JR)JR)JR)JR)JR)JR)JR)JR)JR)JR)JR)JR)JR)JR)JR)JR)JR \ No newline at end of file diff -Naur lammps-10Nov09/doc/Eqs/fix_wall_colloid.tex lammps-11Nov09/doc/Eqs/fix_wall_colloid.tex --- lammps-10Nov09/doc/Eqs/fix_wall_colloid.tex 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/doc/Eqs/fix_wall_colloid.tex 2009-11-06 15:16:55.000000000 -0700 @@ -0,0 +1,14 @@ +\documentstyle[12pt]{article} + +\begin{document} + +\begin{eqnarray} +E &=& 144 \phi^2 \epsilon \left[ \frac{\sigma^{6}}{7560} + \left(\frac{D-6R}{D^{7}} + \frac{D+8R}{(D+2R)^{7}} \right) - + \frac{}{} \right. \nonumber \\ + &&\qquad \left. \frac{1}{6} \left(\frac{2R(D+R) + D(D+2R) + \left[ \ln D - \ln (D+2R) \right]}{D(D+2R)} \right) \right] +\qquad r < r_c \nonumber +\end{eqnarray} + +\end{document} diff -Naur lammps-10Nov09/doc/Eqs/pair_colloid_cc.tex lammps-11Nov09/doc/Eqs/pair_colloid_cc.tex --- lammps-10Nov09/doc/Eqs/pair_colloid_cc.tex 2007-10-22 16:21:44.000000000 -0600 +++ lammps-11Nov09/doc/Eqs/pair_colloid_cc.tex 2009-11-06 15:16:55.000000000 -0700 @@ -4,25 +4,25 @@ \begin{eqnarray} U_A &=& - \frac{A_{cc}}{6} \left[ - \frac{2 a_1 a_2}{r^2-\left(a_1+a_2\right)^2} - + \frac{2 a_1 a_2}{r^2 - \left(a_1 - a_2\right)^2} - + \mathrm{ln} - \left( - \frac{r^2-\left(a_1+a_2\right)^2}{r^2-\left(a_1-a_2\right)^2} - \right) -\right] \nonumber \\ + \frac{2 a_1 a_2}{r^2-\left(a_1+a_2\right)^2} + + \frac{2 a_1 a_2}{r^2 - \left(a_1 - a_2\right)^2} + + \mathrm{ln} + \left( + \frac{r^2-\left(a_1+a_2\right)^2}{r^2-\left(a_1-a_2\right)^2} + \right) + \right] \nonumber \\ \nonumber \\ U_R &=& \frac{A_{cc}}{37800} \frac{\sigma^6}{r} \left[ \frac{}{} \right. \nonumber \\ - &&\qquad \frac{r^2-7r\left(a_1+a_2\right)+6\left(a_1^2+7a_1a_2+a_2^2\right)} - {\left(r-a_1-a_2\right)^7} \nonumber \\ - &&\qquad +\frac{r^2+7r\left(a_1+a_2\right)+6\left(a_1^2+7a_1a_2+a_2^2\right)} - {\left(r+a_1+a_2\right)^7} \nonumber \\ - &&\qquad -\frac{r^2+7r\left(a_1-a_2\right)+6\left(a_1^2-7a_1a_2+a_2^2\right)} - {\left(r+a_1-a_2\right)^7} \nonumber \\ - &&\qquad \left. -\frac{r^2-7r\left(a_1-a_2\right)+6\left(a_1^2-7a_1a_2+a_2^2\right)} - {\left(r-a_1+a_2\right)^7} -\right] \nonumber \\ + &&\qquad \frac{r^2-7r\left(a_1+a_2\right)+6\left(a_1^2+7a_1a_2+a_2^2\right)} + {\left(r-a_1-a_2\right)^7} \nonumber \\ + &&\qquad +\frac{r^2+7r\left(a_1+a_2\right)+6\left(a_1^2+7a_1a_2+a_2^2\right)} + {\left(r+a_1+a_2\right)^7} \nonumber \\ + &&\qquad -\frac{r^2+7r\left(a_1-a_2\right)+6\left(a_1^2-7a_1a_2+a_2^2\right)} + {\left(r+a_1-a_2\right)^7} \nonumber \\ + &&\qquad \left. -\frac{r^2-7r\left(a_1-a_2\right)+6\left(a_1^2-7a_1a_2+a_2^2\right)} + {\left(r-a_1+a_2\right)^7} + \right] \nonumber \\ \nonumber \\ U &=& U_A + U_R, \qquad r < r_c \nonumber \end{eqnarray} diff -Naur lammps-10Nov09/doc/Eqs/pair_yukawa.tex lammps-11Nov09/doc/Eqs/pair_yukawa.tex --- lammps-10Nov09/doc/Eqs/pair_yukawa.tex 2006-09-21 10:22:34.000000000 -0600 +++ lammps-11Nov09/doc/Eqs/pair_yukawa.tex 2009-11-06 14:01:28.000000000 -0700 @@ -6,4 +6,4 @@ E = A \frac{e^{- \kappa r}}{r} \qquad r < r_c $$ -\end{document} \ No newline at end of file +\end{document} diff -Naur lammps-10Nov09/doc/Eqs/pair_yukawa_colloid.jpg lammps-11Nov09/doc/Eqs/pair_yukawa_colloid.jpg --- lammps-10Nov09/doc/Eqs/pair_yukawa_colloid.jpg 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/doc/Eqs/pair_yukawa_colloid.jpg 2009-11-06 14:01:28.000000000 -0700 @@ -0,0 +1,2 @@ +JFIFHHC  !"$"$ ?5 !1"AQa2q#$4BUb?m aǨ؜ּi-pZ~ejËO~vB^L$c8+hV{1NqamKcl`!cJE Vjz,`z |7WUH#'drI ;@ȋ G^3#qZT橾L '5aRcz,NND3alCG`Oz91 ߱'Ux~eSyI`ks#s';-.Qt@$|מt3/_-֙|M]LE5s#&l4.ӧ1~.).`l>#HH'Ř2~c..L-G4lMcycv !(v%Mlqwk]}+u]bkoﵔEAd(`۫:/?aC`l߿썍?P;g{Xb`F^5 N J)]?=SdrU+,Z6i͎n_"CSce '|2~a+cs=+J:82ظqR`hl2Z-e*Gf"2WR]+G&|p^W'..Tqif%2׵|?nlYOշ xf'^ˋ{#]#P"ffj1\NGTbKj&2f䤩a3g(8C$whvDDDDDDDDE  sDrdip~1EMlkGDDEQS5f)7\⑲FӯQne\cZ7 \ No newline at end of file diff -Naur lammps-10Nov09/doc/Eqs/pair_yukawa_colloid.tex lammps-11Nov09/doc/Eqs/pair_yukawa_colloid.tex --- lammps-10Nov09/doc/Eqs/pair_yukawa_colloid.tex 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/doc/Eqs/pair_yukawa_colloid.tex 2009-11-06 14:01:28.000000000 -0700 @@ -0,0 +1,9 @@ +\documentclass[12pt]{article} + +\begin{document} + +$$ + E = \frac{A}{\kappa} e^{- \kappa (r - (r_i + r_j))} \qquad r < r_c +$$ + +\end{document} diff -Naur lammps-10Nov09/doc/Section_commands.html lammps-11Nov09/doc/Section_commands.html --- lammps-10Nov09/doc/Section_commands.html 2009-11-06 10:05:06.000000000 -0700 +++ lammps-11Nov09/doc/Section_commands.html 2009-11-06 14:01:28.000000000 -0700 @@ -327,8 +327,8 @@ nve/aspherenve/limitnve/noforcenve/spherenvtnvt/aspherenvt/sllodnvt/sphere orient/fccplaneforcepoemspourpress/berendsenprintrdfreax/bonds recenterrigidsetforceshakespringspring/rgspring/selftemp/berendsen -temp/rescalethermal/conductivitytmdttmviscosityviscouswall/granwall/lj126 -wall/lj93wall/reflectwiggle +temp/rescalethermal/conductivitytmdttmviscosityviscouswall/colloidwall/gran +wall/lj126wall/lj93wall/reflectwiggle

These are fix styles contributed by users, which can be used if @@ -382,7 +382,7 @@ lj96/cutlubricatemeammorse morse/optperi/pmbreaxresquared softswtabletersoff -tersoff/zblyukawa +tersoff/zblyukawayukawa/colloid

These are pair styles contributed by users, which can be used if diff -Naur lammps-10Nov09/doc/Section_commands.txt lammps-11Nov09/doc/Section_commands.txt --- lammps-10Nov09/doc/Section_commands.txt 2009-11-06 10:05:06.000000000 -0700 +++ lammps-11Nov09/doc/Section_commands.txt 2009-11-06 14:01:28.000000000 -0700 @@ -441,6 +441,7 @@ "ttm"_fix_ttm.html, "viscosity"_fix_viscosity.html, "viscous"_fix_viscous.html, +"wall/colloid"_fix_wall_colloid.html, "wall/gran"_fix_wall_gran.html, "wall/lj126"_fix_wall_lj126.html, "wall/lj93"_fix_wall_lj93.html, @@ -558,7 +559,8 @@ "table"_pair_table.html, "tersoff"_pair_tersoff.html, "tersoff/zbl"_pair_tersoff_zbl.html, -"yukawa"_pair_yukawa.html :tb(c=4,ea=c) +"yukawa"_pair_yukawa.html +"yukawa/colloid"_pair_yukawa_colloid.html :tb(c=4,ea=c) These are pair styles contributed by users, which can be used if "LAMMPS is built with the appropriate package"_Section_start.html#2_3. diff -Naur lammps-10Nov09/doc/Section_start.html lammps-11Nov09/doc/Section_start.html --- lammps-10Nov09/doc/Section_start.html 2009-10-29 16:04:06.000000000 -0600 +++ lammps-11Nov09/doc/Section_start.html 2009-11-06 10:12:08.000000000 -0700 @@ -361,6 +361,7 @@ colloid colloidal particle force fields dipole point dipole particles and force fields dpd dissipative particle dynamics (DPD) force field +dsmc Direct Simulation Monte Carlo (DMSC) pair style gpu GPU-enabled force field styles granular force fields and boundary conditions for granular systems kspace long-range Ewald and particle-mesh (PPPM) solvers @@ -370,6 +371,7 @@ opt optimized versions of a few pair potentials peri Peridynamics model and potential poems coupled rigid body motion +prd parallel replica dynamics reax ReaxFF potential xtc dump atom snapshots in XTC format diff -Naur lammps-10Nov09/doc/Section_start.txt lammps-11Nov09/doc/Section_start.txt --- lammps-10Nov09/doc/Section_start.txt 2009-10-29 16:04:06.000000000 -0600 +++ lammps-11Nov09/doc/Section_start.txt 2009-11-06 10:12:08.000000000 -0700 @@ -355,6 +355,7 @@ colloid : colloidal particle force fields dipole : point dipole particles and force fields dpd : dissipative particle dynamics (DPD) force field +dsmc : Direct Simulation Monte Carlo (DMSC) pair style gpu : GPU-enabled force field styles granular : force fields and boundary conditions for granular systems kspace : long-range Ewald and particle-mesh (PPPM) solvers @@ -364,6 +365,7 @@ opt : optimized versions of a few pair potentials peri : Peridynamics model and potential poems : coupled rigid body motion +prd : parallel replica dynamics reax : ReaxFF potential xtc : dump atom snapshots in XTC format :tb(s=:) diff -Naur lammps-10Nov09/doc/atom_style.html lammps-11Nov09/doc/atom_style.html --- lammps-10Nov09/doc/atom_style.html 2009-06-30 08:49:39.000000000 -0600 +++ lammps-11Nov09/doc/atom_style.html 2009-11-06 14:01:28.000000000 -0700 @@ -15,7 +15,7 @@

atom_style style args 
 
-
  • style = angle or atomic or bond or charge or dipole or dpd or ellipsoid or full or granular or molecular or peri or hybrid +
    • style = angle or atomic or bond or charge or colloid or dipole or dpd or ellipsoid or full or granular or molecular or peri or hybrid
      args = none for any style except hybrid
       hybrid args = list of one or more sub-styles 
    @@ -57,33 +57,40 @@
     atomic  only the default values  coarse-grain liquids, solids, metals 
     bond  bonds  bead-spring polymers 
     charge  charge  atomic system with charges 
    +colloid  angular velocity  extended spherical particles 
     dipole  charge and dipole moment  atomic system with dipoles 
     dpd  default values, also communicates velocities  DPD models 
    -ellipsoid  quaternion for particle orientation, angular momentum  aspherical particles 
    +ellipsoid  quaternion for particle orientation, angular momentum  extended aspherical particles 
     full  molecular + charge  bio-molecules 
     granular  diameter, density, angular velocity  granular models 
     molecular  bonds, angles, dihedrals, impropers  uncharged molecules 
     peri  density, volume  mesocopic Peridynamic models 
     
     
    -

    All of the styles define point particles, except the ellipsoid and -granular and peri styles. These define finite-size particles. -For ellipsoidal systems, the shape command is used to -specify the size and shape of particles, which can be spherical or -aspherical. For granular systems, the particles are spherical and -each has a specified diameter. For peri systems, the particles are -spherical and each has a specified volume. +

    All of the styles define point particles, except the colloid, +dipole, ellipsoid, granular, and peri styles. These define +finite-size particles. For colloid, dipole, and ellipsoid +systems, the shape command is used to specify the size +and shape of particles on a per-type basis, which is spherical for +colloid and dipole particles and spherical or aspherical for +ellipsoid particles. For granular systems, the particles are +spherical and each has a per-particle specified diameter. For peri +systems, the particles are spherical and each has a per-particle +specified volume.

    All of the styles assign mass to particles on a per-type basis, using -the mass command, except the granular and peri styles. -For granular systems, the specified diameter and density are used to -calculate each particle's mass. For peri systems, the speficied -volume and density are used to calculate each particle's mass. -

    -

    Only the dpd and granular styles communicate velocities with ghost -atoms; the others do not. This is because the pairwise interactions -calculated by the pair_style dpd and pair_style -granular commands require velocities. +the mass command, except the granular and peri styles +which assign mass on a per-particle basis. For granular systems, +the specified diameter and density are used to calculate each +particle's mass. For peri systems, the speficied volume and density +are used to calculate each particle's mass. +

    +

    Only the colloid, dpd, and granular styles communicate +velocities and angular velocities (if defined) with ghost atoms; the +others do not. This is because the pairwise interactions calculated +by the pair styles that typically use these atom styles +(e.g. pair_style dpd and pair_style +granular) require velocities of both particles.


    @@ -111,12 +118,13 @@

    The angle, bond, full, and molecular styles are part of the "molecular" package. The granular style is part of the "granular" -package. The dpd style is part of the "dpd" package. The dipole -style is part of the "dipole" package. The ellipsoid style is part -of the "asphere" package. The peri style is part of the "peri" -package for Peridynamics. They are only enabled if LAMMPS was built -with that package. See the Making LAMMPS -section for more info. +package. The dpd style is part of the "dpd" package. The colloid +style is part of the "colloid" package. The dipole style is part of +the "dipole" package. The ellipsoid style is part of the "asphere" +package. The peri style is part of the "peri" package for +Peridynamics. They are only enabled if LAMMPS was built with that +package. See the Making LAMMPS section for +more info.

    Related commands:

    diff -Naur lammps-10Nov09/doc/atom_style.txt lammps-11Nov09/doc/atom_style.txt --- lammps-10Nov09/doc/atom_style.txt 2009-06-30 08:49:39.000000000 -0600 +++ lammps-11Nov09/doc/atom_style.txt 2009-11-06 14:01:28.000000000 -0700 @@ -12,7 +12,7 @@ atom_style style args :pre -style = {angle} or {atomic} or {bond} or {charge} or {dipole} or \ +style = {angle} or {atomic} or {bond} or {charge} or {colloid} or {dipole} or \ {dpd} or {ellipsoid} or {full} or {granular} or {molecular} or \ {peri} or {hybrid} :ul args = none for any style except {hybrid} @@ -54,32 +54,39 @@ {atomic} | only the default values | coarse-grain liquids, solids, metals | {bond} | bonds | bead-spring polymers | {charge} | charge | atomic system with charges | +{colloid} | angular velocity | extended spherical particles | {dipole} | charge and dipole moment | atomic system with dipoles | {dpd} | default values, also communicates velocities | DPD models | -{ellipsoid} | quaternion for particle orientation, angular momentum | aspherical particles | +{ellipsoid} | quaternion for particle orientation, angular momentum | extended aspherical particles | {full} | molecular + charge | bio-molecules | {granular} | diameter, density, angular velocity | granular models | {molecular} | bonds, angles, dihedrals, impropers | uncharged molecules | {peri} | density, volume | mesocopic Peridynamic models :tb(c=3,s=|) -All of the styles define point particles, except the {ellipsoid} and -{granular} and {peri} styles. These define finite-size particles. -For {ellipsoidal} systems, the "shape"_shape.html command is used to -specify the size and shape of particles, which can be spherical or -aspherical. For {granular} systems, the particles are spherical and -each has a specified diameter. For {peri} systems, the particles are -spherical and each has a specified volume. +All of the styles define point particles, except the {colloid}, +{dipole}, {ellipsoid}, {granular}, and {peri} styles. These define +finite-size particles. For {colloid}, {dipole}, and {ellipsoid} +systems, the "shape"_shape.html command is used to specify the size +and shape of particles on a per-type basis, which is spherical for +{colloid} and {dipole} particles and spherical or aspherical for +{ellipsoid} particles. For {granular} systems, the particles are +spherical and each has a per-particle specified diameter. For {peri} +systems, the particles are spherical and each has a per-particle +specified volume. All of the styles assign mass to particles on a per-type basis, using -the "mass"_mass.html command, except the {granular} and {peri} styles. -For {granular} systems, the specified diameter and density are used to -calculate each particle's mass. For {peri} systems, the speficied -volume and density are used to calculate each particle's mass. - -Only the {dpd} and {granular} styles communicate velocities with ghost -atoms; the others do not. This is because the pairwise interactions -calculated by the "pair_style dpd"_pair_dpd.html and "pair_style -granular"_pair_gran.html commands require velocities. +the "mass"_mass.html command, except the {granular} and {peri} styles +which assign mass on a per-particle basis. For {granular} systems, +the specified diameter and density are used to calculate each +particle's mass. For {peri} systems, the speficied volume and density +are used to calculate each particle's mass. + +Only the {colloid}, {dpd}, and {granular} styles communicate +velocities and angular velocities (if defined) with ghost atoms; the +others do not. This is because the pairwise interactions calculated +by the pair styles that typically use these atom styles +(e.g. "pair_style dpd"_pair_dpd.html and "pair_style +granular"_pair_gran.html) require velocities of both particles. :line @@ -107,12 +114,13 @@ The {angle}, {bond}, {full}, and {molecular} styles are part of the "molecular" package. The {granular} style is part of the "granular" -package. The {dpd} style is part of the "dpd" package. The {dipole} -style is part of the "dipole" package. The {ellipsoid} style is part -of the "asphere" package. The {peri} style is part of the "peri" -package for Peridynamics. They are only enabled if LAMMPS was built -with that package. See the "Making LAMMPS"_Section_start.html#2_3 -section for more info. +package. The {dpd} style is part of the "dpd" package. The {colloid} +style is part of the "colloid" package. The {dipole} style is part of +the "dipole" package. The {ellipsoid} style is part of the "asphere" +package. The {peri} style is part of the "peri" package for +Peridynamics. They are only enabled if LAMMPS was built with that +package. See the "Making LAMMPS"_Section_start.html#2_3 section for +more info. [Related commands:] diff -Naur lammps-10Nov09/doc/fix.html lammps-11Nov09/doc/fix.html --- lammps-10Nov09/doc/fix.html 2009-06-22 15:17:38.000000000 -0600 +++ lammps-11Nov09/doc/fix.html 2009-11-06 14:01:28.000000000 -0700 @@ -164,7 +164,8 @@
  • ttm - two-temperature model for electronic/atomic coupling
  • viscosity - Muller-Plathe momentum exchange for viscosity calculation
  • viscous - viscous damping for granular simulations -
  • wall/gran - frictional wall(s) for granular simulations +
  • wall/colloid - Lennard-Jones wall interacting with finite-size particles +
  • wall/gran - frictional wall(s) for granular simulations
  • wall/lj126 - Lennard-Jones 12-6 wall
  • wall/lj93 - Lennard-Jones 9-3 wall
  • wall/reflect - reflecting wall(s) diff -Naur lammps-10Nov09/doc/fix.txt lammps-11Nov09/doc/fix.txt --- lammps-10Nov09/doc/fix.txt 2009-06-22 15:17:38.000000000 -0600 +++ lammps-11Nov09/doc/fix.txt 2009-11-06 14:01:28.000000000 -0700 @@ -173,8 +173,8 @@ "viscosity"_fix_viscosity.html - Muller-Plathe momentum exchange for \ viscosity calculation "viscous"_fix_viscous.html - viscous damping for granular simulations -"wall/gran"_fix_wall_gran.html - frictional wall(s) for \ - granular simulations +"wall/colloid"_fix_wall_colloid.html - Lennard-Jones wall interacting with finite-size particles +"wall/gran"_fix_wall_gran.html - frictional wall(s) for granular simulations "wall/lj126"_fix_wall_lj126.html - Lennard-Jones 12-6 wall "wall/lj93"_fix_wall_lj93.html - Lennard-Jones 9-3 wall "wall/reflect"_fix_wall_reflect.html - reflecting wall(s) diff -Naur lammps-10Nov09/doc/fix_smd.html lammps-11Nov09/doc/fix_smd.html --- lammps-10Nov09/doc/fix_smd.html 2008-05-15 16:05:51.000000000 -0600 +++ lammps-11Nov09/doc/fix_smd.html 2009-11-06 11:00:14.000000000 -0700 @@ -21,12 +21,13 @@
  • mode = cvel or cfor to select constant velocity or constant force SMD -
  • cvel values = K vel +
      cvel values = K vel
         K = spring constant (force/distance units)
         vel = velocity of pulling (distance/time units) 
       cfor values = force
    -    force = pulling force (force units)
    -keyword = tether or couple 
    +    force = pulling force (force units) 
    +
    +
  • keyword = tether or couple
      tether values = x y z R0
         x,y,z = point to which spring is tethered
    diff -Naur lammps-10Nov09/doc/fix_smd.txt lammps-11Nov09/doc/fix_smd.txt
    --- lammps-10Nov09/doc/fix_smd.txt	2008-05-15 16:05:51.000000000 -0600
    +++ lammps-11Nov09/doc/fix_smd.txt	2009-11-06 11:00:14.000000000 -0700
    @@ -19,7 +19,7 @@
         K = spring constant (force/distance units)
         vel = velocity of pulling (distance/time units) 
       {cfor} values = force
    -    force = pulling force (force units)
    +    force = pulling force (force units) :pre
     keyword = {tether} or {couple} :l
       {tether} values = x y z R0
         x,y,z = point to which spring is tethered
    diff -Naur lammps-10Nov09/doc/fix_wall_colloid.html lammps-11Nov09/doc/fix_wall_colloid.html
    --- lammps-10Nov09/doc/fix_wall_colloid.html	1969-12-31 17:00:00.000000000 -0700
    +++ lammps-11Nov09/doc/fix_wall_colloid.html	2009-11-06 16:23:24.000000000 -0700
    @@ -0,0 +1,94 @@
    +
    +
    LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands +
    + + + + + + +
    + +

    fix wall/colloid command +

    +

    Syntax: +

    +
    fix ID group-ID wall/colloid style coord A sigma cutoff 
    +
    +
    • ID, group-ID are documented in fix command +
    • wall/colloid = style name of this fix command +
    • style = xlo or xhi or ylo or yhi or zlo or zhi +
    • coord = position of wall (distance units) +
    • A = Hamaker constant for colloid-wall interactions (energy units) +
    • sigma = size of constituent LJ particle that integration is done over (distance units) +
    • cutoff = distance from wall at which wall-particle interaction is cut off (distance units) +
    +

    Examples: +

    +
    fix wallhi all wall/colloid xhi 10.0 20.0 1.0 2.5
    +fix leftwall all wall/colloid zlo 0.0 10.0 1.0 0.858 
    +
    +

    Description: +

    +

    Bound the simulation domain on one of its faces with a wall of +Lennard-Jones particles that interacts with finite-size colloidal +particles in the group. The energy E of wall-colloid interactions is +given by an integrated form of the pair_style +colloid potential +

    +
    +
    +

    where A is the specified Hamaker constant for the colloid-wall +interaction, r is the distance from the center of the particle to +the wall coord, R is the radius of the colloid particle, D is +the distance from the surface of the colloid particle to the wall +(r-R), sigma is the size of the constituent LJ particle integrated +over as described below, and Rc is the cutoff value specified in the +fix command and is the distance from the particle center to the wall. +

    +

    This colloid/wall interaction is derived by integrating over both the +constituent LJ particles in the colloid particle and a 3d half-lattice +of Lennard-Jones 12-6 particles in the wall. +

    +

    The wall potential is shifted so that the energy of a wall-particle +interaction is 0.0 at the cutoff distance. +

    +

    Restart, fix_modify, output, run start/stop, minimize info: +

    +

    No information about this fix is written to binary restart +files. +

    +

    The fix_modify energy option is supported by this +fix to add the energy of interaction between atoms and the wall to the +system's potential energy as part of thermodynamic +output. +

    +

    This fix computes a scalar energy and a 3-vector of forces (on the +wall), which can be accessed by various output +commands. The scalar and vector values +calculated by this fix are "extensive", meaning they scale with the +number of atoms in the simulation. +

    +

    No parameter of this fix can be used with the start/stop keywords of +the run command. +

    +

    The forces due to this fix are imposed during an energy minimization, +invoked by the minimize command. +

    +

    IMPORTANT NOTE: If you want the atom/wall interaction energy to be +included in the total potential energy of the system (the quantity +being minimized), you MUST enable the fix_modify +energy option for this fix. +

    +

    Restrictions: +

    +

    Any dimension (xyz) that has a colloid wall must be non-periodic. +

    +

    Related commands: +

    +

    fix wall/lj93, pair_style +colloid +

    +

    Default: none +

    + diff -Naur lammps-10Nov09/doc/fix_wall_colloid.txt lammps-11Nov09/doc/fix_wall_colloid.txt --- lammps-10Nov09/doc/fix_wall_colloid.txt 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/doc/fix_wall_colloid.txt 2009-11-06 16:23:24.000000000 -0700 @@ -0,0 +1,89 @@ +"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c + +:link(lws,http://lammps.sandia.gov) +:link(ld,Manual.html) +:link(lc,Section_commands.html#comm) + +:line + +fix wall/colloid command :h3 + +[Syntax:] + +fix ID group-ID wall/colloid style coord A sigma cutoff :pre + +ID, group-ID are documented in "fix"_fix.html command +wall/colloid = style name of this fix command +style = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} +coord = position of wall (distance units) +A = Hamaker constant for colloid-wall interactions (energy units) +sigma = size of constituent LJ particle that integration is done over (distance units) +cutoff = distance from wall at which wall-particle interaction is cut off (distance units) :ul + +[Examples:] + +fix wallhi all wall/colloid xhi 10.0 20.0 1.0 2.5 +fix leftwall all wall/colloid zlo 0.0 10.0 1.0 0.858 :pre + +[Description:] + +Bound the simulation domain on one of its faces with a wall of +Lennard-Jones particles that interacts with finite-size colloidal +particles in the group. The energy E of wall-colloid interactions is +given by an integrated form of the "pair_style +colloid"_pair_colloid.html potential + +:c,image(Eqs/fix_wall_colloid.jpg) + +where A is the specified Hamaker constant for the colloid-wall +interaction, {r} is the distance from the center of the particle to +the wall {coord}, {R} is the radius of the colloid particle, {D} is +the distance from the surface of the colloid particle to the wall +(r-R), sigma is the size of the constituent LJ particle integrated +over as described below, and Rc is the cutoff value specified in the +fix command and is the distance from the particle center to the wall. + +This colloid/wall interaction is derived by integrating over both the +constituent LJ particles in the colloid particle and a 3d half-lattice +of Lennard-Jones 12-6 particles in the wall. + +The wall potential is shifted so that the energy of a wall-particle +interaction is 0.0 at the cutoff distance. + +[Restart, fix_modify, output, run start/stop, minimize info:] + +No information about this fix is written to "binary restart +files"_restart.html. + +The "fix_modify"_fix_modify.html {energy} option is supported by this +fix to add the energy of interaction between atoms and the wall to the +system's potential energy as part of "thermodynamic +output"_thermo_style.html. + +This fix computes a scalar energy and a 3-vector of forces (on the +wall), which can be accessed by various "output +commands"_Section_howto.html#4_15. The scalar and vector values +calculated by this fix are "extensive", meaning they scale with the +number of atoms in the simulation. + +No parameter of this fix can be used with the {start/stop} keywords of +the "run"_run.html command. + +The forces due to this fix are imposed during an energy minimization, +invoked by the "minimize"_minimize.html command. + +IMPORTANT NOTE: If you want the atom/wall interaction energy to be +included in the total potential energy of the system (the quantity +being minimized), you MUST enable the "fix_modify"_fix_modify.html +{energy} option for this fix. + +[Restrictions:] + +Any dimension (xyz) that has a colloid wall must be non-periodic. + +[Related commands:] + +"fix wall/lj93"_fix_wall_lj93.html, "pair_style +colloid"_pair_colloid.html + +[Default:] none diff -Naur lammps-10Nov09/doc/fix_wall_lj126.html lammps-11Nov09/doc/fix_wall_lj126.html --- lammps-10Nov09/doc/fix_wall_lj126.html 2009-08-19 11:25:25.000000000 -0600 +++ lammps-11Nov09/doc/fix_wall_lj126.html 2009-11-06 15:32:29.000000000 -0700 @@ -21,11 +21,11 @@
  • style = xlo or xhi or ylo or yhi or zlo or zhi -
  • coord = position of wall +
  • coord = position of wall (distance units) -
  • epsilon = Lennard-Jones epsilon for wall-particle interaction +
  • epsilon = Lennard-Jones epsilon for wall-particle interaction (energy units) -
  • sigma = Lennard-Jones sigma for wall-particle interaction +
  • sigma = Lennard-Jones sigma for wall-particle interaction (distance units)
  • cutoff = distance from wall at which wall-particle interaction is cut off (distance units) diff -Naur lammps-10Nov09/doc/fix_wall_lj126.txt lammps-11Nov09/doc/fix_wall_lj126.txt --- lammps-10Nov09/doc/fix_wall_lj126.txt 2009-08-19 11:25:25.000000000 -0600 +++ lammps-11Nov09/doc/fix_wall_lj126.txt 2009-11-06 15:32:29.000000000 -0700 @@ -15,9 +15,9 @@ ID, group-ID are documented in "fix"_fix.html command :ulb,l wall/lj126 = style name of this fix command :l style = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} :l -coord = position of wall :l -epsilon = Lennard-Jones epsilon for wall-particle interaction :l -sigma = Lennard-Jones sigma for wall-particle interaction :l +coord = position of wall (distance units) :l +epsilon = Lennard-Jones epsilon for wall-particle interaction (energy units) :l +sigma = Lennard-Jones sigma for wall-particle interaction (distance units) :l cutoff = distance from wall at which wall-particle interaction is cut off (distance units) :l one or more keyword/value pairs may be appended :l keyword = {vel} :l diff -Naur lammps-10Nov09/doc/fix_wall_lj93.html lammps-11Nov09/doc/fix_wall_lj93.html --- lammps-10Nov09/doc/fix_wall_lj93.html 2009-08-19 11:24:02.000000000 -0600 +++ lammps-11Nov09/doc/fix_wall_lj93.html 2009-11-06 15:32:29.000000000 -0700 @@ -21,11 +21,11 @@
  • style = xlo or xhi or ylo or yhi or zlo or zhi -
  • coord = position of wall +
  • coord = position of wall (distance units) -
  • epsilon = Lennard-Jones epsilon for wall-particle interaction +
  • epsilon = Lennard-Jones epsilon for wall-particle interaction (energy units) -
  • sigma = Lennard-Jones sigma for wall-particle interaction +
  • sigma = Lennard-Jones sigma for wall-particle interaction (distance units)
  • cutoff = distance from wall at which wall-particle interaction is cut off (distance units) diff -Naur lammps-10Nov09/doc/fix_wall_lj93.txt lammps-11Nov09/doc/fix_wall_lj93.txt --- lammps-10Nov09/doc/fix_wall_lj93.txt 2009-08-19 11:24:02.000000000 -0600 +++ lammps-11Nov09/doc/fix_wall_lj93.txt 2009-11-06 15:32:29.000000000 -0700 @@ -15,9 +15,9 @@ ID, group-ID are documented in "fix"_fix.html command :ulb,l wall/lj93 = style name of this fix command :l style = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} :l -coord = position of wall :l -epsilon = Lennard-Jones epsilon for wall-particle interaction :l -sigma = Lennard-Jones sigma for wall-particle interaction :l +coord = position of wall (distance units) :l +epsilon = Lennard-Jones epsilon for wall-particle interaction (energy units) :l +sigma = Lennard-Jones sigma for wall-particle interaction (distance units) :l cutoff = distance from wall at which wall-particle interaction is cut off (distance units) :l one or more keyword/value pairs may be appended :l keyword = {vel} :l diff -Naur lammps-10Nov09/doc/pair_coeff.html lammps-11Nov09/doc/pair_coeff.html --- lammps-10Nov09/doc/pair_coeff.html 2009-11-06 10:05:06.000000000 -0700 +++ lammps-11Nov09/doc/pair_coeff.html 2009-11-06 15:39:50.000000000 -0700 @@ -140,8 +140,9 @@
  • pair_style sw - Stillinger-Weber 3-body potential
  • pair_style table - tabulated pair potential
  • pair_style tersoff - Tersoff 3-body potential -
  • pair_style tersoff/zbl - Tersoff/ZBL 3-body potential -
  • pair_style yukawa - Yukawa potential +
  • pair_style tersoff/zbl - Tersoff/ZBL 3-body potential +
  • pair_style yukawa - Yukawa potential +
  • pair_style yukawa/colloid - screened Yukawa potential for finite-size particles

There are also additional pair styles submitted by users which are included in the LAMMPS distribution. The list of these with links to diff -Naur lammps-10Nov09/doc/pair_coeff.txt lammps-11Nov09/doc/pair_coeff.txt --- lammps-10Nov09/doc/pair_coeff.txt 2009-11-06 10:05:06.000000000 -0700 +++ lammps-11Nov09/doc/pair_coeff.txt 2009-11-06 15:39:50.000000000 -0700 @@ -137,8 +137,9 @@ "pair_style sw"_pair_sw.html - Stillinger-Weber 3-body potential "pair_style table"_pair_table.html - tabulated pair potential "pair_style tersoff"_pair_tersoff.html - Tersoff 3-body potential -"pair_style tersoff/zbl"_pair_tersoff.html - Tersoff/ZBL 3-body potential -"pair_style yukawa"_pair_yukawa.html - Yukawa potential :ul +"pair_style tersoff/zbl"_pair_tersoff_zbl.html - Tersoff/ZBL 3-body potential +"pair_style yukawa"_pair_yukawa.html - Yukawa potential +"pair_style yukawa/colloid"_pair_yukawa_colloid.html - screened Yukawa potential for finite-size particles :ul There are also additional pair styles submitted by users which are included in the LAMMPS distribution. The list of these with links to diff -Naur lammps-10Nov09/doc/pair_colloid.html lammps-11Nov09/doc/pair_colloid.html --- lammps-10Nov09/doc/pair_colloid.html 2008-06-23 09:02:54.000000000 -0600 +++ lammps-11Nov09/doc/pair_colloid.html 2009-11-06 15:32:29.000000000 -0700 @@ -36,7 +36,7 @@

-

A_cc is the Hamaker constant, a1 and a2 are the radii of the two +

where A_cc is the Hamaker constant, a1 and a2 are the radii of the two colloidal particles, and Rc is the cutoff. This equation results from describing each colloidal particle as an integrated collection of Lennard-Jones particles of size sigma and is derived in @@ -46,7 +46,7 @@

-

A_cs is the Hamaker constant, a is the radius of the colloidal +

where A_cs is the Hamaker constant, a is the radius of the colloidal particle, and Rc is the cutoff. This formula is derived from the colloid-colloid interaction, letting one of the particle sizes go to zero. @@ -59,6 +59,11 @@

with A_ss set appropriately, which results from letting both particle sizes go to zero.

+

When used in combination with pair_style +yukawa/colloid, the two terms become the so-called +DLVO potential, which combines electrostatic repulsion and van der +Waals attraction. +

The following coefficients must be defined for each pair of atoms types via the pair_coeff command as in the examples above, or in the data file or restart files read by the diff -Naur lammps-10Nov09/doc/pair_colloid.txt lammps-11Nov09/doc/pair_colloid.txt --- lammps-10Nov09/doc/pair_colloid.txt 2008-06-23 09:02:54.000000000 -0600 +++ lammps-11Nov09/doc/pair_colloid.txt 2009-11-06 15:32:29.000000000 -0700 @@ -33,7 +33,7 @@ :c,image(Eqs/pair_colloid_cc.jpg) -A_cc is the Hamaker constant, a1 and a2 are the radii of the two +where A_cc is the Hamaker constant, a1 and a2 are the radii of the two colloidal particles, and Rc is the cutoff. This equation results from describing each colloidal particle as an integrated collection of Lennard-Jones particles of size sigma and is derived in @@ -43,7 +43,7 @@ :c,image(Eqs/pair_colloid_cs.jpg) -A_cs is the Hamaker constant, a is the radius of the colloidal +where A_cs is the Hamaker constant, a is the radius of the colloidal particle, and Rc is the cutoff. This formula is derived from the colloid-colloid interaction, letting one of the particle sizes go to zero. @@ -56,6 +56,11 @@ with A_ss set appropriately, which results from letting both particle sizes go to zero. +When used in combination with "pair_style +yukawa/colloid"_pair_colloid.html, the two terms become the so-called +DLVO potential, which combines electrostatic repulsion and van der +Waals attraction. + The following coefficients must be defined for each pair of atoms types via the "pair_coeff"_pair_coeff.html command as in the examples above, or in the data file or restart files read by the diff -Naur lammps-10Nov09/doc/pair_style.html lammps-11Nov09/doc/pair_style.html --- lammps-10Nov09/doc/pair_style.html 2009-11-06 10:05:06.000000000 -0700 +++ lammps-11Nov09/doc/pair_style.html 2009-11-06 15:39:50.000000000 -0700 @@ -142,8 +142,9 @@

  • pair_style sw - Stillinger-Weber 3-body potential
  • pair_style table - tabulated pair potential
  • pair_style tersoff - Tersoff 3-body potential -
  • pair_style tersoff/zbl - Tersoff/ZBL 3-body potential -
  • pair_style yukawa - Yukawa potential +
  • pair_style tersoff/zbl - Tersoff/ZBL 3-body potential +
  • pair_style yukawa - Yukawa potential +
  • pair_style yukawa/colloid - screened Yukawa potential for finite-size particles

    There are also additional pair styles submitted by users which are included in the LAMMPS distribution. The list of these with links to diff -Naur lammps-10Nov09/doc/pair_style.txt lammps-11Nov09/doc/pair_style.txt --- lammps-10Nov09/doc/pair_style.txt 2009-11-06 10:05:06.000000000 -0700 +++ lammps-11Nov09/doc/pair_style.txt 2009-11-06 15:39:50.000000000 -0700 @@ -139,8 +139,9 @@ "pair_style sw"_pair_sw.html - Stillinger-Weber 3-body potential "pair_style table"_pair_table.html - tabulated pair potential "pair_style tersoff"_pair_tersoff.html - Tersoff 3-body potential -"pair_style tersoff/zbl"_pair_tersoff.html - Tersoff/ZBL 3-body potential -"pair_style yukawa"_pair_yukawa.html - Yukawa potential :ul +"pair_style tersoff/zbl"_pair_tersoff_zbl.html - Tersoff/ZBL 3-body potential +"pair_style yukawa"_pair_yukawa.html - Yukawa potential +"pair_style yukawa/colloid"_pair_yukawa_colloid.html - screened Yukawa potential for finite-size particles :ul There are also additional pair styles submitted by users which are included in the LAMMPS distribution. The list of these with links to diff -Naur lammps-10Nov09/doc/pair_yukawa_colloid.html lammps-11Nov09/doc/pair_yukawa_colloid.html --- lammps-10Nov09/doc/pair_yukawa_colloid.html 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/doc/pair_yukawa_colloid.html 2009-11-06 15:16:55.000000000 -0700 @@ -0,0 +1,126 @@ + +

    LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands +
    + + + + + + +
    + +

    pair_style yukawa/colloid command +

    +

    Syntax: +

    +
    pair_style yukawa/colloid kappa cutoff 
    +
    +
    • kappa = screening length (inverse distance units) +
    • cutoff = global cutoff for colloidal Yukawa interactions (distance units) +
    +

    Examples: +

    +
    pair_style yukawa/colloid 2.0 2.5
    +pair_coeff 1 1 100.0 2.3
    +pair_coeff * * 100.0 
    +
    +

    Description: +

    +

    Style yukawa/colloid computes pairwise interactions with the formula +

    +
    +
    +

    where Ri and Rj are the radii of the two particles and Rc is the +cutoff. +

    +

    In contrast to pair_style yukawa, this functional +form arises from the Coulombic interaction between two colloid +particles, screened due to the presence of an electrolyte. +Pair_style yukawa is a screened Coulombic potential +between two point-charges and uses no such approximation. +

    +

    This potential applies to nearby particle pairs for which the Derjagin +approximation holds, meaning h << Ri + Rj, where h is the +surface-to-surface separation of the two particles. +

    +

    When used in combination with pair_style colloid, +the two terms become the so-called DLVO potential, which combines +electrostatic repulsion and van der Waals attraction. +

    +

    The following coefficients must be defined for each pair of atoms +types via the pair_coeff command as in the examples +above, or in the data file or restart files read by the +read_data or read_restart +commands, or by mixing as described below: +

    +
    • A (energy/distance units) +
    • cutoff (distance units) +
    +

    The prefactor A is determined from the relationship between surface +charge and surface potential due to the presence of electrolyte. Note +that the A for this potential style has different units than the A +used in pair_style yukawa. For low surface +potentials, i.e. less than about 25 mV, A can be written as: +

    +
    A = 2 * PI * R*eps*eps0 * kappa * psi^2 
    +
    +

    where +

    +
    • R = colloid radius (distance units) +
    • eps0 = permittivity of free space (charge^2/energy/distance units) +
    • eps = relative permittivity of fluid medium (dimensionless) +
    • kappa = inverse screening length (1/distance units) +
    • psi = surface potential (energy/charge units) +
    +

    The last coefficient is optional. If not specified, the global +yukawa/colloid cutoff is used. +

    +
    + +

    Mixing, shift, table, tail correction, restart, rRESPA info: +

    +

    For atom type pairs I,J and I != J, the A coefficient and cutoff +distance for this pair style can be mixed. A is an energy value mixed +like a LJ epsilon. The default mix value is geometric. See the +"pair_modify" command for details. +

    +

    This pair style supports the pair_modify shift +option for the energy of the pair interaction. +

    +

    The pair_modify table option is not relevant +for this pair style. +

    +

    This pair style does not support the pair_modify +tail option for adding long-range tail corrections to energy and +pressure. +

    +

    This pair style writes its information to binary restart +files, so pair_style and pair_coeff commands do not need +to be specified in an input script that reads a restart file. +

    +

    This pair style can only be used via the pair keyword of the +run_style respa command. It does not support the +inner, middle, outer keywords. +

    +
    + +

    Restrictions: +

    +

    This style is part of the "colloid" package. It is only enabled if +LAMMPS was built with that package. See the Making +LAMMPS section for more info. +

    +

    Because this potential uses the radii of the particles, the atom style +must support particles whose size is set via the shape +command. For example atom_style colloid or +ellipsoid. Only spherical particles are currently allowed for +pair_style yukawa/colloid, which means that for each particle type, +its 3 shape diameters must be equal to each other. +

    +

    Related commands: +

    +

    pair_coeff +

    +

    Default: none +

    + diff -Naur lammps-10Nov09/doc/pair_yukawa_colloid.txt lammps-11Nov09/doc/pair_yukawa_colloid.txt --- lammps-10Nov09/doc/pair_yukawa_colloid.txt 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/doc/pair_yukawa_colloid.txt 2009-11-06 15:16:55.000000000 -0700 @@ -0,0 +1,121 @@ +"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c + +:link(lws,http://lammps.sandia.gov) +:link(ld,Manual.html) +:link(lc,Section_commands.html#comm) + +:line + +pair_style yukawa/colloid command :h3 + +[Syntax:] + +pair_style yukawa/colloid kappa cutoff :pre + +kappa = screening length (inverse distance units) +cutoff = global cutoff for colloidal Yukawa interactions (distance units) :ul + +[Examples:] + +pair_style yukawa/colloid 2.0 2.5 +pair_coeff 1 1 100.0 2.3 +pair_coeff * * 100.0 :pre + +[Description:] + +Style {yukawa/colloid} computes pairwise interactions with the formula + +:c,image(Eqs/pair_yukawa_colloid.jpg) + +where Ri and Rj are the radii of the two particles and Rc is the +cutoff. + +In contrast to "pair_style yukawa"_pair_yukawa.html, this functional +form arises from the Coulombic interaction between two colloid +particles, screened due to the presence of an electrolyte. +"Pair_style yukawa"_pair_yukawa.html is a screened Coulombic potential +between two point-charges and uses no such approximation. + +This potential applies to nearby particle pairs for which the Derjagin +approximation holds, meaning h << Ri + Rj, where h is the +surface-to-surface separation of the two particles. + +When used in combination with "pair_style colloid"_pair_colloid.html, +the two terms become the so-called DLVO potential, which combines +electrostatic repulsion and van der Waals attraction. + +The following coefficients must be defined for each pair of atoms +types via the "pair_coeff"_pair_coeff.html command as in the examples +above, or in the data file or restart files read by the +"read_data"_read_data.html or "read_restart"_read_restart.html +commands, or by mixing as described below: + +A (energy/distance units) +cutoff (distance units) :ul + +The prefactor A is determined from the relationship between surface +charge and surface potential due to the presence of electrolyte. Note +that the A for this potential style has different units than the A +used in "pair_style yukawa"_pair_yukawa.html. For low surface +potentials, i.e. less than about 25 mV, A can be written as: + +A = 2 * PI * R*eps*eps0 * kappa * psi^2 :pre + +where + +R = colloid radius (distance units) +eps0 = permittivity of free space (charge^2/energy/distance units) +eps = relative permittivity of fluid medium (dimensionless) +kappa = inverse screening length (1/distance units) +psi = surface potential (energy/charge units) :ul + +The last coefficient is optional. If not specified, the global +yukawa/colloid cutoff is used. + +:line + +[Mixing, shift, table, tail correction, restart, rRESPA info]: + +For atom type pairs I,J and I != J, the A coefficient and cutoff +distance for this pair style can be mixed. A is an energy value mixed +like a LJ epsilon. The default mix value is {geometric}. See the +"pair_modify" command for details. + +This pair style supports the "pair_modify"_pair_modify.html shift +option for the energy of the pair interaction. + +The "pair_modify"_pair_modify.html table option is not relevant +for this pair style. + +This pair style does not support the "pair_modify"_pair_modify.html +tail option for adding long-range tail corrections to energy and +pressure. + +This pair style writes its information to "binary restart +files"_restart.html, so pair_style and pair_coeff commands do not need +to be specified in an input script that reads a restart file. + +This pair style can only be used via the {pair} keyword of the +"run_style respa"_run_style.html command. It does not support the +{inner}, {middle}, {outer} keywords. + +:line + +[Restrictions:] + +This style is part of the "colloid" package. It is only enabled if +LAMMPS was built with that package. See the "Making +LAMMPS"_Section_start.html#2_3 section for more info. + +Because this potential uses the radii of the particles, the atom style +must support particles whose size is set via the "shape"_shape.html +command. For example "atom_style"_atom_style.html colloid or +ellipsoid. Only spherical particles are currently allowed for +pair_style yukawa/colloid, which means that for each particle type, +its 3 shape diameters must be equal to each other. + +[Related commands:] + +"pair_coeff"_pair_coeff.html + +[Default:] none diff -Naur lammps-10Nov09/doc/read_data.html lammps-11Nov09/doc/read_data.html --- lammps-10Nov09/doc/read_data.html 2009-06-26 12:22:33.000000000 -0600 +++ lammps-11Nov09/doc/read_data.html 2009-11-06 14:01:28.000000000 -0700 @@ -270,6 +270,7 @@ atomic atom-ID atom-type x y z bond atom-ID molecule-ID atom-type x y z charge atom-ID atom-type q x y z +colloid atom-ID atom-type x y z dipole atom-ID atom-type q x y z mux muy muz dpd atom-ID atom-type x y z ellipsoid atom-ID atom-type x y z quatw quati quatj quatk diff -Naur lammps-10Nov09/doc/read_data.txt lammps-11Nov09/doc/read_data.txt --- lammps-10Nov09/doc/read_data.txt 2009-10-02 11:58:12.000000000 -0600 +++ lammps-11Nov09/doc/read_data.txt 2009-11-06 14:01:28.000000000 -0700 @@ -250,6 +250,7 @@ atomic: atom-ID atom-type x y z bond: atom-ID molecule-ID atom-type x y z charge: atom-ID atom-type q x y z +colloid: atom-ID atom-type x y z dipole: atom-ID atom-type q x y z mux muy muz dpd: atom-ID atom-type x y z ellipsoid: atom-ID atom-type x y z quatw quati quatj quatk diff -Naur lammps-10Nov09/doc/shape.html lammps-11Nov09/doc/shape.html --- lammps-10Nov09/doc/shape.html 2009-09-29 08:10:23.000000000 -0600 +++ lammps-11Nov09/doc/shape.html 2009-11-06 14:01:28.000000000 -0700 @@ -62,14 +62,13 @@

    Note that the shape command can only be used if the atom style requires per-type atom shape to be set. -Currently, only the dipole and ellipsoid styles do. The -granular and peri styles require the shape to be set for indivual -particles, not types. For these styles, the only option currently -allowed is for spherical particles, so a single diameter value -suffices to determine the shape. Per-atom diameters are defined in -the data file read by the read_data command, or set -to default values by the create_atoms command, or -set to new values by the set diamter command. +Currently, only the colloid, dipole, and ellipsoid styles do. +The granular and peri styles also define finite-size spherical +particles, but their size is set on a per-particle basis. These are +are defined in the data file read by the read_data +command, or set to default values by the +create_atoms command, or set to new values by the +set diameter command.

    Dipoles use the atom shape to compute a moment of inertia for rotational energy. See the pair_style dipole @@ -79,8 +78,8 @@

    Ellipsoids use the atom shape to compute a generalized inertia tensor. For example, a shape setting of 3.0 1.0 1.0 defines a particle 3x longer in x than in y or z and with a circular cross-section in yz. -Degenerate ellipsoids which are spherical can be defined by setting -all 3 shape components the same. +Ellipsoids which are in fact spherical can be defined by setting all 3 +shape components the same.

    If you define a hybrid atom style which includes one (or more) sub-styles which require per-type shape and one (or more) diff -Naur lammps-10Nov09/doc/shape.txt lammps-11Nov09/doc/shape.txt --- lammps-10Nov09/doc/shape.txt 2009-09-29 08:10:23.000000000 -0600 +++ lammps-11Nov09/doc/shape.txt 2009-11-06 14:01:28.000000000 -0700 @@ -59,14 +59,13 @@ Note that the shape command can only be used if the "atom style"_atom_style.html requires per-type atom shape to be set. -Currently, only the {dipole} and {ellipsoid} styles do. The -{granular} and {peri} styles require the shape to be set for indivual -particles, not types. For these styles, the only option currently -allowed is for spherical particles, so a single diameter value -suffices to determine the shape. Per-atom diameters are defined in -the data file read by the "read_data"_read_data.html command, or set -to default values by the "create_atoms"_create_atoms.html command, or -set to new values by the "set diamter"_set.html command. +Currently, only the {colloid}, {dipole}, and {ellipsoid} styles do. +The {granular} and {peri} styles also define finite-size spherical +particles, but their size is set on a per-particle basis. These are +are defined in the data file read by the "read_data"_read_data.html +command, or set to default values by the +"create_atoms"_create_atoms.html command, or set to new values by the +"set diameter"_set.html command. Dipoles use the atom shape to compute a moment of inertia for rotational energy. See the "pair_style dipole"_pair_dipole.html @@ -76,8 +75,8 @@ Ellipsoids use the atom shape to compute a generalized inertia tensor. For example, a shape setting of 3.0 1.0 1.0 defines a particle 3x longer in x than in y or z and with a circular cross-section in yz. -Degenerate ellipsoids which are spherical can be defined by setting -all 3 shape components the same. +Ellipsoids which are in fact spherical can be defined by setting all 3 +shape components the same. If you define a "hybrid atom style"_atom_style.html which includes one (or more) sub-styles which require per-type shape and one (or more) diff -Naur lammps-10Nov09/src/COLLOID/Install.csh lammps-11Nov09/src/COLLOID/Install.csh --- lammps-10Nov09/src/COLLOID/Install.csh 2007-10-11 17:56:12.000000000 -0600 +++ lammps-11Nov09/src/COLLOID/Install.csh 2009-11-06 14:02:28.000000000 -0700 @@ -4,21 +4,33 @@ cp style_colloid.h .. + cp atom_vec_colloid.cpp .. + cp fix_wall_colloid.cpp .. cp pair_colloid.cpp .. cp pair_lubricate.cpp .. + cp pair_yukawa_colloid.cpp .. + cp atom_vec_colloid.h .. + cp fix_wall_colloid.h .. cp pair_colloid.h .. cp pair_lubricate.h .. + cp pair_yukawa_colloid.h .. else if ($1 == 0) then rm ../style_colloid.h touch ../style_colloid.h + rm ../atom_vec_colloid.cpp + rm ../fix_wall_colloid.cpp rm ../pair_colloid.cpp rm ../pair_lubricate.cpp + rm ../pair_yukawa_colloid.cpp + rm ../atom_vec_colloid.h + rm ../fix_wall_colloid.h rm ../pair_colloid.h rm ../pair_lubricate.h + rm ../pair_yukawa_colloid.h endif diff -Naur lammps-10Nov09/src/COLLOID/atom_vec_colloid.cpp lammps-11Nov09/src/COLLOID/atom_vec_colloid.cpp --- lammps-10Nov09/src/COLLOID/atom_vec_colloid.cpp 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/src/COLLOID/atom_vec_colloid.cpp 2009-11-06 14:02:28.000000000 -0700 @@ -0,0 +1,644 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "stdlib.h" +#include "atom_vec_colloid.h" +#include "atom.h" +#include "force.h" +#include "domain.h" +#include "modify.h" +#include "fix.h" +#include "memory.h" +#include "error.h" + +using namespace LAMMPS_NS; + +#define DELTA 10000 + +/* ---------------------------------------------------------------------- */ + +AtomVecColloid::AtomVecColloid(LAMMPS *lmp, int narg, char **arg) : + AtomVec(lmp, narg, arg) +{ + mass_type = 1; + shape_type = 1; + comm_x_only = comm_f_only = 0; + ghost_velocity = 1; + size_comm = 9; + size_reverse = 6; + size_border = 12; + size_data_atom = 5; + size_data_vel = 7; + xcol_data = 3; + + atom->omega_flag = atom->torque_flag = 1; +} + +/* ---------------------------------------------------------------------- + grow atom arrays + n = 0 grows arrays by DELTA + n > 0 allocates arrays to size n +------------------------------------------------------------------------- */ + +void AtomVecColloid::grow(int n) +{ + if (n == 0) nmax += DELTA; + else nmax = n; + atom->nmax = nmax; + + tag = atom->tag = (int *) + memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag"); + type = atom->type = (int *) + memory->srealloc(atom->type,nmax*sizeof(int),"atom:type"); + mask = atom->mask = (int *) + memory->srealloc(atom->mask,nmax*sizeof(int),"atom:mask"); + image = atom->image = (int *) + memory->srealloc(atom->image,nmax*sizeof(int),"atom:image"); + x = atom->x = memory->grow_2d_double_array(atom->x,nmax,3,"atom:x"); + v = atom->v = memory->grow_2d_double_array(atom->v,nmax,3,"atom:v"); + f = atom->f = memory->grow_2d_double_array(atom->f,nmax,3,"atom:f"); + + omega = atom->omega = + memory->grow_2d_double_array(atom->omega,nmax,3,"atom:omega"); + torque = atom->torque = + memory->grow_2d_double_array(atom->torque,nmax,3,"atom:torque"); + + if (atom->nextra_grow) + for (int iextra = 0; iextra < atom->nextra_grow; iextra++) + modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax); +} + +/* ---------------------------------------------------------------------- */ + +void AtomVecColloid::copy(int i, int j) +{ + tag[j] = tag[i]; + type[j] = type[i]; + mask[j] = mask[i]; + image[j] = image[i]; + x[j][0] = x[i][0]; + x[j][1] = x[i][1]; + x[j][2] = x[i][2]; + v[j][0] = v[i][0]; + v[j][1] = v[i][1]; + v[j][2] = v[i][2]; + + omega[j][0] = omega[i][0]; + omega[j][1] = omega[i][1]; + omega[j][2] = omega[i][2]; + + if (atom->nextra_grow) + for (int iextra = 0; iextra < atom->nextra_grow; iextra++) + modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j); +} + +/* ---------------------------------------------------------------------- */ + +int AtomVecColloid::pack_comm(int n, int *list, double *buf, + int pbc_flag, int *pbc) +{ + int i,j,m; + double dx,dy,dz; + + m = 0; + if (pbc_flag == 0) { + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = x[j][0]; + buf[m++] = x[j][1]; + buf[m++] = x[j][2]; + buf[m++] = v[j][0]; + buf[m++] = v[j][1]; + buf[m++] = v[j][2]; + buf[m++] = omega[j][0]; + buf[m++] = omega[j][1]; + buf[m++] = omega[j][2]; + } + } else { + if (domain->triclinic == 0) { + dx = pbc[0]*domain->xprd; + dy = pbc[1]*domain->yprd; + dz = pbc[2]*domain->zprd; + } else { + dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz; + dy = pbc[1]*domain->yprd + pbc[3]*domain->yz; + dz = pbc[2]*domain->zprd; + } + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = x[j][0] + dx; + buf[m++] = x[j][1] + dy; + buf[m++] = x[j][2] + dz; + buf[m++] = v[j][0]; + buf[m++] = v[j][1]; + buf[m++] = v[j][2]; + buf[m++] = omega[j][0]; + buf[m++] = omega[j][1]; + buf[m++] = omega[j][2]; + } + } + return m; +} + +/* ---------------------------------------------------------------------- */ + +int AtomVecColloid::pack_comm_one(int i, double *buf) +{ + buf[0] = v[i][0]; + buf[1] = v[i][1]; + buf[2] = v[i][2]; + buf[3] = omega[i][0]; + buf[4] = omega[i][1]; + buf[5] = omega[i][2]; + return 6; +} + +/* ---------------------------------------------------------------------- */ + +void AtomVecColloid::unpack_comm(int n, int first, double *buf) +{ + int i,m,last; + + m = 0; + last = first + n; + for (i = first; i < last; i++) { + x[i][0] = buf[m++]; + x[i][1] = buf[m++]; + x[i][2] = buf[m++]; + v[i][0] = buf[m++]; + v[i][1] = buf[m++]; + v[i][2] = buf[m++]; + omega[i][0] = buf[m++]; + omega[i][1] = buf[m++]; + omega[i][2] = buf[m++]; + } +} + +/* ---------------------------------------------------------------------- */ + +int AtomVecColloid::unpack_comm_one(int i, double *buf) +{ + v[i][0] = buf[0]; + v[i][1] = buf[1]; + v[i][2] = buf[2]; + omega[i][0] = buf[3]; + omega[i][1] = buf[4]; + omega[i][2] = buf[5]; + return 6; +} + +/* ---------------------------------------------------------------------- */ + +int AtomVecColloid::pack_reverse(int n, int first, double *buf) +{ + int i,m,last; + + m = 0; + last = first + n; + for (i = first; i < last; i++) { + buf[m++] = f[i][0]; + buf[m++] = f[i][1]; + buf[m++] = f[i][2]; + buf[m++] = torque[i][0]; + buf[m++] = torque[i][1]; + buf[m++] = torque[i][2]; + } + return m; +} + +/* ---------------------------------------------------------------------- */ + +int AtomVecColloid::pack_reverse_one(int i, double *buf) +{ + buf[0] = torque[i][0]; + buf[1] = torque[i][1]; + buf[2] = torque[i][2]; + return 3; +} + +/* ---------------------------------------------------------------------- */ + +void AtomVecColloid::unpack_reverse(int n, int *list, double *buf) +{ + int i,j,m; + + m = 0; + for (i = 0; i < n; i++) { + j = list[i]; + f[j][0] += buf[m++]; + f[j][1] += buf[m++]; + f[j][2] += buf[m++]; + torque[j][0] += buf[m++]; + torque[j][1] += buf[m++]; + torque[j][2] += buf[m++]; + } +} + +/* ---------------------------------------------------------------------- */ + +int AtomVecColloid::unpack_reverse_one(int i, double *buf) +{ + torque[i][0] += buf[0]; + torque[i][1] += buf[1]; + torque[i][2] += buf[2]; + return 3; +} + +/* ---------------------------------------------------------------------- */ + +int AtomVecColloid::pack_border(int n, int *list, double *buf, + int pbc_flag, int *pbc) +{ + int i,j,m; + double dx,dy,dz; + + m = 0; + if (pbc_flag == 0) { + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = x[j][0]; + buf[m++] = x[j][1]; + buf[m++] = x[j][2]; + buf[m++] = tag[j]; + buf[m++] = type[j]; + buf[m++] = mask[j]; + buf[m++] = v[j][0]; + buf[m++] = v[j][1]; + buf[m++] = v[j][2]; + buf[m++] = omega[j][0]; + buf[m++] = omega[j][1]; + buf[m++] = omega[j][2]; + } + } else { + if (domain->triclinic == 0) { + dx = pbc[0]*domain->xprd; + dy = pbc[1]*domain->yprd; + dz = pbc[2]*domain->zprd; + } else { + dx = pbc[0]; + dy = pbc[1]; + dz = pbc[2]; + } + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = x[j][0] + dx; + buf[m++] = x[j][1] + dy; + buf[m++] = x[j][2] + dz; + buf[m++] = tag[j]; + buf[m++] = type[j]; + buf[m++] = mask[j]; + buf[m++] = v[j][0]; + buf[m++] = v[j][1]; + buf[m++] = v[j][2]; + buf[m++] = omega[j][0]; + buf[m++] = omega[j][1]; + buf[m++] = omega[j][2]; + } + } + return m; +} + +/* ---------------------------------------------------------------------- */ + +int AtomVecColloid::pack_border_one(int i, double *buf) +{ + buf[0] = v[i][0]; + buf[1] = v[i][1]; + buf[2] = v[i][2]; + buf[3] = omega[i][0]; + buf[4] = omega[i][1]; + buf[5] = omega[i][2]; + return 6; +} + +/* ---------------------------------------------------------------------- */ + +void AtomVecColloid::unpack_border(int n, int first, double *buf) +{ + int i,m,last; + + m = 0; + last = first + n; + for (i = first; i < last; i++) { + if (i == nmax) grow(0); + x[i][0] = buf[m++]; + x[i][1] = buf[m++]; + x[i][2] = buf[m++]; + tag[i] = static_cast (buf[m++]); + type[i] = static_cast (buf[m++]); + mask[i] = static_cast (buf[m++]); + v[i][0] = buf[m++]; + v[i][1] = buf[m++]; + v[i][2] = buf[m++]; + omega[i][0] = buf[m++]; + omega[i][1] = buf[m++]; + omega[i][2] = buf[m++]; + } +} + +/* ---------------------------------------------------------------------- */ + +int AtomVecColloid::unpack_border_one(int i, double *buf) +{ + v[i][0] = buf[0]; + v[i][1] = buf[1]; + v[i][2] = buf[2]; + omega[i][0] = buf[3]; + omega[i][1] = buf[4]; + omega[i][2] = buf[5]; + return 6; +} + +/* ---------------------------------------------------------------------- + pack data for atom I for sending to another proc + xyz must be 1st 3 values, so comm::exchange() can test on them +------------------------------------------------------------------------- */ + +int AtomVecColloid::pack_exchange(int i, double *buf) +{ + int m = 1; + buf[m++] = x[i][0]; + buf[m++] = x[i][1]; + buf[m++] = x[i][2]; + buf[m++] = v[i][0]; + buf[m++] = v[i][1]; + buf[m++] = v[i][2]; + buf[m++] = tag[i]; + buf[m++] = type[i]; + buf[m++] = mask[i]; + buf[m++] = image[i]; + + buf[m++] = omega[i][0]; + buf[m++] = omega[i][1]; + buf[m++] = omega[i][2]; + + if (atom->nextra_grow) + for (int iextra = 0; iextra < atom->nextra_grow; iextra++) + m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]); + + buf[0] = m; + return m; +} + +/* ---------------------------------------------------------------------- */ + +int AtomVecColloid::unpack_exchange(double *buf) +{ + int nlocal = atom->nlocal; + if (nlocal == nmax) grow(0); + + int m = 1; + x[nlocal][0] = buf[m++]; + x[nlocal][1] = buf[m++]; + x[nlocal][2] = buf[m++]; + v[nlocal][0] = buf[m++]; + v[nlocal][1] = buf[m++]; + v[nlocal][2] = buf[m++]; + tag[nlocal] = static_cast (buf[m++]); + type[nlocal] = static_cast (buf[m++]); + mask[nlocal] = static_cast (buf[m++]); + image[nlocal] = static_cast (buf[m++]); + + omega[nlocal][0] = buf[m++]; + omega[nlocal][1] = buf[m++]; + omega[nlocal][2] = buf[m++]; + + if (atom->nextra_grow) + for (int iextra = 0; iextra < atom->nextra_grow; iextra++) + m += modify->fix[atom->extra_grow[iextra]]-> + unpack_exchange(nlocal,&buf[m]); + + atom->nlocal++; + return m; +} + +/* ---------------------------------------------------------------------- + size of restart data for all atoms owned by this proc + include extra data stored by fixes +------------------------------------------------------------------------- */ + +int AtomVecColloid::size_restart() +{ + int i; + + int nlocal = atom->nlocal; + int n = 14 * nlocal; + + if (atom->nextra_restart) + for (int iextra = 0; iextra < atom->nextra_restart; iextra++) + for (i = 0; i < nlocal; i++) + n += modify->fix[atom->extra_restart[iextra]]->size_restart(i); + + return n; +} + +/* ---------------------------------------------------------------------- + pack atom I's data for restart file including extra quantities + xyz must be 1st 3 values, so that read_restart can test on them + molecular types may be negative, but write as positive +------------------------------------------------------------------------- */ + +int AtomVecColloid::pack_restart(int i, double *buf) +{ + int m = 1; + buf[m++] = x[i][0]; + buf[m++] = x[i][1]; + buf[m++] = x[i][2]; + buf[m++] = tag[i]; + buf[m++] = type[i]; + buf[m++] = mask[i]; + buf[m++] = image[i]; + buf[m++] = v[i][0]; + buf[m++] = v[i][1]; + buf[m++] = v[i][2]; + + buf[m++] = omega[i][0]; + buf[m++] = omega[i][1]; + buf[m++] = omega[i][2]; + + if (atom->nextra_restart) + for (int iextra = 0; iextra < atom->nextra_restart; iextra++) + m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]); + + buf[0] = m; + return m; +} + +/* ---------------------------------------------------------------------- + unpack data for one atom from restart file including extra quantities +------------------------------------------------------------------------- */ + +int AtomVecColloid::unpack_restart(double *buf) +{ + int nlocal = atom->nlocal; + if (nlocal == nmax) { + grow(0); + if (atom->nextra_store) + atom->extra = memory->grow_2d_double_array(atom->extra,nmax, + atom->nextra_store, + "atom:extra"); + } + + int m = 1; + x[nlocal][0] = buf[m++]; + x[nlocal][1] = buf[m++]; + x[nlocal][2] = buf[m++]; + tag[nlocal] = static_cast (buf[m++]); + type[nlocal] = static_cast (buf[m++]); + mask[nlocal] = static_cast (buf[m++]); + image[nlocal] = static_cast (buf[m++]); + v[nlocal][0] = buf[m++]; + v[nlocal][1] = buf[m++]; + v[nlocal][2] = buf[m++]; + + omega[nlocal][0] = buf[m++]; + omega[nlocal][1] = buf[m++]; + omega[nlocal][2] = buf[m++]; + + double **extra = atom->extra; + if (atom->nextra_store) { + int size = static_cast (buf[0]) - m; + for (int i = 0; i < size; i++) extra[nlocal][i] = buf[m++]; + } + + atom->nlocal++; + return m; +} + +/* ---------------------------------------------------------------------- + create one atom of itype at coord + set other values to defaults +------------------------------------------------------------------------- */ + +void AtomVecColloid::create_atom(int itype, double *coord) +{ + int nlocal = atom->nlocal; + if (nlocal == nmax) grow(0); + + tag[nlocal] = 0; + type[nlocal] = itype; + x[nlocal][0] = coord[0]; + x[nlocal][1] = coord[1]; + x[nlocal][2] = coord[2]; + mask[nlocal] = 1; + image[nlocal] = (512 << 20) | (512 << 10) | 512; + v[nlocal][0] = 0.0; + v[nlocal][1] = 0.0; + v[nlocal][2] = 0.0; + + omega[nlocal][0] = 0.0; + omega[nlocal][1] = 0.0; + omega[nlocal][2] = 0.0; + + atom->nlocal++; +} + +/* ---------------------------------------------------------------------- + unpack one line from Atoms section of data file + initialize other atom quantities +------------------------------------------------------------------------- */ + +void AtomVecColloid::data_atom(double *coord, int imagetmp, char **values) +{ + int nlocal = atom->nlocal; + if (nlocal == nmax) grow(0); + + tag[nlocal] = atoi(values[0]); + if (tag[nlocal] <= 0) + error->one("Invalid atom ID in Atoms section of data file"); + + type[nlocal] = atoi(values[1]); + if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) + error->one("Invalid atom type in Atoms section of data file"); + + x[nlocal][0] = coord[0]; + x[nlocal][1] = coord[1]; + x[nlocal][2] = coord[2]; + + image[nlocal] = imagetmp; + + mask[nlocal] = 1; + v[nlocal][0] = 0.0; + v[nlocal][1] = 0.0; + v[nlocal][2] = 0.0; + omega[nlocal][0] = 0.0; + omega[nlocal][1] = 0.0; + omega[nlocal][2] = 0.0; + + atom->nlocal++; +} + +/* ---------------------------------------------------------------------- + unpack hybrid quantities from one line in Atoms section of data file + initialize other atom quantities for this sub-style +------------------------------------------------------------------------- */ + +int AtomVecColloid::data_atom_hybrid(int nlocal, char **values) +{ + v[nlocal][0] = 0.0; + v[nlocal][1] = 0.0; + v[nlocal][2] = 0.0; + omega[nlocal][0] = 0.0; + omega[nlocal][1] = 0.0; + omega[nlocal][2] = 0.0; + + return 0; +} + +/* ---------------------------------------------------------------------- + unpack one line from Velocities section of data file +------------------------------------------------------------------------- */ + +void AtomVecColloid::data_vel(int m, char **values) +{ + v[m][0] = atof(values[0]); + v[m][1] = atof(values[1]); + v[m][2] = atof(values[2]); + omega[m][0] = atof(values[3]); + omega[m][1] = atof(values[4]); + omega[m][2] = atof(values[5]); +} + +/* ---------------------------------------------------------------------- + unpack hybrid quantities from one line in Velocities section of data file +------------------------------------------------------------------------- */ + +int AtomVecColloid::data_vel_hybrid(int m, char **values) +{ + omega[m][0] = atof(values[0]); + omega[m][1] = atof(values[1]); + omega[m][2] = atof(values[2]); + return 3; +} + +/* ---------------------------------------------------------------------- + return # of bytes of allocated memory +------------------------------------------------------------------------- */ + +double AtomVecColloid::memory_usage() +{ + double bytes = 0.0; + + if (atom->memcheck("tag")) bytes += nmax * sizeof(int); + if (atom->memcheck("type")) bytes += nmax * sizeof(int); + if (atom->memcheck("mask")) bytes += nmax * sizeof(int); + if (atom->memcheck("image")) bytes += nmax * sizeof(int); + if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double); + if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double); + if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double); + + if (atom->memcheck("omega")) bytes += nmax*3 * sizeof(double); + if (atom->memcheck("torque")) bytes += nmax*3 * sizeof(double); + + return bytes; +} diff -Naur lammps-10Nov09/src/COLLOID/atom_vec_colloid.h lammps-11Nov09/src/COLLOID/atom_vec_colloid.h --- lammps-10Nov09/src/COLLOID/atom_vec_colloid.h 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/src/COLLOID/atom_vec_colloid.h 2009-11-06 14:02:28.000000000 -0700 @@ -0,0 +1,59 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef ATOM_VEC_COLLOID_H +#define ATOM_VEC_COLLOID_H + +#include "atom_vec.h" + +namespace LAMMPS_NS { + +class AtomVecColloid : public AtomVec { + public: + AtomVecColloid(class LAMMPS *, int, char **); + virtual ~AtomVecColloid() {} + void grow(int); + void copy(int, int); + int pack_comm(int, int *, double *, int, int *); + int pack_comm_one(int, double *); + void unpack_comm(int, int, double *); + int unpack_comm_one(int, double *); + int pack_reverse(int, int, double *); + int pack_reverse_one(int, double *); + void unpack_reverse(int, int *, double *); + int unpack_reverse_one(int, double *); + int pack_border(int, int *, double *, int, int *); + int pack_border_one(int, double *); + void unpack_border(int, int, double *); + int unpack_border_one(int, double *); + int pack_exchange(int, double *); + int unpack_exchange(double *); + int size_restart(); + int pack_restart(int, double *); + int unpack_restart(double *); + void create_atom(int, double *); + void data_atom(double *, int, char **); + int data_atom_hybrid(int, char **); + void data_vel(int, char **); + int data_vel_hybrid(int, char **); + double memory_usage(); + + private: + int *tag,*type,*mask,*image; + double **x,**v,**f; + double **omega,**torque; +}; + +} + +#endif diff -Naur lammps-10Nov09/src/COLLOID/fix_wall_colloid.cpp lammps-11Nov09/src/COLLOID/fix_wall_colloid.cpp --- lammps-10Nov09/src/COLLOID/fix_wall_colloid.cpp 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/src/COLLOID/fix_wall_colloid.cpp 2009-11-06 16:24:54.000000000 -0700 @@ -0,0 +1,241 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing authors: Jeremy Lechman (SNL) +------------------------------------------------------------------------- */ + +#include "math.h" +#include "stdlib.h" +#include "string.h" +#include "fix_wall_colloid.h" +#include "atom.h" +#include "domain.h" +#include "update.h" +#include "output.h" +#include "respa.h" +#include "error.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +FixWallColloid::FixWallColloid(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg) +{ + if (narg != 8) error->all("Illegal fix wall/colloid command"); + + scalar_flag = 1; + vector_flag = 1; + size_vector = 3; + scalar_vector_freq = 1; + extscalar = 1; + extvector = 1; + + if (strcmp(arg[3],"xlo") == 0) { + dim = 0; + side = -1; + } else if (strcmp(arg[3],"xhi") == 0) { + dim = 0; + side = 1; + } else if (strcmp(arg[3],"ylo") == 0) { + dim = 1; + side = -1; + } else if (strcmp(arg[3],"yhi") == 0) { + dim = 1; + side = 1; + } else if (strcmp(arg[3],"zlo") == 0) { + dim = 2; + side = -1; + } else if (strcmp(arg[3],"zhi") == 0) { + dim = 2; + side = 1; + } else error->all("Illegal fix wall/colloid command"); + + coord = atof(arg[4]); + hamaker = atof(arg[5]); + sigma = atof(arg[6]); + cutoff = atof(arg[7]); + + coeff1 = -4.0/315.0 * hamaker * pow(sigma,6.0); + coeff2 = -2.0/3.0 * hamaker; + coeff3 = hamaker * pow(sigma,6.0)/7560.0; + coeff4 = hamaker/6.0; + + double rinv = 1.0/cutoff; + double r2inv = rinv*rinv; + double r4inv = r2inv*r2inv; + offset = coeff3*r4inv*r4inv*rinv - coeff4*r2inv*rinv; + + if (dim == 0 && domain->xperiodic) + error->all("Cannot use wall in periodic dimension"); + if (dim == 1 && domain->yperiodic) + error->all("Cannot use wall in periodic dimension"); + if (dim == 2 && domain->zperiodic) + error->all("Cannot use wall in periodic dimension"); + + wall_flag = 0; + wall[0] = wall[1] = wall[2] = wall[3] = 0.0; +} + +/* ---------------------------------------------------------------------- */ + +int FixWallColloid::setmask() +{ + int mask = 0; + mask |= POST_FORCE; + mask |= THERMO_ENERGY; + mask |= POST_FORCE_RESPA; + mask |= MIN_POST_FORCE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixWallColloid::init() +{ + if (!atom->shape) + error->all("Fix wall/colloid requires atom attribute shape"); + + // insure all particle shapes are spherical + + for (int i = 1; i <= atom->ntypes; i++) + if ((atom->shape[i][0] != atom->shape[i][1]) || + (atom->shape[i][0] != atom->shape[i][2]) || + (atom->shape[i][1] != atom->shape[i][2])) + error->all("Fix wall/colloid requires spherical particles"); + + if (strcmp(update->integrate_style,"respa") == 0) + nlevels_respa = ((Respa *) update->integrate)->nlevels; +} + +/* ---------------------------------------------------------------------- */ + +void FixWallColloid::setup(int vflag) +{ + if (strcmp(update->integrate_style,"verlet") == 0) + post_force(vflag); + else { + ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + post_force_respa(vflag,nlevels_respa-1,0); + ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + } +} + +/* ---------------------------------------------------------------------- */ + +void FixWallColloid::min_setup(int vflag) +{ + post_force(vflag); +} + +/* ---------------------------------------------------------------------- */ + +void FixWallColloid::post_force(int vflag) +{ + double **x = atom->x; + double **f = atom->f; + int *mask = atom->mask; + int *type = atom->type; + int nlocal = atom->nlocal; + + double delta,delta2,rinv,r2inv,r4inv,r8inv,fwall; + double r2,rinv2,r2inv2,r4inv2,r6inv2; + double r3,rinv3,r2inv3,r4inv3,r6inv3; + double rad,rad2,rad4,rad8,diam,new_coeff2; + wall[0] = wall[1] = wall[2] = wall[3] = 0.0; + wall_flag = 0; + + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + if (side == -1) delta = x[i][dim] - coord; + else delta = coord - x[i][dim]; + if (delta <= 0.0) continue; + if (delta > cutoff) continue; + rad = atom->shape[type[i]][0]; + new_coeff2 = coeff2*rad*rad*rad; + diam = 2.0*rad; + rad2 = rad*rad; + rad4 = rad2*rad2; + rad8 = rad4*rad4; + delta2 = rad2 - delta*delta; + rinv = 1.0/delta2; + r2inv = rinv*rinv; + r4inv = r2inv*r2inv; + r8inv = r4inv*r4inv; + fwall = (coeff1*(rad8*rad + 27.0*rad4*rad2*rad*pow(delta,2.0) + + 63.0*rad4*rad*pow(delta,4.0) + + 21.0*rad2*rad*pow(delta,6.0))*r8inv - + new_coeff2*r2inv) * side; + f[i][dim] -= fwall; + r2 = 0.5*diam - delta; + rinv2 = 1.0/r2; + r2inv2 = rinv2*rinv2; + r4inv2 = r2inv2*r2inv2; + r6inv2 = r4inv2*r2inv2; + r3 = delta+0.5*diam; + rinv3 = 1.0/r3; + r2inv3 = rinv3*rinv3; + r4inv3 = r2inv3*r2inv3; + r6inv3 = r4inv3*r2inv3; + wall[0] += coeff3*((-3.5*diam+delta)*r4inv2*r2inv2*rinv2 + + (3.5*diam+delta)*r4inv3*r2inv3*rinv3) - + coeff4*((-diam*delta+r2*r3*(log(-r2)-log(r3)))* + (-rinv2)*rinv3) - offset; + wall[dim+1] += fwall; + } +} + +/* ---------------------------------------------------------------------- */ + +void FixWallColloid::post_force_respa(int vflag, int ilevel, int iloop) +{ + if (ilevel == nlevels_respa-1) post_force(vflag); +} + +/* ---------------------------------------------------------------------- */ + +void FixWallColloid::min_post_force(int vflag) +{ + post_force(vflag); +} + +/* ---------------------------------------------------------------------- + energy of wall interaction +------------------------------------------------------------------------- */ + +double FixWallColloid::compute_scalar() +{ + // only sum across procs one time + + if (wall_flag == 0) { + MPI_Allreduce(wall,wall_all,4,MPI_DOUBLE,MPI_SUM,world); + wall_flag = 1; + } + return wall_all[0]; +} + +/* ---------------------------------------------------------------------- + components of force on wall +------------------------------------------------------------------------- */ + +double FixWallColloid::compute_vector(int n) +{ + // only sum across procs one time + + if (wall_flag == 0) { + MPI_Allreduce(wall,wall_all,4,MPI_DOUBLE,MPI_SUM,world); + wall_flag = 1; + } + return wall_all[n+1]; +} diff -Naur lammps-10Nov09/src/COLLOID/fix_wall_colloid.h lammps-11Nov09/src/COLLOID/fix_wall_colloid.h --- lammps-10Nov09/src/COLLOID/fix_wall_colloid.h 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/src/COLLOID/fix_wall_colloid.h 2009-11-06 16:24:54.000000000 -0700 @@ -0,0 +1,46 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef FIX_WALL_COLLOID_H +#define FIX_WALL_COLLOID_H + +#include "fix.h" + +namespace LAMMPS_NS { + +class FixWallColloid : public Fix { + public: + FixWallColloid(class LAMMPS *, int, char **); + ~FixWallColloid() {} + int setmask(); + void init(); + void setup(int); + void min_setup(int); + void post_force(int); + void post_force_respa(int, int, int); + void min_post_force(int); + double compute_scalar(); + double compute_vector(int); + + private: + int dim,side,thermo_flag,eflag_enable; + double coord,hamaker,sigma,cutoff; + double coeff1,coeff2,coeff3,coeff4,offset; + double wall[4],wall_all[4]; + int wall_flag; + int nlevels_respa; +}; + +} + +#endif diff -Naur lammps-10Nov09/src/COLLOID/pair_yukawa_colloid.cpp lammps-11Nov09/src/COLLOID/pair_yukawa_colloid.cpp --- lammps-10Nov09/src/COLLOID/pair_yukawa_colloid.cpp 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/src/COLLOID/pair_yukawa_colloid.cpp 2009-11-06 14:28:36.000000000 -0700 @@ -0,0 +1,190 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing authors: Randy Schunk (SNL) +------------------------------------------------------------------------- */ + +#include "math.h" +#include "stdlib.h" +#include "pair_yukawa_colloid.h" +#include "atom.h" +#include "force.h" +#include "comm.h" +#include "neighbor.h" +#include "neigh_list.h" +#include "memory.h" +#include "error.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +PairYukawaColloid::PairYukawaColloid(LAMMPS *lmp) : PairYukawa(lmp) {} + +/* ---------------------------------------------------------------------- */ + +void PairYukawaColloid::compute(int eflag, int vflag) +{ + int i,j,ii,jj,inum,jnum,itype,jtype; + double xtmp,ytmp,ztmp,delx,dely,delz,ecoul,fpair,radi,radj; + double rsq,r2inv,r,rinv,screening,forceyukawa,factor_coul; + int *ilist,*jlist,*numneigh,**firstneigh; + + ecoul = 0.0; + if (eflag || vflag) ev_setup(eflag,vflag); + else evflag = vflag_fdotr = 0; + + double **x = atom->x; + double **f = atom->f; + int *type = atom->type; + int nlocal = atom->nlocal; + int nall = nlocal + atom->nghost; + double *special_coul = force->special_coul; + int newton_pair = force->newton_pair; + + inum = list->inum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + + // loop over neighbors of my atoms + + for (ii = 0; ii < inum; ii++) { + i = ilist[ii]; + xtmp = x[i][0]; + ytmp = x[i][1]; + ztmp = x[i][2]; + itype = type[i]; + radi = atom->shape[itype][0]; + jlist = firstneigh[i]; + jnum = numneigh[i]; + + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + + if (j < nall) factor_coul = 1.0; + else { + factor_coul = special_coul[j/nall]; + j %= nall; + } + + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + jtype = type[j]; + radj = atom->shape[jtype][0]; + + if (rsq < cutsq[itype][jtype]) { + r2inv = 1.0/rsq; + r = sqrt(rsq); + rinv = 1.0/r; + screening = exp(-kappa*(r-(radi+radj))); + forceyukawa = a[itype][jtype] * screening; + + fpair = factor_coul*forceyukawa * rinv; + + f[i][0] += delx*fpair; + f[i][1] += dely*fpair; + f[i][2] += delz*fpair; + if (newton_pair || j < nlocal) { + f[j][0] -= delx*fpair; + f[j][1] -= dely*fpair; + f[j][2] -= delz*fpair; + } + + if (eflag) { + ecoul = a[itype][jtype]/kappa * screening - offset[itype][jtype]; + ecoul *= factor_coul; + } + + if (evflag) ev_tally(i,j,nlocal,newton_pair, + 0.0,ecoul,fpair,delx,dely,delz); + } + } + } + + if (vflag_fdotr) virial_compute(); +} + +/* ---------------------------------------------------------------------- + init specific to this pair style +------------------------------------------------------------------------- */ + +void PairYukawaColloid::init_style() +{ + if (!atom->shape) + error->all("Pair yukawa/colloid requires atom attribute shape"); + + // insure all particle shapes are spherical + + for (int i = 1; i <= atom->ntypes; i++) + if ((atom->shape[i][0] != atom->shape[i][1]) || + (atom->shape[i][0] != atom->shape[i][2]) || + (atom->shape[i][1] != atom->shape[i][2])) + error->all("Pair yukawa/colloid requires spherical particles"); + + if (force->newton_pair != 1) + error->all("Pair lubricate requires newton_pair on"); + + int irequest = neighbor->request(this); +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +double PairYukawaColloid::init_one(int i, int j) +{ + if (setflag[i][j] == 0) { + a[i][j] = mix_energy(a[i][i],a[j][j],1.0,1.0); + cut[i][j] = mix_distance(cut[i][i],cut[j][j]); + } + + if (offset_flag) { + double radi = atom->shape[i][0]; + double radj = atom->shape[j][0]; + double screening = exp(-kappa * (cut[i][j] - (radi+radj))); + offset[i][j] = a[i][j]/kappa * screening; + } else offset[i][j] = 0.0; + + a[j][i] = a[i][j]; + offset[j][i] = offset[i][j]; + + return cut[i][j]; +} + +/* ---------------------------------------------------------------------- */ + +double PairYukawaColloid::single(int i, int j, int itype, int jtype, + double rsq, + double factor_coul, double factor_lj, + double &fforce) +{ + double r2inv,r,rinv,screening,forceyukawa,phi,radi,radj; + + int *type = atom->type; + radi = atom->shape[itype][0]; + radj = atom->shape[jtype][0]; + + r2inv = 1.0/rsq; + r = sqrt(rsq); + rinv = 1.0/r; + screening = exp(-kappa*(r-(radi+radj))); + forceyukawa = a[itype][jtype] * screening; + fforce = factor_coul*forceyukawa * rinv; + + phi = a[itype][jtype]/kappa * screening - offset[itype][jtype]; + return factor_coul*phi; +} diff -Naur lammps-10Nov09/src/COLLOID/pair_yukawa_colloid.h lammps-11Nov09/src/COLLOID/pair_yukawa_colloid.h --- lammps-10Nov09/src/COLLOID/pair_yukawa_colloid.h 1969-12-31 17:00:00.000000000 -0700 +++ lammps-11Nov09/src/COLLOID/pair_yukawa_colloid.h 2009-11-06 14:02:28.000000000 -0700 @@ -0,0 +1,33 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef PAIR_YUKAWA_COLLOID_H +#define PAIR_YUKAWA_COLLOID_H + +#include "pair_yukawa.h" + +namespace LAMMPS_NS { + +class PairYukawaColloid : public PairYukawa { + public: + PairYukawaColloid(class LAMMPS *); + ~PairYukawaColloid() {} + void compute(int, int); + void init_style(); + double init_one(int, int); + double single(int, int, int, int, double, double, double, double &); +}; + +} + +#endif diff -Naur lammps-10Nov09/src/COLLOID/style_colloid.h lammps-11Nov09/src/COLLOID/style_colloid.h --- lammps-10Nov09/src/COLLOID/style_colloid.h 2007-10-11 17:56:12.000000000 -0600 +++ lammps-11Nov09/src/COLLOID/style_colloid.h 2009-11-06 14:02:28.000000000 -0700 @@ -11,12 +11,30 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#ifdef AtomInclude +#include "atom_vec_colloid.h" +#endif + +#ifdef AtomClass +AtomStyle(colloid,AtomVecColloid) +#endif + +#ifdef FixInclude +#include "fix_wall_colloid.h" +#endif + +#ifdef FixClass +FixStyle(wall/colloid,FixWallColloid) +#endif + #ifdef PairInclude #include "pair_colloid.h" #include "pair_lubricate.h" +#include "pair_yukawa_colloid.h" #endif #ifdef PairClass PairStyle(colloid,PairColloid) PairStyle(lubricate,PairLubricate) +PairStyle(yukawa/colloid,PairYukawaColloid) #endif diff -Naur lammps-10Nov09/src/pair_yukawa.h lammps-11Nov09/src/pair_yukawa.h --- lammps-10Nov09/src/pair_yukawa.h 2008-01-02 12:24:46.000000000 -0700 +++ lammps-11Nov09/src/pair_yukawa.h 2009-11-06 14:02:28.000000000 -0700 @@ -21,18 +21,18 @@ class PairYukawa : public Pair { public: PairYukawa(class LAMMPS *); - ~PairYukawa(); - void compute(int, int); + virtual ~PairYukawa(); + virtual void compute(int, int); void settings(int, char **); void coeff(int, char **); - double init_one(int, int); + virtual double init_one(int, int); void write_restart(FILE *); void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); + virtual double single(int, int, int, int, double, double, double, double &); - private: + protected: double cut_global; double kappa; double **cut,**a,**offset;