Merge remote-tracking branch 'lammps-ro/master' into lammps-icms

Resolved Conflicts:
	doc/Manual.html
	doc/Manual.txt
	lib/gpu/lal_sw.cu
	src/GRANULAR/fix_pour.cpp
This commit is contained in:
Axel Kohlmeyer
2014-04-30 06:43:53 -04:00
28 changed files with 2589 additions and 128 deletions

View File

@ -1,7 +1,7 @@
<HTML>
<HEAD>
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="18 Apr 2014 version">
<META NAME="docnumber" CONTENT="29 Apr 2014 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
@ -22,7 +22,7 @@
<CENTER><H3>LAMMPS-ICMS Documentation
</H3></CENTER>
<CENTER><H4>18 Apr 2014 version
<CENTER><H4>29 Apr 2014 version
</H4></CENTER>
<H4>Version info:
</H4>

View File

@ -1,6 +1,6 @@
<HEAD>
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="18 Apr 2014 version">
<META NAME="docnumber" CONTENT="29 Apr 2014 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
@ -18,7 +18,7 @@
<H1></H1>
LAMMPS-ICMS Documentation :c,h3
18 Apr 2014 version :c,h4
29 Apr 2014 version :c,h4
Version info: :h4

View File

@ -402,10 +402,10 @@ of each style or click on the style itself for a full description:
<TR ALIGN="center"><TD ><A HREF = "fix_nve_sphere.html">nve/sphere</A></TD><TD ><A HREF = "fix_nve_tri.html">nve/tri</A></TD><TD ><A HREF = "fix_nh.html">nvt</A></TD><TD ><A HREF = "fix_nvt_asphere.html">nvt/asphere</A></TD><TD ><A HREF = "fix_nvt_sllod.html">nvt/sllod</A></TD><TD ><A HREF = "fix_nvt_sphere.html">nvt/sphere</A></TD><TD ><A HREF = "fix_oneway.html">oneway</A></TD><TD ><A HREF = "fix_orient_fcc.html">orient/fcc</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_planeforce.html">planeforce</A></TD><TD ><A HREF = "fix_poems.html">poems</A></TD><TD ><A HREF = "fix_pour.html">pour</A></TD><TD ><A HREF = "fix_press_berendsen.html">press/berendsen</A></TD><TD ><A HREF = "fix_print.html">print</A></TD><TD ><A HREF = "fix_property_atom.html">property/atom</A></TD><TD ><A HREF = "fix_qeq_comb.html">qeq/comb</A></TD><TD ><A HREF = "fix_reax_bonds.html">reax/bonds</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_recenter.html">recenter</A></TD><TD ><A HREF = "fix_restrain.html">restrain</A></TD><TD ><A HREF = "fix_rigid.html">rigid</A></TD><TD ><A HREF = "fix_rigid.html">rigid/nph</A></TD><TD ><A HREF = "fix_rigid.html">rigid/npt</A></TD><TD ><A HREF = "fix_rigid.html">rigid/nve</A></TD><TD ><A HREF = "fix_rigid.html">rigid/nvt</A></TD><TD ><A HREF = "fix_rigid.html">rigid/small</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_setforce.html">setforce</A></TD><TD ><A HREF = "fix_shake.html">shake</A></TD><TD ><A HREF = "fix_spring.html">spring</A></TD><TD ><A HREF = "fix_spring_rg.html">spring/rg</A></TD><TD ><A HREF = "fix_spring_self.html">spring/self</A></TD><TD ><A HREF = "fix_srd.html">srd</A></TD><TD ><A HREF = "fix_store_force.html">store/force</A></TD><TD ><A HREF = "fix_store_state.html">store/state</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_temp_berendsen.html">temp/berendsen</A></TD><TD ><A HREF = "fix_temp_csvr.html">temp/csvr</A></TD><TD ><A HREF = "fix_temp_rescale.html">temp/rescale</A></TD><TD ><A HREF = "fix_thermal_conductivity.html">thermal/conductivity</A></TD><TD ><A HREF = "fix_tmd.html">tmd</A></TD><TD ><A HREF = "fix_ttm.html">ttm</A></TD><TD ><A HREF = "fix_tune_kspace.html">tune/kspace</A></TD><TD ><A HREF = "fix_vector.html">vector</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_viscosity.html">viscosity</A></TD><TD ><A HREF = "fix_viscous.html">viscous</A></TD><TD ><A HREF = "fix_wall.html">wall/colloid</A></TD><TD ><A HREF = "fix_wall_gran.html">wall/gran</A></TD><TD ><A HREF = "fix_wall.html">wall/harmonic</A></TD><TD ><A HREF = "fix_wall.html">wall/lj1043</A></TD><TD ><A HREF = "fix_wall.html">wall/lj126</A></TD><TD ><A HREF = "fix_wall.html">wall/lj93</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_wall_piston.html">wall/piston</A></TD><TD ><A HREF = "fix_wall_reflect.html">wall/reflect</A></TD><TD ><A HREF = "fix_wall_region.html">wall/region</A></TD><TD ><A HREF = "fix_wall_srd.html">wall/srd</A>
<TR ALIGN="center"><TD ><A HREF = "fix_rigid.html">rigid/small/nph</A></TD><TD ><A HREF = "fix_rigid.html">rigid/small/npt</A></TD><TD ><A HREF = "fix_rigid.html">rigid/small/nve</A></TD><TD ><A HREF = "fix_rigid.html">rigid/small/nvt</A></TD><TD ><A HREF = "fix_setforce.html">setforce</A></TD><TD ><A HREF = "fix_shake.html">shake</A></TD><TD ><A HREF = "fix_spring.html">spring</A></TD><TD ><A HREF = "fix_spring_rg.html">spring/rg</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_spring_self.html">spring/self</A></TD><TD ><A HREF = "fix_srd.html">srd</A></TD><TD ><A HREF = "fix_store_force.html">store/force</A></TD><TD ><A HREF = "fix_store_state.html">store/state</A></TD><TD ><A HREF = "fix_temp_berendsen.html">temp/berendsen</A></TD><TD ><A HREF = "fix_temp_csvr.html">temp/csvr</A></TD><TD ><A HREF = "fix_temp_rescale.html">temp/rescale</A></TD><TD ><A HREF = "fix_thermal_conductivity.html">thermal/conductivity</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_tmd.html">tmd</A></TD><TD ><A HREF = "fix_ttm.html">ttm</A></TD><TD ><A HREF = "fix_tune_kspace.html">tune/kspace</A></TD><TD ><A HREF = "fix_vector.html">vector</A></TD><TD ><A HREF = "fix_viscosity.html">viscosity</A></TD><TD ><A HREF = "fix_viscous.html">viscous</A></TD><TD ><A HREF = "fix_wall.html">wall/colloid</A></TD><TD ><A HREF = "fix_wall_gran.html">wall/gran</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_wall.html">wall/harmonic</A></TD><TD ><A HREF = "fix_wall.html">wall/lj1043</A></TD><TD ><A HREF = "fix_wall.html">wall/lj126</A></TD><TD ><A HREF = "fix_wall.html">wall/lj93</A></TD><TD ><A HREF = "fix_wall_piston.html">wall/piston</A></TD><TD ><A HREF = "fix_wall_reflect.html">wall/reflect</A></TD><TD ><A HREF = "fix_wall_region.html">wall/region</A></TD><TD ><A HREF = "fix_wall_srd.html">wall/srd</A>
</TD></TR></TABLE></DIV>
<P>These are fix styles contributed by users, which can be used if

View File

@ -531,6 +531,10 @@ of each style or click on the style itself for a full description:
"rigid/nve"_fix_rigid.html,
"rigid/nvt"_fix_rigid.html,
"rigid/small"_fix_rigid.html,
"rigid/small/nph"_fix_rigid.html,
"rigid/small/npt"_fix_rigid.html,
"rigid/small/nve"_fix_rigid.html,
"rigid/small/nvt"_fix_rigid.html,
"setforce"_fix_setforce.html,
"shake"_fix_shake.html,
"spring"_fix_spring.html,

View File

@ -113,16 +113,16 @@ performed for the first invocation of the compute and then stored.
For all following invocations of the compute the number of atoms in
each Voronoi cell in the stored tessellation is counted. In this mode
the compute returns a per-atom array with 2 columns. The first column
is the number of atoms currently in the Voronoi volume defined by this
atom at the time of the first invocation of the compute (note that the
is the number of atoms currently in the Voronoi volume defined by this
atom at the time of the first invocation of the compute (note that the
atom may have moved significantly). The second column contains the
total number of atoms sharing the Voronoi cell of the stored
tessellation at the location of the current atom. Numbers in column one
can be any positive integer including zero, while column two values will
always be greater than zero. Column one data can be used to locate
vacancies (the coordinates are given by the atom coordinates at the
time step when the compute was first invoked), while column two data
can be used to identify interstitial atoms.
total number of atoms sharing the Voronoi cell of the stored
tessellation at the location of the current atom. Numbers in column
one can be any positive integer including zero, while column two
values will always be greater than zero. Column one data can be used
to locate vacancies (the coordinates are given by the atom coordinates
at the time step when the compute was first invoked), while column two
data can be used to identify interstitial atoms.
</P>
<HR>

View File

@ -21,13 +21,21 @@
</H3>
<H3>fix rigid/small command
</H3>
<H3>fix rigid/nve/small command
</H3>
<H3>fix rigid/nvt/small command
</H3>
<H3>fix rigid/npt/small command
</H3>
<H3>fix rigid/nph/small command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID style bodystyle args keyword values ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>style = <I>rigid</I> or <I>rigid/nve</I> or <I>rigid/nvt</I> or <I>rigid/npt</I> or <I>rigid/nph</I> or <I>rigid/small</I>
<LI>style = <I>rigid</I> or <I>rigid/nve</I> or <I>rigid/nvt</I> or <I>rigid/npt</I> or <I>rigid/nph</I> or <I>rigid/small</I> or <I>rigid/nve/small</I> or <I>rigid/nvt/small</I> or <I>rigid/npt/small</I> or <I>rigid/nph/small</I>
<LI>bodystyle = <I>single</I> or <I>molecule</I> or <I>group</I>
@ -39,7 +47,7 @@
</PRE>
<LI>zero or more keyword/value pairs may be appended
<LI>keyword = <I>langevin</I> or <I>temp</I> or <I>iso</I> or <I>aniso</I> or <I>x</I> or <I>y</I> or <I>z</I> or <I>couple</I> or <I>tparam</I> or <I>pchain</I> or <I>dilate</I> or <I>force</I> or <I>torque</I> or <I>infile</I> or <I>mol</I>
<LI>keyword = <I>langevin</I> or <I>temp</I> or <I>iso</I> or <I>aniso</I> or <I>x</I> or <I>y</I> or <I>z</I> or <I>couple</I> or <I>tparam</I> or <I>pchain</I> or <I>dilate</I> or <I>force</I> or <I>torque</I> or <I>infile</I>
<PRE> <I>langevin</I> values = Tstart Tstop Tperiod seed
Tstart,Tstop = desired temperature at start/stop of run (temperature units)
@ -70,7 +78,7 @@
M = which rigid body from 1-Nbody (see asterisk form below)
xflag,yflag,zflag = off/on if component of center-of-mass torque is active
<I>infile</I> filename
filename = file with per-body values of mass, center-of-mass, moments of inertia
filename = file with per-body values of mass, center-of-mass, moments of inertia
<I>mol</I> value = template-ID
template-ID = ID of molecule template specified in a separate <A HREF = "molecule.html">molecule</A> command
</PRE>
@ -87,7 +95,8 @@ fix 1 polychains rigid/small molecule langevin 1.0 1.0 1.0 428984
fix 2 fluid rigid group 3 clump1 clump2 clump3 torque * off off off
fix 1 rods rigid/npt molecule temp 300.0 300.0 100.0 iso 0.5 0.5 10.0
fix 1 particles rigid/npt molecule temp 1.0 1.0 5.0 x 0.5 0.5 1.0 z 0.5 0.5 1.0 couple xz
fix 1 water rigid/nph molecule iso 0.5 0.5 1.0
fix 1 water rigid/nph molecule iso 0.5 0.5 1.0
fix 1 particles rigid/npt/small molecule temp 1.0 1.0 1.0 iso 0.5 0.5 1.0
</PRE>
<P><B>Description:</B>
</P>
@ -292,17 +301,17 @@ iterations. The <I>rigid/nve</I> style uses the methods described in the
paper by <A HREF = "#Miller">Miller</A>, which are thought to provide better energy
conservation than an iterative approach.
</P>
<P>The <I>rigid/nvt</I> style performs constant NVT integration using a
Nose/Hoover thermostat with chains as described originally in
<A HREF = "#Hoover">(Hoover)</A> and <A HREF = "#Martyna">(Martyna)</A>, which thermostats both
the translational and rotational degrees of freedom of the rigid
bodies. The rigid-body algorithm used by <I>rigid/nvt</I> is described in
the paper by <A HREF = "#Kamberaj">Kamberaj</A>.
<P>The <I>rigid/nvt</I> and <I>rigid/nvt/small</I> styles performs constant NVT
integration using a Nose/Hoover thermostat with chains as described
originally in <A HREF = "#Hoover">(Hoover)</A> and <A HREF = "#Martyna">(Martyna)</A>, which
thermostats both the translational and rotational degrees of freedom
of the rigid bodies. The rigid-body algorithm used by <I>rigid/nvt</I>
is described in the paper by <A HREF = "#Kamberaj">Kamberaj</A>.
</P>
<P>The <I>rigid/npt</I> and <I>rigid/nph</I> styles perform constant NPT or NPH
integration using a Nose/Hoover barostat with chains. For the NPT
case, the same Nose/Hoover thermostat is also used as with
<I>rigid/nvt</I>.
<P>The <I>rigid/npt</I> and <I>rigid/nph</I> (and their /small counterparts) styles
perform constant NPT or NPH integration using a Nose/Hoover barostat
with chains. For the NPT case, the same Nose/Hoover thermostat is also
used as with <I>rigid/nvt</I>.
</P>
<P>The barostat parameters are specified using one or more of the <I>iso</I>,
<I>aniso</I>, <I>x</I>, <I>y</I>, <I>z</I> and <I>couple</I> keywords. These keywords give you
@ -312,8 +321,8 @@ they represent are varied together during a constant-pressure
simulation. The effects of these keywords are similar to those
defined in <A HREF = "fix_nh.html">fix npt/nph</A>
</P>
<P>NOTE: Currently the <I>rigid/npt</I> and <I>rigid/nph</I> styles do not support
triclinic (non-orthongonal) boxes.
<P>NOTE: Currently the <I>rigid/npt</I> and <I>rigid/nph</I> (and their /small
counterparts) styles do not support triclinic (non-orthongonal) boxes.
</P>
<P>The target pressures for each of the 6 components of the stress tensor
can be specified independently via the <I>x</I>, <I>y</I>, <I>z</I> keywords, which
@ -483,12 +492,10 @@ have to list attributes for every rigid body integrated by fix rigid.
Only bodies which the file specifies will have their computed
attributes overridden. The file can contain initial blank lines or
comment lines starting with "#" which are ignored. The first
non-blank, non-comment line should list N, which is the number of
lines to follow. The N successive lines contain the following
information:
non-blank, non-comment line should list N = the number of lines to
follow. The N successive lines contain the following information:
</P>
<PRE>N
ID1 masstotal xcm ycm zcm ixx iyy izz ixy ixz iyz
<PRE>ID1 masstotal xcm ycm zcm ixx iyy izz ixy ixz iyz
ID2 masstotal xcm ycm zcm ixx iyy izz ixy ixz iyz
...
IDN masstotal xcm ycm zcm ixx iyy izz ixy ixz iyz

View File

@ -12,13 +12,17 @@ fix rigid/nvt command :h3
fix rigid/npt command :h3
fix rigid/nph command :h3
fix rigid/small command :h3
fix rigid/nve/small command :h3
fix rigid/nvt/small command :h3
fix rigid/npt/small command :h3
fix rigid/nph/small command :h3
[Syntax:]
fix ID group-ID style bodystyle args keyword values ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
style = {rigid} or {rigid/nve} or {rigid/nvt} or {rigid/npt} or {rigid/nph} or {rigid/small} :l
style = {rigid} or {rigid/nve} or {rigid/nvt} or {rigid/npt} or {rigid/nph} or {rigid/small} or {rigid/nve/small} or {rigid/nvt/small} or {rigid/npt/small} or {rigid/nph/small} :l
bodystyle = {single} or {molecule} or {group} :l
{single} args = none
{molecule} args = none
@ -27,7 +31,7 @@ bodystyle = {single} or {molecule} or {group} :l
groupID1, groupID2, ... = list of N group IDs :pre
zero or more keyword/value pairs may be appended :l
keyword = {langevin} or {temp} or {iso} or {aniso} or {x} or {y} or {z} or {couple} or {tparam} or {pchain} or {dilate} or {force} or {torque} or {infile} or {mol} :l
keyword = {langevin} or {temp} or {iso} or {aniso} or {x} or {y} or {z} or {couple} or {tparam} or {pchain} or {dilate} or {force} or {torque} or {infile} :l
{langevin} values = Tstart Tstop Tperiod seed
Tstart,Tstop = desired temperature at start/stop of run (temperature units)
Tdamp = temperature damping parameter (time units)
@ -57,7 +61,7 @@ keyword = {langevin} or {temp} or {iso} or {aniso} or {x} or {y} or {z} or {coup
M = which rigid body from 1-Nbody (see asterisk form below)
xflag,yflag,zflag = off/on if component of center-of-mass torque is active
{infile} filename
filename = file with per-body values of mass, center-of-mass, moments of inertia
filename = file with per-body values of mass, center-of-mass, moments of inertia
{mol} value = template-ID
template-ID = ID of molecule template specified in a separate "molecule"_molecule.html command :pre
:ule
@ -73,8 +77,9 @@ fix 1 polychains rigid/small molecule langevin 1.0 1.0 1.0 428984
fix 2 fluid rigid group 3 clump1 clump2 clump3 torque * off off off
fix 1 rods rigid/npt molecule temp 300.0 300.0 100.0 iso 0.5 0.5 10.0
fix 1 particles rigid/npt molecule temp 1.0 1.0 5.0 x 0.5 0.5 1.0 z 0.5 0.5 1.0 couple xz
fix 1 water rigid/nph molecule iso 0.5 0.5 1.0 :pre
fix 1 water rigid/nph molecule iso 0.5 0.5 1.0
fix 1 particles rigid/npt/small molecule temp 1.0 1.0 1.0 iso 0.5 0.5 1.0 :pre
[Description:]
Treat one or more sets of atoms as independent rigid bodies. This
@ -278,17 +283,17 @@ iterations. The {rigid/nve} style uses the methods described in the
paper by "Miller"_#Miller, which are thought to provide better energy
conservation than an iterative approach.
The {rigid/nvt} style performs constant NVT integration using a
Nose/Hoover thermostat with chains as described originally in
"(Hoover)"_#Hoover and "(Martyna)"_#Martyna, which thermostats both
the translational and rotational degrees of freedom of the rigid
bodies. The rigid-body algorithm used by {rigid/nvt} is described in
the paper by "Kamberaj"_#Kamberaj.
The {rigid/nvt} and {rigid/nvt/small} styles performs constant NVT
integration using a Nose/Hoover thermostat with chains as described
originally in "(Hoover)"_#Hoover and "(Martyna)"_#Martyna, which
thermostats both the translational and rotational degrees of freedom
of the rigid bodies. The rigid-body algorithm used by {rigid/nvt}
is described in the paper by "Kamberaj"_#Kamberaj.
The {rigid/npt} and {rigid/nph} styles perform constant NPT or NPH
integration using a Nose/Hoover barostat with chains. For the NPT
case, the same Nose/Hoover thermostat is also used as with
{rigid/nvt}.
The {rigid/npt} and {rigid/nph} (and their /small counterparts) styles
perform constant NPT or NPH integration using a Nose/Hoover barostat
with chains. For the NPT case, the same Nose/Hoover thermostat is also
used as with {rigid/nvt}.
The barostat parameters are specified using one or more of the {iso},
{aniso}, {x}, {y}, {z} and {couple} keywords. These keywords give you
@ -298,8 +303,8 @@ they represent are varied together during a constant-pressure
simulation. The effects of these keywords are similar to those
defined in "fix npt/nph"_fix_nh.html
NOTE: Currently the {rigid/npt} and {rigid/nph} styles do not support
triclinic (non-orthongonal) boxes.
NOTE: Currently the {rigid/npt} and {rigid/nph} (and their /small
counterparts) styles do not support triclinic (non-orthongonal) boxes.
The target pressures for each of the 6 components of the stress tensor
can be specified independently via the {x}, {y}, {z} keywords, which
@ -469,11 +474,9 @@ have to list attributes for every rigid body integrated by fix rigid.
Only bodies which the file specifies will have their computed
attributes overridden. The file can contain initial blank lines or
comment lines starting with "#" which are ignored. The first
non-blank, non-comment line should list N, which is the number of
lines to follow. The N successive lines contain the following
information:
non-blank, non-comment line should list N = the number of lines to
follow. The N successive lines contain the following information:
N
ID1 masstotal xcm ycm zcm ixx iyy izz ixy ixz iyz
ID2 masstotal xcm ycm zcm ixx iyy izz ixy ixz iyz
...

View File

@ -53,7 +53,7 @@ For example the velocity auto-correlation function (VACF) can be
time-integrated, to yield a diffusion coefficient, as follows:
</P>
<PRE>compute 2 all vacf
fix 5 all vector 1 c_2<B>4</B>
fix 5 all vector 1 c_2[4]
variable diff equal dt*trap(f_5)
thermo_style custom step v_diff
</PRE>

View File

@ -112,8 +112,12 @@ int SWT::init(const int ntypes, const int nlocal, const int nall, const int max_
sw3.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY);
for (int i=0; i<nparams; i++) {
dview[i].x=static_cast<numtyp>(cut[i]);
dview[i].y=static_cast<numtyp>(cutsq[i]);
double sw_cut = cut[i];
double sw_cutsq = cutsq[i];
if (sw_cutsq>=sw_cut*sw_cut)
sw_cutsq=sw_cut*sw_cut-1e-4;
dview[i].x=static_cast<numtyp>(sw_cut);
dview[i].y=static_cast<numtyp>(sw_cutsq);
dview[i].z=static_cast<numtyp>(costheta[i]);
dview[i].w=(numtyp)0;
}

View File

@ -195,17 +195,17 @@ __kernel void k_sw(const __global numtyp4 *restrict x_,
numtyp sw_cut=sw3_ijparam.x;
numtyp sw_cutsq=sw3_ijparam.y;
numtyp pre_sw_c1=sw_biga*sw_epsilon*sw_powerp*sw_bigb*
pow(sw_sigma,sw_powerp);
ucl_powr(sw_sigma,sw_powerp);
numtyp pre_sw_c2=sw_biga*sw_epsilon*sw_powerq*
pow(sw_sigma,sw_powerq);
ucl_powr(sw_sigma,sw_powerq);
numtyp pre_sw_c3=sw_biga*sw_epsilon*sw_bigb*
pow(sw_sigma,sw_powerp+(numtyp)1.0);
ucl_powr(sw_sigma,sw_powerp+(numtyp)1.0);
numtyp pre_sw_c4=sw_biga*sw_epsilon*
pow(sw_sigma,sw_powerq+(numtyp)1.0);
ucl_powr(sw_sigma,sw_powerq+(numtyp)1.0);
numtyp pre_sw_c5=sw_biga*sw_epsilon*sw_bigb*
pow(sw_sigma,sw_powerp);
ucl_powr(sw_sigma,sw_powerp);
numtyp pre_sw_c6=sw_biga*sw_epsilon*
pow(sw_sigma,sw_powerq);
ucl_powr(sw_sigma,sw_powerq);
numtyp r=ucl_sqrt(rsq);
numtyp rp=ucl_powr(r,-sw_powerp);
@ -343,7 +343,6 @@ __kernel void k_sw_three_center(const __global numtyp4 *restrict x_,
const int t_per_atom, const int evatom) {
__local int tpa_sq, n_stride;
tpa_sq=fast_mul(t_per_atom,t_per_atom);
numtyp sw_epsilon, sw_sigma, sw_lambda, sw_gamma;
numtyp sw_sigma_gamma_ij, sw_cut_ij, sw_sigma_gamma_ik, sw_cut_ik;
numtyp sw_costheta_ijk, sw_lambda_epsilon_ijk, sw_lambda_epsilon2_ijk;
@ -467,7 +466,6 @@ __kernel void k_sw_three_end(const __global numtyp4 *restrict x_,
const int t_per_atom) {
__local int tpa_sq, n_stride;
tpa_sq=fast_mul(t_per_atom,t_per_atom);
numtyp sw_epsilon, sw_sigma, sw_lambda, sw_gamma;
numtyp sw_sigma_gamma_ij, sw_cut_ij, sw_sigma_gamma_ik, sw_cut_ik;
numtyp sw_costheta_ijk, sw_lambda_epsilon_ijk, sw_lambda_epsilon2_ijk;
@ -515,12 +513,14 @@ __kernel void k_sw_three_end(const __global numtyp4 *restrict x_,
if (rsq1 > sw3_ijparam.y) continue;
numtyp4 sw1_ijparam; fetch4(sw1_ijparam,ijparam,sw1_tex);
sw_sigma_gamma_ij=sw1_ijparam.y*sw1_ijparam.w; //sw_sigma*sw_gamma;
sw_cut_ij=sw3_ijparam.x;
int jiparam=elem2param[jtype*nelements*nelements+itype*nelements+itype];
numtyp4 sw1_jiparam; fetch4(sw1_jiparam,jiparam,sw1_tex);
numtyp4 sw3_jiparam; fetch4(sw3_jiparam,jiparam,sw3_tex);
sw_sigma_gamma_ij=sw1_jiparam.y*sw1_jiparam.w; //sw_sigma*sw_gamma;
sw_cut_ij=sw3_jiparam.x;
int nbor_k=*dev_nbor+j+nbor_pitch;
int numk=nbor_k;
int numk=nbor_k;
if (dev_nbor==dev_packed) {
nbor_k+=nbor_pitch+fast_mul(j,t_per_atom-1);
k_end=nbor_k+fast_mul(numk/t_per_atom,n_stride)+(numk & (t_per_atom-1));
@ -541,25 +541,25 @@ __kernel void k_sw_three_end(const __global numtyp4 *restrict x_,
numtyp4 kx; fetch4(kx,k,pos_tex);
int ktype=kx.w;
ktype=map[ktype];
int ikparam=elem2param[itype*nelements*nelements+ktype*nelements+ktype];
int jkparam=elem2param[jtype*nelements*nelements+ktype*nelements+ktype];
numtyp delr2x = kx.x - jx.x;
numtyp delr2y = kx.y - jx.y;
numtyp delr2z = kx.z - jx.z;
numtyp rsq2 = delr2x*delr2x + delr2y*delr2y + delr2z*delr2z;
numtyp4 sw3_ikparam; fetch4(sw3_ikparam,ikparam,sw3_tex);
numtyp4 sw3_jkparam; fetch4(sw3_jkparam,jkparam,sw3_tex);
if (rsq2 < sw3_ikparam.y) {
numtyp4 sw1_ikparam; fetch4(sw1_ikparam,ikparam,sw1_tex);
sw_sigma_gamma_ik=sw1_ikparam.y*sw1_ikparam.w; //sw_sigma*sw_gamma;
sw_cut_ik=sw3_ikparam.x;
if (rsq2 < sw3_jkparam.y) {
numtyp4 sw1_jkparam; fetch4(sw1_jkparam,jkparam,sw1_tex);
sw_sigma_gamma_ik=sw1_jkparam.y*sw1_jkparam.w; //sw_sigma*sw_gamma;
sw_cut_ik=sw3_jkparam.x;
int ijkparam=elem2param[itype*nelements*nelements+jtype*nelements+ktype];
numtyp4 sw1_ijkparam; fetch4(sw1_ijkparam,ijkparam,sw1_tex);
sw_lambda_epsilon_ijk=sw1_ijkparam.x*sw1_ijkparam.z; //sw_lambda*sw_epsilon;
int jikparam=elem2param[jtype*nelements*nelements+itype*nelements+ktype];
numtyp4 sw1_jikparam; fetch4(sw1_jikparam,jikparam,sw1_tex);
sw_lambda_epsilon_ijk=sw1_jikparam.x*sw1_jikparam.z; //sw_lambda*sw_epsilon;
sw_lambda_epsilon2_ijk=(numtyp)2.0*sw_lambda_epsilon_ijk;
numtyp4 sw3_ijkparam; fetch4(sw3_ijkparam,ijkparam,sw3_tex);
sw_costheta_ijk=sw3_ijkparam.z;
numtyp4 sw3_jikparam; fetch4(sw3_jikparam,jikparam,sw3_tex);
sw_costheta_ijk=sw3_jikparam.z;
numtyp fjx, fjy, fjz;
//if (evatom==0) {
@ -602,7 +602,6 @@ __kernel void k_sw_three_end_vatom(const __global numtyp4 *restrict x_,
const int t_per_atom) {
__local int tpa_sq, n_stride;
tpa_sq=fast_mul(t_per_atom,t_per_atom);
numtyp sw_epsilon, sw_sigma, sw_lambda, sw_gamma;
numtyp sw_sigma_gamma_ij, sw_cut_ij, sw_sigma_gamma_ik, sw_cut_ik;
numtyp sw_costheta_ijk, sw_lambda_epsilon_ijk, sw_lambda_epsilon2_ijk;
@ -650,10 +649,12 @@ __kernel void k_sw_three_end_vatom(const __global numtyp4 *restrict x_,
if (rsq1 > sw3_ijparam.y) continue;
numtyp4 sw1_ijparam; fetch4(sw1_ijparam,ijparam,sw1_tex);
sw_sigma_gamma_ij=sw1_ijparam.y*sw1_ijparam.w; //sw_sigma*sw_gamma;
sw_cut_ij=sw3_ijparam.x;
int jiparam=elem2param[jtype*nelements*nelements+itype*nelements+itype];
numtyp4 sw1_jiparam; fetch4(sw1_jiparam,jiparam,sw1_tex);
numtyp4 sw3_jiparam; fetch4(sw3_jiparam,jiparam,sw3_tex);
sw_sigma_gamma_ij=sw1_jiparam.y*sw1_jiparam.w; //sw_sigma*sw_gamma;
sw_cut_ij=sw3_jiparam.x;
int nbor_k=*dev_nbor+j+nbor_pitch;
int numk=nbor_k;
if (dev_nbor==dev_packed) {
@ -676,25 +677,25 @@ __kernel void k_sw_three_end_vatom(const __global numtyp4 *restrict x_,
numtyp4 kx; fetch4(kx,k,pos_tex);
int ktype=kx.w;
ktype=map[ktype];
int ikparam=elem2param[itype*nelements*nelements+ktype*nelements+ktype];
numtyp4 sw3_ikparam; fetch4(sw3_ikparam,ikparam,sw3_tex);
int jkparam=elem2param[jtype*nelements*nelements+ktype*nelements+ktype];
numtyp4 sw3_jkparam; fetch4(sw3_jkparam,jkparam,sw3_tex);
numtyp delr2x = kx.x - jx.x;
numtyp delr2y = kx.y - jx.y;
numtyp delr2z = kx.z - jx.z;
numtyp rsq2 = delr2x*delr2x + delr2y*delr2y + delr2z*delr2z;
if (rsq2 < sw3_ikparam.y) {
numtyp4 sw1_ikparam; fetch4(sw1_ikparam,ikparam,sw1_tex);
sw_sigma_gamma_ik=sw1_ikparam.y*sw1_ikparam.w; //sw_sigma*sw_gamma;
sw_cut_ik=sw3_ikparam.x;
if (rsq2 < sw3_jkparam.y) {
numtyp4 sw1_jkparam; fetch4(sw1_jkparam,jkparam,sw1_tex);
sw_sigma_gamma_ik=sw1_jkparam.y*sw1_jkparam.w; //sw_sigma*sw_gamma;
sw_cut_ik=sw3_jkparam.x;
int ijkparam=elem2param[itype*nelements*nelements+jtype*nelements+ktype];
numtyp4 sw1_ijkparam; fetch4(sw1_ijkparam,ijkparam,sw1_tex);
sw_lambda_epsilon_ijk=sw1_ijkparam.x*sw1_ijkparam.z; //sw_lambda*sw_epsilon;
int jikparam=elem2param[jtype*nelements*nelements+itype*nelements+ktype];
numtyp4 sw1_jikparam; fetch4(sw1_jikparam,jikparam,sw1_tex);
sw_lambda_epsilon_ijk=sw1_jikparam.x*sw1_jikparam.z; //sw_lambda*sw_epsilon;
sw_lambda_epsilon2_ijk=(numtyp)2.0*sw_lambda_epsilon_ijk;
numtyp4 sw3_ijkparam; fetch4(sw3_ijkparam,ijkparam,sw3_tex);
sw_costheta_ijk=sw3_ijkparam.z;
numtyp4 sw3_jikparam; fetch4(sw3_jikparam,jikparam,sw3_tex);
sw_costheta_ijk=sw3_jikparam.z;
numtyp fjx, fjy, fjz, fkx, fky, fkz;
threebody(delr1x,delr1y,delr1z,eflag,energy);

View File

@ -210,7 +210,8 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
// volume_one = volume of inserted particle (with max possible radius)
// in 3d, insure dy >= 1, for quasi-2d simulations
double volume,volume_one=0.0;
double volume,volume_one=1.0;
if (domain->dimension == 3) {
if (region_style == 1) {
double dy = yhi - ylo;

View File

@ -466,17 +466,17 @@ void FixDeposit::pre_exchange()
for (j = 0; j < nfix; j++)
if (fix[j]->create_attribute) fix[j]->set_arrays(n);
}
// FixRigidSmall::set_molecule stores rigid body attributes
// coord is new position of geometric center of mol, not COM
// FixShake::set_molecule stores shake info for molecule
if (rigidflag)
fixrigid->set_molecule(nlocalprev,maxtag_all,coord,vnew,quat);
else if (shakeflag)
fixshake->set_molecule(nlocalprev,maxtag_all,coord,vnew,quat);
}
// FixRigidSmall::set_molecule stores rigid body attributes
// coord is new position of geometric center of mol, not COM
// FixShake::set_molecule stores shake info for molecule
if (rigidflag)
fixrigid->set_molecule(nlocalprev,maxtag_all,coord,vnew,quat);
else if (shakeflag)
fixshake->set_molecule(nlocalprev,maxtag_all,coord,vnew,quat);
// old code: unsuccessful if no proc performed insertion of an atom
// don't think that check is necessary
// if get this far, should always be succesful

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,195 @@
/* ----------------------------------------------------------------------
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 LMP_FIX_RIGID_NH_SMALL_H
#define LMP_FIX_RIGID_NH_SMALL_H
#include "fix_rigid_small.h"
namespace LAMMPS_NS {
class FixRigidNHSmall : public FixRigidSmall {
public:
FixRigidNHSmall(class LAMMPS *, int, char **);
virtual ~FixRigidNHSmall();
virtual int setmask();
virtual void init();
virtual void setup(int);
virtual void initial_integrate(int);
virtual void final_integrate();
virtual double compute_scalar();
int modify_param(int, char **);
void write_restart(FILE *);
void restart(char *buf);
void reset_target(double);
protected:
double boltz,nktv2p,mvv2e; // boltzman constant, conversion factors
int dimension; // # of dimensions
int nf_t,nf_r; // trans/rot degrees of freedom
double onednft,onednfr; // factors 1 + dimension/trans(rot) degrees of freedom
double *w,*wdti1,*wdti2,*wdti4; // Yoshida-Suzuki coefficients
double *q_t,*q_r; // trans/rot thermostat masses
double *eta_t,*eta_r; // trans/rot thermostat positions
double *eta_dot_t,*eta_dot_r; // trans/rot thermostat velocities
double *f_eta_t,*f_eta_r; // trans/rot thermostat forces
double epsilon_mass[3], *q_b; // baro/thermo masses
double epsilon[3],*eta_b; // baro/thermo positions
double epsilon_dot[3],*eta_dot_b; // baro/thermo velocities
double *f_eta_b; // thermo forces
double akin_t,akin_r; // translational/rotational kinetic energies
int kspace_flag; // 1 if KSpace invoked, 0 if not
int nrigidfix; // number of rigid fixes
int *rfix; // indicies of rigid fixes
double vol0; // reference volume
double t0; // reference temperature
int pdim,g_f; // number of barostatted dims, total DoFs
double p_hydro; // hydrostatic target pressure
double p_freq_max; // maximum barostat frequency
double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections
double t_target,t_current;
double t_freq;
char *id_temp,*id_press;
class Compute *temperature,*pressure;
int tcomputeflag,pcomputeflag;
void couple();
void remap();
void nhc_temp_integrate();
void nhc_press_integrate();
virtual void compute_temp_target();
void compute_press_target();
void nh_epsilon_dot();
void allocate_chain();
void allocate_order();
void deallocate_chain();
void deallocate_order();
void no_squish_rotate(int, double *, double *, double *, double);
inline double maclaurin_series(double);
};
inline double FixRigidNHSmall::maclaurin_series(double x)
{
double x2,x4;
x2 = x * x;
x4 = x2 * x2;
return (1.0 + (1.0/6.0) * x2 + (1.0/120.0) * x4 + (1.0/5040.0) * x2 * x4 +
(1.0/362880.0) * x4 * x4);
}
}
#endif
/* ERROR/WARNING messages:
E: Fix rigid npt/nph period must be > 0.0
Self-explanatory.
E: Invalid fix rigid npt/nph command for a 2d simulation
Cannot control z dimension in a 2d model.
E: Invalid fix rigid npt/nph command pressure settings
If multiple dimensions are coupled, those dimensions must be
specified.
E: Cannot use fix rigid npt/nph on a non-periodic dimension
When specifying a diagonal pressure component, the dimension must be
periodic.
E: Invalid fix rigid npt/nph pressure settings
Settings for coupled dimensions must be the same.
E: Fix rigid nvt/npt/nph damping parameters must be > 0.0
Self-explanatory.
E: Fix rigid npt/nph dilate group ID does not exist
Self-explanatory.
E: Temp ID for fix rigid npt/nph does not exist
Specified compute temperature must be valid.
E: fix rigid npt/nph does not yet allow triclinic box
Self-explanatory.
E: Cannot use fix rigid npt/nph and fix deform on same component of stress tensor
This would be changing the same box dimension twice.
E: Press ID for fix rigid npt/nph does not exist
Specified compute pressure must be valid.
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Could not find fix_modify temperature ID
The compute ID for computing temperature does not exist.
E: Fix_modify temperature ID does not compute temperature
The compute ID assigned to the fix must compute temperature.
W: Temperature for fix modify is not for group all
The temperature compute is being used with a pressure calculation
which does operate on group all, so this may be inconsistent.
E: Pressure ID for fix modify does not exist
Self-explanatory.
E: Could not find fix_modify pressure ID
The compute ID for computing pressure does not exist.
E: Fix_modify pressure ID does not compute pressure
The compute ID assigned to the fix must compute pressure.
U: Target temperature for fix rigid nvt/npt cannot be 0.0
Self-explanatory.
U: Temperature ID for fix rigid npt/nph does not exist
Self-explanatory.
U: Pressure ID for fix rigid npt/nph does not exist
Self-explanatory.
*/

View File

@ -0,0 +1,92 @@
/* ----------------------------------------------------------------------
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 author: Trung Dac Nguyen (ORNL)
references: Kamberaj et al., J. Chem. Phys. 122, 224114 (2005)
Miller et al., J Chem Phys. 116, 8649-8659 (2002)
------------------------------------------------------------------------- */
#include "string.h"
#include "fix_rigid_nph_small.h"
#include "domain.h"
#include "modify.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
FixRigidNPHSmall::FixRigidNPHSmall(LAMMPS *lmp, int narg, char **arg) :
FixRigidNHSmall(lmp, narg, arg)
{
// other setting are made by parent
scalar_flag = 1;
restart_global = 1;
box_change_size = 1;
extscalar = 1;
// error checks
if (pstat_flag == 0)
error->all(FLERR,"Pressure control must be used with fix nph");
if (tstat_flag == 1)
error->all(FLERR,"Temperature control must not be used with fix nph");
if (p_start[0] < 0.0 || p_start[1] < 0.0 || p_start[2] < 0.0 ||
p_stop[0] < 0.0 || p_stop[1] < 0.0 || p_stop[2] < 0.0)
error->all(FLERR,"Target pressure for fix rigid/nph cannot be 0.0");
// convert input periods to frequency
p_freq[0] = p_freq[1] = p_freq[2] = 0.0;
if (p_flag[0]) p_freq[0] = 1.0 / p_period[0];
if (p_flag[1]) p_freq[1] = 1.0 / p_period[1];
if (p_flag[2]) p_freq[2] = 1.0 / p_period[2];
// create a new compute temp style
// id = fix-ID + temp
// compute group = all since pressure is always global (group all)
// and thus its KE/temperature contribution should use group all
int n = strlen(id) + 6;
id_temp = new char[n];
strcpy(id_temp,id);
strcat(id_temp,"_temp");
char **newarg = new char*[3];
newarg[0] = id_temp;
newarg[1] = (char *) "all";
newarg[2] = (char *) "temp";
modify->add_compute(3,newarg);
delete [] newarg;
tcomputeflag = 1;
// create a new compute pressure style
// id = fix-ID + press, compute group = all
// pass id_temp as 4th arg to pressure constructor
n = strlen(id) + 7;
id_press = new char[n];
strcpy(id_press,id);
strcat(id_press,"_press");
newarg = new char*[4];
newarg[0] = id_press;
newarg[1] = (char *) "all";
newarg[2] = (char *) "pressure";
newarg[3] = id_temp;
modify->add_compute(4,newarg);
delete [] newarg;
pcomputeflag = 1;
}

View File

@ -0,0 +1,53 @@
/* ----------------------------------------------------------------------
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.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(rigid/nph/small,FixRigidNPHSmall)
#else
#ifndef LMP_FIX_RIGID_NPH_SMALL_H
#define LMP_FIX_RIGID_NPH_SMALL_H
#include "fix_rigid_nh_small.h"
namespace LAMMPS_NS {
class FixRigidNPHSmall : public FixRigidNHSmall {
public:
FixRigidNPHSmall(class LAMMPS *, int, char **);
~FixRigidNPHSmall() {}
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Pressure control must be used with fix rigid nph/small
UNDOCUMENTED
E: Temperature control must not be used with fix rigid/nph/small
UNDOCUMENTED
E: Target pressure for fix rigid/nph/small cannot be 0.0
UNDOCUMENTED
*/

View File

@ -0,0 +1,104 @@
/* ----------------------------------------------------------------------
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 author: Trung Dac Nguyen (ORNL)
references: Kamberaj et al., J. Chem. Phys. 122, 224114 (2005)
Miller et al., J Chem Phys. 116, 8649-8659 (2002)
------------------------------------------------------------------------- */
#include "string.h"
#include "fix_rigid_npt_small.h"
#include "domain.h"
#include "modify.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
FixRigidNPTSmall::FixRigidNPTSmall(LAMMPS *lmp, int narg, char **arg) :
FixRigidNHSmall(lmp, narg, arg)
{
// other setting are made by parent
scalar_flag = 1;
restart_global = 1;
box_change_size = 1;
extscalar = 1;
// error checks
if (tstat_flag == 0 || pstat_flag == 0)
error->all(FLERR,"Did not set temp or press for fix rigid/npt/small");
if (t_start <= 0.0 || t_stop <= 0.0)
error->all(FLERR,"Target temperature for fix rigid/npt/small cannot be 0.0");
if (p_start[0] < 0.0 || p_start[1] < 0.0 || p_start[2] < 0.0 ||
p_stop[0] < 0.0 || p_stop[1] < 0.0 || p_stop[2] < 0.0)
error->all(FLERR,"Target pressure for fix rigid/npt/small cannot be 0.0");
if (t_period <= 0.0) error->all(FLERR,"Fix rigid/npt/small period must be > 0.0");
// thermostat chain parameters
if (t_chain < 1) error->all(FLERR,"Illegal fix_modify command");
if (t_iter < 1) error->all(FLERR,"Illegal fix_modify command");
if (t_order != 3 && t_order != 5)
error->all(FLERR,"Fix_modify order must be 3 or 5");
// convert input periods to frequency
t_freq = 0.0;
p_freq[0] = p_freq[1] = p_freq[2] = 0.0;
t_freq = 1.0 / t_period;
if (p_flag[0]) p_freq[0] = 1.0 / p_period[0];
if (p_flag[1]) p_freq[1] = 1.0 / p_period[1];
if (p_flag[2]) p_freq[2] = 1.0 / p_period[2];
// create a new compute temp style
// id = fix-ID + temp
// compute group = all since pressure is always global (group all)
// and thus its KE/temperature contribution should use group all
int n = strlen(id) + 6;
id_temp = new char[n];
strcpy(id_temp,id);
strcat(id_temp,"_temp");
char **newarg = new char*[3];
newarg[0] = id_temp;
newarg[1] = (char *) "all";
newarg[2] = (char *) "temp";
modify->add_compute(3,newarg);
delete [] newarg;
tcomputeflag = 1;
// create a new compute pressure style
// id = fix-ID + press, compute group = all
// pass id_temp as 4th arg to pressure constructor
n = strlen(id) + 7;
id_press = new char[n];
strcpy(id_press,id);
strcat(id_press,"_press");
newarg = new char*[4];
newarg[0] = id_press;
newarg[1] = (char *) "all";
newarg[2] = (char *) "pressure";
newarg[3] = id_temp;
modify->add_compute(4,newarg);
delete [] newarg;
pcomputeflag = 1;
}

View File

@ -0,0 +1,65 @@
/* ----------------------------------------------------------------------
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.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(rigid/npt/small,FixRigidNPTSmall)
#else
#ifndef LMP_FIX_RIGID_NPT_SMALL_H
#define LMP_FIX_RIGID_NPT_SMALL_H
#include "fix_rigid_nh_small.h"
namespace LAMMPS_NS {
class FixRigidNPTSmall : public FixRigidNHSmall {
public:
FixRigidNPTSmall(class LAMMPS *, int, char **);
~FixRigidNPTSmall() {}
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Did not set temp or press for fix rigid/npt/small
UNDOCUMENTED
E: Target temperature for fix rigid/npt/small cannot be 0.0
UNDOCUMENTED
E: Target pressure for fix rigid/npt/small cannot be 0.0
UNDOCUMENTED
E: Fix rigid/npt/small period must be > 0.0
UNDOCUMENTED
E: Illegal ... command
UNDOCUMENTED
E: Fix_modify order must be 3 or 5
UNDOCUMENTED
*/

View File

@ -0,0 +1,28 @@
/* ----------------------------------------------------------------------
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 author: Trung Dac Nguyen (ORNL)
references: Kamberaj et al., J. Chem. Phys. 122, 224114 (2005)
Miller et al., J Chem Phys. 116, 8649-8659 (2002)
------------------------------------------------------------------------- */
#include "fix_rigid_nve_small.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
FixRigidNVESmall::FixRigidNVESmall(LAMMPS *lmp, int narg, char **arg) :
FixRigidNHSmall(lmp, narg, arg) {}

View File

@ -0,0 +1,36 @@
/* ----------------------------------------------------------------------
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.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(rigid/nve/small,FixRigidNVESmall)
#else
#ifndef LMP_FIX_RIGID_NVE_SMALL_H
#define LMP_FIX_RIGID_NVE_SMALL_H
#include "fix_rigid_nh_small.h"
namespace LAMMPS_NS {
class FixRigidNVESmall : public FixRigidNHSmall {
public:
FixRigidNVESmall(class LAMMPS *, int, char **);
~FixRigidNVESmall() {}
};
}
#endif
#endif

View File

@ -0,0 +1,50 @@
/* ----------------------------------------------------------------------
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 author: Trung Dac Nguyen (ORNL)
references: Kamberaj et al., J. Chem. Phys. 122, 224114 (2005)
Miller et al., J Chem Phys. 116, 8649-8659 (2002)
------------------------------------------------------------------------- */
#include "fix_rigid_nvt_small.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
FixRigidNVTSmall::FixRigidNVTSmall(LAMMPS *lmp, int narg, char **arg) :
FixRigidNHSmall(lmp, narg, arg)
{
// other settings are made by parent
scalar_flag = 1;
restart_global = 1;
extscalar = 1;
// error checking
// convert input period to frequency
if (tstat_flag == 0)
error->all(FLERR,"Did not set temp for fix rigid/nvt/small");
if (t_start < 0.0 || t_stop <= 0.0)
error->all(FLERR,"Target temperature for fix rigid/nvt/small cannot be 0.0");
if (t_period <= 0.0) error->all(FLERR,"Fix rigid/nvt/small period must be > 0.0");
t_freq = 1.0 / t_period;
if (t_chain < 1) error->all(FLERR,"Fix rigid nvt/small t_chain should not be less than 1");
if (t_iter < 1) error->all(FLERR,"Fix rigid nvt/small t_iter should not be less than 1");
if (t_order != 3 && t_order != 5)
error->all(FLERR,"Fix rigid nvt/small t_order must be 3 or 5");
}

View File

@ -0,0 +1,60 @@
/* ----------------------------------------------------------------------
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.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(rigid/nvt/small,FixRigidNVTSmall)
#else
#ifndef LMP_FIX_RIGID_NVT_SMALL_H
#define LMP_FIX_RIGID_NVT_SMALL_H
#include "fix_rigid_nh_small.h"
namespace LAMMPS_NS {
class FixRigidNVTSmall : public FixRigidNHSmall {
public:
FixRigidNVTSmall(class LAMMPS *, int, char **);
~FixRigidNVTSmall() {}
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Did not set temp for fix rigid/nvt/small
UNDOCUMENTED
E: Target temperature for fix rigid/nvt/small cannot be 0.0
UNDOCUMENTED
E: Fix rigid/nvt/small period must be > 0.0
UNDOCUMENTED
E: Illegal ... command
UNDOCUMENTED
E: Fix_modify order must be 3 or 5
UNDOCUMENTED
*/

View File

@ -59,6 +59,9 @@ FixRigidSmall *FixRigidSmall::frsptr;
#define DELTA_BODY 10000
enum{NONE,XYZ,XY,YZ,XZ}; // same as in FixRigid
enum{ISO,ANISO,TRICLINIC}; // same as in FixRigid
enum{FULL_BODY,INITIAL,FINAL,FORCE_TORQUE,VCM_ANGMOM,XCM_MASS,ITENSOR,DOF};
/* ---------------------------------------------------------------------- */
@ -125,6 +128,23 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) :
infile = NULL;
onemol = NULL;
tstat_flag = 0;
pstat_flag = 0;
allremap = 1;
id_dilate = NULL;
t_chain = 10;
t_iter = 1;
t_order = 3;
p_chain = 10;
pcouple = NONE;
pstyle = ANISO;
for (int i = 0; i < 3; i++) {
p_start[i] = p_stop[i] = p_period[i] = 0.0;
p_flag[i] = 0;
}
int iarg = 4;
while (iarg < narg) {
if (strcmp(arg[iarg],"langevin") == 0) {
@ -159,6 +179,121 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) :
"fix rigid/small has multiple molecules");
onemol = atom->molecules[imol];
iarg += 2;
} else if (strcmp(arg[iarg],"temp") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command");
if (strcmp(style,"rigid/nvt/small") != 0 &&
strcmp(style,"rigid/npt/small") != 0)
error->all(FLERR,"Illegal fix rigid command");
tstat_flag = 1;
t_start = force->numeric(FLERR,arg[iarg+1]);
t_stop = force->numeric(FLERR,arg[iarg+2]);
t_period = force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"iso") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command");
if (strcmp(style,"rigid/npt/small") != 0 &&
strcmp(style,"rigid/nph/small") != 0)
error->all(FLERR,"Illegal fix rigid/small command");
pcouple = XYZ;
p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] =
force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
if (domain->dimension == 2) {
p_start[2] = p_stop[2] = p_period[2] = 0.0;
p_flag[2] = 0;
}
iarg += 4;
} else if (strcmp(arg[iarg],"aniso") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command");
if (strcmp(style,"rigid/npt/small") != 0 &&
strcmp(style,"rigid/nph/small") != 0)
error->all(FLERR,"Illegal fix rigid/small command");
p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] =
force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
if (domain->dimension == 2) {
p_start[2] = p_stop[2] = p_period[2] = 0.0;
p_flag[2] = 0;
}
iarg += 4;
} else if (strcmp(arg[iarg],"x") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command");
p_start[0] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"y") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command");
p_start[1] = force->numeric(FLERR,arg[iarg+1]);
p_stop[1] = force->numeric(FLERR,arg[iarg+2]);
p_period[1] = force->numeric(FLERR,arg[iarg+3]);
p_flag[1] = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"z") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command");
p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[2] = force->numeric(FLERR,arg[iarg+3]);
p_flag[2] = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"couple") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid/small command");
if (strcmp(arg[iarg+1],"xyz") == 0) pcouple = XYZ;
else if (strcmp(arg[iarg+1],"xy") == 0) pcouple = XY;
else if (strcmp(arg[iarg+1],"yz") == 0) pcouple = YZ;
else if (strcmp(arg[iarg+1],"xz") == 0) pcouple = XZ;
else if (strcmp(arg[iarg+1],"none") == 0) pcouple = NONE;
else error->all(FLERR,"Illegal fix rigid/small command");
iarg += 2;
} else if (strcmp(arg[iarg],"dilate") == 0) {
if (iarg+2 > narg)
error->all(FLERR,"Illegal fix rigid/small nvt/npt/nph command");
if (strcmp(arg[iarg+1],"all") == 0) allremap = 1;
else {
allremap = 0;
delete [] id_dilate;
int n = strlen(arg[iarg+1]) + 1;
id_dilate = new char[n];
strcpy(id_dilate,arg[iarg+1]);
int idilate = group->find(id_dilate);
if (idilate == -1)
error->all(FLERR,"Fix rigid/small nvt/npt/nph dilate group ID "
"does not exist");
}
iarg += 2;
} else if (strcmp(arg[iarg],"tparam") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command");
if (strcmp(style,"rigid/nvt/small") != 0 &&
strcmp(style,"rigid/npt/small") != 0)
error->all(FLERR,"Illegal fix rigid/small command");
t_chain = force->numeric(FLERR,arg[iarg+1]);
t_iter = force->numeric(FLERR,arg[iarg+2]);
t_order = force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"pchain") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid/small command");
if (strcmp(style,"rigid/npt/small") != 0 &&
strcmp(style,"rigid/nph/small") != 0)
error->all(FLERR,"Illegal fix rigid/small command");
p_chain = force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
} else error->all(FLERR,"Illegal fix rigid/small command");
}
@ -178,6 +313,15 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) :
onemol->compute_inertia();
}
// set pstat_flag
pstat_flag = 0;
for (int i = 0; i < 3; i++)
if (p_flag[i]) pstat_flag = 1;
if (pcouple == XYZ || (domain->dimension == 2 && pcouple == XY)) pstyle = ISO;
else pstyle = ANISO;
// create rigid bodies based on molecule ID
// sets bodytag for owned atoms
// body attributes are computed later by setup_bodies()
@ -2607,7 +2751,7 @@ int FixRigidSmall::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j;
double *xcm,*vcm,*quat,*omega,*ex_space,*ey_space,*ez_space;
double *xcm,*vcm,*quat,*omega,*ex_space,*ey_space,*ez_space,*conjqm;
int m = 0;
@ -2644,6 +2788,11 @@ int FixRigidSmall::pack_comm(int n, int *list, double *buf,
buf[m++] = ez_space[0];
buf[m++] = ez_space[1];
buf[m++] = ez_space[2];
conjqm = body[bodyown[j]].conjqm;
buf[m++] = conjqm[0];
buf[m++] = conjqm[1];
buf[m++] = conjqm[2];
buf[m++] = conjqm[3];
}
} else if (commflag == FINAL) {
@ -2658,6 +2807,11 @@ int FixRigidSmall::pack_comm(int n, int *list, double *buf,
buf[m++] = omega[0];
buf[m++] = omega[1];
buf[m++] = omega[2];
conjqm = body[bodyown[j]].conjqm;
buf[m++] = conjqm[0];
buf[m++] = conjqm[1];
buf[m++] = conjqm[2];
buf[m++] = conjqm[3];
}
} else if (commflag == FULL_BODY) {
@ -2684,7 +2838,7 @@ int FixRigidSmall::pack_comm(int n, int *list, double *buf,
void FixRigidSmall::unpack_comm(int n, int first, double *buf)
{
int i,j,last;
double *xcm,*vcm,*quat,*omega,*ex_space,*ey_space,*ez_space;
double *xcm,*vcm,*quat,*omega,*ex_space,*ey_space,*ez_space,*conjqm;
int m = 0;
last = first + n;
@ -2721,6 +2875,11 @@ void FixRigidSmall::unpack_comm(int n, int first, double *buf)
ez_space[0] = buf[m++];
ez_space[1] = buf[m++];
ez_space[2] = buf[m++];
conjqm = body[bodyown[i]].conjqm;
conjqm[0] = buf[m++];
conjqm[1] = buf[m++];
conjqm[2] = buf[m++];
conjqm[3] = buf[m++];
}
} else if (commflag == FINAL) {
@ -2734,6 +2893,11 @@ void FixRigidSmall::unpack_comm(int n, int first, double *buf)
omega[0] = buf[m++];
omega[1] = buf[m++];
omega[2] = buf[m++];
conjqm = body[bodyown[i]].conjqm;
conjqm[0] = buf[m++];
conjqm[1] = buf[m++];
conjqm[2] = buf[m++];
conjqm[3] = buf[m++];
}
} else if (commflag == FULL_BODY) {

View File

@ -97,7 +97,8 @@ class FixRigidSmall : public Fix {
double ez_space[3];
double angmom[3]; // space-frame angular momentum of body
double omega[3]; // space-frame omega of body
imageint image; // image flags of xcm
double conjqm[4]; // conjugate quaternion momentum
imageint image; // image flags of xcm
int remapflag[4]; // PBC remap flags
int ilocal; // index of owning atom
};
@ -151,6 +152,22 @@ class FixRigidSmall : public Fix {
int maxlang; // max size of langextra
class RanMars *random; // RNG
int tstat_flag,pstat_flag; // 0/1 = no/yes thermostat/barostat
int t_chain,t_iter,t_order;
double p_start[3],p_stop[3];
double p_period[3],p_freq[3];
int p_flag[3];
int pcouple,pstyle;
int p_chain;
int allremap; // remap all atoms
int dilate_group_bit; // mask for dilation group
char *id_dilate; // group name to dilate
double p_current[3],p_target[3];
// molecules added on-the-fly as rigid bodies
class Molecule *onemol;

View File

@ -747,7 +747,14 @@ void Force::boundsbig(char *str, bigint nmax, bigint &nlo, bigint &nhi,
double Force::numeric(const char *file, int line, char *str)
{
if (!str)
error->all(file,line,"Expected floating point parameter "
"in input script or data file");
int n = strlen(str);
if (n == 0)
error->all(file,line,"Expected floating point parameter "
"in input script or data file");
for (int i = 0; i < n; i++) {
if (isdigit(str[i])) continue;
if (str[i] == '-' || str[i] == '+' || str[i] == '.') continue;
@ -767,7 +774,14 @@ double Force::numeric(const char *file, int line, char *str)
int Force::inumeric(const char *file, int line, char *str)
{
if (!str)
error->all(file,line,
"Expected integer parameter in input script or data file");
int n = strlen(str);
if (n == 0)
error->all(file,line,
"Expected integer parameter in input script or data file");
for (int i = 0; i < n; i++) {
if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue;
error->all(file,line,
@ -785,14 +799,46 @@ int Force::inumeric(const char *file, int line, char *str)
bigint Force::bnumeric(const char *file, int line, char *str)
{
if (!str)
error->all(file,line,
"Expected integer parameter in input script or data file");
int n = strlen(str);
if (n == 0)
error->all(file,line,
"Expected integer parameter in input script or data file");
for (int i = 0; i < n; i++) {
if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue;
error->all(file,line,
"Expected integer parameter in input script or data file");
}
return ATOLL(str);
return ATOBIGINT(str);
}
/* ----------------------------------------------------------------------
read a tag integer value from a string
generate an error if not a legitimate integer value
called by various commands to check validity of their arguments
------------------------------------------------------------------------- */
tagint Force::tnumeric(const char *file, int line, char *str)
{
if (!str)
error->all(file,line,
"Expected integer parameter in input script or data file");
int n = strlen(str);
if (n == 0)
error->all(file,line,
"Expected integer parameter in input script or data file");
for (int i = 0; i < n; i++) {
if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue;
error->all(file,line,
"Expected integer parameter in input script or data file");
}
return ATOTAGINT(str);
}
/* ----------------------------------------------------------------------

View File

@ -105,6 +105,7 @@ class Force : protected Pointers {
double numeric(const char *, int, char *);
int inumeric(const char *, int, char *);
bigint bnumeric(const char *, int, char *);
tagint tnumeric(const char *, int, char *);
FILE *open_potential(const char *);
const char *potname(const char *);

View File

@ -198,18 +198,12 @@ void Group::assign(int narg, char **arg)
else error->all(FLERR,"Illegal group command");
tagint bound1,bound2;
if (sizeof(tagint) == sizeof(smallint))
bound1 = force->inumeric(FLERR,arg[3]);
else
bound1 = force->bnumeric(FLERR,arg[3]);
bound1 = force->tnumeric(FLERR,arg[3]);
bound2 = -1;
if (condition == BETWEEN) {
if (narg != 5) error->all(FLERR,"Illegal group command");
if (sizeof(tagint) == sizeof(smallint))
bound2 = force->inumeric(FLERR,arg[4]);
else
bound2 = force->bnumeric(FLERR,arg[4]);
bound2 = force->tnumeric(FLERR,arg[4]);
} else if (narg != 4) error->all(FLERR,"Illegal group command");
int *attribute = NULL;
@ -284,13 +278,15 @@ void Group::assign(int narg, char **arg)
for (int iarg = 2; iarg < narg; iarg++) {
if (strchr(arg[iarg],':')) {
start = ATOTAGINT(strtok(arg[iarg],":"));
stop = ATOTAGINT(strtok(NULL,":"));
ptr = strtok(arg[iarg],":");
start = force->tnumeric(FLERR,ptr);
ptr = strtok(NULL,":");
stop = force->tnumeric(FLERR,ptr);
ptr = strtok(NULL,":");
if (ptr) delta = ATOTAGINT(ptr);
if (ptr) delta = force->tnumeric(FLERR,ptr);
else delta = 1;
} else {
start = stop = ATOTAGINT(arg[iarg]);
start = stop = force->tnumeric(FLERR,arg[iarg]);
delta = 1;
}

View File

@ -1 +1 @@
#define LAMMPS_VERSION "18 Apr 2014"
#define LAMMPS_VERSION "29 Apr 2014"