Page MenuHomec4science

No OneTemporary

File Metadata

Created
Sat, Jul 20, 17:28
This file is larger than 256 KB, so syntax highlighting was skipped.
This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
diff --git a/doc/Eqs/angle_charmm.jpg b/doc/Eqs/angle_charmm.jpg
index 430fff27c..c6e6c297d 100644
Binary files a/doc/Eqs/angle_charmm.jpg and b/doc/Eqs/angle_charmm.jpg differ
diff --git a/doc/Eqs/angle_class2.jpg b/doc/Eqs/angle_class2.jpg
index 02c873d0c..f0f2a5152 100644
Binary files a/doc/Eqs/angle_class2.jpg and b/doc/Eqs/angle_class2.jpg differ
diff --git a/doc/Eqs/angle_cosine.jpg b/doc/Eqs/angle_cosine.jpg
index 891aeab6e..23b9b6431 100644
Binary files a/doc/Eqs/angle_cosine.jpg and b/doc/Eqs/angle_cosine.jpg differ
diff --git a/doc/Eqs/angle_cosine_delta.jpg b/doc/Eqs/angle_cosine_delta.jpg
index dca7d7393..e39b62471 100644
Binary files a/doc/Eqs/angle_cosine_delta.jpg and b/doc/Eqs/angle_cosine_delta.jpg differ
diff --git a/doc/Eqs/angle_cosine_periodic.jpg b/doc/Eqs/angle_cosine_periodic.jpg
index 32bbaf88b..a9d7d50cb 100644
Binary files a/doc/Eqs/angle_cosine_periodic.jpg and b/doc/Eqs/angle_cosine_periodic.jpg differ
diff --git a/doc/Eqs/angle_cosine_shift.jpg b/doc/Eqs/angle_cosine_shift.jpg
index 1f0bb5685..d9929939c 100644
Binary files a/doc/Eqs/angle_cosine_shift.jpg and b/doc/Eqs/angle_cosine_shift.jpg differ
diff --git a/doc/Eqs/angle_cosine_shift_exp.jpg b/doc/Eqs/angle_cosine_shift_exp.jpg
index 1a3cc05bd..294986de4 100644
Binary files a/doc/Eqs/angle_cosine_shift_exp.jpg and b/doc/Eqs/angle_cosine_shift_exp.jpg differ
diff --git a/doc/Eqs/angle_cosine_squared.jpg b/doc/Eqs/angle_cosine_squared.jpg
index 71cf80d91..b992398b7 100644
Binary files a/doc/Eqs/angle_cosine_squared.jpg and b/doc/Eqs/angle_cosine_squared.jpg differ
diff --git a/doc/Eqs/angle_harmonic.jpg b/doc/Eqs/angle_harmonic.jpg
index ef27177d7..352be0b54 100644
Binary files a/doc/Eqs/angle_harmonic.jpg and b/doc/Eqs/angle_harmonic.jpg differ
diff --git a/doc/Eqs/bond_class2.jpg b/doc/Eqs/bond_class2.jpg
index 7fb129bdb..493048100 100644
Binary files a/doc/Eqs/bond_class2.jpg and b/doc/Eqs/bond_class2.jpg differ
diff --git a/doc/Eqs/bond_fene.jpg b/doc/Eqs/bond_fene.jpg
index b4360f7b3..e8b909c08 100644
Binary files a/doc/Eqs/bond_fene.jpg and b/doc/Eqs/bond_fene.jpg differ
diff --git a/doc/Eqs/bond_fene_expand.jpg b/doc/Eqs/bond_fene_expand.jpg
index 72854dfa6..1d04acec3 100644
Binary files a/doc/Eqs/bond_fene_expand.jpg and b/doc/Eqs/bond_fene_expand.jpg differ
diff --git a/doc/Eqs/bond_harmonic.jpg b/doc/Eqs/bond_harmonic.jpg
index 3180399a0..fe9ef5619 100644
Binary files a/doc/Eqs/bond_harmonic.jpg and b/doc/Eqs/bond_harmonic.jpg differ
diff --git a/doc/Eqs/bond_harmonic_shift.jpg b/doc/Eqs/bond_harmonic_shift.jpg
index cac7bcdbb..3e66d853a 100644
Binary files a/doc/Eqs/bond_harmonic_shift.jpg and b/doc/Eqs/bond_harmonic_shift.jpg differ
diff --git a/doc/Eqs/bond_harmonic_shift_cut.jpg b/doc/Eqs/bond_harmonic_shift_cut.jpg
index 821db256d..06640e4fe 100644
Binary files a/doc/Eqs/bond_harmonic_shift_cut.jpg and b/doc/Eqs/bond_harmonic_shift_cut.jpg differ
diff --git a/doc/Eqs/bond_morse.jpg b/doc/Eqs/bond_morse.jpg
index 794a7e98d..6795c9e52 100644
Binary files a/doc/Eqs/bond_morse.jpg and b/doc/Eqs/bond_morse.jpg differ
diff --git a/doc/Eqs/bond_nonlinear.jpg b/doc/Eqs/bond_nonlinear.jpg
index 09020019a..0f18d8e73 100644
Binary files a/doc/Eqs/bond_nonlinear.jpg and b/doc/Eqs/bond_nonlinear.jpg differ
diff --git a/doc/Eqs/bond_quartic.jpg b/doc/Eqs/bond_quartic.jpg
index 4f333aefb..9d092883b 100644
Binary files a/doc/Eqs/bond_quartic.jpg and b/doc/Eqs/bond_quartic.jpg differ
diff --git a/doc/Eqs/box.jpg b/doc/Eqs/box.jpg
index df1c2bfce..4cb43df95 100644
Binary files a/doc/Eqs/box.jpg and b/doc/Eqs/box.jpg differ
diff --git a/doc/Eqs/box_inverse.jpg b/doc/Eqs/box_inverse.jpg
index 1815bba23..5d0895b87 100644
Binary files a/doc/Eqs/box_inverse.jpg and b/doc/Eqs/box_inverse.jpg differ
diff --git a/doc/Eqs/centro_symmetry.jpg b/doc/Eqs/centro_symmetry.jpg
index 4817ea14f..1e89d11a1 100644
Binary files a/doc/Eqs/centro_symmetry.jpg and b/doc/Eqs/centro_symmetry.jpg differ
diff --git a/doc/Eqs/cna_cutoff1.jpg b/doc/Eqs/cna_cutoff1.jpg
index 7f9526b43..fae5c6b63 100644
Binary files a/doc/Eqs/cna_cutoff1.jpg and b/doc/Eqs/cna_cutoff1.jpg differ
diff --git a/doc/Eqs/cna_cutoff2.jpg b/doc/Eqs/cna_cutoff2.jpg
index 1e6792d04..744b61e9b 100644
Binary files a/doc/Eqs/cna_cutoff2.jpg and b/doc/Eqs/cna_cutoff2.jpg differ
diff --git a/doc/Eqs/compute_gyration.jpg b/doc/Eqs/compute_gyration.jpg
index 0e195374f..228544443 100644
Binary files a/doc/Eqs/compute_gyration.jpg and b/doc/Eqs/compute_gyration.jpg differ
diff --git a/doc/Eqs/dihedral_charmm.jpg b/doc/Eqs/dihedral_charmm.jpg
index 5ab8a3555..810afa3cd 100644
Binary files a/doc/Eqs/dihedral_charmm.jpg and b/doc/Eqs/dihedral_charmm.jpg differ
diff --git a/doc/Eqs/dihedral_class2.jpg b/doc/Eqs/dihedral_class2.jpg
index c05090527..6a6780e76 100644
Binary files a/doc/Eqs/dihedral_class2.jpg and b/doc/Eqs/dihedral_class2.jpg differ
diff --git a/doc/Eqs/dihedral_cosine_shift_exp.jpg b/doc/Eqs/dihedral_cosine_shift_exp.jpg
index 646bb52a6..ea0a7550f 100644
Binary files a/doc/Eqs/dihedral_cosine_shift_exp.jpg and b/doc/Eqs/dihedral_cosine_shift_exp.jpg differ
diff --git a/doc/Eqs/dihedral_harmonic.jpg b/doc/Eqs/dihedral_harmonic.jpg
index 8a395b043..cb5c16a8c 100644
Binary files a/doc/Eqs/dihedral_harmonic.jpg and b/doc/Eqs/dihedral_harmonic.jpg differ
diff --git a/doc/Eqs/dihedral_helix.jpg b/doc/Eqs/dihedral_helix.jpg
index 073a18a9c..01a0ec982 100644
Binary files a/doc/Eqs/dihedral_helix.jpg and b/doc/Eqs/dihedral_helix.jpg differ
diff --git a/doc/Eqs/dihedral_multi_harmonic.jpg b/doc/Eqs/dihedral_multi_harmonic.jpg
index a53ae3dca..d066cd212 100644
Binary files a/doc/Eqs/dihedral_multi_harmonic.jpg and b/doc/Eqs/dihedral_multi_harmonic.jpg differ
diff --git a/doc/Eqs/dihedral_opls.jpg b/doc/Eqs/dihedral_opls.jpg
index 719a14ecb..0546aebfd 100644
Binary files a/doc/Eqs/dihedral_opls.jpg and b/doc/Eqs/dihedral_opls.jpg differ
diff --git a/doc/Eqs/eff_KE.jpg b/doc/Eqs/eff_KE.jpg
index 9fe9c0692..40eed0df6 100644
Binary files a/doc/Eqs/eff_KE.jpg and b/doc/Eqs/eff_KE.jpg differ
diff --git a/doc/Eqs/eff_NN.jpg b/doc/Eqs/eff_NN.jpg
index f70768bf1..c3c52e19b 100644
Binary files a/doc/Eqs/eff_NN.jpg and b/doc/Eqs/eff_NN.jpg differ
diff --git a/doc/Eqs/eff_Ne.jpg b/doc/Eqs/eff_Ne.jpg
index 1ce103df6..e23ceacc8 100644
Binary files a/doc/Eqs/eff_Ne.jpg and b/doc/Eqs/eff_Ne.jpg differ
diff --git a/doc/Eqs/eff_Pauli.jpg b/doc/Eqs/eff_Pauli.jpg
index 82b2c18c2..61bb8652e 100644
Binary files a/doc/Eqs/eff_Pauli.jpg and b/doc/Eqs/eff_Pauli.jpg differ
diff --git a/doc/Eqs/eff_ee.jpg b/doc/Eqs/eff_ee.jpg
index 25871e9b4..aef84d0fd 100644
Binary files a/doc/Eqs/eff_ee.jpg and b/doc/Eqs/eff_ee.jpg differ
diff --git a/doc/Eqs/eff_energy_expression.jpg b/doc/Eqs/eff_energy_expression.jpg
index e5ff7a185..e06fe8ff2 100644
Binary files a/doc/Eqs/eff_energy_expression.jpg and b/doc/Eqs/eff_energy_expression.jpg differ
diff --git a/doc/Eqs/fix_box_relax1.jpg b/doc/Eqs/fix_box_relax1.jpg
index a4b6dda6e..d42552604 100644
Binary files a/doc/Eqs/fix_box_relax1.jpg and b/doc/Eqs/fix_box_relax1.jpg differ
diff --git a/doc/Eqs/fix_box_relax2.jpg b/doc/Eqs/fix_box_relax2.jpg
index 5ab0dd93b..8fac42e0f 100644
Binary files a/doc/Eqs/fix_box_relax2.jpg and b/doc/Eqs/fix_box_relax2.jpg differ
diff --git a/doc/Eqs/fix_gyration.jpg b/doc/Eqs/fix_gyration.jpg
deleted file mode 100644
index 0e195374f..000000000
Binary files a/doc/Eqs/fix_gyration.jpg and /dev/null differ
diff --git a/doc/Eqs/fix_gyration.tex b/doc/Eqs/fix_gyration.tex
deleted file mode 100644
index 97204f1de..000000000
--- a/doc/Eqs/fix_gyration.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\documentstyle[12pt]{article}
-
-\begin{document}
-
-$$
- {R_g}^2 = \frac{1}{M} \sum_i m_i (r_i - r_{cm})^2
-$$
-
-\end{document}
\ No newline at end of file
diff --git a/doc/Eqs/fix_nh1.jpg b/doc/Eqs/fix_nh1.jpg
index 929f97a8c..db59dbc43 100644
Binary files a/doc/Eqs/fix_nh1.jpg and b/doc/Eqs/fix_nh1.jpg differ
diff --git a/doc/Eqs/fix_nphug.jpg b/doc/Eqs/fix_nphug.jpg
index beed5ed5c..a3a67e7b7 100644
Binary files a/doc/Eqs/fix_nphug.jpg and b/doc/Eqs/fix_nphug.jpg differ
diff --git a/doc/Eqs/fix_orient_fcc.jpg b/doc/Eqs/fix_orient_fcc.jpg
index 1645312d2..b22e6c9c2 100644
Binary files a/doc/Eqs/fix_orient_fcc.jpg and b/doc/Eqs/fix_orient_fcc.jpg differ
diff --git a/doc/Eqs/fix_spring_rg.jpg b/doc/Eqs/fix_spring_rg.jpg
index 421b39478..313844f55 100644
Binary files a/doc/Eqs/fix_spring_rg.jpg and b/doc/Eqs/fix_spring_rg.jpg differ
diff --git a/doc/Eqs/fix_ttm.jpg b/doc/Eqs/fix_ttm.jpg
index 68f7fdb12..8d9fac3fe 100644
Binary files a/doc/Eqs/fix_ttm.jpg and b/doc/Eqs/fix_ttm.jpg differ
diff --git a/doc/Eqs/fix_wall_colloid.jpg b/doc/Eqs/fix_wall_colloid.jpg
index df6b654ef..e18aa70cd 100644
Binary files a/doc/Eqs/fix_wall_colloid.jpg and b/doc/Eqs/fix_wall_colloid.jpg differ
diff --git a/doc/Eqs/fix_wall_harmonic.jpg b/doc/Eqs/fix_wall_harmonic.jpg
index fdf308b22..3c605690c 100644
Binary files a/doc/Eqs/fix_wall_harmonic.jpg and b/doc/Eqs/fix_wall_harmonic.jpg differ
diff --git a/doc/Eqs/fix_wall_lj93.jpg b/doc/Eqs/fix_wall_lj93.jpg
index 985a5c188..18e502cfb 100644
Binary files a/doc/Eqs/fix_wall_lj93.jpg and b/doc/Eqs/fix_wall_lj93.jpg differ
diff --git a/doc/Eqs/fld.jpg b/doc/Eqs/fld.jpg
index 6ae18718d..3d80d436f 100644
Binary files a/doc/Eqs/fld.jpg and b/doc/Eqs/fld.jpg differ
diff --git a/doc/Eqs/fld2.jpg b/doc/Eqs/fld2.jpg
index ff88680b7..42de943c9 100644
Binary files a/doc/Eqs/fld2.jpg and b/doc/Eqs/fld2.jpg differ
diff --git a/doc/Eqs/heat_flux_J.jpg b/doc/Eqs/heat_flux_J.jpg
index 67633dad6..cf3e220ca 100644
Binary files a/doc/Eqs/heat_flux_J.jpg and b/doc/Eqs/heat_flux_J.jpg differ
diff --git a/doc/Eqs/heat_flux_k.jpg b/doc/Eqs/heat_flux_k.jpg
index f028e5245..2fd4a19e5 100644
Binary files a/doc/Eqs/heat_flux_k.jpg and b/doc/Eqs/heat_flux_k.jpg differ
diff --git a/doc/Eqs/improper_class2.jpg b/doc/Eqs/improper_class2.jpg
index 331f4ff8c..ca0604f8d 100644
Binary files a/doc/Eqs/improper_class2.jpg and b/doc/Eqs/improper_class2.jpg differ
diff --git a/doc/Eqs/improper_cvff.jpg b/doc/Eqs/improper_cvff.jpg
index 4b8b73b19..14be3ffa0 100644
Binary files a/doc/Eqs/improper_cvff.jpg and b/doc/Eqs/improper_cvff.jpg differ
diff --git a/doc/Eqs/improper_harmonic.jpg b/doc/Eqs/improper_harmonic.jpg
index 48252b24f..c2c1eb466 100644
Binary files a/doc/Eqs/improper_harmonic.jpg and b/doc/Eqs/improper_harmonic.jpg differ
diff --git a/doc/Eqs/improper_umbrella.jpg b/doc/Eqs/improper_umbrella.jpg
index efef6c06b..8d6cbf81e 100644
Binary files a/doc/Eqs/improper_umbrella.jpg and b/doc/Eqs/improper_umbrella.jpg differ
diff --git a/doc/Eqs/min_energy.jpg b/doc/Eqs/min_energy.jpg
index b949216a5..7925d268a 100644
Binary files a/doc/Eqs/min_energy.jpg and b/doc/Eqs/min_energy.jpg differ
diff --git a/doc/Eqs/pair_adp.jpg b/doc/Eqs/pair_adp.jpg
index c2ad8deb2..accae4716 100644
Binary files a/doc/Eqs/pair_adp.jpg and b/doc/Eqs/pair_adp.jpg differ
diff --git a/doc/Eqs/pair_adp.tex b/doc/Eqs/pair_adp.tex
index 4ba8ad76e..07e441f3f 100644
--- a/doc/Eqs/pair_adp.tex
+++ b/doc/Eqs/pair_adp.tex
@@ -1,26 +1,16 @@
\documentclass[12pt]{article}
\begin{document}
-\begin{eqnarray*}
-E_{i} & = & F_{\alpha} \left( \sum_{j \ne i} \rho(r_{ij}) \right) +
-\frac{1}{2} \sum_{j \ne i} \phi_{\alpha \beta} (r_{ij}) +
-\frac{1}{2} \sum_{i,s} \left( \mu_{i}^{s} \right)^2 +
-\sum_{i,s,t} \left( \lambda_{i}^{st} \right)^2 - \frac{1}{6} \nu_{i} \\
-\mu_{i}^{s} & = & \sum_{i \ne j} u(r_{ij}) r_{ij}^{s} \\
-\lambda_{i}^{st} & = & \sum_{i \ne j} w(r_{ij}) r_{ij}^{s} r_{ij}^{t} \\
-\nu_{i} & = & \sum_{s} \lambda_{i}^{ss}
-\end{eqnarray*}
-
\begin{eqnarray*}
E_i & = & F_\alpha \left( \sum_{j\neq i} \rho_\beta (r_{ij}) \right) + \frac{1}{2} \sum_{j\neq i}\phi_{\alpha\beta}(r_{ij})+ \frac{1}{2} \sum_s (\mu_i^s)^2 + \frac{1}{2} \sum_{s,t} (\lambda_i^{st})^2 - \frac{1}{6} \nu_i^2 \\
%
\mu_i^s & = & \sum_{j\neq i}u_{\alpha\beta}(r_{ij})r_{ij}^s\\
%
\lambda_i^{st} & = & \sum_{j\neq i}w_{\alpha\beta}(r_{ij})r_{ij}^sr_{ij}^t\\
%
\nu_i & = & \sum_s\lambda_i^{ss}
\end{eqnarray*}
\end{document}
diff --git a/doc/Eqs/pair_airebo.jpg b/doc/Eqs/pair_airebo.jpg
index 6416d6d7e..a3259879f 100644
Binary files a/doc/Eqs/pair_airebo.jpg and b/doc/Eqs/pair_airebo.jpg differ
diff --git a/doc/Eqs/pair_born.jpg b/doc/Eqs/pair_born.jpg
index 24e846f09..5e6b6a729 100644
Binary files a/doc/Eqs/pair_born.jpg and b/doc/Eqs/pair_born.jpg differ
diff --git a/doc/Eqs/pair_buck.jpg b/doc/Eqs/pair_buck.jpg
index d66980b51..aaa5f7659 100644
Binary files a/doc/Eqs/pair_buck.jpg and b/doc/Eqs/pair_buck.jpg differ
diff --git a/doc/Eqs/pair_charmm.jpg b/doc/Eqs/pair_charmm.jpg
index 85bc839d2..7d6c709ce 100644
Binary files a/doc/Eqs/pair_charmm.jpg and b/doc/Eqs/pair_charmm.jpg differ
diff --git a/doc/Eqs/pair_class2.jpg b/doc/Eqs/pair_class2.jpg
index c0a7aefef..abec072e7 100644
Binary files a/doc/Eqs/pair_class2.jpg and b/doc/Eqs/pair_class2.jpg differ
diff --git a/doc/Eqs/pair_cmm.jpg b/doc/Eqs/pair_cmm.jpg
index f97a47393..1ec60f730 100644
Binary files a/doc/Eqs/pair_cmm.jpg and b/doc/Eqs/pair_cmm.jpg differ
diff --git a/doc/Eqs/pair_colloid_cc.jpg b/doc/Eqs/pair_colloid_cc.jpg
index 36f0b23b1..a64094dda 100644
Binary files a/doc/Eqs/pair_colloid_cc.jpg and b/doc/Eqs/pair_colloid_cc.jpg differ
diff --git a/doc/Eqs/pair_colloid_cs.jpg b/doc/Eqs/pair_colloid_cs.jpg
index 3931e40ee..8f5948fa5 100644
Binary files a/doc/Eqs/pair_colloid_cs.jpg and b/doc/Eqs/pair_colloid_cs.jpg differ
diff --git a/doc/Eqs/pair_colloid_ss.jpg b/doc/Eqs/pair_colloid_ss.jpg
index de61125d9..4ce19ba1e 100644
Binary files a/doc/Eqs/pair_colloid_ss.jpg and b/doc/Eqs/pair_colloid_ss.jpg differ
diff --git a/doc/Eqs/pair_comb1.jpg b/doc/Eqs/pair_comb1.jpg
index 9fbe18ef1..0e7fc4e35 100644
Binary files a/doc/Eqs/pair_comb1.jpg and b/doc/Eqs/pair_comb1.jpg differ
diff --git a/doc/Eqs/pair_comb2.jpg b/doc/Eqs/pair_comb2.jpg
index 1a71f95e4..206046000 100644
Binary files a/doc/Eqs/pair_comb2.jpg and b/doc/Eqs/pair_comb2.jpg differ
diff --git a/doc/Eqs/pair_coul_wolf.jpg b/doc/Eqs/pair_coul_wolf.jpg
new file mode 100644
index 000000000..fd64cb6c0
Binary files /dev/null and b/doc/Eqs/pair_coul_wolf.jpg differ
diff --git a/doc/Eqs/pair_coul_wolf.tex b/doc/Eqs/pair_coul_wolf.tex
new file mode 100644
index 000000000..4a6592638
--- /dev/null
+++ b/doc/Eqs/pair_coul_wolf.tex
@@ -0,0 +1,11 @@
+\documentclass[12pt]{article}
+
+\begin{document}
+$$
+ E_i = \frac{1}{2} \sum_{j \neq i}
+ \frac{q_i q_j {\rm erfc}(\alpha r_{ij})}{r_{ij}} +
+ \frac{1}{2} \sum_{j \neq i}
+ \frac{q_i q_j {\rm erf}(\alpha r_{ij})}{r_{ij}} \qquad r < r_c
+$$
+
+\end{document}
diff --git a/doc/Eqs/pair_coulomb.jpg b/doc/Eqs/pair_coulomb.jpg
index 0b4994092..39aaebac3 100644
Binary files a/doc/Eqs/pair_coulomb.jpg and b/doc/Eqs/pair_coulomb.jpg differ
diff --git a/doc/Eqs/pair_debye.jpg b/doc/Eqs/pair_debye.jpg
index 664c8bc5e..42bcb5cc6 100644
Binary files a/doc/Eqs/pair_debye.jpg and b/doc/Eqs/pair_debye.jpg differ
diff --git a/doc/Eqs/pair_dipole.jpg b/doc/Eqs/pair_dipole.jpg
index cb2036ce8..e106c17c9 100644
Binary files a/doc/Eqs/pair_dipole.jpg and b/doc/Eqs/pair_dipole.jpg differ
diff --git a/doc/Eqs/pair_dipole_sf.jpg b/doc/Eqs/pair_dipole_sf.jpg
index 536ea7f2c..c59153455 100644
Binary files a/doc/Eqs/pair_dipole_sf.jpg and b/doc/Eqs/pair_dipole_sf.jpg differ
diff --git a/doc/Eqs/pair_dipole_sf2.jpg b/doc/Eqs/pair_dipole_sf2.jpg
index f45f58373..b9e57becf 100644
Binary files a/doc/Eqs/pair_dipole_sf2.jpg and b/doc/Eqs/pair_dipole_sf2.jpg differ
diff --git a/doc/Eqs/pair_dpd.jpg b/doc/Eqs/pair_dpd.jpg
index 77eb96897..e9bb8a69a 100644
Binary files a/doc/Eqs/pair_dpd.jpg and b/doc/Eqs/pair_dpd.jpg differ
diff --git a/doc/Eqs/pair_eam.jpg b/doc/Eqs/pair_eam.jpg
index e82f6dd4a..95c86b4ce 100644
Binary files a/doc/Eqs/pair_eam.jpg and b/doc/Eqs/pair_eam.jpg differ
diff --git a/doc/Eqs/pair_eam_fs.jpg b/doc/Eqs/pair_eam_fs.jpg
index fecab0e10..fa72f8fc7 100644
Binary files a/doc/Eqs/pair_eam_fs.jpg and b/doc/Eqs/pair_eam_fs.jpg differ
diff --git a/doc/Eqs/pair_edip.jpg b/doc/Eqs/pair_edip.jpg
index 9e7a8d77d..393328048 100644
Binary files a/doc/Eqs/pair_edip.jpg and b/doc/Eqs/pair_edip.jpg differ
diff --git a/doc/Eqs/pair_eim1.jpg b/doc/Eqs/pair_eim1.jpg
index 9e4a560b1..c243120b2 100644
Binary files a/doc/Eqs/pair_eim1.jpg and b/doc/Eqs/pair_eim1.jpg differ
diff --git a/doc/Eqs/pair_eim2.jpg b/doc/Eqs/pair_eim2.jpg
index accb638d9..4896f658f 100644
Binary files a/doc/Eqs/pair_eim2.jpg and b/doc/Eqs/pair_eim2.jpg differ
diff --git a/doc/Eqs/pair_eim3.jpg b/doc/Eqs/pair_eim3.jpg
index 8e3b47d2a..57366bc15 100644
Binary files a/doc/Eqs/pair_eim3.jpg and b/doc/Eqs/pair_eim3.jpg differ
diff --git a/doc/Eqs/pair_gauss_cut.jpg b/doc/Eqs/pair_gauss_cut.jpg
index a2cd680e5..e47bb8cc0 100644
Binary files a/doc/Eqs/pair_gauss_cut.jpg and b/doc/Eqs/pair_gauss_cut.jpg differ
diff --git a/doc/Eqs/pair_gayberne.jpg b/doc/Eqs/pair_gayberne.jpg
index 70862bd22..e9b1f3ca9 100644
Binary files a/doc/Eqs/pair_gayberne.jpg and b/doc/Eqs/pair_gayberne.jpg differ
diff --git a/doc/Eqs/pair_gayberne2.jpg b/doc/Eqs/pair_gayberne2.jpg
index 2e849a4b3..a4e6c6f70 100644
Binary files a/doc/Eqs/pair_gayberne2.jpg and b/doc/Eqs/pair_gayberne2.jpg differ
diff --git a/doc/Eqs/pair_gran_hertz.jpg b/doc/Eqs/pair_gran_hertz.jpg
index 96a6d8ab6..733875fee 100644
Binary files a/doc/Eqs/pair_gran_hertz.jpg and b/doc/Eqs/pair_gran_hertz.jpg differ
diff --git a/doc/Eqs/pair_gran_hooke.jpg b/doc/Eqs/pair_gran_hooke.jpg
index 174543835..36f34db6c 100644
Binary files a/doc/Eqs/pair_gran_hooke.jpg and b/doc/Eqs/pair_gran_hooke.jpg differ
diff --git a/doc/Eqs/pair_gromacs.jpg b/doc/Eqs/pair_gromacs.jpg
index 4902fe016..675b399c6 100644
Binary files a/doc/Eqs/pair_gromacs.jpg and b/doc/Eqs/pair_gromacs.jpg differ
diff --git a/doc/Eqs/pair_hbond_dreiding.jpg b/doc/Eqs/pair_hbond_dreiding.jpg
index cb1e38ba4..b93044ed3 100644
Binary files a/doc/Eqs/pair_hbond_dreiding.jpg and b/doc/Eqs/pair_hbond_dreiding.jpg differ
diff --git a/doc/Eqs/pair_lj.jpg b/doc/Eqs/pair_lj.jpg
index e767e0b3a..49cf7f5eb 100644
Binary files a/doc/Eqs/pair_lj.jpg and b/doc/Eqs/pair_lj.jpg differ
diff --git a/doc/Eqs/pair_lj96.jpg b/doc/Eqs/pair_lj96.jpg
index a4f51537d..6462de180 100644
Binary files a/doc/Eqs/pair_lj96.jpg and b/doc/Eqs/pair_lj96.jpg differ
diff --git a/doc/Eqs/pair_lj_cubic.jpg b/doc/Eqs/pair_lj_cubic.jpg
index 25ffe2cbf..69ec4f6e8 100644
Binary files a/doc/Eqs/pair_lj_cubic.jpg and b/doc/Eqs/pair_lj_cubic.jpg differ
diff --git a/doc/Eqs/pair_lj_expand.jpg b/doc/Eqs/pair_lj_expand.jpg
index 64776d21d..e27481889 100644
Binary files a/doc/Eqs/pair_lj_expand.jpg and b/doc/Eqs/pair_lj_expand.jpg differ
diff --git a/doc/Eqs/pair_lj_sf.jpg b/doc/Eqs/pair_lj_sf.jpg
index 620331667..a70224000 100644
Binary files a/doc/Eqs/pair_lj_sf.jpg and b/doc/Eqs/pair_lj_sf.jpg differ
diff --git a/doc/Eqs/pair_lj_smooth.jpg b/doc/Eqs/pair_lj_smooth.jpg
index 71e3b41e8..d380fd345 100644
Binary files a/doc/Eqs/pair_lj_smooth.jpg and b/doc/Eqs/pair_lj_smooth.jpg differ
diff --git a/doc/Eqs/pair_lubricate.jpg b/doc/Eqs/pair_lubricate.jpg
index 54bbd199d..560591765 100644
Binary files a/doc/Eqs/pair_lubricate.jpg and b/doc/Eqs/pair_lubricate.jpg differ
diff --git a/doc/Eqs/pair_meam.jpg b/doc/Eqs/pair_meam.jpg
index 013d41f39..f6de50a99 100644
Binary files a/doc/Eqs/pair_meam.jpg and b/doc/Eqs/pair_meam.jpg differ
diff --git a/doc/Eqs/pair_morse.jpg b/doc/Eqs/pair_morse.jpg
index d236a54e0..5ebcdb2e1 100644
Binary files a/doc/Eqs/pair_morse.jpg and b/doc/Eqs/pair_morse.jpg differ
diff --git a/doc/Eqs/pair_resquared.jpg b/doc/Eqs/pair_resquared.jpg
index de3e0fa88..c290c68df 100644
Binary files a/doc/Eqs/pair_resquared.jpg and b/doc/Eqs/pair_resquared.jpg differ
diff --git a/doc/Eqs/pair_resquared2.jpg b/doc/Eqs/pair_resquared2.jpg
index deec54782..d2ed21a62 100644
Binary files a/doc/Eqs/pair_resquared2.jpg and b/doc/Eqs/pair_resquared2.jpg differ
diff --git a/doc/Eqs/pair_resquared3.jpg b/doc/Eqs/pair_resquared3.jpg
index 8e58c660e..3916062a1 100644
Binary files a/doc/Eqs/pair_resquared3.jpg and b/doc/Eqs/pair_resquared3.jpg differ
diff --git a/doc/Eqs/pair_resquared4.jpg b/doc/Eqs/pair_resquared4.jpg
index a654952d2..79ad067fa 100644
Binary files a/doc/Eqs/pair_resquared4.jpg and b/doc/Eqs/pair_resquared4.jpg differ
diff --git a/doc/Eqs/pair_soft.jpg b/doc/Eqs/pair_soft.jpg
index 19e6ca37f..e8a654e1e 100644
Binary files a/doc/Eqs/pair_soft.jpg and b/doc/Eqs/pair_soft.jpg differ
diff --git a/doc/Eqs/pair_sph_ideal.jpg b/doc/Eqs/pair_sph_ideal.jpg
index ad9760d5e..370b75fe9 100644
Binary files a/doc/Eqs/pair_sph_ideal.jpg and b/doc/Eqs/pair_sph_ideal.jpg differ
diff --git a/doc/Eqs/pair_sph_tait.jpg b/doc/Eqs/pair_sph_tait.jpg
index 96adab38e..8bbfe8051 100644
Binary files a/doc/Eqs/pair_sph_tait.jpg and b/doc/Eqs/pair_sph_tait.jpg differ
diff --git a/doc/Eqs/pair_sw.jpg b/doc/Eqs/pair_sw.jpg
index a9cd3a528..f60f07fd2 100644
Binary files a/doc/Eqs/pair_sw.jpg and b/doc/Eqs/pair_sw.jpg differ
diff --git a/doc/Eqs/pair_tersoff_2.jpg b/doc/Eqs/pair_tersoff_2.jpg
index d18ea3df2..6cb8778a0 100644
Binary files a/doc/Eqs/pair_tersoff_2.jpg and b/doc/Eqs/pair_tersoff_2.jpg differ
diff --git a/doc/Eqs/pair_tersoff_zbl.jpg b/doc/Eqs/pair_tersoff_zbl.jpg
index 4309f995b..ac80bba44 100644
Binary files a/doc/Eqs/pair_tersoff_zbl.jpg and b/doc/Eqs/pair_tersoff_zbl.jpg differ
diff --git a/doc/Eqs/pair_yukawa.jpg b/doc/Eqs/pair_yukawa.jpg
index f50280e22..103edc604 100644
Binary files a/doc/Eqs/pair_yukawa.jpg and b/doc/Eqs/pair_yukawa.jpg differ
diff --git a/doc/Eqs/pair_yukawa_colloid.jpg b/doc/Eqs/pair_yukawa_colloid.jpg
index db6e2ea81..1d8362475 100644
Binary files a/doc/Eqs/pair_yukawa_colloid.jpg and b/doc/Eqs/pair_yukawa_colloid.jpg differ
diff --git a/doc/Eqs/pressure.jpg b/doc/Eqs/pressure.jpg
index 69a92daa0..0ed674775 100644
Binary files a/doc/Eqs/pressure.jpg and b/doc/Eqs/pressure.jpg differ
diff --git a/doc/Eqs/pressure_tensor.jpg b/doc/Eqs/pressure_tensor.jpg
index f11e8ac3b..b5abf0ce4 100644
Binary files a/doc/Eqs/pressure_tensor.jpg and b/doc/Eqs/pressure_tensor.jpg differ
diff --git a/doc/Eqs/stress_tensor.jpg b/doc/Eqs/stress_tensor.jpg
index 1be5dc872..f6ec0eeef 100644
Binary files a/doc/Eqs/stress_tensor.jpg and b/doc/Eqs/stress_tensor.jpg differ
diff --git a/doc/PDF/pair_gayberne_extra.pdf b/doc/PDF/pair_gayberne_extra.pdf
index a2e2c8ec8..c82233992 100644
Binary files a/doc/PDF/pair_gayberne_extra.pdf and b/doc/PDF/pair_gayberne_extra.pdf differ
diff --git a/doc/Eqs/pair_gayberne_extra.tex b/doc/PDF/pair_gayberne_extra.tex
similarity index 100%
rename from doc/Eqs/pair_gayberne_extra.tex
rename to doc/PDF/pair_gayberne_extra.tex
diff --git a/doc/PDF/pair_resquared_extra.pdf b/doc/PDF/pair_resquared_extra.pdf
index 448e59c8f..c7956b37e 100644
Binary files a/doc/PDF/pair_resquared_extra.pdf and b/doc/PDF/pair_resquared_extra.pdf differ
diff --git a/doc/Eqs/pair_resquared_extra.tex b/doc/PDF/pair_resquared_extra.tex
old mode 100755
new mode 100644
similarity index 100%
rename from doc/Eqs/pair_resquared_extra.tex
rename to doc/PDF/pair_resquared_extra.tex
diff --git a/doc/Section_accelerate.html b/doc/Section_accelerate.html
index 838c1713d..88f985bf5 100644
--- a/doc/Section_accelerate.html
+++ b/doc/Section_accelerate.html
@@ -1,654 +1,654 @@
<HTML>
<CENTER><A HREF = "Section_packages.html">Previous Section</A> - <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> -
<A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A> - <A HREF = "Section_howto.html">Next
Section</A>
</CENTER>
<HR>
<H3>5. Accelerating LAMMPS performance
</H3>
<P>This section describes various methods for improving LAMMPS
performance for different classes of problems running
on different kinds of machines.
</P>
5.1 <A HREF = "#acc_1">OPT package</A><BR>
5.2 <A HREF = "#acc_2">USER-OMP package</A><BR>
5.3 <A HREF = "#acc_3">GPU package</A><BR>
5.4 <A HREF = "#acc_4">USER-CUDA package</A><BR>
5.5 <A HREF = "#acc_5">Comparison of GPU and USER-CUDA packages</A> <BR>
<P>Accelerated versions of various <A HREF = "pair_style.html">pair_style</A>,
<A HREF = "fix.html">fixes</A>, <A HREF = "compute.html">computes</A>, and other commands have
been added to LAMMPS, which will typically run faster than the
standard non-accelerated versions, if you have the appropriate
hardware on your system.
</P>
<P>The accelerated styles have the same name as the standard styles,
except that a suffix is appended. Otherwise, the syntax for the
command is identical, their functionality is the same, and the
numerical results it produces should also be identical, except for
precision and round-off issues.
</P>
<P>For example, all of these variants of the basic Lennard-Jones pair
style exist in LAMMPS:
</P>
<UL><LI><A HREF = "pair_lj.html">pair_style lj/cut</A>
<LI><A HREF = "pair_lj.html">pair_style lj/cut/opt</A>
<LI><A HREF = "pair_lj.html">pair_style lj/cut/omp</A>
<LI><A HREF = "pair_lj.html">pair_style lj/cut/gpu</A>
<LI><A HREF = "pair_lj.html">pair_style lj/cut/cuda</A>
</UL>
<P>Assuming you have built LAMMPS with the appropriate package, these
styles can be invoked by specifying them explicitly in your input
script. Or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> to invoke the accelerated versions
automatically, without changing your input script. The
<A HREF = "suffix.html">suffix</A> command allows you to set a suffix explicitly and
to turn off/on the comand-line switch setting, both from within your
input script.
</P>
<P>Styles with an "opt" suffix are part of the OPT package and typically
speed-up the pairwise calculations of your simulation by 5-25%.
</P>
<P>Styles with an "omp" suffix are part of the USER-OMP package and allow
a pair-style to be run in multi-threaded mode using OpenMP. This can
be useful on nodes with high-core counts when using less MPI processes
than cores is advantageous, e.g. when running with PPPM so that FFTs
are run on fewer MPI processors or when the many MPI tasks would
overload the available bandwidth for communication.
</P>
<P>Styles with a "gpu" or "cuda" suffix are part of the GPU or USER-CUDA
packages, and can be run on NVIDIA GPUs associated with your CPUs.
The speed-up due to GPU usage depends on a variety of factors, as
discussed below.
</P>
<P>To see what styles are currently available in each of the accelerated
-packages, see <A HREF = "Section_commands.html#cmd_5">this section</A> of the
+packages, see <A HREF = "Section_commands.html#cmd_5">Section_commands 5</A> of the
manual. A list of accelerated styles is included in the pair, fix,
compute, and kspace sections.
</P>
<P>The following sections explain:
</P>
<UL><LI>what hardware and software the accelerated styles require
<LI>how to build LAMMPS with the accelerated packages in place
<LI>what changes (if any) are needed in your input scripts
<LI>guidelines for best performance
<LI>speed-ups you can expect
</UL>
<P>The final section compares and contrasts the GPU and USER-CUDA
packages, since they are both designed to use NVIDIA GPU hardware.
</P>
<HR>
<HR>
<H4><A NAME = "acc_1"></A>5.1 OPT package
</H4>
<P>The OPT package was developed by James Fischer (High Performance
Technologies), David Richie, and Vincent Natoli (Stone Ridge
Technologies). It contains a handful of pair styles whose compute()
methods were rewritten in C++ templated form to reduce the overhead
due to if tests and other conditional code.
</P>
<P>The procedure for building LAMMPS with the OPT package is simple. It
is the same as for any other package which has no additional library
dependencies:
</P>
<PRE>make yes-opt
make machine
</PRE>
<P>If your input script uses one of the OPT pair styles,
you can run it as follows:
</P>
<PRE>lmp_machine -sf opt < in.script
mpirun -np 4 lmp_machine -sf opt < in.script
</PRE>
<P>You should see a reduction in the "Pair time" printed out at the end
of the run. On most machines and problems, this will typically be a 5
to 20% savings.
</P>
<HR>
<HR>
<H4><A NAME = "acc_2"></A>5.2 USER-OMP package
</H4>
<P>The USER-OMP package was developed by Axel Kohlmeyer at Temple University.
It provides multi-threaded versions of most pair styles, all dihedral
styles and a few fixes in LAMMPS. The package currently uses the OpenMP
interface which requires using a specific compiler flag in the makefile
to enable multiple threads; without this flag the corresponding pair
styles will still be compiled and work, but do not support multi-threading.
</P>
<P><B>Building LAMMPS with the USER-OMP package:</B>
</P>
<P>The procedure for building LAMMPS with the USER-OMP package is simple.
You have to edit your machine specific makefile to add the flag to
enable OpenMP support to the CCFLAGS and LINKFLAGS variables. For the
GNU compilers for example this flag is called <I>-fopenmp</I>. Check your
compiler documentation to find out which flag you need to add.
The rest of the compilation is the same as for any other package which
has no additional library dependencies:
</P>
<PRE>make yes-user-omp
make machine
</PRE>
<P>Please note that this will only install accelerated versions
of styles that are already installed, so you want to install
this package as the last package, or else you may be missing
some accelerated styles. If you plan to uninstall some package,
you should first uninstall the USER-OMP package then the other
package and then re-install USER-OMP, to make sure that there
are no orphaned <I>omp</I> style files present, which would lead to
compilation errors.
</P>
<P>If your input script uses one of regular styles that are also
exist as an OpenMP version in the USER-OMP package you can run
it as follows:
</P>
<PRE>env OMP_NUM_THREADS=4 lmp_serial -sf omp -in in.script
env OMP_NUM_THREADS=2 mpirun -np 2 lmp_machine -sf omp -in in.script
mpirun -x OMP_NUM_THREADS=2 -np 2 lmp_machine -sf omp -in in.script
</PRE>
<P>The value of the environment variable OMP_NUM_THREADS determines how
many threads per MPI task are launched. All three examples above use
a total of 4 CPU cores. For different MPI implementations the method
to pass the OMP_NUM_THREADS environment variable to all processes is
different. Two different variants, one for MPICH and OpenMPI, respectively
are shown above. Please check the documentation of your MPI installation
for additional details. Alternatively, the value provided by OMP_NUM_THREADS
can be overridded with the <A HREF = "package.html">package omp</A> command.
Depending on which styles are accelerated in your input, you should
see a reduction in the "Pair time" and/or "Bond time" and "Loop time"
printed out at the end of the run. The optimal ratio of MPI to OpenMP
can vary a lot and should always be confirmed through some benchmark
runs for the current system and on the current machine.
</P>
<P><B>Restrictions:</B>
</P>
<P>None of the pair styles in the USER-OMP package support the "inner",
"middle", "outer" options for r-RESPA integration, only the "pair"
option is supported.
</P>
<P><B>Parallel efficiency and performance tips:</B>
</P>
<P>In most simple cases the MPI parallelization in LAMMPS is more
efficient than multi-threading implemented in the USER-OMP package.
Also the parallel efficiency varies between individual styles.
On the other hand, in many cases you still want to use the <I>omp</I> version
- even when compiling or running without OpenMP support - since they
all contain optimizations similar to those in the OPT package, which
can result in serial speedup.
</P>
<P>Using multi-threading is most effective under the following circumstances:
</P>
<UL><LI>Individual compute nodes have a significant number of CPU cores
but the CPU itself has limited memory bandwidth, e.g. Intel Xeon 53xx
(Clovertown) and 54xx (Harpertown) quad core processors. Running
one MPI task per CPU core will result in significant performance
degradation, so that running with 4 or even only 2 MPI tasks per
nodes is faster. Running in hybrid MPI+OpenMP mode will reduce the
inter-node communication bandwidth contention in the same way,
but offers and additional speedup from utilizing the otherwise
idle CPU cores.
<LI>The interconnect used for MPI communication is not able to provide
sufficient bandwidth for a large number of MPI tasks per node.
This applies for example to running over gigabit ethernet or
on Cray XT4 or XT5 series supercomputers. Same as in the aforementioned
case this effect worsens with using an increasing number of nodes.
<LI>The input is a system that has an inhomogeneous particle density
which cannot be mapped well to the domain decomposition scheme
that LAMMPS employs. While this can be to some degree alleviated
through using the <A HREF = "processors.html">processors</A> keyword, multi-threading
provides a parallelism that parallelizes over the number of particles
not their distribution in space.
<LI>Finally, multi-threaded styles can improve performance when running
LAMMPS in "capability mode", i.e. near the point where the MPI
parallelism scales out. This can happen in particular when using
as kspace style for long-range electrostatics. Here the scaling
of the kspace style is the performance limiting factor and using
multi-threaded styles allows to operate the kspace style at the
limit of scaling and then increase performance parallelizing
the real space calculations with hybrid MPI+OpenMP. Sometimes
additional speedup can be achived by increasing the real-space
coulomb cutoff and thus reducing the work in the kspace part.
</UL>
<P>The best parallel efficiency from <I>omp</I> styles is typically
achieved when there is at least one MPI task per physical
processor, i.e. socket or die.
</P>
<P>Using threads on hyper-threading enabled cores is usually
counterproductive, as the cost in additional memory bandwidth
requirements is not offset by the gain in CPU utilization
through hyper-threading.
</P>
<P>A description of the multi-threading strategy and some performance
examples are <A HREF = "http://sites.google.com/site/akohlmey/software/lammps-icms/lammps-icms-tms2011-talk.pdf?attredirects=0&d=1">presented here</A>
</P>
<HR>
<HR>
<H4><A NAME = "acc_3"></A>5.3 GPU package
</H4>
<P>The GPU package was developed by Mike Brown at ORNL. It provides GPU
versions of several pair styles and for long-range Coulombics via the
PPPM command. It has the following features:
</P>
<UL><LI>The package is designed to exploit common GPU hardware configurations
where one or more GPUs are coupled with many cores of a multi-core
CPUs, e.g. within a node of a parallel machine.
<LI>Atom-based data (e.g. coordinates, forces) moves back-and-forth
between the CPU(s) and GPU every timestep.
<LI>Neighbor lists can be constructed on the CPU or on the GPU
<LI>The charge assignement and force interpolation portions of PPPM can be
run on the GPU. The FFT portion, which requires MPI communication
between processors, runs on the CPU.
<LI>Asynchronous force computations can be performed simultaneously on the
CPU(s) and GPU.
<LI>LAMMPS-specific code is in the GPU package. It makes calls to a
generic GPU library in the lib/gpu directory. This library provides
NVIDIA support as well as more general OpenCL support, so that the
same functionality can eventually be supported on a variety of GPU
hardware.
</UL>
<P><B>Hardware and software requirements:</B>
</P>
<P>To use this package, you currently need to have specific NVIDIA
hardware and install specific NVIDIA CUDA software on your system:
</P>
<UL><LI>Check if you have an NVIDIA card: cat /proc/driver/nvidia/cards/0
<LI>Go to http://www.nvidia.com/object/cuda_get.html
<LI>Install a driver and toolkit appropriate for your system (SDK is not necessary)
<LI>Follow the instructions in lammps/lib/gpu/README to build the library (see below)
<LI>Run lammps/lib/gpu/nvc_get_devices to list supported devices and properties
</UL>
<P><B>Building LAMMPS with the GPU package:</B>
</P>
<P>As with other packages that include a separately compiled library, you
need to first build the GPU library, before building LAMMPS itself.
General instructions for doing this are in <A HREF = "doc/Section_start.html#start_3">this
section</A> of the manual. For this
package, do the following, using a Makefile in lib/gpu appropriate for
your system:
</P>
<PRE>cd lammps/lib/gpu
make -f Makefile.linux
(see further instructions in lammps/lib/gpu/README)
</PRE>
<P>If you are successful, you will produce the file lib/libgpu.a.
</P>
<P>Now you are ready to build LAMMPS with the GPU package installed:
</P>
<PRE>cd lammps/src
make yes-gpu
make machine
</PRE>
<P>Note that the lo-level Makefile (e.g. src/MAKE/Makefile.linux) has
these settings: gpu_SYSINC, gpu_SYSLIB, gpu_SYSPATH. These need to be
set appropriately to include the paths and settings for the CUDA
system software on your machine. See src/MAKE/Makefile.g++ for an
example.
</P>
<P><B>GPU configuration</B>
</P>
<P>When using GPUs, you are restricted to one physical GPU per LAMMPS
process, which is an MPI process running on a single core or
processor. Multiple MPI processes (CPU cores) can share a single GPU,
and in many cases it will be more efficient to run this way.
</P>
<P><B>Input script requirements:</B>
</P>
<P>Additional input script requirements to run pair or PPPM styles with a
<I>gpu</I> suffix are as follows:
</P>
<UL><LI>To invoke specific styles from the GPU package, you can either append
"gpu" to the style name (e.g. pair_style lj/cut/gpu), or use the
<A HREF = "Section_start.html#start_6">-suffix command-line switch</A>, or use the
<A HREF = "suffix.html">suffix</A> command.
<LI>The <A HREF = "newton.html">newton pair</A> setting must be <I>off</I>.
<LI>The <A HREF = "package.html">package gpu</A> command must be used near the beginning
of your script to control the GPU selection and initialization
settings. It also has an option to enable asynchronous splitting of
force computations between the CPUs and GPUs.
</UL>
<P>As an example, if you have two GPUs per node and 8 CPU cores per node,
and would like to run on 4 nodes (32 cores) with dynamic balancing of
force calculation across CPU and GPU cores, you could specify
</P>
<PRE>package gpu force/neigh 0 1 -1
</PRE>
<P>In this case, all CPU cores and GPU devices on the nodes would be
utilized. Each GPU device would be shared by 4 CPU cores. The CPU
cores would perform force calculations for some fraction of the
particles at the same time the GPUs performed force calculation for
the other particles.
</P>
<P><B>Timing output:</B>
</P>
<P>As described by the <A HREF = "package.html">package gpu</A> command, GPU
accelerated pair styles can perform computations asynchronously with
CPU computations. The "Pair" time reported by LAMMPS will be the
maximum of the time required to complete the CPU pair style
computations and the time required to complete the GPU pair style
computations. Any time spent for GPU-enabled pair styles for
computations that run simultaneously with <A HREF = "bond_style.html">bond</A>,
<A HREF = "angle_style.html">angle</A>, <A HREF = "dihedral_style.html">dihedral</A>,
<A HREF = "improper_style.html">improper</A>, and <A HREF = "kspace_style.html">long-range</A>
calculations will not be included in the "Pair" time.
</P>
<P>When the <I>mode</I> setting for the package gpu command is force/neigh,
the time for neighbor list calculations on the GPU will be added into
the "Pair" time, not the "Neigh" time. An additional breakdown of the
times required for various tasks on the GPU (data copy, neighbor
calculations, force computations, etc) are output only with the LAMMPS
screen output (not in the log file) at the end of each run. These
timings represent total time spent on the GPU for each routine,
regardless of asynchronous CPU calculations.
</P>
<P><B>Performance tips:</B>
</P>
<P>Generally speaking, for best performance, you should use multiple CPUs
per GPU, as provided my most multi-core CPU/GPU configurations.
</P>
<P>Because of the large number of cores within each GPU device, it may be
more efficient to run on fewer processes per GPU when the number of
particles per MPI process is small (100's of particles); this can be
necessary to keep the GPU cores busy.
</P>
<P>See the lammps/lib/gpu/README file for instructions on how to build
the GPU library for single, mixed, or double precision. The latter
requires that your GPU card support double precision.
</P>
<HR>
<HR>
<H4><A NAME = "acc_4"></A>5.4 USER-CUDA package
</H4>
<P>The USER-CUDA package was developed by Christian Trott at U Technology
Ilmenau in Germany. It provides NVIDIA GPU versions of many pair
styles, many fixes, a few computes, and for long-range Coulombics via
the PPPM command. It has the following features:
</P>
<UL><LI>The package is designed to allow an entire LAMMPS calculation, for
many timesteps, to run entirely on the GPU (except for inter-processor
MPI communication), so that atom-based data (e.g. coordinates, forces)
do not have to move back-and-forth between the CPU and GPU.
<LI>The speed-up advantage of this approach is typically better when the
number of atoms per GPU is large
<LI>Data will stay on the GPU until a timestep where a non-GPU-ized fix or
compute is invoked. Whenever a non-GPU operation occurs (fix,
compute, output), data automatically moves back to the CPU as needed.
This may incur a performance penalty, but should otherwise work
transparently.
<LI>Neighbor lists for GPU-ized pair styles are constructed on the
GPU.
<LI>The package only supports use of a single CPU (core) with each
GPU.
</UL>
<P><B>Hardware and software requirements:</B>
</P>
<P>To use this package, you need to have specific NVIDIA hardware and
install specific NVIDIA CUDA software on your system.
</P>
<P>Your NVIDIA GPU needs to support Compute Capability 1.3. This list may
help you to find out the Compute Capability of your card:
</P>
<P>http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units
</P>
<P>Install the Nvidia Cuda Toolkit in version 3.2 or higher and the
corresponding GPU drivers. The Nvidia Cuda SDK is not required for
LAMMPSCUDA but we recommend it be installed. You can then make sure
that its sample projects can be compiled without problems.
</P>
<P><B>Building LAMMPS with the USER-CUDA package:</B>
</P>
<P>As with other packages that include a separately compiled library, you
need to first build the USER-CUDA library, before building LAMMPS
itself. General instructions for doing this are in <A HREF = "doc/Section_start.html#start_3">this
section</A> of the manual. For this
package, do the following, using settings in the lib/cuda Makefiles
appropriate for your system:
</P>
<UL><LI>Go to the lammps/lib/cuda directory
<LI>If your <I>CUDA</I> toolkit is not installed in the default system directoy
<I>/usr/local/cuda</I> edit the file <I>lib/cuda/Makefile.common</I>
accordingly.
<LI>Type "make OPTIONS", where <I>OPTIONS</I> are one or more of the following
options. The settings will be written to the
<I>lib/cuda/Makefile.defaults</I> and used in the next step.
<PRE><I>precision=N</I> to set the precision level
N = 1 for single precision (default)
N = 2 for double precision
N = 3 for positions in double precision
N = 4 for positions and velocities in double precision
<I>arch=M</I> to set GPU compute capability
M = 20 for CC2.0 (GF100/110, e.g. C2050,GTX580,GTX470) (default)
M = 21 for CC2.1 (GF104/114, e.g. GTX560, GTX460, GTX450)
M = 13 for CC1.3 (GF200, e.g. C1060, GTX285)
<I>prec_timer=0/1</I> to use hi-precision timers
0 = do not use them (default)
1 = use these timers
this is usually only useful for Mac machines
<I>dbg=0/1</I> to activate debug mode
0 = no debug mode (default)
1 = yes debug mode
this is only useful for developers
<I>cufft=1</I> to determine usage of CUDA FFT library
0 = no CUFFT support (default)
in the future other CUDA-enabled FFT libraries might be supported
</PRE>
<LI>Type "make" to build the library. If you are successful, you will
produce the file lib/libcuda.a.
</UL>
<P>Now you are ready to build LAMMPS with the USER-CUDA package installed:
</P>
<PRE>cd lammps/src
make yes-user-cuda
make machine
</PRE>
<P>Note that the LAMMPS build references the lib/cuda/Makefile.common
file to extract setting specific CUDA settings. So it is important
that you have first built the cuda library (in lib/cuda) using
settings appropriate to your system.
</P>
<P><B>Input script requirements:</B>
</P>
<P>Additional input script requirements to run styles with a <I>cuda</I>
suffix are as follows:
</P>
<UL><LI>To invoke specific styles from the USER-CUDA package, you can either
append "cuda" to the style name (e.g. pair_style lj/cut/cuda), or use
the <A HREF = "Section_start.html#start_6">-suffix command-line switch</A>, or use
the <A HREF = "suffix.html">suffix</A> command. One exception is that the
<A HREF = "kspace_style.html">kspace_style pppm/cuda</A> command has to be requested
explicitly.
<LI>To use the USER-CUDA package with its default settings, no additional
command is needed in your input script. This is because when LAMMPS
starts up, it detects if it has been built with the USER-CUDA package.
See the <A HREF = "Section_start.html#start_6">-cuda command-line switch</A> for
more details.
<LI>To change settings for the USER-CUDA package at run-time, the <A HREF = "package.html">package
cuda</A> command can be used near the beginning of your
input script. See the <A HREF = "package.html">package</A> command doc page for
details.
</UL>
<P><B>Performance tips:</B>
</P>
<P>The USER-CUDA package offers more speed-up relative to CPU performance
when the number of atoms per GPU is large, e.g. on the order of tens
or hundreds of 1000s.
</P>
<P>As noted above, this package will continue to run a simulation
entirely on the GPU(s) (except for inter-processor MPI communication),
for multiple timesteps, until a CPU calculation is required, either by
a fix or compute that is non-GPU-ized, or until output is performed
(thermo or dump snapshot or restart file). The less often this
occurs, the faster your simulation will run.
</P>
<HR>
<HR>
<H4><A NAME = "acc_5"></A>5.5 Comparison of GPU and USER-CUDA packages
</H4>
<P>Both the GPU and USER-CUDA packages accelerate a LAMMPS calculation
using NVIDIA hardware, but they do it in different ways.
</P>
<P>As a consequence, for a particular simulation on specific hardware,
one package may be faster than the other. We give guidelines below,
but the best way to determine which package is faster for your input
script is to try both of them on your machine. See the benchmarking
section below for examples where this has been done.
</P>
<P><B>Guidelines for using each package optimally:</B>
</P>
<UL><LI>The GPU package allows you to assign multiple CPUs (cores) to a single
GPU (a common configuration for "hybrid" nodes that contain multicore
CPU(s) and GPU(s)) and works effectively in this mode. The USER-CUDA
package does not allow this; you can only use one CPU per GPU.
<LI>The GPU package moves per-atom data (coordinates, forces)
back-and-forth between the CPU and GPU every timestep. The USER-CUDA
package only does this on timesteps when a CPU calculation is required
(e.g. to invoke a fix or compute that is non-GPU-ized). Hence, if you
can formulate your input script to only use GPU-ized fixes and
computes, and avoid doing I/O too often (thermo output, dump file
snapshots, restart files), then the data transfer cost of the
USER-CUDA package can be very low, causing it to run faster than the
GPU package.
<LI>The GPU package is often faster than the USER-CUDA package, if the
number of atoms per GPU is "small". The crossover point, in terms of
atoms/GPU at which the USER-CUDA package becomes faster depends
strongly on the pair style. For example, for a simple Lennard Jones
system the crossover (in single precision) is often about 50K-100K
atoms per GPU. When performing double precision calculations the
crossover point can be significantly smaller.
<LI>Both packages compute bonded interactions (bonds, angles, etc) on the
CPU. This means a model with bonds will force the USER-CUDA package
to transfer per-atom data back-and-forth between the CPU and GPU every
timestep. If the GPU package is running with several MPI processes
assigned to one GPU, the cost of computing the bonded interactions is
spread across more CPUs and hence the GPU package can run faster.
<LI>When using the GPU package with multiple CPUs assigned to one GPU, its
performance depends to some extent on high bandwidth between the CPUs
and the GPU. Hence its performance is affected if full 16 PCIe lanes
are not available for each GPU. In HPC environments this can be the
case if S2050/70 servers are used, where two devices generally share
one PCIe 2.0 16x slot. Also many multi-GPU mainboards do not provide
full 16 lanes to each of the PCIe 2.0 16x slots.
</UL>
<P><B>Differences between the two packages:</B>
</P>
<UL><LI>The GPU package accelerates only pair force, neighbor list, and PPPM
calculations. The USER-CUDA package currently supports a wider range
of pair styles and can also accelerate many fix styles and some
compute styles, as well as neighbor list and PPPM calculations.
<LI>The GPU package uses more GPU memory than the USER-CUDA package. This
is generally not a problem since typical runs are computation-limited
rather than memory-limited.
</UL>
<P><B>Examples:</B>
</P>
<P>The LAMMPS distribution has two directories with sample input scripts
for the GPU and USER-CUDA packages.
</P>
<UL><LI>lammps/examples/gpu = GPU package files
<LI>lammps/examples/USER/cuda = USER-CUDA package files
</UL>
<P>These contain input scripts for identical systems, so they can be used
to benchmark the performance of both packages on your system.
</P>
<HR>
<P><B>Benchmark data:</B>
</P>
<P>NOTE: We plan to add some benchmark results and plots here for the
examples described in the previous section.
</P>
<P>Simulations:
</P>
<P>1. Lennard Jones
</P>
<UL><LI>256,000 atoms
<LI>2.5 A cutoff
<LI>0.844 density
</UL>
<P>2. Lennard Jones
</P>
<UL><LI>256,000 atoms
<LI>5.0 A cutoff
<LI>0.844 density
</UL>
<P>3. Rhodopsin model
</P>
<UL><LI>256,000 atoms
<LI>10A cutoff
<LI>Coulomb via PPPM
</UL>
<P>4. Lihtium-Phosphate
</P>
<UL><LI>295650 atoms
<LI>15A cutoff
<LI>Coulomb via PPPM
</UL>
<P>Hardware:
</P>
<P>Workstation:
</P>
<UL><LI>2x GTX470
<LI>i7 950@3GHz
<LI>24Gb DDR3 @ 1066Mhz
<LI>CentOS 5.5
<LI>CUDA 3.2
<LI>Driver 260.19.12
</UL>
<P>eStella:
</P>
<UL><LI>6 Nodes
<LI>2xC2050
<LI>2xQDR Infiniband interconnect(aggregate bandwidth 80GBps)
<LI>Intel X5650 HexCore @ 2.67GHz
<LI>SL 5.5
<LI>CUDA 3.2
<LI>Driver 260.19.26
</UL>
<P>Keeneland:
</P>
<UL><LI>HP SL-390 (Ariston) cluster
<LI>120 nodes
<LI>2x Intel Westmere hex-core CPUs
<LI>3xC2070s
<LI>QDR InfiniBand interconnect
</UL>
</HTML>
diff --git a/doc/Section_accelerate.txt b/doc/Section_accelerate.txt
index 081e6279d..37a49d5f6 100644
--- a/doc/Section_accelerate.txt
+++ b/doc/Section_accelerate.txt
@@ -1,644 +1,644 @@
"Previous Section"_Section_packages.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next
Section"_Section_howto.html :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
5. Accelerating LAMMPS performance :h3
This section describes various methods for improving LAMMPS
performance for different classes of problems running
on different kinds of machines.
5.1 "OPT package"_#acc_1
5.2 "USER-OMP package"_#acc_2
5.3 "GPU package"_#acc_3
5.4 "USER-CUDA package"_#acc_4
5.5 "Comparison of GPU and USER-CUDA packages"_#acc_5 :all(b)
Accelerated versions of various "pair_style"_pair_style.html,
"fixes"_fix.html, "computes"_compute.html, and other commands have
been added to LAMMPS, which will typically run faster than the
standard non-accelerated versions, if you have the appropriate
hardware on your system.
The accelerated styles have the same name as the standard styles,
except that a suffix is appended. Otherwise, the syntax for the
command is identical, their functionality is the same, and the
numerical results it produces should also be identical, except for
precision and round-off issues.
For example, all of these variants of the basic Lennard-Jones pair
style exist in LAMMPS:
"pair_style lj/cut"_pair_lj.html
"pair_style lj/cut/opt"_pair_lj.html
"pair_style lj/cut/omp"_pair_lj.html
"pair_style lj/cut/gpu"_pair_lj.html
"pair_style lj/cut/cuda"_pair_lj.html :ul
Assuming you have built LAMMPS with the appropriate package, these
styles can be invoked by specifying them explicitly in your input
script. Or you can use the "-suffix command-line
switch"_Section_start.html#start_6 to invoke the accelerated versions
automatically, without changing your input script. The
"suffix"_suffix.html command allows you to set a suffix explicitly and
to turn off/on the comand-line switch setting, both from within your
input script.
Styles with an "opt" suffix are part of the OPT package and typically
speed-up the pairwise calculations of your simulation by 5-25%.
Styles with an "omp" suffix are part of the USER-OMP package and allow
a pair-style to be run in multi-threaded mode using OpenMP. This can
be useful on nodes with high-core counts when using less MPI processes
than cores is advantageous, e.g. when running with PPPM so that FFTs
are run on fewer MPI processors or when the many MPI tasks would
overload the available bandwidth for communication.
Styles with a "gpu" or "cuda" suffix are part of the GPU or USER-CUDA
packages, and can be run on NVIDIA GPUs associated with your CPUs.
The speed-up due to GPU usage depends on a variety of factors, as
discussed below.
To see what styles are currently available in each of the accelerated
-packages, see "this section"_Section_commands.html#cmd_5 of the
+packages, see "Section_commands 5"_Section_commands.html#cmd_5 of the
manual. A list of accelerated styles is included in the pair, fix,
compute, and kspace sections.
The following sections explain:
what hardware and software the accelerated styles require
how to build LAMMPS with the accelerated packages in place
what changes (if any) are needed in your input scripts
guidelines for best performance
speed-ups you can expect :ul
The final section compares and contrasts the GPU and USER-CUDA
packages, since they are both designed to use NVIDIA GPU hardware.
:line
:line
5.1 OPT package :h4,link(acc_1)
The OPT package was developed by James Fischer (High Performance
Technologies), David Richie, and Vincent Natoli (Stone Ridge
Technologies). It contains a handful of pair styles whose compute()
methods were rewritten in C++ templated form to reduce the overhead
due to if tests and other conditional code.
The procedure for building LAMMPS with the OPT package is simple. It
is the same as for any other package which has no additional library
dependencies:
make yes-opt
make machine :pre
If your input script uses one of the OPT pair styles,
you can run it as follows:
lmp_machine -sf opt < in.script
mpirun -np 4 lmp_machine -sf opt < in.script :pre
You should see a reduction in the "Pair time" printed out at the end
of the run. On most machines and problems, this will typically be a 5
to 20% savings.
:line
:line
5.2 USER-OMP package :h4,link(acc_2)
The USER-OMP package was developed by Axel Kohlmeyer at Temple University.
It provides multi-threaded versions of most pair styles, all dihedral
styles and a few fixes in LAMMPS. The package currently uses the OpenMP
interface which requires using a specific compiler flag in the makefile
to enable multiple threads; without this flag the corresponding pair
styles will still be compiled and work, but do not support multi-threading.
[Building LAMMPS with the USER-OMP package:]
The procedure for building LAMMPS with the USER-OMP package is simple.
You have to edit your machine specific makefile to add the flag to
enable OpenMP support to the CCFLAGS and LINKFLAGS variables. For the
GNU compilers for example this flag is called {-fopenmp}. Check your
compiler documentation to find out which flag you need to add.
The rest of the compilation is the same as for any other package which
has no additional library dependencies:
make yes-user-omp
make machine :pre
Please note that this will only install accelerated versions
of styles that are already installed, so you want to install
this package as the last package, or else you may be missing
some accelerated styles. If you plan to uninstall some package,
you should first uninstall the USER-OMP package then the other
package and then re-install USER-OMP, to make sure that there
are no orphaned {omp} style files present, which would lead to
compilation errors.
If your input script uses one of regular styles that are also
exist as an OpenMP version in the USER-OMP package you can run
it as follows:
env OMP_NUM_THREADS=4 lmp_serial -sf omp -in in.script
env OMP_NUM_THREADS=2 mpirun -np 2 lmp_machine -sf omp -in in.script
mpirun -x OMP_NUM_THREADS=2 -np 2 lmp_machine -sf omp -in in.script :pre
The value of the environment variable OMP_NUM_THREADS determines how
many threads per MPI task are launched. All three examples above use
a total of 4 CPU cores. For different MPI implementations the method
to pass the OMP_NUM_THREADS environment variable to all processes is
different. Two different variants, one for MPICH and OpenMPI, respectively
are shown above. Please check the documentation of your MPI installation
for additional details. Alternatively, the value provided by OMP_NUM_THREADS
can be overridded with the "package omp"_package.html command.
Depending on which styles are accelerated in your input, you should
see a reduction in the "Pair time" and/or "Bond time" and "Loop time"
printed out at the end of the run. The optimal ratio of MPI to OpenMP
can vary a lot and should always be confirmed through some benchmark
runs for the current system and on the current machine.
[Restrictions:]
None of the pair styles in the USER-OMP package support the "inner",
"middle", "outer" options for r-RESPA integration, only the "pair"
option is supported.
[Parallel efficiency and performance tips:]
In most simple cases the MPI parallelization in LAMMPS is more
efficient than multi-threading implemented in the USER-OMP package.
Also the parallel efficiency varies between individual styles.
On the other hand, in many cases you still want to use the {omp} version
- even when compiling or running without OpenMP support - since they
all contain optimizations similar to those in the OPT package, which
can result in serial speedup.
Using multi-threading is most effective under the following circumstances:
Individual compute nodes have a significant number of CPU cores
but the CPU itself has limited memory bandwidth, e.g. Intel Xeon 53xx
(Clovertown) and 54xx (Harpertown) quad core processors. Running
one MPI task per CPU core will result in significant performance
degradation, so that running with 4 or even only 2 MPI tasks per
nodes is faster. Running in hybrid MPI+OpenMP mode will reduce the
inter-node communication bandwidth contention in the same way,
but offers and additional speedup from utilizing the otherwise
idle CPU cores. :ulb,l
The interconnect used for MPI communication is not able to provide
sufficient bandwidth for a large number of MPI tasks per node.
This applies for example to running over gigabit ethernet or
on Cray XT4 or XT5 series supercomputers. Same as in the aforementioned
case this effect worsens with using an increasing number of nodes. :l
The input is a system that has an inhomogeneous particle density
which cannot be mapped well to the domain decomposition scheme
that LAMMPS employs. While this can be to some degree alleviated
through using the "processors"_processors.html keyword, multi-threading
provides a parallelism that parallelizes over the number of particles
not their distribution in space. :l
Finally, multi-threaded styles can improve performance when running
LAMMPS in "capability mode", i.e. near the point where the MPI
parallelism scales out. This can happen in particular when using
as kspace style for long-range electrostatics. Here the scaling
of the kspace style is the performance limiting factor and using
multi-threaded styles allows to operate the kspace style at the
limit of scaling and then increase performance parallelizing
the real space calculations with hybrid MPI+OpenMP. Sometimes
additional speedup can be achived by increasing the real-space
coulomb cutoff and thus reducing the work in the kspace part. :l,ule
The best parallel efficiency from {omp} styles is typically
achieved when there is at least one MPI task per physical
processor, i.e. socket or die.
Using threads on hyper-threading enabled cores is usually
counterproductive, as the cost in additional memory bandwidth
requirements is not offset by the gain in CPU utilization
through hyper-threading.
A description of the multi-threading strategy and some performance
examples are "presented here"_http://sites.google.com/site/akohlmey/software/lammps-icms/lammps-icms-tms2011-talk.pdf?attredirects=0&d=1
:line
:line
5.3 GPU package :h4,link(acc_3)
The GPU package was developed by Mike Brown at ORNL. It provides GPU
versions of several pair styles and for long-range Coulombics via the
PPPM command. It has the following features:
The package is designed to exploit common GPU hardware configurations
where one or more GPUs are coupled with many cores of a multi-core
CPUs, e.g. within a node of a parallel machine. :ulb,l
Atom-based data (e.g. coordinates, forces) moves back-and-forth
between the CPU(s) and GPU every timestep. :l
Neighbor lists can be constructed on the CPU or on the GPU :l
The charge assignement and force interpolation portions of PPPM can be
run on the GPU. The FFT portion, which requires MPI communication
between processors, runs on the CPU. :l
Asynchronous force computations can be performed simultaneously on the
CPU(s) and GPU. :l
LAMMPS-specific code is in the GPU package. It makes calls to a
generic GPU library in the lib/gpu directory. This library provides
NVIDIA support as well as more general OpenCL support, so that the
same functionality can eventually be supported on a variety of GPU
hardware. :l,ule
[Hardware and software requirements:]
To use this package, you currently need to have specific NVIDIA
hardware and install specific NVIDIA CUDA software on your system:
Check if you have an NVIDIA card: cat /proc/driver/nvidia/cards/0
Go to http://www.nvidia.com/object/cuda_get.html
Install a driver and toolkit appropriate for your system (SDK is not necessary)
Follow the instructions in lammps/lib/gpu/README to build the library (see below)
Run lammps/lib/gpu/nvc_get_devices to list supported devices and properties :ul
[Building LAMMPS with the GPU package:]
As with other packages that include a separately compiled library, you
need to first build the GPU library, before building LAMMPS itself.
General instructions for doing this are in "this
section"_doc/Section_start.html#start_3 of the manual. For this
package, do the following, using a Makefile in lib/gpu appropriate for
your system:
cd lammps/lib/gpu
make -f Makefile.linux
(see further instructions in lammps/lib/gpu/README) :pre
If you are successful, you will produce the file lib/libgpu.a.
Now you are ready to build LAMMPS with the GPU package installed:
cd lammps/src
make yes-gpu
make machine :pre
Note that the lo-level Makefile (e.g. src/MAKE/Makefile.linux) has
these settings: gpu_SYSINC, gpu_SYSLIB, gpu_SYSPATH. These need to be
set appropriately to include the paths and settings for the CUDA
system software on your machine. See src/MAKE/Makefile.g++ for an
example.
[GPU configuration]
When using GPUs, you are restricted to one physical GPU per LAMMPS
process, which is an MPI process running on a single core or
processor. Multiple MPI processes (CPU cores) can share a single GPU,
and in many cases it will be more efficient to run this way.
[Input script requirements:]
Additional input script requirements to run pair or PPPM styles with a
{gpu} suffix are as follows:
To invoke specific styles from the GPU package, you can either append
"gpu" to the style name (e.g. pair_style lj/cut/gpu), or use the
"-suffix command-line switch"_Section_start.html#start_6, or use the
"suffix"_suffix.html command. :ulb,l
The "newton pair"_newton.html setting must be {off}. :l
The "package gpu"_package.html command must be used near the beginning
of your script to control the GPU selection and initialization
settings. It also has an option to enable asynchronous splitting of
force computations between the CPUs and GPUs. :l,ule
As an example, if you have two GPUs per node and 8 CPU cores per node,
and would like to run on 4 nodes (32 cores) with dynamic balancing of
force calculation across CPU and GPU cores, you could specify
package gpu force/neigh 0 1 -1 :pre
In this case, all CPU cores and GPU devices on the nodes would be
utilized. Each GPU device would be shared by 4 CPU cores. The CPU
cores would perform force calculations for some fraction of the
particles at the same time the GPUs performed force calculation for
the other particles.
[Timing output:]
As described by the "package gpu"_package.html command, GPU
accelerated pair styles can perform computations asynchronously with
CPU computations. The "Pair" time reported by LAMMPS will be the
maximum of the time required to complete the CPU pair style
computations and the time required to complete the GPU pair style
computations. Any time spent for GPU-enabled pair styles for
computations that run simultaneously with "bond"_bond_style.html,
"angle"_angle_style.html, "dihedral"_dihedral_style.html,
"improper"_improper_style.html, and "long-range"_kspace_style.html
calculations will not be included in the "Pair" time.
When the {mode} setting for the package gpu command is force/neigh,
the time for neighbor list calculations on the GPU will be added into
the "Pair" time, not the "Neigh" time. An additional breakdown of the
times required for various tasks on the GPU (data copy, neighbor
calculations, force computations, etc) are output only with the LAMMPS
screen output (not in the log file) at the end of each run. These
timings represent total time spent on the GPU for each routine,
regardless of asynchronous CPU calculations.
[Performance tips:]
Generally speaking, for best performance, you should use multiple CPUs
per GPU, as provided my most multi-core CPU/GPU configurations.
Because of the large number of cores within each GPU device, it may be
more efficient to run on fewer processes per GPU when the number of
particles per MPI process is small (100's of particles); this can be
necessary to keep the GPU cores busy.
See the lammps/lib/gpu/README file for instructions on how to build
the GPU library for single, mixed, or double precision. The latter
requires that your GPU card support double precision.
:line
:line
5.4 USER-CUDA package :h4,link(acc_4)
The USER-CUDA package was developed by Christian Trott at U Technology
Ilmenau in Germany. It provides NVIDIA GPU versions of many pair
styles, many fixes, a few computes, and for long-range Coulombics via
the PPPM command. It has the following features:
The package is designed to allow an entire LAMMPS calculation, for
many timesteps, to run entirely on the GPU (except for inter-processor
MPI communication), so that atom-based data (e.g. coordinates, forces)
do not have to move back-and-forth between the CPU and GPU. :ulb,l
The speed-up advantage of this approach is typically better when the
number of atoms per GPU is large :l
Data will stay on the GPU until a timestep where a non-GPU-ized fix or
compute is invoked. Whenever a non-GPU operation occurs (fix,
compute, output), data automatically moves back to the CPU as needed.
This may incur a performance penalty, but should otherwise work
transparently. :l
Neighbor lists for GPU-ized pair styles are constructed on the
GPU. :l
The package only supports use of a single CPU (core) with each
GPU. :l,ule
[Hardware and software requirements:]
To use this package, you need to have specific NVIDIA hardware and
install specific NVIDIA CUDA software on your system.
Your NVIDIA GPU needs to support Compute Capability 1.3. This list may
help you to find out the Compute Capability of your card:
http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units
Install the Nvidia Cuda Toolkit in version 3.2 or higher and the
corresponding GPU drivers. The Nvidia Cuda SDK is not required for
LAMMPSCUDA but we recommend it be installed. You can then make sure
that its sample projects can be compiled without problems.
[Building LAMMPS with the USER-CUDA package:]
As with other packages that include a separately compiled library, you
need to first build the USER-CUDA library, before building LAMMPS
itself. General instructions for doing this are in "this
section"_doc/Section_start.html#start_3 of the manual. For this
package, do the following, using settings in the lib/cuda Makefiles
appropriate for your system:
Go to the lammps/lib/cuda directory :ulb,l
If your {CUDA} toolkit is not installed in the default system directoy
{/usr/local/cuda} edit the file {lib/cuda/Makefile.common}
accordingly. :l
Type "make OPTIONS", where {OPTIONS} are one or more of the following
options. The settings will be written to the
{lib/cuda/Makefile.defaults} and used in the next step. :l
{precision=N} to set the precision level
N = 1 for single precision (default)
N = 2 for double precision
N = 3 for positions in double precision
N = 4 for positions and velocities in double precision
{arch=M} to set GPU compute capability
M = 20 for CC2.0 (GF100/110, e.g. C2050,GTX580,GTX470) (default)
M = 21 for CC2.1 (GF104/114, e.g. GTX560, GTX460, GTX450)
M = 13 for CC1.3 (GF200, e.g. C1060, GTX285)
{prec_timer=0/1} to use hi-precision timers
0 = do not use them (default)
1 = use these timers
this is usually only useful for Mac machines
{dbg=0/1} to activate debug mode
0 = no debug mode (default)
1 = yes debug mode
this is only useful for developers
{cufft=1} to determine usage of CUDA FFT library
0 = no CUFFT support (default)
in the future other CUDA-enabled FFT libraries might be supported :pre
Type "make" to build the library. If you are successful, you will
produce the file lib/libcuda.a. :l,ule
Now you are ready to build LAMMPS with the USER-CUDA package installed:
cd lammps/src
make yes-user-cuda
make machine :pre
Note that the LAMMPS build references the lib/cuda/Makefile.common
file to extract setting specific CUDA settings. So it is important
that you have first built the cuda library (in lib/cuda) using
settings appropriate to your system.
[Input script requirements:]
Additional input script requirements to run styles with a {cuda}
suffix are as follows:
To invoke specific styles from the USER-CUDA package, you can either
append "cuda" to the style name (e.g. pair_style lj/cut/cuda), or use
the "-suffix command-line switch"_Section_start.html#start_6, or use
the "suffix"_suffix.html command. One exception is that the
"kspace_style pppm/cuda"_kspace_style.html command has to be requested
explicitly. :ulb,l
To use the USER-CUDA package with its default settings, no additional
command is needed in your input script. This is because when LAMMPS
starts up, it detects if it has been built with the USER-CUDA package.
See the "-cuda command-line switch"_Section_start.html#start_6 for
more details. :l
To change settings for the USER-CUDA package at run-time, the "package
cuda"_package.html command can be used near the beginning of your
input script. See the "package"_package.html command doc page for
details. :l,ule
[Performance tips:]
The USER-CUDA package offers more speed-up relative to CPU performance
when the number of atoms per GPU is large, e.g. on the order of tens
or hundreds of 1000s.
As noted above, this package will continue to run a simulation
entirely on the GPU(s) (except for inter-processor MPI communication),
for multiple timesteps, until a CPU calculation is required, either by
a fix or compute that is non-GPU-ized, or until output is performed
(thermo or dump snapshot or restart file). The less often this
occurs, the faster your simulation will run.
:line
:line
5.5 Comparison of GPU and USER-CUDA packages :h4,link(acc_5)
Both the GPU and USER-CUDA packages accelerate a LAMMPS calculation
using NVIDIA hardware, but they do it in different ways.
As a consequence, for a particular simulation on specific hardware,
one package may be faster than the other. We give guidelines below,
but the best way to determine which package is faster for your input
script is to try both of them on your machine. See the benchmarking
section below for examples where this has been done.
[Guidelines for using each package optimally:]
The GPU package allows you to assign multiple CPUs (cores) to a single
GPU (a common configuration for "hybrid" nodes that contain multicore
CPU(s) and GPU(s)) and works effectively in this mode. The USER-CUDA
package does not allow this; you can only use one CPU per GPU. :ulb,l
The GPU package moves per-atom data (coordinates, forces)
back-and-forth between the CPU and GPU every timestep. The USER-CUDA
package only does this on timesteps when a CPU calculation is required
(e.g. to invoke a fix or compute that is non-GPU-ized). Hence, if you
can formulate your input script to only use GPU-ized fixes and
computes, and avoid doing I/O too often (thermo output, dump file
snapshots, restart files), then the data transfer cost of the
USER-CUDA package can be very low, causing it to run faster than the
GPU package. :l
The GPU package is often faster than the USER-CUDA package, if the
number of atoms per GPU is "small". The crossover point, in terms of
atoms/GPU at which the USER-CUDA package becomes faster depends
strongly on the pair style. For example, for a simple Lennard Jones
system the crossover (in single precision) is often about 50K-100K
atoms per GPU. When performing double precision calculations the
crossover point can be significantly smaller. :l
Both packages compute bonded interactions (bonds, angles, etc) on the
CPU. This means a model with bonds will force the USER-CUDA package
to transfer per-atom data back-and-forth between the CPU and GPU every
timestep. If the GPU package is running with several MPI processes
assigned to one GPU, the cost of computing the bonded interactions is
spread across more CPUs and hence the GPU package can run faster. :l
When using the GPU package with multiple CPUs assigned to one GPU, its
performance depends to some extent on high bandwidth between the CPUs
and the GPU. Hence its performance is affected if full 16 PCIe lanes
are not available for each GPU. In HPC environments this can be the
case if S2050/70 servers are used, where two devices generally share
one PCIe 2.0 16x slot. Also many multi-GPU mainboards do not provide
full 16 lanes to each of the PCIe 2.0 16x slots. :l,ule
[Differences between the two packages:]
The GPU package accelerates only pair force, neighbor list, and PPPM
calculations. The USER-CUDA package currently supports a wider range
of pair styles and can also accelerate many fix styles and some
compute styles, as well as neighbor list and PPPM calculations. :ulb,l
The GPU package uses more GPU memory than the USER-CUDA package. This
is generally not a problem since typical runs are computation-limited
rather than memory-limited. :l,ule
[Examples:]
The LAMMPS distribution has two directories with sample input scripts
for the GPU and USER-CUDA packages.
lammps/examples/gpu = GPU package files
lammps/examples/USER/cuda = USER-CUDA package files :ul
These contain input scripts for identical systems, so they can be used
to benchmark the performance of both packages on your system.
:line
[Benchmark data:]
NOTE: We plan to add some benchmark results and plots here for the
examples described in the previous section.
Simulations:
1. Lennard Jones
256,000 atoms
2.5 A cutoff
0.844 density :ul
2. Lennard Jones
256,000 atoms
5.0 A cutoff
0.844 density :ul
3. Rhodopsin model
256,000 atoms
10A cutoff
Coulomb via PPPM :ul
4. Lihtium-Phosphate
295650 atoms
15A cutoff
Coulomb via PPPM :ul
Hardware:
Workstation:
2x GTX470
i7 950@3GHz
24Gb DDR3 @ 1066Mhz
CentOS 5.5
CUDA 3.2
Driver 260.19.12 :ul
eStella:
6 Nodes
2xC2050
2xQDR Infiniband interconnect(aggregate bandwidth 80GBps)
Intel X5650 HexCore @ 2.67GHz
SL 5.5
CUDA 3.2
Driver 260.19.26 :ul
Keeneland:
HP SL-390 (Ariston) cluster
120 nodes
2x Intel Westmere hex-core CPUs
3xC2070s
QDR InfiniBand interconnect :ul
diff --git a/doc/Section_commands.html b/doc/Section_commands.html
index 359607403..f9a734d2f 100644
--- a/doc/Section_commands.html
+++ b/doc/Section_commands.html
@@ -1,629 +1,630 @@
<HTML>
<CENTER><A HREF = "Section_start.html">Previous Section</A> - <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A> - <A HREF = "Section_packages.html">Next Section</A>
</CENTER>
<HR>
<H3>3. Commands
</H3>
<P>This section describes how a LAMMPS input script is formatted and the
input script commands used to define a LAMMPS simulation.
</P>
3.1 <A HREF = "#cmd_1">LAMMPS input script</A><BR>
3.2 <A HREF = "#cmd_2">Parsing rules</A><BR>
3.3 <A HREF = "#cmd_3">Input script structure</A><BR>
3.4 <A HREF = "#cmd_4">Commands listed by category</A><BR>
3.5 <A HREF = "#cmd_5">Commands listed alphabetically</A> <BR>
<HR>
<HR>
<A NAME = "cmd_1"></A><H4>3.1 LAMMPS input script
</H4>
<P>LAMMPS executes by reading commands from a input script (text file),
one line at a time. When the input script ends, LAMMPS exits. Each
command causes LAMMPS to take some action. It may set an internal
variable, read in a file, or run a simulation. Most commands have
default settings, which means you only need to use the command if you
wish to change the default.
</P>
<P>In many cases, the ordering of commands in an input script is not
important. However the following rules apply:
</P>
<P>(1) LAMMPS does not read your entire input script and then perform a
simulation with all the settings. Rather, the input script is read
one line at a time and each command takes effect when it is read.
Thus this sequence of commands:
</P>
<PRE>timestep 0.5
run 100
run 100
</PRE>
<P>does something different than this sequence:
</P>
<PRE>run 100
timestep 0.5
run 100
</PRE>
<P>In the first case, the specified timestep (0.5 fmsec) is used for two
simulations of 100 timesteps each. In the 2nd case, the default
timestep (1.0 fmsec) is used for the 1st 100 step simulation and a 0.5
fmsec timestep is used for the 2nd one.
</P>
<P>(2) Some commands are only valid when they follow other commands. For
example you cannot set the temperature of a group of atoms until atoms
have been defined and a group command is used to define which atoms
belong to the group.
</P>
<P>(3) Sometimes command B will use values that can be set by command A.
This means command A must precede command B in the input script if it
is to have the desired effect. For example, the
<A HREF = "read_data.html">read_data</A> command initializes the system by setting
up the simulation box and assigning atoms to processors. If default
values are not desired, the <A HREF = "processors.html">processors</A>,
<A HREF = "nthreads.html">nthreads</A>, and <A HREF = "boundary.html">boundary</A> commands need
to be used before read_data to tell LAMMPS how to map processors to
the simulation box.
</P>
<P>Many input script errors are detected by LAMMPS and an ERROR or
WARNING message is printed. <A HREF = "Section_errors.html">This section</A> gives
more information on what errors mean. The documentation for each
command lists restrictions on how the command can be used.
</P>
<HR>
<A NAME = "cmd_2"></A><H4>3.2 Parsing rules
</H4>
<P>Each non-blank line in the input script is treated as a command.
LAMMPS commands are case sensitive. Command names are lower-case, as
are specified command arguments. Upper case letters may be used in
file names or user-chosen ID strings.
</P>
<P>Here is how each line in the input script is parsed by LAMMPS:
</P>
<P>(1) If the last printable character on the line is a "&" character
(with no surrounding quotes), the command is assumed to continue on
the next line. The next line is concatenated to the previous line by
removing the "&" character and newline. This allows long commands to
be continued across two or more lines.
</P>
<P>(2) All characters from the first "#" character onward are treated as
comment and discarded. See an exception in (6). Note that a
comment after a trailing "&" character will prevent the command from
continuing on the next line. Also note that for multi-line commands a
single leading "#" will comment out the entire command.
</P>
<P>(3) The line is searched repeatedly for $ characters, which indicate
variables that are replaced with a text string. See an exception in
(6). If the $ is followed by curly brackets, then the variable name
is the text inside the curly brackets. If no curly brackets follow
the $, then the variable name is the single character immediately
following the $. Thus ${myTemp} and $x refer to variable names
"myTemp" and "x". See the <A HREF = "variable.html">variable</A> command for
details of how strings are assigned to variables and how they are
substituted for in input script commands.
</P>
<P>(4) The line is broken into "words" separated by whitespace (tabs,
spaces). Note that words can thus contain letters, digits,
underscores, or punctuation characters.
</P>
<P>(5) The first word is the command name. All successive words in the
line are arguments.
</P>
<P>(6) If you want text with spaces to be treated as a single argument,
it can be enclosed in either double or single quotes. E.g.
</P>
<PRE>print "Volume = $v"
print 'Volume = $v'
</PRE>
<P>The quotes are removed when the single argument is stored internally.
See the <A HREF = "dump_modify.html">dump modify format</A> or <A HREF = "if.html">if</A> commands
for examples. A "#" or "$" character that is between quotes will not
be treated as a comment indicator in (2) or substituted for as a
variable in (3).
</P>
<P>IMPORTANT NOTE: If the argument is itself a command that requires a
quoted argument (e.g. using a <A HREF = "print.html">print</A> command as part of an
<A HREF = "if.html">if</A> or <A HREF = "run.html">run every</A> command), then the double and
single quotes can be nested in the usual manner. See the doc pages
for those commands for examples. Only one of level of nesting is
allowed, but that should be sufficient for most use cases.
</P>
<HR>
<H4><A NAME = "cmd_3"></A>3.3 Input script structure
</H4>
<P>This section describes the structure of a typical LAMMPS input script.
The "examples" directory in the LAMMPS distribution contains many
sample input scripts; the corresponding problems are discussed in
-<A HREF = "Section_example.html">this section</A>, and animated on the <A HREF = "http://lammps.sandia.gov">LAMMPS WWW
-Site</A>.
+<A HREF = "Section_example.html">Section_example</A>, and animated on the <A HREF = "http://lammps.sandia.gov">LAMMPS
+WWW Site</A>.
</P>
<P>A LAMMPS input script typically has 4 parts:
</P>
<OL><LI>Initialization
<LI>Atom definition
<LI>Settings
<LI>Run a simulation
</OL>
<P>The last 2 parts can be repeated as many times as desired. I.e. run a
simulation, change some settings, run some more, etc. Each of the 4
parts is now described in more detail. Remember that almost all the
commands need only be used if a non-default value is desired.
</P>
<P>(1) Initialization
</P>
<P>Set parameters that need to be defined before atoms are created or
read-in from a file.
</P>
<P>The relevant commands are <A HREF = "units.html">units</A>,
<A HREF = "dimension.html">dimension</A>, <A HREF = "newton.html">newton</A>,
<A HREF = "nthreads.html">nthreads</A>, <A HREF = "processors.html">processors</A>,
<A HREF = "boundary.html">boundary</A>, <A HREF = "atom_style.html">atom_style</A>,
<A HREF = "atom_modify.html">atom_modify</A>.
</P>
<P>If force-field parameters appear in the files that will be read, these
commands tell LAMMPS what kinds of force fields are being used:
<A HREF = "pair_style.html">pair_style</A>, <A HREF = "bond_style.html">bond_style</A>,
<A HREF = "angle_style.html">angle_style</A>, <A HREF = "dihedral_style.html">dihedral_style</A>,
<A HREF = "improper_style.html">improper_style</A>.
</P>
<P>(2) Atom definition
</P>
<P>There are 3 ways to define atoms in LAMMPS. Read them in from a data
or restart file via the <A HREF = "read_data.html">read_data</A> or
<A HREF = "read_restart.html">read_restart</A> commands. These files can contain
molecular topology information. Or create atoms on a lattice (with no
molecular topology), using these commands: <A HREF = "lattice.html">lattice</A>,
<A HREF = "region.html">region</A>, <A HREF = "create_box.html">create_box</A>,
<A HREF = "create_atoms.html">create_atoms</A>. The entire set of atoms can be
duplicated to make a larger simulation using the
<A HREF = "replicate.html">replicate</A> command.
</P>
<P>(3) Settings
</P>
<P>Once atoms and molecular topology are defined, a variety of settings
can be specified: force field coefficients, simulation parameters,
output options, etc.
</P>
<P>Force field coefficients are set by these commands (they can also be
set in the read-in files): <A HREF = "pair_coeff.html">pair_coeff</A>,
<A HREF = "bond_coeff.html">bond_coeff</A>, <A HREF = "angle_coeff.html">angle_coeff</A>,
<A HREF = "dihedral_coeff.html">dihedral_coeff</A>,
<A HREF = "improper_coeff.html">improper_coeff</A>,
<A HREF = "kspace_style.html">kspace_style</A>, <A HREF = "dielectric.html">dielectric</A>,
<A HREF = "special_bonds.html">special_bonds</A>.
</P>
<P>Various simulation parameters are set by these commands:
<A HREF = "neighbor.html">neighbor</A>, <A HREF = "neigh_modify.html">neigh_modify</A>,
<A HREF = "group.html">group</A>, <A HREF = "timestep.html">timestep</A>,
<A HREF = "reset_timestep.html">reset_timestep</A>, <A HREF = "run_style.html">run_style</A>,
<A HREF = "min_style.html">min_style</A>, <A HREF = "min_modify.html">min_modify</A>.
</P>
<P>Fixes impose a variety of boundary conditions, time integration, and
diagnostic options. The <A HREF = "fix.html">fix</A> command comes in many flavors.
</P>
<P>Various computations can be specified for execution during a
simulation using the <A HREF = "compute.html">compute</A>,
<A HREF = "compute_modify.html">compute_modify</A>, and <A HREF = "variable.html">variable</A>
commands.
</P>
<P>Output options are set by the <A HREF = "thermo.html">thermo</A>, <A HREF = "dump.html">dump</A>,
and <A HREF = "restart.html">restart</A> commands.
</P>
<P>(4) Run a simulation
</P>
<P>A molecular dynamics simulation is run using the <A HREF = "run.html">run</A>
command. Energy minimization (molecular statics) is performed using
the <A HREF = "minimize.html">minimize</A> command. A parallel tempering
(replica-exchange) simulation can be run using the
<A HREF = "temper.html">temper</A> command.
</P>
<HR>
<A NAME = "cmd_4"></A><H4>3.4 Commands listed by category
</H4>
<P>This section lists all LAMMPS commands, grouped by category. The
<A HREF = "#cmd_5">next section</A> lists the same commands alphabetically. Note
that some style options for some commands are part of specific LAMMPS
packages, which means they cannot be used unless the package was
included when LAMMPS was built. Not all packages are included in a
default LAMMPS build. These dependencies are listed as Restrictions
in the command's documentation.
</P>
<P>Initialization:
</P>
<P><A HREF = "atom_modify.html">atom_modify</A>, <A HREF = "atom_style.html">atom_style</A>,
<A HREF = "boundary.html">boundary</A>, <A HREF = "dimension.html">dimension</A>,
<A HREF = "newton.html">newton</A>, <A HREF = "nthreads.html">nthreads</A>,
<A HREF = "processors.html">processors</A>, <A HREF = "units.html">units</A>
</P>
<P>Atom definition:
</P>
<P><A HREF = "create_atoms.html">create_atoms</A>, <A HREF = "create_box.html">create_box</A>,
<A HREF = "lattice.html">lattice</A>, <A HREF = "read_data.html">read_data</A>,
<A HREF = "read_restart.html">read_restart</A>, <A HREF = "region.html">region</A>,
<A HREF = "replicate.html">replicate</A>
</P>
<P>Force fields:
</P>
<P><A HREF = "angle_coeff.html">angle_coeff</A>, <A HREF = "angle_style.html">angle_style</A>,
<A HREF = "bond_coeff.html">bond_coeff</A>, <A HREF = "bond_style.html">bond_style</A>,
<A HREF = "dielectric.html">dielectric</A>, <A HREF = "dihedral_coeff.html">dihedral_coeff</A>,
<A HREF = "dihedral_style.html">dihedral_style</A>,
<A HREF = "improper_coeff.html">improper_coeff</A>,
<A HREF = "improper_style.html">improper_style</A>,
<A HREF = "kspace_modify.html">kspace_modify</A>, <A HREF = "kspace_style.html">kspace_style</A>,
<A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "pair_modify.html">pair_modify</A>,
<A HREF = "pair_style.html">pair_style</A>, <A HREF = "pair_write.html">pair_write</A>,
<A HREF = "special_bonds.html">special_bonds</A>
</P>
<P>Settings:
</P>
<P><A HREF = "communicate.html">communicate</A>, <A HREF = "group.html">group</A>, <A HREF = "mass.html">mass</A>,
<A HREF = "min_modify.html">min_modify</A>, <A HREF = "min_style.html">min_style</A>,
<A HREF = "neigh_modify.html">neigh_modify</A>, <A HREF = "neighbor.html">neighbor</A>,
<A HREF = "reset_timestep.html">reset_timestep</A>, <A HREF = "run_style.html">run_style</A>,
<A HREF = "set.html">set</A>, <A HREF = "timestep.html">timestep</A>, <A HREF = "velocity.html">velocity</A>
</P>
<P>Fixes:
</P>
<P><A HREF = "fix.html">fix</A>, <A HREF = "fix_modify.html">fix_modify</A>, <A HREF = "unfix.html">unfix</A>
</P>
<P>Computes:
</P>
<P><A HREF = "compute.html">compute</A>, <A HREF = "compute_modify.html">compute_modify</A>,
<A HREF = "uncompute.html">uncompute</A>
</P>
<P>Output:
</P>
<P><A HREF = "dump.html">dump</A>, <A HREF = "dump_image.html">dump image</A>,
<A HREF = "dump_modify.html">dump_modify</A>, <A HREF = "restart.html">restart</A>,
<A HREF = "thermo.html">thermo</A>, <A HREF = "thermo_modify.html">thermo_modify</A>,
<A HREF = "thermo_style.html">thermo_style</A>, <A HREF = "undump.html">undump</A>,
<A HREF = "write_restart.html">write_restart</A>
</P>
<P>Actions:
</P>
<P><A HREF = "delete_atoms.html">delete_atoms</A>, <A HREF = "delete_bonds.html">delete_bonds</A>,
<A HREF = "displace_atoms.html">displace_atoms</A>,
<A HREF = "displace_box.html">displace_box</A>, <A HREF = "minimize.html">minimize</A>,
<A HREF = "neb.html">neb</A> <A HREF = "prd.html">prd</A>, <A HREF = "run.html">run</A>, <A HREF = "temper.html">temper</A>
</P>
<P>Miscellaneous:
</P>
<P><A HREF = "clear.html">clear</A>, <A HREF = "echo.html">echo</A>, <A HREF = "if.html">if</A>,
<A HREF = "include.html">include</A>, <A HREF = "jump.html">jump</A>, <A HREF = "label.html">label</A>,
<A HREF = "log.html">log</A>, <A HREF = "next.html">next</A>, <A HREF = "print.html">print</A>,
<A HREF = "shell.html">shell</A>, <A HREF = "variable.html">variable</A>
</P>
<HR>
<H4><A NAME = "cmd_5"></A><A NAME = "comm"></A>3.5 Individual commands
</H4>
<P>This section lists all LAMMPS commands alphabetically, with a separate
listing below of styles within certain commands. The <A HREF = "#cmd_4">previous
section</A> lists the same commands, grouped by category. Note
that some style options for some commands are part of specific LAMMPS
packages, which means they cannot be used unless the package was
included when LAMMPS was built. Not all packages are included in a
default LAMMPS build. These dependencies are listed as Restrictions
in the command's documentation.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "angle_coeff.html">angle_coeff</A></TD><TD ><A HREF = "angle_style.html">angle_style</A></TD><TD ><A HREF = "atom_modify.html">atom_modify</A></TD><TD ><A HREF = "atom_style.html">atom_style</A></TD><TD ><A HREF = "bond_coeff.html">bond_coeff</A></TD><TD ><A HREF = "bond_style.html">bond_style</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "boundary.html">boundary</A></TD><TD ><A HREF = "change_box.html">change_box</A></TD><TD ><A HREF = "clear.html">clear</A></TD><TD ><A HREF = "communicate.html">communicate</A></TD><TD ><A HREF = "compute.html">compute</A></TD><TD ><A HREF = "compute_modify.html">compute_modify</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "create_atoms.html">create_atoms</A></TD><TD ><A HREF = "create_box.html">create_box</A></TD><TD ><A HREF = "delete_atoms.html">delete_atoms</A></TD><TD ><A HREF = "delete_bonds.html">delete_bonds</A></TD><TD ><A HREF = "dielectric.html">dielectric</A></TD><TD ><A HREF = "dihedral_coeff.html">dihedral_coeff</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "dihedral_style.html">dihedral_style</A></TD><TD ><A HREF = "dimension.html">dimension</A></TD><TD ><A HREF = "displace_atoms.html">displace_atoms</A></TD><TD ><A HREF = "displace_box.html">displace_box</A></TD><TD ><A HREF = "dump.html">dump</A></TD><TD ><A HREF = "dump_image.html">dump image</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "dump_modify.html">dump_modify</A></TD><TD ><A HREF = "echo.html">echo</A></TD><TD ><A HREF = "fix.html">fix</A></TD><TD ><A HREF = "fix_modify.html">fix_modify</A></TD><TD ><A HREF = "group.html">group</A></TD><TD ><A HREF = "if.html">if</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "improper_coeff.html">improper_coeff</A></TD><TD ><A HREF = "improper_style.html">improper_style</A></TD><TD ><A HREF = "include.html">include</A></TD><TD ><A HREF = "jump.html">jump</A></TD><TD ><A HREF = "kspace_modify.html">kspace_modify</A></TD><TD ><A HREF = "kspace_style.html">kspace_style</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "label.html">label</A></TD><TD ><A HREF = "lattice.html">lattice</A></TD><TD ><A HREF = "log.html">log</A></TD><TD ><A HREF = "mass.html">mass</A></TD><TD ><A HREF = "minimize.html">minimize</A></TD><TD ><A HREF = "min_modify.html">min_modify</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "min_style.html">min_style</A></TD><TD ><A HREF = "neb.html">neb</A></TD><TD ><A HREF = "neigh_modify.html">neigh_modify</A></TD><TD ><A HREF = "neighbor.html">neighbor</A></TD><TD ><A HREF = "newton.html">newton</A></TD><TD ><A HREF = "next.html">next</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "package.html">package</A></TD><TD ><A HREF = "pair_coeff.html">pair_coeff</A></TD><TD ><A HREF = "pair_modify.html">pair_modify</A></TD><TD ><A HREF = "pair_style.html">pair_style</A></TD><TD ><A HREF = "pair_write.html">pair_write</A></TD><TD ><A HREF = "partition.html">partition</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "prd.html">prd</A></TD><TD ><A HREF = "print.html">print</A></TD><TD ><A HREF = "processors.html">processors</A></TD><TD ><A HREF = "read_data.html">read_data</A></TD><TD ><A HREF = "read_restart.html">read_restart</A></TD><TD ><A HREF = "region.html">region</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "replicate.html">replicate</A></TD><TD ><A HREF = "reset_timestep.html">reset_timestep</A></TD><TD ><A HREF = "restart.html">restart</A></TD><TD ><A HREF = "run.html">run</A></TD><TD ><A HREF = "run_style.html">run_style</A></TD><TD ><A HREF = "set.html">set</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "shell.html">shell</A></TD><TD ><A HREF = "special_bonds.html">special_bonds</A></TD><TD ><A HREF = "suffix.html">suffix</A></TD><TD ><A HREF = "tad.html">tad</A></TD><TD ><A HREF = "temper.html">temper</A></TD><TD ><A HREF = "thermo.html">thermo</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "thermo_modify.html">thermo_modify</A></TD><TD ><A HREF = "thermo_style.html">thermo_style</A></TD><TD ><A HREF = "timestep.html">timestep</A></TD><TD ><A HREF = "uncompute.html">uncompute</A></TD><TD ><A HREF = "undump.html">undump</A></TD><TD ><A HREF = "unfix.html">unfix</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "units.html">units</A></TD><TD ><A HREF = "variable.html">variable</A></TD><TD ><A HREF = "velocity.html">velocity</A></TD><TD ><A HREF = "write_restart.html">write_restart</A>
</TD></TR></TABLE></DIV>
<HR>
<H4>Fix styles
</H4>
<P>See the <A HREF = "fix.html">fix</A> command for one-line descriptions
of each style or click on the style itself for a full description:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "fix_adapt.html">adapt</A></TD><TD ><A HREF = "fix_addforce.html">addforce</A></TD><TD ><A HREF = "fix_aveforce.html">aveforce</A></TD><TD ><A HREF = "fix_ave_atom.html">ave/atom</A></TD><TD ><A HREF = "fix_ave_correlate.html">ave/correlate</A></TD><TD ><A HREF = "fix_ave_histo.html">ave/histo</A></TD><TD ><A HREF = "fix_ave_spatial.html">ave/spatial</A></TD><TD ><A HREF = "fix_ave_time.html">ave/time</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_bond_break.html">bond/break</A></TD><TD ><A HREF = "fix_bond_create.html">bond/create</A></TD><TD ><A HREF = "fix_bond_swap.html">bond/swap</A></TD><TD ><A HREF = "fix_box_relax.html">box/relax</A></TD><TD ><A HREF = "fix_deform.html">deform</A></TD><TD ><A HREF = "fix_deposit.html">deposit</A></TD><TD ><A HREF = "fix_drag.html">drag</A></TD><TD ><A HREF = "fix_dt_reset.html">dt/reset</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_efield.html">efield</A></TD><TD ><A HREF = "fix_enforce2d.html">enforce2d</A></TD><TD ><A HREF = "fix_evaporate.html">evaporate</A></TD><TD ><A HREF = "fix_external.html">external</A></TD><TD ><A HREF = "fix_freeze.html">freeze</A></TD><TD ><A HREF = "fix_gcmc.html">gcmc</A></TD><TD ><A HREF = "fix_gravity.html">gravity</A></TD><TD ><A HREF = "fix_heat.html">heat</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_indent.html">indent</A></TD><TD ><A HREF = "fix_langevin.html">langevin</A></TD><TD ><A HREF = "fix_lineforce.html">lineforce</A></TD><TD ><A HREF = "fix_momentum.html">momentum</A></TD><TD ><A HREF = "fix_move.html">move</A></TD><TD ><A HREF = "fix_msst.html">msst</A></TD><TD ><A HREF = "fix_neb.html">neb</A></TD><TD ><A HREF = "fix_nh.html">nph</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_nphug.html">nphug</A></TD><TD ><A HREF = "fix_nph_asphere.html">nph/asphere</A></TD><TD ><A HREF = "fix_nph_sphere.html">nph/sphere</A></TD><TD ><A HREF = "fix_nh.html">npt</A></TD><TD ><A HREF = "fix_npt_asphere.html">npt/asphere</A></TD><TD ><A HREF = "fix_npt_sphere.html">npt/sphere</A></TD><TD ><A HREF = "fix_nve.html">nve</A></TD><TD ><A HREF = "fix_nve_asphere.html">nve/asphere</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_nve_asphere_noforce.html">nve/asphere/noforce</A></TD><TD ><A HREF = "fix_nve_limit.html">nve/limit</A></TD><TD ><A HREF = "fix_nve_line.html">nve/line</A></TD><TD ><A HREF = "fix_nve_noforce.html">nve/noforce</A></TD><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></TR>
<TR ALIGN="center"><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_orient_fcc.html">orient/fcc</A></TD><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></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_qeq_comb.html">qeq/comb</A></TD><TD ><A HREF = "fix_reax_bonds.html">reax/bonds</A></TD><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/nve</A></TD><TD ><A HREF = "fix_rigid.html">rigid/nvt</A></TD><TD ><A HREF = "fix_setforce.html">setforce</A></TD></TR>
<TR ALIGN="center"><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><TD ><A HREF = "fix_temp_berendsen.html">temp/berendsen</A></TD></TR>
<TR ALIGN="center"><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_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/lj126</A></TD><TD ><A HREF = "fix_wall.html">wall/lj93</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
<A HREF = "Section_start.html#start_3">LAMMPS is built with the appropriate
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "fix_addtorque.html">addtorque</A></TD><TD ><A HREF = "fix_atc.html">atc</A></TD><TD ><A HREF = "fix_imd.html">imd</A></TD><TD ><A HREF = "fix_langevin_eff.html">langevin/eff</A></TD><TD ><A HREF = "fix_meso.html">meso</A></TD><TD ><A HREF = "fix_meso_stationary.html">meso/stationary</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_nh_eff.html">nph/eff</A></TD><TD ><A HREF = "fix_nh_eff.html">npt/eff</A></TD><TD ><A HREF = "fix_nve_eff.html">nve/eff</A></TD><TD ><A HREF = "fix_nh_eff.html">nvt/eff</A></TD><TD ><A HREF = "fix_nvt_sllod_eff.html">nvt/sllod/eff</A></TD><TD ><A HREF = "fix_qeq_reax.html">qeq/reax</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_smd.html">smd</A></TD><TD ><A HREF = "fix_temp_rescale_eff.html">temp/rescale/eff</A>
</TD></TR></TABLE></DIV>
<P>These are accelerated fix styles, which can be used if LAMMPS is
built with the <A HREF = "Section_accelerate.html">appropriate accelerated
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "fix_freeze.html">freeze/cuda</A></TD><TD ><A HREF = "fix_addforce.html">addforce/cuda</A></TD><TD ><A HREF = "fix_aveforce.html">aveforce/cuda</A></TD><TD ><A HREF = "fix_enforce2d.html">enforce2d/cuda</A></TD><TD ><A HREF = "fix_gravity.html">gravity/cuda</A></TD><TD ><A HREF = "fix_gravity.html">gravity/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_nh.html">npt/cuda</A></TD><TD ><A HREF = "fix_nh.html">nve/cuda</A></TD><TD ><A HREF = "fix_nve_sphere.html">nve/sphere/omp</A></TD><TD ><A HREF = "fix_nh.html">nvt/cuda</A></TD><TD ><A HREF = "fix_qeq_comb.html">qeq/comb/omp</A></TD><TD ><A HREF = "fix_setforce.html">setforce/cuda</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_shake.html">shake/cuda</A></TD><TD ><A HREF = "fix_temp_berendsen.html">temp/berendsen/cuda</A></TD><TD ><A HREF = "fix_temp_rescale.html">temp/rescale/cuda</A></TD><TD ><A HREF = "fix_temp_rescale.html">temp/rescale/limit/cuda</A></TD><TD ><A HREF = "fix_viscous.html">viscous/cuda</A>
</TD></TR></TABLE></DIV>
<HR>
<H4>Compute styles
</H4>
<P>See the <A HREF = "compute.html">compute</A> command for one-line descriptions of
each style or click on the style itself for a full description:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "compute_angle_local.html">angle/local</A></TD><TD ><A HREF = "compute_atom_molecule.html">atom/molecule</A></TD><TD ><A HREF = "compute_bond_local.html">bond/local</A></TD><TD ><A HREF = "compute_centro_atom.html">centro/atom</A></TD><TD ><A HREF = "compute_cluster_atom.html">cluster/atom</A></TD><TD ><A HREF = "compute_cna_atom.html">cna/atom</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_com.html">com</A></TD><TD ><A HREF = "compute_com_molecule.html">com/molecule</A></TD><TD ><A HREF = "compute_coord_atom.html">coord/atom</A></TD><TD ><A HREF = "compute_damage_atom.html">damage/atom</A></TD><TD ><A HREF = "compute_dihedral_local.html">dihedral/local</A></TD><TD ><A HREF = "compute_displace_atom.html">displace/atom</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_erotate_asphere.html">erotate/asphere</A></TD><TD ><A HREF = "compute_erotate_sphere.html">erotate/sphere</A></TD><TD ><A HREF = "compute_event_displace.html">event/displace</A></TD><TD ><A HREF = "compute_group_group.html">group/group</A></TD><TD ><A HREF = "compute_gyration.html">gyration</A></TD><TD ><A HREF = "compute_gyration_molecule.html">gyration/molecule</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_heat_flux.html">heat/flux</A></TD><TD ><A HREF = "compute_improper_local.html">improper/local</A></TD><TD ><A HREF = "compute_ke.html">ke</A></TD><TD ><A HREF = "compute_ke_atom.html">ke/atom</A></TD><TD ><A HREF = "compute_msd.html">msd</A></TD><TD ><A HREF = "compute_msd_molecule.html">msd/molecule</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_pair.html">pair</A></TD><TD ><A HREF = "compute_pair_local.html">pair/local</A></TD><TD ><A HREF = "compute_pe.html">pe</A></TD><TD ><A HREF = "compute_pe_atom.html">pe/atom</A></TD><TD ><A HREF = "compute_pressure.html">pressure</A></TD><TD ><A HREF = "compute_property_atom.html">property/atom</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_property_local.html">property/local</A></TD><TD ><A HREF = "compute_property_molecule.html">property/molecule</A></TD><TD ><A HREF = "compute_rdf.html">rdf</A></TD><TD ><A HREF = "compute_reduce.html">reduce</A></TD><TD ><A HREF = "compute_reduce.html">reduce/region</A></TD><TD ><A HREF = "compute_slice.html">slice</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_stress_atom.html">stress/atom</A></TD><TD ><A HREF = "compute_temp.html">temp</A></TD><TD ><A HREF = "compute_temp_asphere.html">temp/asphere</A></TD><TD ><A HREF = "compute_temp_com.html">temp/com</A></TD><TD ><A HREF = "compute_temp_deform.html">temp/deform</A></TD><TD ><A HREF = "compute_temp_partial.html">temp/partial</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_temp_profile.html">temp/profile</A></TD><TD ><A HREF = "compute_temp_ramp.html">temp/ramp</A></TD><TD ><A HREF = "compute_temp_region.html">temp/region</A></TD><TD ><A HREF = "compute_temp_sphere.html">temp/sphere</A></TD><TD ><A HREF = "compute_ti.html">ti</A>
</TD></TR></TABLE></DIV>
<P>These are compute styles contributed by users, which can be used if
<A HREF = "Section_start.html#start_3">LAMMPS is built with the appropriate
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "compute_ackland_atom.html">ackland/atom</A></TD><TD ><A HREF = "compute_ke_eff.html">ke/eff</A></TD><TD ><A HREF = "compute_ke_atom_eff.html">ke/atom/eff</A></TD><TD ><A HREF = "compute_meso_e_atom.html">meso_e/atom</A></TD><TD ><A HREF = "compute_meso_rho_atom.html">meso_rho/atom</A></TD><TD ><A HREF = "compute_meso_t_atom.html">meso_t/atom</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_temp_eff.html">temp/eff</A></TD><TD ><A HREF = "compute_temp_deform_eff.html">temp/deform/eff</A></TD><TD ><A HREF = "compute_temp_region_eff.html">temp/region/eff</A></TD><TD ><A HREF = "compute_temp_rotate.html">temp/rotate</A>
</TD></TR></TABLE></DIV>
<P>These are accelerated compute styles, which can be used if LAMMPS is
built with the <A HREF = "Section_accelerate.html">appropriate accelerated
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "compute_pe.html">pe/cuda</A></TD><TD ><A HREF = "compute_pressure.html">pressure/cuda</A></TD><TD ><A HREF = "compute_temp.html">temp/cuda</A></TD><TD ><A HREF = "compute_temp_partial.html">temp/partial/cuda</A>
</TD></TR></TABLE></DIV>
<HR>
<H4>Pair_style potentials
</H4>
<P>See the <A HREF = "pair_style.html">pair_style</A> command for an overview of pair
potentials. Click on the style itself for a full description:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "pair_none.html">none</A></TD><TD ><A HREF = "pair_hybrid.html">hybrid</A></TD><TD ><A HREF = "pair_hybrid.html">hybrid/overlay</A></TD><TD ><A HREF = "pair_adp.html">adp</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_airebo.html">airebo</A></TD><TD ><A HREF = "pair_born.html">born</A></TD><TD ><A HREF = "pair_born.html">born/coul/long</A></TD><TD ><A HREF = "pair_brownian.html">brownian</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_brownian.html">brownian/poly</A></TD><TD ><A HREF = "pair_buck.html">buck</A></TD><TD ><A HREF = "pair_buck.html">buck/coul/cut</A></TD><TD ><A HREF = "pair_buck.html">buck/coul/long</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_colloid.html">colloid</A></TD><TD ><A HREF = "pair_comb.html">comb</A></TD><TD ><A HREF = "pair_coul.html">coul/cut</A></TD><TD ><A HREF = "pair_coul.html">coul/debye</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_coul.html">coul/long</A></TD><TD ><A HREF = "pair_dipole.html">dipole/cut</A></TD><TD ><A HREF = "pair_dpd.html">dpd</A></TD><TD ><A HREF = "pair_dpd.html">dpd/tstat</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_dsmc.html">dsmc</A></TD><TD ><A HREF = "pair_eam.html">eam</A></TD><TD ><A HREF = "pair_eam.html">eam/alloy</A></TD><TD ><A HREF = "pair_eam.html">eam/fs</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_eim.html">eim</A></TD><TD ><A HREF = "pair_gauss.html">gauss</A></TD><TD ><A HREF = "pair_gayberne.html">gayberne</A></TD><TD ><A HREF = "pair_gran.html">gran/hertz/history</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_gran.html">gran/hooke</A></TD><TD ><A HREF = "pair_gran.html">gran/hooke/history</A></TD><TD ><A HREF = "pair_hbond_dreiding.html">hbond/dreiding/lj</A></TD><TD ><A HREF = "pair_hbond_dreiding.html">hbond/dreiding/morse</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_line_lj.html">line/lj</A></TD><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/charmm</A></TD><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/charmm/implicit</A></TD><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/long</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_class2.html">lj/class2</A></TD><TD ><A HREF = "pair_class2.html">lj/class2/coul/cut</A></TD><TD ><A HREF = "pair_class2.html">lj/class2/coul/long</A></TD><TD ><A HREF = "pair_lj.html">lj/cut</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_lj.html">lj/cut/coul/cut</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/debye</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/long</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/long/tip4p</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_lj_expand.html">lj/expand</A></TD><TD ><A HREF = "pair_gromacs.html">lj/gromacs</A></TD><TD ><A HREF = "pair_gromacs.html">lj/gromacs/coul/gromacs</A></TD><TD ><A HREF = "pair_lj_smooth.html">lj/smooth</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_lj96.html">lj96/cut</A></TD><TD ><A HREF = "pair_lubricate.html">lubricate</A></TD><TD ><A HREF = "pair_lubricate.html">lubricate/poly</A></TD><TD ><A HREF = "pair_lubricateU.html">lubricateU</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_lubricateU.html">lubricateU/poly</A></TD><TD ><A HREF = "pair_meam.html">meam</A></TD><TD ><A HREF = "pair_morse.html">morse</A></TD><TD ><A HREF = "pair_peri.html">peri/lps</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_peri.html">peri/pmb</A></TD><TD ><A HREF = "pair_reax.html">reax</A></TD><TD ><A HREF = "pair_airebo.html">rebo</A></TD><TD ><A HREF = "pair_resquared.html">resquared</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_soft.html">soft</A></TD><TD ><A HREF = "pair_sw.html">sw</A></TD><TD ><A HREF = "pair_table.html">table</A></TD><TD ><A HREF = "pair_tersoff.html">tersoff</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "pair_tersoff_zbl.html">tersoff/zbl</A></TD><TD ><A HREF = "pair_tri_lj.html">tri/lj</A></TD><TD ><A HREF = "pair_yukawa.html">yukawa</A></TD><TD ><A HREF = "pair_yukawa_colloid.html">yukawa/colloid</A>
+<TR ALIGN="center"><TD ><A HREF = "pair_airebo.html">airebo</A></TD><TD ><A HREF = "pair_born.html">born</A></TD><TD ><A HREF = "pair_born.html">born/coul/long</A></TD><TD ><A HREF = "pair_born.html">born/coul/wolf</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_brownian.html">brownian</A></TD><TD ><A HREF = "pair_brownian.html">brownian/poly</A></TD><TD ><A HREF = "pair_buck.html">buck</A></TD><TD ><A HREF = "pair_buck.html">buck/coul/cut</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_buck.html">buck/coul/long</A></TD><TD ><A HREF = "pair_colloid.html">colloid</A></TD><TD ><A HREF = "pair_comb.html">comb</A></TD><TD ><A HREF = "pair_coul.html">coul/cut</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_coul.html">coul/debye</A></TD><TD ><A HREF = "pair_coul.html">coul/long</A></TD><TD ><A HREF = "pair_coul.html">coul/wolf</A></TD><TD ><A HREF = "pair_dipole.html">dipole/cut</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_dpd.html">dpd</A></TD><TD ><A HREF = "pair_dpd.html">dpd/tstat</A></TD><TD ><A HREF = "pair_dsmc.html">dsmc</A></TD><TD ><A HREF = "pair_eam.html">eam</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_eam.html">eam/alloy</A></TD><TD ><A HREF = "pair_eam.html">eam/fs</A></TD><TD ><A HREF = "pair_eim.html">eim</A></TD><TD ><A HREF = "pair_gauss.html">gauss</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_gayberne.html">gayberne</A></TD><TD ><A HREF = "pair_gran.html">gran/hertz/history</A></TD><TD ><A HREF = "pair_gran.html">gran/hooke</A></TD><TD ><A HREF = "pair_gran.html">gran/hooke/history</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_hbond_dreiding.html">hbond/dreiding/lj</A></TD><TD ><A HREF = "pair_hbond_dreiding.html">hbond/dreiding/morse</A></TD><TD ><A HREF = "pair_line_lj.html">line/lj</A></TD><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/charmm</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/charmm/implicit</A></TD><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/long</A></TD><TD ><A HREF = "pair_class2.html">lj/class2</A></TD><TD ><A HREF = "pair_class2.html">lj/class2/coul/cut</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_class2.html">lj/class2/coul/long</A></TD><TD ><A HREF = "pair_lj.html">lj/cut</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/cut</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/debye</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_lj.html">lj/cut/coul/long</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/long/tip4p</A></TD><TD ><A HREF = "pair_lj_expand.html">lj/expand</A></TD><TD ><A HREF = "pair_gromacs.html">lj/gromacs</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_gromacs.html">lj/gromacs/coul/gromacs</A></TD><TD ><A HREF = "pair_lj_smooth.html">lj/smooth</A></TD><TD ><A HREF = "pair_lj96.html">lj96/cut</A></TD><TD ><A HREF = "pair_lubricate.html">lubricate</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_lubricate.html">lubricate/poly</A></TD><TD ><A HREF = "pair_lubricateU.html">lubricateU</A></TD><TD ><A HREF = "pair_lubricateU.html">lubricateU/poly</A></TD><TD ><A HREF = "pair_meam.html">meam</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_morse.html">morse</A></TD><TD ><A HREF = "pair_peri.html">peri/lps</A></TD><TD ><A HREF = "pair_peri.html">peri/pmb</A></TD><TD ><A HREF = "pair_reax.html">reax</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_airebo.html">rebo</A></TD><TD ><A HREF = "pair_resquared.html">resquared</A></TD><TD ><A HREF = "pair_soft.html">soft</A></TD><TD ><A HREF = "pair_sw.html">sw</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_table.html">table</A></TD><TD ><A HREF = "pair_tersoff.html">tersoff</A></TD><TD ><A HREF = "pair_tersoff_zbl.html">tersoff/zbl</A></TD><TD ><A HREF = "pair_tri_lj.html">tri/lj</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "pair_yukawa.html">yukawa</A></TD><TD ><A HREF = "pair_yukawa_colloid.html">yukawa/colloid</A>
</TD></TR></TABLE></DIV>
<P>These are pair styles contributed by users, which can be used if
<A HREF = "Section_start.html#start_3">LAMMPS is built with the appropriate
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "pair_awpmd.html">awpmd/cut</A></TD><TD ><A HREF = "pair_buck_coul.html">buck/coul</A></TD><TD ><A HREF = "pair_coul_diel.html">coul/diel</A></TD><TD ><A HREF = "pair_sdk.html">lj/sdk</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_sdk.html">lj/sdk/coul/long</A></TD><TD ><A HREF = "pair_dipole.html">dipole/sf</A></TD><TD ><A HREF = "pair_eam.html">eam/cd</A></TD><TD ><A HREF = "pair_edip.html">edip</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_eff.html">eff/cut</A></TD><TD ><A HREF = "pair_gauss.html">gauss/cut</A></TD><TD ><A HREF = "pair_lj_coul.html">lj/coul</A></TD><TD ><A HREF = "pair_lj_sf.html">lj/sf</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_reax_c.html">reax/c</A></TD><TD ><A HREF = "pair_heatconduction.html">sph/heatconduction</A></TD><TD ><A HREF = "pair_idealgas.html">sph/idealgas</A></TD><TD ><A HREF = "pair_lj.html">sph/lj</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_rhosum.html">sph/rhosum</A></TD><TD ><A HREF = "pair_taitwater.html">sph/taitwater</A></TD><TD ><A HREF = "pair_taitwater_morris.html">sph/taitwater/morris</A></TD><TD ><A HREF = "pair_tersoff.html">tersoff/table</A>
</TD></TR></TABLE></DIV>
<P>These are accelerated pair styles, which can be used if LAMMPS is
built with the <A HREF = "Section_accelerate.html">appropriate accelerated
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "pair_adp.html">adp/omp</A></TD><TD ><A HREF = "pair_airebo.html">airebo/omp</A></TD><TD ><A HREF = "pair_born.html">born/coul/long/cuda</A></TD><TD ><A HREF = "pair_born.html">born/coul/long/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_born.html">born/omp</A></TD><TD ><A HREF = "pair_buck.html">buck/coul/cut/cuda</A></TD><TD ><A HREF = "pair_buck.html">buck/coul/cut/omp</A></TD><TD ><A HREF = "pair_buck.html">buck/coul/long/cuda</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_buck.html">buck/coul/long/omp</A></TD><TD ><A HREF = "pair_buck_coul.html">buck/coul/omp</A></TD><TD ><A HREF = "pair_buck.html">buck/cuda</A></TD><TD ><A HREF = "pair_buck.html">buck/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_sdk.html">lj/sdk/gpu</A></TD><TD ><A HREF = "pair_sdk.html">lj/sdk/omp</A></TD><TD ><A HREF = "pair_sdk.html">lj/sdk/coul/long/gpu</A></TD><TD ><A HREF = "pair_sdk.html">lj/sdk/coul/long/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_colloid.html">colloid/omp</A></TD><TD ><A HREF = "pair_comb.html">comb/omp</A></TD><TD ><A HREF = "pair_coul.html">coul/cut/omp</A></TD><TD ><A HREF = "pair_coul.html">coul/debye/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_coul.html">coul/long/gpu</A></TD><TD ><A HREF = "pair_coul.html">coul/long/omp</A></TD><TD ><A HREF = "pair_dipole.html">dipole/cut/omp</A></TD><TD ><A HREF = "pair_dipole.html">dipole/sf/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_dpd.html">dpd/omp</A></TD><TD ><A HREF = "pair_dpd.html">dpd/tstat/omp</A></TD><TD ><A HREF = "pair_eam.html">eam/alloy/cuda</A></TD><TD ><A HREF = "pair_eam.html">eam/alloy/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_eam.html">eam/alloy/opt</A></TD><TD ><A HREF = "pair_eam.html">eam/cd/omp</A></TD><TD ><A HREF = "pair_eam.html">eam/cuda</A></TD><TD ><A HREF = "pair_eam.html">eam/fs/cuda</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_eam.html">eam/fs/omp</A></TD><TD ><A HREF = "pair_eam.html">eam/fs/opt</A></TD><TD ><A HREF = "pair_eam.html">eam/omp</A></TD><TD ><A HREF = "pair_eam.html">eam/opt</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_edip.html">edip/omp</A></TD><TD ><A HREF = "pair_eim.html">eim/omp</A></TD><TD ><A HREF = "pair_gauss.html">gauss/omp</A></TD><TD ><A HREF = "pair_gayberne.html">gayberne/gpu</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_gayberne.html">gayberne/omp</A></TD><TD ><A HREF = "pair_gran.html">gran/hertz/history/omp</A></TD><TD ><A HREF = "pair_gran.html">gran/hooke/cuda</A></TD><TD ><A HREF = "pair_gran.html">gran/hooke/history/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_gran.html">gran/hooke/omp</A></TD><TD ><A HREF = "pair_hbond_dreiding.html">hbond/dreiding/lj/omp</A></TD><TD ><A HREF = "pair_hbond_dreiding.html">hbond/dreiding/morse/omp</A></TD><TD ><A HREF = "pair_line_lj.html">line/lj/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/charmm/cuda</A></TD><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/charmm/omp</A></TD><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/charmm/implicit/cuda</A></TD><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/charmm/implicit/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/long/cuda</A></TD><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/long/gpu</A></TD><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/long/omp</A></TD><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/long/opt</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_charmm.html">lj/charmm/coul/pppm/omp</A></TD><TD ><A HREF = "pair_class2.html">lj/class2/coul/cut/cuda</A></TD><TD ><A HREF = "pair_class2.html">lj/class2/coul/cut/omp</A></TD><TD ><A HREF = "pair_class2.html">lj/class2/coul/long/cuda</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_class2.html">lj/class2/coul/long/gpu</A></TD><TD ><A HREF = "pair_class2.html">lj/class2/coul/long/omp</A></TD><TD ><A HREF = "pair_class2.html">lj/class2/cuda</A></TD><TD ><A HREF = "pair_class2.html">lj/class2/gpu</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_class2.html">lj/class2/omp</A></TD><TD ><A HREF = "pair_lj_coul.html">lj/coul/omp</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/cut/cuda</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/cut/gpu</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_lj.html">lj/cut/coul/cut/omp</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/debye/cuda</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/debye/omp</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/long/cuda</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_lj.html">lj/cut/coul/long/gpu</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/long/omp</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/long/opt</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/long/tip4p/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_lj.html">lj/cut/coul/long/tip4p/opt</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/pppm/omp</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/coul/pppm/tip4p/omp</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/cuda</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_lj.html">lj/cut/experimental/cuda</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/gpu</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/omp</A></TD><TD ><A HREF = "pair_lj.html">lj/cut/opt</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_lj_expand.html">lj/expand/cuda</A></TD><TD ><A HREF = "pair_lj_expand.html">lj/expand/gpu</A></TD><TD ><A HREF = "pair_lj_expand.html">lj/expand/omp</A></TD><TD ><A HREF = "pair_gromacs.html">lj/gromacs/coul/gromacs/cuda</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_gromacs.html">lj/gromacs/coul/gromacs/omp</A></TD><TD ><A HREF = "pair_gromacs.html">lj/gromacs/cuda</A></TD><TD ><A HREF = "pair_gromacs.html">lj/gromacs/omp</A></TD><TD ><A HREF = "pair_lj_sf.html">lj/sf/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_lj_smooth.html">lj/smooth/cuda</A></TD><TD ><A HREF = "pair_lj_smooth.html">lj/smooth/omp</A></TD><TD ><A HREF = "pair_lj96.html">lj96/cut/cuda</A></TD><TD ><A HREF = "pair_lj96.html">lj96/cut/gpu</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_lj96.html">lj96/cut/omp</A></TD><TD ><A HREF = "pair_morse.html">morse/cuda</A></TD><TD ><A HREF = "pair_morse.html">morse/gpu</A></TD><TD ><A HREF = "pair_morse.html">morse/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_morse.html">morse/opt</A></TD><TD ><A HREF = "pair_peri.html">peri/lps/omp</A></TD><TD ><A HREF = "pair_peri.html">peri/pmb/omp</A></TD><TD ><A HREF = "pair_airebo.html">rebo/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_resquared.html">resquared/gpu</A></TD><TD ><A HREF = "pair_resquared.html">resquared/omp</A></TD><TD ><A HREF = "pair_soft.html">soft/omp</A></TD><TD ><A HREF = "pair_sw.html">sw/cuda</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_sw.html">sw/omp</A></TD><TD ><A HREF = "pair_table.html">table/omp</A></TD><TD ><A HREF = "pair_tersoff.html">tersoff/cuda</A></TD><TD ><A HREF = "pair_tersoff.html">tersoff/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_tersoff.html">tersoff/table/omp</A></TD><TD ><A HREF = "pair_tersoff_zbl.html">tersoff/zbl/omp</A></TD><TD ><A HREF = "pair_tri_lj.html">tri/lj/omp</A></TD><TD ><A HREF = "pair_yukawa.html">yukawa/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "pair_yukawa_colloid.html">yukawa/colloid/omp</A>
</TD></TR></TABLE></DIV>
<HR>
<H4>Bond_style potentials
</H4>
<P>See the <A HREF = "bond_style.html">bond_style</A> command for an overview of bond
potentials. Click on the style itself for a full description:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "bond_none.html">none</A></TD><TD WIDTH="100"><A HREF = "bond_hybrid.html">hybrid</A></TD><TD WIDTH="100"><A HREF = "bond_class2.html">class2</A></TD><TD WIDTH="100"><A HREF = "bond_fene.html">fene</A></TD></TR>
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "bond_fene_expand.html">fene/expand</A></TD><TD WIDTH="100"><A HREF = "bond_harmonic.html">harmonic</A></TD><TD WIDTH="100"><A HREF = "bond_morse.html">morse</A></TD><TD WIDTH="100"><A HREF = "bond_nonlinear.html">nonlinear</A></TD></TR>
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "bond_quartic.html">quartic</A></TD><TD WIDTH="100"><A HREF = "bond_table.html">table</A>
</TD></TR></TABLE></DIV>
<P>These are bond styles contributed by users, which can be used if
<A HREF = "Section_start.html#start_3">LAMMPS is built with the appropriate
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "bond_harmonic_shift.html">harmonic/shift</A></TD><TD ><A HREF = "bond_harmonic_shift_cut.html">harmonic/shift/cut</A>
</TD></TR></TABLE></DIV>
<P>These are accelerated bond styles, which can be used if LAMMPS is
built with the <A HREF = "Section_accelerate.html">appropriate accelerated
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "bond_class2.html">class2/omp</A></TD><TD WIDTH="100"><A HREF = "bond_fene.html">fene/omp</A></TD><TD WIDTH="100"><A HREF = "bond_fene_expand.html">fene/expand/omp</A></TD><TD WIDTH="100"><A HREF = "bond_harmonic.html">harmonic/omp</A></TD></TR>
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "bond_harmonic_shift.html">harmonic/shift/omp</A></TD><TD WIDTH="100"><A HREF = "bond_harmonic_shift_cut.html">harmonic/shift/cut/omp</A></TD><TD WIDTH="100"><A HREF = "bond_morse.html">morse/omp</A></TD><TD WIDTH="100"><A HREF = "bond_nonlinear.html">nonlinear/omp</A></TD></TR>
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "bond_quartic.html">quartic/omp</A></TD><TD WIDTH="100"><A HREF = "bond_table.html">table/omp</A>
</TD></TR></TABLE></DIV>
<HR>
<H4>Angle_style potentials
</H4>
<P>See the <A HREF = "angle_style.html">angle_style</A> command for an overview of
angle potentials. Click on the style itself for a full description:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "angle_none.html">none</A></TD><TD WIDTH="100"><A HREF = "angle_hybrid.html">hybrid</A></TD><TD WIDTH="100"><A HREF = "angle_charmm.html">charmm</A></TD><TD WIDTH="100"><A HREF = "angle_class2.html">class2</A></TD></TR>
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "angle_cosine.html">cosine</A></TD><TD WIDTH="100"><A HREF = "angle_cosine_delta.html">cosine/delta</A></TD><TD WIDTH="100"><A HREF = "angle_cosine_periodic.html">cosine/periodic</A></TD><TD WIDTH="100"><A HREF = "angle_cosine_squared.html">cosine/squared</A></TD></TR>
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "angle_harmonic.html">harmonic</A></TD><TD WIDTH="100"><A HREF = "angle_table.html">table</A>
</TD></TR></TABLE></DIV>
<P>These are angle styles contributed by users, which can be used if
<A HREF = "Section_start.html#start_3">LAMMPS is built with the appropriate
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "angle_sdk.html">sdk</A></TD><TD ><A HREF = "angle_cosine_shift.html">cosine/shift</A></TD><TD ><A HREF = "angle_cosine_shift_exp.html">cosine/shift/exp</A>
</TD></TR></TABLE></DIV>
<P>These are accelerated angle styles, which can be used if LAMMPS is
built with the <A HREF = "Section_accelerate.html">appropriate accelerated
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "angle_charmm.html">charmm/omp</A></TD><TD WIDTH="100"><A HREF = "angle_class2.html">class2/omp</A></TD><TD WIDTH="100"><A HREF = "angle_cosine.html">cosine/omp</A></TD><TD WIDTH="100"><A HREF = "angle_cosine_delta.html">cosine/delta/omp</A></TD></TR>
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "angle_cosine_periodic.html">cosine/periodic/omp</A></TD><TD WIDTH="100"><A HREF = "angle_cosine_shift.html">cosine/shift/omp</A></TD><TD WIDTH="100"><A HREF = "angle_cosine_shift_exp.html">cosine/shift/exp/omp</A></TD><TD WIDTH="100"><A HREF = "angle_cosine_squared.html">cosine/squared/omp</A></TD></TR>
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "angle_harmonic.html">harmonic/omp</A></TD><TD WIDTH="100"><A HREF = "angle_table.html">table/omp</A>
</TD></TR></TABLE></DIV>
<HR>
<H4>Dihedral_style potentials
</H4>
<P>See the <A HREF = "dihedral_style.html">dihedral_style</A> command for an overview
of dihedral potentials. Click on the style itself for a full
description:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "dihedral_none.html">none</A></TD><TD WIDTH="100"><A HREF = "dihedral_hybrid.html">hybrid</A></TD><TD WIDTH="100"><A HREF = "dihedral_charmm.html">charmm</A></TD><TD WIDTH="100"><A HREF = "dihedral_class2.html">class2</A></TD></TR>
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "dihedral_harmonic.html">harmonic</A></TD><TD WIDTH="100"><A HREF = "dihedral_helix.html">helix</A></TD><TD WIDTH="100"><A HREF = "dihedral_multi_harmonic.html">multi/harmonic</A></TD><TD WIDTH="100"><A HREF = "dihedral_opls.html">opls</A>
</TD></TR></TABLE></DIV>
<P>These are dihedral styles contributed by users, which can be used if
<A HREF = "Section_start.html#start_3">LAMMPS is built with the appropriate
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "dihedral_cosine_shift_exp.html">cosine/shift/exp</A>
</TD></TR></TABLE></DIV>
<P>These are accelerated dihedral styles, which can be used if LAMMPS is
built with the <A HREF = "Section_accelerate.html">appropriate accelerated
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "dihedral_charmm.html">charmm/omp</A></TD><TD WIDTH="100"><A HREF = "dihedral_class2.html">class2/omp</A></TD><TD WIDTH="100"><A HREF = "dihedral_cosine_shift_exp.html">cosine/shift/exp/omp</A></TD><TD WIDTH="100"><A HREF = "dihedral_harmonic.html">harmonic/omp</A></TD></TR>
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "dihedral_helix.html">helix/omp</A></TD><TD WIDTH="100"><A HREF = "dihedral_multi_harmonic.html">multi/harmonic/omp</A></TD><TD WIDTH="100"><A HREF = "dihedral_opls.html">opls/omp</A>
</TD></TR></TABLE></DIV>
<HR>
<H4>Improper_style potentials
</H4>
<P>See the <A HREF = "improper_style.html">improper_style</A> command for an overview
of improper potentials. Click on the style itself for a full
description:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "improper_none.html">none</A></TD><TD WIDTH="100"><A HREF = "improper_hybrid.html">hybrid</A></TD><TD WIDTH="100"><A HREF = "improper_class2.html">class2</A></TD><TD WIDTH="100"><A HREF = "improper_cvff.html">cvff</A></TD></TR>
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "improper_harmonic.html">harmonic</A></TD><TD WIDTH="100"><A HREF = "improper_umbrella.html">umbrella</A>
</TD></TR></TABLE></DIV>
<P>These are accelerated improper styles, which can be used if LAMMPS is
built with the <A HREF = "Section_accelerate.html">appropriate accelerated
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "improper_class2.html">class2/omp</A></TD><TD WIDTH="100"><A HREF = "improper_cvff.html">cvff/omp</A></TD><TD WIDTH="100"><A HREF = "improper_harmonic.html">harmonic/omp</A></TD><TD WIDTH="100"><A HREF = "improper_umbrella.html">umbrella/omp</A>
</TD></TR></TABLE></DIV>
<HR>
<H4>Kspace solvers
</H4>
<P>See the <A HREF = "kspace_style.html">kspace_style</A> command for an overview of
Kspace solvers. Click on the style itself for a full description:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "kspace_style.html">ewald</A></TD><TD WIDTH="100"><A HREF = "kspace_style.html">pppm</A></TD><TD WIDTH="100"><A HREF = "kspace_style.html">pppm/cg</A></TD><TD WIDTH="100"><A HREF = "kspace_style.html">pppm/tip4p</A>
</TD></TR></TABLE></DIV>
<P>These are Kspace solvers contributed by users, which can be used if
<A HREF = "Section_start.html#start_3">LAMMPS is built with the appropriate
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD WIDTH="100"><A HREF = "kspace_style.html">ewald/n</A>
</TD></TR></TABLE></DIV>
<P>These are accelerated Kspace solvers, which can be used if LAMMPS is
built with the <A HREF = "Section_accelerate.html">appropriate accelerated
package</A>.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "kspace_style.html">ewald/omp</A></TD><TD ><A HREF = "kspace_style.html">pppm/cuda</A></TD><TD ><A HREF = "kspace_style.html">pppm/gpu</A></TD><TD ><A HREF = "kspace_style.html">pppm/omp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "kspace_style.html">pppm/proxy</A>
</TD></TR></TABLE></DIV>
</HTML>
diff --git a/doc/Section_commands.txt b/doc/Section_commands.txt
index f7b71877d..6e7528249 100644
--- a/doc/Section_commands.txt
+++ b/doc/Section_commands.txt
@@ -1,1001 +1,1003 @@
"Previous Section"_Section_start.html - "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next Section"_Section_packages.html :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
3. Commands :h3
This section describes how a LAMMPS input script is formatted and the
input script commands used to define a LAMMPS simulation.
3.1 "LAMMPS input script"_#cmd_1
3.2 "Parsing rules"_#cmd_2
3.3 "Input script structure"_#cmd_3
3.4 "Commands listed by category"_#cmd_4
3.5 "Commands listed alphabetically"_#cmd_5 :all(b)
:line
:line
3.1 LAMMPS input script :link(cmd_1),h4
LAMMPS executes by reading commands from a input script (text file),
one line at a time. When the input script ends, LAMMPS exits. Each
command causes LAMMPS to take some action. It may set an internal
variable, read in a file, or run a simulation. Most commands have
default settings, which means you only need to use the command if you
wish to change the default.
In many cases, the ordering of commands in an input script is not
important. However the following rules apply:
(1) LAMMPS does not read your entire input script and then perform a
simulation with all the settings. Rather, the input script is read
one line at a time and each command takes effect when it is read.
Thus this sequence of commands:
timestep 0.5
run 100
run 100 :pre
does something different than this sequence:
run 100
timestep 0.5
run 100 :pre
In the first case, the specified timestep (0.5 fmsec) is used for two
simulations of 100 timesteps each. In the 2nd case, the default
timestep (1.0 fmsec) is used for the 1st 100 step simulation and a 0.5
fmsec timestep is used for the 2nd one.
(2) Some commands are only valid when they follow other commands. For
example you cannot set the temperature of a group of atoms until atoms
have been defined and a group command is used to define which atoms
belong to the group.
(3) Sometimes command B will use values that can be set by command A.
This means command A must precede command B in the input script if it
is to have the desired effect. For example, the
"read_data"_read_data.html command initializes the system by setting
up the simulation box and assigning atoms to processors. If default
values are not desired, the "processors"_processors.html,
"nthreads"_nthreads.html, and "boundary"_boundary.html commands need
to be used before read_data to tell LAMMPS how to map processors to
the simulation box.
Many input script errors are detected by LAMMPS and an ERROR or
WARNING message is printed. "This section"_Section_errors.html gives
more information on what errors mean. The documentation for each
command lists restrictions on how the command can be used.
:line
3.2 Parsing rules :link(cmd_2),h4
Each non-blank line in the input script is treated as a command.
LAMMPS commands are case sensitive. Command names are lower-case, as
are specified command arguments. Upper case letters may be used in
file names or user-chosen ID strings.
Here is how each line in the input script is parsed by LAMMPS:
(1) If the last printable character on the line is a "&" character
(with no surrounding quotes), the command is assumed to continue on
the next line. The next line is concatenated to the previous line by
removing the "&" character and newline. This allows long commands to
be continued across two or more lines.
(2) All characters from the first "#" character onward are treated as
comment and discarded. See an exception in (6). Note that a
comment after a trailing "&" character will prevent the command from
continuing on the next line. Also note that for multi-line commands a
single leading "#" will comment out the entire command.
(3) The line is searched repeatedly for $ characters, which indicate
variables that are replaced with a text string. See an exception in
(6). If the $ is followed by curly brackets, then the variable name
is the text inside the curly brackets. If no curly brackets follow
the $, then the variable name is the single character immediately
following the $. Thus $\{myTemp\} and $x refer to variable names
"myTemp" and "x". See the "variable"_variable.html command for
details of how strings are assigned to variables and how they are
substituted for in input script commands.
(4) The line is broken into "words" separated by whitespace (tabs,
spaces). Note that words can thus contain letters, digits,
underscores, or punctuation characters.
(5) The first word is the command name. All successive words in the
line are arguments.
(6) If you want text with spaces to be treated as a single argument,
it can be enclosed in either double or single quotes. E.g.
print "Volume = $v"
print 'Volume = $v' :pre
The quotes are removed when the single argument is stored internally.
See the "dump modify format"_dump_modify.html or "if"_if.html commands
for examples. A "#" or "$" character that is between quotes will not
be treated as a comment indicator in (2) or substituted for as a
variable in (3).
IMPORTANT NOTE: If the argument is itself a command that requires a
quoted argument (e.g. using a "print"_print.html command as part of an
"if"_if.html or "run every"_run.html command), then the double and
single quotes can be nested in the usual manner. See the doc pages
for those commands for examples. Only one of level of nesting is
allowed, but that should be sufficient for most use cases.
:line
3.3 Input script structure :h4,link(cmd_3)
This section describes the structure of a typical LAMMPS input script.
The "examples" directory in the LAMMPS distribution contains many
sample input scripts; the corresponding problems are discussed in
-"this section"_Section_example.html, and animated on the "LAMMPS WWW
-Site"_lws.
+"Section_example"_Section_example.html, and animated on the "LAMMPS
+WWW Site"_lws.
A LAMMPS input script typically has 4 parts:
Initialization
Atom definition
Settings
Run a simulation :ol
The last 2 parts can be repeated as many times as desired. I.e. run a
simulation, change some settings, run some more, etc. Each of the 4
parts is now described in more detail. Remember that almost all the
commands need only be used if a non-default value is desired.
(1) Initialization
Set parameters that need to be defined before atoms are created or
read-in from a file.
The relevant commands are "units"_units.html,
"dimension"_dimension.html, "newton"_newton.html,
"nthreads"_nthreads.html, "processors"_processors.html,
"boundary"_boundary.html, "atom_style"_atom_style.html,
"atom_modify"_atom_modify.html.
If force-field parameters appear in the files that will be read, these
commands tell LAMMPS what kinds of force fields are being used:
"pair_style"_pair_style.html, "bond_style"_bond_style.html,
"angle_style"_angle_style.html, "dihedral_style"_dihedral_style.html,
"improper_style"_improper_style.html.
(2) Atom definition
There are 3 ways to define atoms in LAMMPS. Read them in from a data
or restart file via the "read_data"_read_data.html or
"read_restart"_read_restart.html commands. These files can contain
molecular topology information. Or create atoms on a lattice (with no
molecular topology), using these commands: "lattice"_lattice.html,
"region"_region.html, "create_box"_create_box.html,
"create_atoms"_create_atoms.html. The entire set of atoms can be
duplicated to make a larger simulation using the
"replicate"_replicate.html command.
(3) Settings
Once atoms and molecular topology are defined, a variety of settings
can be specified: force field coefficients, simulation parameters,
output options, etc.
Force field coefficients are set by these commands (they can also be
set in the read-in files): "pair_coeff"_pair_coeff.html,
"bond_coeff"_bond_coeff.html, "angle_coeff"_angle_coeff.html,
"dihedral_coeff"_dihedral_coeff.html,
"improper_coeff"_improper_coeff.html,
"kspace_style"_kspace_style.html, "dielectric"_dielectric.html,
"special_bonds"_special_bonds.html.
Various simulation parameters are set by these commands:
"neighbor"_neighbor.html, "neigh_modify"_neigh_modify.html,
"group"_group.html, "timestep"_timestep.html,
"reset_timestep"_reset_timestep.html, "run_style"_run_style.html,
"min_style"_min_style.html, "min_modify"_min_modify.html.
Fixes impose a variety of boundary conditions, time integration, and
diagnostic options. The "fix"_fix.html command comes in many flavors.
Various computations can be specified for execution during a
simulation using the "compute"_compute.html,
"compute_modify"_compute_modify.html, and "variable"_variable.html
commands.
Output options are set by the "thermo"_thermo.html, "dump"_dump.html,
and "restart"_restart.html commands.
(4) Run a simulation
A molecular dynamics simulation is run using the "run"_run.html
command. Energy minimization (molecular statics) is performed using
the "minimize"_minimize.html command. A parallel tempering
(replica-exchange) simulation can be run using the
"temper"_temper.html command.
:line
3.4 Commands listed by category :link(cmd_4),h4
This section lists all LAMMPS commands, grouped by category. The
"next section"_#cmd_5 lists the same commands alphabetically. Note
that some style options for some commands are part of specific LAMMPS
packages, which means they cannot be used unless the package was
included when LAMMPS was built. Not all packages are included in a
default LAMMPS build. These dependencies are listed as Restrictions
in the command's documentation.
Initialization:
"atom_modify"_atom_modify.html, "atom_style"_atom_style.html,
"boundary"_boundary.html, "dimension"_dimension.html,
"newton"_newton.html, "nthreads"_nthreads.html,
"processors"_processors.html, "units"_units.html
Atom definition:
"create_atoms"_create_atoms.html, "create_box"_create_box.html,
"lattice"_lattice.html, "read_data"_read_data.html,
"read_restart"_read_restart.html, "region"_region.html,
"replicate"_replicate.html
Force fields:
"angle_coeff"_angle_coeff.html, "angle_style"_angle_style.html,
"bond_coeff"_bond_coeff.html, "bond_style"_bond_style.html,
"dielectric"_dielectric.html, "dihedral_coeff"_dihedral_coeff.html,
"dihedral_style"_dihedral_style.html,
"improper_coeff"_improper_coeff.html,
"improper_style"_improper_style.html,
"kspace_modify"_kspace_modify.html, "kspace_style"_kspace_style.html,
"pair_coeff"_pair_coeff.html, "pair_modify"_pair_modify.html,
"pair_style"_pair_style.html, "pair_write"_pair_write.html,
"special_bonds"_special_bonds.html
Settings:
"communicate"_communicate.html, "group"_group.html, "mass"_mass.html,
"min_modify"_min_modify.html, "min_style"_min_style.html,
"neigh_modify"_neigh_modify.html, "neighbor"_neighbor.html,
"reset_timestep"_reset_timestep.html, "run_style"_run_style.html,
"set"_set.html, "timestep"_timestep.html, "velocity"_velocity.html
Fixes:
"fix"_fix.html, "fix_modify"_fix_modify.html, "unfix"_unfix.html
Computes:
"compute"_compute.html, "compute_modify"_compute_modify.html,
"uncompute"_uncompute.html
Output:
"dump"_dump.html, "dump image"_dump_image.html,
"dump_modify"_dump_modify.html, "restart"_restart.html,
"thermo"_thermo.html, "thermo_modify"_thermo_modify.html,
"thermo_style"_thermo_style.html, "undump"_undump.html,
"write_restart"_write_restart.html
Actions:
"delete_atoms"_delete_atoms.html, "delete_bonds"_delete_bonds.html,
"displace_atoms"_displace_atoms.html,
"displace_box"_displace_box.html, "minimize"_minimize.html,
"neb"_neb.html "prd"_prd.html, "run"_run.html, "temper"_temper.html
Miscellaneous:
"clear"_clear.html, "echo"_echo.html, "if"_if.html,
"include"_include.html, "jump"_jump.html, "label"_label.html,
"log"_log.html, "next"_next.html, "print"_print.html,
"shell"_shell.html, "variable"_variable.html
:line
3.5 Individual commands :h4,link(cmd_5),link(comm)
This section lists all LAMMPS commands alphabetically, with a separate
listing below of styles within certain commands. The "previous
section"_#cmd_4 lists the same commands, grouped by category. Note
that some style options for some commands are part of specific LAMMPS
packages, which means they cannot be used unless the package was
included when LAMMPS was built. Not all packages are included in a
default LAMMPS build. These dependencies are listed as Restrictions
in the command's documentation.
"angle_coeff"_angle_coeff.html,
"angle_style"_angle_style.html,
"atom_modify"_atom_modify.html,
"atom_style"_atom_style.html,
"bond_coeff"_bond_coeff.html,
"bond_style"_bond_style.html,
"boundary"_boundary.html,
"change_box"_change_box.html,
"clear"_clear.html,
"communicate"_communicate.html,
"compute"_compute.html,
"compute_modify"_compute_modify.html,
"create_atoms"_create_atoms.html,
"create_box"_create_box.html,
"delete_atoms"_delete_atoms.html,
"delete_bonds"_delete_bonds.html,
"dielectric"_dielectric.html,
"dihedral_coeff"_dihedral_coeff.html,
"dihedral_style"_dihedral_style.html,
"dimension"_dimension.html,
"displace_atoms"_displace_atoms.html,
"displace_box"_displace_box.html,
"dump"_dump.html,
"dump image"_dump_image.html,
"dump_modify"_dump_modify.html,
"echo"_echo.html,
"fix"_fix.html,
"fix_modify"_fix_modify.html,
"group"_group.html,
"if"_if.html,
"improper_coeff"_improper_coeff.html,
"improper_style"_improper_style.html,
"include"_include.html,
"jump"_jump.html,
"kspace_modify"_kspace_modify.html,
"kspace_style"_kspace_style.html,
"label"_label.html,
"lattice"_lattice.html,
"log"_log.html,
"mass"_mass.html,
"minimize"_minimize.html,
"min_modify"_min_modify.html,
"min_style"_min_style.html,
"neb"_neb.html,
"neigh_modify"_neigh_modify.html,
"neighbor"_neighbor.html,
"newton"_newton.html,
"next"_next.html,
"package"_package.html,
"pair_coeff"_pair_coeff.html,
"pair_modify"_pair_modify.html,
"pair_style"_pair_style.html,
"pair_write"_pair_write.html,
"partition"_partition.html,
"prd"_prd.html,
"print"_print.html,
"processors"_processors.html,
"read_data"_read_data.html,
"read_restart"_read_restart.html,
"region"_region.html,
"replicate"_replicate.html,
"reset_timestep"_reset_timestep.html,
"restart"_restart.html,
"run"_run.html,
"run_style"_run_style.html,
"set"_set.html,
"shell"_shell.html,
"special_bonds"_special_bonds.html,
"suffix"_suffix.html,
"tad"_tad.html,
"temper"_temper.html,
"thermo"_thermo.html,
"thermo_modify"_thermo_modify.html,
"thermo_style"_thermo_style.html,
"timestep"_timestep.html,
"uncompute"_uncompute.html,
"undump"_undump.html,
"unfix"_unfix.html,
"units"_units.html,
"variable"_variable.html,
"velocity"_velocity.html,
"write_restart"_write_restart.html :tb(c=6,ea=c)
:line
Fix styles :h4
See the "fix"_fix.html command for one-line descriptions
of each style or click on the style itself for a full description:
"adapt"_fix_adapt.html,
"addforce"_fix_addforce.html,
"aveforce"_fix_aveforce.html,
"ave/atom"_fix_ave_atom.html,
"ave/correlate"_fix_ave_correlate.html,
"ave/histo"_fix_ave_histo.html,
"ave/spatial"_fix_ave_spatial.html,
"ave/time"_fix_ave_time.html,
"bond/break"_fix_bond_break.html,
"bond/create"_fix_bond_create.html,
"bond/swap"_fix_bond_swap.html,
"box/relax"_fix_box_relax.html,
"deform"_fix_deform.html,
"deposit"_fix_deposit.html,
"drag"_fix_drag.html,
"dt/reset"_fix_dt_reset.html,
"efield"_fix_efield.html,
"enforce2d"_fix_enforce2d.html,
"evaporate"_fix_evaporate.html,
"external"_fix_external.html,
"freeze"_fix_freeze.html,
"gcmc"_fix_gcmc.html,
"gravity"_fix_gravity.html,
"heat"_fix_heat.html,
"indent"_fix_indent.html,
"langevin"_fix_langevin.html,
"lineforce"_fix_lineforce.html,
"momentum"_fix_momentum.html,
"move"_fix_move.html,
"msst"_fix_msst.html,
"neb"_fix_neb.html,
"nph"_fix_nh.html,
"nphug"_fix_nphug.html,
"nph/asphere"_fix_nph_asphere.html,
"nph/sphere"_fix_nph_sphere.html,
"npt"_fix_nh.html,
"npt/asphere"_fix_npt_asphere.html,
"npt/sphere"_fix_npt_sphere.html,
"nve"_fix_nve.html,
"nve/asphere"_fix_nve_asphere.html,
"nve/asphere/noforce"_fix_nve_asphere_noforce.html,
"nve/limit"_fix_nve_limit.html,
"nve/line"_fix_nve_line.html,
"nve/noforce"_fix_nve_noforce.html,
"nve/sphere"_fix_nve_sphere.html,
"nve/tri"_fix_nve_tri.html,
"nvt"_fix_nh.html,
"nvt/asphere"_fix_nvt_asphere.html,
"nvt/sllod"_fix_nvt_sllod.html,
"nvt/sphere"_fix_nvt_sphere.html,
"orient/fcc"_fix_orient_fcc.html,
"planeforce"_fix_planeforce.html,
"poems"_fix_poems.html,
"pour"_fix_pour.html,
"press/berendsen"_fix_press_berendsen.html,
"print"_fix_print.html,
"qeq/comb"_fix_qeq_comb.html,
"reax/bonds"_fix_reax_bonds.html,
"recenter"_fix_recenter.html,
"restrain"_fix_restrain.html,
"rigid"_fix_rigid.html,
"rigid/nve"_fix_rigid.html,
"rigid/nvt"_fix_rigid.html,
"setforce"_fix_setforce.html,
"shake"_fix_shake.html,
"spring"_fix_spring.html,
"spring/rg"_fix_spring_rg.html,
"spring/self"_fix_spring_self.html,
"srd"_fix_srd.html,
"store/force"_fix_store_force.html,
"store/state"_fix_store_state.html,
"temp/berendsen"_fix_temp_berendsen.html,
"temp/rescale"_fix_temp_rescale.html,
"thermal/conductivity"_fix_thermal_conductivity.html,
"tmd"_fix_tmd.html,
"ttm"_fix_ttm.html,
"viscosity"_fix_viscosity.html,
"viscous"_fix_viscous.html,
"wall/colloid"_fix_wall.html,
"wall/gran"_fix_wall_gran.html,
"wall/harmonic"_fix_wall.html,
"wall/lj126"_fix_wall.html,
"wall/lj93"_fix_wall.html,
"wall/reflect"_fix_wall_reflect.html,
"wall/region"_fix_wall_region.html,
"wall/srd"_fix_wall_srd.html :tb(c=8,ea=c)
These are fix styles contributed by users, which can be used if
"LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"addtorque"_fix_addtorque.html,
"atc"_fix_atc.html,
"imd"_fix_imd.html,
"langevin/eff"_fix_langevin_eff.html,
"meso"_fix_meso.html,
"meso/stationary"_fix_meso_stationary.html,
"nph/eff"_fix_nh_eff.html,
"npt/eff"_fix_nh_eff.html,
"nve/eff"_fix_nve_eff.html,
"nvt/eff"_fix_nh_eff.html,
"nvt/sllod/eff"_fix_nvt_sllod_eff.html,
"qeq/reax"_fix_qeq_reax.html,
"smd"_fix_smd.html,
"temp/rescale/eff"_fix_temp_rescale_eff.html :tb(c=6,ea=c)
These are accelerated fix styles, which can be used if LAMMPS is
built with the "appropriate accelerated
package"_Section_accelerate.html.
"freeze/cuda"_fix_freeze.html,
"addforce/cuda"_fix_addforce.html,
"aveforce/cuda"_fix_aveforce.html,
"enforce2d/cuda"_fix_enforce2d.html,
"gravity/cuda"_fix_gravity.html,
"gravity/omp"_fix_gravity.html,
"npt/cuda"_fix_nh.html,
"nve/cuda"_fix_nh.html,
"nve/sphere/omp"_fix_nve_sphere.html,
"nvt/cuda"_fix_nh.html,
"qeq/comb/omp"_fix_qeq_comb.html,
"setforce/cuda"_fix_setforce.html,
"shake/cuda"_fix_shake.html,
"temp/berendsen/cuda"_fix_temp_berendsen.html,
"temp/rescale/cuda"_fix_temp_rescale.html,
"temp/rescale/limit/cuda"_fix_temp_rescale.html,
"viscous/cuda"_fix_viscous.html :tb(c=6,ea=c)
:line
Compute styles :h4
See the "compute"_compute.html command for one-line descriptions of
each style or click on the style itself for a full description:
"angle/local"_compute_angle_local.html,
"atom/molecule"_compute_atom_molecule.html,
"bond/local"_compute_bond_local.html,
"centro/atom"_compute_centro_atom.html,
"cluster/atom"_compute_cluster_atom.html,
"cna/atom"_compute_cna_atom.html,
"com"_compute_com.html,
"com/molecule"_compute_com_molecule.html,
"coord/atom"_compute_coord_atom.html,
"damage/atom"_compute_damage_atom.html,
"dihedral/local"_compute_dihedral_local.html,
"displace/atom"_compute_displace_atom.html,
"erotate/asphere"_compute_erotate_asphere.html,
"erotate/sphere"_compute_erotate_sphere.html,
"event/displace"_compute_event_displace.html,
"group/group"_compute_group_group.html,
"gyration"_compute_gyration.html,
"gyration/molecule"_compute_gyration_molecule.html,
"heat/flux"_compute_heat_flux.html,
"improper/local"_compute_improper_local.html,
"ke"_compute_ke.html,
"ke/atom"_compute_ke_atom.html,
"msd"_compute_msd.html,
"msd/molecule"_compute_msd_molecule.html,
"pair"_compute_pair.html,
"pair/local"_compute_pair_local.html,
"pe"_compute_pe.html,
"pe/atom"_compute_pe_atom.html,
"pressure"_compute_pressure.html,
"property/atom"_compute_property_atom.html,
"property/local"_compute_property_local.html,
"property/molecule"_compute_property_molecule.html,
"rdf"_compute_rdf.html,
"reduce"_compute_reduce.html,
"reduce/region"_compute_reduce.html,
"slice"_compute_slice.html,
"stress/atom"_compute_stress_atom.html,
"temp"_compute_temp.html,
"temp/asphere"_compute_temp_asphere.html,
"temp/com"_compute_temp_com.html,
"temp/deform"_compute_temp_deform.html,
"temp/partial"_compute_temp_partial.html,
"temp/profile"_compute_temp_profile.html,
"temp/ramp"_compute_temp_ramp.html,
"temp/region"_compute_temp_region.html,
"temp/sphere"_compute_temp_sphere.html,
"ti"_compute_ti.html :tb(c=6,ea=c)
These are compute styles contributed by users, which can be used if
"LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"ackland/atom"_compute_ackland_atom.html,
"ke/eff"_compute_ke_eff.html,
"ke/atom/eff"_compute_ke_atom_eff.html,
"meso_e/atom"_compute_meso_e_atom.html,
"meso_rho/atom"_compute_meso_rho_atom.html,
"meso_t/atom"_compute_meso_t_atom.html,
"temp/eff"_compute_temp_eff.html,
"temp/deform/eff"_compute_temp_deform_eff.html,
"temp/region/eff"_compute_temp_region_eff.html,
"temp/rotate"_compute_temp_rotate.html :tb(c=6,ea=c)
These are accelerated compute styles, which can be used if LAMMPS is
built with the "appropriate accelerated
package"_Section_accelerate.html.
"pe/cuda"_compute_pe.html,
"pressure/cuda"_compute_pressure.html,
"temp/cuda"_compute_temp.html,
"temp/partial/cuda"_compute_temp_partial.html :tb(c=6,ea=c)
:line
Pair_style potentials :h4
See the "pair_style"_pair_style.html command for an overview of pair
potentials. Click on the style itself for a full description:
"none"_pair_none.html,
"hybrid"_pair_hybrid.html,
"hybrid/overlay"_pair_hybrid.html,
"adp"_pair_adp.html,
"airebo"_pair_airebo.html,
"born"_pair_born.html,
"born/coul/long"_pair_born.html,
+"born/coul/wolf"_pair_born.html,
"brownian"_pair_brownian.html,
"brownian/poly"_pair_brownian.html,
"buck"_pair_buck.html,
"buck/coul/cut"_pair_buck.html,
"buck/coul/long"_pair_buck.html,
"colloid"_pair_colloid.html,
"comb"_pair_comb.html,
"coul/cut"_pair_coul.html,
"coul/debye"_pair_coul.html,
"coul/long"_pair_coul.html,
+"coul/wolf"_pair_coul.html,
"dipole/cut"_pair_dipole.html,
"dpd"_pair_dpd.html,
"dpd/tstat"_pair_dpd.html,
"dsmc"_pair_dsmc.html,
"eam"_pair_eam.html,
"eam/alloy"_pair_eam.html,
"eam/fs"_pair_eam.html,
"eim"_pair_eim.html,
"gauss"_pair_gauss.html,
"gayberne"_pair_gayberne.html,
"gran/hertz/history"_pair_gran.html,
"gran/hooke"_pair_gran.html,
"gran/hooke/history"_pair_gran.html,
"hbond/dreiding/lj"_pair_hbond_dreiding.html,
"hbond/dreiding/morse"_pair_hbond_dreiding.html,
"line/lj"_pair_line_lj.html,
"lj/charmm/coul/charmm"_pair_charmm.html,
"lj/charmm/coul/charmm/implicit"_pair_charmm.html,
"lj/charmm/coul/long"_pair_charmm.html,
"lj/class2"_pair_class2.html,
"lj/class2/coul/cut"_pair_class2.html,
"lj/class2/coul/long"_pair_class2.html,
"lj/cut"_pair_lj.html,
"lj/cut/coul/cut"_pair_lj.html,
"lj/cut/coul/debye"_pair_lj.html,
"lj/cut/coul/long"_pair_lj.html,
"lj/cut/coul/long/tip4p"_pair_lj.html,
"lj/expand"_pair_lj_expand.html,
"lj/gromacs"_pair_gromacs.html,
"lj/gromacs/coul/gromacs"_pair_gromacs.html,
"lj/smooth"_pair_lj_smooth.html,
"lj96/cut"_pair_lj96.html,
"lubricate"_pair_lubricate.html,
"lubricate/poly"_pair_lubricate.html,
"lubricateU"_pair_lubricateU.html,
"lubricateU/poly"_pair_lubricateU.html,
"meam"_pair_meam.html,
"morse"_pair_morse.html,
"peri/lps"_pair_peri.html,
"peri/pmb"_pair_peri.html,
"reax"_pair_reax.html,
"rebo"_pair_airebo.html,
"resquared"_pair_resquared.html,
"soft"_pair_soft.html,
"sw"_pair_sw.html,
"table"_pair_table.html,
"tersoff"_pair_tersoff.html,
"tersoff/zbl"_pair_tersoff_zbl.html,
"tri/lj"_pair_tri_lj.html,
"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#start_3.
"awpmd/cut"_pair_awpmd.html,
"buck/coul"_pair_buck_coul.html,
"coul/diel"_pair_coul_diel.html,
"lj/sdk"_pair_sdk.html,
"lj/sdk/coul/long"_pair_sdk.html,
"dipole/sf"_pair_dipole.html,
"eam/cd"_pair_eam.html,
"edip"_pair_edip.html,
"eff/cut"_pair_eff.html,
"gauss/cut"_pair_gauss.html,
"lj/coul"_pair_lj_coul.html,
"lj/sf"_pair_lj_sf.html,
"reax/c"_pair_reax_c.html,
"sph/heatconduction"_pair_heatconduction.html,
"sph/idealgas"_pair_idealgas.html,
"sph/lj"_pair_lj.html,
"sph/rhosum"_pair_rhosum.html,
"sph/taitwater"_pair_taitwater.html,
"sph/taitwater/morris"_pair_taitwater_morris.html,
"tersoff/table"_pair_tersoff.html :tb(c=4,ea=c)
These are accelerated pair styles, which can be used if LAMMPS is
built with the "appropriate accelerated
package"_Section_accelerate.html.
"adp/omp"_pair_adp.html,
"airebo/omp"_pair_airebo.html,
"born/coul/long/cuda"_pair_born.html,
"born/coul/long/omp"_pair_born.html,
"born/omp"_pair_born.html,
"buck/coul/cut/cuda"_pair_buck.html,
"buck/coul/cut/omp"_pair_buck.html,
"buck/coul/long/cuda"_pair_buck.html,
"buck/coul/long/omp"_pair_buck.html,
"buck/coul/omp"_pair_buck_coul.html,
"buck/cuda"_pair_buck.html,
"buck/omp"_pair_buck.html,
"lj/sdk/gpu"_pair_sdk.html,
"lj/sdk/omp"_pair_sdk.html,
"lj/sdk/coul/long/gpu"_pair_sdk.html,
"lj/sdk/coul/long/omp"_pair_sdk.html,
"colloid/omp"_pair_colloid.html,
"comb/omp"_pair_comb.html,
"coul/cut/omp"_pair_coul.html,
"coul/debye/omp"_pair_coul.html,
"coul/long/gpu"_pair_coul.html,
"coul/long/omp"_pair_coul.html,
"dipole/cut/omp"_pair_dipole.html,
"dipole/sf/omp"_pair_dipole.html,
"dpd/omp"_pair_dpd.html,
"dpd/tstat/omp"_pair_dpd.html,
"eam/alloy/cuda"_pair_eam.html,
"eam/alloy/omp"_pair_eam.html,
"eam/alloy/opt"_pair_eam.html,
"eam/cd/omp"_pair_eam.html,
"eam/cuda"_pair_eam.html,
"eam/fs/cuda"_pair_eam.html,
"eam/fs/omp"_pair_eam.html,
"eam/fs/opt"_pair_eam.html,
"eam/omp"_pair_eam.html,
"eam/opt"_pair_eam.html,
"edip/omp"_pair_edip.html,
"eim/omp"_pair_eim.html,
"gauss/omp"_pair_gauss.html,
"gayberne/gpu"_pair_gayberne.html,
"gayberne/omp"_pair_gayberne.html,
"gran/hertz/history/omp"_pair_gran.html,
"gran/hooke/cuda"_pair_gran.html,
"gran/hooke/history/omp"_pair_gran.html,
"gran/hooke/omp"_pair_gran.html,
"hbond/dreiding/lj/omp"_pair_hbond_dreiding.html,
"hbond/dreiding/morse/omp"_pair_hbond_dreiding.html,
"line/lj/omp"_pair_line_lj.html,
"lj/charmm/coul/charmm/cuda"_pair_charmm.html,
"lj/charmm/coul/charmm/omp"_pair_charmm.html,
"lj/charmm/coul/charmm/implicit/cuda"_pair_charmm.html,
"lj/charmm/coul/charmm/implicit/omp"_pair_charmm.html,
"lj/charmm/coul/long/cuda"_pair_charmm.html,
"lj/charmm/coul/long/gpu"_pair_charmm.html,
"lj/charmm/coul/long/omp"_pair_charmm.html,
"lj/charmm/coul/long/opt"_pair_charmm.html,
"lj/charmm/coul/pppm/omp"_pair_charmm.html,
"lj/class2/coul/cut/cuda"_pair_class2.html,
"lj/class2/coul/cut/omp"_pair_class2.html,
"lj/class2/coul/long/cuda"_pair_class2.html,
"lj/class2/coul/long/gpu"_pair_class2.html,
"lj/class2/coul/long/omp"_pair_class2.html,
"lj/class2/cuda"_pair_class2.html,
"lj/class2/gpu"_pair_class2.html,
"lj/class2/omp"_pair_class2.html,
"lj/coul/omp"_pair_lj_coul.html,
"lj/cut/coul/cut/cuda"_pair_lj.html,
"lj/cut/coul/cut/gpu"_pair_lj.html,
"lj/cut/coul/cut/omp"_pair_lj.html,
"lj/cut/coul/debye/cuda"_pair_lj.html,
"lj/cut/coul/debye/omp"_pair_lj.html,
"lj/cut/coul/long/cuda"_pair_lj.html,
"lj/cut/coul/long/gpu"_pair_lj.html,
"lj/cut/coul/long/omp"_pair_lj.html,
"lj/cut/coul/long/opt"_pair_lj.html,
"lj/cut/coul/long/tip4p/omp"_pair_lj.html,
"lj/cut/coul/long/tip4p/opt"_pair_lj.html,
"lj/cut/coul/pppm/omp"_pair_lj.html,
"lj/cut/coul/pppm/tip4p/omp"_pair_lj.html,
"lj/cut/cuda"_pair_lj.html,
"lj/cut/experimental/cuda"_pair_lj.html,
"lj/cut/gpu"_pair_lj.html,
"lj/cut/omp"_pair_lj.html,
"lj/cut/opt"_pair_lj.html,
"lj/expand/cuda"_pair_lj_expand.html,
"lj/expand/gpu"_pair_lj_expand.html,
"lj/expand/omp"_pair_lj_expand.html,
"lj/gromacs/coul/gromacs/cuda"_pair_gromacs.html,
"lj/gromacs/coul/gromacs/omp"_pair_gromacs.html,
"lj/gromacs/cuda"_pair_gromacs.html,
"lj/gromacs/omp"_pair_gromacs.html,
"lj/sf/omp"_pair_lj_sf.html,
"lj/smooth/cuda"_pair_lj_smooth.html,
"lj/smooth/omp"_pair_lj_smooth.html,
"lj96/cut/cuda"_pair_lj96.html,
"lj96/cut/gpu"_pair_lj96.html,
"lj96/cut/omp"_pair_lj96.html,
"morse/cuda"_pair_morse.html,
"morse/gpu"_pair_morse.html,
"morse/omp"_pair_morse.html,
"morse/opt"_pair_morse.html,
"peri/lps/omp"_pair_peri.html,
"peri/pmb/omp"_pair_peri.html,
"rebo/omp"_pair_airebo.html,
"resquared/gpu"_pair_resquared.html,
"resquared/omp"_pair_resquared.html,
"soft/omp"_pair_soft.html,
"sw/cuda"_pair_sw.html,
"sw/omp"_pair_sw.html,
"table/omp"_pair_table.html,
"tersoff/cuda"_pair_tersoff.html,
"tersoff/omp"_pair_tersoff.html,
"tersoff/table/omp"_pair_tersoff.html,
"tersoff/zbl/omp"_pair_tersoff_zbl.html,
"tri/lj/omp"_pair_tri_lj.html,
"yukawa/omp"_pair_yukawa.html,
"yukawa/colloid/omp"_pair_yukawa_colloid.html :tb(c=4,ea=c)
:line
Bond_style potentials :h4
See the "bond_style"_bond_style.html command for an overview of bond
potentials. Click on the style itself for a full description:
"none"_bond_none.html,
"hybrid"_bond_hybrid.html,
"class2"_bond_class2.html,
"fene"_bond_fene.html,
"fene/expand"_bond_fene_expand.html,
"harmonic"_bond_harmonic.html,
"morse"_bond_morse.html,
"nonlinear"_bond_nonlinear.html,
"quartic"_bond_quartic.html,
"table"_bond_table.html :tb(c=4,ea=c,w=100)
These are bond styles contributed by users, which can be used if
"LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"harmonic/shift"_bond_harmonic_shift.html,
"harmonic/shift/cut"_bond_harmonic_shift_cut.html :tb(c=4,ea=c)
These are accelerated bond styles, which can be used if LAMMPS is
built with the "appropriate accelerated
package"_Section_accelerate.html.
"class2/omp"_bond_class2.html,
"fene/omp"_bond_fene.html,
"fene/expand/omp"_bond_fene_expand.html,
"harmonic/omp"_bond_harmonic.html,
"harmonic/shift/omp"_bond_harmonic_shift.html,
"harmonic/shift/cut/omp"_bond_harmonic_shift_cut.html,
"morse/omp"_bond_morse.html,
"nonlinear/omp"_bond_nonlinear.html,
"quartic/omp"_bond_quartic.html,
"table/omp"_bond_table.html :tb(c=4,ea=c,w=100)
:line
Angle_style potentials :h4
See the "angle_style"_angle_style.html command for an overview of
angle potentials. Click on the style itself for a full description:
"none"_angle_none.html,
"hybrid"_angle_hybrid.html,
"charmm"_angle_charmm.html,
"class2"_angle_class2.html,
"cosine"_angle_cosine.html,
"cosine/delta"_angle_cosine_delta.html,
"cosine/periodic"_angle_cosine_periodic.html,
"cosine/squared"_angle_cosine_squared.html,
"harmonic"_angle_harmonic.html,
"table"_angle_table.html :tb(c=4,ea=c,w=100)
These are angle styles contributed by users, which can be used if
"LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"sdk"_angle_sdk.html,
"cosine/shift"_angle_cosine_shift.html,
"cosine/shift/exp"_angle_cosine_shift_exp.html :tb(c=4,ea=c)
These are accelerated angle styles, which can be used if LAMMPS is
built with the "appropriate accelerated
package"_Section_accelerate.html.
"charmm/omp"_angle_charmm.html,
"class2/omp"_angle_class2.html,
"cosine/omp"_angle_cosine.html,
"cosine/delta/omp"_angle_cosine_delta.html,
"cosine/periodic/omp"_angle_cosine_periodic.html,
"cosine/shift/omp"_angle_cosine_shift.html,
"cosine/shift/exp/omp"_angle_cosine_shift_exp.html,
"cosine/squared/omp"_angle_cosine_squared.html,
"harmonic/omp"_angle_harmonic.html,
"table/omp"_angle_table.html :tb(c=4,ea=c,w=100)
:line
Dihedral_style potentials :h4
See the "dihedral_style"_dihedral_style.html command for an overview
of dihedral potentials. Click on the style itself for a full
description:
"none"_dihedral_none.html,
"hybrid"_dihedral_hybrid.html,
"charmm"_dihedral_charmm.html,
"class2"_dihedral_class2.html,
"harmonic"_dihedral_harmonic.html,
"helix"_dihedral_helix.html,
"multi/harmonic"_dihedral_multi_harmonic.html,
"opls"_dihedral_opls.html :tb(c=4,ea=c,w=100)
These are dihedral styles contributed by users, which can be used if
"LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"cosine/shift/exp"_dihedral_cosine_shift_exp.html :tb(c=4,ea=c)
These are accelerated dihedral styles, which can be used if LAMMPS is
built with the "appropriate accelerated
package"_Section_accelerate.html.
"charmm/omp"_dihedral_charmm.html,
"class2/omp"_dihedral_class2.html,
"cosine/shift/exp/omp"_dihedral_cosine_shift_exp.html,
"harmonic/omp"_dihedral_harmonic.html,
"helix/omp"_dihedral_helix.html,
"multi/harmonic/omp"_dihedral_multi_harmonic.html,
"opls/omp"_dihedral_opls.html :tb(c=4,ea=c,w=100)
:line
Improper_style potentials :h4
See the "improper_style"_improper_style.html command for an overview
of improper potentials. Click on the style itself for a full
description:
"none"_improper_none.html,
"hybrid"_improper_hybrid.html,
"class2"_improper_class2.html,
"cvff"_improper_cvff.html,
"harmonic"_improper_harmonic.html,
"umbrella"_improper_umbrella.html :tb(c=4,ea=c,w=100)
These are accelerated improper styles, which can be used if LAMMPS is
built with the "appropriate accelerated
package"_Section_accelerate.html.
"class2/omp"_improper_class2.html,
"cvff/omp"_improper_cvff.html,
"harmonic/omp"_improper_harmonic.html,
"umbrella/omp"_improper_umbrella.html :tb(c=4,ea=c,w=100)
:line
Kspace solvers :h4
See the "kspace_style"_kspace_style.html command for an overview of
Kspace solvers. Click on the style itself for a full description:
"ewald"_kspace_style.html,
"pppm"_kspace_style.html,
"pppm/cg"_kspace_style.html,
"pppm/tip4p"_kspace_style.html :tb(c=4,ea=c,w=100)
These are Kspace solvers contributed by users, which can be used if
"LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"ewald/n"_kspace_style.html :tb(c=4,ea=c,w=100)
These are accelerated Kspace solvers, which can be used if LAMMPS is
built with the "appropriate accelerated
package"_Section_accelerate.html.
"ewald/omp"_kspace_style.html,
"pppm/cuda"_kspace_style.html,
"pppm/gpu"_kspace_style.html,
"pppm/omp"_kspace_style.html,
"pppm/proxy"_kspace_style.html :tb(c=4,ea=c)
diff --git a/doc/Section_errors.html b/doc/Section_errors.html
index b7fbbbba7..a6ca97835 100644
--- a/doc/Section_errors.html
+++ b/doc/Section_errors.html
@@ -1,6620 +1,7285 @@
<HTML>
<CENTER><A HREF = "Section_python.html">Previous Section</A> - <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> -
<A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A> - <A HREF = "Section_history.html">Next
Section</A>
</CENTER>
<HR>
<H3>12. Errors
</H3>
<P>This section describes the errors you can encounter when using LAMMPS,
either conceptually, or as printed out by the program.
</P>
12.1 <A HREF = "#err_1">Common problems</A><BR>
12.2 <A HREF = "#err_2">Reporting bugs</A><BR>
12.3 <A HREF = "#err_3">Error & warning messages</A> <BR>
<HR>
<HR>
<A NAME = "err_1"></A><H4>12.1 Common problems
</H4>
<P>If two LAMMPS runs do not produce the same answer on different
machines or different numbers of processors, this is typically not a
bug. In theory you should get identical answers on any number of
processors and on any machine. In practice, numerical round-off can
cause slight differences and eventual divergence of molecular dynamics
phase space trajectories within a few 100s or few 1000s of timesteps.
However, the statistical properties of the two runs (e.g. average
energy or temperature) should still be the same.
</P>
<P>If the <A HREF = "velocity.html">velocity</A> command is used to set initial atom
velocities, a particular atom can be assigned a different velocity
when the problem is run on a different number of processors or on
different machines. If this happens, the phase space trajectories of
the two simulations will rapidly diverge. See the discussion of the
<I>loop</I> option in the <A HREF = "velocity.html">velocity</A> command for details and
options that avoid this issue.
</P>
<P>Similarly, the <A HREF = "create_atoms.html">create_atoms</A> command generates a
lattice of atoms. For the same physical system, the ordering and
numbering of atoms by atom ID may be different depending on the number
of processors.
</P>
<P>Some commands use random number generators which may be setup to
produce different random number streams on each processor and hence
will produce different effects when run on different numbers of
processors. A commonly-used example is the <A HREF = "fix_langevin.html">fix
langevin</A> command for thermostatting.
</P>
<P>A LAMMPS simulation typically has two stages, setup and run. Most
LAMMPS errors are detected at setup time; others like a bond
stretching too far may not occur until the middle of a run.
</P>
<P>LAMMPS tries to flag errors and print informative error messages so
you can fix the problem. Of course, LAMMPS cannot figure out your
physics or numerical mistakes, like choosing too big a timestep,
specifying erroneous force field coefficients, or putting 2 atoms on
top of each other! If you run into errors that LAMMPS doesn't catch
that you think it should flag, please send an email to the
<A HREF = "http://lammps.sandia.gov/authors.html">developers</A>.
</P>
<P>If you get an error message about an invalid command in your input
script, you can determine what command is causing the problem by
looking in the log.lammps file or using the <A HREF = "echo.html">echo command</A>
to see it on the screen. For a given command, LAMMPS expects certain
arguments in a specified order. If you mess this up, LAMMPS will
often flag the error, but it may read a bogus argument and assign a
value that is valid, but not what you wanted. E.g. trying to read the
string "abc" as an integer value and assigning the associated variable
a value of 0.
</P>
<P>Generally, LAMMPS will print a message to the screen and logfile and
exit gracefully when it encounters a fatal error. Sometimes it will
print a WARNING to the screen and logfile and continue on; you can
decide if the WARNING is important or not. A WARNING message that is
generated in the middle of a run is only printed to the screen, not to
the logfile, to avoid cluttering up thermodynamic output. If LAMMPS
crashes or hangs without spitting out an error message first then it
could be a bug (see <A HREF = "#err_2">this section</A>) or one of the following
cases:
</P>
<P>LAMMPS runs in the available memory a processor allows to be
allocated. Most reasonable MD runs are compute limited, not memory
limited, so this shouldn't be a bottleneck on most platforms. Almost
all large memory allocations in the code are done via C-style malloc's
which will generate an error message if you run out of memory.
Smaller chunks of memory are allocated via C++ "new" statements. If
you are unlucky you could run out of memory just when one of these
small requests is made, in which case the code will crash or hang (in
parallel), since LAMMPS doesn't trap on those errors.
</P>
<P>Illegal arithmetic can cause LAMMPS to run slow or crash. This is
typically due to invalid physics and numerics that your simulation is
computing. If you see wild thermodynamic values or NaN values in your
LAMMPS output, something is wrong with your simulation. If you
suspect this is happening, it is a good idea to print out
thermodynamic info frequently (e.g. every timestep) via the
<A HREF = "thermo.html">thermo</A> so you can monitor what is happening.
Visualizing the atom movement is also a good idea to insure your model
is behaving as you expect.
</P>
<P>In parallel, one way LAMMPS can hang is due to how different MPI
implementations handle buffering of messages. If the code hangs
without an error message, it may be that you need to specify an MPI
setting or two (usually via an environment variable) to enable
buffering or boost the sizes of messages that can be buffered.
</P>
<HR>
<A NAME = "err_2"></A><H4>12.2 Reporting bugs
</H4>
<P>If you are confident that you have found a bug in LAMMPS, follow these
steps.
</P>
<P>Check the <A HREF = "http://lammps.sandia.gov/bug.html">New features and bug
fixes</A> section of the <A HREF = "http://lammps.sandia.gov">LAMMPS WWW
site</A> to see if the bug has already been reported or fixed or the
<A HREF = "http://lammps.sandia.gov/unbug.html">Unfixed bug</A> to see if a fix is
pending.
</P>
<P>Check the <A HREF = "http://lammps.sandia.gov/mail.html">mailing list</A>
to see if it has been discussed before.
</P>
<P>If not, send an email to the mailing list describing the problem with
any ideas you have as to what is causing it or where in the code the
problem might be. The developers will ask for more info if needed,
such as an input script or data files.
</P>
<P>The most useful thing you can do to help us fix the bug is to isolate
the problem. Run it on the smallest number of atoms and fewest number
of processors and with the simplest input script that reproduces the
bug and try to identify what command or combination of commands is
causing the problem.
</P>
<P>As a last resort, you can send an email directly to the
<A HREF = "http://lammps.sandia.gov/authors.html">developers</A>.
</P>
<HR>
<H4><A NAME = "err_3"></A>12.3 Error & warning messages
</H4>
<P>These are two alphabetic lists of the <A HREF = "#error">ERROR</A> and
<A HREF = "#warn">WARNING</A> messages LAMMPS prints out and the reason why. If the
explanation here is not sufficient, the documentation for the
offending command may help.
Error and warning messages also list the source file and line number
where the error was generated. For example, this message
</P>
<P>ERROR: Illegal velocity command (velocity.cpp:78)
</P>
<P>means that line #78 in the file src/velocity.cpp generated the error.
Looking in the source code may help you figure out what went wrong.
</P>
<P>Note that error messages from <A HREF = "Section_start.html#start_3">user-contributed
packages</A> are not listed here. If such an
error occurs and is not self-explanatory, you'll need to look in the
source code or contact the author of the package.
</P>
<H4><A NAME = "error"></A>Errors:
</H4>
<DL>
<DT><I>1-3 bond count is inconsistent</I>
<DD>An inconsistency was detected when computing the number of 1-3
neighbors for each atom. This likely means something is wrong with
the bond topologies you have defined.
<DT><I>1-4 bond count is inconsistent</I>
<DD>An inconsistency was detected when computing the number of 1-4
neighbors for each atom. This likely means something is wrong with
the bond topologies you have defined.
-<DT><I>Accelerated style in input script but no fix gpu</I>
+<DT><I>64-bit atom IDs are not yet supported</I>
-<DD>GPU acceleration requires fix gpu in the input script.
-
-<DT><I>Accelerator sharing is not currently supported on system.</I>
-
-<DD>You cannot use more MPI processes than accelerators on the
-system as currently configured. For NVIDIA GPUs, the compute
-mode must be changed using nvidia-smi to support sharing.
+<DD>UNDOCUMENTED
<DT><I>All angle coeffs are not set</I>
<DD>All angle coefficients must be set in the data file or by the
angle_coeff command before running a simulation.
<DT><I>All bond coeffs are not set</I>
<DD>All bond coefficients must be set in the data file or by the
bond_coeff command before running a simulation.
<DT><I>All dihedral coeffs are not set</I>
<DD>All dihedral coefficients must be set in the data file or by the
dihedral_coeff command before running a simulation.
-<DT><I>All dipole moments are not set</I>
-
-<DD>For atom styles that define dipole moments for each atom type, all
-moments must be set in the data file or by the dipole command before
-running a simulation.
-
<DT><I>All improper coeffs are not set</I>
<DD>All improper coefficients must be set in the data file or by the
improper_coeff command before running a simulation.
<DT><I>All masses are not set</I>
<DD>For atom styles that define masses for each atom type, all masses must
be set in the data file or by the mass command before running a
simulation. They must also be set before using the velocity
command.
<DT><I>All pair coeffs are not set</I>
<DD>All pair coefficients must be set in the data file or by the
pair_coeff command before running a simulation.
-<DT><I>All shapes are not set</I>
-
-<DD>All atom types must have a shape setting, even if the particles
-are spherical.
-
<DT><I>All universe/uloop variables must have same # of values</I>
<DD>Self-explanatory.
<DT><I>All variables in next command must be same style</I>
<DD>Self-explanatory.
<DT><I>Angle atom missing in delete_bonds</I>
<DD>The delete_bonds command cannot find one or more atoms in a particular
angle on a particular processor. The pairwise cutoff is too short or
the atoms are too far apart to make a valid angle.
<DT><I>Angle atom missing in set command</I>
<DD>The set command cannot find one or more atoms in a particular angle on
a particular processor. The pairwise cutoff is too short or the atoms
are too far apart to make a valid angle.
-<DT><I>Angle atoms %d %d %d missing on proc %d at step</I>
+<DT><I>Angle atoms %d %d %d missing on proc %d at step %ld</I>
<DD>One or more of 3 atoms needed to compute a particular angle are
missing on this processor. Typically this is because the pairwise
cutoff is set too short or the angle has blown apart and an atom is
-too far away.
+too far away. :dd
<DT><I>Angle coeff for hybrid has invalid style</I>
<DD>Angle style hybrid uses another angle style as one of its
coefficients. The angle style used in the angle_coeff command or read
from a restart file is not recognized.
<DT><I>Angle coeffs are not set</I>
<DD>No angle coefficients have been assigned in the data file or via the
angle_coeff command.
<DT><I>Angle potential must be defined for SHAKE</I>
<DD>When shaking angles, an angle_style potential must be used.
<DT><I>Angle style hybrid cannot have hybrid as an argument</I>
<DD>Self-explanatory.
<DT><I>Angle style hybrid cannot have none as an argument</I>
<DD>Self-explanatory.
<DT><I>Angle style hybrid cannot use same pair style twice</I>
<DD>Self-explanatory.
<DT><I>Angle table must range from 0 to 180 degrees</I>
<DD>Self-explanatory.
<DT><I>Angle table parameters did not set N</I>
<DD>List of angle table parameters must include N setting.
<DT><I>Angle_coeff command before angle_style is defined</I>
<DD>Coefficients cannot be set in the data file or via the angle_coeff
command until an angle_style has been assigned.
<DT><I>Angle_coeff command before simulation box is defined</I>
<DD>The angle_coeff command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>Angle_coeff command when no angles allowed</I>
<DD>The chosen atom style does not allow for angles to be defined.
<DT><I>Angle_style command when no angles allowed</I>
<DD>The chosen atom style does not allow for angles to be defined.
<DT><I>Angles assigned incorrectly</I>
<DD>Angles read in from the data file were not assigned correctly to
atoms. This means there is something invalid about the topology
definitions.
<DT><I>Angles defined but no angle types</I>
<DD>The data file header lists angles but no angle types.
<DT><I>Another input script is already being processed</I>
<DD>Cannot attempt to open a 2nd input script, when the original file is
still being processed.
+<DT><I>Append boundary must be shrink/minimum</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Arccos of invalid value in variable formula</I>
<DD>Argument of arccos() must be between -1 and 1.
<DT><I>Arcsin of invalid value in variable formula</I>
<DD>Argument of arcsin() must be between -1 and 1.
+<DT><I>Assigning ellipsoid parameters to non-ellipsoid atom</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Assigning line parameters to non-line atom</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Assigning tri parameters to non-tri atom</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Atom IDs must be consecutive for velocity create loop all</I>
<DD>Self-explanatory.
<DT><I>Atom count changed in fix neb</I>
<DD>This is not allowed in a NEB calculation.
<DT><I>Atom count is inconsistent, cannot write restart file</I>
<DD>Sum of atoms across processors does not equal initial total count.
This is probably because you have lost some atoms.
<DT><I>Atom in too many rigid bodies - boost MAXBODY</I>
<DD>Fix poems has a parameter MAXBODY (in fix_poems.cpp) which determines
the maximum number of rigid bodies a single atom can belong to (i.e. a
multibody joint). The bodies you have defined exceed this limit.
<DT><I>Atom sort did not operate correctly</I>
<DD>This is an internal LAMMPS error. Please report it to the
developers.
<DT><I>Atom sorting has bin size = 0.0</I>
<DD>The neighbor cutoff is being used as the bin size, but it is zero.
Thus you must explicitly list a bin size in the atom_modify sort
command or turn off sorting.
<DT><I>Atom style hybrid cannot have hybrid as an argument</I>
<DD>Self-explanatory.
<DT><I>Atom style hybrid cannot use same atom style twice</I>
<DD>Self-explanatory.
<DT><I>Atom vector in equal-style variable formula</I>
<DD>Atom vectors generate one value per atom which is not allowed
in an equal-style variable.
<DT><I>Atom-style variable in equal-style variable formula</I>
<DD>Atom-style variables generate one value per atom which is not allowed
in an equal-style variable.
<DT><I>Atom_modify map command after simulation box is defined</I>
<DD>The atom_modify map command cannot be used after a read_data,
read_restart, or create_box command.
<DT><I>Atom_modify sort and first options cannot be used together</I>
<DD>Self-explanatory.
<DT><I>Atom_style command after simulation box is defined</I>
<DD>The atom_style command cannot be used after a read_data,
read_restart, or create_box command.
+<DT><I>Atom_style line can only be used in 2d simulations</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Atom_style tri can only be used in 3d simulations</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Attempt to pop empty stack in fix box/relax</I>
<DD>Internal LAMMPS error. Please report it to the developers.
<DT><I>Attempt to push beyond stack limit in fix box/relax</I>
<DD>Internal LAMMPS error. Please report it to the developers.
<DT><I>Attempting to rescale a 0.0 temperature</I>
<DD>Cannot rescale a temperature that is already 0.0.
+<DT><I>BAD VECLINE COUNT: %s: %d %d: %d %d\n</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>BAD VECLINE PTRS: %s: %d %d: %d\n</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Bad FENE bond</I>
<DD>Two atoms in a FENE bond have become so far apart that the bond cannot
be computed.
<DT><I>Bad TIP4P angle type for PPPM/TIP4P</I>
<DD>Specified angle type is not valid.
<DT><I>Bad TIP4P bond type for PPPM/TIP4P</I>
<DD>Specified bond type is not valid.
+<DT><I>Bad fix ID in fix append_atoms command</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Bad grid of processors</I>
<DD>The 3d grid of processors defined by the processors command does not
match the number of processors LAMMPS is being run on.
<DT><I>Bad kspace_modify slab parameter</I>
<DD>Kspace_modify value for the slab/volume keyword must be >= 2.0.
+<DT><I>Bad matrix inversion in mldivide3</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Bad principal moments</I>
<DD>Fix rigid did not compute the principal moments of inertia of a rigid
group of atoms correctly.
+<DT><I>Bad quadratic solve for particle/line collision</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Bad quadratic solve for particle/tri collision</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Bias compute does not calculate a velocity bias</I>
<DD>The specified compute must compute a bias for temperature.
<DT><I>Bias compute does not calculate temperature</I>
<DD>The specified compute must compute temperature.
<DT><I>Bias compute group does not match compute group</I>
<DD>The specified compute must operate on the same group as the parent
compute.
<DT><I>Big particle in fix srd cannot be point particle</I>
<DD>Big particles must be extended spheriods or ellipsoids.
<DT><I>Bigint setting in lmptype.h is invalid</I>
<DD>Size of bigint is less than size of tagint.
<DT><I>Bigint setting in lmptype.h is not compatible</I>
<DD>Bigint stored in restart file is not consistent with LAMMPS version
you are running.
<DT><I>Bitmapped lookup tables require int/float be same size</I>
<DD>Cannot use pair tables on this machine, because of word sizes. Use
the pair_modify command with table 0 instead.
<DT><I>Bitmapped table in file does not match requested table</I>
<DD>Setting for bitmapped table in pair_coeff command must match table
in file exactly.
<DT><I>Bitmapped table is incorrect length in table file</I>
<DD>Number of table entries is not a correct power of 2.
<DT><I>Bond and angle potentials must be defined for TIP4P</I>
<DD>Cannot use TIP4P pair potential unless bond and angle potentials
are defined.
<DT><I>Bond atom missing in delete_bonds</I>
<DD>The delete_bonds command cannot find one or more atoms in a particular
bond on a particular processor. The pairwise cutoff is too short or
the atoms are too far apart to make a valid bond.
<DT><I>Bond atom missing in set command</I>
<DD>The set command cannot find one or more atoms in a particular bond on
a particular processor. The pairwise cutoff is too short or the atoms
are too far apart to make a valid bond.
-<DT><I>Bond atoms %d %d missing on proc %d at step</I>
+<DT><I>Bond atoms %d %d missing on proc %d at step %ld</I>
<DD>One or both of 2 atoms needed to compute a particular bond are
missing on this processor. Typically this is because the pairwise
cutoff is set too short or the bond has blown apart and an atom is
-too far away.
+too far away. :dd
<DT><I>Bond coeff for hybrid has invalid style</I>
<DD>Bond style hybrid uses another bond style as one of its coefficients.
The bond style used in the bond_coeff command or read from a restart
file is not recognized.
<DT><I>Bond coeffs are not set</I>
<DD>No bond coefficients have been assigned in the data file or via the
bond_coeff command.
<DT><I>Bond potential must be defined for SHAKE</I>
<DD>Cannot use fix shake unless bond potential is defined.
<DT><I>Bond style hybrid cannot have hybrid as an argument</I>
<DD>Self-explanatory.
<DT><I>Bond style hybrid cannot have none as an argument</I>
<DD>Self-explanatory.
<DT><I>Bond style hybrid cannot use same pair style twice</I>
<DD>Self-explanatory.
<DT><I>Bond style quartic cannot be used with 3,4-body interactions</I>
<DD>No angle, dihedral, or improper styles can be defined when using
bond style quartic.
<DT><I>Bond style quartic requires special_bonds = 1,1,1</I>
<DD>This is a restriction of the current bond quartic implementation.
<DT><I>Bond table parameters did not set N</I>
<DD>List of bond table parameters must include N setting.
<DT><I>Bond table values are not increasing</I>
<DD>The values in the tabulated file must be monotonically increasing.
<DT><I>Bond_coeff command before bond_style is defined</I>
<DD>Coefficients cannot be set in the data file or via the bond_coeff
command until an bond_style has been assigned.
<DT><I>Bond_coeff command before simulation box is defined</I>
<DD>The bond_coeff command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>Bond_coeff command when no bonds allowed</I>
<DD>The chosen atom style does not allow for bonds to be defined.
<DT><I>Bond_style command when no bonds allowed</I>
<DD>The chosen atom style does not allow for bonds to be defined.
<DT><I>Bonds assigned incorrectly</I>
<DD>Bonds read in from the data file were not assigned correctly to atoms.
This means there is something invalid about the topology definitions.
<DT><I>Bonds defined but no bond types</I>
<DD>The data file header lists bonds but no bond types.
<DT><I>Both sides of boundary must be periodic</I>
<DD>Cannot specify a boundary as periodic only on the lo or hi side. Must
be periodic on both sides.
<DT><I>Boundary command after simulation box is defined</I>
<DD>The boundary command cannot be used after a read_data, read_restart,
or create_box command.
<DT><I>Box bounds are invalid</I>
<DD>The box boundaries specified in the read_data file are invalid. The
lo value must be less than the hi value for all 3 dimensions.
<DT><I>Can not specify Pxy/Pxz/Pyz in fix box/relax with non-triclinic box</I>
<DD>Only triclinic boxes can be used with off-diagonal pressure components.
See the region prism command for details.
<DT><I>Can not specify Pxy/Pxz/Pyz in fix nvt/npt/nph with non-triclinic box</I>
<DD>Only triclinic boxes can be used with off-diagonal pressure components.
See the region prism command for details.
+<DT><I>Can only use -plog with multiple partitions</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Can only use -pscreen with multiple partitions</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Can only use NEB with 1-processor replicas</I>
<DD>This is current restriction for NEB as implemented in LAMMPS.
<DT><I>Can only use TAD with 1-processor replicas for NEB</I>
<DD>This is current restriction for NEB as implemented in LAMMPS.
<DT><I>Cannot (yet) use PPPM with triclinic box</I>
<DD>This feature is not yet supported.
<DT><I>Cannot add atoms to fix move variable</I>
<DD>Atoms can not be added afterwards to this fix option.
+<DT><I>Cannot append atoms to a triclinic box</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot change box to orthogonal when tilt is non-zero</I>
<DD>Self-explanatory
<DT><I>Cannot change box with certain fixes defined</I>
<DD>The change_box command cannot be used when fix ave/spatial or
fix/deform are defined .
<DT><I>Cannot change box with dumps defined</I>
<DD>Self-explanatory.
<DT><I>Cannot change dump_modify every for dump dcd</I>
<DD>The frequency of writing dump dcd snapshots cannot be changed.
<DT><I>Cannot change dump_modify every for dump xtc</I>
<DD>The frequency of writing dump xtc snapshots cannot be changed.
<DT><I>Cannot change timestep once fix srd is setup</I>
<DD>This is because various SRD properties depend on the timestep
size.
<DT><I>Cannot change timestep with fix pour</I>
<DD>This fix pre-computes some values based on the timestep, so it cannot
be changed during a simulation run.
<DT><I>Cannot compute PPPM G</I>
<DD>LAMMPS failed to compute a valid approximation for the PPPM g_ewald
factor that partitions the computation between real space and k-space.
<DT><I>Cannot create an atom map unless atoms have IDs</I>
<DD>The simulation requires a mapping from global atom IDs to local atoms,
but the atoms that have been defined have no IDs.
<DT><I>Cannot create atoms with undefined lattice</I>
<DD>Must use the lattice command before using the create_atoms
command.
<DT><I>Cannot create/grow a vector/array of pointers for %s</I>
<DD>LAMMPS code is making an illegal call to the templated memory
allocaters, to create a vector or array of pointers.
<DT><I>Cannot create_atoms after reading restart file with per-atom info</I>
<DD>The per-atom info was stored to be used when by a fix that you
may re-define. If you add atoms before re-defining the fix, then
there will not be a correct amount of per-atom info.
<DT><I>Cannot create_box after simulation box is defined</I>
<DD>The create_box command cannot be used after a read_data, read_restart,
or create_box command.
<DT><I>Cannot currently use pair reax with pair hybrid</I>
<DD>This is not yet supported.
<DT><I>Cannot delete group all</I>
<DD>Self-explanatory.
<DT><I>Cannot delete group currently used by a compute</I>
<DD>Self-explanatory.
<DT><I>Cannot delete group currently used by a dump</I>
<DD>Self-explanatory.
<DT><I>Cannot delete group currently used by a fix</I>
<DD>Self-explanatory.
<DT><I>Cannot delete group currently used by atom_modify first</I>
<DD>Self-explanatory.
<DT><I>Cannot displace_atoms after reading restart file with per-atom info</I>
<DD>This is because the restart file info cannot be migrated with the
atoms. You can get around this by performing a 0-timestep run which
will assign the restart file info to actual atoms.
<DT><I>Cannot displace_box after reading restart file with per-atom info</I>
<DD>This is because the restart file info cannot be migrated with the
atoms. You can get around this by performing a 0-timestep run which
will assign the restart file info to actual atoms.
<DT><I>Cannot displace_box on a non-periodic boundary</I>
<DD>Self-explanatory.
+<DT><I>Cannot do GCMC on atoms in atom_modify first group</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot dump JPG file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot dump sort on atom IDs with no atom IDs defined</I>
<DD>Self-explanatory.
<DT><I>Cannot evaporate atoms in atom_modify first group</I>
<DD>This is a restriction due to the way atoms are organized in
a list to enable the atom_modify first command.
<DT><I>Cannot find delete_bonds group ID</I>
<DD>Group ID used in the delete_bonds command does not exist.
<DT><I>Cannot have both pair_modify shift and tail set to yes</I>
<DD>These 2 options are contradictory.
+<DT><I>Cannot open -reorder file</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot open ADP potential file %s</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot open AIREBO potential file %s</I>
<DD>The specified AIREBO potential file cannot be opened. Check that the
path and name are correct.
<DT><I>Cannot open COMB potential file %s</I>
<DD>The specified COMB potential file cannot be opened. Check that the
path and name are correct.
<DT><I>Cannot open EAM potential file %s</I>
<DD>The specified EAM potential file cannot be opened. Check that the
path and name are correct.
<DT><I>Cannot open EIM potential file %s</I>
<DD>The specified EIM potential file cannot be opened. Check that the
path and name are correct.
<DT><I>Cannot open MEAM potential file %s</I>
<DD>The specified MEAM potential file cannot be opened. Check that the
path and name are correct.
<DT><I>Cannot open Stillinger-Weber potential file %s</I>
<DD>The specified SW potential file cannot be opened. Check that the path
and name are correct.
<DT><I>Cannot open Tersoff potential file %s</I>
<DD>The specified Tersoff potential file cannot be opened. Check that the
path and name are correct.
+<DT><I>Cannot open custom file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot open dir to search for restart file</I>
<DD>Using a "*" in the name of the restart file will open the current
directory to search for matching file names.
<DT><I>Cannot open dump file</I>
<DD>The output file for the dump command cannot be opened. Check that the
path and name are correct.
<DT><I>Cannot open file %s</I>
<DD>The specified file cannot be opened. Check that the path and name are
correct.
<DT><I>Cannot open fix ave/correlate file %s</I>
<DD>The specified file cannot be opened. Check that the path and name are
correct.
<DT><I>Cannot open fix ave/histo file %s</I>
<DD>The specified file cannot be opened. Check that the path and name are
correct.
<DT><I>Cannot open fix ave/spatial file %s</I>
<DD>The specified file cannot be opened. Check that the path and name are
correct.
<DT><I>Cannot open fix ave/time file %s</I>
<DD>The specified file cannot be opened. Check that the path and name are
correct.
<DT><I>Cannot open fix poems file %s</I>
<DD>The specified file cannot be opened. Check that the path and name are
correct.
<DT><I>Cannot open fix print file %s</I>
<DD>The output file generated by the fix print command cannot be opened
<DT><I>Cannot open fix qeq/comb file %s</I>
<DD>The output file for the fix qeq/combs command cannot be opened.
Check that the path and name are correct.
<DT><I>Cannot open fix reax/bonds file %s</I>
<DD>The output file for the fix reax/bonds command cannot be opened.
Check that the path and name are correct.
<DT><I>Cannot open fix tmd file %s</I>
<DD>The output file for the fix tmd command cannot be opened. Check that
the path and name are correct.
<DT><I>Cannot open fix ttm file %s</I>
<DD>The output file for the fix ttm command cannot be opened. Check that
the path and name are correct.
<DT><I>Cannot open gzipped file</I>
<DD>LAMMPS is attempting to open a gzipped version of the specified file
but was unsuccessful. Check that the path and name are correct.
<DT><I>Cannot open input script %s</I>
<DD>Self-explanatory.
<DT><I>Cannot open log.lammps</I>
<DD>The default LAMMPS log file cannot be opened. Check that the
directory you are running in allows for files to be created.
-<DT><I>Cannot open logfile %s</I>
+<DT><I>Cannot open logfile</I>
-<DD>The LAMMPS log file specified in the input script cannot be opened.
+<DD>The LAMMPS log file named in a command-line argument cannot be opened.
Check that the path and name are correct.
-<DT><I>Cannot open logfile</I>
+<DT><I>Cannot open logfile %s</I>
-<DD>The LAMMPS log file named in a command-line argument cannot be opened.
+<DD>The LAMMPS log file specified in the input script cannot be opened.
Check that the path and name are correct.
<DT><I>Cannot open pair_write file</I>
<DD>The specified output file for pair energies and forces cannot be
opened. Check that the path and name are correct.
+<DT><I>Cannot open processors custom file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot open restart file %s</I>
<DD>Self-explanatory.
<DT><I>Cannot open screen file</I>
<DD>The screen file specified as a command-line argument cannot be
opened. Check that the directory you are running in allows for files
to be created.
<DT><I>Cannot open universe log file</I>
<DD>For a multi-partition run, the master log file cannot be opened.
Check that the directory you are running in allows for files to be
created.
<DT><I>Cannot open universe screen file</I>
<DD>For a multi-partition run, the master screen file cannot be opened.
Check that the directory you are running in allows for files to be
created.
<DT><I>Cannot read_data after simulation box is defined</I>
<DD>The read_data command cannot be used after a read_data,
read_restart, or create_box command.
<DT><I>Cannot read_restart after simulation box is defined</I>
<DD>The read_restart command cannot be used after a read_data,
read_restart, or create_box command.
<DT><I>Cannot redefine variable as a different style</I>
<DD>An equal-style variable can be re-defined but only if it was
originally an equal-style variable.
<DT><I>Cannot replicate 2d simulation in z dimension</I>
<DD>The replicate command cannot replicate a 2d simulation in the z
dimension.
<DT><I>Cannot replicate with fixes that store atom quantities</I>
<DD>Either fixes are defined that create and store atom-based vectors or a
restart file was read which included atom-based vectors for fixes.
The replicate command cannot duplicate that information for new atoms.
You should use the replicate command before fixes are applied to the
system.
<DT><I>Cannot reset timestep with a dynamic region defined</I>
<DD>Dynamic regions (see the region command) have a time dependence.
Thus you cannot change the timestep when one or more of these
are defined.
<DT><I>Cannot reset timestep with a time-dependent fix defined</I>
<DD>You cannot reset the timestep when a fix that keeps track of elapsed
time is in place.
<DT><I>Cannot reset timestep with dump file already written to</I>
<DD>Changing the timestep will confuse when a dump file is written. Use
the undump command, then restart the dump file.
<DT><I>Cannot reset timestep with restart file already written</I>
<DD>Changing the timestep will confuse when a restart file is written.
Use the "restart 0" command to turn off restarts, then start them
again.
<DT><I>Cannot restart fix rigid/nvt with different # of chains</I>
<DD>This is because the restart file contains per-chain info.
<DT><I>Cannot run 2d simulation with nonperiodic Z dimension</I>
<DD>Use the boundary command to make the z dimension periodic in order to
run a 2d simulation.
<DT><I>Cannot set both respa pair and inner/middle/outer</I>
<DD>In the rRESPA integrator, you must compute pairwise potentials either
all together (pair), or in pieces (inner/middle/outer). You can't do
both.
-<DT><I>Cannot set dipole for this atom style</I>
-
-<DD>This atom style does not support dipole settings for each atom type.
-
<DT><I>Cannot set dump_modify flush for dump xtc</I>
<DD>Self-explanatory.
<DT><I>Cannot set mass for this atom style</I>
<DD>This atom style does not support mass settings for each atom type.
Instead they are defined on a per-atom basis in the data file.
+<DT><I>Cannot set meso_rho for this atom style</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot set non-zero image flag for non-periodic dimension</I>
<DD>Self-explanatory.
<DT><I>Cannot set non-zero z velocity for 2d simulation</I>
<DD>Self-explanatory.
+<DT><I>Cannot set quaternion for atom that has none</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot set respa middle without inner/outer</I>
<DD>In the rRESPA integrator, you must define both a inner and outer
setting in order to use a middle setting.
-<DT><I>Cannot set shape for this atom style</I>
+<DT><I>Cannot set theta for atom that is not a line</I>
-<DD>The atom style does not support this setting.
+<DD>UNDOCUMENTED
<DT><I>Cannot set this attribute for this atom style</I>
<DD>The attribute being set does not exist for the defined atom style.
<DT><I>Cannot set variable z velocity for 2d simulation</I>
<DD>Self-explanatory.
<DT><I>Cannot skew triclinic box in z for 2d simulation</I>
<DD>Self-explanatory.
+<DT><I>Cannot use -cuda on without USER-CUDA installed</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use -reorder after -partition</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot use Ewald with 2d simulation</I>
<DD>The kspace style ewald cannot be used in 2d simulations. You can use
2d Ewald in a 3d simulation; see the kspace_modify command.
<DT><I>Cannot use Ewald with triclinic box</I>
<DD>This feature is not yet supported.
<DT><I>Cannot use NEB unless atom map exists</I>
<DD>Use the atom_modify command to create an atom map.
<DT><I>Cannot use NEB with a single replica</I>
<DD>Self-explanatory.
<DT><I>Cannot use NEB with atom_modify sort enabled</I>
<DD>This is current restriction for NEB implemented in LAMMPS.
<DT><I>Cannot use PPPM with 2d simulation</I>
<DD>The kspace style pppm cannot be used in 2d simulations. You can use
2d PPPM in a 3d simulation; see the kspace_modify command.
<DT><I>Cannot use PRD with a time-dependent fix defined</I>
<DD>PRD alters the timestep in ways that will mess up these fixes.
<DT><I>Cannot use PRD with a time-dependent region defined</I>
<DD>PRD alters the timestep in ways that will mess up these regions.
<DT><I>Cannot use PRD with atom_modify sort enabled</I>
<DD>This is a current restriction of PRD. You must turn off sorting,
which is enabled by default, via the atom_modify command.
<DT><I>Cannot use PRD with multi-processor replicas unless atom map exists</I>
<DD>Use the atom_modify command to create an atom map.
<DT><I>Cannot use TAD unless atom map exists for NEB</I>
<DD>See atom_modify map command to set this.
<DT><I>Cannot use TAD with a single replica for NEB</I>
<DD>NEB requires multiple replicas.
<DT><I>Cannot use TAD with atom_modify sort enabled for NEB</I>
<DD>This is a current restriction of NEB.
<DT><I>Cannot use a damped dynamics min style with fix box/relax</I>
<DD>This is a current restriction in LAMMPS. Use another minimizer
style.
<DT><I>Cannot use a damped dynamics min style with per-atom DOF</I>
<DD>This is a current restriction in LAMMPS. Use another minimizer
style.
+<DT><I>Cannot use append_atoms in periodic dimension</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot use compute cluster/atom unless atoms have IDs</I>
<DD>Atom IDs are used to identify clusters.
<DT><I>Cannot use cwiggle in variable formula between runs</I>
<DD>This is a function of elapsed time.
<DT><I>Cannot use delete_atoms unless atoms have IDs</I>
<DD>Your atoms do not have IDs, so the delete_atoms command cannot be
used.
<DT><I>Cannot use delete_bonds with non-molecular system</I>
<DD>Your choice of atom style does not have bonds.
+<DT><I>Cannot use fix GPU with USER-CUDA mode enabled</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot use fix TMD unless atom map exists</I>
<DD>Using this fix requires the ability to lookup an atom index, which is
provided by an atom map. An atom map does not exist (by default) for
non-molecular problems. Using the atom_modify map command will force
an atom map to be created.
<DT><I>Cannot use fix ave/spatial z for 2 dimensional model</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix bond/break with non-molecular systems</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix bond/create with non-molecular systems</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix box/relax on a 2nd non-periodic dimension</I>
<DD>When specifying an off-diagonal pressure component, the 2nd of the two
dimensions must be periodic. E.g. if the xy component is specified,
then the y dimension must be periodic.
<DT><I>Cannot use fix box/relax on a non-periodic dimension</I>
<DD>When specifying a diagonal pressure component, the dimension must be
periodic.
<DT><I>Cannot use fix deform on a 2nd non-periodic boundary</I>
<DD>When specifying a tilt factor change, the 2nd of the two dimensions
must be periodic. E.g. if the xy tilt is specified, then the y
dimension must be periodic.
<DT><I>Cannot use fix deform on a non-periodic boundary</I>
<DD>When specifying a change is a box dimension, the dimension must be
periodic.
<DT><I>Cannot use fix deform trate on a box with zero tilt</I>
<DD>The trate style alters the current strain.
<DT><I>Cannot use fix enforce2d with 3d simulation</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix msst without per-type mass defined</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix npt and fix deform on same component of stress tensor</I>
<DD>This would be changing the same box dimension twice.
<DT><I>Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension</I>
<DD>When specifying an off-diagonal pressure component, the 2nd of the two
dimensions must be periodic. E.g. if the xy component is specified,
then the y dimension must be periodic.
<DT><I>Cannot use fix nvt/npt/nph on a non-periodic dimension</I>
<DD>When specifying a diagonal pressure component, the dimension must be
periodic.
+<DT><I>Cannot use fix nvt/npt/nph with both xy dynamics and xy scaling</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use fix nvt/npt/nph with both xz dynamics and xz scaling</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use fix nvt/npt/nph with xy dynamics when y is non-periodic dimension</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use fix nvt/npt/nph with xz dynamics when z is non-periodic dimension</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use fix nvt/npt/nph with yz dynamics when z is non-periodic dimension</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use fix nvt/npt/nph withboth yz dynamics and yz scaling</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot use fix pour with triclinic box</I>
<DD>This feature is not yet supported.
<DT><I>Cannot use fix press/berendsen and fix deform on same component of stress tensor</I>
<DD>These commands both change the box size/shape, so you cannot use both
together.
<DT><I>Cannot use fix press/berendsen on a non-periodic dimension</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix press/berendsen with triclinic box</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix reax/bonds without pair_style reax</I>
<DD>Self-explantory.
<DT><I>Cannot use fix shake with non-molecular system</I>
<DD>Your choice of atom style does not have bonds.
<DT><I>Cannot use fix ttm with 2d simulation</I>
<DD>This is a current restriction of this fix due to the grid it creates.
<DT><I>Cannot use fix ttm with triclinic box</I>
<DD>This is a current restriction of this fix due to the grid it creates.
<DT><I>Cannot use fix wall in periodic dimension</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix wall zlo/zhi for a 2d simulation</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix wall/reflect in periodic dimension</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix wall/reflect zlo/zhi for a 2d simulation</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix wall/srd in periodic dimension</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix wall/srd more than once</I>
<DD>Nor is their a need to since multiple walls can be specified
in one command.
<DT><I>Cannot use fix wall/srd without fix srd</I>
<DD>Self-explanatory.
<DT><I>Cannot use fix wall/srd zlo/zhi for a 2d simulation</I>
<DD>Self-explanatory.
+<DT><I>Cannot use force/hybrid_neigh with triclinic box</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot use force/neigh with triclinic box</I>
<DD>This is a current limitation of the GPU implementation
in LAMMPS.
<DT><I>Cannot use kspace solver on system with no charge</I>
<DD>No atoms in system have a non-zero charge.
+<DT><I>Cannot use lines with fix srd unless overlap is set</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot use neigh_modify exclude with GPU neighbor builds</I>
<DD>This is a current limitation of the GPU implementation
in LAMMPS.
<DT><I>Cannot use neighbor bins - box size << cutoff</I>
<DD>Too many neighbor bins will be created. This typically happens when
the simulation box is very small in some dimension, compared to the
neighbor cutoff. Use the "nsq" style instead of "bin" style.
-<DT><I>Cannot use newton pair with GPU CHARMM pair style</I>
+<DT><I>Cannot use newton pair with coul/long/gpu pair style</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use newton pair with gayberne/gpu pair style</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use newton pair with lj/charmm/coul/long/gpu pair style</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use newton pair with lj/class2/coul/long/gpu pair style</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use newton pair with lj/class2/gpu pair style</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use newton pair with lj/cut/coul/cut/gpu pair style</I>
-<DD>See the newton command to change the setting.
+<DD>UNDOCUMENTED
-<DT><I>Cannot use newton pair with GPU Gay-Berne pair style</I>
+<DT><I>Cannot use newton pair with lj/cut/coul/long/gpu pair style</I>
-<DD>See the newton command to change the setting.
+<DD>UNDOCUMENTED
-<DT><I>Cannot use newton pair with GPU LJ pair style</I>
+<DT><I>Cannot use newton pair with lj/cut/gpu pair style</I>
-<DD>See the newton command to change the setting.
+<DD>UNDOCUMENTED
-<DT><I>Cannot use newton pair with GPU LJ96 pair style</I>
+<DT><I>Cannot use newton pair with lj/expand/gpu pair style</I>
-<DD>See the newton command to change the setting.
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use newton pair with lj96/cut/gpu pair style</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use newton pair with morse/gpu pair style</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Cannot use newton pair with resquared/gpu pair style</I>
+
+<DD>UNDOCUMENTED
<DT><I>Cannot use non-zero forces in an energy minimization</I>
<DD>Fix setforce cannot be used in this manner. Use fix addforce
instead.
<DT><I>Cannot use nonperiodic boundares with fix ttm</I>
<DD>This fix requires a fully periodic simulation box.
<DT><I>Cannot use nonperiodic boundaries with Ewald</I>
<DD>For kspace style ewald, all 3 dimensions must have periodic boundaries
unless you use the kspace_modify command to define a 2d slab with a
non-periodic z dimension.
<DT><I>Cannot use nonperiodic boundaries with PPPM</I>
<DD>For kspace style pppm, all 3 dimensions must have periodic boundaries
unless you use the kspace_modify command to define a 2d slab with a
non-periodic z dimension.
+<DT><I>Cannot use order greater than 8 with pppm/gpu.</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot use pair hybrid with GPU neighbor builds</I>
<DD>See documentation for fix gpu.
<DT><I>Cannot use pair tail corrections with 2d simulations</I>
<DD>The correction factors are only currently defined for 3d systems.
+<DT><I>Cannot use processors part command without using partitions</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot use ramp in variable formula between runs</I>
<DD>This is because the ramp() function is time dependent.
<DT><I>Cannot use region INF or EDGE when box does not exist</I>
<DD>Regions that extend to the box boundaries can only be used after the
create_box command has been used.
<DT><I>Cannot use set atom with no atom IDs defined</I>
<DD>Atom IDs are not defined, so they cannot be used to identify an atom.
+<DT><I>Cannot use set mol with no molecule IDs defined</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot use swiggle in variable formula between runs</I>
<DD>This is a function of elapsed time.
+<DT><I>Cannot use tris with fix srd unless overlap is set</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot use variable energy with constant force in fix addforce</I>
<DD>This is because for constant force, LAMMPS can compute the change
in energy directly.
<DT><I>Cannot use variable every setting for dump dcd</I>
<DD>The format of DCD dump files requires snapshots be output
at a constant frequency.
<DT><I>Cannot use variable every setting for dump xtc</I>
<DD>The format of this file requires snapshots at regular intervals.
<DT><I>Cannot use vdisplace in variable formula between runs</I>
<DD>This is a function of elapsed time.
<DT><I>Cannot use velocity create loop all unless atoms have IDs</I>
<DD>Atoms in the simulation to do not have IDs, so this style
of velocity creation cannot be performed.
<DT><I>Cannot use wall in periodic dimension</I>
<DD>Self-explanatory.
<DT><I>Cannot wiggle and shear fix wall/gran</I>
<DD>Cannot specify both options at the same time.
+<DT><I>Cannot zero Langevin force of 0 atoms</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Cannot zero momentum of 0 atoms</I>
<DD>The collection of atoms for which momentum is being computed has no
atoms.
<DT><I>Change_box command before simulation box is defined</I>
<DD>Self-explanatory.
<DT><I>Change_box operation is invalid</I>
<DD>Cannot change orthogonal box to orthogonal or a triclinic box to
triclinic.
<DT><I>Communicate group != atom_modify first group</I>
<DD>Self-explanatory.
<DT><I>Compute ID for compute atom/molecule does not exist</I>
<DD>Self-explanatory.
<DT><I>Compute ID for compute reduce does not exist</I>
<DD>Self-explanatory.
+<DT><I>Compute ID for compute slice does not exist</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Compute ID for fix ave/atom does not exist</I>
<DD>Self-explanatory.
<DT><I>Compute ID for fix ave/correlate does not exist</I>
<DD>Self-explanatory.
<DT><I>Compute ID for fix ave/histo does not exist</I>
<DD>Self-explanatory.
<DT><I>Compute ID for fix ave/spatial does not exist</I>
<DD>Self-explanatory.
<DT><I>Compute ID for fix ave/time does not exist</I>
<DD>Self-explanatory.
<DT><I>Compute ID for fix store/state does not exist</I>
<DD>Self-explanatory.
<DT><I>Compute ID must be alphanumeric or underscore characters</I>
<DD>Self-explanatory.
<DT><I>Compute angle/local used when angles are not allowed</I>
<DD>The atom style does not support angles.
<DT><I>Compute atom/molecule compute array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Compute atom/molecule compute does not calculate a per-atom array</I>
<DD>Self-explanatory.
<DT><I>Compute atom/molecule compute does not calculate a per-atom vector</I>
<DD>Self-explanatory.
<DT><I>Compute atom/molecule compute does not calculate per-atom values</I>
<DD>Self-explanatory.
<DT><I>Compute atom/molecule fix array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Compute atom/molecule fix does not calculate a per-atom array</I>
<DD>Self-explanatory.
<DT><I>Compute atom/molecule fix does not calculate a per-atom vector</I>
<DD>Self-explanatory.
<DT><I>Compute atom/molecule fix does not calculate per-atom values</I>
<DD>Self-explanatory.
<DT><I>Compute atom/molecule requires molecular atom style</I>
<DD>Self-explanatory.
<DT><I>Compute atom/molecule variable is not atom-style variable</I>
<DD>Self-explanatory.
<DT><I>Compute bond/local used when bonds are not allowed</I>
<DD>The atom style does not support bonds.
<DT><I>Compute centro/atom requires a pair style be defined</I>
<DD>This is because the computation of the centro-symmetry values
uses a pairwise neighbor list.
<DT><I>Compute cluster/atom cutoff is longer than pairwise cutoff</I>
<DD>Cannot identify clusters beyond cutoff.
<DT><I>Compute cluster/atom requires a pair style be defined</I>
<DD>This is so that the pair style defines a cutoff distance which
is used to find clusters.
<DT><I>Compute cna/atom cutoff is longer than pairwise cutoff</I>
<DD>Self-explantory.
<DT><I>Compute cna/atom requires a pair style be defined</I>
<DD>Self-explantory.
<DT><I>Compute com/molecule requires molecular atom style</I>
<DD>Self-explanatory.
<DT><I>Compute coord/atom cutoff is longer than pairwise cutoff</I>
<DD>Cannot compute coordination at distances longer than the pair cutoff,
since those atoms are not in the neighbor list.
<DT><I>Compute coord/atom requires a pair style be defined</I>
<DD>Self-explantory.
<DT><I>Compute damage/atom requires peridynamic potential</I>
<DD>Damage is a Peridynamic-specific metric. It requires you
to be running a Peridynamics simulation.
<DT><I>Compute dihedral/local used when dihedrals are not allowed</I>
<DD>The atom style does not support dihedrals.
<DT><I>Compute does not allow an extra compute or fix to be reset</I>
<DD>This is an internal LAMMPS error. Please report it to the
developers.
-<DT><I>Compute erotate/asphere cannot be used with atom attributes diameter or rmass</I>
-
-<DD>These attributes override the shape and mass settings, so cannot be
-used.
-
-<DT><I>Compute erotate/asphere requires atom attributes angmom, quat, shape</I>
+<DT><I>Compute erotate/asphere requires atom style ellipsoid or line or tri</I>
-<DD>An atom style that defines these attributes must be used.
+<DD>UNDOCUMENTED
<DT><I>Compute erotate/asphere requires extended particles</I>
<DD>This compute cannot be used with point paritlces.
-<DT><I>Compute erotate/sphere requires atom attribute omega</I>
-
-<DD>An atom style that defines this attribute must be used.
-
-<DT><I>Compute erotate/sphere requires atom attribute radius or shape</I>
+<DT><I>Compute erotate/sphere requires atom style sphere</I>
-<DD>An atom style that defines these attributes must be used.
-
-<DT><I>Compute erotate/sphere requires spherical particle shapes</I>
-
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
<DT><I>Compute event/displace has invalid fix event assigned</I>
<DD>This is an internal LAMMPS error. Please report it to the
developers.
<DT><I>Compute group/group group ID does not exist</I>
<DD>Self-explanatory.
<DT><I>Compute gyration/molecule requires molecular atom style</I>
<DD>Self-explanatory.
<DT><I>Compute heat/flux compute ID does not compute ke/atom</I>
<DD>Self-explanatory.
<DT><I>Compute heat/flux compute ID does not compute pe/atom</I>
<DD>Self-explanatory.
<DT><I>Compute heat/flux compute ID does not compute stress/atom</I>
<DD>Self-explanatory.
<DT><I>Compute improper/local used when impropers are not allowed</I>
<DD>The atom style does not support impropers.
<DT><I>Compute msd/molecule requires molecular atom style</I>
<DD>Self-explanatory.
+<DT><I>Compute nve/asphere requires atom style ellipsoid</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Compute nvt/nph/npt asphere requires atom style ellipsoid</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Compute pair must use group all</I>
<DD>Pair styles accumlate energy on all atoms.
<DT><I>Compute pe must use group all</I>
<DD>Energies computed by potentials (pair, bond, etc) are computed on all
atoms.
<DT><I>Compute pressure must use group all</I>
<DD>Virial contributions computed by potentials (pair, bond, etc) are
computed on all atoms.
<DT><I>Compute pressure temperature ID does not compute temperature</I>
<DD>The compute ID assigned to a pressure computation must compute
temperature.
<DT><I>Compute property/atom for atom property that isn't allocated</I>
<DD>Self-explanatory.
<DT><I>Compute property/local cannot use these inputs together</I>
<DD>Only inputs that generate the same number of datums can be used
togther. E.g. bond and angle quantities cannot be mixed.
<DT><I>Compute property/local for property that isn't allocated</I>
<DD>Self-explanatory.
<DT><I>Compute property/molecule requires molecular atom style</I>
<DD>Self-explanatory.
<DT><I>Compute rdf requires a pair style be defined</I>
<DD>Self-explanatory.
<DT><I>Compute reduce compute array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Compute reduce compute calculates global values</I>
<DD>A compute that calculates peratom or local values is required.
<DT><I>Compute reduce compute does not calculate a local array</I>
<DD>Self-explanatory.
<DT><I>Compute reduce compute does not calculate a local vector</I>
<DD>Self-explanatory.
<DT><I>Compute reduce compute does not calculate a per-atom array</I>
<DD>Self-explanatory.
<DT><I>Compute reduce compute does not calculate a per-atom vector</I>
<DD>Self-explanatory.
<DT><I>Compute reduce fix array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Compute reduce fix calculates global values</I>
<DD>A fix that calculates peratom or local values is required.
<DT><I>Compute reduce fix does not calculate a local array</I>
<DD>Self-explanatory.
<DT><I>Compute reduce fix does not calculate a local vector</I>
<DD>Self-explanatory.
<DT><I>Compute reduce fix does not calculate a per-atom array</I>
<DD>Self-explanatory.
<DT><I>Compute reduce fix does not calculate a per-atom vector</I>
<DD>Self-explanatory.
<DT><I>Compute reduce replace requires min or max mode</I>
<DD>Self-explanatory.
<DT><I>Compute reduce variable is not atom-style variable</I>
<DD>Self-explanatory.
-<DT><I>Compute temp/asphere cannot be used with atom attributes diameter or rmass</I>
+<DT><I>Compute slice compute array is accessed out-of-range</I>
-<DD>These attributes override the shape and mass settings, so cannot be
-used.
+<DD>UNDOCUMENTED
-<DT><I>Compute temp/asphere requires atom attributes angmom, quat, shape</I>
+<DT><I>Compute slice compute does not calculate a global array</I>
-<DD>An atom style that defines these attributes must be used.
+<DD>UNDOCUMENTED
+
+<DT><I>Compute slice compute does not calculate a global vector</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Compute slice compute does not calculate global vector or array</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Compute slice compute vector is accessed out-of-range</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Compute slice fix array is accessed out-of-range</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Compute slice fix does not calculate a global array</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Compute slice fix does not calculate a global vector</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Compute slice fix does not calculate global vector or array</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Compute slice fix vector is accessed out-of-range</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Compute temp/asphere requires atom style ellipsoid</I>
+
+<DD>UNDOCUMENTED
<DT><I>Compute temp/asphere requires extended particles</I>
<DD>This compute cannot be used with point paritlces.
<DT><I>Compute temp/partial cannot use vz for 2d systemx</I>
<DD>Self-explanatory.
<DT><I>Compute temp/profile cannot bin z for 2d systems</I>
<DD>Self-explanatory.
<DT><I>Compute temp/profile cannot use vz for 2d systemx</I>
<DD>Self-explanatory.
-<DT><I>Compute temp/sphere requires atom attribute omega</I>
-
-<DD>An atom style that defines this attribute must be used.
-
-<DT><I>Compute temp/sphere requires atom attribute radius or shape</I>
-
-<DD>An atom style that defines these attributes must be used.
+<DT><I>Compute temp/sphere requires atom style sphere</I>
-<DT><I>Compute temp/sphere requires spherical particle shapes</I>
-
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
<DT><I>Compute ti kspace style does not exist</I>
<DD>Self-explanatory.
<DT><I>Compute ti pair style does not exist</I>
<DD>Self-explanatory.
<DT><I>Compute ti tail when pair style does not compute tail corrections</I>
<DD>Self-explanatory.
<DT><I>Compute used in variable between runs is not current</I>
<DD>Computes cannot be invoked by a variable in between runs. Thus they
must have been evaluated on the last timestep of the previous run in
order for their value(s) to be accessed. See the doc page for the
variable command for more info.
<DT><I>Compute used in variable thermo keyword between runs is not current</I>
<DD>Some thermo keywords rely on a compute to calculate their value(s).
Computes cannot be invoked by a variable in between runs. Thus they
must have been evaluated on the last timestep of the previous run in
order for their value(s) to be accessed. See the doc page for the
variable command for more info.
<DT><I>Computed temperature for fix temp/berendsen cannot be 0.0</I>
<DD>Self-explanatory.
<DT><I>Computed temperature for fix temp/rescale cannot be 0.0</I>
<DD>Cannot rescale the temperature to a new value if the current
temperature is 0.0.
<DT><I>Could not count initial bonds in fix bond/create</I>
<DD>Could not find one of the atoms in a bond on this processor.
<DT><I>Could not create 3d FFT plan</I>
<DD>The FFT setup in pppm failed.
+<DT><I>Could not create 3d grid of processors</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Could not create 3d remap plan</I>
<DD>The FFT setup in pppm failed.
+<DT><I>Could not create numa 3d grid of processors</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Could not create numa grid of processors</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Could not create twolevel 3d grid of processors</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Could not find atom_modify first group ID</I>
<DD>Self-explanatory.
<DT><I>Could not find compute ID for PRD</I>
<DD>Self-explanatory.
<DT><I>Could not find compute ID for TAD</I>
<DD>Self-explanatory.
<DT><I>Could not find compute ID for temperature bias</I>
<DD>Self-explanatory.
<DT><I>Could not find compute ID to delete</I>
<DD>Self-explanatory.
<DT><I>Could not find compute displace/atom fix ID</I>
<DD>Self-explanatory.
<DT><I>Could not find compute event/displace fix ID</I>
<DD>Self-explanatory.
<DT><I>Could not find compute group ID</I>
<DD>Self-explanatory.
<DT><I>Could not find compute heat/flux compute ID</I>
<DD>Self-explanatory.
<DT><I>Could not find compute msd fix ID</I>
<DD>Self-explanatory.
<DT><I>Could not find compute pressure temperature ID</I>
<DD>The compute ID for calculating temperature does not exist.
<DT><I>Could not find compute_modify ID</I>
<DD>Self-explanatory.
<DT><I>Could not find delete_atoms group ID</I>
<DD>Group ID used in the delete_atoms command does not exist.
<DT><I>Could not find delete_atoms region ID</I>
<DD>Region ID used in the delete_atoms command does not exist.
<DT><I>Could not find displace_atoms group ID</I>
<DD>Group ID used in the displace_atoms command does not exist.
<DT><I>Could not find displace_box group ID</I>
<DD>Group ID used in the displace_box command does not exist.
-<DT><I>Could not find dump cfg compute ID</I>
-
-<DD>Self-explanatory.
-
-<DT><I>Could not find dump cfg fix ID</I>
-
-<DD>Self-explanatory.
-
-<DT><I>Could not find dump cfg variable name</I>
-
-<DD>Self-explanatory.
-
<DT><I>Could not find dump custom compute ID</I>
<DD>The compute ID needed by dump custom to compute a per-atom quantity
does not exist.
<DT><I>Could not find dump custom fix ID</I>
<DD>Self-explanatory.
<DT><I>Could not find dump custom variable name</I>
<DD>Self-explanatory.
<DT><I>Could not find dump group ID</I>
<DD>A group ID used in the dump command does not exist.
<DT><I>Could not find dump local compute ID</I>
<DD>Self-explanatory.
<DT><I>Could not find dump local fix ID</I>
<DD>Self-explanatory.
<DT><I>Could not find dump modify compute ID</I>
<DD>Self-explanatory.
<DT><I>Could not find dump modify fix ID</I>
<DD>Self-explanatory.
<DT><I>Could not find dump modify variable name</I>
<DD>Self-explanatory.
<DT><I>Could not find fix ID to delete</I>
<DD>Self-explanatory.
<DT><I>Could not find fix group ID</I>
<DD>A group ID used in the fix command does not exist.
<DT><I>Could not find fix msst compute ID</I>
<DD>Self-explanatory.
<DT><I>Could not find fix poems group ID</I>
<DD>A group ID used in the fix poems command does not exist.
<DT><I>Could not find fix recenter group ID</I>
<DD>A group ID used in the fix recenter command does not exist.
<DT><I>Could not find fix rigid group ID</I>
<DD>A group ID used in the fix rigid command does not exist.
<DT><I>Could not find fix srd group ID</I>
<DD>Self-explanatory.
<DT><I>Could not find fix_modify ID</I>
<DD>A fix ID used in the fix_modify command does not exist.
<DT><I>Could not find fix_modify pressure ID</I>
<DD>The compute ID for computing pressure does not exist.
<DT><I>Could not find fix_modify temperature ID</I>
<DD>The compute ID for computing temperature does not exist.
<DT><I>Could not find group delete group ID</I>
<DD>Self-explanatory.
-<DT><I>Could not find/initialize a specified accelerator device</I>
-
-<DD>Your GPU setup is invalid.
-
<DT><I>Could not find set group ID</I>
<DD>Group ID specified in set command does not exist.
<DT><I>Could not find thermo compute ID</I>
<DD>Compute ID specified in thermo_style command does not exist.
<DT><I>Could not find thermo custom compute ID</I>
<DD>The compute ID needed by thermo style custom to compute a requested
quantity does not exist.
<DT><I>Could not find thermo custom fix ID</I>
<DD>The fix ID needed by thermo style custom to compute a requested
quantity does not exist.
<DT><I>Could not find thermo custom variable name</I>
<DD>Self-explanatory.
<DT><I>Could not find thermo fix ID</I>
<DD>Fix ID specified in thermo_style command does not exist.
<DT><I>Could not find thermo_modify pressure ID</I>
<DD>The compute ID needed by thermo style custom to compute pressure does
not exist.
<DT><I>Could not find thermo_modify temperature ID</I>
<DD>The compute ID needed by thermo style custom to compute temperature does
not exist.
<DT><I>Could not find undump ID</I>
<DD>A dump ID used in the undump command does not exist.
<DT><I>Could not find velocity group ID</I>
<DD>A group ID used in the velocity command does not exist.
<DT><I>Could not find velocity temperature ID</I>
<DD>The compute ID needed by the velocity command to compute temperature
does not exist.
<DT><I>Could not grab element entry from EIM potential file</I>
<DD>Self-explanatory
<DT><I>Could not grab global entry from EIM potential file</I>
<DD>Self-explanatory.
<DT><I>Could not grab pair entry from EIM potential file</I>
<DD>Self-explanatory.
-<DT><I>Could not set finite-size particle attribute in fix rigid</I>
-
-<DD>The particle has a finite size but its attributes could not be
-determined.
-
<DT><I>Coulomb cutoffs of pair hybrid sub-styles do not match</I>
<DD>If using a Kspace solver, all Coulomb cutoffs of long pair styles must
be the same.
<DT><I>Cound not find dump_modify ID</I>
<DD>Self-explanatory.
<DT><I>Create_atoms command before simulation box is defined</I>
<DD>The create_atoms command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>Create_atoms region ID does not exist</I>
<DD>A region ID used in the create_atoms command does not exist.
<DT><I>Create_box region ID does not exist</I>
<DD>A region ID used in the create_box command does not exist.
<DT><I>Create_box region does not support a bounding box</I>
<DD>Not all regions represent bounded volumes. You cannot use
such a region with the create_box command.
<DT><I>Cyclic loop in joint connections</I>
<DD>Fix poems cannot (yet) work with coupled bodies whose joints connect
the bodies in a ring (or cycle).
<DT><I>Degenerate lattice primitive vectors</I>
<DD>Invalid set of 3 lattice vectors for lattice command.
<DT><I>Delete region ID does not exist</I>
<DD>Self-explanatory.
<DT><I>Delete_atoms command before simulation box is defined</I>
<DD>The delete_atoms command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>Delete_atoms cutoff > neighbor cutoff</I>
<DD>Cannot delete atoms further away than a processor knows about.
<DT><I>Delete_atoms requires a pair style be defined</I>
<DD>This is because atom deletion within a cutoff uses a pairwise
neighbor list.
<DT><I>Delete_bonds command before simulation box is defined</I>
<DD>The delete_bonds command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>Delete_bonds command with no atoms existing</I>
<DD>No atoms are yet defined so the delete_bonds command cannot be used.
<DT><I>Deposition region extends outside simulation box</I>
<DD>Self-explanatory.
<DT><I>Did not assign all atoms correctly</I>
<DD>Atoms read in from a data file were not assigned correctly to
processors. This is likely due to some atom coordinates being
outside a non-periodic simulation box.
<DT><I>Did not find all elements in MEAM library file</I>
<DD>The requested elements were not found in the MEAM file.
<DT><I>Did not find fix shake partner info</I>
<DD>Could not find bond partners implied by fix shake command. This error
can be triggered if the delete_bonds command was used before fix
shake, and it removed bonds without resetting the 1-2, 1-3, 1-4
weighting list via the special keyword.
<DT><I>Did not find keyword in table file</I>
<DD>Keyword used in pair_coeff command was not found in table file.
<DT><I>Did not set temp for fix rigid/nvt</I>
<DD>The temp keyword must be used.
<DT><I>Dihedral atom missing in delete_bonds</I>
<DD>The delete_bonds command cannot find one or more atoms in a particular
dihedral on a particular processor. The pairwise cutoff is too short
or the atoms are too far apart to make a valid dihedral.
<DT><I>Dihedral atom missing in set command</I>
<DD>The set command cannot find one or more atoms in a particular dihedral
on a particular processor. The pairwise cutoff is too short or the
atoms are too far apart to make a valid dihedral.
-<DT><I>Dihedral atoms %d %d %d %d missing on proc %d at step</I>
+<DT><I>Dihedral atoms %d %d %d %d missing on proc %d at step %ld</I>
<DD>One or more of 4 atoms needed to compute a particular dihedral are
missing on this processor. Typically this is because the pairwise
cutoff is set too short or the dihedral has blown apart and an atom is
-too far away.
+too far away. :dd
<DT><I>Dihedral charmm is incompatible with Pair style</I>
<DD>Dihedral style charmm must be used with a pair style charmm
in order for the 1-4 epsilon/sigma parameters to be defined.
<DT><I>Dihedral coeff for hybrid has invalid style</I>
<DD>Dihedral style hybrid uses another dihedral style as one of its
coefficients. The dihedral style used in the dihedral_coeff command
or read from a restart file is not recognized.
<DT><I>Dihedral coeffs are not set</I>
<DD>No dihedral coefficients have been assigned in the data file or via
the dihedral_coeff command.
<DT><I>Dihedral style hybrid cannot have hybrid as an argument</I>
<DD>Self-explanatory.
<DT><I>Dihedral style hybrid cannot have none as an argument</I>
<DD>Self-explanatory.
<DT><I>Dihedral style hybrid cannot use same dihedral style twice</I>
<DD>Self-explanatory.
<DT><I>Dihedral_coeff command before dihedral_style is defined</I>
<DD>Coefficients cannot be set in the data file or via the dihedral_coeff
command until an dihedral_style has been assigned.
<DT><I>Dihedral_coeff command before simulation box is defined</I>
<DD>The dihedral_coeff command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>Dihedral_coeff command when no dihedrals allowed</I>
<DD>The chosen atom style does not allow for dihedrals to be defined.
<DT><I>Dihedral_style command when no dihedrals allowed</I>
<DD>The chosen atom style does not allow for dihedrals to be defined.
<DT><I>Dihedrals assigned incorrectly</I>
<DD>Dihedrals read in from the data file were not assigned correctly to
atoms. This means there is something invalid about the topology
definitions.
<DT><I>Dihedrals defined but no dihedral types</I>
<DD>The data file header lists dihedrals but no dihedral types.
<DT><I>Dimension command after simulation box is defined</I>
<DD>The dimension command cannot be used after a read_data,
read_restart, or create_box command.
-<DT><I>Dipole command before simulation box is defined</I>
-
-<DD>The dipole command cannot be used before a read_data,
-read_restart, or create_box command.
-
<DT><I>Displace_atoms command before simulation box is defined</I>
<DD>The displace_atoms command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>Displace_box command before simulation box is defined</I>
<DD>Self-explanatory.
<DT><I>Displace_box tilt factors require triclinic box</I>
<DD>Cannot use tilt factors unless the simulation box is
non-orthogonal.
<DT><I>Distance must be > 0 for compute event/displace</I>
<DD>Self-explanatory.
<DT><I>Divide by 0 in influence function of pair peri/lps</I>
<DD>This should not normally occur. It is likely a problem with your
model.
<DT><I>Divide by 0 in variable formula</I>
<DD>Self-explanatory.
<DT><I>Domain too large for neighbor bins</I>
<DD>The domain has become extremely large so that neighbor bins cannot be
used. Most likely, one or more atoms have been blown out of the
simulation box to a great distance.
-<DT><I>Double precision is not supported on this accelerator.</I>
+<DT><I>Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu</I>
-<DD>In this case, you must compile the GPU library for single precision.
+<DD>UNDOCUMENTED
-<DT><I>Dump cfg and fix not computed at compatible times</I>
+<DT><I>Dump cfg arguments must start with 'id type xs ys zs' or 'id type xsu ysu zsu'</I>
-<DD>The fix must produce per-atom quantities on timesteps that dump cfg
-needs them.
-
-<DT><I>Dump cfg arguments must start with 'id type xs ys zs'</I>
-
-<DD>This is a requirement of the CFG output format.
+<DD>This is a requirement of the CFG output format. :dd
<DT><I>Dump cfg requires one snapshot per file</I>
<DD>Use the wildcard "*" character in the filename.
<DT><I>Dump custom and fix not computed at compatible times</I>
<DD>The fix must produce per-atom quantities on timesteps that dump custom
needs them.
<DT><I>Dump custom compute does not calculate per-atom array</I>
<DD>Self-explanatory.
<DT><I>Dump custom compute does not calculate per-atom vector</I>
<DD>Self-explanatory.
<DT><I>Dump custom compute does not compute per-atom info</I>
<DD>Self-explanatory.
<DT><I>Dump custom compute vector is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Dump custom fix does not compute per-atom array</I>
<DD>Self-explanatory.
<DT><I>Dump custom fix does not compute per-atom info</I>
<DD>Self-explanatory.
<DT><I>Dump custom fix does not compute per-atom vector</I>
<DD>Self-explanatory.
<DT><I>Dump custom fix vector is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Dump custom variable is not atom-style variable</I>
<DD>Only atom-style variables generate per-atom quantities, needed for
dump output.
<DT><I>Dump dcd of non-matching # of atoms</I>
<DD>Every snapshot written by dump dcd must contain the same # of atoms.
<DT><I>Dump dcd requires sorting by atom ID</I>
<DD>Use the dump_modify sort command to enable this.
<DT><I>Dump every variable returned a bad timestep</I>
<DD>The variable must return a timestep greater than the current timestep.
+<DT><I>Dump image bond not allowed with no bond types</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Dump image cannot perform sorting</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Dump image persp option is not yet supported</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Dump image requires one snapshot per file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Dump local and fix not computed at compatible times</I>
<DD>The fix must produce per-atom quantities on timesteps that dump local
needs them.
<DT><I>Dump local attributes contain no compute or fix</I>
<DD>Self-explanatory.
<DT><I>Dump local cannot sort by atom ID</I>
<DD>This is because dump local does not really dump per-atom info.
<DT><I>Dump local compute does not calculate local array</I>
<DD>Self-explanatory.
<DT><I>Dump local compute does not calculate local vector</I>
<DD>Self-explanatory.
<DT><I>Dump local compute does not compute local info</I>
<DD>Self-explanatory.
<DT><I>Dump local compute vector is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Dump local count is not consistent across input fields</I>
<DD>Every column of output must be the same length.
<DT><I>Dump local fix does not compute local array</I>
<DD>Self-explanatory.
<DT><I>Dump local fix does not compute local info</I>
<DD>Self-explanatory.
<DT><I>Dump local fix does not compute local vector</I>
<DD>Self-explanatory.
<DT><I>Dump local fix vector is accessed out-of-range</I>
<DD>Self-explanatory.
+<DT><I>Dump modify bcolor not allowed with no bond types</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Dump modify bdiam not allowed with no bond types</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Dump modify compute ID does not compute per-atom array</I>
<DD>Self-explanatory.
<DT><I>Dump modify compute ID does not compute per-atom info</I>
<DD>Self-explanatory.
<DT><I>Dump modify compute ID does not compute per-atom vector</I>
<DD>Self-explanatory.
<DT><I>Dump modify compute ID vector is not large enough</I>
<DD>Self-explanatory.
<DT><I>Dump modify element names do not match atom types</I>
<DD>Number of element names must equal number of atom types.
<DT><I>Dump modify fix ID does not compute per-atom array</I>
<DD>Self-explanatory.
<DT><I>Dump modify fix ID does not compute per-atom info</I>
<DD>Self-explanatory.
<DT><I>Dump modify fix ID does not compute per-atom vector</I>
<DD>Self-explanatory.
<DT><I>Dump modify fix ID vector is not large enough</I>
<DD>Self-explanatory.
<DT><I>Dump modify variable is not atom-style variable</I>
<DD>Self-explanatory.
<DT><I>Dump sort column is invalid</I>
<DD>Self-explanatory.
<DT><I>Dump xtc requires sorting by atom ID</I>
<DD>Use the dump_modify sort command to enable this.
<DT><I>Dump_modify region ID does not exist</I>
<DD>Self-explanatory.
<DT><I>Dumping an atom property that isn't allocated</I>
<DD>The chosen atom style does not define the per-atom quantity being
dumped.
<DT><I>Dumping an atom quantity that isn't allocated</I>
<DD>Only per-atom quantities that are defined for the atom style being
used are allowed.
<DT><I>Duplicate particle in PeriDynamic bond - simulation box is too small</I>
<DD>This is likely because your box length is shorter than 2 times
the bond length.
<DT><I>Electronic temperature dropped below zero</I>
<DD>Something has gone wrong with the fix ttm electron temperature model.
<DT><I>Empty brackets in variable</I>
<DD>There is no variable syntax that uses empty brackets. Check
the variable doc page.
<DT><I>Energy was not tallied on needed timestep</I>
<DD>You are using a thermo keyword that requires potentials to
have tallied energy, but they didn't on this timestep. See the
variable doc page for ideas on how to make this work.
<DT><I>Expected floating point parameter in input script or data file</I>
<DD>The quantity being read is an integer on non-numeric value.
<DT><I>Expected floating point parameter in variable definition</I>
<DD>The quantity being read is a non-numeric value.
<DT><I>Expected integer parameter in input script or data file</I>
<DD>The quantity being read is a floating point or non-numeric value.
<DT><I>Expected integer parameter in variable definition</I>
<DD>The quantity being read is a floating point or non-numeric value.
-<DT><I>Failed to allocate %d bytes for array %s</I>
+<DT><I>Failed to allocate %ld bytes for array %s</I>
<DD>Your LAMMPS simulation has run out of memory. You need to run a
-smaller simulation or on more processors.
+smaller simulation or on more processors. :dd
-<DT><I>Failed to reallocate %d bytes for array %s</I>
+<DT><I>Failed to reallocate %ld bytes for array %s</I>
<DD>Your LAMMPS simulation has run out of memory. You need to run a
-smaller simulation or on more processors.
+smaller simulation or on more processors. :dd
<DT><I>Fewer SRD bins than processors in some dimension</I>
<DD>This is not allowed. Make your SRD bin size smaller.
<DT><I>Final box dimension due to fix deform is < 0.0</I>
<DD>Self-explanatory.
-<DT><I>Fix gpu split must be positive for hybrid pair styles.</I>
+<DT><I>Fix GCMC incompatible with given pair_style</I>
-<DD>See documentation for fix gpu.
+<DD>UNDOCUMENTED
+
+<DT><I>Fix GCMC molecule command requires atom attribute molecule</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix GCMC molecule feature does not yet work</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix GPU split must be positive for hybrid pair styles</I>
+
+<DD>UNDOCUMENTED
<DT><I>Fix ID for compute atom/molecule does not exist</I>
<DD>Self-explanatory.
<DT><I>Fix ID for compute reduce does not exist</I>
<DD>Self-explanatory.
+<DT><I>Fix ID for compute slice does not exist</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Fix ID for fix ave/atom does not exist</I>
<DD>Self-explanatory.
<DT><I>Fix ID for fix ave/correlate does not exist</I>
<DD>Self-explanatory.
<DT><I>Fix ID for fix ave/histo does not exist</I>
<DD>Self-explanatory.
<DT><I>Fix ID for fix ave/spatial does not exist</I>
<DD>Self-explanatory.
<DT><I>Fix ID for fix ave/time does not exist</I>
<DD>Self-explanatory.
<DT><I>Fix ID for fix store/state does not exist</I>
<DD>Self-explanatory
<DT><I>Fix ID must be alphanumeric or underscore characters</I>
<DD>Self-explanatory.
-<DT><I>Fix SRD cannot have both atom attributes angmom and omega</I>
-
-<DD>Use either spheroid solute particles or fully generalized
-aspherical solute particles.
-
<DT><I>Fix SRD no-slip requires atom attribute torque</I>
<DD>This is because the SRD collisions will impart torque to the solute
particles.
-<DT><I>Fix SRD requires atom attribute angmom or omega</I>
-
-<DD>This is because the SRD collisions with cause the solute particles to
-rotate.
-
-<DT><I>Fix SRD requires atom attribute radius or shape</I>
-
-<DD>This is because the solute particles must be finite-size particles,
-not point particles.
-
<DT><I>Fix SRD: bad bin assignment for SRD advection</I>
<DD>Something has gone wrong in your SRD model; try using more
conservative settings.
<DT><I>Fix SRD: bad search bin assignment</I>
<DD>Something has gone wrong in your SRD model; try using more
conservative settings.
<DT><I>Fix SRD: bad stencil bin for big particle</I>
<DD>Something has gone wrong in your SRD model; try using more
conservative settings.
<DT><I>Fix SRD: too many big particles in bin</I>
<DD>Reset the ATOMPERBIN parameter at the top of fix_srd.cpp
to a larger value, and re-compile the code.
<DT><I>Fix SRD: too many walls in bin</I>
<DD>This should not happen unless your system has been setup incorrectly.
<DT><I>Fix adapt kspace style does not exist</I>
<DD>Self-explanatory.
<DT><I>Fix adapt pair style does not exist</I>
<DD>Self-explanatory
<DT><I>Fix adapt pair style param not supported</I>
<DD>The pair style does not know about the parameter you specified.
<DT><I>Fix adapt requires atom attribute diameter</I>
<DD>The atom style being used does not specify an atom diameter.
<DT><I>Fix adapt type pair range is not valid for pair hybrid sub-style</I>
<DD>Self-explanatory.
<DT><I>Fix ave/atom compute array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Fix ave/atom compute does not calculate a per-atom array</I>
<DD>Self-explanatory.
<DT><I>Fix ave/atom compute does not calculate a per-atom vector</I>
<DD>A compute used by fix ave/atom must generate per-atom values.
<DT><I>Fix ave/atom compute does not calculate per-atom values</I>
<DD>A compute used by fix ave/atom must generate per-atom values.
<DT><I>Fix ave/atom fix array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Fix ave/atom fix does not calculate a per-atom array</I>
<DD>Self-explanatory.
<DT><I>Fix ave/atom fix does not calculate a per-atom vector</I>
<DD>A fix used by fix ave/atom must generate per-atom values.
<DT><I>Fix ave/atom fix does not calculate per-atom values</I>
<DD>A fix used by fix ave/atom must generate per-atom values.
<DT><I>Fix ave/atom variable is not atom-style variable</I>
<DD>A variable used by fix ave/atom must generate per-atom values.
+<DT><I>Fix ave/correlate compute does not calculate a scalar</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix ave/correlate compute does not calculate a vector</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix ave/correlate compute vector is accessed out-of-range</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix ave/correlate fix does not calculate a scalar</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix ave/correlate fix does not calculate a vector</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix ave/correlate fix vector is accessed out-of-range</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix ave/correlate variable is not equal-style variable</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Fix ave/histo cannot input local values in scalar mode</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo cannot input per-atom values in scalar mode</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo compute array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo compute does not calculate a global array</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo compute does not calculate a global scalar</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo compute does not calculate a global vector</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo compute does not calculate a local array</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo compute does not calculate a local vector</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo compute does not calculate a per-atom array</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo compute does not calculate a per-atom vector</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo compute does not calculate local values</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo compute does not calculate per-atom values</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo compute vector is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo fix array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo fix does not calculate a global array</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo fix does not calculate a global scalar</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo fix does not calculate a global vector</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo fix does not calculate a local array</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo fix does not calculate a local vector</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo fix does not calculate a per-atom array</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo fix does not calculate a per-atom vector</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo fix does not calculate local values</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo fix does not calculate per-atom values</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo fix vector is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo input is invalid compute</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo input is invalid fix</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo input is invalid variable</I>
<DD>Self-explanatory.
<DT><I>Fix ave/histo inputs are not all global, peratom, or local</I>
<DD>All inputs in a single fix ave/histo command must be of the
same style.
<DT><I>Fix ave/spatial compute does not calculate a per-atom array</I>
<DD>Self-explanatory.
<DT><I>Fix ave/spatial compute does not calculate a per-atom vector</I>
<DD>A compute used by fix ave/spatial must generate per-atom values.
<DT><I>Fix ave/spatial compute does not calculate per-atom values</I>
<DD>A compute used by fix ave/spatial must generate per-atom values.
<DT><I>Fix ave/spatial compute vector is accessed out-of-range</I>
<DD>The index for the vector is out of bounds.
<DT><I>Fix ave/spatial fix does not calculate a per-atom array</I>
<DD>Self-explanatory.
<DT><I>Fix ave/spatial fix does not calculate a per-atom vector</I>
<DD>A fix used by fix ave/spatial must generate per-atom values.
<DT><I>Fix ave/spatial fix does not calculate per-atom values</I>
<DD>A fix used by fix ave/spatial must generate per-atom values.
<DT><I>Fix ave/spatial fix vector is accessed out-of-range</I>
<DD>The index for the vector is out of bounds.
<DT><I>Fix ave/spatial for triclinic boxes requires units reduced</I>
<DD>Self-explanatory.
<DT><I>Fix ave/spatial settings invalid with changing box</I>
<DD>If the ave setting is "running" or "window" and the box size/shape
changes during the simulation, then the units setting must be
"reduced", else the number of bins may change.
<DT><I>Fix ave/spatial variable is not atom-style variable</I>
<DD>A variable used by fix ave/spatial must generate per-atom values.
<DT><I>Fix ave/time cannot set output array intensive/extensive from these inputs</I>
<DD>One of more of the vector inputs has individual elements which are
flagged as intensive or extensive. Such an input cannot be flagged as
all intensive/extensive when turned into an array by fix ave/time.
<DT><I>Fix ave/time cannot use variable with vector mode</I>
<DD>Variables produce scalar values.
<DT><I>Fix ave/time columns are inconsistent lengths</I>
<DD>Self-explanatory.
<DT><I>Fix ave/time compute array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Fix ave/time compute does not calculate a scalar</I>
<DD>Only computes that calculate a scalar or vector quantity (not a
per-atom quantity) can be used with fix ave/time.
<DT><I>Fix ave/time compute does not calculate a vector</I>
<DD>Only computes that calculate a scalar or vector quantity (not a
per-atom quantity) can be used with fix ave/time.
<DT><I>Fix ave/time compute does not calculate an array</I>
<DD>Self-explanatory.
<DT><I>Fix ave/time compute vector is accessed out-of-range</I>
<DD>The index for the vector is out of bounds.
<DT><I>Fix ave/time fix array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Fix ave/time fix does not calculate a scalar</I>
<DD>A fix used by fix ave/time must generate global values.
<DT><I>Fix ave/time fix does not calculate a vector</I>
<DD>A fix used by fix ave/time must generate global values.
<DT><I>Fix ave/time fix does not calculate an array</I>
<DD>Self-explanatory.
<DT><I>Fix ave/time fix vector is accessed out-of-range</I>
<DD>The index for the vector is out of bounds.
<DT><I>Fix ave/time variable is not equal-style variable</I>
<DD>A variable used by fix ave/time must generate a global value.
<DT><I>Fix bond/break requires special_bonds = 0,1,1</I>
<DD>This is a restriction of the current fix bond/break implementation.
<DT><I>Fix bond/create cutoff is longer than pairwise cutoff</I>
<DD>This is not allowed because bond creation is done using the
pairwise neighbor list.
<DT><I>Fix bond/create requires special_bonds coul = 0,1,1</I>
<DD>Self-explanatory.
<DT><I>Fix bond/create requires special_bonds lj = 0,1,1</I>
<DD>Self-explanatory.
<DT><I>Fix bond/swap cannot use dihedral or improper styles</I>
<DD>These styles cannot be defined when using this fix.
<DT><I>Fix bond/swap requires pair and bond styles</I>
<DD>Self-explanatory.
<DT><I>Fix bond/swap requires special_bonds = 0,1,1</I>
<DD>Self-explanatory.
<DT><I>Fix box/relax generated negative box length</I>
<DD>The pressure being applied is likely too large. Try applying
it incrementally, to build to the high pressure.
<DT><I>Fix command before simulation box is defined</I>
<DD>The fix command cannot be used before a read_data, read_restart, or
create_box command.
<DT><I>Fix deform is changing yz by too much with changing xy</I>
<DD>When both yz and xy are changing, it induces changes in xz if the
box must flip from one tilt extreme to another. Thus it is not
allowed for yz to grow so much that a flip is induced.
<DT><I>Fix deform tilt factors require triclinic box</I>
<DD>Cannot deform the tilt factors of a simulation box unless it
is a triclinic (non-orthogonal) box.
<DT><I>Fix deform volume setting is invalid</I>
<DD>Cannot use volume style unless other dimensions are being controlled.
<DT><I>Fix deposit region cannot be dynamic</I>
<DD>Only static regions can be used with fix deposit.
<DT><I>Fix deposit region does not support a bounding box</I>
<DD>Not all regions represent bounded volumes. You cannot use
such a region with the fix deposit command.
<DT><I>Fix efield requires atom attribute q</I>
<DD>Self-explanatory.
<DT><I>Fix evaporate molecule requires atom attribute molecule</I>
<DD>The atom style being used does not define a molecule ID.
<DT><I>Fix external callback function not set</I>
<DD>This must be done by an external program in order to use this fix.
<DT><I>Fix for fix ave/atom not computed at compatible time</I>
<DD>Fixes generate their values on specific timesteps. Fix ave/atom is
requesting a value on a non-allowed timestep.
<DT><I>Fix for fix ave/correlate not computed at compatible time</I>
<DD>Fixes generate their values on specific timesteps. Fix ave/correlate
is requesting a value on a non-allowed timestep.
<DT><I>Fix for fix ave/histo not computed at compatible time</I>
<DD>Fixes generate their values on specific timesteps. Fix ave/histo is
requesting a value on a non-allowed timestep.
<DT><I>Fix for fix ave/spatial not computed at compatible time</I>
<DD>Fixes generate their values on specific timesteps. Fix ave/spatial is
requesting a value on a non-allowed timestep.
<DT><I>Fix for fix ave/time not computed at compatible time</I>
<DD>Fixes generate their values on specific timesteps. Fix ave/time
is requesting a value on a non-allowed timestep.
<DT><I>Fix for fix store/state not computed at compatible time</I>
<DD>Fixes generate their values on specific timesteps. Fix store/state
is requesting a value on a non-allowed timestep.
<DT><I>Fix freeze requires atom attribute torque</I>
<DD>The atom style defined does not have this attribute.
<DT><I>Fix heat group has no atoms</I>
<DD>Self-explanatory.
<DT><I>Fix heat kinetic energy went negative</I>
<DD>This will cause the velocity rescaling about to be performed by fix
heat to be invalid.
<DT><I>Fix in variable not computed at compatible time</I>
<DD>Fixes generate their values on specific timesteps. The variable is
requesting the values on a non-allowed timestep.
+<DT><I>Fix langevin angmom require atom style ellipsoid</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix langevin angmom requires atom style ellipsoid</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix langevin angmom requires extended particles</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix langevin omega require atom style sphere</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix langevin omega requires extended particles</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Fix langevin period must be > 0.0</I>
<DD>The time window for temperature relaxation must be > 0
+<DT><I>Fix langevin variable returned negative temperature</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Fix momentum group has no atoms</I>
<DD>Self-explanatory.
<DT><I>Fix move cannot define z or vz variable for 2d problem</I>
<DD>Self-explanatory.
<DT><I>Fix move cannot have 0 length rotation vector</I>
<DD>Self-explanatory.
<DT><I>Fix move cannot rotate aroung non z-axis for 2d problem</I>
<DD>Self-explanatory.
<DT><I>Fix move cannot set linear z motion for 2d problem</I>
<DD>Self-explanatory.
<DT><I>Fix move cannot set wiggle z motion for 2d problem</I>
<DD>Self-explanatory.
<DT><I>Fix msst compute ID does not compute potential energy</I>
<DD>Self-explanatory.
<DT><I>Fix msst compute ID does not compute pressure</I>
<DD>Self-explanatory.
<DT><I>Fix msst compute ID does not compute temperature</I>
<DD>Self-explanatory.
<DT><I>Fix msst requires a periodic box</I>
<DD>Self-explanatory.
<DT><I>Fix msst tscale must satisfy 0 <= tscale < 1</I>
<DD>Self-explanatory.
-<DT><I>Fix npt/nph has tilted box too far - box flips are not yet implemented</I>
+<DT><I>Fix npt/nph has tilted box too far in one step - periodic cell is too far from equilibrium state</I>
-<DD>This feature has not yet been added. However, if you are applying
-an off-diagonal pressure to a fluid, the box may want to tilt indefinitely,
-because the fluid cannot support the pressure you are imposing.
+<DD>UNDOCUMENTED
-<DT><I>Fix nve/asphere cannot be used with atom attributes diameter or rmass</I>
+<DT><I>Fix nve/asphere requires extended particles</I>
-<DD>These attributes override the shape and mass settings, so cannot be
-used.
+<DD>This fix can only be used for particles with a shape setting.
-<DT><I>Fix nve/asphere requires atom attributes angmom, quat, torque, shape</I>
+<DT><I>Fix nve/asphere/noforce requires atom style ellipsoid</I>
-<DD>An atom style that specifies these quantities is needed.
+<DD>UNDOCUMENTED
-<DT><I>Fix nve/asphere requires extended particles</I>
+<DT><I>Fix nve/asphere/noforce requires extended particles</I>
-<DD>This fix can only be used for particles with a shape setting.
+<DD>UNDOCUMENTED
+
+<DT><I>Fix nve/line can only be used for 2d simulations</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix nve/line can only be used for 3d simulations</I>
-<DT><I>Fix nve/sphere requires atom attribute diameter or shape</I>
+<DD>UNDOCUMENTED
-<DD>An atom style that specifies these quantities is needed.
+<DT><I>Fix nve/line requires atom style line</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix nve/line requires line particles</I>
+
+<DD>UNDOCUMENTED
<DT><I>Fix nve/sphere requires atom attribute mu</I>
<DD>An atom style with this attribute is needed.
-<DT><I>Fix nve/sphere requires atom attributes omega, torque</I>
+<DT><I>Fix nve/sphere requires atom style sphere</I>
-<DD>An atom style with these attributes is needed.
+<DD>UNDOCUMENTED
<DT><I>Fix nve/sphere requires extended particles</I>
<DD>This fix can only be used for particles of a finite size.
-<DT><I>Fix nve/sphere requires spherical particle shapes</I>
-
-<DD>Self-explanatory.
-
-<DT><I>Fix nvt/nph/npt asphere cannot be used with atom attributes diameter or rmass</I>
+<DT><I>Fix nve/tri requires atom style tri</I>
-<DD>Those attributes are for spherical particles.
+<DD>UNDOCUMENTED
-<DT><I>Fix nvt/nph/npt asphere requires atom attributes quat, angmom, torque, shape</I>
+<DT><I>Fix nve/tri requires tri particles</I>
-<DD>Those attributes are what are used to define aspherical particles.
+<DD>UNDOCUMENTED
<DT><I>Fix nvt/nph/npt asphere requires extended particles</I>
<DD>The shape setting for a particle in the fix group has shape = 0.0,
which means it is a point particle.
-<DT><I>Fix nvt/nph/npt sphere requires atom attribute diameter or shape</I>
-
-<DD>An atom style that specifies these quantities is needed.
-
-<DT><I>Fix nvt/nph/npt sphere requires atom attributes omega, torque</I>
+<DT><I>Fix nvt/nph/npt sphere requires atom style sphere</I>
-<DD>Those attributes are what are used to define spherical particles.
+<DD>UNDOCUMENTED
<DT><I>Fix nvt/npt/nph damping parameters must be > 0.0</I>
<DD>Self-explanatory.
<DT><I>Fix nvt/sphere requires extended particles</I>
<DD>This fix can only be used for particles of a finite size.
-<DT><I>Fix nvt/sphere requires spherical particle shapes</I>
-
-<DD>Self-explanatory.
-
<DT><I>Fix orient/fcc file open failed</I>
<DD>The fix orient/fcc command could not open a specified file.
<DT><I>Fix orient/fcc file read failed</I>
<DD>The fix orient/fcc command could not read the needed parameters from a
specified file.
<DT><I>Fix orient/fcc found self twice</I>
<DD>The neighbor lists used by fix orient/fcc are messed up. If this
error occurs, it is likely a bug, so send an email to the
<A HREF = "http://lammps.sandia.gov/authors.html">developers</A>.
<DT><I>Fix peri neigh does not exist</I>
<DD>Somehow a fix that the pair style defines has been deleted.
<DT><I>Fix pour region ID does not exist</I>
<DD>Self-explanatory.
<DT><I>Fix pour region cannot be dynamic</I>
<DD>Only static regions can be used with fix pour.
<DT><I>Fix pour region does not support a bounding box</I>
<DD>Not all regions represent bounded volumes. You cannot use
such a region with the fix pour command.
<DT><I>Fix pour requires atom attributes radius, rmass</I>
<DD>The atom style defined does not have these attributes.
<DT><I>Fix press/berendsen damping parameters must be > 0.0</I>
<DD>Self-explanatory.
<DT><I>Fix qeq/comb group has no atoms</I>
<DD>Self-explanatory.
<DT><I>Fix qeq/comb requires atom attribute q</I>
<DD>An atom style with charge must be used to perform charge equilibration.
<DT><I>Fix reax/bonds numbonds > nsbmax_most</I>
<DD>The limit of the number of bonds expected by the ReaxFF force field
was exceeded.
<DT><I>Fix recenter group has no atoms</I>
<DD>Self-explanatory.
+<DT><I>Fix restrain requires an atom map, see atom_modify</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Fix rigid atom has non-zero image flag in a non-periodic dimension</I>
<DD>You cannot set image flags for non-periodic dimensions.
+<DT><I>Fix rigid langevin period must be > 0.0</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Fix rigid molecule requires atom attribute molecule</I>
<DD>Self-explanatory.
-<DT><I>Fix rigid/nvt period must be > 0.0</I>
+<DT><I>Fix rigid xy torque cannot be on for 2d simulation</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix rigid z force cannot be on for 2d simulation</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Fix rigid/nvt period must be > 0.0</I>
<DD>Self-explanatory
<DT><I>Fix rigid: Bad principal moments</I>
<DD>The principal moments of inertia computed for a rigid body
are not within the required tolerances.
<DT><I>Fix shake cannot be used with minimization</I>
<DD>Cannot use fix shake while doing an energy minimization since
it turns off bonds that should contribute to the energy.
<DT><I>Fix spring couple group ID does not exist</I>
<DD>Self-explanatory.
<DT><I>Fix srd lamda must be >= 0.6 of SRD grid size</I>
<DD>This is a requirement for accuracy reasons.
<DT><I>Fix srd requires SRD particles all have same mass</I>
<DD>Self-explanatory.
<DT><I>Fix srd requires ghost atoms store velocity</I>
<DD>Use the communicate vel yes command to enable this.
<DT><I>Fix srd requires newton pair on</I>
<DD>Self-explanatory.
<DT><I>Fix store/state compute array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Fix store/state compute does not calculate a per-atom array</I>
<DD>The compute calculates a per-atom vector.
<DT><I>Fix store/state compute does not calculate a per-atom vector</I>
<DD>The compute calculates a per-atom vector.
<DT><I>Fix store/state compute does not calculate per-atom values</I>
<DD>Computes that calculate global or local quantities cannot be used
with fix store/state.
<DT><I>Fix store/state fix array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Fix store/state fix does not calculate a per-atom array</I>
<DD>The fix calculates a per-atom vector.
<DT><I>Fix store/state fix does not calculate a per-atom vector</I>
<DD>The fix calculates a per-atom array.
<DT><I>Fix store/state fix does not calculate per-atom values</I>
<DD>Fixes that calculate global or local quantities cannot be used with
fix store/state.
<DT><I>Fix store/state for atom property that isn't allocated</I>
<DD>Self-explanatory.
<DT><I>Fix store/state variable is not atom-style variable</I>
<DD>Only atom-style variables calculate per-atom quantities.
<DT><I>Fix temp/berendsen period must be > 0.0</I>
<DD>Self-explanatory.
<DT><I>Fix thermal/conductivity swap value must be positive</I>
<DD>Self-explanatory.
<DT><I>Fix tmd must come after integration fixes</I>
<DD>Any fix tmd command must appear in the input script after all time
integration fixes (nve, nvt, npt). See the fix tmd documentation for
details.
<DT><I>Fix ttm electron temperatures must be > 0.0</I>
<DD>Self-explanatory.
<DT><I>Fix ttm electronic_density must be > 0.0</I>
<DD>Self-explanatory.
<DT><I>Fix ttm electronic_specific_heat must be > 0.0</I>
<DD>Self-explanatory.
<DT><I>Fix ttm electronic_thermal_conductivity must be >= 0.0</I>
<DD>Self-explanatory.
<DT><I>Fix ttm gamma_p must be > 0.0</I>
<DD>Self-explanatory.
<DT><I>Fix ttm gamma_s must be >= 0.0</I>
<DD>Self-explanatory.
<DT><I>Fix ttm number of nodes must be > 0</I>
<DD>Self-explanatory.
<DT><I>Fix ttm v_0 must be >= 0.0</I>
<DD>Self-explanatory.
<DT><I>Fix used in compute atom/molecule not computed at compatible time</I>
<DD>The fix must produce per-atom quantities on timesteps that the compute
needs them.
<DT><I>Fix used in compute reduce not computed at compatible time</I>
<DD>Fixes generate their values on specific timesteps. Compute sum is
requesting a value on a non-allowed timestep.
+<DT><I>Fix used in compute slice not computed at compatible time</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Fix viscosity swap value must be positive</I>
<DD>Self-explanatory.
<DT><I>Fix viscosity vtarget value must be positive</I>
<DD>Self-explanatory.
<DT><I>Fix wall cutoff <= 0.0</I>
<DD>Self-explanatory.
-<DT><I>Fix wall/colloid cannot be used with atom attribute diameter</I>
-
-<DD>Only finite-size particles defined by the shape command can be used.
+<DT><I>Fix wall/colloid requires atom style sphere</I>
-<DT><I>Fix wall/colloid requires atom attribute shape</I>
-
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
<DT><I>Fix wall/colloid requires extended particles</I>
<DD>Self-explanatory.
-<DT><I>Fix wall/colloid requires spherical particles</I>
-
-<DD>Self-explanatory.
-
<DT><I>Fix wall/gran is incompatible with Pair style</I>
<DD>Must use a granular pair style to define the parameters needed for
this fix.
-<DT><I>Fix wall/gran requires atom attributes radius, omega, torque</I>
+<DT><I>Fix wall/gran requires atom style sphere</I>
-<DD>The atom style defined does not have these attributes.
+<DD>UNDOCUMENTED
-<DT><I>Fix wall/region colloid cannot be used with atom attribute diameter</I>
+<DT><I>Fix wall/piston command only available at zlo</I>
-<DD>Only finite-size particles defined by the shape command can be used.
+<DD>UNDOCUMENTED
-<DT><I>Fix wall/region colloid requires atom attribute shape</I>
+<DT><I>Fix wall/region colloid requires atom style sphere</I>
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
<DT><I>Fix wall/region colloid requires extended particles</I>
<DD>Self-explanatory.
-<DT><I>Fix wall/region colloid requires spherical particles</I>
-
-<DD>Self-explanatory.
-
<DT><I>Fix wall/region cutoff <= 0.0</I>
<DD>Self-explanatory.
<DT><I>Fix_modify order must be 3 or 5</I>
<DD>Self-explanatory.
<DT><I>Fix_modify pressure ID does not compute pressure</I>
<DD>The compute ID assigned to the fix must compute pressure.
<DT><I>Fix_modify temperature ID does not compute temperature</I>
<DD>The compute ID assigned to the fix must compute temperature.
<DT><I>Found no restart file matching pattern</I>
<DD>When using a "*" in the restart file name, no matching file was found.
-<DT><I>GPU is not the first fix for this run</I>
-
-<DD>This is the way the fix must be defined in your input script.
-
-<DT><I>GPU library not compiled for this accelerator</I>
-
-<DD>The GPU library was not built for your accelerator. Check the arch flag in
-lib/gpu.
-
<DT><I>Gmask function in equal-style variable formula</I>
<DD>Gmask is per-atom operation.
<DT><I>Gravity changed since fix pour was created</I>
<DD>Gravity must be static and not dynamic for use with fix pour.
<DT><I>Gravity must point in -y to use with fix pour in 2d</I>
<DD>Gravity must be pointing "down" in a 2d box.
<DT><I>Gravity must point in -z to use with fix pour in 3d</I>
<DD>Gravity must be pointing "down" in a 3d box, i.e. theta = 180.0.
<DT><I>Grmask function in equal-style variable formula</I>
<DD>Grmask is per-atom operation.
<DT><I>Group ID does not exist</I>
<DD>A group ID used in the group command does not exist.
<DT><I>Group ID in variable formula does not exist</I>
<DD>Self-explanatory.
<DT><I>Group command before simulation box is defined</I>
<DD>The group command cannot be used before a read_data, read_restart, or
create_box command.
<DT><I>Group region ID does not exist</I>
<DD>A region ID used in the group command does not exist.
+<DT><I>Illega dump_modify command</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Illegal ... command</I>
<DD>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.
<DT><I>Illegal COMB parameter</I>
<DD>One or more of the coefficients defined in the potential file is
invalid.
<DT><I>Illegal Stillinger-Weber parameter</I>
<DD>One or more of the coefficients defined in the potential file is
invalid.
<DT><I>Illegal Tersoff parameter</I>
<DD>One or more of the coefficients defined in the potential file is
invalid.
-<DT><I>Illegal chemical element names</I>
+<DT><I>Illegal fix wall/piston velocity</I>
-<DD>The name is too long to be a chemical element.
+<DD>UNDOCUMENTED
-<DT><I>Illegal fix gpu command</I>
+<DT><I>Illegal integrate style</I>
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
<DT><I>Illegal number of angle table entries</I>
<DD>There must be at least 2 table entries.
<DT><I>Illegal number of bond table entries</I>
<DD>There must be at least 2 table entries.
<DT><I>Illegal number of pair table entries</I>
<DD>There must be at least 2 table entries.
<DT><I>Illegal simulation box</I>
<DD>The lower bound of the simulation box is greater than the upper bound.
<DT><I>Improper atom missing in delete_bonds</I>
<DD>The delete_bonds command cannot find one or more atoms in a particular
improper on a particular processor. The pairwise cutoff is too short
or the atoms are too far apart to make a valid improper.
<DT><I>Improper atom missing in set command</I>
<DD>The set command cannot find one or more atoms in a particular improper
on a particular processor. The pairwise cutoff is too short or the
atoms are too far apart to make a valid improper.
-<DT><I>Improper atoms %d %d %d %d missing on proc %d at step</I>
+<DT><I>Improper atoms %d %d %d %d missing on proc %d at step %ld</I>
<DD>One or more of 4 atoms needed to compute a particular improper are
missing on this processor. Typically this is because the pairwise
cutoff is set too short or the improper has blown apart and an atom is
-too far away.
+too far away. :dd
<DT><I>Improper coeff for hybrid has invalid style</I>
<DD>Improper style hybrid uses another improper style as one of its
coefficients. The improper style used in the improper_coeff command
or read from a restart file is not recognized.
<DT><I>Improper coeffs are not set</I>
<DD>No improper coefficients have been assigned in the data file or via
the improper_coeff command.
<DT><I>Improper style hybrid cannot have hybrid as an argument</I>
<DD>Self-explanatory.
<DT><I>Improper style hybrid cannot have none as an argument</I>
<DD>Self-explanatory.
<DT><I>Improper style hybrid cannot use same improper style twice</I>
<DD>Self-explanatory.
<DT><I>Improper_coeff command before improper_style is defined</I>
<DD>Coefficients cannot be set in the data file or via the improper_coeff
command until an improper_style has been assigned.
<DT><I>Improper_coeff command before simulation box is defined</I>
<DD>The improper_coeff command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>Improper_coeff command when no impropers allowed</I>
<DD>The chosen atom style does not allow for impropers to be defined.
<DT><I>Improper_style command when no impropers allowed</I>
<DD>The chosen atom style does not allow for impropers to be defined.
<DT><I>Impropers assigned incorrectly</I>
<DD>Impropers read in from the data file were not assigned correctly to
atoms. This means there is something invalid about the topology
definitions.
<DT><I>Impropers defined but no improper types</I>
<DD>The data file header lists improper but no improper types.
<DT><I>Inconsistent iparam/jparam values in fix bond/create command</I>
<DD>If itype and jtype are the same, then their maxbond and newtype
settings must also be the same.
+<DT><I>Inconsistent line segment in data file</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Inconsistent triangle in data file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Incorrect args for angle coefficients</I>
<DD>Self-explanatory. Check the input script or data file.
<DT><I>Incorrect args for bond coefficients</I>
<DD>Self-explanatory. Check the input script or data file.
<DT><I>Incorrect args for dihedral coefficients</I>
<DD>Self-explanatory. Check the input script or data file.
<DT><I>Incorrect args for improper coefficients</I>
<DD>Self-explanatory. Check the input script or data file.
<DT><I>Incorrect args for pair coefficients</I>
<DD>Self-explanatory. Check the input script or data file.
<DT><I>Incorrect args in pair_style command</I>
<DD>Self-explanatory.
<DT><I>Incorrect atom format in data file</I>
<DD>Number of values per atom line in the data file is not consistent with
the atom style.
+<DT><I>Incorrect bonus data format in data file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Incorrect boundaries with slab Ewald</I>
<DD>Must have periodic x,y dimensions and non-periodic z dimension to use
2d slab option with Ewald.
<DT><I>Incorrect boundaries with slab PPPM</I>
<DD>Must have periodic x,y dimensions and non-periodic z dimension to use
2d slab option with PPPM.
+<DT><I>Incorrect element names in ADP potential file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Incorrect element names in EAM potential file</I>
<DD>The element names in the EAM file do not match those requested.
<DT><I>Incorrect format in COMB potential file</I>
<DD>Incorrect number of words per line in the potential file.
<DT><I>Incorrect format in MEAM potential file</I>
<DD>Incorrect number of words per line in the potential file.
<DT><I>Incorrect format in NEB coordinate file</I>
<DD>Self-explanatory.
<DT><I>Incorrect format in Stillinger-Weber potential file</I>
<DD>Incorrect number of words per line in the potential file.
<DT><I>Incorrect format in TMD target file</I>
<DD>Format of file read by fix tmd command is incorrect.
<DT><I>Incorrect format in Tersoff potential file</I>
<DD>Incorrect number of words per line in the potential file.
<DT><I>Incorrect multiplicity arg for dihedral coefficients</I>
<DD>Self-explanatory. Check the input script or data file.
<DT><I>Incorrect sign arg for dihedral coefficients</I>
<DD>Self-explanatory. Check the input script or data file.
<DT><I>Incorrect velocity format in data file</I>
<DD>Each atom style defines a format for the Velocity section
of the data file. The read-in lines do not match.
<DT><I>Incorrect weight arg for dihedral coefficients</I>
<DD>Self-explanatory. Check the input script or data file.
<DT><I>Index between variable brackets must be positive</I>
<DD>Self-explanatory.
<DT><I>Indexed per-atom vector in variable formula without atom map</I>
<DD>Accessing a value from an atom vector requires the ability to lookup
an atom index, which is provided by an atom map. An atom map does not
exist (by default) for non-molecular problems. Using the atom_modify
map command will force an atom map to be created.
<DT><I>Induced tilt by displace_box is too large</I>
<DD>The final tilt value must be between -1/2 and 1/2 of the perpendicular
box length.
<DT><I>Initial temperatures not all set in fix ttm</I>
<DD>Self-explantory.
<DT><I>Input line too long after variable substitution</I>
<DD>This is a hard (very large) limit defined in the input.cpp file.
<DT><I>Input line too long: %s</I>
<DD>This is a hard (very large) limit defined in the input.cpp file.
<DT><I>Insertion region extends outside simulation box</I>
<DD>Region specified with fix pour command extends outside the global
simulation box.
<DT><I>Insufficient Jacobi rotations for POEMS body</I>
<DD>Eigensolve for rigid body was not sufficiently accurate.
<DT><I>Insufficient Jacobi rotations for rigid body</I>
<DD>Eigensolve for rigid body was not sufficiently accurate.
-<DT><I>Insufficient memory on accelerator. </I>
+<DT><I>Insufficient Jacobi rotations for triangle</I>
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
+
+<DT><I>Invalid -reorder N value</I>
+
+<DD>UNDOCUMENTED
<DT><I>Invalid Boolean syntax in if command</I>
<DD>Self-explanatory.
<DT><I>Invalid REAX atom type</I>
<DD>There is a mis-match between LAMMPS atom types and the elements
listed in the ReaxFF force field file.
<DT><I>Invalid angle style</I>
<DD>The choice of angle style is unknown.
<DT><I>Invalid angle table length</I>
<DD>Length must be 2 or greater.
<DT><I>Invalid angle type in Angles section of data file</I>
<DD>Angle type must be positive integer and within range of specified angle
types.
<DT><I>Invalid angle type index for fix shake</I>
<DD>Self-explanatory.
+<DT><I>Invalid argument for fix nphug</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Invalid atom ID in Angles section of data file</I>
<DD>Atom IDs must be positive integers and within range of defined
atoms.
<DT><I>Invalid atom ID in Atoms section of data file</I>
<DD>Atom IDs must be positive integers.
<DT><I>Invalid atom ID in Bonds section of data file</I>
<DD>Atom IDs must be positive integers and within range of defined
atoms.
+<DT><I>Invalid atom ID in Bonus section of data file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Invalid atom ID in Dihedrals section of data file</I>
<DD>Atom IDs must be positive integers and within range of defined
atoms.
<DT><I>Invalid atom ID in Impropers section of data file</I>
<DD>Atom IDs must be positive integers and within range of defined
atoms.
<DT><I>Invalid atom ID in Velocities section of data file</I>
<DD>Atom IDs must be positive integers and within range of defined
atoms.
<DT><I>Invalid atom mass for fix shake</I>
<DD>Mass specified in fix shake command must be > 0.0.
<DT><I>Invalid atom style</I>
<DD>The choice of atom style is unknown.
<DT><I>Invalid atom type in Atoms section of data file</I>
<DD>Atom types must range from 1 to specified # of types.
<DT><I>Invalid atom type in create_atoms command</I>
<DD>The create_box command specified the range of valid atom types.
An invalid type is being requested.
+<DT><I>Invalid atom type in fix GCMC command</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Invalid atom type in fix bond/create command</I>
<DD>Self-explanatory.
<DT><I>Invalid atom type in neighbor exclusion list</I>
<DD>Atom types must range from 1 to Ntypes inclusive.
<DT><I>Invalid atom type index for fix shake</I>
<DD>Atom types must range from 1 to Ntypes inclusive.
<DT><I>Invalid atom types in pair_write command</I>
<DD>Atom types must range from 1 to Ntypes inclusive.
<DT><I>Invalid atom vector in variable formula</I>
<DD>The atom vector is not recognized.
<DT><I>Invalid attribute in dump custom command</I>
<DD>Self-explantory.
<DT><I>Invalid attribute in dump local command</I>
<DD>Self-explantory.
<DT><I>Invalid attribute in dump modify command</I>
<DD>Self-explantory.
<DT><I>Invalid bond style</I>
<DD>The choice of bond style is unknown.
<DT><I>Invalid bond table length</I>
<DD>Length must be 2 or greater.
<DT><I>Invalid bond type in Bonds section of data file</I>
<DD>Bond type must be positive integer and within range of specified bond
types.
<DT><I>Invalid bond type in fix bond/break command</I>
<DD>Self-explanatory.
<DT><I>Invalid bond type in fix bond/create command</I>
<DD>Self-explanatory.
<DT><I>Invalid bond type index for fix shake</I>
<DD>Self-explanatory. Check the fix shake command in the input script.
<DT><I>Invalid coeffs for this dihedral style</I>
<DD>Cannot set class 2 coeffs in data file for this dihedral style.
+<DT><I>Invalid color in dump_modify command</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Invalid color map in dump_modify command</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Invalid command-line argument</I>
<DD>One or more command-line arguments is invalid. Check the syntax of
the command you are using to launch LAMMPS.
<DT><I>Invalid compute ID in variable formula</I>
<DD>The compute is not recognized.
<DT><I>Invalid compute style</I>
<DD>Self-explanatory.
<DT><I>Invalid cutoff in communicate command</I>
<DD>Specified cutoff must be >= 0.0.
<DT><I>Invalid cutoffs in pair_write command</I>
<DD>Inner cutoff must be larger than 0.0 and less than outer cutoff.
<DT><I>Invalid d1 or d2 value for pair colloid coeff</I>
<DD>Neither d1 or d2 can be < 0.
<DT><I>Invalid data file section: Angle Coeffs</I>
<DD>Atom style does not allow angles.
<DT><I>Invalid data file section: AngleAngle Coeffs</I>
<DD>Atom style does not allow impropers.
<DT><I>Invalid data file section: AngleAngleTorsion Coeffs</I>
<DD>Atom style does not allow dihedrals.
<DT><I>Invalid data file section: AngleTorsion Coeffs</I>
<DD>Atom style does not allow dihedrals.
<DT><I>Invalid data file section: Angles</I>
<DD>Atom style does not allow angles.
<DT><I>Invalid data file section: Bond Coeffs</I>
<DD>Atom style does not allow bonds.
<DT><I>Invalid data file section: BondAngle Coeffs</I>
<DD>Atom style does not allow angles.
<DT><I>Invalid data file section: BondBond Coeffs</I>
<DD>Atom style does not allow angles.
<DT><I>Invalid data file section: BondBond13 Coeffs</I>
<DD>Atom style does not allow dihedrals.
<DT><I>Invalid data file section: Bonds</I>
<DD>Atom style does not allow bonds.
<DT><I>Invalid data file section: Dihedral Coeffs</I>
<DD>Atom style does not allow dihedrals.
<DT><I>Invalid data file section: Dihedrals</I>
<DD>Atom style does not allow dihedrals.
+<DT><I>Invalid data file section: Ellipsoids</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Invalid data file section: EndBondTorsion Coeffs</I>
<DD>Atom style does not allow dihedrals.
<DT><I>Invalid data file section: Improper Coeffs</I>
<DD>Atom style does not allow impropers.
<DT><I>Invalid data file section: Impropers</I>
<DD>Atom style does not allow impropers.
+<DT><I>Invalid data file section: Lines</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Invalid data file section: MiddleBondTorsion Coeffs</I>
<DD>Atom style does not allow dihedrals.
+<DT><I>Invalid data file section: Triangles</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Invalid delta_conf in tad command</I>
<DD>The value must be between 0 and 1 inclusive.
<DT><I>Invalid density in Atoms section of data file</I>
<DD>Density value cannot be <= 0.0.
+<DT><I>Invalid diameter in set command</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Invalid dihedral style</I>
<DD>The choice of dihedral style is unknown.
<DT><I>Invalid dihedral type in Dihedrals section of data file</I>
<DD>Dihedral type must be positive integer and within range of specified
dihedral types.
-<DT><I>Invalid dipole line in data file</I>
+<DT><I>Invalid dipole length in set command</I>
-<DD>Self-explanatory.
-
-<DT><I>Invalid dipole value</I>
-
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
<DT><I>Invalid dump dcd filename</I>
<DD>Filenames used with the dump dcd style cannot be binary or compressed
or cause multiple files to be written.
<DT><I>Invalid dump frequency</I>
<DD>Dump frequency must be 1 or greater.
+<DT><I>Invalid dump image color range</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Invalid dump image element name</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Invalid dump image filename</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Invalid dump image persp value</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Invalid dump image theta value</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Invalid dump image up vector</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Invalid dump image zoom value</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Invalid dump style</I>
<DD>The choice of dump style is unknown.
<DT><I>Invalid dump xtc filename</I>
<DD>Filenames used with the dump xtc style cannot be binary or compressed
or cause multiple files to be written.
<DT><I>Invalid dump xyz filename</I>
<DD>Filenames used with the dump xyz style cannot be binary or cause files
to be written by each processor.
<DT><I>Invalid dump_modify threshhold operator</I>
<DD>Operator keyword used for threshold specification in not recognized.
+<DT><I>Invalid entry in reorder file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Invalid fix ID in variable formula</I>
<DD>The fix is not recognized.
<DT><I>Invalid fix ave/time off column</I>
<DD>Self-explantory.
<DT><I>Invalid fix box/relax command for a 2d simulation</I>
<DD>Fix box/relax styles involving the z dimension cannot be used in
a 2d simulation.
<DT><I>Invalid fix box/relax command pressure settings</I>
<DD>If multiple dimensions are coupled, those dimensions must be specified.
<DT><I>Invalid fix box/relax pressure settings</I>
<DD>Settings for coupled dimensions must be the same.
<DT><I>Invalid fix nvt/npt/nph command for a 2d simulation</I>
<DD>Cannot control z dimension in a 2d model.
<DT><I>Invalid fix nvt/npt/nph command pressure settings</I>
<DD>If multiple dimensions are coupled, those dimensions must be
specified.
<DT><I>Invalid fix nvt/npt/nph pressure settings</I>
<DD>Settings for coupled dimensions must be the same.
<DT><I>Invalid fix press/berendsen for a 2d simulation</I>
<DD>The z component of pressure cannot be controlled for a 2d model.
<DT><I>Invalid fix press/berendsen pressure settings</I>
<DD>Settings for coupled dimensions must be the same.
<DT><I>Invalid fix style</I>
<DD>The choice of fix style is unknown.
<DT><I>Invalid flag in force field section of restart file</I>
<DD>Unrecognized entry in restart file.
<DT><I>Invalid flag in header section of restart file</I>
<DD>Unrecognized entry in restart file.
<DT><I>Invalid flag in type arrays section of restart file</I>
<DD>Unrecognized entry in restart file.
<DT><I>Invalid frequency in temper command</I>
<DD>Nevery must be > 0.
<DT><I>Invalid group ID in neigh_modify command</I>
<DD>A group ID used in the neigh_modify command does not exist.
<DT><I>Invalid group function in variable formula</I>
<DD>Group function is not recognized.
<DT><I>Invalid group in communicate command</I>
<DD>Self-explanatory.
<DT><I>Invalid improper style</I>
<DD>The choice of improper style is unknown.
<DT><I>Invalid improper type in Impropers section of data file</I>
<DD>Improper type must be positive integer and within range of specified
improper types.
<DT><I>Invalid keyword in angle table parameters</I>
<DD>Self-explanatory.
<DT><I>Invalid keyword in bond table parameters</I>
<DD>Self-explanatory.
<DT><I>Invalid keyword in compute angle/local command</I>
<DD>Self-explanatory.
<DT><I>Invalid keyword in compute bond/local command</I>
<DD>Self-explanatory.
<DT><I>Invalid keyword in compute dihedral/local command</I>
<DD>Self-explanatory.
<DT><I>Invalid keyword in compute improper/local command</I>
<DD>Self-explanatory.
<DT><I>Invalid keyword in compute pair/local command</I>
<DD>Self-explanatory.
<DT><I>Invalid keyword in compute property/atom command</I>
<DD>Self-explanatory.
<DT><I>Invalid keyword in compute property/local command</I>
<DD>Self-explanatory.
<DT><I>Invalid keyword in compute property/molecule command</I>
<DD>Self-explanatory.
<DT><I>Invalid keyword in dump cfg command</I>
<DD>Self-explanatory.
<DT><I>Invalid keyword in pair table parameters</I>
<DD>Keyword used in list of table parameters is not recognized.
<DT><I>Invalid keyword in thermo_style custom command</I>
<DD>One or more specified keywords are not recognized.
<DT><I>Invalid kspace style</I>
<DD>The choice of kspace style is unknown.
+<DT><I>Invalid length in set command</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Invalid mass in set command</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Invalid mass line in data file</I>
<DD>Self-explanatory.
<DT><I>Invalid mass value</I>
<DD>Self-explanatory.
<DT><I>Invalid math function in variable formula</I>
<DD>Self-explanatory.
<DT><I>Invalid math/group/special function in variable formula</I>
<DD>Self-explanatory.
<DT><I>Invalid option in lattice command for non-custom style</I>
<DD>Certain lattice keywords are not supported unless the
lattice style is "custom".
<DT><I>Invalid order of forces within respa levels</I>
<DD>For respa, ordering of force computations within respa levels must
obey certain rules. E.g. bonds cannot be compute less frequently than
angles, pairwise forces cannot be computed less frequently than
kspace, etc.
<DT><I>Invalid pair style</I>
<DD>The choice of pair style is unknown.
<DT><I>Invalid pair table cutoff</I>
<DD>Cutoffs in pair_coeff command are not valid with read-in pair table.
<DT><I>Invalid pair table length</I>
<DD>Length of read-in pair table is invalid
+<DT><I>Invalid partitions in processors part command</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Invalid radius in Atoms section of data file</I>
<DD>Radius must be >= 0.0.
<DT><I>Invalid random number seed in fix ttm command</I>
<DD>Random number seed must be > 0.
<DT><I>Invalid random number seed in set command</I>
<DD>Random number seed must be > 0.
<DT><I>Invalid region style</I>
<DD>The choice of region style is unknown.
<DT><I>Invalid replace values in compute reduce</I>
<DD>Self-explanatory.
<DT><I>Invalid run command N value</I>
<DD>The number of timesteps must fit in a 32-bit integer. If you want to
run for more steps than this, perform multiple shorter runs.
<DT><I>Invalid run command start/stop value</I>
<DD>Self-explanatory.
<DT><I>Invalid run command upto value</I>
<DD>Self-explanatory.
<DT><I>Invalid seed for Marsaglia random # generator</I>
<DD>The initial seed for this random number generator must be a positive
integer less than or equal to 900 million.
<DT><I>Invalid seed for Park random # generator</I>
<DD>The initial seed for this random number generator must be a positive
integer.
-<DT><I>Invalid shape line in data file</I>
+<DT><I>Invalid shape in Ellipsoids section of data file</I>
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
-<DT><I>Invalid shape line in data file</I>
+<DT><I>Invalid shape in Triangles section of data file</I>
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
-<DT><I>Invalid shape value</I>
+<DT><I>Invalid shape in set command</I>
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
<DT><I>Invalid shear direction for fix wall/gran</I>
<DD>Self-explanatory.
<DT><I>Invalid special function in variable formula</I>
<DD>Self-explanatory.
<DT><I>Invalid style in pair_write command</I>
<DD>Self-explanatory. Check the input script.
<DT><I>Invalid syntax in variable formula</I>
<DD>Self-explanatory.
<DT><I>Invalid t_event in prd command</I>
<DD>Self-explanatory.
<DT><I>Invalid t_event in tad command</I>
<DD>The value must be greater than 0.
<DT><I>Invalid thermo keyword in variable formula</I>
<DD>The keyword is not recognized.
<DT><I>Invalid tmax in tad command</I>
<DD>The value must be greater than 0.0.
-<DT><I>Invalid type for dipole set</I>
-
-<DD>Dipole command must set a type from 1-N where N is the number of atom
-types.
-
<DT><I>Invalid type for mass set</I>
<DD>Mass command must set a type from 1-N where N is the number of atom
types.
-<DT><I>Invalid type for shape set</I>
-
-<DD>Atom type is out of bounds.
-
<DT><I>Invalid value in set command</I>
<DD>The value specified for the setting is invalid, likely because it is
too small or too large.
<DT><I>Invalid variable evaluation in variable formula</I>
<DD>A variable used in a formula could not be evaluated.
<DT><I>Invalid variable in next command</I>
<DD>Self-explanatory.
-<DT><I>Invalid variable name in variable formula</I>
-
-<DD>Variable name is not recognized.
-
<DT><I>Invalid variable name</I>
<DD>Variable name used in an input script line is invalid.
+<DT><I>Invalid variable name in variable formula</I>
+
+<DD>Variable name is not recognized.
+
<DT><I>Invalid variable style with next command</I>
<DD>Variable styles <I>equal</I> and <I>world</I> cannot be used in a next
command.
<DT><I>Invalid wiggle direction for fix wall/gran</I>
<DD>Self-explanatory.
<DT><I>Invoked angle equil angle on angle style none</I>
<DD>Self-explanatory.
<DT><I>Invoked angle single on angle style none</I>
<DD>Self-explanatory.
<DT><I>Invoked bond equil distance on bond style none</I>
<DD>Self-explanatory.
<DT><I>Invoked bond single on bond style none</I>
<DD>Self-explanatory.
<DT><I>Invoked pair single on pair style none</I>
<DD>A command (e.g. a dump) attempted to invoke the single() function on a
pair style none, which is illegal. You are probably attempting to
compute per-atom quantities with an undefined pair style.
<DT><I>KSpace style has not yet been set</I>
<DD>Cannot use kspace_modify command until a kspace style is set.
<DT><I>KSpace style is incompatible with Pair style</I>
<DD>Setting a kspace style requires that a pair style with a long-range
Coulombic component be selected.
<DT><I>Keyword %s in MEAM parameter file not recognized</I>
<DD>Self-explanatory.
+<DT><I>Kspace style pppm/tip4p requires newton on</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Kspace style requires atom attribute q</I>
<DD>The atom style defined does not have these attributes.
<DT><I>Label wasn't found in input script</I>
<DD>Self-explanatory.
<DT><I>Lattice orient vectors are not orthogonal</I>
<DD>The three specified lattice orientation vectors must be mutually
orthogonal.
<DT><I>Lattice orient vectors are not right-handed</I>
<DD>The three specified lattice orientation vectors must create a
right-handed coordinate system such that a1 cross a2 = a3.
<DT><I>Lattice primitive vectors are collinear</I>
<DD>The specified lattice primitive vectors do not for a unit cell with
non-zero volume.
<DT><I>Lattice settings are not compatible with 2d simulation</I>
<DD>One or more of the specified lattice vectors has a non-zero z
component.
<DT><I>Lattice spacings are invalid</I>
<DD>Each x,y,z spacing must be > 0.
<DT><I>Lattice style incompatible with simulation dimension</I>
<DD>2d simulation can use sq, sq2, or hex lattice. 3d simulation can use
sc, bcc, or fcc lattice.
<DT><I>Log of zero/negative value in variable formula</I>
<DD>Self-explanatory.
+<DT><I>Lost atoms via displace_atoms: original %ld current %ld</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Lost atoms via displace_box: original %ld current %ld</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Lost atoms: original %ld current %ld</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>MEAM library error %d</I>
<DD>A call to the MEAM Fortran library returned an error.
<DT><I>MPI_LMP_BIGINT and bigint in lmptype.h are not compatible</I>
<DD>The size of the MPI datatype does not match the size of a bigint.
<DT><I>MPI_LMP_TAGINT and tagint in lmptype.h are not compatible</I>
<DD>The size of the MPI datatype does not match the size of a tagint.
<DT><I>Mass command before simulation box is defined</I>
<DD>The mass command cannot be used before a read_data, read_restart, or
create_box command.
<DT><I>Min_style command before simulation box is defined</I>
<DD>The min_style command cannot be used before a read_data, read_restart,
or create_box command.
<DT><I>Minimization could not find thermo_pe compute</I>
<DD>This compute is created by the thermo command. It must have been
explicitly deleted by a uncompute command.
<DT><I>Minimize command before simulation box is defined</I>
<DD>The minimize command cannot be used before a read_data, read_restart,
or create_box command.
<DT><I>Mismatched brackets in variable</I>
<DD>Self-explanatory.
<DT><I>Mismatched compute in variable formula</I>
<DD>A compute is referenced incorrectly or a compute that produces per-atom
values is used in an equal-style variable formula.
<DT><I>Mismatched fix in variable formula</I>
<DD>A fix is referenced incorrectly or a fix that produces per-atom
values is used in an equal-style variable formula.
<DT><I>Mismatched variable in variable formula</I>
<DD>A variable is referenced incorrectly or an atom-style variable that
produces per-atom values is used in an equal-style variable
formula.
<DT><I>Molecular data file has too many atoms</I>
<DD>These kids of data files are currently limited to a number
of atoms that fits in a 32-bit integer.
<DT><I>Molecule count changed in compute atom/molecule</I>
<DD>Number of molecules must remain constant over time.
<DT><I>Molecule count changed in compute com/molecule</I>
<DD>Number of molecules must remain constant over time.
<DT><I>Molecule count changed in compute gyration/molecule</I>
<DD>Number of molecules must remain constant over time.
<DT><I>Molecule count changed in compute msd/molecule</I>
<DD>Number of molecules must remain constant over time.
<DT><I>Molecule count changed in compute property/molecule</I>
<DD>Number of molecules must remain constant over time.
<DT><I>More than one fix deform</I>
<DD>Only one fix deform can be defined at a time.
<DT><I>More than one fix freeze</I>
<DD>Only one of these fixes can be defined, since the granular pair
potentials access it.
<DT><I>More than one fix shake</I>
<DD>Only one fix shake can be defined.
<DT><I>Must define angle_style before Angle Coeffs</I>
<DD>Must use an angle_style command before reading a data file that
defines Angle Coeffs.
<DT><I>Must define angle_style before BondAngle Coeffs</I>
<DD>Must use an angle_style command before reading a data file that
defines Angle Coeffs.
<DT><I>Must define angle_style before BondBond Coeffs</I>
<DD>Must use an angle_style command before reading a data file that
defines Angle Coeffs.
<DT><I>Must define bond_style before Bond Coeffs</I>
<DD>Must use a bond_style command before reading a data file that
defines Bond Coeffs.
<DT><I>Must define dihedral_style before AngleAngleTorsion Coeffs</I>
<DD>Must use a dihedral_style command before reading a data file that
defines AngleAngleTorsion Coeffs.
<DT><I>Must define dihedral_style before AngleTorsion Coeffs</I>
<DD>Must use a dihedral_style command before reading a data file that
defines AngleTorsion Coeffs.
<DT><I>Must define dihedral_style before BondBond13 Coeffs</I>
<DD>Must use a dihedral_style command before reading a data file that
defines BondBond13 Coeffs.
<DT><I>Must define dihedral_style before Dihedral Coeffs</I>
<DD>Must use a dihedral_style command before reading a data file that
defines Dihedral Coeffs.
<DT><I>Must define dihedral_style before EndBondTorsion Coeffs</I>
<DD>Must use a dihedral_style command before reading a data file that
defines EndBondTorsion Coeffs.
<DT><I>Must define dihedral_style before MiddleBondTorsion Coeffs</I>
<DD>Must use a dihedral_style command before reading a data file that
defines MiddleBondTorsion Coeffs.
<DT><I>Must define improper_style before AngleAngle Coeffs</I>
<DD>Must use an improper_style command before reading a data file that
defines AngleAngle Coeffs.
<DT><I>Must define improper_style before Improper Coeffs</I>
<DD>Must use an improper_style command before reading a data file that
defines Improper Coeffs.
+<DT><I>Must define lattice to append_atoms</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Must define pair_style before Pair Coeffs</I>
<DD>Must use a pair_style command before reading a data file that defines
Pair Coeffs.
<DT><I>Must have more than one processor partition to temper</I>
<DD>Cannot use the temper command with only one processor partition. Use
the -partition command-line option.
<DT><I>Must read Atoms before Angles</I>
<DD>The Atoms section of a data file must come before an Angles section.
<DT><I>Must read Atoms before Bonds</I>
<DD>The Atoms section of a data file must come before a Bonds section.
<DT><I>Must read Atoms before Dihedrals</I>
<DD>The Atoms section of a data file must come before a Dihedrals section.
+<DT><I>Must read Atoms before Ellipsoids</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Must read Atoms before Impropers</I>
<DD>The Atoms section of a data file must come before an Impropers
section.
+<DT><I>Must read Atoms before Lines</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Must read Atoms before Triangles</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Must read Atoms before Velocities</I>
<DD>The Atoms section of a data file must come before a Velocities
section.
<DT><I>Must set both respa inner and outer</I>
<DD>Cannot use just the inner or outer option with respa without using the
other.
+<DT><I>Must shrink-wrap piston boundary</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Must specify a region in fix deposit</I>
<DD>The region keyword must be specified with this fix.
<DT><I>Must specify a region in fix pour</I>
<DD>The region keyword must be specified with this fix.
<DT><I>Must use -in switch with multiple partitions</I>
<DD>A multi-partition simulation cannot read the input script from stdin.
The -in command-line option must be used to specify a file.
<DT><I>Must use a block or cylinder region with fix pour</I>
<DD>Self-explanatory.
<DT><I>Must use a block region with fix pour for 2d simulations</I>
<DD>Self-explanatory.
<DT><I>Must use a bond style with TIP4P potential</I>
<DD>TIP4P potentials assume bond lengths in water are constrained
by a fix shake command.
<DT><I>Must use a molecular atom style with fix poems molecule</I>
<DD>Self-explanatory.
<DT><I>Must use a z-axis cylinder with fix pour</I>
<DD>The axis of the cylinder region used with the fix pour command must
be oriented along the z dimension.
<DT><I>Must use an angle style with TIP4P potential</I>
<DD>TIP4P potentials assume angles in water are constrained by a fix shake
command.
<DT><I>Must use atom style with molecule IDs with fix bond/swap</I>
<DD>Self-explanatory.
<DT><I>Must use pair_style comb with fix qeq/comb</I>
<DD>Self-explanatory.
<DT><I>Must use variable energy with fix addforce</I>
<DD>Must define an energy vartiable when applyting a dynamic
force during minimization.
<DT><I>NEB command before simulation box is defined</I>
<DD>Self-explanatory.
<DT><I>NEB requires damped dynamics minimizer</I>
<DD>Use a different minimization style.
<DT><I>NEB requires use of fix neb</I>
<DD>Self-explanatory.
+<DT><I>NL ramp in wall/piston only implemented in zlo for now</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Needed bonus data not in data file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Needed topology not in data file</I>
<DD>The header of the data file indicated that bonds or angles or
dihedrals or impropers would be included, but they were not present.
<DT><I>Neigh_modify exclude molecule requires atom attribute molecule</I>
<DD>Self-explanatory.
<DT><I>Neigh_modify include group != atom_modify first group</I>
<DD>Self-explanatory.
<DT><I>Neighbor delay must be 0 or multiple of every setting</I>
<DD>The delay and every parameters set via the neigh_modify command are
inconsistent. If the delay setting is non-zero, then it must be a
multiple of the every setting.
<DT><I>Neighbor include group not allowed with ghost neighbors</I>
<DD>This is a current restriction within LAMMPS.
<DT><I>Neighbor list overflow, boost neigh_modify one or page</I>
<DD>There are too many neighbors of a single atom. Use the neigh_modify
command to increase the neighbor page size and the max number of
neighbors allowed for one atom.
<DT><I>Neighbor multi not yet enabled for ghost neighbors</I>
<DD>This is a current restriction within LAMMPS.
<DT><I>Neighbor multi not yet enabled for granular</I>
<DD>Self-explanatory.
<DT><I>Neighbor multi not yet enabled for rRESPA</I>
<DD>Self-explanatory.
<DT><I>Neighbor page size must be >= 10x the one atom setting</I>
<DD>This is required to prevent wasting too much memory.
<DT><I>Neighbors of ghost atoms only allowed for full neighbor lists</I>
<DD>This is a current restriction within LAMMPS.
<DT><I>New bond exceeded bonds per atom in fix bond/create</I>
<DD>See the read_data command for info on setting the "extra bond per
atom" header value to allow for additional bonds to be formed.
<DT><I>New bond exceeded special list size in fix bond/create</I>
<DD>See the special_bonds extra command for info on how to leave space in
the special bonds list to allow for additional bonds to be formed.
<DT><I>Newton bond change after simulation box is defined</I>
<DD>The newton command cannot be used to change the newton bond value
after a read_data, read_restart, or create_box command.
+<DT><I>No OpenMP support compiled in</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>No angle style is defined for compute angle/local</I>
<DD>Self-explanatory.
<DT><I>No angles allowed with this atom style</I>
<DD>Self-explanatory. Check data file.
<DT><I>No atoms in data file</I>
<DD>The header of the data file indicated that atoms would be included,
but they were not present.
<DT><I>No basis atoms in lattice</I>
<DD>Basis atoms must be defined for lattice style user.
<DT><I>No bond style is defined for compute bond/local</I>
<DD>Self-explanatory.
<DT><I>No bonds allowed with this atom style</I>
<DD>Self-explanatory. Check data file.
<DT><I>No dihedral style is defined for compute dihedral/local</I>
<DD>Self-explanatory.
<DT><I>No dihedrals allowed with this atom style</I>
<DD>Self-explanatory. Check data file.
<DT><I>No dump custom arguments specified</I>
<DD>The dump custom command requires that atom quantities be specified to
output to dump file.
<DT><I>No dump local arguments specified</I>
<DD>Self-explanatory.
+<DT><I>No ellipsoids allowed with this atom style</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>No fix gravity defined for fix pour</I>
<DD>Cannot add poured particles without gravity to move them.
<DT><I>No improper style is defined for compute improper/local</I>
<DD>Self-explanatory.
<DT><I>No impropers allowed with this atom style</I>
<DD>Self-explanatory. Check data file.
+<DT><I>No lines allowed with this atom style</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>No matching element in ADP potential file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>No matching element in EAM potential file</I>
<DD>The EAM potential file does not contain elements that match the
requested elements.
<DT><I>No pair hbond/dreiding coefficients set</I>
<DD>Self-explanatory.
<DT><I>No pair style defined for compute group/group</I>
<DD>Cannot calculate group interactions without a pair style defined.
<DT><I>No pair style is defined for compute pair/local</I>
<DD>Self-explanatory.
<DT><I>No pair style is defined for compute property/local</I>
<DD>Self-explanatory.
<DT><I>No rigid bodies defined</I>
<DD>The fix specification did not end up defining any rigid bodies.
+<DT><I>No triangles allowed with this atom style</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Non digit character between brackets in variable</I>
<DD>Self-explantory.
<DT><I>Non integer # of swaps in temper command</I>
<DD>Swap frequency in temper command must evenly divide the total # of
timesteps.
+<DT><I>Nprocs not a multiple of N for -reorder</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Numeric index is out of bounds</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>One or more atoms belong to multiple rigid bodies</I>
<DD>Two or more rigid bodies defined by the fix rigid command cannot
contain the same atom.
<DT><I>One or zero atoms in rigid body</I>
<DD>Any rigid body defined by the fix rigid command must contain 2 or more
atoms.
+<DT><I>Only zhi currently implemented for append_atom</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Only zhi currently implemented for append_atoms</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Out of memory on GPGPU</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Out of range atoms - cannot compute PPPM</I>
<DD>One or more atoms are attempting to map their charge to a PPPM grid
point that is not owned by a processor. This is likely for one of two
reasons, both of them bad. First, it may mean that an atom near the
boundary of a processor's sub-domain has moved more than 1/2 the
<A HREF = "neighbor.html">neighbor skin distance</A> without neighbor lists being
rebuilt and atoms being migrated to new processors. This also means
you may be missing pairwise interactions that need to be computed.
The solution is to change the re-neighboring criteria via the
<A HREF = "neigh_modify">neigh_modify</A> command. The safest settings are "delay 0
every 1 check yes". Second, it may mean that an atom has moved far
outside a processor's sub-domain or even the entire simulation box.
This indicates bad physics, e.g. due to highly overlapping atoms, too
large a timestep, etc.
<DT><I>Overlapping large/large in pair colloid</I>
<DD>This potential is infinite when there is an overlap.
<DT><I>Overlapping small/large in pair colloid</I>
<DD>This potential is inifinte when there is an overlap.
<DT><I>POEMS fix must come before NPT/NPH fix</I>
<DD>NPT/NPH fix must be defined in input script after all poems fixes,
else the fix contribution to the pressure virial is incorrect.
<DT><I>PPPM grid is too large</I>
<DD>The global PPPM grid is larger than OFFSET in one or more dimensions.
OFFSET is currently set to 4096. You likely need to decrease the
requested precision.
<DT><I>PPPM order cannot be greater than %d</I>
<DD>Self-explanatory.
<DT><I>PPPM order has been reduced to 0</I>
<DD>LAMMPS has attempted to reduce the PPPM order to enable the simulation
to run, but can reduce the order no further. Try increasing the
accuracy of PPPM by reducing the tolerance size, thus inducing a
larger PPPM grid.
<DT><I>PRD command before simulation box is defined</I>
<DD>The prd command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>PRD nsteps must be multiple of t_event</I>
<DD>Self-explanatory.
<DT><I>PRD t_corr must be multiple of t_event</I>
<DD>Self-explanatory.
+<DT><I>Package command after simulation box is defined</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Package cuda command without USER-CUDA installed</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair brownian requires atom style sphere</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair brownian requires extended particles</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair brownian requires monodisperse particles</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair brownian/poly requires atom style sphere</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair brownian/poly requires extended particles</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair brownian/poly requires newton pair off</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Pair coeff for hybrid has invalid style</I>
<DD>Style in pair coeff must have been listed in pair_style command.
+<DT><I>Pair coul/wolf requires atom attribute q</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Pair cutoff < Respa interior cutoff</I>
<DD>One or more pairwise cutoffs are too short to use with the specified
rRESPA cutoffs.
-<DT><I>Pair dipole/cut requires atom attributes q, mu, torque, dipole</I>
+<DT><I>Pair dipole/cut requires atom attributes q, mu, torque</I>
-<DD>An atom style that specifies these quantities is needed.
+<DD>UNDOCUMENTED
<DT><I>Pair distance < table inner cutoff</I>
<DD>Two atoms are closer together than the pairwise table allows.
<DT><I>Pair distance > table outer cutoff</I>
<DD>Two atoms are further apart than the pairwise table allows.
<DT><I>Pair dpd requires ghost atoms store velocity</I>
<DD>Use the communicate vel yes command to enable this.
-<DT><I>Pair gayberne cannot be used with atom attribute diameter</I>
-
-<DD>Finite-size particles must be defined with the shape command.
-
<DT><I>Pair gayberne epsilon a,b,c coeffs are not all set</I>
<DD>Each atom type involved in pair_style gayberne must
have these 3 coefficients set at least once.
-<DT><I>Pair gayberne requires atom attributes quat, torque, shape</I>
+<DT><I>Pair gayberne requires atom style ellipsoid</I>
-<DD>An atom style that defines these attributes must be used.
+<DD>UNDOCUMENTED
-<DT><I>Pair granular requires atom attributes radius, omega, torque</I>
+<DT><I>Pair gayberne requires atoms with same type have same shape</I>
-<DD>The atom style defined does not have these attributes.
+<DD>UNDOCUMENTED
+
+<DT><I>Pair gayberne/gpu requires atom style ellipsoid</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair gayberne/gpu requires atoms with same type have same shape</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair granular requires atom style sphere</I>
+
+<DD>UNDOCUMENTED
<DT><I>Pair granular requires ghost atoms store velocity</I>
<DD>Use the communicate vel yes command to enable this.
<DT><I>Pair granular with shear history requires newton pair off</I>
<DD>This is a current restriction of the implementation of pair
granular styles with history.
<DT><I>Pair hybrid sub-style does not support single call</I>
<DD>You are attempting to invoke a single() call on a pair style
that doesn't support it.
<DT><I>Pair hybrid sub-style is not used</I>
<DD>No pair_coeff command used a sub-style specified in the pair_style
command.
<DT><I>Pair inner cutoff < Respa interior cutoff</I>
<DD>One or more pairwise cutoffs are too short to use with the specified
rRESPA cutoffs.
<DT><I>Pair inner cutoff >= Pair outer cutoff</I>
<DD>The specified cutoffs for the pair style are inconsistent.
-<DT><I>Pair lubricate cannot be used with atom attributes diameter or rmass</I>
+<DT><I>Pair line/lj requires atom style line</I>
-<DD>These attributes override the shape and mass settings, so cannot be
-used.
+<DD>UNDOCUMENTED
+
+<DT><I>Pair lubricate requires atom style sphere</I>
-<DT><I>Pair lubricate requires atom attribute omega or angmom</I>
+<DD>UNDOCUMENTED
-<DD>An atom style that defines these attributes must be used.
+<DT><I>Pair lubricate requires ghost atoms store velocity</I>
-<DT><I>Pair lubricate requires atom attributes torque and shape</I>
+<DD>Use the communicate vel yes command to enable this.
-<DD>An atom style that defines these attributes must be used.
+<DT><I>Pair lubricate requires monodisperse particles</I>
-<DT><I>Pair lubricate requires extended particles</I>
+<DD>UNDOCUMENTED
-<DD>This pair style can only be used for particles with a shape
-setting.
+<DT><I>Pair lubricate/poly requires atom style sphere</I>
-<DT><I>Pair lubricate requires ghost atoms store velocity</I>
+<DD>UNDOCUMENTED
-<DD>Use the communicate vel yes command to enable this.
+<DT><I>Pair lubricate/poly requires extended particles</I>
+
+<DD>UNDOCUMENTED
-<DT><I>Pair lubricate requires spherical, mono-disperse particles</I>
+<DT><I>Pair lubricate/poly requires ghost atoms store velocity</I>
-<DD>This is a current restriction of this pair style.
+<DD>UNDOCUMENTED
+
+<DT><I>Pair lubricate/poly requires newton pair off</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair lubricateU requires atom style sphere</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair lubricateU requires ghost atoms store velocity</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair lubricateU requires monodisperse particles</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair lubricateU/poly requires ghost atoms store velocity</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair lubricateU/poly requires newton pair off</I>
+
+<DD>UNDOCUMENTED
<DT><I>Pair peri lattice is not identical in x, y, and z</I>
<DD>The lattice defined by the lattice command must be cubic.
<DT><I>Pair peri requires a lattice be defined</I>
<DD>Use the lattice command for this purpose.
<DT><I>Pair peri requires an atom map, see atom_modify</I>
<DD>Even for atomic systems, an atom map is required to find Peridynamic
bonds. Use the atom_modify command to define one.
-<DT><I>Pair resquared cannot be used with atom attribute diameter</I>
-
-<DD>This attribute overrides the shape settings, so cannot be used.
-
<DT><I>Pair resquared epsilon a,b,c coeffs are not all set</I>
<DD>Self-explanatory.
<DT><I>Pair resquared epsilon and sigma coeffs are not all set</I>
<DD>Self-explanatory.
-<DT><I>Pair resquared requires atom attributes quat, torque, shape</I>
+<DT><I>Pair resquared requires atom style ellipsoid</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair resquared/gpu requires atom style ellipsoid</I>
+
+<DD>UNDOCUMENTED
-<DD>An atom style that defines these attributes must be used.
+<DT><I>Pair resquared/gpu requires atoms with same type have same shape</I>
+
+<DD>UNDOCUMENTED
<DT><I>Pair style AIREBO requires atom IDs</I>
<DD>This is a requirement to use the AIREBO potential.
<DT><I>Pair style AIREBO requires newton pair on</I>
<DD>See the newton command. This is a restriction to use the AIREBO
potential.
<DT><I>Pair style COMB requires atom IDs</I>
<DD>This is a requirement to use the AIREBO potential.
<DT><I>Pair style COMB requires atom attribute q</I>
<DD>Self-explanatory.
<DT><I>Pair style COMB requires newton pair on</I>
<DD>See the newton command. This is a restriction to use the COMB
potential.
<DT><I>Pair style MEAM requires newton pair on</I>
<DD>See the newton command. This is a restriction to use the MEAM
potential.
<DT><I>Pair style Stillinger-Weber requires atom IDs</I>
<DD>This is a requirement to use the SW potential.
<DT><I>Pair style Stillinger-Weber requires newton pair on</I>
<DD>See the newton command. This is a restriction to use the SW
potential.
<DT><I>Pair style Tersoff requires atom IDs</I>
<DD>This is a requirement to use the Tersoff potential.
<DT><I>Pair style Tersoff requires newton pair on</I>
<DD>See the newton command. This is a restriction to use the Tersoff
potential.
+<DT><I>Pair style born/coul/Wolf requires atom attribute q</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Pair style born/coul/long requires atom attribute q</I>
<DD>An atom style that defines this attribute must be used.
<DT><I>Pair style buck/coul/cut requires atom attribute q</I>
<DD>The atom style defined does not have this attribute.
<DT><I>Pair style buck/coul/long requires atom attribute q</I>
<DD>The atom style defined does not have these attributes.
<DT><I>Pair style coul/cut requires atom attribute q</I>
<DD>The atom style defined does not have these attributes.
+<DT><I>Pair style coul/long/gpu requires atom attribute q</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair style does not have single field requested by compute pair/local</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Pair style does not support bond_style quartic</I>
<DD>The pair style does not have a single() function, so it can
not be invoked by bond_style quartic.
<DT><I>Pair style does not support compute group/group</I>
<DD>The pair_style does not have a single() function, so it cannot be
invokded by the compute group/group command.
<DT><I>Pair style does not support compute pair/local</I>
<DD>The pair style does not have a single() function, so it can
not be invoked by fix bond/swap.
<DT><I>Pair style does not support compute property/local</I>
<DD>The pair style does not have a single() function, so it can
not be invoked by fix bond/swap.
<DT><I>Pair style does not support fix bond/swap</I>
<DD>The pair style does not have a single() function, so it can
not be invoked by fix bond/swap.
<DT><I>Pair style does not support pair_write</I>
<DD>The pair style does not have a single() function, so it can
not be invoked by pair write.
<DT><I>Pair style does not support rRESPA inner/middle/outer</I>
<DD>You are attempting to use rRESPA options with a pair style that
does not support them.
<DT><I>Pair style granular with history requires atoms have IDs</I>
<DD>Atoms in the simulation do not have IDs, so history effects
cannot be tracked by the granular pair potential.
<DT><I>Pair style hbond/dreiding requires an atom map, see atom_modify</I>
<DD>Self-explanatory.
<DT><I>Pair style hbond/dreiding requires atom IDs</I>
<DD>Self-explanatory.
<DT><I>Pair style hbond/dreiding requires molecular system</I>
<DD>Self-explanatory.
<DT><I>Pair style hbond/dreiding requires newton pair on</I>
<DD>See the newton command for details.
<DT><I>Pair style hybrid cannot have hybrid as an argument</I>
<DD>Self-explanatory.
<DT><I>Pair style hybrid cannot have none as an argument</I>
<DD>Self-explanatory.
<DT><I>Pair style hybrid cannot use same pair style twice</I>
<DD>The sub-style arguments of pair_style hybrid cannot be duplicated.
Check the input script.
<DT><I>Pair style is incompatible with KSpace style</I>
<DD>If a pair style with a long-range Coulombic component is selected,
then a kspace style must also be used.
<DT><I>Pair style lj/charmm/coul/charmm requires atom attribute q</I>
<DD>The atom style defined does not have these attributes.
<DT><I>Pair style lj/charmm/coul/long requires atom attribute q</I>
<DD>The atom style defined does not have these attributes.
+<DT><I>Pair style lj/charmm/coul/long/gpu requires atom attribute q</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Pair style lj/class2/coul/cut requires atom attribute q</I>
<DD>The atom style defined does not have this attribute.
<DT><I>Pair style lj/class2/coul/long requires atom attribute q</I>
<DD>The atom style defined does not have this attribute.
+<DT><I>Pair style lj/class2/coul/long/gpu requires atom attribute q</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Pair style lj/cut/coul/cut requires atom attribute q</I>
<DD>The atom style defined does not have this attribute.
+<DT><I>Pair style lj/cut/coul/cut/gpu requires atom attribute q</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Pair style lj/cut/coul/long requires atom attribute q</I>
<DD>The atom style defined does not have this attribute.
+<DT><I>Pair style lj/cut/coul/long/gpu requires atom attribute q</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Pair style lj/cut/coul/long/tip4p requires atom IDs</I>
<DD>There are no atom IDs defined in the system and the TIP4P potential
requires them to find O,H atoms with a water molecule.
<DT><I>Pair style lj/cut/coul/long/tip4p requires atom attribute q</I>
<DD>The atom style defined does not have these attributes.
<DT><I>Pair style lj/cut/coul/long/tip4p requires newton pair on</I>
<DD>This is because the computation of constraint forces within a water
molecule adds forces to atoms owned by other processors.
<DT><I>Pair style lj/gromacs/coul/gromacs requires atom attribute q</I>
<DD>An atom_style with this attribute is needed.
-<DT><I>Pair style peri_lps requires atom style peri</I>
-
-<DD>This is because atom style peri stores quantities needed by
-the peridynamic potential.
+<DT><I>Pair style peri requires atom style peri</I>
-<DT><I>Pair style peri_pmb requires atom style peri</I>
-
-<DD>This is because atom style peri stores quantities needed by
-the peridynamic potential.
+<DD>UNDOCUMENTED
<DT><I>Pair style reax requires atom IDs</I>
<DD>This is a requirement to use the ReaxFF potential.
<DT><I>Pair style reax requires newton pair on</I>
<DD>This is a requirement to use the ReaxFF potential.
<DT><I>Pair table cutoffs must all be equal to use with KSpace</I>
<DD>When using pair style table with a long-range KSpace solver, the
cutoffs for all atom type pairs must all be the same, since the
long-range solver starts at that cutoff.
<DT><I>Pair table parameters did not set N</I>
<DD>List of pair table parameters must include N setting.
<DT><I>Pair tersoff/zbl requires metal or real units</I>
<DD>This is a current restriction of this pair potential.
-<DT><I>Pair yukawa/colloid cannot be used with atom attribute diameter</I>
+<DT><I>Pair tri/lj requires atom style tri</I>
-<DD>Only finite-size particles defined by the shape command can be used.
+<DD>UNDOCUMENTED
-<DT><I>Pair yukawa/colloid requires atom attribute shape</I>
+<DT><I>Pair yukawa/colloid requires atom style sphere</I>
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
-<DT><I>Pair yukawa/colloid requires spherical particles</I>
+<DT><I>Pair yukawa/colloid requires atoms with same type have same radius</I>
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
<DT><I>Pair_coeff command before pair_style is defined</I>
<DD>Self-explanatory.
<DT><I>Pair_coeff command before simulation box is defined</I>
<DD>The pair_coeff command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>Pair_modify command before pair_style is defined</I>
<DD>Self-explanatory.
<DT><I>Pair_write command before pair_style is defined</I>
<DD>Self-explanatory.
<DT><I>Particle on or inside fix wall surface</I>
<DD>Particles must be "exterior" to the wall in order for energy/force to
be calculated.
<DT><I>Particle on or inside surface of region used in fix wall/region</I>
<DD>Particles must be "exterior" to the region surface in order for
energy/force to be calculated.
<DT><I>Per-atom compute in equal-style variable formula</I>
<DD>Equal-style variables cannot use per-atom quantities.
<DT><I>Per-atom energy was not tallied on needed timestep</I>
<DD>You are using a thermo keyword that requires potentials to
have tallied energy, but they didn't on this timestep. See the
variable doc page for ideas on how to make this work.
<DT><I>Per-atom fix in equal-style variable formula</I>
<DD>Equal-style variables cannot use per-atom quantities.
<DT><I>Per-atom virial was not tallied on needed timestep</I>
<DD>You are using a thermo keyword that requires potentials to have
tallied the virial, but they didn't on this timestep. See the
variable doc page for ideas on how to make this work.
<DT><I>Per-processor system is too big</I>
<DD>The number of owned atoms plus ghost atoms on a single
processor must fit in 32-bit integer.
<DT><I>Potential energy ID for fix neb does not exist</I>
<DD>Self-explanatory.
+<DT><I>Potential energy ID for fix nvt/nph/npt does not exist</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Potential file has duplicate entry</I>
<DD>The potential file for a SW or Tersoff potential has more than
one entry for the same 3 ordered elements.
<DT><I>Potential file is missing an entry</I>
<DD>The potential file for a SW or Tersoff potential does not have a
needed entry.
<DT><I>Power by 0 in variable formula</I>
<DD>Self-explanatory.
<DT><I>Pressure ID for fix box/relax does not exist</I>
<DD>The compute ID needed to compute pressure for the fix does not
exist.
<DT><I>Pressure ID for fix modify does not exist</I>
<DD>Self-explanatory.
<DT><I>Pressure ID for fix npt/nph does not exist</I>
<DD>Self-explanatory.
<DT><I>Pressure ID for fix press/berendsen does not exist</I>
<DD>The compute ID needed to compute pressure for the fix does not
exist.
<DT><I>Pressure ID for thermo does not exist</I>
<DD>The compute ID needed to compute pressure for thermodynamics does not
exist.
+<DT><I>Pressure control can not be used with fix nvt</I>
+
+<DD>Self-explanatory.
+
<DT><I>Pressure control can not be used with fix nvt/asphere</I>
<DD>Self-explanatory.
<DT><I>Pressure control can not be used with fix nvt/sllod</I>
<DD>Self-explanatory.
<DT><I>Pressure control can not be used with fix nvt/sphere</I>
<DD>Self-explanatory.
-<DT><I>Pressure control can not be used with fix nvt</I>
+<DT><I>Pressure control must be used with fix nph</I>
<DD>Self-explanatory.
<DT><I>Pressure control must be used with fix nph/asphere</I>
<DD>Self-explanatory.
<DT><I>Pressure control must be used with fix nph/sphere</I>
<DD>Self-explanatory.
-<DT><I>Pressure control must be used with fix nph</I>
+<DT><I>Pressure control must be used with fix nphug</I>
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
-<DT><I>Pressure control must be used with fix npt/asphere</I>
+<DT><I>Pressure control must be used with fix npt</I>
<DD>Self-explanatory.
-<DT><I>Pressure control must be used with fix npt/sphere</I>
+<DT><I>Pressure control must be used with fix npt/asphere</I>
<DD>Self-explanatory.
-<DT><I>Pressure control must be used with fix npt</I>
+<DT><I>Pressure control must be used with fix npt/sphere</I>
<DD>Self-explanatory.
<DT><I>Processor count in z must be 1 for 2d simulation</I>
<DD>Self-explanatory.
<DT><I>Processor partitions are inconsistent</I>
<DD>The total number of processors in all partitions must match the number
of processors LAMMPS is running on.
<DT><I>Processors command after simulation box is defined</I>
<DD>The processors command cannot be used after a read_data, read_restart,
or create_box command.
-<DT><I>Quaternion creation numeric error</I>
+<DT><I>Processors custom grid file is inconsistent</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Processors custom grid file is invalid</I>
-<DD>A numeric error occurred in the creation of a rigid body by the fix
-rigid command.
+<DD>UNDOCUMENTED
+
+<DT><I>Processors grid numa and map style are incompatible</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Processors part option and grid style are incompatible</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Processors twogrid requires proc count be a multiple of core count</I>
+
+<DD>UNDOCUMENTED
<DT><I>R0 < 0 for fix spring command</I>
<DD>Equilibrium spring length is invalid.
<DT><I>Reax_defs.h setting for NATDEF is too small</I>
<DD>Edit the setting in the ReaxFF library and re-compile the
library and re-build LAMMPS.
<DT><I>Reax_defs.h setting for NNEIGHMAXDEF is too small</I>
<DD>Edit the setting in the ReaxFF library and re-compile the
library and re-build LAMMPS.
-<DT><I>Region ID for compute reduce/region does not exist</I>
+<DT><I>Receiving partition in processors part command is already a receiver</I>
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
-<DT><I>Region ID for compute temp/region does not exist</I>
+<DT><I>Region ID for compute reduce/region does not exist</I>
<DD>Self-explanatory.
-<DT><I>Region ID for dump cfg does not exist</I>
+<DT><I>Region ID for compute temp/region does not exist</I>
<DD>Self-explanatory.
<DT><I>Region ID for dump custom does not exist</I>
<DD>Self-explanatory.
<DT><I>Region ID for fix addforce does not exist</I>
<DD>Self-explanatory.
<DT><I>Region ID for fix ave/spatial does not exist</I>
<DD>Self-explanatory.
<DT><I>Region ID for fix aveforce does not exist</I>
<DD>Self-explanatory.
<DT><I>Region ID for fix deposit does not exist</I>
<DD>Self-explanatory.
<DT><I>Region ID for fix evaporate does not exist</I>
<DD>Self-explanatory.
<DT><I>Region ID for fix heat does not exist</I>
<DD>Self-explanatory.
<DT><I>Region ID for fix setforce does not exist</I>
<DD>Self-explanatory.
<DT><I>Region ID for fix wall/region does not exist</I>
<DD>Self-explanatory.
<DT><I>Region ID in variable formula does not exist</I>
<DD>Self-explanatory.
<DT><I>Region cannot have 0 length rotation vector</I>
<DD>Self-explanatory.
<DT><I>Region intersect region ID does not exist</I>
<DD>Self-explanatory.
<DT><I>Region union or intersect cannot be dynamic</I>
<DD>The sub-regions can be dynamic, but not the combined region.
<DT><I>Region union region ID does not exist</I>
<DD>One or more of the region IDs specified by the region union command
does not exist.
<DT><I>Replacing a fix, but new style != old style</I>
<DD>A fix ID can be used a 2nd time, but only if the style matches the
previous fix. In this case it is assumed you with to reset a fix's
parameters. This error may mean you are mistakenly re-using a fix ID
when you do not intend to.
<DT><I>Replicate command before simulation box is defined</I>
<DD>The replicate command cannot be used before a read_data, read_restart,
or create_box command.
<DT><I>Replicate did not assign all atoms correctly</I>
<DD>Atoms replicated by the replicate command were not assigned correctly
to processors. This is likely due to some atom coordinates being
outside a non-periodic simulation box.
<DT><I>Replicated molecular system atom IDs are too big</I>
<DD>See the setting for the allowed atom ID size in the src/lmptype.h
file.
<DT><I>Replicated system is too big</I>
<DD>See the setting for bigint in the src/lmptype.h file.
<DT><I>Resetting timestep is not allowed with fix move</I>
<DD>This is because fix move is moving atoms based on elapsed time.
<DT><I>Respa inner cutoffs are invalid</I>
<DD>The first cutoff must be <= the second cutoff.
<DT><I>Respa levels must be >= 1</I>
<DD>Self-explanatory.
<DT><I>Respa middle cutoffs are invalid</I>
<DD>The first cutoff must be <= the second cutoff.
+<DT><I>Restrain atoms %d %d %d %d missing on proc %d at step %ld</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Reuse of compute ID</I>
<DD>A compute ID cannot be used twice.
<DT><I>Reuse of dump ID</I>
<DD>A dump ID cannot be used twice.
<DT><I>Reuse of region ID</I>
<DD>A region ID cannot be used twice.
<DT><I>Rigid body has degenerate moment of inertia</I>
<DD>Fix poems will only work with bodies (collections of atoms) that have
non-zero principal moments of inertia. This means they must be 3 or
more non-collinear atoms, even with joint atoms removed.
<DT><I>Rigid fix must come before NPT/NPH fix</I>
<DD>NPT/NPH fix must be defined in input script after all rigid fixes,
else the rigid fix contribution to the pressure virial is
incorrect.
<DT><I>Rmask function in equal-style variable formula</I>
<DD>Rmask is per-atom operation.
<DT><I>Run command before simulation box is defined</I>
<DD>The run command cannot be used before a read_data, read_restart, or
create_box command.
<DT><I>Run command start value is after start of run</I>
<DD>Self-explanatory.
<DT><I>Run command stop value is before end of run</I>
<DD>Self-explanatory.
<DT><I>Run_style command before simulation box is defined</I>
<DD>The run_style command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>SRD bin size for fix srd differs from user request</I>
<DD>Fix SRD had to adjust the bin size to fit the simulation box.
<DT><I>SRD bins for fix srd are not cubic enough</I>
<DD>The bin shape is not within tolerance of cubic.
+<DT><I>SRD particle %d started inside big particle %d on step %ld bounce %d\n</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Same dimension twice in fix ave/spatial</I>
<DD>Self-explanatory.
+<DT><I>Sending partition in processors part command is already a sender</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Set command before simulation box is defined</I>
<DD>The set command cannot be used before a read_data, read_restart,
or create_box command.
<DT><I>Set command with no atoms existing</I>
<DD>No atoms are yet defined so the set command cannot be used.
<DT><I>Set region ID does not exist</I>
<DD>Region ID specified in set command does not exist.
<DT><I>Shake angles have different bond types</I>
<DD>All 3-atom angle-constrained SHAKE clusters specified by the fix shake
command that are the same angle type, must also have the same bond
types for the 2 bonds in the angle.
-<DT><I>Shake atoms %d %d %d %d missing on proc %d at step</I>
+<DT><I>Shake atoms %d %d %d %d missing on proc %d at step %ld</I>
<DD>The 4 atoms in a single shake cluster specified by the fix shake
command are not all accessible to a processor. This probably means
-an atom has moved too far.
+an atom has moved too far. :dd
-<DT><I>Shake atoms %d %d %d missing on proc %d at step</I>
+<DT><I>Shake atoms %d %d %d missing on proc %d at step %ld</I>
<DD>The 3 atoms in a single shake cluster specified by the fix shake
command are not all accessible to a processor. This probably means
-an atom has moved too far.
+an atom has moved too far. :dd
-<DT><I>Shake atoms %d %d missing on proc %d at step</I>
+<DT><I>Shake atoms %d %d missing on proc %d at step %ld</I>
<DD>The 2 atoms in a single shake cluster specified by the fix shake
command are not all accessible to a processor. This probably means
-an atom has moved too far.
+an atom has moved too far. :dd
<DT><I>Shake cluster of more than 4 atoms</I>
<DD>A single cluster specified by the fix shake command can have no more
than 4 atoms.
<DT><I>Shake clusters are connected</I>
<DD>A single cluster specified by the fix shake command must have a single
central atom with up to 3 other atoms bonded to it.
<DT><I>Shake determinant = 0.0</I>
<DD>The determinant of the matrix being solved for a single cluster
specified by the fix shake command is numerically invalid.
<DT><I>Shake fix must come before NPT/NPH fix</I>
<DD>NPT fix must be defined in input script after SHAKE fix, else the
SHAKE fix contribution to the pressure virial is incorrect.
-<DT><I>Shape command before simulation box is defined</I>
+<DT><I>Small, tag, big integers are not sized correctly</I>
-<DD>Self-explanatory.
+<DD>UNDOCUMENTED
<DT><I>Smallint setting in lmptype.h is invalid</I>
<DD>It has to be the size of an integer.
<DT><I>Smallint setting in lmptype.h is not compatible</I>
<DD>Smallint stored in restart file is not consistent with LAMMPS version
you are running.
<DT><I>Sqrt of negative value in variable formula</I>
<DD>Self-explanatory.
<DT><I>Substitution for illegal variable</I>
<DD>Input script line contained a variable that could not be substituted
for.
<DT><I>System in data file is too big</I>
<DD>See the setting for bigint in the src/lmptype.h file.
<DT><I>TAD nsteps must be multiple of t_event</I>
<DD>Self-explanatory.
<DT><I>TIP4P hydrogen has incorrect atom type</I>
<DD>The TIP4P pairwise computation found an H atom whose type does not
agree with the specified H type.
<DT><I>TIP4P hydrogen is missing</I>
<DD>The TIP4P pairwise computation failed to find the correct H atom
within a water molecule.
<DT><I>TMD target file did not list all group atoms</I>
<DD>The target file for the fix tmd command did not list all atoms in the
fix group.
<DT><I>Tad command before simulation box is defined</I>
<DD>Self-explanatory.
<DT><I>Tagint setting in lmptype.h is invalid</I>
<DD>Tagint must be as large or larger than smallint.
<DT><I>Tagint setting in lmptype.h is not compatible</I>
<DD>Smallint stored in restart file is not consistent with LAMMPS version
you are running.
<DT><I>Target temperature for fix nvt/npt/nph cannot be 0.0</I>
<DD>Self-explanatory.
<DT><I>Target temperature for fix rigid/nvt cannot be 0.0</I>
<DD>Self-explanatory.
<DT><I>Temper command before simulation box is defined</I>
<DD>The temper command cannot be used before a read_data, read_restart, or
create_box command.
<DT><I>Temperature ID for fix bond/swap does not exist</I>
<DD>Self-explanatory.
<DT><I>Temperature ID for fix box/relax does not exist</I>
<DD>Self-explanatory.
<DT><I>Temperature ID for fix nvt/nph/npt does not exist</I>
<DD>Self-explanatory.
<DT><I>Temperature ID for fix press/berendsen does not exist</I>
<DD>Self-explanatory.
<DT><I>Temperature ID for fix temp/berendsen does not exist</I>
<DD>Self-explanatory.
<DT><I>Temperature ID for fix temp/rescale does not exist</I>
<DD>Self-explanatory.
+<DT><I>Temperature control can not be used with fix nph</I>
+
+<DD>Self-explanatory.
+
<DT><I>Temperature control can not be used with fix nph/asphere</I>
<DD>Self-explanatory.
<DT><I>Temperature control can not be used with fix nph/sphere</I>
<DD>Self-explanatory.
-<DT><I>Temperature control can not be used with fix nph</I>
+<DT><I>Temperature control must be used with fix nphug</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Temperature control must be used with fix npt</I>
<DD>Self-explanatory.
<DT><I>Temperature control must be used with fix npt/asphere</I>
<DD>Self-explanatory.
<DT><I>Temperature control must be used with fix npt/sphere</I>
<DD>Self-explanatory.
-<DT><I>Temperature control must be used with fix npt</I>
+<DT><I>Temperature control must be used with fix nvt</I>
<DD>Self-explanatory.
<DT><I>Temperature control must be used with fix nvt/asphere</I>
<DD>Self-explanatory.
<DT><I>Temperature control must be used with fix nvt/sllod</I>
<DD>Self-explanatory.
<DT><I>Temperature control must be used with fix nvt/sphere</I>
<DD>Self-explanatory.
-<DT><I>Temperature control must be used with fix nvt</I>
-
-<DD>Self-explanatory.
-
<DT><I>Temperature for fix nvt/sllod does not have a bias</I>
<DD>The specified compute must compute temperature with a bias.
<DT><I>Tempering could not find thermo_pe compute</I>
<DD>This compute is created by the thermo command. It must have been
explicitly deleted by a uncompute command.
<DT><I>Tempering fix ID is not defined</I>
<DD>The fix ID specified by the temper command does not exist.
<DT><I>Tempering temperature fix is not valid</I>
<DD>The fix specified by the temper command is not one that controls
temperature (nvt or langevin).
<DT><I>Thermo and fix not computed at compatible times</I>
<DD>Fixes generate values on specific timesteps. The thermo output
does not match these timesteps.
<DT><I>Thermo compute array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Thermo compute does not compute array</I>
<DD>Self-explanatory.
<DT><I>Thermo compute does not compute scalar</I>
<DD>Self-explanatory.
<DT><I>Thermo compute does not compute vector</I>
<DD>Self-explanatory.
<DT><I>Thermo compute vector is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Thermo custom variable cannot be indexed</I>
<DD>Self-explanatory.
<DT><I>Thermo custom variable is not equal-style variable</I>
<DD>Only equal-style variables can be output with thermodynamics, not
atom-style variables.
<DT><I>Thermo every variable returned a bad timestep</I>
<DD>The variable must return a timestep greater than the current timestep.
<DT><I>Thermo fix array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Thermo fix does not compute array</I>
<DD>Self-explanatory.
<DT><I>Thermo fix does not compute scalar</I>
<DD>Self-explanatory.
<DT><I>Thermo fix does not compute vector</I>
<DD>Self-explanatory.
<DT><I>Thermo fix vector is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Thermo keyword in variable requires lattice be defined</I>
<DD>The xlat, ylat, zlat keywords refer to lattice properties.
<DT><I>Thermo keyword in variable requires thermo to use/init pe</I>
<DD>You are using a thermo keyword in a variable that requires
potential energy to be calculated, but your thermo output
does not use it. Add it to your thermo output.
<DT><I>Thermo keyword in variable requires thermo to use/init press</I>
<DD>You are using a thermo keyword in a variable that requires pressure to
be calculated, but your thermo output does not use it. Add it to your
thermo output.
<DT><I>Thermo keyword in variable requires thermo to use/init temp</I>
<DD>You are using a thermo keyword in a variable that requires temperature
to be calculated, but your thermo output does not use it. Add it to
your thermo output.
<DT><I>Thermo keyword requires lattice be defined</I>
<DD>The xlat, ylat, zlat keywords refer to lattice properties.
<DT><I>Thermo style does not use press</I>
<DD>Cannot use thermo_modify to set this parameter since the thermo_style
is not computing this quantity.
<DT><I>Thermo style does not use temp</I>
<DD>Cannot use thermo_modify to set this parameter since the thermo_style
is not computing this quantity.
<DT><I>Thermo_modify int format does not contain d character</I>
<DD>Self-explanatory.
<DT><I>Thermo_modify pressure ID does not compute pressure</I>
<DD>The specified compute ID does not compute pressure.
<DT><I>Thermo_modify temperature ID does not compute temperature</I>
<DD>The specified compute ID does not compute temperature.
<DT><I>Thermo_style command before simulation box is defined</I>
<DD>The thermo_style command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>This variable thermo keyword cannot be used between runs</I>
<DD>Keywords that refer to time (such as cpu, elapsed) do not
make sense in between runs.
<DT><I>Threshhold for an atom property that isn't allocated</I>
<DD>A dump threshhold has been requested on a quantity that is
not defined by the atom style used in this simulation.
<DT><I>Timestep must be >= 0</I>
<DD>Specified timestep size is invalid.
<DT><I>Too big a problem to use velocity create loop all</I>
<DD>The system size must fit in a 32-bit integer to use this option.
+<DT><I>Too big a timestep</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Too big a timestep for dump dcd</I>
<DD>The timestep must fit in a 32-bit integer to use this dump style.
<DT><I>Too big a timestep for dump xtc</I>
<DD>The timestep must fit in a 32-bit integer to use this dump style.
<DT><I>Too few bits for lookup table</I>
<DD>Table size specified via pair_modify command does not work with your
machine's floating point representation.
<DT><I>Too many atom sorting bins</I>
<DD>This is likely due to an immense simulation box that has blown up
to a large size.
<DT><I>Too many atoms for dump dcd</I>
<DD>The system size must fit in a 32-bit integer to use this dump
style.
<DT><I>Too many atoms for dump xtc</I>
<DD>The system size must fit in a 32-bit integer to use this dump
style.
<DT><I>Too many atoms to dump sort</I>
<DD>Cannot sort when running with more than 2^31 atoms.
<DT><I>Too many exponent bits for lookup table</I>
<DD>Table size specified via pair_modify command does not work with your
machine's floating point representation.
<DT><I>Too many groups</I>
<DD>The maximum number of atom groups (including the "all" group) is
given by MAX_GROUP in group.cpp and is 32.
<DT><I>Too many iterations</I>
<DD>You must use a number of iterations that fit in a 32-bit integer
for minimization.
+<DT><I>Too many local+ghost atoms for neighbor list</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Too many mantissa bits for lookup table</I>
<DD>Table size specified via pair_modify command does not work with your
machine's floating point representation.
<DT><I>Too many masses for fix shake</I>
<DD>The fix shake command cannot list more masses than there are atom
types.
<DT><I>Too many neighbor bins</I>
<DD>This is likely due to an immense simulation box that has blown up
to a large size.
+<DT><I>Too many timesteps</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Too many timesteps for NEB</I>
<DD>You must use a number of timesteps that fit in a 32-bit integer
for NEB.
<DT><I>Too many total atoms</I>
<DD>See the setting for bigint in the src/lmptype.h file.
<DT><I>Too many total bits for bitmapped lookup table</I>
<DD>Table size specified via pair_modify command is too large. Note that
a value of N generates a 2^N size table.
<DT><I>Too many touching neighbors - boost MAXTOUCH</I>
<DD>A granular simulation has too many neighbors touching one atom. The
MAXTOUCH parameter in fix_shear_history.cpp must be set larger and
LAMMPS must be re-built.
<DT><I>Too much per-proc info for dump</I>
<DD>Number of local atoms times number of columns must fit in a 32-bit
integer for dump.
<DT><I>Tree structure in joint connections</I>
<DD>Fix poems cannot (yet) work with coupled bodies whose joints connect
the bodies in a tree structure.
<DT><I>Triclinic box must be periodic in skewed dimensions</I>
<DD>This is a requirement for using a non-orthogonal box. E.g. to set a
non-zero xy tilt, both x and y must be periodic dimensions.
<DT><I>Triclinic box skew is too large</I>
<DD>The displacement in a skewed direction must be less than half the box
length in that dimension. E.g. the xy tilt must be between -half and
+half of the x box length.
<DT><I>Tried to convert a double to int, but input_double > INT_MAX</I>
<DD>Self-explanatory.
<DT><I>Two groups cannot be the same in fix spring couple</I>
<DD>Self-explanatory.
-<DT><I>Unable to initialize accelerator for use</I>
+<DT><I>USER-CUDA mode requires CUDA variant of min style</I>
-<DD>One or more specified accelerator(s) cannot currently be used by LAMMPS.
-This can happen if the accelerator is already in use by another
-process.
+<DD>UNDOCUMENTED
+
+<DT><I>USER-CUDA mode requires CUDA variant of run style</I>
+
+<DD>UNDOCUMENTED
<DT><I>Unbalanced quotes in input line</I>
<DD>No matching end double quote was found following a leading double
quote.
+<DT><I>Unexpected end of -reorder file</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Unexpected end of custom file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Unexpected end of data file</I>
<DD>LAMMPS hit the end of the data file while attempting to read a
section. Something is wrong with the format of the data file.
+<DT><I>Unexpected end of reorder file</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Units command after simulation box is defined</I>
<DD>The units command cannot be used after a read_data, read_restart, or
create_box command.
<DT><I>Universe/uloop variable count < # of partitions</I>
<DD>A universe or uloop style variable must specify a number of values >= to the
number of processor partitions.
<DT><I>Unknown command: %s</I>
<DD>The command is not known to LAMMPS. Check the input script.
<DT><I>Unknown identifier in data file: %s</I>
<DD>A section of the data file cannot be read by LAMMPS.
<DT><I>Unknown table style in angle style table</I>
<DD>Self-explanatory.
<DT><I>Unknown table style in bond style table</I>
<DD>Self-explanatory.
<DT><I>Unknown table style in pair_style command</I>
<DD>Style of table is invalid for use with pair_style table command.
<DT><I>Unrecognized lattice type in MEAM file 1</I>
<DD>The lattice type in an entry of the MEAM library file is not
valid.
<DT><I>Unrecognized lattice type in MEAM file 2</I>
<DD>The lattice type in an entry of the MEAM parameter file is not
valid.
<DT><I>Unrecognized pair style in compute pair command</I>
<DD>Self-explanatory.
<DT><I>Use of compute temp/ramp with undefined lattice</I>
<DD>Must use lattice command with compute temp/ramp command if units
option is set to lattice.
<DT><I>Use of displace_atoms with undefined lattice</I>
<DD>Must use lattice command with displace_atoms command if units option
is set to lattice.
<DT><I>Use of displace_box with undefined lattice</I>
<DD>Must use lattice command with displace_box command if units option is
set to lattice.
+<DT><I>Use of fix append_atoms with undefined lattice</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Use of fix ave/spatial with undefined lattice</I>
<DD>A lattice must be defined to use fix ave/spatial with units = lattice.
<DT><I>Use of fix deform with undefined lattice</I>
<DD>A lattice must be defined to use fix deform with units = lattice.
<DT><I>Use of fix deposit with undefined lattice</I>
<DD>Must use lattice command with compute fix deposit command if units
option is set to lattice.
<DT><I>Use of fix dt/reset with undefined lattice</I>
<DD>Must use lattice command with fix dt/reset command if units option is
set to lattice.
<DT><I>Use of fix indent with undefined lattice</I>
<DD>The lattice command must be used to define a lattice before using the
fix indent command.
<DT><I>Use of fix move with undefined lattice</I>
<DD>Must use lattice command with fix move command if units option is
set to lattice.
<DT><I>Use of fix recenter with undefined lattice</I>
<DD>Must use lattice command with fix recenter command if units option is
set to lattice.
<DT><I>Use of fix wall with undefined lattice</I>
<DD>Must use lattice command with fix wall command if units option is set
to lattice.
+<DT><I>Use of fix wall/piston with undefined lattice</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Use of region with undefined lattice</I>
<DD>If scale = lattice (the default) for the region command, then a
lattice must first be defined via the lattice command.
<DT><I>Use of velocity with undefined lattice</I>
<DD>If scale = lattice (the default) for the velocity set or velocity ramp
command, then a lattice must first be defined via the lattice command.
<DT><I>Using fix nvt/sllod with inconsistent fix deform remap option</I>
<DD>Fix nvt/sllod requires that deforming atoms have a velocity profile
provided by "remap v" as a fix deform option.
<DT><I>Using fix nvt/sllod with no fix deform defined</I>
<DD>Self-explanatory.
<DT><I>Using fix srd with inconsistent fix deform remap option</I>
<DD>When shearing the box in an SRD simulation, the remap v option for fix
deform needs to be used.
+<DT><I>Using pair lubricate with inconsistent fix deform remap option</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Using pair lubricate/poly with inconsistent fix deform remap option</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Variable evaluation before simulation box is defined</I>
<DD>Cannot evaluate a compute or fix or atom-based value in a variable
before the simulation has been setup.
<DT><I>Variable for compute ti is invalid style</I>
<DD>Self-explanatory.
<DT><I>Variable for dump every is invalid style</I>
<DD>Only equal-style variables can be used.
+<DT><I>Variable for dump image center is invalid style</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Variable for dump image persp is invalid style</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Variable for dump image phi is invalid style</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Variable for dump image theta is invalid style</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Variable for dump image zoom is invalid style</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Variable for fix adapt is invalid style</I>
<DD>Only equal-style variables can be used.
<DT><I>Variable for fix addforce is invalid style</I>
<DD>Self-explanatory.
<DT><I>Variable for fix aveforce is invalid style</I>
<DD>Only equal-style variables can be used.
<DT><I>Variable for fix efield is invalid style</I>
<DD>Only equal-style variables can be used.
<DT><I>Variable for fix indent is invalid style</I>
<DD>Only equal-style variables can be used.
<DT><I>Variable for fix indent is not equal style</I>
<DD>Only equal-style variables can be used.
+<DT><I>Variable for fix langevin is invalid style</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Variable for fix move is invalid style</I>
<DD>Only equal-style variables can be used.
<DT><I>Variable for fix setforce is invalid style</I>
<DD>Only equal-style variables can be used.
<DT><I>Variable for fix wall is invalid style</I>
<DD>Only equal-style variables can be used.
<DT><I>Variable for fix wall/reflect is invalid style</I>
<DD>Only equal-style variables can be used.
<DT><I>Variable for fix wall/srd is invalid style</I>
<DD>Only equal-style variables can be used.
<DT><I>Variable for region is invalid style</I>
<DD>Only equal-style variables can be used.
<DT><I>Variable for region is not equal style</I>
<DD>Self-explanatory.
<DT><I>Variable for thermo every is invalid style</I>
<DD>Only equal-style variables can be used.
<DT><I>Variable for velocity set is invalid style</I>
<DD>Only atom-style variables can be used.
<DT><I>Variable formula compute array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Variable formula compute vector is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Variable formula fix array is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Variable formula fix vector is accessed out-of-range</I>
<DD>Self-explanatory.
<DT><I>Variable name for compute atom/molecule does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for compute reduce does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for compute ti does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for dump every does not exist</I>
<DD>Self-explanatory.
+<DT><I>Variable name for dump image center does not exist</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Variable name for dump image persp does not exist</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Variable name for dump image phi does not exist</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Variable name for dump image theta does not exist</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Variable name for dump image zoom does not exist</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Variable name for fix adapt does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix addforce does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix ave/atom does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix ave/correlate does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix ave/histo does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix ave/spatial does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix ave/time does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix aveforce does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix efield does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix indent does not exist</I>
<DD>Self-explanatory.
+<DT><I>Variable name for fix langevin does not exist</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Variable name for fix move does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix setforce does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix store/state does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix wall does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix wall/reflect does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for fix wall/srd does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for region does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for thermo every does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name for velocity set does not exist</I>
<DD>Self-explanatory.
<DT><I>Variable name must be alphanumeric or underscore characters</I>
<DD>Self-explanatory.
<DT><I>Velocity command before simulation box is defined</I>
<DD>The velocity command cannot be used before a read_data, read_restart,
or create_box command.
<DT><I>Velocity command with no atoms existing</I>
<DD>A velocity command has been used, but no atoms yet exist.
<DT><I>Velocity ramp in z for a 2d problem</I>
<DD>Self-explanatory.
<DT><I>Velocity temperature ID does not compute temperature</I>
<DD>The compute ID given to the velocity command must compute
temperature.
+<DT><I>Verlet/split requires 2 partitions</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Verlet/split requires Rspace partition layout be multiple of Kspace partition layout in each dim</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Verlet/split requires Rspace partition size be multiple of Kspace partition size</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Virial was not tallied on needed timestep</I>
<DD>You are using a thermo keyword that requires potentials to
have tallied the virial, but they didn't on this timestep. See the
variable doc page for ideas on how to make this work.
<DT><I>Wall defined twice in fix wall command</I>
<DD>Self-explanatory.
<DT><I>Wall defined twice in fix wall/reflect command</I>
<DD>Self-explanatory.
<DT><I>Wall defined twice in fix wall/srd command</I>
<DD>Self-explanatory.
-<DT><I>Weighted neighbor list values are too big</I>
-
-<DD>You must have less atoms per processor to use this
-style neighbor list.
-
<DT><I>World variable count doesn't match # of partitions</I>
<DD>A world-style variable must specify a number of values equal to the
number of processor partitions.
<DT><I>Write_restart command before simulation box is defined</I>
<DD>The write_restart command cannot be used before a read_data,
read_restart, or create_box command.
<DT><I>Zero-length lattice orient vector</I>
<DD>Self-explanatory.
</DL>
<H4><A NAME = "warn"></A>Warnings:
</H4>
<DL>
-<DT><I>All element names have been set to 'C' for dump cfg</I>
-
-<DD>Use the dump_modify command if you wish to override this.
-
<DT><I>Atom with molecule ID = 0 included in compute molecule group</I>
<DD>The group used in a compute command that operates on moleclues
includes atoms with no molecule ID. This is probably not what you
want.
<DT><I>Broken bonds will not alter angles, dihedrals, or impropers</I>
<DD>See the doc page for fix bond/break for more info on this
restriction.
<DT><I>Building an occasional neighobr list when atoms may have moved too far</I>
<DD>This can cause LAMMPS to crash when the neighbor list is built.
The solution is to check for building the regular neighbor lists
more frequently.
<DT><I>Compute cna/atom cutoff may be too large to find ghost atom neighbors</I>
<DD>The neighbor cutoff used may not encompass enough ghost atoms
to perform this operation correctly.
<DT><I>Computing temperature of portions of rigid bodies</I>
<DD>The group defined by the temperature compute does not encompass all
the atoms in one or more rigid bodies, so the change in
degrees-of-freedom for the atoms in those partial rigid bodies will
not be accounted for.
<DT><I>Created bonds will not create angles, dihedrals, or impropers</I>
<DD>See the doc page for fix bond/create for more info on this
restriction.
-<DT><I>Dihedral problem: %d %d %d %d %d %d</I>
+<DT><I>Dihedral problem: %d %ld %d %d %d %d</I>
<DD>Conformation of the 4 listed dihedral atoms is extreme; you may want
-to check your simulation geometry.
+to check your simulation geometry. :dd
<DT><I>Dump dcd/xtc timestamp may be wrong with fix dt/reset</I>
<DD>If the fix changes the timestep, the dump dcd file will not
reflect the change.
-<DT><I>FENE bond too long: %d %d %d %g</I>
+<DT><I>FENE bond too long: %ld %d %d %g</I>
<DD>A FENE bond has stretched dangerously far. It's interaction strength
-will be truncated to attempt to prevent the bond from blowing up.
+will be truncated to attempt to prevent the bond from blowing up. :dd
-<DT><I>FENE bond too long: %d %g</I>
+<DT><I>FENE bond too long: %ld %g</I>
<DD>A FENE bond has stretched dangerously far. It's interaction strength
-will be truncated to attempt to prevent the bond from blowing up.
+will be truncated to attempt to prevent the bond from blowing up. :dd
+
+<DT><I>Fix GCMC may delete atom with non-zero molecule ID</I>
+
+<DD>UNDOCUMENTED
<DT><I>Fix SRD walls overlap but fix srd overlap not set</I>
<DD>You likely want to set this in your input script.
<DT><I>Fix bond/swap will ignore defined angles</I>
<DD>See the doc page for fix bond/swap for more info on this
restriction.
+<DT><I>Fix evaporate may delete atom with non-zero molecule ID</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Fix move does not update angular momentum</I>
<DD>Atoms store this quantity, but fix move does not (yet) update it.
<DT><I>Fix move does not update quaternions</I>
<DD>Atoms store this quantity, but fix move does not (yet) update it.
<DT><I>Fix recenter should come after all other integration fixes</I>
<DD>Other fixes may change the position of the center-of-mass, so
fix recenter should come last.
<DT><I>Fix srd SRD moves may trigger frequent reneighboring</I>
<DD>This is because the SRD particles may move long distances.
<DT><I>Fix srd grid size > 1/4 of big particle diameter</I>
<DD>This may cause accuracy problems.
-<DT><I>Fix srd no-slip wall collisions with bin shifting</I>
-
-<DD>This is an inconsistent setting in your input script.
-
<DT><I>Fix srd particle moved outside valid domain</I>
<DD>This may indicate a problem with your simulation parameters.
<DT><I>Fix srd particles may move > big particle diameter</I>
<DD>This may cause accuracy problems.
<DT><I>Fix srd viscosity < 0.0 due to low SRD density</I>
<DD>This may cause accuracy problems.
<DT><I>Fix thermal/conductivity comes before fix ave/spatial</I>
<DD>The order of these 2 fixes in your input script is such that fix
thermal/conductivity comes first. If you are using fix ave/spatial to
measure the temperature profile induced by fix viscosity, then this
may cause a glitch in the profile since you are averaging immediately
after swaps have occurred. Flipping the order of the 2 fixes
typically helps.
<DT><I>Fix viscosity comes before fix ave/spatial</I>
<DD>The order of these 2 fixes in your input script is such that
fix viscosity comes first. If you are using fix ave/spatial
to measure the velocity profile induced by fix viscosity, then
this may cause a glitch in the profile since you are averaging
immediately after swaps have occurred. Flipping the order
of the 2 fixes typically helps.
<DT><I>Group for fix_modify temp != fix group</I>
<DD>The fix_modify command is specifying a temperature computation that
computes a temperature on a different group of atoms than the fix
itself operates on. This is probably not what you want to do.
-<DT><I>Improper problem: %d %d %d %d %d %d</I>
+<DT><I>Improper problem: %d %ld %d %d %d %d</I>
<DD>Conformation of the 4 listed improper atoms is extreme; you may want
-to check your simulation geometry.
+to check your simulation geometry. :dd
<DT><I>Kspace_modify slab param < 2.0 may cause unphysical behavior</I>
<DD>The kspace_modify slab parameter should be larger to insure periodic
grids padded with empty space do not overlap.
<DT><I>Less insertions than requested</I>
<DD>Less atom insertions occurred on this timestep due to the fix pour
command than were scheduled. This is probably because there were too
many overlaps detected.
-<DT><I>Lost atoms: original %.15g current %.15g</I>
-
-<DD>A thermodynamic computation has detected lost atoms.
-
<DT><I>Mismatch between velocity and compute groups</I>
<DD>The temperature computation used by the velocity command will not be
on the same group of atoms that velocities are being set for.
<DT><I>More than one compute centro/atom</I>
<DD>It is not efficient to use compute centro/atom more than once.
<DT><I>More than one compute cluster/atom</I>
<DD>It is not efficient to use compute cluster/atom more than once.
<DT><I>More than one compute cna/atom defined</I>
<DD>It is not efficient to use compute cna/atom more than once.
<DT><I>More than one compute coord/atom</I>
<DD>It is not efficient to use compute coord/atom more than once.
<DT><I>More than one compute damage/atom</I>
<DD>It is not efficient to use compute ke/atom more than once.
<DT><I>More than one compute ke/atom</I>
<DD>It is not efficient to use compute ke/atom more than once.
<DT><I>More than one fix poems</I>
<DD>It is not efficient to use fix poems more than once.
<DT><I>More than one fix rigid</I>
<DD>It is not efficient to use fix rigid more than once.
<DT><I>New thermo_style command, previous thermo_modify settings will be lost</I>
<DD>If a thermo_style command is used after a thermo_modify command, the
settings changed by the thermo_modify command will be reset to their
default values. This is because the thermo_modify commmand acts on
the currently defined thermo style, and a thermo_style command creates
a new style.
+<DT><I>No Kspace calculation with verlet/split</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>No fixes defined, atoms won't move</I>
<DD>If you are not using a fix like nve, nvt, npt then atom velocities and
coordinates will not be updated during timestepping.
<DT><I>No joints between rigid bodies, use fix rigid instead</I>
<DD>The bodies defined by fix poems are not connected by joints. POEMS
will integrate the body motion, but it would be more efficient to use
fix rigid.
<DT><I>Not using real units with pair reax</I>
<DD>This is most likely an error, unless you have created your own ReaxFF
parameter file in a different set of units.
<DT><I>One or more atoms are time integrated more than once</I>
<DD>This is probably an error since you typically do not want to
advance the positions or velocities of an atom more than once
per timestep.
<DT><I>One or more compute molecules has atoms not in group</I>
<DD>The group used in a compute command that operates on moleclues does
not include all the atoms in some molecules. This is probably not
what you want.
<DT><I>One or more respa levels compute no forces</I>
<DD>This is computationally inefficient.
<DT><I>Pair COMB charge %.10f with force %.10f hit max barrier</I>
<DD>Something is possibly wrong with your model.
<DT><I>Pair COMB charge %.10f with force %.10f hit min barrier</I>
<DD>Something is possibly wrong with your model.
+<DT><I>Pair brownian needs newton pair on for momentum conservation</I>
+
+<DD>UNDOCUMENTED
+
+<DT><I>Pair dpd needs newton pair on for momentum conservation</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Pair dsmc: num_of_collisions > number_of_A</I>
<DD>Collision model in DSMC is breaking down.
<DT><I>Pair dsmc: num_of_collisions > number_of_B</I>
<DD>Collision model in DSMC is breaking down.
<DT><I>Particle deposition was unsuccessful</I>
<DD>The fix deposit command was not able to insert as many atoms as
needed. The requested volume fraction may be too high, or other atoms
may be in the insertion region.
<DT><I>Reducing PPPM order b/c stencil extends beyond neighbor processor</I>
<DD>LAMMPS is attempting this in order to allow the simulation
to run. It should not effect the PPPM accuracy.
<DT><I>Replacing a fix, but new group != old group</I>
<DD>The ID and style of a fix match for a fix you are changing with a fix
command, but the new group you are specifying does not match the old
group.
<DT><I>Replicating in a non-periodic dimension</I>
<DD>The parameters for a replicate command will cause a non-periodic
dimension to be replicated; this may cause unwanted behavior.
<DT><I>Resetting reneighboring criteria during PRD</I>
<DD>A PRD simulation requires that neigh_modify settings be delay = 0,
every = 1, check = yes. Since these settings were not in place,
LAMMPS changed them and will restore them to their original values
after the PRD simulation.
<DT><I>Resetting reneighboring criteria during TAD</I>
<DD>A TAD simulation requires that neigh_modify settings be delay = 0,
every = 1, check = yes. Since these settings were not in place,
LAMMPS changed them and will restore them to their original values
after the PRD simulation.
<DT><I>Resetting reneighboring criteria during minimization</I>
<DD>Minimization requires that neigh_modify settings be delay = 0, every =
1, check = yes. Since these settings were not in place, LAMMPS
changed them and will restore them to their original values after the
minimization.
<DT><I>Restart file used different # of processors</I>
<DD>The restart file was written out by a LAMMPS simulation running on a
different number of processors. Due to round-off, the trajectories of
your restarted simulation may diverge a little more quickly than if
you ran on the same # of processors.
<DT><I>Restart file used different 3d processor grid</I>
<DD>The restart file was written out by a LAMMPS simulation running on a
different 3d grid of processors. Due to round-off, the trajectories
of your restarted simulation may diverge a little more quickly than if
you ran on the same # of processors.
<DT><I>Restart file used different boundary settings, using restart file values</I>
<DD>Your input script cannot change these restart file settings.
<DT><I>Restart file used different newton bond setting, using restart file value</I>
<DD>The restart file value will override the setting in the input script.
<DT><I>Restart file used different newton pair setting, using input script value</I>
<DD>The input script value will override the setting in the restart file.
<DT><I>Restart file version does not match LAMMPS version</I>
<DD>This may cause problems when reading the restart file.
+<DT><I>Restrain problem: %d %ld %d %d %d %d</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Running PRD with only one replica</I>
<DD>This is allowed, but you will get no parallel speed-up.
<DT><I>SRD bin shifting turned on due to small lamda</I>
<DD>This is done to try to preserve accuracy.
-<DT><I>SRD bin size for fix srd differs from user request</I>
-
-<DD>Check if the new bin size is acceptable.
-
-<DT><I>SRD bins for fix srd are not cubic enough</I>
-
-<DD>Check if the bin shape is acceptable.
-
-<DT><I>SRD particle %d started inside big particle %d on step %d bounce %d</I>
-
-<DD>This may not be a problem, but indicates one or more SRD particles are
-being left inside solute particles.
-
<DT><I>Shake determinant < 0.0</I>
<DD>The determinant of the quadratic equation being solved for a single
cluster specified by the fix shake command is numerically suspect. LAMMPS
will set it to 0.0 and continue.
<DT><I>Should not allow rigid bodies to bounce off relecting walls</I>
<DD>LAMMPS allows this, but their dynamics are not computed correctly.
<DT><I>System is not charge neutral, net charge = %g</I>
<DD>The total charge on all atoms on the system is not 0.0, which
is not valid for Ewald or PPPM.
<DT><I>Table inner cutoff >= outer cutoff</I>
<DD>You specified an inner cutoff for a Coulombic table that is longer
than the global cutoff. Probably not what you wanted.
<DT><I>Temperature for MSST is not for group all</I>
<DD>User-assigned temperature to MSST fix does not compute temperature for
all atoms. Since MSST computes a global pressure, the kinetic energy
contribution from the temperature is assumed to also be for all atoms.
Thus the pressure used by MSST could be inaccurate.
<DT><I>Temperature for NPT is not for group all</I>
<DD>User-assigned temperature to NPT fix does not compute temperature for
all atoms. Since NPT computes a global pressure, the kinetic energy
contribution from the temperature is assumed to also be for all atoms.
Thus the pressure used by NPT could be inaccurate.
<DT><I>Temperature for fix modify is not for group all</I>
<DD>The temperature compute is being used with a pressure calculation
which does operate on group all, so this may be inconsistent.
<DT><I>Temperature for thermo pressure is not for group all</I>
<DD>User-assigned temperature to thermo via the thermo_modify command does
not compute temperature for all atoms. Since thermo computes a global
pressure, the kinetic energy contribution from the temperature is
assumed to also be for all atoms. Thus the pressure printed by thermo
could be inaccurate.
<DT><I>Too many common neighbors in CNA %d times</I>
<DD>More than the maximum # of neighbors was found multiple times. This
was unexpected.
<DT><I>Too many inner timesteps in fix ttm</I>
<DD>Self-explanatory.
<DT><I>Too many neighbors in CNA for %d atoms</I>
<DD>More than the maximum # of neighbors was found multiple times. This
was unexpected.
-<DT><I>Use special bonds = 0,1,1 with bond style fene/expand</I>
+<DT><I>Use special bonds = 0,1,1 with bond style fene</I>
<DD>Most FENE models need this setting for the special_bonds command.
-<DT><I>Use special bonds = 0,1,1 with bond style fene</I>
+<DT><I>Use special bonds = 0,1,1 with bond style fene/expand</I>
<DD>Most FENE models need this setting for the special_bonds command.
<DT><I>Using compute temp/deform with inconsistent fix deform remap option</I>
<DD>Fix nvt/sllod assumes deforming atoms have a velocity profile provided
by "remap v" or "remap none" as a fix deform option.
<DT><I>Using compute temp/deform with no fix deform defined</I>
<DD>This is probably an error, since it makes little sense to use
compute temp/deform in this case.
+<DT><I>Using fix srd with box deformation but no SRD thermostat</I>
+
+<DD>UNDOCUMENTED
+
<DT><I>Using pair tail corrections with nonperiodic system</I>
<DD>This is probably a bogus thing to do, since tail corrections are
computed by integrating the density of a periodic system out to
infinity.
</DL>
</HTML>
diff --git a/doc/Section_errors.txt b/doc/Section_errors.txt
index 9c44470ab..64b07b8b0 100644
--- a/doc/Section_errors.txt
+++ b/doc/Section_errors.txt
@@ -1,6614 +1,7280 @@
"Previous Section"_Section_python.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next
Section"_Section_history.html :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
12. Errors :h3
This section describes the errors you can encounter when using LAMMPS,
either conceptually, or as printed out by the program.
12.1 "Common problems"_#err_1
12.2 "Reporting bugs"_#err_2
12.3 "Error & warning messages"_#err_3 :all(b)
:line
:line
12.1 Common problems :link(err_1),h4
If two LAMMPS runs do not produce the same answer on different
machines or different numbers of processors, this is typically not a
bug. In theory you should get identical answers on any number of
processors and on any machine. In practice, numerical round-off can
cause slight differences and eventual divergence of molecular dynamics
phase space trajectories within a few 100s or few 1000s of timesteps.
However, the statistical properties of the two runs (e.g. average
energy or temperature) should still be the same.
If the "velocity"_velocity.html command is used to set initial atom
velocities, a particular atom can be assigned a different velocity
when the problem is run on a different number of processors or on
different machines. If this happens, the phase space trajectories of
the two simulations will rapidly diverge. See the discussion of the
{loop} option in the "velocity"_velocity.html command for details and
options that avoid this issue.
Similarly, the "create_atoms"_create_atoms.html command generates a
lattice of atoms. For the same physical system, the ordering and
numbering of atoms by atom ID may be different depending on the number
of processors.
Some commands use random number generators which may be setup to
produce different random number streams on each processor and hence
will produce different effects when run on different numbers of
processors. A commonly-used example is the "fix
langevin"_fix_langevin.html command for thermostatting.
A LAMMPS simulation typically has two stages, setup and run. Most
LAMMPS errors are detected at setup time; others like a bond
stretching too far may not occur until the middle of a run.
LAMMPS tries to flag errors and print informative error messages so
you can fix the problem. Of course, LAMMPS cannot figure out your
physics or numerical mistakes, like choosing too big a timestep,
specifying erroneous force field coefficients, or putting 2 atoms on
top of each other! If you run into errors that LAMMPS doesn't catch
that you think it should flag, please send an email to the
"developers"_http://lammps.sandia.gov/authors.html.
If you get an error message about an invalid command in your input
script, you can determine what command is causing the problem by
looking in the log.lammps file or using the "echo command"_echo.html
to see it on the screen. For a given command, LAMMPS expects certain
arguments in a specified order. If you mess this up, LAMMPS will
often flag the error, but it may read a bogus argument and assign a
value that is valid, but not what you wanted. E.g. trying to read the
string "abc" as an integer value and assigning the associated variable
a value of 0.
Generally, LAMMPS will print a message to the screen and logfile and
exit gracefully when it encounters a fatal error. Sometimes it will
print a WARNING to the screen and logfile and continue on; you can
decide if the WARNING is important or not. A WARNING message that is
generated in the middle of a run is only printed to the screen, not to
the logfile, to avoid cluttering up thermodynamic output. If LAMMPS
crashes or hangs without spitting out an error message first then it
could be a bug (see "this section"_#err_2) or one of the following
cases:
LAMMPS runs in the available memory a processor allows to be
allocated. Most reasonable MD runs are compute limited, not memory
limited, so this shouldn't be a bottleneck on most platforms. Almost
all large memory allocations in the code are done via C-style malloc's
which will generate an error message if you run out of memory.
Smaller chunks of memory are allocated via C++ "new" statements. If
you are unlucky you could run out of memory just when one of these
small requests is made, in which case the code will crash or hang (in
parallel), since LAMMPS doesn't trap on those errors.
Illegal arithmetic can cause LAMMPS to run slow or crash. This is
typically due to invalid physics and numerics that your simulation is
computing. If you see wild thermodynamic values or NaN values in your
LAMMPS output, something is wrong with your simulation. If you
suspect this is happening, it is a good idea to print out
thermodynamic info frequently (e.g. every timestep) via the
"thermo"_thermo.html so you can monitor what is happening.
Visualizing the atom movement is also a good idea to insure your model
is behaving as you expect.
In parallel, one way LAMMPS can hang is due to how different MPI
implementations handle buffering of messages. If the code hangs
without an error message, it may be that you need to specify an MPI
setting or two (usually via an environment variable) to enable
buffering or boost the sizes of messages that can be buffered.
:line
12.2 Reporting bugs :link(err_2),h4
If you are confident that you have found a bug in LAMMPS, follow these
steps.
Check the "New features and bug
fixes"_http://lammps.sandia.gov/bug.html section of the "LAMMPS WWW
site"_lws to see if the bug has already been reported or fixed or the
"Unfixed bug"_http://lammps.sandia.gov/unbug.html to see if a fix is
pending.
Check the "mailing list"_http://lammps.sandia.gov/mail.html
to see if it has been discussed before.
If not, send an email to the mailing list describing the problem with
any ideas you have as to what is causing it or where in the code the
problem might be. The developers will ask for more info if needed,
such as an input script or data files.
The most useful thing you can do to help us fix the bug is to isolate
the problem. Run it on the smallest number of atoms and fewest number
of processors and with the simplest input script that reproduces the
bug and try to identify what command or combination of commands is
causing the problem.
As a last resort, you can send an email directly to the
"developers"_http://lammps.sandia.gov/authors.html.
:line
12.3 Error & warning messages :h4,link(err_3)
These are two alphabetic lists of the "ERROR"_#error and
"WARNING"_#warn messages LAMMPS prints out and the reason why. If the
explanation here is not sufficient, the documentation for the
offending command may help.
Error and warning messages also list the source file and line number
where the error was generated. For example, this message
ERROR: Illegal velocity command (velocity.cpp:78)
means that line #78 in the file src/velocity.cpp generated the error.
Looking in the source code may help you figure out what went wrong.
Note that error messages from "user-contributed
packages"_Section_start.html#start_3 are not listed here. If such an
error occurs and is not self-explanatory, you'll need to look in the
source code or contact the author of the package.
Errors: :h4,link(error)
:dlb
{1-3 bond count is inconsistent} :dt
An inconsistency was detected when computing the number of 1-3
neighbors for each atom. This likely means something is wrong with
the bond topologies you have defined. :dd
{1-4 bond count is inconsistent} :dt
An inconsistency was detected when computing the number of 1-4
neighbors for each atom. This likely means something is wrong with
the bond topologies you have defined. :dd
-{Accelerated style in input script but no fix gpu} :dt
+{64-bit atom IDs are not yet supported} :dt
-GPU acceleration requires fix gpu in the input script. :dd
-
-{Accelerator sharing is not currently supported on system.} :dt
-
-You cannot use more MPI processes than accelerators on the
-system as currently configured. For NVIDIA GPUs, the compute
-mode must be changed using nvidia-smi to support sharing. :dd
+UNDOCUMENTED :dd
{All angle coeffs are not set} :dt
All angle coefficients must be set in the data file or by the
angle_coeff command before running a simulation. :dd
{All bond coeffs are not set} :dt
All bond coefficients must be set in the data file or by the
bond_coeff command before running a simulation. :dd
{All dihedral coeffs are not set} :dt
All dihedral coefficients must be set in the data file or by the
dihedral_coeff command before running a simulation. :dd
-{All dipole moments are not set} :dt
-
-For atom styles that define dipole moments for each atom type, all
-moments must be set in the data file or by the dipole command before
-running a simulation. :dd
-
{All improper coeffs are not set} :dt
All improper coefficients must be set in the data file or by the
improper_coeff command before running a simulation. :dd
{All masses are not set} :dt
For atom styles that define masses for each atom type, all masses must
be set in the data file or by the mass command before running a
simulation. They must also be set before using the velocity
command. :dd
{All pair coeffs are not set} :dt
All pair coefficients must be set in the data file or by the
pair_coeff command before running a simulation. :dd
-{All shapes are not set} :dt
-
-All atom types must have a shape setting, even if the particles
-are spherical. :dd
-
{All universe/uloop variables must have same # of values} :dt
Self-explanatory. :dd
{All variables in next command must be same style} :dt
Self-explanatory. :dd
{Angle atom missing in delete_bonds} :dt
The delete_bonds command cannot find one or more atoms in a particular
angle on a particular processor. The pairwise cutoff is too short or
the atoms are too far apart to make a valid angle. :dd
{Angle atom missing in set command} :dt
The set command cannot find one or more atoms in a particular angle on
a particular processor. The pairwise cutoff is too short or the atoms
are too far apart to make a valid angle. :dd
-{Angle atoms %d %d %d missing on proc %d at step} :dt
+{Angle atoms %d %d %d missing on proc %d at step %ld} :dt
One or more of 3 atoms needed to compute a particular angle are
missing on this processor. Typically this is because the pairwise
cutoff is set too short or the angle has blown apart and an atom is
-too far away. :dd
+too far away. :dd :dd
{Angle coeff for hybrid has invalid style} :dt
Angle style hybrid uses another angle style as one of its
coefficients. The angle style used in the angle_coeff command or read
from a restart file is not recognized. :dd
{Angle coeffs are not set} :dt
No angle coefficients have been assigned in the data file or via the
angle_coeff command. :dd
{Angle potential must be defined for SHAKE} :dt
When shaking angles, an angle_style potential must be used. :dd
{Angle style hybrid cannot have hybrid as an argument} :dt
Self-explanatory. :dd
{Angle style hybrid cannot have none as an argument} :dt
Self-explanatory. :dd
{Angle style hybrid cannot use same pair style twice} :dt
Self-explanatory. :dd
{Angle table must range from 0 to 180 degrees} :dt
Self-explanatory. :dd
{Angle table parameters did not set N} :dt
List of angle table parameters must include N setting. :dd
{Angle_coeff command before angle_style is defined} :dt
Coefficients cannot be set in the data file or via the angle_coeff
command until an angle_style has been assigned. :dd
{Angle_coeff command before simulation box is defined} :dt
The angle_coeff command cannot be used before a read_data,
read_restart, or create_box command. :dd
{Angle_coeff command when no angles allowed} :dt
The chosen atom style does not allow for angles to be defined. :dd
{Angle_style command when no angles allowed} :dt
The chosen atom style does not allow for angles to be defined. :dd
{Angles assigned incorrectly} :dt
Angles read in from the data file were not assigned correctly to
atoms. This means there is something invalid about the topology
definitions. :dd
{Angles defined but no angle types} :dt
The data file header lists angles but no angle types. :dd
{Another input script is already being processed} :dt
Cannot attempt to open a 2nd input script, when the original file is
still being processed. :dd
+{Append boundary must be shrink/minimum} :dt
+
+UNDOCUMENTED :dd
+
{Arccos of invalid value in variable formula} :dt
Argument of arccos() must be between -1 and 1. :dd
{Arcsin of invalid value in variable formula} :dt
Argument of arcsin() must be between -1 and 1. :dd
+{Assigning ellipsoid parameters to non-ellipsoid atom} :dt
+
+UNDOCUMENTED :dd
+
+{Assigning line parameters to non-line atom} :dt
+
+UNDOCUMENTED :dd
+
+{Assigning tri parameters to non-tri atom} :dt
+
+UNDOCUMENTED :dd
+
{Atom IDs must be consecutive for velocity create loop all} :dt
Self-explanatory. :dd
{Atom count changed in fix neb} :dt
This is not allowed in a NEB calculation. :dd
{Atom count is inconsistent, cannot write restart file} :dt
Sum of atoms across processors does not equal initial total count.
This is probably because you have lost some atoms. :dd
{Atom in too many rigid bodies - boost MAXBODY} :dt
Fix poems has a parameter MAXBODY (in fix_poems.cpp) which determines
the maximum number of rigid bodies a single atom can belong to (i.e. a
multibody joint). The bodies you have defined exceed this limit. :dd
{Atom sort did not operate correctly} :dt
This is an internal LAMMPS error. Please report it to the
developers. :dd
{Atom sorting has bin size = 0.0} :dt
The neighbor cutoff is being used as the bin size, but it is zero.
Thus you must explicitly list a bin size in the atom_modify sort
command or turn off sorting. :dd
{Atom style hybrid cannot have hybrid as an argument} :dt
Self-explanatory. :dd
{Atom style hybrid cannot use same atom style twice} :dt
Self-explanatory. :dd
{Atom vector in equal-style variable formula} :dt
Atom vectors generate one value per atom which is not allowed
in an equal-style variable. :dd
{Atom-style variable in equal-style variable formula} :dt
Atom-style variables generate one value per atom which is not allowed
in an equal-style variable. :dd
{Atom_modify map command after simulation box is defined} :dt
The atom_modify map command cannot be used after a read_data,
read_restart, or create_box command. :dd
{Atom_modify sort and first options cannot be used together} :dt
Self-explanatory. :dd
{Atom_style command after simulation box is defined} :dt
The atom_style command cannot be used after a read_data,
read_restart, or create_box command. :dd
+{Atom_style line can only be used in 2d simulations} :dt
+
+UNDOCUMENTED :dd
+
+{Atom_style tri can only be used in 3d simulations} :dt
+
+UNDOCUMENTED :dd
+
{Attempt to pop empty stack in fix box/relax} :dt
Internal LAMMPS error. Please report it to the developers. :dd
{Attempt to push beyond stack limit in fix box/relax} :dt
Internal LAMMPS error. Please report it to the developers. :dd
{Attempting to rescale a 0.0 temperature} :dt
Cannot rescale a temperature that is already 0.0. :dd
+{BAD VECLINE COUNT: %s: %d %d: %d %d\n} :dt
+
+UNDOCUMENTED :dd
+
+{BAD VECLINE PTRS: %s: %d %d: %d\n} :dt
+
+UNDOCUMENTED :dd
+
{Bad FENE bond} :dt
Two atoms in a FENE bond have become so far apart that the bond cannot
be computed. :dd
{Bad TIP4P angle type for PPPM/TIP4P} :dt
Specified angle type is not valid. :dd
{Bad TIP4P bond type for PPPM/TIP4P} :dt
Specified bond type is not valid. :dd
+{Bad fix ID in fix append_atoms command} :dt
+
+UNDOCUMENTED :dd
+
{Bad grid of processors} :dt
The 3d grid of processors defined by the processors command does not
match the number of processors LAMMPS is being run on. :dd
{Bad kspace_modify slab parameter} :dt
Kspace_modify value for the slab/volume keyword must be >= 2.0. :dd
+{Bad matrix inversion in mldivide3} :dt
+
+UNDOCUMENTED :dd
+
{Bad principal moments} :dt
Fix rigid did not compute the principal moments of inertia of a rigid
group of atoms correctly. :dd
+{Bad quadratic solve for particle/line collision} :dt
+
+UNDOCUMENTED :dd
+
+{Bad quadratic solve for particle/tri collision} :dt
+
+UNDOCUMENTED :dd
+
{Bias compute does not calculate a velocity bias} :dt
The specified compute must compute a bias for temperature. :dd
{Bias compute does not calculate temperature} :dt
The specified compute must compute temperature. :dd
{Bias compute group does not match compute group} :dt
The specified compute must operate on the same group as the parent
compute. :dd
{Big particle in fix srd cannot be point particle} :dt
Big particles must be extended spheriods or ellipsoids. :dd
{Bigint setting in lmptype.h is invalid} :dt
Size of bigint is less than size of tagint. :dd
{Bigint setting in lmptype.h is not compatible} :dt
Bigint stored in restart file is not consistent with LAMMPS version
you are running. :dd
{Bitmapped lookup tables require int/float be same size} :dt
Cannot use pair tables on this machine, because of word sizes. Use
the pair_modify command with table 0 instead. :dd
{Bitmapped table in file does not match requested table} :dt
Setting for bitmapped table in pair_coeff command must match table
in file exactly. :dd
{Bitmapped table is incorrect length in table file} :dt
Number of table entries is not a correct power of 2. :dd
{Bond and angle potentials must be defined for TIP4P} :dt
Cannot use TIP4P pair potential unless bond and angle potentials
are defined. :dd
{Bond atom missing in delete_bonds} :dt
The delete_bonds command cannot find one or more atoms in a particular
bond on a particular processor. The pairwise cutoff is too short or
the atoms are too far apart to make a valid bond. :dd
{Bond atom missing in set command} :dt
The set command cannot find one or more atoms in a particular bond on
a particular processor. The pairwise cutoff is too short or the atoms
are too far apart to make a valid bond. :dd
-{Bond atoms %d %d missing on proc %d at step} :dt
+{Bond atoms %d %d missing on proc %d at step %ld} :dt
One or both of 2 atoms needed to compute a particular bond are
missing on this processor. Typically this is because the pairwise
cutoff is set too short or the bond has blown apart and an atom is
-too far away. :dd
+too far away. :dd :dd
{Bond coeff for hybrid has invalid style} :dt
Bond style hybrid uses another bond style as one of its coefficients.
The bond style used in the bond_coeff command or read from a restart
file is not recognized. :dd
{Bond coeffs are not set} :dt
No bond coefficients have been assigned in the data file or via the
bond_coeff command. :dd
{Bond potential must be defined for SHAKE} :dt
Cannot use fix shake unless bond potential is defined. :dd
{Bond style hybrid cannot have hybrid as an argument} :dt
Self-explanatory. :dd
{Bond style hybrid cannot have none as an argument} :dt
Self-explanatory. :dd
{Bond style hybrid cannot use same pair style twice} :dt
Self-explanatory. :dd
{Bond style quartic cannot be used with 3,4-body interactions} :dt
No angle, dihedral, or improper styles can be defined when using
bond style quartic. :dd
{Bond style quartic requires special_bonds = 1,1,1} :dt
This is a restriction of the current bond quartic implementation. :dd
{Bond table parameters did not set N} :dt
List of bond table parameters must include N setting. :dd
{Bond table values are not increasing} :dt
The values in the tabulated file must be monotonically increasing. :dd
{Bond_coeff command before bond_style is defined} :dt
Coefficients cannot be set in the data file or via the bond_coeff
command until an bond_style has been assigned. :dd
{Bond_coeff command before simulation box is defined} :dt
The bond_coeff command cannot be used before a read_data,
read_restart, or create_box command. :dd
{Bond_coeff command when no bonds allowed} :dt
The chosen atom style does not allow for bonds to be defined. :dd
{Bond_style command when no bonds allowed} :dt
The chosen atom style does not allow for bonds to be defined. :dd
{Bonds assigned incorrectly} :dt
Bonds read in from the data file were not assigned correctly to atoms.
This means there is something invalid about the topology definitions. :dd
{Bonds defined but no bond types} :dt
The data file header lists bonds but no bond types. :dd
{Both sides of boundary must be periodic} :dt
Cannot specify a boundary as periodic only on the lo or hi side. Must
be periodic on both sides. :dd
{Boundary command after simulation box is defined} :dt
The boundary command cannot be used after a read_data, read_restart,
or create_box command. :dd
{Box bounds are invalid} :dt
The box boundaries specified in the read_data file are invalid. The
lo value must be less than the hi value for all 3 dimensions. :dd
{Can not specify Pxy/Pxz/Pyz in fix box/relax with non-triclinic box} :dt
Only triclinic boxes can be used with off-diagonal pressure components.
See the region prism command for details. :dd
{Can not specify Pxy/Pxz/Pyz in fix nvt/npt/nph with non-triclinic box} :dt
Only triclinic boxes can be used with off-diagonal pressure components.
See the region prism command for details. :dd
+{Can only use -plog with multiple partitions} :dt
+
+UNDOCUMENTED :dd
+
+{Can only use -pscreen with multiple partitions} :dt
+
+UNDOCUMENTED :dd
+
{Can only use NEB with 1-processor replicas} :dt
This is current restriction for NEB as implemented in LAMMPS. :dd
{Can only use TAD with 1-processor replicas for NEB} :dt
This is current restriction for NEB as implemented in LAMMPS. :dd
{Cannot (yet) use PPPM with triclinic box} :dt
This feature is not yet supported. :dd
{Cannot add atoms to fix move variable} :dt
Atoms can not be added afterwards to this fix option. :dd
+{Cannot append atoms to a triclinic box} :dt
+
+UNDOCUMENTED :dd
+
{Cannot change box to orthogonal when tilt is non-zero} :dt
Self-explanatory :dd
{Cannot change box with certain fixes defined} :dt
The change_box command cannot be used when fix ave/spatial or
fix/deform are defined . :dd
{Cannot change box with dumps defined} :dt
Self-explanatory. :dd
{Cannot change dump_modify every for dump dcd} :dt
The frequency of writing dump dcd snapshots cannot be changed. :dd
{Cannot change dump_modify every for dump xtc} :dt
The frequency of writing dump xtc snapshots cannot be changed. :dd
{Cannot change timestep once fix srd is setup} :dt
This is because various SRD properties depend on the timestep
size. :dd
{Cannot change timestep with fix pour} :dt
This fix pre-computes some values based on the timestep, so it cannot
be changed during a simulation run. :dd
{Cannot compute PPPM G} :dt
LAMMPS failed to compute a valid approximation for the PPPM g_ewald
factor that partitions the computation between real space and k-space. :dd
{Cannot create an atom map unless atoms have IDs} :dt
The simulation requires a mapping from global atom IDs to local atoms,
but the atoms that have been defined have no IDs. :dd
{Cannot create atoms with undefined lattice} :dt
Must use the lattice command before using the create_atoms
command. :dd
{Cannot create/grow a vector/array of pointers for %s} :dt
LAMMPS code is making an illegal call to the templated memory
allocaters, to create a vector or array of pointers. :dd
{Cannot create_atoms after reading restart file with per-atom info} :dt
The per-atom info was stored to be used when by a fix that you
may re-define. If you add atoms before re-defining the fix, then
there will not be a correct amount of per-atom info. :dd
{Cannot create_box after simulation box is defined} :dt
The create_box command cannot be used after a read_data, read_restart,
or create_box command. :dd
{Cannot currently use pair reax with pair hybrid} :dt
This is not yet supported. :dd
{Cannot delete group all} :dt
Self-explanatory. :dd
{Cannot delete group currently used by a compute} :dt
Self-explanatory. :dd
{Cannot delete group currently used by a dump} :dt
Self-explanatory. :dd
{Cannot delete group currently used by a fix} :dt
Self-explanatory. :dd
{Cannot delete group currently used by atom_modify first} :dt
Self-explanatory. :dd
{Cannot displace_atoms after reading restart file with per-atom info} :dt
This is because the restart file info cannot be migrated with the
atoms. You can get around this by performing a 0-timestep run which
will assign the restart file info to actual atoms. :dd
{Cannot displace_box after reading restart file with per-atom info} :dt
This is because the restart file info cannot be migrated with the
atoms. You can get around this by performing a 0-timestep run which
will assign the restart file info to actual atoms. :dd
{Cannot displace_box on a non-periodic boundary} :dt
Self-explanatory. :dd
+{Cannot do GCMC on atoms in atom_modify first group} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot dump JPG file} :dt
+
+UNDOCUMENTED :dd
+
{Cannot dump sort on atom IDs with no atom IDs defined} :dt
Self-explanatory. :dd
{Cannot evaporate atoms in atom_modify first group} :dt
This is a restriction due to the way atoms are organized in
a list to enable the atom_modify first command. :dd
{Cannot find delete_bonds group ID} :dt
Group ID used in the delete_bonds command does not exist. :dd
{Cannot have both pair_modify shift and tail set to yes} :dt
These 2 options are contradictory. :dd
+{Cannot open -reorder file} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot open ADP potential file %s} :dt
+
+UNDOCUMENTED :dd
+
{Cannot open AIREBO potential file %s} :dt
The specified AIREBO potential file cannot be opened. Check that the
path and name are correct. :dd
{Cannot open COMB potential file %s} :dt
The specified COMB potential file cannot be opened. Check that the
path and name are correct. :dd
{Cannot open EAM potential file %s} :dt
The specified EAM potential file cannot be opened. Check that the
path and name are correct. :dd
{Cannot open EIM potential file %s} :dt
The specified EIM potential file cannot be opened. Check that the
path and name are correct. :dd
{Cannot open MEAM potential file %s} :dt
The specified MEAM potential file cannot be opened. Check that the
path and name are correct. :dd
{Cannot open Stillinger-Weber potential file %s} :dt
The specified SW potential file cannot be opened. Check that the path
and name are correct. :dd
{Cannot open Tersoff potential file %s} :dt
The specified Tersoff potential file cannot be opened. Check that the
path and name are correct. :dd
+{Cannot open custom file} :dt
+
+UNDOCUMENTED :dd
+
{Cannot open dir to search for restart file} :dt
Using a "*" in the name of the restart file will open the current
directory to search for matching file names. :dd
{Cannot open dump file} :dt
The output file for the dump command cannot be opened. Check that the
path and name are correct. :dd
{Cannot open file %s} :dt
The specified file cannot be opened. Check that the path and name are
correct. :dd
{Cannot open fix ave/correlate file %s} :dt
The specified file cannot be opened. Check that the path and name are
correct. :dd
{Cannot open fix ave/histo file %s} :dt
The specified file cannot be opened. Check that the path and name are
correct. :dd
{Cannot open fix ave/spatial file %s} :dt
The specified file cannot be opened. Check that the path and name are
correct. :dd
{Cannot open fix ave/time file %s} :dt
The specified file cannot be opened. Check that the path and name are
correct. :dd
{Cannot open fix poems file %s} :dt
The specified file cannot be opened. Check that the path and name are
correct. :dd
{Cannot open fix print file %s} :dt
The output file generated by the fix print command cannot be opened :dd
{Cannot open fix qeq/comb file %s} :dt
The output file for the fix qeq/combs command cannot be opened.
Check that the path and name are correct. :dd
{Cannot open fix reax/bonds file %s} :dt
The output file for the fix reax/bonds command cannot be opened.
Check that the path and name are correct. :dd
{Cannot open fix tmd file %s} :dt
The output file for the fix tmd command cannot be opened. Check that
the path and name are correct. :dd
{Cannot open fix ttm file %s} :dt
The output file for the fix ttm command cannot be opened. Check that
the path and name are correct. :dd
{Cannot open gzipped file} :dt
LAMMPS is attempting to open a gzipped version of the specified file
but was unsuccessful. Check that the path and name are correct. :dd
{Cannot open input script %s} :dt
Self-explanatory. :dd
{Cannot open log.lammps} :dt
The default LAMMPS log file cannot be opened. Check that the
directory you are running in allows for files to be created. :dd
-{Cannot open logfile %s} :dt
+{Cannot open logfile} :dt
-The LAMMPS log file specified in the input script cannot be opened.
+The LAMMPS log file named in a command-line argument cannot be opened.
Check that the path and name are correct. :dd
-{Cannot open logfile} :dt
+{Cannot open logfile %s} :dt
-The LAMMPS log file named in a command-line argument cannot be opened.
+The LAMMPS log file specified in the input script cannot be opened.
Check that the path and name are correct. :dd
{Cannot open pair_write file} :dt
The specified output file for pair energies and forces cannot be
opened. Check that the path and name are correct. :dd
+{Cannot open processors custom file} :dt
+
+UNDOCUMENTED :dd
+
{Cannot open restart file %s} :dt
Self-explanatory. :dd
{Cannot open screen file} :dt
The screen file specified as a command-line argument cannot be
opened. Check that the directory you are running in allows for files
to be created. :dd
{Cannot open universe log file} :dt
For a multi-partition run, the master log file cannot be opened.
Check that the directory you are running in allows for files to be
created. :dd
{Cannot open universe screen file} :dt
For a multi-partition run, the master screen file cannot be opened.
Check that the directory you are running in allows for files to be
created. :dd
{Cannot read_data after simulation box is defined} :dt
The read_data command cannot be used after a read_data,
read_restart, or create_box command. :dd
{Cannot read_restart after simulation box is defined} :dt
The read_restart command cannot be used after a read_data,
read_restart, or create_box command. :dd
{Cannot redefine variable as a different style} :dt
An equal-style variable can be re-defined but only if it was
originally an equal-style variable. :dd
{Cannot replicate 2d simulation in z dimension} :dt
The replicate command cannot replicate a 2d simulation in the z
dimension. :dd
{Cannot replicate with fixes that store atom quantities} :dt
Either fixes are defined that create and store atom-based vectors or a
restart file was read which included atom-based vectors for fixes.
The replicate command cannot duplicate that information for new atoms.
You should use the replicate command before fixes are applied to the
system. :dd
{Cannot reset timestep with a dynamic region defined} :dt
Dynamic regions (see the region command) have a time dependence.
Thus you cannot change the timestep when one or more of these
are defined. :dd
{Cannot reset timestep with a time-dependent fix defined} :dt
You cannot reset the timestep when a fix that keeps track of elapsed
time is in place. :dd
{Cannot reset timestep with dump file already written to} :dt
Changing the timestep will confuse when a dump file is written. Use
the undump command, then restart the dump file. :dd
{Cannot reset timestep with restart file already written} :dt
Changing the timestep will confuse when a restart file is written.
Use the "restart 0" command to turn off restarts, then start them
again. :dd
{Cannot restart fix rigid/nvt with different # of chains} :dt
This is because the restart file contains per-chain info. :dd
{Cannot run 2d simulation with nonperiodic Z dimension} :dt
Use the boundary command to make the z dimension periodic in order to
run a 2d simulation. :dd
{Cannot set both respa pair and inner/middle/outer} :dt
In the rRESPA integrator, you must compute pairwise potentials either
all together (pair), or in pieces (inner/middle/outer). You can't do
both. :dd
-{Cannot set dipole for this atom style} :dt
-
-This atom style does not support dipole settings for each atom type. :dd
-
{Cannot set dump_modify flush for dump xtc} :dt
Self-explanatory. :dd
{Cannot set mass for this atom style} :dt
This atom style does not support mass settings for each atom type.
Instead they are defined on a per-atom basis in the data file. :dd
+{Cannot set meso_rho for this atom style} :dt
+
+UNDOCUMENTED :dd
+
{Cannot set non-zero image flag for non-periodic dimension} :dt
Self-explanatory. :dd
{Cannot set non-zero z velocity for 2d simulation} :dt
Self-explanatory. :dd
+{Cannot set quaternion for atom that has none} :dt
+
+UNDOCUMENTED :dd
+
{Cannot set respa middle without inner/outer} :dt
In the rRESPA integrator, you must define both a inner and outer
setting in order to use a middle setting. :dd
-{Cannot set shape for this atom style} :dt
+{Cannot set theta for atom that is not a line} :dt
-The atom style does not support this setting. :dd
+UNDOCUMENTED :dd
{Cannot set this attribute for this atom style} :dt
The attribute being set does not exist for the defined atom style. :dd
{Cannot set variable z velocity for 2d simulation} :dt
Self-explanatory. :dd
{Cannot skew triclinic box in z for 2d simulation} :dt
Self-explanatory. :dd
+{Cannot use -cuda on without USER-CUDA installed} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use -reorder after -partition} :dt
+
+UNDOCUMENTED :dd
+
{Cannot use Ewald with 2d simulation} :dt
The kspace style ewald cannot be used in 2d simulations. You can use
2d Ewald in a 3d simulation; see the kspace_modify command. :dd
{Cannot use Ewald with triclinic box} :dt
This feature is not yet supported. :dd
{Cannot use NEB unless atom map exists} :dt
Use the atom_modify command to create an atom map. :dd
{Cannot use NEB with a single replica} :dt
Self-explanatory. :dd
{Cannot use NEB with atom_modify sort enabled} :dt
This is current restriction for NEB implemented in LAMMPS. :dd
{Cannot use PPPM with 2d simulation} :dt
The kspace style pppm cannot be used in 2d simulations. You can use
2d PPPM in a 3d simulation; see the kspace_modify command. :dd
{Cannot use PRD with a time-dependent fix defined} :dt
PRD alters the timestep in ways that will mess up these fixes. :dd
{Cannot use PRD with a time-dependent region defined} :dt
PRD alters the timestep in ways that will mess up these regions. :dd
{Cannot use PRD with atom_modify sort enabled} :dt
This is a current restriction of PRD. You must turn off sorting,
which is enabled by default, via the atom_modify command. :dd
{Cannot use PRD with multi-processor replicas unless atom map exists} :dt
Use the atom_modify command to create an atom map. :dd
{Cannot use TAD unless atom map exists for NEB} :dt
See atom_modify map command to set this. :dd
{Cannot use TAD with a single replica for NEB} :dt
NEB requires multiple replicas. :dd
{Cannot use TAD with atom_modify sort enabled for NEB} :dt
This is a current restriction of NEB. :dd
{Cannot use a damped dynamics min style with fix box/relax} :dt
This is a current restriction in LAMMPS. Use another minimizer
style. :dd
{Cannot use a damped dynamics min style with per-atom DOF} :dt
This is a current restriction in LAMMPS. Use another minimizer
style. :dd
+{Cannot use append_atoms in periodic dimension} :dt
+
+UNDOCUMENTED :dd
+
{Cannot use compute cluster/atom unless atoms have IDs} :dt
Atom IDs are used to identify clusters. :dd
{Cannot use cwiggle in variable formula between runs} :dt
This is a function of elapsed time. :dd
{Cannot use delete_atoms unless atoms have IDs} :dt
Your atoms do not have IDs, so the delete_atoms command cannot be
used. :dd
{Cannot use delete_bonds with non-molecular system} :dt
Your choice of atom style does not have bonds. :dd
+{Cannot use fix GPU with USER-CUDA mode enabled} :dt
+
+UNDOCUMENTED :dd
+
{Cannot use fix TMD unless atom map exists} :dt
Using this fix requires the ability to lookup an atom index, which is
provided by an atom map. An atom map does not exist (by default) for
non-molecular problems. Using the atom_modify map command will force
an atom map to be created. :dd
{Cannot use fix ave/spatial z for 2 dimensional model} :dt
Self-explanatory. :dd
{Cannot use fix bond/break with non-molecular systems} :dt
Self-explanatory. :dd
{Cannot use fix bond/create with non-molecular systems} :dt
Self-explanatory. :dd
{Cannot use fix box/relax on a 2nd non-periodic dimension} :dt
When specifying an off-diagonal pressure component, the 2nd of the two
dimensions must be periodic. E.g. if the xy component is specified,
then the y dimension must be periodic. :dd
{Cannot use fix box/relax on a non-periodic dimension} :dt
When specifying a diagonal pressure component, the dimension must be
periodic. :dd
{Cannot use fix deform on a 2nd non-periodic boundary} :dt
When specifying a tilt factor change, the 2nd of the two dimensions
must be periodic. E.g. if the xy tilt is specified, then the y
dimension must be periodic. :dd
{Cannot use fix deform on a non-periodic boundary} :dt
When specifying a change is a box dimension, the dimension must be
periodic. :dd
{Cannot use fix deform trate on a box with zero tilt} :dt
The trate style alters the current strain. :dd
{Cannot use fix enforce2d with 3d simulation} :dt
Self-explanatory. :dd
{Cannot use fix msst without per-type mass defined} :dt
Self-explanatory. :dd
{Cannot use fix npt and fix deform on same component of stress tensor} :dt
This would be changing the same box dimension twice. :dd
{Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension} :dt
When specifying an off-diagonal pressure component, the 2nd of the two
dimensions must be periodic. E.g. if the xy component is specified,
then the y dimension must be periodic. :dd
{Cannot use fix nvt/npt/nph on a non-periodic dimension} :dt
When specifying a diagonal pressure component, the dimension must be
periodic. :dd
+{Cannot use fix nvt/npt/nph with both xy dynamics and xy scaling} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use fix nvt/npt/nph with both xz dynamics and xz scaling} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use fix nvt/npt/nph with xy dynamics when y is non-periodic dimension} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use fix nvt/npt/nph with xz dynamics when z is non-periodic dimension} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use fix nvt/npt/nph with yz dynamics when z is non-periodic dimension} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use fix nvt/npt/nph withboth yz dynamics and yz scaling} :dt
+
+UNDOCUMENTED :dd
+
{Cannot use fix pour with triclinic box} :dt
This feature is not yet supported. :dd
{Cannot use fix press/berendsen and fix deform on same component of stress tensor} :dt
These commands both change the box size/shape, so you cannot use both
together. :dd
{Cannot use fix press/berendsen on a non-periodic dimension} :dt
Self-explanatory. :dd
{Cannot use fix press/berendsen with triclinic box} :dt
Self-explanatory. :dd
{Cannot use fix reax/bonds without pair_style reax} :dt
Self-explantory. :dd
{Cannot use fix shake with non-molecular system} :dt
Your choice of atom style does not have bonds. :dd
{Cannot use fix ttm with 2d simulation} :dt
This is a current restriction of this fix due to the grid it creates. :dd
{Cannot use fix ttm with triclinic box} :dt
This is a current restriction of this fix due to the grid it creates. :dd
{Cannot use fix wall in periodic dimension} :dt
Self-explanatory. :dd
{Cannot use fix wall zlo/zhi for a 2d simulation} :dt
Self-explanatory. :dd
{Cannot use fix wall/reflect in periodic dimension} :dt
Self-explanatory. :dd
{Cannot use fix wall/reflect zlo/zhi for a 2d simulation} :dt
Self-explanatory. :dd
{Cannot use fix wall/srd in periodic dimension} :dt
Self-explanatory. :dd
{Cannot use fix wall/srd more than once} :dt
Nor is their a need to since multiple walls can be specified
in one command. :dd
{Cannot use fix wall/srd without fix srd} :dt
Self-explanatory. :dd
{Cannot use fix wall/srd zlo/zhi for a 2d simulation} :dt
Self-explanatory. :dd
+{Cannot use force/hybrid_neigh with triclinic box} :dt
+
+UNDOCUMENTED :dd
+
{Cannot use force/neigh with triclinic box} :dt
This is a current limitation of the GPU implementation
in LAMMPS. :dd
{Cannot use kspace solver on system with no charge} :dt
No atoms in system have a non-zero charge. :dd
+{Cannot use lines with fix srd unless overlap is set} :dt
+
+UNDOCUMENTED :dd
+
{Cannot use neigh_modify exclude with GPU neighbor builds} :dt
This is a current limitation of the GPU implementation
in LAMMPS. :dd
{Cannot use neighbor bins - box size << cutoff} :dt
Too many neighbor bins will be created. This typically happens when
the simulation box is very small in some dimension, compared to the
neighbor cutoff. Use the "nsq" style instead of "bin" style. :dd
-{Cannot use newton pair with GPU CHARMM pair style} :dt
+{Cannot use newton pair with coul/long/gpu pair style} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use newton pair with gayberne/gpu pair style} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use newton pair with lj/charmm/coul/long/gpu pair style} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use newton pair with lj/class2/coul/long/gpu pair style} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use newton pair with lj/class2/gpu pair style} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use newton pair with lj/cut/coul/cut/gpu pair style} :dt
-See the newton command to change the setting. :dd
+UNDOCUMENTED :dd
-{Cannot use newton pair with GPU Gay-Berne pair style} :dt
+{Cannot use newton pair with lj/cut/coul/long/gpu pair style} :dt
-See the newton command to change the setting. :dd
+UNDOCUMENTED :dd
-{Cannot use newton pair with GPU LJ pair style} :dt
+{Cannot use newton pair with lj/cut/gpu pair style} :dt
-See the newton command to change the setting. :dd
+UNDOCUMENTED :dd
-{Cannot use newton pair with GPU LJ96 pair style} :dt
+{Cannot use newton pair with lj/expand/gpu pair style} :dt
-See the newton command to change the setting. :dd
+UNDOCUMENTED :dd
+
+{Cannot use newton pair with lj96/cut/gpu pair style} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use newton pair with morse/gpu pair style} :dt
+
+UNDOCUMENTED :dd
+
+{Cannot use newton pair with resquared/gpu pair style} :dt
+
+UNDOCUMENTED :dd
{Cannot use non-zero forces in an energy minimization} :dt
Fix setforce cannot be used in this manner. Use fix addforce
instead. :dd
{Cannot use nonperiodic boundares with fix ttm} :dt
This fix requires a fully periodic simulation box. :dd
{Cannot use nonperiodic boundaries with Ewald} :dt
For kspace style ewald, all 3 dimensions must have periodic boundaries
unless you use the kspace_modify command to define a 2d slab with a
non-periodic z dimension. :dd
{Cannot use nonperiodic boundaries with PPPM} :dt
For kspace style pppm, all 3 dimensions must have periodic boundaries
unless you use the kspace_modify command to define a 2d slab with a
non-periodic z dimension. :dd
+{Cannot use order greater than 8 with pppm/gpu.} :dt
+
+UNDOCUMENTED :dd
+
{Cannot use pair hybrid with GPU neighbor builds} :dt
See documentation for fix gpu. :dd
{Cannot use pair tail corrections with 2d simulations} :dt
The correction factors are only currently defined for 3d systems. :dd
+{Cannot use processors part command without using partitions} :dt
+
+UNDOCUMENTED :dd
+
{Cannot use ramp in variable formula between runs} :dt
This is because the ramp() function is time dependent. :dd
{Cannot use region INF or EDGE when box does not exist} :dt
Regions that extend to the box boundaries can only be used after the
create_box command has been used. :dd
{Cannot use set atom with no atom IDs defined} :dt
Atom IDs are not defined, so they cannot be used to identify an atom. :dd
+{Cannot use set mol with no molecule IDs defined} :dt
+
+UNDOCUMENTED :dd
+
{Cannot use swiggle in variable formula between runs} :dt
This is a function of elapsed time. :dd
+{Cannot use tris with fix srd unless overlap is set} :dt
+
+UNDOCUMENTED :dd
+
{Cannot use variable energy with constant force in fix addforce} :dt
This is because for constant force, LAMMPS can compute the change
in energy directly. :dd
{Cannot use variable every setting for dump dcd} :dt
The format of DCD dump files requires snapshots be output
at a constant frequency. :dd
{Cannot use variable every setting for dump xtc} :dt
The format of this file requires snapshots at regular intervals. :dd
{Cannot use vdisplace in variable formula between runs} :dt
This is a function of elapsed time. :dd
{Cannot use velocity create loop all unless atoms have IDs} :dt
Atoms in the simulation to do not have IDs, so this style
of velocity creation cannot be performed. :dd
{Cannot use wall in periodic dimension} :dt
Self-explanatory. :dd
{Cannot wiggle and shear fix wall/gran} :dt
Cannot specify both options at the same time. :dd
+{Cannot zero Langevin force of 0 atoms} :dt
+
+UNDOCUMENTED :dd
+
{Cannot zero momentum of 0 atoms} :dt
The collection of atoms for which momentum is being computed has no
atoms. :dd
{Change_box command before simulation box is defined} :dt
Self-explanatory. :dd
{Change_box operation is invalid} :dt
Cannot change orthogonal box to orthogonal or a triclinic box to
triclinic. :dd
{Communicate group != atom_modify first group} :dt
Self-explanatory. :dd
{Compute ID for compute atom/molecule does not exist} :dt
Self-explanatory. :dd
{Compute ID for compute reduce does not exist} :dt
Self-explanatory. :dd
+{Compute ID for compute slice does not exist} :dt
+
+UNDOCUMENTED :dd
+
{Compute ID for fix ave/atom does not exist} :dt
Self-explanatory. :dd
{Compute ID for fix ave/correlate does not exist} :dt
Self-explanatory. :dd
{Compute ID for fix ave/histo does not exist} :dt
Self-explanatory. :dd
{Compute ID for fix ave/spatial does not exist} :dt
Self-explanatory. :dd
{Compute ID for fix ave/time does not exist} :dt
Self-explanatory. :dd
{Compute ID for fix store/state does not exist} :dt
Self-explanatory. :dd
{Compute ID must be alphanumeric or underscore characters} :dt
Self-explanatory. :dd
{Compute angle/local used when angles are not allowed} :dt
The atom style does not support angles. :dd
{Compute atom/molecule compute array is accessed out-of-range} :dt
Self-explanatory. :dd
{Compute atom/molecule compute does not calculate a per-atom array} :dt
Self-explanatory. :dd
{Compute atom/molecule compute does not calculate a per-atom vector} :dt
Self-explanatory. :dd
{Compute atom/molecule compute does not calculate per-atom values} :dt
Self-explanatory. :dd
{Compute atom/molecule fix array is accessed out-of-range} :dt
Self-explanatory. :dd
{Compute atom/molecule fix does not calculate a per-atom array} :dt
Self-explanatory. :dd
{Compute atom/molecule fix does not calculate a per-atom vector} :dt
Self-explanatory. :dd
{Compute atom/molecule fix does not calculate per-atom values} :dt
Self-explanatory. :dd
{Compute atom/molecule requires molecular atom style} :dt
Self-explanatory. :dd
{Compute atom/molecule variable is not atom-style variable} :dt
Self-explanatory. :dd
{Compute bond/local used when bonds are not allowed} :dt
The atom style does not support bonds. :dd
{Compute centro/atom requires a pair style be defined} :dt
This is because the computation of the centro-symmetry values
uses a pairwise neighbor list. :dd
{Compute cluster/atom cutoff is longer than pairwise cutoff} :dt
Cannot identify clusters beyond cutoff. :dd
{Compute cluster/atom requires a pair style be defined} :dt
This is so that the pair style defines a cutoff distance which
is used to find clusters. :dd
{Compute cna/atom cutoff is longer than pairwise cutoff} :dt
Self-explantory. :dd
{Compute cna/atom requires a pair style be defined} :dt
Self-explantory. :dd
{Compute com/molecule requires molecular atom style} :dt
Self-explanatory. :dd
{Compute coord/atom cutoff is longer than pairwise cutoff} :dt
Cannot compute coordination at distances longer than the pair cutoff,
since those atoms are not in the neighbor list. :dd
{Compute coord/atom requires a pair style be defined} :dt
Self-explantory. :dd
{Compute damage/atom requires peridynamic potential} :dt
Damage is a Peridynamic-specific metric. It requires you
to be running a Peridynamics simulation. :dd
{Compute dihedral/local used when dihedrals are not allowed} :dt
The atom style does not support dihedrals. :dd
{Compute does not allow an extra compute or fix to be reset} :dt
This is an internal LAMMPS error. Please report it to the
developers. :dd
-{Compute erotate/asphere cannot be used with atom attributes diameter or rmass} :dt
-
-These attributes override the shape and mass settings, so cannot be
-used. :dd
-
-{Compute erotate/asphere requires atom attributes angmom, quat, shape} :dt
+{Compute erotate/asphere requires atom style ellipsoid or line or tri} :dt
-An atom style that defines these attributes must be used. :dd
+UNDOCUMENTED :dd
{Compute erotate/asphere requires extended particles} :dt
This compute cannot be used with point paritlces. :dd
-{Compute erotate/sphere requires atom attribute omega} :dt
-
-An atom style that defines this attribute must be used. :dd
-
-{Compute erotate/sphere requires atom attribute radius or shape} :dt
+{Compute erotate/sphere requires atom style sphere} :dt
-An atom style that defines these attributes must be used. :dd
-
-{Compute erotate/sphere requires spherical particle shapes} :dt
-
-Self-explanatory. :dd
+UNDOCUMENTED :dd
{Compute event/displace has invalid fix event assigned} :dt
This is an internal LAMMPS error. Please report it to the
developers. :dd
{Compute group/group group ID does not exist} :dt
Self-explanatory. :dd
{Compute gyration/molecule requires molecular atom style} :dt
Self-explanatory. :dd
{Compute heat/flux compute ID does not compute ke/atom} :dt
Self-explanatory. :dd
{Compute heat/flux compute ID does not compute pe/atom} :dt
Self-explanatory. :dd
{Compute heat/flux compute ID does not compute stress/atom} :dt
Self-explanatory. :dd
{Compute improper/local used when impropers are not allowed} :dt
The atom style does not support impropers. :dd
{Compute msd/molecule requires molecular atom style} :dt
Self-explanatory. :dd
+{Compute nve/asphere requires atom style ellipsoid} :dt
+
+UNDOCUMENTED :dd
+
+{Compute nvt/nph/npt asphere requires atom style ellipsoid} :dt
+
+UNDOCUMENTED :dd
+
{Compute pair must use group all} :dt
Pair styles accumlate energy on all atoms. :dd
{Compute pe must use group all} :dt
Energies computed by potentials (pair, bond, etc) are computed on all
atoms. :dd
{Compute pressure must use group all} :dt
Virial contributions computed by potentials (pair, bond, etc) are
computed on all atoms. :dd
{Compute pressure temperature ID does not compute temperature} :dt
The compute ID assigned to a pressure computation must compute
temperature. :dd
{Compute property/atom for atom property that isn't allocated} :dt
Self-explanatory. :dd
{Compute property/local cannot use these inputs together} :dt
Only inputs that generate the same number of datums can be used
togther. E.g. bond and angle quantities cannot be mixed. :dd
{Compute property/local for property that isn't allocated} :dt
Self-explanatory. :dd
{Compute property/molecule requires molecular atom style} :dt
Self-explanatory. :dd
{Compute rdf requires a pair style be defined} :dt
Self-explanatory. :dd
{Compute reduce compute array is accessed out-of-range} :dt
Self-explanatory. :dd
{Compute reduce compute calculates global values} :dt
A compute that calculates peratom or local values is required. :dd
{Compute reduce compute does not calculate a local array} :dt
Self-explanatory. :dd
{Compute reduce compute does not calculate a local vector} :dt
Self-explanatory. :dd
{Compute reduce compute does not calculate a per-atom array} :dt
Self-explanatory. :dd
{Compute reduce compute does not calculate a per-atom vector} :dt
Self-explanatory. :dd
{Compute reduce fix array is accessed out-of-range} :dt
Self-explanatory. :dd
{Compute reduce fix calculates global values} :dt
A fix that calculates peratom or local values is required. :dd
{Compute reduce fix does not calculate a local array} :dt
Self-explanatory. :dd
{Compute reduce fix does not calculate a local vector} :dt
Self-explanatory. :dd
{Compute reduce fix does not calculate a per-atom array} :dt
Self-explanatory. :dd
{Compute reduce fix does not calculate a per-atom vector} :dt
Self-explanatory. :dd
{Compute reduce replace requires min or max mode} :dt
Self-explanatory. :dd
{Compute reduce variable is not atom-style variable} :dt
Self-explanatory. :dd
-{Compute temp/asphere cannot be used with atom attributes diameter or rmass} :dt
+{Compute slice compute array is accessed out-of-range} :dt
-These attributes override the shape and mass settings, so cannot be
-used. :dd
+UNDOCUMENTED :dd
-{Compute temp/asphere requires atom attributes angmom, quat, shape} :dt
+{Compute slice compute does not calculate a global array} :dt
-An atom style that defines these attributes must be used. :dd
+UNDOCUMENTED :dd
+
+{Compute slice compute does not calculate a global vector} :dt
+
+UNDOCUMENTED :dd
+
+{Compute slice compute does not calculate global vector or array} :dt
+
+UNDOCUMENTED :dd
+
+{Compute slice compute vector is accessed out-of-range} :dt
+
+UNDOCUMENTED :dd
+
+{Compute slice fix array is accessed out-of-range} :dt
+
+UNDOCUMENTED :dd
+
+{Compute slice fix does not calculate a global array} :dt
+
+UNDOCUMENTED :dd
+
+{Compute slice fix does not calculate a global vector} :dt
+
+UNDOCUMENTED :dd
+
+{Compute slice fix does not calculate global vector or array} :dt
+
+UNDOCUMENTED :dd
+
+{Compute slice fix vector is accessed out-of-range} :dt
+
+UNDOCUMENTED :dd
+
+{Compute temp/asphere requires atom style ellipsoid} :dt
+
+UNDOCUMENTED :dd
{Compute temp/asphere requires extended particles} :dt
This compute cannot be used with point paritlces. :dd
{Compute temp/partial cannot use vz for 2d systemx} :dt
Self-explanatory. :dd
{Compute temp/profile cannot bin z for 2d systems} :dt
Self-explanatory. :dd
{Compute temp/profile cannot use vz for 2d systemx} :dt
Self-explanatory. :dd
-{Compute temp/sphere requires atom attribute omega} :dt
-
-An atom style that defines this attribute must be used. :dd
-
-{Compute temp/sphere requires atom attribute radius or shape} :dt
-
-An atom style that defines these attributes must be used. :dd
+{Compute temp/sphere requires atom style sphere} :dt
-{Compute temp/sphere requires spherical particle shapes} :dt
-
-Self-explanatory. :dd
+UNDOCUMENTED :dd
{Compute ti kspace style does not exist} :dt
Self-explanatory. :dd
{Compute ti pair style does not exist} :dt
Self-explanatory. :dd
{Compute ti tail when pair style does not compute tail corrections} :dt
Self-explanatory. :dd
{Compute used in variable between runs is not current} :dt
Computes cannot be invoked by a variable in between runs. Thus they
must have been evaluated on the last timestep of the previous run in
order for their value(s) to be accessed. See the doc page for the
variable command for more info. :dd
{Compute used in variable thermo keyword between runs is not current} :dt
Some thermo keywords rely on a compute to calculate their value(s).
Computes cannot be invoked by a variable in between runs. Thus they
must have been evaluated on the last timestep of the previous run in
order for their value(s) to be accessed. See the doc page for the
variable command for more info. :dd
{Computed temperature for fix temp/berendsen cannot be 0.0} :dt
Self-explanatory. :dd
{Computed temperature for fix temp/rescale cannot be 0.0} :dt
Cannot rescale the temperature to a new value if the current
temperature is 0.0. :dd
{Could not count initial bonds in fix bond/create} :dt
Could not find one of the atoms in a bond on this processor. :dd
{Could not create 3d FFT plan} :dt
The FFT setup in pppm failed. :dd
+{Could not create 3d grid of processors} :dt
+
+UNDOCUMENTED :dd
+
{Could not create 3d remap plan} :dt
The FFT setup in pppm failed. :dd
+{Could not create numa 3d grid of processors} :dt
+
+UNDOCUMENTED :dd
+
+{Could not create numa grid of processors} :dt
+
+UNDOCUMENTED :dd
+
+{Could not create twolevel 3d grid of processors} :dt
+
+UNDOCUMENTED :dd
+
{Could not find atom_modify first group ID} :dt
Self-explanatory. :dd
{Could not find compute ID for PRD} :dt
Self-explanatory. :dd
{Could not find compute ID for TAD} :dt
Self-explanatory. :dd
{Could not find compute ID for temperature bias} :dt
Self-explanatory. :dd
{Could not find compute ID to delete} :dt
Self-explanatory. :dd
{Could not find compute displace/atom fix ID} :dt
Self-explanatory. :dd
{Could not find compute event/displace fix ID} :dt
Self-explanatory. :dd
{Could not find compute group ID} :dt
Self-explanatory. :dd
{Could not find compute heat/flux compute ID} :dt
Self-explanatory. :dd
{Could not find compute msd fix ID} :dt
Self-explanatory. :dd
{Could not find compute pressure temperature ID} :dt
The compute ID for calculating temperature does not exist. :dd
{Could not find compute_modify ID} :dt
Self-explanatory. :dd
{Could not find delete_atoms group ID} :dt
Group ID used in the delete_atoms command does not exist. :dd
{Could not find delete_atoms region ID} :dt
Region ID used in the delete_atoms command does not exist. :dd
{Could not find displace_atoms group ID} :dt
Group ID used in the displace_atoms command does not exist. :dd
{Could not find displace_box group ID} :dt
Group ID used in the displace_box command does not exist. :dd
-{Could not find dump cfg compute ID} :dt
-
-Self-explanatory. :dd
-
-{Could not find dump cfg fix ID} :dt
-
-Self-explanatory. :dd
-
-{Could not find dump cfg variable name} :dt
-
-Self-explanatory. :dd
-
{Could not find dump custom compute ID} :dt
The compute ID needed by dump custom to compute a per-atom quantity
does not exist. :dd
{Could not find dump custom fix ID} :dt
Self-explanatory. :dd
{Could not find dump custom variable name} :dt
Self-explanatory. :dd
{Could not find dump group ID} :dt
A group ID used in the dump command does not exist. :dd
{Could not find dump local compute ID} :dt
Self-explanatory. :dd
{Could not find dump local fix ID} :dt
Self-explanatory. :dd
{Could not find dump modify compute ID} :dt
Self-explanatory. :dd
{Could not find dump modify fix ID} :dt
Self-explanatory. :dd
{Could not find dump modify variable name} :dt
Self-explanatory. :dd
{Could not find fix ID to delete} :dt
Self-explanatory. :dd
{Could not find fix group ID} :dt
A group ID used in the fix command does not exist. :dd
{Could not find fix msst compute ID} :dt
Self-explanatory. :dd
{Could not find fix poems group ID} :dt
A group ID used in the fix poems command does not exist. :dd
{Could not find fix recenter group ID} :dt
A group ID used in the fix recenter command does not exist. :dd
{Could not find fix rigid group ID} :dt
A group ID used in the fix rigid command does not exist. :dd
{Could not find fix srd group ID} :dt
Self-explanatory. :dd
{Could not find fix_modify ID} :dt
A fix ID used in the fix_modify command does not exist. :dd
{Could not find fix_modify pressure ID} :dt
The compute ID for computing pressure does not exist. :dd
{Could not find fix_modify temperature ID} :dt
The compute ID for computing temperature does not exist. :dd
{Could not find group delete group ID} :dt
Self-explanatory. :dd
-{Could not find/initialize a specified accelerator device} :dt
-
-Your GPU setup is invalid. :dd
-
{Could not find set group ID} :dt
Group ID specified in set command does not exist. :dd
{Could not find thermo compute ID} :dt
Compute ID specified in thermo_style command does not exist. :dd
{Could not find thermo custom compute ID} :dt
The compute ID needed by thermo style custom to compute a requested
quantity does not exist. :dd
{Could not find thermo custom fix ID} :dt
The fix ID needed by thermo style custom to compute a requested
quantity does not exist. :dd
{Could not find thermo custom variable name} :dt
Self-explanatory. :dd
{Could not find thermo fix ID} :dt
Fix ID specified in thermo_style command does not exist. :dd
{Could not find thermo_modify pressure ID} :dt
The compute ID needed by thermo style custom to compute pressure does
not exist. :dd
{Could not find thermo_modify temperature ID} :dt
The compute ID needed by thermo style custom to compute temperature does
not exist. :dd
{Could not find undump ID} :dt
A dump ID used in the undump command does not exist. :dd
{Could not find velocity group ID} :dt
A group ID used in the velocity command does not exist. :dd
{Could not find velocity temperature ID} :dt
The compute ID needed by the velocity command to compute temperature
does not exist. :dd
{Could not grab element entry from EIM potential file} :dt
Self-explanatory :dd
{Could not grab global entry from EIM potential file} :dt
Self-explanatory. :dd
{Could not grab pair entry from EIM potential file} :dt
Self-explanatory. :dd
-{Could not set finite-size particle attribute in fix rigid} :dt
-
-The particle has a finite size but its attributes could not be
-determined. :dd
-
{Coulomb cutoffs of pair hybrid sub-styles do not match} :dt
If using a Kspace solver, all Coulomb cutoffs of long pair styles must
be the same. :dd
{Cound not find dump_modify ID} :dt
Self-explanatory. :dd
{Create_atoms command before simulation box is defined} :dt
The create_atoms command cannot be used before a read_data,
read_restart, or create_box command. :dd
{Create_atoms region ID does not exist} :dt
A region ID used in the create_atoms command does not exist. :dd
{Create_box region ID does not exist} :dt
A region ID used in the create_box command does not exist. :dd
{Create_box region does not support a bounding box} :dt
Not all regions represent bounded volumes. You cannot use
such a region with the create_box command. :dd
{Cyclic loop in joint connections} :dt
Fix poems cannot (yet) work with coupled bodies whose joints connect
the bodies in a ring (or cycle). :dd
{Degenerate lattice primitive vectors} :dt
Invalid set of 3 lattice vectors for lattice command. :dd
{Delete region ID does not exist} :dt
Self-explanatory. :dd
{Delete_atoms command before simulation box is defined} :dt
The delete_atoms command cannot be used before a read_data,
read_restart, or create_box command. :dd
{Delete_atoms cutoff > neighbor cutoff} :dt
Cannot delete atoms further away than a processor knows about. :dd
{Delete_atoms requires a pair style be defined} :dt
This is because atom deletion within a cutoff uses a pairwise
neighbor list. :dd
{Delete_bonds command before simulation box is defined} :dt
The delete_bonds command cannot be used before a read_data,
read_restart, or create_box command. :dd
{Delete_bonds command with no atoms existing} :dt
No atoms are yet defined so the delete_bonds command cannot be used. :dd
{Deposition region extends outside simulation box} :dt
Self-explanatory. :dd
{Did not assign all atoms correctly} :dt
Atoms read in from a data file were not assigned correctly to
processors. This is likely due to some atom coordinates being
outside a non-periodic simulation box. :dd
{Did not find all elements in MEAM library file} :dt
The requested elements were not found in the MEAM file. :dd
{Did not find fix shake partner info} :dt
Could not find bond partners implied by fix shake command. This error
can be triggered if the delete_bonds command was used before fix
shake, and it removed bonds without resetting the 1-2, 1-3, 1-4
weighting list via the special keyword. :dd
{Did not find keyword in table file} :dt
Keyword used in pair_coeff command was not found in table file. :dd
{Did not set temp for fix rigid/nvt} :dt
The temp keyword must be used. :dd
{Dihedral atom missing in delete_bonds} :dt
The delete_bonds command cannot find one or more atoms in a particular
dihedral on a particular processor. The pairwise cutoff is too short
or the atoms are too far apart to make a valid dihedral. :dd
{Dihedral atom missing in set command} :dt
The set command cannot find one or more atoms in a particular dihedral
on a particular processor. The pairwise cutoff is too short or the
atoms are too far apart to make a valid dihedral. :dd
-{Dihedral atoms %d %d %d %d missing on proc %d at step} :dt
+{Dihedral atoms %d %d %d %d missing on proc %d at step %ld} :dt
One or more of 4 atoms needed to compute a particular dihedral are
missing on this processor. Typically this is because the pairwise
cutoff is set too short or the dihedral has blown apart and an atom is
-too far away. :dd
+too far away. :dd :dd
{Dihedral charmm is incompatible with Pair style} :dt
Dihedral style charmm must be used with a pair style charmm
in order for the 1-4 epsilon/sigma parameters to be defined. :dd
{Dihedral coeff for hybrid has invalid style} :dt
Dihedral style hybrid uses another dihedral style as one of its
coefficients. The dihedral style used in the dihedral_coeff command
or read from a restart file is not recognized. :dd
{Dihedral coeffs are not set} :dt
No dihedral coefficients have been assigned in the data file or via
the dihedral_coeff command. :dd
{Dihedral style hybrid cannot have hybrid as an argument} :dt
Self-explanatory. :dd
{Dihedral style hybrid cannot have none as an argument} :dt
Self-explanatory. :dd
{Dihedral style hybrid cannot use same dihedral style twice} :dt
Self-explanatory. :dd
{Dihedral_coeff command before dihedral_style is defined} :dt
Coefficients cannot be set in the data file or via the dihedral_coeff
command until an dihedral_style has been assigned. :dd
{Dihedral_coeff command before simulation box is defined} :dt
The dihedral_coeff command cannot be used before a read_data,
read_restart, or create_box command. :dd
{Dihedral_coeff command when no dihedrals allowed} :dt
The chosen atom style does not allow for dihedrals to be defined. :dd
{Dihedral_style command when no dihedrals allowed} :dt
The chosen atom style does not allow for dihedrals to be defined. :dd
{Dihedrals assigned incorrectly} :dt
Dihedrals read in from the data file were not assigned correctly to
atoms. This means there is something invalid about the topology
definitions. :dd
{Dihedrals defined but no dihedral types} :dt
The data file header lists dihedrals but no dihedral types. :dd
{Dimension command after simulation box is defined} :dt
The dimension command cannot be used after a read_data,
read_restart, or create_box command. :dd
-{Dipole command before simulation box is defined} :dt
-
-The dipole command cannot be used before a read_data,
-read_restart, or create_box command. :dd
-
{Displace_atoms command before simulation box is defined} :dt
The displace_atoms command cannot be used before a read_data,
read_restart, or create_box command. :dd
{Displace_box command before simulation box is defined} :dt
Self-explanatory. :dd
{Displace_box tilt factors require triclinic box} :dt
Cannot use tilt factors unless the simulation box is
non-orthogonal. :dd
{Distance must be > 0 for compute event/displace} :dt
Self-explanatory. :dd
{Divide by 0 in influence function of pair peri/lps} :dt
This should not normally occur. It is likely a problem with your
model. :dd
{Divide by 0 in variable formula} :dt
Self-explanatory. :dd
{Domain too large for neighbor bins} :dt
The domain has become extremely large so that neighbor bins cannot be
used. Most likely, one or more atoms have been blown out of the
simulation box to a great distance. :dd
-{Double precision is not supported on this accelerator.} :dt
+{Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu} :dt
-In this case, you must compile the GPU library for single precision. :dd
+UNDOCUMENTED :dd
-{Dump cfg and fix not computed at compatible times} :dt
+{Dump cfg arguments must start with 'id type xs ys zs' or 'id type xsu ysu zsu'} :dt
-The fix must produce per-atom quantities on timesteps that dump cfg
-needs them. :dd
-
-{Dump cfg arguments must start with 'id type xs ys zs'} :dt
-
-This is a requirement of the CFG output format. :dd
+This is a requirement of the CFG output format. :dd :dd
{Dump cfg requires one snapshot per file} :dt
Use the wildcard "*" character in the filename. :dd
{Dump custom and fix not computed at compatible times} :dt
The fix must produce per-atom quantities on timesteps that dump custom
needs them. :dd
{Dump custom compute does not calculate per-atom array} :dt
Self-explanatory. :dd
{Dump custom compute does not calculate per-atom vector} :dt
Self-explanatory. :dd
{Dump custom compute does not compute per-atom info} :dt
Self-explanatory. :dd
{Dump custom compute vector is accessed out-of-range} :dt
Self-explanatory. :dd
{Dump custom fix does not compute per-atom array} :dt
Self-explanatory. :dd
{Dump custom fix does not compute per-atom info} :dt
Self-explanatory. :dd
{Dump custom fix does not compute per-atom vector} :dt
Self-explanatory. :dd
{Dump custom fix vector is accessed out-of-range} :dt
Self-explanatory. :dd
{Dump custom variable is not atom-style variable} :dt
Only atom-style variables generate per-atom quantities, needed for
dump output. :dd
{Dump dcd of non-matching # of atoms} :dt
Every snapshot written by dump dcd must contain the same # of atoms. :dd
{Dump dcd requires sorting by atom ID} :dt
Use the dump_modify sort command to enable this. :dd
{Dump every variable returned a bad timestep} :dt
The variable must return a timestep greater than the current timestep. :dd
+{Dump image bond not allowed with no bond types} :dt
+
+UNDOCUMENTED :dd
+
+{Dump image cannot perform sorting} :dt
+
+UNDOCUMENTED :dd
+
+{Dump image persp option is not yet supported} :dt
+
+UNDOCUMENTED :dd
+
+{Dump image requires one snapshot per file} :dt
+
+UNDOCUMENTED :dd
+
{Dump local and fix not computed at compatible times} :dt
The fix must produce per-atom quantities on timesteps that dump local
needs them. :dd
{Dump local attributes contain no compute or fix} :dt
Self-explanatory. :dd
{Dump local cannot sort by atom ID} :dt
This is because dump local does not really dump per-atom info. :dd
{Dump local compute does not calculate local array} :dt
Self-explanatory. :dd
{Dump local compute does not calculate local vector} :dt
Self-explanatory. :dd
{Dump local compute does not compute local info} :dt
Self-explanatory. :dd
{Dump local compute vector is accessed out-of-range} :dt
Self-explanatory. :dd
{Dump local count is not consistent across input fields} :dt
Every column of output must be the same length. :dd
{Dump local fix does not compute local array} :dt
Self-explanatory. :dd
{Dump local fix does not compute local info} :dt
Self-explanatory. :dd
{Dump local fix does not compute local vector} :dt
Self-explanatory. :dd
{Dump local fix vector is accessed out-of-range} :dt
Self-explanatory. :dd
+{Dump modify bcolor not allowed with no bond types} :dt
+
+UNDOCUMENTED :dd
+
+{Dump modify bdiam not allowed with no bond types} :dt
+
+UNDOCUMENTED :dd
+
{Dump modify compute ID does not compute per-atom array} :dt
Self-explanatory. :dd
{Dump modify compute ID does not compute per-atom info} :dt
Self-explanatory. :dd
{Dump modify compute ID does not compute per-atom vector} :dt
Self-explanatory. :dd
{Dump modify compute ID vector is not large enough} :dt
Self-explanatory. :dd
{Dump modify element names do not match atom types} :dt
Number of element names must equal number of atom types. :dd
{Dump modify fix ID does not compute per-atom array} :dt
Self-explanatory. :dd
{Dump modify fix ID does not compute per-atom info} :dt
Self-explanatory. :dd
{Dump modify fix ID does not compute per-atom vector} :dt
Self-explanatory. :dd
{Dump modify fix ID vector is not large enough} :dt
Self-explanatory. :dd
{Dump modify variable is not atom-style variable} :dt
Self-explanatory. :dd
{Dump sort column is invalid} :dt
Self-explanatory. :dd
{Dump xtc requires sorting by atom ID} :dt
Use the dump_modify sort command to enable this. :dd
{Dump_modify region ID does not exist} :dt
Self-explanatory. :dd
{Dumping an atom property that isn't allocated} :dt
The chosen atom style does not define the per-atom quantity being
dumped. :dd
{Dumping an atom quantity that isn't allocated} :dt
Only per-atom quantities that are defined for the atom style being
used are allowed. :dd
{Duplicate particle in PeriDynamic bond - simulation box is too small} :dt
This is likely because your box length is shorter than 2 times
the bond length. :dd
{Electronic temperature dropped below zero} :dt
Something has gone wrong with the fix ttm electron temperature model. :dd
{Empty brackets in variable} :dt
There is no variable syntax that uses empty brackets. Check
the variable doc page. :dd
{Energy was not tallied on needed timestep} :dt
You are using a thermo keyword that requires potentials to
have tallied energy, but they didn't on this timestep. See the
variable doc page for ideas on how to make this work. :dd
{Expected floating point parameter in input script or data file} :dt
The quantity being read is an integer on non-numeric value. :dd
{Expected floating point parameter in variable definition} :dt
The quantity being read is a non-numeric value. :dd
{Expected integer parameter in input script or data file} :dt
The quantity being read is a floating point or non-numeric value. :dd
{Expected integer parameter in variable definition} :dt
The quantity being read is a floating point or non-numeric value. :dd
-{Failed to allocate %d bytes for array %s} :dt
+{Failed to allocate %ld bytes for array %s} :dt
Your LAMMPS simulation has run out of memory. You need to run a
-smaller simulation or on more processors. :dd
+smaller simulation or on more processors. :dd :dd
-{Failed to reallocate %d bytes for array %s} :dt
+{Failed to reallocate %ld bytes for array %s} :dt
Your LAMMPS simulation has run out of memory. You need to run a
-smaller simulation or on more processors. :dd
+smaller simulation or on more processors. :dd :dd
{Fewer SRD bins than processors in some dimension} :dt
This is not allowed. Make your SRD bin size smaller. :dd
{Final box dimension due to fix deform is < 0.0} :dt
Self-explanatory. :dd
-{Fix gpu split must be positive for hybrid pair styles.} :dt
+{Fix GCMC incompatible with given pair_style} :dt
-See documentation for fix gpu. :dd
+UNDOCUMENTED :dd
+
+{Fix GCMC molecule command requires atom attribute molecule} :dt
+
+UNDOCUMENTED :dd
+
+{Fix GCMC molecule feature does not yet work} :dt
+
+UNDOCUMENTED :dd
+
+{Fix GPU split must be positive for hybrid pair styles} :dt
+
+UNDOCUMENTED :dd
{Fix ID for compute atom/molecule does not exist} :dt
Self-explanatory. :dd
{Fix ID for compute reduce does not exist} :dt
Self-explanatory. :dd
+{Fix ID for compute slice does not exist} :dt
+
+UNDOCUMENTED :dd
+
{Fix ID for fix ave/atom does not exist} :dt
Self-explanatory. :dd
{Fix ID for fix ave/correlate does not exist} :dt
Self-explanatory. :dd
{Fix ID for fix ave/histo does not exist} :dt
Self-explanatory. :dd
{Fix ID for fix ave/spatial does not exist} :dt
Self-explanatory. :dd
{Fix ID for fix ave/time does not exist} :dt
Self-explanatory. :dd
{Fix ID for fix store/state does not exist} :dt
Self-explanatory :dd
{Fix ID must be alphanumeric or underscore characters} :dt
Self-explanatory. :dd
-{Fix SRD cannot have both atom attributes angmom and omega} :dt
-
-Use either spheroid solute particles or fully generalized
-aspherical solute particles. :dd
-
{Fix SRD no-slip requires atom attribute torque} :dt
This is because the SRD collisions will impart torque to the solute
particles. :dd
-{Fix SRD requires atom attribute angmom or omega} :dt
-
-This is because the SRD collisions with cause the solute particles to
-rotate. :dd
-
-{Fix SRD requires atom attribute radius or shape} :dt
-
-This is because the solute particles must be finite-size particles,
-not point particles. :dd
-
{Fix SRD: bad bin assignment for SRD advection} :dt
Something has gone wrong in your SRD model; try using more
conservative settings. :dd
{Fix SRD: bad search bin assignment} :dt
Something has gone wrong in your SRD model; try using more
conservative settings. :dd
{Fix SRD: bad stencil bin for big particle} :dt
Something has gone wrong in your SRD model; try using more
conservative settings. :dd
{Fix SRD: too many big particles in bin} :dt
Reset the ATOMPERBIN parameter at the top of fix_srd.cpp
to a larger value, and re-compile the code. :dd
{Fix SRD: too many walls in bin} :dt
This should not happen unless your system has been setup incorrectly. :dd
{Fix adapt kspace style does not exist} :dt
Self-explanatory. :dd
{Fix adapt pair style does not exist} :dt
Self-explanatory :dd
{Fix adapt pair style param not supported} :dt
The pair style does not know about the parameter you specified. :dd
{Fix adapt requires atom attribute diameter} :dt
The atom style being used does not specify an atom diameter. :dd
{Fix adapt type pair range is not valid for pair hybrid sub-style} :dt
Self-explanatory. :dd
{Fix ave/atom compute array is accessed out-of-range} :dt
Self-explanatory. :dd
{Fix ave/atom compute does not calculate a per-atom array} :dt
Self-explanatory. :dd
{Fix ave/atom compute does not calculate a per-atom vector} :dt
A compute used by fix ave/atom must generate per-atom values. :dd
{Fix ave/atom compute does not calculate per-atom values} :dt
A compute used by fix ave/atom must generate per-atom values. :dd
{Fix ave/atom fix array is accessed out-of-range} :dt
Self-explanatory. :dd
{Fix ave/atom fix does not calculate a per-atom array} :dt
Self-explanatory. :dd
{Fix ave/atom fix does not calculate a per-atom vector} :dt
A fix used by fix ave/atom must generate per-atom values. :dd
{Fix ave/atom fix does not calculate per-atom values} :dt
A fix used by fix ave/atom must generate per-atom values. :dd
{Fix ave/atom variable is not atom-style variable} :dt
A variable used by fix ave/atom must generate per-atom values. :dd
+{Fix ave/correlate compute does not calculate a scalar} :dt
+
+UNDOCUMENTED :dd
+
+{Fix ave/correlate compute does not calculate a vector} :dt
+
+UNDOCUMENTED :dd
+
+{Fix ave/correlate compute vector is accessed out-of-range} :dt
+
+UNDOCUMENTED :dd
+
+{Fix ave/correlate fix does not calculate a scalar} :dt
+
+UNDOCUMENTED :dd
+
+{Fix ave/correlate fix does not calculate a vector} :dt
+
+UNDOCUMENTED :dd
+
+{Fix ave/correlate fix vector is accessed out-of-range} :dt
+
+UNDOCUMENTED :dd
+
+{Fix ave/correlate variable is not equal-style variable} :dt
+
+UNDOCUMENTED :dd
+
{Fix ave/histo cannot input local values in scalar mode} :dt
Self-explanatory. :dd
{Fix ave/histo cannot input per-atom values in scalar mode} :dt
Self-explanatory. :dd
{Fix ave/histo compute array is accessed out-of-range} :dt
Self-explanatory. :dd
{Fix ave/histo compute does not calculate a global array} :dt
Self-explanatory. :dd
{Fix ave/histo compute does not calculate a global scalar} :dt
Self-explanatory. :dd
{Fix ave/histo compute does not calculate a global vector} :dt
Self-explanatory. :dd
{Fix ave/histo compute does not calculate a local array} :dt
Self-explanatory. :dd
{Fix ave/histo compute does not calculate a local vector} :dt
Self-explanatory. :dd
{Fix ave/histo compute does not calculate a per-atom array} :dt
Self-explanatory. :dd
{Fix ave/histo compute does not calculate a per-atom vector} :dt
Self-explanatory. :dd
{Fix ave/histo compute does not calculate local values} :dt
Self-explanatory. :dd
{Fix ave/histo compute does not calculate per-atom values} :dt
Self-explanatory. :dd
{Fix ave/histo compute vector is accessed out-of-range} :dt
Self-explanatory. :dd
{Fix ave/histo fix array is accessed out-of-range} :dt
Self-explanatory. :dd
{Fix ave/histo fix does not calculate a global array} :dt
Self-explanatory. :dd
{Fix ave/histo fix does not calculate a global scalar} :dt
Self-explanatory. :dd
{Fix ave/histo fix does not calculate a global vector} :dt
Self-explanatory. :dd
{Fix ave/histo fix does not calculate a local array} :dt
Self-explanatory. :dd
{Fix ave/histo fix does not calculate a local vector} :dt
Self-explanatory. :dd
{Fix ave/histo fix does not calculate a per-atom array} :dt
Self-explanatory. :dd
{Fix ave/histo fix does not calculate a per-atom vector} :dt
Self-explanatory. :dd
{Fix ave/histo fix does not calculate local values} :dt
Self-explanatory. :dd
{Fix ave/histo fix does not calculate per-atom values} :dt
Self-explanatory. :dd
{Fix ave/histo fix vector is accessed out-of-range} :dt
Self-explanatory. :dd
{Fix ave/histo input is invalid compute} :dt
Self-explanatory. :dd
{Fix ave/histo input is invalid fix} :dt
Self-explanatory. :dd
{Fix ave/histo input is invalid variable} :dt
Self-explanatory. :dd
{Fix ave/histo inputs are not all global, peratom, or local} :dt
All inputs in a single fix ave/histo command must be of the
same style. :dd
{Fix ave/spatial compute does not calculate a per-atom array} :dt
Self-explanatory. :dd
{Fix ave/spatial compute does not calculate a per-atom vector} :dt
A compute used by fix ave/spatial must generate per-atom values. :dd
{Fix ave/spatial compute does not calculate per-atom values} :dt
A compute used by fix ave/spatial must generate per-atom values. :dd
{Fix ave/spatial compute vector is accessed out-of-range} :dt
The index for the vector is out of bounds. :dd
{Fix ave/spatial fix does not calculate a per-atom array} :dt
Self-explanatory. :dd
{Fix ave/spatial fix does not calculate a per-atom vector} :dt
A fix used by fix ave/spatial must generate per-atom values. :dd
{Fix ave/spatial fix does not calculate per-atom values} :dt
A fix used by fix ave/spatial must generate per-atom values. :dd
{Fix ave/spatial fix vector is accessed out-of-range} :dt
The index for the vector is out of bounds. :dd
{Fix ave/spatial for triclinic boxes requires units reduced} :dt
Self-explanatory. :dd
{Fix ave/spatial settings invalid with changing box} :dt
If the ave setting is "running" or "window" and the box size/shape
changes during the simulation, then the units setting must be
"reduced", else the number of bins may change. :dd
{Fix ave/spatial variable is not atom-style variable} :dt
A variable used by fix ave/spatial must generate per-atom values. :dd
{Fix ave/time cannot set output array intensive/extensive from these inputs} :dt
One of more of the vector inputs has individual elements which are
flagged as intensive or extensive. Such an input cannot be flagged as
all intensive/extensive when turned into an array by fix ave/time. :dd
{Fix ave/time cannot use variable with vector mode} :dt
Variables produce scalar values. :dd
{Fix ave/time columns are inconsistent lengths} :dt
Self-explanatory. :dd
{Fix ave/time compute array is accessed out-of-range} :dt
Self-explanatory. :dd
{Fix ave/time compute does not calculate a scalar} :dt
Only computes that calculate a scalar or vector quantity (not a
per-atom quantity) can be used with fix ave/time. :dd
{Fix ave/time compute does not calculate a vector} :dt
Only computes that calculate a scalar or vector quantity (not a
per-atom quantity) can be used with fix ave/time. :dd
{Fix ave/time compute does not calculate an array} :dt
Self-explanatory. :dd
{Fix ave/time compute vector is accessed out-of-range} :dt
The index for the vector is out of bounds. :dd
{Fix ave/time fix array is accessed out-of-range} :dt
Self-explanatory. :dd
{Fix ave/time fix does not calculate a scalar} :dt
A fix used by fix ave/time must generate global values. :dd
{Fix ave/time fix does not calculate a vector} :dt
A fix used by fix ave/time must generate global values. :dd
{Fix ave/time fix does not calculate an array} :dt
Self-explanatory. :dd
{Fix ave/time fix vector is accessed out-of-range} :dt
The index for the vector is out of bounds. :dd
{Fix ave/time variable is not equal-style variable} :dt
A variable used by fix ave/time must generate a global value. :dd
{Fix bond/break requires special_bonds = 0,1,1} :dt
This is a restriction of the current fix bond/break implementation. :dd
{Fix bond/create cutoff is longer than pairwise cutoff} :dt
This is not allowed because bond creation is done using the
pairwise neighbor list. :dd
{Fix bond/create requires special_bonds coul = 0,1,1} :dt
Self-explanatory. :dd
{Fix bond/create requires special_bonds lj = 0,1,1} :dt
Self-explanatory. :dd
{Fix bond/swap cannot use dihedral or improper styles} :dt
These styles cannot be defined when using this fix. :dd
{Fix bond/swap requires pair and bond styles} :dt
Self-explanatory. :dd
{Fix bond/swap requires special_bonds = 0,1,1} :dt
Self-explanatory. :dd
{Fix box/relax generated negative box length} :dt
The pressure being applied is likely too large. Try applying
it incrementally, to build to the high pressure. :dd
{Fix command before simulation box is defined} :dt
The fix command cannot be used before a read_data, read_restart, or
create_box command. :dd
{Fix deform is changing yz by too much with changing xy} :dt
When both yz and xy are changing, it induces changes in xz if the
box must flip from one tilt extreme to another. Thus it is not
allowed for yz to grow so much that a flip is induced. :dd
{Fix deform tilt factors require triclinic box} :dt
Cannot deform the tilt factors of a simulation box unless it
is a triclinic (non-orthogonal) box. :dd
{Fix deform volume setting is invalid} :dt
Cannot use volume style unless other dimensions are being controlled. :dd
{Fix deposit region cannot be dynamic} :dt
Only static regions can be used with fix deposit. :dd
{Fix deposit region does not support a bounding box} :dt
Not all regions represent bounded volumes. You cannot use
such a region with the fix deposit command. :dd
{Fix efield requires atom attribute q} :dt
Self-explanatory. :dd
{Fix evaporate molecule requires atom attribute molecule} :dt
The atom style being used does not define a molecule ID. :dd
{Fix external callback function not set} :dt
This must be done by an external program in order to use this fix. :dd
{Fix for fix ave/atom not computed at compatible time} :dt
Fixes generate their values on specific timesteps. Fix ave/atom is
requesting a value on a non-allowed timestep. :dd
{Fix for fix ave/correlate not computed at compatible time} :dt
Fixes generate their values on specific timesteps. Fix ave/correlate
is requesting a value on a non-allowed timestep. :dd
{Fix for fix ave/histo not computed at compatible time} :dt
Fixes generate their values on specific timesteps. Fix ave/histo is
requesting a value on a non-allowed timestep. :dd
{Fix for fix ave/spatial not computed at compatible time} :dt
Fixes generate their values on specific timesteps. Fix ave/spatial is
requesting a value on a non-allowed timestep. :dd
{Fix for fix ave/time not computed at compatible time} :dt
Fixes generate their values on specific timesteps. Fix ave/time
is requesting a value on a non-allowed timestep. :dd
{Fix for fix store/state not computed at compatible time} :dt
Fixes generate their values on specific timesteps. Fix store/state
is requesting a value on a non-allowed timestep. :dd
{Fix freeze requires atom attribute torque} :dt
The atom style defined does not have this attribute. :dd
{Fix heat group has no atoms} :dt
Self-explanatory. :dd
{Fix heat kinetic energy went negative} :dt
This will cause the velocity rescaling about to be performed by fix
heat to be invalid. :dd
{Fix in variable not computed at compatible time} :dt
Fixes generate their values on specific timesteps. The variable is
requesting the values on a non-allowed timestep. :dd
+{Fix langevin angmom require atom style ellipsoid} :dt
+
+UNDOCUMENTED :dd
+
+{Fix langevin angmom requires atom style ellipsoid} :dt
+
+UNDOCUMENTED :dd
+
+{Fix langevin angmom requires extended particles} :dt
+
+UNDOCUMENTED :dd
+
+{Fix langevin omega require atom style sphere} :dt
+
+UNDOCUMENTED :dd
+
+{Fix langevin omega requires extended particles} :dt
+
+UNDOCUMENTED :dd
+
{Fix langevin period must be > 0.0} :dt
The time window for temperature relaxation must be > 0 :dd
+{Fix langevin variable returned negative temperature} :dt
+
+UNDOCUMENTED :dd
+
{Fix momentum group has no atoms} :dt
Self-explanatory. :dd
{Fix move cannot define z or vz variable for 2d problem} :dt
Self-explanatory. :dd
{Fix move cannot have 0 length rotation vector} :dt
Self-explanatory. :dd
{Fix move cannot rotate aroung non z-axis for 2d problem} :dt
Self-explanatory. :dd
{Fix move cannot set linear z motion for 2d problem} :dt
Self-explanatory. :dd
{Fix move cannot set wiggle z motion for 2d problem} :dt
Self-explanatory. :dd
{Fix msst compute ID does not compute potential energy} :dt
Self-explanatory. :dd
{Fix msst compute ID does not compute pressure} :dt
Self-explanatory. :dd
{Fix msst compute ID does not compute temperature} :dt
Self-explanatory. :dd
{Fix msst requires a periodic box} :dt
Self-explanatory. :dd
{Fix msst tscale must satisfy 0 <= tscale < 1} :dt
Self-explanatory. :dd
-{Fix npt/nph has tilted box too far - box flips are not yet implemented} :dt
+{Fix npt/nph has tilted box too far in one step - periodic cell is too far from equilibrium state} :dt
-This feature has not yet been added. However, if you are applying
-an off-diagonal pressure to a fluid, the box may want to tilt indefinitely,
-because the fluid cannot support the pressure you are imposing. :dd
+UNDOCUMENTED :dd
-{Fix nve/asphere cannot be used with atom attributes diameter or rmass} :dt
+{Fix nve/asphere requires extended particles} :dt
-These attributes override the shape and mass settings, so cannot be
-used. :dd
+This fix can only be used for particles with a shape setting. :dd
-{Fix nve/asphere requires atom attributes angmom, quat, torque, shape} :dt
+{Fix nve/asphere/noforce requires atom style ellipsoid} :dt
-An atom style that specifies these quantities is needed. :dd
+UNDOCUMENTED :dd
-{Fix nve/asphere requires extended particles} :dt
+{Fix nve/asphere/noforce requires extended particles} :dt
-This fix can only be used for particles with a shape setting. :dd
+UNDOCUMENTED :dd
+
+{Fix nve/line can only be used for 2d simulations} :dt
+
+UNDOCUMENTED :dd
+
+{Fix nve/line can only be used for 3d simulations} :dt
-{Fix nve/sphere requires atom attribute diameter or shape} :dt
+UNDOCUMENTED :dd
-An atom style that specifies these quantities is needed. :dd
+{Fix nve/line requires atom style line} :dt
+
+UNDOCUMENTED :dd
+
+{Fix nve/line requires line particles} :dt
+
+UNDOCUMENTED :dd
{Fix nve/sphere requires atom attribute mu} :dt
An atom style with this attribute is needed. :dd
-{Fix nve/sphere requires atom attributes omega, torque} :dt
+{Fix nve/sphere requires atom style sphere} :dt
-An atom style with these attributes is needed. :dd
+UNDOCUMENTED :dd
{Fix nve/sphere requires extended particles} :dt
This fix can only be used for particles of a finite size. :dd
-{Fix nve/sphere requires spherical particle shapes} :dt
-
-Self-explanatory. :dd
-
-{Fix nvt/nph/npt asphere cannot be used with atom attributes diameter or rmass} :dt
+{Fix nve/tri requires atom style tri} :dt
-Those attributes are for spherical particles. :dd
+UNDOCUMENTED :dd
-{Fix nvt/nph/npt asphere requires atom attributes quat, angmom, torque, shape} :dt
+{Fix nve/tri requires tri particles} :dt
-Those attributes are what are used to define aspherical particles. :dd
+UNDOCUMENTED :dd
{Fix nvt/nph/npt asphere requires extended particles} :dt
The shape setting for a particle in the fix group has shape = 0.0,
which means it is a point particle. :dd
-{Fix nvt/nph/npt sphere requires atom attribute diameter or shape} :dt
-
-An atom style that specifies these quantities is needed. :dd
-
-{Fix nvt/nph/npt sphere requires atom attributes omega, torque} :dt
+{Fix nvt/nph/npt sphere requires atom style sphere} :dt
-Those attributes are what are used to define spherical particles. :dd
+UNDOCUMENTED :dd
{Fix nvt/npt/nph damping parameters must be > 0.0} :dt
Self-explanatory. :dd
{Fix nvt/sphere requires extended particles} :dt
This fix can only be used for particles of a finite size. :dd
-{Fix nvt/sphere requires spherical particle shapes} :dt
-
-Self-explanatory. :dd
-
{Fix orient/fcc file open failed} :dt
The fix orient/fcc command could not open a specified file. :dd
{Fix orient/fcc file read failed} :dt
The fix orient/fcc command could not read the needed parameters from a
specified file. :dd
{Fix orient/fcc found self twice} :dt
The neighbor lists used by fix orient/fcc are messed up. If this
error occurs, it is likely a bug, so send an email to the
"developers"_http://lammps.sandia.gov/authors.html. :dd
{Fix peri neigh does not exist} :dt
Somehow a fix that the pair style defines has been deleted. :dd
{Fix pour region ID does not exist} :dt
Self-explanatory. :dd
{Fix pour region cannot be dynamic} :dt
Only static regions can be used with fix pour. :dd
{Fix pour region does not support a bounding box} :dt
Not all regions represent bounded volumes. You cannot use
such a region with the fix pour command. :dd
{Fix pour requires atom attributes radius, rmass} :dt
The atom style defined does not have these attributes. :dd
{Fix press/berendsen damping parameters must be > 0.0} :dt
Self-explanatory. :dd
{Fix qeq/comb group has no atoms} :dt
Self-explanatory. :dd
{Fix qeq/comb requires atom attribute q} :dt
An atom style with charge must be used to perform charge equilibration. :dd
{Fix reax/bonds numbonds > nsbmax_most} :dt
The limit of the number of bonds expected by the ReaxFF force field
was exceeded. :dd
{Fix recenter group has no atoms} :dt
Self-explanatory. :dd
+{Fix restrain requires an atom map, see atom_modify} :dt
+
+UNDOCUMENTED :dd
+
{Fix rigid atom has non-zero image flag in a non-periodic dimension} :dt
You cannot set image flags for non-periodic dimensions. :dd
+{Fix rigid langevin period must be > 0.0} :dt
+
+UNDOCUMENTED :dd
+
{Fix rigid molecule requires atom attribute molecule} :dt
Self-explanatory. :dd
-{Fix rigid/nvt period must be > 0.0} :dt
+{Fix rigid xy torque cannot be on for 2d simulation} :dt
+
+UNDOCUMENTED :dd
+
+{Fix rigid z force cannot be on for 2d simulation} :dt
+
+UNDOCUMENTED :dd
+
+{Fix rigid/nvt period must be > 0.0} :dt
Self-explanatory :dd
{Fix rigid: Bad principal moments} :dt
The principal moments of inertia computed for a rigid body
are not within the required tolerances. :dd
{Fix shake cannot be used with minimization} :dt
Cannot use fix shake while doing an energy minimization since
it turns off bonds that should contribute to the energy. :dd
{Fix spring couple group ID does not exist} :dt
Self-explanatory. :dd
{Fix srd lamda must be >= 0.6 of SRD grid size} :dt
This is a requirement for accuracy reasons. :dd
{Fix srd requires SRD particles all have same mass} :dt
Self-explanatory. :dd
{Fix srd requires ghost atoms store velocity} :dt
Use the communicate vel yes command to enable this. :dd
{Fix srd requires newton pair on} :dt
Self-explanatory. :dd
{Fix store/state compute array is accessed out-of-range} :dt
Self-explanatory. :dd
{Fix store/state compute does not calculate a per-atom array} :dt
The compute calculates a per-atom vector. :dd
{Fix store/state compute does not calculate a per-atom vector} :dt
The compute calculates a per-atom vector. :dd
{Fix store/state compute does not calculate per-atom values} :dt
Computes that calculate global or local quantities cannot be used
with fix store/state. :dd
{Fix store/state fix array is accessed out-of-range} :dt
Self-explanatory. :dd
{Fix store/state fix does not calculate a per-atom array} :dt
The fix calculates a per-atom vector. :dd
{Fix store/state fix does not calculate a per-atom vector} :dt
The fix calculates a per-atom array. :dd
{Fix store/state fix does not calculate per-atom values} :dt
Fixes that calculate global or local quantities cannot be used with
fix store/state. :dd
{Fix store/state for atom property that isn't allocated} :dt
Self-explanatory. :dd
{Fix store/state variable is not atom-style variable} :dt
Only atom-style variables calculate per-atom quantities. :dd
{Fix temp/berendsen period must be > 0.0} :dt
Self-explanatory. :dd
{Fix thermal/conductivity swap value must be positive} :dt
Self-explanatory. :dd
{Fix tmd must come after integration fixes} :dt
Any fix tmd command must appear in the input script after all time
integration fixes (nve, nvt, npt). See the fix tmd documentation for
details. :dd
{Fix ttm electron temperatures must be > 0.0} :dt
Self-explanatory. :dd
{Fix ttm electronic_density must be > 0.0} :dt
Self-explanatory. :dd
{Fix ttm electronic_specific_heat must be > 0.0} :dt
Self-explanatory. :dd
{Fix ttm electronic_thermal_conductivity must be >= 0.0} :dt
Self-explanatory. :dd
{Fix ttm gamma_p must be > 0.0} :dt
Self-explanatory. :dd
{Fix ttm gamma_s must be >= 0.0} :dt
Self-explanatory. :dd
{Fix ttm number of nodes must be > 0} :dt
Self-explanatory. :dd
{Fix ttm v_0 must be >= 0.0} :dt
Self-explanatory. :dd
{Fix used in compute atom/molecule not computed at compatible time} :dt
The fix must produce per-atom quantities on timesteps that the compute
needs them. :dd
{Fix used in compute reduce not computed at compatible time} :dt
Fixes generate their values on specific timesteps. Compute sum is
requesting a value on a non-allowed timestep. :dd
+{Fix used in compute slice not computed at compatible time} :dt
+
+UNDOCUMENTED :dd
+
{Fix viscosity swap value must be positive} :dt
Self-explanatory. :dd
{Fix viscosity vtarget value must be positive} :dt
Self-explanatory. :dd
{Fix wall cutoff <= 0.0} :dt
Self-explanatory. :dd
-{Fix wall/colloid cannot be used with atom attribute diameter} :dt
-
-Only finite-size particles defined by the shape command can be used. :dd
+{Fix wall/colloid requires atom style sphere} :dt
-{Fix wall/colloid requires atom attribute shape} :dt
-
-Self-explanatory. :dd
+UNDOCUMENTED :dd
{Fix wall/colloid requires extended particles} :dt
Self-explanatory. :dd
-{Fix wall/colloid requires spherical particles} :dt
-
-Self-explanatory. :dd
-
{Fix wall/gran is incompatible with Pair style} :dt
Must use a granular pair style to define the parameters needed for
this fix. :dd
-{Fix wall/gran requires atom attributes radius, omega, torque} :dt
+{Fix wall/gran requires atom style sphere} :dt
-The atom style defined does not have these attributes. :dd
+UNDOCUMENTED :dd
-{Fix wall/region colloid cannot be used with atom attribute diameter} :dt
+{Fix wall/piston command only available at zlo} :dt
-Only finite-size particles defined by the shape command can be used. :dd
+UNDOCUMENTED :dd
-{Fix wall/region colloid requires atom attribute shape} :dt
+{Fix wall/region colloid requires atom style sphere} :dt
-Self-explanatory. :dd
+UNDOCUMENTED :dd
{Fix wall/region colloid requires extended particles} :dt
Self-explanatory. :dd
-{Fix wall/region colloid requires spherical particles} :dt
-
-Self-explanatory. :dd
-
{Fix wall/region cutoff <= 0.0} :dt
Self-explanatory. :dd
{Fix_modify order must be 3 or 5} :dt
Self-explanatory. :dd
{Fix_modify pressure ID does not compute pressure} :dt
The compute ID assigned to the fix must compute pressure. :dd
{Fix_modify temperature ID does not compute temperature} :dt
The compute ID assigned to the fix must compute temperature. :dd
{Found no restart file matching pattern} :dt
When using a "*" in the restart file name, no matching file was found. :dd
-{GPU is not the first fix for this run} :dt
-
-This is the way the fix must be defined in your input script. :dd
-
-{GPU library not compiled for this accelerator} :dt
-
-The GPU library was not built for your accelerator. Check the arch flag in
-lib/gpu. :dd
-
{Gmask function in equal-style variable formula} :dt
Gmask is per-atom operation. :dd
{Gravity changed since fix pour was created} :dt
Gravity must be static and not dynamic for use with fix pour. :dd
{Gravity must point in -y to use with fix pour in 2d} :dt
Gravity must be pointing "down" in a 2d box. :dd
{Gravity must point in -z to use with fix pour in 3d} :dt
Gravity must be pointing "down" in a 3d box, i.e. theta = 180.0. :dd
{Grmask function in equal-style variable formula} :dt
Grmask is per-atom operation. :dd
{Group ID does not exist} :dt
A group ID used in the group command does not exist. :dd
{Group ID in variable formula does not exist} :dt
Self-explanatory. :dd
{Group command before simulation box is defined} :dt
The group command cannot be used before a read_data, read_restart, or
create_box command. :dd
{Group region ID does not exist} :dt
A region ID used in the group command does not exist. :dd
+{Illega dump_modify command} :dt
+
+UNDOCUMENTED :dd
+
{Illegal ... command} :dt
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. :dd
{Illegal COMB parameter} :dt
One or more of the coefficients defined in the potential file is
invalid. :dd
{Illegal Stillinger-Weber parameter} :dt
One or more of the coefficients defined in the potential file is
invalid. :dd
{Illegal Tersoff parameter} :dt
One or more of the coefficients defined in the potential file is
invalid. :dd
-{Illegal chemical element names} :dt
+{Illegal fix wall/piston velocity} :dt
-The name is too long to be a chemical element. :dd
+UNDOCUMENTED :dd
-{Illegal fix gpu command} :dt
+{Illegal integrate style} :dt
-Self-explanatory. :dd
+UNDOCUMENTED :dd
{Illegal number of angle table entries} :dt
There must be at least 2 table entries. :dd
{Illegal number of bond table entries} :dt
There must be at least 2 table entries. :dd
{Illegal number of pair table entries} :dt
There must be at least 2 table entries. :dd
{Illegal simulation box} :dt
The lower bound of the simulation box is greater than the upper bound. :dd
{Improper atom missing in delete_bonds} :dt
The delete_bonds command cannot find one or more atoms in a particular
improper on a particular processor. The pairwise cutoff is too short
or the atoms are too far apart to make a valid improper. :dd
{Improper atom missing in set command} :dt
The set command cannot find one or more atoms in a particular improper
on a particular processor. The pairwise cutoff is too short or the
atoms are too far apart to make a valid improper. :dd
-{Improper atoms %d %d %d %d missing on proc %d at step} :dt
+{Improper atoms %d %d %d %d missing on proc %d at step %ld} :dt
One or more of 4 atoms needed to compute a particular improper are
missing on this processor. Typically this is because the pairwise
cutoff is set too short or the improper has blown apart and an atom is
-too far away. :dd
+too far away. :dd :dd
{Improper coeff for hybrid has invalid style} :dt
Improper style hybrid uses another improper style as one of its
coefficients. The improper style used in the improper_coeff command
or read from a restart file is not recognized. :dd
{Improper coeffs are not set} :dt
No improper coefficients have been assigned in the data file or via
the improper_coeff command. :dd
{Improper style hybrid cannot have hybrid as an argument} :dt
Self-explanatory. :dd
{Improper style hybrid cannot have none as an argument} :dt
Self-explanatory. :dd
{Improper style hybrid cannot use same improper style twice} :dt
Self-explanatory. :dd
{Improper_coeff command before improper_style is defined} :dt
Coefficients cannot be set in the data file or via the improper_coeff
command until an improper_style has been assigned. :dd
{Improper_coeff command before simulation box is defined} :dt
The improper_coeff command cannot be used before a read_data,
read_restart, or create_box command. :dd
{Improper_coeff command when no impropers allowed} :dt
The chosen atom style does not allow for impropers to be defined. :dd
{Improper_style command when no impropers allowed} :dt
The chosen atom style does not allow for impropers to be defined. :dd
{Impropers assigned incorrectly} :dt
Impropers read in from the data file were not assigned correctly to
atoms. This means there is something invalid about the topology
definitions. :dd
{Impropers defined but no improper types} :dt
The data file header lists improper but no improper types. :dd
{Inconsistent iparam/jparam values in fix bond/create command} :dt
If itype and jtype are the same, then their maxbond and newtype
settings must also be the same. :dd
+{Inconsistent line segment in data file} :dt
+
+UNDOCUMENTED :dd
+
+{Inconsistent triangle in data file} :dt
+
+UNDOCUMENTED :dd
+
{Incorrect args for angle coefficients} :dt
Self-explanatory. Check the input script or data file. :dd
{Incorrect args for bond coefficients} :dt
Self-explanatory. Check the input script or data file. :dd
{Incorrect args for dihedral coefficients} :dt
Self-explanatory. Check the input script or data file. :dd
{Incorrect args for improper coefficients} :dt
Self-explanatory. Check the input script or data file. :dd
{Incorrect args for pair coefficients} :dt
Self-explanatory. Check the input script or data file. :dd
{Incorrect args in pair_style command} :dt
Self-explanatory. :dd
{Incorrect atom format in data file} :dt
Number of values per atom line in the data file is not consistent with
the atom style. :dd
+{Incorrect bonus data format in data file} :dt
+
+UNDOCUMENTED :dd
+
{Incorrect boundaries with slab Ewald} :dt
Must have periodic x,y dimensions and non-periodic z dimension to use
2d slab option with Ewald. :dd
{Incorrect boundaries with slab PPPM} :dt
Must have periodic x,y dimensions and non-periodic z dimension to use
2d slab option with PPPM. :dd
+{Incorrect element names in ADP potential file} :dt
+
+UNDOCUMENTED :dd
+
{Incorrect element names in EAM potential file} :dt
The element names in the EAM file do not match those requested. :dd
{Incorrect format in COMB potential file} :dt
Incorrect number of words per line in the potential file. :dd
{Incorrect format in MEAM potential file} :dt
Incorrect number of words per line in the potential file. :dd
{Incorrect format in NEB coordinate file} :dt
Self-explanatory. :dd
{Incorrect format in Stillinger-Weber potential file} :dt
Incorrect number of words per line in the potential file. :dd
{Incorrect format in TMD target file} :dt
Format of file read by fix tmd command is incorrect. :dd
{Incorrect format in Tersoff potential file} :dt
Incorrect number of words per line in the potential file. :dd
{Incorrect multiplicity arg for dihedral coefficients} :dt
Self-explanatory. Check the input script or data file. :dd
{Incorrect sign arg for dihedral coefficients} :dt
Self-explanatory. Check the input script or data file. :dd
{Incorrect velocity format in data file} :dt
Each atom style defines a format for the Velocity section
of the data file. The read-in lines do not match. :dd
{Incorrect weight arg for dihedral coefficients} :dt
Self-explanatory. Check the input script or data file. :dd
{Index between variable brackets must be positive} :dt
Self-explanatory. :dd
{Indexed per-atom vector in variable formula without atom map} :dt
Accessing a value from an atom vector requires the ability to lookup
an atom index, which is provided by an atom map. An atom map does not
exist (by default) for non-molecular problems. Using the atom_modify
map command will force an atom map to be created. :dd
{Induced tilt by displace_box is too large} :dt
The final tilt value must be between -1/2 and 1/2 of the perpendicular
box length. :dd
{Initial temperatures not all set in fix ttm} :dt
Self-explantory. :dd
{Input line too long after variable substitution} :dt
This is a hard (very large) limit defined in the input.cpp file. :dd
{Input line too long: %s} :dt
This is a hard (very large) limit defined in the input.cpp file. :dd
{Insertion region extends outside simulation box} :dt
Region specified with fix pour command extends outside the global
simulation box. :dd
{Insufficient Jacobi rotations for POEMS body} :dt
Eigensolve for rigid body was not sufficiently accurate. :dd
{Insufficient Jacobi rotations for rigid body} :dt
Eigensolve for rigid body was not sufficiently accurate. :dd
-{Insufficient memory on accelerator. } :dt
+{Insufficient Jacobi rotations for triangle} :dt
-Self-explanatory. :dd
+UNDOCUMENTED :dd
+
+{Invalid -reorder N value} :dt
+
+UNDOCUMENTED :dd
{Invalid Boolean syntax in if command} :dt
Self-explanatory. :dd
{Invalid REAX atom type} :dt
There is a mis-match between LAMMPS atom types and the elements
listed in the ReaxFF force field file. :dd
{Invalid angle style} :dt
The choice of angle style is unknown. :dd
{Invalid angle table length} :dt
Length must be 2 or greater. :dd
{Invalid angle type in Angles section of data file} :dt
Angle type must be positive integer and within range of specified angle
types. :dd
{Invalid angle type index for fix shake} :dt
Self-explanatory. :dd
+{Invalid argument for fix nphug} :dt
+
+UNDOCUMENTED :dd
+
{Invalid atom ID in Angles section of data file} :dt
Atom IDs must be positive integers and within range of defined
atoms. :dd
{Invalid atom ID in Atoms section of data file} :dt
Atom IDs must be positive integers. :dd
{Invalid atom ID in Bonds section of data file} :dt
Atom IDs must be positive integers and within range of defined
atoms. :dd
+{Invalid atom ID in Bonus section of data file} :dt
+
+UNDOCUMENTED :dd
+
{Invalid atom ID in Dihedrals section of data file} :dt
Atom IDs must be positive integers and within range of defined
atoms. :dd
{Invalid atom ID in Impropers section of data file} :dt
Atom IDs must be positive integers and within range of defined
atoms. :dd
{Invalid atom ID in Velocities section of data file} :dt
Atom IDs must be positive integers and within range of defined
atoms. :dd
{Invalid atom mass for fix shake} :dt
Mass specified in fix shake command must be > 0.0. :dd
{Invalid atom style} :dt
The choice of atom style is unknown. :dd
{Invalid atom type in Atoms section of data file} :dt
Atom types must range from 1 to specified # of types. :dd
{Invalid atom type in create_atoms command} :dt
The create_box command specified the range of valid atom types.
An invalid type is being requested. :dd
+{Invalid atom type in fix GCMC command} :dt
+
+UNDOCUMENTED :dd
+
{Invalid atom type in fix bond/create command} :dt
Self-explanatory. :dd
{Invalid atom type in neighbor exclusion list} :dt
Atom types must range from 1 to Ntypes inclusive. :dd
{Invalid atom type index for fix shake} :dt
Atom types must range from 1 to Ntypes inclusive. :dd
{Invalid atom types in pair_write command} :dt
Atom types must range from 1 to Ntypes inclusive. :dd
{Invalid atom vector in variable formula} :dt
The atom vector is not recognized. :dd
{Invalid attribute in dump custom command} :dt
Self-explantory. :dd
{Invalid attribute in dump local command} :dt
Self-explantory. :dd
{Invalid attribute in dump modify command} :dt
Self-explantory. :dd
{Invalid bond style} :dt
The choice of bond style is unknown. :dd
{Invalid bond table length} :dt
Length must be 2 or greater. :dd
{Invalid bond type in Bonds section of data file} :dt
Bond type must be positive integer and within range of specified bond
types. :dd
{Invalid bond type in fix bond/break command} :dt
Self-explanatory. :dd
{Invalid bond type in fix bond/create command} :dt
Self-explanatory. :dd
{Invalid bond type index for fix shake} :dt
Self-explanatory. Check the fix shake command in the input script. :dd
{Invalid coeffs for this dihedral style} :dt
Cannot set class 2 coeffs in data file for this dihedral style. :dd
+{Invalid color in dump_modify command} :dt
+
+UNDOCUMENTED :dd
+
+{Invalid color map in dump_modify command} :dt
+
+UNDOCUMENTED :dd
+
{Invalid command-line argument} :dt
One or more command-line arguments is invalid. Check the syntax of
the command you are using to launch LAMMPS. :dd
{Invalid compute ID in variable formula} :dt
The compute is not recognized. :dd
{Invalid compute style} :dt
Self-explanatory. :dd
{Invalid cutoff in communicate command} :dt
Specified cutoff must be >= 0.0. :dd
{Invalid cutoffs in pair_write command} :dt
Inner cutoff must be larger than 0.0 and less than outer cutoff. :dd
{Invalid d1 or d2 value for pair colloid coeff} :dt
Neither d1 or d2 can be < 0. :dd
{Invalid data file section: Angle Coeffs} :dt
Atom style does not allow angles. :dd
{Invalid data file section: AngleAngle Coeffs} :dt
Atom style does not allow impropers. :dd
{Invalid data file section: AngleAngleTorsion Coeffs} :dt
Atom style does not allow dihedrals. :dd
{Invalid data file section: AngleTorsion Coeffs} :dt
Atom style does not allow dihedrals. :dd
{Invalid data file section: Angles} :dt
Atom style does not allow angles. :dd
{Invalid data file section: Bond Coeffs} :dt
Atom style does not allow bonds. :dd
{Invalid data file section: BondAngle Coeffs} :dt
Atom style does not allow angles. :dd
{Invalid data file section: BondBond Coeffs} :dt
Atom style does not allow angles. :dd
{Invalid data file section: BondBond13 Coeffs} :dt
Atom style does not allow dihedrals. :dd
{Invalid data file section: Bonds} :dt
Atom style does not allow bonds. :dd
{Invalid data file section: Dihedral Coeffs} :dt
Atom style does not allow dihedrals. :dd
{Invalid data file section: Dihedrals} :dt
Atom style does not allow dihedrals. :dd
+{Invalid data file section: Ellipsoids} :dt
+
+UNDOCUMENTED :dd
+
{Invalid data file section: EndBondTorsion Coeffs} :dt
Atom style does not allow dihedrals. :dd
{Invalid data file section: Improper Coeffs} :dt
Atom style does not allow impropers. :dd
{Invalid data file section: Impropers} :dt
Atom style does not allow impropers. :dd
+{Invalid data file section: Lines} :dt
+
+UNDOCUMENTED :dd
+
{Invalid data file section: MiddleBondTorsion Coeffs} :dt
Atom style does not allow dihedrals. :dd
+{Invalid data file section: Triangles} :dt
+
+UNDOCUMENTED :dd
+
{Invalid delta_conf in tad command} :dt
The value must be between 0 and 1 inclusive. :dd
{Invalid density in Atoms section of data file} :dt
Density value cannot be <= 0.0. :dd
+{Invalid diameter in set command} :dt
+
+UNDOCUMENTED :dd
+
{Invalid dihedral style} :dt
The choice of dihedral style is unknown. :dd
{Invalid dihedral type in Dihedrals section of data file} :dt
Dihedral type must be positive integer and within range of specified
dihedral types. :dd
-{Invalid dipole line in data file} :dt
-
-Self-explanatory. :dd
-
-{Invalid dipole value} :dt
+{Invalid dipole length in set command} :dt
-Self-explanatory. :dd
+UNDOCUMENTED :dd
{Invalid dump dcd filename} :dt
Filenames used with the dump dcd style cannot be binary or compressed
or cause multiple files to be written. :dd
{Invalid dump frequency} :dt
Dump frequency must be 1 or greater. :dd
+{Invalid dump image color range} :dt
+
+UNDOCUMENTED :dd
+
+{Invalid dump image element name} :dt
+
+UNDOCUMENTED :dd
+
+{Invalid dump image filename} :dt
+
+UNDOCUMENTED :dd
+
+{Invalid dump image persp value} :dt
+
+UNDOCUMENTED :dd
+
+{Invalid dump image theta value} :dt
+
+UNDOCUMENTED :dd
+
+{Invalid dump image up vector} :dt
+
+UNDOCUMENTED :dd
+
+{Invalid dump image zoom value} :dt
+
+UNDOCUMENTED :dd
+
{Invalid dump style} :dt
The choice of dump style is unknown. :dd
{Invalid dump xtc filename} :dt
Filenames used with the dump xtc style cannot be binary or compressed
or cause multiple files to be written. :dd
{Invalid dump xyz filename} :dt
Filenames used with the dump xyz style cannot be binary or cause files
to be written by each processor. :dd
{Invalid dump_modify threshhold operator} :dt
Operator keyword used for threshold specification in not recognized. :dd
+{Invalid entry in reorder file} :dt
+
+UNDOCUMENTED :dd
+
{Invalid fix ID in variable formula} :dt
The fix is not recognized. :dd
{Invalid fix ave/time off column} :dt
Self-explantory. :dd
{Invalid fix box/relax command for a 2d simulation} :dt
Fix box/relax styles involving the z dimension cannot be used in
a 2d simulation. :dd
{Invalid fix box/relax command pressure settings} :dt
If multiple dimensions are coupled, those dimensions must be specified. :dd
{Invalid fix box/relax pressure settings} :dt
Settings for coupled dimensions must be the same. :dd
{Invalid fix nvt/npt/nph command for a 2d simulation} :dt
Cannot control z dimension in a 2d model. :dd
{Invalid fix nvt/npt/nph command pressure settings} :dt
If multiple dimensions are coupled, those dimensions must be
specified. :dd
{Invalid fix nvt/npt/nph pressure settings} :dt
Settings for coupled dimensions must be the same. :dd
{Invalid fix press/berendsen for a 2d simulation} :dt
The z component of pressure cannot be controlled for a 2d model. :dd
{Invalid fix press/berendsen pressure settings} :dt
Settings for coupled dimensions must be the same. :dd
{Invalid fix style} :dt
The choice of fix style is unknown. :dd
{Invalid flag in force field section of restart file} :dt
Unrecognized entry in restart file. :dd
{Invalid flag in header section of restart file} :dt
Unrecognized entry in restart file. :dd
{Invalid flag in type arrays section of restart file} :dt
Unrecognized entry in restart file. :dd
{Invalid frequency in temper command} :dt
Nevery must be > 0. :dd
{Invalid group ID in neigh_modify command} :dt
A group ID used in the neigh_modify command does not exist. :dd
{Invalid group function in variable formula} :dt
Group function is not recognized. :dd
{Invalid group in communicate command} :dt
Self-explanatory. :dd
{Invalid improper style} :dt
The choice of improper style is unknown. :dd
{Invalid improper type in Impropers section of data file} :dt
Improper type must be positive integer and within range of specified
improper types. :dd
{Invalid keyword in angle table parameters} :dt
Self-explanatory. :dd
{Invalid keyword in bond table parameters} :dt
Self-explanatory. :dd
{Invalid keyword in compute angle/local command} :dt
Self-explanatory. :dd
{Invalid keyword in compute bond/local command} :dt
Self-explanatory. :dd
{Invalid keyword in compute dihedral/local command} :dt
Self-explanatory. :dd
{Invalid keyword in compute improper/local command} :dt
Self-explanatory. :dd
{Invalid keyword in compute pair/local command} :dt
Self-explanatory. :dd
{Invalid keyword in compute property/atom command} :dt
Self-explanatory. :dd
{Invalid keyword in compute property/local command} :dt
Self-explanatory. :dd
{Invalid keyword in compute property/molecule command} :dt
Self-explanatory. :dd
{Invalid keyword in dump cfg command} :dt
Self-explanatory. :dd
{Invalid keyword in pair table parameters} :dt
Keyword used in list of table parameters is not recognized. :dd
{Invalid keyword in thermo_style custom command} :dt
One or more specified keywords are not recognized. :dd
{Invalid kspace style} :dt
The choice of kspace style is unknown. :dd
+{Invalid length in set command} :dt
+
+UNDOCUMENTED :dd
+
+{Invalid mass in set command} :dt
+
+UNDOCUMENTED :dd
+
{Invalid mass line in data file} :dt
Self-explanatory. :dd
{Invalid mass value} :dt
Self-explanatory. :dd
{Invalid math function in variable formula} :dt
Self-explanatory. :dd
{Invalid math/group/special function in variable formula} :dt
Self-explanatory. :dd
{Invalid option in lattice command for non-custom style} :dt
Certain lattice keywords are not supported unless the
lattice style is "custom". :dd
{Invalid order of forces within respa levels} :dt
For respa, ordering of force computations within respa levels must
obey certain rules. E.g. bonds cannot be compute less frequently than
angles, pairwise forces cannot be computed less frequently than
kspace, etc. :dd
{Invalid pair style} :dt
The choice of pair style is unknown. :dd
{Invalid pair table cutoff} :dt
Cutoffs in pair_coeff command are not valid with read-in pair table. :dd
{Invalid pair table length} :dt
Length of read-in pair table is invalid :dd
+{Invalid partitions in processors part command} :dt
+
+UNDOCUMENTED :dd
+
{Invalid radius in Atoms section of data file} :dt
Radius must be >= 0.0. :dd
{Invalid random number seed in fix ttm command} :dt
Random number seed must be > 0. :dd
{Invalid random number seed in set command} :dt
Random number seed must be > 0. :dd
{Invalid region style} :dt
The choice of region style is unknown. :dd
{Invalid replace values in compute reduce} :dt
Self-explanatory. :dd
{Invalid run command N value} :dt
The number of timesteps must fit in a 32-bit integer. If you want to
run for more steps than this, perform multiple shorter runs. :dd
{Invalid run command start/stop value} :dt
Self-explanatory. :dd
{Invalid run command upto value} :dt
Self-explanatory. :dd
{Invalid seed for Marsaglia random # generator} :dt
The initial seed for this random number generator must be a positive
integer less than or equal to 900 million. :dd
{Invalid seed for Park random # generator} :dt
The initial seed for this random number generator must be a positive
integer. :dd
-{Invalid shape line in data file} :dt
+{Invalid shape in Ellipsoids section of data file} :dt
-Self-explanatory. :dd
+UNDOCUMENTED :dd
-{Invalid shape line in data file} :dt
+{Invalid shape in Triangles section of data file} :dt
-Self-explanatory. :dd
+UNDOCUMENTED :dd
-{Invalid shape value} :dt
+{Invalid shape in set command} :dt
-Self-explanatory. :dd
+UNDOCUMENTED :dd
{Invalid shear direction for fix wall/gran} :dt
Self-explanatory. :dd
{Invalid special function in variable formula} :dt
Self-explanatory. :dd
{Invalid style in pair_write command} :dt
Self-explanatory. Check the input script. :dd
{Invalid syntax in variable formula} :dt
Self-explanatory. :dd
{Invalid t_event in prd command} :dt
Self-explanatory. :dd
{Invalid t_event in tad command} :dt
The value must be greater than 0. :dd
{Invalid thermo keyword in variable formula} :dt
The keyword is not recognized. :dd
{Invalid tmax in tad command} :dt
The value must be greater than 0.0. :dd
-{Invalid type for dipole set} :dt
-
-Dipole command must set a type from 1-N where N is the number of atom
-types. :dd
-
{Invalid type for mass set} :dt
Mass command must set a type from 1-N where N is the number of atom
types. :dd
-{Invalid type for shape set} :dt
-
-Atom type is out of bounds. :dd
-
{Invalid value in set command} :dt
The value specified for the setting is invalid, likely because it is
too small or too large. :dd
{Invalid variable evaluation in variable formula} :dt
A variable used in a formula could not be evaluated. :dd
{Invalid variable in next command} :dt
Self-explanatory. :dd
-{Invalid variable name in variable formula} :dt
-
-Variable name is not recognized. :dd
-
{Invalid variable name} :dt
Variable name used in an input script line is invalid. :dd
+{Invalid variable name in variable formula} :dt
+
+Variable name is not recognized. :dd
+
{Invalid variable style with next command} :dt
Variable styles {equal} and {world} cannot be used in a next
command. :dd
{Invalid wiggle direction for fix wall/gran} :dt
Self-explanatory. :dd
{Invoked angle equil angle on angle style none} :dt
Self-explanatory. :dd
{Invoked angle single on angle style none} :dt
Self-explanatory. :dd
{Invoked bond equil distance on bond style none} :dt
Self-explanatory. :dd
{Invoked bond single on bond style none} :dt
Self-explanatory. :dd
{Invoked pair single on pair style none} :dt
A command (e.g. a dump) attempted to invoke the single() function on a
pair style none, which is illegal. You are probably attempting to
compute per-atom quantities with an undefined pair style. :dd
{KSpace style has not yet been set} :dt
Cannot use kspace_modify command until a kspace style is set. :dd
{KSpace style is incompatible with Pair style} :dt
Setting a kspace style requires that a pair style with a long-range
Coulombic component be selected. :dd
{Keyword %s in MEAM parameter file not recognized} :dt
Self-explanatory. :dd
+{Kspace style pppm/tip4p requires newton on} :dt
+
+UNDOCUMENTED :dd
+
{Kspace style requires atom attribute q} :dt
The atom style defined does not have these attributes. :dd
{Label wasn't found in input script} :dt
Self-explanatory. :dd
{Lattice orient vectors are not orthogonal} :dt
The three specified lattice orientation vectors must be mutually
orthogonal. :dd
{Lattice orient vectors are not right-handed} :dt
The three specified lattice orientation vectors must create a
right-handed coordinate system such that a1 cross a2 = a3. :dd
{Lattice primitive vectors are collinear} :dt
The specified lattice primitive vectors do not for a unit cell with
non-zero volume. :dd
{Lattice settings are not compatible with 2d simulation} :dt
One or more of the specified lattice vectors has a non-zero z
component. :dd
{Lattice spacings are invalid} :dt
Each x,y,z spacing must be > 0. :dd
{Lattice style incompatible with simulation dimension} :dt
2d simulation can use sq, sq2, or hex lattice. 3d simulation can use
sc, bcc, or fcc lattice. :dd
{Log of zero/negative value in variable formula} :dt
Self-explanatory. :dd
+{Lost atoms via displace_atoms: original %ld current %ld} :dt
+
+UNDOCUMENTED :dd
+
+{Lost atoms via displace_box: original %ld current %ld} :dt
+
+UNDOCUMENTED :dd
+
+{Lost atoms: original %ld current %ld} :dt
+
+UNDOCUMENTED :dd
+
{MEAM library error %d} :dt
A call to the MEAM Fortran library returned an error. :dd
{MPI_LMP_BIGINT and bigint in lmptype.h are not compatible} :dt
The size of the MPI datatype does not match the size of a bigint. :dd
{MPI_LMP_TAGINT and tagint in lmptype.h are not compatible} :dt
The size of the MPI datatype does not match the size of a tagint. :dd
{Mass command before simulation box is defined} :dt
The mass command cannot be used before a read_data, read_restart, or
create_box command. :dd
{Min_style command before simulation box is defined} :dt
The min_style command cannot be used before a read_data, read_restart,
or create_box command. :dd
{Minimization could not find thermo_pe compute} :dt
This compute is created by the thermo command. It must have been
explicitly deleted by a uncompute command. :dd
{Minimize command before simulation box is defined} :dt
The minimize command cannot be used before a read_data, read_restart,
or create_box command. :dd
{Mismatched brackets in variable} :dt
Self-explanatory. :dd
{Mismatched compute in variable formula} :dt
A compute is referenced incorrectly or a compute that produces per-atom
values is used in an equal-style variable formula. :dd
{Mismatched fix in variable formula} :dt
A fix is referenced incorrectly or a fix that produces per-atom
values is used in an equal-style variable formula. :dd
{Mismatched variable in variable formula} :dt
A variable is referenced incorrectly or an atom-style variable that
produces per-atom values is used in an equal-style variable
formula. :dd
{Molecular data file has too many atoms} :dt
These kids of data files are currently limited to a number
of atoms that fits in a 32-bit integer. :dd
{Molecule count changed in compute atom/molecule} :dt
Number of molecules must remain constant over time. :dd
{Molecule count changed in compute com/molecule} :dt
Number of molecules must remain constant over time. :dd
{Molecule count changed in compute gyration/molecule} :dt
Number of molecules must remain constant over time. :dd
{Molecule count changed in compute msd/molecule} :dt
Number of molecules must remain constant over time. :dd
{Molecule count changed in compute property/molecule} :dt
Number of molecules must remain constant over time. :dd
{More than one fix deform} :dt
Only one fix deform can be defined at a time. :dd
{More than one fix freeze} :dt
Only one of these fixes can be defined, since the granular pair
potentials access it. :dd
{More than one fix shake} :dt
Only one fix shake can be defined. :dd
{Must define angle_style before Angle Coeffs} :dt
Must use an angle_style command before reading a data file that
defines Angle Coeffs. :dd
{Must define angle_style before BondAngle Coeffs} :dt
Must use an angle_style command before reading a data file that
defines Angle Coeffs. :dd
{Must define angle_style before BondBond Coeffs} :dt
Must use an angle_style command before reading a data file that
defines Angle Coeffs. :dd
{Must define bond_style before Bond Coeffs} :dt
Must use a bond_style command before reading a data file that
defines Bond Coeffs. :dd
{Must define dihedral_style before AngleAngleTorsion Coeffs} :dt
Must use a dihedral_style command before reading a data file that
defines AngleAngleTorsion Coeffs. :dd
{Must define dihedral_style before AngleTorsion Coeffs} :dt
Must use a dihedral_style command before reading a data file that
defines AngleTorsion Coeffs. :dd
{Must define dihedral_style before BondBond13 Coeffs} :dt
Must use a dihedral_style command before reading a data file that
defines BondBond13 Coeffs. :dd
{Must define dihedral_style before Dihedral Coeffs} :dt
Must use a dihedral_style command before reading a data file that
defines Dihedral Coeffs. :dd
{Must define dihedral_style before EndBondTorsion Coeffs} :dt
Must use a dihedral_style command before reading a data file that
defines EndBondTorsion Coeffs. :dd
{Must define dihedral_style before MiddleBondTorsion Coeffs} :dt
Must use a dihedral_style command before reading a data file that
defines MiddleBondTorsion Coeffs. :dd
{Must define improper_style before AngleAngle Coeffs} :dt
Must use an improper_style command before reading a data file that
defines AngleAngle Coeffs. :dd
{Must define improper_style before Improper Coeffs} :dt
Must use an improper_style command before reading a data file that
defines Improper Coeffs. :dd
+{Must define lattice to append_atoms} :dt
+
+UNDOCUMENTED :dd
+
{Must define pair_style before Pair Coeffs} :dt
Must use a pair_style command before reading a data file that defines
Pair Coeffs. :dd
{Must have more than one processor partition to temper} :dt
Cannot use the temper command with only one processor partition. Use
the -partition command-line option. :dd
{Must read Atoms before Angles} :dt
The Atoms section of a data file must come before an Angles section. :dd
{Must read Atoms before Bonds} :dt
The Atoms section of a data file must come before a Bonds section. :dd
{Must read Atoms before Dihedrals} :dt
The Atoms section of a data file must come before a Dihedrals section. :dd
+{Must read Atoms before Ellipsoids} :dt
+
+UNDOCUMENTED :dd
+
{Must read Atoms before Impropers} :dt
The Atoms section of a data file must come before an Impropers
section. :dd
+{Must read Atoms before Lines} :dt
+
+UNDOCUMENTED :dd
+
+{Must read Atoms before Triangles} :dt
+
+UNDOCUMENTED :dd
+
{Must read Atoms before Velocities} :dt
The Atoms section of a data file must come before a Velocities
section. :dd
{Must set both respa inner and outer} :dt
Cannot use just the inner or outer option with respa without using the
other. :dd
+{Must shrink-wrap piston boundary} :dt
+
+UNDOCUMENTED :dd
+
{Must specify a region in fix deposit} :dt
The region keyword must be specified with this fix. :dd
{Must specify a region in fix pour} :dt
The region keyword must be specified with this fix. :dd
{Must use -in switch with multiple partitions} :dt
A multi-partition simulation cannot read the input script from stdin.
The -in command-line option must be used to specify a file. :dd
{Must use a block or cylinder region with fix pour} :dt
Self-explanatory. :dd
{Must use a block region with fix pour for 2d simulations} :dt
Self-explanatory. :dd
{Must use a bond style with TIP4P potential} :dt
TIP4P potentials assume bond lengths in water are constrained
by a fix shake command. :dd
{Must use a molecular atom style with fix poems molecule} :dt
Self-explanatory. :dd
{Must use a z-axis cylinder with fix pour} :dt
The axis of the cylinder region used with the fix pour command must
be oriented along the z dimension. :dd
{Must use an angle style with TIP4P potential} :dt
TIP4P potentials assume angles in water are constrained by a fix shake
command. :dd
{Must use atom style with molecule IDs with fix bond/swap} :dt
Self-explanatory. :dd
{Must use pair_style comb with fix qeq/comb} :dt
Self-explanatory. :dd
{Must use variable energy with fix addforce} :dt
Must define an energy vartiable when applyting a dynamic
force during minimization. :dd
{NEB command before simulation box is defined} :dt
Self-explanatory. :dd
{NEB requires damped dynamics minimizer} :dt
Use a different minimization style. :dd
{NEB requires use of fix neb} :dt
Self-explanatory. :dd
+{NL ramp in wall/piston only implemented in zlo for now} :dt
+
+UNDOCUMENTED :dd
+
+{Needed bonus data not in data file} :dt
+
+UNDOCUMENTED :dd
+
{Needed topology not in data file} :dt
The header of the data file indicated that bonds or angles or
dihedrals or impropers would be included, but they were not present. :dd
{Neigh_modify exclude molecule requires atom attribute molecule} :dt
Self-explanatory. :dd
{Neigh_modify include group != atom_modify first group} :dt
Self-explanatory. :dd
{Neighbor delay must be 0 or multiple of every setting} :dt
The delay and every parameters set via the neigh_modify command are
inconsistent. If the delay setting is non-zero, then it must be a
multiple of the every setting. :dd
{Neighbor include group not allowed with ghost neighbors} :dt
This is a current restriction within LAMMPS. :dd
{Neighbor list overflow, boost neigh_modify one or page} :dt
There are too many neighbors of a single atom. Use the neigh_modify
command to increase the neighbor page size and the max number of
neighbors allowed for one atom. :dd
{Neighbor multi not yet enabled for ghost neighbors} :dt
This is a current restriction within LAMMPS. :dd
{Neighbor multi not yet enabled for granular} :dt
Self-explanatory. :dd
{Neighbor multi not yet enabled for rRESPA} :dt
Self-explanatory. :dd
{Neighbor page size must be >= 10x the one atom setting} :dt
This is required to prevent wasting too much memory. :dd
{Neighbors of ghost atoms only allowed for full neighbor lists} :dt
This is a current restriction within LAMMPS. :dd
{New bond exceeded bonds per atom in fix bond/create} :dt
See the read_data command for info on setting the "extra bond per
atom" header value to allow for additional bonds to be formed. :dd
{New bond exceeded special list size in fix bond/create} :dt
See the special_bonds extra command for info on how to leave space in
the special bonds list to allow for additional bonds to be formed. :dd
{Newton bond change after simulation box is defined} :dt
The newton command cannot be used to change the newton bond value
after a read_data, read_restart, or create_box command. :dd
+{No OpenMP support compiled in} :dt
+
+UNDOCUMENTED :dd
+
{No angle style is defined for compute angle/local} :dt
Self-explanatory. :dd
{No angles allowed with this atom style} :dt
Self-explanatory. Check data file. :dd
{No atoms in data file} :dt
The header of the data file indicated that atoms would be included,
but they were not present. :dd
{No basis atoms in lattice} :dt
Basis atoms must be defined for lattice style user. :dd
{No bond style is defined for compute bond/local} :dt
Self-explanatory. :dd
{No bonds allowed with this atom style} :dt
Self-explanatory. Check data file. :dd
{No dihedral style is defined for compute dihedral/local} :dt
Self-explanatory. :dd
{No dihedrals allowed with this atom style} :dt
Self-explanatory. Check data file. :dd
{No dump custom arguments specified} :dt
The dump custom command requires that atom quantities be specified to
output to dump file. :dd
{No dump local arguments specified} :dt
Self-explanatory. :dd
+{No ellipsoids allowed with this atom style} :dt
+
+UNDOCUMENTED :dd
+
{No fix gravity defined for fix pour} :dt
Cannot add poured particles without gravity to move them. :dd
{No improper style is defined for compute improper/local} :dt
Self-explanatory. :dd
{No impropers allowed with this atom style} :dt
Self-explanatory. Check data file. :dd
+{No lines allowed with this atom style} :dt
+
+UNDOCUMENTED :dd
+
+{No matching element in ADP potential file} :dt
+
+UNDOCUMENTED :dd
+
{No matching element in EAM potential file} :dt
The EAM potential file does not contain elements that match the
requested elements. :dd
{No pair hbond/dreiding coefficients set} :dt
Self-explanatory. :dd
{No pair style defined for compute group/group} :dt
Cannot calculate group interactions without a pair style defined. :dd
{No pair style is defined for compute pair/local} :dt
Self-explanatory. :dd
{No pair style is defined for compute property/local} :dt
Self-explanatory. :dd
{No rigid bodies defined} :dt
The fix specification did not end up defining any rigid bodies. :dd
+{No triangles allowed with this atom style} :dt
+
+UNDOCUMENTED :dd
+
{Non digit character between brackets in variable} :dt
Self-explantory. :dd
{Non integer # of swaps in temper command} :dt
Swap frequency in temper command must evenly divide the total # of
timesteps. :dd
+{Nprocs not a multiple of N for -reorder} :dt
+
+UNDOCUMENTED :dd
+
+{Numeric index is out of bounds} :dt
+
+UNDOCUMENTED :dd
+
{One or more atoms belong to multiple rigid bodies} :dt
Two or more rigid bodies defined by the fix rigid command cannot
contain the same atom. :dd
{One or zero atoms in rigid body} :dt
Any rigid body defined by the fix rigid command must contain 2 or more
atoms. :dd
+{Only zhi currently implemented for append_atom} :dt
+
+UNDOCUMENTED :dd
+
+{Only zhi currently implemented for append_atoms} :dt
+
+UNDOCUMENTED :dd
+
+{Out of memory on GPGPU} :dt
+
+UNDOCUMENTED :dd
+
{Out of range atoms - cannot compute PPPM} :dt
One or more atoms are attempting to map their charge to a PPPM grid
point that is not owned by a processor. This is likely for one of two
reasons, both of them bad. First, it may mean that an atom near the
boundary of a processor's sub-domain has moved more than 1/2 the
"neighbor skin distance"_neighbor.html without neighbor lists being
rebuilt and atoms being migrated to new processors. This also means
you may be missing pairwise interactions that need to be computed.
The solution is to change the re-neighboring criteria via the
"neigh_modify"_neigh_modify command. The safest settings are "delay 0
every 1 check yes". Second, it may mean that an atom has moved far
outside a processor's sub-domain or even the entire simulation box.
This indicates bad physics, e.g. due to highly overlapping atoms, too
large a timestep, etc. :dd
{Overlapping large/large in pair colloid} :dt
This potential is infinite when there is an overlap. :dd
{Overlapping small/large in pair colloid} :dt
This potential is inifinte when there is an overlap. :dd
{POEMS fix must come before NPT/NPH fix} :dt
NPT/NPH fix must be defined in input script after all poems fixes,
else the fix contribution to the pressure virial is incorrect. :dd
{PPPM grid is too large} :dt
The global PPPM grid is larger than OFFSET in one or more dimensions.
OFFSET is currently set to 4096. You likely need to decrease the
requested precision. :dd
{PPPM order cannot be greater than %d} :dt
Self-explanatory. :dd
{PPPM order has been reduced to 0} :dt
LAMMPS has attempted to reduce the PPPM order to enable the simulation
to run, but can reduce the order no further. Try increasing the
accuracy of PPPM by reducing the tolerance size, thus inducing a
larger PPPM grid. :dd
{PRD command before simulation box is defined} :dt
The prd command cannot be used before a read_data,
read_restart, or create_box command. :dd
{PRD nsteps must be multiple of t_event} :dt
Self-explanatory. :dd
{PRD t_corr must be multiple of t_event} :dt
Self-explanatory. :dd
+{Package command after simulation box is defined} :dt
+
+UNDOCUMENTED :dd
+
+{Package cuda command without USER-CUDA installed} :dt
+
+UNDOCUMENTED :dd
+
+{Pair brownian requires atom style sphere} :dt
+
+UNDOCUMENTED :dd
+
+{Pair brownian requires extended particles} :dt
+
+UNDOCUMENTED :dd
+
+{Pair brownian requires monodisperse particles} :dt
+
+UNDOCUMENTED :dd
+
+{Pair brownian/poly requires atom style sphere} :dt
+
+UNDOCUMENTED :dd
+
+{Pair brownian/poly requires extended particles} :dt
+
+UNDOCUMENTED :dd
+
+{Pair brownian/poly requires newton pair off} :dt
+
+UNDOCUMENTED :dd
+
{Pair coeff for hybrid has invalid style} :dt
Style in pair coeff must have been listed in pair_style command. :dd
+{Pair coul/wolf requires atom attribute q} :dt
+
+UNDOCUMENTED :dd
+
{Pair cutoff < Respa interior cutoff} :dt
One or more pairwise cutoffs are too short to use with the specified
rRESPA cutoffs. :dd
-{Pair dipole/cut requires atom attributes q, mu, torque, dipole} :dt
+{Pair dipole/cut requires atom attributes q, mu, torque} :dt
-An atom style that specifies these quantities is needed. :dd
+UNDOCUMENTED :dd
{Pair distance < table inner cutoff} :dt
Two atoms are closer together than the pairwise table allows. :dd
{Pair distance > table outer cutoff} :dt
Two atoms are further apart than the pairwise table allows. :dd
{Pair dpd requires ghost atoms store velocity} :dt
Use the communicate vel yes command to enable this. :dd
-{Pair gayberne cannot be used with atom attribute diameter} :dt
-
-Finite-size particles must be defined with the shape command. :dd
-
{Pair gayberne epsilon a,b,c coeffs are not all set} :dt
Each atom type involved in pair_style gayberne must
have these 3 coefficients set at least once. :dd
-{Pair gayberne requires atom attributes quat, torque, shape} :dt
+{Pair gayberne requires atom style ellipsoid} :dt
-An atom style that defines these attributes must be used. :dd
+UNDOCUMENTED :dd
-{Pair granular requires atom attributes radius, omega, torque} :dt
+{Pair gayberne requires atoms with same type have same shape} :dt
-The atom style defined does not have these attributes. :dd
+UNDOCUMENTED :dd
+
+{Pair gayberne/gpu requires atom style ellipsoid} :dt
+
+UNDOCUMENTED :dd
+
+{Pair gayberne/gpu requires atoms with same type have same shape} :dt
+
+UNDOCUMENTED :dd
+
+{Pair granular requires atom style sphere} :dt
+
+UNDOCUMENTED :dd
{Pair granular requires ghost atoms store velocity} :dt
Use the communicate vel yes command to enable this. :dd
{Pair granular with shear history requires newton pair off} :dt
This is a current restriction of the implementation of pair
granular styles with history. :dd
{Pair hybrid sub-style does not support single call} :dt
You are attempting to invoke a single() call on a pair style
that doesn't support it. :dd
{Pair hybrid sub-style is not used} :dt
No pair_coeff command used a sub-style specified in the pair_style
command. :dd
{Pair inner cutoff < Respa interior cutoff} :dt
One or more pairwise cutoffs are too short to use with the specified
rRESPA cutoffs. :dd
{Pair inner cutoff >= Pair outer cutoff} :dt
The specified cutoffs for the pair style are inconsistent. :dd
-{Pair lubricate cannot be used with atom attributes diameter or rmass} :dt
+{Pair line/lj requires atom style line} :dt
-These attributes override the shape and mass settings, so cannot be
-used. :dd
+UNDOCUMENTED :dd
+
+{Pair lubricate requires atom style sphere} :dt
+
+UNDOCUMENTED :dd
-{Pair lubricate requires atom attribute omega or angmom} :dt
+{Pair lubricate requires ghost atoms store velocity} :dt
-An atom style that defines these attributes must be used. :dd
+Use the communicate vel yes command to enable this. :dd
-{Pair lubricate requires atom attributes torque and shape} :dt
+{Pair lubricate requires monodisperse particles} :dt
-An atom style that defines these attributes must be used. :dd
+UNDOCUMENTED :dd
-{Pair lubricate requires extended particles} :dt
+{Pair lubricate/poly requires atom style sphere} :dt
-This pair style can only be used for particles with a shape
-setting. :dd
+UNDOCUMENTED :dd
-{Pair lubricate requires ghost atoms store velocity} :dt
+{Pair lubricate/poly requires extended particles} :dt
-Use the communicate vel yes command to enable this. :dd
+UNDOCUMENTED :dd
+
+{Pair lubricate/poly requires ghost atoms store velocity} :dt
-{Pair lubricate requires spherical, mono-disperse particles} :dt
+UNDOCUMENTED :dd
-This is a current restriction of this pair style. :dd
+{Pair lubricate/poly requires newton pair off} :dt
+
+UNDOCUMENTED :dd
+
+{Pair lubricateU requires atom style sphere} :dt
+
+UNDOCUMENTED :dd
+
+{Pair lubricateU requires ghost atoms store velocity} :dt
+
+UNDOCUMENTED :dd
+
+{Pair lubricateU requires monodisperse particles} :dt
+
+UNDOCUMENTED :dd
+
+{Pair lubricateU/poly requires ghost atoms store velocity} :dt
+
+UNDOCUMENTED :dd
+
+{Pair lubricateU/poly requires newton pair off} :dt
+
+UNDOCUMENTED :dd
{Pair peri lattice is not identical in x, y, and z} :dt
The lattice defined by the lattice command must be cubic. :dd
{Pair peri requires a lattice be defined} :dt
Use the lattice command for this purpose. :dd
{Pair peri requires an atom map, see atom_modify} :dt
Even for atomic systems, an atom map is required to find Peridynamic
bonds. Use the atom_modify command to define one. :dd
-{Pair resquared cannot be used with atom attribute diameter} :dt
-
-This attribute overrides the shape settings, so cannot be used. :dd
-
{Pair resquared epsilon a,b,c coeffs are not all set} :dt
Self-explanatory. :dd
{Pair resquared epsilon and sigma coeffs are not all set} :dt
Self-explanatory. :dd
-{Pair resquared requires atom attributes quat, torque, shape} :dt
+{Pair resquared requires atom style ellipsoid} :dt
+
+UNDOCUMENTED :dd
+
+{Pair resquared/gpu requires atom style ellipsoid} :dt
+
+UNDOCUMENTED :dd
+
+{Pair resquared/gpu requires atoms with same type have same shape} :dt
-An atom style that defines these attributes must be used. :dd
+UNDOCUMENTED :dd
{Pair style AIREBO requires atom IDs} :dt
This is a requirement to use the AIREBO potential. :dd
{Pair style AIREBO requires newton pair on} :dt
See the newton command. This is a restriction to use the AIREBO
potential. :dd
{Pair style COMB requires atom IDs} :dt
This is a requirement to use the AIREBO potential. :dd
{Pair style COMB requires atom attribute q} :dt
Self-explanatory. :dd
{Pair style COMB requires newton pair on} :dt
See the newton command. This is a restriction to use the COMB
potential. :dd
{Pair style MEAM requires newton pair on} :dt
See the newton command. This is a restriction to use the MEAM
potential. :dd
{Pair style Stillinger-Weber requires atom IDs} :dt
This is a requirement to use the SW potential. :dd
{Pair style Stillinger-Weber requires newton pair on} :dt
See the newton command. This is a restriction to use the SW
potential. :dd
{Pair style Tersoff requires atom IDs} :dt
This is a requirement to use the Tersoff potential. :dd
{Pair style Tersoff requires newton pair on} :dt
See the newton command. This is a restriction to use the Tersoff
potential. :dd
+{Pair style born/coul/Wolf requires atom attribute q} :dt
+
+UNDOCUMENTED :dd
+
{Pair style born/coul/long requires atom attribute q} :dt
An atom style that defines this attribute must be used. :dd
{Pair style buck/coul/cut requires atom attribute q} :dt
The atom style defined does not have this attribute. :dd
{Pair style buck/coul/long requires atom attribute q} :dt
The atom style defined does not have these attributes. :dd
{Pair style coul/cut requires atom attribute q} :dt
The atom style defined does not have these attributes. :dd
+{Pair style coul/long/gpu requires atom attribute q} :dt
+
+UNDOCUMENTED :dd
+
+{Pair style does not have single field requested by compute pair/local} :dt
+
+UNDOCUMENTED :dd
+
{Pair style does not support bond_style quartic} :dt
The pair style does not have a single() function, so it can
not be invoked by bond_style quartic. :dd
{Pair style does not support compute group/group} :dt
The pair_style does not have a single() function, so it cannot be
invokded by the compute group/group command. :dd
{Pair style does not support compute pair/local} :dt
The pair style does not have a single() function, so it can
not be invoked by fix bond/swap. :dd
{Pair style does not support compute property/local} :dt
The pair style does not have a single() function, so it can
not be invoked by fix bond/swap. :dd
{Pair style does not support fix bond/swap} :dt
The pair style does not have a single() function, so it can
not be invoked by fix bond/swap. :dd
{Pair style does not support pair_write} :dt
The pair style does not have a single() function, so it can
not be invoked by pair write. :dd
{Pair style does not support rRESPA inner/middle/outer} :dt
You are attempting to use rRESPA options with a pair style that
does not support them. :dd
{Pair style granular with history requires atoms have IDs} :dt
Atoms in the simulation do not have IDs, so history effects
cannot be tracked by the granular pair potential. :dd
{Pair style hbond/dreiding requires an atom map, see atom_modify} :dt
Self-explanatory. :dd
{Pair style hbond/dreiding requires atom IDs} :dt
Self-explanatory. :dd
{Pair style hbond/dreiding requires molecular system} :dt
Self-explanatory. :dd
{Pair style hbond/dreiding requires newton pair on} :dt
See the newton command for details. :dd
{Pair style hybrid cannot have hybrid as an argument} :dt
Self-explanatory. :dd
{Pair style hybrid cannot have none as an argument} :dt
Self-explanatory. :dd
{Pair style hybrid cannot use same pair style twice} :dt
The sub-style arguments of pair_style hybrid cannot be duplicated.
Check the input script. :dd
{Pair style is incompatible with KSpace style} :dt
If a pair style with a long-range Coulombic component is selected,
then a kspace style must also be used. :dd
{Pair style lj/charmm/coul/charmm requires atom attribute q} :dt
The atom style defined does not have these attributes. :dd
{Pair style lj/charmm/coul/long requires atom attribute q} :dt
The atom style defined does not have these attributes. :dd
+{Pair style lj/charmm/coul/long/gpu requires atom attribute q} :dt
+
+UNDOCUMENTED :dd
+
{Pair style lj/class2/coul/cut requires atom attribute q} :dt
The atom style defined does not have this attribute. :dd
{Pair style lj/class2/coul/long requires atom attribute q} :dt
The atom style defined does not have this attribute. :dd
+{Pair style lj/class2/coul/long/gpu requires atom attribute q} :dt
+
+UNDOCUMENTED :dd
+
{Pair style lj/cut/coul/cut requires atom attribute q} :dt
The atom style defined does not have this attribute. :dd
+{Pair style lj/cut/coul/cut/gpu requires atom attribute q} :dt
+
+UNDOCUMENTED :dd
+
{Pair style lj/cut/coul/long requires atom attribute q} :dt
The atom style defined does not have this attribute. :dd
+{Pair style lj/cut/coul/long/gpu requires atom attribute q} :dt
+
+UNDOCUMENTED :dd
+
{Pair style lj/cut/coul/long/tip4p requires atom IDs} :dt
There are no atom IDs defined in the system and the TIP4P potential
requires them to find O,H atoms with a water molecule. :dd
{Pair style lj/cut/coul/long/tip4p requires atom attribute q} :dt
The atom style defined does not have these attributes. :dd
{Pair style lj/cut/coul/long/tip4p requires newton pair on} :dt
This is because the computation of constraint forces within a water
molecule adds forces to atoms owned by other processors. :dd
{Pair style lj/gromacs/coul/gromacs requires atom attribute q} :dt
An atom_style with this attribute is needed. :dd
-{Pair style peri_lps requires atom style peri} :dt
-
-This is because atom style peri stores quantities needed by
-the peridynamic potential. :dd
-
-{Pair style peri_pmb requires atom style peri} :dt
+{Pair style peri requires atom style peri} :dt
-This is because atom style peri stores quantities needed by
-the peridynamic potential. :dd
+UNDOCUMENTED :dd
{Pair style reax requires atom IDs} :dt
This is a requirement to use the ReaxFF potential. :dd
{Pair style reax requires newton pair on} :dt
This is a requirement to use the ReaxFF potential. :dd
{Pair table cutoffs must all be equal to use with KSpace} :dt
When using pair style table with a long-range KSpace solver, the
cutoffs for all atom type pairs must all be the same, since the
long-range solver starts at that cutoff. :dd
{Pair table parameters did not set N} :dt
List of pair table parameters must include N setting. :dd
{Pair tersoff/zbl requires metal or real units} :dt
This is a current restriction of this pair potential. :dd
-{Pair yukawa/colloid cannot be used with atom attribute diameter} :dt
+{Pair tri/lj requires atom style tri} :dt
-Only finite-size particles defined by the shape command can be used. :dd
+UNDOCUMENTED :dd
-{Pair yukawa/colloid requires atom attribute shape} :dt
+{Pair yukawa/colloid requires atom style sphere} :dt
-Self-explanatory. :dd
+UNDOCUMENTED :dd
-{Pair yukawa/colloid requires spherical particles} :dt
+{Pair yukawa/colloid requires atoms with same type have same radius} :dt
-Self-explanatory. :dd
+UNDOCUMENTED :dd
{Pair_coeff command before pair_style is defined} :dt
Self-explanatory. :dd
{Pair_coeff command before simulation box is defined} :dt
The pair_coeff command cannot be used before a read_data,
read_restart, or create_box command. :dd
{Pair_modify command before pair_style is defined} :dt
Self-explanatory. :dd
{Pair_write command before pair_style is defined} :dt
Self-explanatory. :dd
{Particle on or inside fix wall surface} :dt
Particles must be "exterior" to the wall in order for energy/force to
be calculated. :dd
{Particle on or inside surface of region used in fix wall/region} :dt
Particles must be "exterior" to the region surface in order for
energy/force to be calculated. :dd
{Per-atom compute in equal-style variable formula} :dt
Equal-style variables cannot use per-atom quantities. :dd
{Per-atom energy was not tallied on needed timestep} :dt
You are using a thermo keyword that requires potentials to
have tallied energy, but they didn't on this timestep. See the
variable doc page for ideas on how to make this work. :dd
{Per-atom fix in equal-style variable formula} :dt
Equal-style variables cannot use per-atom quantities. :dd
{Per-atom virial was not tallied on needed timestep} :dt
You are using a thermo keyword that requires potentials to have
tallied the virial, but they didn't on this timestep. See the
variable doc page for ideas on how to make this work. :dd
{Per-processor system is too big} :dt
The number of owned atoms plus ghost atoms on a single
processor must fit in 32-bit integer. :dd
{Potential energy ID for fix neb does not exist} :dt
Self-explanatory. :dd
+{Potential energy ID for fix nvt/nph/npt does not exist} :dt
+
+UNDOCUMENTED :dd
+
{Potential file has duplicate entry} :dt
The potential file for a SW or Tersoff potential has more than
one entry for the same 3 ordered elements. :dd
{Potential file is missing an entry} :dt
The potential file for a SW or Tersoff potential does not have a
needed entry. :dd
{Power by 0 in variable formula} :dt
Self-explanatory. :dd
{Pressure ID for fix box/relax does not exist} :dt
The compute ID needed to compute pressure for the fix does not
exist. :dd
{Pressure ID for fix modify does not exist} :dt
Self-explanatory. :dd
{Pressure ID for fix npt/nph does not exist} :dt
Self-explanatory. :dd
{Pressure ID for fix press/berendsen does not exist} :dt
The compute ID needed to compute pressure for the fix does not
exist. :dd
{Pressure ID for thermo does not exist} :dt
The compute ID needed to compute pressure for thermodynamics does not
exist. :dd
+{Pressure control can not be used with fix nvt} :dt
+
+Self-explanatory. :dd
+
{Pressure control can not be used with fix nvt/asphere} :dt
Self-explanatory. :dd
{Pressure control can not be used with fix nvt/sllod} :dt
Self-explanatory. :dd
{Pressure control can not be used with fix nvt/sphere} :dt
Self-explanatory. :dd
-{Pressure control can not be used with fix nvt} :dt
+{Pressure control must be used with fix nph} :dt
Self-explanatory. :dd
{Pressure control must be used with fix nph/asphere} :dt
Self-explanatory. :dd
{Pressure control must be used with fix nph/sphere} :dt
Self-explanatory. :dd
-{Pressure control must be used with fix nph} :dt
+{Pressure control must be used with fix nphug} :dt
-Self-explanatory. :dd
+UNDOCUMENTED :dd
-{Pressure control must be used with fix npt/asphere} :dt
+{Pressure control must be used with fix npt} :dt
Self-explanatory. :dd
-{Pressure control must be used with fix npt/sphere} :dt
+{Pressure control must be used with fix npt/asphere} :dt
Self-explanatory. :dd
-{Pressure control must be used with fix npt} :dt
+{Pressure control must be used with fix npt/sphere} :dt
Self-explanatory. :dd
{Processor count in z must be 1 for 2d simulation} :dt
Self-explanatory. :dd
{Processor partitions are inconsistent} :dt
The total number of processors in all partitions must match the number
of processors LAMMPS is running on. :dd
{Processors command after simulation box is defined} :dt
The processors command cannot be used after a read_data, read_restart,
or create_box command. :dd
-{Quaternion creation numeric error} :dt
+{Processors custom grid file is inconsistent} :dt
+
+UNDOCUMENTED :dd
+
+{Processors custom grid file is invalid} :dt
+
+UNDOCUMENTED :dd
-A numeric error occurred in the creation of a rigid body by the fix
-rigid command. :dd
+{Processors grid numa and map style are incompatible} :dt
+
+UNDOCUMENTED :dd
+
+{Processors part option and grid style are incompatible} :dt
+
+UNDOCUMENTED :dd
+
+{Processors twogrid requires proc count be a multiple of core count} :dt
+
+UNDOCUMENTED :dd
{R0 < 0 for fix spring command} :dt
Equilibrium spring length is invalid. :dd
{Reax_defs.h setting for NATDEF is too small} :dt
Edit the setting in the ReaxFF library and re-compile the
library and re-build LAMMPS. :dd
{Reax_defs.h setting for NNEIGHMAXDEF is too small} :dt
Edit the setting in the ReaxFF library and re-compile the
library and re-build LAMMPS. :dd
-{Region ID for compute reduce/region does not exist} :dt
+{Receiving partition in processors part command is already a receiver} :dt
-Self-explanatory. :dd
+UNDOCUMENTED :dd
-{Region ID for compute temp/region does not exist} :dt
+{Region ID for compute reduce/region does not exist} :dt
Self-explanatory. :dd
-{Region ID for dump cfg does not exist} :dt
+{Region ID for compute temp/region does not exist} :dt
Self-explanatory. :dd
{Region ID for dump custom does not exist} :dt
Self-explanatory. :dd
{Region ID for fix addforce does not exist} :dt
Self-explanatory. :dd
{Region ID for fix ave/spatial does not exist} :dt
Self-explanatory. :dd
{Region ID for fix aveforce does not exist} :dt
Self-explanatory. :dd
{Region ID for fix deposit does not exist} :dt
Self-explanatory. :dd
{Region ID for fix evaporate does not exist} :dt
Self-explanatory. :dd
{Region ID for fix heat does not exist} :dt
Self-explanatory. :dd
{Region ID for fix setforce does not exist} :dt
Self-explanatory. :dd
{Region ID for fix wall/region does not exist} :dt
Self-explanatory. :dd
{Region ID in variable formula does not exist} :dt
Self-explanatory. :dd
{Region cannot have 0 length rotation vector} :dt
Self-explanatory. :dd
{Region intersect region ID does not exist} :dt
Self-explanatory. :dd
{Region union or intersect cannot be dynamic} :dt
The sub-regions can be dynamic, but not the combined region. :dd
{Region union region ID does not exist} :dt
One or more of the region IDs specified by the region union command
does not exist. :dd
{Replacing a fix, but new style != old style} :dt
A fix ID can be used a 2nd time, but only if the style matches the
previous fix. In this case it is assumed you with to reset a fix's
parameters. This error may mean you are mistakenly re-using a fix ID
when you do not intend to. :dd
{Replicate command before simulation box is defined} :dt
The replicate command cannot be used before a read_data, read_restart,
or create_box command. :dd
{Replicate did not assign all atoms correctly} :dt
Atoms replicated by the replicate command were not assigned correctly
to processors. This is likely due to some atom coordinates being
outside a non-periodic simulation box. :dd
{Replicated molecular system atom IDs are too big} :dt
See the setting for the allowed atom ID size in the src/lmptype.h
file. :dd
{Replicated system is too big} :dt
See the setting for bigint in the src/lmptype.h file. :dd
{Resetting timestep is not allowed with fix move} :dt
This is because fix move is moving atoms based on elapsed time. :dd
{Respa inner cutoffs are invalid} :dt
The first cutoff must be <= the second cutoff. :dd
{Respa levels must be >= 1} :dt
Self-explanatory. :dd
{Respa middle cutoffs are invalid} :dt
The first cutoff must be <= the second cutoff. :dd
+{Restrain atoms %d %d %d %d missing on proc %d at step %ld} :dt
+
+UNDOCUMENTED :dd
+
{Reuse of compute ID} :dt
A compute ID cannot be used twice. :dd
{Reuse of dump ID} :dt
A dump ID cannot be used twice. :dd
{Reuse of region ID} :dt
A region ID cannot be used twice. :dd
{Rigid body has degenerate moment of inertia} :dt
Fix poems will only work with bodies (collections of atoms) that have
non-zero principal moments of inertia. This means they must be 3 or
more non-collinear atoms, even with joint atoms removed. :dd
{Rigid fix must come before NPT/NPH fix} :dt
NPT/NPH fix must be defined in input script after all rigid fixes,
else the rigid fix contribution to the pressure virial is
incorrect. :dd
{Rmask function in equal-style variable formula} :dt
Rmask is per-atom operation. :dd
{Run command before simulation box is defined} :dt
The run command cannot be used before a read_data, read_restart, or
create_box command. :dd
{Run command start value is after start of run} :dt
Self-explanatory. :dd
{Run command stop value is before end of run} :dt
Self-explanatory. :dd
{Run_style command before simulation box is defined} :dt
The run_style command cannot be used before a read_data,
read_restart, or create_box command. :dd
{SRD bin size for fix srd differs from user request} :dt
Fix SRD had to adjust the bin size to fit the simulation box. :dd
{SRD bins for fix srd are not cubic enough} :dt
The bin shape is not within tolerance of cubic. :dd
+{SRD particle %d started inside big particle %d on step %ld bounce %d\n} :dt
+
+UNDOCUMENTED :dd
+
{Same dimension twice in fix ave/spatial} :dt
Self-explanatory. :dd
+{Sending partition in processors part command is already a sender} :dt
+
+UNDOCUMENTED :dd
+
{Set command before simulation box is defined} :dt
The set command cannot be used before a read_data, read_restart,
or create_box command. :dd
{Set command with no atoms existing} :dt
No atoms are yet defined so the set command cannot be used. :dd
{Set region ID does not exist} :dt
Region ID specified in set command does not exist. :dd
{Shake angles have different bond types} :dt
All 3-atom angle-constrained SHAKE clusters specified by the fix shake
command that are the same angle type, must also have the same bond
types for the 2 bonds in the angle. :dd
-{Shake atoms %d %d %d %d missing on proc %d at step} :dt
+{Shake atoms %d %d %d %d missing on proc %d at step %ld} :dt
The 4 atoms in a single shake cluster specified by the fix shake
command are not all accessible to a processor. This probably means
-an atom has moved too far. :dd
+an atom has moved too far. :dd :dd
-{Shake atoms %d %d %d missing on proc %d at step} :dt
+{Shake atoms %d %d %d missing on proc %d at step %ld} :dt
The 3 atoms in a single shake cluster specified by the fix shake
command are not all accessible to a processor. This probably means
-an atom has moved too far. :dd
+an atom has moved too far. :dd :dd
-{Shake atoms %d %d missing on proc %d at step} :dt
+{Shake atoms %d %d missing on proc %d at step %ld} :dt
The 2 atoms in a single shake cluster specified by the fix shake
command are not all accessible to a processor. This probably means
-an atom has moved too far. :dd
+an atom has moved too far. :dd :dd
{Shake cluster of more than 4 atoms} :dt
A single cluster specified by the fix shake command can have no more
than 4 atoms. :dd
{Shake clusters are connected} :dt
A single cluster specified by the fix shake command must have a single
central atom with up to 3 other atoms bonded to it. :dd
{Shake determinant = 0.0} :dt
The determinant of the matrix being solved for a single cluster
specified by the fix shake command is numerically invalid. :dd
{Shake fix must come before NPT/NPH fix} :dt
NPT fix must be defined in input script after SHAKE fix, else the
SHAKE fix contribution to the pressure virial is incorrect. :dd
-{Shape command before simulation box is defined} :dt
+{Small, tag, big integers are not sized correctly} :dt
-Self-explanatory. :dd
+UNDOCUMENTED :dd
{Smallint setting in lmptype.h is invalid} :dt
It has to be the size of an integer. :dd
{Smallint setting in lmptype.h is not compatible} :dt
Smallint stored in restart file is not consistent with LAMMPS version
you are running. :dd
{Sqrt of negative value in variable formula} :dt
Self-explanatory. :dd
{Substitution for illegal variable} :dt
Input script line contained a variable that could not be substituted
for. :dd
{System in data file is too big} :dt
See the setting for bigint in the src/lmptype.h file. :dd
{TAD nsteps must be multiple of t_event} :dt
Self-explanatory. :dd
{TIP4P hydrogen has incorrect atom type} :dt
The TIP4P pairwise computation found an H atom whose type does not
agree with the specified H type. :dd
{TIP4P hydrogen is missing} :dt
The TIP4P pairwise computation failed to find the correct H atom
within a water molecule. :dd
{TMD target file did not list all group atoms} :dt
The target file for the fix tmd command did not list all atoms in the
fix group. :dd
{Tad command before simulation box is defined} :dt
Self-explanatory. :dd
{Tagint setting in lmptype.h is invalid} :dt
Tagint must be as large or larger than smallint. :dd
{Tagint setting in lmptype.h is not compatible} :dt
Smallint stored in restart file is not consistent with LAMMPS version
you are running. :dd
{Target temperature for fix nvt/npt/nph cannot be 0.0} :dt
Self-explanatory. :dd
{Target temperature for fix rigid/nvt cannot be 0.0} :dt
Self-explanatory. :dd
{Temper command before simulation box is defined} :dt
The temper command cannot be used before a read_data, read_restart, or
create_box command. :dd
{Temperature ID for fix bond/swap does not exist} :dt
Self-explanatory. :dd
{Temperature ID for fix box/relax does not exist} :dt
Self-explanatory. :dd
{Temperature ID for fix nvt/nph/npt does not exist} :dt
Self-explanatory. :dd
{Temperature ID for fix press/berendsen does not exist} :dt
Self-explanatory. :dd
{Temperature ID for fix temp/berendsen does not exist} :dt
Self-explanatory. :dd
{Temperature ID for fix temp/rescale does not exist} :dt
Self-explanatory. :dd
+{Temperature control can not be used with fix nph} :dt
+
+Self-explanatory. :dd
+
{Temperature control can not be used with fix nph/asphere} :dt
Self-explanatory. :dd
{Temperature control can not be used with fix nph/sphere} :dt
Self-explanatory. :dd
-{Temperature control can not be used with fix nph} :dt
+{Temperature control must be used with fix nphug} :dt
+
+UNDOCUMENTED :dd
+
+{Temperature control must be used with fix npt} :dt
Self-explanatory. :dd
{Temperature control must be used with fix npt/asphere} :dt
Self-explanatory. :dd
{Temperature control must be used with fix npt/sphere} :dt
Self-explanatory. :dd
-{Temperature control must be used with fix npt} :dt
+{Temperature control must be used with fix nvt} :dt
Self-explanatory. :dd
{Temperature control must be used with fix nvt/asphere} :dt
Self-explanatory. :dd
{Temperature control must be used with fix nvt/sllod} :dt
Self-explanatory. :dd
{Temperature control must be used with fix nvt/sphere} :dt
Self-explanatory. :dd
-{Temperature control must be used with fix nvt} :dt
-
-Self-explanatory. :dd
-
{Temperature for fix nvt/sllod does not have a bias} :dt
The specified compute must compute temperature with a bias. :dd
{Tempering could not find thermo_pe compute} :dt
This compute is created by the thermo command. It must have been
explicitly deleted by a uncompute command. :dd
{Tempering fix ID is not defined} :dt
The fix ID specified by the temper command does not exist. :dd
{Tempering temperature fix is not valid} :dt
The fix specified by the temper command is not one that controls
temperature (nvt or langevin). :dd
{Thermo and fix not computed at compatible times} :dt
Fixes generate values on specific timesteps. The thermo output
does not match these timesteps. :dd
{Thermo compute array is accessed out-of-range} :dt
Self-explanatory. :dd
{Thermo compute does not compute array} :dt
Self-explanatory. :dd
{Thermo compute does not compute scalar} :dt
Self-explanatory. :dd
{Thermo compute does not compute vector} :dt
Self-explanatory. :dd
{Thermo compute vector is accessed out-of-range} :dt
Self-explanatory. :dd
{Thermo custom variable cannot be indexed} :dt
Self-explanatory. :dd
{Thermo custom variable is not equal-style variable} :dt
Only equal-style variables can be output with thermodynamics, not
atom-style variables. :dd
{Thermo every variable returned a bad timestep} :dt
The variable must return a timestep greater than the current timestep. :dd
{Thermo fix array is accessed out-of-range} :dt
Self-explanatory. :dd
{Thermo fix does not compute array} :dt
Self-explanatory. :dd
{Thermo fix does not compute scalar} :dt
Self-explanatory. :dd
{Thermo fix does not compute vector} :dt
Self-explanatory. :dd
{Thermo fix vector is accessed out-of-range} :dt
Self-explanatory. :dd
{Thermo keyword in variable requires lattice be defined} :dt
The xlat, ylat, zlat keywords refer to lattice properties. :dd
{Thermo keyword in variable requires thermo to use/init pe} :dt
You are using a thermo keyword in a variable that requires
potential energy to be calculated, but your thermo output
does not use it. Add it to your thermo output. :dd
{Thermo keyword in variable requires thermo to use/init press} :dt
You are using a thermo keyword in a variable that requires pressure to
be calculated, but your thermo output does not use it. Add it to your
thermo output. :dd
{Thermo keyword in variable requires thermo to use/init temp} :dt
You are using a thermo keyword in a variable that requires temperature
to be calculated, but your thermo output does not use it. Add it to
your thermo output. :dd
{Thermo keyword requires lattice be defined} :dt
The xlat, ylat, zlat keywords refer to lattice properties. :dd
{Thermo style does not use press} :dt
Cannot use thermo_modify to set this parameter since the thermo_style
is not computing this quantity. :dd
{Thermo style does not use temp} :dt
Cannot use thermo_modify to set this parameter since the thermo_style
is not computing this quantity. :dd
{Thermo_modify int format does not contain d character} :dt
Self-explanatory. :dd
{Thermo_modify pressure ID does not compute pressure} :dt
The specified compute ID does not compute pressure. :dd
{Thermo_modify temperature ID does not compute temperature} :dt
The specified compute ID does not compute temperature. :dd
{Thermo_style command before simulation box is defined} :dt
The thermo_style command cannot be used before a read_data,
read_restart, or create_box command. :dd
{This variable thermo keyword cannot be used between runs} :dt
Keywords that refer to time (such as cpu, elapsed) do not
make sense in between runs. :dd
{Threshhold for an atom property that isn't allocated} :dt
A dump threshhold has been requested on a quantity that is
not defined by the atom style used in this simulation. :dd
{Timestep must be >= 0} :dt
Specified timestep size is invalid. :dd
{Too big a problem to use velocity create loop all} :dt
The system size must fit in a 32-bit integer to use this option. :dd
+{Too big a timestep} :dt
+
+UNDOCUMENTED :dd
+
{Too big a timestep for dump dcd} :dt
The timestep must fit in a 32-bit integer to use this dump style. :dd
{Too big a timestep for dump xtc} :dt
The timestep must fit in a 32-bit integer to use this dump style. :dd
{Too few bits for lookup table} :dt
Table size specified via pair_modify command does not work with your
machine's floating point representation. :dd
{Too many atom sorting bins} :dt
This is likely due to an immense simulation box that has blown up
to a large size. :dd
{Too many atoms for dump dcd} :dt
The system size must fit in a 32-bit integer to use this dump
style. :dd
{Too many atoms for dump xtc} :dt
The system size must fit in a 32-bit integer to use this dump
style. :dd
{Too many atoms to dump sort} :dt
Cannot sort when running with more than 2^31 atoms. :dd
{Too many exponent bits for lookup table} :dt
Table size specified via pair_modify command does not work with your
machine's floating point representation. :dd
{Too many groups} :dt
The maximum number of atom groups (including the "all" group) is
given by MAX_GROUP in group.cpp and is 32. :dd
{Too many iterations} :dt
You must use a number of iterations that fit in a 32-bit integer
for minimization. :dd
+{Too many local+ghost atoms for neighbor list} :dt
+
+UNDOCUMENTED :dd
+
{Too many mantissa bits for lookup table} :dt
Table size specified via pair_modify command does not work with your
machine's floating point representation. :dd
{Too many masses for fix shake} :dt
The fix shake command cannot list more masses than there are atom
types. :dd
{Too many neighbor bins} :dt
This is likely due to an immense simulation box that has blown up
to a large size. :dd
+{Too many timesteps} :dt
+
+UNDOCUMENTED :dd
+
{Too many timesteps for NEB} :dt
You must use a number of timesteps that fit in a 32-bit integer
for NEB. :dd
{Too many total atoms} :dt
See the setting for bigint in the src/lmptype.h file. :dd
{Too many total bits for bitmapped lookup table} :dt
Table size specified via pair_modify command is too large. Note that
a value of N generates a 2^N size table. :dd
{Too many touching neighbors - boost MAXTOUCH} :dt
A granular simulation has too many neighbors touching one atom. The
MAXTOUCH parameter in fix_shear_history.cpp must be set larger and
LAMMPS must be re-built. :dd
{Too much per-proc info for dump} :dt
Number of local atoms times number of columns must fit in a 32-bit
integer for dump. :dd
{Tree structure in joint connections} :dt
Fix poems cannot (yet) work with coupled bodies whose joints connect
the bodies in a tree structure. :dd
{Triclinic box must be periodic in skewed dimensions} :dt
This is a requirement for using a non-orthogonal box. E.g. to set a
non-zero xy tilt, both x and y must be periodic dimensions. :dd
{Triclinic box skew is too large} :dt
The displacement in a skewed direction must be less than half the box
length in that dimension. E.g. the xy tilt must be between -half and
+half of the x box length. :dd
{Tried to convert a double to int, but input_double > INT_MAX} :dt
Self-explanatory. :dd
{Two groups cannot be the same in fix spring couple} :dt
Self-explanatory. :dd
-{Unable to initialize accelerator for use} :dt
+{USER-CUDA mode requires CUDA variant of min style} :dt
+
+UNDOCUMENTED :dd
-One or more specified accelerator(s) cannot currently be used by LAMMPS.
-This can happen if the accelerator is already in use by another
-process. :dd
+{USER-CUDA mode requires CUDA variant of run style} :dt
+
+UNDOCUMENTED :dd
{Unbalanced quotes in input line} :dt
No matching end double quote was found following a leading double
quote. :dd
+{Unexpected end of -reorder file} :dt
+
+UNDOCUMENTED :dd
+
+{Unexpected end of custom file} :dt
+
+UNDOCUMENTED :dd
+
{Unexpected end of data file} :dt
LAMMPS hit the end of the data file while attempting to read a
section. Something is wrong with the format of the data file. :dd
+{Unexpected end of reorder file} :dt
+
+UNDOCUMENTED :dd
+
{Units command after simulation box is defined} :dt
The units command cannot be used after a read_data, read_restart, or
create_box command. :dd
{Universe/uloop variable count < # of partitions} :dt
A universe or uloop style variable must specify a number of values >= to the
number of processor partitions. :dd
{Unknown command: %s} :dt
The command is not known to LAMMPS. Check the input script. :dd
{Unknown identifier in data file: %s} :dt
A section of the data file cannot be read by LAMMPS. :dd
{Unknown table style in angle style table} :dt
Self-explanatory. :dd
{Unknown table style in bond style table} :dt
Self-explanatory. :dd
{Unknown table style in pair_style command} :dt
Style of table is invalid for use with pair_style table command. :dd
{Unrecognized lattice type in MEAM file 1} :dt
The lattice type in an entry of the MEAM library file is not
valid. :dd
{Unrecognized lattice type in MEAM file 2} :dt
The lattice type in an entry of the MEAM parameter file is not
valid. :dd
{Unrecognized pair style in compute pair command} :dt
Self-explanatory. :dd
{Use of compute temp/ramp with undefined lattice} :dt
Must use lattice command with compute temp/ramp command if units
option is set to lattice. :dd
{Use of displace_atoms with undefined lattice} :dt
Must use lattice command with displace_atoms command if units option
is set to lattice. :dd
{Use of displace_box with undefined lattice} :dt
Must use lattice command with displace_box command if units option is
set to lattice. :dd
+{Use of fix append_atoms with undefined lattice} :dt
+
+UNDOCUMENTED :dd
+
{Use of fix ave/spatial with undefined lattice} :dt
A lattice must be defined to use fix ave/spatial with units = lattice. :dd
{Use of fix deform with undefined lattice} :dt
A lattice must be defined to use fix deform with units = lattice. :dd
{Use of fix deposit with undefined lattice} :dt
Must use lattice command with compute fix deposit command if units
option is set to lattice. :dd
{Use of fix dt/reset with undefined lattice} :dt
Must use lattice command with fix dt/reset command if units option is
set to lattice. :dd
{Use of fix indent with undefined lattice} :dt
The lattice command must be used to define a lattice before using the
fix indent command. :dd
{Use of fix move with undefined lattice} :dt
Must use lattice command with fix move command if units option is
set to lattice. :dd
{Use of fix recenter with undefined lattice} :dt
Must use lattice command with fix recenter command if units option is
set to lattice. :dd
{Use of fix wall with undefined lattice} :dt
Must use lattice command with fix wall command if units option is set
to lattice. :dd
+{Use of fix wall/piston with undefined lattice} :dt
+
+UNDOCUMENTED :dd
+
{Use of region with undefined lattice} :dt
If scale = lattice (the default) for the region command, then a
lattice must first be defined via the lattice command. :dd
{Use of velocity with undefined lattice} :dt
If scale = lattice (the default) for the velocity set or velocity ramp
command, then a lattice must first be defined via the lattice command. :dd
{Using fix nvt/sllod with inconsistent fix deform remap option} :dt
Fix nvt/sllod requires that deforming atoms have a velocity profile
provided by "remap v" as a fix deform option. :dd
{Using fix nvt/sllod with no fix deform defined} :dt
Self-explanatory. :dd
{Using fix srd with inconsistent fix deform remap option} :dt
When shearing the box in an SRD simulation, the remap v option for fix
deform needs to be used. :dd
+{Using pair lubricate with inconsistent fix deform remap option} :dt
+
+UNDOCUMENTED :dd
+
+{Using pair lubricate/poly with inconsistent fix deform remap option} :dt
+
+UNDOCUMENTED :dd
+
{Variable evaluation before simulation box is defined} :dt
Cannot evaluate a compute or fix or atom-based value in a variable
before the simulation has been setup. :dd
{Variable for compute ti is invalid style} :dt
Self-explanatory. :dd
{Variable for dump every is invalid style} :dt
Only equal-style variables can be used. :dd
+{Variable for dump image center is invalid style} :dt
+
+UNDOCUMENTED :dd
+
+{Variable for dump image persp is invalid style} :dt
+
+UNDOCUMENTED :dd
+
+{Variable for dump image phi is invalid style} :dt
+
+UNDOCUMENTED :dd
+
+{Variable for dump image theta is invalid style} :dt
+
+UNDOCUMENTED :dd
+
+{Variable for dump image zoom is invalid style} :dt
+
+UNDOCUMENTED :dd
+
{Variable for fix adapt is invalid style} :dt
Only equal-style variables can be used. :dd
{Variable for fix addforce is invalid style} :dt
Self-explanatory. :dd
{Variable for fix aveforce is invalid style} :dt
Only equal-style variables can be used. :dd
{Variable for fix efield is invalid style} :dt
Only equal-style variables can be used. :dd
{Variable for fix indent is invalid style} :dt
Only equal-style variables can be used. :dd
{Variable for fix indent is not equal style} :dt
Only equal-style variables can be used. :dd
+{Variable for fix langevin is invalid style} :dt
+
+UNDOCUMENTED :dd
+
{Variable for fix move is invalid style} :dt
Only equal-style variables can be used. :dd
{Variable for fix setforce is invalid style} :dt
Only equal-style variables can be used. :dd
{Variable for fix wall is invalid style} :dt
Only equal-style variables can be used. :dd
{Variable for fix wall/reflect is invalid style} :dt
Only equal-style variables can be used. :dd
{Variable for fix wall/srd is invalid style} :dt
Only equal-style variables can be used. :dd
{Variable for region is invalid style} :dt
Only equal-style variables can be used. :dd
{Variable for region is not equal style} :dt
Self-explanatory. :dd
{Variable for thermo every is invalid style} :dt
Only equal-style variables can be used. :dd
{Variable for velocity set is invalid style} :dt
Only atom-style variables can be used. :dd
{Variable formula compute array is accessed out-of-range} :dt
Self-explanatory. :dd
{Variable formula compute vector is accessed out-of-range} :dt
Self-explanatory. :dd
{Variable formula fix array is accessed out-of-range} :dt
Self-explanatory. :dd
{Variable formula fix vector is accessed out-of-range} :dt
Self-explanatory. :dd
{Variable name for compute atom/molecule does not exist} :dt
Self-explanatory. :dd
{Variable name for compute reduce does not exist} :dt
Self-explanatory. :dd
{Variable name for compute ti does not exist} :dt
Self-explanatory. :dd
{Variable name for dump every does not exist} :dt
Self-explanatory. :dd
+{Variable name for dump image center does not exist} :dt
+
+UNDOCUMENTED :dd
+
+{Variable name for dump image persp does not exist} :dt
+
+UNDOCUMENTED :dd
+
+{Variable name for dump image phi does not exist} :dt
+
+UNDOCUMENTED :dd
+
+{Variable name for dump image theta does not exist} :dt
+
+UNDOCUMENTED :dd
+
+{Variable name for dump image zoom does not exist} :dt
+
+UNDOCUMENTED :dd
+
{Variable name for fix adapt does not exist} :dt
Self-explanatory. :dd
{Variable name for fix addforce does not exist} :dt
Self-explanatory. :dd
{Variable name for fix ave/atom does not exist} :dt
Self-explanatory. :dd
{Variable name for fix ave/correlate does not exist} :dt
Self-explanatory. :dd
{Variable name for fix ave/histo does not exist} :dt
Self-explanatory. :dd
{Variable name for fix ave/spatial does not exist} :dt
Self-explanatory. :dd
{Variable name for fix ave/time does not exist} :dt
Self-explanatory. :dd
{Variable name for fix aveforce does not exist} :dt
Self-explanatory. :dd
{Variable name for fix efield does not exist} :dt
Self-explanatory. :dd
{Variable name for fix indent does not exist} :dt
Self-explanatory. :dd
+{Variable name for fix langevin does not exist} :dt
+
+UNDOCUMENTED :dd
+
{Variable name for fix move does not exist} :dt
Self-explanatory. :dd
{Variable name for fix setforce does not exist} :dt
Self-explanatory. :dd
{Variable name for fix store/state does not exist} :dt
Self-explanatory. :dd
{Variable name for fix wall does not exist} :dt
Self-explanatory. :dd
{Variable name for fix wall/reflect does not exist} :dt
Self-explanatory. :dd
{Variable name for fix wall/srd does not exist} :dt
Self-explanatory. :dd
{Variable name for region does not exist} :dt
Self-explanatory. :dd
{Variable name for thermo every does not exist} :dt
Self-explanatory. :dd
{Variable name for velocity set does not exist} :dt
Self-explanatory. :dd
{Variable name must be alphanumeric or underscore characters} :dt
Self-explanatory. :dd
{Velocity command before simulation box is defined} :dt
The velocity command cannot be used before a read_data, read_restart,
or create_box command. :dd
{Velocity command with no atoms existing} :dt
A velocity command has been used, but no atoms yet exist. :dd
{Velocity ramp in z for a 2d problem} :dt
Self-explanatory. :dd
{Velocity temperature ID does not compute temperature} :dt
The compute ID given to the velocity command must compute
temperature. :dd
+{Verlet/split requires 2 partitions} :dt
+
+UNDOCUMENTED :dd
+
+{Verlet/split requires Rspace partition layout be multiple of Kspace partition layout in each dim} :dt
+
+UNDOCUMENTED :dd
+
+{Verlet/split requires Rspace partition size be multiple of Kspace partition size} :dt
+
+UNDOCUMENTED :dd
+
{Virial was not tallied on needed timestep} :dt
You are using a thermo keyword that requires potentials to
have tallied the virial, but they didn't on this timestep. See the
variable doc page for ideas on how to make this work. :dd
{Wall defined twice in fix wall command} :dt
Self-explanatory. :dd
{Wall defined twice in fix wall/reflect command} :dt
Self-explanatory. :dd
{Wall defined twice in fix wall/srd command} :dt
Self-explanatory. :dd
-{Weighted neighbor list values are too big} :dt
-
-You must have less atoms per processor to use this
-style neighbor list. :dd
-
{World variable count doesn't match # of partitions} :dt
A world-style variable must specify a number of values equal to the
number of processor partitions. :dd
{Write_restart command before simulation box is defined} :dt
The write_restart command cannot be used before a read_data,
read_restart, or create_box command. :dd
{Zero-length lattice orient vector} :dt
Self-explanatory. :dd
:dle
Warnings: :h4,link(warn)
:dlb
-{All element names have been set to 'C' for dump cfg} :dt
-
-Use the dump_modify command if you wish to override this. :dd
-
{Atom with molecule ID = 0 included in compute molecule group} :dt
The group used in a compute command that operates on moleclues
includes atoms with no molecule ID. This is probably not what you
want. :dd
{Broken bonds will not alter angles, dihedrals, or impropers} :dt
See the doc page for fix bond/break for more info on this
restriction. :dd
{Building an occasional neighobr list when atoms may have moved too far} :dt
This can cause LAMMPS to crash when the neighbor list is built.
The solution is to check for building the regular neighbor lists
more frequently. :dd
{Compute cna/atom cutoff may be too large to find ghost atom neighbors} :dt
The neighbor cutoff used may not encompass enough ghost atoms
to perform this operation correctly. :dd
{Computing temperature of portions of rigid bodies} :dt
The group defined by the temperature compute does not encompass all
the atoms in one or more rigid bodies, so the change in
degrees-of-freedom for the atoms in those partial rigid bodies will
not be accounted for. :dd
{Created bonds will not create angles, dihedrals, or impropers} :dt
See the doc page for fix bond/create for more info on this
restriction. :dd
-{Dihedral problem: %d %d %d %d %d %d} :dt
+{Dihedral problem: %d %ld %d %d %d %d} :dt
Conformation of the 4 listed dihedral atoms is extreme; you may want
-to check your simulation geometry. :dd
+to check your simulation geometry. :dd :dd
{Dump dcd/xtc timestamp may be wrong with fix dt/reset} :dt
If the fix changes the timestep, the dump dcd file will not
reflect the change. :dd
-{FENE bond too long: %d %d %d %g} :dt
+{FENE bond too long: %ld %d %d %g} :dt
A FENE bond has stretched dangerously far. It's interaction strength
-will be truncated to attempt to prevent the bond from blowing up. :dd
+will be truncated to attempt to prevent the bond from blowing up. :dd :dd
-{FENE bond too long: %d %g} :dt
+{FENE bond too long: %ld %g} :dt
A FENE bond has stretched dangerously far. It's interaction strength
-will be truncated to attempt to prevent the bond from blowing up. :dd
+will be truncated to attempt to prevent the bond from blowing up. :dd :dd
+
+{Fix GCMC may delete atom with non-zero molecule ID} :dt
+
+UNDOCUMENTED :dd
{Fix SRD walls overlap but fix srd overlap not set} :dt
You likely want to set this in your input script. :dd
{Fix bond/swap will ignore defined angles} :dt
See the doc page for fix bond/swap for more info on this
restriction. :dd
+{Fix evaporate may delete atom with non-zero molecule ID} :dt
+
+UNDOCUMENTED :dd
+
{Fix move does not update angular momentum} :dt
Atoms store this quantity, but fix move does not (yet) update it. :dd
{Fix move does not update quaternions} :dt
Atoms store this quantity, but fix move does not (yet) update it. :dd
{Fix recenter should come after all other integration fixes} :dt
Other fixes may change the position of the center-of-mass, so
fix recenter should come last. :dd
{Fix srd SRD moves may trigger frequent reneighboring} :dt
This is because the SRD particles may move long distances. :dd
{Fix srd grid size > 1/4 of big particle diameter} :dt
This may cause accuracy problems. :dd
-{Fix srd no-slip wall collisions with bin shifting} :dt
-
-This is an inconsistent setting in your input script. :dd
-
{Fix srd particle moved outside valid domain} :dt
This may indicate a problem with your simulation parameters. :dd
{Fix srd particles may move > big particle diameter} :dt
This may cause accuracy problems. :dd
{Fix srd viscosity < 0.0 due to low SRD density} :dt
This may cause accuracy problems. :dd
{Fix thermal/conductivity comes before fix ave/spatial} :dt
The order of these 2 fixes in your input script is such that fix
thermal/conductivity comes first. If you are using fix ave/spatial to
measure the temperature profile induced by fix viscosity, then this
may cause a glitch in the profile since you are averaging immediately
after swaps have occurred. Flipping the order of the 2 fixes
typically helps. :dd
{Fix viscosity comes before fix ave/spatial} :dt
The order of these 2 fixes in your input script is such that
fix viscosity comes first. If you are using fix ave/spatial
to measure the velocity profile induced by fix viscosity, then
this may cause a glitch in the profile since you are averaging
immediately after swaps have occurred. Flipping the order
of the 2 fixes typically helps. :dd
{Group for fix_modify temp != fix group} :dt
The fix_modify command is specifying a temperature computation that
computes a temperature on a different group of atoms than the fix
itself operates on. This is probably not what you want to do. :dd
-{Improper problem: %d %d %d %d %d %d} :dt
+{Improper problem: %d %ld %d %d %d %d} :dt
Conformation of the 4 listed improper atoms is extreme; you may want
-to check your simulation geometry. :dd
+to check your simulation geometry. :dd :dd
{Kspace_modify slab param < 2.0 may cause unphysical behavior} :dt
The kspace_modify slab parameter should be larger to insure periodic
grids padded with empty space do not overlap. :dd
{Less insertions than requested} :dt
Less atom insertions occurred on this timestep due to the fix pour
command than were scheduled. This is probably because there were too
many overlaps detected. :dd
-{Lost atoms: original %.15g current %.15g} :dt
-
-A thermodynamic computation has detected lost atoms. :dd
-
{Mismatch between velocity and compute groups} :dt
The temperature computation used by the velocity command will not be
on the same group of atoms that velocities are being set for. :dd
{More than one compute centro/atom} :dt
It is not efficient to use compute centro/atom more than once. :dd
{More than one compute cluster/atom} :dt
It is not efficient to use compute cluster/atom more than once. :dd
{More than one compute cna/atom defined} :dt
It is not efficient to use compute cna/atom more than once. :dd
{More than one compute coord/atom} :dt
It is not efficient to use compute coord/atom more than once. :dd
{More than one compute damage/atom} :dt
It is not efficient to use compute ke/atom more than once. :dd
{More than one compute ke/atom} :dt
It is not efficient to use compute ke/atom more than once. :dd
{More than one fix poems} :dt
It is not efficient to use fix poems more than once. :dd
{More than one fix rigid} :dt
It is not efficient to use fix rigid more than once. :dd
{New thermo_style command, previous thermo_modify settings will be lost} :dt
If a thermo_style command is used after a thermo_modify command, the
settings changed by the thermo_modify command will be reset to their
default values. This is because the thermo_modify commmand acts on
the currently defined thermo style, and a thermo_style command creates
a new style. :dd
+{No Kspace calculation with verlet/split} :dt
+
+UNDOCUMENTED :dd
+
{No fixes defined, atoms won't move} :dt
If you are not using a fix like nve, nvt, npt then atom velocities and
coordinates will not be updated during timestepping. :dd
{No joints between rigid bodies, use fix rigid instead} :dt
The bodies defined by fix poems are not connected by joints. POEMS
will integrate the body motion, but it would be more efficient to use
fix rigid. :dd
{Not using real units with pair reax} :dt
This is most likely an error, unless you have created your own ReaxFF
parameter file in a different set of units. :dd
{One or more atoms are time integrated more than once} :dt
This is probably an error since you typically do not want to
advance the positions or velocities of an atom more than once
per timestep. :dd
{One or more compute molecules has atoms not in group} :dt
The group used in a compute command that operates on moleclues does
not include all the atoms in some molecules. This is probably not
what you want. :dd
{One or more respa levels compute no forces} :dt
This is computationally inefficient. :dd
{Pair COMB charge %.10f with force %.10f hit max barrier} :dt
Something is possibly wrong with your model. :dd
{Pair COMB charge %.10f with force %.10f hit min barrier} :dt
Something is possibly wrong with your model. :dd
+{Pair brownian needs newton pair on for momentum conservation} :dt
+
+UNDOCUMENTED :dd
+
+{Pair dpd needs newton pair on for momentum conservation} :dt
+
+UNDOCUMENTED :dd
+
{Pair dsmc: num_of_collisions > number_of_A} :dt
Collision model in DSMC is breaking down. :dd
{Pair dsmc: num_of_collisions > number_of_B} :dt
Collision model in DSMC is breaking down. :dd
{Particle deposition was unsuccessful} :dt
The fix deposit command was not able to insert as many atoms as
needed. The requested volume fraction may be too high, or other atoms
may be in the insertion region. :dd
{Reducing PPPM order b/c stencil extends beyond neighbor processor} :dt
LAMMPS is attempting this in order to allow the simulation
to run. It should not effect the PPPM accuracy. :dd
{Replacing a fix, but new group != old group} :dt
The ID and style of a fix match for a fix you are changing with a fix
command, but the new group you are specifying does not match the old
group. :dd
{Replicating in a non-periodic dimension} :dt
The parameters for a replicate command will cause a non-periodic
dimension to be replicated; this may cause unwanted behavior. :dd
{Resetting reneighboring criteria during PRD} :dt
A PRD simulation requires that neigh_modify settings be delay = 0,
every = 1, check = yes. Since these settings were not in place,
LAMMPS changed them and will restore them to their original values
after the PRD simulation. :dd
{Resetting reneighboring criteria during TAD} :dt
A TAD simulation requires that neigh_modify settings be delay = 0,
every = 1, check = yes. Since these settings were not in place,
LAMMPS changed them and will restore them to their original values
after the PRD simulation. :dd
{Resetting reneighboring criteria during minimization} :dt
Minimization requires that neigh_modify settings be delay = 0, every =
1, check = yes. Since these settings were not in place, LAMMPS
changed them and will restore them to their original values after the
minimization. :dd
{Restart file used different # of processors} :dt
The restart file was written out by a LAMMPS simulation running on a
different number of processors. Due to round-off, the trajectories of
your restarted simulation may diverge a little more quickly than if
you ran on the same # of processors. :dd
{Restart file used different 3d processor grid} :dt
The restart file was written out by a LAMMPS simulation running on a
different 3d grid of processors. Due to round-off, the trajectories
of your restarted simulation may diverge a little more quickly than if
you ran on the same # of processors. :dd
{Restart file used different boundary settings, using restart file values} :dt
Your input script cannot change these restart file settings. :dd
{Restart file used different newton bond setting, using restart file value} :dt
The restart file value will override the setting in the input script. :dd
{Restart file used different newton pair setting, using input script value} :dt
The input script value will override the setting in the restart file. :dd
{Restart file version does not match LAMMPS version} :dt
This may cause problems when reading the restart file. :dd
+{Restrain problem: %d %ld %d %d %d %d} :dt
+
+UNDOCUMENTED :dd
+
{Running PRD with only one replica} :dt
This is allowed, but you will get no parallel speed-up. :dd
{SRD bin shifting turned on due to small lamda} :dt
This is done to try to preserve accuracy. :dd
-{SRD bin size for fix srd differs from user request} :dt
-
-Check if the new bin size is acceptable. :dd
-
-{SRD bins for fix srd are not cubic enough} :dt
-
-Check if the bin shape is acceptable. :dd
-
-{SRD particle %d started inside big particle %d on step %d bounce %d} :dt
-
-This may not be a problem, but indicates one or more SRD particles are
-being left inside solute particles. :dd
-
{Shake determinant < 0.0} :dt
The determinant of the quadratic equation being solved for a single
cluster specified by the fix shake command is numerically suspect. LAMMPS
will set it to 0.0 and continue. :dd
{Should not allow rigid bodies to bounce off relecting walls} :dt
LAMMPS allows this, but their dynamics are not computed correctly. :dd
{System is not charge neutral, net charge = %g} :dt
The total charge on all atoms on the system is not 0.0, which
is not valid for Ewald or PPPM. :dd
{Table inner cutoff >= outer cutoff} :dt
You specified an inner cutoff for a Coulombic table that is longer
than the global cutoff. Probably not what you wanted. :dd
{Temperature for MSST is not for group all} :dt
User-assigned temperature to MSST fix does not compute temperature for
all atoms. Since MSST computes a global pressure, the kinetic energy
contribution from the temperature is assumed to also be for all atoms.
Thus the pressure used by MSST could be inaccurate. :dd
{Temperature for NPT is not for group all} :dt
User-assigned temperature to NPT fix does not compute temperature for
all atoms. Since NPT computes a global pressure, the kinetic energy
contribution from the temperature is assumed to also be for all atoms.
Thus the pressure used by NPT could be inaccurate. :dd
{Temperature for fix modify is not for group all} :dt
The temperature compute is being used with a pressure calculation
which does operate on group all, so this may be inconsistent. :dd
{Temperature for thermo pressure is not for group all} :dt
User-assigned temperature to thermo via the thermo_modify command does
not compute temperature for all atoms. Since thermo computes a global
pressure, the kinetic energy contribution from the temperature is
assumed to also be for all atoms. Thus the pressure printed by thermo
could be inaccurate. :dd
{Too many common neighbors in CNA %d times} :dt
More than the maximum # of neighbors was found multiple times. This
was unexpected. :dd
{Too many inner timesteps in fix ttm} :dt
Self-explanatory. :dd
{Too many neighbors in CNA for %d atoms} :dt
More than the maximum # of neighbors was found multiple times. This
was unexpected. :dd
-{Use special bonds = 0,1,1 with bond style fene/expand} :dt
+{Use special bonds = 0,1,1 with bond style fene} :dt
Most FENE models need this setting for the special_bonds command. :dd
-{Use special bonds = 0,1,1 with bond style fene} :dt
+{Use special bonds = 0,1,1 with bond style fene/expand} :dt
Most FENE models need this setting for the special_bonds command. :dd
{Using compute temp/deform with inconsistent fix deform remap option} :dt
Fix nvt/sllod assumes deforming atoms have a velocity profile provided
by "remap v" or "remap none" as a fix deform option. :dd
{Using compute temp/deform with no fix deform defined} :dt
This is probably an error, since it makes little sense to use
compute temp/deform in this case. :dd
+{Using fix srd with box deformation but no SRD thermostat} :dt
+
+UNDOCUMENTED :dd
+
{Using pair tail corrections with nonperiodic system} :dt
This is probably a bogus thing to do, since tail corrections are
computed by integrating the density of a periodic system out to
infinity. :dd
:dle
+
diff --git a/doc/Section_howto.html b/doc/Section_howto.html
index ada3d46ad..bad450038 100644
--- a/doc/Section_howto.html
+++ b/doc/Section_howto.html
@@ -1,1963 +1,1963 @@
<HTML>
<CENTER><A HREF = "Section_accelerate.html">Previous Section</A> - <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A> - <A HREF = "Section_example.html">Next Section</A>
</CENTER>
<HR>
<H3>6. How-to discussions
</H3>
<P>This section describes how to perform common tasks using LAMMPS.
</P>
6.1 <A HREF = "#howto_1">Restarting a simulation</A><BR>
6.2 <A HREF = "#howto_2">2d simulations</A><BR>
6.3 <A HREF = "#howto_3">CHARMM, AMBER, and DREIDING force fields</A><BR>
6.4 <A HREF = "#howto_4">Running multiple simulations from one input script</A><BR>
6.5 <A HREF = "#howto_5">Multi-replica simulations</A><BR>
6.6 <A HREF = "#howto_6">Granular models</A><BR>
6.7 <A HREF = "#howto_7">TIP3P water model</A><BR>
6.8 <A HREF = "#howto_8">TIP4P water model</A><BR>
6.9 <A HREF = "#howto_9">SPC water model</A><BR>
6.10 <A HREF = "#howto_10">Coupling LAMMPS to other codes</A><BR>
6.11 <A HREF = "#howto_11">Visualizing LAMMPS snapshots</A><BR>
6.12 <A HREF = "#howto_12">Triclinic (non-orthogonal) simulation boxes</A><BR>
6.13 <A HREF = "#howto_13">NEMD simulations</A><BR>
6.14 <A HREF = "#howto_14">Extended spherical and aspherical particles</A><BR>
6.15 <A HREF = "#howto_15">Output from LAMMPS (thermo, dumps, computes, fixes, variables)</A><BR>
6.16 <A HREF = "#howto_16">Thermostatting, barostatting and computing temperature</A><BR>
6.17 <A HREF = "#howto_17">Walls</A><BR>
6.18 <A HREF = "#howto_18">Elastic constants</A><BR>
6.19 <A HREF = "#howto_19">Library interface to LAMMPS</A><BR>
6.20 <A HREF = "#howto_20">Calculating thermal conductivity</A><BR>
6.21 <A HREF = "#howto_21">Calculating viscosity</A> <BR>
<P>The example input scripts included in the LAMMPS distribution and
-highlighted in <A HREF = "Section_example.html">this section</A> also show how to
+highlighted in <A HREF = "Section_example.html">Section_example</A> also show how to
setup and run various kinds of simulations.
</P>
<HR>
<HR>
<A NAME = "howto_1"></A><H4>6.1 Restarting a simulation
</H4>
<P>There are 3 ways to continue a long LAMMPS simulation. Multiple
<A HREF = "run.html">run</A> commands can be used in the same input script. Each
run will continue from where the previous run left off. Or binary
restart files can be saved to disk using the <A HREF = "restart.html">restart</A>
command. At a later time, these binary files can be read via a
<A HREF = "read_restart.html">read_restart</A> command in a new script. Or they can
be converted to text data files and read by a
<A HREF = "read_data.html">read_data</A> command in a new script. <A HREF = "Section_tools.html">This
section</A> discusses the <I>restart2data</I> tool that is
used to perform the conversion.
</P>
<P>Here we give examples of 2 scripts that read either a binary restart
file or a converted data file and then issue a new run command to
continue where the previous run left off. They illustrate what
settings must be made in the new script. Details are discussed in the
documentation for the <A HREF = "read_restart.html">read_restart</A> and
<A HREF = "read_data.html">read_data</A> commands.
</P>
<P>Look at the <I>in.chain</I> input script provided in the <I>bench</I> directory
of the LAMMPS distribution to see the original script that these 2
scripts are based on. If that script had the line
</P>
<PRE>restart 50 tmp.restart
</PRE>
<P>added to it, it would produce 2 binary restart files (tmp.restart.50
and tmp.restart.100) as it ran.
</P>
<P>This script could be used to read the 1st restart file and re-run the
last 50 timesteps:
</P>
<PRE>read_restart tmp.restart.50
</PRE>
<PRE>neighbor 0.4 bin
neigh_modify every 1 delay 1
</PRE>
<PRE>fix 1 all nve
fix 2 all langevin 1.0 1.0 10.0 904297
</PRE>
<PRE>timestep 0.012
</PRE>
<PRE>run 50
</PRE>
<P>Note that the following commands do not need to be repeated because
their settings are included in the restart file: <I>units, atom_style,
special_bonds, pair_style, bond_style</I>. However these commands do
need to be used, since their settings are not in the restart file:
<I>neighbor, fix, timestep</I>.
</P>
<P>If you actually use this script to perform a restarted run, you will
notice that the thermodynamic data match at step 50 (if you also put a
"thermo 50" command in the original script), but do not match at step
100. This is because the <A HREF = "fix_langevin.html">fix langevin</A> command
uses random numbers in a way that does not allow for perfect restarts.
</P>
<P>As an alternate approach, the restart file could be converted to a data
file using this tool:
</P>
<PRE>restart2data tmp.restart.50 tmp.restart.data
</PRE>
<P>Then, this script could be used to re-run the last 50 steps:
</P>
<PRE>units lj
atom_style bond
pair_style lj/cut 1.12
pair_modify shift yes
bond_style fene
special_bonds 0.0 1.0 1.0
</PRE>
<PRE>read_data tmp.restart.data
</PRE>
<PRE>neighbor 0.4 bin
neigh_modify every 1 delay 1
</PRE>
<PRE>fix 1 all nve
fix 2 all langevin 1.0 1.0 10.0 904297
</PRE>
<PRE>timestep 0.012
</PRE>
<PRE>reset_timestep 50
run 50
</PRE>
<P>Note that nearly all the settings specified in the original <I>in.chain</I>
script must be repeated, except the <I>pair_coeff</I> and <I>bond_coeff</I>
commands since the new data file lists the force field coefficients.
Also, the <A HREF = "reset_timestep.html">reset_timestep</A> command is used to tell
LAMMPS the current timestep. This value is stored in restart files,
but not in data files.
</P>
<HR>
<A NAME = "howto_2"></A><H4>6.2 2d simulations
</H4>
<P>Use the <A HREF = "dimension.html">dimension</A> command to specify a 2d simulation.
</P>
<P>Make the simulation box periodic in z via the <A HREF = "boundary.html">boundary</A>
command. This is the default.
</P>
<P>If using the <A HREF = "create_box.html">create box</A> command to define a
simulation box, set the z dimensions narrow, but finite, so that the
create_atoms command will tile the 3d simulation box with a single z
plane of atoms - e.g.
</P>
<PRE><A HREF = "create_box.html">create box</A> 1 -10 10 -10 10 -0.25 0.25
</PRE>
<P>If using the <A HREF = "read_data.html">read data</A> command to read in a file of
atom coordinates, set the "zlo zhi" values to be finite but narrow,
similar to the create_box command settings just described. For each
atom in the file, assign a z coordinate so it falls inside the
z-boundaries of the box - e.g. 0.0.
</P>
<P>Use the <A HREF = "fix_enforce2d.html">fix enforce2d</A> command as the last
defined fix to insure that the z-components of velocities and forces
are zeroed out every timestep. The reason to make it the last fix is
so that any forces induced by other fixes will be zeroed out.
</P>
<P>Many of the example input scripts included in the LAMMPS distribution
are for 2d models.
</P>
<P>IMPORTANT NOTE: Some models in LAMMPS treat particles as extended
spheres, as opposed to point particles. In 2d, the particles will
still be spheres, not disks, meaning their moment of inertia will be
the same as in 3d.
</P>
<HR>
<A NAME = "howto_3"></A><H4>6.3 CHARMM, AMBER, and DREIDING force fields
</H4>
<P>A force field has 2 parts: the formulas that define it and the
coefficients used for a particular system. Here we only discuss
formulas implemented in LAMMPS that correspond to formulas commonly
used in the CHARMM, AMBER, and DREIDING force fields. Setting
coefficients is done in the input data file via the
<A HREF = "read_data.html">read_data</A> command or in the input script with
commands like <A HREF = "pair_coeff.html">pair_coeff</A> or
-<A HREF = "bond_coeff.html">bond_coeff</A>. See <A HREF = "Section_tools.html">this section</A>
+<A HREF = "bond_coeff.html">bond_coeff</A>. See <A HREF = "Section_tools.html">Section_tools</A>
for additional tools that can use CHARMM or AMBER to assign force
field coefficients and convert their output into LAMMPS input.
</P>
<P>See <A HREF = "#MacKerell">(MacKerell)</A> for a description of the CHARMM force
field. See <A HREF = "#Cornell">(Cornell)</A> for a description of the AMBER force
field.
</P>
<P>These style choices compute force field formulas that are consistent
with common options in CHARMM or AMBER. See each command's
documentation for the formula it computes.
</P>
<UL><LI><A HREF = "bond_harmonic.html">bond_style</A> harmonic
<LI><A HREF = "angle_charmm.html">angle_style</A> charmm
<LI><A HREF = "dihedral_charmm.html">dihedral_style</A> charmm
<LI><A HREF = "pair_charmm.html">pair_style</A> lj/charmm/coul/charmm
<LI><A HREF = "pair_charmm.html">pair_style</A> lj/charmm/coul/charmm/implicit
<LI><A HREF = "pair_charmm.html">pair_style</A> lj/charmm/coul/long
</UL>
<UL><LI><A HREF = "special_bonds.html">special_bonds</A> charmm
<LI><A HREF = "special_bonds.html">special_bonds</A> amber
</UL>
<P>DREIDING is a generic force field developed by the <A HREF = "http://www.wag.caltech.edu">Goddard
group</A> at Caltech and is useful for
predicting structures and dynamics of organic, biological and
main-group inorganic molecules. The philosophy in DREIDING is to use
general force constants and geometry parameters based on simple
hybridization considerations, rather than individual force constants
and geometric parameters that depend on the particular combinations of
atoms involved in the bond, angle, or torsion terms. DREIDING has an
<A HREF = "pair_hbond_dreiding.html">explicit hydrogen bond term</A> to describe
interactions involving a hydrogen atom on very electronegative atoms
(N, O, F).
</P>
<P>See <A HREF = "#Mayo">(Mayo)</A> for a description of the DREIDING force field
</P>
<P>These style choices compute force field formulas that are consistent
with the DREIDING force field. See each command's
documentation for the formula it computes.
</P>
<UL><LI><A HREF = "bond_harmonic.html">bond_style</A> harmonic
<LI><A HREF = "bond_morse.html">bond_style</A> morse
</UL>
<UL><LI><A HREF = "angle_harmonic.html">angle_style</A> harmonic
<LI><A HREF = "angle_cosine.html">angle_style</A> cosine
<LI><A HREF = "angle_cosine_periodic.html">angle_style</A> cosine/periodic
</UL>
<UL><LI><A HREF = "dihedral_charmm.html">dihedral_style</A> charmm
<LI><A HREF = "improper_umbrella.html">improper_style</A> umbrella
</UL>
<UL><LI><A HREF = "pair_buck.html">pair_style</A> buck
<LI><A HREF = "pair_buck.html">pair_style</A> buck/coul/cut
<LI><A HREF = "pair_buck.html">pair_style</A> buck/coul/long
<LI><A HREF = "pair_lj.html">pair_style</A> lj/cut
<LI><A HREF = "pair_lj.html">pair_style</A> lj/cut/coul/cut
<LI><A HREF = "pair_lj.html">pair_style</A> lj/cut/coul/long
</UL>
<UL><LI><A HREF = "pair_hbond_dreiding.html">pair_style</A> hbond/dreiding/lj
<LI><A HREF = "pair_hbond_dreiding.html">pair_style</A> hbond/dreiding/morse
</UL>
<UL><LI><A HREF = "special_bonds.html">special_bonds</A> dreiding
</UL>
<HR>
<A NAME = "howto_4"></A><H4>6.4 Running multiple simulations from one input script
</H4>
<P>This can be done in several ways. See the documentation for
individual commands for more details on how these examples work.
</P>
<P>If "multiple simulations" means continue a previous simulation for
more timesteps, then you simply use the <A HREF = "run.html">run</A> command
multiple times. For example, this script
</P>
<PRE>units lj
atom_style atomic
read_data data.lj
run 10000
run 10000
run 10000
run 10000
run 10000
</PRE>
<P>would run 5 successive simulations of the same system for a total of
50,000 timesteps.
</P>
<P>If you wish to run totally different simulations, one after the other,
the <A HREF = "clear.html">clear</A> command can be used in between them to
re-initialize LAMMPS. For example, this script
</P>
<PRE>units lj
atom_style atomic
read_data data.lj
run 10000
clear
units lj
atom_style atomic
read_data data.lj.new
run 10000
</PRE>
<P>would run 2 independent simulations, one after the other.
</P>
<P>For large numbers of independent simulations, you can use
<A HREF = "variable.html">variables</A> and the <A HREF = "next.html">next</A> and
<A HREF = "jump.html">jump</A> commands to loop over the same input script
multiple times with different settings. For example, this
script, named in.polymer
</P>
<PRE>variable d index run1 run2 run3 run4 run5 run6 run7 run8
shell cd $d
read_data data.polymer
run 10000
shell cd ..
clear
next d
jump in.polymer
</PRE>
<P>would run 8 simulations in different directories, using a data.polymer
file in each directory. The same concept could be used to run the
same system at 8 different temperatures, using a temperature variable
and storing the output in different log and dump files, for example
</P>
<PRE>variable a loop 8
variable t index 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15
log log.$a
read data.polymer
velocity all create $t 352839
fix 1 all nvt $t $t 100.0
dump 1 all atom 1000 dump.$a
run 100000
next t
next a
jump in.polymer
</PRE>
<P>All of the above examples work whether you are running on 1 or
multiple processors, but assumed you are running LAMMPS on a single
partition of processors. LAMMPS can be run on multiple partitions via
the "-partition" command-line switch as described in <A HREF = "Section_start.html#start_6">this
section</A> of the manual.
</P>
<P>In the last 2 examples, if LAMMPS were run on 3 partitions, the same
scripts could be used if the "index" and "loop" variables were
replaced with <I>universe</I>-style variables, as described in the
<A HREF = "variable.html">variable</A> command. Also, the "next t" and "next a"
commands would need to be replaced with a single "next a t" command.
With these modifications, the 8 simulations of each script would run
on the 3 partitions one after the other until all were finished.
Initially, 3 simulations would be started simultaneously, one on each
partition. When one finished, that partition would then start
the 4th simulation, and so forth, until all 8 were completed.
</P>
<HR>
<A NAME = "howto_5"></A><H4>6.5 Multi-replica simulations
</H4>
<P>Several commands in LAMMPS run mutli-replica simulations, meaning
that multiple instances (replicas) of your simulation are run
simultaneously, with small amounts of data exchanged between replicas
periodically.
</P>
<P>These are the relevant commands:
</P>
<UL><LI><A HREF = "neb.html">neb</A> for nudged elastic band calculations
<LI><A HREF = "prd.html">prd</A> for parallel replica dynamics
<LI><A HREF = "tad.html">tad</A> for temperature accelerated dynamics
<LI><A HREF = "temper.html">temper</A> for parallel tempering
</UL>
<P>NEB is a method for finding transition states and barrier energies.
PRD and TAD are methods for performing accelerated dynamics to find
and perform infrequent events. Parallel tempering or replica exchange
runs different replicas at a series of temperature to facilitate
rare-event sampling.
</P>
<P>These command can only be used if LAMMPS was built with the "replica"
package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info on packages.
</P>
<P>In all these cases, you must run with one or more processors per
replica. The processors assigned to each replica are determined at
run-time by using the <A HREF = "Section_start.html#start_6">-partition command-line
switch</A> to launch LAMMPS on multiple
partitions, which in this context are the same as replicas. E.g.
these commands:
</P>
<PRE>mpirun -np 16 lmp_linux -partition 8x2 -in in.temper
mpirun -np 8 lmp_linux -partition 8x1 -in in.neb
</PRE>
<P>would each run 8 replicas, on either 16 or 8 processors. Note the use
of the <A HREF = "Section_start.html#start_6">-in command-line switch</A> to specify
the input script which is required when running in multi-replica mode.
</P>
<P>Also note that with MPI installed on a machine (e.g. your desktop),
you can run on more (virtual) processors than you have physical
processors. Thus the above commands could be run on a
single-processor (or few-processor) desktop so that you can run
a multi-replica simulation on more replicas than you have
physical processors.
</P>
<HR>
<A NAME = "howto_6"></A><H4>6.6 Granular models
</H4>
<P>Granular system are composed of spherical particles with a diameter,
as opposed to point particles. This means they have an angular
velocity and torque can be imparted to them to cause them to rotate.
</P>
<P>To run a simulation of a granular model, you will want to use
the following commands:
</P>
<UL><LI><A HREF = "atom_style.html">atom_style sphere</A>
<LI><A HREF = "fix_nve_sphere.html">fix nve/sphere</A>
<LI><A HREF = "fix_gravity.html">fix gravity</A>
</UL>
<P>This compute
</P>
<UL><LI><A HREF = "compute_erotate_sphere.html">compute erotate/sphere</A>
</UL>
<P>calculates rotational kinetic energy which can be <A HREF = "Section_howto.html#howto_15">output with
thermodynamic info</A>.
</P>
<P>Use one of these 3 pair potentials, which compute forces and torques
between interacting pairs of particles:
</P>
<UL><LI><A HREF = "pair_style.html">pair_style</A> gran/history
<LI><A HREF = "pair_style.html">pair_style</A> gran/no_history
<LI><A HREF = "pair_style.html">pair_style</A> gran/hertzian
</UL>
<P>These commands implement fix options specific to granular systems:
</P>
<UL><LI><A HREF = "fix_freeze.html">fix freeze</A>
<LI><A HREF = "fix_pour.html">fix pour</A>
<LI><A HREF = "fix_viscous.html">fix viscous</A>
<LI><A HREF = "fix_wall_gran.html">fix wall/gran</A>
</UL>
<P>The fix style <I>freeze</I> zeroes both the force and torque of frozen
atoms, and should be used for granular system instead of the fix style
<I>setforce</I>.
</P>
<P>For computational efficiency, you can eliminate needless pairwise
computations between frozen atoms by using this command:
</P>
<UL><LI><A HREF = "neigh_modify.html">neigh_modify</A> exclude
</UL>
<HR>
<A NAME = "howto_7"></A><H4>6.7 TIP3P water model
</H4>
<P>The TIP3P water model as implemented in CHARMM
<A HREF = "#MacKerell">(MacKerell)</A> specifies a 3-site rigid water molecule with
charges and Lennard-Jones parameters assigned to each of the 3 atoms.
In LAMMPS the <A HREF = "fix_shake.html">fix shake</A> command can be used to hold
the two O-H bonds and the H-O-H angle rigid. A bond style of
<I>harmonic</I> and an angle style of <I>harmonic</I> or <I>charmm</I> should also be
used.
</P>
<P>These are the additional parameters (in real units) to set for O and H
atoms and the water molecule to run a rigid TIP3P-CHARMM model with a
cutoff. The K values can be used if a flexible TIP3P model (without
fix shake) is desired. If the LJ epsilon and sigma for HH and OH are
set to 0.0, it corresponds to the original 1983 TIP3P model
<A HREF = "#Jorgensen">(Jorgensen)</A>.
</P>
<P>O mass = 15.9994<BR>
H mass = 1.008 <BR>
</P>
<P>O charge = -0.834<BR>
H charge = 0.417 <BR>
</P>
<P>LJ epsilon of OO = 0.1521<BR>
LJ sigma of OO = 3.1507<BR>
LJ epsilon of HH = 0.0460<BR>
LJ sigma of HH = 0.4000<BR>
LJ epsilon of OH = 0.0836<BR>
LJ sigma of OH = 1.7753 <BR>
</P>
<P>K of OH bond = 450<BR>
r0 of OH bond = 0.9572 <BR>
</P>
<P>K of HOH angle = 55<BR>
theta of HOH angle = 104.52 <BR>
</P>
<P>These are the parameters to use for TIP3P with a long-range Coulombic
solver (Ewald or PPPM in LAMMPS), see <A HREF = "#Price">(Price)</A> for details:
</P>
<P>O mass = 15.9994<BR>
H mass = 1.008 <BR>
</P>
<P>O charge = -0.830<BR>
H charge = 0.415 <BR>
</P>
<P>LJ epsilon of OO = 0.102<BR>
LJ sigma of OO = 3.188<BR>
LJ epsilon, sigma of OH, HH = 0.0 <BR>
</P>
<P>K of OH bond = 450<BR>
r0 of OH bond = 0.9572 <BR>
</P>
<P>K of HOH angle = 55<BR>
theta of HOH angle = 104.52 <BR>
</P>
<P>Wikipedia also has a nice article on <A HREF = "http://en.wikipedia.org/wiki/Water_model">water
models</A>.
</P>
<HR>
<A NAME = "howto_8"></A><H4>6.8 TIP4P water model
</H4>
<P>The four-point TIP4P rigid water model extends the traditional
three-point TIP3P model by adding an additional site, usually
massless, where the charge associated with the oxygen atom is placed.
This site M is located at a fixed distance away from the oxygen along
the bisector of the HOH bond angle. A bond style of <I>harmonic</I> and an
angle style of <I>harmonic</I> or <I>charmm</I> should also be used.
</P>
<P>Currently, only a four-point model for long-range Coulombics is
implemented via the LAMMPS <A HREF = "pair_lj.html">pair style
lj/cut/coul/long/tip4p</A>. A cutoff version may be added
the future. For both models, the bond lengths and bond angles should
be held fixed using the <A HREF = "fix_shake.html">fix shake</A> command.
</P>
<P>These are the additional parameters (in real units) to set for O and H
atoms and the water molecule to run a rigid TIP4P model with a cutoff
<A HREF = "#Jorgensen">(Jorgensen)</A>. Note that the OM distance is specified in
the <A HREF = "pair_style.html">pair_style</A> command, not as part of the pair
coefficients.
</P>
<P>O mass = 15.9994<BR>
H mass = 1.008 <BR>
</P>
<P>O charge = -1.040<BR>
H charge = 0.520 <BR>
</P>
<P>r0 of OH bond = 0.9572<BR>
theta of HOH angle = 104.52 <BR>
</P>
<P>OM distance = 0.15 <BR>
</P>
<P>LJ epsilon of O-O = 0.1550<BR>
LJ sigma of O-O = 3.1536<BR>
LJ epsilon, sigma of OH, HH = 0.0 <BR>
</P>
<P>These are the parameters to use for TIP4P with a long-range Coulombic
solver (Ewald or PPPM in LAMMPS):
</P>
<P>O mass = 15.9994<BR>
H mass = 1.008 <BR>
</P>
<P>O charge = -1.0484<BR>
H charge = 0.5242 <BR>
</P>
<P>r0 of OH bond = 0.9572<BR>
theta of HOH angle = 104.52 <BR>
</P>
<P>OM distance = 0.1250 <BR>
</P>
<P>LJ epsilon of O-O = 0.16275<BR>
LJ sigma of O-O = 3.16435<BR>
LJ epsilon, sigma of OH, HH = 0.0 <BR>
</P>
<P>Wikipedia also has a nice article on <A HREF = "http://en.wikipedia.org/wiki/Water_model">water
models</A>.
</P>
<HR>
<A NAME = "howto_9"></A><H4>6.9 SPC water model
</H4>
<P>The SPC water model specifies a 3-site rigid water molecule with
charges and Lennard-Jones parameters assigned to each of the 3 atoms.
In LAMMPS the <A HREF = "fix_shake.html">fix shake</A> command can be used to hold
the two O-H bonds and the H-O-H angle rigid. A bond style of
<I>harmonic</I> and an angle style of <I>harmonic</I> or <I>charmm</I> should also be
used.
</P>
<P>These are the additional parameters (in real units) to set for O and H
atoms and the water molecule to run a rigid SPC model.
</P>
<P>O mass = 15.9994<BR>
H mass = 1.008 <BR>
</P>
<P>O charge = -0.820<BR>
H charge = 0.410 <BR>
</P>
<P>LJ epsilon of OO = 0.1553<BR>
LJ sigma of OO = 3.166<BR>
LJ epsilon, sigma of OH, HH = 0.0 <BR>
</P>
<P>r0 of OH bond = 1.0<BR>
theta of HOH angle = 109.47 <BR>
</P>
<P>Note that as originally proposed, the SPC model was run with a 9
Angstrom cutoff for both LJ and Coulommbic terms. It can also be used
with long-range Coulombics (Ewald or PPPM in LAMMPS), without changing
any of the parameters above, though it becomes a different model in
that mode of usage.
</P>
<P>The SPC/E (extended) water model is the same, except
the partial charge assignemnts change:
</P>
<P>O charge = -0.8476<BR>
H charge = 0.4238 <BR>
</P>
<P>See the <A HREF = "#Berendsen">(Berendsen)</A> reference for more details on both
the SPC and SPC/E models.
</P>
<P>Wikipedia also has a nice article on <A HREF = "http://en.wikipedia.org/wiki/Water_model">water
models</A>.
</P>
<HR>
<A NAME = "howto_10"></A><H4>6.10 Coupling LAMMPS to other codes
</H4>
<P>LAMMPS is designed to allow it to be coupled to other codes. For
example, a quantum mechanics code might compute forces on a subset of
atoms and pass those forces to LAMMPS. Or a continuum finite element
(FE) simulation might use atom positions as boundary conditions on FE
nodal points, compute a FE solution, and return interpolated forces on
MD atoms.
</P>
<P>LAMMPS can be coupled to other codes in at least 3 ways. Each has
advantages and disadvantages, which you'll have to think about in the
context of your application.
</P>
<P>(1) Define a new <A HREF = "fix.html">fix</A> command that calls the other code. In
this scenario, LAMMPS is the driver code. During its timestepping,
the fix is invoked, and can make library calls to the other code,
which has been linked to LAMMPS as a library. This is the way the
<A HREF = "http://www.rpi.edu/~anderk5/lab">POEMS</A> package that performs constrained rigid-body motion on
groups of atoms is hooked to LAMMPS. See the
<A HREF = "fix_poems.html">fix_poems</A> command for more details. See <A HREF = "Section_modify.html">this
section</A> of the documentation for info on how to add
a new fix to LAMMPS.
</P>
<P>(2) Define a new LAMMPS command that calls the other code. This is
conceptually similar to method (1), but in this case LAMMPS and the
other code are on a more equal footing. Note that now the other code
is not called during the timestepping of a LAMMPS run, but between
runs. The LAMMPS input script can be used to alternate LAMMPS runs
with calls to the other code, invoked via the new command. The
<A HREF = "run.html">run</A> command facilitates this with its <I>every</I> option, which
makes it easy to run a few steps, invoke the command, run a few steps,
invoke the command, etc.
</P>
<P>In this scenario, the other code can be called as a library, as in
(1), or it could be a stand-alone code, invoked by a system() call
made by the command (assuming your parallel machine allows one or more
processors to start up another program). In the latter case the
stand-alone code could communicate with LAMMPS thru files that the
command writes and reads.
</P>
-<P>See <A HREF = "Section_modify.html">this section</A> of the documentation for how to
-add a new command to LAMMPS.
+<P>See <A HREF = "Section_modify.html">Section_modify</A> of the documentation for how
+to add a new command to LAMMPS.
</P>
<P>(3) Use LAMMPS as a library called by another code. In this case the
other code is the driver and calls LAMMPS as needed. Or a wrapper
code could link and call both LAMMPS and another code as libraries.
Again, the <A HREF = "run.html">run</A> command has options that allow it to be
invoked with minimal overhead (no setup or clean-up) if you wish to do
multiple short runs, driven by another program.
</P>
<P>Examples of driver codes that call LAMMPS as a library are included in
the "couple" directory of the LAMMPS distribution; see couple/README
for more details:
</P>
<UL><LI>simple: simple driver programs in C++ and C which invoke LAMMPS as a
library
<LI>lammps_quest: coupling of LAMMPS and <A HREF = "http://dft.sandia.gov/Quest">Quest</A>, to run classical
MD with quantum forces calculated by a density functional code
<LI>lammps_spparks: coupling of LAMMPS and <A HREF = "http://www.sandia.gov/~sjplimp/spparks.html">SPPARKS</A>, to couple
a kinetic Monte Carlo model for grain growth using MD to calculate
strain induced across grain boundaries
</UL>
<P><A HREF = "Section_start.html#start_4">This section</A> of the documentation
describes how to build LAMMPS as a library. Once this is done, you
can interface with LAMMPS either via C++, C, Fortran, or Python (or
any other language that supports a vanilla C-like interface). For
example, from C++ you could create one (or more) "instances" of
LAMMPS, pass it an input script to process, or execute individual
commands, all by invoking the correct class methods in LAMMPS. From C
or Fortran you can make function calls to do the same things. See
-<A HREF = "Section_python.html">this section</A> of the manual for a description of
-the Python wrapper provided with LAMMPS that operates through the
+<A HREF = "Section_python.html">Section_python</A> of the manual for a description
+of the Python wrapper provided with LAMMPS that operates through the
LAMMPS library interface.
</P>
<P>The files src/library.cpp and library.h contain the C-style interface
-to LAMMPS. See <A HREF = "Section_howto.html#howto_19">this section</A> of the manual
-for a description of the interface and how to extend it for your
-needs.
+to LAMMPS. See <A HREF = "Section_howto.html#howto_19">Section_howto 19</A> of the
+manual for a description of the interface and how to extend it for
+your needs.
</P>
<P>Note that the lammps_open() function that creates an instance of
LAMMPS takes an MPI communicator as an argument. This means that
instance of LAMMPS will run on the set of processors in the
communicator. Thus the calling code can run LAMMPS on all or a subset
of processors. For example, a wrapper script might decide to
alternate between LAMMPS and another code, allowing them both to run
on all the processors. Or it might allocate half the processors to
LAMMPS and half to the other code and run both codes simultaneously
before syncing them up periodically. Or it might instantiate multiple
instances of LAMMPS to perform different calculations.
</P>
<HR>
<A NAME = "howto_11"></A><H4>6.11 Visualizing LAMMPS snapshots
</H4>
<P>LAMMPS itself does not do visualization, but snapshots from LAMMPS
simulations can be visualized (and analyzed) in a variety of ways.
</P>
<P>LAMMPS snapshots are created by the <A HREF = "dump.html">dump</A> command which can
create files in several formats. The native LAMMPS dump format is a
text file (see "dump atom" or "dump custom") which can be visualized
by the <A HREF = "Section_tools.html#xmovie">xmovie</A> program, included with the
LAMMPS package. This produces simple, fast 2d projections of 3d
systems, and can be useful for rapid debugging of simulation geometry
and atom trajectories.
</P>
<P>Several programs included with LAMMPS as auxiliary tools can convert
native LAMMPS dump files to other formats. See the
<A HREF = "Section_tools.html">Section_tools</A> doc page for details. The first is
the <A HREF = "Section_tools.html#charmm">ch2lmp tool</A>, which contains a
lammps2pdb Perl script which converts LAMMPS dump files into PDB
files. The second is the <A HREF = "Section_tools.html#arc">lmp2arc tool</A> which
converts LAMMPS dump files into Accelrys' Insight MD program files.
The third is the <A HREF = "Section_tools.html#cfg">lmp2cfg tool</A> which converts
LAMMPS dump files into CFG files which can be read into the
<A HREF = "http://mt.seas.upenn.edu/Archive/Graphics/A">AtomEye</A> visualizer.
</P>
<P>A Python-based toolkit distributed by our group can read native LAMMPS
dump files, including custom dump files with additional columns of
user-specified atom information, and convert them to various formats
or pipe them into visualization software directly. See the <A HREF = "http://www.sandia.gov/~sjplimp/pizza.html">Pizza.py
WWW site</A> for details. Specifically, Pizza.py can convert
LAMMPS dump files into PDB, XYZ, <A HREF = "http://www.ensight.com">Ensight</A>, and VTK formats.
Pizza.py can pipe LAMMPS dump files directly into the Raster3d and
RasMol visualization programs. Pizza.py has tools that do interactive
3d OpenGL visualization and one that creates SVG images of dump file
snapshots.
</P>
<P>LAMMPS can create XYZ files directly (via "dump xyz") which is a
simple text-based file format used by many visualization programs
including <A HREF = "http://www.ks.uiuc.edu/Research/vmd">VMD</A>.
</P>
<P>LAMMPS can create DCD files directly (via "dump dcd") which can be
read by <A HREF = "http://www.ks.uiuc.edu/Research/vmd">VMD</A> in conjunction with a CHARMM PSF file. Using this
form of output avoids the need to convert LAMMPS snapshots to PDB
files. See the <A HREF = "dump.html">dump</A> command for more information on DCD
files.
</P>
<P>LAMMPS can create XTC files directly (via "dump xtc") which is GROMACS
file format which can also be read by <A HREF = "http://www.ks.uiuc.edu/Research/vmd">VMD</A> for visualization.
See the <A HREF = "dump.html">dump</A> command for more information on XTC files.
</P>
<HR>
<A NAME = "howto_12"></A><H4>6.12 Triclinic (non-orthogonal) simulation boxes
</H4>
<P>By default, LAMMPS uses an orthogonal simulation box to encompass the
particles. The <A HREF = "boundary.html">boundary</A> command sets the boundary
conditions of the box (periodic, non-periodic, etc). The orthogonal
box has its "origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors
starting from the origin given by <B>a</B> = (xhi-xlo,0,0); <B>b</B> =
(0,yhi-ylo,0); <B>c</B> = (0,0,zhi-zlo). The 6 parameters
(xlo,xhi,ylo,yhi,zlo,zhi) are defined at the time the simluation box
is created, e.g. by the <A HREF = "create_box.html">create_box</A> or
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands. Additionally, LAMMPS defines box size parameters lx,ly,lz
where lx = xhi-xlo, and similarly in the y and z dimensions. The 6
parameters, as well as lx,ly,lz, can be output via the <A HREF = "thermo_style.html">thermo_style
custom</A> command.
</P>
<P>LAMMPS also allows simulations to be perfored in non-orthogonal
simulation boxes shaped as a parallelepiped with triclinic symmetry.
The parallelepiped has its "origin" at (xlo,ylo,zlo) and is defined by
3 edge vectors starting from the origin given by <B>a</B> = (xhi-xlo,0,0); <B>b</B>
= (xy,yhi-ylo,0); <B>c</B> = (xz,yz,zhi-zlo). <I>Xy,xz,yz</I> can be 0.0 or
positive or negative values and are called "tilt factors" because they
are the amount of displacement applied to faces of an originally
orthogonal box to transform it into the parallelepiped. Note that in
LAMMPS the triclinic simulation box edge vectors <B>a</B>, <B>b</B>, and <B>c</B> cannot be
arbitrary vectors. As indicated, <B>a</B> must be aligned with the x axis, <B>b</B>
must be in the xy plane, and <B>c</B> is arbitrary. However, this is not a
restriction since it is possible to rotate any set of 3 crystal basis
vectors so that they meet this restriction.
</P>
<P>The 9 parameters (xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz) are defined at the
time the simluation box is created. This happens in one of 3 ways.
If the <A HREF = "create_box.html">create_box</A> command is used with a region of
style <I>prism</I>, then a triclinic box is setup. See the
<A HREF = "region.html">region</A> command for details. If the
<A HREF = "read_data.html">read_data</A> command is used to define the simulation
box, and the header of the data file contains a line with the "xy xz
yz" keyword, then a triclinic box is setup. See the
<A HREF = "read_data.html">read_data</A> command for details. Finally, if the
<A HREF = "read_restart.html">read_restart</A> command reads a restart file which
was written from a simulation using a triclinic box, then a triclinic
box will be setup for the restarted simulation.
</P>
<P>Note that you can define a triclinic box with all 3 tilt factors =
0.0, so that it is initially orthogonal. This is necessary if the box
will become non-orthogonal, e.g. due to the <A HREF = "fix_nh.html">fix npt</A> or
<A HREF = "fix_deform.html">fix deform</A> commands. Alternatively, you can use the
<A HREF = "change_box.html">change_box</A> command to convert a simulation box from
orthogonal to triclinic and vice versa.
</P>
<P>As with orthogonal boxes, LAMMPS defines triclinic box size parameters
lx,ly,lz where lx = xhi-xlo, and similarly in the y and z dimensions.
The 9 parameters, as well as lx,ly,lz, can be output via the
<A HREF = "thermo_style.html">thermo_style custom</A> command.
</P>
<P>To avoid extremely tilted boxes (which would be computationally
inefficient), no tilt factor can skew the box more than half the
distance of the parallel box length, which is the 1st dimension in the
tilt factor (x for xz). For example, if xlo = 2 and xhi = 12, then
the x box length is 10 and the xy tilt factor must be between -5 and
5. Similarly, both xz and yz must be between -(xhi-xlo)/2 and
+(yhi-ylo)/2. Note that this is not a limitation, since if the
maximum tilt factor is 5 (as in this example), then configurations
with tilt = ..., -15, -5, 5, 15, 25, ... are geometrically all
equivalent.
</P>
<P>Triclinic crystal structures are often defined using three lattice
constants <I>a</I>, <I>b</I>, and <I>c</I>, and three angles <I>alpha</I>, <I>beta</I> and
<I>gamma</I>. Note that in this nomenclature, the a, b, and c lattice constants
are the scalar lengths of the edge vectors <B>a</B>, <B>b</B>, and <B>c</B> defined
above. The
relationship between these 6 quantities (a,b,c,alpha,beta,gamma) and
the LAMMPS box sizes (lx,ly,lz) = (xhi-xlo,yhi-ylo,zhi-zlo) and tilt
factors (xy,xz,yz) is as follows:
</P>
<CENTER><IMG SRC = "Eqs/box.jpg">
</CENTER>
<P>The inverse relationship can be written as follows:
</P>
<CENTER><IMG SRC = "Eqs/box_inverse.jpg">
</CENTER>
<P>The values of <I>a</I>, <I>b</I>, <I>c</I> , <I>alpha</I>, <I>beta</I> , and <I>gamma</I> can be printed
out or accessed by computes using the
<A HREF = "thermo_style.html">thermo_style custom</A> keywords
<I>cella</I>, <I>cellb</I>, <I>cellc</I>, <I>cellalpha</I>, <I>cellbeta</I>, <I>cellgamma</I>,
respectively.
</P>
<P>As discussed on the <A HREF = "dump.html">dump</A> command doc page, when the BOX
BOUNDS for a snapshot is written to a dump file for a triclinic box,
an orthogonal bounding box which encloses the triclinic simulation box
is output, along with the 3 tilt factors (xy, xz, yz) of the triclinic
box, formatted as follows:
</P>
<PRE>ITEM: BOX BOUNDS xy xz yz
xlo_bound xhi_bound xy
ylo_bound yhi_bound xz
zlo_bound zhi_bound yz
</PRE>
<P>This bounding box is convenient for many visualization programs and is
calculated from the 9 triclinic box parameters
(xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz) as follows:
</P>
<PRE>xlo_bound = xlo + MIN(0.0,xy,xz,xy+xz)
xhi_bound = xhi + MAX(0.0,xy,xz,xy+xz)
ylo_bound = ylo + MIN(0.0,yz)
yhi_bound = yhi + MAX(0.0,yz)
zlo_bound = zlo
zhi_bound = zhi
</PRE>
<P>These formulas can be inverted if you need to convert the bounding box
back into the triclinic box parameters, e.g. xlo = xlo_bound -
MIN(0.0,xy,xz,xy+xz).
</P>
<P>One use of triclinic simulation boxes is to model solid-state crystals
with triclinic symmetry. The <A HREF = "lattice.html">lattice</A> command can be
used with non-orthogonal basis vectors to define a lattice that will
tile a triclinic simulation box via the
<A HREF = "create_atoms.html">create_atoms</A> command.
</P>
<P>A second use is to run Parinello-Rahman dyanamics via the <A HREF = "fix_nh.html">fix
npt</A> command, which will adjust the xy, xz, yz tilt
factors to compensate for off-diagonal components of the pressure
tensor. The analalog for an <A HREF = "minimize.html">energy minimization</A> is
the <A HREF = "fix_box_relax.html">fix box/relax</A> command.
</P>
<P>A third use is to shear a bulk solid to study the response of the
material. The <A HREF = "fix_deform.html">fix deform</A> command can be used for
this purpose. It allows dynamic control of the xy, xz, yz tilt
factors as a simulation runs. This is discussed in the next section
on non-equilibrium MD (NEMD) simulations.
</P>
<HR>
<A NAME = "howto_13"></A><H4>6.13 NEMD simulations
</H4>
<P>Non-equilibrium molecular dynamics or NEMD simulations are typically
used to measure a fluid's rheological properties such as viscosity.
In LAMMPS, such simulations can be performed by first setting up a
non-orthogonal simulation box (see the preceding Howto section).
</P>
<P>A shear strain can be applied to the simulation box at a desired
strain rate by using the <A HREF = "fix_deform.html">fix deform</A> command. The
<A HREF = "fix_nvt_sllod.html">fix nvt/sllod</A> command can be used to thermostat
the sheared fluid and integrate the SLLOD equations of motion for the
system. Fix nvt/sllod uses <A HREF = "compute_temp_deform.html">compute
temp/deform</A> to compute a thermal temperature
by subtracting out the streaming velocity of the shearing atoms. The
velocity profile or other properties of the fluid can be monitored via
the <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command.
</P>
<P>As discussed in the previous section on non-orthogonal simulation
boxes, the amount of tilt or skew that can be applied is limited by
LAMMPS for computational efficiency to be 1/2 of the parallel box
length. However, <A HREF = "fix_deform.html">fix deform</A> can continuously strain
a box by an arbitrary amount. As discussed in the <A HREF = "fix_deform.html">fix
deform</A> command, when the tilt value reaches a limit,
the box is re-shaped to the opposite limit which is an equivalent
tiling of periodic space. The strain rate can then continue to change
as before. In a long NEMD simulation these box re-shaping events may
occur many times.
</P>
<P>In a NEMD simulation, the "remap" option of <A HREF = "fix_deform.html">fix
deform</A> should be set to "remap v", since that is what
<A HREF = "fix_nvt_sllod.html">fix nvt/sllod</A> assumes to generate a velocity
profile consistent with the applied shear strain rate.
</P>
<P>An alternative method for calculating viscosities is provided via the
<A HREF = "fix_viscosity.html">fix viscosity</A> command.
</P>
<HR>
<A NAME = "howto_14"></A><H4>6.14 Extended spherical and aspherical particles
</H4>
<P>Typical MD models treat atoms or particles as point masses.
Sometimes, however, it is desirable to have a model with finite-size
particles such as spheres or aspherical ellipsoids. The difference is
that such particles have a moment of inertia, rotational energy, and
angular momentum. Rotation is induced by torque from interactions
with other particles.
</P>
<P>LAMMPS has several options for running simulations with these kinds of
particles. The following aspects are discussed in turn:
</P>
<UL><LI>atom styles
<LI>pair potentials
<LI>time integration
<LI>computes, thermodynamics, and dump output
<LI>rigid bodies composed of extended particles
</UL>
<H5>Atom styles
</H5>
<P>There are 2 <A HREF = "atom_style.html">atom styles</A> that allow for definition of
finite-size particles: sphere and ellipsoid. The peri atom style also
treats particles as having a volume, but that is internal to the
<A HREF = "pair_peri.html">pair_style peri</A> potentials. The dipole atom style is
most often used in conjunction with finite-size particles.
</P>
<P>The sphere style defines particles that are spheriods and each
particle can have a unique diameter and mass (or density). These
particles store an angular velocity (omega) and can be acted upon by
torque. The "set" command can be used to modify the diameter and mass
of individual particles, after then are created.
</P>
<P>The ellipsoid style defines particles that are ellipsoids and thus can
be aspherical. Each particle has a shape, specified by 3 diameters,
and mass (or density). These particles store an angular momentum and
their orientation (quaternion), and can be acted upon by torque. They
do not store an angular velocity (omega), which can be in a different
direction than angular momentum, rather they compute it as needed.
The "set" command can be used to modify the diameter, orientation, and
mass of individual particles, after then are created. It also has a
brief explanation of what quaternions are.
</P>
<P>The dipole style does not define extended particles, but is often
used in conjunction with spherical particles, via a command like
</P>
<PRE>atom_style hybrid sphere dipole
</PRE>
<P>This is because when dipoles interact with each other, they induce
torques, and a particle must be extended (i.e. have a moment of
inertia) in order to respond and rotate. See the <A HREF = "atom_style.html">atom_style
dipole</A> command for details. The "set" command can be
used to modify the orientation and length of the dipole moment of
individual particles, after then are created.
</P>
<P>Note that if one of these atom styles is used (or multiple styles via
the <A HREF = "atom_style.html">atom_style hybrid</A> command), not all particles in
the system are required to be finite-size or aspherical. For example,
if the 3 shape parameters are set to the same value, the particle will
be a sphere rather than an ellipsoid. If the 3 shape parameters are
all set to 0.0 or if the diameter is set to 0.0, it will be a point
particle. If the length of the dipole moment is set to zero, the
particle will not have a point dipole associated with it. The pair
styles used to compute pairwise interactions will typically compute
the correct interaction in these simplified (cheaper) cases.
<A HREF = "pair_hybrid.html">Pair_style hybrid</A> can be used to insure the correct
interactions are computed for the appropriate style of interactions.
Likewise, using groups to partition particles (ellipsoids versus
spheres versus point particles) will allow you to use the appropriate
time integrators and temperature computations for each class of
particles. See the doc pages for various commands for details.
</P>
<P>Also note that for <A HREF = "dimension.html">2d simulations</A>, finite-size
spheres and ellipsoids are still treated as 3d particles, rather than
as circular disks or ellipses. This means they have the same moment
of inertia for a 3d extended object. When their temperature is
coomputed, the correct degrees of freedom are used for rotation in a
2d versus 3d system.
</P>
<H5>Pair potentials
</H5>
<P>When a system with extended particles is defined, the particles will
only rotate and experience torque if the force field computes such
interactions. These are the various <A HREF = "pair_style.html">pair styles</A>
that generate torque:
</P>
<UL><LI><A HREF = "pair_gran.html">pair_style gran/history</A>
<LI><A HREF = "pair_gran.html">pair_style gran/hertzian</A>
<LI><A HREF = "pair_gran.html">pair_style gran/no_history</A>
<LI><A HREF = "pair_dipole.html">pair_style dipole/cut</A>
<LI><A HREF = "pair_gayberne.html">pair_style gayberne</A>
<LI><A HREF = "pair_resquared.html">pair_style resquared</A>
<LI><A HREF = "pair_lubricate.html">pair_style lubricate</A>
</UL>
<P>The <A HREF = "pair_gran.html">granular pair styles</A> are used with spherical
particles. The <A HREF = "pair_dipole.html">dipole pair style</A> is used with
<A HREF = "atom_style.html">atom_style dipole</A>, which could be applied to
spherical or ellipsoidal particles. The <A HREF = "pair_gayberne.html">GayBerne</A>
and <A HREF = "pair_resquared.html">REsquared</A> potentials require ellipsoidal
particles, though they will also work if the 3 shape parameters are
the same (a sphere). The <A HREF = "pair_lubricate.html">lubrication potential</A>
works with spherical particles.
</P>
<H5>Time integration
</H5>
<P>There are 3 fixes that perform time integration on extended spherical
particles, meaning the integrators update the rotational orientation
and angular velocity or angular momentum of the particles:
</P>
<UL><LI><A HREF = "fix_nve_sphere.html">fix nve/sphere</A>
<LI><A HREF = "fix_nvt_sphere.html">fix nvt/sphere</A>
<LI><A HREF = "fix_npt_sphere.html">fix npt/sphere</A>
</UL>
<P>Likewise, there are 3 fixes that perform time integration on
ellipsoids as extended aspherical particles:
</P>
<UL><LI><A HREF = "fix_nve_asphere.html">fix nve/asphere</A>
<LI><A HREF = "fix_nvt_asphere.html">fix nvt/asphere</A>
<LI><A HREF = "fix_npt_asphere.html">fix npt/asphere</A>
</UL>
<P>The advantage of these fixes is that those which thermostat the
particles include the rotational degrees of freedom in the temperature
calculation and thermostatting. Other thermostats can be used with
fix nve/sphere or fix nve/asphere, such as fix langevin or fix
temp/berendsen, but those thermostats only operate on the
translational kinetic energy of the extended particles.
</P>
<P>Note that for mixtures of point and extended particles, you should
only use these integration fixes on <A HREF = "group.html">groups</A> which contain
extended particles.
</P>
<H5>Computes, thermodynamics, and dump output
</H5>
<P>There are 4 computes that calculate the temperature or rotational energy
of extended spherical or aspherical particles (ellipsoids):
</P>
<UL><LI><A HREF = "compute_temp_sphere.html">compute temp/sphere</A>
<LI><A HREF = "compute_temp_asphere.html">compute temp/asphere</A>
<LI><A HREF = "compute_erotate_sphere.html">compute erotate/sphere</A>
<LI><A HREF = "compute_erotate_asphere.html">compute erotate/asphere</A>
</UL>
<P>These include rotational degrees of freedom in their computation. If
you wish the thermodynamic output of temperature or pressure to use
one of these computes (e.g. for a system entirely composed of extended
particles), then the compute can be defined and the
<A HREF = "thermo_modify.html">thermo_modify</A> command used. Note that by
default thermodynamic quantities will be calculated with a temperature
that only includes translational degrees of freedom. See the
<A HREF = "thermo_style.html">thermo_style</A> command for details.
</P>
<P>The <A HREF = "dump.html">dump custom</A> command can output various attributes of
extended particles, including the dipole moment (mu), the angular
velocity (omega), the angular momentum (angmom), the quaternion
(quat), and the torque (tq) on the particle.
</P>
<H5>Rigid bodies composed of extended particles
</H5>
<P>The <A HREF = "fix_rigid.html">fix rigid</A> command treats a collection of
particles as a rigid body, computes its inertia tensor, sums the total
force and torque on the rigid body each timestep due to forces on its
constituent particles, and integrates the motion of the rigid body.
</P>
<P>If any of the constituent particles of a rigid body are extended
particles (spheres or ellipsoids), then their contribution to the
inertia tensor of the body is different than if they were point
particles. This means the rotational dynamics of the rigid body will
be different. Thus a model of a dimer is different if the dimer
consists of two point masses versus two extended sphereoids, even if
the two particles have the same mass. Extended particles that
experience torque due to their interaction with other particles will
also impart that torque to a rigid body they are part of.
</P>
<P>See the "fix rigid" command for example of complex rigid-body models
it is possible to define in LAMMPS.
</P>
<P>Note that the <A HREF = "fix_shake.html">fix shake</A> command can also be used to
treat 2, 3, or 4 particles as a rigid body, but it always assumes the
particles are point masses.
</P>
<HR>
<A NAME = "howto_15"></A><H4>6.15 Output from LAMMPS (thermo, dumps, computes, fixes, variables)
</H4>
<P>There are four basic kinds of LAMMPS output:
</P>
<UL><LI><A HREF = "thermo_style.html">Thermodynamic output</A>, which is a list
of quantities printed every few timesteps to the screen and logfile.
<LI><A HREF = "dump.html">Dump files</A>, which contain snapshots of atoms and various
per-atom values and are written at a specified frequency.
<LI>Certain fixes can output user-specified quantities to files: <A HREF = "fix_ave_time.html">fix
ave/time</A> for time averaging, <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> for spatial averaging, and <A HREF = "fix_print.html">fix
print</A> for single-line output of
<A HREF = "variable.html">variables</A>. Fix print can also output to the
screen.
<LI><A HREF = "restart.html">Restart files</A>.
</UL>
<P>A simulation prints one set of thermodynamic output and (optionally)
restart files. It can generate any number of dump files and fix
output files, depending on what <A HREF = "dump.html">dump</A> and <A HREF = "fix.html">fix</A>
commands you specify.
</P>
<P>As discussed below, LAMMPS gives you a variety of ways to determine
what quantities are computed and printed when the thermodynamics,
dump, or fix commands listed above perform output. Throughout this
discussion, note that users can also <A HREF = "Section_modify.html">add their own computes and fixes
to LAMMPS</A> which can then generate values that can
then be output with these commands.
</P>
<P>The following sub-sections discuss different LAMMPS command related
to output and the kind of data they operate on and produce:
</P>
<UL><LI><A HREF = "#global">Global/per-atom/local data</A>
<LI><A HREF = "#scalar">Scalar/vector/array data</A>
<LI><A HREF = "#thermo">Thermodynamic output</A>
<LI><A HREF = "#dump">Dump file output</A>
<LI><A HREF = "#fixoutput">Fixes that write output files</A>
<LI><A HREF = "#computeoutput">Computes that process output quantities</A>
<LI><A HREF = "#fixoutput">Fixes that process output quantities</A>
<LI><A HREF = "#compute">Computes that generate values to output</A>
<LI><A HREF = "#fix">Fixes that generate values to output</A>
<LI><A HREF = "#variable">Variables that generate values to output</A>
<LI><A HREF = "#table">Summary table of output options and data flow between commands</A>
</UL>
<H5><A NAME = "global"></A>Global/per-atom/local data
</H5>
<P>Various output-related commands work with three different styles of
data: global, per-atom, or local. A global datum is one or more
system-wide values, e.g. the temperature of the system. A per-atom
datum is one or more values per atom, e.g. the kinetic energy of each
atom. Local datums are calculated by each processor based on the
atoms it owns, but there may be zero or more per atom, e.g. a list of
bond distances.
</P>
<H5><A NAME = "scalar"></A>Scalar/vector/array data
</H5>
<P>Global, per-atom, and local datums can each come in three kinds: a
single scalar value, a vector of values, or a 2d array of values. The
doc page for a "compute" or "fix" or "variable" that generates data
will specify both the style and kind of data it produces, e.g. a
per-atom vector.
</P>
<P>When a quantity is accessed, as in many of the output commands
discussed below, it can be referenced via the following bracket
notation, where ID in this case is the ID of a compute. The leading
"c_" would be replaced by "f_" for a fix, or "v_" for a variable:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >c_ID </TD><TD > entire scalar, vector, or array</TD></TR>
<TR><TD >c_ID[I] </TD><TD > one element of vector, one column of array</TD></TR>
<TR><TD >c_ID[I][J] </TD><TD > one element of array
</TD></TR></TABLE></DIV>
<P>In other words, using one bracket reduces the dimension of the data
once (vector -> scalar, array -> vector). Using two brackets reduces
the dimension twice (array -> scalar). Thus a command that uses
scalar values as input can typically also process elements of a vector
or array.
</P>
<H5><A NAME = "thermo"></A>Thermodynamic output
</H5>
<P>The frequency and format of thermodynamic output is set by the
<A HREF = "thermo.html">thermo</A>, <A HREF = "thermo_style.html">thermo_style</A>, and
<A HREF = "thermo_modify.html">thermo_modify</A> commands. The
<A HREF = "thermo_style.html">thermo_style</A> command also specifies what values
are calculated and written out. Pre-defined keywords can be specified
(e.g. press, etotal, etc). Three additional kinds of keywords can
also be specified (c_ID, f_ID, v_name), where a <A HREF = "compute.html">compute</A>
or <A HREF = "fix.html">fix</A> or <A HREF = "variable.html">variable</A> provides the value to be
output. In each case, the compute, fix, or variable must generate
global values for input to the <A HREF = "dump.html">thermo_style custom</A>
command.
</P>
<H5><A NAME = "dump"></A>Dump file output
</H5>
<P>Dump file output is specified by the <A HREF = "dump.html">dump</A> and
<A HREF = "dump_modify.html">dump_modify</A> commands. There are several
pre-defined formats (dump atom, dump xtc, etc).
</P>
<P>There is also a <A HREF = "dump.html">dump custom</A> format where the user
specifies what values are output with each atom. Pre-defined atom
attributes can be specified (id, x, fx, etc). Three additional kinds
of keywords can also be specified (c_ID, f_ID, v_name), where a
<A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A> or <A HREF = "variable.html">variable</A>
provides the values to be output. In each case, the compute, fix, or
variable must generate per-atom values for input to the <A HREF = "dump.html">dump
custom</A> command.
</P>
<P>There is also a <A HREF = "dump.html">dump local</A> format where the user specifies
what local values to output. A pre-defined index keyword can be
specified to enumuerate the local values. Two additional kinds of
keywords can also be specified (c_ID, f_ID), where a
<A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A> or <A HREF = "variable.html">variable</A>
provides the values to be output. In each case, the compute or fix
must generate local values for input to the <A HREF = "dump.html">dump local</A>
command.
</P>
<H5><A NAME = "fixoutput"></A>Fixes that write output files
</H5>
<P>Sevarl fixes take various quantities as input and can write output
files: <A HREF = "fix_ave_time.html">fix ave/time</A>, <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A>, <A HREF = "fix_ave_histo.html">fix ave/histo</A>,
<A HREF = "fix_ave_correlate.html">fix ave/correlate</A>, and <A HREF = "fix_print.html">fix
print</A>.
</P>
<P>The <A HREF = "fix_ave_time.html">fix ave/time</A> command enables direct output to
a file and/or time-averaging of global scalars or vectors. The user
specifies one or more quantities as input. These can be global
<A HREF = "compute.html">compute</A> values, global <A HREF = "fix.html">fix</A> values, or
<A HREF = "variable.html">variables</A> of any style except the atom style which
produces per-atom values. Since a variable can refer to keywords used
by the <A HREF = "thermo_style.html">thermo_style custom</A> command (like temp or
press) and individual per-atom values, a wide variety of quantities
can be time averaged and/or output in this way. If the inputs are one
or more scalar values, then the fix generate a global scalar or vector
of output. If the inputs are one or more vector values, then the fix
generates a global vector or array of output. The time-averaged
output of this fix can also be used as input to other output commands.
</P>
<P>The <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command enables direct
output to a file of spatial-averaged per-atom quantities like those
output in dump files, within 1d layers of the simulation box. The
per-atom quantities can be atom density (mass or number) or atom
attributes such as position, velocity, force. They can also be
per-atom quantities calculated by a <A HREF = "compute.html">compute</A>, by a
<A HREF = "fix.html">fix</A>, or by an atom-style <A HREF = "variable.html">variable</A>. The
spatial-averaged output of this fix can also be used as input to other
output commands.
</P>
<P>The <A HREF = "fix_ave_histo.html">fix ave/histo</A> command enables direct output
to a file of histogrammed quantities, which can be global or per-atom
or local quantities. The histogram output of this fix can also be
used as input to other output commands.
</P>
<P>The <A HREF = "fix_ave_histo.html">fix ave/correlate</A> command enables direct
output to a file of time-correlated quantities, which can be global
scalars. The correlation matrix output of this fix can also be used
as input to other output commands.
</P>
<P>The <A HREF = "fix_print.html">fix print</A> command can generate a line of output
written to the screen and log file or to a separate file, periodically
during a running simulation. The line can contain one or more
<A HREF = "variable.html">variable</A> values for any style variable except the atom
style). As explained above, variables themselves can contain
references to global values generated by <A HREF = "thermo_style.html">thermodynamic
keywords</A>, <A HREF = "compute.html">computes</A>,
<A HREF = "fix.html">fixes</A>, or other <A HREF = "variable.html">variables</A>, or to per-atom
values for a specific atom. Thus the <A HREF = "fix_print.html">fix print</A>
command is a means to output a wide variety of quantities separate
from normal thermodynamic or dump file output.
</P>
<H5><A NAME = "computeoutput"></A>Computes that process output quantities
</H5>
<P>The <A HREF = "compute_reduce.html">compute reduce</A> and <A HREF = "compute_reduce.html">compute
reduce/region</A> commands take one or more per-atom
or local vector quantities as inputs and "reduce" them (sum, min, max,
ave) to scalar quantities. These are produced as output values which
can be used as input to other output commands.
</P>
<P>The <A HREF = "compute_slice.html">compute slice</A> command take one or more global
vector or array quantities as inputs and extracts a subset of their
values to create a new vector or array. These are produced as output
values which can be used as input to other output commands.
</P>
<P>The <A HREF = "compute_property_atom.html">compute property/atom</A> command takes a
list of one or more pre-defined atom attributes (id, x, fx, etc) and
stores the values in a per-atom vector or array. These are produced
as output values which can be used as input to other output commands.
The list of atom attributes is the same as for the <A HREF = "dump.html">dump
custom</A> command.
</P>
<P>The <A HREF = "compute_property_local.html">compute property/local</A> command takes
a list of one or more pre-defined local attributes (bond info, angle
info, etc) and stores the values in a local vector or array. These
are produced as output values which can be used as input to other
output commands.
</P>
<P>The <A HREF = "compute_atom_molecule.html">compute atom/molecule</A> command takes a
list of one or more per-atom quantities (from a compute, fix, per-atom
variable) and sums the quantities on a per-molecule basis. It
produces a global vector or array as output values which can be used
as input to other output commands.
</P>
<H5><A NAME = "fixoutput"></A>Fixes that process output quantities
</H5>
<P>The <A HREF = "fix_ave_atom.html">fix ave/atom</A> command performs time-averaging
of per-atom vectors. The per-atom quantities can be atom attributes
such as position, velocity, force. They can also be per-atom
quantities calculated by a <A HREF = "compute.html">compute</A>, by a
<A HREF = "fix.html">fix</A>, or by an atom-style <A HREF = "variable.html">variable</A>. The
time-averaged per-atom output of this fix can be used as input to
other output commands.
</P>
<P>The <A HREF = "fix_store_state.html">fix store/state</A> command can archive one or
more per-atom attributes at a particular time, so that the old values
can be used in a future calculation or output. The list of atom
attributes is the same as for the <A HREF = "dump.html">dump custom</A> command,
including per-atom quantities calculated by a <A HREF = "compute.html">compute</A>,
by a <A HREF = "fix.html">fix</A>, or by an atom-style <A HREF = "variable.html">variable</A>.
The output of this fix can be used as input to other output commands.
</P>
<H5><A NAME = "compute"></A>Computes that generate values to output
</H5>
<P>Every <A HREF = "compute.html">compute</A> in LAMMPS produces either global or
per-atom or local values. The values can be scalars or vectors or
arrays of data. These values can be output using the other commands
described in this section. The doc page for each compute command
describes what it produces. Computes that produce per-atom or local
values have the word "atom" or "local" in their style name. Computes
without the word "atom" or "local" produce global values.
</P>
<H5><A NAME = "fix"></A>Fixes that generate values to output
</H5>
<P>Some <A HREF = "fix.html">fixes</A> in LAMMPS produces either global or per-atom or
local values which can be accessed by other commands. The values can
be scalars or vectors or arrays of data. These values can be output
using the other commands described in this section. The doc page for
each fix command tells whether it produces any output quantities and
describes them.
</P>
<H5><A NAME = "variable"></A>Variables that generate values to output
</H5>
<P>Every <A HREF = "variable.html">variables</A> defined in an input script generates
either a global scalar value or a per-atom vector (only atom-style
variables) when it is accessed. The formulas used to define equal-
and atom-style variables can contain references to the thermodynamic
keywords and to global and per-atom data generated by computes, fixes,
and other variables. The values generated by variables can be output
using the other commands described in this section.
</P>
<H5><A NAME = "table"></A>Summary table of output options and data flow between commands
</H5>
<P>This table summarizes the various commands that can be used for
generating output from LAMMPS. Each command produces output data of
some kind and/or writes data to a file. Most of the commands can take
data from other commands as input. Thus you can link many of these
commands together in pipeline form, where data produced by one command
is used as input to another command and eventually written to the
screen or to a file. Note that to hook two commands together the
output and input data types must match, e.g. global/per-atom/local
data and scalar/vector/array data.
</P>
<P>Also note that, as described above, when a command takes a scalar as
input, that could be an element of a vector or array. Likewise a
vector input could be a column of an array.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >Command</TD><TD > Input</TD><TD > Output</TD><TD ></TD></TR>
<TR><TD ><A HREF = "thermo_style.html">thermo_style custom</A></TD><TD > global scalars</TD><TD > screen, log file</TD><TD ></TD></TR>
<TR><TD ><A HREF = "dump.html">dump custom</A></TD><TD > per-atom vectors</TD><TD > dump file</TD><TD ></TD></TR>
<TR><TD ><A HREF = "dump.html">dump local</A></TD><TD > local vectors</TD><TD > dump file</TD><TD ></TD></TR>
<TR><TD ><A HREF = "fix_print.html">fix print</A></TD><TD > global scalar from variable</TD><TD > screen, file</TD><TD ></TD></TR>
<TR><TD ><A HREF = "print.html">print</A></TD><TD > global scalar from variable</TD><TD > screen</TD><TD ></TD></TR>
<TR><TD ><A HREF = "compute.html">computes</A></TD><TD > N/A</TD><TD > global/per-atom/local scalar/vector/array</TD><TD ></TD></TR>
<TR><TD ><A HREF = "fix.html">fixes</A></TD><TD > N/A</TD><TD > global/per-atom/local scalar/vector/array</TD><TD ></TD></TR>
<TR><TD ><A HREF = "variable.html">variables</A></TD><TD > global scalars, per-atom vectors</TD><TD > global scalar, per-atom vector</TD><TD ></TD></TR>
<TR><TD ><A HREF = "compute_reduce.html">compute reduce</A></TD><TD > per-atom/local vectors</TD><TD > global scalar/vector</TD><TD ></TD></TR>
<TR><TD ><A HREF = "compute_slice.html">compute slice</A></TD><TD > global vectors/arrays</TD><TD > global vector/array</TD><TD ></TD></TR>
<TR><TD ><A HREF = "compute_property_atom.html">compute property/atom</A></TD><TD > per-atom vectors</TD><TD > per-atom vector/array</TD><TD ></TD></TR>
<TR><TD ><A HREF = "compute_property_local.html">compute property/local</A></TD><TD > local vectors</TD><TD > local vector/array</TD><TD ></TD></TR>
<TR><TD ><A HREF = "compute_atom_molecule.html">compute atom/molecule</A></TD><TD > per-atom vectors</TD><TD > global vector/array</TD><TD ></TD></TR>
<TR><TD ><A HREF = "fix_ave_atom.html">fix ave/atom</A></TD><TD > per-atom vectors</TD><TD > per-atom vector/array</TD><TD ></TD></TR>
<TR><TD ><A HREF = "fix_ave_time.html">fix ave/time</A></TD><TD > global scalars/vectors</TD><TD > global scalar/vector/array, file</TD><TD ></TD></TR>
<TR><TD ><A HREF = "fix_ave_spatial.html">fix ave/spatial</A></TD><TD > per-atom vectors</TD><TD > global array, file</TD><TD ></TD></TR>
<TR><TD ><A HREF = "fix_ave_histo.html">fix ave/histo</A></TD><TD > global/per-atom/local scalars and vectors</TD><TD > global array, file</TD><TD ></TD></TR>
<TR><TD ><A HREF = "fix_ave_correlate.html">fix ave/correlate</A></TD><TD > global scalars</TD><TD > global array, file</TD><TD ></TD></TR>
<TR><TD ><A HREF = "fix_store_state.html">fix store/state</A></TD><TD > per-atom vectors</TD><TD > per-atom vector/array</TD><TD ></TD></TR>
<TR><TD >
</TD></TR></TABLE></DIV>
<HR>
<A NAME = "howto_16"></A><H4>6.16 Thermostatting, barostatting, and computing temperature
</H4>
<P>Thermostatting means controlling the temperature of particles in an MD
simulation. Barostatting means controlling the pressure. Since the
pressure includes a kinetic component due to particle velocities, both
these operations require calculation of the temperature. Typically a
target temperature (T) and/or pressure (P) is specified by the user,
and the thermostat or barostat attempts to equilibrate the system to
the requested T and/or P.
</P>
<P>Temperature is computed as kinetic energy divided by some number of
degrees of freedom (and the Boltzmann constant). Since kinetic energy
is a function of particle velocity, there is often a need to
distinguish between a particle's advection velocity (due to some
aggregate motiion of particles) and its thermal velocity. The sum of
the two is the particle's total velocity, but the latter is often what
is wanted to compute a temperature.
</P>
<P>LAMMPS has several options for computing temperatures, any of which
can be used in thermostatting and barostatting. These <A HREF = "compute.html">compute
commands</A> calculate temperature, and the <A HREF = "compute_pressure.html">compute
pressure</A> command calculates pressure.
</P>
<UL><LI><A HREF = "compute_temp.html">compute temp</A>
<LI><A HREF = "compute_temp_sphere.html">compute temp/sphere</A>
<LI><A HREF = "compute_temp_asphere.html">compute temp/asphere</A>
<LI><A HREF = "compute_temp_com.html">compute temp/com</A>
<LI><A HREF = "compute_temp_deform.html">compute temp/deform</A>
<LI><A HREF = "compute_temp_partial.html">compute temp/partial</A>
<LI><A HREF = "compute_temp_profile.html">compute temp/profile</A>
<LI><A HREF = "compute_temp_ramp.html">compute temp/ramp</A>
<LI><A HREF = "compute_temp_region.html">compute temp/region</A>
</UL>
<P>All but the first 3 calculate velocity biases (i.e. advection
velocities) that are removed when computing the thermal temperature.
<A HREF = "compute_temp_sphere.html">Compute temp/sphere</A> and <A HREF = "compute_temp_asphere.html">compute
temp/asphere</A> compute kinetic energy for
extended particles that includes rotational degrees of freedom. They
both allow, as an extra argument, which is another temperature compute
that subtracts a velocity bias. This allows the translational
velocity of extended spherical or aspherical particles to be adjusted
in prescribed ways.
</P>
<P>Thermostatting in LAMMPS is performed by <A HREF = "fix.html">fixes</A>, or in one
case by a pair style. Four thermostatting fixes are currently
available: Nose-Hoover (nvt), Berendsen, Langevin, and direct
rescaling (temp/rescale). Dissipative particle dynamics (DPD)
thermostatting can be invoked via the <I>dpd/tstat</I> pair style:
</P>
<UL><LI><A HREF = "fix_nh.html">fix nvt</A>
<LI><A HREF = "fix_nvt_sphere.html">fix nvt/sphere</A>
<LI><A HREF = "fix_nvt_asphere.html">fix nvt/asphere</A>
<LI><A HREF = "fix_nvt_sllod.html">fix nvt/sllod</A>
<LI><A HREF = "fix_temp_berendsen.html">fix temp/berendsen</A>
<LI><A HREF = "fix_langevin.html">fix langevin</A>
<LI><A HREF = "fix_temp_rescale.html">fix temp/rescale</A>
<LI><A HREF = "pair_dpd.html">pair_style dpd/tstat</A>
</UL>
<P><A HREF = "fix_nh.html">Fix nvt</A> only thermostats the translational velocity of
particles. <A HREF = "fix_nvt_sllod.html">Fix nvt/sllod</A> also does this, except
that it subtracts out a velocity bias due to a deforming box and
integrates the SLLOD equations of motion. See the <A HREF = "#howto_13">NEMD
simulations</A> section of this page for further details. <A HREF = "fix_nvt_sphere.html">Fix
nvt/sphere</A> and <A HREF = "fix_nvt_asphere.html">fix
nvt/asphere</A> thermostat not only translation
velocities but also rotational velocities for spherical and aspherical
particles.
</P>
<P>DPD thermostatting alters pairwise interactions in a manner analagous
to the per-particle thermostatting of <A HREF = "fix_langevin.html">fix
langevin</A>.
</P>
<P>Any of the thermostatting fixes can use temperature computes that
remove bias for two purposes: (a) computing the current temperature to
compare to the requested target temperature, and (b) adjusting only
the thermal temperature component of the particle's velocities. See
the doc pages for the individual fixes and for the
<A HREF = "fix_modify.html">fix_modify</A> command for instructions on how to assign
a temperature compute to a thermostatting fix. For example, you can
apply a thermostat to only the x and z components of velocity by using
it in conjunction with <A HREF = "compute_temp_partial.html">compute
temp/partial</A>.
</P>
<P>IMPORTANT NOTE: Only the nvt fixes perform time integration, meaning
they update the velocities and positions of particles due to forces
and velocities respectively. The other thermostat fixes only adjust
velocities; they do NOT perform time integration updates. Thus they
should be used in conjunction with a constant NVE integration fix such
as these:
</P>
<UL><LI><A HREF = "fix_nve.html">fix nve</A>
<LI><A HREF = "fix_nve_sphere.html">fix nve/sphere</A>
<LI><A HREF = "fix_nve_asphere.html">fix nve/asphere</A>
</UL>
<P>Barostatting in LAMMPS is also performed by <A HREF = "fix.html">fixes</A>. Two
barosttating methods are currently available: Nose-Hoover (npt and
nph) and Berendsen:
</P>
<UL><LI><A HREF = "fix_nh.html">fix npt</A>
<LI><A HREF = "fix_npt_sphere.html">fix npt/sphere</A>
<LI><A HREF = "fix_npt_asphere.html">fix npt/asphere</A>
<LI><A HREF = "fix_nh.html">fix nph</A>
<LI><A HREF = "fix_press_berendsen.html">fix press/berendsen</A>
</UL>
<P>The <A HREF = "fix_nh.html">fix npt</A> commands include a Nose-Hoover thermostat
and barostat. <A HREF = "fix_nh.html">Fix nph</A> is just a Nose/Hoover barostat;
it does no thermostatting. Both <A HREF = "fix_nh.html">fix nph</A> and <A HREF = "fix_press_berendsen.html">fix
press/bernendsen</A> can be used in conjunction
with any of the thermostatting fixes.
</P>
<P>As with the thermostats, <A HREF = "fix_nh.html">fix npt</A> and <A HREF = "fix_nh.html">fix
nph</A> only use translational motion of the particles in
computing T and P and performing thermo/barostatting. <A HREF = "fix_npt_sphere.html">Fix
npt/sphere</A> and <A HREF = "fix_npt_asphere.html">fix
npt/asphere</A> thermo/barostat using not only
translation velocities but also rotational velocities for spherical
and aspherical particles.
</P>
<P>All of the barostatting fixes use the <A HREF = "compute_pressure.html">compute
pressure</A> compute to calculate a current
pressure. By default, this compute is created with a simple <A HREF = "compute_temp.html">compute
temp</A> (see the last argument of the <A HREF = "compute_pressure.html">compute
pressure</A> command), which is used to calculated
the kinetic componenet of the pressure. The barostatting fixes can
also use temperature computes that remove bias for the purpose of
computing the kinetic componenet which contributes to the current
pressure. See the doc pages for the individual fixes and for the
<A HREF = "fix_modify.html">fix_modify</A> command for instructions on how to assign
a temperature or pressure compute to a barostatting fix.
</P>
<P>IMPORTANT NOTE: As with the thermostats, the Nose/Hoover methods (<A HREF = "fix_nh.html">fix
npt</A> and <A HREF = "fix_nh.html">fix nph</A>) perform time
integration. <A HREF = "fix_press_berendsen.html">Fix press/berendsen</A> does NOT,
so it should be used with one of the constant NVE fixes or with one of
the NVT fixes.
</P>
<P>Finally, thermodynamic output, which can be setup via the
<A HREF = "thermo_style.html">thermo_style</A> command, often includes temperature
and pressure values. As explained on the doc page for the
<A HREF = "thermo_style.html">thermo_style</A> command, the default T and P are
setup by the thermo command itself. They are NOT the ones associated
with any thermostatting or barostatting fix you have defined or with
any compute that calculates a temperature or pressure. Thus if you
want to view these values of T and P, you need to specify them
explicitly via a <A HREF = "thermo_style.html">thermo_style custom</A> command. Or
you can use the <A HREF = "thermo_modify.html">thermo_modify</A> command to
re-define what temperature or pressure compute is used for default
thermodynamic output.
</P>
<HR>
<A NAME = "howto_17"></A><H4>6.17 Walls
</H4>
<P>Walls in an MD simulation are typically used to bound particle motion,
i.e. to serve as a boundary condition.
</P>
<P>Walls in LAMMPS can be of rough (made of particles) or idealized
surfaces. Ideal walls can be smooth, generating forces only in the
normal direction, or frictional, generating forces also in the
tangential direction.
</P>
<P>Rough walls, built of particles, can be created in various ways. The
particles themselves can be generated like any other particle, via the
<A HREF = "lattice.html">lattice</A> and <A HREF = "create_atoms.html">create_atoms</A> commands,
or read in via the <A HREF = "read_data.html">read_data</A> command.
</P>
<P>Their motion can be constrained by many different commands, so that
they do not move at all, move together as a group at constant velocity
or in response to a net force acting on them, move in a prescribed
fashion (e.g. rotate around a point), etc. Note that if a time
integration fix like <A HREF = "fix_nve.html">fix nve</A> or <A HREF = "fix_nh.html">fix nvt</A>
is not used with the group that contains wall particles, their
positions and velocities will not be updated.
</P>
<UL><LI><A HREF = "fix_aveforce.html">fix aveforce</A> - set force on particles to average value, so they move together
<LI><A HREF = "fix_setforce.html">fix setforce</A> - set force on particles to a value, e.g. 0.0
<LI><A HREF = "fix_freeze.html">fix freeze</A> - freeze particles for use as granular walls
<LI><A HREF = "fix_nve_noforce.html">fix nve/noforce</A> - advect particles by their velocity, but without force
<LI><A HREF = "fix_move.html">fix move</A> - prescribe motion of particles by a linear velocity, oscillation, rotation, variable
</UL>
<P>The <A HREF = "fix_move.html">fix move</A> command offers the most generality, since
the motion of individual particles can be specified with
<A HREF = "variable.html">variable</A> formula which depends on time and/or the
particle position.
</P>
<P>For rough walls, it may be useful to turn off pairwise interactions
between wall particles via the <A HREF = "neigh_modify.html">neigh_modify
exclude</A> command.
</P>
<P>Rough walls can also be created by specifying frozen particles that do
not move and do not interact with mobile particles, and then tethering
other particles to the fixed particles, via a <A HREF = "bond_style.html">bond</A>.
The bonded particles do interact with other mobile particles.
</P>
<P>Idealized walls can be specified via several fix commands. <A HREF = "fix_wall_gran.html">Fix
wall/gran</A> creates frictional walls for use with
granular particles; all the other commands create smooth walls.
</P>
<UL><LI><A HREF = "fix_wall_reflect.html">fix wall/reflect</A> - reflective flat walls
<LI><A HREF = "fix_wall.html">fix wall/lj93</A> - flat walls, with Lennard-Jones 9/3 potential
<LI><A HREF = "fix_wall.html">fix wall/lj126</A> - flat walls, with Lennard-Jones 12/6 potential
<LI><A HREF = "fix_wall.html">fix wall/colloid</A> - flat walls, with <A HREF = "pair_colloid.html">pair_style colloid</A> potential
<LI><A HREF = "fix_wall.html">fix wall/harmonic</A> - flat walls, with repulsive harmonic spring potential
<LI><A HREF = "fix_wall_region.html">fix wall/region</A> - use region surface as wall
<LI><A HREF = "fix_wall_gran.html">fix wall/gran</A> - flat or curved walls with <A HREF = "pair_gran.html">pair_style granular</A> potential
</UL>
<P>The <I>lj93</I>, <I>lj126</I>, <I>colloid</I>, and <I>harmonic</I> styles all allow the
flat walls to move with a constant velocity, or oscillate in time.
The <A HREF = "fix_wall_region.html">fix wall/region</A> command offers the most
generality, since the region surface is treated as a wall, and the
geometry of the region can be a simple primitive volume (e.g. a
sphere, or cube, or plane), or a complex volume made from the union
and intersection of primitive volumes. <A HREF = "region.html">Regions</A> can also
specify a volume "interior" or "exterior" to the specified primitive
shape or <I>union</I> or <I>intersection</I>. <A HREF = "region.html">Regions</A> can also be
"dynamic" meaning they move with constant velocity, oscillate, or
rotate.
</P>
<P>The only frictional idealized walls currently in LAMMPS are flat or
curved surfaces specified by the <A HREF = "fix_wall_gran.html">fix wall/gran</A>
command. At some point we plan to allow regoin surfaces to be used as
frictional walls, as well as triangulated surfaces.
</P>
<HR>
<A NAME = "howto_18"></A><H4>6.18 Elastic constants
</H4>
<P>Elastic constants characterize the stiffness of a material. The formal
definition is provided by the linear relation that holds between the
stress and strain tensors in the limit of infinitesimal deformation.
In tensor notation, this is expressed as s_ij = C_ijkl * e_kl, where
the repeated indices imply summation. s_ij are the elements of the
symmetric stress tensor. e_kl are the elements of the symmetric strain
tensor. C_ijkl are the elements of the fourth rank tensor of elastic
constants. In three dimensions, this tensor has 3^4=81 elements. Using
Voigt notation, the tensor can be written as a 6x6 matrix, where C_ij
is now the derivative of s_i w.r.t. e_j. Because s_i is itself a
derivative w.r.t. e_i, it follows that C_ij is also symmetric, with at
most 7*6/2 = 21 distinct elements.
</P>
<P>At zero temperature, it is easy to estimate these derivatives by
deforming the cell in one of the six directions using the command
<A HREF = "displace_box.html">displace_box</A> and measuring the change in the
stress tensor. A general-purpose script that does this is given in the
examples/elastic directory described in <A HREF = "Section_example.html">this
section</A>.
</P>
<P>Calculating elastic constants at finite temperature is more
challenging, because it is necessary to run a simulation that perfoms
time averages of differential properties. One way to do this is to
measure the change in average stress tensor in an NVT simulations when
the cell volume undergoes a finite deformation. In order to balance
the systematic and statistical errors in this method, the magnitude of
the deformation must be chosen judiciously, and care must be taken to
fully equilibrate the deformed cell before sampling the stress
tensor. Another approach is to sample the triclinic cell fluctuations
that occur in an NPT simulation. This method can also be slow to
converge and requires careful post-processing <A HREF = "#Shinoda">(Shinoda)</A>
</P>
<HR>
<A NAME = "howto_19"></A><H4>6.19 Library interface to LAMMPS
</H4>
-<P>As described in <A HREF = "Section_start.html#start_4">this section</A>, LAMMPS can
-be built as a library, so that it can be called by another code, used
-in a <A HREF = "Section_howto.html#howto_10">coupled manner</A> with other codes, or
-driven through a <A HREF = "Section_python.html">Python interface</A>.
+<P>As described in <A HREF = "Section_start.html#start_4">Section_start 4</A>, LAMMPS
+can be built as a library, so that it can be called by another code,
+used in a <A HREF = "Section_howto.html#howto_10">coupled manner</A> with other
+codes, or driven through a <A HREF = "Section_python.html">Python interface</A>.
</P>
<P>All of these methodologies use a C-style interface to LAMMPS that is
provided in the files src/library.cpp and src/library.h. The
functions therein have a C-style argument list, but contain C++ code
you could write yourself in a C++ application that was invoking LAMMPS
directly. The C++ code in the functions illustrates how to invoke
internal LAMMPS operations. Note that LAMMPS classes are defined
within a LAMMPS namespace (LAMMPS_NS) if you use them from another C++
application.
</P>
<P>Library.cpp contains these 4 functions:
</P>
<PRE>void lammps_open(int, char **, MPI_Comm, void **);
void lammps_close(void *);
void lammps_file(void *, char *);
char *lammps_command(void *, char *);
</PRE>
<P>The lammps_open() function is used to initialize LAMMPS, passing in a
list of strings as if they were <A HREF = "Section_start.html#start_6">command-line
arguments</A> when LAMMPS is run in
stand-alone mode from the command line, and a MPI communicator for
LAMMPS to run under. It returns a ptr to the LAMMPS object that is
created, and which is used in subsequent library calls. The
lammps_open() function can be called multiple times, to create
multiple instances of LAMMPS.
</P>
<P>LAMMPS will run on the set of processors in the communicator. This
means the calling code can run LAMMPS on all or a subset of
processors. For example, a wrapper script might decide to alternate
between LAMMPS and another code, allowing them both to run on all the
processors. Or it might allocate half the processors to LAMMPS and
half to the other code and run both codes simultaneously before
syncing them up periodically. Or it might instantiate multiple
instances of LAMMPS to perform different calculations.
</P>
<P>The lammps_close() function is used to shut down an instance of LAMMPS
and free all its memory.
</P>
<P>The lammps_file() and lammps_command() functions are used to pass a
file or string to LAMMPS as if it were an input script or single
command in an input script. Thus the calling code can read or
generate a series of LAMMPS commands one line at a time and pass it
thru the library interface to setup a problem and then run it,
interleaving the lammps_command() calls with other calls to extract
information from LAMMPS, perform its own operations, or call another
code's library.
</P>
<P>Other useful functions are also included in library.cpp. For example:
</P>
<PRE>void *lammps_extract_global(void *, char *)
void *lammps_extract_atom(void *, char *)
void *lammps_extract_compute(void *, char *, int, int)
void *lammps_extract_fix(void *, char *, int, int, int, int)
void *lammps_extract_variable(void *, char *, char *)
int lammps_get_natoms(void *)
void lammps_get_coords(void *, double *)
void lammps_put_coords(void *, double *)
</PRE>
<P>These can extract various global or per-atom quantities from LAMMPS as
well as values calculated by a compute, fix, or variable. The "get"
and "put" operations can retrieve and reset atom coordinates.
See the library.cpp file and its associated header file library.h for
details.
</P>
<P>The key idea of the library interface is that you can write any
functions you wish to define how your code talks to LAMMPS and add
them to src/library.cpp and src/library.h, as well as to the <A HREF = "Section_python.html">Python
interface</A>. The routines you add can access
or change any LAMMPS data you wish. The couple and python directories
have example C++ and C and Python codes which show how a driver code
can link to LAMMPS as a library, run LAMMPS on a subset of processors,
grab data from LAMMPS, change it, and put it back into LAMMPS.
</P>
<HR>
<A NAME = "howto_20"></A><H4>6.20 Calculating thermal conductivity
</H4>
<P>The thermal conductivity kappa of a material can be measured in at
least 3 ways using various options in LAMMPS. (See <A HREF = "Section_howto.html#howto_21">this
section</A> of the manual for an analogous
discussion for viscosity). The thermal conducitivity tensor kappa is
a measure of the propensity of a material to transmit heat energy in a
diffusive manner as given by Fourier's law
</P>
<P>J = -kappa grad(T)
</P>
<P>where J is the heat flux in units of energy per area per time and
grad(T) is the spatial gradient of temperature. The thermal
conductivity thus has units of energy per distance per time per degree
K and is often approximated as an isotropic quantity, i.e. as a
scalar.
</P>
<P>The first method is to setup two thermostatted regions at opposite
ends of a simulation box, or one in the middle and one at the end of a
periodic box. By holding the two regions at different temperatures
with a <A HREF = "Section_howto.html#howto_13">thermostatting fix</A>, the energy added
to the hot region should equal the energy subtracted from the cold
region and be proportional to the heat flux moving between the
regions. See the paper by <A HREF = "#Ikeshoji">Ikeshoji and Hafskjold</A> for
details of this idea. Note that thermostatting fixes such as <A HREF = "fix_nh.html">fix
nvt</A>, <A HREF = "fix_langevin.html">fix langevin</A>, and <A HREF = "fix_temp_rescale.html">fix
temp/rescale</A> store the cumulative energy they
add/subtract. Alternatively, the <A HREF = "fix_heat.html">fix heat</A> command can
used in place of thermostats on each of two regions, and the resulting
temperatures of the two regions monitored with the "compute
temp/region" command or the temperature profile of the intermediate
region monitored with the <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> and
<A HREF = "compute_ke_atom.html">compute ke/atom</A> commands.
</P>
<P>The second method is to perform a reverse non-equilibrium MD
simulation using the <A HREF = "fix_thermal_conductivity.html">fix
thermal/conductivity</A> command which
implements the rNEMD algorithm of Muller-Plathe. Kinetic energy is
swapped between atoms in two different layers of the simulation box.
This induces a temperature gradient between the two layers which can
be monitored with the <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> and
<A HREF = "compute_ke_atom.html">compute ke/atom</A> commands. The fix tallies the
cumulative energy transfer that it performs. See the <A HREF = "fix_thermal_conductivity.html">fix
thermal/conductivity</A> command for
details.
</P>
<P>The third method is based on the Green-Kubo (GK) formula which relates
the ensemble average of the auto-correlation of the heat flux to
kappa. The heat flux can be calculated from the fluctuations of
per-atom potential and kinetic energies and per-atom stress tensor in
a steady-state equilibrated simulation. This is in contrast to the
two preceding non-equilibrium methods, where energy flows continuously
between hot and cold regions of the simulation box.
</P>
<P>The <A HREF = "compute_heat_flux.html">compute heat/flux</A> command can calculate
the needed heat flux and describes how to implement the Green_Kubo
formalism using additional LAMMPS commands, such as the <A HREF = "fix_ave_correlate.html">fix
ave/correlate</A> command to calculate the needed
auto-correlation. See the doc page for the <A HREF = "compute_heat_flux.html">compute
heat/flux</A> command for an example input script
that calculates the thermal conductivity of solid Ar via the GK
formalism.
</P>
<HR>
<A NAME = "howto_21"></A><H4>6.21 Calculating viscosity
</H4>
<P>The shear viscosity eta of a fluid can be measured in at least 3 ways
using various options in LAMMPS. (See <A HREF = "Section_howto.html#howto_20">this
section</A> of the manual for an analogous
discussion for thermal conductivity). Eta is a measure of the
propensity of a fluid to transmit momentum in a direction
perpendicular to the direction of velocity or momentum flow.
Alternatively it is the resistance the fluid has to being sheared. It
is given by
</P>
<P>J = -eta grad(Vstream)
</P>
<P>where J is the momentum flux in units of momentum per area per time.
and grad(Vstream) is the spatial gradient of the velocity of the fluid
moving in another direction, normal to the area through which the
momentum flows. Viscosity thus has units of pressure-time.
</P>
<P>The first method is to perform a non-equlibrium MD (NEMD) simulation
by shearing the simulation box via the <A HREF = "fix_deform.html">fix deform</A>
command, and using the <A HREF = "fix_nvt_sllod.html">fix nvt/sllod</A> command to
thermostat the fluid via the SLLOD equations of motion. The velocity
profile setup in the fluid by this procedure can be monitored by the
<A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command, which determines
grad(Vstream) in the equation above. E.g. the derivative in the
y-direction of the Vx component of fluid motion or grad(Vstream) =
dVx/dy. In this case, the Pxy off-diagonal component of the pressure
or stress tensor, as calculated by the <A HREF = "compute_pressure.html">compute
pressure</A> command, can also be monitored, which
is the J term in the equation above. See <A HREF = "Section_howto.html#howto_13">this
section</A> of the manual for details on NEMD
simulations.
</P>
<P>The second method is to perform a reverse non-equilibrium MD
simulation using the <A HREF = "fix_viscosity.html">fix viscosity</A> command which
implements the rNEMD algorithm of Muller-Plathe. Momentum in one
dimension is swapped between atoms in two different layers of the
simulation box in a different dimension. This induces a velocity
gradient which can be monitored with the <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> command. The fix tallies the
cummulative momentum transfer that it performs. See the <A HREF = "fix_viscosity.html">fix
viscosity</A> command for details.
</P>
<P>The third method is based on the Green-Kubo (GK) formula which relates
the ensemble average of the auto-correlation of the stress/pressure
tensor to eta. This can be done in a steady-state equilibrated
simulation which is in contrast to the two preceding non-equilibrium
methods, where momentum flows continuously through the simulation box.
</P>
<P>Here is an example input script that calculates the viscosity of
liquid Ar via the GK formalism:
</P>
<PRE># Sample LAMMPS input script for viscosity of liquid Ar
</PRE>
<PRE>units real
variable T equal 86.4956
variable V equal vol
variable dt equal 4.0
variable p equal 400 # correlation length
variable s equal 5 # sample interval
variable d equal $p*$s # dump interval
</PRE>
<PRE># convert from LAMMPS real units to SI
</PRE>
<PRE>variable kB equal 1.3806504e-23 # [J/K/</B> Boltzmann
variable atm2Pa equal 101325.0
variable A2m equal 1.0e-10
variable fs2s equal 1.0e-15
variable convert equal ${atm2Pa}*${atm2Pa}*${fs2s}*${A2m}*${A2m}*${A2m}
</PRE>
<PRE># setup problem
</PRE>
<PRE>dimension 3
boundary p p p
lattice fcc 5.376 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
region box block 0 4 0 4 0 4
create_box 1 box
create_atoms 1 box
mass 1 39.948
pair_style lj/cut 13.0
pair_coeff * * 0.2381 3.405
timestep ${dt}
thermo $d
</PRE>
<PRE># equilibration and thermalization
</PRE>
<PRE>velocity all create $T 102486 mom yes rot yes dist gaussian
fix NVT all nvt temp $T $T 10 drag 0.2
run 8000
</PRE>
<PRE># viscosity calculation, switch to NVE if desired
</PRE>
<PRE>#unfix NVT
#fix NVE all nve
</PRE>
<PRE>reset_timestep 0
variable pxy equal pxy
variable pxz equal pxz
variable pyz equal pyz
fix SS all ave/correlate $s $p $d &
v_pxy v_pxz v_pyz type auto file S0St.dat ave running
variable scale equal ${convert}/(${kB}*$T)*$V*$s*${dt}
variable v11 equal trap(f_SS[3/</B>)*${scale}
variable v22 equal trap(f_SS[4/</B>)*${scale}
variable v33 equal trap(f_SS[5/</B>)*${scale}
thermo_style custom step temp press v_pxy v_pxz v_pyz v_v11 v_v22 v_v33
run 100000
variable v equal (v_v11+v_v22+v_v33)/3.0
variable ndens equal count(all)/vol
print "average viscosity: $v [Pa.s/</B> @ $T K, ${ndens} /A^3"
</PRE>
<HR>
<HR>
<A NAME = "Berendsen"></A>
<P><B>(Berendsen)</B> Berendsen, Grigera, Straatsma, J Phys Chem, 91,
6269-6271 (1987).
</P>
<A NAME = "Cornell"></A>
<P><B>(Cornell)</B> Cornell, Cieplak, Bayly, Gould, Merz, Ferguson,
Spellmeyer, Fox, Caldwell, Kollman, JACS 117, 5179-5197 (1995).
</P>
<A NAME = "Horn"></A>
<P><B>(Horn)</B> Horn, Swope, Pitera, Madura, Dick, Hura, and Head-Gordon,
J Chem Phys, 120, 9665 (2004).
</P>
<A NAME = "Ikeshoji"></A>
<P><B>(Ikeshoji)</B> Ikeshoji and Hafskjold, Molecular Physics, 81, 251-261
(1994).
</P>
<A NAME = "MacKerell"></A>
<P><B>(MacKerell)</B> MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field,
Fischer, Gao, Guo, Ha, et al, J Phys Chem, 102, 3586 (1998).
</P>
<A NAME = "Mayo"></A>
<P><B>(Mayo)</B> Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
(1990).
</P>
<A NAME = "Jorgensen"></A>
<P><B>(Jorgensen)</B> Jorgensen, Chandrasekhar, Madura, Impey, Klein, J Chem
Phys, 79, 926 (1983).
</P>
<A NAME = "Price"></A>
<P><B>(Price)</B> Price and Brooks, J Chem Phys, 121, 10096 (2004).
</P>
<A NAME = "Shinoda"></A>
<P><B>(Shinoda)</B> Shinoda, Shiga, and Mikami, Phys Rev B, 69, 134103 (2004).
</P>
</HTML>
diff --git a/doc/Section_howto.txt b/doc/Section_howto.txt
index 00da9985a..50c24d8b8 100644
--- a/doc/Section_howto.txt
+++ b/doc/Section_howto.txt
@@ -1,1938 +1,1938 @@
"Previous Section"_Section_accelerate.html - "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next Section"_Section_example.html :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
6. How-to discussions :h3
This section describes how to perform common tasks using LAMMPS.
6.1 "Restarting a simulation"_#howto_1
6.2 "2d simulations"_#howto_2
6.3 "CHARMM, AMBER, and DREIDING force fields"_#howto_3
6.4 "Running multiple simulations from one input script"_#howto_4
6.5 "Multi-replica simulations"_#howto_5
6.6 "Granular models"_#howto_6
6.7 "TIP3P water model"_#howto_7
6.8 "TIP4P water model"_#howto_8
6.9 "SPC water model"_#howto_9
6.10 "Coupling LAMMPS to other codes"_#howto_10
6.11 "Visualizing LAMMPS snapshots"_#howto_11
6.12 "Triclinic (non-orthogonal) simulation boxes"_#howto_12
6.13 "NEMD simulations"_#howto_13
6.14 "Extended spherical and aspherical particles"_#howto_14
6.15 "Output from LAMMPS (thermo, dumps, computes, fixes, variables)"_#howto_15
6.16 "Thermostatting, barostatting and computing temperature"_#howto_16
6.17 "Walls"_#howto_17
6.18 "Elastic constants"_#howto_18
6.19 "Library interface to LAMMPS"_#howto_19
6.20 "Calculating thermal conductivity"_#howto_20
6.21 "Calculating viscosity"_#howto_21 :all(b)
The example input scripts included in the LAMMPS distribution and
-highlighted in "this section"_Section_example.html also show how to
+highlighted in "Section_example"_Section_example.html also show how to
setup and run various kinds of simulations.
:line
:line
6.1 Restarting a simulation :link(howto_1),h4
There are 3 ways to continue a long LAMMPS simulation. Multiple
"run"_run.html commands can be used in the same input script. Each
run will continue from where the previous run left off. Or binary
restart files can be saved to disk using the "restart"_restart.html
command. At a later time, these binary files can be read via a
"read_restart"_read_restart.html command in a new script. Or they can
be converted to text data files and read by a
"read_data"_read_data.html command in a new script. "This
section"_Section_tools.html discusses the {restart2data} tool that is
used to perform the conversion.
Here we give examples of 2 scripts that read either a binary restart
file or a converted data file and then issue a new run command to
continue where the previous run left off. They illustrate what
settings must be made in the new script. Details are discussed in the
documentation for the "read_restart"_read_restart.html and
"read_data"_read_data.html commands.
Look at the {in.chain} input script provided in the {bench} directory
of the LAMMPS distribution to see the original script that these 2
scripts are based on. If that script had the line
restart 50 tmp.restart :pre
added to it, it would produce 2 binary restart files (tmp.restart.50
and tmp.restart.100) as it ran.
This script could be used to read the 1st restart file and re-run the
last 50 timesteps:
read_restart tmp.restart.50 :pre
neighbor 0.4 bin
neigh_modify every 1 delay 1 :pre
fix 1 all nve
fix 2 all langevin 1.0 1.0 10.0 904297 :pre
timestep 0.012 :pre
run 50 :pre
Note that the following commands do not need to be repeated because
their settings are included in the restart file: {units, atom_style,
special_bonds, pair_style, bond_style}. However these commands do
need to be used, since their settings are not in the restart file:
{neighbor, fix, timestep}.
If you actually use this script to perform a restarted run, you will
notice that the thermodynamic data match at step 50 (if you also put a
"thermo 50" command in the original script), but do not match at step
100. This is because the "fix langevin"_fix_langevin.html command
uses random numbers in a way that does not allow for perfect restarts.
As an alternate approach, the restart file could be converted to a data
file using this tool:
restart2data tmp.restart.50 tmp.restart.data :pre
Then, this script could be used to re-run the last 50 steps:
units lj
atom_style bond
pair_style lj/cut 1.12
pair_modify shift yes
bond_style fene
special_bonds 0.0 1.0 1.0 :pre
read_data tmp.restart.data :pre
neighbor 0.4 bin
neigh_modify every 1 delay 1 :pre
fix 1 all nve
fix 2 all langevin 1.0 1.0 10.0 904297 :pre
timestep 0.012 :pre
reset_timestep 50
run 50 :pre
Note that nearly all the settings specified in the original {in.chain}
script must be repeated, except the {pair_coeff} and {bond_coeff}
commands since the new data file lists the force field coefficients.
Also, the "reset_timestep"_reset_timestep.html command is used to tell
LAMMPS the current timestep. This value is stored in restart files,
but not in data files.
:line
6.2 2d simulations :link(howto_2),h4
Use the "dimension"_dimension.html command to specify a 2d simulation.
Make the simulation box periodic in z via the "boundary"_boundary.html
command. This is the default.
If using the "create box"_create_box.html command to define a
simulation box, set the z dimensions narrow, but finite, so that the
create_atoms command will tile the 3d simulation box with a single z
plane of atoms - e.g.
"create box"_create_box.html 1 -10 10 -10 10 -0.25 0.25 :pre
If using the "read data"_read_data.html command to read in a file of
atom coordinates, set the "zlo zhi" values to be finite but narrow,
similar to the create_box command settings just described. For each
atom in the file, assign a z coordinate so it falls inside the
z-boundaries of the box - e.g. 0.0.
Use the "fix enforce2d"_fix_enforce2d.html command as the last
defined fix to insure that the z-components of velocities and forces
are zeroed out every timestep. The reason to make it the last fix is
so that any forces induced by other fixes will be zeroed out.
Many of the example input scripts included in the LAMMPS distribution
are for 2d models.
IMPORTANT NOTE: Some models in LAMMPS treat particles as extended
spheres, as opposed to point particles. In 2d, the particles will
still be spheres, not disks, meaning their moment of inertia will be
the same as in 3d.
:line
6.3 CHARMM, AMBER, and DREIDING force fields :link(howto_3),h4
A force field has 2 parts: the formulas that define it and the
coefficients used for a particular system. Here we only discuss
formulas implemented in LAMMPS that correspond to formulas commonly
used in the CHARMM, AMBER, and DREIDING force fields. Setting
coefficients is done in the input data file via the
"read_data"_read_data.html command or in the input script with
commands like "pair_coeff"_pair_coeff.html or
-"bond_coeff"_bond_coeff.html. See "this section"_Section_tools.html
+"bond_coeff"_bond_coeff.html. See "Section_tools"_Section_tools.html
for additional tools that can use CHARMM or AMBER to assign force
field coefficients and convert their output into LAMMPS input.
See "(MacKerell)"_#MacKerell for a description of the CHARMM force
field. See "(Cornell)"_#Cornell for a description of the AMBER force
field.
:link(charmm,http://www.scripps.edu/brooks)
:link(amber,http://amber.scripps.edu)
These style choices compute force field formulas that are consistent
with common options in CHARMM or AMBER. See each command's
documentation for the formula it computes.
"bond_style"_bond_harmonic.html harmonic
"angle_style"_angle_charmm.html charmm
"dihedral_style"_dihedral_charmm.html charmm
"pair_style"_pair_charmm.html lj/charmm/coul/charmm
"pair_style"_pair_charmm.html lj/charmm/coul/charmm/implicit
"pair_style"_pair_charmm.html lj/charmm/coul/long :ul
"special_bonds"_special_bonds.html charmm
"special_bonds"_special_bonds.html amber :ul
DREIDING is a generic force field developed by the "Goddard
group"_http://www.wag.caltech.edu at Caltech and is useful for
predicting structures and dynamics of organic, biological and
main-group inorganic molecules. The philosophy in DREIDING is to use
general force constants and geometry parameters based on simple
hybridization considerations, rather than individual force constants
and geometric parameters that depend on the particular combinations of
atoms involved in the bond, angle, or torsion terms. DREIDING has an
"explicit hydrogen bond term"_pair_hbond_dreiding.html to describe
interactions involving a hydrogen atom on very electronegative atoms
(N, O, F).
See "(Mayo)"_#Mayo for a description of the DREIDING force field
These style choices compute force field formulas that are consistent
with the DREIDING force field. See each command's
documentation for the formula it computes.
"bond_style"_bond_harmonic.html harmonic
"bond_style"_bond_morse.html morse :ul
"angle_style"_angle_harmonic.html harmonic
"angle_style"_angle_cosine.html cosine
"angle_style"_angle_cosine_periodic.html cosine/periodic :ul
"dihedral_style"_dihedral_charmm.html charmm
"improper_style"_improper_umbrella.html umbrella :ul
"pair_style"_pair_buck.html buck
"pair_style"_pair_buck.html buck/coul/cut
"pair_style"_pair_buck.html buck/coul/long
"pair_style"_pair_lj.html lj/cut
"pair_style"_pair_lj.html lj/cut/coul/cut
"pair_style"_pair_lj.html lj/cut/coul/long :ul
"pair_style"_pair_hbond_dreiding.html hbond/dreiding/lj
"pair_style"_pair_hbond_dreiding.html hbond/dreiding/morse :ul
"special_bonds"_special_bonds.html dreiding :ul
:line
6.4 Running multiple simulations from one input script :link(howto_4),h4
This can be done in several ways. See the documentation for
individual commands for more details on how these examples work.
If "multiple simulations" means continue a previous simulation for
more timesteps, then you simply use the "run"_run.html command
multiple times. For example, this script
units lj
atom_style atomic
read_data data.lj
run 10000
run 10000
run 10000
run 10000
run 10000 :pre
would run 5 successive simulations of the same system for a total of
50,000 timesteps.
If you wish to run totally different simulations, one after the other,
the "clear"_clear.html command can be used in between them to
re-initialize LAMMPS. For example, this script
units lj
atom_style atomic
read_data data.lj
run 10000
clear
units lj
atom_style atomic
read_data data.lj.new
run 10000 :pre
would run 2 independent simulations, one after the other.
For large numbers of independent simulations, you can use
"variables"_variable.html and the "next"_next.html and
"jump"_jump.html commands to loop over the same input script
multiple times with different settings. For example, this
script, named in.polymer
variable d index run1 run2 run3 run4 run5 run6 run7 run8
shell cd $d
read_data data.polymer
run 10000
shell cd ..
clear
next d
jump in.polymer :pre
would run 8 simulations in different directories, using a data.polymer
file in each directory. The same concept could be used to run the
same system at 8 different temperatures, using a temperature variable
and storing the output in different log and dump files, for example
variable a loop 8
variable t index 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15
log log.$a
read data.polymer
velocity all create $t 352839
fix 1 all nvt $t $t 100.0
dump 1 all atom 1000 dump.$a
run 100000
next t
next a
jump in.polymer :pre
All of the above examples work whether you are running on 1 or
multiple processors, but assumed you are running LAMMPS on a single
partition of processors. LAMMPS can be run on multiple partitions via
the "-partition" command-line switch as described in "this
section"_Section_start.html#start_6 of the manual.
In the last 2 examples, if LAMMPS were run on 3 partitions, the same
scripts could be used if the "index" and "loop" variables were
replaced with {universe}-style variables, as described in the
"variable"_variable.html command. Also, the "next t" and "next a"
commands would need to be replaced with a single "next a t" command.
With these modifications, the 8 simulations of each script would run
on the 3 partitions one after the other until all were finished.
Initially, 3 simulations would be started simultaneously, one on each
partition. When one finished, that partition would then start
the 4th simulation, and so forth, until all 8 were completed.
:line
6.5 Multi-replica simulations :link(howto_5),h4
Several commands in LAMMPS run mutli-replica simulations, meaning
that multiple instances (replicas) of your simulation are run
simultaneously, with small amounts of data exchanged between replicas
periodically.
These are the relevant commands:
"neb"_neb.html for nudged elastic band calculations
"prd"_prd.html for parallel replica dynamics
"tad"_tad.html for temperature accelerated dynamics
"temper"_temper.html for parallel tempering :ul
NEB is a method for finding transition states and barrier energies.
PRD and TAD are methods for performing accelerated dynamics to find
and perform infrequent events. Parallel tempering or replica exchange
runs different replicas at a series of temperature to facilitate
rare-event sampling.
These command can only be used if LAMMPS was built with the "replica"
package. See the "Making LAMMPS"_Section_start.html#start_3 section
for more info on packages.
In all these cases, you must run with one or more processors per
replica. The processors assigned to each replica are determined at
run-time by using the "-partition command-line
switch"_Section_start.html#start_6 to launch LAMMPS on multiple
partitions, which in this context are the same as replicas. E.g.
these commands:
mpirun -np 16 lmp_linux -partition 8x2 -in in.temper
mpirun -np 8 lmp_linux -partition 8x1 -in in.neb :pre
would each run 8 replicas, on either 16 or 8 processors. Note the use
of the "-in command-line switch"_Section_start.html#start_6 to specify
the input script which is required when running in multi-replica mode.
Also note that with MPI installed on a machine (e.g. your desktop),
you can run on more (virtual) processors than you have physical
processors. Thus the above commands could be run on a
single-processor (or few-processor) desktop so that you can run
a multi-replica simulation on more replicas than you have
physical processors.
:line
6.6 Granular models :link(howto_6),h4
Granular system are composed of spherical particles with a diameter,
as opposed to point particles. This means they have an angular
velocity and torque can be imparted to them to cause them to rotate.
To run a simulation of a granular model, you will want to use
the following commands:
"atom_style sphere"_atom_style.html
"fix nve/sphere"_fix_nve_sphere.html
"fix gravity"_fix_gravity.html :ul
This compute
"compute erotate/sphere"_compute_erotate_sphere.html :ul
calculates rotational kinetic energy which can be "output with
thermodynamic info"_Section_howto.html#howto_15.
Use one of these 3 pair potentials, which compute forces and torques
between interacting pairs of particles:
"pair_style"_pair_style.html gran/history
"pair_style"_pair_style.html gran/no_history
"pair_style"_pair_style.html gran/hertzian :ul
These commands implement fix options specific to granular systems:
"fix freeze"_fix_freeze.html
"fix pour"_fix_pour.html
"fix viscous"_fix_viscous.html
"fix wall/gran"_fix_wall_gran.html :ul
The fix style {freeze} zeroes both the force and torque of frozen
atoms, and should be used for granular system instead of the fix style
{setforce}.
For computational efficiency, you can eliminate needless pairwise
computations between frozen atoms by using this command:
"neigh_modify"_neigh_modify.html exclude :ul
:line
6.7 TIP3P water model :link(howto_7),h4
The TIP3P water model as implemented in CHARMM
"(MacKerell)"_#MacKerell specifies a 3-site rigid water molecule with
charges and Lennard-Jones parameters assigned to each of the 3 atoms.
In LAMMPS the "fix shake"_fix_shake.html command can be used to hold
the two O-H bonds and the H-O-H angle rigid. A bond style of
{harmonic} and an angle style of {harmonic} or {charmm} should also be
used.
These are the additional parameters (in real units) to set for O and H
atoms and the water molecule to run a rigid TIP3P-CHARMM model with a
cutoff. The K values can be used if a flexible TIP3P model (without
fix shake) is desired. If the LJ epsilon and sigma for HH and OH are
set to 0.0, it corresponds to the original 1983 TIP3P model
"(Jorgensen)"_#Jorgensen.
O mass = 15.9994
H mass = 1.008 :all(b),p
O charge = -0.834
H charge = 0.417 :all(b),p
LJ epsilon of OO = 0.1521
LJ sigma of OO = 3.1507
LJ epsilon of HH = 0.0460
LJ sigma of HH = 0.4000
LJ epsilon of OH = 0.0836
LJ sigma of OH = 1.7753 :all(b),p
K of OH bond = 450
r0 of OH bond = 0.9572 :all(b),p
K of HOH angle = 55
theta of HOH angle = 104.52 :all(b),p
These are the parameters to use for TIP3P with a long-range Coulombic
solver (Ewald or PPPM in LAMMPS), see "(Price)"_#Price for details:
O mass = 15.9994
H mass = 1.008 :all(b),p
O charge = -0.830
H charge = 0.415 :all(b),p
LJ epsilon of OO = 0.102
LJ sigma of OO = 3.188
LJ epsilon, sigma of OH, HH = 0.0 :all(b),p
K of OH bond = 450
r0 of OH bond = 0.9572 :all(b),p
K of HOH angle = 55
theta of HOH angle = 104.52 :all(b),p
Wikipedia also has a nice article on "water
models"_http://en.wikipedia.org/wiki/Water_model.
:line
6.8 TIP4P water model :link(howto_8),h4
The four-point TIP4P rigid water model extends the traditional
three-point TIP3P model by adding an additional site, usually
massless, where the charge associated with the oxygen atom is placed.
This site M is located at a fixed distance away from the oxygen along
the bisector of the HOH bond angle. A bond style of {harmonic} and an
angle style of {harmonic} or {charmm} should also be used.
Currently, only a four-point model for long-range Coulombics is
implemented via the LAMMPS "pair style
lj/cut/coul/long/tip4p"_pair_lj.html. A cutoff version may be added
the future. For both models, the bond lengths and bond angles should
be held fixed using the "fix shake"_fix_shake.html command.
These are the additional parameters (in real units) to set for O and H
atoms and the water molecule to run a rigid TIP4P model with a cutoff
"(Jorgensen)"_#Jorgensen. Note that the OM distance is specified in
the "pair_style"_pair_style.html command, not as part of the pair
coefficients.
O mass = 15.9994
H mass = 1.008 :all(b),p
O charge = -1.040
H charge = 0.520 :all(b),p
r0 of OH bond = 0.9572
theta of HOH angle = 104.52 :all(b),p
OM distance = 0.15 :all(b),p
LJ epsilon of O-O = 0.1550
LJ sigma of O-O = 3.1536
LJ epsilon, sigma of OH, HH = 0.0 :all(b),p
These are the parameters to use for TIP4P with a long-range Coulombic
solver (Ewald or PPPM in LAMMPS):
O mass = 15.9994
H mass = 1.008 :all(b),p
O charge = -1.0484
H charge = 0.5242 :all(b),p
r0 of OH bond = 0.9572
theta of HOH angle = 104.52 :all(b),p
OM distance = 0.1250 :all(b),p
LJ epsilon of O-O = 0.16275
LJ sigma of O-O = 3.16435
LJ epsilon, sigma of OH, HH = 0.0 :all(b),p
Wikipedia also has a nice article on "water
models"_http://en.wikipedia.org/wiki/Water_model.
:line
6.9 SPC water model :link(howto_9),h4
The SPC water model specifies a 3-site rigid water molecule with
charges and Lennard-Jones parameters assigned to each of the 3 atoms.
In LAMMPS the "fix shake"_fix_shake.html command can be used to hold
the two O-H bonds and the H-O-H angle rigid. A bond style of
{harmonic} and an angle style of {harmonic} or {charmm} should also be
used.
These are the additional parameters (in real units) to set for O and H
atoms and the water molecule to run a rigid SPC model.
O mass = 15.9994
H mass = 1.008 :all(b),p
O charge = -0.820
H charge = 0.410 :all(b),p
LJ epsilon of OO = 0.1553
LJ sigma of OO = 3.166
LJ epsilon, sigma of OH, HH = 0.0 :all(b),p
r0 of OH bond = 1.0
theta of HOH angle = 109.47 :all(b),p
Note that as originally proposed, the SPC model was run with a 9
Angstrom cutoff for both LJ and Coulommbic terms. It can also be used
with long-range Coulombics (Ewald or PPPM in LAMMPS), without changing
any of the parameters above, though it becomes a different model in
that mode of usage.
The SPC/E (extended) water model is the same, except
the partial charge assignemnts change:
O charge = -0.8476
H charge = 0.4238 :all(b),p
See the "(Berendsen)"_#Berendsen reference for more details on both
the SPC and SPC/E models.
Wikipedia also has a nice article on "water
models"_http://en.wikipedia.org/wiki/Water_model.
:line
6.10 Coupling LAMMPS to other codes :link(howto_10),h4
LAMMPS is designed to allow it to be coupled to other codes. For
example, a quantum mechanics code might compute forces on a subset of
atoms and pass those forces to LAMMPS. Or a continuum finite element
(FE) simulation might use atom positions as boundary conditions on FE
nodal points, compute a FE solution, and return interpolated forces on
MD atoms.
LAMMPS can be coupled to other codes in at least 3 ways. Each has
advantages and disadvantages, which you'll have to think about in the
context of your application.
(1) Define a new "fix"_fix.html command that calls the other code. In
this scenario, LAMMPS is the driver code. During its timestepping,
the fix is invoked, and can make library calls to the other code,
which has been linked to LAMMPS as a library. This is the way the
"POEMS"_poems package that performs constrained rigid-body motion on
groups of atoms is hooked to LAMMPS. See the
"fix_poems"_fix_poems.html command for more details. See "this
section"_Section_modify.html of the documentation for info on how to add
a new fix to LAMMPS.
:link(poems,http://www.rpi.edu/~anderk5/lab)
(2) Define a new LAMMPS command that calls the other code. This is
conceptually similar to method (1), but in this case LAMMPS and the
other code are on a more equal footing. Note that now the other code
is not called during the timestepping of a LAMMPS run, but between
runs. The LAMMPS input script can be used to alternate LAMMPS runs
with calls to the other code, invoked via the new command. The
"run"_run.html command facilitates this with its {every} option, which
makes it easy to run a few steps, invoke the command, run a few steps,
invoke the command, etc.
In this scenario, the other code can be called as a library, as in
(1), or it could be a stand-alone code, invoked by a system() call
made by the command (assuming your parallel machine allows one or more
processors to start up another program). In the latter case the
stand-alone code could communicate with LAMMPS thru files that the
command writes and reads.
-See "this section"_Section_modify.html of the documentation for how to
-add a new command to LAMMPS.
+See "Section_modify"_Section_modify.html of the documentation for how
+to add a new command to LAMMPS.
(3) Use LAMMPS as a library called by another code. In this case the
other code is the driver and calls LAMMPS as needed. Or a wrapper
code could link and call both LAMMPS and another code as libraries.
Again, the "run"_run.html command has options that allow it to be
invoked with minimal overhead (no setup or clean-up) if you wish to do
multiple short runs, driven by another program.
Examples of driver codes that call LAMMPS as a library are included in
the "couple" directory of the LAMMPS distribution; see couple/README
for more details:
simple: simple driver programs in C++ and C which invoke LAMMPS as a
library :ulb,l
lammps_quest: coupling of LAMMPS and "Quest"_quest, to run classical
MD with quantum forces calculated by a density functional code :l
lammps_spparks: coupling of LAMMPS and "SPPARKS"_spparks, to couple
a kinetic Monte Carlo model for grain growth using MD to calculate
strain induced across grain boundaries :l,ule
:link(quest,http://dft.sandia.gov/Quest)
:link(spparks,http://www.sandia.gov/~sjplimp/spparks.html)
"This section"_Section_start.html#start_4 of the documentation
describes how to build LAMMPS as a library. Once this is done, you
can interface with LAMMPS either via C++, C, Fortran, or Python (or
any other language that supports a vanilla C-like interface). For
example, from C++ you could create one (or more) "instances" of
LAMMPS, pass it an input script to process, or execute individual
commands, all by invoking the correct class methods in LAMMPS. From C
or Fortran you can make function calls to do the same things. See
-"this section"_Section_python.html of the manual for a description of
-the Python wrapper provided with LAMMPS that operates through the
+"Section_python"_Section_python.html of the manual for a description
+of the Python wrapper provided with LAMMPS that operates through the
LAMMPS library interface.
The files src/library.cpp and library.h contain the C-style interface
-to LAMMPS. See "this section"_Section_howto.html#howto_19 of the manual
-for a description of the interface and how to extend it for your
-needs.
+to LAMMPS. See "Section_howto 19"_Section_howto.html#howto_19 of the
+manual for a description of the interface and how to extend it for
+your needs.
Note that the lammps_open() function that creates an instance of
LAMMPS takes an MPI communicator as an argument. This means that
instance of LAMMPS will run on the set of processors in the
communicator. Thus the calling code can run LAMMPS on all or a subset
of processors. For example, a wrapper script might decide to
alternate between LAMMPS and another code, allowing them both to run
on all the processors. Or it might allocate half the processors to
LAMMPS and half to the other code and run both codes simultaneously
before syncing them up periodically. Or it might instantiate multiple
instances of LAMMPS to perform different calculations.
:line
6.11 Visualizing LAMMPS snapshots :link(howto_11),h4
LAMMPS itself does not do visualization, but snapshots from LAMMPS
simulations can be visualized (and analyzed) in a variety of ways.
LAMMPS snapshots are created by the "dump"_dump.html command which can
create files in several formats. The native LAMMPS dump format is a
text file (see "dump atom" or "dump custom") which can be visualized
by the "xmovie"_Section_tools.html#xmovie program, included with the
LAMMPS package. This produces simple, fast 2d projections of 3d
systems, and can be useful for rapid debugging of simulation geometry
and atom trajectories.
Several programs included with LAMMPS as auxiliary tools can convert
native LAMMPS dump files to other formats. See the
"Section_tools"_Section_tools.html doc page for details. The first is
the "ch2lmp tool"_Section_tools.html#charmm, which contains a
lammps2pdb Perl script which converts LAMMPS dump files into PDB
files. The second is the "lmp2arc tool"_Section_tools.html#arc which
converts LAMMPS dump files into Accelrys' Insight MD program files.
The third is the "lmp2cfg tool"_Section_tools.html#cfg which converts
LAMMPS dump files into CFG files which can be read into the
"AtomEye"_atomeye visualizer.
A Python-based toolkit distributed by our group can read native LAMMPS
dump files, including custom dump files with additional columns of
user-specified atom information, and convert them to various formats
or pipe them into visualization software directly. See the "Pizza.py
WWW site"_pizza for details. Specifically, Pizza.py can convert
LAMMPS dump files into PDB, XYZ, "Ensight"_ensight, and VTK formats.
Pizza.py can pipe LAMMPS dump files directly into the Raster3d and
RasMol visualization programs. Pizza.py has tools that do interactive
3d OpenGL visualization and one that creates SVG images of dump file
snapshots.
LAMMPS can create XYZ files directly (via "dump xyz") which is a
simple text-based file format used by many visualization programs
including "VMD"_vmd.
LAMMPS can create DCD files directly (via "dump dcd") which can be
read by "VMD"_vmd in conjunction with a CHARMM PSF file. Using this
form of output avoids the need to convert LAMMPS snapshots to PDB
files. See the "dump"_dump.html command for more information on DCD
files.
LAMMPS can create XTC files directly (via "dump xtc") which is GROMACS
file format which can also be read by "VMD"_vmd for visualization.
See the "dump"_dump.html command for more information on XTC files.
:link(pizza,http://www.sandia.gov/~sjplimp/pizza.html)
:link(vmd,http://www.ks.uiuc.edu/Research/vmd)
:link(ensight,http://www.ensight.com)
:link(atomeye,http://mt.seas.upenn.edu/Archive/Graphics/A)
:line
6.12 Triclinic (non-orthogonal) simulation boxes :link(howto_12),h4
By default, LAMMPS uses an orthogonal simulation box to encompass the
particles. The "boundary"_boundary.html command sets the boundary
conditions of the box (periodic, non-periodic, etc). The orthogonal
box has its "origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors
starting from the origin given by [a] = (xhi-xlo,0,0); [b] =
(0,yhi-ylo,0); [c] = (0,0,zhi-zlo). The 6 parameters
(xlo,xhi,ylo,yhi,zlo,zhi) are defined at the time the simluation box
is created, e.g. by the "create_box"_create_box.html or
"read_data"_read_data.html or "read_restart"_read_restart.html
commands. Additionally, LAMMPS defines box size parameters lx,ly,lz
where lx = xhi-xlo, and similarly in the y and z dimensions. The 6
parameters, as well as lx,ly,lz, can be output via the "thermo_style
custom"_thermo_style.html command.
LAMMPS also allows simulations to be perfored in non-orthogonal
simulation boxes shaped as a parallelepiped with triclinic symmetry.
The parallelepiped has its "origin" at (xlo,ylo,zlo) and is defined by
3 edge vectors starting from the origin given by [a] = (xhi-xlo,0,0); [b]
= (xy,yhi-ylo,0); [c] = (xz,yz,zhi-zlo). {Xy,xz,yz} can be 0.0 or
positive or negative values and are called "tilt factors" because they
are the amount of displacement applied to faces of an originally
orthogonal box to transform it into the parallelepiped. Note that in
LAMMPS the triclinic simulation box edge vectors [a], [b], and [c] cannot be
arbitrary vectors. As indicated, [a] must be aligned with the x axis, [b]
must be in the xy plane, and [c] is arbitrary. However, this is not a
restriction since it is possible to rotate any set of 3 crystal basis
vectors so that they meet this restriction.
The 9 parameters (xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz) are defined at the
time the simluation box is created. This happens in one of 3 ways.
If the "create_box"_create_box.html command is used with a region of
style {prism}, then a triclinic box is setup. See the
"region"_region.html command for details. If the
"read_data"_read_data.html command is used to define the simulation
box, and the header of the data file contains a line with the "xy xz
yz" keyword, then a triclinic box is setup. See the
"read_data"_read_data.html command for details. Finally, if the
"read_restart"_read_restart.html command reads a restart file which
was written from a simulation using a triclinic box, then a triclinic
box will be setup for the restarted simulation.
Note that you can define a triclinic box with all 3 tilt factors =
0.0, so that it is initially orthogonal. This is necessary if the box
will become non-orthogonal, e.g. due to the "fix npt"_fix_nh.html or
"fix deform"_fix_deform.html commands. Alternatively, you can use the
"change_box"_change_box.html command to convert a simulation box from
orthogonal to triclinic and vice versa.
As with orthogonal boxes, LAMMPS defines triclinic box size parameters
lx,ly,lz where lx = xhi-xlo, and similarly in the y and z dimensions.
The 9 parameters, as well as lx,ly,lz, can be output via the
"thermo_style custom"_thermo_style.html command.
To avoid extremely tilted boxes (which would be computationally
inefficient), no tilt factor can skew the box more than half the
distance of the parallel box length, which is the 1st dimension in the
tilt factor (x for xz). For example, if xlo = 2 and xhi = 12, then
the x box length is 10 and the xy tilt factor must be between -5 and
5. Similarly, both xz and yz must be between -(xhi-xlo)/2 and
+(yhi-ylo)/2. Note that this is not a limitation, since if the
maximum tilt factor is 5 (as in this example), then configurations
with tilt = ..., -15, -5, 5, 15, 25, ... are geometrically all
equivalent.
Triclinic crystal structures are often defined using three lattice
constants {a}, {b}, and {c}, and three angles {alpha}, {beta} and
{gamma}. Note that in this nomenclature, the a, b, and c lattice constants
are the scalar lengths of the edge vectors [a], [b], and [c] defined
above. The
relationship between these 6 quantities (a,b,c,alpha,beta,gamma) and
the LAMMPS box sizes (lx,ly,lz) = (xhi-xlo,yhi-ylo,zhi-zlo) and tilt
factors (xy,xz,yz) is as follows:
:c,image(Eqs/box.jpg)
The inverse relationship can be written as follows:
:c,image(Eqs/box_inverse.jpg)
The values of {a}, {b}, {c} , {alpha}, {beta} , and {gamma} can be printed
out or accessed by computes using the
"thermo_style custom"_thermo_style.html keywords
{cella}, {cellb}, {cellc}, {cellalpha}, {cellbeta}, {cellgamma},
respectively.
As discussed on the "dump"_dump.html command doc page, when the BOX
BOUNDS for a snapshot is written to a dump file for a triclinic box,
an orthogonal bounding box which encloses the triclinic simulation box
is output, along with the 3 tilt factors (xy, xz, yz) of the triclinic
box, formatted as follows:
ITEM: BOX BOUNDS xy xz yz
xlo_bound xhi_bound xy
ylo_bound yhi_bound xz
zlo_bound zhi_bound yz :pre
This bounding box is convenient for many visualization programs and is
calculated from the 9 triclinic box parameters
(xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz) as follows:
xlo_bound = xlo + MIN(0.0,xy,xz,xy+xz)
xhi_bound = xhi + MAX(0.0,xy,xz,xy+xz)
ylo_bound = ylo + MIN(0.0,yz)
yhi_bound = yhi + MAX(0.0,yz)
zlo_bound = zlo
zhi_bound = zhi :pre
These formulas can be inverted if you need to convert the bounding box
back into the triclinic box parameters, e.g. xlo = xlo_bound -
MIN(0.0,xy,xz,xy+xz).
One use of triclinic simulation boxes is to model solid-state crystals
with triclinic symmetry. The "lattice"_lattice.html command can be
used with non-orthogonal basis vectors to define a lattice that will
tile a triclinic simulation box via the
"create_atoms"_create_atoms.html command.
A second use is to run Parinello-Rahman dyanamics via the "fix
npt"_fix_nh.html command, which will adjust the xy, xz, yz tilt
factors to compensate for off-diagonal components of the pressure
tensor. The analalog for an "energy minimization"_minimize.html is
the "fix box/relax"_fix_box_relax.html command.
A third use is to shear a bulk solid to study the response of the
material. The "fix deform"_fix_deform.html command can be used for
this purpose. It allows dynamic control of the xy, xz, yz tilt
factors as a simulation runs. This is discussed in the next section
on non-equilibrium MD (NEMD) simulations.
:line
6.13 NEMD simulations :link(howto_13),h4
Non-equilibrium molecular dynamics or NEMD simulations are typically
used to measure a fluid's rheological properties such as viscosity.
In LAMMPS, such simulations can be performed by first setting up a
non-orthogonal simulation box (see the preceding Howto section).
A shear strain can be applied to the simulation box at a desired
strain rate by using the "fix deform"_fix_deform.html command. The
"fix nvt/sllod"_fix_nvt_sllod.html command can be used to thermostat
the sheared fluid and integrate the SLLOD equations of motion for the
system. Fix nvt/sllod uses "compute
temp/deform"_compute_temp_deform.html to compute a thermal temperature
by subtracting out the streaming velocity of the shearing atoms. The
velocity profile or other properties of the fluid can be monitored via
the "fix ave/spatial"_fix_ave_spatial.html command.
As discussed in the previous section on non-orthogonal simulation
boxes, the amount of tilt or skew that can be applied is limited by
LAMMPS for computational efficiency to be 1/2 of the parallel box
length. However, "fix deform"_fix_deform.html can continuously strain
a box by an arbitrary amount. As discussed in the "fix
deform"_fix_deform.html command, when the tilt value reaches a limit,
the box is re-shaped to the opposite limit which is an equivalent
tiling of periodic space. The strain rate can then continue to change
as before. In a long NEMD simulation these box re-shaping events may
occur many times.
In a NEMD simulation, the "remap" option of "fix
deform"_fix_deform.html should be set to "remap v", since that is what
"fix nvt/sllod"_fix_nvt_sllod.html assumes to generate a velocity
profile consistent with the applied shear strain rate.
An alternative method for calculating viscosities is provided via the
"fix viscosity"_fix_viscosity.html command.
:line
6.14 Extended spherical and aspherical particles :link(howto_14),h4
Typical MD models treat atoms or particles as point masses.
Sometimes, however, it is desirable to have a model with finite-size
particles such as spheres or aspherical ellipsoids. The difference is
that such particles have a moment of inertia, rotational energy, and
angular momentum. Rotation is induced by torque from interactions
with other particles.
LAMMPS has several options for running simulations with these kinds of
particles. The following aspects are discussed in turn:
atom styles
pair potentials
time integration
computes, thermodynamics, and dump output
rigid bodies composed of extended particles :ul
Atom styles :h5
There are 2 "atom styles"_atom_style.html that allow for definition of
finite-size particles: sphere and ellipsoid. The peri atom style also
treats particles as having a volume, but that is internal to the
"pair_style peri"_pair_peri.html potentials. The dipole atom style is
most often used in conjunction with finite-size particles.
The sphere style defines particles that are spheriods and each
particle can have a unique diameter and mass (or density). These
particles store an angular velocity (omega) and can be acted upon by
torque. The "set" command can be used to modify the diameter and mass
of individual particles, after then are created.
The ellipsoid style defines particles that are ellipsoids and thus can
be aspherical. Each particle has a shape, specified by 3 diameters,
and mass (or density). These particles store an angular momentum and
their orientation (quaternion), and can be acted upon by torque. They
do not store an angular velocity (omega), which can be in a different
direction than angular momentum, rather they compute it as needed.
The "set" command can be used to modify the diameter, orientation, and
mass of individual particles, after then are created. It also has a
brief explanation of what quaternions are.
The dipole style does not define extended particles, but is often
used in conjunction with spherical particles, via a command like
atom_style hybrid sphere dipole :pre
This is because when dipoles interact with each other, they induce
torques, and a particle must be extended (i.e. have a moment of
inertia) in order to respond and rotate. See the "atom_style
dipole"_atom_style.html command for details. The "set" command can be
used to modify the orientation and length of the dipole moment of
individual particles, after then are created.
Note that if one of these atom styles is used (or multiple styles via
the "atom_style hybrid"_atom_style.html command), not all particles in
the system are required to be finite-size or aspherical. For example,
if the 3 shape parameters are set to the same value, the particle will
be a sphere rather than an ellipsoid. If the 3 shape parameters are
all set to 0.0 or if the diameter is set to 0.0, it will be a point
particle. If the length of the dipole moment is set to zero, the
particle will not have a point dipole associated with it. The pair
styles used to compute pairwise interactions will typically compute
the correct interaction in these simplified (cheaper) cases.
"Pair_style hybrid"_pair_hybrid.html can be used to insure the correct
interactions are computed for the appropriate style of interactions.
Likewise, using groups to partition particles (ellipsoids versus
spheres versus point particles) will allow you to use the appropriate
time integrators and temperature computations for each class of
particles. See the doc pages for various commands for details.
Also note that for "2d simulations"_dimension.html, finite-size
spheres and ellipsoids are still treated as 3d particles, rather than
as circular disks or ellipses. This means they have the same moment
of inertia for a 3d extended object. When their temperature is
coomputed, the correct degrees of freedom are used for rotation in a
2d versus 3d system.
Pair potentials :h5
When a system with extended particles is defined, the particles will
only rotate and experience torque if the force field computes such
interactions. These are the various "pair styles"_pair_style.html
that generate torque:
"pair_style gran/history"_pair_gran.html
"pair_style gran/hertzian"_pair_gran.html
"pair_style gran/no_history"_pair_gran.html
"pair_style dipole/cut"_pair_dipole.html
"pair_style gayberne"_pair_gayberne.html
"pair_style resquared"_pair_resquared.html
"pair_style lubricate"_pair_lubricate.html :ul
The "granular pair styles"_pair_gran.html are used with spherical
particles. The "dipole pair style"_pair_dipole.html is used with
"atom_style dipole"_atom_style.html, which could be applied to
spherical or ellipsoidal particles. The "GayBerne"_pair_gayberne.html
and "REsquared"_pair_resquared.html potentials require ellipsoidal
particles, though they will also work if the 3 shape parameters are
the same (a sphere). The "lubrication potential"_pair_lubricate.html
works with spherical particles.
Time integration :h5
There are 3 fixes that perform time integration on extended spherical
particles, meaning the integrators update the rotational orientation
and angular velocity or angular momentum of the particles:
"fix nve/sphere"_fix_nve_sphere.html
"fix nvt/sphere"_fix_nvt_sphere.html
"fix npt/sphere"_fix_npt_sphere.html :ul
Likewise, there are 3 fixes that perform time integration on
ellipsoids as extended aspherical particles:
"fix nve/asphere"_fix_nve_asphere.html
"fix nvt/asphere"_fix_nvt_asphere.html
"fix npt/asphere"_fix_npt_asphere.html :ul
The advantage of these fixes is that those which thermostat the
particles include the rotational degrees of freedom in the temperature
calculation and thermostatting. Other thermostats can be used with
fix nve/sphere or fix nve/asphere, such as fix langevin or fix
temp/berendsen, but those thermostats only operate on the
translational kinetic energy of the extended particles.
Note that for mixtures of point and extended particles, you should
only use these integration fixes on "groups"_group.html which contain
extended particles.
Computes, thermodynamics, and dump output :h5
There are 4 computes that calculate the temperature or rotational energy
of extended spherical or aspherical particles (ellipsoids):
"compute temp/sphere"_compute_temp_sphere.html
"compute temp/asphere"_compute_temp_asphere.html
"compute erotate/sphere"_compute_erotate_sphere.html
"compute erotate/asphere"_compute_erotate_asphere.html :ul
These include rotational degrees of freedom in their computation. If
you wish the thermodynamic output of temperature or pressure to use
one of these computes (e.g. for a system entirely composed of extended
particles), then the compute can be defined and the
"thermo_modify"_thermo_modify.html command used. Note that by
default thermodynamic quantities will be calculated with a temperature
that only includes translational degrees of freedom. See the
"thermo_style"_thermo_style.html command for details.
The "dump custom"_dump.html command can output various attributes of
extended particles, including the dipole moment (mu), the angular
velocity (omega), the angular momentum (angmom), the quaternion
(quat), and the torque (tq) on the particle.
Rigid bodies composed of extended particles :h5
The "fix rigid"_fix_rigid.html command treats a collection of
particles as a rigid body, computes its inertia tensor, sums the total
force and torque on the rigid body each timestep due to forces on its
constituent particles, and integrates the motion of the rigid body.
If any of the constituent particles of a rigid body are extended
particles (spheres or ellipsoids), then their contribution to the
inertia tensor of the body is different than if they were point
particles. This means the rotational dynamics of the rigid body will
be different. Thus a model of a dimer is different if the dimer
consists of two point masses versus two extended sphereoids, even if
the two particles have the same mass. Extended particles that
experience torque due to their interaction with other particles will
also impart that torque to a rigid body they are part of.
See the "fix rigid" command for example of complex rigid-body models
it is possible to define in LAMMPS.
Note that the "fix shake"_fix_shake.html command can also be used to
treat 2, 3, or 4 particles as a rigid body, but it always assumes the
particles are point masses.
:line
6.15 Output from LAMMPS (thermo, dumps, computes, fixes, variables) :link(howto_15),h4
There are four basic kinds of LAMMPS output:
"Thermodynamic output"_thermo_style.html, which is a list
of quantities printed every few timesteps to the screen and logfile. :ulb,l
"Dump files"_dump.html, which contain snapshots of atoms and various
per-atom values and are written at a specified frequency. :l
Certain fixes can output user-specified quantities to files: "fix
ave/time"_fix_ave_time.html for time averaging, "fix
ave/spatial"_fix_ave_spatial.html for spatial averaging, and "fix
print"_fix_print.html for single-line output of
"variables"_variable.html. Fix print can also output to the
screen. :l
"Restart files"_restart.html. :l,ule
A simulation prints one set of thermodynamic output and (optionally)
restart files. It can generate any number of dump files and fix
output files, depending on what "dump"_dump.html and "fix"_fix.html
commands you specify.
As discussed below, LAMMPS gives you a variety of ways to determine
what quantities are computed and printed when the thermodynamics,
dump, or fix commands listed above perform output. Throughout this
discussion, note that users can also "add their own computes and fixes
to LAMMPS"_Section_modify.html which can then generate values that can
then be output with these commands.
The following sub-sections discuss different LAMMPS command related
to output and the kind of data they operate on and produce:
"Global/per-atom/local data"_#global
"Scalar/vector/array data"_#scalar
"Thermodynamic output"_#thermo
"Dump file output"_#dump
"Fixes that write output files"_#fixoutput
"Computes that process output quantities"_#computeoutput
"Fixes that process output quantities"_#fixoutput
"Computes that generate values to output"_#compute
"Fixes that generate values to output"_#fix
"Variables that generate values to output"_#variable
"Summary table of output options and data flow between commands"_#table :ul
Global/per-atom/local data :h5,link(global)
Various output-related commands work with three different styles of
data: global, per-atom, or local. A global datum is one or more
system-wide values, e.g. the temperature of the system. A per-atom
datum is one or more values per atom, e.g. the kinetic energy of each
atom. Local datums are calculated by each processor based on the
atoms it owns, but there may be zero or more per atom, e.g. a list of
bond distances.
Scalar/vector/array data :h5,link(scalar)
Global, per-atom, and local datums can each come in three kinds: a
single scalar value, a vector of values, or a 2d array of values. The
doc page for a "compute" or "fix" or "variable" that generates data
will specify both the style and kind of data it produces, e.g. a
per-atom vector.
When a quantity is accessed, as in many of the output commands
discussed below, it can be referenced via the following bracket
notation, where ID in this case is the ID of a compute. The leading
"c_" would be replaced by "f_" for a fix, or "v_" for a variable:
c_ID | entire scalar, vector, or array
c_ID\[I\] | one element of vector, one column of array
c_ID\[I\]\[J\] | one element of array :tb(s=|)
In other words, using one bracket reduces the dimension of the data
once (vector -> scalar, array -> vector). Using two brackets reduces
the dimension twice (array -> scalar). Thus a command that uses
scalar values as input can typically also process elements of a vector
or array.
Thermodynamic output :h5,link(thermo)
The frequency and format of thermodynamic output is set by the
"thermo"_thermo.html, "thermo_style"_thermo_style.html, and
"thermo_modify"_thermo_modify.html commands. The
"thermo_style"_thermo_style.html command also specifies what values
are calculated and written out. Pre-defined keywords can be specified
(e.g. press, etotal, etc). Three additional kinds of keywords can
also be specified (c_ID, f_ID, v_name), where a "compute"_compute.html
or "fix"_fix.html or "variable"_variable.html provides the value to be
output. In each case, the compute, fix, or variable must generate
global values for input to the "thermo_style custom"_dump.html
command.
Dump file output :h5,link(dump)
Dump file output is specified by the "dump"_dump.html and
"dump_modify"_dump_modify.html commands. There are several
pre-defined formats (dump atom, dump xtc, etc).
There is also a "dump custom"_dump.html format where the user
specifies what values are output with each atom. Pre-defined atom
attributes can be specified (id, x, fx, etc). Three additional kinds
of keywords can also be specified (c_ID, f_ID, v_name), where a
"compute"_compute.html or "fix"_fix.html or "variable"_variable.html
provides the values to be output. In each case, the compute, fix, or
variable must generate per-atom values for input to the "dump
custom"_dump.html command.
There is also a "dump local"_dump.html format where the user specifies
what local values to output. A pre-defined index keyword can be
specified to enumuerate the local values. Two additional kinds of
keywords can also be specified (c_ID, f_ID), where a
"compute"_compute.html or "fix"_fix.html or "variable"_variable.html
provides the values to be output. In each case, the compute or fix
must generate local values for input to the "dump local"_dump.html
command.
Fixes that write output files :h5,link(fixoutput)
Sevarl fixes take various quantities as input and can write output
files: "fix ave/time"_fix_ave_time.html, "fix
ave/spatial"_fix_ave_spatial.html, "fix ave/histo"_fix_ave_histo.html,
"fix ave/correlate"_fix_ave_correlate.html, and "fix
print"_fix_print.html.
The "fix ave/time"_fix_ave_time.html command enables direct output to
a file and/or time-averaging of global scalars or vectors. The user
specifies one or more quantities as input. These can be global
"compute"_compute.html values, global "fix"_fix.html values, or
"variables"_variable.html of any style except the atom style which
produces per-atom values. Since a variable can refer to keywords used
by the "thermo_style custom"_thermo_style.html command (like temp or
press) and individual per-atom values, a wide variety of quantities
can be time averaged and/or output in this way. If the inputs are one
or more scalar values, then the fix generate a global scalar or vector
of output. If the inputs are one or more vector values, then the fix
generates a global vector or array of output. The time-averaged
output of this fix can also be used as input to other output commands.
The "fix ave/spatial"_fix_ave_spatial.html command enables direct
output to a file of spatial-averaged per-atom quantities like those
output in dump files, within 1d layers of the simulation box. The
per-atom quantities can be atom density (mass or number) or atom
attributes such as position, velocity, force. They can also be
per-atom quantities calculated by a "compute"_compute.html, by a
"fix"_fix.html, or by an atom-style "variable"_variable.html. The
spatial-averaged output of this fix can also be used as input to other
output commands.
The "fix ave/histo"_fix_ave_histo.html command enables direct output
to a file of histogrammed quantities, which can be global or per-atom
or local quantities. The histogram output of this fix can also be
used as input to other output commands.
The "fix ave/correlate"_fix_ave_histo.html command enables direct
output to a file of time-correlated quantities, which can be global
scalars. The correlation matrix output of this fix can also be used
as input to other output commands.
The "fix print"_fix_print.html command can generate a line of output
written to the screen and log file or to a separate file, periodically
during a running simulation. The line can contain one or more
"variable"_variable.html values for any style variable except the atom
style). As explained above, variables themselves can contain
references to global values generated by "thermodynamic
keywords"_thermo_style.html, "computes"_compute.html,
"fixes"_fix.html, or other "variables"_variable.html, or to per-atom
values for a specific atom. Thus the "fix print"_fix_print.html
command is a means to output a wide variety of quantities separate
from normal thermodynamic or dump file output.
Computes that process output quantities :h5,link(computeoutput)
The "compute reduce"_compute_reduce.html and "compute
reduce/region"_compute_reduce.html commands take one or more per-atom
or local vector quantities as inputs and "reduce" them (sum, min, max,
ave) to scalar quantities. These are produced as output values which
can be used as input to other output commands.
The "compute slice"_compute_slice.html command take one or more global
vector or array quantities as inputs and extracts a subset of their
values to create a new vector or array. These are produced as output
values which can be used as input to other output commands.
The "compute property/atom"_compute_property_atom.html command takes a
list of one or more pre-defined atom attributes (id, x, fx, etc) and
stores the values in a per-atom vector or array. These are produced
as output values which can be used as input to other output commands.
The list of atom attributes is the same as for the "dump
custom"_dump.html command.
The "compute property/local"_compute_property_local.html command takes
a list of one or more pre-defined local attributes (bond info, angle
info, etc) and stores the values in a local vector or array. These
are produced as output values which can be used as input to other
output commands.
The "compute atom/molecule"_compute_atom_molecule.html command takes a
list of one or more per-atom quantities (from a compute, fix, per-atom
variable) and sums the quantities on a per-molecule basis. It
produces a global vector or array as output values which can be used
as input to other output commands.
Fixes that process output quantities :h5,link(fixoutput)
The "fix ave/atom"_fix_ave_atom.html command performs time-averaging
of per-atom vectors. The per-atom quantities can be atom attributes
such as position, velocity, force. They can also be per-atom
quantities calculated by a "compute"_compute.html, by a
"fix"_fix.html, or by an atom-style "variable"_variable.html. The
time-averaged per-atom output of this fix can be used as input to
other output commands.
The "fix store/state"_fix_store_state.html command can archive one or
more per-atom attributes at a particular time, so that the old values
can be used in a future calculation or output. The list of atom
attributes is the same as for the "dump custom"_dump.html command,
including per-atom quantities calculated by a "compute"_compute.html,
by a "fix"_fix.html, or by an atom-style "variable"_variable.html.
The output of this fix can be used as input to other output commands.
Computes that generate values to output :h5,link(compute)
Every "compute"_compute.html in LAMMPS produces either global or
per-atom or local values. The values can be scalars or vectors or
arrays of data. These values can be output using the other commands
described in this section. The doc page for each compute command
describes what it produces. Computes that produce per-atom or local
values have the word "atom" or "local" in their style name. Computes
without the word "atom" or "local" produce global values.
Fixes that generate values to output :h5,link(fix)
Some "fixes"_fix.html in LAMMPS produces either global or per-atom or
local values which can be accessed by other commands. The values can
be scalars or vectors or arrays of data. These values can be output
using the other commands described in this section. The doc page for
each fix command tells whether it produces any output quantities and
describes them.
Variables that generate values to output :h5,link(variable)
Every "variables"_variable.html defined in an input script generates
either a global scalar value or a per-atom vector (only atom-style
variables) when it is accessed. The formulas used to define equal-
and atom-style variables can contain references to the thermodynamic
keywords and to global and per-atom data generated by computes, fixes,
and other variables. The values generated by variables can be output
using the other commands described in this section.
Summary table of output options and data flow between commands :h5,link(table)
This table summarizes the various commands that can be used for
generating output from LAMMPS. Each command produces output data of
some kind and/or writes data to a file. Most of the commands can take
data from other commands as input. Thus you can link many of these
commands together in pipeline form, where data produced by one command
is used as input to another command and eventually written to the
screen or to a file. Note that to hook two commands together the
output and input data types must match, e.g. global/per-atom/local
data and scalar/vector/array data.
Also note that, as described above, when a command takes a scalar as
input, that could be an element of a vector or array. Likewise a
vector input could be a column of an array.
Command: Input: Output:
"thermo_style custom"_thermo_style.html: global scalars: screen, log file:
"dump custom"_dump.html: per-atom vectors: dump file:
"dump local"_dump.html: local vectors: dump file:
"fix print"_fix_print.html: global scalar from variable: screen, file:
"print"_print.html: global scalar from variable: screen:
"computes"_compute.html: N/A: global/per-atom/local scalar/vector/array:
"fixes"_fix.html: N/A: global/per-atom/local scalar/vector/array:
"variables"_variable.html: global scalars, per-atom vectors: global scalar, per-atom vector:
"compute reduce"_compute_reduce.html: per-atom/local vectors: global scalar/vector:
"compute slice"_compute_slice.html: global vectors/arrays: global vector/array:
"compute property/atom"_compute_property_atom.html: per-atom vectors: per-atom vector/array:
"compute property/local"_compute_property_local.html: local vectors: local vector/array:
"compute atom/molecule"_compute_atom_molecule.html: per-atom vectors: global vector/array:
"fix ave/atom"_fix_ave_atom.html: per-atom vectors: per-atom vector/array:
"fix ave/time"_fix_ave_time.html: global scalars/vectors: global scalar/vector/array, file:
"fix ave/spatial"_fix_ave_spatial.html: per-atom vectors: global array, file:
"fix ave/histo"_fix_ave_histo.html: global/per-atom/local scalars and vectors: global array, file:
"fix ave/correlate"_fix_ave_correlate.html: global scalars: global array, file:
"fix store/state"_fix_store_state.html: per-atom vectors: per-atom vector/array:
:tb(s=:)
:line
6.16 Thermostatting, barostatting, and computing temperature :link(howto_16),h4
Thermostatting means controlling the temperature of particles in an MD
simulation. Barostatting means controlling the pressure. Since the
pressure includes a kinetic component due to particle velocities, both
these operations require calculation of the temperature. Typically a
target temperature (T) and/or pressure (P) is specified by the user,
and the thermostat or barostat attempts to equilibrate the system to
the requested T and/or P.
Temperature is computed as kinetic energy divided by some number of
degrees of freedom (and the Boltzmann constant). Since kinetic energy
is a function of particle velocity, there is often a need to
distinguish between a particle's advection velocity (due to some
aggregate motiion of particles) and its thermal velocity. The sum of
the two is the particle's total velocity, but the latter is often what
is wanted to compute a temperature.
LAMMPS has several options for computing temperatures, any of which
can be used in thermostatting and barostatting. These "compute
commands"_compute.html calculate temperature, and the "compute
pressure"_compute_pressure.html command calculates pressure.
"compute temp"_compute_temp.html
"compute temp/sphere"_compute_temp_sphere.html
"compute temp/asphere"_compute_temp_asphere.html
"compute temp/com"_compute_temp_com.html
"compute temp/deform"_compute_temp_deform.html
"compute temp/partial"_compute_temp_partial.html
"compute temp/profile"_compute_temp_profile.html
"compute temp/ramp"_compute_temp_ramp.html
"compute temp/region"_compute_temp_region.html :ul
All but the first 3 calculate velocity biases (i.e. advection
velocities) that are removed when computing the thermal temperature.
"Compute temp/sphere"_compute_temp_sphere.html and "compute
temp/asphere"_compute_temp_asphere.html compute kinetic energy for
extended particles that includes rotational degrees of freedom. They
both allow, as an extra argument, which is another temperature compute
that subtracts a velocity bias. This allows the translational
velocity of extended spherical or aspherical particles to be adjusted
in prescribed ways.
Thermostatting in LAMMPS is performed by "fixes"_fix.html, or in one
case by a pair style. Four thermostatting fixes are currently
available: Nose-Hoover (nvt), Berendsen, Langevin, and direct
rescaling (temp/rescale). Dissipative particle dynamics (DPD)
thermostatting can be invoked via the {dpd/tstat} pair style:
"fix nvt"_fix_nh.html
"fix nvt/sphere"_fix_nvt_sphere.html
"fix nvt/asphere"_fix_nvt_asphere.html
"fix nvt/sllod"_fix_nvt_sllod.html
"fix temp/berendsen"_fix_temp_berendsen.html
"fix langevin"_fix_langevin.html
"fix temp/rescale"_fix_temp_rescale.html
"pair_style dpd/tstat"_pair_dpd.html :ul
"Fix nvt"_fix_nh.html only thermostats the translational velocity of
particles. "Fix nvt/sllod"_fix_nvt_sllod.html also does this, except
that it subtracts out a velocity bias due to a deforming box and
integrates the SLLOD equations of motion. See the "NEMD
simulations"_#howto_13 section of this page for further details. "Fix
nvt/sphere"_fix_nvt_sphere.html and "fix
nvt/asphere"_fix_nvt_asphere.html thermostat not only translation
velocities but also rotational velocities for spherical and aspherical
particles.
DPD thermostatting alters pairwise interactions in a manner analagous
to the per-particle thermostatting of "fix
langevin"_fix_langevin.html.
Any of the thermostatting fixes can use temperature computes that
remove bias for two purposes: (a) computing the current temperature to
compare to the requested target temperature, and (b) adjusting only
the thermal temperature component of the particle's velocities. See
the doc pages for the individual fixes and for the
"fix_modify"_fix_modify.html command for instructions on how to assign
a temperature compute to a thermostatting fix. For example, you can
apply a thermostat to only the x and z components of velocity by using
it in conjunction with "compute
temp/partial"_compute_temp_partial.html.
IMPORTANT NOTE: Only the nvt fixes perform time integration, meaning
they update the velocities and positions of particles due to forces
and velocities respectively. The other thermostat fixes only adjust
velocities; they do NOT perform time integration updates. Thus they
should be used in conjunction with a constant NVE integration fix such
as these:
"fix nve"_fix_nve.html
"fix nve/sphere"_fix_nve_sphere.html
"fix nve/asphere"_fix_nve_asphere.html :ul
Barostatting in LAMMPS is also performed by "fixes"_fix.html. Two
barosttating methods are currently available: Nose-Hoover (npt and
nph) and Berendsen:
"fix npt"_fix_nh.html
"fix npt/sphere"_fix_npt_sphere.html
"fix npt/asphere"_fix_npt_asphere.html
"fix nph"_fix_nh.html
"fix press/berendsen"_fix_press_berendsen.html :ul
The "fix npt"_fix_nh.html commands include a Nose-Hoover thermostat
and barostat. "Fix nph"_fix_nh.html is just a Nose/Hoover barostat;
it does no thermostatting. Both "fix nph"_fix_nh.html and "fix
press/bernendsen"_fix_press_berendsen.html can be used in conjunction
with any of the thermostatting fixes.
As with the thermostats, "fix npt"_fix_nh.html and "fix
nph"_fix_nh.html only use translational motion of the particles in
computing T and P and performing thermo/barostatting. "Fix
npt/sphere"_fix_npt_sphere.html and "fix
npt/asphere"_fix_npt_asphere.html thermo/barostat using not only
translation velocities but also rotational velocities for spherical
and aspherical particles.
All of the barostatting fixes use the "compute
pressure"_compute_pressure.html compute to calculate a current
pressure. By default, this compute is created with a simple "compute
temp"_compute_temp.html (see the last argument of the "compute
pressure"_compute_pressure.html command), which is used to calculated
the kinetic componenet of the pressure. The barostatting fixes can
also use temperature computes that remove bias for the purpose of
computing the kinetic componenet which contributes to the current
pressure. See the doc pages for the individual fixes and for the
"fix_modify"_fix_modify.html command for instructions on how to assign
a temperature or pressure compute to a barostatting fix.
IMPORTANT NOTE: As with the thermostats, the Nose/Hoover methods ("fix
npt"_fix_nh.html and "fix nph"_fix_nh.html) perform time
integration. "Fix press/berendsen"_fix_press_berendsen.html does NOT,
so it should be used with one of the constant NVE fixes or with one of
the NVT fixes.
Finally, thermodynamic output, which can be setup via the
"thermo_style"_thermo_style.html command, often includes temperature
and pressure values. As explained on the doc page for the
"thermo_style"_thermo_style.html command, the default T and P are
setup by the thermo command itself. They are NOT the ones associated
with any thermostatting or barostatting fix you have defined or with
any compute that calculates a temperature or pressure. Thus if you
want to view these values of T and P, you need to specify them
explicitly via a "thermo_style custom"_thermo_style.html command. Or
you can use the "thermo_modify"_thermo_modify.html command to
re-define what temperature or pressure compute is used for default
thermodynamic output.
:line
6.17 Walls :link(howto_17),h4
Walls in an MD simulation are typically used to bound particle motion,
i.e. to serve as a boundary condition.
Walls in LAMMPS can be of rough (made of particles) or idealized
surfaces. Ideal walls can be smooth, generating forces only in the
normal direction, or frictional, generating forces also in the
tangential direction.
Rough walls, built of particles, can be created in various ways. The
particles themselves can be generated like any other particle, via the
"lattice"_lattice.html and "create_atoms"_create_atoms.html commands,
or read in via the "read_data"_read_data.html command.
Their motion can be constrained by many different commands, so that
they do not move at all, move together as a group at constant velocity
or in response to a net force acting on them, move in a prescribed
fashion (e.g. rotate around a point), etc. Note that if a time
integration fix like "fix nve"_fix_nve.html or "fix nvt"_fix_nh.html
is not used with the group that contains wall particles, their
positions and velocities will not be updated.
"fix aveforce"_fix_aveforce.html - set force on particles to average value, so they move together
"fix setforce"_fix_setforce.html - set force on particles to a value, e.g. 0.0
"fix freeze"_fix_freeze.html - freeze particles for use as granular walls
"fix nve/noforce"_fix_nve_noforce.html - advect particles by their velocity, but without force
"fix move"_fix_move.html - prescribe motion of particles by a linear velocity, oscillation, rotation, variable :ul
The "fix move"_fix_move.html command offers the most generality, since
the motion of individual particles can be specified with
"variable"_variable.html formula which depends on time and/or the
particle position.
For rough walls, it may be useful to turn off pairwise interactions
between wall particles via the "neigh_modify
exclude"_neigh_modify.html command.
Rough walls can also be created by specifying frozen particles that do
not move and do not interact with mobile particles, and then tethering
other particles to the fixed particles, via a "bond"_bond_style.html.
The bonded particles do interact with other mobile particles.
Idealized walls can be specified via several fix commands. "Fix
wall/gran"_fix_wall_gran.html creates frictional walls for use with
granular particles; all the other commands create smooth walls.
"fix wall/reflect"_fix_wall_reflect.html - reflective flat walls
"fix wall/lj93"_fix_wall.html - flat walls, with Lennard-Jones 9/3 potential
"fix wall/lj126"_fix_wall.html - flat walls, with Lennard-Jones 12/6 potential
"fix wall/colloid"_fix_wall.html - flat walls, with "pair_style colloid"_pair_colloid.html potential
"fix wall/harmonic"_fix_wall.html - flat walls, with repulsive harmonic spring potential
"fix wall/region"_fix_wall_region.html - use region surface as wall
"fix wall/gran"_fix_wall_gran.html - flat or curved walls with "pair_style granular"_pair_gran.html potential :ul
The {lj93}, {lj126}, {colloid}, and {harmonic} styles all allow the
flat walls to move with a constant velocity, or oscillate in time.
The "fix wall/region"_fix_wall_region.html command offers the most
generality, since the region surface is treated as a wall, and the
geometry of the region can be a simple primitive volume (e.g. a
sphere, or cube, or plane), or a complex volume made from the union
and intersection of primitive volumes. "Regions"_region.html can also
specify a volume "interior" or "exterior" to the specified primitive
shape or {union} or {intersection}. "Regions"_region.html can also be
"dynamic" meaning they move with constant velocity, oscillate, or
rotate.
The only frictional idealized walls currently in LAMMPS are flat or
curved surfaces specified by the "fix wall/gran"_fix_wall_gran.html
command. At some point we plan to allow regoin surfaces to be used as
frictional walls, as well as triangulated surfaces.
:line
6.18 Elastic constants :link(howto_18),h4
Elastic constants characterize the stiffness of a material. The formal
definition is provided by the linear relation that holds between the
stress and strain tensors in the limit of infinitesimal deformation.
In tensor notation, this is expressed as s_ij = C_ijkl * e_kl, where
the repeated indices imply summation. s_ij are the elements of the
symmetric stress tensor. e_kl are the elements of the symmetric strain
tensor. C_ijkl are the elements of the fourth rank tensor of elastic
constants. In three dimensions, this tensor has 3^4=81 elements. Using
Voigt notation, the tensor can be written as a 6x6 matrix, where C_ij
is now the derivative of s_i w.r.t. e_j. Because s_i is itself a
derivative w.r.t. e_i, it follows that C_ij is also symmetric, with at
most 7*6/2 = 21 distinct elements.
At zero temperature, it is easy to estimate these derivatives by
deforming the cell in one of the six directions using the command
"displace_box"_displace_box.html and measuring the change in the
stress tensor. A general-purpose script that does this is given in the
examples/elastic directory described in "this
section"_Section_example.html.
Calculating elastic constants at finite temperature is more
challenging, because it is necessary to run a simulation that perfoms
time averages of differential properties. One way to do this is to
measure the change in average stress tensor in an NVT simulations when
the cell volume undergoes a finite deformation. In order to balance
the systematic and statistical errors in this method, the magnitude of
the deformation must be chosen judiciously, and care must be taken to
fully equilibrate the deformed cell before sampling the stress
tensor. Another approach is to sample the triclinic cell fluctuations
that occur in an NPT simulation. This method can also be slow to
converge and requires careful post-processing "(Shinoda)"_#Shinoda
:line
6.19 Library interface to LAMMPS :link(howto_19),h4
-As described in "this section"_Section_start.html#start_4, LAMMPS can
-be built as a library, so that it can be called by another code, used
-in a "coupled manner"_Section_howto.html#howto_10 with other codes, or
-driven through a "Python interface"_Section_python.html.
+As described in "Section_start 4"_Section_start.html#start_4, LAMMPS
+can be built as a library, so that it can be called by another code,
+used in a "coupled manner"_Section_howto.html#howto_10 with other
+codes, or driven through a "Python interface"_Section_python.html.
All of these methodologies use a C-style interface to LAMMPS that is
provided in the files src/library.cpp and src/library.h. The
functions therein have a C-style argument list, but contain C++ code
you could write yourself in a C++ application that was invoking LAMMPS
directly. The C++ code in the functions illustrates how to invoke
internal LAMMPS operations. Note that LAMMPS classes are defined
within a LAMMPS namespace (LAMMPS_NS) if you use them from another C++
application.
Library.cpp contains these 4 functions:
void lammps_open(int, char **, MPI_Comm, void **);
void lammps_close(void *);
void lammps_file(void *, char *);
char *lammps_command(void *, char *); :pre
The lammps_open() function is used to initialize LAMMPS, passing in a
list of strings as if they were "command-line
arguments"_Section_start.html#start_6 when LAMMPS is run in
stand-alone mode from the command line, and a MPI communicator for
LAMMPS to run under. It returns a ptr to the LAMMPS object that is
created, and which is used in subsequent library calls. The
lammps_open() function can be called multiple times, to create
multiple instances of LAMMPS.
LAMMPS will run on the set of processors in the communicator. This
means the calling code can run LAMMPS on all or a subset of
processors. For example, a wrapper script might decide to alternate
between LAMMPS and another code, allowing them both to run on all the
processors. Or it might allocate half the processors to LAMMPS and
half to the other code and run both codes simultaneously before
syncing them up periodically. Or it might instantiate multiple
instances of LAMMPS to perform different calculations.
The lammps_close() function is used to shut down an instance of LAMMPS
and free all its memory.
The lammps_file() and lammps_command() functions are used to pass a
file or string to LAMMPS as if it were an input script or single
command in an input script. Thus the calling code can read or
generate a series of LAMMPS commands one line at a time and pass it
thru the library interface to setup a problem and then run it,
interleaving the lammps_command() calls with other calls to extract
information from LAMMPS, perform its own operations, or call another
code's library.
Other useful functions are also included in library.cpp. For example:
void *lammps_extract_global(void *, char *)
void *lammps_extract_atom(void *, char *)
void *lammps_extract_compute(void *, char *, int, int)
void *lammps_extract_fix(void *, char *, int, int, int, int)
void *lammps_extract_variable(void *, char *, char *)
int lammps_get_natoms(void *)
void lammps_get_coords(void *, double *)
void lammps_put_coords(void *, double *) :pre
These can extract various global or per-atom quantities from LAMMPS as
well as values calculated by a compute, fix, or variable. The "get"
and "put" operations can retrieve and reset atom coordinates.
See the library.cpp file and its associated header file library.h for
details.
The key idea of the library interface is that you can write any
functions you wish to define how your code talks to LAMMPS and add
them to src/library.cpp and src/library.h, as well as to the "Python
interface"_Section_python.html. The routines you add can access
or change any LAMMPS data you wish. The couple and python directories
have example C++ and C and Python codes which show how a driver code
can link to LAMMPS as a library, run LAMMPS on a subset of processors,
grab data from LAMMPS, change it, and put it back into LAMMPS.
:line
6.20 Calculating thermal conductivity :link(howto_20),h4
The thermal conductivity kappa of a material can be measured in at
least 3 ways using various options in LAMMPS. (See "this
section"_Section_howto.html#howto_21 of the manual for an analogous
discussion for viscosity). The thermal conducitivity tensor kappa is
a measure of the propensity of a material to transmit heat energy in a
diffusive manner as given by Fourier's law
J = -kappa grad(T)
where J is the heat flux in units of energy per area per time and
grad(T) is the spatial gradient of temperature. The thermal
conductivity thus has units of energy per distance per time per degree
K and is often approximated as an isotropic quantity, i.e. as a
scalar.
The first method is to setup two thermostatted regions at opposite
ends of a simulation box, or one in the middle and one at the end of a
periodic box. By holding the two regions at different temperatures
with a "thermostatting fix"_Section_howto.html#howto_13, the energy added
to the hot region should equal the energy subtracted from the cold
region and be proportional to the heat flux moving between the
regions. See the paper by "Ikeshoji and Hafskjold"_#Ikeshoji for
details of this idea. Note that thermostatting fixes such as "fix
nvt"_fix_nh.html, "fix langevin"_fix_langevin.html, and "fix
temp/rescale"_fix_temp_rescale.html store the cumulative energy they
add/subtract. Alternatively, the "fix heat"_fix_heat.html command can
used in place of thermostats on each of two regions, and the resulting
temperatures of the two regions monitored with the "compute
temp/region" command or the temperature profile of the intermediate
region monitored with the "fix ave/spatial"_fix_ave_spatial.html and
"compute ke/atom"_compute_ke_atom.html commands.
The second method is to perform a reverse non-equilibrium MD
simulation using the "fix
thermal/conductivity"_fix_thermal_conductivity.html command which
implements the rNEMD algorithm of Muller-Plathe. Kinetic energy is
swapped between atoms in two different layers of the simulation box.
This induces a temperature gradient between the two layers which can
be monitored with the "fix ave/spatial"_fix_ave_spatial.html and
"compute ke/atom"_compute_ke_atom.html commands. The fix tallies the
cumulative energy transfer that it performs. See the "fix
thermal/conductivity"_fix_thermal_conductivity.html command for
details.
The third method is based on the Green-Kubo (GK) formula which relates
the ensemble average of the auto-correlation of the heat flux to
kappa. The heat flux can be calculated from the fluctuations of
per-atom potential and kinetic energies and per-atom stress tensor in
a steady-state equilibrated simulation. This is in contrast to the
two preceding non-equilibrium methods, where energy flows continuously
between hot and cold regions of the simulation box.
The "compute heat/flux"_compute_heat_flux.html command can calculate
the needed heat flux and describes how to implement the Green_Kubo
formalism using additional LAMMPS commands, such as the "fix
ave/correlate"_fix_ave_correlate.html command to calculate the needed
auto-correlation. See the doc page for the "compute
heat/flux"_compute_heat_flux.html command for an example input script
that calculates the thermal conductivity of solid Ar via the GK
formalism.
:line
6.21 Calculating viscosity :link(howto_21),h4
The shear viscosity eta of a fluid can be measured in at least 3 ways
using various options in LAMMPS. (See "this
section"_Section_howto.html#howto_20 of the manual for an analogous
discussion for thermal conductivity). Eta is a measure of the
propensity of a fluid to transmit momentum in a direction
perpendicular to the direction of velocity or momentum flow.
Alternatively it is the resistance the fluid has to being sheared. It
is given by
J = -eta grad(Vstream)
where J is the momentum flux in units of momentum per area per time.
and grad(Vstream) is the spatial gradient of the velocity of the fluid
moving in another direction, normal to the area through which the
momentum flows. Viscosity thus has units of pressure-time.
The first method is to perform a non-equlibrium MD (NEMD) simulation
by shearing the simulation box via the "fix deform"_fix_deform.html
command, and using the "fix nvt/sllod"_fix_nvt_sllod.html command to
thermostat the fluid via the SLLOD equations of motion. The velocity
profile setup in the fluid by this procedure can be monitored by the
"fix ave/spatial"_fix_ave_spatial.html command, which determines
grad(Vstream) in the equation above. E.g. the derivative in the
y-direction of the Vx component of fluid motion or grad(Vstream) =
dVx/dy. In this case, the Pxy off-diagonal component of the pressure
or stress tensor, as calculated by the "compute
pressure"_compute_pressure.html command, can also be monitored, which
is the J term in the equation above. See "this
section"_Section_howto.html#howto_13 of the manual for details on NEMD
simulations.
The second method is to perform a reverse non-equilibrium MD
simulation using the "fix viscosity"_fix_viscosity.html command which
implements the rNEMD algorithm of Muller-Plathe. Momentum in one
dimension is swapped between atoms in two different layers of the
simulation box in a different dimension. This induces a velocity
gradient which can be monitored with the "fix
ave/spatial"_fix_ave_spatial.html command. The fix tallies the
cummulative momentum transfer that it performs. See the "fix
viscosity"_fix_viscosity.html command for details.
The third method is based on the Green-Kubo (GK) formula which relates
the ensemble average of the auto-correlation of the stress/pressure
tensor to eta. This can be done in a steady-state equilibrated
simulation which is in contrast to the two preceding non-equilibrium
methods, where momentum flows continuously through the simulation box.
Here is an example input script that calculates the viscosity of
liquid Ar via the GK formalism:
# Sample LAMMPS input script for viscosity of liquid Ar :pre
units real
variable T equal 86.4956
variable V equal vol
variable dt equal 4.0
variable p equal 400 # correlation length
variable s equal 5 # sample interval
variable d equal $p*$s # dump interval :pre
# convert from LAMMPS real units to SI :pre
variable kB equal 1.3806504e-23 # \[J/K/] Boltzmann
variable atm2Pa equal 101325.0
variable A2m equal 1.0e-10
variable fs2s equal 1.0e-15
variable convert equal $\{atm2Pa\}*$\{atm2Pa\}*$\{fs2s\}*$\{A2m\}*$\{A2m\}*$\{A2m\} :pre
# setup problem :pre
dimension 3
boundary p p p
lattice fcc 5.376 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
region box block 0 4 0 4 0 4
create_box 1 box
create_atoms 1 box
mass 1 39.948
pair_style lj/cut 13.0
pair_coeff * * 0.2381 3.405
timestep $\{dt\}
thermo $d :pre
# equilibration and thermalization :pre
velocity all create $T 102486 mom yes rot yes dist gaussian
fix NVT all nvt temp $T $T 10 drag 0.2
run 8000 :pre
# viscosity calculation, switch to NVE if desired :pre
#unfix NVT
#fix NVE all nve :pre
reset_timestep 0
variable pxy equal pxy
variable pxz equal pxz
variable pyz equal pyz
fix SS all ave/correlate $s $p $d &
v_pxy v_pxz v_pyz type auto file S0St.dat ave running
variable scale equal $\{convert\}/($\{kB\}*$T)*$V*$s*$\{dt\}
variable v11 equal trap(f_SS\[3/])*$\{scale\}
variable v22 equal trap(f_SS\[4/])*$\{scale\}
variable v33 equal trap(f_SS\[5/])*$\{scale\}
thermo_style custom step temp press v_pxy v_pxz v_pyz v_v11 v_v22 v_v33
run 100000
variable v equal (v_v11+v_v22+v_v33)/3.0
variable ndens equal count(all)/vol
print "average viscosity: $v \[Pa.s/] @ $T K, $\{ndens\} /A^3" :pre
:line
:line
:link(Berendsen)
[(Berendsen)] Berendsen, Grigera, Straatsma, J Phys Chem, 91,
6269-6271 (1987).
:link(Cornell)
[(Cornell)] Cornell, Cieplak, Bayly, Gould, Merz, Ferguson,
Spellmeyer, Fox, Caldwell, Kollman, JACS 117, 5179-5197 (1995).
:link(Horn)
[(Horn)] Horn, Swope, Pitera, Madura, Dick, Hura, and Head-Gordon,
J Chem Phys, 120, 9665 (2004).
:link(Ikeshoji)
[(Ikeshoji)] Ikeshoji and Hafskjold, Molecular Physics, 81, 251-261
(1994).
:link(MacKerell)
[(MacKerell)] MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field,
Fischer, Gao, Guo, Ha, et al, J Phys Chem, 102, 3586 (1998).
:link(Mayo)
[(Mayo)] Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
(1990).
:link(Jorgensen)
[(Jorgensen)] Jorgensen, Chandrasekhar, Madura, Impey, Klein, J Chem
Phys, 79, 926 (1983).
:link(Price)
[(Price)] Price and Brooks, J Chem Phys, 121, 10096 (2004).
:link(Shinoda)
[(Shinoda)] Shinoda, Shiga, and Mikami, Phys Rev B, 69, 134103 (2004).
diff --git a/doc/Section_intro.html b/doc/Section_intro.html
index 815541a4b..9b278bfc8 100644
--- a/doc/Section_intro.html
+++ b/doc/Section_intro.html
@@ -1,541 +1,542 @@
<HTML>
<CENTER><A HREF = "Manual.html">Previous Section</A> - <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A> - <A HREF = "Section_start.html">Next Section</A>
</CENTER>
<HR>
<H3>1. Introduction
</H3>
<P>This section provides an overview of what LAMMPS can and can't do,
describes what it means for LAMMPS to be an open-source code, and
acknowledges the funding and people who have contributed to LAMMPS
over the years.
</P>
1.1 <A HREF = "#intro_1">What is LAMMPS</A><BR>
1.2 <A HREF = "#intro_2">LAMMPS features</A><BR>
1.3 <A HREF = "#intro_3">LAMMPS non-features</A><BR>
1.4 <A HREF = "#intro_4">Open source distribution</A><BR>
1.5 <A HREF = "#intro_5">Acknowledgments and citations</A> <BR>
<HR>
<HR>
<A NAME = "intro_1"></A><H4>1.1 What is LAMMPS
</H4>
<P>LAMMPS is a classical molecular dynamics code that models an ensemble
of particles in a liquid, solid, or gaseous state. It can model
atomic, polymeric, biological, metallic, granular, and coarse-grained
systems using a variety of force fields and boundary conditions.
</P>
<P>For examples of LAMMPS simulations, see the Publications page of the
<A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A>.
</P>
<P>LAMMPS runs efficiently on single-processor desktop or laptop
machines, but is designed for parallel computers. It will run on any
parallel machine that compiles C++ and supports the <A HREF = "http://www-unix.mcs.anl.gov/mpi">MPI</A>
message-passing library. This includes distributed- or shared-memory
parallel machines and Beowulf-style clusters.
</P>
<P>LAMMPS can model systems with only a few particles up to millions or
-billions. See <A HREF = "Section_perf.html">this section</A> for information on LAMMPS
-performance and scalability, or the Benchmarks section of the <A HREF = "http://lammps.sandia.gov">LAMMPS
-WWW Site</A>.
+billions. See <A HREF = "Section_perf.html">Section_perf</A> for information on
+LAMMPS performance and scalability, or the Benchmarks section of the
+<A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A>.
</P>
<P>LAMMPS is a freely-available open-source code, distributed under the
terms of the <A HREF = "http://www.gnu.org/copyleft/gpl.html">GNU Public License</A>, which means you can use or
-modify the code however you wish. See <A HREF = "#intro_4">this section</A> for a brief
-discussion of the open-source philosophy.
+modify the code however you wish. See <A HREF = "#intro_4">this section</A> for a
+brief discussion of the open-source philosophy.
</P>
<P>LAMMPS is designed to be easy to modify or extend with new
capabilities, such as new force fields, atom types, boundary
-conditions, or diagnostics. See <A HREF = "Section_modify.html">this section</A> for
-more details.
+conditions, or diagnostics. See <A HREF = "Section_modify.html">Section_modify</A>
+for more details.
</P>
<P>The current version of LAMMPS is written in C++. Earlier versions
-were written in F77 and F90. See <A HREF = "Section_history.html">this section</A>
-for more information on different versions. All versions can be
-downloaded from the <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A>.
+were written in F77 and F90. See
+<A HREF = "Section_history.html">Section_history</A> for more information on
+different versions. All versions can be downloaded from the <A HREF = "http://lammps.sandia.gov">LAMMPS
+WWW Site</A>.
</P>
<P>LAMMPS was originally developed under a US Department of Energy CRADA
(Cooperative Research and Development Agreement) between two DOE labs
and 3 companies. It is distributed by <A HREF = "http://www.sandia.gov">Sandia National Labs</A>.
See <A HREF = "#intro_5">this section</A> for more information on LAMMPS funding and
individuals who have contributed to LAMMPS.
</P>
<P>In the most general sense, LAMMPS integrates Newton's equations of
motion for collections of atoms, molecules, or macroscopic particles
that interact via short- or long-range forces with a variety of
initial and/or boundary conditions. For computational efficiency
LAMMPS uses neighbor lists to keep track of nearby particles. The
lists are optimized for systems with particles that are repulsive at
short distances, so that the local density of particles never becomes
too large. On parallel machines, LAMMPS uses spatial-decomposition
techniques to partition the simulation domain into small 3d
sub-domains, one of which is assigned to each processor. Processors
communicate and store "ghost" atom information for atoms that border
their sub-domain. LAMMPS is most efficient (in a parallel sense) for
systems whose particles fill a 3d rectangular box with roughly uniform
density. Papers with technical details of the algorithms used in
LAMMPS are listed in <A HREF = "#intro_5">this section</A>.
</P>
<HR>
<A NAME = "intro_2"></A><H4>1.2 LAMMPS features
</H4>
<P>This section highlights LAMMPS features, with pointers to specific
commands which give more details. If LAMMPS doesn't have your
favorite interatomic potential, boundary condition, or atom type, see
-<A HREF = "Section_modify.html">this section</A>, which describes how you can add it to
-LAMMPS.
+<A HREF = "Section_modify.html">Section_modify</A>, which describes how you can add
+it to LAMMPS.
</P>
<H4>General features
</H4>
<UL><LI> runs on a single processor or in parallel
<LI> distributed-memory message-passing parallelism (MPI)
<LI> spatial-decomposition of simulation domain for parallelism
<LI> open-source distribution
<LI> highly portable C++
<LI> optional libraries used: MPI and single-processor FFT
<LI> easy to extend with new features and functionality
<LI> runs from an input script
<LI> syntax for defining and using variables and formulas
<LI> syntax for looping over runs and breaking out of loops
<LI> run one or multiple simulations simultaneously (in parallel) from one script
<LI> build as library, invoke LAMMPS thru library interface or provided Python wrapper
<LI> couple with other codes: LAMMPS calls other code, other code calls LAMMPS, umbrella code calls both
</UL>
<H4>Particle and model types
</H4>
<P>(<A HREF = "atom_style.html">atom style</A> command)
</P>
<UL><LI> atoms
<LI> coarse-grained particles (e.g. bead-spring polymers)
<LI> united-atom polymers or organic molecules
<LI> all-atom polymers, organic molecules, proteins, DNA
<LI> metals
<LI> granular materials
<LI> coarse-grained mesoscale models
<LI> finite-size spherical and ellipsoidal particles
<LI> finite-size line segment (2d) and triangle (3d) particles
<LI> point dipolar particles
<LI> rigid collections of particles
<LI> hybrid combinations of these
</UL>
<H4>Force fields
</H4>
<P>(<A HREF = "pair_style.html">pair style</A>, <A HREF = "bond_style.html">bond style</A>,
<A HREF = "angle_style.html">angle style</A>, <A HREF = "dihedral_style.html">dihedral style</A>,
<A HREF = "improper_style.html">improper style</A>, <A HREF = "kspace_style.html">kspace style</A>
commands)
</P>
<UL><LI> pairwise potentials: Lennard-Jones, Buckingham, Morse, Born-Mayer-Huggins, Yukawa, soft, class 2 (COMPASS), hydrogen bond, tabulated
<LI> charged pairwise potentials: Coulombic, point-dipole
<LI> manybody potentials: EAM, Finnis/Sinclair EAM, modified EAM (MEAM), embedded ion method (EIM), EDIP, ADP, Stillinger-Weber, Tersoff, REBO, AIREBO, ReaxFF, COMB
<LI> electron force field (eFF, AWPMD)
<LI> coarse-grained potentials: DPD, GayBerne, REsquared, colloidal, DLVO
<LI> mesoscopic potentials: granular, Peridynamics, SPH
<LI> bond potentials: harmonic, FENE, Morse, nonlinear, class 2, quartic (breakable)
<LI> angle potentials: harmonic, CHARMM, cosine, cosine/squared, cosine/periodic, class 2 (COMPASS)
<LI> dihedral potentials: harmonic, CHARMM, multi-harmonic, helix, class 2 (COMPASS), OPLS
<LI> improper potentials: harmonic, cvff, umbrella, class 2 (COMPASS)
<LI> polymer potentials: all-atom, united-atom, bead-spring, breakable
<LI> water potentials: TIP3P, TIP4P, SPC
<LI> implicit solvent potentials: hydrodynamic lubrication, Debye
-<LI> long-range Coulombics and dispersion: Ewald, PPPM (similar to particle-mesh Ewald), Ewald/N for long-range Lennard-Jones
+<LI> long-range Coulombics and dispersion: Ewald, Wolf, PPPM (similar to particle-mesh Ewald), Ewald/N for long-range Lennard-Jones
<LI> force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
<LI> handful of GPU-enabled pair styles
</UL>
<P> hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation
overlaid potentials: superposition of multiple pair potentials
</P>
<H4>Atom creation
</H4>
<P>(<A HREF = "read_data.html">read_data</A>, <A HREF = "lattice.html">lattice</A>,
<A HREF = "create_atoms.html">create_atoms</A>, <A HREF = "delete_atoms.html">delete_atoms</A>,
<A HREF = "displace_atoms.html">displace_atoms</A>, <A HREF = "replicate.html">replicate</A> commands)
</P>
<UL><LI> read in atom coords from files
<LI> create atoms on one or more lattices (e.g. grain boundaries)
<LI> delete geometric or logical groups of atoms (e.g. voids)
<LI> replicate existing atoms multiple times
<LI> displace atoms
</UL>
<H4>Ensembles, constraints, and boundary conditions
</H4>
<P>(<A HREF = "fix.html">fix</A> command)
</P>
<UL><LI> 2d or 3d systems
<LI> orthogonal or non-orthogonal (triclinic symmetry) simulation domains
<LI> constant NVE, NVT, NPT, NPH, Parinello/Rahman integrators
<LI> thermostatting options for groups and geometric regions of atoms
<LI> pressure control via Nose/Hoover or Berendsen barostatting in 1 to 3 dimensions
<LI> simulation box deformation (tensile and shear)
<LI> harmonic (umbrella) constraint forces
<LI> rigid body constraints
<LI> SHAKE bond and angle constraints
<LI> bond breaking, formation, swapping
<LI> walls of various kinds
<LI> non-equilibrium molecular dynamics (NEMD)
<LI> variety of additional boundary conditions and constraints
</UL>
<H4>Integrators
</H4>
<P>(<A HREF = "run.html">run</A>, <A HREF = "run_style.html">run_style</A>, <A HREF = "minimize.html">minimize</A> commands)
</P>
<UL><LI> velocity-Verlet integrator
<LI> Brownian dynamics
<LI> rigid body integration
<LI> energy minimization via conjugate gradient or steepest descent relaxation
<LI> rRESPA hierarchical timestepping
</UL>
<H4>Diagnostics
</H4>
<UL><LI> see the various flavors of the <A HREF = "fix.html">fix</A> and <A HREF = "compute.html">compute</A> commands
</UL>
<H4>Output
</H4>
<P>(<A HREF = "dump.html">dump</A>, <A HREF = "restart.html">restart</A> commands)
</P>
<UL><LI> log file of thermodynamic info
<LI> text dump files of atom coords, velocities, other per-atom quantities
<LI> binary restart files
<LI> parallel I/O of dump and restart files
<LI> per-atom quantities (energy, stress, centro-symmetry parameter, CNA, etc)
<LI> user-defined system-wide (log file) or per-atom (dump file) calculations
<LI> spatial and time averaging of per-atom quantities
<LI> time averaging of system-wide quantities
<LI> atom snapshots in native, XYZ, XTC, DCD, CFG formats
</UL>
<H4>Multi-replica models
</H4>
<P><A HREF = "neb.html">nudged elastic band</A>
<A HREF = "prd.html">parallel replica dynamics</A>
<A HREF = "tad.html">temperature accelerated dynamics</A>
<A HREF = "temper.html">parallel tempering</A>
</P>
<H4>Pre- and post-processing
</H4>
<UL><LI>Various pre- and post-processing serial tools are packaged
with LAMMPS; see these <A HREF = "Section_tools.html">doc pages</A>.
<LI>Our group has also written and released a separate toolkit called
<A HREF = "http://www.sandia.gov/~sjplimp/pizza.html">Pizza.py</A> which provides tools for doing setup, analysis,
plotting, and visualization for LAMMPS simulations. Pizza.py is
written in <A HREF = "http://www.python.org">Python</A> and is available for download from <A HREF = "http://www.sandia.gov/~sjplimp/pizza.html">the
Pizza.py WWW site</A>.
</UL>
<H4>Specialized features
</H4>
<P>These are LAMMPS capabilities which you may not think of as typical
molecular dynamics options:
</P>
<UL><LI><A HREF = "fix_srd.html">stochastic rotation dynamics (SRD)</A>
<LI><A HREF = "fix_imd.html">real-time visualization and interactive MD</A>
<LI><A HREF = "fix_atc.html">atom-to-continuum coupling</A> with finite elements
<LI>coupled rigid body integration via the <A HREF = "fix_poems.html">POEMS</A> library
<LI><A HREF = "doc/fix_gcmc.html">grand canonical Monte Carlo</A> insertions/deletions
<LI><A HREF = "pair_dsmc.html">Direct Simulation Monte Carlo</A> for low-density fluids
<LI><A HREF = "pair_peri.html">Peridynamics mesoscale modeling</A>
<LI><A HREF = "fix_tmd.html">targeted</A> and <A HREF = "fix_smd.html">steered</A> molecular dynamics
<LI><A HREF = "fix_ttm.html">two-temperature electron model</A>
</UL>
<HR>
<A NAME = "intro_3"></A><H4>1.3 LAMMPS non-features
</H4>
<P>LAMMPS is designed to efficiently compute Newton's equations of motion
for a system of interacting particles. Many of the tools needed to
pre- and post-process the data for such simulations are not included
in the LAMMPS kernel for several reasons:
</P>
<UL><LI>the desire to keep LAMMPS simple
<LI>they are not parallel operations
<LI>other codes already do them
<LI>limited development resources
</UL>
<P>Specifically, LAMMPS itself does not:
</P>
<UL><LI>run thru a GUI
<LI>build molecular systems
<LI>assign force-field coefficients automagically
<LI>perform sophisticated analyses of your MD simulation
<LI>visualize your MD simulation
<LI>plot your output data
</UL>
<P>A few tools for pre- and post-processing tasks are provided as part of
the LAMMPS package; they are described in <A HREF = "Section_tools.html">this
section</A>. However, many people use other codes or
write their own tools for these tasks.
</P>
<P>As noted above, our group has also written and released a separate
toolkit called <A HREF = "http://www.sandia.gov/~sjplimp/pizza.html">Pizza.py</A> which addresses some of the listed
bullets. It provides tools for doing setup, analysis, plotting, and
visualization for LAMMPS simulations. Pizza.py is written in
<A HREF = "http://www.python.org">Python</A> and is available for download from <A HREF = "http://www.sandia.gov/~sjplimp/pizza.html">the Pizza.py WWW
site</A>.
</P>
<P>LAMMPS requires as input a list of initial atom coordinates and types,
molecular topology information, and force-field coefficients assigned
to all atoms and bonds. LAMMPS will not build molecular systems and
assign force-field parameters for you.
</P>
<P>For atomic systems LAMMPS provides a <A HREF = "create_atoms.html">create_atoms</A>
command which places atoms on solid-state lattices (fcc, bcc,
user-defined, etc). Assigning small numbers of force field
coefficients can be done via the <A HREF = "pair_coeff.html">pair coeff</A>, <A HREF = "bond_coeff.html">bond
coeff</A>, <A HREF = "angle_coeff.html">angle coeff</A>, etc commands.
For molecular systems or more complicated simulation geometries, users
typically use another code as a builder and convert its output to
LAMMPS input format, or write their own code to generate atom
coordinate and molecular topology for LAMMPS to read in.
</P>
<P>For complicated molecular systems (e.g. a protein), a multitude of
topology information and hundreds of force-field coefficients must
typically be specified. We suggest you use a program like
<A HREF = "http://www.scripps.edu/brooks">CHARMM</A> or <A HREF = "http://amber.scripps.edu">AMBER</A> or other molecular builders to setup
such problems and dump its information to a file. You can then
reformat the file as LAMMPS input. Some of the tools in <A HREF = "Section_tools.html">this
section</A> can assist in this process.
</P>
<P>Similarly, LAMMPS creates output files in a simple format. Most users
post-process these files with their own analysis tools or re-format
them for input into other programs, including visualization packages.
If you are convinced you need to compute something on-the-fly as
-LAMMPS runs, see <A HREF = "Section_modify.html">this section</A> for a discussion
+LAMMPS runs, see <A HREF = "Section_modify.html">Section_modify</A> for a discussion
of how you can use the <A HREF = "dump.html">dump</A> and <A HREF = "compute.html">compute</A> and
<A HREF = "fix.html">fix</A> commands to print out data of your choosing. Keep in
mind that complicated computations can slow down the molecular
dynamics timestepping, particularly if the computations are not
parallel, so it is often better to leave such analysis to
post-processing codes.
</P>
<P>A very simple (yet fast) visualizer is provided with the LAMMPS
package - see the <A HREF = "Section_tools.html#xmovie">xmovie</A> tool in <A HREF = "Section_tools.html">this
section</A>. It creates xyz projection views of
atomic coordinates and animates them. We find it very useful for
debugging purposes. For high-quality visualization we recommend the
following packages:
</P>
<UL><LI><A HREF = "http://www.ks.uiuc.edu/Research/vmd">VMD</A>
<LI><A HREF = "http://mt.seas.upenn.edu/Archive/Graphics/A">AtomEye</A>
<LI><A HREF = "http://pymol.sourceforge.net">PyMol</A>
<LI><A HREF = "http://www.bmsc.washington.edu/raster3d/raster3d.html">Raster3d</A>
<LI><A HREF = "http://www.openrasmol.org">RasMol</A>
</UL>
<P>Other features that LAMMPS does not yet (and may never) support are
-discussed in <A HREF = "Section_history.html">this section</A>.
+discussed in <A HREF = "Section_history.html">Section_history</A>.
</P>
<P>Finally, these are freely-available molecular dynamics codes, most of
them parallel, which may be well-suited to the problems you want to
model. They can also be used in conjunction with LAMMPS to perform
complementary modeling tasks.
</P>
<UL><LI><A HREF = "http://www.scripps.edu/brooks">CHARMM</A>
<LI><A HREF = "http://amber.scripps.edu">AMBER</A>
<LI><A HREF = "http://www.ks.uiuc.edu/Research/namd/">NAMD</A>
<LI><A HREF = "http://www.emsl.pnl.gov/docs/nwchem/nwchem.html">NWCHEM</A>
<LI><A HREF = "http://www.cse.clrc.ac.uk/msi/software/DL_POLY">DL_POLY</A>
<LI><A HREF = "http://dasher.wustl.edu/tinker">Tinker</A>
</UL>
<P>CHARMM, AMBER, NAMD, NWCHEM, and Tinker are designed primarily for
modeling biological molecules. CHARMM and AMBER use
atom-decomposition (replicated-data) strategies for parallelism; NAMD
and NWCHEM use spatial-decomposition approaches, similar to LAMMPS.
Tinker is a serial code. DL_POLY includes potentials for a variety of
biological and non-biological materials; both a replicated-data and
spatial-decomposition version exist.
</P>
<HR>
<A NAME = "intro_4"></A><H4>1.4 Open source distribution
</H4>
<P>LAMMPS comes with no warranty of any kind. As each source file states
in its header, it is a copyrighted code that is distributed free-of-
charge, under the terms of the <A HREF = "http://www.gnu.org/copyleft/gpl.html">GNU Public License</A> (GPL). This
is often referred to as open-source distribution - see
<A HREF = "http://www.gnu.org">www.gnu.org</A> or <A HREF = "http://www.opensource.org">www.opensource.org</A> for more
details. The legal text of the GPL is in the LICENSE file that is
included in the LAMMPS distribution.
</P>
<P>Here is a summary of what the GPL means for LAMMPS users:
</P>
<P>(1) Anyone is free to use, modify, or extend LAMMPS in any way they
choose, including for commercial purposes.
</P>
<P>(2) If you distribute a modified version of LAMMPS, it must remain
open-source, meaning you distribute it under the terms of the GPL.
You should clearly annotate such a code as a derivative version of
LAMMPS.
</P>
<P>(3) If you release any code that includes LAMMPS source code, then it
must also be open-sourced, meaning you distribute it under the terms
of the GPL.
</P>
<P>(4) If you give LAMMPS files to someone else, the GPL LICENSE file and
source file headers (including the copyright and GPL notices) should
remain part of the code.
</P>
<P>In the spirit of an open-source code, these are various ways you can
contribute to making LAMMPS better. You can send email to the
<A HREF = "http://lammps.sandia.gov/authors.html">developers</A> on any of these
items.
</P>
<UL><LI>Point prospective users to the <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A>. Mention it in
talks or link to it from your WWW site.
<LI>If you find an error or omission in this manual or on the <A HREF = "http://lammps.sandia.gov">LAMMPS WWW
Site</A>, or have a suggestion for something to clarify or include,
send an email to the
<A HREF = "http://lammps.sandia.gov/authors.html">developers</A>.
-<LI>If you find a bug, <A HREF = "Section_errors.html#err_2">this section</A> describes
-how to report it.
+<LI>If you find a bug, <A HREF = "Section_errors.html#err_2">Section_errors 2</A>
+describes how to report it.
<LI>If you publish a paper using LAMMPS results, send the citation (and
any cool pictures or movies if you like) to add to the Publications,
Pictures, and Movies pages of the <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A>, with links
and attributions back to you.
<LI>Create a new Makefile.machine that can be added to the src/MAKE
directory.
<LI>The tools sub-directory of the LAMMPS distribution has various
stand-alone codes for pre- and post-processing of LAMMPS data. More
-details are given in <A HREF = "Section_tools.html">this section</A>. If you write
+details are given in <A HREF = "Section_tools.html">Section_tools</A>. If you write
a new tool that users will find useful, it can be added to the LAMMPS
distribution.
<LI>LAMMPS is designed to be easy to extend with new code for features
like potentials, boundary conditions, diagnostic computations, etc.
<A HREF = "Section_modify.html">This section</A> gives details. If you add a
feature of general interest, it can be added to the LAMMPS
distribution.
<LI>The Benchmark page of the <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> lists LAMMPS
performance on various platforms. The files needed to run the
benchmarks are part of the LAMMPS distribution. If your machine is
sufficiently different from those listed, your timing data can be
added to the page.
<LI>You can send feedback for the User Comments page of the <A HREF = "http://lammps.sandia.gov">LAMMPS WWW
Site</A>. It might be added to the page. No promises.
<LI>Cash. Small denominations, unmarked bills preferred. Paper sack OK.
Leave on desk. VISA also accepted. Chocolate chip cookies
encouraged.
</UL>
<HR>
<H4><A NAME = "intro_5"></A>1.5 Acknowledgments and citations
</H4>
<P>LAMMPS development has been funded by the <A HREF = "http://www.doe.gov">US Department of
Energy</A> (DOE), through its CRADA, LDRD, ASCI, and Genomes-to-Life
programs and its <A HREF = "http://www.sc.doe.gov/ascr/home.html">OASCR</A> and <A HREF = "http://www.er.doe.gov/production/ober/ober_top.html">OBER</A> offices.
</P>
<P>Specifically, work on the latest version was funded in part by the US
Department of Energy's Genomics:GTL program
(<A HREF = "http://www.doegenomestolife.org">www.doegenomestolife.org</A>) under the <A HREF = "http://www.genomes2life.org">project</A>, "Carbon
Sequestration in Synechococcus Sp.: From Molecular Machines to
Hierarchical Modeling".
</P>
<P>The following paper describe the basic parallel algorithms used in
LAMMPS. If you use LAMMPS results in your published work, please cite
this paper and include a pointer to the <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A>
(http://lammps.sandia.gov):
</P>
<P>S. J. Plimpton, <B>Fast Parallel Algorithms for Short-Range Molecular
Dynamics</B>, J Comp Phys, 117, 1-19 (1995).
</P>
<P>Other papers describing specific algorithms used in LAMMPS are listed
under the <A HREF = "http://lammps.sandia.gov/cite.html">Citing LAMMPS link</A> of
the LAMMPS WWW page.
</P>
<P>The <A HREF = "http://lammps.sandia.gov/papers.html">Publications link</A> on the
LAMMPS WWW page lists papers that have cited LAMMPS. If your paper is
not listed there for some reason, feel free to send us the info. If
the simulations in your paper produced cool pictures or animations,
we'll be pleased to add them to the
<A HREF = "http://lammps.sandia.gov/pictures.html">Pictures</A> or
<A HREF = "http://lammps.sandia.gov/movies.html">Movies</A> pages of the LAMMPS WWW
site.
</P>
<P>The core group of LAMMPS developers is at Sandia National Labs:
</P>
<UL><LI>Steve Plimpton, sjplimp at sandia.gov
<LI>Aidan Thompson, athomps at sandia.gov
<LI>Paul Crozier, pscrozi at sandia.gov
</UL>
<P>The following folks are responsible for significant contributions to
the code, or other aspects of the LAMMPS development effort. Many of
the packages they have written are somewhat unique to LAMMPS and the
code would not be as general-purpose as it is without their expertise
and efforts.
</P>
<UL><LI>Axel Kohlmeyer (Temple U), akohlmey at gmail.com, SVN and Git repositories, indefatigable mail list responder, USER-CG-CMM and USER-OMP packages
<LI>Roy Pollock (LLNL), Ewald and PPPM solvers
<LI>Mike Brown (ORNL), brownw at ornl.gov, GPU package
<LI>Greg Wagner (Sandia), gjwagne at sandia.gov, MEAM package for MEAM potential
<LI>Mike Parks (Sandia), mlparks at sandia.gov, PERI package for Peridynamics
<LI>Rudra Mukherjee (JPL), Rudranarayan.M.Mukherjee at jpl.nasa.gov, POEMS package for articulated rigid body motion
<LI>Reese Jones (Sandia) and collaborators, rjones at sandia.gov, USER-ATC package for atom/continuum coupling
<LI>Ilya Valuev (JIHT), valuev at physik.hu-berlin.de, USER-AWPMD package for wave-packet MD
<LI>Christian Trott (U Tech Ilmenau), christian.trott at tu-ilmenau.de, USER-CUDA package
<LI>Andres Jaramillo-Botero (Caltech), ajaramil at wag.caltech.edu, USER-EFF package for electron force field
<LI>Pieter in' t Veld (BASF), pieter.intveld at basf.com, USER-EWALDN package for 1/r^N long-range solvers
<LI>Christoph Kloss (JKU), Christoph.Kloss at jku.at, USER-LIGGGHTS package for granular models and granular/fluid coupling
<LI>Metin Aktulga (LBL), hmaktulga at lbl.gov, USER-REAXC package for C version of ReaxFF
<LI>Georg Gunzenmuller (EMI), georg.ganzenmueller at emi.fhg.de, USER-SPH package
</UL>
-<P>As discussed in <A HREF = "Section_history.html">this section</A>, LAMMPS originated
-as a cooperative project between DOE labs and industrial
+<P>As discussed in <A HREF = "Section_history.html">Section_history</A>, LAMMPS
+originated as a cooperative project between DOE labs and industrial
partners. Folks involved in the design and testing of the original
version of LAMMPS were the following:
</P>
<UL><LI>John Carpenter (Mayo Clinic, formerly at Cray Research)
<LI>Terry Stouch (Lexicon Pharmaceuticals, formerly at Bristol Myers Squibb)
<LI>Steve Lustig (Dupont)
<LI>Jim Belak (LLNL)
</UL>
</HTML>
diff --git a/doc/Section_intro.txt b/doc/Section_intro.txt
index 53158cc39..bebab7a73 100644
--- a/doc/Section_intro.txt
+++ b/doc/Section_intro.txt
@@ -1,524 +1,525 @@
"Previous Section"_Manual.html - "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next Section"_Section_start.html :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
1. Introduction :h3
This section provides an overview of what LAMMPS can and can't do,
describes what it means for LAMMPS to be an open-source code, and
acknowledges the funding and people who have contributed to LAMMPS
over the years.
1.1 "What is LAMMPS"_#intro_1
1.2 "LAMMPS features"_#intro_2
1.3 "LAMMPS non-features"_#intro_3
1.4 "Open source distribution"_#intro_4
1.5 "Acknowledgments and citations"_#intro_5 :all(b)
:line
:line
1.1 What is LAMMPS :link(intro_1),h4
LAMMPS is a classical molecular dynamics code that models an ensemble
of particles in a liquid, solid, or gaseous state. It can model
atomic, polymeric, biological, metallic, granular, and coarse-grained
systems using a variety of force fields and boundary conditions.
For examples of LAMMPS simulations, see the Publications page of the
"LAMMPS WWW Site"_lws.
LAMMPS runs efficiently on single-processor desktop or laptop
machines, but is designed for parallel computers. It will run on any
parallel machine that compiles C++ and supports the "MPI"_mpi
message-passing library. This includes distributed- or shared-memory
parallel machines and Beowulf-style clusters.
:link(mpi,http://www-unix.mcs.anl.gov/mpi)
LAMMPS can model systems with only a few particles up to millions or
-billions. See "this section"_Section_perf.html for information on LAMMPS
-performance and scalability, or the Benchmarks section of the "LAMMPS
-WWW Site"_lws.
+billions. See "Section_perf"_Section_perf.html for information on
+LAMMPS performance and scalability, or the Benchmarks section of the
+"LAMMPS WWW Site"_lws.
LAMMPS is a freely-available open-source code, distributed under the
terms of the "GNU Public License"_gnu, which means you can use or
-modify the code however you wish. See "this section"_#intro_4 for a brief
-discussion of the open-source philosophy.
+modify the code however you wish. See "this section"_#intro_4 for a
+brief discussion of the open-source philosophy.
:link(gnu,http://www.gnu.org/copyleft/gpl.html)
LAMMPS is designed to be easy to modify or extend with new
capabilities, such as new force fields, atom types, boundary
-conditions, or diagnostics. See "this section"_Section_modify.html for
-more details.
+conditions, or diagnostics. See "Section_modify"_Section_modify.html
+for more details.
The current version of LAMMPS is written in C++. Earlier versions
-were written in F77 and F90. See "this section"_Section_history.html
-for more information on different versions. All versions can be
-downloaded from the "LAMMPS WWW Site"_lws.
+were written in F77 and F90. See
+"Section_history"_Section_history.html for more information on
+different versions. All versions can be downloaded from the "LAMMPS
+WWW Site"_lws.
LAMMPS was originally developed under a US Department of Energy CRADA
(Cooperative Research and Development Agreement) between two DOE labs
and 3 companies. It is distributed by "Sandia National Labs"_snl.
See "this section"_#intro_5 for more information on LAMMPS funding and
individuals who have contributed to LAMMPS.
:link(snl,http://www.sandia.gov)
In the most general sense, LAMMPS integrates Newton's equations of
motion for collections of atoms, molecules, or macroscopic particles
that interact via short- or long-range forces with a variety of
initial and/or boundary conditions. For computational efficiency
LAMMPS uses neighbor lists to keep track of nearby particles. The
lists are optimized for systems with particles that are repulsive at
short distances, so that the local density of particles never becomes
too large. On parallel machines, LAMMPS uses spatial-decomposition
techniques to partition the simulation domain into small 3d
sub-domains, one of which is assigned to each processor. Processors
communicate and store "ghost" atom information for atoms that border
their sub-domain. LAMMPS is most efficient (in a parallel sense) for
systems whose particles fill a 3d rectangular box with roughly uniform
density. Papers with technical details of the algorithms used in
LAMMPS are listed in "this section"_#intro_5.
:line
1.2 LAMMPS features :link(intro_2),h4
This section highlights LAMMPS features, with pointers to specific
commands which give more details. If LAMMPS doesn't have your
favorite interatomic potential, boundary condition, or atom type, see
-"this section"_Section_modify.html, which describes how you can add it to
-LAMMPS.
+"Section_modify"_Section_modify.html, which describes how you can add
+it to LAMMPS.
General features :h4
runs on a single processor or in parallel
distributed-memory message-passing parallelism (MPI)
spatial-decomposition of simulation domain for parallelism
open-source distribution
highly portable C++
optional libraries used: MPI and single-processor FFT
easy to extend with new features and functionality
runs from an input script
syntax for defining and using variables and formulas
syntax for looping over runs and breaking out of loops
run one or multiple simulations simultaneously (in parallel) from one script
build as library, invoke LAMMPS thru library interface or provided Python wrapper
couple with other codes: LAMMPS calls other code, other code calls LAMMPS, umbrella code calls both :ul
Particle and model types :h4
("atom style"_atom_style.html command)
atoms
coarse-grained particles (e.g. bead-spring polymers)
united-atom polymers or organic molecules
all-atom polymers, organic molecules, proteins, DNA
metals
granular materials
coarse-grained mesoscale models
finite-size spherical and ellipsoidal particles
finite-size line segment (2d) and triangle (3d) particles
point dipolar particles
rigid collections of particles
hybrid combinations of these :ul
Force fields :h4
("pair style"_pair_style.html, "bond style"_bond_style.html,
"angle style"_angle_style.html, "dihedral style"_dihedral_style.html,
"improper style"_improper_style.html, "kspace style"_kspace_style.html
commands)
pairwise potentials: Lennard-Jones, Buckingham, Morse, Born-Mayer-Huggins, \
Yukawa, soft, class 2 (COMPASS), hydrogen bond, tabulated
charged pairwise potentials: Coulombic, point-dipole
manybody potentials: EAM, Finnis/Sinclair EAM, modified EAM (MEAM), \
embedded ion method (EIM), EDIP, ADP, Stillinger-Weber, Tersoff, REBO, AIREBO, ReaxFF, COMB
electron force field (eFF, AWPMD)
coarse-grained potentials: DPD, GayBerne, REsquared, colloidal, DLVO
mesoscopic potentials: granular, Peridynamics, SPH
bond potentials: harmonic, FENE, Morse, nonlinear, class 2, \
quartic (breakable)
angle potentials: harmonic, CHARMM, cosine, cosine/squared, cosine/periodic, \
class 2 (COMPASS)
dihedral potentials: harmonic, CHARMM, multi-harmonic, helix, \
class 2 (COMPASS), OPLS
improper potentials: harmonic, cvff, umbrella, class 2 (COMPASS)
polymer potentials: all-atom, united-atom, bead-spring, breakable
water potentials: TIP3P, TIP4P, SPC
implicit solvent potentials: hydrodynamic lubrication, Debye
- long-range Coulombics and dispersion: Ewald, \
+ long-range Coulombics and dispersion: Ewald, Wolf, \
PPPM (similar to particle-mesh Ewald), Ewald/N for long-range Lennard-Jones
force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
handful of GPU-enabled pair styles :ul
hybrid potentials: multiple pair, bond, angle, dihedral, improper \
potentials can be used in one simulation
overlaid potentials: superposition of multiple pair potentials
Atom creation :h4
("read_data"_read_data.html, "lattice"_lattice.html,
"create_atoms"_create_atoms.html, "delete_atoms"_delete_atoms.html,
"displace_atoms"_displace_atoms.html, "replicate"_replicate.html commands)
read in atom coords from files
create atoms on one or more lattices (e.g. grain boundaries)
delete geometric or logical groups of atoms (e.g. voids)
replicate existing atoms multiple times
displace atoms :ul
Ensembles, constraints, and boundary conditions :h4
("fix"_fix.html command)
2d or 3d systems
orthogonal or non-orthogonal (triclinic symmetry) simulation domains
constant NVE, NVT, NPT, NPH, Parinello/Rahman integrators
thermostatting options for groups and geometric regions of atoms
pressure control via Nose/Hoover or Berendsen barostatting in 1 to 3 dimensions
simulation box deformation (tensile and shear)
harmonic (umbrella) constraint forces
rigid body constraints
SHAKE bond and angle constraints
bond breaking, formation, swapping
walls of various kinds
non-equilibrium molecular dynamics (NEMD)
variety of additional boundary conditions and constraints :ul
Integrators :h4
("run"_run.html, "run_style"_run_style.html, "minimize"_minimize.html commands)
velocity-Verlet integrator
Brownian dynamics
rigid body integration
energy minimization via conjugate gradient or steepest descent relaxation
rRESPA hierarchical timestepping :ul
Diagnostics :h4
see the various flavors of the "fix"_fix.html and "compute"_compute.html commands :ul
Output :h4
("dump"_dump.html, "restart"_restart.html commands)
log file of thermodynamic info
text dump files of atom coords, velocities, other per-atom quantities
binary restart files
parallel I/O of dump and restart files
per-atom quantities (energy, stress, centro-symmetry parameter, CNA, etc)
user-defined system-wide (log file) or per-atom (dump file) calculations
spatial and time averaging of per-atom quantities
time averaging of system-wide quantities
atom snapshots in native, XYZ, XTC, DCD, CFG formats :ul
Multi-replica models :h4
"nudged elastic band"_neb.html
"parallel replica dynamics"_prd.html
"temperature accelerated dynamics"_tad.html
"parallel tempering"_temper.html
Pre- and post-processing :h4
Various pre- and post-processing serial tools are packaged
with LAMMPS; see these "doc pages"_Section_tools.html. :ulb,l
Our group has also written and released a separate toolkit called
"Pizza.py"_pizza which provides tools for doing setup, analysis,
plotting, and visualization for LAMMPS simulations. Pizza.py is
written in "Python"_python and is available for download from "the
Pizza.py WWW site"_pizza. :l,ule
:link(pizza,http://www.sandia.gov/~sjplimp/pizza.html)
:link(python,http://www.python.org)
Specialized features :h4
These are LAMMPS capabilities which you may not think of as typical
molecular dynamics options:
"stochastic rotation dynamics (SRD)"_fix_srd.html
"real-time visualization and interactive MD"_fix_imd.html
"atom-to-continuum coupling"_fix_atc.html with finite elements
coupled rigid body integration via the "POEMS"_fix_poems.html library
"grand canonical Monte Carlo"_doc/fix_gcmc.html insertions/deletions
"Direct Simulation Monte Carlo"_pair_dsmc.html for low-density fluids
"Peridynamics mesoscale modeling"_pair_peri.html
"targeted"_fix_tmd.html and "steered"_fix_smd.html molecular dynamics
"two-temperature electron model"_fix_ttm.html :ul
:line
1.3 LAMMPS non-features :link(intro_3),h4
LAMMPS is designed to efficiently compute Newton's equations of motion
for a system of interacting particles. Many of the tools needed to
pre- and post-process the data for such simulations are not included
in the LAMMPS kernel for several reasons:
the desire to keep LAMMPS simple
they are not parallel operations
other codes already do them
limited development resources :ul
Specifically, LAMMPS itself does not:
run thru a GUI
build molecular systems
assign force-field coefficients automagically
perform sophisticated analyses of your MD simulation
visualize your MD simulation
plot your output data :ul
A few tools for pre- and post-processing tasks are provided as part of
the LAMMPS package; they are described in "this
section"_Section_tools.html. However, many people use other codes or
write their own tools for these tasks.
As noted above, our group has also written and released a separate
toolkit called "Pizza.py"_pizza which addresses some of the listed
bullets. It provides tools for doing setup, analysis, plotting, and
visualization for LAMMPS simulations. Pizza.py is written in
"Python"_python and is available for download from "the Pizza.py WWW
site"_pizza.
LAMMPS requires as input a list of initial atom coordinates and types,
molecular topology information, and force-field coefficients assigned
to all atoms and bonds. LAMMPS will not build molecular systems and
assign force-field parameters for you.
For atomic systems LAMMPS provides a "create_atoms"_create_atoms.html
command which places atoms on solid-state lattices (fcc, bcc,
user-defined, etc). Assigning small numbers of force field
coefficients can be done via the "pair coeff"_pair_coeff.html, "bond
coeff"_bond_coeff.html, "angle coeff"_angle_coeff.html, etc commands.
For molecular systems or more complicated simulation geometries, users
typically use another code as a builder and convert its output to
LAMMPS input format, or write their own code to generate atom
coordinate and molecular topology for LAMMPS to read in.
For complicated molecular systems (e.g. a protein), a multitude of
topology information and hundreds of force-field coefficients must
typically be specified. We suggest you use a program like
"CHARMM"_charmm or "AMBER"_amber or other molecular builders to setup
such problems and dump its information to a file. You can then
reformat the file as LAMMPS input. Some of the tools in "this
section"_Section_tools.html can assist in this process.
Similarly, LAMMPS creates output files in a simple format. Most users
post-process these files with their own analysis tools or re-format
them for input into other programs, including visualization packages.
If you are convinced you need to compute something on-the-fly as
-LAMMPS runs, see "this section"_Section_modify.html for a discussion
+LAMMPS runs, see "Section_modify"_Section_modify.html for a discussion
of how you can use the "dump"_dump.html and "compute"_compute.html and
"fix"_fix.html commands to print out data of your choosing. Keep in
mind that complicated computations can slow down the molecular
dynamics timestepping, particularly if the computations are not
parallel, so it is often better to leave such analysis to
post-processing codes.
A very simple (yet fast) visualizer is provided with the LAMMPS
package - see the "xmovie"_Section_tools.html#xmovie tool in "this
section"_Section_tools.html. It creates xyz projection views of
atomic coordinates and animates them. We find it very useful for
debugging purposes. For high-quality visualization we recommend the
following packages:
"VMD"_http://www.ks.uiuc.edu/Research/vmd
"AtomEye"_http://mt.seas.upenn.edu/Archive/Graphics/A
"PyMol"_http://pymol.sourceforge.net
"Raster3d"_http://www.bmsc.washington.edu/raster3d/raster3d.html
"RasMol"_http://www.openrasmol.org :ul
Other features that LAMMPS does not yet (and may never) support are
-discussed in "this section"_Section_history.html.
+discussed in "Section_history"_Section_history.html.
Finally, these are freely-available molecular dynamics codes, most of
them parallel, which may be well-suited to the problems you want to
model. They can also be used in conjunction with LAMMPS to perform
complementary modeling tasks.
"CHARMM"_charmm
"AMBER"_amber
"NAMD"_namd
"NWCHEM"_nwchem
"DL_POLY"_dlpoly
"Tinker"_tinker :ul
:link(charmm,http://www.scripps.edu/brooks)
:link(amber,http://amber.scripps.edu)
:link(namd,http://www.ks.uiuc.edu/Research/namd/)
:link(nwchem,http://www.emsl.pnl.gov/docs/nwchem/nwchem.html)
:link(dlpoly,http://www.cse.clrc.ac.uk/msi/software/DL_POLY)
:link(tinker,http://dasher.wustl.edu/tinker)
CHARMM, AMBER, NAMD, NWCHEM, and Tinker are designed primarily for
modeling biological molecules. CHARMM and AMBER use
atom-decomposition (replicated-data) strategies for parallelism; NAMD
and NWCHEM use spatial-decomposition approaches, similar to LAMMPS.
Tinker is a serial code. DL_POLY includes potentials for a variety of
biological and non-biological materials; both a replicated-data and
spatial-decomposition version exist.
:line
1.4 Open source distribution :link(intro_4),h4
LAMMPS comes with no warranty of any kind. As each source file states
in its header, it is a copyrighted code that is distributed free-of-
charge, under the terms of the "GNU Public License"_gnu (GPL). This
is often referred to as open-source distribution - see
"www.gnu.org"_gnuorg or "www.opensource.org"_opensource for more
details. The legal text of the GPL is in the LICENSE file that is
included in the LAMMPS distribution.
:link(gnuorg,http://www.gnu.org)
:link(opensource,http://www.opensource.org)
Here is a summary of what the GPL means for LAMMPS users:
(1) Anyone is free to use, modify, or extend LAMMPS in any way they
choose, including for commercial purposes.
(2) If you distribute a modified version of LAMMPS, it must remain
open-source, meaning you distribute it under the terms of the GPL.
You should clearly annotate such a code as a derivative version of
LAMMPS.
(3) If you release any code that includes LAMMPS source code, then it
must also be open-sourced, meaning you distribute it under the terms
of the GPL.
(4) If you give LAMMPS files to someone else, the GPL LICENSE file and
source file headers (including the copyright and GPL notices) should
remain part of the code.
In the spirit of an open-source code, these are various ways you can
contribute to making LAMMPS better. You can send email to the
"developers"_http://lammps.sandia.gov/authors.html on any of these
items.
Point prospective users to the "LAMMPS WWW Site"_lws. Mention it in
talks or link to it from your WWW site. :ulb,l
If you find an error or omission in this manual or on the "LAMMPS WWW
Site"_lws, or have a suggestion for something to clarify or include,
send an email to the
"developers"_http://lammps.sandia.gov/authors.html. :l
-If you find a bug, "this section"_Section_errors.html#err_2 describes
-how to report it. :l
+If you find a bug, "Section_errors 2"_Section_errors.html#err_2
+describes how to report it. :l
If you publish a paper using LAMMPS results, send the citation (and
any cool pictures or movies if you like) to add to the Publications,
Pictures, and Movies pages of the "LAMMPS WWW Site"_lws, with links
and attributions back to you. :l
Create a new Makefile.machine that can be added to the src/MAKE
directory. :l
The tools sub-directory of the LAMMPS distribution has various
stand-alone codes for pre- and post-processing of LAMMPS data. More
-details are given in "this section"_Section_tools.html. If you write
+details are given in "Section_tools"_Section_tools.html. If you write
a new tool that users will find useful, it can be added to the LAMMPS
distribution. :l
LAMMPS is designed to be easy to extend with new code for features
like potentials, boundary conditions, diagnostic computations, etc.
"This section"_Section_modify.html gives details. If you add a
feature of general interest, it can be added to the LAMMPS
distribution. :l
The Benchmark page of the "LAMMPS WWW Site"_lws lists LAMMPS
performance on various platforms. The files needed to run the
benchmarks are part of the LAMMPS distribution. If your machine is
sufficiently different from those listed, your timing data can be
added to the page. :l
You can send feedback for the User Comments page of the "LAMMPS WWW
Site"_lws. It might be added to the page. No promises. :l
Cash. Small denominations, unmarked bills preferred. Paper sack OK.
Leave on desk. VISA also accepted. Chocolate chip cookies
encouraged. :ule,l
:line
1.5 Acknowledgments and citations :h4,link(intro_5)
LAMMPS development has been funded by the "US Department of
Energy"_doe (DOE), through its CRADA, LDRD, ASCI, and Genomes-to-Life
programs and its "OASCR"_oascr and "OBER"_ober offices.
Specifically, work on the latest version was funded in part by the US
Department of Energy's Genomics:GTL program
("www.doegenomestolife.org"_gtl) under the "project"_ourgtl, "Carbon
Sequestration in Synechococcus Sp.: From Molecular Machines to
Hierarchical Modeling".
:link(doe,http://www.doe.gov)
:link(gtl,http://www.doegenomestolife.org)
:link(ourgtl,http://www.genomes2life.org)
:link(oascr,http://www.sc.doe.gov/ascr/home.html)
:link(ober,http://www.er.doe.gov/production/ober/ober_top.html)
The following paper describe the basic parallel algorithms used in
LAMMPS. If you use LAMMPS results in your published work, please cite
this paper and include a pointer to the "LAMMPS WWW Site"_lws
(http://lammps.sandia.gov):
S. J. Plimpton, [Fast Parallel Algorithms for Short-Range Molecular
Dynamics], J Comp Phys, 117, 1-19 (1995).
Other papers describing specific algorithms used in LAMMPS are listed
under the "Citing LAMMPS link"_http://lammps.sandia.gov/cite.html of
the LAMMPS WWW page.
The "Publications link"_http://lammps.sandia.gov/papers.html on the
LAMMPS WWW page lists papers that have cited LAMMPS. If your paper is
not listed there for some reason, feel free to send us the info. If
the simulations in your paper produced cool pictures or animations,
we'll be pleased to add them to the
"Pictures"_http://lammps.sandia.gov/pictures.html or
"Movies"_http://lammps.sandia.gov/movies.html pages of the LAMMPS WWW
site.
The core group of LAMMPS developers is at Sandia National Labs:
Steve Plimpton, sjplimp at sandia.gov
Aidan Thompson, athomps at sandia.gov
Paul Crozier, pscrozi at sandia.gov :ul
The following folks are responsible for significant contributions to
the code, or other aspects of the LAMMPS development effort. Many of
the packages they have written are somewhat unique to LAMMPS and the
code would not be as general-purpose as it is without their expertise
and efforts.
Axel Kohlmeyer (Temple U), akohlmey at gmail.com, SVN and Git repositories, indefatigable mail list responder, USER-CG-CMM and USER-OMP packages
Roy Pollock (LLNL), Ewald and PPPM solvers
Mike Brown (ORNL), brownw at ornl.gov, GPU package
Greg Wagner (Sandia), gjwagne at sandia.gov, MEAM package for MEAM potential
Mike Parks (Sandia), mlparks at sandia.gov, PERI package for Peridynamics
Rudra Mukherjee (JPL), Rudranarayan.M.Mukherjee at jpl.nasa.gov, POEMS package for articulated rigid body motion
Reese Jones (Sandia) and collaborators, rjones at sandia.gov, USER-ATC package for atom/continuum coupling
Ilya Valuev (JIHT), valuev at physik.hu-berlin.de, USER-AWPMD package for wave-packet MD
Christian Trott (U Tech Ilmenau), christian.trott at tu-ilmenau.de, USER-CUDA package
Andres Jaramillo-Botero (Caltech), ajaramil at wag.caltech.edu, USER-EFF package for electron force field
Pieter in' t Veld (BASF), pieter.intveld at basf.com, USER-EWALDN package for 1/r^N long-range solvers
Christoph Kloss (JKU), Christoph.Kloss at jku.at, USER-LIGGGHTS package for granular models and granular/fluid coupling
Metin Aktulga (LBL), hmaktulga at lbl.gov, USER-REAXC package for C version of ReaxFF
Georg Gunzenmuller (EMI), georg.ganzenmueller at emi.fhg.de, USER-SPH package :ul
-As discussed in "this section"_Section_history.html, LAMMPS originated
-as a cooperative project between DOE labs and industrial
+As discussed in "Section_history"_Section_history.html, LAMMPS
+originated as a cooperative project between DOE labs and industrial
partners. Folks involved in the design and testing of the original
version of LAMMPS were the following:
John Carpenter (Mayo Clinic, formerly at Cray Research)
Terry Stouch (Lexicon Pharmaceuticals, formerly at Bristol Myers Squibb)
Steve Lustig (Dupont)
Jim Belak (LLNL) :ul
diff --git a/doc/Section_packages.html b/doc/Section_packages.html
index 600f034d3..af512bd2e 100644
--- a/doc/Section_packages.html
+++ b/doc/Section_packages.html
@@ -1,422 +1,422 @@
<HTML>
<CENTER><A HREF = "Section_commands.html">Previous Section</A> - <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> -
<A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A> - <A HREF = "Section_accelerate.html">Next
Section</A>
</CENTER>
<HR>
<H3>4. Packages
</H3>
<P>This section gives a quick overview of the add-on packages that extend
LAMMPS functionality.
</P>
4.1 <A HREF = "#pkg_1">Standard packages</A><BR>
4.2 <A HREF = "#pkg_2">User packages</A> <BR>
<P>LAMMPS includes many optional packages, which are groups of files that
enable a specific set of features. For example, force fields for
molecular systems or granular systems are in packages. You can see
the list of all packages by typing "make package" from within the src
directory of the LAMMPS distribution.
</P>
-<P>See <A HREF = "Section_start.html#start_3">this section</A> of the manual for
+<P>See <A HREF = "Section_start.html#start_3">Section_start 3</A> of the manual for
details on how to include/exclude specific packages as part of the
LAMMPS build process, and for more details about the differences
between standard packages and user packages in LAMMPS.
</P>
<P>Below, the packages currently availabe in LAMMPS are listed. For
standard packages, just a one-line description is given. For user
packages, more details are provided.
</P>
<HR>
<HR>
<H4><A NAME = "pkg_1"></A>4.1 Standard packages
</H4>
<P>The current list of standard packages is as follows:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD >Package</TD><TD > Description</TD><TD > Author(s)</TD><TD > Doc page</TD><TD > Example</TD><TD > Library</TD></TR>
<TR ALIGN="center"><TD >ASPHERE</TD><TD > aspherical particles</TD><TD > -</TD><TD > <A HREF = "Section_howto.html#howto_14">howto</A></TD><TD > ellipse</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >CLASS2</TD><TD > class 2 force fields</TD><TD > -</TD><TD > <A HREF = "pair_class2.html">pair_style lj/class2</A></TD><TD > -</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >COLLOID</TD><TD > colloidal particles</TD><TD > -</TD><TD > <A HREF = "atom_style.html">atom_style colloid</A></TD><TD > colloid</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >DIPOLE</TD><TD > point dipole particles</TD><TD > -</TD><TD > <A HREF = "pair_dipole.html">pair_style dipole/cut</A></TD><TD > dipole</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >FLD</TD><TD > Fast Lubrication Dynamics</TD><TD > Kumar & Bybee & Higdon (1)</TD><TD > <A HREF = "pair_lubricateU.html">pair_style lubricateU</A></TD><TD > -</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >GPU</TD><TD > GPU-enabled potentials</TD><TD > Mike Brown (ORNL)</TD><TD > <A HREF = "Section_accelerate.html#acc_3">accelerate</A></TD><TD > gpu</TD><TD > lib/gpu</TD></TR>
<TR ALIGN="center"><TD >GRANULAR</TD><TD > granular systems</TD><TD > -</TD><TD > <A HREF = "Section_howto.html#howto_6">howto</A></TD><TD > pour</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >KSPACE</TD><TD > long-range Coulombic solvers</TD><TD > -</TD><TD > <A HREF = "kspace_style.html">kspace_style</A></TD><TD > peptide</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >MANYBODY</TD><TD > many-body potentials</TD><TD > -</TD><TD > <A HREF = "pair_tersoff.html">pair_style tersoff</A></TD><TD > shear</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >MEAM</TD><TD > modified EAM potential</TD><TD > Greg Wagner (Sandia)</TD><TD > <A HREF = "pair_meam.html">pair_style meam</A></TD><TD > meam</TD><TD > lib/meam</TD></TR>
<TR ALIGN="center"><TD >MC</TD><TD > Monte Carlo options</TD><TD > -</TD><TD > <A HREF = "fix_gcmc.html">fix gcmc</A></TD><TD > -</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >MOLECULE</TD><TD > molecular system force fields</TD><TD > -</TD><TD > <A HREF = "Section_howto.html#howto_3">howto</A></TD><TD > peptide</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >OPT</TD><TD > optimized pair potentials</TD><TD > Fischer & Richie & Natoli (2)</TD><TD > <A HREF = "Section_accelerate.html#acc_1">howto</A></TD><TD > -</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >PERI</TD><TD > Peridynamics models</TD><TD > Mike Parks (Sandia)</TD><TD > <A HREF = "pair_peri.html">pair_style peri</A></TD><TD > peri</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >POEMS</TD><TD > coupled rigid body motion</TD><TD > Rudra Mukherjee (JPL)</TD><TD > <A HREF = "fix_poems.html">fix poems</A></TD><TD > rigid</TD><TD > lib/poems</TD></TR>
<TR ALIGN="center"><TD >REAX</TD><TD > ReaxFF potential</TD><TD > Aidan Thompson (Sandia)</TD><TD > <A HREF = "pair_reax.html">pair_style reax</A></TD><TD > reax</TD><TD > lib/reax</TD></TR>
<TR ALIGN="center"><TD >REPLICA</TD><TD > multi-replica methods</TD><TD > -</TD><TD > <A HREF = "Section_howto.html#howto_5">howto</A></TD><TD > tad</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >SHOCK</TD><TD > shock loading methods</TD><TD > -</TD><TD > <A HREF = "fix_msst.html">fix msst</A></TD><TD > -</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >SRD</TD><TD > stochastic rotation dynamics</TD><TD > -</TD><TD > <A HREF = "fix_srd.html">fix srd</A></TD><TD > srd</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >XTC</TD><TD > dumps in XTC format</TD><TD > -</TD><TD > <A HREF = "dump.html">dump</A></TD><TD > -</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >
</TD></TR></TABLE></DIV>
<P>The "Authors" column lists a name(s) if a specific person is
responible for creating and maintaining the package.
</P>
<P>(1) The FLD package was created by Amit Kumar and Michael Bybee from
Jonathan Higdon's group at UIUC.
</P>
<P>(2) The OPT package was created by James Fischer (High Performance
Technologies), David Richie, and Vincent Natoli (Stone Ridge
Technolgy).
</P>
<P>The "Doc page" column links to either a portion of the
<A HREF = "Section_howto.html">Section_howto</A> of the manual, or an input script
command implemented as part of the package.
</P>
<P>The "Example" column is a sub-directory in the examples directory of
the distribution which has an input script that uses the package.
E.g. "peptide" refers to the examples/peptide directory.
</P>
<P>The "Library" column lists an external library which must be built first and which LAMMPS links to when it is built. These are in the lib directory of the distribution. <A HREF = "Section_start.html#start_3_3">This section</A> of the manual gives details on the 2-step build process with external libraries.
</P>
<HR>
<HR>
<H4><A NAME = "pkg_2"></A>4.2 User packages
</H4>
<P>The current list of user-contributed packages is as follows:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD >Package</TD><TD > Description</TD><TD > Author(s)</TD><TD > Doc page</TD><TD > Example</TD><TD > Pic/movie</TD><TD > Library</TD></TR>
<TR ALIGN="center"><TD >USER-MISC</TD><TD > single-file contributions</TD><TD > USER-MISC/README</TD><TD > -</TD><TD > -</TD><TD > -</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >USER-ATC</TD><TD > atom-to-continuum coupling</TD><TD > Jones & Templeton & Zimmerman (2)</TD><TD > <A HREF = "fix_atc.html">fix atc</A></TD><TD > USER/atc</TD><TD > <A HREF = "http://lammps.sandia.gov/pictures.html#atc">atc</A></TD><TD > lib/atc</TD></TR>
<TR ALIGN="center"><TD >USER-AWPMD</TD><TD > wave-packet MD</TD><TD > Ilya Valuev (JIHT)</TD><TD > <A HREF = "pair_awpmd.html">pair_style awpmd/cut</A></TD><TD > USER/awpmd</TD><TD > -</TD><TD > lib/awpmd</TD></TR>
<TR ALIGN="center"><TD >USER-CG-CMM</TD><TD > coarse-graining model</TD><TD > Axel Kohlmeyer (Temple U)</TD><TD > <A HREF = "pair_sdk.html">pair_style lj/sdk</A></TD><TD > USER/cg-cmm</TD><TD > <A HREF = "http://lammps.sandia.gov/pictures.html#cg">cg</A></TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >USER-CUDA</TD><TD > NVIDIA GPU styles</TD><TD > Christian Trott (U Tech Ilmenau)</TD><TD > <A HREF = "Section_accelerate.html#acc_4">accelerate</A></TD><TD > USER/cuda</TD><TD > -</TD><TD > lib/cuda</TD></TR>
<TR ALIGN="center"><TD >USER-EFF</TD><TD > electron force field</TD><TD > Andres Jaramillo-Botero (Caltech)</TD><TD > <A HREF = "pair_eff.html">pair_style eff/cut</A></TD><TD > USER/eff</TD><TD > <A HREF = "http://lammps.sandia.gov/movies.html#eff">eff</A></TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >USER-EWALDN</TD><TD > Ewald for 1/R^n</TD><TD > Pieter in' t Veld (BASF)</TD><TD > <A HREF = "kspace_style.html">kspace_style</A></TD><TD > -</TD><TD > -</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >USER-OMP</TD><TD > OpenMP threaded styles</TD><TD > Axel Kohlmeyer (Temple U)</TD><TD > <A HREF = "Section_accelerate.html#acc_2">accelerate</A></TD><TD > -</TD><TD > -</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >USER-REAXC</TD><TD > C version of ReaxFF</TD><TD > Metin Aktulga (LBNL)</TD><TD > <A HREF = "pair_reax_c.html">pair_style reaxc</A></TD><TD > reax</TD><TD > -</TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >USER-SPH</TD><TD > smoothed particle hydrodynamics</TD><TD > Georg Ganzenmuller (EMI)</TD><TD > <A HREF = "USER/sph/SPH_LAMMPS_userguide.pdf">SPH_LAMMPS_userguide.pdf</A></TD><TD > USER/sph</TD><TD > <A HREF = "http://lammps.sandia.gov/movies.html#sph">sph</A></TD><TD > -</TD></TR>
<TR ALIGN="center"><TD >
</TD></TR></TABLE></DIV>
<P>The "Authors" column lists a name(s) if a specific person is
responible for creating and maintaining the package.
</P>
<P>(2) The ATC package was created by Reese Jones, Jeremy Templeton, and Jon Zimmerman (Sandia).
</P>
<P>The "Doc page" column links to either a portion of the
<A HREF = "Section_howto.html">Section_howto</A> of the manual, or an input script
command implemented as part of the package, or to additional
documentation provided witht he package.
</P>
<P>The "Example" column is a sub-directory in the examples directory of
the distribution which has an input script that uses the package.
E.g. "peptide" refers to the examples/peptide directory. USER/cuda
refers to the examples/USER/cuda directory.
</P>
<P>The "Library" column lists an external library which must be built
first and which LAMMPS links to when it is built. These are in the
lib directory of the distribution. <A HREF = "Section_start.html#start_3_3">This
section</A> of the manual gives details on
the 2-step build process with external libraries.
</P>
<P>More details on each package, from the USER-blah/README file
is given below.
</P>
<HR>
<H4>USER-MISC package
</H4>
<P>The files in this package are a potpourri of (mostly) unrelated
features contributed to LAMMPS by users. Each feature is a single
pair of files (*.cpp and *.h).
</P>
<P>More information about each feature can be found by reading its doc
page in the LAMMPS doc directory. The doc page which lists all LAMMPS
input script commands is as follows:
</P>
<P><A HREF = "Section_commands.html#cmd_5">Section_commands</A>
</P>
<P>User-contributed features are listed at the bottom of the fix,
compute, pair, etc sections.
</P>
<P>The list of features and author of each is given in the
src/USER-MISC/README file.
</P>
<P>You should contact the author directly if you have specific questions
about the feature or its coding.
</P>
<HR>
<H4>USER-ATC package
</H4>
<P>This package implements a "fix atc" command which can be used in a
LAMMPS input script. This fix can be employed to either do concurrent
coupling of MD with FE-based physics surrogates or on-the-fly
post-processing of atomic information to continuum fields.
</P>
<P>See the doc page for the fix atc command to get started. At the
bottom of the doc page are many links to additional documentation
contained in the doc/USER/atc directory.
</P>
<P>There are example scripts for using this package in examples/USER/atc.
</P>
<P>This package uses an external library in lib/atc which must be
compiled before making LAMMPS. See the lib/atc/README file and the
LAMMPS manual for information on building LAMMPS with external
libraries.
</P>
<P>The primary people who created this package are Reese Jones (rjones at
sandia.gov), Jeremy Templeton (jatempl at sandia.gov) and Jon
Zimmerman (jzimmer at sandia.gov) at Sandia. Contact them directly if
you have questions.
</P>
<HR>
<H4>USER-AWPMD package
</H4>
<P>This package contains a LAMMPS implementation of the Antisymmetrized
Wave Packet Molecular Dynamics (AWPMD) method.
</P>
<P>See the doc page for the pair_style awpmd/cut command to get started.
</P>
<P>There are example scripts for using this package in examples/USER/awpmd.
</P>
<P>This package uses an external library in lib/awpmd which must be
compiled before making LAMMPS. See the lib/awpmd/README file and the
LAMMPS manual for information on building LAMMPS with external
libraries.
</P>
<P>The person who created this package is Ilya Valuev at the JIHT in
Russia (valuev at physik.hu-berlin.de). Contact him directly if you
have questions.
</P>
<HR>
<H4>USER-CG-CMM package
</H4>
<P>This package implements 3 commands which can be used in a LAMMPS input
script:
</P>
<UL><LI>pair_style lj/sdk
<LI>pair_style lj/sdk/coul/long
<LI>angle_style sdk
</UL>
<P>These styles allow coarse grained MD simulations with the
parametrization of Shinoda, DeVane, Klein, Mol Sim, 33, 27 (2007)
(SDK), with extensions to simulate ionic liquids, electrolytes, lipids
and charged amino acids.
</P>
<P>See the doc pages for these commands for details.
</P>
<P>There are example scripts for using this package in
examples/USER/cg-cmm.
</P>
<P>This is the second generation implementation reducing the the clutter
of the previous version. For many systems with electrostatics, it will
be faster to use pair_style hybrid/overlay with lj/sdk and coul/long
instead of the combined lj/sdk/coul/long style. since the number of
charged atom types is usually small. For any other coulomb
interactions this is now required. To exploit this property, the use
of the kspace_style pppm/cg is recommended over regular pppm. For all
new styles, input file backward compatibility is provided. The old
implementation is still available through appending the /old
suffix. These will be discontinued and removed after the new
implementation has been fully validated.
</P>
<P>The current version of this package should be considered beta
quality. The CG potentials work correctly for "normal" situations, but
have not been testing with all kinds of potential parameters and
simulation systems.
</P>
<P>The person who created this package is Axel Kohlmeyer at Temple U
(akohlmey at gmail.com). Contact him directly if you have questions.
</P>
<HR>
<H4>USER-CUDA package
</H4>
<P>This package provides acceleration of various LAMMPS pair styles, fix
styles, compute styles, and long-range Coulombics via PPPM for NVIDIA
GPUs.
</P>
<P>See this section of the manual to get started:
</P>
<P><A HREF = "Section_accelerate.html#acc_4">Section_accelerate</A>
</P>
<P>There are example scripts for using this package in
examples/USER/cuda.
</P>
<P>This package uses an external library in lib/cuda which must be
compiled before making LAMMPS. See the lib/cuda/README file and the
LAMMPS manual for information on building LAMMPS with external
libraries.
</P>
<P>The person who created this package is Christian Trott at the
University of Technology Ilmenau, Germany (christian.trott at
tu-ilmenau.de). Contact him directly if you have questions.
</P>
<HR>
<H4>USER-EFF package
</H4>
<P>This package contains a LAMMPS implementation of the electron Force
Field (eFF) currently under development at Caltech, as described in
A. Jaramillo-Botero, J. Su, Q. An, and W.A. Goddard III, JCC,
2010. The eFF potential was first introduced by Su and Goddard, in
2007.
</P>
<P>eFF can be viewed as an approximation to QM wave packet dynamics and
Fermionic molecular dynamics, combining the ability of electronic
structure methods to describe atomic structure, bonding, and chemistry
in materials, and of plasma methods to describe nonequilibrium
dynamics of large systems with a large number of highly excited
electrons. We classify it as a mixed QM-classical approach rather than
a conventional force field method, which introduces QM-based terms (a
spin-dependent repulsion term to account for the Pauli exclusion
principle and the electron wavefunction kinetic energy associated with
the Heisenberg principle) that reduce, along with classical
electrostatic terms between nuclei and electrons, to the sum of a set
of effective pairwise potentials. This makes eFF uniquely suited to
simulate materials over a wide range of temperatures and pressures
where electronically excited and ionized states of matter can occur
and coexist.
</P>
<P>The necessary customizations to the LAMMPS core are in place to
enable the correct handling of explicit electron properties during
minimization and dynamics.
</P>
<P>See the doc page for the pair_style eff/cut command to get started.
</P>
<P>There are example scripts for using this package in
examples/USER/eff.
</P>
<P>There are auxiliary tools for using this package in tools/eff.
</P>
<P>The person who created this package is Andres Jaramillo-Botero at
CalTech (ajaramil at wag.caltech.edu). Contact him directly if you
have questions.
</P>
<HR>
<H4>USER-EWALDN package
</H4>
<P>This package implements 3 commands which can be used in a LAMMPS input
script: pair_style lj/coul, pair_style buck/coul, and kspace_style
ewald/n.
</P>
<P>The "kspace_style ewald/n" command is similar to standard Ewald for
charges, but also enables the Lennard-Jones interaction, or any 1/r^N
interaction to be of infinite extent, instead of being cutoff. LAMMPS
pair potentials for long-range Coulombic interactions, such as
lj/cut/coul/long can be used with ewald/n. The two new pair_style
commands provide the modifications for the short-range LJ and
Buckingham interactions that can also be used with ewald/n.
</P>
<P>Another advantage of kspace_style ewald/n is that it can be used with
non-orthogonal (triclinic symmetry) simulation boxes, either for just
long-range Coulombic interactions, or for both Coulombic and 1/r^N LJ
or Buckingham, which is not currently possible for other kspace styles
such as PPPM and ewald.
</P>
<P>See the doc pages for these commands for details.
</P>
<P>The person who created these files is Pieter in' t Veld while at
Sandia. He is now at BASF (pieter.intveld at basf.com). Contact him
directly if you have questions.
</P>
<HR>
<H4>USER-OMP package
</H4>
<P>This package provides OpenMP multi-threading support and
other optimizations of various LAMMPS pair styles, dihedral
styles, and fix styles.
</P>
<P>See this section of the manual to get started:
</P>
<P><A HREF = "Section_accelerate.html#acc_2">Section_accelerate</A>
</P>
<P>The person who created this package is Axel Kohlmeyer at Temple U
(akohlmey at gmail.com). Contact him directly if you have questions.
</P>
<HR>
<H4>USER-REAXC package
</H4>
<P>This package contains a implementation for LAMMPS of the ReaxFF force
field. ReaxFF uses distance-dependent bond-order functions to
represent the contributions of chemical bonding to the potential
energy. It was originally developed by Adri van Duin and the Goddard
group at CalTech.
</P>
<P>The USER-REAXC version of ReaxFF (pair_style reax/c), implemented in
C, should give identical or very similar results to pair_style reax,
which is a ReaxFF implementation on top of a Fortran library, a
version of which library was originally authored by Adri van Duin.
</P>
<P>The reax/c version should be somewhat faster and more scalable,
particularly with respect to the charge equilibration calculation. It
should also be easier to build and use since there are no complicating
issues with Fortran memory allocation or linking to a Fortran library.
</P>
<P>For technical details about this implemention of ReaxFF, see
this paper:
</P>
<P>Parallel and Scalable Reactive Molecular Dynamics: Numerical Methods
and Algorithmic Techniques, H. M. Aktulga, J. C. Fogarty,
S. A. Pandit, A. Y. Grama, Parallel Computing, in press (2011).
</P>
<P>See the doc page for the pair_style reax/c command for details
of how to use it in LAMMPS.
</P>
<P>The person who created this package is Hasan Metin Aktulga (hmaktulga
at lbl.gov), while at Purdue University. Contact him directly, or
Aidan Thompson at Sandia (athomps at sandia.gov), if you have
questions.
</P>
<HR>
<H4>USER-SPH package
</H4>
<P>This package implements smoothed particle hydrodynamics (SPH) in
LAMMPS. Currently, the package has the following features:
</P>
<P>* Tait, ideal gas, Lennard-Jones equation of states, full support for
complete (i.e. internal-energy dependent) equations of state
* plain or Monaghans XSPH integration of the equations of motion
* density continuity or density summation to propagate the density field
* commands to set internal energy and density of particles from the
input script
* output commands to access internal energy and density for dumping and
thermo output
</P>
<P>See the file doc/USER/sph/SPH_LAMMPS_userguide.pdf to get started.
</P>
<P>There are example scripts for using this package in examples/USER/sph.
</P>
<P>The person who created this package is Georg Ganzenmuller at the
Fraunhofer-Institute for High-Speed Dynamics, Ernst Mach Institute in
Germany (georg.ganzenmueller at emi.fhg.de). Contact him directly if
you have questions.
</P>
</HTML>
diff --git a/doc/Section_packages.txt b/doc/Section_packages.txt
index 20b016cbc..425373d7a 100644
--- a/doc/Section_packages.txt
+++ b/doc/Section_packages.txt
@@ -1,408 +1,408 @@
"Previous Section"_Section_commands.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next
Section"_Section_accelerate.html :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
4. Packages :h3
This section gives a quick overview of the add-on packages that extend
LAMMPS functionality.
4.1 "Standard packages"_#pkg_1
4.2 "User packages"_#pkg_2 :all(b)
LAMMPS includes many optional packages, which are groups of files that
enable a specific set of features. For example, force fields for
molecular systems or granular systems are in packages. You can see
the list of all packages by typing "make package" from within the src
directory of the LAMMPS distribution.
-See "this section"_Section_start.html#start_3 of the manual for
+See "Section_start 3"_Section_start.html#start_3 of the manual for
details on how to include/exclude specific packages as part of the
LAMMPS build process, and for more details about the differences
between standard packages and user packages in LAMMPS.
Below, the packages currently availabe in LAMMPS are listed. For
standard packages, just a one-line description is given. For user
packages, more details are provided.
:line
:line
4.1 Standard packages :h4,link(pkg_1)
The current list of standard packages is as follows:
Package, Description, Author(s), Doc page, Example, Library
ASPHERE, aspherical particles, -, "howto"_Section_howto.html#howto_14, ellipse, -
CLASS2, class 2 force fields, -, "pair_style lj/class2"_pair_class2.html, -, -
COLLOID, colloidal particles, -, "atom_style colloid"_atom_style.html, colloid, -
DIPOLE, point dipole particles, -, "pair_style dipole/cut"_pair_dipole.html, dipole, -
FLD, Fast Lubrication Dynamics, Kumar & Bybee & Higdon (1), "pair_style lubricateU"_pair_lubricateU.html, -, -
GPU, GPU-enabled potentials, Mike Brown (ORNL), "accelerate"_Section_accelerate.html#acc_3, gpu, lib/gpu
GRANULAR, granular systems, -, "howto"_Section_howto.html#howto_6, pour, -
KSPACE, long-range Coulombic solvers, -, "kspace_style"_kspace_style.html, peptide, -
MANYBODY, many-body potentials, -, "pair_style tersoff"_pair_tersoff.html, shear, -
MEAM, modified EAM potential, Greg Wagner (Sandia), "pair_style meam"_pair_meam.html, meam, lib/meam
MC, Monte Carlo options, -, "fix gcmc"_fix_gcmc.html, -, -
MOLECULE, molecular system force fields, -, "howto"_Section_howto.html#howto_3, peptide, -
OPT, optimized pair potentials, Fischer & Richie & Natoli (2), "howto"_Section_accelerate.html#acc_1, -, -
PERI, Peridynamics models, Mike Parks (Sandia), "pair_style peri"_pair_peri.html, peri, -
POEMS, coupled rigid body motion, Rudra Mukherjee (JPL), "fix poems"_fix_poems.html, rigid, lib/poems
REAX, ReaxFF potential, Aidan Thompson (Sandia), "pair_style reax"_pair_reax.html, reax, lib/reax
REPLICA, multi-replica methods, -, "howto"_Section_howto.html#howto_5, tad, -
SHOCK, shock loading methods, -, "fix msst"_fix_msst.html, -, -
SRD, stochastic rotation dynamics, -, "fix srd"_fix_srd.html, srd, -
XTC, dumps in XTC format, -, "dump"_dump.html, -, -
:tb(ea=c)
The "Authors" column lists a name(s) if a specific person is
responible for creating and maintaining the package.
(1) The FLD package was created by Amit Kumar and Michael Bybee from
Jonathan Higdon's group at UIUC.
(2) The OPT package was created by James Fischer (High Performance
Technologies), David Richie, and Vincent Natoli (Stone Ridge
Technolgy).
The "Doc page" column links to either a portion of the
"Section_howto"_Section_howto.html of the manual, or an input script
command implemented as part of the package.
The "Example" column is a sub-directory in the examples directory of
the distribution which has an input script that uses the package.
E.g. "peptide" refers to the examples/peptide directory.
The "Library" column lists an external library which must be built first and which LAMMPS links to when it is built. These are in the lib directory of the distribution. "This section"_Section_start.html#start_3_3 of the manual gives details on the 2-step build process with external libraries.
:line
:line
4.2 User packages :h4,link(pkg_2)
The current list of user-contributed packages is as follows:
Package, Description, Author(s), Doc page, Example, Pic/movie, Library
USER-MISC, single-file contributions, USER-MISC/README, -, -, -, -
USER-ATC, atom-to-continuum coupling, Jones & Templeton & Zimmerman (2), "fix atc"_fix_atc.html, USER/atc, "atc"_atc, lib/atc
USER-AWPMD, wave-packet MD, Ilya Valuev (JIHT), "pair_style awpmd/cut"_pair_awpmd.html, USER/awpmd, -, lib/awpmd
USER-CG-CMM, coarse-graining model, Axel Kohlmeyer (Temple U), "pair_style lj/sdk"_pair_sdk.html, USER/cg-cmm, "cg"_cg, -
USER-CUDA, NVIDIA GPU styles, Christian Trott (U Tech Ilmenau), "accelerate"_Section_accelerate.html#acc_4, USER/cuda, -, lib/cuda
USER-EFF, electron force field, Andres Jaramillo-Botero (Caltech), "pair_style eff/cut"_pair_eff.html, USER/eff, "eff"_eff, -
USER-EWALDN, Ewald for 1/R^n, Pieter in' t Veld (BASF), "kspace_style"_kspace_style.html, -, -, -
USER-OMP, OpenMP threaded styles, Axel Kohlmeyer (Temple U), "accelerate"_Section_accelerate.html#acc_2, -, -, -
USER-REAXC, C version of ReaxFF, Metin Aktulga (LBNL), "pair_style reaxc"_pair_reax_c.html, reax, -, -
USER-SPH, smoothed particle hydrodynamics, Georg Ganzenmuller (EMI), "SPH_LAMMPS_userguide.pdf"_USER/sph/SPH_LAMMPS_userguide.pdf, USER/sph, "sph"_sph, -
:tb(ea=c)
:link(atc,http://lammps.sandia.gov/pictures.html#atc)
:link(cg,http://lammps.sandia.gov/pictures.html#cg)
:link(eff,http://lammps.sandia.gov/movies.html#eff)
:link(sph,http://lammps.sandia.gov/movies.html#sph)
The "Authors" column lists a name(s) if a specific person is
responible for creating and maintaining the package.
(2) The ATC package was created by Reese Jones, Jeremy Templeton, and Jon Zimmerman (Sandia).
The "Doc page" column links to either a portion of the
"Section_howto"_Section_howto.html of the manual, or an input script
command implemented as part of the package, or to additional
documentation provided witht he package.
The "Example" column is a sub-directory in the examples directory of
the distribution which has an input script that uses the package.
E.g. "peptide" refers to the examples/peptide directory. USER/cuda
refers to the examples/USER/cuda directory.
The "Library" column lists an external library which must be built
first and which LAMMPS links to when it is built. These are in the
lib directory of the distribution. "This
section"_Section_start.html#start_3_3 of the manual gives details on
the 2-step build process with external libraries.
More details on each package, from the USER-blah/README file
is given below.
:line
USER-MISC package :h4
The files in this package are a potpourri of (mostly) unrelated
features contributed to LAMMPS by users. Each feature is a single
pair of files (*.cpp and *.h).
More information about each feature can be found by reading its doc
page in the LAMMPS doc directory. The doc page which lists all LAMMPS
input script commands is as follows:
"Section_commands"_Section_commands.html#cmd_5
User-contributed features are listed at the bottom of the fix,
compute, pair, etc sections.
The list of features and author of each is given in the
src/USER-MISC/README file.
You should contact the author directly if you have specific questions
about the feature or its coding.
:line
USER-ATC package :h4
This package implements a "fix atc" command which can be used in a
LAMMPS input script. This fix can be employed to either do concurrent
coupling of MD with FE-based physics surrogates or on-the-fly
post-processing of atomic information to continuum fields.
See the doc page for the fix atc command to get started. At the
bottom of the doc page are many links to additional documentation
contained in the doc/USER/atc directory.
There are example scripts for using this package in examples/USER/atc.
This package uses an external library in lib/atc which must be
compiled before making LAMMPS. See the lib/atc/README file and the
LAMMPS manual for information on building LAMMPS with external
libraries.
The primary people who created this package are Reese Jones (rjones at
sandia.gov), Jeremy Templeton (jatempl at sandia.gov) and Jon
Zimmerman (jzimmer at sandia.gov) at Sandia. Contact them directly if
you have questions.
:line
USER-AWPMD package :h4
This package contains a LAMMPS implementation of the Antisymmetrized
Wave Packet Molecular Dynamics (AWPMD) method.
See the doc page for the pair_style awpmd/cut command to get started.
There are example scripts for using this package in examples/USER/awpmd.
This package uses an external library in lib/awpmd which must be
compiled before making LAMMPS. See the lib/awpmd/README file and the
LAMMPS manual for information on building LAMMPS with external
libraries.
The person who created this package is Ilya Valuev at the JIHT in
Russia (valuev at physik.hu-berlin.de). Contact him directly if you
have questions.
:line
USER-CG-CMM package :h4
This package implements 3 commands which can be used in a LAMMPS input
script:
pair_style lj/sdk
pair_style lj/sdk/coul/long
angle_style sdk :ul
These styles allow coarse grained MD simulations with the
parametrization of Shinoda, DeVane, Klein, Mol Sim, 33, 27 (2007)
(SDK), with extensions to simulate ionic liquids, electrolytes, lipids
and charged amino acids.
See the doc pages for these commands for details.
There are example scripts for using this package in
examples/USER/cg-cmm.
This is the second generation implementation reducing the the clutter
of the previous version. For many systems with electrostatics, it will
be faster to use pair_style hybrid/overlay with lj/sdk and coul/long
instead of the combined lj/sdk/coul/long style. since the number of
charged atom types is usually small. For any other coulomb
interactions this is now required. To exploit this property, the use
of the kspace_style pppm/cg is recommended over regular pppm. For all
new styles, input file backward compatibility is provided. The old
implementation is still available through appending the /old
suffix. These will be discontinued and removed after the new
implementation has been fully validated.
The current version of this package should be considered beta
quality. The CG potentials work correctly for "normal" situations, but
have not been testing with all kinds of potential parameters and
simulation systems.
The person who created this package is Axel Kohlmeyer at Temple U
(akohlmey at gmail.com). Contact him directly if you have questions.
:line
USER-CUDA package :h4
This package provides acceleration of various LAMMPS pair styles, fix
styles, compute styles, and long-range Coulombics via PPPM for NVIDIA
GPUs.
See this section of the manual to get started:
"Section_accelerate"_Section_accelerate.html#acc_4
There are example scripts for using this package in
examples/USER/cuda.
This package uses an external library in lib/cuda which must be
compiled before making LAMMPS. See the lib/cuda/README file and the
LAMMPS manual for information on building LAMMPS with external
libraries.
The person who created this package is Christian Trott at the
University of Technology Ilmenau, Germany (christian.trott at
tu-ilmenau.de). Contact him directly if you have questions.
:line
USER-EFF package :h4
This package contains a LAMMPS implementation of the electron Force
Field (eFF) currently under development at Caltech, as described in
A. Jaramillo-Botero, J. Su, Q. An, and W.A. Goddard III, JCC,
2010. The eFF potential was first introduced by Su and Goddard, in
2007.
eFF can be viewed as an approximation to QM wave packet dynamics and
Fermionic molecular dynamics, combining the ability of electronic
structure methods to describe atomic structure, bonding, and chemistry
in materials, and of plasma methods to describe nonequilibrium
dynamics of large systems with a large number of highly excited
electrons. We classify it as a mixed QM-classical approach rather than
a conventional force field method, which introduces QM-based terms (a
spin-dependent repulsion term to account for the Pauli exclusion
principle and the electron wavefunction kinetic energy associated with
the Heisenberg principle) that reduce, along with classical
electrostatic terms between nuclei and electrons, to the sum of a set
of effective pairwise potentials. This makes eFF uniquely suited to
simulate materials over a wide range of temperatures and pressures
where electronically excited and ionized states of matter can occur
and coexist.
The necessary customizations to the LAMMPS core are in place to
enable the correct handling of explicit electron properties during
minimization and dynamics.
See the doc page for the pair_style eff/cut command to get started.
There are example scripts for using this package in
examples/USER/eff.
There are auxiliary tools for using this package in tools/eff.
The person who created this package is Andres Jaramillo-Botero at
CalTech (ajaramil at wag.caltech.edu). Contact him directly if you
have questions.
:line
USER-EWALDN package :h4
This package implements 3 commands which can be used in a LAMMPS input
script: pair_style lj/coul, pair_style buck/coul, and kspace_style
ewald/n.
The "kspace_style ewald/n" command is similar to standard Ewald for
charges, but also enables the Lennard-Jones interaction, or any 1/r^N
interaction to be of infinite extent, instead of being cutoff. LAMMPS
pair potentials for long-range Coulombic interactions, such as
lj/cut/coul/long can be used with ewald/n. The two new pair_style
commands provide the modifications for the short-range LJ and
Buckingham interactions that can also be used with ewald/n.
Another advantage of kspace_style ewald/n is that it can be used with
non-orthogonal (triclinic symmetry) simulation boxes, either for just
long-range Coulombic interactions, or for both Coulombic and 1/r^N LJ
or Buckingham, which is not currently possible for other kspace styles
such as PPPM and ewald.
See the doc pages for these commands for details.
The person who created these files is Pieter in' t Veld while at
Sandia. He is now at BASF (pieter.intveld at basf.com). Contact him
directly if you have questions.
:line
USER-OMP package :h4
This package provides OpenMP multi-threading support and
other optimizations of various LAMMPS pair styles, dihedral
styles, and fix styles.
See this section of the manual to get started:
"Section_accelerate"_Section_accelerate.html#acc_2
The person who created this package is Axel Kohlmeyer at Temple U
(akohlmey at gmail.com). Contact him directly if you have questions.
:line
USER-REAXC package :h4
This package contains a implementation for LAMMPS of the ReaxFF force
field. ReaxFF uses distance-dependent bond-order functions to
represent the contributions of chemical bonding to the potential
energy. It was originally developed by Adri van Duin and the Goddard
group at CalTech.
The USER-REAXC version of ReaxFF (pair_style reax/c), implemented in
C, should give identical or very similar results to pair_style reax,
which is a ReaxFF implementation on top of a Fortran library, a
version of which library was originally authored by Adri van Duin.
The reax/c version should be somewhat faster and more scalable,
particularly with respect to the charge equilibration calculation. It
should also be easier to build and use since there are no complicating
issues with Fortran memory allocation or linking to a Fortran library.
For technical details about this implemention of ReaxFF, see
this paper:
Parallel and Scalable Reactive Molecular Dynamics: Numerical Methods
and Algorithmic Techniques, H. M. Aktulga, J. C. Fogarty,
S. A. Pandit, A. Y. Grama, Parallel Computing, in press (2011).
See the doc page for the pair_style reax/c command for details
of how to use it in LAMMPS.
The person who created this package is Hasan Metin Aktulga (hmaktulga
at lbl.gov), while at Purdue University. Contact him directly, or
Aidan Thompson at Sandia (athomps at sandia.gov), if you have
questions.
:line
USER-SPH package :h4
This package implements smoothed particle hydrodynamics (SPH) in
LAMMPS. Currently, the package has the following features:
* Tait, ideal gas, Lennard-Jones equation of states, full support for
complete (i.e. internal-energy dependent) equations of state
* plain or Monaghans XSPH integration of the equations of motion
* density continuity or density summation to propagate the density field
* commands to set internal energy and density of particles from the
input script
* output commands to access internal energy and density for dumping and
thermo output
See the file doc/USER/sph/SPH_LAMMPS_userguide.pdf to get started.
There are example scripts for using this package in examples/USER/sph.
The person who created this package is Georg Ganzenmuller at the
Fraunhofer-Institute for High-Speed Dynamics, Ernst Mach Institute in
Germany (georg.ganzenmueller at emi.fhg.de). Contact him directly if
you have questions.
diff --git a/doc/Section_python.html b/doc/Section_python.html
index a9eb0d34a..5f0952120 100644
--- a/doc/Section_python.html
+++ b/doc/Section_python.html
@@ -1,679 +1,679 @@
<HTML>
<CENTER><A HREF = "Section_modify.html">Previous Section</A> - <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A> - <A HREF = "Section_errors.html">Next Section</A>
</CENTER>
<HR>
<H3>11. Python interface to LAMMPS
</H3>
<P>This section describes how to build and use LAMMPS via a Python
interface.
</P>
<UL><LI>11.1 <A HREF = "#py_1">Extending Python with a serial version of LAMMPS</A>
<LI>11.2 <A HREF = "#py_2">Creating a shared MPI library</A>
<LI>11.3 <A HREF = "#py_3">Extending Python with a parallel version of LAMMPS</A>
<LI>11.4 <A HREF = "#py_4">Extending Python with MPI</A>
<LI>11.5 <A HREF = "#py_5">Testing the Python-LAMMPS interface</A>
<LI>11.6 <A HREF = "#py_6">Using LAMMPS from Python</A>
<LI>11.7 <A HREF = "#py_7">Example Python scripts that use LAMMPS</A>
</UL>
<P>The LAMMPS distribution includes some Python code in its python
directory which wraps the library interface to LAMMPS. This makes it
is possible to run LAMMPS, invoke LAMMPS commands or give it an input
script, extract LAMMPS results, an modify internal LAMMPS variables,
either from a Python script or interactively from a Python prompt.
</P>
<P><A HREF = "http://www.python.org">Python</A> is a powerful scripting and programming
language which can be used to wrap software like LAMMPS and other
packages. It can be used to glue multiple pieces of software
together, e.g. to run a coupled or multiscale model. See <A HREF = "Section_howto.html#howto_10">this
section</A> of the manual and the couple
directory of the distribution for more ideas about coupling LAMMPS to
-other codes. See <A HREF = "Section_start.html#start_4">this section</A> about how
-to build LAMMPS as a library, and <A HREF = "Section_howto.html#howto_19">this
+other codes. See <A HREF = "Section_start.html#start_4">Section_start 4</A> about
+how to build LAMMPS as a library, and <A HREF = "Section_howto.html#howto_19">this
section</A> for a description of the library
interface provided in src/library.cpp and src/library.h and how to
extend it for your needs. As described below, that interface is what
is exposed to Python. It is designed to be easy to add functions to.
This has the effect of extending the Python inteface as well. See
details below.
</P>
<P>By using the Python interface LAMMPS can also be coupled with a GUI or
visualization tools that display graphs or animations in real time as
LAMMPS runs. Examples of such scripts are inlcluded in the python
directory.
</P>
<P>Two advantages of using Python are how concise the language is and
that it can be run interactively, enabling rapid development and
debugging of programs. If you use it to mostly invoke costly
operations within LAMMPS, such as running a simulation for a
reasonable number of timesteps, then the overhead cost of invoking
LAMMPS thru Python will be negligible.
</P>
<P>Before using LAMMPS from a Python script, the Python on your machine
must be "extended" to include an interface to the LAMMPS library. If
your Python script will invoke MPI operations, you will also need to
extend your Python with an interface to MPI itself.
</P>
<P>Thus you should first decide how you intend to use LAMMPS from Python.
There are 3 options:
</P>
<P>(1) Use LAMMPS on a single processor running Python.
</P>
<P>(2) Use LAMMPS in parallel, where each processor runs Python, but your
Python program does not use MPI.
</P>
<P>(3) Use LAMMPS in parallel, where each processor runs Python, and your
Python script also makes MPI calls through a Python/MPI interface.
</P>
<P>Note that for (2) and (3) you will not be able to use Python
interactively by typing commands and getting a response. This is
because you will have multiple instances of Python running (e.g. on a
parallel machine) and they cannot all read what you type.
</P>
<P>Working in mode (1) does not require your machine to have MPI
installed. You should extend your Python with a serial version of
LAMMPS and the dummy MPI library provided with LAMMPS. See
instructions below on how to do this.
</P>
<P>Working in mode (2) requires your machine to have an MPI library
installed, but your Python does not need to be extended with MPI
itself. The MPI library must be a shared library (e.g. a *.so file on
Linux) which is not typically created when MPI is built/installed.
See instruction below on how to do this. You should extend your
Python with the a parallel versionn of LAMMPS which will use the
shared MPI system library. See instructions below on how to do this.
</P>
<P>Working in mode (3) requires your machine to have MPI installed (as a
shared library as in (2)). You must also extend your Python with a
parallel version of LAMMPS (same as in (2)) and with MPI itself, via
one of several available Python/MPI packages. See instructions below
on how to do the latter task.
</P>
<P>Several of the following sub-sections cover the rest of the Python
setup discussion. The next to last sub-section describes the Python
syntax used to invoke LAMMPS. The last sub-section describes example
Python scripts included in the python directory.
</P>
<P>Before proceeding, there are 2 items to note.
</P>
<P>(1) The provided Python wrapper for LAMMPS uses the amazing and
magical (to me) "ctypes" package in Python, which auto-generates the
interface code needed between Python and a set of C interface routines
for a library. Ctypes is part of standard Python for versions 2.5 and
later. You can check which version of Python you have installed, by
simply typing "python" at a shell prompt.
</P>
<P>(2) Any library wrapped by Python, including LAMMPS, must be built as
a shared library (e.g. a *.so file on Linux and not a *.a file). The
python/setup_serial.py and setup.py scripts do this build for LAMMPS
itself (described below). But if you have LAMMPS configured to use
additional packages that have their own libraries, then those
libraries must also be shared libraries. E.g. MPI, FFTW, or any of
the libraries in lammps/lib. When you build LAMMPS as a stand-alone
code, you are not building shared versions of these libraries.
</P>
<P>The discussion below describes how to create a shared MPI library. I
suggest you start by configuing LAMMPS without packages installed that
require any libraries besides MPI. See <A HREF = "Section_start.html#start_3">this
section</A> of the manual for a discussion of
LAMMPS pacakges. E.g. do not use the KSPACE, GPU, MEAM, POEMS, or
REAX packages.
</P>
<P>If you are successfully follow the steps belwo to build the Python
wrappers and use this version of LAMMPS through Python, you can then
take the next step of adding LAMMPS packages that use additional
libraries. This will require you to build a shared library for that
package's library, similar to what is described below for MPI. It
will also require you to edit the python/setup_serial.py or setup.py
scripts to enable Python to access those libraries when it builds the
LAMMPS wrapper.
</P>
<HR>
<HR>
<A NAME = "py_1"></A><H4>11.1 Extending Python with a serial version of LAMMPS
</H4>
<P>From the python directory in the LAMMPS distribution, type
</P>
<PRE>python setup_serial.py build
</PRE>
<P>and then one of these commands:
</P>
<PRE>sudo python setup_serial.py install
python setup_serial.py install --home=~/foo
</PRE>
<P>The "build" command should compile all the needed LAMMPS files,
including its dummy MPI library. The first "install" command will put
the needed files in your Python's site-packages sub-directory, so that
Python can load them. For example, if you installed Python yourself
on a Linux machine, it would typically be somewhere like
/usr/local/lib/python2.5/site-packages. Installing Python packages
this way often requires you to be able to write to the Python
directories, which may require root priveleges, hence the "sudo"
prefix. If this is not the case, you can drop the "sudo".
</P>
<P>Alternatively, you can install the LAMMPS files (or any other Python
packages) in your own user space. The second "install" command does
this, where you should replace "foo" with your directory of choice.
</P>
<P>If these commands are successful, a <I>lammps.py</I> and
<I>_lammps_serial.so</I> file will be put in the appropriate directory.
</P>
<HR>
<A NAME = "py_2"></A><H4>11.2 Creating a shared MPI library
</H4>
<P>A shared library is one that is dynamically loadable, which is what
Python requires. On Linux this is a library file that ends in ".so",
not ".a". Such a shared library is normally not built if you
installed MPI yourself, but it is easy to do. Here is how to do it
for <A HREF = "http://www-unix.mcs.anl.gov/mpi">MPICH</A>, a popular open-source version of MPI, distributed
by Argonne National Labs. From within the mpich directory, type
</P>
<PRE>./configure --enable-shared
make
make install
</PRE>
<P>You may need to use "sudo make install" in place of the last line.
The end result should be the file libmpich.so in /usr/local/lib.
</P>
<P>IMPORTANT NOTE: If the file libmpich.a already exists in your
installation directory (e.g. /usr/local/lib), you will now have both a
static and shared MPI library. This will be fine for running LAMMPS
from Python since it only uses the shared library. But if you now try
to build LAMMPS by itself as a stand-alone program (cd lammps/src;
make foo) or build other codes that expect to link against libmpich.a,
then those builds may fail if the linker uses libmpich.so instead. If
this happens, it means you will need to remove the file
/usr/local/lib/libmich.so before building LAMMPS again as a
stand-alone code.
</P>
<HR>
<A NAME = "py_3"></A><H4>11.3 Extending Python with a parallel version of LAMMPS
</H4>
<P>From the python directory, type
</P>
<PRE>python setup.py build
</PRE>
<P>and then one of these commands:
</P>
<PRE>sudo python setup.py install
python setup.py install --home=~/foo
</PRE>
<P>The "build" command should compile all the needed LAMMPS C++ files,
which will require MPI to be installed on your system. This means it
must find both the header file mpi.h and a shared library file,
e.g. libmpich.so if the MPICH version of MPI is installed. See the
preceding section for how to create a shared library version of MPI if
it does not exist. You may need to adjust the "include_dirs" and
"library_dirs" and "libraries" fields in python/setup.py to
insure the Python build finds all the files it needs.
</P>
<P>The first "install" command will put the needed files in your Python's
site-packages sub-directory, so that Python can load them. For
example, if you installed Python yourself on a Linux machine, it would
typically be somewhere like /usr/local/lib/python2.5/site-packages.
Installing Python packages this way often requires you to be able to
write to the Python directories, which may require root priveleges,
hence the "sudo" prefix. If this is not the case, you can drop the
"sudo".
</P>
<P>Alternatively, you can install the LAMMPS files (or any other Python
packages) in your own user space. The second "install" command does
this, where you should replace "foo" with your directory of choice.
</P>
<P>If these commands are successful, a <I>lammps.py</I> and <I>_lammps.so</I> file
will be put in the appropriate directory.
</P>
<HR>
<A NAME = "py_4"></A><H4>11.4 Extending Python with MPI
</H4>
<P>There are several Python packages available that purport to wrap MPI
as a library and allow MPI functions to be called from Python.
</P>
<P>These include
</P>
<UL><LI><A HREF = "http://pympi.sourceforge.net/">pyMPI</A>
<LI><A HREF = "http://code.google.com/p/maroonmpi/">maroonmpi</A>
<LI><A HREF = "http://code.google.com/p/mpi4py/">mpi4py</A>
<LI><A HREF = "http://nbcr.sdsc.edu/forum/viewtopic.php?t=89&sid=c997fefc3933bd66204875b436940f16">myMPI</A>
<LI><A HREF = "http://datamining.anu.edu.au/~ole/pypar">Pypar</A>
</UL>
<P>All of these except pyMPI work by wrapping the MPI library (which must
be available on your system as a shared library, as discussed above),
and exposing (some portion of) its interface to your Python script.
This means they cannot be used interactively in parallel, since they
do not address the issue of interactive input to multiple instances of
Python running on different processors. The one exception is pyMPI,
which alters the Python interpreter to address this issue, and (I
believe) creates a new alternate executable (in place of python
itself) as a result.
</P>
<P>In principle any of these Python/MPI packages should work to invoke
both calls to LAMMPS and MPI itself from a Python script running in
parallel. However, when I downloaded and looked at a few of them,
their docuemtation was incomplete and I had trouble with their
installation. It's not clear if some of the packages are still being
actively developed and supported.
</P>
<P>The one I recommend, since I have successfully used it with LAMMPS, is
Pypar. Pypar requires the ubiquitous <A HREF = "http://numpy.scipy.org">Numpy
package</A> be installed in your Python. After
launching python, type
</P>
<PRE>>>> import numpy
</PRE>
<P>to see if it is installed. If not, here is how to install it (version
1.3.0b1 as of April 2009). Unpack the numpy tarball and from its
top-level directory, type
</P>
<PRE>python setup.py build
sudo python setup.py install
</PRE>
<P>The "sudo" is only needed if required to copy Numpy files into your
Python distribution's site-packages directory.
</P>
<P>To install Pypar (version pypar-2.1.0_66 as of April 2009), unpack it
and from its "source" directory, type
</P>
<PRE>python setup.py build
sudo python setup.py install
</PRE>
<P>Again, the "sudo" is only needed if required to copy PyPar files into
your Python distribution's site-packages directory.
</P>
<P>If you have successully installed Pypar, you should be able to run
python serially and type
</P>
<PRE>>>> import pypar
</PRE>
<P>without error. You should also be able to run python in parallel
on a simple test script
</P>
<PRE>% mpirun -np 4 python test.script
</PRE>
<P>where test.script contains the lines
</P>
<PRE>import pypar
print "Proc %d out of %d procs" % (pypar.rank(),pypar.size())
</PRE>
<P>and see one line of output for each processor you ran on.
</P>
<HR>
<A NAME = "py_5"></A><H4>11.5 Testing the Python-LAMMPS interface
</H4>
<P>Before using LAMMPS in a Python program, one more step is needed. The
interface to LAMMPS is via the Python ctypes package, which loads the
shared LAMMPS library via a CDLL() call, which in turn is a wrapper on
the C-library dlopen(). This command is different than a normal
Python "import" and needs to be able to find the LAMMPS shared
library, which is either in the Python site-packages directory or in a
local directory you specified in the "python setup.py install"
command, as described above.
</P>
<P>The simplest way to do this is add a line like this to your
.cshrc or other shell start-up file.
</P>
<PRE>setenv LD_LIBRARY_PATH
${LD_LIBRARY_PATH}:/usr/local/lib/python2.5/site-packages
</PRE>
<P>and then execute the shell file to insure the path has been updated.
This will extend the path that dlopen() uses to look for shared
libraries.
</P>
<P>To test if the serial LAMMPS library has been successfully installed
(mode 1 above), launch Python and type
</P>
<PRE>>>> from lammps import lammps
>>> lmp = lammps()
</PRE>
<P>If you get no errors, you're ready to use serial LAMMPS from Python.
</P>
<P>If you built LAMMPS for parallel use (mode 2 or 3 above), launch
Python in parallel:
</P>
<PRE>% mpirun -np 4 python test.script
</PRE>
<P>where test.script contains the lines
</P>
<PRE>import pypar
from lammps import lammps
lmp = lammps()
print "Proc %d out of %d procs has" % (pypar.rank(),pypar.size()), lmp
pypar.finalize()
</PRE>
<P>Again, if you get no errors, you're good to go.
</P>
<P>Note that if you left out the "import pypar" line from this script,
you would instantiate and run LAMMPS independently on each of the P
processors specified in the mpirun command. You can test if Pypar is
enabling true parallel Python and LAMMPS by adding a line to the above
sequence of commands like lmp.file("in.lj") to run an input script and
see if the LAMMPS run says it ran on P processors or if you get output
from P duplicated 1-processor runs written to the screen. In the
latter case, Pypar is not working correctly.
</P>
<P>Note that this line:
</P>
<PRE>from lammps import lammps
</PRE>
<P>will import either the serial or parallel version of the LAMMPS
library, as wrapped by lammps.py. But if you installed both via
setup_serial.py and setup.py, it will always import the parallel
version, since it attempts that first.
</P>
<P>Note that if your Python script imports the Pypar package (as above),
so that it can use MPI calls directly, then Pypar initializes MPI for
you. Thus the last line of your Python script should be
pypar.finalize(), to insure MPI is shut down correctly.
</P>
<P>Also note that a Python script can be invoked in one of several ways:
</P>
<P>% python foo.script
% python -i foo.script
% foo.script
</P>
<P>The last command requires that the first line of the script be
something like this:
</P>
<P>#!/usr/local/bin/python
#!/usr/local/bin/python -i
</P>
<P>where the path points to where you have Python installed, and that you
have made the script file executable:
</P>
<P>% chmod +x foo.script
</P>
<P>Without the "-i" flag, Python will exit when the script finishes.
With the "-i" flag, you will be left in the Python interpreter when
the script finishes, so you can type subsequent commands. As
mentioned above, you can only run Python interactively when running
Python on a single processor, not in parallel.
</P>
<HR>
<HR>
<A NAME = "py_6"></A><H4>11.6 Using LAMMPS from Python
</H4>
<P>The Python interface to LAMMPS consists of a Python "lammps" module,
the source code for which is in python/lammps.py, which creates a
"lammps" object, with a set of methods that can be invoked on that
object. The sample Python code below assumes you have first imported
the "lammps" module in your Python script and its settings as
follows:
</P>
<PRE>from lammps import lammps
from lammps import LMPINT as INT
from lammps import LMPDOUBLE as DOUBLE
from lammps import LMPIPTR as IPTR
from lammps import LMPDPTR as DPTR
from lammps import LMPDPTRPTR as DPTRPTR
</PRE>
<P>These are the methods defined by the lammps module. If you look
at the file src/library.cpp you will see that they correspond
one-to-one with calls you can make to the LAMMPS library from a C++ or
C or Fortran program.
</P>
<PRE>lmp = lammps() # create a LAMMPS object
lmp = lammps(list) # ditto, with command-line args, list = ["-echo","screen"]
</PRE>
<PRE>lmp.close() # destroy a LAMMPS object
</PRE>
<PRE>lmp.file(file) # run an entire input script, file = "in.lj"
lmp.command(cmd) # invoke a single LAMMPS command, cmd = "run 100"
</PRE>
<PRE>xlo = lmp.extract_global(name,type) # extract a global quantity
# name = "boxxlo", "nlocal", etc
# type = INT or DOUBLE
</PRE>
<PRE>coords = lmp.extract_atom(name,type) # extract a per-atom quantity
# name = "x", "type", etc
# type = IPTR or DPTR or DPTRPTR
</PRE>
<PRE>eng = lmp.extract_compute(id,style,type) # extract value(s) from a compute
v3 = lmp.extract_fix(id,style,type,i,j) # extract value(s) from a fix
# id = ID of compute or fix
# style = 0 = global data
# 1 = per-atom data
# 2 = local data
# type = 0 = scalar
# 1 = vector
# 2 = array
# i,j = indices of value in global vector or array
</PRE>
<PRE>var = lmp.extract_variable(name,group,flag) # extract value(s) from a variable
# name = name of variable
# group = group ID (ignored for equal-style variables)
# flag = 0 = equal-style variable
# 1 = atom-style variable
</PRE>
<PRE>natoms = lmp.get_natoms() # total # of atoms as int
x = lmp.get_coords() # return coords of all atoms in x
lmp.put_coords(x) # set all atom coords via x
</PRE>
<HR>
<P>The creation of a LAMMPS object does not take an MPI communicator as
an argument. There should be a way to do this, so that the LAMMPS
instance runs on a subset of processors, if desired, but I don't yet
know how from Pypar. So for now, it runs on MPI_COMM_WORLD, which is
all the processors.
</P>
<P>The file() and command() methods allow an input script or single
commands to be invoked.
</P>
<P>The extract_global(), extract_atom(), extract_compute(),
extract_fix(), and extract_variable() methods return values or
pointers to data structures internal to LAMMPS.
</P>
<P>For extract_global() see the src/library.cpp file for the list of
valid names. New names could easily be added. A double or integer is
returned. You need to specify the appropriate data type via the type
argument.
</P>
<P>For extract_atom(), a pointer to internal LAMMPS atom-based data is
returned, which you can use via normal Python subscripting. See the
extract() method in the src/atom.cpp file for a list of valid names.
Again, new names could easily be added. A pointer to a vector of
doubles or integers, or a pointer to an array of doubles (double **)
is returned. You need to specify the appropriate data type via the
type argument.
</P>
<P>For extract_compute() and extract_fix(), the global, per-atom, or
local data calulated by the compute or fix can be accessed. What is
returned depends on whether the compute or fix calculates a scalar or
vector or array. For a scalar, a single double value is returned. If
the compute or fix calculates a vector or array, a pointer to the
internal LAMMPS data is returned, which you can use via normal Python
subscripting. The one exception is that for a fix that calculates a
global vector or array, a single double value from the vector or array
is returned, indexed by I (vector) or I and J (array). I,J are
zero-based indices. The I,J arguments can be left out if not needed.
-See <A HREF = "Section_howto.html#howto_15">this section</A> of the manual for a
+See <A HREF = "Section_howto.html#howto_15">Section_howto 15</A> of the manual for a
discussion of global, per-atom, and local data, and of scalar, vector,
and array data types. See the doc pages for individual
<A HREF = "compute.html">computes</A> and <A HREF = "fix.html">fixes</A> for a description of what
they calculate and store.
</P>
<P>For extract_variable(), an <A HREF = "variable.html">equal-style or atom-style
variable</A> is evaluated and its result returned.
</P>
<P>For equal-style variables a single double value is returned and the
group argument is ignored. For atom-style variables, a vector of
doubles is returned, one value per atom, which you can use via normal
Python subscripting. The values will be zero for atoms not in the
specified group.
</P>
<P>The get_natoms() method returns the total number of atoms in the
simulation, as an int. Note that extract_global("natoms") returns the
same value, but as a double, which is the way LAMMPS stores it to
allow for systems with more atoms than can be stored in an int (> 2
billion).
</P>
<P>The get_coords() method returns an ctypes vector of doubles of length
3*natoms, for the coordinates of all the atoms in the simulation,
ordered by x,y,z and then by atom ID (see code for put_coords()
below). The array can be used via normal Python subscripting. If
atom IDs are not consecutively ordered within LAMMPS, a None is
returned as indication of an error.
</P>
<P>Note that the data structure get_coords() returns is different from
the data structure returned by extract_atom("x") in four ways. (1)
Get_coords() returns a vector which you index as x[i];
extract_atom() returns an array which you index as x[i][j]. (2)
Get_coords() orders the atoms by atom ID while extract_atom() does
not. (3) Get_coords() returns a list of all atoms in the simulation;
extract_atoms() returns just the atoms local to each processor. (4)
Finally, the get_coords() data structure is a copy of the atom coords
stored internally in LAMMPS, whereas extract_atom returns an array
that points directly to the internal data. This means you can change
values inside LAMMPS from Python by assigning a new values to the
extract_atom() array. To do this with the get_atoms() vector, you
need to change values in the vector, then invoke the put_coords()
method.
</P>
<P>The put_coords() method takes a vector of coordinates for all atoms in
the simulation, assumed to be ordered by x,y,z and then by atom ID,
and uses the values to overwrite the corresponding coordinates for
each atom inside LAMMPS. This requires LAMMPS to have its "map"
option enabled; see the <A HREF = "atom_modify.html">atom_modify</A> command for
details. If it is not or if atom IDs are not consecutively ordered,
no coordinates are reset,
</P>
<P>The array of coordinates passed to put_coords() must be a ctypes
vector of doubles, allocated and initialized something like this:
</P>
<PRE>from ctypes import *
natoms = lmp.get_atoms()
n3 = 3*natoms
x = (c_double*n3)()
x<B>0</B> = x coord of atom with ID 1
x<B>1</B> = y coord of atom with ID 1
x<B>2</B> = z coord of atom with ID 1
x<B>3</B> = x coord of atom with ID 2
...
x<B>n3-1</B> = z coord of atom with ID natoms
lmp.put_coords(x)
</PRE>
<P>Alternatively, you can just change values in the vector returned by
get_coords(), since it is a ctypes vector of doubles.
</P>
<HR>
<P>As noted above, these Python class methods correspond one-to-one with
the functions in the LAMMPS library interface in src/library.cpp and
library.h. This means you can extend the Python wrapper via the
following steps:
</P>
<UL><LI>Add a new interface function to src/library.cpp and
src/library.h.
<LI>Verify the new function is syntactically correct by building LAMMPS as
-a library - see <A HREF = "Section_start.html#start_4">this section</A> of the
+a library - see <A HREF = "Section_start.html#start_4">Section_start 4</A> of the
manual.
<LI>Add a wrapper method in the Python LAMMPS module to python/lammps.py
for this interface function.
<LI>Rebuild the Python wrapper via python/setup_serial.py or
python/setup.py.
<LI>You should now be able to invoke the new interface function from a
Python script. Isn't ctypes amazing?
</UL>
<HR>
<HR>
<A NAME = "py_7"></A><H4>11.7 Example Python scripts that use LAMMPS
</H4>
<P>These are the Python scripts included as demos in the python/examples
directory of the LAMMPS distribution, to illustrate the kinds of
things that are possible when Python wraps LAMMPS. If you create your
own scripts, send them to us and we can include them in the LAMMPS
distribution.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >trivial.py</TD><TD > read/run a LAMMPS input script thru Python</TD></TR>
<TR><TD >demo.py</TD><TD > invoke various LAMMPS library interface routines</TD></TR>
<TR><TD >simple.py</TD><TD > mimic operation of couple/simple/simple.cpp in Python</TD></TR>
<TR><TD >gui.py</TD><TD > GUI go/stop/temperature-slider to control LAMMPS</TD></TR>
<TR><TD >plot.py</TD><TD > real-time temeperature plot with GnuPlot via Pizza.py</TD></TR>
<TR><TD >viz_tool.py</TD><TD > real-time viz via some viz package</TD></TR>
<TR><TD >vizplotgui_tool.py</TD><TD > combination of viz_tool.py and plot.py and gui.py
</TD></TR></TABLE></DIV>
<HR>
<P>For the viz_tool.py and vizplotgui_tool.py commands, replace "tool"
with "gl" or "atomeye" or "pymol" or "vmd", depending on what
visualization package you have installed.
</P>
<P>Note that for GL, you need to be able to run the Pizza.py GL tool,
which is included in the pizza sub-directory. See the <A HREF = "http://www.sandia.gov/~sjplimp/pizza.html">Pizza.py doc
pages</A> for more info:
</P>
<P>Note that for AtomEye, you need version 3, and there is a line in the
scripts that specifies the path and name of the executable. See the
AtomEye WWW pages <A HREF = "http://mt.seas.upenn.edu/Archive/Graphics/A">here</A> or <A HREF = "http://mt.seas.upenn.edu/Archive/Graphics/A3/A3.html">here</A> for more details:
</P>
<PRE>http://mt.seas.upenn.edu/Archive/Graphics/A
http://mt.seas.upenn.edu/Archive/Graphics/A3/A3.html
</PRE>
<P>The latter link is to AtomEye 3 which has the scriping
capability needed by these Python scripts.
</P>
<P>Note that for PyMol, you need to have built and installed the
open-source version of PyMol in your Python, so that you can import it
from a Python script. See the PyMol WWW pages <A HREF = "http://www.pymol.org">here</A> or
<A HREF = "http://sourceforge.net/scm/?type=svn&group_id=4546">here</A> for more details:
</P>
<PRE>http://www.pymol.org
http://sourceforge.net/scm/?type=svn&group_id=4546
</PRE>
<P>The latter link is to the open-source version.
</P>
<P>Note that for VMD, you need a fairly current version (1.8.7 works for
me) and there are some lines in the pizza/vmd.py script for 4 PIZZA
variables that have to match the VMD installation on your system.
</P>
<HR>
<P>See the python/README file for instructions on how to run them and the
source code for individual scripts for comments about what they do.
</P>
<P>Here are screenshots of the vizplotgui_tool.py script in action for
different visualization package options. Click to see larger images:
</P>
<A HREF = "JPG/screenshot_gl.jpg"><IMG SRC = "JPG/screenshot_gl_small.jpg"></A>
<A HREF = "JPG/screenshot_atomeye.jpg"><IMG SRC = "JPG/screenshot_atomeye_small.jpg"></A>
<A HREF = "JPG/screenshot_pymol.jpg"><IMG SRC = "JPG/screenshot_pymol_small.jpg"></A>
<A HREF = "JPG/screenshot_vmd.jpg"><IMG SRC = "JPG/screenshot_vmd_small.jpg"></A>
</HTML>
diff --git a/doc/Section_python.txt b/doc/Section_python.txt
index 6a80a827b..44b2a0f01 100644
--- a/doc/Section_python.txt
+++ b/doc/Section_python.txt
@@ -1,664 +1,664 @@
"Previous Section"_Section_modify.html - "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next Section"_Section_errors.html :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
11. Python interface to LAMMPS :h3
This section describes how to build and use LAMMPS via a Python
interface.
11.1 "Extending Python with a serial version of LAMMPS"_#py_1
11.2 "Creating a shared MPI library"_#py_2
11.3 "Extending Python with a parallel version of LAMMPS"_#py_3
11.4 "Extending Python with MPI"_#py_4
11.5 "Testing the Python-LAMMPS interface"_#py_5
11.6 "Using LAMMPS from Python"_#py_6
11.7 "Example Python scripts that use LAMMPS"_#py_7 :ul
The LAMMPS distribution includes some Python code in its python
directory which wraps the library interface to LAMMPS. This makes it
is possible to run LAMMPS, invoke LAMMPS commands or give it an input
script, extract LAMMPS results, an modify internal LAMMPS variables,
either from a Python script or interactively from a Python prompt.
"Python"_http://www.python.org is a powerful scripting and programming
language which can be used to wrap software like LAMMPS and other
packages. It can be used to glue multiple pieces of software
together, e.g. to run a coupled or multiscale model. See "this
section"_Section_howto.html#howto_10 of the manual and the couple
directory of the distribution for more ideas about coupling LAMMPS to
-other codes. See "this section"_Section_start.html#start_4 about how
-to build LAMMPS as a library, and "this
+other codes. See "Section_start 4"_Section_start.html#start_4 about
+how to build LAMMPS as a library, and "this
section"_Section_howto.html#howto_19 for a description of the library
interface provided in src/library.cpp and src/library.h and how to
extend it for your needs. As described below, that interface is what
is exposed to Python. It is designed to be easy to add functions to.
This has the effect of extending the Python inteface as well. See
details below.
By using the Python interface LAMMPS can also be coupled with a GUI or
visualization tools that display graphs or animations in real time as
LAMMPS runs. Examples of such scripts are inlcluded in the python
directory.
Two advantages of using Python are how concise the language is and
that it can be run interactively, enabling rapid development and
debugging of programs. If you use it to mostly invoke costly
operations within LAMMPS, such as running a simulation for a
reasonable number of timesteps, then the overhead cost of invoking
LAMMPS thru Python will be negligible.
Before using LAMMPS from a Python script, the Python on your machine
must be "extended" to include an interface to the LAMMPS library. If
your Python script will invoke MPI operations, you will also need to
extend your Python with an interface to MPI itself.
Thus you should first decide how you intend to use LAMMPS from Python.
There are 3 options:
(1) Use LAMMPS on a single processor running Python.
(2) Use LAMMPS in parallel, where each processor runs Python, but your
Python program does not use MPI.
(3) Use LAMMPS in parallel, where each processor runs Python, and your
Python script also makes MPI calls through a Python/MPI interface.
Note that for (2) and (3) you will not be able to use Python
interactively by typing commands and getting a response. This is
because you will have multiple instances of Python running (e.g. on a
parallel machine) and they cannot all read what you type.
Working in mode (1) does not require your machine to have MPI
installed. You should extend your Python with a serial version of
LAMMPS and the dummy MPI library provided with LAMMPS. See
instructions below on how to do this.
Working in mode (2) requires your machine to have an MPI library
installed, but your Python does not need to be extended with MPI
itself. The MPI library must be a shared library (e.g. a *.so file on
Linux) which is not typically created when MPI is built/installed.
See instruction below on how to do this. You should extend your
Python with the a parallel versionn of LAMMPS which will use the
shared MPI system library. See instructions below on how to do this.
Working in mode (3) requires your machine to have MPI installed (as a
shared library as in (2)). You must also extend your Python with a
parallel version of LAMMPS (same as in (2)) and with MPI itself, via
one of several available Python/MPI packages. See instructions below
on how to do the latter task.
Several of the following sub-sections cover the rest of the Python
setup discussion. The next to last sub-section describes the Python
syntax used to invoke LAMMPS. The last sub-section describes example
Python scripts included in the python directory.
Before proceeding, there are 2 items to note.
(1) The provided Python wrapper for LAMMPS uses the amazing and
magical (to me) "ctypes" package in Python, which auto-generates the
interface code needed between Python and a set of C interface routines
for a library. Ctypes is part of standard Python for versions 2.5 and
later. You can check which version of Python you have installed, by
simply typing "python" at a shell prompt.
(2) Any library wrapped by Python, including LAMMPS, must be built as
a shared library (e.g. a *.so file on Linux and not a *.a file). The
python/setup_serial.py and setup.py scripts do this build for LAMMPS
itself (described below). But if you have LAMMPS configured to use
additional packages that have their own libraries, then those
libraries must also be shared libraries. E.g. MPI, FFTW, or any of
the libraries in lammps/lib. When you build LAMMPS as a stand-alone
code, you are not building shared versions of these libraries.
The discussion below describes how to create a shared MPI library. I
suggest you start by configuing LAMMPS without packages installed that
require any libraries besides MPI. See "this
section"_Section_start.html#start_3 of the manual for a discussion of
LAMMPS pacakges. E.g. do not use the KSPACE, GPU, MEAM, POEMS, or
REAX packages.
If you are successfully follow the steps belwo to build the Python
wrappers and use this version of LAMMPS through Python, you can then
take the next step of adding LAMMPS packages that use additional
libraries. This will require you to build a shared library for that
package's library, similar to what is described below for MPI. It
will also require you to edit the python/setup_serial.py or setup.py
scripts to enable Python to access those libraries when it builds the
LAMMPS wrapper.
:line
:line
11.1 Extending Python with a serial version of LAMMPS :link(py_1),h4
From the python directory in the LAMMPS distribution, type
python setup_serial.py build :pre
and then one of these commands:
sudo python setup_serial.py install
python setup_serial.py install --home=~/foo :pre
The "build" command should compile all the needed LAMMPS files,
including its dummy MPI library. The first "install" command will put
the needed files in your Python's site-packages sub-directory, so that
Python can load them. For example, if you installed Python yourself
on a Linux machine, it would typically be somewhere like
/usr/local/lib/python2.5/site-packages. Installing Python packages
this way often requires you to be able to write to the Python
directories, which may require root priveleges, hence the "sudo"
prefix. If this is not the case, you can drop the "sudo".
Alternatively, you can install the LAMMPS files (or any other Python
packages) in your own user space. The second "install" command does
this, where you should replace "foo" with your directory of choice.
If these commands are successful, a {lammps.py} and
{_lammps_serial.so} file will be put in the appropriate directory.
:line
11.2 Creating a shared MPI library :link(py_2),h4
A shared library is one that is dynamically loadable, which is what
Python requires. On Linux this is a library file that ends in ".so",
not ".a". Such a shared library is normally not built if you
installed MPI yourself, but it is easy to do. Here is how to do it
for "MPICH"_mpich, a popular open-source version of MPI, distributed
by Argonne National Labs. From within the mpich directory, type
:link(mpich,http://www-unix.mcs.anl.gov/mpi)
./configure --enable-shared
make
make install :pre
You may need to use "sudo make install" in place of the last line.
The end result should be the file libmpich.so in /usr/local/lib.
IMPORTANT NOTE: If the file libmpich.a already exists in your
installation directory (e.g. /usr/local/lib), you will now have both a
static and shared MPI library. This will be fine for running LAMMPS
from Python since it only uses the shared library. But if you now try
to build LAMMPS by itself as a stand-alone program (cd lammps/src;
make foo) or build other codes that expect to link against libmpich.a,
then those builds may fail if the linker uses libmpich.so instead. If
this happens, it means you will need to remove the file
/usr/local/lib/libmich.so before building LAMMPS again as a
stand-alone code.
:line
11.3 Extending Python with a parallel version of LAMMPS :link(py_3),h4
From the python directory, type
python setup.py build :pre
and then one of these commands:
sudo python setup.py install
python setup.py install --home=~/foo :pre
The "build" command should compile all the needed LAMMPS C++ files,
which will require MPI to be installed on your system. This means it
must find both the header file mpi.h and a shared library file,
e.g. libmpich.so if the MPICH version of MPI is installed. See the
preceding section for how to create a shared library version of MPI if
it does not exist. You may need to adjust the "include_dirs" and
"library_dirs" and "libraries" fields in python/setup.py to
insure the Python build finds all the files it needs.
The first "install" command will put the needed files in your Python's
site-packages sub-directory, so that Python can load them. For
example, if you installed Python yourself on a Linux machine, it would
typically be somewhere like /usr/local/lib/python2.5/site-packages.
Installing Python packages this way often requires you to be able to
write to the Python directories, which may require root priveleges,
hence the "sudo" prefix. If this is not the case, you can drop the
"sudo".
Alternatively, you can install the LAMMPS files (or any other Python
packages) in your own user space. The second "install" command does
this, where you should replace "foo" with your directory of choice.
If these commands are successful, a {lammps.py} and {_lammps.so} file
will be put in the appropriate directory.
:line
11.4 Extending Python with MPI :link(py_4),h4
There are several Python packages available that purport to wrap MPI
as a library and allow MPI functions to be called from Python.
These include
"pyMPI"_http://pympi.sourceforge.net/
"maroonmpi"_http://code.google.com/p/maroonmpi/
"mpi4py"_http://code.google.com/p/mpi4py/
"myMPI"_http://nbcr.sdsc.edu/forum/viewtopic.php?t=89&sid=c997fefc3933bd66204875b436940f16
"Pypar"_http://datamining.anu.edu.au/~ole/pypar :ul
All of these except pyMPI work by wrapping the MPI library (which must
be available on your system as a shared library, as discussed above),
and exposing (some portion of) its interface to your Python script.
This means they cannot be used interactively in parallel, since they
do not address the issue of interactive input to multiple instances of
Python running on different processors. The one exception is pyMPI,
which alters the Python interpreter to address this issue, and (I
believe) creates a new alternate executable (in place of python
itself) as a result.
In principle any of these Python/MPI packages should work to invoke
both calls to LAMMPS and MPI itself from a Python script running in
parallel. However, when I downloaded and looked at a few of them,
their docuemtation was incomplete and I had trouble with their
installation. It's not clear if some of the packages are still being
actively developed and supported.
The one I recommend, since I have successfully used it with LAMMPS, is
Pypar. Pypar requires the ubiquitous "Numpy
package"_http://numpy.scipy.org be installed in your Python. After
launching python, type
>>> import numpy :pre
to see if it is installed. If not, here is how to install it (version
1.3.0b1 as of April 2009). Unpack the numpy tarball and from its
top-level directory, type
python setup.py build
sudo python setup.py install :pre
The "sudo" is only needed if required to copy Numpy files into your
Python distribution's site-packages directory.
To install Pypar (version pypar-2.1.0_66 as of April 2009), unpack it
and from its "source" directory, type
python setup.py build
sudo python setup.py install :pre
Again, the "sudo" is only needed if required to copy PyPar files into
your Python distribution's site-packages directory.
If you have successully installed Pypar, you should be able to run
python serially and type
>>> import pypar :pre
without error. You should also be able to run python in parallel
on a simple test script
% mpirun -np 4 python test.script :pre
where test.script contains the lines
import pypar
print "Proc %d out of %d procs" % (pypar.rank(),pypar.size()) :pre
and see one line of output for each processor you ran on.
:line
11.5 Testing the Python-LAMMPS interface :link(py_5),h4
Before using LAMMPS in a Python program, one more step is needed. The
interface to LAMMPS is via the Python ctypes package, which loads the
shared LAMMPS library via a CDLL() call, which in turn is a wrapper on
the C-library dlopen(). This command is different than a normal
Python "import" and needs to be able to find the LAMMPS shared
library, which is either in the Python site-packages directory or in a
local directory you specified in the "python setup.py install"
command, as described above.
The simplest way to do this is add a line like this to your
.cshrc or other shell start-up file.
setenv LD_LIBRARY_PATH
$\{LD_LIBRARY_PATH\}:/usr/local/lib/python2.5/site-packages :pre
and then execute the shell file to insure the path has been updated.
This will extend the path that dlopen() uses to look for shared
libraries.
To test if the serial LAMMPS library has been successfully installed
(mode 1 above), launch Python and type
>>> from lammps import lammps
>>> lmp = lammps() :pre
If you get no errors, you're ready to use serial LAMMPS from Python.
If you built LAMMPS for parallel use (mode 2 or 3 above), launch
Python in parallel:
% mpirun -np 4 python test.script :pre
where test.script contains the lines
import pypar
from lammps import lammps
lmp = lammps()
print "Proc %d out of %d procs has" % (pypar.rank(),pypar.size()), lmp
pypar.finalize() :pre
Again, if you get no errors, you're good to go.
Note that if you left out the "import pypar" line from this script,
you would instantiate and run LAMMPS independently on each of the P
processors specified in the mpirun command. You can test if Pypar is
enabling true parallel Python and LAMMPS by adding a line to the above
sequence of commands like lmp.file("in.lj") to run an input script and
see if the LAMMPS run says it ran on P processors or if you get output
from P duplicated 1-processor runs written to the screen. In the
latter case, Pypar is not working correctly.
Note that this line:
from lammps import lammps :pre
will import either the serial or parallel version of the LAMMPS
library, as wrapped by lammps.py. But if you installed both via
setup_serial.py and setup.py, it will always import the parallel
version, since it attempts that first.
Note that if your Python script imports the Pypar package (as above),
so that it can use MPI calls directly, then Pypar initializes MPI for
you. Thus the last line of your Python script should be
pypar.finalize(), to insure MPI is shut down correctly.
Also note that a Python script can be invoked in one of several ways:
% python foo.script
% python -i foo.script
% foo.script
The last command requires that the first line of the script be
something like this:
#!/usr/local/bin/python
#!/usr/local/bin/python -i
where the path points to where you have Python installed, and that you
have made the script file executable:
% chmod +x foo.script
Without the "-i" flag, Python will exit when the script finishes.
With the "-i" flag, you will be left in the Python interpreter when
the script finishes, so you can type subsequent commands. As
mentioned above, you can only run Python interactively when running
Python on a single processor, not in parallel.
:line
:line
11.6 Using LAMMPS from Python :link(py_6),h4
The Python interface to LAMMPS consists of a Python "lammps" module,
the source code for which is in python/lammps.py, which creates a
"lammps" object, with a set of methods that can be invoked on that
object. The sample Python code below assumes you have first imported
the "lammps" module in your Python script and its settings as
follows:
from lammps import lammps
from lammps import LMPINT as INT
from lammps import LMPDOUBLE as DOUBLE
from lammps import LMPIPTR as IPTR
from lammps import LMPDPTR as DPTR
from lammps import LMPDPTRPTR as DPTRPTR :pre
These are the methods defined by the lammps module. If you look
at the file src/library.cpp you will see that they correspond
one-to-one with calls you can make to the LAMMPS library from a C++ or
C or Fortran program.
lmp = lammps() # create a LAMMPS object
lmp = lammps(list) # ditto, with command-line args, list = \["-echo","screen"\] :pre
lmp.close() # destroy a LAMMPS object :pre
lmp.file(file) # run an entire input script, file = "in.lj"
lmp.command(cmd) # invoke a single LAMMPS command, cmd = "run 100" :pre
xlo = lmp.extract_global(name,type) # extract a global quantity
# name = "boxxlo", "nlocal", etc
# type = INT or DOUBLE :pre
coords = lmp.extract_atom(name,type) # extract a per-atom quantity
# name = "x", "type", etc
# type = IPTR or DPTR or DPTRPTR :pre
eng = lmp.extract_compute(id,style,type) # extract value(s) from a compute
v3 = lmp.extract_fix(id,style,type,i,j) # extract value(s) from a fix
# id = ID of compute or fix
# style = 0 = global data
# 1 = per-atom data
# 2 = local data
# type = 0 = scalar
# 1 = vector
# 2 = array
# i,j = indices of value in global vector or array :pre
var = lmp.extract_variable(name,group,flag) # extract value(s) from a variable
# name = name of variable
# group = group ID (ignored for equal-style variables)
# flag = 0 = equal-style variable
# 1 = atom-style variable :pre
natoms = lmp.get_natoms() # total # of atoms as int
x = lmp.get_coords() # return coords of all atoms in x
lmp.put_coords(x) # set all atom coords via x :pre
:line
The creation of a LAMMPS object does not take an MPI communicator as
an argument. There should be a way to do this, so that the LAMMPS
instance runs on a subset of processors, if desired, but I don't yet
know how from Pypar. So for now, it runs on MPI_COMM_WORLD, which is
all the processors.
The file() and command() methods allow an input script or single
commands to be invoked.
The extract_global(), extract_atom(), extract_compute(),
extract_fix(), and extract_variable() methods return values or
pointers to data structures internal to LAMMPS.
For extract_global() see the src/library.cpp file for the list of
valid names. New names could easily be added. A double or integer is
returned. You need to specify the appropriate data type via the type
argument.
For extract_atom(), a pointer to internal LAMMPS atom-based data is
returned, which you can use via normal Python subscripting. See the
extract() method in the src/atom.cpp file for a list of valid names.
Again, new names could easily be added. A pointer to a vector of
doubles or integers, or a pointer to an array of doubles (double **)
is returned. You need to specify the appropriate data type via the
type argument.
For extract_compute() and extract_fix(), the global, per-atom, or
local data calulated by the compute or fix can be accessed. What is
returned depends on whether the compute or fix calculates a scalar or
vector or array. For a scalar, a single double value is returned. If
the compute or fix calculates a vector or array, a pointer to the
internal LAMMPS data is returned, which you can use via normal Python
subscripting. The one exception is that for a fix that calculates a
global vector or array, a single double value from the vector or array
is returned, indexed by I (vector) or I and J (array). I,J are
zero-based indices. The I,J arguments can be left out if not needed.
-See "this section"_Section_howto.html#howto_15 of the manual for a
+See "Section_howto 15"_Section_howto.html#howto_15 of the manual for a
discussion of global, per-atom, and local data, and of scalar, vector,
and array data types. See the doc pages for individual
"computes"_compute.html and "fixes"_fix.html for a description of what
they calculate and store.
For extract_variable(), an "equal-style or atom-style
variable"_variable.html is evaluated and its result returned.
For equal-style variables a single double value is returned and the
group argument is ignored. For atom-style variables, a vector of
doubles is returned, one value per atom, which you can use via normal
Python subscripting. The values will be zero for atoms not in the
specified group.
The get_natoms() method returns the total number of atoms in the
simulation, as an int. Note that extract_global("natoms") returns the
same value, but as a double, which is the way LAMMPS stores it to
allow for systems with more atoms than can be stored in an int (> 2
billion).
The get_coords() method returns an ctypes vector of doubles of length
3*natoms, for the coordinates of all the atoms in the simulation,
ordered by x,y,z and then by atom ID (see code for put_coords()
below). The array can be used via normal Python subscripting. If
atom IDs are not consecutively ordered within LAMMPS, a None is
returned as indication of an error.
Note that the data structure get_coords() returns is different from
the data structure returned by extract_atom("x") in four ways. (1)
Get_coords() returns a vector which you index as x\[i\];
extract_atom() returns an array which you index as x\[i\]\[j\]. (2)
Get_coords() orders the atoms by atom ID while extract_atom() does
not. (3) Get_coords() returns a list of all atoms in the simulation;
extract_atoms() returns just the atoms local to each processor. (4)
Finally, the get_coords() data structure is a copy of the atom coords
stored internally in LAMMPS, whereas extract_atom returns an array
that points directly to the internal data. This means you can change
values inside LAMMPS from Python by assigning a new values to the
extract_atom() array. To do this with the get_atoms() vector, you
need to change values in the vector, then invoke the put_coords()
method.
The put_coords() method takes a vector of coordinates for all atoms in
the simulation, assumed to be ordered by x,y,z and then by atom ID,
and uses the values to overwrite the corresponding coordinates for
each atom inside LAMMPS. This requires LAMMPS to have its "map"
option enabled; see the "atom_modify"_atom_modify.html command for
details. If it is not or if atom IDs are not consecutively ordered,
no coordinates are reset,
The array of coordinates passed to put_coords() must be a ctypes
vector of doubles, allocated and initialized something like this:
from ctypes import *
natoms = lmp.get_atoms()
n3 = 3*natoms
x = (c_double*n3)()
x[0] = x coord of atom with ID 1
x[1] = y coord of atom with ID 1
x[2] = z coord of atom with ID 1
x[3] = x coord of atom with ID 2
...
x[n3-1] = z coord of atom with ID natoms
lmp.put_coords(x) :pre
Alternatively, you can just change values in the vector returned by
get_coords(), since it is a ctypes vector of doubles.
:line
As noted above, these Python class methods correspond one-to-one with
the functions in the LAMMPS library interface in src/library.cpp and
library.h. This means you can extend the Python wrapper via the
following steps:
Add a new interface function to src/library.cpp and
src/library.h. :ulb,l
Verify the new function is syntactically correct by building LAMMPS as
-a library - see "this section"_Section_start.html#start_4 of the
+a library - see "Section_start 4"_Section_start.html#start_4 of the
manual. :l
Add a wrapper method in the Python LAMMPS module to python/lammps.py
for this interface function. :l
Rebuild the Python wrapper via python/setup_serial.py or
python/setup.py. :l
You should now be able to invoke the new interface function from a
Python script. Isn't ctypes amazing? :l,ule
:line
:line
11.7 Example Python scripts that use LAMMPS :link(py_7),h4
These are the Python scripts included as demos in the python/examples
directory of the LAMMPS distribution, to illustrate the kinds of
things that are possible when Python wraps LAMMPS. If you create your
own scripts, send them to us and we can include them in the LAMMPS
distribution.
trivial.py, read/run a LAMMPS input script thru Python,
demo.py, invoke various LAMMPS library interface routines,
simple.py, mimic operation of couple/simple/simple.cpp in Python,
gui.py, GUI go/stop/temperature-slider to control LAMMPS,
plot.py, real-time temeperature plot with GnuPlot via Pizza.py,
viz_tool.py, real-time viz via some viz package,
vizplotgui_tool.py, combination of viz_tool.py and plot.py and gui.py :tb(c=2)
:line
For the viz_tool.py and vizplotgui_tool.py commands, replace "tool"
with "gl" or "atomeye" or "pymol" or "vmd", depending on what
visualization package you have installed.
Note that for GL, you need to be able to run the Pizza.py GL tool,
which is included in the pizza sub-directory. See the "Pizza.py doc
pages"_pizza for more info:
:link(pizza,http://www.sandia.gov/~sjplimp/pizza.html)
Note that for AtomEye, you need version 3, and there is a line in the
scripts that specifies the path and name of the executable. See the
AtomEye WWW pages "here"_atomeye or "here"_atomeye3 for more details:
http://mt.seas.upenn.edu/Archive/Graphics/A
http://mt.seas.upenn.edu/Archive/Graphics/A3/A3.html :pre
:link(atomeye,http://mt.seas.upenn.edu/Archive/Graphics/A)
:link(atomeye3,http://mt.seas.upenn.edu/Archive/Graphics/A3/A3.html)
The latter link is to AtomEye 3 which has the scriping
capability needed by these Python scripts.
Note that for PyMol, you need to have built and installed the
open-source version of PyMol in your Python, so that you can import it
from a Python script. See the PyMol WWW pages "here"_pymol or
"here"_pymolopen for more details:
http://www.pymol.org
http://sourceforge.net/scm/?type=svn&group_id=4546 :pre
:link(pymol,http://www.pymol.org)
:link(pymolopen,http://sourceforge.net/scm/?type=svn&group_id=4546)
The latter link is to the open-source version.
Note that for VMD, you need a fairly current version (1.8.7 works for
me) and there are some lines in the pizza/vmd.py script for 4 PIZZA
variables that have to match the VMD installation on your system.
:line
See the python/README file for instructions on how to run them and the
source code for individual scripts for comments about what they do.
Here are screenshots of the vizplotgui_tool.py script in action for
different visualization package options. Click to see larger images:
:image(JPG/screenshot_gl_small.jpg,JPG/screenshot_gl.jpg)
:image(JPG/screenshot_atomeye_small.jpg,JPG/screenshot_atomeye.jpg)
:image(JPG/screenshot_pymol_small.jpg,JPG/screenshot_pymol.jpg)
:image(JPG/screenshot_vmd_small.jpg,JPG/screenshot_vmd.jpg)
diff --git a/doc/Section_start.html b/doc/Section_start.html
index 4d6410729..29682bcd0 100644
--- a/doc/Section_start.html
+++ b/doc/Section_start.html
@@ -1,1176 +1,1245 @@
<HTML>
<CENTER><A HREF = "Section_intro.html">Previous Section</A> - <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A> - <A HREF = "Section_commands.html">Next Section</A>
</CENTER>
<HR>
<H3>2. Getting Started
</H3>
<P>This section describes how to build and run LAMMPS, for both new and
experienced users.
</P>
2.1 <A HREF = "#start_1">What's in the LAMMPS distribution</A><BR>
2.2 <A HREF = "#start_2">Making LAMMPS</A><BR>
2.3 <A HREF = "#start_3">Making LAMMPS with optional packages</A><BR>
2.4 <A HREF = "#start_4">Building LAMMPS as a library</A><BR>
2.5 <A HREF = "#start_5">Running LAMMPS</A><BR>
2.6 <A HREF = "#start_6">Command-line options</A><BR>
2.7 <A HREF = "#start_7">Screen output</A><BR>
2.8 <A HREF = "#start_8">Tips for users of previous versions</A> <BR>
<HR>
<HR>
<H4><A NAME = "start_1"></A>2.1 What's in the LAMMPS distribution
</H4>
<P>When you download LAMMPS you will need to unzip and untar the
downloaded file with the following commands, after placing the file in
an appropriate directory.
</P>
<PRE>gunzip lammps*.tar.gz
tar xvf lammps*.tar
</PRE>
<P>This will create a LAMMPS directory containing two files and several
sub-directories:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >README</TD><TD > text file</TD></TR>
<TR><TD >LICENSE</TD><TD > the GNU General Public License (GPL)</TD></TR>
<TR><TD >bench</TD><TD > benchmark problems</TD></TR>
<TR><TD >couple</TD><TD > code coupling examples, using LAMMPS as a library</TD></TR>
<TR><TD >doc</TD><TD > documentation</TD></TR>
<TR><TD >examples</TD><TD > simple test problems</TD></TR>
<TR><TD >potentials</TD><TD > embedded atom method (EAM) potential files</TD></TR>
<TR><TD >src</TD><TD > source files</TD></TR>
<TR><TD >tools</TD><TD > pre- and post-processing tools
</TD></TR></TABLE></DIV>
<P>If you download one of the Windows executables from the download page,
then you just get a single file:
</P>
<PRE>lmp_windows.exe
</PRE>
<P>Skip to the <A HREF = "#start_5">Running LAMMPS</A> sections for info on how to
launch these executables on a Windows box.
</P>
<P>The Windows executables for serial or parallel only include certain
packages and bug-fixes/upgrades listed on <A HREF = "http://lammps.sandia.gov/bug.html">this
page</A> up to a certain date, as
stated on the download page. If you want something with more packages
or that is more current, you'll have to download the source tarball
and build it yourself from source code using Microsoft Visual Studio,
as described in the next section.
</P>
<HR>
<H4><A NAME = "start_2"></A>2.2 Making LAMMPS
</H4>
<P>This section has the following sub-sections:
</P>
<UL><LI><A HREF = "#start_2_1">Read this first</A>
<LI><A HREF = "#start_2_2">Steps to build a LAMMPS executable</A>
<LI><A HREF = "#start_2_3">Common errors that can occur when making LAMMPS</A>
<LI><A HREF = "#start_2_4">Additional build tips</A>
<LI><A HREF = "#start_2_5">Building for a Mac</A>
<LI><A HREF = "#start_2_6">Building for Windows</A>
</UL>
<HR>
<A NAME = "start_2_1"></A><B><I>Read this first:</I></B>
<P>Building LAMMPS can be non-trivial. You may need to edit a makefile,
there are compiler options to consider, additional libraries can be
used (MPI, FFT, JPEG), LAMMPS packages may be included or excluded,
some of these packages use auxiliary libraries which need to be
pre-built, etc.
</P>
<P>Please read this section carefully. If you are not comfortable with
makefiles, or building codes on a Unix platform, or running an MPI job
on your machine, please find a local expert to help you. Many
compiling, linking, and run problems that users have are not really
LAMMPS issues - they are peculiar to the user's system, compilers,
libraries, etc. Such questions are better answered by a local expert.
</P>
<P>If you have a build problem that you are convinced is a LAMMPS issue
(e.g. the compiler complains about a line of LAMMPS source code), then
please send an email to the
<A HREF = "http://lammps.sandia.gov/authors.html">developers</A>.
</P>
<P>If you succeed in building LAMMPS on a new kind of machine, for which
there isn't a similar Makefile for in the src/MAKE directory, send it
to the developers and we'll include it in future LAMMPS releases.
</P>
<HR>
<A NAME = "start_2_2"></A><B><I>Steps to build a LAMMPS executable:</I></B>
<P><B>Step 0</B>
</P>
<P>The src directory contains the C++ source and header files for LAMMPS.
It also contains a top-level Makefile and a MAKE sub-directory with
low-level Makefile.* files for many machines. From within the src
directory, type "make" or "gmake". You should see a list of available
choices. If one of those is the machine and options you want, you can
type a command like:
</P>
<PRE>make linux
or
gmake mac
</PRE>
<P>Note that on a multi-processor or multi-core platform you can launch a
parallel make, by using the "-j" switch with the make command, which
will build LAMMPS more quickly.
</P>
<P>If you get no errors and an executable like lmp_linux or lmp_mac is
produced, you're done; it's your lucky day.
</P>
<P>Note that by default only a few of LAMMPS optional pacakges are
installed. To build LAMMPS with optional packages, see <A HREF = "#start_3">this
section</A> below.
</P>
<P><B>Step 1</B>
</P>
<P>If Step 0 did not work, you will need to create a low-level Makefile
for your machine, like Makefile.foo. You should make a copy of an
existing src/MAKE/Makefile.* as a starting point. The only portions
of the file you need to edit are the first line, the "compiler/linker
settings" section, and the "LAMMPS-specific settings" section.
</P>
<P><B>Step 2</B>
</P>
<P>Change the first line of src/MAKE/Makefile.foo to list the word "foo"
after the "#", and whatever other options it will set. This is the
line you will see if you just type "make".
</P>
<P><B>Step 3</B>
</P>
<P>The "compiler/linker settings" section lists compiler and linker
settings for your C++ compiler, including optimization flags. You can
use g++, the open-source GNU compiler, which is available on all Unix
systems. You can also use mpicc which will typically be available if
MPI is installed on your system, though you should check which actual
compiler it wraps. Vendor compilers often produce faster code. On
boxes with Intel CPUs, we suggest using the commercial Intel icc
compiler, which can be downloaded from <A HREF = "http://www.intel.com/software/products/noncom">Intel's compiler site</A>.
</P>
<P>If building a C++ code on your machine requires additional libraries,
then you should list them as part of the LIB variable.
</P>
<P>The DEPFLAGS setting is what triggers the C++ compiler to create a
dependency list for a source file. This speeds re-compilation when
source (*.cpp) or header (*.h) files are edited. Some compilers do
not support dependency file creation, or may use a different switch
than -D. GNU g++ works with -D. If your compiler can't create
dependency files, then you'll need to create a Makefile.foo patterned
after Makefile.storm, which uses different rules that do not involve
dependency files. Note that when you build LAMMPS for the first time
on a new platform, a long list of *.d files will be printed out
rapidly. This is not an error; it is the Makefile doing its normal
creation of dependencies.
</P>
<P><B>Step 4</B>
</P>
<P>The "system-specific settings" section has several parts. Note that
if you change any -D setting in this section, you should do a full
re-compile, after typing "make clean" (which will describe different
clean options).
</P>
<P>The LMP_INC variable is used to include options that turn on ifdefs
within the LAMMPS code. The options that are currently recogized are:
</P>
<UL><LI>-DLAMMPS_GZIP
<LI>-DLAMMPS_JPEG
<LI>-DLAMMPS_MEMALIGN
<LI>-DLAMMPS_XDR
<LI>-DLAMMPS_SMALLBIG
<LI>-DLAMMPS_BIGBIG
<LI>-DLAMMPS_SMALLSMALL
<LI>-DLAMMPS_LONGLONG_TO_LONG
<LI>-DPACK_ARRAY
<LI>-DPACK_POINTER
<LI>-DPACK_MEMCPY
</UL>
<P>The read_data and dump commands will read/write gzipped files if you
compile with -DLAMMPS_GZIP. It requires that your Unix support the
"popen" command.
</P>
<P>If you use -DLAMMPS_JPEG, the <A HREF = "dump.html">dump image</A> command will be
able to write out JPEG image files. If not, it will only be able to
write out text-based PPM image files. For JPEG files, you must also
link LAMMPS with a JPEG library, as described below.
</P>
<P>Using -DLAMMPS_MEMALIGN=<bytes> enables the use of the
posix_memalign() call instead of malloc() when large chunks or memory
are allocated by LAMMPS. This can help to make more efficient use of
vector instructions of modern CPUS, since dynamically allocated memory
has to be aligned on larger than default byte boundaries (e.g. 16
bytes instead of 8 bytes on x86 type platforms) for optimal
performance.
</P>
<P>If you use -DLAMMPS_XDR, the build will include XDR compatibility
files for doing particle dumps in XTC format. This is only necessary
if your platform does have its own XDR files available. See the
Restrictions section of the <A HREF = "dump.html">dump</A> command for details.
</P>
<P>Use at most one of the -DLAMMPS_SMALLBIG, -DLAMMPS_BIGBIG,
-D-DLAMMPS_SMALLSMALL settings. The default is -DLAMMPS_SMALLBIG.
These refer to use of 4-byte (small) vs 8-byte (big) integers within
LAMMPS, as described in src/lmptype.h. The only reason to use the
BIGBIG setting is to enable simulation of huge molecular systems with
more than 2 billion atoms. The only reason to use the SMALLSMALL
setting is if your machine does not support 64-bit integers.
</P>
<P>The -DLAMMPS_LONGLONG_TO_LONG setting may be needed if your system or
MPI version does not recognize "long long" data types. In this case a
"long" data type is likely already 64-bits, in which case this setting
will convert to that data type.
</P>
<P>Using one of the -DPACK_ARRAY, -DPACK_POINTER, and -DPACK_MEMCPY
options can make for faster parallel FFTs (in the PPPM solver) on some
platforms. The -DPACK_ARRAY setting is the default. See the
<A HREF = "kspace_style.html">kspace_style</A> command for info about PPPM. See
Step 6 below for info about building LAMMPS with an FFT library.
</P>
<P><B>Step 5</B>
</P>
<P>The 3 MPI variables are used to specify an MPI library to build LAMMPS
with.
</P>
<P>If you want LAMMPS to run in parallel, you must have an MPI library
installed on your platform. If you use an MPI-wrapped compiler, such
as "mpicc" to build LAMMPS, you should be able to leave these 3
variables blank; the MPI wrapper knows where to find the needed files.
If not, and MPI is installed on your system in the usual place (under
/usr/local), you also may not need to specify these 3 variables. On
some large parallel machines which use "modules" for their
compile/link environements, you may simply need to include the correct
module in your build environment. Or the parallel machine may have a
vendor-provided MPI which the compiler has no trouble finding.
</P>
<P>Failing this, with these 3 variables you can specify where the mpi.h
file (MPI_INC) and the MPI library file (MPI_PATH) are found and the
name of the library file (MPI_LIB).
</P>
<P>If you are installing MPI yourself, we recommend Argonne's MPICH2
or OpenMPI. MPICH can be downloaded from the <A HREF = "http://www.mcs.anl.gov/research/projects/mpich2/">Argonne MPI
site</A>. OpenMPI can
be downloaded from the <A HREF = "http://www.open-mpi.org">OpenMPI site</A>.
Other MPI packages should also work. If you are running on a big
parallel platform, your system people or the vendor should have
already installed a version of MPI, which is likely to be faster
than a self-installed MPICH or OpenMPI, so find out how to build
and link with it. If you use MPICH or OpenMPI, you will have to
configure and build it for your platform. The MPI configure script
should have compiler options to enable you to use the same compiler
you are using for the LAMMPS build, which can avoid problems that can
arise when linking LAMMPS to the MPI library.
</P>
<P>If you just want to run LAMMPS on a single processor, you can use the
dummy MPI library provided in src/STUBS, since you don't need a true
MPI library installed on your system. See the
src/MAKE/Makefile.serial file for how to specify the 3 MPI variables
in this case. You will also need to build the STUBS library for your
platform before making LAMMPS itself. From the src directory, type
"make stubs", or from the STUBS dir, type "make" and it should create
a libmpi.a suitable for linking to LAMMPS. If this build fails, you
will need to edit the STUBS/Makefile for your platform.
</P>
<P>The file STUBS/mpi.cpp provides a CPU timer function called
MPI_Wtime() that calls gettimeofday() . If your system doesn't
support gettimeofday() , you'll need to insert code to call another
timer. Note that the ANSI-standard function clock() rolls over after
an hour or so, and is therefore insufficient for timing long LAMMPS
simulations.
</P>
<P><B>Step 6</B>
</P>
<P>The 3 FFT variables allow you to specify an FFT library which LAMMPS
uses (for performing 1d FFTs) when running the particle-particle
particle-mesh (PPPM) option for long-range Coulombics via the
<A HREF = "kspace_style.html">kspace_style</A> command.
</P>
<P>LAMMPS supports various open-source or vendor-supplied FFT libraries
for this purpose. If you leave these 3 variables blank, LAMMPS will
use the open-source <A HREF = "http://kissfft.sf.net">KISS FFT library</A>, which is
included in the LAMMPS distribution. This library is portable to all
platforms and for typical LAMMPS simulations is almost as fast as FFTW
or vendor optimized libraries. If you are not including the KSPACE
package in your build, you can also leave the 3 variables blank.
</P>
<P>Otherwise, select which kinds of FFTs to use as part of the FFT_INC
setting by a switch of the form -DFFT_XXX. Recommended values for XXX
are: MKL, SCSL, FFTW2, and FFTW3. Legacy options are: INTEL, SGI,
ACML, and T3E. For backward compatability, using -DFFT_FFTW will use
the FFTW2 library. Using -DFFT_NONE will use the KISS library
described above.
</P>
<P>You may also need to set the FFT_INC, FFT_PATH, and FFT_LIB variables,
so the compiler and linker can find the needed FFT header and library
files. Note that on some large parallel machines which use "modules"
for their compile/link environements, you may simply need to include
the correct module in your build environment. Or the parallel machine
may have a vendor-provided FFT library which the compiler has no
trouble finding.
</P>
<P>FFTW is a fast, portable library that should also work on any
platform. You can download it from
<A HREF = "http://www.fftw.org">www.fftw.org</A>. Both the legacy version 2.1.X and
the newer 3.X versions are supported as -DFFT_FFTW2 or -DFFT_FFTW3.
Building FFTW for your box should be as simple as ./configure; make.
Note that on some platforms FFTW2 has been pre-installed, and uses
renamed files indicating the precision it was compiled with,
e.g. sfftw.h, or dfftw.h instead of fftw.h. In this case, you can
specify an additional define variable for FFT_INC called -DFFTW2_SIZE,
which will select the correct include file. In this case, for FFT_LIB
you must also manually specify the correct library, namely -lsfftw or
-ldfftw.
</P>
<P>The FFT_INC variable also allows for a -DFFT_SINGLE setting that will
use single-precision FFTs with PPPM, which can speed-up long-range
calulations, particularly in parallel or on GPUs. Fourier transform
and related PPPM operations are somewhat insensitive to floating point
truncation errors and thus do not always need to be performed in
double precision. Using the -DFFT_SINGLE setting trades off a little
accuracy for reduced memory use and parallel communication costs for
transposing 3d FFT data. Note that single precision FFTs have only
been tested with the FFTW3, FFTW2, MKL, and KISS FFT options.
</P>
<P><B>Step 7</B>
</P>
<P>The 3 JPG variables allow you to specify a JPEG library which LAMMPS
uses when writing out JPEG files via the <A HREF = "dump_image.html">dump image</A>
command. These can be left blank if you do not use the -DLAMMPS_JPEG
switch discussed above in Step 4, since in that case JPEG output will
be disabled.
</P>
<P>A standard JPEG library usually goes by the name libjpeg.a and has an
associated header file jpeglib.h. Whichever JPEG library you have on
your platform, you'll need to set the appropriate JPG_INC, JPG_PATH,
and JPG_LIB variables, so that the compiler and linker can find it.
</P>
<P>As before, if these header and library files are in the usual place on
your machine, you may not need to set these variables.
</P>
<P><B>Step 8</B>
</P>
<P>Note that by default only a few of LAMMPS optional pacakges are
installed. To build LAMMPS with optional packages, see <A HREF = "#start_3">this
section</A> below, before proceeding to Step 9.
</P>
<P><B>Step 9</B>
</P>
<P>That's it. Once you have a correct Makefile.foo, you have installed
the optional LAMMPS packages you want to include in your build, and
you have pre-built any other needed libraries (e.g. MPI, FFT, package
libraries), all you need to do from the src directory is type
something like this:
</P>
<PRE>make foo
or
gmake foo
</PRE>
<P>You should get the executable lmp_foo when the build is complete.
</P>
<HR>
<A NAME = "start_2_3"></A><B><I>Errors that can occur when making LAMMPS:</I></B>
<P>IMPORTANT NOTE: If an error occurs when building LAMMPS, the compiler
or linker will state very explicitly what the problem is. The error
message should give you a hint as to which of the steps above has
failed, and what you need to do in order to fix it. Building a code
with a Makefile is a very logical process. The compiler and linker
need to find the appropriate files and those files need to be
compatible with LAMMPS source files. When a make fails, there is
usually a very simple reason, which you or a local expert will need to
fix.
</P>
<P>Here are two non-obvious errors that can occur:
</P>
<P>(1) If the make command breaks immediately with errors that indicate
it can't find files with a "*" in their names, this can be because
your machine's native make doesn't support wildcard expansion in a
makefile. Try gmake instead of make. If that doesn't work, try using
a -f switch with your make command to use a pre-generated
Makefile.list which explicitly lists all the needed files, e.g.
</P>
<PRE>make makelist
make -f Makefile.list linux
gmake -f Makefile.list mac
</PRE>
<P>The first "make" command will create a current Makefile.list with all
the file names in your src dir. The 2nd "make" command (make or
gmake) will use it to build LAMMPS. Note that you should
include/exclude any desired optional packages before using the "make
makelist" command.
</P>
<P>(2) If you get an error that says something like 'identifier "atoll"
is undefined', then your machine does not support "long long"
integers. Try using the -DLAMMPS_LONGLONG_TO_LONG setting described
above in Step 4.
</P>
<HR>
<A NAME = "start_2_4"></A><B><I>Additional build tips:</I></B>
<P>(1) Building LAMMPS for multiple platforms.
</P>
<P>You can make LAMMPS for multiple platforms from the same src
directory. Each target creates its own object sub-directory called
Obj_name where it stores the system-specific *.o files.
</P>
<P>(2) Cleaning up.
</P>
<P>Typing "make clean-all" or "make clean-foo" will delete *.o object
files created when LAMMPS is built, for either all builds or for a
particular machine.
</P>
<P>(3) Changing the size limits in src/lmptype.h
</P>
<P>If you are running a very large problem (billions of atoms or more)
and get a run-time error about the system being too big, either on a
per-processor basis or in total size, then you may need to change one
or more settings in src/lmptype.h and re-compile LAMMPS.
</P>
<P>As the documentation in that file explains, you have basically
two choices to make:
</P>
<UL><LI>set the data type size of integer atom IDs to 4 or 8 bytes
<LI>set the data type size of integers that store the total system size to 4 or 8 bytes
</UL>
<P>The default for atom IDs is 4-byte integers since there is a memory
and communication cost for 8-byte integers. Non-molecular problems do
not need atom IDs so this does not restrict their size. Molecular
problems (which use IDs to define molecular topology), are limited to
about 2 billion atoms (2^31) with 4-byte IDs. With 8-byte IDs they
are effectively unlimited in size (2^63).
</P>
<P>The default for total system size quantities (like the number of atoms
or timesteps) is 8-byte integers by default which is effectively
unlimited in size (2^63). If your system or MPI implementation does
not support 8-byte integers, an error will be generated, and you will
need to set "bigint" to 4-byte integers. This restricts your total
system size to about 2 billion atoms or timesteps (2^31).
</P>
<P>Note that in src/lmptype.h there are also settings for the MPI data
types associated with the integers that store atom IDs and total
system sizes, which need to be set consistent with the associated C
data types.
</P>
<P>In all cases, the size of problem that can be run on a per-processor
basis is limited by 4-byte integer storage to about 2 billion atoms
per processor (2^31), which should not normally be a restriction since
such a problem would have a huge per-processor memory footprint due to
neighbor lists and would run very slowly in terms of CPU
secs/timestep.
</P>
<HR>
<A NAME = "start_2_5"></A><B><I>Building for a Mac:</I></B>
<P>OS X is BSD Unix, so it should just work. See the Makefile.mac file.
</P>
<HR>
<A NAME = "start_2_6"></A><B><I>Building for Windows:</I></B>
<P>The LAMMPS download page has an option to download both a serial and
parallel pre-built Windows exeutable. See the <A HREF = "#start_5">Running
LAMMPS</A> section for instructions for running these
executables on a Windows box.
</P>
<P>If the pre-built executable doesn't have the options you want, then
you can build LAMMPS from its source files on a Windows box. One way
to do this is install and use cygwin to build LAMMPS with a standard
Linus make, just as you would on any Linux box; see
src/MAKE/Makefile.cygwin.
</P>
<P>There is a also a src/WINDOWS directory that contains project files
for Microsoft Visual Studio 2005, which should also work with later
versions of VS. That directory contains a README.txt file which
provides instructions for building LAMMPS from source code using
Visual Studio that are hopefully easy to follow for Windows and VS
users.
</P>
<P>Four VS project options are provided. The first includes the default
packages (MANYBODY, MOLECULE, and KSPACE). The second includes all
standard packages (except GPU, MEAM, and REAX which are not yet
included because they require NVIDIA or Fortran compilation). The
third includes all standard packages (with the exceptions) and some
user packages. The included user packages are USER-EFF, USER-CG-CMM,
and USER-REAXC. The fourth project includes the USER-AWPMD package.
</P>
<HR>
<H4><A NAME = "start_3"></A>2.3 Making LAMMPS with optional packages
</H4>
<P>This section has the following sub-sections:
</P>
<UL><LI><A HREF = "#start_3_1">Package basics</A>
<LI><A HREF = "#start_3_2">Including/excluding packages</A>
<LI><A HREF = "#start_3_3">Packages that require extra libraries</A>
<LI><A HREF = "#start_3_4">Additional Makefile settings for extra libraries</A>
</UL>
<HR>
<A NAME = "start_3_1"></A><B><I>Package basics:</I></B>
<P>The source code for LAMMPS is structured as a set of core files which
are always included, plus optional packages. Packages are groups of
files that enable a specific set of features. For example, force
fields for molecular systems or granular systems are in packages. You
can see the list of all packages by typing "make package" from within
the src directory of the LAMMPS distribution.
</P>
<P>If you use a command in a LAMMPS input script that is specific to a
particular package, you must have built LAMMPS with that package, else
you will get an error that the style is invalid or the command is
unknown. Every command's doc page specfies if it is part of a
package. You can also type
</P>
<PRE>lmp_machine -h
</PRE>
<P>to run your executable with the optional <A HREF = "#start_6">-h command-line
switch</A> for "help", which will list the styles and commands
known to your executable.
</P>
<P>There are two kinds of packages in LAMMPS, standard and user packages.
More information about the contents of standard and user packages is
-given in <A HREF = "Section_packages.html">this section</A> of the manual. The
+given in <A HREF = "Section_packages.html">Section_packages</A> of the manual. The
difference between standard and user packages is as follows:
</P>
<P>Standard packages are supported by the LAMMPS developers and are
written in a syntax and style consistent with the rest of LAMMPS.
This means we will answer questions about them, debug and fix them if
necessary, and keep them compatible with future changes to LAMMPS.
</P>
<P>User packages have been contributed by users, and always begin with
the user prefix. If they are a single command (single file), they are
typically in the user-misc package. Otherwise, they are a a set of
files grouped together which add a specific functionality to the code.
</P>
<P>User packages don't necessarily meet the requirements of the standard
packages. If you have problems using a feature provided in a user
package, you will likely need to contact the contributor directly to
get help. Information on how to submit additions you make to LAMMPS
as a user-contributed package is given in <A HREF = "Section_modify.html#mod_14">this
section</A> of the documentation.
</P>
<HR>
<A NAME = "start_3_2"></A><B><I>Including/excluding packages:</I></B>
<P>To use or not use a package you must include or exclude it before
building LAMMPS. From the src directory, this is typically as simple
as:
</P>
<PRE>make yes-colloid
make g++
</PRE>
<P>or
</P>
<PRE>make no-manybody
make g++
</PRE>
<P>Some packages have individual files that depend on other packages
being included. LAMMPS checks for this and does the right thing.
I.e. individual files are only included if their dependencies are
already included. Likewise, if a package is excluded, other files
dependent on that package are also excluded.
</P>
<P>The reason to exclude packages is if you will never run certain kinds
of simulations. For some packages, this will keep you from having to
build auxiliary libraries (see below), and will also produce a smaller
executable which may run a bit faster.
</P>
<P>When you download a LAMMPS tarball, these packages are pre-installed
in the src directory: KSPACE, MANYBODY,MOLECULE. When you download
LAMMPS source files from the SVN or Git repositories, no packages are
pre-installed.
</P>
<P>Packages are included or excluded by typing "make yes-name" or "make
no-name", where "name" is the name of the package in lower-case, e.g.
name = kspace for the KSPACE package or name = user-atc for the
USER-ATC package. You can also type "make yes-standard", "make
no-standard", "make yes-user", "make no-user", "make yes-all" or "make
no-all" to include/exclude various sets of packages. Type "make
package" to see the all of the package-related make options.
</P>
<P>IMPORTANT NOTE: Inclusion/exclusion of a package works by simply
moving files back and forth between the main src directory and
sub-directories with the package name (e.g. src/KSPACE, src/USER-ATC),
so that the files are seen or not seen when LAMMPS is built. After
you have included or excluded a package, you must re-build LAMMPS.
</P>
<P>Additional package-related make options exist to help manage LAMMPS
files that exist in both the src directory and in package
sub-directories. You do not normally need to use these commands
unless you are editing LAMMPS files or have downloaded a patch from
the LAMMPS WWW site.
</P>
<P>Typing "make package-update" will overwrite src files with files from
the package sub-directories if the package has been included. It
should be used after a patch is installed, since patches only update
the files in the package sub-directory, but not the src files. Typing
"make package-overwrite" will overwrite files in the package
sub-directories with src files.
</P>
<P>Typing "make package-status" will show which packages are currently
included. Of those that are included, it will list files that are
different in the src directory and package sub-directory. Typing
"make package-diff" lists all differences between these files. Again,
type "make package" to see all of the package-related make options.
</P>
<HR>
<A NAME = "start_3_3"></A><B><I>Packages that require extra libraries:</I></B>
<P>A few of the standard and user packages require additional auxiliary
libraries to be compiled first. If you get a LAMMPS build error about
a missing library, this is likely the reason. The source code for
these libraries is included in the LAMMPS distribution under the "lib"
directory. Look at the lib/README file for a list of these or see
-<A HREF = "Section_packages.html">this section</A> of the doc pages.
+<A HREF = "Section_packages.html">Section_packages</A> of the doc pages.
</P>
<P>Each lib directory has a README file (e.g. lib/reax/README) with
instructions on how to build that library. Typically this is done
in this manner:
</P>
<PRE>make -f Makefile.g++
</PRE>
<P>in the appropriate directory, e.g. in lib/reax. Some of the libraries
do not build this way. Again, see the libary README file for details.
</P>
<P>In any event, you will need to use a Makefile that is a match for your
system. If one of the provided Makefiles is not appropriate for your
system you will need to edit or add one. For example, in the case of
Fortran-based libraries, your system must have a Fortran compiler, the
settings for which will need to be listed in the Makefile.
</P>
<P>When you have built one of these libraries, there are 2 things to
check:
</P>
<P>(1) The file libname.a should now exist in lib/name.
E.g. lib/reax/libreax.a. This is the library file LAMMPS will link
against. One exception is the lib/cuda library which produces the
file liblammpscuda.a, because there is already a system library
libcuda.a.
</P>
<P>(2) The file Makefile.lammps should exist in lib/name. E.g.
lib/cuda/Makefile.lammps. This file may be auto-generated by the
build of the library, or you may need to make a copy of the
appropriate provided file (e.g. lib/meam/Makefile.lammps.gfortran).
Either way you should insure that the settings in this file are
appropriate for your system.
</P>
<P>There are typically 3 settings in the Makefile.lammps file (unless
some are blank or not needed): a SYSINC, SYSPATH, and SYSLIB setting,
specific to this package. These are settings the LAMMPS build will
import when compiling the LAMMPS package files (not the library
files), and linking to the auxiliary library. They typically list any
other system libraries needed to support the package and where to find
them. An example is the BLAS and LAPACK libraries needed by the
USER-ATC package. Or the system libraries that support calling
Fortran from C++, as the MEAM and REAX packages do.
</P>
<P>Note that if these settings are not correct for your box, the LAMMPS
build will likely fail.
</P>
<HR>
<H4><A NAME = "start_4"></A>2.4 Building LAMMPS as a library
</H4>
<P>LAMMPS itself can be built as a library, which can then be called from
another application or a scripting language. See <A HREF = "Section_howto.html#howto_10">this
section</A> for more info on coupling LAMMPS
to other codes. Building LAMMPS as a library is done by typing
</P>
<PRE>make makelib
make -f Makefile.lib foo
</PRE>
<P>where foo is the machine name. Note that inclusion or exclusion of
any desired optional packages should be done before typing "make
makelib". The first "make" command will create a current Makefile.lib
with all the file names in your src dir. The 2nd "make" command will
use it to build LAMMPS as a library. This requires that Makefile.foo
have a library target (lib) and system-specific settings for ARCHIVE
and ARFLAGS. See Makefile.linux for an example. The build will
create the file liblmp_foo.a which another application can link to.
</P>
<P>When used from a C++ program, the library allows one or more LAMMPS
objects to be instantiated. All of LAMMPS is wrapped in a LAMMPS_NS
namespace; you can safely use any of its classes and methods from
within your application code, as needed.
</P>
<P>When used from a C or Fortran program or a scripting language, the
library has a simple function-style interface, provided in
src/library.cpp and src/library.h.
</P>
<P>See the sample codes couple/simple/simple.cpp and simple.c as examples
of C++ and C codes that invoke LAMMPS thru its library interface.
There are other examples as well in the couple directory which are
-discussed in <A HREF = "Section_howto.html#howto_10">this section</A> of the manual.
-See <A HREF = "Section_python.html">this section</A> of the manual for a description
-of the Python wrapper provided with LAMMPS that operates through the
-LAMMPS library interface.
+discussed in <A HREF = "Section_howto.html#howto_10">Section_howto 10</A> of the
+manual. See <A HREF = "Section_python.html">Section_python</A> of the manual for a
+description of the Python wrapper provided with LAMMPS that operates
+through the LAMMPS library interface.
</P>
<P>The files src/library.cpp and library.h contain the C-style interface
-to LAMMPS. See <A HREF = "Section_howto.html#howto_19">this section</A> of the
+to LAMMPS. See <A HREF = "Section_howto.html#howto_19">Section_howto 19</A> of the
manual for a description of the interface and how to extend it for
your needs.
</P>
<HR>
<H4><A NAME = "start_5"></A>2.5 Running LAMMPS
</H4>
<P>By default, LAMMPS runs by reading commands from stdin; e.g. lmp_linux
< in.file. This means you first create an input script (e.g. in.file)
containing the desired commands. <A HREF = "Section_commands.html">This section</A>
describes how input scripts are structured and what commands they
contain.
</P>
<P>You can test LAMMPS on any of the sample inputs provided in the
examples or bench directory. Input scripts are named in.* and sample
outputs are named log.*.name.P where name is a machine and P is the
number of processors it was run on.
</P>
<P>Here is how you might run a standard Lennard-Jones benchmark on a
Linux box, using mpirun to launch a parallel job:
</P>
<PRE>cd src
make linux
cp lmp_linux ../bench
cd ../bench
mpirun -np 4 lmp_linux < in.lj
</PRE>
<P>See <A HREF = "http://lammps.sandia.gov/bench.html">this page</A> for timings for this and the other benchmarks
on various platforms.
</P>
<HR>
<P>On a Windows box, you can skip making LAMMPS and simply download an
executable, as described above, though the pre-packaged executables
include only certain packages.
</P>
<P>To run a LAMMPS executable on a Windows machine, first decide whether
you want to download the non-MPI (serial) or the MPI (parallel)
version of the executable. Download and save the version you have
chosen.
</P>
<P>For the non-MPI version, follow these steps:
</P>
<UL><LI>Get a command prompt by going to Start->Run... ,
then typing "cmd".
<LI>Move to the directory where you have saved lmp_win_no-mpi.exe
(e.g. by typing: cd "Documents").
<LI>At the command prompt, type "lmp_win_no-mpi -in in.lj", replacing in.lj
with the name of your LAMMPS input script.
</UL>
<P>For the MPI version, which allows you to run LAMMPS under Windows on
multiple processors, follow these steps:
</P>
<UL><LI>Download and install
<A HREF = "http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads">MPICH2</A>
for Windows.
<LI>You'll need to use the mpiexec.exe and smpd.exe files from the MPICH2 package. Put them in
same directory (or path) as the LAMMPS Windows executable.
<LI>Get a command prompt by going to Start->Run... ,
then typing "cmd".
<LI>Move to the directory where you have saved lmp_win_mpi.exe
(e.g. by typing: cd "Documents").
<LI>Then type something like this: "mpiexec -np 4 -localonly lmp_win_mpi -in in.lj",
replacing in.lj with the name of your LAMMPS input script.
<LI>Note that you may need to provide smpd with a passphrase --- it doesn't matter what you
type.
<LI>In this mode, output may not immediately show up on the screen, so
if your input script takes a long time to execute, you may need to be
patient before the output shows up.
<LI>Alternatively, you can still use this executable to run on a single processor by
typing something like: "lmp_win_mpi -in in.lj".
</UL>
<HR>
<P>The screen output from LAMMPS is described in the next section. As it
runs, LAMMPS also writes a log.lammps file with the same information.
</P>
<P>Note that this sequence of commands copies the LAMMPS executable
(lmp_linux) to the directory with the input files. This may not be
necessary, but some versions of MPI reset the working directory to
where the executable is, rather than leave it as the directory where
you launch mpirun from (if you launch lmp_linux on its own and not
under mpirun). If that happens, LAMMPS will look for additional input
files and write its output files to the executable directory, rather
than your working directory, which is probably not what you want.
</P>
<P>If LAMMPS encounters errors in the input script or while running a
simulation it will print an ERROR message and stop or a WARNING
-message and continue. See <A HREF = "Section_errors.html">this section</A> for a
+message and continue. See <A HREF = "Section_errors.html">Section_errors</A> for a
discussion of the various kinds of errors LAMMPS can or can't detect,
a list of all ERROR and WARNING messages, and what to do about them.
</P>
<P>LAMMPS can run a problem on any number of processors, including a
single processor. In theory you should get identical answers on any
number of processors and on any machine. In practice, numerical
round-off can cause slight differences and eventual divergence of
molecular dynamics phase space trajectories.
</P>
<P>LAMMPS can run as large a problem as will fit in the physical memory
of one or more processors. If you run out of memory, you must run on
more processors or setup a smaller problem.
</P>
<HR>
<H4><A NAME = "start_6"></A>2.6 Command-line options
</H4>
<P>At run time, LAMMPS recognizes several optional command-line switches
which may be used in any order. Either the full word or a one-or-two
letter abbreviation can be used:
</P>
<UL><LI>-c or -cuda
<LI>-e or -echo
<LI>-i or -in
<LI>-h or -help
<LI>-l or -log
<LI>-p or -partition
<LI>-pl or -plog
<LI>-ps or -pscreen
+<LI>-r or -reorder
<LI>-sc or -screen
<LI>-sf or -suffix
<LI>-v or -var
</UL>
<P>For example, lmp_ibm might be launched as follows:
</P>
<PRE>mpirun -np 16 lmp_ibm -v f tmp.out -l my.log -sc none < in.alloy
mpirun -np 16 lmp_ibm -var f tmp.out -log my.log -screen none < in.alloy
</PRE>
<P>Here are the details on the options:
</P>
<PRE>-cuda on/off
</PRE>
<P>Explicitly enable or disable CUDA support, as provided by the
USER-CUDA package. If LAMMPS is built with this package, as described
above in <A HREF = "#start_3">Section 2.3</A>, then by default LAMMPS will run in
CUDA mode. If this switch is set to "off", then it will not, even if
it was built with the USER-CUDA package, which means you can run
standard LAMMPS or with the GPU package for testing or benchmarking
purposes. The only reason to set the switch to "on", is to check if
LAMMPS was built with the USER-CUDA package, since an error will be
generated if it was not.
</P>
<PRE>-echo style
</PRE>
<P>Set the style of command echoing. The style can be <I>none</I> or <I>screen</I>
or <I>log</I> or <I>both</I>. Depending on the style, each command read from
the input script will be echoed to the screen and/or logfile. This
can be useful to figure out which line of your script is causing an
input error. The default value is <I>log</I>. The echo style can also be
set by using the <A HREF = "echo.html">echo</A> command in the input script itself.
</P>
<PRE>-in file
</PRE>
<P>Specify a file to use as an input script. This is an optional switch
when running LAMMPS in one-partition mode. If it is not specified,
LAMMPS reads its input script from stdin - e.g. lmp_linux < in.run.
This is a required switch when running LAMMPS in multi-partition mode,
since multiple processors cannot all read from stdin.
</P>
<PRE>-help
</PRE>
<P>Print a list of options compiled into this executable for each LAMMPS
style (atom_style, fix, compute, pair_style, bond_style, etc). This
can help you know if the command you want to use was included via the
appropriate package. LAMMPS will print the info and immediately exit
if this switch is used.
</P>
<PRE>-log file
</PRE>
<P>Specify a log file for LAMMPS to write status information to. In
one-partition mode, if the switch is not used, LAMMPS writes to the
file log.lammps. If this switch is used, LAMMPS writes to the
specified file. In multi-partition mode, if the switch is not used, a
log.lammps file is created with hi-level status information. Each
partition also writes to a log.lammps.N file where N is the partition
ID. If the switch is specified in multi-partition mode, the hi-level
logfile is named "file" and each partition also logs information to a
file.N. For both one-partition and multi-partition mode, if the
specified file is "none", then no log files are created. Using a
<A HREF = "log.html">log</A> command in the input script will override this setting.
Option -plog will override the name of the partition log files file.N.
</P>
<PRE>-partition 8x2 4 5 ...
</PRE>
<P>Invoke LAMMPS in multi-partition mode. When LAMMPS is run on P
processors and this switch is not used, LAMMPS runs in one partition,
i.e. all P processors run a single simulation. If this switch is
used, the P processors are split into separate partitions and each
partition runs its own simulation. The arguments to the switch
specify the number of processors in each partition. Arguments of the
form MxN mean M partitions, each with N processors. Arguments of the
form N mean a single partition with N processors. The sum of
processors in all partitions must equal P. Thus the command
"-partition 8x2 4 5" has 10 partitions and runs on a total of 25
processors.
</P>
<P>Running with multiple partitions can e useful for running
<A HREF = "Section_howto.html#howto_5">multi-replica simulations</A>, where each
replica runs on on one or a few processors. Note that with MPI
installed on a machine (e.g. your desktop), you can run on more
(virtual) processors than you have physical processors.
</P>
<P>To run multiple independent simulatoins from one input script, using
-multiple partitions, see <A HREF = "Section_howto.html#howto_4">this section</A> of
-the manual. World- and universe-style <A HREF = "variable.html">variables</A> are
-useful in this context.
+multiple partitions, see <A HREF = "Section_howto.html#howto_4">Section_howto 4</A>
+of the manual. World- and universe-style <A HREF = "variable.html">variables</A>
+are useful in this context.
</P>
<PRE>-plog file
</PRE>
<P>Specify the base name for the partition log files, so partition N
writes log information to file.N. If file is none, then no partition
log files are created. This overrides the filename specified in the
-log command-line option. This option is useful when working with
large numbers of partitions, allowing the partition log files to be
suppressed (-plog none) or placed in a sub-directory (-plog
replica_files/log.lammps) If this option is not used the log file for
partition N is log.lammps.N or whatever is specified by the -log
command-line option.
</P>
<PRE>-pscreen file
</PRE>
<P>Specify the base name for the partition screen file, so partition N
writes screen information to file.N. If file is none, then no
partition screen files are created. This overrides the filename
specified in the -screen command-line option. This option is useful
when working with large numbers of partitions, allowing the partition
screen files to be suppressed (-pscreen none) or placed in a
-sub-directory (-pscreen replica_files/screen) If this option is not
+sub-directory (-pscreen replica_files/screen). If this option is not
used the screen file for partition N is screen.N or whatever is
specified by the -screen command-line option.
</P>
+<PRE>-reorder nth N
+-reorder custom filename
+</PRE>
+<P>Reorder the processors in the MPI communicator used to instantiate
+LAMMPS, in one of several ways. The original MPI communicator ranks
+all P processors from 0 to P-1. The mapping of these ranks to
+physical processors is done by MPI before LAMMPS begins. It may be
+useful in some cases to alter the rank order. E.g. to insure that
+cores within each node are ranked in a desired order. Or when using
+the <A HREF = "run_style.html">run_style verlet/split</A> command with 2 partitions
+to insure that a specific Kspace processor (in the 2nd partition) is
+matched up with a specific set of processors in the 1st partition.
+See the <A HREF = "Section_accelerate.html">Section_accelerate</A> doc pages for
+more details.
+</P>
+<P>If the keyword <I>nth</I> is used with a setting <I>N</I>, then it means every
+Nth processor will be moved to the end of the ranking. This is useful
+when using the <A HREF = "run_style.html">run_style verlet/split</A> command with 2
+partitions via the -partition command-line switch. The first set of
+processors will be in the first partition, the 2nd set in the 2nd
+partition. The -reorder command-line switch can alter this so that
+the 1st N procs in the 1st partition and one proc in the 2nd partition
+will be ordered consecutively, e.g. as the cores on one physical node.
+This can boost performance. For example, if you use "-reorder nth 4"
+and "-partition 9 3" and you are running on 12 processors, the
+processors will be reordered from
+</P>
+<PRE>0 1 2 3 4 5 6 7 8 9 10 11
+</PRE>
+<P>to
+</P>
+<PRE>0 1 2 4 5 6 8 9 10 3 7 11
+</PRE>
+<P>so that the processors in each partition will be
+</P>
+<PRE>0 1 2 4 5 6 8 9 10
+3 7 11
+</PRE>
+<P>See the "processors" command for how to insure processors from each
+partition could then be grouped optimally for quad-core nodes.
+</P>
+<P>If the keyword is <I>custom", then a file that specifies a permutation
+of the processor ranks is also specified. The format of the reorder
+file is as follows. Any number of initial blank or comment lines
+(starting with a "#" character) can be present. These should be
+followed by P lines of the form:
+</P>
+<PRE>I J
+</PRE>
+<P>where P is the number of processors LAMMPS was launched with. Note
+that if running in multi-partition mode (see the -partition switch
+above) P is the total number of processors in all partitions. The I
+and J values describe a permutation of the P processors. Every I and
+J should be values from 0 to P-1 inclusive. In the set of P I values,
+every proc ID should appear exactly once. Ditto for the set of P J
+values. A single I,J pairing means that the physical processor with
+rank I in the original MPI communicator will have rank J in the
+reordered communicator.
+</P>
+<P>Note that rank ordering can also be specified by many MPI
+implementations, either by environment variables that specify how to
+order physical processors, or by config files that specify what
+physical processors to assign to each MPI rank. The -reorder switch
+simply gives you a portable way to do this without relying on MPI
+itself. See the <A HREF = "processors">processors out</A> command for how to output
+info on the final assignment of physical processors to the LAMMPS
+simulation domain.
+</P>
<PRE>-screen file
</PRE>
<P>Specify a file for LAMMPS to write its screen information to. In
one-partition mode, if the switch is not used, LAMMPS writes to the
screen. If this switch is used, LAMMPS writes to the specified file
instead and you will see no screen output. In multi-partition mode,
if the switch is not used, hi-level status information is written to
the screen. Each partition also writes to a screen.N file where N is
the partition ID. If the switch is specified in multi-partition mode,
the hi-level screen dump is named "file" and each partition also
writes screen information to a file.N. For both one-partition and
multi-partition mode, if the specified file is "none", then no screen
output is performed. Option -pscreen will override the name of the
partition screen files file.N.
</P>
<PRE>-suffix style
</PRE>
<P>Use variants of various styles if they exist. The specified style can
be <I>opt</I>, <I>omp</I>, <I>gpu</I>, or <I>cuda</I>. These refer to optional packages that
LAMMPS can be built with, as described above in <A HREF = "#start_3">Section
2.3</A>. The "opt" style corrsponds to the OPT package, the
"omp" style to the USER-OMP package, the "gpu" style to the GPU
package, and the "cuda" style to the USER-CUDA package.
</P>
<P>As an example, all of the packages provide a <A HREF = "pair_lj.html">pair_style
lj/cut</A> variant, with style names lj/cut/opt, lj/cut/omp,
lj/cut/gpu, or lj/cut/cuda. A variant styles can be specified
explicitly in your input script, e.g. pair_style lj/cut/gpu. If the
-suffix switch is used, you do not need to modify your input script.
The specified suffix (opt,omp,gpu,cuda) is automatically appended
whenever your input script command creates a new
<A HREF = "atom_style.html">atom</A>, <A HREF = "pair_style.html">pair</A>, <A HREF = "fix.html">fix</A>,
<A HREF = "compute.html">compute</A>, or <A HREF = "run_style.html">run</A> style. If the variant
version does not exist, the standard version is created.
</P>
<P>For the GPU package, using this command-line switch also invokes the
default GPU settings, as if the command "package gpu force/neigh 0 0
1" were used at the top of your input script. These settings can be
changed by using the <A HREF = "pacakge.html">package gpu</A> command in your script
if desired.
</P>
<P>For the OMP package, using this command-line switch also invokes the
default OMP settings, as if the command "package omp *" were used at
the top of your input script. These settings can be changed by using
the <A HREF = "pacakge.html">package omp</A> command in your script if desired.
</P>
<P>The <A HREF = "suffix.html">suffix</A> command can also set a suffix and it can also
turn off/on any suffix setting made via the command line.
</P>
<PRE>-var name value1 value2 ...
</PRE>
<P>Specify a variable that will be defined for substitution purposes when
the input script is read. "Name" is the variable name which can be a
single character (referenced as $x in the input script) or a full
string (referenced as ${abc}). An <A HREF = "variable.html">index-style
variable</A> will be created and populated with the
subsequent values, e.g. a set of filenames. Using this command-line
option is equivalent to putting the line "variable name index value1
value2 ..." at the beginning of the input script. Defining an index
variable as a command-line argument overrides any setting for the same
index variable in the input script, since index variables cannot be
re-defined. See the <A HREF = "variable.html">variable</A> command for more info on
defining index and other kinds of variables and <A HREF = "Section_commands.html#cmd_2">this
section</A> for more info on using variables
in input scripts.
</P>
<P>NOTE: Currently, the command-line parser looks for arguments that
start with "-" to indicate new switches. Thus you cannot specify
multiple variable values if any of they start with a "-", e.g. a
negative numeric value. It is OK if the first value1 starts with a
"-", since it is automatically skipped.
</P>
<HR>
<H4><A NAME = "start_7"></A>2.7 LAMMPS screen output
</H4>
<P>As LAMMPS reads an input script, it prints information to both the
screen and a log file about significant actions it takes to setup a
simulation. When the simulation is ready to begin, LAMMPS performs
various initializations and prints the amount of memory (in MBytes per
processor) that the simulation requires. It also prints details of
the initial thermodynamic state of the system. During the run itself,
thermodynamic information is printed periodically, every few
timesteps. When the run concludes, LAMMPS prints the final
thermodynamic state and a total run time for the simulation. It then
appends statistics about the CPU time and storage requirements for the
simulation. An example set of statistics is shown here:
</P>
<PRE>Loop time of 49.002 on 2 procs for 2004 atoms
</PRE>
<PRE>Pair time (%) = 35.0495 (71.5267)
Bond time (%) = 0.092046 (0.187841)
Kspce time (%) = 6.42073 (13.103)
Neigh time (%) = 2.73485 (5.5811)
Comm time (%) = 1.50291 (3.06703)
Outpt time (%) = 0.013799 (0.0281601)
Other time (%) = 2.13669 (4.36041)
</PRE>
<PRE>Nlocal: 1002 ave, 1015 max, 989 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Nghost: 8720 ave, 8724 max, 8716 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Neighs: 354141 ave, 361422 max, 346860 min
Histogram: 1 0 0 0 0 0 0 0 0 1
</PRE>
<PRE>Total # of neighbors = 708282
Ave neighs/atom = 353.434
Ave special neighs/atom = 2.34032
Number of reneighborings = 42
Dangerous reneighborings = 2
</PRE>
<P>The first section gives the breakdown of the CPU run time (in seconds)
into major categories. The second section lists the number of owned
atoms (Nlocal), ghost atoms (Nghost), and pair-wise neighbors stored
per processor. The max and min values give the spread of these values
across processors with a 10-bin histogram showing the distribution.
The total number of histogram counts is equal to the number of
processors.
</P>
<P>The last section gives aggregate statistics for pair-wise neighbors
and special neighbors that LAMMPS keeps track of (see the
<A HREF = "special_bonds.html">special_bonds</A> command). The number of times
neighbor lists were rebuilt during the run is given as well as the
number of potentially "dangerous" rebuilds. If atom movement
triggered neighbor list rebuilding (see the
<A HREF = "neigh_modify.html">neigh_modify</A> command), then dangerous
reneighborings are those that were triggered on the first timestep
atom movement was checked for. If this count is non-zero you may wish
to reduce the delay factor to insure no force interactions are missed
by atoms moving beyond the neighbor skin distance before a rebuild
takes place.
</P>
<P>If an energy minimization was performed via the
<A HREF = "minimize.html">minimize</A> command, additional information is printed,
e.g.
</P>
<PRE>Minimization stats:
E initial, next-to-last, final = -0.895962 -2.94193 -2.94342
Gradient 2-norm init/final= 1920.78 20.9992
Gradient inf-norm init/final= 304.283 9.61216
Iterations = 36
Force evaluations = 177
</PRE>
<P>The first line lists the initial and final energy, as well as the
energy on the next-to-last iteration. The next 2 lines give a measure
of the gradient of the energy (force on all atoms). The 2-norm is the
"length" of this force vector; the inf-norm is the largest component.
The last 2 lines are statistics on how many iterations and
force-evaluations the minimizer required. Multiple force evaluations
are typically done at each iteration to perform a 1d line minimization
in the search direction.
</P>
<P>If a <A HREF = "kspace_style.html">kspace_style</A> long-range Coulombics solve was
performed during the run (PPPM, Ewald), then additional information is
printed, e.g.
</P>
<PRE>FFT time (% of Kspce) = 0.200313 (8.34477)
FFT Gflps 3d 1d-only = 2.31074 9.19989
</PRE>
<P>The first line gives the time spent doing 3d FFTs (4 per timestep) and
the fraction it represents of the total KSpace time (listed above).
Each 3d FFT requires computation (3 sets of 1d FFTs) and communication
(transposes). The total flops performed is 5Nlog_2(N), where N is the
number of points in the 3d grid. The FFTs are timed with and without
the communication and a Gflop rate is computed. The 3d rate is with
communication; the 1d rate is without (just the 1d FFTs). Thus you
can estimate what fraction of your FFT time was spent in
communication, roughly 75% in the example above.
</P>
<HR>
<H4><A NAME = "start_8"></A>2.8 Tips for users of previous LAMMPS versions
</H4>
<P>The current C++ began with a complete rewrite of LAMMPS 2001, which
was written in F90. Features of earlier versions of LAMMPS are listed
-in <A HREF = "Section_history.html">this section</A>. The F90 and F77 versions
+in <A HREF = "Section_history.html">Section_history</A>. The F90 and F77 versions
(2001 and 99) are also freely distributed as open-source codes; check
the <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> for distribution information if you prefer
those versions. The 99 and 2001 versions are no longer under active
development; they do not have all the features of C++ LAMMPS.
</P>
<P>If you are a previous user of LAMMPS 2001, these are the most
significant changes you will notice in C++ LAMMPS:
</P>
<P>(1) The names and arguments of many input script commands have
changed. All commands are now a single word (e.g. read_data instead
of read data).
</P>
<P>(2) All the functionality of LAMMPS 2001 is included in C++ LAMMPS,
but you may need to specify the relevant commands in different ways.
</P>
<P>(3) The format of the data file can be streamlined for some problems.
See the <A HREF = "read_data.html">read_data</A> command for details. The data file
section "Nonbond Coeff" has been renamed to "Pair Coeff" in C++ LAMMPS.
</P>
<P>(4) Binary restart files written by LAMMPS 2001 cannot be read by C++
LAMMPS with a <A HREF = "read_restart.html">read_restart</A> command. This is
because they were output by F90 which writes in a different binary
format than C or C++ writes or reads. Use the <I>restart2data</I> tool
provided with LAMMPS 2001 to convert the 2001 restart file to a text
data file. Then edit the data file as necessary before using the C++
LAMMPS <A HREF = "read_data.html">read_data</A> command to read it in.
</P>
<P>(5) There are numerous small numerical changes in C++ LAMMPS that mean
you will not get identical answers when comparing to a 2001 run.
However, your initial thermodynamic energy and MD trajectory should be
close if you have setup the problem for both codes the same.
</P>
</HTML>
diff --git a/doc/Section_start.txt b/doc/Section_start.txt
index c6c82e1eb..17ad9b696 100644
--- a/doc/Section_start.txt
+++ b/doc/Section_start.txt
@@ -1,1165 +1,1234 @@
"Previous Section"_Section_intro.html - "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next Section"_Section_commands.html :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
2. Getting Started :h3
This section describes how to build and run LAMMPS, for both new and
experienced users.
2.1 "What's in the LAMMPS distribution"_#start_1
2.2 "Making LAMMPS"_#start_2
2.3 "Making LAMMPS with optional packages"_#start_3
2.4 "Building LAMMPS as a library"_#start_4
2.5 "Running LAMMPS"_#start_5
2.6 "Command-line options"_#start_6
2.7 "Screen output"_#start_7
2.8 "Tips for users of previous versions"_#start_8 :all(b)
:line
:line
2.1 What's in the LAMMPS distribution :h4,link(start_1)
When you download LAMMPS you will need to unzip and untar the
downloaded file with the following commands, after placing the file in
an appropriate directory.
gunzip lammps*.tar.gz
tar xvf lammps*.tar :pre
This will create a LAMMPS directory containing two files and several
sub-directories:
README: text file
LICENSE: the GNU General Public License (GPL)
bench: benchmark problems
couple: code coupling examples, using LAMMPS as a library
doc: documentation
examples: simple test problems
potentials: embedded atom method (EAM) potential files
src: source files
tools: pre- and post-processing tools :tb(s=:)
If you download one of the Windows executables from the download page,
then you just get a single file:
lmp_windows.exe :pre
Skip to the "Running LAMMPS"_#start_5 sections for info on how to
launch these executables on a Windows box.
The Windows executables for serial or parallel only include certain
packages and bug-fixes/upgrades listed on "this
page"_http://lammps.sandia.gov/bug.html up to a certain date, as
stated on the download page. If you want something with more packages
or that is more current, you'll have to download the source tarball
and build it yourself from source code using Microsoft Visual Studio,
as described in the next section.
:line
2.2 Making LAMMPS :h4,link(start_2)
This section has the following sub-sections:
"Read this first"_#start_2_1
"Steps to build a LAMMPS executable"_#start_2_2
"Common errors that can occur when making LAMMPS"_#start_2_3
"Additional build tips"_#start_2_4
"Building for a Mac"_#start_2_5
"Building for Windows"_#start_2_6 :ul
:line
[{Read this first:}] :link(start_2_1)
Building LAMMPS can be non-trivial. You may need to edit a makefile,
there are compiler options to consider, additional libraries can be
used (MPI, FFT, JPEG), LAMMPS packages may be included or excluded,
some of these packages use auxiliary libraries which need to be
pre-built, etc.
Please read this section carefully. If you are not comfortable with
makefiles, or building codes on a Unix platform, or running an MPI job
on your machine, please find a local expert to help you. Many
compiling, linking, and run problems that users have are not really
LAMMPS issues - they are peculiar to the user's system, compilers,
libraries, etc. Such questions are better answered by a local expert.
If you have a build problem that you are convinced is a LAMMPS issue
(e.g. the compiler complains about a line of LAMMPS source code), then
please send an email to the
"developers"_http://lammps.sandia.gov/authors.html.
If you succeed in building LAMMPS on a new kind of machine, for which
there isn't a similar Makefile for in the src/MAKE directory, send it
to the developers and we'll include it in future LAMMPS releases.
:line
[{Steps to build a LAMMPS executable:}] :link(start_2_2)
[Step 0]
The src directory contains the C++ source and header files for LAMMPS.
It also contains a top-level Makefile and a MAKE sub-directory with
low-level Makefile.* files for many machines. From within the src
directory, type "make" or "gmake". You should see a list of available
choices. If one of those is the machine and options you want, you can
type a command like:
make linux
or
gmake mac :pre
Note that on a multi-processor or multi-core platform you can launch a
parallel make, by using the "-j" switch with the make command, which
will build LAMMPS more quickly.
If you get no errors and an executable like lmp_linux or lmp_mac is
produced, you're done; it's your lucky day.
Note that by default only a few of LAMMPS optional pacakges are
installed. To build LAMMPS with optional packages, see "this
section"_#start_3 below.
[Step 1]
If Step 0 did not work, you will need to create a low-level Makefile
for your machine, like Makefile.foo. You should make a copy of an
existing src/MAKE/Makefile.* as a starting point. The only portions
of the file you need to edit are the first line, the "compiler/linker
settings" section, and the "LAMMPS-specific settings" section.
[Step 2]
Change the first line of src/MAKE/Makefile.foo to list the word "foo"
after the "#", and whatever other options it will set. This is the
line you will see if you just type "make".
[Step 3]
The "compiler/linker settings" section lists compiler and linker
settings for your C++ compiler, including optimization flags. You can
use g++, the open-source GNU compiler, which is available on all Unix
systems. You can also use mpicc which will typically be available if
MPI is installed on your system, though you should check which actual
compiler it wraps. Vendor compilers often produce faster code. On
boxes with Intel CPUs, we suggest using the commercial Intel icc
compiler, which can be downloaded from "Intel's compiler site"_intel.
:link(intel,http://www.intel.com/software/products/noncom)
If building a C++ code on your machine requires additional libraries,
then you should list them as part of the LIB variable.
The DEPFLAGS setting is what triggers the C++ compiler to create a
dependency list for a source file. This speeds re-compilation when
source (*.cpp) or header (*.h) files are edited. Some compilers do
not support dependency file creation, or may use a different switch
than -D. GNU g++ works with -D. If your compiler can't create
dependency files, then you'll need to create a Makefile.foo patterned
after Makefile.storm, which uses different rules that do not involve
dependency files. Note that when you build LAMMPS for the first time
on a new platform, a long list of *.d files will be printed out
rapidly. This is not an error; it is the Makefile doing its normal
creation of dependencies.
[Step 4]
The "system-specific settings" section has several parts. Note that
if you change any -D setting in this section, you should do a full
re-compile, after typing "make clean" (which will describe different
clean options).
The LMP_INC variable is used to include options that turn on ifdefs
within the LAMMPS code. The options that are currently recogized are:
-DLAMMPS_GZIP
-DLAMMPS_JPEG
-DLAMMPS_MEMALIGN
-DLAMMPS_XDR
-DLAMMPS_SMALLBIG
-DLAMMPS_BIGBIG
-DLAMMPS_SMALLSMALL
-DLAMMPS_LONGLONG_TO_LONG
-DPACK_ARRAY
-DPACK_POINTER
-DPACK_MEMCPY :ul
The read_data and dump commands will read/write gzipped files if you
compile with -DLAMMPS_GZIP. It requires that your Unix support the
"popen" command.
If you use -DLAMMPS_JPEG, the "dump image"_dump.html command will be
able to write out JPEG image files. If not, it will only be able to
write out text-based PPM image files. For JPEG files, you must also
link LAMMPS with a JPEG library, as described below.
Using -DLAMMPS_MEMALIGN=<bytes> enables the use of the
posix_memalign() call instead of malloc() when large chunks or memory
are allocated by LAMMPS. This can help to make more efficient use of
vector instructions of modern CPUS, since dynamically allocated memory
has to be aligned on larger than default byte boundaries (e.g. 16
bytes instead of 8 bytes on x86 type platforms) for optimal
performance.
If you use -DLAMMPS_XDR, the build will include XDR compatibility
files for doing particle dumps in XTC format. This is only necessary
if your platform does have its own XDR files available. See the
Restrictions section of the "dump"_dump.html command for details.
Use at most one of the -DLAMMPS_SMALLBIG, -DLAMMPS_BIGBIG,
-D-DLAMMPS_SMALLSMALL settings. The default is -DLAMMPS_SMALLBIG.
These refer to use of 4-byte (small) vs 8-byte (big) integers within
LAMMPS, as described in src/lmptype.h. The only reason to use the
BIGBIG setting is to enable simulation of huge molecular systems with
more than 2 billion atoms. The only reason to use the SMALLSMALL
setting is if your machine does not support 64-bit integers.
The -DLAMMPS_LONGLONG_TO_LONG setting may be needed if your system or
MPI version does not recognize "long long" data types. In this case a
"long" data type is likely already 64-bits, in which case this setting
will convert to that data type.
Using one of the -DPACK_ARRAY, -DPACK_POINTER, and -DPACK_MEMCPY
options can make for faster parallel FFTs (in the PPPM solver) on some
platforms. The -DPACK_ARRAY setting is the default. See the
"kspace_style"_kspace_style.html command for info about PPPM. See
Step 6 below for info about building LAMMPS with an FFT library.
[Step 5]
The 3 MPI variables are used to specify an MPI library to build LAMMPS
with.
If you want LAMMPS to run in parallel, you must have an MPI library
installed on your platform. If you use an MPI-wrapped compiler, such
as "mpicc" to build LAMMPS, you should be able to leave these 3
variables blank; the MPI wrapper knows where to find the needed files.
If not, and MPI is installed on your system in the usual place (under
/usr/local), you also may not need to specify these 3 variables. On
some large parallel machines which use "modules" for their
compile/link environements, you may simply need to include the correct
module in your build environment. Or the parallel machine may have a
vendor-provided MPI which the compiler has no trouble finding.
Failing this, with these 3 variables you can specify where the mpi.h
file (MPI_INC) and the MPI library file (MPI_PATH) are found and the
name of the library file (MPI_LIB).
If you are installing MPI yourself, we recommend Argonne's MPICH2
or OpenMPI. MPICH can be downloaded from the "Argonne MPI
site"_http://www.mcs.anl.gov/research/projects/mpich2/. OpenMPI can
be downloaded from the "OpenMPI site"_http://www.open-mpi.org.
Other MPI packages should also work. If you are running on a big
parallel platform, your system people or the vendor should have
already installed a version of MPI, which is likely to be faster
than a self-installed MPICH or OpenMPI, so find out how to build
and link with it. If you use MPICH or OpenMPI, you will have to
configure and build it for your platform. The MPI configure script
should have compiler options to enable you to use the same compiler
you are using for the LAMMPS build, which can avoid problems that can
arise when linking LAMMPS to the MPI library.
If you just want to run LAMMPS on a single processor, you can use the
dummy MPI library provided in src/STUBS, since you don't need a true
MPI library installed on your system. See the
src/MAKE/Makefile.serial file for how to specify the 3 MPI variables
in this case. You will also need to build the STUBS library for your
platform before making LAMMPS itself. From the src directory, type
"make stubs", or from the STUBS dir, type "make" and it should create
a libmpi.a suitable for linking to LAMMPS. If this build fails, you
will need to edit the STUBS/Makefile for your platform.
The file STUBS/mpi.cpp provides a CPU timer function called
MPI_Wtime() that calls gettimeofday() . If your system doesn't
support gettimeofday() , you'll need to insert code to call another
timer. Note that the ANSI-standard function clock() rolls over after
an hour or so, and is therefore insufficient for timing long LAMMPS
simulations.
[Step 6]
The 3 FFT variables allow you to specify an FFT library which LAMMPS
uses (for performing 1d FFTs) when running the particle-particle
particle-mesh (PPPM) option for long-range Coulombics via the
"kspace_style"_kspace_style.html command.
LAMMPS supports various open-source or vendor-supplied FFT libraries
for this purpose. If you leave these 3 variables blank, LAMMPS will
use the open-source "KISS FFT library"_http://kissfft.sf.net, which is
included in the LAMMPS distribution. This library is portable to all
platforms and for typical LAMMPS simulations is almost as fast as FFTW
or vendor optimized libraries. If you are not including the KSPACE
package in your build, you can also leave the 3 variables blank.
Otherwise, select which kinds of FFTs to use as part of the FFT_INC
setting by a switch of the form -DFFT_XXX. Recommended values for XXX
are: MKL, SCSL, FFTW2, and FFTW3. Legacy options are: INTEL, SGI,
ACML, and T3E. For backward compatability, using -DFFT_FFTW will use
the FFTW2 library. Using -DFFT_NONE will use the KISS library
described above.
You may also need to set the FFT_INC, FFT_PATH, and FFT_LIB variables,
so the compiler and linker can find the needed FFT header and library
files. Note that on some large parallel machines which use "modules"
for their compile/link environements, you may simply need to include
the correct module in your build environment. Or the parallel machine
may have a vendor-provided FFT library which the compiler has no
trouble finding.
FFTW is a fast, portable library that should also work on any
platform. You can download it from
"www.fftw.org"_http://www.fftw.org. Both the legacy version 2.1.X and
the newer 3.X versions are supported as -DFFT_FFTW2 or -DFFT_FFTW3.
Building FFTW for your box should be as simple as ./configure; make.
Note that on some platforms FFTW2 has been pre-installed, and uses
renamed files indicating the precision it was compiled with,
e.g. sfftw.h, or dfftw.h instead of fftw.h. In this case, you can
specify an additional define variable for FFT_INC called -DFFTW2_SIZE,
which will select the correct include file. In this case, for FFT_LIB
you must also manually specify the correct library, namely -lsfftw or
-ldfftw.
The FFT_INC variable also allows for a -DFFT_SINGLE setting that will
use single-precision FFTs with PPPM, which can speed-up long-range
calulations, particularly in parallel or on GPUs. Fourier transform
and related PPPM operations are somewhat insensitive to floating point
truncation errors and thus do not always need to be performed in
double precision. Using the -DFFT_SINGLE setting trades off a little
accuracy for reduced memory use and parallel communication costs for
transposing 3d FFT data. Note that single precision FFTs have only
been tested with the FFTW3, FFTW2, MKL, and KISS FFT options.
[Step 7]
The 3 JPG variables allow you to specify a JPEG library which LAMMPS
uses when writing out JPEG files via the "dump image"_dump_image.html
command. These can be left blank if you do not use the -DLAMMPS_JPEG
switch discussed above in Step 4, since in that case JPEG output will
be disabled.
A standard JPEG library usually goes by the name libjpeg.a and has an
associated header file jpeglib.h. Whichever JPEG library you have on
your platform, you'll need to set the appropriate JPG_INC, JPG_PATH,
and JPG_LIB variables, so that the compiler and linker can find it.
As before, if these header and library files are in the usual place on
your machine, you may not need to set these variables.
[Step 8]
Note that by default only a few of LAMMPS optional pacakges are
installed. To build LAMMPS with optional packages, see "this
section"_#start_3 below, before proceeding to Step 9.
[Step 9]
That's it. Once you have a correct Makefile.foo, you have installed
the optional LAMMPS packages you want to include in your build, and
you have pre-built any other needed libraries (e.g. MPI, FFT, package
libraries), all you need to do from the src directory is type
something like this:
make foo
or
gmake foo :pre
You should get the executable lmp_foo when the build is complete.
:line
[{Errors that can occur when making LAMMPS:}] :link(start_2_3)
IMPORTANT NOTE: If an error occurs when building LAMMPS, the compiler
or linker will state very explicitly what the problem is. The error
message should give you a hint as to which of the steps above has
failed, and what you need to do in order to fix it. Building a code
with a Makefile is a very logical process. The compiler and linker
need to find the appropriate files and those files need to be
compatible with LAMMPS source files. When a make fails, there is
usually a very simple reason, which you or a local expert will need to
fix.
Here are two non-obvious errors that can occur:
(1) If the make command breaks immediately with errors that indicate
it can't find files with a "*" in their names, this can be because
your machine's native make doesn't support wildcard expansion in a
makefile. Try gmake instead of make. If that doesn't work, try using
a -f switch with your make command to use a pre-generated
Makefile.list which explicitly lists all the needed files, e.g.
make makelist
make -f Makefile.list linux
gmake -f Makefile.list mac :pre
The first "make" command will create a current Makefile.list with all
the file names in your src dir. The 2nd "make" command (make or
gmake) will use it to build LAMMPS. Note that you should
include/exclude any desired optional packages before using the "make
makelist" command.
(2) If you get an error that says something like 'identifier "atoll"
is undefined', then your machine does not support "long long"
integers. Try using the -DLAMMPS_LONGLONG_TO_LONG setting described
above in Step 4.
:line
[{Additional build tips:}] :link(start_2_4)
(1) Building LAMMPS for multiple platforms.
You can make LAMMPS for multiple platforms from the same src
directory. Each target creates its own object sub-directory called
Obj_name where it stores the system-specific *.o files.
(2) Cleaning up.
Typing "make clean-all" or "make clean-foo" will delete *.o object
files created when LAMMPS is built, for either all builds or for a
particular machine.
(3) Changing the size limits in src/lmptype.h
If you are running a very large problem (billions of atoms or more)
and get a run-time error about the system being too big, either on a
per-processor basis or in total size, then you may need to change one
or more settings in src/lmptype.h and re-compile LAMMPS.
As the documentation in that file explains, you have basically
two choices to make:
set the data type size of integer atom IDs to 4 or 8 bytes
set the data type size of integers that store the total system size to 4 or 8 bytes :ul
The default for atom IDs is 4-byte integers since there is a memory
and communication cost for 8-byte integers. Non-molecular problems do
not need atom IDs so this does not restrict their size. Molecular
problems (which use IDs to define molecular topology), are limited to
about 2 billion atoms (2^31) with 4-byte IDs. With 8-byte IDs they
are effectively unlimited in size (2^63).
The default for total system size quantities (like the number of atoms
or timesteps) is 8-byte integers by default which is effectively
unlimited in size (2^63). If your system or MPI implementation does
not support 8-byte integers, an error will be generated, and you will
need to set "bigint" to 4-byte integers. This restricts your total
system size to about 2 billion atoms or timesteps (2^31).
Note that in src/lmptype.h there are also settings for the MPI data
types associated with the integers that store atom IDs and total
system sizes, which need to be set consistent with the associated C
data types.
In all cases, the size of problem that can be run on a per-processor
basis is limited by 4-byte integer storage to about 2 billion atoms
per processor (2^31), which should not normally be a restriction since
such a problem would have a huge per-processor memory footprint due to
neighbor lists and would run very slowly in terms of CPU
secs/timestep.
:line
[{Building for a Mac:}] :link(start_2_5)
OS X is BSD Unix, so it should just work. See the Makefile.mac file.
:line
[{Building for Windows:}] :link(start_2_6)
The LAMMPS download page has an option to download both a serial and
parallel pre-built Windows exeutable. See the "Running
LAMMPS"_#start_5 section for instructions for running these
executables on a Windows box.
If the pre-built executable doesn't have the options you want, then
you can build LAMMPS from its source files on a Windows box. One way
to do this is install and use cygwin to build LAMMPS with a standard
Linus make, just as you would on any Linux box; see
src/MAKE/Makefile.cygwin.
There is a also a src/WINDOWS directory that contains project files
for Microsoft Visual Studio 2005, which should also work with later
versions of VS. That directory contains a README.txt file which
provides instructions for building LAMMPS from source code using
Visual Studio that are hopefully easy to follow for Windows and VS
users.
Four VS project options are provided. The first includes the default
packages (MANYBODY, MOLECULE, and KSPACE). The second includes all
standard packages (except GPU, MEAM, and REAX which are not yet
included because they require NVIDIA or Fortran compilation). The
third includes all standard packages (with the exceptions) and some
user packages. The included user packages are USER-EFF, USER-CG-CMM,
and USER-REAXC. The fourth project includes the USER-AWPMD package.
:line
2.3 Making LAMMPS with optional packages :h4,link(start_3)
This section has the following sub-sections:
"Package basics"_#start_3_1
"Including/excluding packages"_#start_3_2
"Packages that require extra libraries"_#start_3_3
"Additional Makefile settings for extra libraries"_#start_3_4 :ul
:line
[{Package basics:}] :link(start_3_1)
The source code for LAMMPS is structured as a set of core files which
are always included, plus optional packages. Packages are groups of
files that enable a specific set of features. For example, force
fields for molecular systems or granular systems are in packages. You
can see the list of all packages by typing "make package" from within
the src directory of the LAMMPS distribution.
If you use a command in a LAMMPS input script that is specific to a
particular package, you must have built LAMMPS with that package, else
you will get an error that the style is invalid or the command is
unknown. Every command's doc page specfies if it is part of a
package. You can also type
lmp_machine -h :pre
to run your executable with the optional "-h command-line
switch"_#start_6 for "help", which will list the styles and commands
known to your executable.
There are two kinds of packages in LAMMPS, standard and user packages.
More information about the contents of standard and user packages is
-given in "this section"_Section_packages.html of the manual. The
+given in "Section_packages"_Section_packages.html of the manual. The
difference between standard and user packages is as follows:
Standard packages are supported by the LAMMPS developers and are
written in a syntax and style consistent with the rest of LAMMPS.
This means we will answer questions about them, debug and fix them if
necessary, and keep them compatible with future changes to LAMMPS.
User packages have been contributed by users, and always begin with
the user prefix. If they are a single command (single file), they are
typically in the user-misc package. Otherwise, they are a a set of
files grouped together which add a specific functionality to the code.
User packages don't necessarily meet the requirements of the standard
packages. If you have problems using a feature provided in a user
package, you will likely need to contact the contributor directly to
get help. Information on how to submit additions you make to LAMMPS
as a user-contributed package is given in "this
section"_Section_modify.html#mod_14 of the documentation.
:line
[{Including/excluding packages:}] :link(start_3_2)
To use or not use a package you must include or exclude it before
building LAMMPS. From the src directory, this is typically as simple
as:
make yes-colloid
make g++ :pre
or
make no-manybody
make g++ :pre
Some packages have individual files that depend on other packages
being included. LAMMPS checks for this and does the right thing.
I.e. individual files are only included if their dependencies are
already included. Likewise, if a package is excluded, other files
dependent on that package are also excluded.
The reason to exclude packages is if you will never run certain kinds
of simulations. For some packages, this will keep you from having to
build auxiliary libraries (see below), and will also produce a smaller
executable which may run a bit faster.
When you download a LAMMPS tarball, these packages are pre-installed
in the src directory: KSPACE, MANYBODY,MOLECULE. When you download
LAMMPS source files from the SVN or Git repositories, no packages are
pre-installed.
Packages are included or excluded by typing "make yes-name" or "make
no-name", where "name" is the name of the package in lower-case, e.g.
name = kspace for the KSPACE package or name = user-atc for the
USER-ATC package. You can also type "make yes-standard", "make
no-standard", "make yes-user", "make no-user", "make yes-all" or "make
no-all" to include/exclude various sets of packages. Type "make
package" to see the all of the package-related make options.
IMPORTANT NOTE: Inclusion/exclusion of a package works by simply
moving files back and forth between the main src directory and
sub-directories with the package name (e.g. src/KSPACE, src/USER-ATC),
so that the files are seen or not seen when LAMMPS is built. After
you have included or excluded a package, you must re-build LAMMPS.
Additional package-related make options exist to help manage LAMMPS
files that exist in both the src directory and in package
sub-directories. You do not normally need to use these commands
unless you are editing LAMMPS files or have downloaded a patch from
the LAMMPS WWW site.
Typing "make package-update" will overwrite src files with files from
the package sub-directories if the package has been included. It
should be used after a patch is installed, since patches only update
the files in the package sub-directory, but not the src files. Typing
"make package-overwrite" will overwrite files in the package
sub-directories with src files.
Typing "make package-status" will show which packages are currently
included. Of those that are included, it will list files that are
different in the src directory and package sub-directory. Typing
"make package-diff" lists all differences between these files. Again,
type "make package" to see all of the package-related make options.
:line
[{Packages that require extra libraries:}] :link(start_3_3)
A few of the standard and user packages require additional auxiliary
libraries to be compiled first. If you get a LAMMPS build error about
a missing library, this is likely the reason. The source code for
these libraries is included in the LAMMPS distribution under the "lib"
directory. Look at the lib/README file for a list of these or see
-"this section"_Section_packages.html of the doc pages.
+"Section_packages"_Section_packages.html of the doc pages.
Each lib directory has a README file (e.g. lib/reax/README) with
instructions on how to build that library. Typically this is done
in this manner:
make -f Makefile.g++ :pre
in the appropriate directory, e.g. in lib/reax. Some of the libraries
do not build this way. Again, see the libary README file for details.
In any event, you will need to use a Makefile that is a match for your
system. If one of the provided Makefiles is not appropriate for your
system you will need to edit or add one. For example, in the case of
Fortran-based libraries, your system must have a Fortran compiler, the
settings for which will need to be listed in the Makefile.
When you have built one of these libraries, there are 2 things to
check:
(1) The file libname.a should now exist in lib/name.
E.g. lib/reax/libreax.a. This is the library file LAMMPS will link
against. One exception is the lib/cuda library which produces the
file liblammpscuda.a, because there is already a system library
libcuda.a.
(2) The file Makefile.lammps should exist in lib/name. E.g.
lib/cuda/Makefile.lammps. This file may be auto-generated by the
build of the library, or you may need to make a copy of the
appropriate provided file (e.g. lib/meam/Makefile.lammps.gfortran).
Either way you should insure that the settings in this file are
appropriate for your system.
There are typically 3 settings in the Makefile.lammps file (unless
some are blank or not needed): a SYSINC, SYSPATH, and SYSLIB setting,
specific to this package. These are settings the LAMMPS build will
import when compiling the LAMMPS package files (not the library
files), and linking to the auxiliary library. They typically list any
other system libraries needed to support the package and where to find
them. An example is the BLAS and LAPACK libraries needed by the
USER-ATC package. Or the system libraries that support calling
Fortran from C++, as the MEAM and REAX packages do.
Note that if these settings are not correct for your box, the LAMMPS
build will likely fail.
:line
2.4 Building LAMMPS as a library :h4,link(start_4)
LAMMPS itself can be built as a library, which can then be called from
another application or a scripting language. See "this
section"_Section_howto.html#howto_10 for more info on coupling LAMMPS
to other codes. Building LAMMPS as a library is done by typing
make makelib
make -f Makefile.lib foo :pre
where foo is the machine name. Note that inclusion or exclusion of
any desired optional packages should be done before typing "make
makelib". The first "make" command will create a current Makefile.lib
with all the file names in your src dir. The 2nd "make" command will
use it to build LAMMPS as a library. This requires that Makefile.foo
have a library target (lib) and system-specific settings for ARCHIVE
and ARFLAGS. See Makefile.linux for an example. The build will
create the file liblmp_foo.a which another application can link to.
When used from a C++ program, the library allows one or more LAMMPS
objects to be instantiated. All of LAMMPS is wrapped in a LAMMPS_NS
namespace; you can safely use any of its classes and methods from
within your application code, as needed.
When used from a C or Fortran program or a scripting language, the
library has a simple function-style interface, provided in
src/library.cpp and src/library.h.
See the sample codes couple/simple/simple.cpp and simple.c as examples
of C++ and C codes that invoke LAMMPS thru its library interface.
There are other examples as well in the couple directory which are
-discussed in "this section"_Section_howto.html#howto_10 of the manual.
-See "this section"_Section_python.html of the manual for a description
-of the Python wrapper provided with LAMMPS that operates through the
-LAMMPS library interface.
+discussed in "Section_howto 10"_Section_howto.html#howto_10 of the
+manual. See "Section_python"_Section_python.html of the manual for a
+description of the Python wrapper provided with LAMMPS that operates
+through the LAMMPS library interface.
The files src/library.cpp and library.h contain the C-style interface
-to LAMMPS. See "this section"_Section_howto.html#howto_19 of the
+to LAMMPS. See "Section_howto 19"_Section_howto.html#howto_19 of the
manual for a description of the interface and how to extend it for
your needs.
:line
2.5 Running LAMMPS :h4,link(start_5)
By default, LAMMPS runs by reading commands from stdin; e.g. lmp_linux
< in.file. This means you first create an input script (e.g. in.file)
containing the desired commands. "This section"_Section_commands.html
describes how input scripts are structured and what commands they
contain.
You can test LAMMPS on any of the sample inputs provided in the
examples or bench directory. Input scripts are named in.* and sample
outputs are named log.*.name.P where name is a machine and P is the
number of processors it was run on.
Here is how you might run a standard Lennard-Jones benchmark on a
Linux box, using mpirun to launch a parallel job:
cd src
make linux
cp lmp_linux ../bench
cd ../bench
mpirun -np 4 lmp_linux < in.lj :pre
See "this page"_bench for timings for this and the other benchmarks
on various platforms.
:link(bench,http://lammps.sandia.gov/bench.html)
:line
On a Windows box, you can skip making LAMMPS and simply download an
executable, as described above, though the pre-packaged executables
include only certain packages.
To run a LAMMPS executable on a Windows machine, first decide whether
you want to download the non-MPI (serial) or the MPI (parallel)
version of the executable. Download and save the version you have
chosen.
For the non-MPI version, follow these steps:
Get a command prompt by going to Start->Run... ,
then typing "cmd". :ulb,l
Move to the directory where you have saved lmp_win_no-mpi.exe
(e.g. by typing: cd "Documents"). :l
At the command prompt, type "lmp_win_no-mpi -in in.lj", replacing in.lj
with the name of your LAMMPS input script. :l,ule
For the MPI version, which allows you to run LAMMPS under Windows on
multiple processors, follow these steps:
Download and install
"MPICH2"_http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads
for Windows. :ulb,l
You'll need to use the mpiexec.exe and smpd.exe files from the MPICH2 package. Put them in
same directory (or path) as the LAMMPS Windows executable. :l
Get a command prompt by going to Start->Run... ,
then typing "cmd". :l
Move to the directory where you have saved lmp_win_mpi.exe
(e.g. by typing: cd "Documents"). :l
Then type something like this: "mpiexec -np 4 -localonly lmp_win_mpi -in in.lj",
replacing in.lj with the name of your LAMMPS input script. :l
Note that you may need to provide smpd with a passphrase --- it doesn't matter what you
type. :l
In this mode, output may not immediately show up on the screen, so
if your input script takes a long time to execute, you may need to be
patient before the output shows up. :l
Alternatively, you can still use this executable to run on a single processor by
typing something like: "lmp_win_mpi -in in.lj". :l,ule
:line
The screen output from LAMMPS is described in the next section. As it
runs, LAMMPS also writes a log.lammps file with the same information.
Note that this sequence of commands copies the LAMMPS executable
(lmp_linux) to the directory with the input files. This may not be
necessary, but some versions of MPI reset the working directory to
where the executable is, rather than leave it as the directory where
you launch mpirun from (if you launch lmp_linux on its own and not
under mpirun). If that happens, LAMMPS will look for additional input
files and write its output files to the executable directory, rather
than your working directory, which is probably not what you want.
If LAMMPS encounters errors in the input script or while running a
simulation it will print an ERROR message and stop or a WARNING
-message and continue. See "this section"_Section_errors.html for a
+message and continue. See "Section_errors"_Section_errors.html for a
discussion of the various kinds of errors LAMMPS can or can't detect,
a list of all ERROR and WARNING messages, and what to do about them.
LAMMPS can run a problem on any number of processors, including a
single processor. In theory you should get identical answers on any
number of processors and on any machine. In practice, numerical
round-off can cause slight differences and eventual divergence of
molecular dynamics phase space trajectories.
LAMMPS can run as large a problem as will fit in the physical memory
of one or more processors. If you run out of memory, you must run on
more processors or setup a smaller problem.
:line
2.6 Command-line options :h4,link(start_6)
At run time, LAMMPS recognizes several optional command-line switches
which may be used in any order. Either the full word or a one-or-two
letter abbreviation can be used:
-c or -cuda
-e or -echo
-i or -in
-h or -help
-l or -log
-p or -partition
-pl or -plog
-ps or -pscreen
+-r or -reorder
-sc or -screen
-sf or -suffix
-v or -var :ul
For example, lmp_ibm might be launched as follows:
mpirun -np 16 lmp_ibm -v f tmp.out -l my.log -sc none < in.alloy
mpirun -np 16 lmp_ibm -var f tmp.out -log my.log -screen none < in.alloy :pre
Here are the details on the options:
-cuda on/off :pre
Explicitly enable or disable CUDA support, as provided by the
USER-CUDA package. If LAMMPS is built with this package, as described
above in "Section 2.3"_#start_3, then by default LAMMPS will run in
CUDA mode. If this switch is set to "off", then it will not, even if
it was built with the USER-CUDA package, which means you can run
standard LAMMPS or with the GPU package for testing or benchmarking
purposes. The only reason to set the switch to "on", is to check if
LAMMPS was built with the USER-CUDA package, since an error will be
generated if it was not.
-echo style :pre
Set the style of command echoing. The style can be {none} or {screen}
or {log} or {both}. Depending on the style, each command read from
the input script will be echoed to the screen and/or logfile. This
can be useful to figure out which line of your script is causing an
input error. The default value is {log}. The echo style can also be
set by using the "echo"_echo.html command in the input script itself.
-in file :pre
Specify a file to use as an input script. This is an optional switch
when running LAMMPS in one-partition mode. If it is not specified,
LAMMPS reads its input script from stdin - e.g. lmp_linux < in.run.
This is a required switch when running LAMMPS in multi-partition mode,
since multiple processors cannot all read from stdin.
-help :pre
Print a list of options compiled into this executable for each LAMMPS
style (atom_style, fix, compute, pair_style, bond_style, etc). This
can help you know if the command you want to use was included via the
appropriate package. LAMMPS will print the info and immediately exit
if this switch is used.
-log file :pre
Specify a log file for LAMMPS to write status information to. In
one-partition mode, if the switch is not used, LAMMPS writes to the
file log.lammps. If this switch is used, LAMMPS writes to the
specified file. In multi-partition mode, if the switch is not used, a
log.lammps file is created with hi-level status information. Each
partition also writes to a log.lammps.N file where N is the partition
ID. If the switch is specified in multi-partition mode, the hi-level
logfile is named "file" and each partition also logs information to a
file.N. For both one-partition and multi-partition mode, if the
specified file is "none", then no log files are created. Using a
"log"_log.html command in the input script will override this setting.
Option -plog will override the name of the partition log files file.N.
-partition 8x2 4 5 ... :pre
Invoke LAMMPS in multi-partition mode. When LAMMPS is run on P
processors and this switch is not used, LAMMPS runs in one partition,
i.e. all P processors run a single simulation. If this switch is
used, the P processors are split into separate partitions and each
partition runs its own simulation. The arguments to the switch
specify the number of processors in each partition. Arguments of the
form MxN mean M partitions, each with N processors. Arguments of the
form N mean a single partition with N processors. The sum of
processors in all partitions must equal P. Thus the command
"-partition 8x2 4 5" has 10 partitions and runs on a total of 25
processors.
Running with multiple partitions can e useful for running
"multi-replica simulations"_Section_howto.html#howto_5, where each
replica runs on on one or a few processors. Note that with MPI
installed on a machine (e.g. your desktop), you can run on more
(virtual) processors than you have physical processors.
To run multiple independent simulatoins from one input script, using
-multiple partitions, see "this section"_Section_howto.html#howto_4 of
-the manual. World- and universe-style "variables"_variable.html are
-useful in this context.
+multiple partitions, see "Section_howto 4"_Section_howto.html#howto_4
+of the manual. World- and universe-style "variables"_variable.html
+are useful in this context.
-plog file :pre
Specify the base name for the partition log files, so partition N
writes log information to file.N. If file is none, then no partition
log files are created. This overrides the filename specified in the
-log command-line option. This option is useful when working with
large numbers of partitions, allowing the partition log files to be
suppressed (-plog none) or placed in a sub-directory (-plog
replica_files/log.lammps) If this option is not used the log file for
partition N is log.lammps.N or whatever is specified by the -log
command-line option.
-pscreen file :pre
Specify the base name for the partition screen file, so partition N
writes screen information to file.N. If file is none, then no
partition screen files are created. This overrides the filename
specified in the -screen command-line option. This option is useful
when working with large numbers of partitions, allowing the partition
screen files to be suppressed (-pscreen none) or placed in a
-sub-directory (-pscreen replica_files/screen) If this option is not
+sub-directory (-pscreen replica_files/screen). If this option is not
used the screen file for partition N is screen.N or whatever is
specified by the -screen command-line option.
+-reorder nth N
+-reorder custom filename :pre
+
+Reorder the processors in the MPI communicator used to instantiate
+LAMMPS, in one of several ways. The original MPI communicator ranks
+all P processors from 0 to P-1. The mapping of these ranks to
+physical processors is done by MPI before LAMMPS begins. It may be
+useful in some cases to alter the rank order. E.g. to insure that
+cores within each node are ranked in a desired order. Or when using
+the "run_style verlet/split"_run_style.html command with 2 partitions
+to insure that a specific Kspace processor (in the 2nd partition) is
+matched up with a specific set of processors in the 1st partition.
+See the "Section_accelerate"_Section_accelerate.html doc pages for
+more details.
+
+If the keyword {nth} is used with a setting {N}, then it means every
+Nth processor will be moved to the end of the ranking. This is useful
+when using the "run_style verlet/split"_run_style.html command with 2
+partitions via the -partition command-line switch. The first set of
+processors will be in the first partition, the 2nd set in the 2nd
+partition. The -reorder command-line switch can alter this so that
+the 1st N procs in the 1st partition and one proc in the 2nd partition
+will be ordered consecutively, e.g. as the cores on one physical node.
+This can boost performance. For example, if you use "-reorder nth 4"
+and "-partition 9 3" and you are running on 12 processors, the
+processors will be reordered from
+
+0 1 2 3 4 5 6 7 8 9 10 11 :pre
+
+to
+
+0 1 2 4 5 6 8 9 10 3 7 11 :pre
+
+so that the processors in each partition will be
+
+0 1 2 4 5 6 8 9 10
+3 7 11 :pre
+
+See the "processors" command for how to insure processors from each
+partition could then be grouped optimally for quad-core nodes.
+
+If the keyword is {custom", then a file that specifies a permutation
+of the processor ranks is also specified. The format of the reorder
+file is as follows. Any number of initial blank or comment lines
+(starting with a "#" character) can be present. These should be
+followed by P lines of the form:
+
+I J :pre
+
+where P is the number of processors LAMMPS was launched with. Note
+that if running in multi-partition mode (see the -partition switch
+above) P is the total number of processors in all partitions. The I
+and J values describe a permutation of the P processors. Every I and
+J should be values from 0 to P-1 inclusive. In the set of P I values,
+every proc ID should appear exactly once. Ditto for the set of P J
+values. A single I,J pairing means that the physical processor with
+rank I in the original MPI communicator will have rank J in the
+reordered communicator.
+
+Note that rank ordering can also be specified by many MPI
+implementations, either by environment variables that specify how to
+order physical processors, or by config files that specify what
+physical processors to assign to each MPI rank. The -reorder switch
+simply gives you a portable way to do this without relying on MPI
+itself. See the "processors out"_processors command for how to output
+info on the final assignment of physical processors to the LAMMPS
+simulation domain.
+
-screen file :pre
Specify a file for LAMMPS to write its screen information to. In
one-partition mode, if the switch is not used, LAMMPS writes to the
screen. If this switch is used, LAMMPS writes to the specified file
instead and you will see no screen output. In multi-partition mode,
if the switch is not used, hi-level status information is written to
the screen. Each partition also writes to a screen.N file where N is
the partition ID. If the switch is specified in multi-partition mode,
the hi-level screen dump is named "file" and each partition also
writes screen information to a file.N. For both one-partition and
multi-partition mode, if the specified file is "none", then no screen
output is performed. Option -pscreen will override the name of the
partition screen files file.N.
-suffix style :pre
Use variants of various styles if they exist. The specified style can
be {opt}, {omp}, {gpu}, or {cuda}. These refer to optional packages that
LAMMPS can be built with, as described above in "Section
2.3"_#start_3. The "opt" style corrsponds to the OPT package, the
"omp" style to the USER-OMP package, the "gpu" style to the GPU
package, and the "cuda" style to the USER-CUDA package.
As an example, all of the packages provide a "pair_style
lj/cut"_pair_lj.html variant, with style names lj/cut/opt, lj/cut/omp,
lj/cut/gpu, or lj/cut/cuda. A variant styles can be specified
explicitly in your input script, e.g. pair_style lj/cut/gpu. If the
-suffix switch is used, you do not need to modify your input script.
The specified suffix (opt,omp,gpu,cuda) is automatically appended
whenever your input script command creates a new
"atom"_atom_style.html, "pair"_pair_style.html, "fix"_fix.html,
"compute"_compute.html, or "run"_run_style.html style. If the variant
version does not exist, the standard version is created.
For the GPU package, using this command-line switch also invokes the
default GPU settings, as if the command "package gpu force/neigh 0 0
1" were used at the top of your input script. These settings can be
changed by using the "package gpu"_pacakge.html command in your script
if desired.
For the OMP package, using this command-line switch also invokes the
default OMP settings, as if the command "package omp *" were used at
the top of your input script. These settings can be changed by using
the "package omp"_pacakge.html command in your script if desired.
The "suffix"_suffix.html command can also set a suffix and it can also
turn off/on any suffix setting made via the command line.
-var name value1 value2 ... :pre
Specify a variable that will be defined for substitution purposes when
the input script is read. "Name" is the variable name which can be a
single character (referenced as $x in the input script) or a full
string (referenced as $\{abc\}). An "index-style
variable"_variable.html will be created and populated with the
subsequent values, e.g. a set of filenames. Using this command-line
option is equivalent to putting the line "variable name index value1
value2 ..." at the beginning of the input script. Defining an index
variable as a command-line argument overrides any setting for the same
index variable in the input script, since index variables cannot be
re-defined. See the "variable"_variable.html command for more info on
defining index and other kinds of variables and "this
section"_Section_commands.html#cmd_2 for more info on using variables
in input scripts.
NOTE: Currently, the command-line parser looks for arguments that
start with "-" to indicate new switches. Thus you cannot specify
multiple variable values if any of they start with a "-", e.g. a
negative numeric value. It is OK if the first value1 starts with a
"-", since it is automatically skipped.
:line
2.7 LAMMPS screen output :h4,link(start_7)
As LAMMPS reads an input script, it prints information to both the
screen and a log file about significant actions it takes to setup a
simulation. When the simulation is ready to begin, LAMMPS performs
various initializations and prints the amount of memory (in MBytes per
processor) that the simulation requires. It also prints details of
the initial thermodynamic state of the system. During the run itself,
thermodynamic information is printed periodically, every few
timesteps. When the run concludes, LAMMPS prints the final
thermodynamic state and a total run time for the simulation. It then
appends statistics about the CPU time and storage requirements for the
simulation. An example set of statistics is shown here:
Loop time of 49.002 on 2 procs for 2004 atoms :pre
Pair time (%) = 35.0495 (71.5267)
Bond time (%) = 0.092046 (0.187841)
Kspce time (%) = 6.42073 (13.103)
Neigh time (%) = 2.73485 (5.5811)
Comm time (%) = 1.50291 (3.06703)
Outpt time (%) = 0.013799 (0.0281601)
Other time (%) = 2.13669 (4.36041) :pre
Nlocal: 1002 ave, 1015 max, 989 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Nghost: 8720 ave, 8724 max, 8716 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Neighs: 354141 ave, 361422 max, 346860 min
Histogram: 1 0 0 0 0 0 0 0 0 1 :pre
Total # of neighbors = 708282
Ave neighs/atom = 353.434
Ave special neighs/atom = 2.34032
Number of reneighborings = 42
Dangerous reneighborings = 2 :pre
The first section gives the breakdown of the CPU run time (in seconds)
into major categories. The second section lists the number of owned
atoms (Nlocal), ghost atoms (Nghost), and pair-wise neighbors stored
per processor. The max and min values give the spread of these values
across processors with a 10-bin histogram showing the distribution.
The total number of histogram counts is equal to the number of
processors.
The last section gives aggregate statistics for pair-wise neighbors
and special neighbors that LAMMPS keeps track of (see the
"special_bonds"_special_bonds.html command). The number of times
neighbor lists were rebuilt during the run is given as well as the
number of potentially "dangerous" rebuilds. If atom movement
triggered neighbor list rebuilding (see the
"neigh_modify"_neigh_modify.html command), then dangerous
reneighborings are those that were triggered on the first timestep
atom movement was checked for. If this count is non-zero you may wish
to reduce the delay factor to insure no force interactions are missed
by atoms moving beyond the neighbor skin distance before a rebuild
takes place.
If an energy minimization was performed via the
"minimize"_minimize.html command, additional information is printed,
e.g.
Minimization stats:
E initial, next-to-last, final = -0.895962 -2.94193 -2.94342
Gradient 2-norm init/final= 1920.78 20.9992
Gradient inf-norm init/final= 304.283 9.61216
Iterations = 36
Force evaluations = 177 :pre
The first line lists the initial and final energy, as well as the
energy on the next-to-last iteration. The next 2 lines give a measure
of the gradient of the energy (force on all atoms). The 2-norm is the
"length" of this force vector; the inf-norm is the largest component.
The last 2 lines are statistics on how many iterations and
force-evaluations the minimizer required. Multiple force evaluations
are typically done at each iteration to perform a 1d line minimization
in the search direction.
If a "kspace_style"_kspace_style.html long-range Coulombics solve was
performed during the run (PPPM, Ewald), then additional information is
printed, e.g.
FFT time (% of Kspce) = 0.200313 (8.34477)
FFT Gflps 3d 1d-only = 2.31074 9.19989 :pre
The first line gives the time spent doing 3d FFTs (4 per timestep) and
the fraction it represents of the total KSpace time (listed above).
Each 3d FFT requires computation (3 sets of 1d FFTs) and communication
(transposes). The total flops performed is 5Nlog_2(N), where N is the
number of points in the 3d grid. The FFTs are timed with and without
the communication and a Gflop rate is computed. The 3d rate is with
communication; the 1d rate is without (just the 1d FFTs). Thus you
can estimate what fraction of your FFT time was spent in
communication, roughly 75% in the example above.
:line
2.8 Tips for users of previous LAMMPS versions :h4,link(start_8)
The current C++ began with a complete rewrite of LAMMPS 2001, which
was written in F90. Features of earlier versions of LAMMPS are listed
-in "this section"_Section_history.html. The F90 and F77 versions
+in "Section_history"_Section_history.html. The F90 and F77 versions
(2001 and 99) are also freely distributed as open-source codes; check
the "LAMMPS WWW Site"_lws for distribution information if you prefer
those versions. The 99 and 2001 versions are no longer under active
development; they do not have all the features of C++ LAMMPS.
If you are a previous user of LAMMPS 2001, these are the most
significant changes you will notice in C++ LAMMPS:
(1) The names and arguments of many input script commands have
changed. All commands are now a single word (e.g. read_data instead
of read data).
(2) All the functionality of LAMMPS 2001 is included in C++ LAMMPS,
but you may need to specify the relevant commands in different ways.
(3) The format of the data file can be streamlined for some problems.
See the "read_data"_read_data.html command for details. The data file
section "Nonbond Coeff" has been renamed to "Pair Coeff" in C++ LAMMPS.
(4) Binary restart files written by LAMMPS 2001 cannot be read by C++
LAMMPS with a "read_restart"_read_restart.html command. This is
because they were output by F90 which writes in a different binary
format than C or C++ writes or reads. Use the {restart2data} tool
provided with LAMMPS 2001 to convert the 2001 restart file to a text
data file. Then edit the data file as necessary before using the C++
LAMMPS "read_data"_read_data.html command to read it in.
(5) There are numerous small numerical changes in C++ LAMMPS that mean
you will not get identical answers when comparing to a 2001 run.
However, your initial thermodynamic energy and MD trajectory should be
close if you have setup the problem for both codes the same.
diff --git a/doc/angle_charmm.html b/doc/angle_charmm.html
index 310912773..9cc950f56 100644
--- a/doc/angle_charmm.html
+++ b/doc/angle_charmm.html
@@ -1,94 +1,94 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>angle_style charmm command
</H3>
<H3>angle_style charmm/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>angle_style charmm
</PRE>
<P><B>Examples:</B>
</P>
<PRE>angle_style charmm
angle_coeff 1 300.0 107.0 50.0 3.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>charmm</I> angle style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/angle_charmm.jpg">
</CENTER>
<P>with an additional Urey_Bradley term based on the distance <I>r</I> between
the 1st and 3rd atoms in the angle. K, theta0, Kub, and Rub are
coefficients defined for each angle type.
</P>
<P>See <A HREF = "#MacKerell">(MacKerell)</A> for a description of the CHARMM force
field.
</P>
<P>The following coefficients must be defined for each angle type via the
<A HREF = "angle_coeff.html">angle_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>K (energy/radian^2)
<LI>theta0 (degrees)
<LI>K_ub (energy/distance^2)
<LI>r_ub (distance)
</UL>
<P>Theta0 is specified in degrees, but LAMMPS converts it to radians
internally; hence the units of K are in energy/radian^2.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "angle_coeff.html">angle_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "MacKerell"></A>
<P><B>(MacKerell)</B> MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field,
Fischer, Gao, Guo, Ha, et al, J Phys Chem, 102, 3586 (1998).
</P>
</HTML>
diff --git a/doc/angle_charmm.txt b/doc/angle_charmm.txt
index f980d516e..78500a538 100644
--- a/doc/angle_charmm.txt
+++ b/doc/angle_charmm.txt
@@ -1,87 +1,87 @@
"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
angle_style charmm command :h3
angle_style charmm/omp command :h3
[Syntax:]
angle_style charmm :pre
[Examples:]
angle_style charmm
angle_coeff 1 300.0 107.0 50.0 3.0 :pre
[Description:]
The {charmm} angle style uses the potential
:c,image(Eqs/angle_charmm.jpg)
with an additional Urey_Bradley term based on the distance {r} between
the 1st and 3rd atoms in the angle. K, theta0, Kub, and Rub are
coefficients defined for each angle type.
See "(MacKerell)"_#MacKerell for a description of the CHARMM force
field.
The following coefficients must be defined for each angle type via the
"angle_coeff"_angle_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
K (energy/radian^2)
theta0 (degrees)
K_ub (energy/distance^2)
r_ub (distance) :ul
Theta0 is specified in degrees, but LAMMPS converts it to radians
internally; hence the units of K are in energy/radian^2.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"angle_coeff"_angle_coeff.html
[Default:] none
:line
:link(MacKerell)
[(MacKerell)] MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field,
Fischer, Gao, Guo, Ha, et al, J Phys Chem, 102, 3586 (1998).
diff --git a/doc/angle_class2.html b/doc/angle_class2.html
index e80f4d733..ddc19dd1b 100644
--- a/doc/angle_class2.html
+++ b/doc/angle_class2.html
@@ -1,125 +1,125 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>angle_style class2 command
</H3>
<H3>angle_style class2/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>angle_style class2
</PRE>
<P><B>Examples:</B>
</P>
<PRE>angle_style class2
angle_coeff * 75.0
angle_coeff 1 bb 10.5872 1.0119 1.5228
angle_coeff * ba 3.6551 24.895 1.0119 1.5228
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>class2</I> angle style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/angle_class2.jpg">
</CENTER>
<P>where Ea is the angle term, Ebb is a bond-bond term, and Eba is a
bond-angle term. Theta0 is the equilibrium angle and r1 and r2 are
the equilibrium bond lengths.
</P>
<P>See <A HREF = "#Sun">(Sun)</A> for a description of the COMPASS class2 force field.
</P>
<P>Coefficients for the Ea, Ebb, and Eba formulas must be defined for
each angle type via the <A HREF = "bond_coeff.html">bond_coeff</A> command as in the
example above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands.
</P>
<P>These are the 4 coefficients for the Ea formula:
</P>
<UL><LI>theta0 (degrees)
<LI>K2 (energy/radian^2)
<LI>K3 (energy/radian^3)
<LI>K4 (energy/radian^4)
</UL>
<P>Theta0 is specified in degrees, but LAMMPS converts it to radians
internally; hence the units of the various K are in per-radian.
</P>
<P>For the Ebb formula, each line in a <A HREF = "bond_coeff.html">bond_coeff</A>
command in the input script lists 4 coefficients, the first of which
is "bb" to indicate they are BondBond coefficients. In a data file,
these coefficients should be listed under a "BondBond Coeffs" heading
and you must leave out the "bb", i.e. only list 3 coefficients after
the angle type.
</P>
<UL><LI>bb
<LI>M (energy/distance^2)
<LI>r1 (distance)
<LI>r2 (distance)
</UL>
<P>For the Eba formula, each line in a <A HREF = "bond_coeff.html">bond_coeff</A>
command in the input script lists 5 coefficients, the first of which
is "ba" to indicate they are BondAngle coefficients. In a data file,
these coefficients should be listed under a "BondAngle Coeffs" heading
and you must leave out the "ba", i.e. only list 4 coefficients after
the angle type.
</P>
<UL><LI>ba
<LI>N1 (energy/distance^2)
<LI>N2 (energy/distance^2)
<LI>r1 (distance)
<LI>r2 (distance)
</UL>
<P>The theta0 value in the Eba formula is not specified, since it is the
same value from the Ea formula.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This angle style can only be used if LAMMPS was built with the CLASS2
package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "angle_coeff.html">angle_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Sun"></A>
<P><B>(Sun)</B> Sun, J Phys Chem B 102, 7338-7364 (1998).
</P>
</HTML>
diff --git a/doc/angle_class2.txt b/doc/angle_class2.txt
index f9d48f4ef..36a16e836 100644
--- a/doc/angle_class2.txt
+++ b/doc/angle_class2.txt
@@ -1,118 +1,118 @@
"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
angle_style class2 command :h3
angle_style class2/omp command :h3
[Syntax:]
angle_style class2 :pre
[Examples:]
angle_style class2
angle_coeff * 75.0
angle_coeff 1 bb 10.5872 1.0119 1.5228
angle_coeff * ba 3.6551 24.895 1.0119 1.5228 :pre
[Description:]
The {class2} angle style uses the potential
:c,image(Eqs/angle_class2.jpg)
where Ea is the angle term, Ebb is a bond-bond term, and Eba is a
bond-angle term. Theta0 is the equilibrium angle and r1 and r2 are
the equilibrium bond lengths.
See "(Sun)"_#Sun for a description of the COMPASS class2 force field.
Coefficients for the Ea, Ebb, and Eba formulas must be defined for
each angle type via the "bond_coeff"_bond_coeff.html command as in the
example above, or in the data file or restart files read by the
"read_data"_read_data.html or "read_restart"_read_restart.html
commands.
These are the 4 coefficients for the Ea formula:
theta0 (degrees)
K2 (energy/radian^2)
K3 (energy/radian^3)
K4 (energy/radian^4) :ul
Theta0 is specified in degrees, but LAMMPS converts it to radians
internally; hence the units of the various K are in per-radian.
For the Ebb formula, each line in a "bond_coeff"_bond_coeff.html
command in the input script lists 4 coefficients, the first of which
is "bb" to indicate they are BondBond coefficients. In a data file,
these coefficients should be listed under a "BondBond Coeffs" heading
and you must leave out the "bb", i.e. only list 3 coefficients after
the angle type.
bb
M (energy/distance^2)
r1 (distance)
r2 (distance) :ul
For the Eba formula, each line in a "bond_coeff"_bond_coeff.html
command in the input script lists 5 coefficients, the first of which
is "ba" to indicate they are BondAngle coefficients. In a data file,
these coefficients should be listed under a "BondAngle Coeffs" heading
and you must leave out the "ba", i.e. only list 4 coefficients after
the angle type.
ba
N1 (energy/distance^2)
N2 (energy/distance^2)
r1 (distance)
r2 (distance) :ul
The theta0 value in the Eba formula is not specified, since it is the
same value from the Ea formula.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This angle style can only be used if LAMMPS was built with the CLASS2
package. See the "Making LAMMPS"_Section_start.html#start_3 section
for more info on packages.
[Related commands:]
"angle_coeff"_angle_coeff.html
[Default:] none
:line
:link(Sun)
[(Sun)] Sun, J Phys Chem B 102, 7338-7364 (1998).
diff --git a/doc/angle_cosine.html b/doc/angle_cosine.html
index cb3c29304..1c376614a 100644
--- a/doc/angle_cosine.html
+++ b/doc/angle_cosine.html
@@ -1,76 +1,76 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>angle_style cosine command
</H3>
<H3>angle_style cosine/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>angle_style cosine
</PRE>
<P><B>Examples:</B>
</P>
<PRE>angle_style cosine
angle_coeff * 75.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>cosine</I> angle style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/angle_cosine.jpg">
</CENTER>
<P>where K is defined for each angle type.
</P>
<P>The following coefficients must be defined for each angle type via the
<A HREF = "angle_coeff.html">angle_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>K (energy)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "angle_coeff.html">angle_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/angle_cosine.txt b/doc/angle_cosine.txt
index 80a380d50..9c7b72297 100644
--- a/doc/angle_cosine.txt
+++ b/doc/angle_cosine.txt
@@ -1,70 +1,70 @@
"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
angle_style cosine command :h3
angle_style cosine/omp command :h3
[Syntax:]
angle_style cosine :pre
[Examples:]
angle_style cosine
angle_coeff * 75.0 :pre
[Description:]
The {cosine} angle style uses the potential
:c,image(Eqs/angle_cosine.jpg)
where K is defined for each angle type.
The following coefficients must be defined for each angle type via the
"angle_coeff"_angle_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
K (energy) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"angle_coeff"_angle_coeff.html
[Default:] none
diff --git a/doc/angle_cosine_delta.html b/doc/angle_cosine_delta.html
index 1b034e85e..dd8c9965c 100644
--- a/doc/angle_cosine_delta.html
+++ b/doc/angle_cosine_delta.html
@@ -1,82 +1,82 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>angle_style cosine/delta command
</H3>
<H3>angle_style cosine/delta/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>angle_style cosine/delta
</PRE>
<P><B>Examples:</B>
</P>
<PRE>angle_style cosine/delta
angle_coeff 2*4 75.0 100.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>cosine/delta</I> angle style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/angle_cosine_delta.jpg">
</CENTER>
<P>where theta0 is the equilibrium value of the angle, and K is a
prefactor. Note that the usual 1/2 factor is included in K.
</P>
<P>The following coefficients must be defined for each angle type via the
<A HREF = "angle_coeff.html">angle_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>K (energy)
<LI>theta0 (degrees)
</UL>
<P>Theta0 is specified in degrees, but LAMMPS converts it to radians
internally.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "angle_coeff.html">angle_coeff</A>, <A HREF = "angle_cosine_squared.html">angle_style
cosine/squared</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/angle_cosine_delta.txt b/doc/angle_cosine_delta.txt
index 38128b9da..92b809b67 100644
--- a/doc/angle_cosine_delta.txt
+++ b/doc/angle_cosine_delta.txt
@@ -1,76 +1,76 @@
"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
angle_style cosine/delta command :h3
angle_style cosine/delta/omp command :h3
[Syntax:]
angle_style cosine/delta :pre
[Examples:]
angle_style cosine/delta
angle_coeff 2*4 75.0 100.0 :pre
[Description:]
The {cosine/delta} angle style uses the potential
:c,image(Eqs/angle_cosine_delta.jpg)
where theta0 is the equilibrium value of the angle, and K is a
prefactor. Note that the usual 1/2 factor is included in K.
The following coefficients must be defined for each angle type via the
"angle_coeff"_angle_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
K (energy)
theta0 (degrees) :ul
Theta0 is specified in degrees, but LAMMPS converts it to radians
internally.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"angle_coeff"_angle_coeff.html, "angle_style
cosine/squared"_angle_cosine_squared.html
[Default:] none
diff --git a/doc/angle_cosine_periodic.html b/doc/angle_cosine_periodic.html
index 1078488fc..55469c2c6 100644
--- a/doc/angle_cosine_periodic.html
+++ b/doc/angle_cosine_periodic.html
@@ -1,96 +1,96 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>angle_style cosine/periodic command
</H3>
<H3>angle_style cosine/periodic/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>angle_style cosine/periodic
</PRE>
<P><B>Examples:</B>
</P>
<PRE>angle_style cosine/periodic
angle_coeff * 75.0 1 6
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>cosine/periodic</I> angle style uses the following potential, which
is commonly used in the <A HREF = "Section_howto.html#howto_4">DREIDING</A> force
field, particularly for organometallic systems where <I>n</I> = 4 might be
used for an octahedral complex and <I>n</I> = 3 might be used for a
trigonal center:
</P>
<CENTER><IMG SRC = "Eqs/angle_cosine_periodic.jpg">
</CENTER>
<P>where C, B and n are coefficients defined for each angle type.
</P>
<P>See <A HREF = "#Mayo">(Mayo)</A> for a description of the DREIDING force field
</P>
<P>The following coefficients must be defined for each angle type via the
<A HREF = "angle_coeff.html">angle_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>C (energy)
<LI>B = 1 or -1
<LI>n = 1, 2, 3, 4, 5 or 6 for periodicity
</UL>
<P>Note that the prefactor C is specified and not the overall force
constant K = C / n^2. When B = 1, it leads to a minimum for the
linear geometry. When B = -1, it leads to a maximum for the linear
geometry.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "angle_coeff.html">angle_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Mayo"></A>
<P><B>(Mayo)</B> Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
(1990).
</P>
</HTML>
diff --git a/doc/angle_cosine_periodic.txt b/doc/angle_cosine_periodic.txt
index 8c3ac1bb3..c5ea3563b 100644
--- a/doc/angle_cosine_periodic.txt
+++ b/doc/angle_cosine_periodic.txt
@@ -1,89 +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
angle_style cosine/periodic command :h3
angle_style cosine/periodic/omp command :h3
[Syntax:]
angle_style cosine/periodic :pre
[Examples:]
angle_style cosine/periodic
angle_coeff * 75.0 1 6 :pre
[Description:]
The {cosine/periodic} angle style uses the following potential, which
is commonly used in the "DREIDING"_Section_howto.html#howto_4 force
field, particularly for organometallic systems where {n} = 4 might be
used for an octahedral complex and {n} = 3 might be used for a
trigonal center:
:c,image(Eqs/angle_cosine_periodic.jpg)
where C, B and n are coefficients defined for each angle type.
See "(Mayo)"_#Mayo for a description of the DREIDING force field
The following coefficients must be defined for each angle type via the
"angle_coeff"_angle_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
C (energy)
B = 1 or -1
n = 1, 2, 3, 4, 5 or 6 for periodicity :ul
Note that the prefactor C is specified and not the overall force
constant K = C / n^2. When B = 1, it leads to a minimum for the
linear geometry. When B = -1, it leads to a maximum for the linear
geometry.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"angle_coeff"_angle_coeff.html
[Default:] none
:line
:link(Mayo)
[(Mayo)] Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
(1990).
diff --git a/doc/angle_cosine_shift.html b/doc/angle_cosine_shift.html
index b20940c56..76b1cea55 100644
--- a/doc/angle_cosine_shift.html
+++ b/doc/angle_cosine_shift.html
@@ -1,80 +1,80 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>angle_style cosine/shift command
</H3>
<H3>angle_style cosine/shift/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>angle_style cosine/shift
</PRE>
<P><B>Examples:</B>
</P>
<PRE>angle_style cosine/shift
angle_coeff * 10.0 45.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>cosine/shift</I> angle style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/angle_cosine_shift.jpg">
</CENTER>
<P>where theta0 is the equilibrium angle. The potential is bounded
between -Umin and zero. In the neighborhood of the minimum E=- Umin +
Umin/4(theta-theta0)^2 hence the spring constant is umin/2.
</P>
<P>The following coefficients must be defined for each angle type via the
<A HREF = "angle_coeff.html">angle_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>umin (energy)
<LI>theta (angle)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This angle style can only be used if LAMMPS was built with the
USER-MISC package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "angle_coeff.html">angle_coeff</A>,
<A HREF = "angle_cosineshiftexp.html">angle_cosineshiftexp</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/angle_cosine_shift.txt b/doc/angle_cosine_shift.txt
index 40fa44947..cd2b7fe10 100644
--- a/doc/angle_cosine_shift.txt
+++ b/doc/angle_cosine_shift.txt
@@ -1,74 +1,74 @@
"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
angle_style cosine/shift command :h3
angle_style cosine/shift/omp command :h3
[Syntax:]
angle_style cosine/shift :pre
[Examples:]
angle_style cosine/shift
angle_coeff * 10.0 45.0 :pre
[Description:]
The {cosine/shift} angle style uses the potential
:c,image(Eqs/angle_cosine_shift.jpg)
where theta0 is the equilibrium angle. The potential is bounded
between -Umin and zero. In the neighborhood of the minimum E=- Umin +
Umin/4(theta-theta0)^2 hence the spring constant is umin/2.
The following coefficients must be defined for each angle type via the
"angle_coeff"_angle_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
umin (energy)
theta (angle) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This angle style can only be used if LAMMPS was built with the
USER-MISC package. See the "Making LAMMPS"_Section_start.html#start_3
section for more info on packages.
[Related commands:]
"angle_coeff"_angle_coeff.html,
"angle_cosineshiftexp"_angle_cosineshiftexp.html
[Default:] none
diff --git a/doc/angle_cosine_shift_exp.html b/doc/angle_cosine_shift_exp.html
index 8540a8e84..3a30784ee 100644
--- a/doc/angle_cosine_shift_exp.html
+++ b/doc/angle_cosine_shift_exp.html
@@ -1,93 +1,93 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>angle_style cosine/shift/exp command
</H3>
<H3>angle_style cosine/shift/exp/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>angle_style cosine/shift/exp
</PRE>
<P><B>Examples:</B>
</P>
<PRE>angle_style cosine/shift/exp
angle_coeff * 10.0 45.0 2.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>cosine/shift/exp</I> angle style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/angle_cosine_shift_exp.jpg">
</CENTER>
<P>where Umin, theta, and a are defined for each angle type.
</P>
<P>The potential is bounded between [-Umin:0] and the minimum is
located at the angle theta0. The a parameter can be both positive or
negative and is used to control the spring constant at the
equilibrium.
</P>
<P>The spring constant is given by k = A exp(A) Umin / [2 (Exp(a)-1)].
For a > 3, k/Umin = a/2 to better than 5% relative error. For negative
values of the a parameter, the spring constant is essentially zero,
and anharmonic terms takes over. The potential is furthermore well
behaved in the limit a -> 0, where it has been implemented to linear
order in a for a < 0.001. In this limit the potential reduces to the
cosineshifted potential.
</P>
<P>The following coefficients must be defined for each angle type via the
<A HREF = "angle_coeff.html">angle_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>umin (energy)
<LI>theta (angle)
<LI>A (real number)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This angle style can only be used if LAMMPS was built with the
USER-MISC package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "angle_coeff.html">angle_coeff</A>,
<A HREF = "angle_cosineshift.html">angle_cosineshift</A>,
<A HREF = "dihedral_cosineshift.html">dihedral_cosineshift</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/angle_cosine_shift_exp.txt b/doc/angle_cosine_shift_exp.txt
index 46f475895..f9b2efdf9 100644
--- a/doc/angle_cosine_shift_exp.txt
+++ b/doc/angle_cosine_shift_exp.txt
@@ -1,87 +1,87 @@
"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
angle_style cosine/shift/exp command :h3
angle_style cosine/shift/exp/omp command :h3
[Syntax:]
angle_style cosine/shift/exp :pre
[Examples:]
angle_style cosine/shift/exp
angle_coeff * 10.0 45.0 2.0 :pre
[Description:]
The {cosine/shift/exp} angle style uses the potential
:c,image(Eqs/angle_cosine_shift_exp.jpg)
where Umin, theta, and a are defined for each angle type.
The potential is bounded between \[-Umin:0\] and the minimum is
located at the angle theta0. The a parameter can be both positive or
negative and is used to control the spring constant at the
equilibrium.
The spring constant is given by k = A exp(A) Umin / \[2 (Exp(a)-1)\].
For a > 3, k/Umin = a/2 to better than 5% relative error. For negative
values of the a parameter, the spring constant is essentially zero,
and anharmonic terms takes over. The potential is furthermore well
behaved in the limit a -> 0, where it has been implemented to linear
order in a for a < 0.001. In this limit the potential reduces to the
cosineshifted potential.
The following coefficients must be defined for each angle type via the
"angle_coeff"_angle_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
umin (energy)
theta (angle)
A (real number) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This angle style can only be used if LAMMPS was built with the
USER-MISC package. See the "Making LAMMPS"_Section_start.html#start_3
section for more info on packages.
[Related commands:]
"angle_coeff"_angle_coeff.html,
"angle_cosineshift"_angle_cosineshift.html,
"dihedral_cosineshift"_dihedral_cosineshift.html
[Default:] none
diff --git a/doc/angle_cosine_squared.html b/doc/angle_cosine_squared.html
index d2440aeee..08af46901 100644
--- a/doc/angle_cosine_squared.html
+++ b/doc/angle_cosine_squared.html
@@ -1,81 +1,81 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>angle_style cosine/squared command
</H3>
<H3>angle_style cosine/squared/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>angle_style cosine/squared
</PRE>
<P><B>Examples:</B>
</P>
<PRE>angle_style cosine/squared
angle_coeff 2*4 75.0 100.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>cosine/squared</I> angle style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/angle_cosine_squared.jpg">
</CENTER>
<P>where theta0 is the equilibrium value of the angle, and K is a
prefactor. Note that the usual 1/2 factor is included in K.
</P>
<P>The following coefficients must be defined for each angle type via the
<A HREF = "angle_coeff.html">angle_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>K (energy)
<LI>theta0 (degrees)
</UL>
<P>Theta0 is specified in degrees, but LAMMPS converts it to radians
internally.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "angle_coeff.html">angle_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/angle_cosine_squared.txt b/doc/angle_cosine_squared.txt
index d313a1b34..ec7dbd217 100644
--- a/doc/angle_cosine_squared.txt
+++ b/doc/angle_cosine_squared.txt
@@ -1,75 +1,75 @@
"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
angle_style cosine/squared command :h3
angle_style cosine/squared/omp command :h3
[Syntax:]
angle_style cosine/squared :pre
[Examples:]
angle_style cosine/squared
angle_coeff 2*4 75.0 100.0 :pre
[Description:]
The {cosine/squared} angle style uses the potential
:c,image(Eqs/angle_cosine_squared.jpg)
where theta0 is the equilibrium value of the angle, and K is a
prefactor. Note that the usual 1/2 factor is included in K.
The following coefficients must be defined for each angle type via the
"angle_coeff"_angle_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
K (energy)
theta0 (degrees) :ul
Theta0 is specified in degrees, but LAMMPS converts it to radians
internally.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"angle_coeff"_angle_coeff.html
[Default:] none
diff --git a/doc/angle_harmonic.html b/doc/angle_harmonic.html
index ca1c1662f..4242327db 100644
--- a/doc/angle_harmonic.html
+++ b/doc/angle_harmonic.html
@@ -1,81 +1,81 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>angle_style harmonic command
</H3>
<H3>angle_style harmonic/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>angle_style harmonic
</PRE>
<P><B>Examples:</B>
</P>
<PRE>angle_style harmonic
angle_coeff 1 300.0 107.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>harmonic</I> angle style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/angle_harmonic.jpg">
</CENTER>
<P>where theta0 is the equilibrium value of the angle, and K is a
prefactor. Note that the usual 1/2 factor is included in K.
</P>
<P>The following coefficients must be defined for each angle type via the
<A HREF = "angle_coeff.html">angle_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>K (energy/radian^2)
<LI>theta0 (degrees)
</UL>
<P>Theta0 is specified in degrees, but LAMMPS converts it to radians
internally; hence the units of K are in energy/radian^2.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P>This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "angle_coeff.html">angle_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/angle_harmonic.txt b/doc/angle_harmonic.txt
index 45deb90e4..b0695631e 100644
--- a/doc/angle_harmonic.txt
+++ b/doc/angle_harmonic.txt
@@ -1,75 +1,75 @@
"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
angle_style harmonic command :h3
angle_style harmonic/omp command :h3
[Syntax:]
angle_style harmonic :pre
[Examples:]
angle_style harmonic
angle_coeff 1 300.0 107.0 :pre
[Description:]
The {harmonic} angle style uses the potential
:c,image(Eqs/angle_harmonic.jpg)
where theta0 is the equilibrium value of the angle, and K is a
prefactor. Note that the usual 1/2 factor is included in K.
The following coefficients must be defined for each angle type via the
"angle_coeff"_angle_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
K (energy/radian^2)
theta0 (degrees) :ul
Theta0 is specified in degrees, but LAMMPS converts it to radians
internally; hence the units of K are in energy/radian^2.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:] none
This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"angle_coeff"_angle_coeff.html
[Default:] none
diff --git a/doc/angle_table.html b/doc/angle_table.html
index f9cc6701a..992eeeb26 100644
--- a/doc/angle_table.html
+++ b/doc/angle_table.html
@@ -1,162 +1,162 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>angle_style table command
</H3>
<H3>angle_style table/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>angle_style table style N
</PRE>
<UL><LI>style = <I>linear</I> or <I>spline</I> = method of interpolation
<LI>N = use N values in table
</UL>
<P><B>Examples:</B>
</P>
<PRE>angle_style table linear 1000
angle_coeff 3 file.table ENTRY1
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>table</I> creates interpolation tables of length <I>N</I> from angle
potential and derivative values listed in a file(s) as a function of
angle The files are read by the <A HREF = "angle_coeff.html">angle_coeff</A>
command.
</P>
<P>The interpolation tables are created by fitting cubic splines to the
file values and interpolating energy and derivative values at each of
<I>N</I> angles. During a simulation, these tables are used to interpolate
energy and force values on individual atoms as needed. The
interpolation is done in one of 2 styles: <I>linear</I> or <I>spline</I>.
</P>
<P>For the <I>linear</I> style, the angle is used to find 2 surrounding table
values from which an energy or its derivative is computed by linear
interpolation.
</P>
<P>For the <I>spline</I> style, a cubic spline coefficients are computed and
stored at each of the <I>N</I> values in the table. The angle is used to
find the appropriate set of coefficients which are used to evaluate a
cubic polynomial which computes the energy or derivative.
</P>
<P>The following coefficients must be defined for each angle type via the
<A HREF = "angle_coeff.html">angle_coeff</A> command as in the example above.
</P>
<UL><LI>filename
<LI>keyword
</UL>
<P>The filename specifies a file containing tabulated energy and
derivative values. The keyword specifies a section of the file. The
format of this file is described below.
</P>
<HR>
<P>The format of a tabulated file is as follows (without the
parenthesized comments):
</P>
<PRE># Angle potential for harmonic (one or more comment or blank lines)
</PRE>
<PRE>HAM (keyword is the first text on line)
N 181 FP 0 0 EQ 90.0 (N, FP, EQ parameters)
(blank line)
N 181 FP 0 0 (N, FP parameters)
1 0.0 200.5 2.5 (index, angle, energy, derivative)
2 1.0 198.0 2.5
...
181 180.0 0.0 0.0
</PRE>
<P>A section begins with a non-blank line whose 1st character is not a
"#"; blank lines or lines starting with "#" can be used as comments
between sections. The first line begins with a keyword which
identifies the section. The line can contain additional text, but the
initial text must match the argument specified in the
<A HREF = "angle_coeff.html">angle_coeff</A> command. The next line lists (in any
order) one or more parameters for the table. Each parameter is a
keyword followed by one or more numeric values.
</P>
<P>The parameter "N" is required and its value is the number of table
entries that follow. Note that this may be different than the <I>N</I>
specified in the <A HREF = "angle_style.html">angle_style table</A> command. Let
Ntable = <I>N</I> in the angle_style command, and Nfile = "N" in the
tabulated file. What LAMMPS does is a preliminary interpolation by
creating splines using the Nfile tabulated values as nodal points. It
uses these to interpolate as needed to generate energy and derivative
values at Ntable different points. The resulting tables of length
Ntable are then used as described above, when computing energy and
force for individual angles and their atoms. This means that if you
want the interpolation tables of length Ntable to match exactly what
is in the tabulated file (with effectively no preliminary
interpolation), you should set Ntable = Nfile.
</P>
<P>The "FP" parameter is optional. If used, it is followed by two values
fplo and fphi, which are the 2nd derivatives at the innermost and
outermost angle settings. These values are needed by the spline
construction routines. If not specified by the "FP" parameter, they
are estimated (less accurately) by the first two and last two
derivative values in the table.
</P>
<P>The "EQ" parameter is also optional. If used, it is followed by a the
equilibrium angle value, which is used, for example, by the <A HREF = "fix_shake.html">fix
shake</A> command. If not used, the equilibrium angle is
set to 180.0.
</P>
<P>Following a blank line, the next N lines list the tabulated values.
On each line, the 1st value is the index from 1 to N, the 2nd value is
the angle value (in degrees), the 3rd value is the energy (in energy
units), and the 4th is -dE/d(theta) (also in energy units). The 3rd
term is the energy of the 3-atom configuration for the specified
angle. The last term is the derivative of the energy with respect to
the angle (in degrees, not radians). Thus the units of the last term
are still energy, not force. The angle values must increase from one
line to the next. The angle values must also begin with 0.0 and end
with 180.0, i.e. span the full range of possible angles.
</P>
<P>Note that one file can contain many sections, each with a tabulated
potential. LAMMPS reads the file section by section until it finds
one that matches the specified keyword.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "angle_coeff.html">angle_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/angle_table.txt b/doc/angle_table.txt
index 21ef6b245..008d0c21f 100644
--- a/doc/angle_table.txt
+++ b/doc/angle_table.txt
@@ -1,156 +1,156 @@
"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
angle_style table command :h3
angle_style table/omp command :h3
[Syntax:]
angle_style table style N :pre
style = {linear} or {spline} = method of interpolation
N = use N values in table :ul
[Examples:]
angle_style table linear 1000
angle_coeff 3 file.table ENTRY1 :pre
[Description:]
Style {table} creates interpolation tables of length {N} from angle
potential and derivative values listed in a file(s) as a function of
angle The files are read by the "angle_coeff"_angle_coeff.html
command.
The interpolation tables are created by fitting cubic splines to the
file values and interpolating energy and derivative values at each of
{N} angles. During a simulation, these tables are used to interpolate
energy and force values on individual atoms as needed. The
interpolation is done in one of 2 styles: {linear} or {spline}.
For the {linear} style, the angle is used to find 2 surrounding table
values from which an energy or its derivative is computed by linear
interpolation.
For the {spline} style, a cubic spline coefficients are computed and
stored at each of the {N} values in the table. The angle is used to
find the appropriate set of coefficients which are used to evaluate a
cubic polynomial which computes the energy or derivative.
The following coefficients must be defined for each angle type via the
"angle_coeff"_angle_coeff.html command as in the example above.
filename
keyword :ul
The filename specifies a file containing tabulated energy and
derivative values. The keyword specifies a section of the file. The
format of this file is described below.
:line
The format of a tabulated file is as follows (without the
parenthesized comments):
# Angle potential for harmonic (one or more comment or blank lines) :pre
HAM (keyword is the first text on line)
N 181 FP 0 0 EQ 90.0 (N, FP, EQ parameters)
(blank line)
N 181 FP 0 0 (N, FP parameters)
1 0.0 200.5 2.5 (index, angle, energy, derivative)
2 1.0 198.0 2.5
...
181 180.0 0.0 0.0 :pre
A section begins with a non-blank line whose 1st character is not a
"#"; blank lines or lines starting with "#" can be used as comments
between sections. The first line begins with a keyword which
identifies the section. The line can contain additional text, but the
initial text must match the argument specified in the
"angle_coeff"_angle_coeff.html command. The next line lists (in any
order) one or more parameters for the table. Each parameter is a
keyword followed by one or more numeric values.
The parameter "N" is required and its value is the number of table
entries that follow. Note that this may be different than the {N}
specified in the "angle_style table"_angle_style.html command. Let
Ntable = {N} in the angle_style command, and Nfile = "N" in the
tabulated file. What LAMMPS does is a preliminary interpolation by
creating splines using the Nfile tabulated values as nodal points. It
uses these to interpolate as needed to generate energy and derivative
values at Ntable different points. The resulting tables of length
Ntable are then used as described above, when computing energy and
force for individual angles and their atoms. This means that if you
want the interpolation tables of length Ntable to match exactly what
is in the tabulated file (with effectively no preliminary
interpolation), you should set Ntable = Nfile.
The "FP" parameter is optional. If used, it is followed by two values
fplo and fphi, which are the 2nd derivatives at the innermost and
outermost angle settings. These values are needed by the spline
construction routines. If not specified by the "FP" parameter, they
are estimated (less accurately) by the first two and last two
derivative values in the table.
The "EQ" parameter is also optional. If used, it is followed by a the
equilibrium angle value, which is used, for example, by the "fix
shake"_fix_shake.html command. If not used, the equilibrium angle is
set to 180.0.
Following a blank line, the next N lines list the tabulated values.
On each line, the 1st value is the index from 1 to N, the 2nd value is
the angle value (in degrees), the 3rd value is the energy (in energy
units), and the 4th is -dE/d(theta) (also in energy units). The 3rd
term is the energy of the 3-atom configuration for the specified
angle. The last term is the derivative of the energy with respect to
the angle (in degrees, not radians). Thus the units of the last term
are still energy, not force. The angle values must increase from one
line to the next. The angle values must also begin with 0.0 and end
with 180.0, i.e. span the full range of possible angles.
Note that one file can contain many sections, each with a tabulated
potential. LAMMPS reads the file section by section until it finds
one that matches the specified keyword.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This angle style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"angle_coeff"_angle_coeff.html
[Default:] none
diff --git a/doc/bond_class2.html b/doc/bond_class2.html
index b9178e767..d12a5254a 100644
--- a/doc/bond_class2.html
+++ b/doc/bond_class2.html
@@ -1,87 +1,87 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>bond_style class2 command
</H3>
<H3>bond_style class2/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>bond_style class2
</PRE>
<P><B>Examples:</B>
</P>
<PRE>bond_style class2
bond_coeff 1 1.0 100.0 80.0 80.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>class2</I> bond style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/bond_class2.jpg">
</CENTER>
<P>where r0 is the equilibrium bond distance.
</P>
<P>See <A HREF = "#Sun">(Sun)</A> for a description of the COMPASS class2 force field.
</P>
<P>The following coefficients must be defined for each bond type via the
<A HREF = "bond_coeff.html">bond_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>R0 (distance)
<LI>K2 (energy/distance^2)
<LI>K3 (energy/distance^3)
<LI>K4 (energy/distance^4)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This bond style can only be used if LAMMPS was built with the CLASS2
package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "bond_coeff.html">bond_coeff</A>, <A HREF = "delete_bonds.html">delete_bonds</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Sun"></A>
<P><B>(Sun)</B> Sun, J Phys Chem B 102, 7338-7364 (1998).
</P>
</HTML>
diff --git a/doc/bond_class2.txt b/doc/bond_class2.txt
index fa9c6bb25..c6a9c317e 100644
--- a/doc/bond_class2.txt
+++ b/doc/bond_class2.txt
@@ -1,80 +1,80 @@
"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
bond_style class2 command :h3
bond_style class2/omp command :h3
[Syntax:]
bond_style class2 :pre
[Examples:]
bond_style class2
bond_coeff 1 1.0 100.0 80.0 80.0 :pre
[Description:]
The {class2} bond style uses the potential
:c,image(Eqs/bond_class2.jpg)
where r0 is the equilibrium bond distance.
See "(Sun)"_#Sun for a description of the COMPASS class2 force field.
The following coefficients must be defined for each bond type via the
"bond_coeff"_bond_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
R0 (distance)
K2 (energy/distance^2)
K3 (energy/distance^3)
K4 (energy/distance^4) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This bond style can only be used if LAMMPS was built with the CLASS2
package. See the "Making LAMMPS"_Section_start.html#start_3 section
for more info on packages.
[Related commands:]
"bond_coeff"_bond_coeff.html, "delete_bonds"_delete_bonds.html
[Default:] none
:line
:link(Sun)
[(Sun)] Sun, J Phys Chem B 102, 7338-7364 (1998).
diff --git a/doc/bond_fene.html b/doc/bond_fene.html
index 8d837185f..06efe05a1 100644
--- a/doc/bond_fene.html
+++ b/doc/bond_fene.html
@@ -1,93 +1,93 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>bond_style fene command
</H3>
<H3>bond_style fene/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>bond_style fene
</PRE>
<P><B>Examples:</B>
</P>
<PRE>bond_style fene
bond_coeff 1 30.0 1.5 1.0 1.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>fene</I> bond style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/bond_fene.jpg">
</CENTER>
<P>to define a finite extensible nonlinear elastic (FENE) potential
<A HREF = "#Kremer">(Kremer)</A>, used for bead-spring polymer models. The first
term is attractive, the 2nd Lennard-Jones term is repulsive. The
first term extends to R0, the maximum extent of the bond. The 2nd
term is cutoff at 2^(1/6) sigma, the minimum of the LJ potential.
</P>
<P>The following coefficients must be defined for each bond type via the
<A HREF = "bond_coeff.html">bond_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>K (energy/distance^2)
<LI>R0 (distance)
<LI>epsilon (energy)
<LI>sigma (distance)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P>You typically should specify <A HREF = "special_bonds.html"">special_bonds fene</A>
or <A HREF = "special_bonds.html">special_bonds lj/coul 0 1 1</A> to use this bond
style. LAMMPS will issue a warning it that's not the case.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "bond_coeff.html">bond_coeff</A>, <A HREF = "delete_bonds.html">delete_bonds</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Kremer"></A>
<P><B>(Kremer)</B> Kremer, Grest, J Chem Phys, 92, 5057 (1990).
</P>
</HTML>
diff --git a/doc/bond_fene.txt b/doc/bond_fene.txt
index 0ed8bb737..8ce6ae89c 100644
--- a/doc/bond_fene.txt
+++ b/doc/bond_fene.txt
@@ -1,86 +1,86 @@
"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
bond_style fene command :h3
bond_style fene/omp command :h3
[Syntax:]
bond_style fene :pre
[Examples:]
bond_style fene
bond_coeff 1 30.0 1.5 1.0 1.0 :pre
[Description:]
The {fene} bond style uses the potential
:c,image(Eqs/bond_fene.jpg)
to define a finite extensible nonlinear elastic (FENE) potential
"(Kremer)"_#Kremer, used for bead-spring polymer models. The first
term is attractive, the 2nd Lennard-Jones term is repulsive. The
first term extends to R0, the maximum extent of the bond. The 2nd
term is cutoff at 2^(1/6) sigma, the minimum of the LJ potential.
The following coefficients must be defined for each bond type via the
"bond_coeff"_bond_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
K (energy/distance^2)
R0 (distance)
epsilon (energy)
sigma (distance) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
You typically should specify "special_bonds fene"_special_bonds.html"
or "special_bonds lj/coul 0 1 1"_special_bonds.html to use this bond
style. LAMMPS will issue a warning it that's not the case.
[Related commands:]
"bond_coeff"_bond_coeff.html, "delete_bonds"_delete_bonds.html
[Default:] none
:line
:link(Kremer)
[(Kremer)] Kremer, Grest, J Chem Phys, 92, 5057 (1990).
diff --git a/doc/bond_fene_expand.html b/doc/bond_fene_expand.html
index 0d8856914..a68e76f04 100644
--- a/doc/bond_fene_expand.html
+++ b/doc/bond_fene_expand.html
@@ -1,98 +1,98 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>bond_style fene/expand command
</H3>
<H3>bond_style fene/expand/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>bond_style fene/expand
</PRE>
<P><B>Examples:</B>
</P>
<PRE>bond_style fene/expand
bond_coeff 1 30.0 1.5 1.0 1.0 0.5
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>fene/expand</I> bond style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/bond_fene_expand.jpg">
</CENTER>
<P>to define a finite extensible nonlinear elastic (FENE) potential
<A HREF = "#Kremer">(Kremer)</A>, used for bead-spring polymer models. The first
term is attractive, the 2nd Lennard-Jones term is repulsive.
</P>
<P>The <I>fene/expand</I> bond style is similar to <I>fene</I> except that an extra
shift factor of delta (positive or negative) is added to <I>r</I> to
effectively change the bead size of the bonded atoms. The first term
now extends to R0 + delta and the 2nd term is cutoff at 2^(1/6) sigma
+ delta.
</P>
<P>The following coefficients must be defined for each bond type via the
<A HREF = "bond_coeff.html">bond_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>K (energy/distance^2)
<LI>R0 (distance)
<LI>epsilon (energy)
<LI>sigma (distance)
<LI>delta (distance)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P>You typically should specify <A HREF = "special_bonds.html"">special_bonds fene</A>
or <A HREF = "special_bonds.html">special_bonds lj/coul 0 1 1</A> to use this bond
style. LAMMPS will issue a warning it that's not the case.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "bond_coeff.html">bond_coeff</A>, <A HREF = "delete_bonds.html">delete_bonds</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Kremer"></A>
<P><B>(Kremer)</B> Kremer, Grest, J Chem Phys, 92, 5057 (1990).
</P>
</HTML>
diff --git a/doc/bond_fene_expand.txt b/doc/bond_fene_expand.txt
index 8738f2b6a..997921cd7 100644
--- a/doc/bond_fene_expand.txt
+++ b/doc/bond_fene_expand.txt
@@ -1,91 +1,91 @@
"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
bond_style fene/expand command :h3
bond_style fene/expand/omp command :h3
[Syntax:]
bond_style fene/expand :pre
[Examples:]
bond_style fene/expand
bond_coeff 1 30.0 1.5 1.0 1.0 0.5 :pre
[Description:]
The {fene/expand} bond style uses the potential
:c,image(Eqs/bond_fene_expand.jpg)
to define a finite extensible nonlinear elastic (FENE) potential
"(Kremer)"_#Kremer, used for bead-spring polymer models. The first
term is attractive, the 2nd Lennard-Jones term is repulsive.
The {fene/expand} bond style is similar to {fene} except that an extra
shift factor of delta (positive or negative) is added to {r} to
effectively change the bead size of the bonded atoms. The first term
now extends to R0 + delta and the 2nd term is cutoff at 2^(1/6) sigma
+ delta.
The following coefficients must be defined for each bond type via the
"bond_coeff"_bond_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
K (energy/distance^2)
R0 (distance)
epsilon (energy)
sigma (distance)
delta (distance) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
You typically should specify "special_bonds fene"_special_bonds.html"
or "special_bonds lj/coul 0 1 1"_special_bonds.html to use this bond
style. LAMMPS will issue a warning it that's not the case.
[Related commands:]
"bond_coeff"_bond_coeff.html, "delete_bonds"_delete_bonds.html
[Default:] none
:line
:link(Kremer)
[(Kremer)] Kremer, Grest, J Chem Phys, 92, 5057 (1990).
diff --git a/doc/bond_harmonic.html b/doc/bond_harmonic.html
index 34d1dce34..3fbe7041c 100644
--- a/doc/bond_harmonic.html
+++ b/doc/bond_harmonic.html
@@ -1,78 +1,78 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>bond_style harmonic command
</H3>
<H3>bond_style harmonic/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>bond_style harmonic
</PRE>
<P><B>Examples:</B>
</P>
<PRE>bond_style harmonic
bond_coeff 5 80.0 1.2
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>harmonic</I> bond style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/bond_harmonic.jpg">
</CENTER>
<P>where r0 is the equilibrium bond distance. Note that the usual 1/2
factor is included in K.
</P>
<P>The following coefficients must be defined for each bond type via the
<A HREF = "bond_coeff.html">bond_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>K (energy/distance^2)
<LI>r0 (distance)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "bond_coeff.html">bond_coeff</A>, <A HREF = "delete_bonds.html">delete_bonds</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/bond_harmonic.txt b/doc/bond_harmonic.txt
index fa6004905..df5bdeeff 100644
--- a/doc/bond_harmonic.txt
+++ b/doc/bond_harmonic.txt
@@ -1,72 +1,72 @@
"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
bond_style harmonic command :h3
bond_style harmonic/omp command :h3
[Syntax:]
bond_style harmonic :pre
[Examples:]
bond_style harmonic
bond_coeff 5 80.0 1.2 :pre
[Description:]
The {harmonic} bond style uses the potential
:c,image(Eqs/bond_harmonic.jpg)
where r0 is the equilibrium bond distance. Note that the usual 1/2
factor is included in K.
The following coefficients must be defined for each bond type via the
"bond_coeff"_bond_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
K (energy/distance^2)
r0 (distance) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"bond_coeff"_bond_coeff.html, "delete_bonds"_delete_bonds.html
[Default:] none
diff --git a/doc/bond_harmonic_shift.html b/doc/bond_harmonic_shift.html
index 6c2647b18..0b9b3f6c1 100644
--- a/doc/bond_harmonic_shift.html
+++ b/doc/bond_harmonic_shift.html
@@ -1,84 +1,84 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>bond_style harmonic/shift command
</H3>
<H3>bond_style harmonic/shift/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>bond_style harmonic/shift
</PRE>
<P><B>Examples:</B>
</P>
<PRE>bond_style harmonic/shift
bond_coeff 5 10.0 0.5 1.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>harmonic/shift</I> bond style is a shifted harmonic bond that uses
the potential
</P>
<CENTER><IMG SRC = "Eqs/bond_harmonic_shift.jpg">
</CENTER>
<P>where r0 is the equilibrium bond distance, and rc the critical distance.
The potential is -Umin at r0 and zero at rc. The spring constant is
k = Umin / [ 2 (r0-rc)^2].
</P>
<P>The following coefficients must be defined for each bond type via the
<A HREF = "bond_coeff.html">bond_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>Umin (energy)
</UL>
<UL><LI>r0 (distance)
</UL>
<UL><LI>rc (distance)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This bond style can only be used if LAMMPS was built with the
USER-MISC package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "bond_coeff.html">bond_coeff</A>, <A HREF = "delete_bonds.html">delete_bonds</A>,
<A HREF = "bond_harmonic.html">bond_harmonic</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/bond_harmonic_shift.txt b/doc/bond_harmonic_shift.txt
index 1a72a6c74..0ca376089 100644
--- a/doc/bond_harmonic_shift.txt
+++ b/doc/bond_harmonic_shift.txt
@@ -1,76 +1,76 @@
"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
bond_style harmonic/shift command :h3
bond_style harmonic/shift/omp command :h3
[Syntax:]
bond_style harmonic/shift :pre
[Examples:]
bond_style harmonic/shift
bond_coeff 5 10.0 0.5 1.0 :pre
[Description:]
The {harmonic/shift} bond style is a shifted harmonic bond that uses
the potential
:c,image(Eqs/bond_harmonic_shift.jpg)
where r0 is the equilibrium bond distance, and rc the critical distance.
The potential is -Umin at r0 and zero at rc. The spring constant is
k = Umin / \[ 2 (r0-rc)^2\].
The following coefficients must be defined for each bond type via the
"bond_coeff"_bond_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
Umin (energy) :ul
r0 (distance) :ul
rc (distance) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This bond style can only be used if LAMMPS was built with the
USER-MISC package. See the "Making LAMMPS"_Section_start.html#start_3
section for more info on packages.
[Related commands:]
"bond_coeff"_bond_coeff.html, "delete_bonds"_delete_bonds.html,
"bond_harmonic"_bond_harmonic.html
[Default:] none
diff --git a/doc/bond_harmonic_shift_cut.html b/doc/bond_harmonic_shift_cut.html
index 7af0c2410..b7b8e3064 100644
--- a/doc/bond_harmonic_shift_cut.html
+++ b/doc/bond_harmonic_shift_cut.html
@@ -1,83 +1,83 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>bond_style harmonic/shift/cut command
</H3>
<H3>bond_style harmonic/shift/cut/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>bond_style harmonic/shift/cut
</PRE>
<P><B>Examples:</B>
</P>
<PRE>bond_style harmonic/shift/cut
bond_coeff 5 10.0 0.5 1.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>harmonic/shift/cut</I> bond style is a shifted harmonic bond that
uses the potential
</P>
<CENTER><IMG SRC = "Eqs/bond_harmonic_shift_cut.jpg">
</CENTER>
<P>where r0 is the equilibrium bond distance, and rc the critical distance.
The bond potential is zero for distances r > rc. The potential is -Umin
at r0 and zero at rc. The spring constant is k = Umin / [ 2 (r0-rc)^2].
</P>
<P>The following coefficients must be defined for each bond type via the
<A HREF = "bond_coeff.html">bond_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>Umin (energy)
<LI>r0 (distance)
<LI>rc (distance)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This bond style can only be used if LAMMPS was built with the
USER-MISC package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "bond_coeff.html">bond_coeff</A>, <A HREF = "delete_bonds.html">delete_bonds</A>,
<A HREF = "bond_harmonic.html">bond_harmonic</A>,
<A HREF = "bond_harmonicshift.html">bond_harmonicshift</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/bond_harmonic_shift_cut.txt b/doc/bond_harmonic_shift_cut.txt
index cce603334..847a45541 100644
--- a/doc/bond_harmonic_shift_cut.txt
+++ b/doc/bond_harmonic_shift_cut.txt
@@ -1,77 +1,77 @@
"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
bond_style harmonic/shift/cut command :h3
bond_style harmonic/shift/cut/omp command :h3
[Syntax:]
bond_style harmonic/shift/cut :pre
[Examples:]
bond_style harmonic/shift/cut
bond_coeff 5 10.0 0.5 1.0 :pre
[Description:]
The {harmonic/shift/cut} bond style is a shifted harmonic bond that
uses the potential
:c,image(Eqs/bond_harmonic_shift_cut.jpg)
where r0 is the equilibrium bond distance, and rc the critical distance.
The bond potential is zero for distances r > rc. The potential is -Umin
at r0 and zero at rc. The spring constant is k = Umin / \[ 2 (r0-rc)^2\].
The following coefficients must be defined for each bond type via the
"bond_coeff"_bond_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
Umin (energy)
r0 (distance)
rc (distance) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This bond style can only be used if LAMMPS was built with the
USER-MISC package. See the "Making LAMMPS"_Section_start.html#start_3
section for more info on packages.
[Related commands:]
"bond_coeff"_bond_coeff.html, "delete_bonds"_delete_bonds.html,
"bond_harmonic"_bond_harmonic.html,
"bond_harmonicshift"_bond_harmonicshift.html
[Default:] none
diff --git a/doc/bond_morse.html b/doc/bond_morse.html
index bc436c26d..3c6051438 100644
--- a/doc/bond_morse.html
+++ b/doc/bond_morse.html
@@ -1,79 +1,79 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>bond_style morse command
</H3>
<H3>bond_style morse/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>bond_style morse
</PRE>
<P><B>Examples:</B>
</P>
<PRE>bond_style morse
bond_coeff 5 1.0 2.0 1.2
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>morse</I> bond style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/bond_morse.jpg">
</CENTER>
<P>where r0 is the equilibrium bond distance, alpha is a stiffness
parameter, and D determines the depth of the potential well.
</P>
<P>The following coefficients must be defined for each bond type via the
<A HREF = "bond_coeff.html">bond_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>D (energy)
<LI>alpha (inverse distance)
<LI>r0 (distance)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "bond_coeff.html">bond_coeff</A>, <A HREF = "delete_bonds.html">delete_bonds</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/bond_morse.txt b/doc/bond_morse.txt
index fdecd281f..b399b02e9 100644
--- a/doc/bond_morse.txt
+++ b/doc/bond_morse.txt
@@ -1,73 +1,73 @@
"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
bond_style morse command :h3
bond_style morse/omp command :h3
[Syntax:]
bond_style morse :pre
[Examples:]
bond_style morse
bond_coeff 5 1.0 2.0 1.2 :pre
[Description:]
The {morse} bond style uses the potential
:c,image(Eqs/bond_morse.jpg)
where r0 is the equilibrium bond distance, alpha is a stiffness
parameter, and D determines the depth of the potential well.
The following coefficients must be defined for each bond type via the
"bond_coeff"_bond_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
D (energy)
alpha (inverse distance)
r0 (distance) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"bond_coeff"_bond_coeff.html, "delete_bonds"_delete_bonds.html
[Default:] none
diff --git a/doc/bond_nonlinear.html b/doc/bond_nonlinear.html
index bbe7778a7..c511c2c95 100644
--- a/doc/bond_nonlinear.html
+++ b/doc/bond_nonlinear.html
@@ -1,85 +1,85 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>bond_style nonlinear command
</H3>
<H3>bond_style nonlinear/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>bond_style nonlinear
</PRE>
<P><B>Examples:</B>
</P>
<PRE>bond_style nonlinear
bond_coeff 2 100.0 1.1 1.4
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>nonlinear</I> bond style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/bond_nonlinear.jpg">
</CENTER>
<P>to define an anharmonic spring <A HREF = "#Rector">(Rector)</A> of equilibrium
length r0 and maximum extension lamda.
</P>
<P>The following coefficients must be defined for each bond type via the
<A HREF = "bond_coeff.html">bond_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>epsilon (energy)
<LI>r0 (distance)
<LI>lamda (distance)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "bond_coeff.html">bond_coeff</A>, <A HREF = "delete_bonds.html">delete_bonds</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Rector"></A>
<P><B>(Rector)</B> Rector, Van Swol, Henderson, Molecular Physics, 82, 1009 (1994).
</P>
</HTML>
diff --git a/doc/bond_nonlinear.txt b/doc/bond_nonlinear.txt
index ef5f87b2b..e0cd987b6 100644
--- a/doc/bond_nonlinear.txt
+++ b/doc/bond_nonlinear.txt
@@ -1,78 +1,78 @@
"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
bond_style nonlinear command :h3
bond_style nonlinear/omp command :h3
[Syntax:]
bond_style nonlinear :pre
[Examples:]
bond_style nonlinear
bond_coeff 2 100.0 1.1 1.4 :pre
[Description:]
The {nonlinear} bond style uses the potential
:c,image(Eqs/bond_nonlinear.jpg)
to define an anharmonic spring "(Rector)"_#Rector of equilibrium
length r0 and maximum extension lamda.
The following coefficients must be defined for each bond type via the
"bond_coeff"_bond_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
epsilon (energy)
r0 (distance)
lamda (distance) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"bond_coeff"_bond_coeff.html, "delete_bonds"_delete_bonds.html
[Default:] none
:line
:link(Rector)
[(Rector)] Rector, Van Swol, Henderson, Molecular Physics, 82, 1009 (1994).
diff --git a/doc/bond_quartic.html b/doc/bond_quartic.html
index fddb40aca..fc138a298 100644
--- a/doc/bond_quartic.html
+++ b/doc/bond_quartic.html
@@ -1,118 +1,118 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>bond_style quartic command
</H3>
<H3>bond_style quartic/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>bond_style quartic
</PRE>
<P><B>Examples:</B>
</P>
<PRE>bond_style quartic
bond_coeff 2 1200 -0.55 0.25 1.3 34.6878
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>quartic</I> bond style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/bond_quartic.jpg">
</CENTER>
<P>to define a bond that can be broken as the simulation proceeds (e.g.
due to a polymer being stretched). The sigma and epsilon used in the
LJ portion of the formula are both set equal to 1.0 by LAMMPS.
</P>
<P>The following coefficients must be defined for each bond type via the
<A HREF = "bond_coeff.html">bond_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>K (energy/distance^2)
<LI>B1 (distance)
<LI>B2 (distance)
<LI>Rc (distance)
<LI>U0 (energy)
</UL>
<P>This potential was constructed to mimic the FENE bond potential for
coarse-grained polymer chains. When monomers with sigma = epsilon =
1.0 are used, the following choice of parameters gives a quartic
potential that looks nearly like the FENE potential: K = 1200, B1 =
-0.55, B2 = 0.25, Rc = 1.3, and U0 = 34.6878. Different parameters
can be specified using the <A HREF = "bond_coeff.html">bond_coeff</A> command, but
you will need to choose them carefully so they form a suitable bond
potential.
</P>
<P>Rc is the cutoff length at which the bond potential goes smoothly to a
local maximum. If a bond length ever becomes > Rc, LAMMPS "breaks"
the bond, which means two things. First, the bond potential is turned
off by setting its type to 0, and is no longer computed. Second, a
pairwise interaction between the two atoms is turned on, since they
are no longer bonded.
</P>
<P>LAMMPS does the second task via a computational sleight-of-hand. It
subtracts the pairwise interaction as part of the bond computation.
When the bond breaks, the subtraction stops. For this to work, the
pairwise interaction must always be computed by the
<A HREF = "pair_style.html">pair_style</A> command, whether the bond is broken or
not. This means that <A HREF = "special_bonds.html">special_bonds</A> must be set
to 1,1,1, as indicated as a restriction below.
</P>
<P>Note that when bonds are dumped to a file via the <A HREF = "dump.html">dump
local</A> command, bonds with type 0 are not included. The
<A HREF = "delete_bonds.html">delete_bonds</A> command can also be used to query the
status of broken bonds or permanently delete them, e.g.:
</P>
<PRE>delete_bonds all stats
delete_bonds all bond 0 remove
</PRE>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P>The <I>quartic</I> style requires that <A HREF = "special_bonds.html">special_bonds</A>
parameters be set to 1,1,1. Three- and four-body interactions (angle,
dihedral, etc) cannot be used with <I>quartic</I> bonds.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "bond_coeff.html">bond_coeff</A>, <A HREF = "delete_bonds.html">delete_bonds</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/bond_quartic.txt b/doc/bond_quartic.txt
index d4304f292..b0a7ff4bc 100644
--- a/doc/bond_quartic.txt
+++ b/doc/bond_quartic.txt
@@ -1,112 +1,112 @@
"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
bond_style quartic command :h3
bond_style quartic/omp command :h3
[Syntax:]
bond_style quartic :pre
[Examples:]
bond_style quartic
bond_coeff 2 1200 -0.55 0.25 1.3 34.6878 :pre
[Description:]
The {quartic} bond style uses the potential
:c,image(Eqs/bond_quartic.jpg)
to define a bond that can be broken as the simulation proceeds (e.g.
due to a polymer being stretched). The sigma and epsilon used in the
LJ portion of the formula are both set equal to 1.0 by LAMMPS.
The following coefficients must be defined for each bond type via the
"bond_coeff"_bond_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
K (energy/distance^2)
B1 (distance)
B2 (distance)
Rc (distance)
U0 (energy) :ul
This potential was constructed to mimic the FENE bond potential for
coarse-grained polymer chains. When monomers with sigma = epsilon =
1.0 are used, the following choice of parameters gives a quartic
potential that looks nearly like the FENE potential: K = 1200, B1 =
-0.55, B2 = 0.25, Rc = 1.3, and U0 = 34.6878. Different parameters
can be specified using the "bond_coeff"_bond_coeff.html command, but
you will need to choose them carefully so they form a suitable bond
potential.
Rc is the cutoff length at which the bond potential goes smoothly to a
local maximum. If a bond length ever becomes > Rc, LAMMPS "breaks"
the bond, which means two things. First, the bond potential is turned
off by setting its type to 0, and is no longer computed. Second, a
pairwise interaction between the two atoms is turned on, since they
are no longer bonded.
LAMMPS does the second task via a computational sleight-of-hand. It
subtracts the pairwise interaction as part of the bond computation.
When the bond breaks, the subtraction stops. For this to work, the
pairwise interaction must always be computed by the
"pair_style"_pair_style.html command, whether the bond is broken or
not. This means that "special_bonds"_special_bonds.html must be set
to 1,1,1, as indicated as a restriction below.
Note that when bonds are dumped to a file via the "dump
local"_dump.html command, bonds with type 0 are not included. The
"delete_bonds"_delete_bonds.html command can also be used to query the
status of broken bonds or permanently delete them, e.g.:
delete_bonds all stats
delete_bonds all bond 0 remove :pre
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
The {quartic} style requires that "special_bonds"_special_bonds.html
parameters be set to 1,1,1. Three- and four-body interactions (angle,
dihedral, etc) cannot be used with {quartic} bonds.
[Related commands:]
"bond_coeff"_bond_coeff.html, "delete_bonds"_delete_bonds.html
[Default:] none
diff --git a/doc/bond_table.html b/doc/bond_table.html
index 13ed4a929..d79c4b409 100644
--- a/doc/bond_table.html
+++ b/doc/bond_table.html
@@ -1,159 +1,159 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>bond_style table command
</H3>
<H3>bond_style table/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>bond_style table style N
</PRE>
<UL><LI>style = <I>linear</I> or <I>spline</I> = method of interpolation
<LI>N = use N values in table
</UL>
<P><B>Examples:</B>
</P>
<PRE>bond_style table linear 1000
bond_coeff 1 file.table ENTRY1
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>table</I> creates interpolation tables of length <I>N</I> from bond
potential and force values listed in a file(s) as a function of bond
length. The files are read by the <A HREF = "bond_coeff.html">bond_coeff</A>
command.
</P>
<P>The interpolation tables are created by fitting cubic splines to the
file values and interpolating energy and force values at each of <I>N</I>
distances. During a simulation, these tables are used to interpolate
energy and force values as needed. The interpolation is done in one
of 2 styles: <I>linear</I> or <I>spline</I>.
</P>
<P>For the <I>linear</I> style, the bond length is used to find 2 surrounding
table values from which an energy or force is computed by linear
interpolation.
</P>
<P>For the <I>spline</I> style, a cubic spline coefficients are computed and
stored at each of the <I>N</I> values in the table. The bond length is
used to find the appropriate set of coefficients which are used to
evaluate a cubic polynomial which computes the energy or force.
</P>
<P>The following coefficients must be defined for each bond type via the
<A HREF = "bond_coeff.html">bond_coeff</A> command as in the example above.
</P>
<UL><LI>filename
<LI>keyword
</UL>
<P>The filename specifies a file containing tabulated energy and force
values. The keyword specifies a section of the file. The format of
this file is described below.
</P>
<HR>
<P>The format of a tabulated file is as follows (without the
parenthesized comments):
</P>
<PRE># Bond potential for harmonic (one or more comment or blank lines)
</PRE>
<PRE>HAM (keyword is the first text on line)
N 101 FP 0 0 EQ 0.5 (N, FP, EQ parameters)
(blank line)
1 0.00 338.0000 1352.0000 (index, bond-length, energy, force)
2 0.01 324.6152 1324.9600
...
101 1.00 338.0000 -1352.0000
</PRE>
<P>A section begins with a non-blank line whose 1st character is not a
"#"; blank lines or lines starting with "#" can be used as comments
between sections. The first line begins with a keyword which
identifies the section. The line can contain additional text, but the
initial text must match the argument specified in the
<A HREF = "bond_coeff.html">bond_coeff</A> command. The next line lists (in any
order) one or more parameters for the table. Each parameter is a
keyword followed by one or more numeric values.
</P>
<P>The parameter "N" is required and its value is the number of table
entries that follow. Note that this may be different than the <I>N</I>
specified in the <A HREF = "bond_style.html">bond_style table</A> command. Let
Ntable = <I>N</I> in the bond_style command, and Nfile = "N" in the
tabulated file. What LAMMPS does is a preliminary interpolation by
creating splines using the Nfile tabulated values as nodal points. It
uses these to interpolate as needed to generate energy and force
values at Ntable different points. The resulting tables of length
Ntable are then used as described above, when computing energy and
force for individual bond lengths. This means that if you want the
interpolation tables of length Ntable to match exactly what is in the
tabulated file (with effectively no preliminary interpolation), you
should set Ntable = Nfile.
</P>
<P>The "FP" parameter is optional. If used, it is followed by two values
fplo and fphi, which are the derivatives of the force at the innermost
and outermost bond lengths. These values are needed by the spline
construction routines. If not specified by the "FP" parameter, they
are estimated (less accurately) by the first two and last two force
values in the table.
</P>
<P>The "EQ" parameter is also optional. If used, it is followed by a the
equilibrium bond length, which is used, for example, by the <A HREF = "fix_shake.html">fix
shake</A> command. If not used, the equilibrium bond
length is set to 0.0.
</P>
<P>Following a blank line, the next N lines list the tabulated values.
On each line, the 1st value is the index from 1 to N, the 2nd value is
the bond length r (in distance units), the 3rd value is the energy (in
energy units), and the 4th is the force (in force units). The bond
lengths must range from a LO value to a HI value, and increase from
one line to the next. If the actual bond length is ever smaller than
the LO value or larger than the HI value, then the bond energy and
force is evaluated as if the bond were the LO or HI length.
</P>
<P>Note that one file can contain many sections, each with a tabulated
potential. LAMMPS reads the file section by section until it finds
one that matches the specified keyword.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "bond_coeff.html">bond_coeff</A>, <A HREF = "delete_bonds.html">delete_bonds</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/bond_table.txt b/doc/bond_table.txt
index cc70596bc..be9060d59 100644
--- a/doc/bond_table.txt
+++ b/doc/bond_table.txt
@@ -1,153 +1,153 @@
"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
bond_style table command :h3
bond_style table/omp command :h3
[Syntax:]
bond_style table style N :pre
style = {linear} or {spline} = method of interpolation
N = use N values in table :ul
[Examples:]
bond_style table linear 1000
bond_coeff 1 file.table ENTRY1 :pre
[Description:]
Style {table} creates interpolation tables of length {N} from bond
potential and force values listed in a file(s) as a function of bond
length. The files are read by the "bond_coeff"_bond_coeff.html
command.
The interpolation tables are created by fitting cubic splines to the
file values and interpolating energy and force values at each of {N}
distances. During a simulation, these tables are used to interpolate
energy and force values as needed. The interpolation is done in one
of 2 styles: {linear} or {spline}.
For the {linear} style, the bond length is used to find 2 surrounding
table values from which an energy or force is computed by linear
interpolation.
For the {spline} style, a cubic spline coefficients are computed and
stored at each of the {N} values in the table. The bond length is
used to find the appropriate set of coefficients which are used to
evaluate a cubic polynomial which computes the energy or force.
The following coefficients must be defined for each bond type via the
"bond_coeff"_bond_coeff.html command as in the example above.
filename
keyword :ul
The filename specifies a file containing tabulated energy and force
values. The keyword specifies a section of the file. The format of
this file is described below.
:line
The format of a tabulated file is as follows (without the
parenthesized comments):
# Bond potential for harmonic (one or more comment or blank lines) :pre
HAM (keyword is the first text on line)
N 101 FP 0 0 EQ 0.5 (N, FP, EQ parameters)
(blank line)
1 0.00 338.0000 1352.0000 (index, bond-length, energy, force)
2 0.01 324.6152 1324.9600
...
101 1.00 338.0000 -1352.0000 :pre
A section begins with a non-blank line whose 1st character is not a
"#"; blank lines or lines starting with "#" can be used as comments
between sections. The first line begins with a keyword which
identifies the section. The line can contain additional text, but the
initial text must match the argument specified in the
"bond_coeff"_bond_coeff.html command. The next line lists (in any
order) one or more parameters for the table. Each parameter is a
keyword followed by one or more numeric values.
The parameter "N" is required and its value is the number of table
entries that follow. Note that this may be different than the {N}
specified in the "bond_style table"_bond_style.html command. Let
Ntable = {N} in the bond_style command, and Nfile = "N" in the
tabulated file. What LAMMPS does is a preliminary interpolation by
creating splines using the Nfile tabulated values as nodal points. It
uses these to interpolate as needed to generate energy and force
values at Ntable different points. The resulting tables of length
Ntable are then used as described above, when computing energy and
force for individual bond lengths. This means that if you want the
interpolation tables of length Ntable to match exactly what is in the
tabulated file (with effectively no preliminary interpolation), you
should set Ntable = Nfile.
The "FP" parameter is optional. If used, it is followed by two values
fplo and fphi, which are the derivatives of the force at the innermost
and outermost bond lengths. These values are needed by the spline
construction routines. If not specified by the "FP" parameter, they
are estimated (less accurately) by the first two and last two force
values in the table.
The "EQ" parameter is also optional. If used, it is followed by a the
equilibrium bond length, which is used, for example, by the "fix
shake"_fix_shake.html command. If not used, the equilibrium bond
length is set to 0.0.
Following a blank line, the next N lines list the tabulated values.
On each line, the 1st value is the index from 1 to N, the 2nd value is
the bond length r (in distance units), the 3rd value is the energy (in
energy units), and the 4th is the force (in force units). The bond
lengths must range from a LO value to a HI value, and increase from
one line to the next. If the actual bond length is ever smaller than
the LO value or larger than the HI value, then the bond energy and
force is evaluated as if the bond were the LO or HI length.
Note that one file can contain many sections, each with a tabulated
potential. LAMMPS reads the file section by section until it finds
one that matches the specified keyword.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This bond style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"bond_coeff"_bond_coeff.html, "delete_bonds"_delete_bonds.html
[Default:] none
diff --git a/doc/compute_ackland_atom.html b/doc/compute_ackland_atom.html
index 16ad975e8..d3445f2f5 100644
--- a/doc/compute_ackland_atom.html
+++ b/doc/compute_ackland_atom.html
@@ -1,80 +1,80 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute ackland/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID ackland/atom
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>ackland/atom = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all ackland/atom
</PRE>
<P><B>Description:</B>
</P>
<P>Defines a computation that calculates the local lattice structure
according to the formulation given in <A HREF = "#Ackland">(Ackland)</A>.
</P>
<P>In contrast to the <A HREF = "compute_centro_atom.html">centro-symmetry
parameter</A> this method is stable against
temperature boost, because it is based not on the distance between
particles but the angles. Therefore statistical fluctuations are
averaged out a little more. A comparison with the Common Neighbor
Analysis metric is made in the paper.
</P>
<P>The result is a number which is mapped to the following different
lattice structures:
</P>
<UL><LI>0 = UNKNOWN
<LI>1 = BCC
<LI>2 = FCC
<LI>3 = HCP
<LI>4 = ICO
</UL>
<P>The neighbor list needed to compute this quantity is constructed each
time the calculation is performed (i.e. each time a snapshot of atoms
is dumped). Thus it can be inefficient to compute/dump this quantity
too frequently or to have multiple compute/dump commands, each of
which computes this quantity.-
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-<A HREF = "Section_howto.html#howto_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P><B>Restrictions:</B>
</P>
<P>This compute is part of the USER-MISC package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>The per-atom vector values will be unitless since they are the
integers defined above.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_centro_atom.html">compute centro/atom</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Ackland"></A>
<P><B>(Ackland)</B> Ackland, Jones, Phys Rev B, 73, 054104 (2006).
</P>
</HTML>
diff --git a/doc/compute_ackland_atom.txt b/doc/compute_ackland_atom.txt
index 5a9dcebba..62fa81282 100644
--- a/doc/compute_ackland_atom.txt
+++ b/doc/compute_ackland_atom.txt
@@ -1,74 +1,74 @@
"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
compute ackland/atom command :h3
[Syntax:]
compute ID group-ID ackland/atom :pre
ID, group-ID are documented in "compute"_compute.html command
ackland/atom = style name of this compute command :ul
[Examples:]
compute 1 all ackland/atom :pre
[Description:]
Defines a computation that calculates the local lattice structure
according to the formulation given in "(Ackland)"_#Ackland.
In contrast to the "centro-symmetry
parameter"_compute_centro_atom.html this method is stable against
temperature boost, because it is based not on the distance between
particles but the angles. Therefore statistical fluctuations are
averaged out a little more. A comparison with the Common Neighbor
Analysis metric is made in the paper.
The result is a number which is mapped to the following different
lattice structures:
0 = UNKNOWN
1 = BCC
2 = FCC
3 = HCP
4 = ICO :ul
The neighbor list needed to compute this quantity is constructed each
time the calculation is performed (i.e. each time a snapshot of atoms
is dumped). Thus it can be inefficient to compute/dump this quantity
too frequently or to have multiple compute/dump commands, each of
which computes this quantity.-
[Output info:]
This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-"this section"_Section_howto.html#howto_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
[Restrictions:]
This compute is part of the USER-MISC package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
The per-atom vector values will be unitless since they are the
integers defined above.
[Related commands:]
"compute centro/atom"_compute_centro_atom.html
[Default:] none
:line
:link(Ackland)
[(Ackland)] Ackland, Jones, Phys Rev B, 73, 054104 (2006).
diff --git a/doc/compute_centro_atom.html b/doc/compute_centro_atom.html
index 63c0c2b95..6b3c03710 100644
--- a/doc/compute_centro_atom.html
+++ b/doc/compute_centro_atom.html
@@ -1,126 +1,126 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute centro/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID centro/atom lattice
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>centro/atom = style name of this compute command
<LI>lattice = <I>fcc</I> or <I>bcc</I> or N = # of neighbors per atom to include
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all centro/atom fcc
</PRE>
<PRE>compute 1 all centro/atom 8
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the centro-symmetry parameter for
each atom in the group. In solid-state systems the centro-symmetry
parameter is a useful measure of the local lattice disorder around an
atom and can be used to characterize whether the atom is part of a
perfect lattice, a local defect (e.g. a dislocation or stacking
fault), or at a surface.
</P>
<P>The value of the centro-symmetry parameter will be 0.0 for atoms not
in the specified compute group.
</P>
<P>This parameter is computed using the following formula from
<A HREF = "#Kelchner">(Kelchner)</A>
</P>
<CENTER><IMG SRC = "Eqs/centro_symmetry.jpg">
</CENTER>
<P>where the <I>N</I> nearest neighbors or each atom are identified and Ri and
Ri+N/2 are vectors from the central atom to a particular pair of
nearest neighbors. There are N*(N-1)/2 possible neighbor pairs that
can contribute to this formula. The quantity in the sum is computed
for each, and the N/2 smallest are used. This will typically be for
pairs of atoms in symmetrically opposite positions with respect to the
central atom; hence the i+N/2 notation.
</P>
<P><I>N</I> is an input parameter, which should be set to correspond to the
number of nearest neighbors in the underlying lattice of atoms. If
the keyword <I>fcc</I> or <I>bcc</I> is used, <I>N</I> is set to 12 and 8
respectively. More generally, <I>N</I> can be set to a positive, even
integer.
</P>
<P>For an atom on a lattice site, surrounded by atoms on a perfect
lattice, the centro-symmetry parameter will be 0. It will be near 0
for small thermal perturbations of a perfect lattice. If a point
defect exists, the symmetry is broken, and the parameter will be a
larger positive value. An atom at a surface will have a large
positive parameter. If the atom does not have <I>N</I> neighbors (within
the potential cutoff), then its centro-symmetry parameter is set to
0.0.
</P>
<P>Only atoms within the cutoff of the pairwise neighbor list are
considered as possible neighbors. Atoms not in the compute group are
included in the <I>N</I> neighbors used in this calculation.
</P>
<P>The neighbor list needed to compute this quantity is constructed each
time the calculation is performed (e.g. each time a snapshot of atoms
is dumped). Thus it can be inefficient to compute/dump this quantity
too frequently or to have multiple compute/dump commands, each with a
<I>centro/atom</I> style.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-<A HREF = "Section_howto.html#howto_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The per-atom vector values are unitless values >= 0.0. Their
magnitude depends on the lattice style due to the number of
contibuting neighbor pairs in the summation in the formula above. And
it depends on the local defects surrounding the central atom, as
described above.
</P>
<P>Here are typical centro-symmetry values, from a a nanoindentation
simulation into gold (FCC). These were provided by Jon Zimmerman
(Sandia):
</P>
<PRE>Bulk lattice = 0
Dislocation core ~ 1.0 (0.5 to 1.25)
Stacking faults ~ 5.0 (4.0 to 6.0)
Free surface ~ 23.0
</PRE>
<P>These values are *not* normalized by the square of the lattice
parameter. If they were, normalized values would be:
</P>
<PRE>Bulk lattice = 0
Dislocation core ~ 0.06 (0.03 to 0.075)
Stacking faults ~ 0.3 (0.24 to 0.36)
Free surface ~ 1.38
</PRE>
<P>For BCC materials, the values for dislocation cores and free surfaces
would be somewhat different, due to their being only 8 neighbors instead
of 12.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_cna_atom.html">compute cna/atom</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Kelchner"></A>
<P><B>(Kelchner)</B> Kelchner, Plimpton, Hamilton, Phys Rev B, 58, 11085 (1998).
</P>
</HTML>
diff --git a/doc/compute_centro_atom.txt b/doc/compute_centro_atom.txt
index a5a83a0c3..5a9faf909 100644
--- a/doc/compute_centro_atom.txt
+++ b/doc/compute_centro_atom.txt
@@ -1,119 +1,119 @@
"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
compute centro/atom command :h3
[Syntax:]
compute ID group-ID centro/atom lattice :pre
ID, group-ID are documented in "compute"_compute.html command
centro/atom = style name of this compute command
lattice = {fcc} or {bcc} or N = # of neighbors per atom to include :ul
[Examples:]
compute 1 all centro/atom fcc :pre
compute 1 all centro/atom 8 :pre
[Description:]
Define a computation that calculates the centro-symmetry parameter for
each atom in the group. In solid-state systems the centro-symmetry
parameter is a useful measure of the local lattice disorder around an
atom and can be used to characterize whether the atom is part of a
perfect lattice, a local defect (e.g. a dislocation or stacking
fault), or at a surface.
The value of the centro-symmetry parameter will be 0.0 for atoms not
in the specified compute group.
This parameter is computed using the following formula from
"(Kelchner)"_#Kelchner
:c,image(Eqs/centro_symmetry.jpg)
where the {N} nearest neighbors or each atom are identified and Ri and
Ri+N/2 are vectors from the central atom to a particular pair of
nearest neighbors. There are N*(N-1)/2 possible neighbor pairs that
can contribute to this formula. The quantity in the sum is computed
for each, and the N/2 smallest are used. This will typically be for
pairs of atoms in symmetrically opposite positions with respect to the
central atom; hence the i+N/2 notation.
{N} is an input parameter, which should be set to correspond to the
number of nearest neighbors in the underlying lattice of atoms. If
the keyword {fcc} or {bcc} is used, {N} is set to 12 and 8
respectively. More generally, {N} can be set to a positive, even
integer.
For an atom on a lattice site, surrounded by atoms on a perfect
lattice, the centro-symmetry parameter will be 0. It will be near 0
for small thermal perturbations of a perfect lattice. If a point
defect exists, the symmetry is broken, and the parameter will be a
larger positive value. An atom at a surface will have a large
positive parameter. If the atom does not have {N} neighbors (within
the potential cutoff), then its centro-symmetry parameter is set to
0.0.
Only atoms within the cutoff of the pairwise neighbor list are
considered as possible neighbors. Atoms not in the compute group are
included in the {N} neighbors used in this calculation.
The neighbor list needed to compute this quantity is constructed each
time the calculation is performed (e.g. each time a snapshot of atoms
is dumped). Thus it can be inefficient to compute/dump this quantity
too frequently or to have multiple compute/dump commands, each with a
{centro/atom} style.
[Output info:]
This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-"this section"_Section_howto.html#howto_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The per-atom vector values are unitless values >= 0.0. Their
magnitude depends on the lattice style due to the number of
contibuting neighbor pairs in the summation in the formula above. And
it depends on the local defects surrounding the central atom, as
described above.
Here are typical centro-symmetry values, from a a nanoindentation
simulation into gold (FCC). These were provided by Jon Zimmerman
(Sandia):
Bulk lattice = 0
Dislocation core ~ 1.0 (0.5 to 1.25)
Stacking faults ~ 5.0 (4.0 to 6.0)
Free surface ~ 23.0 :pre
These values are *not* normalized by the square of the lattice
parameter. If they were, normalized values would be:
Bulk lattice = 0
Dislocation core ~ 0.06 (0.03 to 0.075)
Stacking faults ~ 0.3 (0.24 to 0.36)
Free surface ~ 1.38 :pre
For BCC materials, the values for dislocation cores and free surfaces
would be somewhat different, due to their being only 8 neighbors instead
of 12.
[Restrictions:] none
[Related commands:]
"compute cna/atom"_compute_cna_atom.html
[Default:] none
:line
:link(Kelchner)
[(Kelchner)] Kelchner, Plimpton, Hamilton, Phys Rev B, 58, 11085 (1998).
diff --git a/doc/compute_cluster_atom.html b/doc/compute_cluster_atom.html
index b2f7b49fd..f972d2fae 100644
--- a/doc/compute_cluster_atom.html
+++ b/doc/compute_cluster_atom.html
@@ -1,62 +1,62 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute cluster/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID cluster/atom cutoff
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>cluster/atom = style name of this compute command
<LI>cutoff = distance within which to label atoms as part of same cluster (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all cluster/atom 1.0
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that assigns each atom a cluster ID.
</P>
<P>A cluster is defined as a set of atoms, each of which is within the
cutoff distance from one or more other atoms in the cluster. If an
atom has no neighbors within the cutoff distance, then it is a 1-atom
cluster. The ID of every atom in the cluster will be the smallest
atom ID of any atom in the cluster.
</P>
<P>Only atoms in the compute group are clustered and assigned cluster
IDs. Atoms not in the compute group are assigned a cluster ID = 0.
</P>
<P>The neighbor list needed to compute this quantity is constructed each
time the calculation is performed (i.e. each time a snapshot of atoms
is dumped). Thus it can be inefficient to compute/dump this quantity
too frequently or to have multiple compute/dump commands, each of a
<I>clsuter/atom</I> style.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-<A HREF = "Section_howto.html#howto_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The per-atom vector values will be an ID > 0, as explained above.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_coord_atom.html">compute coord/atom</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_cluster_atom.txt b/doc/compute_cluster_atom.txt
index 3193331f9..eb4ba3294 100644
--- a/doc/compute_cluster_atom.txt
+++ b/doc/compute_cluster_atom.txt
@@ -1,57 +1,57 @@
"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
compute cluster/atom command :h3
[Syntax:]
compute ID group-ID cluster/atom cutoff :pre
ID, group-ID are documented in "compute"_compute.html command
cluster/atom = style name of this compute command
cutoff = distance within which to label atoms as part of same cluster (distance units) :ul
[Examples:]
compute 1 all cluster/atom 1.0 :pre
[Description:]
Define a computation that assigns each atom a cluster ID.
A cluster is defined as a set of atoms, each of which is within the
cutoff distance from one or more other atoms in the cluster. If an
atom has no neighbors within the cutoff distance, then it is a 1-atom
cluster. The ID of every atom in the cluster will be the smallest
atom ID of any atom in the cluster.
Only atoms in the compute group are clustered and assigned cluster
IDs. Atoms not in the compute group are assigned a cluster ID = 0.
The neighbor list needed to compute this quantity is constructed each
time the calculation is performed (i.e. each time a snapshot of atoms
is dumped). Thus it can be inefficient to compute/dump this quantity
too frequently or to have multiple compute/dump commands, each of a
{clsuter/atom} style.
[Output info:]
This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-"this section"_Section_howto.html#howto_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The per-atom vector values will be an ID > 0, as explained above.
[Restrictions:] none
[Related commands:]
"compute coord/atom"_compute_coord_atom.html
[Default:] none
diff --git a/doc/compute_cna_atom.html b/doc/compute_cna_atom.html
index 7549fa7c6..191b8911c 100644
--- a/doc/compute_cna_atom.html
+++ b/doc/compute_cna_atom.html
@@ -1,104 +1,104 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute cna/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID cna/atom cutoff
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>cna/atom = style name of this compute command
<LI>cutoff = cutoff distance for nearest neighbors (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all cna/atom 3.08
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the CNA (Common Neighbor
Analysis) pattern for each atom in the group. In solid-state systems
the CNA pattern is a useful measure of the local crystal structure
around an atom. The CNA methodology is described in <A HREF = "#Faken">(Faken)</A>
and <A HREF = "#Tsuzuki">(Tsuzuki)</A>.
</P>
<P>Currently, there are five kinds of CNA patterns LAMMPS recognizes:
</P>
<UL><LI>fcc = 1
<LI>hcp = 2
<LI>bcc = 3
<LI>icosohedral = 4
<LI>unknown = 5
</UL>
<P>The value of the CNA pattern will be 0 for atoms not in the specified
compute group. Note that normally a CNA calculation should only be
performed on mono-component systems.
</P>
<P>The CNA calculation can be sensitive to the specified cutoff value.
You should insure the appropriate nearest neighbors of an atom are
found within the cutoff distance for the presumed crystal strucure.
E.g. 12 nearest neighbor for perfect FCC and HCP crystals, 14 nearest
neighbors for perfect BCC crystals. These formulas can be used to
obtain a good cutoff distance:
</P>
<CENTER><IMG SRC = "Eqs/cna_cutoff1.jpg">
</CENTER>
<P>where a is the lattice constant for the crystal structure concerned
and in the HCP case, x = (c/a) / 1.633, where 1.633 is the ideal c/a
for HCP crystals.
</P>
<P>Also note that since the CNA calculation in LAMMPS uses the neighbors
of an owned atom to find the nearest neighbors of a ghost atom, the
following relation should also be satisfied:
</P>
<CENTER><IMG SRC = "Eqs/cna_cutoff2.jpg">
</CENTER>
<P>where Rc is the cutoff distance of the potential, Rs is the skin
distance as specified by the <A HREF = "neighbor.html">neighbor</A> command, and
cutoff is the argument used with the compute cna/atom command. LAMMPS
will issue a warning if this is not the case.
</P>
<P>The neighbor list needed to compute this quantity is constructed each
time the calculation is performed (e.g. each time a snapshot of atoms
is dumped). Thus it can be inefficient to compute/dump this quantity
too frequently or to have multiple compute/dump commands, each with a
<I>cna/atom</I> style.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-<A HREF = "Section_howto.html#howto_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The per-atom vector values will be a number from 0 to 5, as explained
above.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_centro_atom.html">compute centro/atom</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Faken"></A>
<P><B>(Faken)</B> Faken, Jonsson, Comput Mater Sci, 2, 279 (1994).
</P>
<A NAME = "Tsuzuki"></A>
<P><B>(Tsuzuki)</B> Tsuzuki, Branicio, Rino, Comput Phys Comm, 177, 518 (2007).
</P>
</HTML>
diff --git a/doc/compute_cna_atom.txt b/doc/compute_cna_atom.txt
index 63afcf9a8..7aafcaf80 100644
--- a/doc/compute_cna_atom.txt
+++ b/doc/compute_cna_atom.txt
@@ -1,97 +1,97 @@
"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
compute cna/atom command :h3
[Syntax:]
compute ID group-ID cna/atom cutoff :pre
ID, group-ID are documented in "compute"_compute.html command
cna/atom = style name of this compute command
cutoff = cutoff distance for nearest neighbors (distance units) :ul
[Examples:]
compute 1 all cna/atom 3.08 :pre
[Description:]
Define a computation that calculates the CNA (Common Neighbor
Analysis) pattern for each atom in the group. In solid-state systems
the CNA pattern is a useful measure of the local crystal structure
around an atom. The CNA methodology is described in "(Faken)"_#Faken
and "(Tsuzuki)"_#Tsuzuki.
Currently, there are five kinds of CNA patterns LAMMPS recognizes:
fcc = 1
hcp = 2
bcc = 3
icosohedral = 4
unknown = 5 :ul
The value of the CNA pattern will be 0 for atoms not in the specified
compute group. Note that normally a CNA calculation should only be
performed on mono-component systems.
The CNA calculation can be sensitive to the specified cutoff value.
You should insure the appropriate nearest neighbors of an atom are
found within the cutoff distance for the presumed crystal strucure.
E.g. 12 nearest neighbor for perfect FCC and HCP crystals, 14 nearest
neighbors for perfect BCC crystals. These formulas can be used to
obtain a good cutoff distance:
:c,image(Eqs/cna_cutoff1.jpg)
where a is the lattice constant for the crystal structure concerned
and in the HCP case, x = (c/a) / 1.633, where 1.633 is the ideal c/a
for HCP crystals.
Also note that since the CNA calculation in LAMMPS uses the neighbors
of an owned atom to find the nearest neighbors of a ghost atom, the
following relation should also be satisfied:
:c,image(Eqs/cna_cutoff2.jpg)
where Rc is the cutoff distance of the potential, Rs is the skin
distance as specified by the "neighbor"_neighbor.html command, and
cutoff is the argument used with the compute cna/atom command. LAMMPS
will issue a warning if this is not the case.
The neighbor list needed to compute this quantity is constructed each
time the calculation is performed (e.g. each time a snapshot of atoms
is dumped). Thus it can be inefficient to compute/dump this quantity
too frequently or to have multiple compute/dump commands, each with a
{cna/atom} style.
[Output info:]
This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-"this section"_Section_howto.html#howto_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The per-atom vector values will be a number from 0 to 5, as explained
above.
[Restrictions:] none
[Related commands:]
"compute centro/atom"_compute_centro_atom.html
[Default:] none
:line
:link(Faken)
[(Faken)] Faken, Jonsson, Comput Mater Sci, 2, 279 (1994).
:link(Tsuzuki)
[(Tsuzuki)] Tsuzuki, Branicio, Rino, Comput Phys Comm, 177, 518 (2007).
diff --git a/doc/compute_com_molecule.html b/doc/compute_com_molecule.html
index 957b3feca..c5337ec44 100644
--- a/doc/compute_com_molecule.html
+++ b/doc/compute_com_molecule.html
@@ -1,81 +1,81 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute com/molecule command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID com/molecule
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>com/molecule = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 fluid com/molecule
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the center-of-mass of individual
molecules. The calculation includes all effects due to atoms passing
thru periodic boundaries.
</P>
<P>The x,y,z coordinates of the center-of-mass for a particular molecule
are only computed if one or more of its atoms are in the specified
group. Normally all atoms in the molecule should be in the group,
however this is not required. LAMMPS will warn you if this is not the
case. Only atoms in the group contribute to the center-of-mass
calculation for the molecule.
</P>
<P>The ordering of per-molecule quantities produced by this compute is
consistent with the ordering produced by other compute commands that
generate per-molecule datums. Conceptually, them molecule IDs will be
in ascending order for any molecule with one or more of its atoms in
the specified group.
</P>
<P>IMPORTANT NOTE: The coordinates of an atom contribute to the
molecule's center-of-mass in "unwrapped" form, by using the image
flags associated with each atom. See the <A HREF = "dump.html">dump custom</A>
command for a discussion of "unwrapped" coordinates. See the Atoms
section of the <A HREF = "read_data.html">read_data</A> command for a discussion of
image flags and how they are set for each atom. You can reset the
image flags (e.g. to 0) before invoking this compute by using the <A HREF = "set.html">set
image</A> command.
</P>
<P>IMPORTANT NOTE: If an atom is part of a rigid body (see the <A HREF = "fix_rigid.html">fix
rigid</A> command), it's periodic image flags are altered,
and its contribution to the center-of-mass may not reflect its true
contribution. See the <A HREF = "fix_rigid.html">fix rigid</A> command for details.
Thus, to compute the center-of-mass of rigid bodies as they cross
periodic boundaries, you will need to post-process a <A HREF = "dump.html">dump
file</A> containing coordinates of the atoms in the bodies.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global array where the number of rows =
Nmolecules and the number of columns = 3 for the x,y,z center-of-mass
coordinates of each molecule. These values can be accessed by any
command that uses global array values from a compute as input. See
-<A HREF = "Section_howto.html#howto_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The array values are "intensive". The array values will be in
distance <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_com.html">compute com</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_com_molecule.txt b/doc/compute_com_molecule.txt
index accfd389c..29ef45413 100644
--- a/doc/compute_com_molecule.txt
+++ b/doc/compute_com_molecule.txt
@@ -1,76 +1,76 @@
"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
compute com/molecule command :h3
[Syntax:]
compute ID group-ID com/molecule :pre
ID, group-ID are documented in "compute"_compute.html command
com/molecule = style name of this compute command :ul
[Examples:]
compute 1 fluid com/molecule :pre
[Description:]
Define a computation that calculates the center-of-mass of individual
molecules. The calculation includes all effects due to atoms passing
thru periodic boundaries.
The x,y,z coordinates of the center-of-mass for a particular molecule
are only computed if one or more of its atoms are in the specified
group. Normally all atoms in the molecule should be in the group,
however this is not required. LAMMPS will warn you if this is not the
case. Only atoms in the group contribute to the center-of-mass
calculation for the molecule.
The ordering of per-molecule quantities produced by this compute is
consistent with the ordering produced by other compute commands that
generate per-molecule datums. Conceptually, them molecule IDs will be
in ascending order for any molecule with one or more of its atoms in
the specified group.
IMPORTANT NOTE: The coordinates of an atom contribute to the
molecule's center-of-mass in "unwrapped" form, by using the image
flags associated with each atom. See the "dump custom"_dump.html
command for a discussion of "unwrapped" coordinates. See the Atoms
section of the "read_data"_read_data.html command for a discussion of
image flags and how they are set for each atom. You can reset the
image flags (e.g. to 0) before invoking this compute by using the "set
image"_set.html command.
IMPORTANT NOTE: If an atom is part of a rigid body (see the "fix
rigid"_fix_rigid.html command), it's periodic image flags are altered,
and its contribution to the center-of-mass may not reflect its true
contribution. See the "fix rigid"_fix_rigid.html command for details.
Thus, to compute the center-of-mass of rigid bodies as they cross
periodic boundaries, you will need to post-process a "dump
file"_dump.html containing coordinates of the atoms in the bodies.
[Output info:]
This compute calculates a global array where the number of rows =
Nmolecules and the number of columns = 3 for the x,y,z center-of-mass
coordinates of each molecule. These values can be accessed by any
command that uses global array values from a compute as input. See
-"this section"_Section_howto.html#howto_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The array values are "intensive". The array values will be in
distance "units"_units.html.
[Restrictions:] none
[Related commands:]
"compute com"_compute_com.html
[Default:] none
diff --git a/doc/compute_coord_atom.html b/doc/compute_coord_atom.html
index 57738b4f3..bd4c55d2c 100644
--- a/doc/compute_coord_atom.html
+++ b/doc/compute_coord_atom.html
@@ -1,63 +1,63 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute coord/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID coord/atom cutoff
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>coord/atom = style name of this compute command
<LI>cutoff = distance within which to count coordination neighbors (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all coord/atom 2.0
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the coordination number for each
atom in a group.
</P>
<P>The value of the coordination number will be 0.0 for atoms not in the
specified compute group.
</P>
<P>The coordination number is defined as the number of neighbor atoms
within the specified cutoff distance from the central atom. Atoms not
in the group are included in the coordination number of atoms in the
group.
</P>
<P>The neighbor list needed to compute this quantity is constructed each
time the calculation is performed (i.e. each time a snapshot of atoms
is dumped). Thus it can be inefficient to compute/dump this quantity
too frequently or to have multiple compute/dump commands, each of a
<I>coord/atom</I> style.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-<A HREF = "Section_howto.html#howto_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The per-atom vector values will be a number >= 0.0, as explained
above.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_cluster_atom.html">compute cluster/atom</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_coord_atom.txt b/doc/compute_coord_atom.txt
index fc5f2c900..5fdbd9106 100644
--- a/doc/compute_coord_atom.txt
+++ b/doc/compute_coord_atom.txt
@@ -1,58 +1,58 @@
"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
compute coord/atom command :h3
[Syntax:]
compute ID group-ID coord/atom cutoff :pre
ID, group-ID are documented in "compute"_compute.html command
coord/atom = style name of this compute command
cutoff = distance within which to count coordination neighbors (distance units) :ul
[Examples:]
compute 1 all coord/atom 2.0 :pre
[Description:]
Define a computation that calculates the coordination number for each
atom in a group.
The value of the coordination number will be 0.0 for atoms not in the
specified compute group.
The coordination number is defined as the number of neighbor atoms
within the specified cutoff distance from the central atom. Atoms not
in the group are included in the coordination number of atoms in the
group.
The neighbor list needed to compute this quantity is constructed each
time the calculation is performed (i.e. each time a snapshot of atoms
is dumped). Thus it can be inefficient to compute/dump this quantity
too frequently or to have multiple compute/dump commands, each of a
{coord/atom} style.
[Output info:]
This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-"this section"_Section_howto.html#howto_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The per-atom vector values will be a number >= 0.0, as explained
above.
[Restrictions:] none
[Related commands:]
"compute cluster/atom"_compute_cluster_atom.html
[Default:] none
diff --git a/doc/compute_damage_atom.html b/doc/compute_damage_atom.html
index b5e0d03d8..0d0e378f5 100644
--- a/doc/compute_damage_atom.html
+++ b/doc/compute_damage_atom.html
@@ -1,58 +1,58 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute damage/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID damage/atom
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>damage/atom = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all damage/atom
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the per-atom damage for each atom
in a group. Please see the <A HREF = "http://www.sandia.gov/~mlparks/papers/PDLAMMPS.pdf">PDLAMMPS user
guide</A> for a formal
definition of "damage" and more details about Peridynamics as it is
implemented in LAMMPS.
</P>
<P>The value of the damage will be 0.0 for atoms not in the specified
compute group.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-<A HREF = "Section_howto.html#howto_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The per-atom vector values will be a number >= 0.0, as explained
above.
</P>
<P><B>Restrictions:</B>
</P>
<P>This compute is part of the PERI package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dump.html">dump custom</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_damage_atom.txt b/doc/compute_damage_atom.txt
index 104cf22b5..3c640d61e 100644
--- a/doc/compute_damage_atom.txt
+++ b/doc/compute_damage_atom.txt
@@ -1,53 +1,53 @@
"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
compute damage/atom command :h3
[Syntax:]
compute ID group-ID damage/atom :pre
ID, group-ID are documented in "compute"_compute.html command
damage/atom = style name of this compute command :ul
[Examples:]
compute 1 all damage/atom :pre
[Description:]
Define a computation that calculates the per-atom damage for each atom
in a group. Please see the "PDLAMMPS user
guide"_http://www.sandia.gov/~mlparks/papers/PDLAMMPS.pdf for a formal
definition of "damage" and more details about Peridynamics as it is
implemented in LAMMPS.
The value of the damage will be 0.0 for atoms not in the specified
compute group.
[Output info:]
This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-"this section"_Section_howto.html#howto_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The per-atom vector values will be a number >= 0.0, as explained
above.
[Restrictions:]
This compute is part of the PERI package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"dump custom"_dump.html
[Default:] none
diff --git a/doc/compute_displace_atom.html b/doc/compute_displace_atom.html
index 79dae1562..2070d896a 100644
--- a/doc/compute_displace_atom.html
+++ b/doc/compute_displace_atom.html
@@ -1,93 +1,94 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute displace/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID displace/atom
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>displace/atom = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all displace/atom
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the current displacement of each
atom in the group from its original coordinates, including all effects
due to atoms passing thru periodic boundaries.
</P>
<P>A vector of four quantites per atom is calculated by this compute.
The first 3 elements of the vector are the dx,dy,dz displacements.
The 4th component is the total displacement, i.e. sqrt(dx*dx + dy*dy +
dz*dz).
</P>
<P>The displacement of an atom is from its original position at the time
the compute command was issued. To store the original coordinates,
the compute creates its own fix of style "store/state", as if this
command had been issued:
</P>
<PRE>fix compute-ID_store_state group-ID store/state xu yu zu
</PRE>
<P>See the <A HREF = "fix_store_state.html">fix store/state</A> command for details.
Note that the ID of the new fix is the compute-ID + underscore +
"store/state", and the group for the new fix is the same as the
compute group.
</P>
<P>The value of the displacement will be 0.0 for atoms not in the
specified compute group.
</P>
<P>IMPORTANT NOTE: Fix store/state stores the initial coordinates in
"unwrapped" form, by using the image flags associated with each atom.
See the <A HREF = "dump.html">dump custom</A> command for a discussion of
"unwrapped" coordinates. See the Atoms section of the
<A HREF = "read_data.html">read_data</A> command for a discussion of image flags and
how they are set for each atom. You can reset the image flags
(e.g. to 0) before invoking this compute by using the <A HREF = "set.html">set
image</A> command.
</P>
<P>IMPORTANT NOTE: If an atom is part of a rigid body (see the <A HREF = "fix_rigid.html">fix
rigid</A> command), it's periodic image flags are altered,
and the computed displacement may not reflect its true displacement.
See the <A HREF = "fix_rigid.html">fix rigid</A> command for details. Thus, to
compute the displacement of rigid bodies as they cross periodic
boundaries, you will need to post-process a <A HREF = "dump.html">dump file</A>
containing coordinates of the atoms in the bodies.
</P>
<P>IMPORTANT NOTE: If you want the quantities calculated by this compute
to be continuous when running from a <A HREF = "read_restart.html">restart file</A>,
then you should use the same ID for this compute, as in the original
run. This is so that the created fix will also have the same ID, and
thus be initialized correctly with atom coordinates from the restart
file.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom array with 4 columns, which can be
accessed by indices 1-4 by any command that uses per-atom values from
-a compute as input. See <A HREF = "Section_howto.html#howto_15">this section</A>
-for an overview of LAMMPS output options.
+a compute as input. See <A HREF = "Section_howto.html#howto_15">Section_howto
+15</A> for an overview of LAMMPS output
+options.
</P>
<P>The per-atom array values will be in distance <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_msd.html">compute msd</A>, <A HREF = "dump.html">dump custom</A>, <A HREF = "fix_store_state.html">fix
store/state</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_displace_atom.txt b/doc/compute_displace_atom.txt
index ecbdf22b3..5b7363db9 100644
--- a/doc/compute_displace_atom.txt
+++ b/doc/compute_displace_atom.txt
@@ -1,88 +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
compute displace/atom command :h3
[Syntax:]
compute ID group-ID displace/atom :pre
ID, group-ID are documented in "compute"_compute.html command
displace/atom = style name of this compute command :ul
[Examples:]
compute 1 all displace/atom :pre
[Description:]
Define a computation that calculates the current displacement of each
atom in the group from its original coordinates, including all effects
due to atoms passing thru periodic boundaries.
A vector of four quantites per atom is calculated by this compute.
The first 3 elements of the vector are the dx,dy,dz displacements.
The 4th component is the total displacement, i.e. sqrt(dx*dx + dy*dy +
dz*dz).
The displacement of an atom is from its original position at the time
the compute command was issued. To store the original coordinates,
the compute creates its own fix of style "store/state", as if this
command had been issued:
fix compute-ID_store_state group-ID store/state xu yu zu :pre
See the "fix store/state"_fix_store_state.html command for details.
Note that the ID of the new fix is the compute-ID + underscore +
"store/state", and the group for the new fix is the same as the
compute group.
The value of the displacement will be 0.0 for atoms not in the
specified compute group.
IMPORTANT NOTE: Fix store/state stores the initial coordinates in
"unwrapped" form, by using the image flags associated with each atom.
See the "dump custom"_dump.html command for a discussion of
"unwrapped" coordinates. See the Atoms section of the
"read_data"_read_data.html command for a discussion of image flags and
how they are set for each atom. You can reset the image flags
(e.g. to 0) before invoking this compute by using the "set
image"_set.html command.
IMPORTANT NOTE: If an atom is part of a rigid body (see the "fix
rigid"_fix_rigid.html command), it's periodic image flags are altered,
and the computed displacement may not reflect its true displacement.
See the "fix rigid"_fix_rigid.html command for details. Thus, to
compute the displacement of rigid bodies as they cross periodic
boundaries, you will need to post-process a "dump file"_dump.html
containing coordinates of the atoms in the bodies.
IMPORTANT NOTE: If you want the quantities calculated by this compute
to be continuous when running from a "restart file"_read_restart.html,
then you should use the same ID for this compute, as in the original
run. This is so that the created fix will also have the same ID, and
thus be initialized correctly with atom coordinates from the restart
file.
[Output info:]
This compute calculates a per-atom array with 4 columns, which can be
accessed by indices 1-4 by any command that uses per-atom values from
-a compute as input. See "this section"_Section_howto.html#howto_15
-for an overview of LAMMPS output options.
+a compute as input. See "Section_howto
+15"_Section_howto.html#howto_15 for an overview of LAMMPS output
+options.
The per-atom array values will be in distance "units"_units.html.
[Restrictions:] none
[Related commands:]
"compute msd"_compute_msd.html, "dump custom"_dump.html, "fix
store/state"_fix_store_state.html
[Default:] none
diff --git a/doc/compute_erotate_asphere.html b/doc/compute_erotate_asphere.html
index 161aef27c..8ea9a4e1d 100644
--- a/doc/compute_erotate_asphere.html
+++ b/doc/compute_erotate_asphere.html
@@ -1,75 +1,75 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute erotate/asphere command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID erotate/asphere
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>erotate/asphere = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all erotate/asphere
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the rotational kinetic energy of
a group of aspherical particles. The aspherical particles can be
ellipsoids, or line segments, or triangles. See the
<A HREF = "atom_style.html">atom_style</A> and <A HREF = "read_data.html">read_data</A> commands
for descriptions of these options.
</P>
<P>For all 3 types of particles, the rotational kinetic energy is
computed as 1/2 I w^2, where I is the inertia tensor for the
aspherical particle and w is its angular velocity, which is computed
from its angular momentum if needed.
</P>
<P>IMPORTANT NOTE: For <A HREF = "dimension.html">2d models</A>, ellipsoidal particles
are treated as ellipsoids, not ellipses, meaning their moments of
inertia will be the same as in 3d.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar (the KE). This value can be
used by any command that uses a global scalar value from a compute as
-input. See <A HREF = "Section_howto.html#howto_15">this section</A> for an overview
-of LAMMPS output options.
+input. See <A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an
+overview of LAMMPS output options.
</P>
<P>The scalar value calculated by this compute is "extensive". The
scalar value will be in energy <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This compute requires that ellipsoidal particles atoms store a shape
and quaternion orientation and angular momentum as defined by the
<A HREF = "atom_style.html">atom_style ellipsoid</A> command.
</P>
<P>This compute requires that line segment particles atoms store a length
and orientation and angular velocity as defined by the <A HREF = "atom_style.html">atom_style
line</A> command.
</P>
<P>This compute requires that triangular particles atoms store a size and
shape and quaternion orientation and angular momentum as defined by
the <A HREF = "atom_style.html">atom_style tri</A> command.
</P>
<P>All particles in the group must be finite-size. They cannot be point
particles.
</P>
<P><B>Related commands:</B> none
</P>
<P><A HREF = "compute_erotate_sphere.html">compute erotate/sphere</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_erotate_asphere.txt b/doc/compute_erotate_asphere.txt
index 39aded0ed..a6a14cfa0 100644
--- a/doc/compute_erotate_asphere.txt
+++ b/doc/compute_erotate_asphere.txt
@@ -1,70 +1,70 @@
"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
compute erotate/asphere command :h3
[Syntax:]
compute ID group-ID erotate/asphere :pre
ID, group-ID are documented in "compute"_compute.html command
erotate/asphere = style name of this compute command :ul
[Examples:]
compute 1 all erotate/asphere :pre
[Description:]
Define a computation that calculates the rotational kinetic energy of
a group of aspherical particles. The aspherical particles can be
ellipsoids, or line segments, or triangles. See the
"atom_style"_atom_style.html and "read_data"_read_data.html commands
for descriptions of these options.
For all 3 types of particles, the rotational kinetic energy is
computed as 1/2 I w^2, where I is the inertia tensor for the
aspherical particle and w is its angular velocity, which is computed
from its angular momentum if needed.
IMPORTANT NOTE: For "2d models"_dimension.html, ellipsoidal particles
are treated as ellipsoids, not ellipses, meaning their moments of
inertia will be the same as in 3d.
[Output info:]
This compute calculates a global scalar (the KE). This value can be
used by any command that uses a global scalar value from a compute as
-input. See "this section"_Section_howto.html#howto_15 for an overview
-of LAMMPS output options.
+input. See "Section_howto 15"_Section_howto.html#howto_15 for an
+overview of LAMMPS output options.
The scalar value calculated by this compute is "extensive". The
scalar value will be in energy "units"_units.html.
[Restrictions:]
This compute requires that ellipsoidal particles atoms store a shape
and quaternion orientation and angular momentum as defined by the
"atom_style ellipsoid"_atom_style.html command.
This compute requires that line segment particles atoms store a length
and orientation and angular velocity as defined by the "atom_style
line"_atom_style.html command.
This compute requires that triangular particles atoms store a size and
shape and quaternion orientation and angular momentum as defined by
the "atom_style tri"_atom_style.html command.
All particles in the group must be finite-size. They cannot be point
particles.
[Related commands:] none
"compute erotate/sphere"_compute_erotate_sphere.html
[Default:] none
diff --git a/doc/compute_erotate_sphere.html b/doc/compute_erotate_sphere.html
index d9e328364..eb6662b13 100644
--- a/doc/compute_erotate_sphere.html
+++ b/doc/compute_erotate_sphere.html
@@ -1,62 +1,62 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute erotate/sphere command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID erotate/sphere
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>erotate/sphere = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all erotate/sphere
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the rotational kinetic energy of
a group of spherical particles.
</P>
<P>The rotational energy is computed as 1/2 I w^2, where I is the moment
of inertia for a sphere and w is the particle's angular velocity.
</P>
<P>IMPORTANT NOTE: For <A HREF = "dimension.html">2d models</A>, particles are treated
as spheres, not disks, meaning their moment of inertia will be the
same as in 3d.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar (the KE). This value can be
used by any command that uses a global scalar value from a compute as
-input. See <A HREF = "Section_howto.html#howto_15">this section</A> for an overview
-of LAMMPS output options.
+input. See <A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an
+overview of LAMMPS output options.
</P>
<P>The scalar value calculated by this compute is "extensive". The
scalar value will be in energy <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This compute requires that atoms store a radius and angular velocity
(omega) as defined by the <A HREF = "atom_style.html">atom_style sphere</A> command.
</P>
<P>All particles in the group must be finite-size spheres or point
particles. They cannot be aspherical. Point particles will not
contribute to the rotational energy.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_erotate_asphere.html">compute erotate/asphere</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_erotate_sphere.txt b/doc/compute_erotate_sphere.txt
index 7e480a281..eaf2eede1 100644
--- a/doc/compute_erotate_sphere.txt
+++ b/doc/compute_erotate_sphere.txt
@@ -1,57 +1,57 @@
"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
compute erotate/sphere command :h3
[Syntax:]
compute ID group-ID erotate/sphere :pre
ID, group-ID are documented in "compute"_compute.html command
erotate/sphere = style name of this compute command :ul
[Examples:]
compute 1 all erotate/sphere :pre
[Description:]
Define a computation that calculates the rotational kinetic energy of
a group of spherical particles.
The rotational energy is computed as 1/2 I w^2, where I is the moment
of inertia for a sphere and w is the particle's angular velocity.
IMPORTANT NOTE: For "2d models"_dimension.html, particles are treated
as spheres, not disks, meaning their moment of inertia will be the
same as in 3d.
[Output info:]
This compute calculates a global scalar (the KE). This value can be
used by any command that uses a global scalar value from a compute as
-input. See "this section"_Section_howto.html#howto_15 for an overview
-of LAMMPS output options.
+input. See "Section_howto 15"_Section_howto.html#howto_15 for an
+overview of LAMMPS output options.
The scalar value calculated by this compute is "extensive". The
scalar value will be in energy "units"_units.html.
[Restrictions:]
This compute requires that atoms store a radius and angular velocity
(omega) as defined by the "atom_style sphere"_atom_style.html command.
All particles in the group must be finite-size spheres or point
particles. They cannot be aspherical. Point particles will not
contribute to the rotational energy.
[Related commands:]
"compute erotate/asphere"_compute_erotate_asphere.html
[Default:] none
diff --git a/doc/compute_event_displace.html b/doc/compute_event_displace.html
index ae63a96bb..8efff145a 100644
--- a/doc/compute_event_displace.html
+++ b/doc/compute_event_displace.html
@@ -1,67 +1,67 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute event/displace command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID event/displace threshold
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>event/displace = style name of this compute command
<LI>threshold = minimum distance anyparticle must move to trigger an event (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all event/displace 0.5
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that flags an "event" if any particle in the
group has moved a distance greater than the specified threshold
distance when compared to a previously stored reference state
(i.e. the previous event). This compute is typically used in
conjunction with the <A HREF = "prd.html">prd</A> and <A HREF = "tad.html">tad</A> commands,
to detect if a transition
to a new minimum energy basin has occurred.
</P>
<P>This value calculated by the compute is equal to 0 if no particle has
moved far enough, and equal to 1 if one or more particles have moved
further than the threshold distance.
</P>
<P>NOTE: If the system is undergoing significant center-of-mass motion,
due to thermal motion, an external force, or an initial net momentum,
then this compute will not be able to distinguish that motion from
local atom displacements and may generate "false postives."
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar (the flag). This value can be
used by any command that uses a global scalar value from a compute as
-input. See <A HREF = "Section_howto.html#howto_15">this section</A> for an overview
-of LAMMPS output options.
+input. See <A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an
+overview of LAMMPS output options.
</P>
<P>The scalar value calculated by this compute is "intensive". The
scalar value will be a 0 or 1 as explained above.
</P>
<P><B>Restrictions:</B>
</P>
<P>This command can only be used if LAMMPS was built with the REPLICA
package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "prd.html">prd</A>, <A HREF = "tad.html">tad</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_event_displace.txt b/doc/compute_event_displace.txt
index 7b26d3120..4d638c74f 100644
--- a/doc/compute_event_displace.txt
+++ b/doc/compute_event_displace.txt
@@ -1,62 +1,62 @@
"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
compute event/displace command :h3
[Syntax:]
compute ID group-ID event/displace threshold :pre
ID, group-ID are documented in "compute"_compute.html command
event/displace = style name of this compute command
threshold = minimum distance anyparticle must move to trigger an event (distance units) :ul
[Examples:]
compute 1 all event/displace 0.5 :pre
[Description:]
Define a computation that flags an "event" if any particle in the
group has moved a distance greater than the specified threshold
distance when compared to a previously stored reference state
(i.e. the previous event). This compute is typically used in
conjunction with the "prd"_prd.html and "tad"_tad.html commands,
to detect if a transition
to a new minimum energy basin has occurred.
This value calculated by the compute is equal to 0 if no particle has
moved far enough, and equal to 1 if one or more particles have moved
further than the threshold distance.
NOTE: If the system is undergoing significant center-of-mass motion,
due to thermal motion, an external force, or an initial net momentum,
then this compute will not be able to distinguish that motion from
local atom displacements and may generate "false postives."
[Output info:]
This compute calculates a global scalar (the flag). This value can be
used by any command that uses a global scalar value from a compute as
-input. See "this section"_Section_howto.html#howto_15 for an overview
-of LAMMPS output options.
+input. See "Section_howto 15"_Section_howto.html#howto_15 for an
+overview of LAMMPS output options.
The scalar value calculated by this compute is "intensive". The
scalar value will be a 0 or 1 as explained above.
[Restrictions:]
This command can only be used if LAMMPS was built with the REPLICA
package. See the "Making LAMMPS"_Section_start.html#start_3 section
for more info on packages.
[Related commands:]
"prd"_prd.html, "tad"_tad.html
[Default:] none
diff --git a/doc/compute_gyration.html b/doc/compute_gyration.html
index 1d8b8389c..79994c6df 100644
--- a/doc/compute_gyration.html
+++ b/doc/compute_gyration.html
@@ -1,66 +1,66 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute gyration command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID gyration
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>gyration = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 molecule gyration
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the radius of gyration Rg of the
group of atoms, including all effects due to atoms passing thru
periodic boundaries.
</P>
<P>Rg is a measure of the size of the group of atoms, and is computed by
this formula
</P>
<CENTER><IMG SRC = "Eqs/compute_gyration.jpg">
</CENTER>
<P>where M is the total mass of the group, Rcm is the center-of-mass
position of the group, and the sum is over all atoms in the group.
</P>
<P>IMPORTANT NOTE: The coordinates of an atom contribute to Rg in
"unwrapped" form, by using the image flags associated with each atom.
See the <A HREF = "dump.html">dump custom</A> command for a discussion of
"unwrapped" coordinates. See the Atoms section of the
<A HREF = "read_data.html">read_data</A> command for a discussion of image flags and
how they are set for each atom. You can reset the image flags
(e.g. to 0) before invoking this compute by using the <A HREF = "set.html">set
image</A> command.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar (Rg). This value can be used
by any command that uses a global scalar value from a compute as
-input. See <A HREF = "Section_howto.html#howto_15">this section</A> for an overview
-of LAMMPS output options.
+input. See <A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an
+overview of LAMMPS output options.
</P>
<P>The scalar value calculated by this compute is "intensive". The
scalar value will be in distance <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_gyration_molecule.html">compute gyration/molecule</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_gyration.txt b/doc/compute_gyration.txt
index 867669d0a..2cc818c5f 100644
--- a/doc/compute_gyration.txt
+++ b/doc/compute_gyration.txt
@@ -1,61 +1,61 @@
"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
compute gyration command :h3
[Syntax:]
compute ID group-ID gyration :pre
ID, group-ID are documented in "compute"_compute.html command
gyration = style name of this compute command :ul
[Examples:]
compute 1 molecule gyration :pre
[Description:]
Define a computation that calculates the radius of gyration Rg of the
group of atoms, including all effects due to atoms passing thru
periodic boundaries.
Rg is a measure of the size of the group of atoms, and is computed by
this formula
:c,image(Eqs/compute_gyration.jpg)
where M is the total mass of the group, Rcm is the center-of-mass
position of the group, and the sum is over all atoms in the group.
IMPORTANT NOTE: The coordinates of an atom contribute to Rg in
"unwrapped" form, by using the image flags associated with each atom.
See the "dump custom"_dump.html command for a discussion of
"unwrapped" coordinates. See the Atoms section of the
"read_data"_read_data.html command for a discussion of image flags and
how they are set for each atom. You can reset the image flags
(e.g. to 0) before invoking this compute by using the "set
image"_set.html command.
[Output info:]
This compute calculates a global scalar (Rg). This value can be used
by any command that uses a global scalar value from a compute as
-input. See "this section"_Section_howto.html#howto_15 for an overview
-of LAMMPS output options.
+input. See "Section_howto 15"_Section_howto.html#howto_15 for an
+overview of LAMMPS output options.
The scalar value calculated by this compute is "intensive". The
scalar value will be in distance "units"_units.html.
[Restrictions:] none
[Related commands:]
"compute gyration/molecule"_compute_gyration_molecule.html
[Default:] none
diff --git a/doc/compute_ke.html b/doc/compute_ke.html
index 12769e0f5..b71d9e306 100644
--- a/doc/compute_ke.html
+++ b/doc/compute_ke.html
@@ -1,64 +1,64 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute ke command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID ke
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>ke = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all ke
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the translational kinetic energy
of a group of particles.
</P>
<P>The kinetic energy or each particle is computed as 1/2 m v^2, where m
and v are the mass and velocity of the particle.
</P>
<P>There is a subtle difference between the quantity calculated by this
compute and the kinetic energy calculated by the <I>ke</I> or <I>etotal</I>
keyword used in thermodynamic output, as specified by the
<A HREF = "thermo_style.html">thermo_style</A> command. For this compute, kinetic
energy is "translational" kinetic energy, calculated by the simple
formula above. For thermodynamic output, the <I>ke</I> keyword infers
kinetic energy from the temperature of the system with 1/2 Kb T of
energy for each degree of freedom. For the default temperature
computation via the <A HREF = "compute_temp.html">compute temp</A> command, these
are the same. But different computes that calculate temperature can
subtract out different non-thermal components of velocity and/or
include different degrees of freedom (translational, rotational, etc).
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar (the KE). This value can be
used by any command that uses a global scalar value from a compute as
-input. See <A HREF = "Section_howto.html#howto_15">this section</A> for an overview
-of LAMMPS output options.
+input. See <A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an
+overview of LAMMPS output options.
</P>
<P>The scalar value calculated by this compute is "extensive". The
scalar value will be in energy <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_erotate_sphere.html">compute erotate/sphere</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_ke.txt b/doc/compute_ke.txt
index 003332c07..cd84381d3 100644
--- a/doc/compute_ke.txt
+++ b/doc/compute_ke.txt
@@ -1,59 +1,59 @@
"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
compute ke command :h3
[Syntax:]
compute ID group-ID ke :pre
ID, group-ID are documented in "compute"_compute.html command
ke = style name of this compute command :ul
[Examples:]
compute 1 all ke :pre
[Description:]
Define a computation that calculates the translational kinetic energy
of a group of particles.
The kinetic energy or each particle is computed as 1/2 m v^2, where m
and v are the mass and velocity of the particle.
There is a subtle difference between the quantity calculated by this
compute and the kinetic energy calculated by the {ke} or {etotal}
keyword used in thermodynamic output, as specified by the
"thermo_style"_thermo_style.html command. For this compute, kinetic
energy is "translational" kinetic energy, calculated by the simple
formula above. For thermodynamic output, the {ke} keyword infers
kinetic energy from the temperature of the system with 1/2 Kb T of
energy for each degree of freedom. For the default temperature
computation via the "compute temp"_compute_temp.html command, these
are the same. But different computes that calculate temperature can
subtract out different non-thermal components of velocity and/or
include different degrees of freedom (translational, rotational, etc).
[Output info:]
This compute calculates a global scalar (the KE). This value can be
used by any command that uses a global scalar value from a compute as
-input. See "this section"_Section_howto.html#howto_15 for an overview
-of LAMMPS output options.
+input. See "Section_howto 15"_Section_howto.html#howto_15 for an
+overview of LAMMPS output options.
The scalar value calculated by this compute is "extensive". The
scalar value will be in energy "units"_units.html.
[Restrictions:] none
[Related commands:]
"compute erotate/sphere"_compute_erotate_sphere.html
[Default:] none
diff --git a/doc/compute_ke_atom.html b/doc/compute_ke_atom.html
index 434718e6a..fdf97f197 100644
--- a/doc/compute_ke_atom.html
+++ b/doc/compute_ke_atom.html
@@ -1,53 +1,53 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute ke/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID ke/atom
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>ke/atom = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all ke/atom
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the per-atom translational
kinetic energy for each atom in a group.
</P>
<P>The kinetic energy is simply 1/2 m v^2, where m is the mass and v is
the velocity of each atom.
</P>
<P>The value of the kinetic energy will be 0.0 for atoms not in the
specified compute group.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-<A HREF = "Section_howto.html#howto_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The per-atom vector values will be in energy <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dump.html">dump custom</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_ke_atom.txt b/doc/compute_ke_atom.txt
index fd4265130..66abf81a5 100644
--- a/doc/compute_ke_atom.txt
+++ b/doc/compute_ke_atom.txt
@@ -1,48 +1,48 @@
"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
compute ke/atom command :h3
[Syntax:]
compute ID group-ID ke/atom :pre
ID, group-ID are documented in "compute"_compute.html command
ke/atom = style name of this compute command :ul
[Examples:]
compute 1 all ke/atom :pre
[Description:]
Define a computation that calculates the per-atom translational
kinetic energy for each atom in a group.
The kinetic energy is simply 1/2 m v^2, where m is the mass and v is
the velocity of each atom.
The value of the kinetic energy will be 0.0 for atoms not in the
specified compute group.
[Output info:]
This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-"this section"_Section_howto.html#howto_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The per-atom vector values will be in energy "units"_units.html.
[Restrictions:] none
[Related commands:]
"dump custom"_dump.html
[Default:] none
diff --git a/doc/compute_ke_atom_eff.html b/doc/compute_ke_atom_eff.html
index 19ffb3f77..d305890bb 100644
--- a/doc/compute_ke_atom_eff.html
+++ b/doc/compute_ke_atom_eff.html
@@ -1,82 +1,82 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute ke/atom/eff command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID ke/atom/eff
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>ke/atom/eff = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all ke/atom/eff
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the per-atom translational
(nuclei and electrons) and radial kinetic energy (electron only) in a
group. The particles are assumed to be nuclei and electrons modeled
with the <A HREF = "pair_eff.html">electronic force field</A>.
</P>
<P>The kinetic energy for each nucleus is computed as 1/2 m v^2, where m
corresponds to the corresponding nuclear mass, and the kinetic energy
for each electron is computed as 1/2 (me v^2 + 3/4 me s^2), where me
and v correspond to the mass and translational velocity of each
electron, and s to its radial velocity, respectively.
</P>
<P>There is a subtle difference between the quantity calculated by this
compute and the kinetic energy calculated by the <I>ke</I> or <I>etotal</I>
keyword used in thermodynamic output, as specified by the
<A HREF = "thermo_style.html">thermo_style</A> command. For this compute, kinetic
energy is "translational" plus electronic "radial" kinetic energy,
calculated by the simple formula above. For thermodynamic output, the
<I>ke</I> keyword infers kinetic energy from the temperature of the system
with 1/2 Kb T of energy for each (nuclear-only) degree of freedom in
eFF.
</P>
<P>IMPORTANT NOTE: The temperature in eFF should be monitored via the
<A HREF = "compute_temp_eff.html">compute temp/eff</A> command, which can be printed
with thermodynamic output by using the
<A HREF = "thermo_modify.html">thermo_modify</A> command, as shown in the following
example:
</P>
<PRE>compute effTemp all temp/eff
thermo_style custom step etotal pe ke temp press
thermo_modify temp effTemp
</PRE>
<P>The value of the kinetic energy will be 0.0 for atoms (nuclei or
electrons) not in the specified compute group.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a scalar quantity for each atom, which can be
accessed by any command that uses per-atom computes as input. See
-<A HREF = "Section_howto.html#howto_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The per-atom vector values will be in energy <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This compute is part of the USER-EFF package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dump.html">dump custom</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_ke_atom_eff.txt b/doc/compute_ke_atom_eff.txt
index 00c32be62..736c38677 100644
--- a/doc/compute_ke_atom_eff.txt
+++ b/doc/compute_ke_atom_eff.txt
@@ -1,77 +1,77 @@
"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
compute ke/atom/eff command :h3
[Syntax:]
compute ID group-ID ke/atom/eff :pre
ID, group-ID are documented in "compute"_compute.html command
ke/atom/eff = style name of this compute command :ul
[Examples:]
compute 1 all ke/atom/eff :pre
[Description:]
Define a computation that calculates the per-atom translational
(nuclei and electrons) and radial kinetic energy (electron only) in a
group. The particles are assumed to be nuclei and electrons modeled
with the "electronic force field"_pair_eff.html.
The kinetic energy for each nucleus is computed as 1/2 m v^2, where m
corresponds to the corresponding nuclear mass, and the kinetic energy
for each electron is computed as 1/2 (me v^2 + 3/4 me s^2), where me
and v correspond to the mass and translational velocity of each
electron, and s to its radial velocity, respectively.
There is a subtle difference between the quantity calculated by this
compute and the kinetic energy calculated by the {ke} or {etotal}
keyword used in thermodynamic output, as specified by the
"thermo_style"_thermo_style.html command. For this compute, kinetic
energy is "translational" plus electronic "radial" kinetic energy,
calculated by the simple formula above. For thermodynamic output, the
{ke} keyword infers kinetic energy from the temperature of the system
with 1/2 Kb T of energy for each (nuclear-only) degree of freedom in
eFF.
IMPORTANT NOTE: The temperature in eFF should be monitored via the
"compute temp/eff"_compute_temp_eff.html command, which can be printed
with thermodynamic output by using the
"thermo_modify"_thermo_modify.html command, as shown in the following
example:
compute effTemp all temp/eff
thermo_style custom step etotal pe ke temp press
thermo_modify temp effTemp :pre
The value of the kinetic energy will be 0.0 for atoms (nuclei or
electrons) not in the specified compute group.
[Output info:]
This compute calculates a scalar quantity for each atom, which can be
accessed by any command that uses per-atom computes as input. See
-"this section"_Section_howto.html#howto_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The per-atom vector values will be in energy "units"_units.html.
[Restrictions:]
This compute is part of the USER-EFF package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"dump custom"_dump.html
[Default:] none
diff --git a/doc/compute_ke_eff.html b/doc/compute_ke_eff.html
index 2fa318f8a..7c476b9aa 100644
--- a/doc/compute_ke_eff.html
+++ b/doc/compute_ke_eff.html
@@ -1,83 +1,83 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute ke/eff command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID ke/eff
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>ke/eff = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all ke/eff
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the kinetic energy of motion of a
group of eFF particles (nuclei and electrons), as modeled with the
<A HREF = "pair_eff.html">electronic force field</A>.
</P>
<P>The kinetic energy for each nucleus is computed as 1/2 m v^2 and the
kinetic energy for each electron is computed as 1/2(me v^2 + 3/4 me
s^2), where m corresponds to the nuclear mass, me to the electron
mass, v to the translational velocity of each particle, and s to the
radial velocity of the electron, respectively.
</P>
<P>There is a subtle difference between the quantity calculated by this
compute and the kinetic energy calculated by the <I>ke</I> or <I>etotal</I>
keyword used in thermodynamic output, as specified by the
<A HREF = "thermo_style.html">thermo_style</A> command. For this compute, kinetic
energy is "translational" and "radial" (only for electrons) kinetic
energy, calculated by the simple formula above. For thermodynamic
output, the <I>ke</I> keyword infers kinetic energy from the temperature of
the system with 1/2 Kb T of energy for each degree of freedom. For
the eFF temperature computation via the <A HREF = "compute_temp_eff.html">compute
temp_eff</A> command, these are the same. But
different computes that calculate temperature can subtract out
different non-thermal components of velocity and/or include other
degrees of freedom.
</P>
<P>IMPRORTANT NOTE: The temperature in eFF models should be monitored via
the <A HREF = "compute_temp_eff.html">compute temp/eff</A> command, which can be
printed with thermodynamic output by using the
<A HREF = "thermo_modify.html">thermo_modify</A> command, as shown in the following
example:
</P>
<PRE>compute effTemp all temp/eff
thermo_style custom step etotal pe ke temp press
thermo_modify temp effTemp
</PRE>
<P>See <A HREF = "compute_temp_eff.html">compute temp/eff</A>.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar (the KE). This value can be
used by any command that uses a global scalar value from a compute as
-input. See <A HREF = "Section_howto.html#howto_15">this section</A> for an overview
-of LAMMPS output options.
+input. See <A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an
+overview of LAMMPS output options.
</P>
<P>The scalar value calculated by this compute is "extensive". The
scalar value will be in energy <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This compute is part of the USER-EFF package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B> none
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_ke_eff.txt b/doc/compute_ke_eff.txt
index 2ebe435df..61c46d337 100644
--- a/doc/compute_ke_eff.txt
+++ b/doc/compute_ke_eff.txt
@@ -1,78 +1,78 @@
"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
compute ke/eff command :h3
[Syntax:]
compute ID group-ID ke/eff :pre
ID, group-ID are documented in "compute"_compute.html command
ke/eff = style name of this compute command :ul
[Examples:]
compute 1 all ke/eff :pre
[Description:]
Define a computation that calculates the kinetic energy of motion of a
group of eFF particles (nuclei and electrons), as modeled with the
"electronic force field"_pair_eff.html.
The kinetic energy for each nucleus is computed as 1/2 m v^2 and the
kinetic energy for each electron is computed as 1/2(me v^2 + 3/4 me
s^2), where m corresponds to the nuclear mass, me to the electron
mass, v to the translational velocity of each particle, and s to the
radial velocity of the electron, respectively.
There is a subtle difference between the quantity calculated by this
compute and the kinetic energy calculated by the {ke} or {etotal}
keyword used in thermodynamic output, as specified by the
"thermo_style"_thermo_style.html command. For this compute, kinetic
energy is "translational" and "radial" (only for electrons) kinetic
energy, calculated by the simple formula above. For thermodynamic
output, the {ke} keyword infers kinetic energy from the temperature of
the system with 1/2 Kb T of energy for each degree of freedom. For
the eFF temperature computation via the "compute
temp_eff"_compute_temp_eff.html command, these are the same. But
different computes that calculate temperature can subtract out
different non-thermal components of velocity and/or include other
degrees of freedom.
IMPRORTANT NOTE: The temperature in eFF models should be monitored via
the "compute temp/eff"_compute_temp_eff.html command, which can be
printed with thermodynamic output by using the
"thermo_modify"_thermo_modify.html command, as shown in the following
example:
compute effTemp all temp/eff
thermo_style custom step etotal pe ke temp press
thermo_modify temp effTemp :pre
See "compute temp/eff"_compute_temp_eff.html.
[Output info:]
This compute calculates a global scalar (the KE). This value can be
used by any command that uses a global scalar value from a compute as
-input. See "this section"_Section_howto.html#howto_15 for an overview
-of LAMMPS output options.
+input. See "Section_howto 15"_Section_howto.html#howto_15 for an
+overview of LAMMPS output options.
The scalar value calculated by this compute is "extensive". The
scalar value will be in energy "units"_units.html.
[Restrictions:]
This compute is part of the USER-EFF package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:] none
[Default:] none
diff --git a/doc/compute_meso_e_atom.html b/doc/compute_meso_e_atom.html
index 69d903799..3350eb300 100644
--- a/doc/compute_meso_e_atom.html
+++ b/doc/compute_meso_e_atom.html
@@ -1,61 +1,61 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute meso_e/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID meso_e/atom
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>meso_e/atom = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all meso_e/atom
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the per-atom internal energy
for each atom in a group.
</P>
<P>The internal energy is the energy associated with the internal degrees
of freedom of a mesoscopic particles, e.g. a Smooth-Particle
Hydrodynamics particle.
</P>
<P>See <A HREF = "USER/sph/SPH_LAMMPS_userguide.pdf">this PDF guide</A> to using SPH in
LAMMPS.
</P>
<P>The value of the internal energy will be 0.0 for atoms not in the
specified compute group.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-<A HREF = "Section_howto.html#4_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The per-atom vector values will be in energy <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This compute is part of the USER-SPH package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dump.html">dump custom</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_meso_e_atom.txt b/doc/compute_meso_e_atom.txt
index b85115da4..0cf93ef6e 100644
--- a/doc/compute_meso_e_atom.txt
+++ b/doc/compute_meso_e_atom.txt
@@ -1,56 +1,56 @@
"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
compute meso_e/atom command :h3
[Syntax:]
compute ID group-ID meso_e/atom :pre
ID, group-ID are documented in "compute"_compute.html command
meso_e/atom = style name of this compute command :ul
[Examples:]
compute 1 all meso_e/atom :pre
[Description:]
Define a computation that calculates the per-atom internal energy
for each atom in a group.
The internal energy is the energy associated with the internal degrees
of freedom of a mesoscopic particles, e.g. a Smooth-Particle
Hydrodynamics particle.
See "this PDF guide"_USER/sph/SPH_LAMMPS_userguide.pdf to using SPH in
LAMMPS.
The value of the internal energy will be 0.0 for atoms not in the
specified compute group.
[Output info:]
This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-"this section"_Section_howto.html#4_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The per-atom vector values will be in energy "units"_units.html.
[Restrictions:]
This compute is part of the USER-SPH package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"dump custom"_dump.html
[Default:] none
diff --git a/doc/compute_meso_rho_atom.html b/doc/compute_meso_rho_atom.html
index 202be3573..790e2f900 100644
--- a/doc/compute_meso_rho_atom.html
+++ b/doc/compute_meso_rho_atom.html
@@ -1,61 +1,61 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute meso_rho/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID meso_rho/atom
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>meso_rho/atom = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all meso_rho/atom
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the per-atom mesoscopic density
for each atom in a group.
</P>
<P>The mesoscopic density is the mass density of a mesoscopic particle,
calculated by kernel function interpolation using "pair style
sph/rhosum".
</P>
<P>See <A HREF = "USER/sph/SPH_LAMMPS_userguide.pdf">this PDF guide</A> to using SPH in
LAMMPS.
</P>
<P>The value of the mesoscopic density will be 0.0 for atoms not in the
specified compute group.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-<A HREF = "Section_howto.html#4_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The per-atom vector values will be in mass/volume <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This compute is part of the USER-SPH package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dump.html">dump custom</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_meso_rho_atom.txt b/doc/compute_meso_rho_atom.txt
index c09581864..5ed9ec86d 100644
--- a/doc/compute_meso_rho_atom.txt
+++ b/doc/compute_meso_rho_atom.txt
@@ -1,56 +1,56 @@
"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
compute meso_rho/atom command :h3
[Syntax:]
compute ID group-ID meso_rho/atom :pre
ID, group-ID are documented in "compute"_compute.html command
meso_rho/atom = style name of this compute command :ul
[Examples:]
compute 1 all meso_rho/atom :pre
[Description:]
Define a computation that calculates the per-atom mesoscopic density
for each atom in a group.
The mesoscopic density is the mass density of a mesoscopic particle,
calculated by kernel function interpolation using "pair style
sph/rhosum".
See "this PDF guide"_USER/sph/SPH_LAMMPS_userguide.pdf to using SPH in
LAMMPS.
The value of the mesoscopic density will be 0.0 for atoms not in the
specified compute group.
[Output info:]
This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-"this section"_Section_howto.html#4_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The per-atom vector values will be in mass/volume "units"_units.html.
[Restrictions:]
This compute is part of the USER-SPH package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"dump custom"_dump.html
[Default:] none
diff --git a/doc/compute_meso_t_atom.html b/doc/compute_meso_t_atom.html
index dc41ea8d3..39b21ccff 100644
--- a/doc/compute_meso_t_atom.html
+++ b/doc/compute_meso_t_atom.html
@@ -1,63 +1,63 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute meso_t/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID meso_t/atom
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>meso_t/atom = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all meso_t/atom
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the per-atom internal temperature
for each atom in a group.
</P>
<P>The internal temperature is the ratio of internal energy over the heat
capacity associated with the internal degrees of freedom of a mesoscopic
particles, e.g. a Smooth-Particle Hydrodynamics particle.
</P>
<P>T_<I>int</I> = E_<I>int</I> / C_<I>V, int</I>
</P>
<P>See <A HREF = "USER/sph/SPH_LAMMPS_userguide.pdf">this PDF guide</A> to using SPH in
LAMMPS.
</P>
<P>The value of the internal energy will be 0.0 for atoms not in the
specified compute group.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-<A HREF = "Section_howto.html#4_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The per-atom vector values will be in temperature <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This compute is part of the USER-SPH package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dump.html">dump custom</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_meso_t_atom.txt b/doc/compute_meso_t_atom.txt
index 1d1a3a12a..cfdd78755 100644
--- a/doc/compute_meso_t_atom.txt
+++ b/doc/compute_meso_t_atom.txt
@@ -1,58 +1,58 @@
"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
compute meso_t/atom command :h3
[Syntax:]
compute ID group-ID meso_t/atom :pre
ID, group-ID are documented in "compute"_compute.html command
meso_t/atom = style name of this compute command :ul
[Examples:]
compute 1 all meso_t/atom :pre
[Description:]
Define a computation that calculates the per-atom internal temperature
for each atom in a group.
The internal temperature is the ratio of internal energy over the heat
capacity associated with the internal degrees of freedom of a mesoscopic
particles, e.g. a Smooth-Particle Hydrodynamics particle.
T_{int} = E_{int} / C_{V, int}
See "this PDF guide"_USER/sph/SPH_LAMMPS_userguide.pdf to using SPH in
LAMMPS.
The value of the internal energy will be 0.0 for atoms not in the
specified compute group.
[Output info:]
This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-"this section"_Section_howto.html#4_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The per-atom vector values will be in temperature "units"_units.html.
[Restrictions:]
This compute is part of the USER-SPH package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"dump custom"_dump.html
[Default:] none
diff --git a/doc/compute_pe.html b/doc/compute_pe.html
index 96a25eb42..75f44af57 100644
--- a/doc/compute_pe.html
+++ b/doc/compute_pe.html
@@ -1,100 +1,101 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute pe command
</H3>
<H3>compute pe/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID pe keyword ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>pe = style name of this compute command
<LI>zero or more keywords may be appended
<LI>keyword = <I>pair</I> or <I>bond</I> or <I>angle</I> or <I>dihedral</I> or <I>improper</I> or <I>kspace</I>
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all pe
compute molPE all pe bond angle dihedral improper
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the potential energy of the
entire system of atoms. The specified group must be "all". See the
<A HREF = "compute_pe_atom.html">compute pe/atom</A> command if you want per-atom
energies. These per-atom values could be summed for a group of atoms
via the <A HREF = "compute_reduce.html">compute reduce</A> command.
</P>
<P>The energy is calculated by the various pair, bond, etc potentials
defined for the simulation. If no extra keywords are listed, then the
potential energy is the sum of pair, bond, angle, dihedral, improper,
and kspace (long-range) energy. If any extra keywords are listed,
then only those components are summed to compute the potential energy.
</P>
<P>Various fixes can contribute to the total potential energy of the
system. See the doc pages for <A HREF = "fix.html">individual fixes</A> for
details. The <I>thermo</I> option of the
<A HREF = "compute_modify.html">compute_modify</A> command determines whether these
contributions are added into the computed potential energy. If no
keywords are specified the default is <I>yes</I>. If any keywords are
specified, the default is <I>no</I>.
</P>
<P>A compute of this style with the ID of "thermo_pe" is created when
LAMMPS starts up, as if this command were in the input script:
</P>
<PRE>compute thermo_pe all pe
</PRE>
<P>See the "thermo_style" command for more details.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar (the potential energy). This
value can be used by any command that uses a global scalar value from
-a compute as input. See <A HREF = "Section_howto.html#howto_15">this section</A>
-for an overview of LAMMPS output options.
+a compute as input. See <A HREF = "Section_howto.html#howto_15">Section_howto
+15</A> for an overview of LAMMPS output
+options.
</P>
<P>The scalar value calculated by this compute is "extensive". The
scalar value will be in energy <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_pe_atom.html">compute pe/atom</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_pe.txt b/doc/compute_pe.txt
index 46d54268e..e09ad02b3 100644
--- a/doc/compute_pe.txt
+++ b/doc/compute_pe.txt
@@ -1,94 +1,95 @@
"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
compute pe command :h3
compute pe/cuda command :h3
[Syntax:]
compute ID group-ID pe keyword ... :pre
ID, group-ID are documented in "compute"_compute.html command
pe = style name of this compute command
zero or more keywords may be appended
keyword = {pair} or {bond} or {angle} or {dihedral} or {improper} or {kspace} :ul
[Examples:]
compute 1 all pe
compute molPE all pe bond angle dihedral improper :pre
[Description:]
Define a computation that calculates the potential energy of the
entire system of atoms. The specified group must be "all". See the
"compute pe/atom"_compute_pe_atom.html command if you want per-atom
energies. These per-atom values could be summed for a group of atoms
via the "compute reduce"_compute_reduce.html command.
The energy is calculated by the various pair, bond, etc potentials
defined for the simulation. If no extra keywords are listed, then the
potential energy is the sum of pair, bond, angle, dihedral, improper,
and kspace (long-range) energy. If any extra keywords are listed,
then only those components are summed to compute the potential energy.
Various fixes can contribute to the total potential energy of the
system. See the doc pages for "individual fixes"_fix.html for
details. The {thermo} option of the
"compute_modify"_compute_modify.html command determines whether these
contributions are added into the computed potential energy. If no
keywords are specified the default is {yes}. If any keywords are
specified, the default is {no}.
A compute of this style with the ID of "thermo_pe" is created when
LAMMPS starts up, as if this command were in the input script:
compute thermo_pe all pe :pre
See the "thermo_style" command for more details.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Output info:]
This compute calculates a global scalar (the potential energy). This
value can be used by any command that uses a global scalar value from
-a compute as input. See "this section"_Section_howto.html#howto_15
-for an overview of LAMMPS output options.
+a compute as input. See "Section_howto
+15"_Section_howto.html#howto_15 for an overview of LAMMPS output
+options.
The scalar value calculated by this compute is "extensive". The
scalar value will be in energy "units"_units.html.
[Restrictions:] none
[Related commands:]
"compute pe/atom"_compute_pe_atom.html
[Default:] none
diff --git a/doc/compute_pe_atom.html b/doc/compute_pe_atom.html
index af5f158fc..3e7bc51f4 100644
--- a/doc/compute_pe_atom.html
+++ b/doc/compute_pe_atom.html
@@ -1,87 +1,87 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute pe/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID pe/atom keyword ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>pe/atom = style name of this compute command
<LI>zero or more keywords may be appended
<LI>keyword = <I>pair</I> or <I>bond</I> or <I>angle</I> or <I>dihedral</I> or <I>improper</I>
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all pe/atom
compute 1 all pe/atom pair
compute 1 all pe/atom pair bond
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that computes the per-atom potential energy for
each atom in a group. See the <A HREF = "compute_pe.html">compute pe</A> command if
you want the potential energy of the entire system.
</P>
<P>The per-atom energy is calculated by the various pair, bond, etc
potentials defined for the simulation. If no extra keywords are
listed, then the potential energy is the sum of pair, bond, angle,
dihedral, and improper energy. If any extra keywords are listed, then
only those components are summed to compute the potential energy.
</P>
<P>Note that the energy of each atom is due to its interaction with all
other atoms in the simulation, not just with other atoms in the group.
</P>
<P>For an energy contribution produced by a small set of atoms (e.g. 4
atoms in a dihedral or 3 atoms in a Tersoff 3-body interaction), that
energy is assigned in equal portions to each atom in the set.
E.g. 1/4 of the dihedral energy to each of the 4 atoms.
</P>
<P>The <A HREF = "dihedral_charmm.html">dihedral_style charmm</A> style calculates
pairwise interactions between 1-4 atoms. The energy contribution of
these terms is included in the pair energy, not the dihedral energy.
</P>
<P>As an example of per-atom potential energy compared to total potential
energy, these lines in an input script should yield the same result
in the last 2 columns of thermo output:
</P>
<PRE>compute peratom all pe/atom
compute pe all reduce sum c_peratom
thermo_style custom step temp etotal press pe c_pe
</PRE>
<P>IMPORTANT NOTE: The per-atom energy does NOT include contributions due
to long-range Coulombic interactions (via the
<A HREF = "kspace_style.html">kspace_style</A> command). It's not clear this
contribution can easily be computed. It also does not include any
Lennard-Jones tail corrections invoked by the <A HREF = "pair_modify.html">pair_modify tail
yes</A> command, since those are global contributions to
the system energy.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-<A HREF = "Section_howto.html#howto_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The per-atom vector values will be in energy <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_pe.html">compute pe</A>, <A HREF = "compute_stress_atom.html">compute
stress/atom</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_pe_atom.txt b/doc/compute_pe_atom.txt
index c71dceec4..3b3d2a331 100644
--- a/doc/compute_pe_atom.txt
+++ b/doc/compute_pe_atom.txt
@@ -1,82 +1,82 @@
"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
compute pe/atom command :h3
[Syntax:]
compute ID group-ID pe/atom keyword ... :pre
ID, group-ID are documented in "compute"_compute.html command
pe/atom = style name of this compute command
zero or more keywords may be appended
keyword = {pair} or {bond} or {angle} or {dihedral} or {improper} :ul
[Examples:]
compute 1 all pe/atom
compute 1 all pe/atom pair
compute 1 all pe/atom pair bond :pre
[Description:]
Define a computation that computes the per-atom potential energy for
each atom in a group. See the "compute pe"_compute_pe.html command if
you want the potential energy of the entire system.
The per-atom energy is calculated by the various pair, bond, etc
potentials defined for the simulation. If no extra keywords are
listed, then the potential energy is the sum of pair, bond, angle,
dihedral, and improper energy. If any extra keywords are listed, then
only those components are summed to compute the potential energy.
Note that the energy of each atom is due to its interaction with all
other atoms in the simulation, not just with other atoms in the group.
For an energy contribution produced by a small set of atoms (e.g. 4
atoms in a dihedral or 3 atoms in a Tersoff 3-body interaction), that
energy is assigned in equal portions to each atom in the set.
E.g. 1/4 of the dihedral energy to each of the 4 atoms.
The "dihedral_style charmm"_dihedral_charmm.html style calculates
pairwise interactions between 1-4 atoms. The energy contribution of
these terms is included in the pair energy, not the dihedral energy.
As an example of per-atom potential energy compared to total potential
energy, these lines in an input script should yield the same result
in the last 2 columns of thermo output:
compute peratom all pe/atom
compute pe all reduce sum c_peratom
thermo_style custom step temp etotal press pe c_pe :pre
IMPORTANT NOTE: The per-atom energy does NOT include contributions due
to long-range Coulombic interactions (via the
"kspace_style"_kspace_style.html command). It's not clear this
contribution can easily be computed. It also does not include any
Lennard-Jones tail corrections invoked by the "pair_modify tail
yes"_pair_modify.html command, since those are global contributions to
the system energy.
[Output info:]
This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
-"this section"_Section_howto.html#howto_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The per-atom vector values will be in energy "units"_units.html.
[Restrictions:]
[Related commands:]
"compute pe"_compute_pe.html, "compute
stress/atom"_compute_stress_atom.html
[Default:] none
diff --git a/doc/compute_pressure.html b/doc/compute_pressure.html
index 53cc3132c..f5e729b51 100644
--- a/doc/compute_pressure.html
+++ b/doc/compute_pressure.html
@@ -1,135 +1,135 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute pressure command
</H3>
<H3>compute pressure/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID pressure temp-ID keyword ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>pressure = style name of this compute command
<LI>temp-ID = ID of compute that calculates temperature
<LI>zero or more keywords may be appended
<LI>keyword = <I>ke</I> or <I>pair</I> or <I>bond</I> or <I>angle</I> or <I>dihedral</I> or <I>improper</I> or <I>kspace</I> or <I>fix</I> or <I>virial</I>
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all pressure myTemp
compute 1 all pressure thermo_temp pair bond
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the pressure of the entire system
of atoms. The specified group must be "all". See the <A HREF = "compute_stress_atom.html">compute
stress/atom</A> command if you want per-atom
pressure (stress). These per-atom values could be summed for a group
of atoms via the <A HREF = "compute_reduce.html">compute reduce</A> command.
</P>
<P>The pressure is computed by the formula
</P>
<CENTER><IMG SRC = "Eqs/pressure.jpg">
</CENTER>
<P>where N is the number of atoms in the system (see discussion of DOF
below), Kb is the Boltzmann constant, T is the temperature, d is the
dimensionality of the system (2 or 3 for 2d/3d), V is the system
volume (or area in 2d), and the second term is the virial, computed
within LAMMPS for all pairwise as well as 2-body, 3-body, and 4-body,
and long-range interactions. <A HREF = "fix.html">Fixes</A> that impose constraints
(e.g. the <A HREF = "fix_shake.html">fix shake</A> command) also contribute to the
virial term.
</P>
<P>A symmetric pressure tensor, stored as a 6-element vector, is also
calculated by this compute. The 6 components of the vector are
ordered xx, yy, zz, xy, xz, yz. The equation for the I,J components
(where I and J = x,y,z) is similar to the above formula, except that
the first term uses components of the kinetic energy tensor and the
second term uses components of the virial tensor:
</P>
<CENTER><IMG SRC = "Eqs/pressure_tensor.jpg">
</CENTER>
<P>If no extra keywords are listed, the entire equations above are
calculated which include a kinetic energy (temperature) term and the
virial as the sum of pair, bond, angle, dihedral, improper, kspace
(long-range), and fix contributions to the force on each atom. If any
extra keywords are listed, then only those components are summed to
compute temperature or ke and/or the virial. The <I>virial</I> keyword
means include all terms except the kinetic energy <I>ke</I>.
</P>
<P>The temperature and kinetic energy tensor is not calculated by this
compute, but rather by the temperature compute specified with the
command. Normally this compute should calculate the temperature of
all atoms for consistency with the virial term, but any compute style
that calculates temperature can be used, e.g. one that excludes frozen
atoms or other degrees of freedom.
</P>
<P>Note that the N in the first formula above is really
degrees-of-freedom divided by d = dimensionality, where the DOF value
is calcluated by the temperature compute. See the various <A HREF = "compute.html">compute
temperature</A> styles for details.
</P>
<P>A compute of this style with the ID of "thermo_press" is created when
LAMMPS starts up, as if this command were in the input script:
</P>
<PRE>compute thermo_press all pressure thermo_temp
</PRE>
<P>where "thermo_temp" is the ID of a similarly defined compute of style
"temp". See the "thermo_style" command for more details.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar (the pressure) and a global
vector of length 6 (pressure tensor), which can be accessed by indices
1-6. These values can be used by any command that uses global scalar
or vector values from a compute as input. See <A HREF = "Section_howto.html#howto_15">this
section</A> for an overview of LAMMPS output
options.
</P>
<P>The scalar and vector values calculated by this compute are
"intensive". The scalar and vector values will be in pressure
<A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_temp.html">compute temp</A>, <A HREF = "compute_stress_atom.html">compute
stress/atom</A>,
<A HREF = "thermo_style.html">thermo_style</A>,
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_pressure.txt b/doc/compute_pressure.txt
index 28d77dd17..0e4270948 100644
--- a/doc/compute_pressure.txt
+++ b/doc/compute_pressure.txt
@@ -1,129 +1,129 @@
"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
compute pressure command :h3
compute pressure/cuda command :h3
[Syntax:]
compute ID group-ID pressure temp-ID keyword ... :pre
ID, group-ID are documented in "compute"_compute.html command
pressure = style name of this compute command
temp-ID = ID of compute that calculates temperature
zero or more keywords may be appended
keyword = {ke} or {pair} or {bond} or {angle} or {dihedral} or {improper} or {kspace} or {fix} or {virial} :ul
[Examples:]
compute 1 all pressure myTemp
compute 1 all pressure thermo_temp pair bond :pre
[Description:]
Define a computation that calculates the pressure of the entire system
of atoms. The specified group must be "all". See the "compute
stress/atom"_compute_stress_atom.html command if you want per-atom
pressure (stress). These per-atom values could be summed for a group
of atoms via the "compute reduce"_compute_reduce.html command.
The pressure is computed by the formula
:c,image(Eqs/pressure.jpg)
where N is the number of atoms in the system (see discussion of DOF
below), Kb is the Boltzmann constant, T is the temperature, d is the
dimensionality of the system (2 or 3 for 2d/3d), V is the system
volume (or area in 2d), and the second term is the virial, computed
within LAMMPS for all pairwise as well as 2-body, 3-body, and 4-body,
and long-range interactions. "Fixes"_fix.html that impose constraints
(e.g. the "fix shake"_fix_shake.html command) also contribute to the
virial term.
A symmetric pressure tensor, stored as a 6-element vector, is also
calculated by this compute. The 6 components of the vector are
ordered xx, yy, zz, xy, xz, yz. The equation for the I,J components
(where I and J = x,y,z) is similar to the above formula, except that
the first term uses components of the kinetic energy tensor and the
second term uses components of the virial tensor:
:c,image(Eqs/pressure_tensor.jpg)
If no extra keywords are listed, the entire equations above are
calculated which include a kinetic energy (temperature) term and the
virial as the sum of pair, bond, angle, dihedral, improper, kspace
(long-range), and fix contributions to the force on each atom. If any
extra keywords are listed, then only those components are summed to
compute temperature or ke and/or the virial. The {virial} keyword
means include all terms except the kinetic energy {ke}.
The temperature and kinetic energy tensor is not calculated by this
compute, but rather by the temperature compute specified with the
command. Normally this compute should calculate the temperature of
all atoms for consistency with the virial term, but any compute style
that calculates temperature can be used, e.g. one that excludes frozen
atoms or other degrees of freedom.
Note that the N in the first formula above is really
degrees-of-freedom divided by d = dimensionality, where the DOF value
is calcluated by the temperature compute. See the various "compute
temperature"_compute.html styles for details.
A compute of this style with the ID of "thermo_press" is created when
LAMMPS starts up, as if this command were in the input script:
compute thermo_press all pressure thermo_temp :pre
where "thermo_temp" is the ID of a similarly defined compute of style
"temp". See the "thermo_style" command for more details.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Output info:]
This compute calculates a global scalar (the pressure) and a global
vector of length 6 (pressure tensor), which can be accessed by indices
1-6. These values can be used by any command that uses global scalar
or vector values from a compute as input. See "this
section"_Section_howto.html#howto_15 for an overview of LAMMPS output
options.
The scalar and vector values calculated by this compute are
"intensive". The scalar and vector values will be in pressure
"units"_units.html.
[Restrictions:] none
[Related commands:]
"compute temp"_compute_temp.html, "compute
stress/atom"_compute_stress_atom.html,
"thermo_style"_thermo_style.html,
[Default:] none
diff --git a/doc/compute_rdf.html b/doc/compute_rdf.html
index ae66e375b..50bb94428 100644
--- a/doc/compute_rdf.html
+++ b/doc/compute_rdf.html
@@ -1,130 +1,130 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute rdf command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID rdf Nbin itype1 jtype1 itype2 jtype2 ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>rdf = style name of this compute command
<LI>Nbin = number of RDF bins
<LI>itypeN = central atom type for Nth RDF histogram (see asterisk form below)
<LI>jtypeN = distribution atom type for Nth RDF histogram (see asterisk form below)
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all rdf 100
compute 1 all rdf 100 1 1
compute 1 all rdf 100 * 3
compute 1 fluid rdf 500 1 1 1 2 2 1 2 2
compute 1 fluid rdf 500 1*3 2 5 *10
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the radial distribution function
(RDF), also called g(r), and the coordination number for a group of
particles. Both are calculated in histogram form by binning pairwise
distances into <I>Nbin</I> bins from 0.0 to the maximum force cutoff
defined by the <A HREF = "pair_style.html">pair_style</A> command. The bins are of
uniform size in radial distance. Thus a single bin encompasses a thin
shell of distances in 3d and a thin ring of distances in 2d.
</P>
<P>The <I>itypeN</I> and <I>jtypeN</I> arguments are optional. These arguments
must come in pairs. If no pairs are listed, then a single histogram
is computed for g(r) between all atom types. If one or more pairs are
listed, then a separate histogram is generated for each
<I>itype</I>,<I>jtype</I> pair.
</P>
<P>The <I>itypeN</I> and <I>jtypeN</I> settings can be specified in one of two
ways. An explicit numeric value can be used, as in the 4th example
above. Or a wild-card asterisk can be used to specify a range of atom
types. This takes the form "*" or "*n" or "n*" or "m*n". If N = the
number of atom types, then an asterisk with no numeric values means
all types from 1 to N. A leading asterisk means all types from 1 to n
(inclusive). A trailing asterisk means all types from n to N
(inclusive). A middle asterisk means all types from m to n
(inclusive).
</P>
<P>If both <I>itypeN</I> and <I>jtypeN</I> are single values, as in the 4th example
above, this means that a g(r) is computed where atoms of type <I>itypeN</I>
are the central atom, and atoms of type <I>jtypeN</I> are the distribution
atom. If either <I>itypeN</I> and <I>jtypeN</I> represent a range of values via
the wild-card asterisk, as in the 5th example above, this means that a
g(r) is computed where atoms of any of the range of types represented
by <I>itypeN</I> are the central atom, and atoms of any of the range of
types represented by <I>jtypeN</I> are the distribution atom.
</P>
<P>Pairwise distances are generated by looping over a pairwise neighbor
list, just as they would be in a <A HREF = "pair_style.html">pair_style</A>
computation. The distance between two atoms I and J is included in
a specific histogram if the following criteria are met:
</P>
<UL><LI>atoms I,J are both in the specified compute group
<LI>the distance between atoms I,J is less than the maximum force cutoff
<LI>the type of the I atom matches itypeN (one or a range of types)
<LI>the type of the J atom matches jtypeN (one or a range of types)
</UL>
<P>It is OK if a particular pairwise distance is included in more than
one individual histogram, due to the way the <I>itypeN</I> and <I>jtypeN</I>
arguments are specified.
</P>
<P>The g(r) value for a bin is calculated from the histogram count by
scaling it by the idealized number of how many counts there would be
if atoms of type <I>jtypeN</I> were uniformly distributed. Thus it
involves the count of <I>itypeN</I> atoms, the count of <I>jtypeN</I> atoms, the
volume of the entire simulation box, and the volume of the bin's thin
shell in 3d (or the area of the bin's thin ring in 2d).
</P>
<P>A coordination number coord(r) is also calculated, which is the sum of
g(r) values for all bins up to and including the current bin.
</P>
<P>The simplest way to output the results of the compute rdf calculation
to a file is to use the <A HREF = "fix_ave_time.html">fix ave/time</A> command, for
example:
</P>
<PRE>compute myRDF all rdf 50
fix 1 all ave/time 100 1 100 c_myRDF file tmp.rdf mode vector
</PRE>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global array with the number of rows =
<I>Nbins</I>, and the number of columns = 1 + 2*Npairs, where Npairs is the
number of I,J pairings specified. The first column has the bin
coordinate (center of the bin), Each successive set of 2 columns has
the g(r) and coord(r) values for a specific set of <I>itypeN</I> versus
<I>jtypeN</I> interactions, as described above. These values can be used
by any command that uses a global values from a compute as input. See
-<A HREF = "Section_howto.html#howto_15">this section</A> for an overview of LAMMPS
-output options.
+<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
+LAMMPS output options.
</P>
<P>The array values calculated by this compute are all "intensive".
</P>
<P>The first column of array values will be in distance
<A HREF = "units.html">units</A>. The g(r) columns of array values are normalized
numbers >= 0.0. The coordination number columns of array values are
also numbers >= 0.0.
</P>
<P><B>Restrictions:</B>
</P>
<P>The RDF is not computed for distances longer than the force cutoff,
since processors (in parallel) don't know about atom coordinates for
atoms further away than that distance. If you want an RDF for larger
distances, you'll need to post-process a dump file.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_ave_time.html">fix ave/time</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_rdf.txt b/doc/compute_rdf.txt
index 83e835ff3..afda1a28b 100644
--- a/doc/compute_rdf.txt
+++ b/doc/compute_rdf.txt
@@ -1,125 +1,125 @@
"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
compute rdf command :h3
[Syntax:]
compute ID group-ID rdf Nbin itype1 jtype1 itype2 jtype2 ... :pre
ID, group-ID are documented in "compute"_compute.html command
rdf = style name of this compute command
Nbin = number of RDF bins
itypeN = central atom type for Nth RDF histogram (see asterisk form below)
jtypeN = distribution atom type for Nth RDF histogram (see asterisk form below) :ul
[Examples:]
compute 1 all rdf 100
compute 1 all rdf 100 1 1
compute 1 all rdf 100 * 3
compute 1 fluid rdf 500 1 1 1 2 2 1 2 2
compute 1 fluid rdf 500 1*3 2 5 *10 :pre
[Description:]
Define a computation that calculates the radial distribution function
(RDF), also called g(r), and the coordination number for a group of
particles. Both are calculated in histogram form by binning pairwise
distances into {Nbin} bins from 0.0 to the maximum force cutoff
defined by the "pair_style"_pair_style.html command. The bins are of
uniform size in radial distance. Thus a single bin encompasses a thin
shell of distances in 3d and a thin ring of distances in 2d.
The {itypeN} and {jtypeN} arguments are optional. These arguments
must come in pairs. If no pairs are listed, then a single histogram
is computed for g(r) between all atom types. If one or more pairs are
listed, then a separate histogram is generated for each
{itype},{jtype} pair.
The {itypeN} and {jtypeN} settings can be specified in one of two
ways. An explicit numeric value can be used, as in the 4th example
above. Or a wild-card asterisk can be used to specify a range of atom
types. This takes the form "*" or "*n" or "n*" or "m*n". If N = the
number of atom types, then an asterisk with no numeric values means
all types from 1 to N. A leading asterisk means all types from 1 to n
(inclusive). A trailing asterisk means all types from n to N
(inclusive). A middle asterisk means all types from m to n
(inclusive).
If both {itypeN} and {jtypeN} are single values, as in the 4th example
above, this means that a g(r) is computed where atoms of type {itypeN}
are the central atom, and atoms of type {jtypeN} are the distribution
atom. If either {itypeN} and {jtypeN} represent a range of values via
the wild-card asterisk, as in the 5th example above, this means that a
g(r) is computed where atoms of any of the range of types represented
by {itypeN} are the central atom, and atoms of any of the range of
types represented by {jtypeN} are the distribution atom.
Pairwise distances are generated by looping over a pairwise neighbor
list, just as they would be in a "pair_style"_pair_style.html
computation. The distance between two atoms I and J is included in
a specific histogram if the following criteria are met:
atoms I,J are both in the specified compute group
the distance between atoms I,J is less than the maximum force cutoff
the type of the I atom matches itypeN (one or a range of types)
the type of the J atom matches jtypeN (one or a range of types) :ul
It is OK if a particular pairwise distance is included in more than
one individual histogram, due to the way the {itypeN} and {jtypeN}
arguments are specified.
The g(r) value for a bin is calculated from the histogram count by
scaling it by the idealized number of how many counts there would be
if atoms of type {jtypeN} were uniformly distributed. Thus it
involves the count of {itypeN} atoms, the count of {jtypeN} atoms, the
volume of the entire simulation box, and the volume of the bin's thin
shell in 3d (or the area of the bin's thin ring in 2d).
A coordination number coord(r) is also calculated, which is the sum of
g(r) values for all bins up to and including the current bin.
The simplest way to output the results of the compute rdf calculation
to a file is to use the "fix ave/time"_fix_ave_time.html command, for
example:
compute myRDF all rdf 50
fix 1 all ave/time 100 1 100 c_myRDF file tmp.rdf mode vector :pre
[Output info:]
This compute calculates a global array with the number of rows =
{Nbins}, and the number of columns = 1 + 2*Npairs, where Npairs is the
number of I,J pairings specified. The first column has the bin
coordinate (center of the bin), Each successive set of 2 columns has
the g(r) and coord(r) values for a specific set of {itypeN} versus
{jtypeN} interactions, as described above. These values can be used
by any command that uses a global values from a compute as input. See
-"this section"_Section_howto.html#howto_15 for an overview of LAMMPS
-output options.
+"Section_howto 15"_Section_howto.html#howto_15 for an overview of
+LAMMPS output options.
The array values calculated by this compute are all "intensive".
The first column of array values will be in distance
"units"_units.html. The g(r) columns of array values are normalized
numbers >= 0.0. The coordination number columns of array values are
also numbers >= 0.0.
[Restrictions:]
The RDF is not computed for distances longer than the force cutoff,
since processors (in parallel) don't know about atom coordinates for
atoms further away than that distance. If you want an RDF for larger
distances, you'll need to post-process a dump file.
[Related commands:]
"fix ave/time"_fix_ave_time.html
[Default:] none
diff --git a/doc/compute_reduce.html b/doc/compute_reduce.html
index f5533307e..74dbbdd9d 100644
--- a/doc/compute_reduce.html
+++ b/doc/compute_reduce.html
@@ -1,194 +1,194 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute reduce command
</H3>
<H3>compute reduce/region command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID style arg mode input1 input2 ... keyword args ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>style = <I>reduce</I> or <I>reduce/region</I>
<PRE> <I>reduce</I> arg = none
<I>reduce/region</I> arg = region-ID
region-ID = ID of region to use for choosing atoms
</PRE>
<LI>mode = <I>sum</I> or <I>min</I> or <I>max</I> or <I>ave</I>
<LI>one or more inputs can be listed
<LI>input = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID[N], f_ID, f_ID[N], v_name
<PRE> x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (position, velocity, force component)
c_ID = per-atom or local vector calculated by a compute with ID
c_ID[I] = Ith column of per-atom or local array calculated by a compute with ID
f_ID = per-atom or local vector calculated by a fix with ID
f_ID[I] = Ith column of per-atom or local array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name
</PRE>
<LI>zero or more keyword/args pairs may be appended
<LI>keyword = <I>replace</I>
<PRE> <I>replace</I> args = vec1 vec2
vec1 = reduced value from this input vector will be replaced
vec2 = replace it with vec1[N] where N is index of max/min value from vec2
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all reduce sum c_force
compute 1 all reduce/region subbox sum c_force
compute 2 all reduce min c_press<B>2</B> f_ave v_myKE
compute 3 fluid reduce max c_index<B>1</B> c_index<B>2</B> c_dist replace 1 3 replace 2 3
</PRE>
<P><B>Description:</B>
</P>
<P>Define a calculation that "reduces" one or more vector inputs into
scalar values, one per listed input. The inputs can be per-atom or
local quantities; they cannot be global quantities. Atom attributes
are per-atom quantities, <A HREF = "compute.html">computes</A> and <A HREF = "fix.html">fixes</A>
may generate any of the three kinds of quantities, and <A HREF = "variable.html">atom-style
variables</A> generate per-atom quantities. See the
<A HREF = "variable">variable</A> command and its special functions which can
perform the same operations as the compute reduce command on global
vectors.
</P>
<P>The reduction operation is specified by the <I>mode</I> setting. The <I>sum</I>
option adds the values in the vector into a global total. The <I>min</I>
or <I>max</I> options find the minimum or maximum value across all vector
values. The <I>ave</I> setting adds the vector values into a global total,
then divides by the number of values in the vector.
</P>
<P>Each listed input is operated on independently. For per-atom inputs,
the group specified with this command means only atoms within the
group contribute to the result. For per-atom inputs, if the compute
reduce/region command is used, the atoms must also currently be within
the region. Note that an input that produces per-atom quantities may
define its own group which affects the quantities it returns. For
example, if a compute is used as an input which generates a per-atom
vector, it will generate values of 0.0 for atoms that are not in the
group specified for that compute.
</P>
<P>Each listed input can be an atom attribute (position, velocity, force
component) or can be the result of a <A HREF = "compute.html">compute</A> or
<A HREF = "fix.html">fix</A> or the evaluation of an atom-style
<A HREF = "variable.html">variable</A>.
</P>
<P>The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are
self-explanatory. Note that other atom attributes can be used as
inputs to this fix by using the <A HREF = "compute_property_atom.html">compute
property/atom</A> command and then specifying
an input value from that compute.
</P>
<P>If a value begins with "c_", a compute ID must follow which has been
previously defined in the input script. Computes can generate
per-atom or local quantities. See the individual
<A HREF = "compute.html">compute</A> doc page for details. If no bracketed integer
is appended, the vector calculated by the compute is used. If a
bracketed interger is appended, the Ith column of the array calculated
by the compute is used. Users can also write code for their own
compute styles and <A HREF = "Section_modify.html">add them to LAMMPS</A>.
</P>
<P>If a value begins with "f_", a fix ID must follow which has been
previously defined in the input script. Fixes can generate per-atom
or local quantities. See the individual <A HREF = "fix.html">fix</A> doc page for
details. Note that some fixes only produce their values on certain
timesteps, which must be compatible with when compute reduce
references the values, else an error results. If no bracketed integer
is appended, the vector calculated by the fix is used. If a bracketed
integer is appended, the Ith column of the array calculated by the fix
is used. Users can also write code for their own fix style and <A HREF = "Section_modify.html">add
them to LAMMPS</A>.
</P>
<P>If a value begins with "v_", a variable name must follow which has
been previously defined in the input script. It must be an
<A HREF = "variable.html">atom-style variable</A>. Atom-style variables can
reference thermodynamic keywords and various per-atom attributes, or
invoke other computes, fixes, or variables when they are evaluated, so
this is a very general means of generating per-atom quantities to
reduce.
</P>
<HR>
<P>If the <I>replace</I> keyword is used, two indices <I>vec1</I> and <I>vec2</I> are
specified, where each index ranges from 1 to the # of input values.
The replace keyword can only be used if the <I>mode</I> is <I>min</I> or <I>max</I>.
It works as follows. A min/max is computed as usual on the <I>vec2</I>
input vector. The index N of that value within <I>vec2</I> is also stored.
Then, instead of performing a min/max on the <I>vec1</I> input vector, the
stored index is used to select the Nth element of the <I>vec1</I> vector.
</P>
<P>Thus, for example, if you wish to use this compute to find the bond
with maximum stretch, you can do it as follows:
</P>
<PRE>compute 1 all property/local batom1 batom2
compute 2 all bond/local dist
compute 3 all reduce max c_1[1] c_1[2] c_2 replace 1 3 replace 2 3
thermo_style custom step temp c_3[1] c_3[2] c_3[3]
</PRE>
<P>The first two input values in the compute reduce command are vectors
with the IDs of the 2 atoms in each bond, using the <A HREF = "compute_property_local.html">compute
property/local</A> command. The last input
value is bond distance, using the <A HREF = "compute_bond_local.html">compute
bond/local</A> command. Instead of taking the
max of the two atom ID vectors, which does not yield useful
information in this context, the <I>replace</I> keywords will extract the
atom IDs for the two atoms in the bond of maximum stretch. These atom
IDs and the bond stretch will be printed with thermodynamic output.
</P>
<HR>
<P>If a single input is specified this compute produces a global scalar
value. If multiple inputs are specified, this compute produces a
global vector of values, the length of which is equal to the number of
inputs specified.
</P>
<P>As discussed below, for <I>sum</I> mode, the value(s) produced by this
compute are all "extensive", meaning their value scales linearly with
the number of atoms involved. If normalized values are desired, this
compute can be accessed by the <A HREF = "thermo_style.html">thermo_style custom</A>
command with <A HREF = "thermo_modify.html">thermo_modify norm yes</A> set as an
option. Or it can be accessed by a <A HREF = "variable.html">variable</A> that
divides by the appropriate atom count.
</P>
<HR>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar if a single input value is
specified or a global vector of length N where N is the number of
inputs, and which can be accessed by indices 1 to N. These values can
be used by any command that uses global scalar or vector values from a
-compute as input. See <A HREF = "Section_howto.html#howto_15">this section</A> for
-an overview of LAMMPS output options.
+compute as input. See <A HREF = "Section_howto.html#howto_15">Section_howto 15</A>
+for an overview of LAMMPS output options.
</P>
<P>All the scalar or vector values calculated by this compute are
"intensive", except when the <I>sum</I> mode is used on per-atom or local
vectors, in which case the calculated values are "extensive".
</P>
<P>The scalar or vector values will be in whatever <A HREF = "units.html">units</A> the
quantities being reduced are in.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute.html">compute</A>, <A HREF = "fix.html">fix</A>, <A HREF = "variable.html">variable</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_reduce.txt b/doc/compute_reduce.txt
index 135f83eef..be542b8d8 100644
--- a/doc/compute_reduce.txt
+++ b/doc/compute_reduce.txt
@@ -1,179 +1,179 @@
"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
compute reduce command :h3
compute reduce/region command :h3
[Syntax:]
compute ID group-ID style arg mode input1 input2 ... keyword args ... :pre
ID, group-ID are documented in "compute"_compute.html command :ulb,l
style = {reduce} or {reduce/region} :l
{reduce} arg = none
{reduce/region} arg = region-ID
region-ID = ID of region to use for choosing atoms :pre
mode = {sum} or {min} or {max} or {ave} :l
one or more inputs can be listed :l
input = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :l
x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (position, velocity, force component)
c_ID = per-atom or local vector calculated by a compute with ID
c_ID\[I\] = Ith column of per-atom or local array calculated by a compute with ID
f_ID = per-atom or local vector calculated by a fix with ID
f_ID\[I\] = Ith column of per-atom or local array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name :pre
zero or more keyword/args pairs may be appended :l
keyword = {replace} :l
{replace} args = vec1 vec2
vec1 = reduced value from this input vector will be replaced
vec2 = replace it with vec1\[N\] where N is index of max/min value from vec2 :pre
:ule
[Examples:]
compute 1 all reduce sum c_force
compute 1 all reduce/region subbox sum c_force
compute 2 all reduce min c_press[2] f_ave v_myKE
compute 3 fluid reduce max c_index[1] c_index[2] c_dist replace 1 3 replace 2 3 :pre
[Description:]
Define a calculation that "reduces" one or more vector inputs into
scalar values, one per listed input. The inputs can be per-atom or
local quantities; they cannot be global quantities. Atom attributes
are per-atom quantities, "computes"_compute.html and "fixes"_fix.html
may generate any of the three kinds of quantities, and "atom-style
variables"_variable.html generate per-atom quantities. See the
"variable"_variable command and its special functions which can
perform the same operations as the compute reduce command on global
vectors.
The reduction operation is specified by the {mode} setting. The {sum}
option adds the values in the vector into a global total. The {min}
or {max} options find the minimum or maximum value across all vector
values. The {ave} setting adds the vector values into a global total,
then divides by the number of values in the vector.
Each listed input is operated on independently. For per-atom inputs,
the group specified with this command means only atoms within the
group contribute to the result. For per-atom inputs, if the compute
reduce/region command is used, the atoms must also currently be within
the region. Note that an input that produces per-atom quantities may
define its own group which affects the quantities it returns. For
example, if a compute is used as an input which generates a per-atom
vector, it will generate values of 0.0 for atoms that are not in the
group specified for that compute.
Each listed input can be an atom attribute (position, velocity, force
component) or can be the result of a "compute"_compute.html or
"fix"_fix.html or the evaluation of an atom-style
"variable"_variable.html.
The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are
self-explanatory. Note that other atom attributes can be used as
inputs to this fix by using the "compute
property/atom"_compute_property_atom.html command and then specifying
an input value from that compute.
If a value begins with "c_", a compute ID must follow which has been
previously defined in the input script. Computes can generate
per-atom or local quantities. See the individual
"compute"_compute.html doc page for details. If no bracketed integer
is appended, the vector calculated by the compute is used. If a
bracketed interger is appended, the Ith column of the array calculated
by the compute is used. Users can also write code for their own
compute styles and "add them to LAMMPS"_Section_modify.html.
If a value begins with "f_", a fix ID must follow which has been
previously defined in the input script. Fixes can generate per-atom
or local quantities. See the individual "fix"_fix.html doc page for
details. Note that some fixes only produce their values on certain
timesteps, which must be compatible with when compute reduce
references the values, else an error results. If no bracketed integer
is appended, the vector calculated by the fix is used. If a bracketed
integer is appended, the Ith column of the array calculated by the fix
is used. Users can also write code for their own fix style and "add
them to LAMMPS"_Section_modify.html.
If a value begins with "v_", a variable name must follow which has
been previously defined in the input script. It must be an
"atom-style variable"_variable.html. Atom-style variables can
reference thermodynamic keywords and various per-atom attributes, or
invoke other computes, fixes, or variables when they are evaluated, so
this is a very general means of generating per-atom quantities to
reduce.
:line
If the {replace} keyword is used, two indices {vec1} and {vec2} are
specified, where each index ranges from 1 to the # of input values.
The replace keyword can only be used if the {mode} is {min} or {max}.
It works as follows. A min/max is computed as usual on the {vec2}
input vector. The index N of that value within {vec2} is also stored.
Then, instead of performing a min/max on the {vec1} input vector, the
stored index is used to select the Nth element of the {vec1} vector.
Thus, for example, if you wish to use this compute to find the bond
with maximum stretch, you can do it as follows:
compute 1 all property/local batom1 batom2
compute 2 all bond/local dist
compute 3 all reduce max c_1\[1\] c_1\[2\] c_2 replace 1 3 replace 2 3
thermo_style custom step temp c_3\[1\] c_3\[2\] c_3\[3\] :pre
The first two input values in the compute reduce command are vectors
with the IDs of the 2 atoms in each bond, using the "compute
property/local"_compute_property_local.html command. The last input
value is bond distance, using the "compute
bond/local"_compute_bond_local.html command. Instead of taking the
max of the two atom ID vectors, which does not yield useful
information in this context, the {replace} keywords will extract the
atom IDs for the two atoms in the bond of maximum stretch. These atom
IDs and the bond stretch will be printed with thermodynamic output.
:line
If a single input is specified this compute produces a global scalar
value. If multiple inputs are specified, this compute produces a
global vector of values, the length of which is equal to the number of
inputs specified.
As discussed below, for {sum} mode, the value(s) produced by this
compute are all "extensive", meaning their value scales linearly with
the number of atoms involved. If normalized values are desired, this
compute can be accessed by the "thermo_style custom"_thermo_style.html
command with "thermo_modify norm yes"_thermo_modify.html set as an
option. Or it can be accessed by a "variable"_variable.html that
divides by the appropriate atom count.
:line
[Output info:]
This compute calculates a global scalar if a single input value is
specified or a global vector of length N where N is the number of
inputs, and which can be accessed by indices 1 to N. These values can
be used by any command that uses global scalar or vector values from a
-compute as input. See "this section"_Section_howto.html#howto_15 for
-an overview of LAMMPS output options.
+compute as input. See "Section_howto 15"_Section_howto.html#howto_15
+for an overview of LAMMPS output options.
All the scalar or vector values calculated by this compute are
"intensive", except when the {sum} mode is used on per-atom or local
vectors, in which case the calculated values are "extensive".
The scalar or vector values will be in whatever "units"_units.html the
quantities being reduced are in.
[Restrictions:] none
[Related commands:]
"compute"_compute.html, "fix"_fix.html, "variable"_variable.html
[Default:] none
diff --git a/doc/compute_stress_atom.html b/doc/compute_stress_atom.html
index f39d75300..fb9a8634b 100644
--- a/doc/compute_stress_atom.html
+++ b/doc/compute_stress_atom.html
@@ -1,119 +1,120 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute stress/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID stress/atom keyword ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>stress/atom = style name of this compute command
<LI>zero or more keywords may be appended
<LI>keyword = <I>ke</I> or <I>pair</I> or <I>bond</I> or <I>angle</I> or <I>dihedral</I> or <I>improper</I> or <I>fix</I> or <I>virial</I>
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 mobile stress/atom
compute 1 all stress/atom pair bond
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that computes the symmetric per-atom stress
tensor for each atom in a group. The tensor for each atom has 6
components and is stored as a 6-element vector in the following order:
xx, yy, zz, xy, xz, yz. See the <A HREF = "compute_pressure.html">compute
pressure</A> command if you want the stress tensor
(pressure) of the entire system.
</P>
<P>The stress tensor for atom <I>I</I> is given by the following formula,
where <I>a</I> and <I>b</I> take on values x,y,z to generate the 6 components of
the symmetric tensor:
</P>
<CENTER><IMG SRC = "Eqs/stress_tensor.jpg">
</CENTER>
<P>The first term is a kinetic energy contribution for atom <I>I</I>. The
second term is a pairwise energy contribution where <I>n</I> loops over the
<I>Np</I> neighbors of atom <I>I</I>, <I>r1</I> and <I>r2</I> are the positions of the 2
atoms in the pairwise interaction, and <I>F1</I> and <I>F2</I> are the forces on
the 2 atoms resulting from the pairwise interaction. The third term
is a bond contribution of similar form for the <I>Nb</I> bonds which atom
<I>I</I> is part of. There are similar terms for the <I>Na</I> angle, <I>Nd</I>
dihedral, and <I>Ni</I> improper interactions atom <I>I</I> is part of.
Finally, there is a term for the <I>Nf</I> <A HREF = "fix.html">fixes</A> that apply
internal constraint forces to atom <I>I</I>. Currently, only the <A HREF = "fix_shake.html">fix
shake</A> and <A HREF = "fix_rigid.html">fix rigid</A> commands
contribute to this term.
</P>
<P>As the coefficients in the formula imply, a virial contribution
produced by a small set of atoms (e.g. 4 atoms in a dihedral or 3
atoms in a Tersoff 3-body interaction) is assigned in equal portions
to each atom in the set. E.g. 1/4 of the dihedral virial to each of
the 4 atoms, or 1/3 of the fix virial due to SHAKE constraints applied
to atoms in a a water molecule via the <A HREF = "fix_shake.html">fix shake</A>
command.
</P>
<P>If no extra keywords are listed, all of the terms in this formula are
included in the per-atom stress tensor. If any extra keywords are
listed, only those terms are summed to compute the tensor. The
<I>virial</I> keyword means include all terms except the kinetic energy
<I>ke</I>.
</P>
<P>Note that the stress for each atom is due to its interaction with all
other atoms in the simulation, not just with other atoms in the group.
</P>
<P>The <A HREF = "dihedral_charmm.html">dihedral_style charmm</A> style calculates
pairwise interactions between 1-4 atoms. The virial contribution of
these terms is included in the pair virial, not the dihedral virial.
</P>
<P>Note that as defined in the formula, per-atom stress is the negative
of the per-atom pressure tensor. It is also really a stress*volume
formulation, meaning the computed quantity is in units of
pressure*volume. It would need to be divided by a per-atom volume to
have units of stress (pressure), but an individual atom's volume is
not well defined or easy to compute in a deformed solid or a liquid.
Thus, if the diagonal components of the per-atom stress tensor are
summed for all atoms in the system and the sum is divided by dV, where
d = dimension and V is the volume of the system, the result should be
-P, where P is the total pressure of the system.
</P>
<P>These lines in an input script for a 3d system should yield that
result. I.e. the last 2 columns of thermo output will be the same:
</P>
<PRE>compute peratom all stress/atom
compute p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3]
variable press equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol)
thermo_style custom step temp etotal press v_press
</PRE>
<P>IMPORTANT NOTE: The per-atom stress does NOT include contributions due
to long-range Coulombic interactions (via the
<A HREF = "kspace_style.html">kspace_style</A> command). It's not clear this
contribution can easily be computed.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom array with 6 columns, which can be
accessed by indices 1-6 by any command that uses per-atom values from
-a compute as input. See <A HREF = "Section_howto.html#howto_15">this section</A>
-for an overview of LAMMPS output options.
+a compute as input. See <A HREF = "Section_howto.html#howto_15">Section_howto
+15</A> for an overview of LAMMPS output
+options.
</P>
<P>The per-atom array values will be in pressure*volume
<A HREF = "units.html">units</A> as discussed above.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_pe.html">compute pe</A>, <A HREF = "compute_pressure.html">compute pressure</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_stress_atom.txt b/doc/compute_stress_atom.txt
index f8d073397..6cdd4b028 100644
--- a/doc/compute_stress_atom.txt
+++ b/doc/compute_stress_atom.txt
@@ -1,114 +1,115 @@
"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
compute stress/atom command :h3
[Syntax:]
compute ID group-ID stress/atom keyword ... :pre
ID, group-ID are documented in "compute"_compute.html command
stress/atom = style name of this compute command
zero or more keywords may be appended
keyword = {ke} or {pair} or {bond} or {angle} or {dihedral} or {improper} or {fix} or {virial} :ul
[Examples:]
compute 1 mobile stress/atom
compute 1 all stress/atom pair bond :pre
[Description:]
Define a computation that computes the symmetric per-atom stress
tensor for each atom in a group. The tensor for each atom has 6
components and is stored as a 6-element vector in the following order:
xx, yy, zz, xy, xz, yz. See the "compute
pressure"_compute_pressure.html command if you want the stress tensor
(pressure) of the entire system.
The stress tensor for atom {I} is given by the following formula,
where {a} and {b} take on values x,y,z to generate the 6 components of
the symmetric tensor:
:c,image(Eqs/stress_tensor.jpg)
The first term is a kinetic energy contribution for atom {I}. The
second term is a pairwise energy contribution where {n} loops over the
{Np} neighbors of atom {I}, {r1} and {r2} are the positions of the 2
atoms in the pairwise interaction, and {F1} and {F2} are the forces on
the 2 atoms resulting from the pairwise interaction. The third term
is a bond contribution of similar form for the {Nb} bonds which atom
{I} is part of. There are similar terms for the {Na} angle, {Nd}
dihedral, and {Ni} improper interactions atom {I} is part of.
Finally, there is a term for the {Nf} "fixes"_fix.html that apply
internal constraint forces to atom {I}. Currently, only the "fix
shake"_fix_shake.html and "fix rigid"_fix_rigid.html commands
contribute to this term.
As the coefficients in the formula imply, a virial contribution
produced by a small set of atoms (e.g. 4 atoms in a dihedral or 3
atoms in a Tersoff 3-body interaction) is assigned in equal portions
to each atom in the set. E.g. 1/4 of the dihedral virial to each of
the 4 atoms, or 1/3 of the fix virial due to SHAKE constraints applied
to atoms in a a water molecule via the "fix shake"_fix_shake.html
command.
If no extra keywords are listed, all of the terms in this formula are
included in the per-atom stress tensor. If any extra keywords are
listed, only those terms are summed to compute the tensor. The
{virial} keyword means include all terms except the kinetic energy
{ke}.
Note that the stress for each atom is due to its interaction with all
other atoms in the simulation, not just with other atoms in the group.
The "dihedral_style charmm"_dihedral_charmm.html style calculates
pairwise interactions between 1-4 atoms. The virial contribution of
these terms is included in the pair virial, not the dihedral virial.
Note that as defined in the formula, per-atom stress is the negative
of the per-atom pressure tensor. It is also really a stress*volume
formulation, meaning the computed quantity is in units of
pressure*volume. It would need to be divided by a per-atom volume to
have units of stress (pressure), but an individual atom's volume is
not well defined or easy to compute in a deformed solid or a liquid.
Thus, if the diagonal components of the per-atom stress tensor are
summed for all atoms in the system and the sum is divided by dV, where
d = dimension and V is the volume of the system, the result should be
-P, where P is the total pressure of the system.
These lines in an input script for a 3d system should yield that
result. I.e. the last 2 columns of thermo output will be the same:
compute peratom all stress/atom
compute p all reduce sum c_peratom\[1\] c_peratom\[2\] c_peratom\[3\]
variable press equal -(c_p\[1\]+c_p\[2\]+c_p\[3\])/(3*vol)
thermo_style custom step temp etotal press v_press :pre
IMPORTANT NOTE: The per-atom stress does NOT include contributions due
to long-range Coulombic interactions (via the
"kspace_style"_kspace_style.html command). It's not clear this
contribution can easily be computed.
[Output info:]
This compute calculates a per-atom array with 6 columns, which can be
accessed by indices 1-6 by any command that uses per-atom values from
-a compute as input. See "this section"_Section_howto.html#howto_15
-for an overview of LAMMPS output options.
+a compute as input. See "Section_howto
+15"_Section_howto.html#howto_15 for an overview of LAMMPS output
+options.
The per-atom array values will be in pressure*volume
"units"_units.html as discussed above.
[Restrictions:] none
[Related commands:]
"compute pe"_compute_pe.html, "compute pressure"_compute_pressure.html
[Default:] none
diff --git a/doc/compute_temp.html b/doc/compute_temp.html
index 6005da58d..bf7a2615c 100644
--- a/doc/compute_temp.html
+++ b/doc/compute_temp.html
@@ -1,117 +1,117 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute temp command
</H3>
<H3>compute temp/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID temp
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>temp = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all temp
compute myTemp mobile temp
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the temperature of a group of
atoms. A compute of this style can be used by any command that
computes a temperature, e.g. <A HREF = "thermo_modify.html">thermo_modify</A>, <A HREF = "fix_temp_rescale.html">fix
temp/rescale</A>, <A HREF = "fix_nh.html">fix npt</A>, etc.
</P>
<P>The temperature is calculated by the formula KE = dim/2 N k T, where
KE = total kinetic energy of the group of atoms (sum of 1/2 m v^2),
dim = 2 or 3 = dimensionality of the simulation, N = number of atoms
in the group, k = Boltzmann constant, and T = temperature.
</P>
<P>A kinetic energy tensor, stored as a 6-element vector, is also
calculated by this compute for use in the computation of a pressure
tensor. The formula for the components of the tensor is the same as
the above formula, except that v^2 is replaced by vx*vy for the xy
component, etc. The 6 components of the vector are ordered xx, yy,
zz, xy, xz, yz.
</P>
<P>The number of atoms contributing to the temperature is assumed to be
constant for the duration of the run; use the <I>dynamic</I> option of the
<A HREF = "compute_modify.html">compute_modify</A> command if this is not the case.
</P>
<P>This compute subtracts out degrees-of-freedom due to fixes that
constrain molecular motion, such as <A HREF = "fix_shake.html">fix shake</A> and
<A HREF = "fix_rigid.html">fix rigid</A>. This means the temperature of groups of
atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the
<I>extra</I> option of the <A HREF = "compute_modify.html">compute_modify</A> command.
</P>
<P>A compute of this style with the ID of "thermo_temp" is created when
LAMMPS starts up, as if this command were in the input script:
</P>
<PRE>compute thermo_temp all temp
</PRE>
<P>See the "thermo_style" command for more details.
</P>
<P>See <A HREF = "Section_howto.html#howto_16">this howto section</A> of the manual for
a discussion of different ways to compute temperature and perform
thermostatting.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6.
These values can be used by any command that uses global scalar or
vector values from a compute as input. See <A HREF = "Section_howto.html#howto_15">this
section</A> for an overview of LAMMPS output
options.
</P>
<P>The scalar value calculated by this compute is "intensive". The
vector are "extensive".
</P>
<P>The scalar value will be in temperature <A HREF = "units.html">units</A>. The
vector values will be in energy <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_temp_partial.html">compute temp/partial</A>, <A HREF = "compute_temp_region.html">compute
temp/region</A>, <A HREF = "compute_pressure.html">compute
pressure</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_temp.txt b/doc/compute_temp.txt
index 7915e8683..d31b05bd2 100644
--- a/doc/compute_temp.txt
+++ b/doc/compute_temp.txt
@@ -1,111 +1,111 @@
"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
compute temp command :h3
compute temp/cuda command :h3
[Syntax:]
compute ID group-ID temp :pre
ID, group-ID are documented in "compute"_compute.html command
temp = style name of this compute command :ul
[Examples:]
compute 1 all temp
compute myTemp mobile temp :pre
[Description:]
Define a computation that calculates the temperature of a group of
atoms. A compute of this style can be used by any command that
computes a temperature, e.g. "thermo_modify"_thermo_modify.html, "fix
temp/rescale"_fix_temp_rescale.html, "fix npt"_fix_nh.html, etc.
The temperature is calculated by the formula KE = dim/2 N k T, where
KE = total kinetic energy of the group of atoms (sum of 1/2 m v^2),
dim = 2 or 3 = dimensionality of the simulation, N = number of atoms
in the group, k = Boltzmann constant, and T = temperature.
A kinetic energy tensor, stored as a 6-element vector, is also
calculated by this compute for use in the computation of a pressure
tensor. The formula for the components of the tensor is the same as
the above formula, except that v^2 is replaced by vx*vy for the xy
component, etc. The 6 components of the vector are ordered xx, yy,
zz, xy, xz, yz.
The number of atoms contributing to the temperature is assumed to be
constant for the duration of the run; use the {dynamic} option of the
"compute_modify"_compute_modify.html command if this is not the case.
This compute subtracts out degrees-of-freedom due to fixes that
constrain molecular motion, such as "fix shake"_fix_shake.html and
"fix rigid"_fix_rigid.html. This means the temperature of groups of
atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the
{extra} option of the "compute_modify"_compute_modify.html command.
A compute of this style with the ID of "thermo_temp" is created when
LAMMPS starts up, as if this command were in the input script:
compute thermo_temp all temp :pre
See the "thermo_style" command for more details.
See "this howto section"_Section_howto.html#howto_16 of the manual for
a discussion of different ways to compute temperature and perform
thermostatting.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Output info:]
This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6.
These values can be used by any command that uses global scalar or
vector values from a compute as input. See "this
section"_Section_howto.html#howto_15 for an overview of LAMMPS output
options.
The scalar value calculated by this compute is "intensive". The
vector are "extensive".
The scalar value will be in temperature "units"_units.html. The
vector values will be in energy "units"_units.html.
[Restrictions:] none
[Related commands:]
"compute temp/partial"_compute_temp_partial.html, "compute
temp/region"_compute_temp_region.html, "compute
pressure"_compute_pressure.html
[Default:] none
diff --git a/doc/compute_temp_partial.html b/doc/compute_temp_partial.html
index c076a2be5..c6b841c2b 100644
--- a/doc/compute_temp_partial.html
+++ b/doc/compute_temp_partial.html
@@ -1,125 +1,125 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute temp/partial command
</H3>
<H3>compute temp/partial/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID temp/partial xflag yflag zflag
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>temp/partial = style name of this compute command
<LI>xflag,yflag,zflag = 0/1 for whether to exclude/include this dimension
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute newT flow temp/partial 1 1 0
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the temperature of a group of
atoms, after excluding one or more velocity components. A compute of
this style can be used by any command that computes a temperature,
e.g. <A HREF = "thermo_modify.html">thermo_modify</A>, <A HREF = "fix_temp_rescale.html">fix
temp/rescale</A>, <A HREF = "fix_nh.html">fix npt</A>, etc.
</P>
<P>The temperature is calculated by the formula KE = dim/2 N k T, where
KE = total kinetic energy of the group of atoms (sum of 1/2 m v^2),
dim = dimensionality of the simulation, N = number of atoms in the
group, k = Boltzmann constant, and T = temperature. The calculation
of KE excludes the x, y, or z dimensions if xflag, yflag, or zflag =
0. The dim parameter is adjusted to give the correct number of
degrees of freedom.
</P>
<P>A kinetic energy tensor, stored as a 6-element vector, is also
calculated by this compute for use in the calculation of a pressure
tensor. The formula for the components of the tensor is the same as
the above formula, except that v^2 is replaced by vx*vy for the xy
component, etc. The 6 components of the vector are ordered xx, yy,
zz, xy, xz, yz.
</P>
<P>The number of atoms contributing to the temperature is assumed to be
constant for the duration of the run; use the <I>dynamic</I> option of the
<A HREF = "compute_modify.html">compute_modify</A> command if this is not the case.
</P>
<P>The removal of velocity components by this fix is essentially
computing the temperature after a "bias" has been removed from the
velocity of the atoms. If this compute is used with a fix command
that performs thermostatting then this bias will be subtracted from
each atom, thermostatting of the remaining thermal velocity will be
performed, and the bias will be added back in. Thermostatting fixes
that work in this way include <A HREF = "fix_nh.html">fix nvt</A>, <A HREF = "fix_temp_rescale.html">fix
temp/rescale</A>, <A HREF = "fix_temp_berendsen.html">fix
temp/berendsen</A>, and <A HREF = "fix_langevin.html">fix
langevin</A>.
</P>
<P>This compute subtracts out degrees-of-freedom due to fixes that
constrain molecular motion, such as <A HREF = "fix_shake.html">fix shake</A> and
<A HREF = "fix_rigid.html">fix rigid</A>. This means the temperature of groups of
atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the
<I>extra</I> option of the <A HREF = "compute_modify.html">compute_modify</A> command.
</P>
<P>See <A HREF = "Section_howto.html#howto_16">this howto section</A> of the manual for
a discussion of different ways to compute temperature and perform
thermostatting.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6.
These values can be used by any command that uses global scalar or
vector values from a compute as input. See <A HREF = "Section_howto.html#howto_15">this
section</A> for an overview of LAMMPS output
options.
</P>
<P>The scalar value calculated by this compute is "intensive". The
vector values are "extensive".
</P>
<P>The scalar value will be in temperature <A HREF = "units.html">units</A>. The
vector values will be in energy <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_temp.html">compute temp</A>, <A HREF = "compute_temp_region.html">compute
temp/region</A>, <A HREF = "compute_pressure.html">compute
pressure</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/compute_temp_partial.txt b/doc/compute_temp_partial.txt
index ab5d42f9d..525ab972a 100644
--- a/doc/compute_temp_partial.txt
+++ b/doc/compute_temp_partial.txt
@@ -1,119 +1,119 @@
"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
compute temp/partial command :h3
compute temp/partial/cuda command :h3
[Syntax:]
compute ID group-ID temp/partial xflag yflag zflag :pre
ID, group-ID are documented in "compute"_compute.html command
temp/partial = style name of this compute command
xflag,yflag,zflag = 0/1 for whether to exclude/include this dimension :ul
[Examples:]
compute newT flow temp/partial 1 1 0 :pre
[Description:]
Define a computation that calculates the temperature of a group of
atoms, after excluding one or more velocity components. A compute of
this style can be used by any command that computes a temperature,
e.g. "thermo_modify"_thermo_modify.html, "fix
temp/rescale"_fix_temp_rescale.html, "fix npt"_fix_nh.html, etc.
The temperature is calculated by the formula KE = dim/2 N k T, where
KE = total kinetic energy of the group of atoms (sum of 1/2 m v^2),
dim = dimensionality of the simulation, N = number of atoms in the
group, k = Boltzmann constant, and T = temperature. The calculation
of KE excludes the x, y, or z dimensions if xflag, yflag, or zflag =
0. The dim parameter is adjusted to give the correct number of
degrees of freedom.
A kinetic energy tensor, stored as a 6-element vector, is also
calculated by this compute for use in the calculation of a pressure
tensor. The formula for the components of the tensor is the same as
the above formula, except that v^2 is replaced by vx*vy for the xy
component, etc. The 6 components of the vector are ordered xx, yy,
zz, xy, xz, yz.
The number of atoms contributing to the temperature is assumed to be
constant for the duration of the run; use the {dynamic} option of the
"compute_modify"_compute_modify.html command if this is not the case.
The removal of velocity components by this fix is essentially
computing the temperature after a "bias" has been removed from the
velocity of the atoms. If this compute is used with a fix command
that performs thermostatting then this bias will be subtracted from
each atom, thermostatting of the remaining thermal velocity will be
performed, and the bias will be added back in. Thermostatting fixes
that work in this way include "fix nvt"_fix_nh.html, "fix
temp/rescale"_fix_temp_rescale.html, "fix
temp/berendsen"_fix_temp_berendsen.html, and "fix
langevin"_fix_langevin.html.
This compute subtracts out degrees-of-freedom due to fixes that
constrain molecular motion, such as "fix shake"_fix_shake.html and
"fix rigid"_fix_rigid.html. This means the temperature of groups of
atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the
{extra} option of the "compute_modify"_compute_modify.html command.
See "this howto section"_Section_howto.html#howto_16 of the manual for
a discussion of different ways to compute temperature and perform
thermostatting.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Output info:]
This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6.
These values can be used by any command that uses global scalar or
vector values from a compute as input. See "this
section"_Section_howto.html#howto_15 for an overview of LAMMPS output
options.
The scalar value calculated by this compute is "intensive". The
vector values are "extensive".
The scalar value will be in temperature "units"_units.html. The
vector values will be in energy "units"_units.html.
[Restrictions:] none
[Related commands:]
"compute temp"_compute_temp.html, "compute
temp/region"_compute_temp_region.html, "compute
pressure"_compute_pressure.html
[Default:] none
diff --git a/doc/compute_ti.html b/doc/compute_ti.html
index 4e997fb1c..b3e7c6358 100644
--- a/doc/compute_ti.html
+++ b/doc/compute_ti.html
@@ -1,124 +1,125 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute ti command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group ti keyword args ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>ti = style name of this compute command
<LI>one or more attribute/arg pairs may be appended
<LI>keyword = pair style (lj/cut, gauss, born, etc) or <I>tail</I> or <I>kspace</I>
<PRE> pair style args = v_name1 v_name2
v_name1 = variable with name1 that is energy scale factor and function of lambda
v_name2 = variable with name2 that is derivative of v_name1 with respect to lambda
<I>tail</I> args = v_name1 v_name2
v_name1 = variable with name1 that is energy tail correction scale factor and function of lambda
v_name2 = variable with name2 that is derivative of v_name1 with respect to lambda
<I>kspace</I> args = v_name1 v_name2
v_name1 = variable with name1 that is K-Space scale factor and function of lambda
v_name2 = variable with name2 that is derivative of v_name1 with respect to lambda
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all ti lj/cut v_lj v_dlj coul/long v_c v_dc kspace v_ks v_dks
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the derivative of the interaction
potential with respect to <I>lambda</I>, the coupling parameter used in a
thermodynamic integration. This derivative can be used to infer a
free energy difference resulting from an alchemical simulation, as
described in <A HREF = "#Eike">Eike</A>.
</P>
<P>Typically this compute will be used in conjunction with the <A HREF = "fix_adapt.html">fix
adapt</A> command which can perform alchemical
transformations by adusting the strength of an interaction potential
as a simulation runs, as defined by one or more
<A HREF = "pair_style.html">pair_style</A> or <A HREF = "kspace_style.html">kspace_style</A>
commands. This scaling is done via a prefactor on the energy, forces,
virial calculated by the pair or K-Space style. The prefactor is
often a function of a <I>lambda</I> parameter which may be adjusted from 0
to 1 (or vice versa) over the course of a <A HREF = "run.html">run</A>. The
time-dependent adjustment is what the <A HREF = "fix_adapt.html">fix adapt</A>
command does.
</P>
<P>Assume that the unscaled energy of a pair_style or kspace_style is
given by U. Then the scaled energy is
</P>
<PRE>Us = f(lambda) U
</PRE>
<P>where f() is some function of lambda. What this compute calculates is
</P>
<PRE>dUs / d(lambda) = U df(lambda)/dlambda = Us / f(lambda) df(lambda)/dlambda
</PRE>
<P>which is the derivative of the system's scaled potential energy Us
with respect to <I>lambda</I>.
</P>
<P>To do this calculation, you provide two functions, as <A HREF = "variable.html">equal-style
variables</A>. The first is specified as <I>v_name1</I>, where
<I>name1</I> is the name of the variable, and is f(lambda) in the notation
above. The second is specified as <I>v_name2</I>, where <I>name2</I> is the
name of the variable, and is df(lambda) / dlambda in the notation
above. I.e. it is the analytic derivative of f() with respect to
lambda. Note that the <I>name1</I> variable is also typically given as an
argument to the <A HREF = "fix_adapt.html">fix adapt</A> command.
</P>
<P>An alchemical simulation may use several pair potentials together,
invoked via the <A HREF = "pair_hybrid.html">pair_style hybrid or hybrid/overlay</A>
command. The total dUs/dlambda for the overall system is calculated
as the sum of each contributing term as listed by the keywords in the
compute ti command. Individual pair potentials can be listed, which
will be sub-styles in the hybrid case. You can also include a K-space
term via the <I>kspace</I> keyword. You can also include a pairwise
long-range tail correction to the energy via the <I>tail</I> keyword.
</P>
<P>For each term you can specify a different (or the same) scale factor
by the two variables that you list. Again, these will typically
correspond toe the scale factors applied to these various potentials
and the K-Space contribution via the <A HREF = "fix_adapt.html">fix_adapt</A>
command.
</P>
<P>More details about the exact functional forms for the computation of
du/dl can be found in the paper by <A HREF = "#Eike">Eike</A>.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar, namely dUs/dlambda. This
value can be used by any command that uses a global scalar value from
-a compute as input. See <A HREF = "Section_howto.html#howto_15">this section</A>
-for an overview of LAMMPS output options.
+a compute as input. See <A HREF = "Section_howto.html#howto_15">Section_howto
+15</A> for an overview of LAMMPS output
+options.
</P>
<P>The scalar value calculated by this compute is "extensive".
</P>
<P>The scalar value will be in energy <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_adapt.html">fix adapt</A>
</P>
<P><B>Default:</B> none
</P>
<A NAME = "Eike"></A>
<P><B>(Eike)</B> Eike and Maginn, Journal of Chemical Physics, 124, 164503 (2006).
</P>
</HTML>
diff --git a/doc/compute_ti.txt b/doc/compute_ti.txt
index 1d8041ae9..11888ddb1 100644
--- a/doc/compute_ti.txt
+++ b/doc/compute_ti.txt
@@ -1,113 +1,114 @@
"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
compute ti command :h3
[Syntax:]
compute ID group ti keyword args ... :pre
ID, group-ID are documented in "compute"_compute.html command :ulb,l
ti = style name of this compute command :l
one or more attribute/arg pairs may be appended :l
keyword = pair style (lj/cut, gauss, born, etc) or {tail} or {kspace} :l
pair style args = v_name1 v_name2
v_name1 = variable with name1 that is energy scale factor and function of lambda
v_name2 = variable with name2 that is derivative of v_name1 with respect to lambda
{tail} args = v_name1 v_name2
v_name1 = variable with name1 that is energy tail correction scale factor and function of lambda
v_name2 = variable with name2 that is derivative of v_name1 with respect to lambda
{kspace} args = v_name1 v_name2
v_name1 = variable with name1 that is K-Space scale factor and function of lambda
v_name2 = variable with name2 that is derivative of v_name1 with respect to lambda :pre
:ule
[Examples:]
compute 1 all ti lj/cut v_lj v_dlj coul/long v_c v_dc kspace v_ks v_dks :pre
[Description:]
Define a computation that calculates the derivative of the interaction
potential with respect to {lambda}, the coupling parameter used in a
thermodynamic integration. This derivative can be used to infer a
free energy difference resulting from an alchemical simulation, as
described in "Eike"_#Eike.
Typically this compute will be used in conjunction with the "fix
adapt"_fix_adapt.html command which can perform alchemical
transformations by adusting the strength of an interaction potential
as a simulation runs, as defined by one or more
"pair_style"_pair_style.html or "kspace_style"_kspace_style.html
commands. This scaling is done via a prefactor on the energy, forces,
virial calculated by the pair or K-Space style. The prefactor is
often a function of a {lambda} parameter which may be adjusted from 0
to 1 (or vice versa) over the course of a "run"_run.html. The
time-dependent adjustment is what the "fix adapt"_fix_adapt.html
command does.
Assume that the unscaled energy of a pair_style or kspace_style is
given by U. Then the scaled energy is
Us = f(lambda) U :pre
where f() is some function of lambda. What this compute calculates is
dUs / d(lambda) = U df(lambda)/dlambda = Us / f(lambda) df(lambda)/dlambda :pre
which is the derivative of the system's scaled potential energy Us
with respect to {lambda}.
To do this calculation, you provide two functions, as "equal-style
variables"_variable.html. The first is specified as {v_name1}, where
{name1} is the name of the variable, and is f(lambda) in the notation
above. The second is specified as {v_name2}, where {name2} is the
name of the variable, and is df(lambda) / dlambda in the notation
above. I.e. it is the analytic derivative of f() with respect to
lambda. Note that the {name1} variable is also typically given as an
argument to the "fix adapt"_fix_adapt.html command.
An alchemical simulation may use several pair potentials together,
invoked via the "pair_style hybrid or hybrid/overlay"_pair_hybrid.html
command. The total dUs/dlambda for the overall system is calculated
as the sum of each contributing term as listed by the keywords in the
compute ti command. Individual pair potentials can be listed, which
will be sub-styles in the hybrid case. You can also include a K-space
term via the {kspace} keyword. You can also include a pairwise
long-range tail correction to the energy via the {tail} keyword.
For each term you can specify a different (or the same) scale factor
by the two variables that you list. Again, these will typically
correspond toe the scale factors applied to these various potentials
and the K-Space contribution via the "fix_adapt"_fix_adapt.html
command.
More details about the exact functional forms for the computation of
du/dl can be found in the paper by "Eike"_#Eike.
[Output info:]
This compute calculates a global scalar, namely dUs/dlambda. This
value can be used by any command that uses a global scalar value from
-a compute as input. See "this section"_Section_howto.html#howto_15
-for an overview of LAMMPS output options.
+a compute as input. See "Section_howto
+15"_Section_howto.html#howto_15 for an overview of LAMMPS output
+options.
The scalar value calculated by this compute is "extensive".
The scalar value will be in energy "units"_units.html.
[Restrictions:] none
[Related commands:]
"fix adapt"_fix_adapt.html
[Default:] none
:link(Eike)
[(Eike)] Eike and Maginn, Journal of Chemical Physics, 124, 164503 (2006).
diff --git a/doc/create_box.html b/doc/create_box.html
index 974af9ee3..235e2bc3f 100644
--- a/doc/create_box.html
+++ b/doc/create_box.html
@@ -1,98 +1,98 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>create_box command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>create_box N region-ID
</PRE>
<UL><LI>N = # of atom types to use in this simulation
<LI>region-ID = ID of region to use as simulation domain
</UL>
<P><B>Examples:</B>
</P>
<PRE>create_box 2 mybox
</PRE>
<P><B>Description:</B>
</P>
<P>This command creates a simulation box based on the specified region.
Thus a <A HREF = "region.html">region</A> command must first be used to define a
geometric domain.
</P>
<P>The argument N is the number of atom types that will be used in the
simulation.
</P>
<P>If the region is not of style <I>prism</I>, then LAMMPS encloses the region
(block, sphere, etc) with an axis-aligned orthogonal bounding box
which becomes the simulation domain.
</P>
<P>If the region is of style <I>prism</I>, LAMMPS creates a non-orthogonal
simulation domain shaped as a parallelepiped with triclinic symmetry.
As defined by the <A HREF = "region.html">region prism</A> command, the
parallelepiped has its "origin" at (xlo,ylo,zlo) and is defined by 3
edge vectors starting from the origin given by A = (xhi-xlo,0,0); B =
(xy,yhi-ylo,0); C = (xz,yz,zhi-zlo). <I>Xy,xz,yz</I> can be 0.0 or
positive or negative values and are called "tilt factors" because they
are the amount of displacement applied to faces of an originally
orthogonal box to transform it into the parallelipiped.
</P>
<P>A <I>prism</I> region used with the create_box command must have tilt
factors (xy,xz,yz) that do not skew the box more than half the
distance of the parallel box length. For example, if xlo = 2 and xhi
= 12, then the x box length is 10 and the xy tilt factor must be
between -5 and 5. Similarly, both xz and yz must be between
-(xhi-xlo)/2 and +(yhi-ylo)/2. Note that this is not a limitation,
since if the maximum tilt factor is 5 (as in this example), then
configurations with tilt = ..., -15, -5, 5, 15, 25, ... are all
geometrically equivalent.
</P>
-<P>See <A HREF = "Section_howto.html#howto_12">this section</A> of the doc pages for a
-geometric description of triclinic boxes, as defined by LAMMPS, and
-how to transform these parameters to and from other commonly used
+<P>See <A HREF = "Section_howto.html#howto_12">Section_howto 12</A> of the doc pages
+for a geometric description of triclinic boxes, as defined by LAMMPS,
+and how to transform these parameters to and from other commonly used
triclinic representations.
</P>
<P>When a prism region is used, the simulation domain must be periodic in
any dimensions with a non-zero tilt factor, as defined by the
<A HREF = "boundary.html">boundary</A> command. I.e. if the xy tilt factor is
non-zero, then both the x and y dimensions must be periodic.
Similarly, x and z must be periodic if xz is non-zero and y and z must
be periodic if yz is non-zero. Also note that if your simulation will
tilt the box, e.g. via the <A HREF = "fix_deform.html">fix deform</A> command, the
simulation box must be defined as triclinic, even if the tilt factors
are initially 0.0.
</P>
<P>IMPORTANT NOTE: If the system is non-periodic (in a dimension), then
you should not make the lo/hi box dimensions (as defined in your
<A HREF = "region.html">region</A> command) radically smaller/larger than the extent
of the atoms you eventually plan to create, e.g. via the
<A HREF = "create_atoms.html">create_atoms</A> command. For example, if your atoms
extend from 0 to 50, you should not specify the box bounds as -10000
and 10000. This is because LAMMPS uses the specified box size to
layout the 3d grid of processors. A huge (mostly empty) box will be
sub-optimal for performance when using "fixed" boundary conditions
(see the <A HREF = "boundary.html">boundary</A> command). When using "shrink-wrap"
boundary conditions (see the <A HREF = "boundary.html">boundary</A> command), a huge
(mostly empty) box may cause a parallel simulation to lose atoms the
first time that LAMMPS shrink-wraps the box around the atoms.
</P>
<P><B>Restrictions:</B>
</P>
<P>An <A HREF = "atom_style.html">atom_style</A> and <A HREF = "region.html">region</A> must have
been previously defined to use this command.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "create_atoms.html">create_atoms</A>, <A HREF = "region.html">region</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/create_box.txt b/doc/create_box.txt
index 247486503..08fce9e6b 100644
--- a/doc/create_box.txt
+++ b/doc/create_box.txt
@@ -1,93 +1,93 @@
"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
create_box command :h3
[Syntax:]
create_box N region-ID :pre
N = # of atom types to use in this simulation
region-ID = ID of region to use as simulation domain :ul
[Examples:]
create_box 2 mybox :pre
[Description:]
This command creates a simulation box based on the specified region.
Thus a "region"_region.html command must first be used to define a
geometric domain.
The argument N is the number of atom types that will be used in the
simulation.
If the region is not of style {prism}, then LAMMPS encloses the region
(block, sphere, etc) with an axis-aligned orthogonal bounding box
which becomes the simulation domain.
If the region is of style {prism}, LAMMPS creates a non-orthogonal
simulation domain shaped as a parallelepiped with triclinic symmetry.
As defined by the "region prism"_region.html command, the
parallelepiped has its "origin" at (xlo,ylo,zlo) and is defined by 3
edge vectors starting from the origin given by A = (xhi-xlo,0,0); B =
(xy,yhi-ylo,0); C = (xz,yz,zhi-zlo). {Xy,xz,yz} can be 0.0 or
positive or negative values and are called "tilt factors" because they
are the amount of displacement applied to faces of an originally
orthogonal box to transform it into the parallelipiped.
A {prism} region used with the create_box command must have tilt
factors (xy,xz,yz) that do not skew the box more than half the
distance of the parallel box length. For example, if xlo = 2 and xhi
= 12, then the x box length is 10 and the xy tilt factor must be
between -5 and 5. Similarly, both xz and yz must be between
-(xhi-xlo)/2 and +(yhi-ylo)/2. Note that this is not a limitation,
since if the maximum tilt factor is 5 (as in this example), then
configurations with tilt = ..., -15, -5, 5, 15, 25, ... are all
geometrically equivalent.
-See "this section"_Section_howto.html#howto_12 of the doc pages for a
-geometric description of triclinic boxes, as defined by LAMMPS, and
-how to transform these parameters to and from other commonly used
+See "Section_howto 12"_Section_howto.html#howto_12 of the doc pages
+for a geometric description of triclinic boxes, as defined by LAMMPS,
+and how to transform these parameters to and from other commonly used
triclinic representations.
When a prism region is used, the simulation domain must be periodic in
any dimensions with a non-zero tilt factor, as defined by the
"boundary"_boundary.html command. I.e. if the xy tilt factor is
non-zero, then both the x and y dimensions must be periodic.
Similarly, x and z must be periodic if xz is non-zero and y and z must
be periodic if yz is non-zero. Also note that if your simulation will
tilt the box, e.g. via the "fix deform"_fix_deform.html command, the
simulation box must be defined as triclinic, even if the tilt factors
are initially 0.0.
IMPORTANT NOTE: If the system is non-periodic (in a dimension), then
you should not make the lo/hi box dimensions (as defined in your
"region"_region.html command) radically smaller/larger than the extent
of the atoms you eventually plan to create, e.g. via the
"create_atoms"_create_atoms.html command. For example, if your atoms
extend from 0 to 50, you should not specify the box bounds as -10000
and 10000. This is because LAMMPS uses the specified box size to
layout the 3d grid of processors. A huge (mostly empty) box will be
sub-optimal for performance when using "fixed" boundary conditions
(see the "boundary"_boundary.html command). When using "shrink-wrap"
boundary conditions (see the "boundary"_boundary.html command), a huge
(mostly empty) box may cause a parallel simulation to lose atoms the
first time that LAMMPS shrink-wraps the box around the atoms.
[Restrictions:]
An "atom_style"_atom_style.html and "region"_region.html must have
been previously defined to use this command.
[Related commands:]
"create_atoms"_create_atoms.html, "region"_region.html
[Default:] none
diff --git a/doc/dihedral_charmm.html b/doc/dihedral_charmm.html
index 6c3104c6e..37f910922 100644
--- a/doc/dihedral_charmm.html
+++ b/doc/dihedral_charmm.html
@@ -1,120 +1,120 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>dihedral_style charmm command
</H3>
<H3>dihedral_style charmm/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>dihedral_style charmm
</PRE>
<P><B>Examples:</B>
</P>
<PRE>dihedral_style charmm
dihedral_coeff 1 120.0 1 60 0.5
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>charmm</I> dihedral style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/dihedral_charmm.jpg">
</CENTER>
<P>See <A HREF = "#MacKerell">(MacKerell)</A> for a description of the CHARMM force
field. This dihedral style can also be used for the AMBER force field
(see comment on weighting factors below). See <A HREF = "#Cornell">(Cornell)</A>
for a description of the AMBER force field.
</P>
<P>The following coefficients must be defined for each dihedral type via the
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>K (energy)
<LI>n (integer >= 0)
<LI>d (integer value of degrees)
<LI>weighting factor (0.0 to 1.0)
</UL>
<P>The weighting factor is applied to pairwise interaction between the
1st and 4th atoms in the dihedral, which are computed by a CHARMM
<A HREF = "pair_charmm.html">pair_style</A> with epsilon and sigma values specified
with a <A HREF = "pair_charmm.html">pair_coeff</A> command. Note that this
weighting factor is unrelated to the weighting factor specified by the
<A HREF = "special_bonds.html">special bonds</A> command which applies to all 1-4
interactions in the system.
</P>
<P>For CHARMM force fields, the special_bonds 1-4 weighting factor should
be set to 0.0. This is because the pair styles that contain "charmm"
(e.g. <A HREF = "pair_charmm.html">pair_style lj/charmm/coul/long</A>) define extra
1-4 interaction coefficients that are used by this dihedral style to
compute those interactions explicitly. This means that if any of the
weighting factors defined as dihedral coefficients (4th coeff above)
are non-zero, then you must use a charmm pair style. Note that if you
do not set the special_bonds 1-4 weighting factor to 0.0 (which is the
default) then 1-4 interactions in dihedrals will be computed twice,
once by the pair routine and once by the dihedral routine, which is
probably not what you want.
</P>
<P>For AMBER force fields, the special_bonds 1-4 weighting factor should
be set to the AMBER defaults (1/2 and 5/6) and all the dihedral
weighting factors (4th coeff above) should be set to 0.0. In this
case, you can use any pair style you wish, since the dihedral does not
need any 1-4 information.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This dihedral style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dihedral_coeff.html">dihedral_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Cornell"></A>
<P><B>(Cornell)</B> Cornell, Cieplak, Bayly, Gould, Merz, Ferguson,
Spellmeyer, Fox, Caldwell, Kollman, JACS 117, 5179-5197 (1995).
</P>
<A NAME = "MacKerell"></A>
<P><B>(MacKerell)</B> MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field,
Fischer, Gao, Guo, Ha, et al, J Phys Chem B, 102, 3586 (1998).
</P>
</HTML>
diff --git a/doc/dihedral_charmm.txt b/doc/dihedral_charmm.txt
index c0b959ffb..712967358 100644
--- a/doc/dihedral_charmm.txt
+++ b/doc/dihedral_charmm.txt
@@ -1,112 +1,112 @@
"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
dihedral_style charmm command :h3
dihedral_style charmm/omp command :h3
[Syntax:]
dihedral_style charmm :pre
[Examples:]
dihedral_style charmm
dihedral_coeff 1 120.0 1 60 0.5 :pre
[Description:]
The {charmm} dihedral style uses the potential
:c,image(Eqs/dihedral_charmm.jpg)
See "(MacKerell)"_#MacKerell for a description of the CHARMM force
field. This dihedral style can also be used for the AMBER force field
(see comment on weighting factors below). See "(Cornell)"_#Cornell
for a description of the AMBER force field.
The following coefficients must be defined for each dihedral type via the
"dihedral_coeff"_dihedral_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
K (energy)
n (integer >= 0)
d (integer value of degrees)
weighting factor (0.0 to 1.0) :ul
The weighting factor is applied to pairwise interaction between the
1st and 4th atoms in the dihedral, which are computed by a CHARMM
"pair_style"_pair_charmm.html with epsilon and sigma values specified
with a "pair_coeff"_pair_charmm.html command. Note that this
weighting factor is unrelated to the weighting factor specified by the
"special bonds"_special_bonds.html command which applies to all 1-4
interactions in the system.
For CHARMM force fields, the special_bonds 1-4 weighting factor should
be set to 0.0. This is because the pair styles that contain "charmm"
(e.g. "pair_style lj/charmm/coul/long"_pair_charmm.html) define extra
1-4 interaction coefficients that are used by this dihedral style to
compute those interactions explicitly. This means that if any of the
weighting factors defined as dihedral coefficients (4th coeff above)
are non-zero, then you must use a charmm pair style. Note that if you
do not set the special_bonds 1-4 weighting factor to 0.0 (which is the
default) then 1-4 interactions in dihedrals will be computed twice,
once by the pair routine and once by the dihedral routine, which is
probably not what you want.
For AMBER force fields, the special_bonds 1-4 weighting factor should
be set to the AMBER defaults (1/2 and 5/6) and all the dihedral
weighting factors (4th coeff above) should be set to 0.0. In this
case, you can use any pair style you wish, since the dihedral does not
need any 1-4 information.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This dihedral style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"dihedral_coeff"_dihedral_coeff.html
[Default:] none
:line
:link(Cornell)
[(Cornell)] Cornell, Cieplak, Bayly, Gould, Merz, Ferguson,
Spellmeyer, Fox, Caldwell, Kollman, JACS 117, 5179-5197 (1995).
:link(MacKerell)
[(MacKerell)] MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field,
Fischer, Gao, Guo, Ha, et al, J Phys Chem B, 102, 3586 (1998).
diff --git a/doc/dihedral_class2.html b/doc/dihedral_class2.html
index 79e7b47d9..dcc8e8343 100644
--- a/doc/dihedral_class2.html
+++ b/doc/dihedral_class2.html
@@ -1,184 +1,184 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>dihedral_style class2 command
</H3>
<H3>dihedral_style class2/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>dihedral_style class2
</PRE>
<P><B>Examples:</B>
</P>
<PRE>dihedral_style class2
dihedral_coeff 1 100 75 100 70 80 60
dihedral_coeff * mbt 3.5945 0.1704 -0.5490 1.5228
dihedral_coeff * ebt 0.3417 0.3264 -0.9036 0.1368 0.0 -0.8080 1.0119 1.1010
dihedral_coeff 2 at 0.0 -0.1850 -0.7963 -2.0220 0.0 -0.3991 110.2453 105.1270
dihedral_coeff * aat -13.5271 110.2453 105.1270
dihedral_coeff * bb13 0.0 1.0119 1.1010
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>class2</I> dihedral style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/dihedral_class2.jpg">
</CENTER>
<P>where Ed is the dihedral term, Embt is a middle-bond-torsion term,
Eebt is an end-bond-torsion term, Eat is an angle-torsion term, Eaat
is an angle-angle-torsion term, and Ebb13 is a bond-bond-13 term.
</P>
<P>Theta1 and theta2 are equilibrium angles and r1 r2 r3 are equilibrium
bond lengths.
</P>
<P>See <A HREF = "#Sun">(Sun)</A> for a description of the COMPASS class2 force field.
</P>
<P>Coefficients for the Ed, Embt, Eebt, Eat, Eaat, and Ebb13 formulas
must be defined for each dihedral type via the
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> command as in the example above,
or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands.
</P>
<P>These are the 6 coefficients for the Ed formula:
</P>
<UL><LI>K1 (energy)
<LI>phi1 (degrees)
<LI>K2 (energy)
<LI>phi2 (degrees)
<LI>K3 (energy)
<LI>phi3 (degrees)
</UL>
<P>For the Embt formula, each line in a
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> command in the input script lists
5 coefficients, the first of which is "mbt" to indicate they are
MiddleBondTorsion coefficients. In a data file, these coefficients
should be listed under a "MiddleBondTorsion Coeffs" heading and you
must leave out the "mbt", i.e. only list 4 coefficients after the
dihedral type.
</P>
<UL><LI>mbt
<LI>A1 (energy/distance)
<LI>A2 (energy/distance)
<LI>A3 (energy/distance)
<LI>r2 (distance)
</UL>
<P>For the Eebt formula, each line in a
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> command in the input script lists
9 coefficients, the first of which is "ebt" to indicate they are
EndBondTorsion coefficients. In a data file, these coefficients
should be listed under a "EndBondTorsion Coeffs" heading and you must
leave out the "ebt", i.e. only list 8 coefficients after the dihedral
type.
</P>
<UL><LI>ebt
<LI>B1 (energy/distance)
<LI>B2 (energy/distance)
<LI>B3 (energy/distance)
<LI>C1 (energy/distance)
<LI>C2 (energy/distance)
<LI>C3 (energy/distance)
<LI>r1 (distance)
<LI>r3 (distance)
</UL>
<P>For the Eat formula, each line in a
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> command in the input script lists
9 coefficients, the first of which is "at" to indicate they are
AngleTorsion coefficients. In a data file, these coefficients should
be listed under a "AngleTorsion Coeffs" heading and you must leave out
the "at", i.e. only list 8 coefficients after the dihedral type.
</P>
<UL><LI>at
<LI>D1 (energy/radian)
<LI>D2 (energy/radian)
<LI>D3 (energy/radian)
<LI>E1 (energy/radian)
<LI>E2 (energy/radian)
<LI>E3 (energy/radian)
<LI>theta1 (degrees)
<LI>theta2 (degrees)
</UL>
<P>Theta1 and theta2 are specified in degrees, but LAMMPS converts them
to radians internally; hence the units of D and E are in
energy/radian.
</P>
<P>For the Eaat formula, each line in a
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> command in the input script lists
4 coefficients, the first of which is "aat" to indicate they are
AngleAngleTorsion coefficients. In a data file, these coefficients
should be listed under a "AngleAngleTorsion Coeffs" heading and you
must leave out the "aat", i.e. only list 3 coefficients after the
dihedral type.
</P>
<UL><LI>aat
<LI>M (energy/radian^2)
<LI>theta1 (degrees)
<LI>theta2 (degrees)
</UL>
<P>Theta1 and theta2 are specified in degrees, but LAMMPS converts them
to radians internally; hence the units of M are in energy/radian^2.
</P>
<P>For the Ebb13 formula, each line in a
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> command in the input script lists
4 coefficients, the first of which is "bb13" to indicate they are
BondBond13 coefficients. In a data file, these coefficients should be
listed under a "BondBond13 Coeffs" heading and you must leave out the
"bb13", i.e. only list 3 coefficients after the dihedral type.
</P>
<UL><LI>bb13
<LI>N (energy/distance^2)
<LI>r1 (distance)
<LI>r3 (distance)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This dihedral style can only be used if LAMMPS was built with the
CLASS2 package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dihedral_coeff.html">dihedral_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Sun"></A>
<P><B>(Sun)</B> Sun, J Phys Chem B 102, 7338-7364 (1998).
</P>
</HTML>
diff --git a/doc/dihedral_class2.txt b/doc/dihedral_class2.txt
index ab60aa381..391facf94 100644
--- a/doc/dihedral_class2.txt
+++ b/doc/dihedral_class2.txt
@@ -1,177 +1,177 @@
"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
dihedral_style class2 command :h3
dihedral_style class2/omp command :h3
[Syntax:]
dihedral_style class2 :pre
[Examples:]
dihedral_style class2
dihedral_coeff 1 100 75 100 70 80 60
dihedral_coeff * mbt 3.5945 0.1704 -0.5490 1.5228
dihedral_coeff * ebt 0.3417 0.3264 -0.9036 0.1368 0.0 -0.8080 1.0119 1.1010
dihedral_coeff 2 at 0.0 -0.1850 -0.7963 -2.0220 0.0 -0.3991 110.2453 105.1270
dihedral_coeff * aat -13.5271 110.2453 105.1270
dihedral_coeff * bb13 0.0 1.0119 1.1010 :pre
[Description:]
The {class2} dihedral style uses the potential
:c,image(Eqs/dihedral_class2.jpg)
where Ed is the dihedral term, Embt is a middle-bond-torsion term,
Eebt is an end-bond-torsion term, Eat is an angle-torsion term, Eaat
is an angle-angle-torsion term, and Ebb13 is a bond-bond-13 term.
Theta1 and theta2 are equilibrium angles and r1 r2 r3 are equilibrium
bond lengths.
See "(Sun)"_#Sun for a description of the COMPASS class2 force field.
Coefficients for the Ed, Embt, Eebt, Eat, Eaat, and Ebb13 formulas
must be defined for each dihedral type via the
"dihedral_coeff"_dihedral_coeff.html command as in the example above,
or in the data file or restart files read by the
"read_data"_read_data.html or "read_restart"_read_restart.html
commands.
These are the 6 coefficients for the Ed formula:
K1 (energy)
phi1 (degrees)
K2 (energy)
phi2 (degrees)
K3 (energy)
phi3 (degrees) :ul
For the Embt formula, each line in a
"dihedral_coeff"_dihedral_coeff.html command in the input script lists
5 coefficients, the first of which is "mbt" to indicate they are
MiddleBondTorsion coefficients. In a data file, these coefficients
should be listed under a "MiddleBondTorsion Coeffs" heading and you
must leave out the "mbt", i.e. only list 4 coefficients after the
dihedral type.
mbt
A1 (energy/distance)
A2 (energy/distance)
A3 (energy/distance)
r2 (distance) :ul
For the Eebt formula, each line in a
"dihedral_coeff"_dihedral_coeff.html command in the input script lists
9 coefficients, the first of which is "ebt" to indicate they are
EndBondTorsion coefficients. In a data file, these coefficients
should be listed under a "EndBondTorsion Coeffs" heading and you must
leave out the "ebt", i.e. only list 8 coefficients after the dihedral
type.
ebt
B1 (energy/distance)
B2 (energy/distance)
B3 (energy/distance)
C1 (energy/distance)
C2 (energy/distance)
C3 (energy/distance)
r1 (distance)
r3 (distance) :ul
For the Eat formula, each line in a
"dihedral_coeff"_dihedral_coeff.html command in the input script lists
9 coefficients, the first of which is "at" to indicate they are
AngleTorsion coefficients. In a data file, these coefficients should
be listed under a "AngleTorsion Coeffs" heading and you must leave out
the "at", i.e. only list 8 coefficients after the dihedral type.
at
D1 (energy/radian)
D2 (energy/radian)
D3 (energy/radian)
E1 (energy/radian)
E2 (energy/radian)
E3 (energy/radian)
theta1 (degrees)
theta2 (degrees) :ul
Theta1 and theta2 are specified in degrees, but LAMMPS converts them
to radians internally; hence the units of D and E are in
energy/radian.
For the Eaat formula, each line in a
"dihedral_coeff"_dihedral_coeff.html command in the input script lists
4 coefficients, the first of which is "aat" to indicate they are
AngleAngleTorsion coefficients. In a data file, these coefficients
should be listed under a "AngleAngleTorsion Coeffs" heading and you
must leave out the "aat", i.e. only list 3 coefficients after the
dihedral type.
aat
M (energy/radian^2)
theta1 (degrees)
theta2 (degrees) :ul
Theta1 and theta2 are specified in degrees, but LAMMPS converts them
to radians internally; hence the units of M are in energy/radian^2.
For the Ebb13 formula, each line in a
"dihedral_coeff"_dihedral_coeff.html command in the input script lists
4 coefficients, the first of which is "bb13" to indicate they are
BondBond13 coefficients. In a data file, these coefficients should be
listed under a "BondBond13 Coeffs" heading and you must leave out the
"bb13", i.e. only list 3 coefficients after the dihedral type.
bb13
N (energy/distance^2)
r1 (distance)
r3 (distance) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This dihedral style can only be used if LAMMPS was built with the
CLASS2 package. See the "Making LAMMPS"_Section_start.html#start_3
section for more info on packages.
[Related commands:]
"dihedral_coeff"_dihedral_coeff.html
[Default:] none
:line
:link(Sun)
[(Sun)] Sun, J Phys Chem B 102, 7338-7364 (1998).
diff --git a/doc/dihedral_cosine_shift_exp.html b/doc/dihedral_cosine_shift_exp.html
index c6ab2cae7..f0270280a 100644
--- a/doc/dihedral_cosine_shift_exp.html
+++ b/doc/dihedral_cosine_shift_exp.html
@@ -1,91 +1,91 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>dihedral_style cosine/shift/exp command
</H3>
<H3>dihedral_style cosine/shift/exp/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>dihedral_style cosine/shift/exp
</PRE>
<P><B>Examples:</B>
</P>
<PRE>dihedral_style cosine/shift/exp
dihedral_coeff 1 10.0 45.0 2.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>cosine/shift/exp</I> dihedral style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/dihedral_cosine_shift_exp.jpg">
</CENTER>
<P>where Umin, theta, and a are defined for each dihedral type.
</P>
<P>The potential is bounded between [-Umin:0] and the minimum is located
at the angle theta0. The a parameter can be both positive or negative
and is used to control the spring constant at the equilibrium.
</P>
<P>The spring constant is given by k=a exp(a) Umin/ [2 (Exp(a)-1)].
For a>3 k/Umin = a/2 to better than 5% relative error. For negative
values of the a parameter, the spring constant is essentially zero,
and anharmonic terms takes over. The potential is furthermore well
behaved in the limit a->0, where it has been implemented to linear
order in a for a < 0.001.
</P>
<P>The following coefficients must be defined for each dihedral type via
the <A HREF = "dihedral_coeff.html">dihedral_coeff</A> command as in the example
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>umin (energy)
<LI>theta (angle)
<LI>A (real number)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This dihedral style can only be used if LAMMPS was built with the
USER-MISC package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dihedral_coeff.html">dihedral_coeff</A>,
<A HREF = "angle_cosineshiftexp.html">angle_cosineshiftexp</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/dihedral_cosine_shift_exp.txt b/doc/dihedral_cosine_shift_exp.txt
index d1e1c8223..1807d1c7e 100644
--- a/doc/dihedral_cosine_shift_exp.txt
+++ b/doc/dihedral_cosine_shift_exp.txt
@@ -1,85 +1,85 @@
"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
dihedral_style cosine/shift/exp command :h3
dihedral_style cosine/shift/exp/omp command :h3
[Syntax:]
dihedral_style cosine/shift/exp :pre
[Examples:]
dihedral_style cosine/shift/exp
dihedral_coeff 1 10.0 45.0 2.0 :pre
[Description:]
The {cosine/shift/exp} dihedral style uses the potential
:c,image(Eqs/dihedral_cosine_shift_exp.jpg)
where Umin, theta, and a are defined for each dihedral type.
The potential is bounded between \[-Umin:0\] and the minimum is located
at the angle theta0. The a parameter can be both positive or negative
and is used to control the spring constant at the equilibrium.
The spring constant is given by k=a exp(a) Umin/ \[2 (Exp(a)-1)\].
For a>3 k/Umin = a/2 to better than 5% relative error. For negative
values of the a parameter, the spring constant is essentially zero,
and anharmonic terms takes over. The potential is furthermore well
behaved in the limit a->0, where it has been implemented to linear
order in a for a < 0.001.
The following coefficients must be defined for each dihedral type via
the "dihedral_coeff"_dihedral_coeff.html command as in the example
above, or in the data file or restart files read by the
"read_data"_read_data.html or "read_restart"_read_restart.html
commands:
umin (energy)
theta (angle)
A (real number) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This dihedral style can only be used if LAMMPS was built with the
USER-MISC package. See the "Making LAMMPS"_Section_start.html#start_3
section for more info on packages.
[Related commands:]
"dihedral_coeff"_dihedral_coeff.html,
"angle_cosineshiftexp"_angle_cosineshiftexp.html
[Default:] none
diff --git a/doc/dihedral_harmonic.html b/doc/dihedral_harmonic.html
index d8c3a73f6..ad361cfce 100644
--- a/doc/dihedral_harmonic.html
+++ b/doc/dihedral_harmonic.html
@@ -1,76 +1,76 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>dihedral_style harmonic command
</H3>
<H3>dihedral_style harmonic/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>dihedral_style harmonic
</PRE>
<P><B>Examples:</B>
</P>
<PRE>dihedral_style harmonic
dihedral_coeff 1 80.0 1 2
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>harmonic</I> dihedral style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/dihedral_harmonic.jpg">
</CENTER>
<P>The following coefficients must be defined for each dihedral type via the
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>K (energy)
<LI>d (+1 or -1)
<LI>n (integer >= 0)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This dihedral style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dihedral_coeff.html">dihedral_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/dihedral_harmonic.txt b/doc/dihedral_harmonic.txt
index a076931a0..8eefbc02b 100644
--- a/doc/dihedral_harmonic.txt
+++ b/doc/dihedral_harmonic.txt
@@ -1,70 +1,70 @@
"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
dihedral_style harmonic command :h3
dihedral_style harmonic/omp command :h3
[Syntax:]
dihedral_style harmonic :pre
[Examples:]
dihedral_style harmonic
dihedral_coeff 1 80.0 1 2 :pre
[Description:]
The {harmonic} dihedral style uses the potential
:c,image(Eqs/dihedral_harmonic.jpg)
The following coefficients must be defined for each dihedral type via the
"dihedral_coeff"_dihedral_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
K (energy)
d (+1 or -1)
n (integer >= 0) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This dihedral style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"dihedral_coeff"_dihedral_coeff.html
[Default:] none
diff --git a/doc/dihedral_helix.html b/doc/dihedral_helix.html
index 86b372833..f95b796e1 100644
--- a/doc/dihedral_helix.html
+++ b/doc/dihedral_helix.html
@@ -1,90 +1,90 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>dihedral_style helix command
</H3>
<H3>dihedral_style helix/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>dihedral_style helix
</PRE>
<P><B>Examples:</B>
</P>
<PRE>dihedral_style helix
dihedral_coeff 1 80.0 100.0 40.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>helix</I> dihedral style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/dihedral_helix.jpg">
</CENTER>
<P>This coarse-grain dihedral potential is described in <A HREF = "#Guo">(Guo)</A>.
For dihedral angles in the helical region, the energy function is
represented by a standard potential consisting of three minima, one
corresponding to the trans (t) state and the other to gauche states
(g+ and g-). The paper describes how the A,B,C parameters are chosen
so as to balance secondary (largely driven by local interactions) and
tertiary structure (driven by long-range interactions).
</P>
<P>The following coefficients must be defined for each dihedral type via the
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>A (energy)
<LI>B (energy)
<LI>C (energy)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This dihedral style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dihedral_coeff.html">dihedral_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Guo"></A>
<P><B>(Guo)</B> Guo and Thirumalai, Journal of Molecular Biology, 263, 323-43 (1996).
</P>
</HTML>
diff --git a/doc/dihedral_helix.txt b/doc/dihedral_helix.txt
index 8792c1076..7706c04c2 100644
--- a/doc/dihedral_helix.txt
+++ b/doc/dihedral_helix.txt
@@ -1,83 +1,83 @@
"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
dihedral_style helix command :h3
dihedral_style helix/omp command :h3
[Syntax:]
dihedral_style helix :pre
[Examples:]
dihedral_style helix
dihedral_coeff 1 80.0 100.0 40.0 :pre
[Description:]
The {helix} dihedral style uses the potential
:c,image(Eqs/dihedral_helix.jpg)
This coarse-grain dihedral potential is described in "(Guo)"_#Guo.
For dihedral angles in the helical region, the energy function is
represented by a standard potential consisting of three minima, one
corresponding to the trans (t) state and the other to gauche states
(g+ and g-). The paper describes how the A,B,C parameters are chosen
so as to balance secondary (largely driven by local interactions) and
tertiary structure (driven by long-range interactions).
The following coefficients must be defined for each dihedral type via the
"dihedral_coeff"_dihedral_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
A (energy)
B (energy)
C (energy) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This dihedral style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"dihedral_coeff"_dihedral_coeff.html
[Default:] none
:line
:link(Guo)
[(Guo)] Guo and Thirumalai, Journal of Molecular Biology, 263, 323-43 (1996).
diff --git a/doc/dihedral_multi_harmonic.html b/doc/dihedral_multi_harmonic.html
index 10601f336..4872c2934 100644
--- a/doc/dihedral_multi_harmonic.html
+++ b/doc/dihedral_multi_harmonic.html
@@ -1,78 +1,78 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>dihedral_style multi/harmonic command
</H3>
<H3>dihedral_style multi/harmonic/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>dihedral_style multi/harmonic
</PRE>
<P><B>Examples:</B>
</P>
<PRE>dihedral_style multi/harmonic
dihedral_coeff 1 20 20 20 20 20
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>multi/harmonic</I> dihedral style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/dihedral_multi_harmonic.jpg">
</CENTER>
<P>The following coefficients must be defined for each dihedral type via the
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>A1 (energy)
<LI>A2 (energy)
<LI>A3 (energy)
<LI>A4 (energy)
<LI>A5 (energy)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This dihedral style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dihedral_coeff.html">dihedral_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/dihedral_multi_harmonic.txt b/doc/dihedral_multi_harmonic.txt
index 505857fe8..97b87546a 100644
--- a/doc/dihedral_multi_harmonic.txt
+++ b/doc/dihedral_multi_harmonic.txt
@@ -1,72 +1,72 @@
"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
dihedral_style multi/harmonic command :h3
dihedral_style multi/harmonic/omp command :h3
[Syntax:]
dihedral_style multi/harmonic :pre
[Examples:]
dihedral_style multi/harmonic
dihedral_coeff 1 20 20 20 20 20 :pre
[Description:]
The {multi/harmonic} dihedral style uses the potential
:c,image(Eqs/dihedral_multi_harmonic.jpg)
The following coefficients must be defined for each dihedral type via the
"dihedral_coeff"_dihedral_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
A1 (energy)
A2 (energy)
A3 (energy)
A4 (energy)
A5 (energy) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This dihedral style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"dihedral_coeff"_dihedral_coeff.html
[Default:] none
diff --git a/doc/dihedral_opls.html b/doc/dihedral_opls.html
index e0656dd83..6bedadc0c 100644
--- a/doc/dihedral_opls.html
+++ b/doc/dihedral_opls.html
@@ -1,88 +1,88 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>dihedral_style opls command
</H3>
<H3>dihedral_style opls/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>dihedral_style opls
</PRE>
<P><B>Examples:</B>
</P>
<PRE>dihedral_style opls
dihedral_coeff 1 90.0 90.0 90.0 70.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>opls</I> dihedral style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/dihedral_opls.jpg">
</CENTER>
<P>Note that the usual 1/2 factor is not included in the K values.
</P>
<P>This dihedral potential is used in the OPLS force field and is
described in <A HREF = "#Watkins">(Watkins)</A>.
</P>
<P>The following coefficients must be defined for each dihedral type via the
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> command as in the example above, or in
the data file or restart files read by the <A HREF = "read_data.html">read_data</A>
or <A HREF = "read_restart.html">read_restart</A> commands:
</P>
<UL><LI>K1 (energy)
<LI>K2 (energy)
<LI>K3 (energy)
<LI>K4 (energy)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This dihedral style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dihedral_coeff.html">dihedral_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Watkins"></A>
<P><B>(Watkins)</B> Watkins and Jorgensen, J Phys Chem A, 105, 4118-4125 (2001).
</P>
</HTML>
diff --git a/doc/dihedral_opls.txt b/doc/dihedral_opls.txt
index c43e7a279..d12ced983 100644
--- a/doc/dihedral_opls.txt
+++ b/doc/dihedral_opls.txt
@@ -1,81 +1,81 @@
"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
dihedral_style opls command :h3
dihedral_style opls/omp command :h3
[Syntax:]
dihedral_style opls :pre
[Examples:]
dihedral_style opls
dihedral_coeff 1 90.0 90.0 90.0 70.0 :pre
[Description:]
The {opls} dihedral style uses the potential
:c,image(Eqs/dihedral_opls.jpg)
Note that the usual 1/2 factor is not included in the K values.
This dihedral potential is used in the OPLS force field and is
described in "(Watkins)"_#Watkins.
The following coefficients must be defined for each dihedral type via the
"dihedral_coeff"_dihedral_coeff.html command as in the example above, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
K1 (energy)
K2 (energy)
K3 (energy)
K4 (energy) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This dihedral style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"dihedral_coeff"_dihedral_coeff.html
[Default:] none
:line
:link(Watkins)
[(Watkins)] Watkins and Jorgensen, J Phys Chem A, 105, 4118-4125 (2001).
diff --git a/doc/dimension.html b/doc/dimension.html
index 5a0866c05..c4ebeccf7 100644
--- a/doc/dimension.html
+++ b/doc/dimension.html
@@ -1,53 +1,53 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>dimension command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>dimension N
</PRE>
<UL><LI>N = 2 or 3
</UL>
<P><B>Examples:</B>
</P>
<PRE>dimension 2
</PRE>
<P><B>Description:</B>
</P>
<P>Set the dimensionality of the simulation. By default LAMMPS runs 3d
simulations. To run a 2d simulation, this command should be used
prior to setting up a simulation box via the
<A HREF = "create_box.html">create_box</A> or <A HREF = "read_data.html">read_data</A> commands.
Restart files also store this setting.
</P>
-<P>See the discussion in <A HREF = "Section_howto.html">this section</A> for additional
-instructions on how to run 2d simulations.
+<P>See the discussion in <A HREF = "Section_howto.html">Section_howto</A> for
+additional instructions on how to run 2d simulations.
</P>
<P>IMPORTANT NOTE: Some models in LAMMPS treat particles as extended
spheres or ellipsoids, as opposed to point particles. In 2d, the
particles will still be spheres or ellipsoids, not circular disks or
ellipses, meaning their moment of inertia will be the same as in 3d.
</P>
<P><B>Restrictions:</B>
</P>
<P>This command must be used before the simulation box is defined by a
<A HREF = "read_data.html">read_data</A> or <A HREF = "create_box.html">create_box</A> command.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_enforce2d.html">fix enforce2d</A>
</P>
<P><B>Default:</B>
</P>
<PRE>dimension 3
</PRE>
</HTML>
diff --git a/doc/dimension.txt b/doc/dimension.txt
index 00e5bcfeb..e8e843c80 100644
--- a/doc/dimension.txt
+++ b/doc/dimension.txt
@@ -1,48 +1,48 @@
"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
dimension command :h3
[Syntax:]
dimension N :pre
N = 2 or 3 :ul
[Examples:]
dimension 2 :pre
[Description:]
Set the dimensionality of the simulation. By default LAMMPS runs 3d
simulations. To run a 2d simulation, this command should be used
prior to setting up a simulation box via the
"create_box"_create_box.html or "read_data"_read_data.html commands.
Restart files also store this setting.
-See the discussion in "this section"_Section_howto.html for additional
-instructions on how to run 2d simulations.
+See the discussion in "Section_howto"_Section_howto.html for
+additional instructions on how to run 2d simulations.
IMPORTANT NOTE: Some models in LAMMPS treat particles as extended
spheres or ellipsoids, as opposed to point particles. In 2d, the
particles will still be spheres or ellipsoids, not circular disks or
ellipses, meaning their moment of inertia will be the same as in 3d.
[Restrictions:]
This command must be used before the simulation box is defined by a
"read_data"_read_data.html or "create_box"_create_box.html command.
[Related commands:]
"fix enforce2d"_fix_enforce2d.html
[Default:]
dimension 3 :pre
diff --git a/doc/dump.html b/doc/dump.html
index 23bd26c17..8e8c90349 100644
--- a/doc/dump.html
+++ b/doc/dump.html
@@ -1,540 +1,540 @@
<HTML>
<CENTER> <A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>dump command
</H3>
<H3><A HREF = "dump_image.html">dump image</A> command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>dump ID group-ID style N file args
</PRE>
<UL><LI>ID = user-assigned name for the dump
<LI>group-ID = ID of the group of atoms to be dumped
<LI>style = <I>atom</I> or <I>cfg</I> or <I>dcd</I> or <I>xtc</I> or <I>xyz</I> or <I>image</I> or <I>local</I> or <I>custom</I>
<LI>N = dump every this many timesteps
<LI>file = name of file to write dump info to
<LI>args = list of arguments for a particular style
<PRE> <I>atom</I> args = none
<I>cfg</I> args = same as <I>custom</I> args, see below
<I>dcd</I> args = none
<I>xtc</I> args = none
<I>xyz</I> args = none
</PRE>
<PRE> <I>image</I> args = discussed on <A HREF = "dump_image.html">dump image</A> doc page
</PRE>
<PRE> <I>local</I> args = list of local attributes
possible attributes = index, c_ID, c_ID[N], f_ID, f_ID[N]
index = enumeration of local values
c_ID = local vector calculated by a compute with ID
c_ID[N] = Nth column of local array calculated by a compute with ID
f_ID = local vector calculated by a fix with ID
f_ID[N] = Nth column of local array calculated by a fix with ID
</PRE>
<PRE> <I>custom</I> args = list of atom attributes
possible attributes = id, mol, type, element, mass,
x, y, z, xs, ys, zs, xu, yu, zu,
xsu, ysu, zsu, ix, iy, iz,
vx, vy, vz, fx, fy, fz,
q, mux, muy, muz, mu,
radius, diameter, omegax, omegay, omegaz,
angmomx, angmomy, angmomz, tqx, tqy, tqz,
spin, eradius, ervel, erforce,
c_ID, c_ID[N], f_ID, f_ID[N], v_name
</PRE>
<PRE> id = atom ID
mol = molecule ID
type = atom type
element = name of atom element, as defined by <A HREF = "dump_modify.html">dump_modify</A> command
mass = atom mass
x,y,z = unscaled atom coordinates
xs,ys,zs = scaled atom coordinates
xu,yu,zu = unwrapped atom coordinates
xsu,ysu,zsu = scaled unwrapped atom coordinates
ix,iy,iz = box image that the atom is in
vx,vy,vz = atom velocities
fx,fy,fz = forces on atoms
q = atom charge
mux,muy,muz = orientation of dipole moment of atom
mu = magnitude of dipole moment of atom
radius,diameter = radius,diameter of spherical particle
omegax,omegay,omegaz = angular velocity of extended particle
angmomx,angmomy,angmomz = angular momentum of extended particle
tqx,tqy,tqz = torque on extended particles
spin = electron spin
eradius = electron radius
ervel = electron radial velocity
erforce = electron radial force
c_ID = per-atom vector calculated by a compute with ID
c_ID[N] = Nth column of per-atom array calculated by a compute with ID
f_ID = per-atom vector calculated by a fix with ID
f_ID[N] = Nth column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>dump myDump all atom 100 dump.atom
dump 2 subgroup atom 50 dump.run.bin
dump 4a all custom 100 dump.myforce.* id type x y vx fx
dump 4b flow custom 100 dump.%.myforce id type c_myF[3] v_ke
dump 2 inner cfg 10 dump.snap.*.cfg id type xs ys zs vx vy vz
dump snap all cfg 100 dump.config.*.cfg id type xs ys zs id type c_Stress<B>2</B>
dump 1 all xtc 1000 file.xtc
dump e_data all custom 100 dump.eff id type x y z spin eradius fx fy fz eforce
</PRE>
<P><B>Description:</B>
</P>
<P>Dump a snapshot of atom quantities to one or more files every N
timesteps in one of several styles. The <I>image</I> style is the
exception; it creates a JPG or PPM image file of the atom
configuration every N timesteps, as discussed on the <A HREF = "dump_image.html">dump
image</A> doc page.
</P>
<P>Only information for atoms in the specified group is dumped. The
<A HREF = "dump_modify.html">dump_modify thresh and region</A> commands can also
alter what atoms are included. Not all styles support all these
options; see details below.
</P>
<P>As described below, the filename determines the kind of output (text
or binary or gzipped, one big file or one per timestep, one big file
or one per processor).
</P>
<P>IMPORTANT NOTE: Because periodic boundary conditions are enforced only
on timesteps when neighbor lists are rebuilt, the coordinates of an
atom written to a dump file may be slightly outside the simulation
box.
</P>
<P>IMPORTANT NOTE: Unless the <A HREF = "dump_modify.html">dump_modify sort</A> option
is invoked, the lines of atom information written to dump files
(typically one line per atom) will be in an indeterminate order for
each snapshot. This is even true when running on a single processor,
if the <A HREF = "atom_modify.html">atom_modify sort</A> option is on, which it is
by default. In this case atoms are re-ordered periodically during a
simulation, due to spatial sorting. It is also true when running in
parallel, because data for a single snapshot is collected from
multiple processors.
</P>
<P>For the <I>atom</I>, <I>custom</I>, <I>cfg</I>, and <I>local</I> styles, sorting is off by
default. For the <I>dcd</I>, <I>xtc</I>, and <I>xyz</I> styles, sorting by atom ID
is on by default. See the <A HREF = "dump_modify.html">dump_modify</A> doc page for
details.
</P>
<HR>
<P>The <I>style</I> keyword determines what atom quantities are written to the
file and in what format. Settings made via the
<A HREF = "dump_modify.html">dump_modify</A> command can also alter the format of
individual values and the file itself.
</P>
<P>The <I>atom</I>, <I>local</I>, and <I>custom</I> styles create files in a simple text
format that is self-explanatory when viewing a dump file. Many of the
LAMMPS <A HREF = "Section_tools.html">post-processing tools</A>, including
<A HREF = "http://www.sandia.gov/~sjplimp/pizza.html">Pizza.py</A>, work with
this format.
</P>
<P>For post-processing purposes the <I>atom</I> and <I>custom</I> text files are
self-describing in the following sense.
</P>
<P>The dimensions of the simulation box are included in each snapshot.
For an orthogonal simulation box this information is is formatted as:
</P>
<PRE>ITEM: BOX BOUNDS xx yy zz
xlo xhi
ylo yhi
zlo zhi
</PRE>
<P>where xlo,xhi are the maximum extents of the simulation box in the
x-dimension, and similarly for y and z. The "xx yy zz" represent 6
characters that encode the style of boundary for each of the 6
simulation box boundaries (xlo,xhi and ylo,yhi and zlo,zhi). Each of
the 6 characters is either p = periodic, f = fixed, s = shrink wrap,
or m = shrink wrapped with a minimum value. See the
<A HREF = "doc/boundary.html">boundary</A> command for details.
</P>
<P>For triclinic simulation boxes (non-orthogonal), an orthogonal
bounding box which encloses the triclinic simulation box is output,
along with the 3 tilt factors (xy, xz, yz) of the triclinic box,
formatted as follows:
</P>
<PRE>ITEM: BOX BOUNDS xy xz yz xx yy zz
xlo_bound xhi_bound xy
ylo_bound yhi_bound xz
zlo_bound zhi_bound yz
</PRE>
<P>The presence of the text "xy xz yz" in the ITEM line indicates that
the 3 tilt factors will be included on each of the 3 following lines.
This bounding box is convenient for many visualization programs. The
meaning of the 6 character flags for "xx yy zz" is the same as above.
</P>
<P>Note that the first two numbers on each line are now xlo_bound instead
of xlo, etc, since they repesent a bounding box. See <A HREF = "Section_howto.html#howto_12">this
section</A> of the doc pages for a geometric
description of triclinic boxes, as defined by LAMMPS, simple formulas
for how the 6 bounding box extents (xlo_bound,xhi_bound,etc) are
calculated from the triclinic parameters, and how to transform those
parameters to and from other commonly used triclinic representations.
</P>
<P>The "ITEM: ATOMS" line in each snapshot lists column descriptors for
the per-atom lines that follow. For example, the descriptors would be
"id type xs ys zs" for the default <I>atom</I> style, and would be the atom
attributes you specify in the dump command for the <I>custom</I> style.
</P>
<P>For style <I>atom</I>, atom coordinates are written to the file, along with
the atom ID and atom type. By default, atom coords are written in a
scaled format (from 0 to 1). I.e. an x value of 0.25 means the atom
is at a location 1/4 of the distance from xlo to xhi of the box
boundaries. The format can be changed to unscaled coords via the
<A HREF = "dump_modify.html">dump_modify</A> settings. Image flags can also be
added for each atom via dump_modify.
</P>
<P>Style <I>custom</I> allows you to specify a list of atom attributes to be
written to the dump file for each atom. Possible attributes are
listed above and will appear in the order specified. You cannot
specify a quantity that is not defined for a particular simulation -
such as <I>q</I> for atom style <I>bond</I>, since that atom style doesn't
assign charges. Dumps occur at the very end of a timestep, so atom
attributes will include effects due to fixes that are applied during
the timestep. An explanation of the possible dump custom attributes
is given below.
</P>
<P>For style <I>local</I>, local output generated by <A HREF = "compute.html">computes</A>
and <A HREF = "fix.html">fixes</A> is used to gnerate lines of output that is
written to the dump file. This local data is typically calculated by
each processor based on the atoms it owns, but there may be zero or
more entities per atom, e.g. a list of bond distances. An explanation
of the possible dump local attributes is given below. Note that by
using input from the <A HREF = "compute_property_local.html">compute
property/local</A> command with dump local,
it is possible to generate information on bonds, angles, etc that can
be cut and pasted directly into a data file read by the
<A HREF = "read_data.html">read_data</A> command.
</P>
<P>Style <I>cfg</I> has the same command syntax as style <I>custom</I> and writes
extended CFG format files, as used by the
<A HREF = "http://mt.seas.upenn.edu/Archive/Graphics/A">AtomEye</A> visualization
package. Since the extended CFG format uses a single snapshot of the
system per file, a wildcard "*" must be included in the filename, as
discussed below. The list of atom attributes for style <I>cfg</I> must
begin with either "id type xs ys zs" or "id type xsu ysu zsu" or
since these quantities are needed to
write the CFG files in the appropriate format (though the "id" and
"type" fields do not appear explicitly in the file). Any remaining
attributes will be stored as "auxiliary properties" in the CFG files.
Note that you will typically want to use the <A HREF = "dump_modify.html">dump_modify
element</A> command with CFG-formatted files, to
associate element names with atom types, so that AtomEye can render
atoms appropriately. When unwrapped coordinates <I>xsu</I>, <I>ysu</I>, and <I>zsu</I>
are requested, the nominal AtomEye periodic cell dimensions are expanded
by a large factor UNWRAPEXPAND = 10.0, which ensures atoms that are
displayed correctly for up to UNWRAPEXPAND/2 periodic boundary crossings
in any direction.
Beyond this, AtomEye will rewrap the unwrapped coordinates.
The expansion causes the atoms to be drawn farther
away from the viewer, but it is easy to zoom the atoms closer, and
the interatomic distances are unaffected.
</P>
<P>The <I>dcd</I> style writes DCD files, a standard atomic trajectory format
used by the CHARMM, NAMD, and XPlor molecular dynamics packages. DCD
files are binary and thus may not be portable to different machines.
The number of atoms per snapshot cannot change with the <I>dcd</I> style.
The <I>unwrap</I> option of the <A HREF = "dump_modify.html">dump_modify</A> command
allows DCD coordinates to be written "unwrapped" by the image flags
for each atom. Unwrapped means that if the atom has passed through
a periodic boundary one or more times, the value is printed for what
the coordinate would be if it had not been wrapped back into the
periodic box. Note that these coordinates may thus be far outside
the box size stored with the snapshot.
</P>
<P>The <I>xtc</I> style writes XTC files, a compressed trajectory format used
by the GROMACS molecular dynamics package, and described
<A HREF = "http://manual.gromacs.org/current/online/xtc.html">here</A>.
The precision used in XTC files can be adjusted via the
<A HREF = "dump_modify.html">dump_modify</A> command. The default value of 1000
means that coordinates are stored to 1/1000 nanometer accuracy. XTC
files are portable binary files written in the NFS XDR data format,
so that any machine which supports XDR should be able to read them.
The number of atoms per snapshot cannot change with the <I>xtc</I> style.
The <I>unwrap</I> option of the <A HREF = "dump_modify.html">dump_modify</A> command allows
XTC coordinates to be written "unwrapped" by the image flags for each
atom. Unwrapped means that if the atom has passed thru a periodic
boundary one or more times, the value is printed for what the
coordinate would be if it had not been wrapped back into the periodic
box. Note that these coordinates may thus be far outside the box size
stored with the snapshot.
</P>
<P>The <I>xyz</I> style writes XYZ files, which is a simple text-based
coordinate format that many codes can read.
</P>
<P>Note that DCD, XTC, and XYZ formatted files can be read directly by
<A HREF = "http://www.ks.uiuc.edu/Research/vmd">VMD</A> (a popular molecular viewing
-program). See <A HREF = "Section_tools.html#vmd">this section</A> of the manual and
-the tools/lmp2vmd/README.txt file for more information about support
-in VMD for reading and visualizing LAMMPS dump files.
+program). See <A HREF = "Section_tools.html#vmd">Section tools</A> of the manual
+and the tools/lmp2vmd/README.txt file for more information about
+support in VMD for reading and visualizing LAMMPS dump files.
</P>
<HR>
<P>Dumps are performed on timesteps that are a multiple of N (including
timestep 0) and on the last timestep of a minimization if the
minimization converges. Note that this means a dump will not be
performed on the initial timestep after the dump command is invoked,
if the current timestep is not a multiple of N. This behavior can be
changed via the <A HREF = "dump_modify.html">dump_modify first</A> command, which
can be useful if the dump command is invoked after a minimization
ended on an arbitrary timestep. N can be changed between runs by
using the <A HREF = "dump_modify.html">dump_modify every</A> command (not allowed
for <I>dcd</I> style).
</P>
<P>The specified filename determines how the dump file(s) is written.
The default is to write one large text file, which is opened when the
dump command is invoked and closed when an <A HREF = "undump.html">undump</A>
command is used or when LAMMPS exits. For the <I>dcd</I> and <I>xtc</I> styles,
this is a single large binary file.
</P>
<P>Dump filenames can contain two wildcard characters. If a "*"
character appears in the filename, then one file per snapshot is
written and the "*" character is replaced with the timestep value.
For example, tmp.dump.* becomes tmp.dump.0, tmp.dump.10000,
tmp.dump.20000, etc. This option is not available for the <I>dcd</I> and
<I>xtc</I> styles. Note that the <A HREF = "dump_modify.html">dump_modify pad</A>
command can be used to insure all timestep numbers are the same length
(e.g. 00010), which can make it easier to read a series of dump files
in order by some post-processing tools.
</P>
<P>If a "%" character appears in the filename, then one file is written
for each processor and the "%" character is replaced with the
processor ID from 0 to P-1. For example, tmp.dump.% becomes
tmp.dump.0, tmp.dump.1, ... tmp.dump.P-1, etc. This creates smaller
files and can be a fast mode of output on parallel machines that
support parallel I/O for output. This option is not available for the
<I>dcd</I>, <I>xtc</I>, and <I>xyz</I> styles.
</P>
<P>Note that the "*" and "%" characters can be used together to produce a
large number of small dump files!
</P>
<P>If the filename ends with ".bin", the dump file (or files, if "*" or
"%" is also used) is written in binary format. A binary dump file
will be about the same size as a text version, but will typically
write out much faster. Of course, when post-processing, you will need
to convert it back to text format (see the <A HREF = "Section_tools.html#binary">binary2txt
tool</A>) or write your own code to read the
binary file. The format of the binary file can be understood by
looking at the tools/binary2txt.cpp file. This option is only
available for the <I>atom</I> and <I>custom</I> styles.
</P>
<P>If the filename ends with ".gz", the dump file (or files, if "*" or "%"
is also used) is written in gzipped format. A gzipped dump file will
be about 3x smaller than the text version, but will also take longer
to write. This option is not available for the <I>dcd</I> and <I>xtc</I>
styles.
</P>
<HR>
<P>This section explains the local attributes that can be specified as
part of the <I>local</I> style.
</P>
<P>The <I>index</I> attribute can be used to generate an index number from 1
to N for each line written into the dump file, where N is the total
number of local datums from all processors, or lines of output that
will appear in the snapshot. Note that because data from different
processors depend on what atoms they currently own, and atoms migrate
between processor, there is no guarantee that the same index will be
used for the same info (e.g. a particular bond) in successive
snapshots.
</P>
<P>The <I>c_ID</I> and <I>c_ID[N]</I> attributes allow local vectors or arrays
calculated by a <A HREF = "compute.html">compute</A> to be output. The ID in the
attribute should be replaced by the actual ID of the compute that has
been defined previously in the input script. See the
<A HREF = "compute.html">compute</A> command for details. There are computes for
calculating local information such as indices, types, and energies for
bonds and angles.
</P>
<P>Note that computes which calculate global or per-atom quantities, as
opposed to local quantities, cannot be output in a dump local command.
Instead, global quantities can be output by the <A HREF = "thermo_style.html">thermo_style
custom</A> command, and per-atom quantities can be
output by the dump custom command.
</P>
<P>If <I>c_ID</I> is used as a attribute, then the local vector calculated by
the compute is printed. If <I>c_ID[N]</I> is used, then N must be in the
range from 1-M, which will print the Nth column of the M-length local
array calculated by the compute.
</P>
<P>The <I>f_ID</I> and <I>f_ID[N]</I> attributes allow local vectors or arrays
calculated by a <A HREF = "fix.html">fix</A> to be output. The ID in the attribute
should be replaced by the actual ID of the fix that has been defined
previously in the input script.
</P>
<P>If <I>f_ID</I> is used as a attribute, then the local vector calculated by
the fix is printed. If <I>f_ID[N]</I> is used, then N must be in the
range from 1-M, which will print the Nth column of the M-length local
array calculated by the fix.
</P>
<HR>
<P>This section explains the atom attributes that can be specified as
part of the <I>custom</I> and <I>cfg</I> styles.
</P>
<P>The <I>id</I>, <I>mol</I>, <I>type</I>, <I>element</I>, <I>mass</I>, <I>vx</I>, <I>vy</I>, <I>vz</I>, <I>fx</I>, <I>fy</I>,
<I>fz</I>, <I>q</I> attributes are self-explanatory.
</P>
<P><I>Id</I> is the atom ID. <I>Mol</I> is the molecule ID, included in the data
file for molecular systems. <I>Type</I> is the atom type. <I>Element</I> is
typically the chemical name of an element, which you must assign to
each type via the <A HREF = "dump_modify.html">dump_modify element</A> command.
More generally, it can be any string you wish to associated with an
atom type. <I>Mass</I> is the atom mass. <I>Vx</I>, <I>vy</I>, <I>vz</I>, <I>fx</I>, <I>fy</I>,
<I>fz</I>, and <I>q</I> are components of atom velocity and force and atomic
charge.
</P>
<P>There are several options for outputting atom coordinates. The <I>x</I>,
<I>y</I>, <I>z</I> attributes write atom coordinates "unscaled", in the
appropriate distance <A HREF = "units.html">units</A> (Angstroms, sigma, etc). Use
<I>xs</I>, <I>ys</I>, <I>zs</I> if you want the coordinates "scaled" to the box size,
so that each value is 0.0 to 1.0. If the simulation box is triclinic
(tilted), then all atom coords will still be between 0.0 and 1.0. Use
<I>xu</I>, <I>yu</I>, <I>zu</I> if you want the coordinates "unwrapped" by the image
flags for each atom. Unwrapped means that if the atom has passed thru
a periodic boundary one or more times, the value is printed for what
the coordinate would be if it had not been wrapped back into the
periodic box. Note that using <I>xu</I>, <I>yu</I>, <I>zu</I> means that the
coordinate values may be far outside the box bounds printed with the
snapshot. Using <I>xsu</I>, <I>ysu</I>, <I>zsu</I> is similar to using <I>xu</I>, <I>yu</I>, <I>zu</I>,
except that the unwrapped coordinates are scaled by the box size. Atoms
that have passed through a periodic boundary will have the corresponding
cooordinate increased or decreased by 1.0.
</P>
<P>The image flags can be printed directly using the <I>ix</I>,
<I>iy</I>, <I>iz</I> attributes. The <A HREF = "dump_modify.html">dump_modify</A> command
describes in more detail what is meant by scaled vs unscaled
coordinates and the image flags.
</P>
<P>The <I>mux</I>, <I>muy</I>, <I>muz</I> attributes are specific to dipolar systems
defined with an atom style of <I>dipole</I>. They give the orientation of
the atom's point dipole moment. The <I>mu</I> attribute gives the
magnitude of the atom's dipole moment.
</P>
<P>The <I>radius</I> and <I>diameter</I> attributes are specific to extended
spherical particles that have a finite size, such as those defined
with an atom style of <I>sphere</I>.
</P>
<P>The <I>omegax</I>, <I>omegay</I>, and <I>omegaz</I> attributes are specific to
extended spherical or aspherical particles that have an angular
velocity. Only certain atom styles, such as <I>sphere</I> define this
quantity.
</P>
<P>The <I>angmomx</I>, <I>angmomy</I>, and <I>angmomz</I> attributes are specific to
extended aspherical particles that have an angular momentum. Only
the <I>ellipsoid</I> atom style defines this quantity.
</P>
<P>The <I>tqx</I>, <I>tqy</I>, <I>tqz</I> attributes are for extended spherical or
aspherical particles that can sustain a rotational torque due
to interactions with other particles.
</P>
<P>The <I>spin</I>, <I>eradius</I>, <I>ervel</I>, and <I>erforce</I> attributes are for
particles that represent nuclei and electrons modeled with the
electronic force field (EFF). See <A HREF = "atom_style.html">atom_style
electron</A> and <A HREF = "pair_eff.html">pair_style eff</A> for more
details.
</P>
<P>The <I>c_ID</I> and <I>c_ID[N]</I> attributes allow per-atom vectors or arrays
calculated by a <A HREF = "compute.html">compute</A> to be output. The ID in the
attribute should be replaced by the actual ID of the compute that has
been defined previously in the input script. See the
<A HREF = "compute.html">compute</A> command for details. There are computes for
calculating the per-atom energy, stress, centro-symmetry parameter,
and coordination number of individual atoms.
</P>
<P>Note that computes which calculate global or local quantities, as
opposed to per-atom quantities, cannot be output in a dump custom
command. Instead, global quantities can be output by the
<A HREF = "thermo_style.html">thermo_style custom</A> command, and local quantities
can be output by the dump local command.
</P>
<P>If <I>c_ID</I> is used as a attribute, then the per-atom vector calculated
by the compute is printed. If <I>c_ID[N]</I> is used, then N must be in
the range from 1-M, which will print the Nth column of the M-length
per-atom array calculated by the compute.
</P>
<P>The <I>f_ID</I> and <I>f_ID[N]</I> attributes allow vector or array per-atom
quantities calculated by a <A HREF = "fix.html">fix</A> to be output. The ID in the
attribute should be replaced by the actual ID of the fix that has been
defined previously in the input script. The <A HREF = "fix_ave_atom.html">fix
ave/atom</A> command is one that calculates per-atom
quantities. Since it can time-average per-atom quantities produced by
any <A HREF = "compute.html">compute</A>, <A HREF = "fix.html">fix</A>, or atom-style
<A HREF = "variable.html">variable</A>, this allows those time-averaged results to
be written to a dump file.
</P>
<P>If <I>f_ID</I> is used as a attribute, then the per-atom vector calculated
by the fix is printed. If <I>f_ID[N]</I> is used, then N must be in the
range from 1-M, which will print the Nth column of the M-length
per-atom array calculated by the fix.
</P>
<P>The <I>v_name</I> attribute allows per-atom vectors calculated by a
<A HREF = "variable.html">variable</A> to be output. The name in the attribute
should be replaced by the actual name of the variable that has been
defined previously in the input script. Only an atom-style variable
can be referenced, since it is the only style that generates per-atom
values. Variables of style <I>atom</I> can reference individual atom
attributes, per-atom atom attributes, thermodynamic keywords, or
invoke other computes, fixes, or variables when they are evaluated, so
this is a very general means of creating quantities to output to a
dump file.
</P>
-<P>See <A HREF = "Section_modify.html">this section</A> of the manual for information
+<P>See <A HREF = "Section_modify.html">Section_modify</A> of the manual for information
on how to add new compute and fix styles to LAMMPS to calculate
per-atom quantities which could then be output into dump files.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>To write gzipped dump files, you must compile LAMMPS with the
-DLAMMPS_GZIP option - see the <A HREF = "Section_start.html#start_2">Making
LAMMPS</A> section of the documentation.
</P>
<P>The <I>xtc</I> style is part of the XTC package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info. This is
because some machines may not support the low-level XDR data format
that XTC files are written with, which will result in a compile-time
error when a low-level include file is not found. Putting this style
in a package makes it easy to exclude from a LAMMPS build for those
machines. However, the XTC package also includes two compatibility
header files and associated functions, which should be a suitable
substitute on machines that do not have the appropriate native header
files. This option can be invoked at build time by adding
-DLAMMPS_XDR to the CCFLAGS variable in the appropriate low-level
Makefile, e.g. src/MAKE/Makefile.foo. This compatibility mode has
been tested successfully on Cray XT3/XT4/XT5 and IBM BlueGene/L
machines and should also work on IBM BG/P, and Windows XP/Vista/7
machines.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dump_image.html">dump image</A>, <A HREF = "dump_modify.html">dump_modify</A>,
<A HREF = "undump.html">undump</A>
</P>
<P><B>Default:</B>
</P>
<P>The defaults for the image style are listed on the <A HREF = "dump_image.html">dump
image</A> doc page.
</P>
</HTML>
diff --git a/doc/dump.txt b/doc/dump.txt
index 56df5f44a..be599aafb 100644
--- a/doc/dump.txt
+++ b/doc/dump.txt
@@ -1,527 +1,527 @@
"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
dump command :h3
"dump image"_dump_image.html command :h3
[Syntax:]
dump ID group-ID style N file args :pre
ID = user-assigned name for the dump :ulb,l
group-ID = ID of the group of atoms to be dumped :l
style = {atom} or {cfg} or {dcd} or {xtc} or {xyz} or {image} or {local} or {custom} :l
N = dump every this many timesteps :l
file = name of file to write dump info to :l
args = list of arguments for a particular style :l
{atom} args = none
{cfg} args = same as {custom} args, see below
{dcd} args = none
{xtc} args = none
{xyz} args = none :pre
{image} args = discussed on "dump image"_dump_image.html doc page :pre
{local} args = list of local attributes
possible attributes = index, c_ID, c_ID\[N\], f_ID, f_ID\[N\]
index = enumeration of local values
c_ID = local vector calculated by a compute with ID
c_ID\[N\] = Nth column of local array calculated by a compute with ID
f_ID = local vector calculated by a fix with ID
f_ID\[N\] = Nth column of local array calculated by a fix with ID :pre
{custom} args = list of atom attributes
possible attributes = id, mol, type, element, mass,
x, y, z, xs, ys, zs, xu, yu, zu,
xsu, ysu, zsu, ix, iy, iz,
vx, vy, vz, fx, fy, fz,
q, mux, muy, muz, mu,
radius, diameter, omegax, omegay, omegaz,
angmomx, angmomy, angmomz, tqx, tqy, tqz,
spin, eradius, ervel, erforce,
c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :pre
id = atom ID
mol = molecule ID
type = atom type
element = name of atom element, as defined by "dump_modify"_dump_modify.html command
mass = atom mass
x,y,z = unscaled atom coordinates
xs,ys,zs = scaled atom coordinates
xu,yu,zu = unwrapped atom coordinates
xsu,ysu,zsu = scaled unwrapped atom coordinates
ix,iy,iz = box image that the atom is in
vx,vy,vz = atom velocities
fx,fy,fz = forces on atoms
q = atom charge
mux,muy,muz = orientation of dipole moment of atom
mu = magnitude of dipole moment of atom
radius,diameter = radius,diameter of spherical particle
omegax,omegay,omegaz = angular velocity of extended particle
angmomx,angmomy,angmomz = angular momentum of extended particle
tqx,tqy,tqz = torque on extended particles
spin = electron spin
eradius = electron radius
ervel = electron radial velocity
erforce = electron radial force
c_ID = per-atom vector calculated by a compute with ID
c_ID\[N\] = Nth column of per-atom array calculated by a compute with ID
f_ID = per-atom vector calculated by a fix with ID
f_ID\[N\] = Nth column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name :pre
:ule
[Examples:]
dump myDump all atom 100 dump.atom
dump 2 subgroup atom 50 dump.run.bin
dump 4a all custom 100 dump.myforce.* id type x y vx fx
dump 4b flow custom 100 dump.%.myforce id type c_myF\[3\] v_ke
dump 2 inner cfg 10 dump.snap.*.cfg id type xs ys zs vx vy vz
dump snap all cfg 100 dump.config.*.cfg id type xs ys zs id type c_Stress[2]
dump 1 all xtc 1000 file.xtc
dump e_data all custom 100 dump.eff id type x y z spin eradius fx fy fz eforce :pre
[Description:]
Dump a snapshot of atom quantities to one or more files every N
timesteps in one of several styles. The {image} style is the
exception; it creates a JPG or PPM image file of the atom
configuration every N timesteps, as discussed on the "dump
image"_dump_image.html doc page.
Only information for atoms in the specified group is dumped. The
"dump_modify thresh and region"_dump_modify.html commands can also
alter what atoms are included. Not all styles support all these
options; see details below.
As described below, the filename determines the kind of output (text
or binary or gzipped, one big file or one per timestep, one big file
or one per processor).
IMPORTANT NOTE: Because periodic boundary conditions are enforced only
on timesteps when neighbor lists are rebuilt, the coordinates of an
atom written to a dump file may be slightly outside the simulation
box.
IMPORTANT NOTE: Unless the "dump_modify sort"_dump_modify.html option
is invoked, the lines of atom information written to dump files
(typically one line per atom) will be in an indeterminate order for
each snapshot. This is even true when running on a single processor,
if the "atom_modify sort"_atom_modify.html option is on, which it is
by default. In this case atoms are re-ordered periodically during a
simulation, due to spatial sorting. It is also true when running in
parallel, because data for a single snapshot is collected from
multiple processors.
For the {atom}, {custom}, {cfg}, and {local} styles, sorting is off by
default. For the {dcd}, {xtc}, and {xyz} styles, sorting by atom ID
is on by default. See the "dump_modify"_dump_modify.html doc page for
details.
:line
The {style} keyword determines what atom quantities are written to the
file and in what format. Settings made via the
"dump_modify"_dump_modify.html command can also alter the format of
individual values and the file itself.
The {atom}, {local}, and {custom} styles create files in a simple text
format that is self-explanatory when viewing a dump file. Many of the
LAMMPS "post-processing tools"_Section_tools.html, including
"Pizza.py"_http://www.sandia.gov/~sjplimp/pizza.html, work with
this format.
For post-processing purposes the {atom} and {custom} text files are
self-describing in the following sense.
The dimensions of the simulation box are included in each snapshot.
For an orthogonal simulation box this information is is formatted as:
ITEM: BOX BOUNDS xx yy zz
xlo xhi
ylo yhi
zlo zhi :pre
where xlo,xhi are the maximum extents of the simulation box in the
x-dimension, and similarly for y and z. The "xx yy zz" represent 6
characters that encode the style of boundary for each of the 6
simulation box boundaries (xlo,xhi and ylo,yhi and zlo,zhi). Each of
the 6 characters is either p = periodic, f = fixed, s = shrink wrap,
or m = shrink wrapped with a minimum value. See the
"boundary"_doc/boundary.html command for details.
For triclinic simulation boxes (non-orthogonal), an orthogonal
bounding box which encloses the triclinic simulation box is output,
along with the 3 tilt factors (xy, xz, yz) of the triclinic box,
formatted as follows:
ITEM: BOX BOUNDS xy xz yz xx yy zz
xlo_bound xhi_bound xy
ylo_bound yhi_bound xz
zlo_bound zhi_bound yz :pre
The presence of the text "xy xz yz" in the ITEM line indicates that
the 3 tilt factors will be included on each of the 3 following lines.
This bounding box is convenient for many visualization programs. The
meaning of the 6 character flags for "xx yy zz" is the same as above.
Note that the first two numbers on each line are now xlo_bound instead
of xlo, etc, since they repesent a bounding box. See "this
section"_Section_howto.html#howto_12 of the doc pages for a geometric
description of triclinic boxes, as defined by LAMMPS, simple formulas
for how the 6 bounding box extents (xlo_bound,xhi_bound,etc) are
calculated from the triclinic parameters, and how to transform those
parameters to and from other commonly used triclinic representations.
The "ITEM: ATOMS" line in each snapshot lists column descriptors for
the per-atom lines that follow. For example, the descriptors would be
"id type xs ys zs" for the default {atom} style, and would be the atom
attributes you specify in the dump command for the {custom} style.
For style {atom}, atom coordinates are written to the file, along with
the atom ID and atom type. By default, atom coords are written in a
scaled format (from 0 to 1). I.e. an x value of 0.25 means the atom
is at a location 1/4 of the distance from xlo to xhi of the box
boundaries. The format can be changed to unscaled coords via the
"dump_modify"_dump_modify.html settings. Image flags can also be
added for each atom via dump_modify.
Style {custom} allows you to specify a list of atom attributes to be
written to the dump file for each atom. Possible attributes are
listed above and will appear in the order specified. You cannot
specify a quantity that is not defined for a particular simulation -
such as {q} for atom style {bond}, since that atom style doesn't
assign charges. Dumps occur at the very end of a timestep, so atom
attributes will include effects due to fixes that are applied during
the timestep. An explanation of the possible dump custom attributes
is given below.
For style {local}, local output generated by "computes"_compute.html
and "fixes"_fix.html is used to gnerate lines of output that is
written to the dump file. This local data is typically calculated by
each processor based on the atoms it owns, but there may be zero or
more entities per atom, e.g. a list of bond distances. An explanation
of the possible dump local attributes is given below. Note that by
using input from the "compute
property/local"_compute_property_local.html command with dump local,
it is possible to generate information on bonds, angles, etc that can
be cut and pasted directly into a data file read by the
"read_data"_read_data.html command.
Style {cfg} has the same command syntax as style {custom} and writes
extended CFG format files, as used by the
"AtomEye"_http://mt.seas.upenn.edu/Archive/Graphics/A visualization
package. Since the extended CFG format uses a single snapshot of the
system per file, a wildcard "*" must be included in the filename, as
discussed below. The list of atom attributes for style {cfg} must
begin with either "id type xs ys zs" or "id type xsu ysu zsu" or
since these quantities are needed to
write the CFG files in the appropriate format (though the "id" and
"type" fields do not appear explicitly in the file). Any remaining
attributes will be stored as "auxiliary properties" in the CFG files.
Note that you will typically want to use the "dump_modify
element"_dump_modify.html command with CFG-formatted files, to
associate element names with atom types, so that AtomEye can render
atoms appropriately. When unwrapped coordinates {xsu}, {ysu}, and {zsu}
are requested, the nominal AtomEye periodic cell dimensions are expanded
by a large factor UNWRAPEXPAND = 10.0, which ensures atoms that are
displayed correctly for up to UNWRAPEXPAND/2 periodic boundary crossings
in any direction.
Beyond this, AtomEye will rewrap the unwrapped coordinates.
The expansion causes the atoms to be drawn farther
away from the viewer, but it is easy to zoom the atoms closer, and
the interatomic distances are unaffected.
The {dcd} style writes DCD files, a standard atomic trajectory format
used by the CHARMM, NAMD, and XPlor molecular dynamics packages. DCD
files are binary and thus may not be portable to different machines.
The number of atoms per snapshot cannot change with the {dcd} style.
The {unwrap} option of the "dump_modify"_dump_modify.html command
allows DCD coordinates to be written "unwrapped" by the image flags
for each atom. Unwrapped means that if the atom has passed through
a periodic boundary one or more times, the value is printed for what
the coordinate would be if it had not been wrapped back into the
periodic box. Note that these coordinates may thus be far outside
the box size stored with the snapshot.
The {xtc} style writes XTC files, a compressed trajectory format used
by the GROMACS molecular dynamics package, and described
"here"_http://manual.gromacs.org/current/online/xtc.html.
The precision used in XTC files can be adjusted via the
"dump_modify"_dump_modify.html command. The default value of 1000
means that coordinates are stored to 1/1000 nanometer accuracy. XTC
files are portable binary files written in the NFS XDR data format,
so that any machine which supports XDR should be able to read them.
The number of atoms per snapshot cannot change with the {xtc} style.
The {unwrap} option of the "dump_modify"_dump_modify.html command allows
XTC coordinates to be written "unwrapped" by the image flags for each
atom. Unwrapped means that if the atom has passed thru a periodic
boundary one or more times, the value is printed for what the
coordinate would be if it had not been wrapped back into the periodic
box. Note that these coordinates may thus be far outside the box size
stored with the snapshot.
The {xyz} style writes XYZ files, which is a simple text-based
coordinate format that many codes can read.
Note that DCD, XTC, and XYZ formatted files can be read directly by
"VMD"_http://www.ks.uiuc.edu/Research/vmd (a popular molecular viewing
-program). See "this section"_Section_tools.html#vmd of the manual and
-the tools/lmp2vmd/README.txt file for more information about support
-in VMD for reading and visualizing LAMMPS dump files.
+program). See "Section tools"_Section_tools.html#vmd of the manual
+and the tools/lmp2vmd/README.txt file for more information about
+support in VMD for reading and visualizing LAMMPS dump files.
:line
Dumps are performed on timesteps that are a multiple of N (including
timestep 0) and on the last timestep of a minimization if the
minimization converges. Note that this means a dump will not be
performed on the initial timestep after the dump command is invoked,
if the current timestep is not a multiple of N. This behavior can be
changed via the "dump_modify first"_dump_modify.html command, which
can be useful if the dump command is invoked after a minimization
ended on an arbitrary timestep. N can be changed between runs by
using the "dump_modify every"_dump_modify.html command (not allowed
for {dcd} style).
The specified filename determines how the dump file(s) is written.
The default is to write one large text file, which is opened when the
dump command is invoked and closed when an "undump"_undump.html
command is used or when LAMMPS exits. For the {dcd} and {xtc} styles,
this is a single large binary file.
Dump filenames can contain two wildcard characters. If a "*"
character appears in the filename, then one file per snapshot is
written and the "*" character is replaced with the timestep value.
For example, tmp.dump.* becomes tmp.dump.0, tmp.dump.10000,
tmp.dump.20000, etc. This option is not available for the {dcd} and
{xtc} styles. Note that the "dump_modify pad"_dump_modify.html
command can be used to insure all timestep numbers are the same length
(e.g. 00010), which can make it easier to read a series of dump files
in order by some post-processing tools.
If a "%" character appears in the filename, then one file is written
for each processor and the "%" character is replaced with the
processor ID from 0 to P-1. For example, tmp.dump.% becomes
tmp.dump.0, tmp.dump.1, ... tmp.dump.P-1, etc. This creates smaller
files and can be a fast mode of output on parallel machines that
support parallel I/O for output. This option is not available for the
{dcd}, {xtc}, and {xyz} styles.
Note that the "*" and "%" characters can be used together to produce a
large number of small dump files!
If the filename ends with ".bin", the dump file (or files, if "*" or
"%" is also used) is written in binary format. A binary dump file
will be about the same size as a text version, but will typically
write out much faster. Of course, when post-processing, you will need
to convert it back to text format (see the "binary2txt
tool"_Section_tools.html#binary) or write your own code to read the
binary file. The format of the binary file can be understood by
looking at the tools/binary2txt.cpp file. This option is only
available for the {atom} and {custom} styles.
If the filename ends with ".gz", the dump file (or files, if "*" or "%"
is also used) is written in gzipped format. A gzipped dump file will
be about 3x smaller than the text version, but will also take longer
to write. This option is not available for the {dcd} and {xtc}
styles.
:line
This section explains the local attributes that can be specified as
part of the {local} style.
The {index} attribute can be used to generate an index number from 1
to N for each line written into the dump file, where N is the total
number of local datums from all processors, or lines of output that
will appear in the snapshot. Note that because data from different
processors depend on what atoms they currently own, and atoms migrate
between processor, there is no guarantee that the same index will be
used for the same info (e.g. a particular bond) in successive
snapshots.
The {c_ID} and {c_ID\[N\]} attributes allow local vectors or arrays
calculated by a "compute"_compute.html to be output. The ID in the
attribute should be replaced by the actual ID of the compute that has
been defined previously in the input script. See the
"compute"_compute.html command for details. There are computes for
calculating local information such as indices, types, and energies for
bonds and angles.
Note that computes which calculate global or per-atom quantities, as
opposed to local quantities, cannot be output in a dump local command.
Instead, global quantities can be output by the "thermo_style
custom"_thermo_style.html command, and per-atom quantities can be
output by the dump custom command.
If {c_ID} is used as a attribute, then the local vector calculated by
the compute is printed. If {c_ID\[N\]} is used, then N must be in the
range from 1-M, which will print the Nth column of the M-length local
array calculated by the compute.
The {f_ID} and {f_ID\[N\]} attributes allow local vectors or arrays
calculated by a "fix"_fix.html to be output. The ID in the attribute
should be replaced by the actual ID of the fix that has been defined
previously in the input script.
If {f_ID} is used as a attribute, then the local vector calculated by
the fix is printed. If {f_ID\[N\]} is used, then N must be in the
range from 1-M, which will print the Nth column of the M-length local
array calculated by the fix.
:line
This section explains the atom attributes that can be specified as
part of the {custom} and {cfg} styles.
The {id}, {mol}, {type}, {element}, {mass}, {vx}, {vy}, {vz}, {fx}, {fy},
{fz}, {q} attributes are self-explanatory.
{Id} is the atom ID. {Mol} is the molecule ID, included in the data
file for molecular systems. {Type} is the atom type. {Element} is
typically the chemical name of an element, which you must assign to
each type via the "dump_modify element"_dump_modify.html command.
More generally, it can be any string you wish to associated with an
atom type. {Mass} is the atom mass. {Vx}, {vy}, {vz}, {fx}, {fy},
{fz}, and {q} are components of atom velocity and force and atomic
charge.
There are several options for outputting atom coordinates. The {x},
{y}, {z} attributes write atom coordinates "unscaled", in the
appropriate distance "units"_units.html (Angstroms, sigma, etc). Use
{xs}, {ys}, {zs} if you want the coordinates "scaled" to the box size,
so that each value is 0.0 to 1.0. If the simulation box is triclinic
(tilted), then all atom coords will still be between 0.0 and 1.0. Use
{xu}, {yu}, {zu} if you want the coordinates "unwrapped" by the image
flags for each atom. Unwrapped means that if the atom has passed thru
a periodic boundary one or more times, the value is printed for what
the coordinate would be if it had not been wrapped back into the
periodic box. Note that using {xu}, {yu}, {zu} means that the
coordinate values may be far outside the box bounds printed with the
snapshot. Using {xsu}, {ysu}, {zsu} is similar to using {xu}, {yu}, {zu},
except that the unwrapped coordinates are scaled by the box size. Atoms
that have passed through a periodic boundary will have the corresponding
cooordinate increased or decreased by 1.0.
The image flags can be printed directly using the {ix},
{iy}, {iz} attributes. The "dump_modify"_dump_modify.html command
describes in more detail what is meant by scaled vs unscaled
coordinates and the image flags.
The {mux}, {muy}, {muz} attributes are specific to dipolar systems
defined with an atom style of {dipole}. They give the orientation of
the atom's point dipole moment. The {mu} attribute gives the
magnitude of the atom's dipole moment.
The {radius} and {diameter} attributes are specific to extended
spherical particles that have a finite size, such as those defined
with an atom style of {sphere}.
The {omegax}, {omegay}, and {omegaz} attributes are specific to
extended spherical or aspherical particles that have an angular
velocity. Only certain atom styles, such as {sphere} define this
quantity.
The {angmomx}, {angmomy}, and {angmomz} attributes are specific to
extended aspherical particles that have an angular momentum. Only
the {ellipsoid} atom style defines this quantity.
The {tqx}, {tqy}, {tqz} attributes are for extended spherical or
aspherical particles that can sustain a rotational torque due
to interactions with other particles.
The {spin}, {eradius}, {ervel}, and {erforce} attributes are for
particles that represent nuclei and electrons modeled with the
electronic force field (EFF). See "atom_style
electron"_atom_style.html and "pair_style eff"_pair_eff.html for more
details.
The {c_ID} and {c_ID\[N\]} attributes allow per-atom vectors or arrays
calculated by a "compute"_compute.html to be output. The ID in the
attribute should be replaced by the actual ID of the compute that has
been defined previously in the input script. See the
"compute"_compute.html command for details. There are computes for
calculating the per-atom energy, stress, centro-symmetry parameter,
and coordination number of individual atoms.
Note that computes which calculate global or local quantities, as
opposed to per-atom quantities, cannot be output in a dump custom
command. Instead, global quantities can be output by the
"thermo_style custom"_thermo_style.html command, and local quantities
can be output by the dump local command.
If {c_ID} is used as a attribute, then the per-atom vector calculated
by the compute is printed. If {c_ID\[N\]} is used, then N must be in
the range from 1-M, which will print the Nth column of the M-length
per-atom array calculated by the compute.
The {f_ID} and {f_ID\[N\]} attributes allow vector or array per-atom
quantities calculated by a "fix"_fix.html to be output. The ID in the
attribute should be replaced by the actual ID of the fix that has been
defined previously in the input script. The "fix
ave/atom"_fix_ave_atom.html command is one that calculates per-atom
quantities. Since it can time-average per-atom quantities produced by
any "compute"_compute.html, "fix"_fix.html, or atom-style
"variable"_variable.html, this allows those time-averaged results to
be written to a dump file.
If {f_ID} is used as a attribute, then the per-atom vector calculated
by the fix is printed. If {f_ID\[N\]} is used, then N must be in the
range from 1-M, which will print the Nth column of the M-length
per-atom array calculated by the fix.
The {v_name} attribute allows per-atom vectors calculated by a
"variable"_variable.html to be output. The name in the attribute
should be replaced by the actual name of the variable that has been
defined previously in the input script. Only an atom-style variable
can be referenced, since it is the only style that generates per-atom
values. Variables of style {atom} can reference individual atom
attributes, per-atom atom attributes, thermodynamic keywords, or
invoke other computes, fixes, or variables when they are evaluated, so
this is a very general means of creating quantities to output to a
dump file.
-See "this section"_Section_modify.html of the manual for information
+See "Section_modify"_Section_modify.html of the manual for information
on how to add new compute and fix styles to LAMMPS to calculate
per-atom quantities which could then be output into dump files.
:line
[Restrictions:]
To write gzipped dump files, you must compile LAMMPS with the
-DLAMMPS_GZIP option - see the "Making
LAMMPS"_Section_start.html#start_2 section of the documentation.
The {xtc} style is part of the XTC package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info. This is
because some machines may not support the low-level XDR data format
that XTC files are written with, which will result in a compile-time
error when a low-level include file is not found. Putting this style
in a package makes it easy to exclude from a LAMMPS build for those
machines. However, the XTC package also includes two compatibility
header files and associated functions, which should be a suitable
substitute on machines that do not have the appropriate native header
files. This option can be invoked at build time by adding
-DLAMMPS_XDR to the CCFLAGS variable in the appropriate low-level
Makefile, e.g. src/MAKE/Makefile.foo. This compatibility mode has
been tested successfully on Cray XT3/XT4/XT5 and IBM BlueGene/L
machines and should also work on IBM BG/P, and Windows XP/Vista/7
machines.
[Related commands:]
"dump image"_dump_image.html, "dump_modify"_dump_modify.html,
"undump"_undump.html
[Default:]
The defaults for the image style are listed on the "dump
image"_dump_image.html doc page.
diff --git a/doc/dump_image.html b/doc/dump_image.html
index 65eda7079..1e07899d3 100644
--- a/doc/dump_image.html
+++ b/doc/dump_image.html
@@ -1,455 +1,455 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>dump image command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>dump ID group-ID image N file color diameter keyword value ...
</PRE>
<UL><LI>ID = user-assigned name for the dump
<LI>group-ID = ID of the group of atoms to be imaged
<LI>image = style of dump command (other styles <I>atom</I> or <I>cfg</I> or <I>dcd</I> or <I>xtc</I> or <I>xyz</I> or <I>local</I> or <I>custom</I> are discussed on the <A HREF = "dump.html">dump</A> doc page)
<LI>N = dump every this many timesteps
<LI>file = name of file to write image to
<LI>color = atom attribute that determines color of each atom
<LI>diameter = atom attribute that determines size of each atom
<LI>zero or more keyword/value pairs may be appended
<LI>keyword = <I>adiam</I> or <I>atom</I> or <I>bond</I> or <I>size</I> or <I>view</I> or <I>center</I> or <I>up</I> or <I>zoom</I> or <I>persp</I> or <I>box</I> or <I>axes</I> or <I>shiny</I> or <I>ssao</I>
<PRE> <I>adiam</I> value = number = numeric value for atom diameter (distance units)
<I>atom</I> = yes/no = do or do not draw atoms
<I>bond</I> values = color width = color and width of bonds
color = <I>atom</I> or <I>type</I> or <I>none</I>
width = number or <I>atom</I> or <I>type</I> or <I>none</I>
number = numeric value for bond width (distance units)
<I>size</I> values = width height = size of images
width = width of image in # of pixels
height = height of image in # of pixels
<I>view</I> values = theta phi = view of simulation box
theta = view angle from +z axis (degrees)
phi = azimuthal view angle (degrees)
theta or phi can be a variable (see below)
<I>center</I> values = flag Cx Cy Cz = center point of image
flag = "s" for static, "d" for dynamic
Cx,Cy,Cz = center point of image as fraction of box dimension (0.5 = center of box)
Cx,Cy,Cz can be variables (see below)
<I>up</I> values = Ux Uy Uz = direction that is "up" in image
Ux,Uy,Uz = components of up vector
Ux,Uy,Uz can be variables (see below)
<I>zoom</I> value = zfactor = size that simulation box appears in image
zfactor = scale image size by factor > 1 to enlarge, factor < 1 to shrink
zfactor can be a variable (see below)
<I>persp</I> value = pfactor = amount of "perspective" in image
pfactor = amount of perspective (0 = none, < 1 = some, > 1 = highly skewed)
pfactor can be a variable (see below)
<I>box</I> values = yes/no diam = draw outline of simulation box
yes/no = do or do not draw simulation box lines
diam = diameter of box lines as fraction of shortest box length
<I>axes</I> values = yes/no length diam = draw xyz axes
yes/no = do or do not draw xyz axes lines next to simulation box
length = length of axes lines as fraction of respective box lengths
diam = diameter of axes lines as fraction of shortest box length
<I>shiny</I> value = sfactor = shinyness of spheres and cylinders
sfactor = shinyness of spheres and cylinders from 0.0 to 1.0
<I>ssao</I> value = yes/no seed dfactor = SSAO depth shading
yes/no = turn depth shading on/off
seed = random # seed (positive integer)
dfactor = strength of shading from 0.0 to 1.0
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>dump myDump all image 100 dump.*.jpg type type
</PRE>
<P><B>Description:</B>
</P>
<P>Dump a high-quality ray-traced image of the atom configuration every N
timesteps as either a JPG or PPM file. A series of such images can
easily be converted into an animated movie of your simulation; see
further details below. Other dump styles store snapshots of numerical
data asociated with atoms in various formats, as discussed on the
<A HREF = "dump.html">dump</A> doc page.
</P>
<P>Here are two sample images, rendered as 1024x1024 JPG files. Click to
see the full-size images:
</P>
<DIV ALIGN=center>
<A HREF = "JPG/dump1.jpg"><IMG SRC = "JPG/dump1_small.jpg"></A>
<A HREF = "JPG/dump2.jpg"><IMG SRC = "JPG/dump2_small.jpg"></A>
</DIV>
<P>Only atoms in the specified group are rendered in the image. The
<A HREF = "dump_modify.html">dump_modify region and thresh</A> commands can also
alter what atoms are included in the image.
</P>
<P>The filename suffix determines whether a JPG or PPM file is created.
If the suffix is ".jpg" or ".jpeg", then a JPG file is created, else a
PPM file is created, which is a text-based format. To write out JPG
files, you must build LAMMPS with a JPEG library. See <A HREF = "Section_start.html#start_2_4">this
section</A> of the manual for instructions
on how to do this.
</P>
<P>IMPORTANT NOTE: Because periodic boundary conditions are enforced only
on timesteps when neighbor lists are rebuilt, the coordinates of an
atom in the image may be slightly outside the simulation box.
</P>
<HR>
<P>Dumps are performed on timesteps that are a multiple of N (including
timestep 0) and on the last timestep of a minimization if the
minimization converges. Note that this means a dump will not be
performed on the initial timestep after the dump command is invoked,
if the current timestep is not a multiple of N. This behavior can be
changed via the <A HREF = "dump_modify.html">dump_modify first</A> command, which
can be useful if the dump command is invoked after a minimization
ended on an arbitrary timestep. N can be changed between runs by
using the <A HREF = "dump_modify.html">dump_modify every</A> command.
</P>
<P>Dump image filenames must contain a wildcard character "*", so that
one image file per snapshot is written. The "*" character is replaced
with the timestep value. For example, tmp.dump.*.jpg becomes
tmp.dump.0.jpg, tmp.dump.10000.jpg, tmp.dump.20000.jpg, etc. Note
that the <A HREF = "dump_modify.html">dump_modify pad</A> command can be used to
insure all timestep numbers are the same length (e.g. 00010), which
can make it easier to convert a series of images into a movie in the
correct ordering.
</P>
<HR>
<P>The <I>color</I> and <I>diameter</I> settings determine the color and size of
atoms rendered in the image. They can be any atom attribute defined
for the <A HREF = "dump.html">dump custom</A> command, including <I>type</I> and
<I>element</I>. This includes per-atom quantities calculated by a
<A HREF = "compute.html">compute</A>, <A HREF = "fix.html">fix</A>, or <A HREF = "variable.html">variable</A>,
which are prefixed by "c_", "f_", or "v_" respectively. Note that the
<I>diameter</I> setting can be overridden with a numeric value by the
optional <I>adiam</I> keyword, in which case you can specify the <I>diameter</I>
setting with any valid atom attribute.
</P>
<P>If <I>type</I> is specified for the <I>color</I> setting, then the color of each
atom is determined by its atom type. By default the mapping of types
to colors is as follows:
</P>
<UL><LI>type 1 = red
<LI>type 2 = green
<LI>type 3 = blue
<LI>type 4 = yellow
<LI>type 5 = aqua
<LI>type 6 = cyan
</UL>
<P>and repeats itself for types > 6. This mapping can be changed by the
<A HREF = "dump_modify.html">dump_modify acolor</A> command.
</P>
<P>If <I>type</I> is specified for the <I>diameter</I> setting then the diameter of
each atom is determined by its atom type. By default all types have
diameter 1.0. This mapping can be changed by the <A HREF = "dump_modify.html">dump_modify
adiam</A> command.
</P>
<P>If <I>element</I> is specified for the <I>color</I> and/or <I>diameter</I> setting,
then the color and/or diameter of each atom is determined by which
element it is, which in turn is specified by the element-to-type
mapping specified by the "dump_modify element" command. By default
every atom type is C (carbon). Every element has a color and diameter
associated with it, which is the same as the colors and sizes used by
the <A HREF = "http://mt.seas.upenn.edu/Archive/Graphics/A">AtomEye</A> visualization package.
</P>
<P>If other atom attributes are used for the <I>color</I> or <I>diameter</I>
settings, they are interpreted in the following way.
</P>
<P>If "vx", for example, is used as the <I>color</I> setting, then the color
of the atom will depend on the x-component of its velocity. The
association of a per-atom value with a specific color is determined by
a "color map", which can be specified via the
<A HREF = "dump_modify.html">dump_modify</A> command. The basic idea is that the
atom-attribute will be within a range of values, and every value
within the range is mapped to a specific color. Depending on how the
color map is defined, that mapping can take place via interpolation so
that a value of -3.2 is halfway between "red" and "blue", or
discretely so that the value of -3.2 is "orange".
</P>
<P>If "vx", for example, is used as the <I>diameter</I> setting, then the atom
will be rendered using the x-component of its velocity as the
diameter. If the per-atom value <= 0.0, them the atom will not be
drawn. Note that finite-size spherical particles, as defined by
<A HREF = "atom_style.html">atom_style sphere</A> define a per-particle radius or
diameter, which can be used as the <I>diameter</I> setting.
</P>
<HR>
<P>The various kewords listed above control how the image is rendered.
As listed below, all of the keywords have defaults, most of which you
will likely not need to change. The <A HREF = "dump_modify.html">dump modify</A>
also has options specific to the dump image style, particularly for
assigning colors to atoms, bonds, and other image features.
</P>
<HR>
<P>The <I>adiam</I> keyword allows you to override the <I>diameter</I> setting to a
per-atom attribute with a specified numeric value. All atoms will be
drawn with that diameter, e.g. 1.5, which is in whatever distance
<A HREF = "units.html">units</A> the input script defines, e.g. Angstroms.
</P>
<P>The <I>atom</I> keyword allow you to turn off the drawing of all atoms,
if the specified value is <I>no</I>.
</P>
<P>The <I>bond</I> keyword allows to you to alter how bonds are drawn. A bond
is only drawn if both atoms in the bond are being drawn due to being
in the specified group and due to other selection criteria
(e.g. region, threshhold settings of the
<A HREF = "dump_modify.html">dump_modify</A> command). By default, bonds are drawn
if they are defined in the input data file as read by the
<A HREF = "read_data.html">read_data</A> command. Using <I>none</I> for both the bond
<I>color</I> and <I>width</I> value will turn off the drawing of all bonds.
</P>
<P>If <I>atom</I> is specified for the bond <I>color</I> value, then each bond is
drawn in 2 halves, with the color of each half being the color of the
atom at that end of the bond.
</P>
<P>If <I>type</I> is specified for the <I>color</I> value, then the color of each
bond is determined by its bond type. By default the mapping of bond
types to colors is as follows:
</P>
<UL><LI>type 1 = red
<LI>type 2 = green
<LI>type 3 = blue
<LI>type 4 = yellow
<LI>type 5 = aqua
<LI>type 6 = cyan
</UL>
<P>and repeats itself for bond types > 6. This mapping can be changed by
the <A HREF = "dump_modify.html">dump_modify bcolor</A> command.
</P>
<P>The bond <I>width</I> value can be a numeric value or <I>atom</I> or <I>type</I> (or
<I>none</I> as indicated above).
</P>
<P>If a numeric value is specified, then all bonds will be drawn as
cylinders with that diameter, e.g. 1.0, which is in whatever distance
<A HREF = "units.html">units</A> the input script defines, e.g. Angstroms.
</P>
<P>If <I>atom</I> is specified for the <I>width</I> value, then each bond
will be drawn with a width corresponding to the minimum diameter
of the 2 atoms in the bond.
</P>
<P>If <I>type</I> is specified for the <I>width</I> value then the diameter of each
bond is determined by its bond type. By default all types have
diameter 0.5. This mapping can be changed by the <A HREF = "dump_modify.html">dump_modify
bdiam</A> command.
</P>
<HR>
<P>The <I>size</I> keyword sets the width and height of the created images,
i.e. the number of pixels in each direction.
</P>
<HR>
<P>The <I>view</I>, <I>center</I>, <I>up</I>, <I>zoom</I>, and <I>persp</I> values determine how
3d simulation space is mapped to the 2d plane of the image. Basically
they control how the simulation box appears in the image.
</P>
<P>All of the <I>view</I>, <I>center</I>, <I>up</I>, <I>zoom</I>, and <I>persp</I> values can be
specified as numeric quantities, whose meaning is explained below.
Any of them can also be specified as an <A HREF = "variable.html">equal-style
variable</A>, by using v_name as the value, where "name" is
the variable name. In this case the variable will be evaluated on the
timestep each image is created to create a new value. If the
equal-style variable is time-dependent, this is a means of changing
the way the simulation box appears from image to image, effectively
doing a pan or fly-by view of your simulation.
</P>
<P>The <I>view</I> keyword determines the viewpoint from which the simulation
box is viewed, looking towards the <I>center</I> point. The <I>theta</I> value
is the vertical angle from the +z axis, and must be an angle from 0 to
180 degrees. The <I>phi</I> value is an azimuthal angle around the z axis
and can be positive or negative. A value of 0.0 is a view along the
+x axis, towards the <I>center</I> point. If <I>theta</I> or <I>phi</I> are
specified via variables, then the variable values should be in
degrees.
</P>
<P>The <I>center</I> keyword determines the point in simulation space that
will be at the center of the image. <I>Cx</I>, <I>Cy</I>, and <I>Cz</I> are
speficied as fractions of the box dimensions, so that (0.5,0.5,0.5) is
the center of the simulation box. These values do not have to be
between 0.0 and 1.0, if you want the simulation box to be offset from
the center of the image. Note, however, that if you choose strange
values for <I>Cx</I>, <I>Cy</I>, or <I>Cz</I> you may get a blank image. Internally,
<I>Cx</I>, <I>Cy</I>, and <I>Cz</I> are converted into a point in simulation space.
If <I>flag</I> is set to "s" for static, then this conversion is done once,
at the time the dump command is issued. If <I>flag</I> is set to "d" for
dynamic then the conversion is performed every time a new image is
created. If the box size or shape is changing, this will adjust the
center point in simulation space.
</P>
<P>The <I>up</I> keyword determines what direction in simulation space will be
"up" in the image. Internally it is stored as a vector that is in the
plane perpendicular to the view vector implied by the <I>theta</I> and
<I>pni</I> values, and which is also in the plane defined by the view
vector and user-specified up vector. Thus this internal vector is
computed from the user-specified <I>up</I> vector as
</P>
<PRE>up_internal = view cross (up cross view)
</PRE>
<P>This means the only restriction on the specified <I>up</I> vector is that
it cannot be parallel to the <I>view</I> vector, implied by the <I>theta</I> and
<I>phi</I> values.
</P>
<P>The <I>zoom</I> keyword scales the size of the simulation box as it appears
in the image. The default <I>zfactor</I> value of 1 should display an
image mostly filled by the atoms in the simulation box. A <I>zfactor</I> >
1 will make the simulation box larger; a <I>zfactor</I> < 1 will make it
smaller. <I>Zfactor</I> must be a value > 0.0.
</P>
<P>The <I>persp</I> keyword determines how much depth perspective is present
in the image. Depth perspective makes lines that are parallel in
simulation space appear non-parallel in the image. A <I>pfactor</I> value
of 0.0 means that parallel lines will meet at infininty (1.0/pfactor),
which is an orthographic rendering with no persepctive. A <I>pfactor</I>
value between 0.0 and 1.0 will introduce more perspective. A <I>pfactor</I>
value > 1 will create a highly skewed image with a large amount of
perspective.
</P>
<P>IMPORTANT NOTE: The <I>persp</I> keyword is not yet supported as an option.
</P>
<HR>
<P>The <I>box</I> keyword determines how the simulation box boundaries are
rendered as thin cylinders in the image. If <I>no</I> is set, then the box
boundaries are not drawn and the <I>diam</I> setting is ignored. If <I>yes</I>
is set, the 12 edges of the box are drawn, with a diameter that is a
fraction of the shortest box length in x,y,z (for 3d) or x,y (for 2d).
The color of the box boundaries can be set with the <A HREF = "dump_modify.html">dump_modify
boxcolor</A> command.
</P>
<P>The <I>axes</I> keyword determines how the coordinate axes are rendered as
thin cylinders in the image. If <I>no</I> is set, then the axes are not
drawn and the <I>length</I> and <I>diam</I> settings are ignored. If <I>yes</I> is
set, 3 thin cylinders are drawn to represent the x,y,z axes in colors
red,green,blue. The origin of these cylinders will be offset from the
lower left corner of the box by 10%. The <I>length</I> setting determines
how long the cylinders will be as a fraction of the respective box
lengths. The <I>diam</I> setting determines their thickness as a fraction
of the shortest box length in x,y,z (for 3d) or x,y (for 2d).
</P>
<HR>
<P>The <I>shiny</I> keyword determines how shiny the objects rendered in the
image will appear. The <I>sfactor</I> value must be a value 0.0 <=
<I>sfactor</I> <= 1.0, where <I>sfactor</I> = 1 is a highly reflective surface
and <I>sfactor</I> = 0 is a rough non-shiny surface.
</P>
<P>The <I>ssao</I> keyword turns on/off a screen space ambient occlusion
(SSAO) model for depth shading. If <I>yes</I> is set, then atoms further
away from the viewer are darkened via a randomized process, which is
perceived as depth. The calculation of this effect can increase the
cost of computing the image by roughly 2x. The strength of the effect
can be scaled by the <I>dfactor</I> parameter. If <I>no</I> is set, no depth
shading is performed.
</P>
<HR>
<P>A series of JPG or PPM images can be converted into a movie file and
then played as a movie using commonly available tools.
</P>
<P>Convert JPG or PPM files into an animated GIF or MPEG or other movie
file:
</P>
<UL><LI>a) Use the ImageMagick convert program.
<PRE>% convert *.jpg foo.gif
% convert *.ppm foo.mpg
</PRE>
<LI>b) Use QuickTime.
<P>Select "Open Image Sequence" under the File menu
Load the images into QuickTime to animate them
Select "Export" under the File menu
Save the movie as a QuickTime movie (*.mov) or in another format
</P>
<LI>c) Windows-based tool.
</UL>
<P>If someone tells us how to do this via a common Windows-based tool,
we'll post the instructions here.
</P>
<P>Play the movie:
</P>
<UL><LI>a) Use your browser to view an animated GIF movie.
<P>Select "Open File" under the File menu
Load the animated GIF file
</P>
<LI>b) Use the freely available mplayer tool to view an MPEG movie.
<PRE>% mplayer foo.mpg
</PRE>
<LI>c) Use the <A HREF = "http://www.sandia.gov/~sjplimp/pizza.html">Pizza.py</A>
<A HREF = "http://www.sandia.gov/~sjplimp/pizza/doc/animate.html">animate tool</A>,
which works directly on a series of image files.
<PRE>a = animate("foo*.jpg")
</PRE>
<LI>d) QuickTime and other Windows-based media players can
obviously play movie files directly.
</UL>
<HR>
-<P>See <A HREF = "Section_modify.html">this section</A> of the manual for information
+<P>See <A HREF = "Section_modify.html">Section_modify</A> of the manual for information
on how to add new compute and fix styles to LAMMPS to calculate
per-atom quantities which could then be output into dump files.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>To write JPG images, you must use a -DLAMMPS_JPEG switch when building
LAMMPS and link with a JPEG library. See the <A HREF = "Section_start.html#start_2_4">Making
LAMMPS</A> section of the documentation for
details.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dump.html">dump</A>, <A HREF = "dump_modify.html">dump_modify</A>, <A HREF = "undump.html">undump</A>
</P>
<P><B>Default:</B>
</P>
<P>The defaults for the keywords are as follows:
</P>
<UL><LI>adiam = not specified (use diameter setting)
<LI>atom = yes
<LI>bond = none none (if no bonds in system)
<LI>bond = atom 0.5 (if bonds in system)
<LI>size = 512 512
<LI>view = 60 30 (for 3d)
<LI>view = 0 0 (for 2d)
<LI>center = s 0.5 0.5 0.5
<LI>up = 0 0 1 (for 3d)
<LI>up = 0 1 0 (for 2d)
<LI>zoom = 1.0
<LI>persp = 0.0
<LI>box = yes 0.02
<LI>axes = no 0.0 0.0
<LI>shiny = 1.0
<LI>ssao = no
</UL>
</HTML>
diff --git a/doc/dump_image.txt b/doc/dump_image.txt
index 08a74c6de..6637f0b46 100644
--- a/doc/dump_image.txt
+++ b/doc/dump_image.txt
@@ -1,439 +1,439 @@
"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
dump image command :h3
[Syntax:]
dump ID group-ID image N file color diameter keyword value ... :pre
ID = user-assigned name for the dump :ulb,l
group-ID = ID of the group of atoms to be imaged :l
image = style of dump command (other styles {atom} or {cfg} or {dcd} or {xtc} or {xyz} or {local} or {custom} are discussed on the "dump"_dump.html doc page) :l
N = dump every this many timesteps :l
file = name of file to write image to :l
color = atom attribute that determines color of each atom :l
diameter = atom attribute that determines size of each atom :l
zero or more keyword/value pairs may be appended :l
keyword = {adiam} or {atom} or {bond} or {size} or {view} or {center} or {up} or {zoom} or {persp} or {box} or {axes} or {shiny} or {ssao} :l
{adiam} value = number = numeric value for atom diameter (distance units)
{atom} = yes/no = do or do not draw atoms
{bond} values = color width = color and width of bonds
color = {atom} or {type} or {none}
width = number or {atom} or {type} or {none}
number = numeric value for bond width (distance units)
{size} values = width height = size of images
width = width of image in # of pixels
height = height of image in # of pixels
{view} values = theta phi = view of simulation box
theta = view angle from +z axis (degrees)
phi = azimuthal view angle (degrees)
theta or phi can be a variable (see below)
{center} values = flag Cx Cy Cz = center point of image
flag = "s" for static, "d" for dynamic
Cx,Cy,Cz = center point of image as fraction of box dimension (0.5 = center of box)
Cx,Cy,Cz can be variables (see below)
{up} values = Ux Uy Uz = direction that is "up" in image
Ux,Uy,Uz = components of up vector
Ux,Uy,Uz can be variables (see below)
{zoom} value = zfactor = size that simulation box appears in image
zfactor = scale image size by factor > 1 to enlarge, factor < 1 to shrink
zfactor can be a variable (see below)
{persp} value = pfactor = amount of "perspective" in image
pfactor = amount of perspective (0 = none, < 1 = some, > 1 = highly skewed)
pfactor can be a variable (see below)
{box} values = yes/no diam = draw outline of simulation box
yes/no = do or do not draw simulation box lines
diam = diameter of box lines as fraction of shortest box length
{axes} values = yes/no length diam = draw xyz axes
yes/no = do or do not draw xyz axes lines next to simulation box
length = length of axes lines as fraction of respective box lengths
diam = diameter of axes lines as fraction of shortest box length
{shiny} value = sfactor = shinyness of spheres and cylinders
sfactor = shinyness of spheres and cylinders from 0.0 to 1.0
{ssao} value = yes/no seed dfactor = SSAO depth shading
yes/no = turn depth shading on/off
seed = random # seed (positive integer)
dfactor = strength of shading from 0.0 to 1.0 :pre
:ule
[Examples:]
dump myDump all image 100 dump.*.jpg type type :pre
[Description:]
Dump a high-quality ray-traced image of the atom configuration every N
timesteps as either a JPG or PPM file. A series of such images can
easily be converted into an animated movie of your simulation; see
further details below. Other dump styles store snapshots of numerical
data asociated with atoms in various formats, as discussed on the
"dump"_dump.html doc page.
Here are two sample images, rendered as 1024x1024 JPG files. Click to
see the full-size images:
<DIV ALIGN=center>
:image(JPG/dump1_small.jpg,JPG/dump1.jpg)
:image(JPG/dump2_small.jpg,JPG/dump2.jpg)
</DIV>
Only atoms in the specified group are rendered in the image. The
"dump_modify region and thresh"_dump_modify.html commands can also
alter what atoms are included in the image.
The filename suffix determines whether a JPG or PPM file is created.
If the suffix is ".jpg" or ".jpeg", then a JPG file is created, else a
PPM file is created, which is a text-based format. To write out JPG
files, you must build LAMMPS with a JPEG library. See "this
section"_Section_start.html#start_2_4 of the manual for instructions
on how to do this.
IMPORTANT NOTE: Because periodic boundary conditions are enforced only
on timesteps when neighbor lists are rebuilt, the coordinates of an
atom in the image may be slightly outside the simulation box.
:line
Dumps are performed on timesteps that are a multiple of N (including
timestep 0) and on the last timestep of a minimization if the
minimization converges. Note that this means a dump will not be
performed on the initial timestep after the dump command is invoked,
if the current timestep is not a multiple of N. This behavior can be
changed via the "dump_modify first"_dump_modify.html command, which
can be useful if the dump command is invoked after a minimization
ended on an arbitrary timestep. N can be changed between runs by
using the "dump_modify every"_dump_modify.html command.
Dump image filenames must contain a wildcard character "*", so that
one image file per snapshot is written. The "*" character is replaced
with the timestep value. For example, tmp.dump.*.jpg becomes
tmp.dump.0.jpg, tmp.dump.10000.jpg, tmp.dump.20000.jpg, etc. Note
that the "dump_modify pad"_dump_modify.html command can be used to
insure all timestep numbers are the same length (e.g. 00010), which
can make it easier to convert a series of images into a movie in the
correct ordering.
:line
The {color} and {diameter} settings determine the color and size of
atoms rendered in the image. They can be any atom attribute defined
for the "dump custom"_dump.html command, including {type} and
{element}. This includes per-atom quantities calculated by a
"compute"_compute.html, "fix"_fix.html, or "variable"_variable.html,
which are prefixed by "c_", "f_", or "v_" respectively. Note that the
{diameter} setting can be overridden with a numeric value by the
optional {adiam} keyword, in which case you can specify the {diameter}
setting with any valid atom attribute.
If {type} is specified for the {color} setting, then the color of each
atom is determined by its atom type. By default the mapping of types
to colors is as follows:
type 1 = red
type 2 = green
type 3 = blue
type 4 = yellow
type 5 = aqua
type 6 = cyan :ul
and repeats itself for types > 6. This mapping can be changed by the
"dump_modify acolor"_dump_modify.html command.
If {type} is specified for the {diameter} setting then the diameter of
each atom is determined by its atom type. By default all types have
diameter 1.0. This mapping can be changed by the "dump_modify
adiam"_dump_modify.html command.
If {element} is specified for the {color} and/or {diameter} setting,
then the color and/or diameter of each atom is determined by which
element it is, which in turn is specified by the element-to-type
mapping specified by the "dump_modify element" command. By default
every atom type is C (carbon). Every element has a color and diameter
associated with it, which is the same as the colors and sizes used by
the "AtomEye"_atomeye visualization package.
:link(atomeye,http://mt.seas.upenn.edu/Archive/Graphics/A)
If other atom attributes are used for the {color} or {diameter}
settings, they are interpreted in the following way.
If "vx", for example, is used as the {color} setting, then the color
of the atom will depend on the x-component of its velocity. The
association of a per-atom value with a specific color is determined by
a "color map", which can be specified via the
"dump_modify"_dump_modify.html command. The basic idea is that the
atom-attribute will be within a range of values, and every value
within the range is mapped to a specific color. Depending on how the
color map is defined, that mapping can take place via interpolation so
that a value of -3.2 is halfway between "red" and "blue", or
discretely so that the value of -3.2 is "orange".
If "vx", for example, is used as the {diameter} setting, then the atom
will be rendered using the x-component of its velocity as the
diameter. If the per-atom value <= 0.0, them the atom will not be
drawn. Note that finite-size spherical particles, as defined by
"atom_style sphere"_atom_style.html define a per-particle radius or
diameter, which can be used as the {diameter} setting.
:line
The various kewords listed above control how the image is rendered.
As listed below, all of the keywords have defaults, most of which you
will likely not need to change. The "dump modify"_dump_modify.html
also has options specific to the dump image style, particularly for
assigning colors to atoms, bonds, and other image features.
:line
The {adiam} keyword allows you to override the {diameter} setting to a
per-atom attribute with a specified numeric value. All atoms will be
drawn with that diameter, e.g. 1.5, which is in whatever distance
"units"_units.html the input script defines, e.g. Angstroms.
The {atom} keyword allow you to turn off the drawing of all atoms,
if the specified value is {no}.
The {bond} keyword allows to you to alter how bonds are drawn. A bond
is only drawn if both atoms in the bond are being drawn due to being
in the specified group and due to other selection criteria
(e.g. region, threshhold settings of the
"dump_modify"_dump_modify.html command). By default, bonds are drawn
if they are defined in the input data file as read by the
"read_data"_read_data.html command. Using {none} for both the bond
{color} and {width} value will turn off the drawing of all bonds.
If {atom} is specified for the bond {color} value, then each bond is
drawn in 2 halves, with the color of each half being the color of the
atom at that end of the bond.
If {type} is specified for the {color} value, then the color of each
bond is determined by its bond type. By default the mapping of bond
types to colors is as follows:
type 1 = red
type 2 = green
type 3 = blue
type 4 = yellow
type 5 = aqua
type 6 = cyan :ul
and repeats itself for bond types > 6. This mapping can be changed by
the "dump_modify bcolor"_dump_modify.html command.
The bond {width} value can be a numeric value or {atom} or {type} (or
{none} as indicated above).
If a numeric value is specified, then all bonds will be drawn as
cylinders with that diameter, e.g. 1.0, which is in whatever distance
"units"_units.html the input script defines, e.g. Angstroms.
If {atom} is specified for the {width} value, then each bond
will be drawn with a width corresponding to the minimum diameter
of the 2 atoms in the bond.
If {type} is specified for the {width} value then the diameter of each
bond is determined by its bond type. By default all types have
diameter 0.5. This mapping can be changed by the "dump_modify
bdiam"_dump_modify.html command.
:line
The {size} keyword sets the width and height of the created images,
i.e. the number of pixels in each direction.
:line
The {view}, {center}, {up}, {zoom}, and {persp} values determine how
3d simulation space is mapped to the 2d plane of the image. Basically
they control how the simulation box appears in the image.
All of the {view}, {center}, {up}, {zoom}, and {persp} values can be
specified as numeric quantities, whose meaning is explained below.
Any of them can also be specified as an "equal-style
variable"_variable.html, by using v_name as the value, where "name" is
the variable name. In this case the variable will be evaluated on the
timestep each image is created to create a new value. If the
equal-style variable is time-dependent, this is a means of changing
the way the simulation box appears from image to image, effectively
doing a pan or fly-by view of your simulation.
The {view} keyword determines the viewpoint from which the simulation
box is viewed, looking towards the {center} point. The {theta} value
is the vertical angle from the +z axis, and must be an angle from 0 to
180 degrees. The {phi} value is an azimuthal angle around the z axis
and can be positive or negative. A value of 0.0 is a view along the
+x axis, towards the {center} point. If {theta} or {phi} are
specified via variables, then the variable values should be in
degrees.
The {center} keyword determines the point in simulation space that
will be at the center of the image. {Cx}, {Cy}, and {Cz} are
speficied as fractions of the box dimensions, so that (0.5,0.5,0.5) is
the center of the simulation box. These values do not have to be
between 0.0 and 1.0, if you want the simulation box to be offset from
the center of the image. Note, however, that if you choose strange
values for {Cx}, {Cy}, or {Cz} you may get a blank image. Internally,
{Cx}, {Cy}, and {Cz} are converted into a point in simulation space.
If {flag} is set to "s" for static, then this conversion is done once,
at the time the dump command is issued. If {flag} is set to "d" for
dynamic then the conversion is performed every time a new image is
created. If the box size or shape is changing, this will adjust the
center point in simulation space.
The {up} keyword determines what direction in simulation space will be
"up" in the image. Internally it is stored as a vector that is in the
plane perpendicular to the view vector implied by the {theta} and
{pni} values, and which is also in the plane defined by the view
vector and user-specified up vector. Thus this internal vector is
computed from the user-specified {up} vector as
up_internal = view cross (up cross view) :pre
This means the only restriction on the specified {up} vector is that
it cannot be parallel to the {view} vector, implied by the {theta} and
{phi} values.
The {zoom} keyword scales the size of the simulation box as it appears
in the image. The default {zfactor} value of 1 should display an
image mostly filled by the atoms in the simulation box. A {zfactor} >
1 will make the simulation box larger; a {zfactor} < 1 will make it
smaller. {Zfactor} must be a value > 0.0.
The {persp} keyword determines how much depth perspective is present
in the image. Depth perspective makes lines that are parallel in
simulation space appear non-parallel in the image. A {pfactor} value
of 0.0 means that parallel lines will meet at infininty (1.0/pfactor),
which is an orthographic rendering with no persepctive. A {pfactor}
value between 0.0 and 1.0 will introduce more perspective. A {pfactor}
value > 1 will create a highly skewed image with a large amount of
perspective.
IMPORTANT NOTE: The {persp} keyword is not yet supported as an option.
:line
The {box} keyword determines how the simulation box boundaries are
rendered as thin cylinders in the image. If {no} is set, then the box
boundaries are not drawn and the {diam} setting is ignored. If {yes}
is set, the 12 edges of the box are drawn, with a diameter that is a
fraction of the shortest box length in x,y,z (for 3d) or x,y (for 2d).
The color of the box boundaries can be set with the "dump_modify
boxcolor"_dump_modify.html command.
The {axes} keyword determines how the coordinate axes are rendered as
thin cylinders in the image. If {no} is set, then the axes are not
drawn and the {length} and {diam} settings are ignored. If {yes} is
set, 3 thin cylinders are drawn to represent the x,y,z axes in colors
red,green,blue. The origin of these cylinders will be offset from the
lower left corner of the box by 10%. The {length} setting determines
how long the cylinders will be as a fraction of the respective box
lengths. The {diam} setting determines their thickness as a fraction
of the shortest box length in x,y,z (for 3d) or x,y (for 2d).
:line
The {shiny} keyword determines how shiny the objects rendered in the
image will appear. The {sfactor} value must be a value 0.0 <=
{sfactor} <= 1.0, where {sfactor} = 1 is a highly reflective surface
and {sfactor} = 0 is a rough non-shiny surface.
The {ssao} keyword turns on/off a screen space ambient occlusion
(SSAO) model for depth shading. If {yes} is set, then atoms further
away from the viewer are darkened via a randomized process, which is
perceived as depth. The calculation of this effect can increase the
cost of computing the image by roughly 2x. The strength of the effect
can be scaled by the {dfactor} parameter. If {no} is set, no depth
shading is performed.
:line
A series of JPG or PPM images can be converted into a movie file and
then played as a movie using commonly available tools.
Convert JPG or PPM files into an animated GIF or MPEG or other movie
file:
a) Use the ImageMagick convert program. :ulb,l
% convert *.jpg foo.gif
% convert *.ppm foo.mpg :pre
b) Use QuickTime. :l
Select "Open Image Sequence" under the File menu
Load the images into QuickTime to animate them
Select "Export" under the File menu
Save the movie as a QuickTime movie (*.mov) or in another format
c) Windows-based tool. :ule,l
If someone tells us how to do this via a common Windows-based tool,
we'll post the instructions here.
Play the movie:
a) Use your browser to view an animated GIF movie. :ulb,l
Select "Open File" under the File menu
Load the animated GIF file
b) Use the freely available mplayer tool to view an MPEG movie. :l
% mplayer foo.mpg :pre
c) Use the "Pizza.py"_http://www.sandia.gov/~sjplimp/pizza.html
"animate tool"_http://www.sandia.gov/~sjplimp/pizza/doc/animate.html,
which works directly on a series of image files. :l
a = animate("foo*.jpg") :pre
d) QuickTime and other Windows-based media players can
obviously play movie files directly. :ule,l
:line
-See "this section"_Section_modify.html of the manual for information
+See "Section_modify"_Section_modify.html of the manual for information
on how to add new compute and fix styles to LAMMPS to calculate
per-atom quantities which could then be output into dump files.
:line
[Restrictions:]
To write JPG images, you must use a -DLAMMPS_JPEG switch when building
LAMMPS and link with a JPEG library. See the "Making
LAMMPS"_Section_start.html#start_2_4 section of the documentation for
details.
[Related commands:]
"dump"_dump.html, "dump_modify"_dump_modify.html, "undump"_undump.html
[Default:]
The defaults for the keywords are as follows:
adiam = not specified (use diameter setting)
atom = yes
bond = none none (if no bonds in system)
bond = atom 0.5 (if bonds in system)
size = 512 512
view = 60 30 (for 3d)
view = 0 0 (for 2d)
center = s 0.5 0.5 0.5
up = 0 0 1 (for 3d)
up = 0 1 0 (for 2d)
zoom = 1.0
persp = 0.0
box = yes 0.02
axes = no 0.0 0.0
shiny = 1.0
ssao = no :ul
diff --git a/doc/fix_addforce.html b/doc/fix_addforce.html
index 05b679d66..60ead3703 100644
--- a/doc/fix_addforce.html
+++ b/doc/fix_addforce.html
@@ -1,176 +1,176 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix addforce command
</H3>
<H3>fix addforce/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID addforce fx fy fz keyword value ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>addforce = style name of this fix command
<LI>fx,fy,fz = force component values (force units)
<PRE> any of fx,fy,fz can be a variable (see below)
</PRE>
<LI>zero or more keyword/value pairs may be appended to args
<LI>keyword = <I>region</I> or <I>energy</I>
<PRE> <I>region</I> value = region-ID
region-ID = ID of region atoms must be in to have added force
<I>energy</I> value = v_name
v_name = variable with name that calculates the potential energy of each atom in the added force field
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix kick flow addforce 1.0 0.0 0.0
fix kick flow addforce 1.0 0.0 v_oscillate
fix ff boundary addforce 0.0 0.0 v_push energy v_espace
</PRE>
<P><B>Description:</B>
</P>
<P>Add fx,fy,fz to the corresponding component of force for each atom in
the group. This command can be used to give an additional push to
atoms in a simulation, such as for a simulation of Poiseuille flow in
a channel.
</P>
<P>Any of the 3 quantities defining the force components can be specified
as an equal-style or atom-style <A HREF = "variable.html">variable</A>, namely <I>fx</I>,
<I>fy</I>, <I>fz</I>. If the value is a variable, it should be specified as
v_name, where name is the variable name. In this case, the variable
will be evaluated each timestep, and its value used to determine the
force component.
</P>
<P>Equal-style variables can specify formulas with various mathematical
functions, and include <A HREF = "thermo_style.html">thermo_style</A> command
keywords for the simulation box parameters and timestep and elapsed
time. Thus it is easy to specify a time-dependent force field.
</P>
<P>Atom-style variables can specify the same formulas as equal-style
variables but can also include per-atom values, such as atom
coordinates. Thus it is easy to specify a spatially-dependent force
field with optional time-dependence as well.
</P>
<P>If the <I>region</I> keyword is used, the atom must also be in the
specified geometric <A HREF = "region.html">region</A> in order to have force added
to it.
</P>
<HR>
<P>Adding a force to atoms implies a change in their potential energy as
they move due to the applied force field. For dynamics via the "run"
command, this energy can be optionally added to the system's potential
energy for thermodynamic output (see below). For energy minimization
via the "minimize" command, this energy must be added to the system's
potential energy to formulate a self-consistent minimization problem
(see below).
</P>
<P>The <I>energy</I> keyword is not allowed if the added force is a constant
vector F = (fx,fy,fz), with all components defined as numeric
constants and not as variables. This is because LAMMPS can compute
the energy for each atom directly as E = -x dot F = -(x*fx + y*fy +
z*fz), so that -Grad(E) = F.
</P>
<P>The <I>energy</I> keyword is optional if the added force is defined with
one or more variables, and if you are performing dynamics via the
<A HREF = "run.html">run</A> command. If the keyword is not used, LAMMPS will set
the energy to 0.0, which is typically fine for dynamics.
</P>
<P>The <I>energy</I> keyword is required if the added force is defined with
one or more variables, and you are performing energy minimization via
the "minimize" command. The keyword specifies the name of an
atom-style <A HREF = "variable.html">variable</A> which is used to compute the
energy of each atom as function of its position. Like variables used
for <I>fx</I>, <I>fy</I>, <I>fz</I>, the energy variable is specified as v_name,
where name is the variable name.
</P>
<P>Note that when the <I>energy</I> keyword is used during an energy
minimization, you must insure that the formula defined for the
atom-style <A HREF = "variable.html">variable</A> is consistent with the force
variable formulas, i.e. that -Grad(E) = F. For example, if the force
were a spring-like F = kx, then the energy formula should be E =
-0.5kx^2. If you don't do this correctly, the minimization will not
converge properly.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>.
</P>
<P>The <A HREF = "fix_modify.html">fix_modify</A> <I>energy</I> option is supported by this
fix to add the potential "energy" inferred by the added force to the
system's potential energy as part of <A HREF = "thermo_style.html">thermodynamic
output</A>. This is a fictitious quantity but is
needed so that the <A HREF = "minimize.html">minimize</A> command can include the
forces added by this fix in a consistent manner. I.e. there is a
decrease in potential energy when atoms move in the direction of the
added force.
</P>
<P>This fix computes a global scalar and a global 3-vector of forces,
which can be accessed by various <A HREF = "Section_howto.html#howto_15">output
commands</A>. The scalar is the potential
energy discussed above. The vector is the total force on the group of
atoms before the forces on individual atoms are changed by the fix.
The scalar and vector values calculated by this fix are "extensive".
</P>
<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
the <A HREF = "run.html">run</A> command.
</P>
<P>The forces due to this fix are imposed during an energy minimization,
invoked by the <A HREF = "minimize.html">minimize</A> command. You should not
specify force components with a variable that has time-dependence for
use with a minimizer, since the minimizer increments the timestep as
the iteration count during the minimization.
</P>
<P>IMPORTANT NOTE: If you want the fictitious potential energy associated
with the added forces to be included in the total potential energy of
the system (the quantity being minimized), you MUST enable the
<A HREF = "fix_modify.html">fix_modify</A> <I>energy</I> option for this fix.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_setforce.html">fix setforce</A>, <A HREF = "fix_aveforce.html">fix aveforce</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_addforce.txt b/doc/fix_addforce.txt
index b20a69607..bd2a15913 100644
--- a/doc/fix_addforce.txt
+++ b/doc/fix_addforce.txt
@@ -1,163 +1,163 @@
"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 addforce command :h3
fix addforce/cuda command :h3
[Syntax:]
fix ID group-ID addforce fx fy fz keyword value ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
addforce = style name of this fix command :l
fx,fy,fz = force component values (force units) :l
any of fx,fy,fz can be a variable (see below) :pre
zero or more keyword/value pairs may be appended to args :l
keyword = {region} or {energy} :l
{region} value = region-ID
region-ID = ID of region atoms must be in to have added force
{energy} value = v_name
v_name = variable with name that calculates the potential energy of each atom in the added force field :pre
:ule
[Examples:]
fix kick flow addforce 1.0 0.0 0.0
fix kick flow addforce 1.0 0.0 v_oscillate
fix ff boundary addforce 0.0 0.0 v_push energy v_espace :pre
[Description:]
Add fx,fy,fz to the corresponding component of force for each atom in
the group. This command can be used to give an additional push to
atoms in a simulation, such as for a simulation of Poiseuille flow in
a channel.
Any of the 3 quantities defining the force components can be specified
as an equal-style or atom-style "variable"_variable.html, namely {fx},
{fy}, {fz}. If the value is a variable, it should be specified as
v_name, where name is the variable name. In this case, the variable
will be evaluated each timestep, and its value used to determine the
force component.
Equal-style variables can specify formulas with various mathematical
functions, and include "thermo_style"_thermo_style.html command
keywords for the simulation box parameters and timestep and elapsed
time. Thus it is easy to specify a time-dependent force field.
Atom-style variables can specify the same formulas as equal-style
variables but can also include per-atom values, such as atom
coordinates. Thus it is easy to specify a spatially-dependent force
field with optional time-dependence as well.
If the {region} keyword is used, the atom must also be in the
specified geometric "region"_region.html in order to have force added
to it.
:line
Adding a force to atoms implies a change in their potential energy as
they move due to the applied force field. For dynamics via the "run"
command, this energy can be optionally added to the system's potential
energy for thermodynamic output (see below). For energy minimization
via the "minimize" command, this energy must be added to the system's
potential energy to formulate a self-consistent minimization problem
(see below).
The {energy} keyword is not allowed if the added force is a constant
vector F = (fx,fy,fz), with all components defined as numeric
constants and not as variables. This is because LAMMPS can compute
the energy for each atom directly as E = -x dot F = -(x*fx + y*fy +
z*fz), so that -Grad(E) = F.
The {energy} keyword is optional if the added force is defined with
one or more variables, and if you are performing dynamics via the
"run"_run.html command. If the keyword is not used, LAMMPS will set
the energy to 0.0, which is typically fine for dynamics.
The {energy} keyword is required if the added force is defined with
one or more variables, and you are performing energy minimization via
the "minimize" command. The keyword specifies the name of an
atom-style "variable"_variable.html which is used to compute the
energy of each atom as function of its position. Like variables used
for {fx}, {fy}, {fz}, the energy variable is specified as v_name,
where name is the variable name.
Note that when the {energy} keyword is used during an energy
minimization, you must insure that the formula defined for the
atom-style "variable"_variable.html is consistent with the force
variable formulas, i.e. that -Grad(E) = F. For example, if the force
were a spring-like F = kx, then the energy formula should be E =
-0.5kx^2. If you don't do this correctly, the minimization will not
converge properly.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[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 potential "energy" inferred by the added force to the
system's potential energy as part of "thermodynamic
output"_thermo_style.html. This is a fictitious quantity but is
needed so that the "minimize"_minimize.html command can include the
forces added by this fix in a consistent manner. I.e. there is a
decrease in potential energy when atoms move in the direction of the
added force.
This fix computes a global scalar and a global 3-vector of forces,
which can be accessed by various "output
commands"_Section_howto.html#howto_15. The scalar is the potential
energy discussed above. The vector is the total force on the group of
atoms before the forces on individual atoms are changed by the fix.
The scalar and vector values calculated by this fix are "extensive".
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. You should not
specify force components with a variable that has time-dependence for
use with a minimizer, since the minimizer increments the timestep as
the iteration count during the minimization.
IMPORTANT NOTE: If you want the fictitious potential energy associated
with the added forces 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:] none
[Related commands:]
"fix setforce"_fix_setforce.html, "fix aveforce"_fix_aveforce.html
[Default:] none
diff --git a/doc/fix_append_atoms.html b/doc/fix_append_atoms.html
index 1523661ce..f9a0d6e60 100644
--- a/doc/fix_append_atoms.html
+++ b/doc/fix_append_atoms.html
@@ -1,112 +1,113 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix append_atoms command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID append_atoms face arg ... keyword value ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>append_atoms = style name of this fix command
<LI>one face/arg pairs must be appended
<LI>face = <I>zhi</I>
<LI>zero or more keyword/value pairs may be appended
<LI>keyword = <I>size</I> or <I>freq</I> or <I>temp</I> or <I>random</I> or <I>units</I>
<PRE> <I>size</I> args = Lz
Lz = z size of lattice region appended in a single event(distance units)
<I>freq</I> args = freq
freq = the number of timesteps between append events
<I>temp</I> args = target damp seed extent
target = target velocity for region immediately ahead of the piston
damp = damping parameter (time units)
seed = random number seed for langevin kicks
extent = extent of thermostated region (distance units)
<I>random</I> args = xmax ymax zmax seed
<I>xmax</I>, <I>ymax</I>, <I>zmax</I> = maximum displacement in particular direction (distance units)
<I>seed</I> = random number seed for random displacement
<I>units</I> value = <I>lattice</I> or <I>box</I>
<I>lattice</I> = the wall position is defined in lattice units
<I>box</I> = the wall position is defined in simulation box units
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all append_atoms zhi size 5.0 freq 295 units lattice
fix 4 all append_atoms zhi size 15.0 freq 5 units box
fix A all append_atoms zhi size 1.0 freq 1000 units lattice
</PRE>
<P><B>Description:</B>
</P>
<P>This fix creates atoms on a lattice, appended on the zhi edge of the system box.
This can be useful when a shock or wave is propagating from zlo. This allows
the system to grow with time to accommodate an expanding wave. A simulation
box must already exist, which is typically created via the
<A HREF = "create_box.html">create_box</A> command. Before using this command, a
lattice must also be defined using the <A HREF = "lattice.html">lattice</A> command.
</P>
<P>This fix will automatically freeze atoms on the zhi edge of the system, so that
overlaps are avoided when new atoms are appended.
</P>
<P>The <I>size</I> keyword defines the size in z of the chunk of material to be added.
</P>
<P>The <I>random</I> keyword will give the atoms random displacements around their
lattice points to simulate some initial temperature.
</P>
<P>The <I>temp</I> keyword will cause a region to be thermostated with a Langevin
thermostat on the zhi boundary. The size of the region is measured from zhi and
is set with the <I>extent</I> argument.
</P>
<P>The <I>units</I> keyword determines the meaning of the distance units used
to define a wall position, but only when a numeric constant is used.
A <I>box</I> value selects standard distance units as defined by the
<A HREF = "units.html">units</A> command, e.g. Angstroms for units = real or metal.
A <I>lattice</I> value means the distance units are in lattice spacings.
The <A HREF = "lattice.html">lattice</A> command must have been previously used to
define the lattice spacings.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix. No global or per-atom quantities are stored
-by this fix for access by various <A HREF = "Section_howto.html#4_15">output
-commands</A>. No parameter of this fix can be
-used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
+by this fix for access by various <A HREF = "Section_howto.html#howto_15">output
+commands</A>. No parameter of this fix can
+be used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
This fix is not invoked during <A HREF = "minimize.html">energy minimization</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This fix style is part of the SHOCK package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
-<P>The zhi boundary on which atoms are added with append_atoms must be shrink-wrapped.
-The zlo boundary may be any boundary type other than periodic.
+<P>The zhi boundary on which atoms are added with append_atoms must be
+shrink-wrapped. The zlo boundary may be any boundary type other than
+periodic.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_wall_piston.html">fix wall/piston</A> command
</P>
<P><B>Default:</B> <I>size</I> = 0.0, <I>freq</I> = 0, <I>units</I> = lattice.
</P>
<HR>
</HTML>
diff --git a/doc/fix_append_atoms.txt b/doc/fix_append_atoms.txt
index a98c9734d..a698ae6a5 100644
--- a/doc/fix_append_atoms.txt
+++ b/doc/fix_append_atoms.txt
@@ -1,100 +1,101 @@
"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 append_atoms command :h3
[Syntax:]
fix ID group-ID append_atoms face arg ... keyword value ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
append_atoms = style name of this fix command :l
one face/arg pairs must be appended :l
face = {zhi} :l
zero or more keyword/value pairs may be appended :l
keyword = {size} or {freq} or {temp} or {random} or {units} :l
{size} args = Lz
Lz = z size of lattice region appended in a single event(distance units)
{freq} args = freq
freq = the number of timesteps between append events
{temp} args = target damp seed extent
target = target velocity for region immediately ahead of the piston
damp = damping parameter (time units)
seed = random number seed for langevin kicks
extent = extent of thermostated region (distance units)
{random} args = xmax ymax zmax seed
{xmax}, {ymax}, {zmax} = maximum displacement in particular direction (distance units)
{seed} = random number seed for random displacement
{units} value = {lattice} or {box}
{lattice} = the wall position is defined in lattice units
{box} = the wall position is defined in simulation box units :pre
:ule
[Examples:]
fix 1 all append_atoms zhi size 5.0 freq 295 units lattice
fix 4 all append_atoms zhi size 15.0 freq 5 units box
fix A all append_atoms zhi size 1.0 freq 1000 units lattice :pre
[Description:]
This fix creates atoms on a lattice, appended on the zhi edge of the system box.
This can be useful when a shock or wave is propagating from zlo. This allows
the system to grow with time to accommodate an expanding wave. A simulation
box must already exist, which is typically created via the
"create_box"_create_box.html command. Before using this command, a
lattice must also be defined using the "lattice"_lattice.html command.
This fix will automatically freeze atoms on the zhi edge of the system, so that
overlaps are avoided when new atoms are appended.
The {size} keyword defines the size in z of the chunk of material to be added.
The {random} keyword will give the atoms random displacements around their
lattice points to simulate some initial temperature.
The {temp} keyword will cause a region to be thermostated with a Langevin
thermostat on the zhi boundary. The size of the region is measured from zhi and
is set with the {extent} argument.
The {units} keyword determines the meaning of the distance units used
to define a wall position, but only when a numeric constant is used.
A {box} value selects standard distance units as defined by the
"units"_units.html command, e.g. Angstroms for units = real or metal.
A {lattice} value means the distance units are in lattice spacings.
The "lattice"_lattice.html command must have been previously used to
define the lattice spacings.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various "output
-commands"_Section_howto.html#4_15. No parameter of this fix can be
-used with the {start/stop} keywords of the "run"_run.html command.
+commands"_Section_howto.html#howto_15. No parameter of this fix can
+be used with the {start/stop} keywords of the "run"_run.html command.
This fix is not invoked during "energy minimization"_minimize.html.
[Restrictions:]
This fix style is part of the SHOCK package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
-The zhi boundary on which atoms are added with append_atoms must be shrink-wrapped.
-The zlo boundary may be any boundary type other than periodic.
+The zhi boundary on which atoms are added with append_atoms must be
+shrink-wrapped. The zlo boundary may be any boundary type other than
+periodic.
[Related commands:]
"fix wall/piston"_fix_wall_piston.html command
[Default:] {size} = 0.0, {freq} = 0, {units} = lattice.
:line
diff --git a/doc/fix_aveforce.html b/doc/fix_aveforce.html
index 3aae86bb5..99052a01e 100644
--- a/doc/fix_aveforce.html
+++ b/doc/fix_aveforce.html
@@ -1,128 +1,128 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix aveforce command
</H3>
<H3>fix aveforce/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID aveforce fx fy fz keyword value ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>aveforce = style name of this fix command
<LI>fx,fy,fz = force component values (force units)
<PRE> any of fx,fy,fz can be a variable (see below)
</PRE>
<LI>zero or more keyword/value pairs may be appended to args
<LI>keyword = <I>region</I>
<PRE> <I>region</I> value = region-ID
region-ID = ID of region atoms must be in to have added force
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix pressdown topwall aveforce 0.0 -1.0 0.0
fix 2 bottomwall aveforce NULL -1.0 0.0 region top
fix 2 bottomwall aveforce NULL -1.0 v_oscillate region top
</PRE>
<P><B>Description:</B>
</P>
<P>Apply an additional external force to a group of atoms in such a way
that every atom experiences the same force. This is useful for
pushing on wall or boundary atoms so that the structure of the wall
does not change over time.
</P>
<P>The existing force is averaged for the group of atoms, component by
component. The actual force on each atom is then set to the average
value plus the component specified in this command. This means each
atom in the group receives the same force.
</P>
<P>Any of the fx,fy,fz values can be specified as NULL which means the
force in that dimension is not changed. Note that this is not the
same as specifying a 0.0 value, since that sets all forces to the same
average value without adding in any additional force.
</P>
<P>Any of the 3 quantities defining the force components can be specified
as an equal-style <A HREF = "variable.html">variable</A>, namely <I>fx</I>, <I>fy</I>, <I>fz</I>.
If the value is a variable, it should be specified as v_name, where
name is the variable name. In this case, the variable will be
evaluated each timestep, and its value used to determine the average
force.
</P>
<P>Equal-style variables can specify formulas with various mathematical
functions, and include <A HREF = "thermo_style.html">thermo_style</A> command
keywords for the simulation box parameters and timestep and elapsed
time. Thus it is easy to specify a time-dependent average force.
</P>
<P>If the <I>region</I> keyword is used, the atom must also be in the
specified geometric <A HREF = "region.html">region</A> in order to have force added
to it.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix.
</P>
<P>This fix computes a global 3-vector of forces, which can be accessed
by various <A HREF = "Section_howto.html#howto_15">output commands</A>. This is the
total force on the group of atoms before the forces on individual
atoms are changed by the fix. The vector values calculated by this
fix are "extensive".
</P>
<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
the <A HREF = "run.html">run</A> command.
</P>
<P>The forces due to this fix are imposed during an energy minimization,
invoked by the <A HREF = "minimize.html">minimize</A> command. You should not
specify force components with a variable that has time-dependence for
use with a minimizer, since the minimizer increments the timestep as
the iteration count during the minimization.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_setforce.html">fix setforce</A>, <A HREF = "fix_addforce.html">fix addforce</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_aveforce.txt b/doc/fix_aveforce.txt
index bae11d47d..9759fe455 100644
--- a/doc/fix_aveforce.txt
+++ b/doc/fix_aveforce.txt
@@ -1,115 +1,115 @@
"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 aveforce command :h3
fix aveforce/cuda command :h3
[Syntax:]
fix ID group-ID aveforce fx fy fz keyword value ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
aveforce = style name of this fix command :l
fx,fy,fz = force component values (force units) :l
any of fx,fy,fz can be a variable (see below) :pre
zero or more keyword/value pairs may be appended to args :l
keyword = {region} :l
{region} value = region-ID
region-ID = ID of region atoms must be in to have added force :pre
:ule
[Examples:]
fix pressdown topwall aveforce 0.0 -1.0 0.0
fix 2 bottomwall aveforce NULL -1.0 0.0 region top
fix 2 bottomwall aveforce NULL -1.0 v_oscillate region top :pre
[Description:]
Apply an additional external force to a group of atoms in such a way
that every atom experiences the same force. This is useful for
pushing on wall or boundary atoms so that the structure of the wall
does not change over time.
The existing force is averaged for the group of atoms, component by
component. The actual force on each atom is then set to the average
value plus the component specified in this command. This means each
atom in the group receives the same force.
Any of the fx,fy,fz values can be specified as NULL which means the
force in that dimension is not changed. Note that this is not the
same as specifying a 0.0 value, since that sets all forces to the same
average value without adding in any additional force.
Any of the 3 quantities defining the force components can be specified
as an equal-style "variable"_variable.html, namely {fx}, {fy}, {fz}.
If the value is a variable, it should be specified as v_name, where
name is the variable name. In this case, the variable will be
evaluated each timestep, and its value used to determine the average
force.
Equal-style variables can specify formulas with various mathematical
functions, and include "thermo_style"_thermo_style.html command
keywords for the simulation box parameters and timestep and elapsed
time. Thus it is easy to specify a time-dependent average force.
If the {region} keyword is used, the atom must also be in the
specified geometric "region"_region.html in order to have force added
to it.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix.
This fix computes a global 3-vector of forces, which can be accessed
by various "output commands"_Section_howto.html#howto_15. This is the
total force on the group of atoms before the forces on individual
atoms are changed by the fix. The vector values calculated by this
fix are "extensive".
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. You should not
specify force components with a variable that has time-dependence for
use with a minimizer, since the minimizer increments the timestep as
the iteration count during the minimization.
[Restrictions:] none
[Related commands:]
"fix setforce"_fix_setforce.html, "fix addforce"_fix_addforce.html
[Default:] none
diff --git a/doc/fix_enforce2d.html b/doc/fix_enforce2d.html
index cad153683..3bf7b56e4 100644
--- a/doc/fix_enforce2d.html
+++ b/doc/fix_enforce2d.html
@@ -1,74 +1,74 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix enforce2d command
</H3>
<H3>fix enforce2d/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID enforce2d
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>enforce2d = style name of this fix command
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 5 all enforce2d
</PRE>
<P><B>Description:</B>
</P>
<P>Zero out the z-dimension velocity and force on each atom in the group.
This is useful when running a 2d simulation to insure that atoms do
not move from their initial z coordinate.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various <A HREF = "Section_howto.html#howto_15">output
commands</A>. No parameter of this fix can
be used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
</P>
<P>The forces due to this fix are imposed during an energy minimization,
invoked by the <A HREF = "minimize.html">minimize</A> command.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B> none
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_enforce2d.txt b/doc/fix_enforce2d.txt
index 20bcf8f3c..46000e962 100644
--- a/doc/fix_enforce2d.txt
+++ b/doc/fix_enforce2d.txt
@@ -1,68 +1,68 @@
"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 enforce2d command :h3
fix enforce2d/cuda command :h3
[Syntax:]
fix ID group-ID enforce2d :pre
ID, group-ID are documented in "fix"_fix.html command
enforce2d = style name of this fix command :ul
[Examples:]
fix 5 all enforce2d :pre
[Description:]
Zero out the z-dimension velocity and force on each atom in the group.
This is useful when running a 2d simulation to insure that atoms do
not move from their initial z coordinate.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various "output
commands"_Section_howto.html#howto_15. 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.
[Restrictions:] none
[Related commands:] none
[Default:] none
diff --git a/doc/fix_freeze.html b/doc/fix_freeze.html
index 762460f39..ea95a1fdb 100644
--- a/doc/fix_freeze.html
+++ b/doc/fix_freeze.html
@@ -1,91 +1,91 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix freeze command
</H3>
<H3>fix freeze/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID freeze
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>freeze = style name of this fix command
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 2 bottom freeze
</PRE>
<P><B>Description:</B>
</P>
<P>Zero out the force and torque on a granular particle. This is useful
for preventing certain particles from moving in a simulation. The
<A HREF = "pair_gran.html">granular pair styles</A> also detect if this fix has been
defined and compute interactions between frozen and non-frozen
particles appropriately, as if the frozen particle has infinite mass.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix.
</P>
<P>This fix computes a global 3-vector of forces, which can be accessed
by various <A HREF = "Section_howto.html#howto_15">output commands</A>. This is the
total force on the group of atoms before the forces on individual
atoms are changed by the fix. The vector values calculated by this
fix are "extensive".
</P>
<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
the <A HREF = "run.html">run</A> command. This fix is not invoked during <A HREF = "minimize.html">energy
minimization</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This fix is part of the GRANULAR package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>There can only be a single freeze fix defined. This is because other
the <A HREF = "pair_gran.html">granular pair styles</A> treat frozen particles
differently and need to be able to reference a single group to which
this fix is applied.
</P>
<P><B>Related commands:</B> none
</P>
<P><A HREF = "atom_style.html">atom_style sphere</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_freeze.txt b/doc/fix_freeze.txt
index ac89b1819..05ad19479 100644
--- a/doc/fix_freeze.txt
+++ b/doc/fix_freeze.txt
@@ -1,85 +1,85 @@
"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 freeze command :h3
fix freeze/cuda command :h3
[Syntax:]
fix ID group-ID freeze :pre
ID, group-ID are documented in "fix"_fix.html command
freeze = style name of this fix command :ul
[Examples:]
fix 2 bottom freeze :pre
[Description:]
Zero out the force and torque on a granular particle. This is useful
for preventing certain particles from moving in a simulation. The
"granular pair styles"_pair_gran.html also detect if this fix has been
defined and compute interactions between frozen and non-frozen
particles appropriately, as if the frozen particle has infinite mass.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix.
This fix computes a global 3-vector of forces, which can be accessed
by various "output commands"_Section_howto.html#howto_15. This is the
total force on the group of atoms before the forces on individual
atoms are changed by the fix. The vector values calculated by this
fix are "extensive".
No parameter of this fix can be used with the {start/stop} keywords of
the "run"_run.html command. This fix is not invoked during "energy
minimization"_minimize.html.
[Restrictions:]
This fix is part of the GRANULAR package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
There can only be a single freeze fix defined. This is because other
the "granular pair styles"_pair_gran.html treat frozen particles
differently and need to be able to reference a single group to which
this fix is applied.
[Related commands:] none
"atom_style sphere"_atom_style.html
[Default:] none
diff --git a/doc/fix_gravity.html b/doc/fix_gravity.html
index fbc2fce7f..b26083d2d 100644
--- a/doc/fix_gravity.html
+++ b/doc/fix_gravity.html
@@ -1,145 +1,145 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix gravity command
</H3>
<H3>fix gravity/cuda command
</H3>
<H3>fix gravity/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group gravity style magnitude args
</PRE>
<UL><LI>ID, group are documented in <A HREF = "fix.html">fix</A> command
<LI>gravity = style name of this fix command
<LI>magnitude = size of acceleration (force/mass units)
<LI>style = <I>chute</I> or <I>spherical</I> or <I>gradient</I> or <I>vector</I>
<PRE> <I>chute</I> args = angle
angle = angle in +x away from -z or -y axis in 3d/2d (in degrees)
<I>spherical</I> args = phi theta
phi = azimuthal angle from +x axis (in degrees)
theta = angle from +z or +y axis in 3d/2d (in degrees)
<I>gradient</I> args = phi theta phi_grad theta_grad
phi = azimuthal angle from +x axis (in degrees)
theta = angle from +z or +y axis in 3d/2d (in degrees)
phi_grad = rate of change of angle phi (full rotations per time unit)
theta_grad = rate of change of angle theta (full rotations per time unit)
<I>vector</I> args = x y z
x y z = vector direction to apply the acceleration
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all gravity 1.0 chute 24.0
fix 1 all gravity 1.0 spherical 0.0 -180.0
fix 1 all gravity 1.0 gradient 0.0 -180.0 0.0 0.1
fix 1 all gravity 100.0 vector 1 1 0
</PRE>
<P><B>Description:</B>
</P>
<P>Impose an additional acceleration on each particle in the group. This
fix is typically used with granular systems to include a "gravity"
term acting on the macroscopic particles. More generally, it can
represent any kind of driving field, e.g. a pressure gradient inducing
a Poiseuille flow in a fluid. Note that this fix operates differently
than the <A HREF = "fix_addforce.html">fix addforce</A> command. The addforce fix
adds the same force to each atom, independent of its mass. This
command imparts the same acceleration to each atom (force/mass).
</P>
<P>The <I>magnitude</I> of the acceleration is specified in force/mass units.
For granular systems (LJ units) this is typically 1.0. See the
<A HREF = "units.html">units</A> command for details.
</P>
<P>Style <I>chute</I> is typically used for simulations of chute flow where
the specified angle is the chute angle, with flow occurring in the +x
direction. For 3d systems, the tilt is away from the z axis; for 2d
systems, the tilt is away from the y axis.
</P>
<P>Style <I>spherical</I> allows an arbitrary 3d direction to be specified for
the acceleration vector. Phi and theta are defined in the usual
spherical coordinates. Thus for acceleration acting in the -z
direction, theta would be 180.0 (or -180.0). Theta = 90.0 and phi =
-90.0 would mean acceleration acts in the -y direction. For 2d
systems, <I>phi</I> is ignored and <I>theta</I> is an angle in the xy plane
where theta = 0.0 is the y-axis.
</P>
<P>Style <I>gradient</I> is the same as style <I>spherical</I> except that the
direction of the acceleration vector is time dependent. The units of
the gradient arguments are in full rotations per time unit. E.g. a
timestep of 0.001 and a gradient of 0.1 means the acceleration vector
would rotate thru 360 degrees every 10,000 timesteps. For the
time-dependent case, the initial direction of the acceleration vector
is set to phi,theta when the fix is specified and evolves thereafter.
For 2d systems, <I>phi</I> and <I>phi_grad</I> are ignored.
</P>
<P>Style <I>vector</I> imposes an acceleration in the vector direction given
by (x,y,z). For 2d systems, the z component is ignored.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>.
</P>
<P>The <A HREF = "fix_modify.html">fix_modify</A> <I>energy</I> option is supported by this
fix to add the gravitational potential energy of the system to the
system's potential energy as part of <A HREF = "thermo_style.html">thermodynamic
output</A>.
</P>
<P>This fix computes a global scalar which can be accessed by various
<A HREF = "Section_howto.html#howto_15">output commands</A>. This scalar is the
gravitational potential energy of the particles in the defined field,
namely mass * (g dot x) for each particles, where x and mass are the
particles position and mass, and g is the gravitational field. The
scalar value calculated by this fix is "extensive".
</P>
<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
the <A HREF = "run.html">run</A> command. This fix is not invoked during <A HREF = "minimize.html">energy
minimization</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "atom_style.html">atom_style sphere</A>, <A HREF = "fix_addforce.html">fix addforce</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_gravity.txt b/doc/fix_gravity.txt
index bad5edc99..45812ffe4 100644
--- a/doc/fix_gravity.txt
+++ b/doc/fix_gravity.txt
@@ -1,133 +1,133 @@
"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 gravity command :h3
fix gravity/cuda command :h3
fix gravity/omp command :h3
[Syntax:]
fix ID group gravity style magnitude args :pre
ID, group are documented in "fix"_fix.html command :ulb,l
gravity = style name of this fix command :l
magnitude = size of acceleration (force/mass units) :l
style = {chute} or {spherical} or {gradient} or {vector} :l
{chute} args = angle
angle = angle in +x away from -z or -y axis in 3d/2d (in degrees)
{spherical} args = phi theta
phi = azimuthal angle from +x axis (in degrees)
theta = angle from +z or +y axis in 3d/2d (in degrees)
{gradient} args = phi theta phi_grad theta_grad
phi = azimuthal angle from +x axis (in degrees)
theta = angle from +z or +y axis in 3d/2d (in degrees)
phi_grad = rate of change of angle phi (full rotations per time unit)
theta_grad = rate of change of angle theta (full rotations per time unit)
{vector} args = x y z
x y z = vector direction to apply the acceleration :pre
:ule
[Examples:]
fix 1 all gravity 1.0 chute 24.0
fix 1 all gravity 1.0 spherical 0.0 -180.0
fix 1 all gravity 1.0 gradient 0.0 -180.0 0.0 0.1
fix 1 all gravity 100.0 vector 1 1 0 :pre
[Description:]
Impose an additional acceleration on each particle in the group. This
fix is typically used with granular systems to include a "gravity"
term acting on the macroscopic particles. More generally, it can
represent any kind of driving field, e.g. a pressure gradient inducing
a Poiseuille flow in a fluid. Note that this fix operates differently
than the "fix addforce"_fix_addforce.html command. The addforce fix
adds the same force to each atom, independent of its mass. This
command imparts the same acceleration to each atom (force/mass).
The {magnitude} of the acceleration is specified in force/mass units.
For granular systems (LJ units) this is typically 1.0. See the
"units"_units.html command for details.
Style {chute} is typically used for simulations of chute flow where
the specified angle is the chute angle, with flow occurring in the +x
direction. For 3d systems, the tilt is away from the z axis; for 2d
systems, the tilt is away from the y axis.
Style {spherical} allows an arbitrary 3d direction to be specified for
the acceleration vector. Phi and theta are defined in the usual
spherical coordinates. Thus for acceleration acting in the -z
direction, theta would be 180.0 (or -180.0). Theta = 90.0 and phi =
-90.0 would mean acceleration acts in the -y direction. For 2d
systems, {phi} is ignored and {theta} is an angle in the xy plane
where theta = 0.0 is the y-axis.
Style {gradient} is the same as style {spherical} except that the
direction of the acceleration vector is time dependent. The units of
the gradient arguments are in full rotations per time unit. E.g. a
timestep of 0.001 and a gradient of 0.1 means the acceleration vector
would rotate thru 360 degrees every 10,000 timesteps. For the
time-dependent case, the initial direction of the acceleration vector
is set to phi,theta when the fix is specified and evolves thereafter.
For 2d systems, {phi} and {phi_grad} are ignored.
Style {vector} imposes an acceleration in the vector direction given
by (x,y,z). For 2d systems, the z component is ignored.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[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 gravitational potential energy of the system to the
system's potential energy as part of "thermodynamic
output"_thermo_style.html.
This fix computes a global scalar which can be accessed by various
"output commands"_Section_howto.html#howto_15. This scalar is the
gravitational potential energy of the particles in the defined field,
namely mass * (g dot x) for each particles, where x and mass are the
particles position and mass, and g is the gravitational field. The
scalar value calculated by this fix is "extensive".
No parameter of this fix can be used with the {start/stop} keywords of
the "run"_run.html command. This fix is not invoked during "energy
minimization"_minimize.html.
[Restrictions:] none
[Related commands:]
"atom_style sphere"_atom_style.html, "fix addforce"_fix_addforce.html
[Default:] none
diff --git a/doc/fix_meso.html b/doc/fix_meso.html
index b3684d872..81bb83334 100644
--- a/doc/fix_meso.html
+++ b/doc/fix_meso.html
@@ -1,57 +1,57 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix meso command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID meso
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>meso = style name of this fix command
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all meso
</PRE>
<P><B>Description:</B>
</P>
<P>Perform time integration to update position, velocity, internal energy
and local density for atoms in the group each timestep. This fix is
needed to time-integrate mesoscopic systems where particles carry
internal variables such as SPH or DPDE.
</P>
<P>See <A HREF = "USER/sph/SPH_LAMMPS_userguide.pdf">this PDF guide</A> to using SPH in
LAMMPS.
</P>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix. No global or per-atom quantities are stored
-by this fix for access by various <A HREF = "Section_howto.html#4_15">output
-commands</A>. No parameter of this fix can be
-used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
+by this fix for access by various <A HREF = "Section_howto.html#howto_15">output
+commands</A>. No parameter of this fix can
+be used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
This fix is not invoked during <A HREF = "minimize.html">energy minimization</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This fix is part of the USER-SPH package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P>"fix meso/stationary"
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_meso.txt b/doc/fix_meso.txt
index 7c6a5cfc4..85f5838dd 100644
--- a/doc/fix_meso.txt
+++ b/doc/fix_meso.txt
@@ -1,52 +1,52 @@
"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 meso command :h3
[Syntax:]
fix ID group-ID meso :pre
ID, group-ID are documented in "fix"_fix.html command
meso = style name of this fix command :ul
[Examples:]
fix 1 all meso :pre
[Description:]
Perform time integration to update position, velocity, internal energy
and local density for atoms in the group each timestep. This fix is
needed to time-integrate mesoscopic systems where particles carry
internal variables such as SPH or DPDE.
See "this PDF guide"_USER/sph/SPH_LAMMPS_userguide.pdf to using SPH in
LAMMPS.
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various "output
-commands"_Section_howto.html#4_15. No parameter of this fix can be
-used with the {start/stop} keywords of the "run"_run.html command.
+commands"_Section_howto.html#howto_15. No parameter of this fix can
+be used with the {start/stop} keywords of the "run"_run.html command.
This fix is not invoked during "energy minimization"_minimize.html.
[Restrictions:]
This fix is part of the USER-SPH package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"fix meso/stationary"
[Default:] none
diff --git a/doc/fix_meso_stationary.html b/doc/fix_meso_stationary.html
index 67a9a6a20..cf339c256 100644
--- a/doc/fix_meso_stationary.html
+++ b/doc/fix_meso_stationary.html
@@ -1,58 +1,58 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix meso/stationary command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID meso/stationary
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>meso = style name of this fix command
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 boundary meso/stationary
</PRE>
<P><B>Description:</B>
</P>
<P>Perform time integration to update internal energy and local density,
but not position or velocity for atoms in the group each timestep.
This fix is needed for SPH simulations to correctly time-integrate
fixed boundary particles which constrain a fluid to a given region in
space.
</P>
<P>See <A HREF = "USER/sph/SPH_LAMMPS_userguide.pdf">this PDF guide</A> to using SPH in
LAMMPS.
</P>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix. No global or per-atom quantities are stored
-by this fix for access by various <A HREF = "Section_howto.html#4_15">output
-commands</A>. No parameter of this fix can be
-used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
+by this fix for access by various <A HREF = "Section_howto.html#howto_15">output
+commands</A>. No parameter of this fix can
+be used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
This fix is not invoked during <A HREF = "minimize.html">energy minimization</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This fix is part of the USER-SPH package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P>"fix meso"
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_meso_stationary.txt b/doc/fix_meso_stationary.txt
index 31bdb4b1f..5b83573bc 100644
--- a/doc/fix_meso_stationary.txt
+++ b/doc/fix_meso_stationary.txt
@@ -1,53 +1,53 @@
"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 meso/stationary command :h3
[Syntax:]
fix ID group-ID meso/stationary :pre
ID, group-ID are documented in "fix"_fix.html command
meso = style name of this fix command :ul
[Examples:]
fix 1 boundary meso/stationary :pre
[Description:]
Perform time integration to update internal energy and local density,
but not position or velocity for atoms in the group each timestep.
This fix is needed for SPH simulations to correctly time-integrate
fixed boundary particles which constrain a fluid to a given region in
space.
See "this PDF guide"_USER/sph/SPH_LAMMPS_userguide.pdf to using SPH in
LAMMPS.
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various "output
-commands"_Section_howto.html#4_15. No parameter of this fix can be
-used with the {start/stop} keywords of the "run"_run.html command.
+commands"_Section_howto.html#howto_15. No parameter of this fix can
+be used with the {start/stop} keywords of the "run"_run.html command.
This fix is not invoked during "energy minimization"_minimize.html.
[Restrictions:]
This fix is part of the USER-SPH package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"fix meso"
[Default:] none
diff --git a/doc/fix_neb.html b/doc/fix_neb.html
index 79390f9b3..23a8b894d 100644
--- a/doc/fix_neb.html
+++ b/doc/fix_neb.html
@@ -1,113 +1,113 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix neb command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID neb Kspring
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>neb = style name of this fix command
<LI>Kspring = inter-replica spring constant (force/distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 active neb 10.0
</PRE>
<P><B>Description:</B>
</P>
<P>Add inter-replica forces to atoms in the group for a multi-replica
simulation run via the <A HREF = "neb.html">neb</A> command to perform a nudged
elastic band (NEB) calculation for transition state finding. Hi-level
explanations of NEB are given with the <A HREF = "neb.html">neb</A> command and in
-<A HREF = "Section_howto.html#howto_5">this section</A> of the manual. The fix neb
-command must be used with the "neb" command to define how
+<A HREF = "Section_howto.html#howto_5">Section_howto 5</A> of the manual. The fix
+neb command must be used with the "neb" command to define how
inter-replica forces are computed.
</P>
<P>Only the N atoms in the fix group experience inter-replica forces.
Atoms in the two end-point replicas do not experience these forces,
but those in intermediate replicas do. During the initial stage of
NEB, the 3N-length vector of interatomic forces Fi = -Grad(V) acting
on the atoms of each intermediate replica I is altered, as described
in the <A HREF = "#Henkelman1">(Henkelman1)</A> paper, to become:
</P>
<PRE>Fi = -Grad(V) + (Grad(V) dot That) That + Kspring (|Ri+i - Ri| - |Ri - Ri-1|) That
</PRE>
<P>Ri are the atomic coordinates of replica I; Ri-1 and Ri+1 are the
coordinates of its neighbor replicas. That (t with a hat over it) is
the unit "tangent" vector for replica I which is a function of Ri,
Ri-1, Ri+1, and the potential energy of the 3 replicas; it points
roughly in the direction of (Ri+i - Ri-1); see the
<A HREF = "#Henkelman1">(Henkelman1)</A> paper for details.
</P>
<P>The first two terms in the above equation are the component of the
interatomic forces perpendicular to the tangent vector. The last term
is a spring force between replica I and its neighbors, parallel to the
tangent vector direction with the specified spring constant <I>Kspring</I>.
</P>
<P>The effect of the first two terms is to push the atoms of each replica
toward the minimum energy path (MEP) of conformational states that
transition over the energy barrier. The MEP for an energy barrier is
defined as a sequence of 3N-dimensional states which cross the barrier
at its saddle point, each of which has a potential energy gradient
parallel to the MEP itself.
</P>
<P>The effect of the last term is to push each replica away from its two
neighbors in a direction along the MEP, so that the final set of
states are equidistant from each other.
</P>
<P>During the second stage of NEB, the forces on the N atoms in the
replica nearest the top of the energy barrier are altered so that it
climbs to the top of the barrier and finds the saddle point. The
forces on atoms in this replica are described in the
<A HREF = "#Henkelman2">(Henkelman2)</A> paper, and become:
</P>
<PRE>Fi = -Grad(V) + 2 (Grad(V) dot That) That
</PRE>
<P>The inter-replica forces for the other replicas are unchanged from the
first equation.
</P>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various <A HREF = "Section_howto.html#howto_15">output
commands</A>. No parameter of this fix can
be used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
</P>
<P>The forces due to this fix are imposed during an energy minimization,
as invoked by the <A HREF = "minimize.html">minimize</A> command via the
<A HREF = "neb.html">neb</A> command.
</P>
<P><B>Restrictions:</B>
</P>
<P>This command can only be used if LAMMPS was built with the REPLICA
package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "neb.html">neb</A>
</P>
<P><B>Default:</B> none
</P>
<A NAME = "Henkelman"></A>
<P><B>(Henkelman1)</B> Henkelman and Jonsson, J Chem Phys, 113, 9978-9985 (2000).
</P>
<A NAME = "Henkelman"></A>
<P><B>(Henkelman2)</B> Henkelman, Uberuaga, Jonsson, J Chem Phys, 113,
9901-9904 (2000).
</P>
</HTML>
diff --git a/doc/fix_neb.txt b/doc/fix_neb.txt
index 397a259c4..c84b46a42 100644
--- a/doc/fix_neb.txt
+++ b/doc/fix_neb.txt
@@ -1,106 +1,106 @@
"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 neb command :h3
[Syntax:]
fix ID group-ID neb Kspring :pre
ID, group-ID are documented in "fix"_fix.html command
neb = style name of this fix command
Kspring = inter-replica spring constant (force/distance units) :ul
[Examples:]
fix 1 active neb 10.0 :pre
[Description:]
Add inter-replica forces to atoms in the group for a multi-replica
simulation run via the "neb"_neb.html command to perform a nudged
elastic band (NEB) calculation for transition state finding. Hi-level
explanations of NEB are given with the "neb"_neb.html command and in
-"this section"_Section_howto.html#howto_5 of the manual. The fix neb
-command must be used with the "neb" command to define how
+"Section_howto 5"_Section_howto.html#howto_5 of the manual. The fix
+neb command must be used with the "neb" command to define how
inter-replica forces are computed.
Only the N atoms in the fix group experience inter-replica forces.
Atoms in the two end-point replicas do not experience these forces,
but those in intermediate replicas do. During the initial stage of
NEB, the 3N-length vector of interatomic forces Fi = -Grad(V) acting
on the atoms of each intermediate replica I is altered, as described
in the "(Henkelman1)"_#Henkelman1 paper, to become:
Fi = -Grad(V) + (Grad(V) dot That) That + Kspring (|Ri+i - Ri| - |Ri - Ri-1|) That :pre
Ri are the atomic coordinates of replica I; Ri-1 and Ri+1 are the
coordinates of its neighbor replicas. That (t with a hat over it) is
the unit "tangent" vector for replica I which is a function of Ri,
Ri-1, Ri+1, and the potential energy of the 3 replicas; it points
roughly in the direction of (Ri+i - Ri-1); see the
"(Henkelman1)"_#Henkelman1 paper for details.
The first two terms in the above equation are the component of the
interatomic forces perpendicular to the tangent vector. The last term
is a spring force between replica I and its neighbors, parallel to the
tangent vector direction with the specified spring constant {Kspring}.
The effect of the first two terms is to push the atoms of each replica
toward the minimum energy path (MEP) of conformational states that
transition over the energy barrier. The MEP for an energy barrier is
defined as a sequence of 3N-dimensional states which cross the barrier
at its saddle point, each of which has a potential energy gradient
parallel to the MEP itself.
The effect of the last term is to push each replica away from its two
neighbors in a direction along the MEP, so that the final set of
states are equidistant from each other.
During the second stage of NEB, the forces on the N atoms in the
replica nearest the top of the energy barrier are altered so that it
climbs to the top of the barrier and finds the saddle point. The
forces on atoms in this replica are described in the
"(Henkelman2)"_#Henkelman2 paper, and become:
Fi = -Grad(V) + 2 (Grad(V) dot That) That :pre
The inter-replica forces for the other replicas are unchanged from the
first equation.
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various "output
commands"_Section_howto.html#howto_15. 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,
as invoked by the "minimize"_minimize.html command via the
"neb"_neb.html command.
[Restrictions:]
This command can only be used if LAMMPS was built with the REPLICA
package. See the "Making LAMMPS"_Section_start.html#start_3 section
for more info on packages.
[Related commands:]
"neb"_neb.html
[Default:] none
:link(Henkelman)
[(Henkelman1)] Henkelman and Jonsson, J Chem Phys, 113, 9978-9985 (2000).
:link(Henkelman)
[(Henkelman2)] Henkelman, Uberuaga, Jonsson, J Chem Phys, 113,
9901-9904 (2000).
diff --git a/doc/fix_nh.html b/doc/fix_nh.html
index 6bf376ba7..845d2cd0a 100644
--- a/doc/fix_nh.html
+++ b/doc/fix_nh.html
@@ -1,545 +1,545 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix nvt command
</H3>
<H3>fix nvt/cuda command
</H3>
<H3>fix npt command
</H3>
<H3>fix npt/cuda command
</H3>
<H3>fix nph command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID style_name keyword value ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>style_name = <I>nvt</I> or <I>npt</I> or <I>nph</I>
<PRE>one or more keyword value pairs may be appended
keyword = <I>temp</I> or <I>iso</I> or <I>aniso</I> or <I>tri</I> or <I>x</I> or <I>y</I> or <I>z</I> or <I>xy</I> or <I>yz</I> or <I>xz</I> or <I>couple</I> or <I>tchain</I> or <I>pchain</I> or <I>mtk</I> or <I>tloop</I> or <I>ploop</I> or <I>nreset</I> or <I>drag</I> or <I>dilate</I> or <I>scaleyz</I> or <I>scalexz</I> or <I>scalexy</I>
<I>temp</I> values = Tstart Tstop Tdamp
Tstart,Tstop = external temperature at start/end of run
Tdamp = temperature damping parameter (time units)
<I>iso</I> or <I>aniso</I> or <I>tri</I> values = Pstart Pstop Pdamp
Pstart,Pstop = scalar external pressure at start/end of run (pressure units)
Pdamp = pressure damping parameter (time units)
<I>x</I> or <I>y</I> or <I>z</I> or <I>xy</I> or <I>yz</I> or <I>xz</I> values = Pstart Pstop Pdamp
Pstart,Pstop = external stress tensor component at start/end of run (pressure units)
Pdamp = stress damping parameter (time units)
<I>couple</I> = <I>none</I> or <I>xyz</I> or <I>xy</I> or <I>yz</I> or <I>xz</I>
<I>tchain</I> value = length of thermostat chain (1 = single thermostat)
<I>pchain</I> values = length of thermostat chain on barostat (0 = no thermostat)
<I>mtk</I> value = <I>yes</I> or <I>no</I> = add in MTK adjustment term or not
<I>tloop</I> value = number of sub-cycles to perform on thermostat
<I>ploop</I> value = number of sub-cycles to perform on barostat thermostat
<I>nreset</I> value = reset reference cell every this many timesteps
<I>drag</I> value = drag factor added to barostat/thermostat (0.0 = no drag)
<I>dilate</I> value = <I>all</I> or <I>partial</I>
<I>scaleyz</I> value = <I>yes</I> or <I>no</I> = scale yz with lz
<I>scalexz</I> value = <I>yes</I> or <I>no</I> = scale xz with lz
<I>scalexy</I> value = <I>yes</I> or <I>no</I> = scale xy with ly
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all nvt temp 300.0 300.0 100.0
fix 1 water npt temp 300.0 300.0 100.0 iso 0.0 0.0 1000.0
fix 2 jello npt temp 300.0 300.0 100.0 tri 5.0 5.0 1000.0
fix 2 ice nph x 1.0 1.0 0.5 y 2.0 2.0 0.5 z 3.0 3.0 0.5 yz 0.1 0.1 0.5 xz 0.2 0.2 0.5 xy 0.3 0.3 0.5 nreset 1000
</PRE>
<P><B>Description:</B>
</P>
<P>These commands perform time integration on Nose-Hoover style
non-Hamiltonian equations of motion which are designed to generate
positions and velocities sampled from the canonical (nvt),
isothermal-isobaric (npt), and isenthalpic (nph) ensembles. This is
achieved by adding some dynamic variables which are coupled to the
particle velocities (thermostatting) and simulation domain dimensions
(barostatting). In addition to basic thermostatting and barostatting,
these fixes can also create a chain of thermostats coupled to the
particle thermostat, and another chain of thermostats coupled to the
barostat variables. The barostat can be coupled to the overall box
volume, or to individual dimensions, including the <I>xy</I>, <I>xz</I> and <I>yz</I>
tilt dimensions. The external pressure of the barostat can be
specified as either a scalar pressure (isobaric ensemble) or as
components of a symmetric stress tensor (constant stress ensemble).
When used correctly, the time-averaged temperature and stress tensor
of the particles will match the target values specified by
Tstart/Tstop and Pstart/Pstop.
</P>
<P>The equations of motion used are those of Shinoda et al. in
<A HREF = "#Shinoda">(Shinoda)</A>, which combine the hydrostatic equations of
Martyna, Tobias and Klein in <A HREF = "#Martyna">(Martyna)</A> with the strain
energy proposed by Parrinello and Rahman in
<A HREF = "#Parrinello">(Parrinello)</A>. The time integration schemes closely
follow the time-reversible measure-preserving Verlet and
rRESPA integrators derived by Tuckerman et al. in <A HREF = "#Tuckerman">(Tuckerman)</A>.
</P>
<HR>
<P>The thermostat for fix styles <I>nvt</I> and <I>npt</I> is specified using the
<I>temp</I> keyword. Other thermostat-related keywords are <I>tchain</I>,
<I>tloop</I> and <I>drag</I>, which are discussed below.
</P>
<P>The thermostat is applied to only the translational degrees of freedom
for the particles. The translational degrees of freedom can also have
a bias velocity removed before thermostatting takes place; see the
description below. The desired temperature at each timestep is a
ramped value during the run from <I>Tstart</I> to <I>Tstop</I>. The <I>Tdamp</I>
parameter is specified in time units and determines how rapidly the
temperature is relaxed. For example, a value of 10.0 means to relax
the temperature in a timespan of (roughly) 10 time units (e.g. tau or
fmsec or psec - see the <A HREF = "units.html">units</A> command). The atoms in the
fix group are the only ones whose velocities and positions are updated
by the velocity/position update portion of the integration.
</P>
<P>IMPORTANT NOTE: A Nose-Hoover thermostat will not work well for
arbitrary values of <I>Tdamp</I>. If <I>Tdamp</I> is too small, the temperature
can fluctuate wildly; if it is too large, the temperature will take a
very long time to equilibrate. A good choice for many models is a
<I>Tdamp</I> of around 100 timesteps. Note that this is NOT the same as
100 time units for most <A HREF = "units.html">units</A> settings.
</P>
<HR>
<P>The barostat for fix styles <I>npt</I> and <I>nph</I> is specified using one or
more of the <I>iso</I>, <I>aniso</I>, <I>tri</I>, <I>x</I>, <I>y</I>, <I>z</I>, <I>xy</I>, <I>xz</I>, <I>yz</I>,
and <I>couple</I> keywords. These keywords give you the ability to specify
all 6 components of an external stress tensor, and to couple various
of these components together so that the dimensions they represent are
varied together during a constant-pressure simulation.
</P>
<P>Other barostat-related keywords are <I>pchain</I>, <I>mtk</I>, <I>ploop</I>,
<I>nreset</I>, <I>drag</I>, and <I>dilate</I>, which are discussed below.
</P>
<P>Orthogonal simulation boxes have 3 adjustable dimensions (x,y,z).
Triclinic (non-orthogonal) simulation boxes have 6 adjustable
dimensions (x,y,z,xy,xz,yz). The <A HREF = "create_box.html">create_box</A>, <A HREF = "read_data.html">read
data</A>, and <A HREF = "read_restart.html">read_restart</A> commands
specify whether the simulation box is orthogonal or non-orthogonal
(triclinic) and explain the meaning of the xy,xz,yz tilt factors.
</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>, <I>xy</I>, <I>xz</I>, <I>yz</I>
keywords, which correspond to the 6 simulation box dimensions. For
each component, the external pressure or tensor component at each
timestep is a ramped value during the run from <I>Pstart</I> to <I>Pstop</I>.
If a target pressure is specified for a component, then the
corresponding box dimension will change during a simulation. For
example, if the <I>y</I> keyword is used, the y-box length will change. If
the <I>xy</I> keyword is used, the xy tilt factor will change. A box
dimension will not change if that component is not specified, although
you have the option to change that dimension via the <A HREF = "fix_deform.html">fix
deform</A> command.
</P>
<P>Note that in order to use the <I>xy</I>, <I>xz</I>, or <I>yz</I> keywords, the
simulation box must be triclinic, even if its initial tilt factors are
0.0.
</P>
<P>For all barostat keywords, the <I>Pdamp</I> parameter operates like the
<I>Tdamp</I> parameter, determining the time scale on which pressure is
relaxed. For example, a value of 10.0 means to relax the pressure in
a timespan of (roughly) 10 time units (e.g. tau or fmsec or psec - see
the <A HREF = "units.html">units</A> command).
</P>
<P>IMPORTANT NOTE: A Nose-Hoover barostat will not work well for
arbitrary values of <I>Pdamp</I>. If <I>Pdamp</I> is too small, the pressure
and volume can fluctuate wildly; if it is too large, the pressure will
take a very long time to equilibrate. A good choice for many models
is a <I>Pdamp</I> of around 1000 timesteps. Note that this is NOT the same
as 1000 time units for most <A HREF = "units.html">units</A> settings.
</P>
<P>Regardless of what atoms are in the fix group, a global pressure or
stress tensor is computed for all atoms. Similarly, when the size of
the simulation box is changed, all atoms are re-scaled to new
positions, unless the keyword <I>dilate</I> is specified with a value of
<I>partial</I>, in which case only the atoms in the fix group are
re-scaled. The latter can be useful for leaving the coordinates of
atoms in a solid substrate unchanged and controlling the pressure of a
surrounding fluid.
</P>
<HR>
<P>The <I>couple</I> keyword allows two or three of the diagonal components of
the pressure tensor to be "coupled" together. The value specified
with the keyword determines which are coupled. For example, <I>xz</I>
means the <I>Pxx</I> and <I>Pzz</I> components of the stress tensor are coupled.
<I>Xyz</I> means all 3 diagonal components are coupled. Coupling means two
things: the instantaneous stress will be computed as an average of the
corresponding diagonal components, and the coupled box dimensions will
be changed together in lockstep, meaning coupled dimensions will be
dilated or contracted by the same percentage every timestep. The
<I>Pstart</I>, <I>Pstop</I>, <I>Pdamp</I> parameters for any coupled dimensions must
be identical. <I>Couple xyz</I> can be used for a 2d simulation; the <I>z</I>
dimension is simply ignored.
</P>
<HR>
<P>The <I>iso</I>, <I>aniso</I>, and <I>tri</I> keywords are simply shortcuts that are
equivalent to specifying several other keywords together.
</P>
<P>The keyword <I>iso</I> means couple all 3 diagonal components together when
pressure is computed (hydrostatic pressure), and dilate/contract the
dimensions together. Using "iso Pstart Pstop Pdamp" is the same as
specifying these 4 keywords:
</P>
<PRE>x Pstart Pstop Pdamp
y Pstart Pstop Pdamp
z Pstart Pstop Pdamp
couple xyz
</PRE>
<P>The keyword <I>aniso</I> means <I>x</I>, <I>y</I>, and <I>z</I> dimensions are controlled
independently using the <I>Pxx</I>, <I>Pyy</I>, and <I>Pzz</I> components of the
stress tensor as the driving forces, and the specified scalar external
pressure. Using "aniso Pstart Pstop Pdamp" is the same as specifying
these 4 keywords:
</P>
<PRE>x Pstart Pstop Pdamp
y Pstart Pstop Pdamp
z Pstart Pstop Pdamp
couple none
</PRE>
<P>The keyword <I>tri</I> means <I>x</I>, <I>y</I>, <I>z</I>, <I>xy</I>, <I>xz</I>, and <I>yz</I> dimensions
are controlled independently using their individual stress components
as the driving forces, and the specified scalar pressure as the
external normal stress. Using "tri Pstart Pstop Pdamp" is the same as
specifying these 7 keywords:
</P>
<PRE>x Pstart Pstop Pdamp
y Pstart Pstop Pdamp
z Pstart Pstop Pdamp
xy 0.0 0.0 Pdamp
yz 0.0 0.0 Pdamp
xz 0.0 0.0 Pdamp
couple none
</PRE>
<HR>
<P>In some cases (e.g. for solids) the pressure (volume) and/or
temperature of the system can oscillate undesirably when a Nose/Hoover
barostat and thermostat is applied. The optional <I>drag</I> keyword will
damp these oscillations, although it alters the Nose/Hoover equations.
A value of 0.0 (no drag) leaves the Nose/Hoover formalism unchanged.
A non-zero value adds a drag term; the larger the value specified, the
greater the damping effect. Performing a short run and monitoring the
pressure and temperature is the best way to determine if the drag term
is working. Typically a value between 0.2 to 2.0 is sufficient to
damp oscillations after a few periods. Note that use of the drag
keyword will interfere with energy conservation and will also change
the distribution of positions and velocities so that they do not
correspond to the nominal NVT, NPT, or NPH ensembles.
</P>
<P>An alternative way to control initial oscillations is to use chain
thermostats. The keyword <I>tchain</I> determines the number of thermostats
in the particle thermostat. A value of 1 corresponds to the original
Nose-Hoover thermostat. The keyword <I>pchain</I> specifies the number of
thermostats in the chain thermostatting the barostat degrees of
freedom. A value of 0 corresponds to no thermostatting of the
barostat variables.
</P>
<P>The <I>mtk</I> keyword controls whether or not the correction terms due to
Martyna, Tuckerman, and Klein are included in the equations of motion
<A HREF = "#Martyna">(Martyna)</A>. Specifying <I>no</I> reproduces the original
Hoover barostat, whose volume probability distribution function
differs from the true NPT and NPH ensembles by a factor of 1/V. Hence
using <I>yes</I> is more correct, but in many cases the difference is
negligible.
</P>
<P>The keyword <I>tloop</I> can be used to improve the accuracy of integration
scheme at little extra cost. The initial and final updates of the
thermostat variables are broken up into <I>tloop</I> substeps, each of
length <I>dt</I>/<I>tloop</I>. This corresponds to using a first-order
Suzuki-Yoshida scheme <A HREF = "#Tuckerman2006">(Tuckerman2006)</A>. The keyword
<I>ploop</I> does the same thing for the barostat thermostat.
</P>
<P>The keyword <I>nreset</I> controls how often the reference dimensions used
to define the strain energy are reset. If this keyword is not used,
or is given a value of zero, then the reference dimensions are set to
those of the initial simulation domain and are never changed. If the
simulation domain changes significantly during the simulation, then
the final average pressure tensor will differ significantly from the
specified values of the external stress tensor. A value of <I>nstep</I>
means that every <I>nstep</I> timesteps, the reference dimensions are set
to those of the current simulation domain.
</P>
<P>The <I>scaleyz</I>, <I>scalexz</I>, and <I>scalexy</I> keywords control whether or
not the corresponding tilt factors are scaled with the
associated box dimensions
when barostatting triclinic periodic cells.
The default values <I>yes</I> will turn on scaling, which corresponds to
adjusting the linear dimensions of the cell while preserving its shape.
Choosing <I>no</I> ensures that the tilt factors are not scaled with the
box dimensions. See below for restrictions and default values in different
situations. In older versions of LAMMPS, scaling of tilt factors was not
performed. The old behavior can be recovered by setting all three
scale keywords to <I>no</I>.
</P>
<HR>
<P>IMPORTANT NOTE: Using a barostat coupled to tilt dimensions <I>xy</I>,
<I>xz</I>, <I>yz</I> can sometimes result in arbitrarily large values of the
tilt dimensions, i.e. a dramatically deformed simulation box. LAMMPS
allows the tilt factors to grow a little beyond the normal limit
of half the box length (0.6 times the box length), and then performs
flipping or re-shaping to an equivalent periodic cell. The re-shaping
operation is described in more detail in the doc page for
<A HREF = "fix_deform.html">fix deform</A>. Both the barostat dynamics and
the atom trajectories are unaffected by this operation. However,
if a tilt factor is incremented by a large amount (1.5 times the
box length) on a single timestep, LAMMPS can not accomodate
this event and will terminate the simulation
with an error. This error typically
indicates that there is something badly wrong with how the simulation
was constructed, such as specifying values of <I>Pstart</I> that are
too far from the current stress value, or specifying a timestep that
is too large. Triclinic barostatting should be used with
care. This also is true for other barostat styles, although they tend
to be more forgiving of insults. In particular, it is important to
recognize that equilibrium liquids can not support a shear stress and
that equilibrium solids can not support shear stresses that exceed the yield stress.
</P>
<P>IMPORTANT NOTE: Unlike the <A HREF = "fix_temp_berendsen.html">fix
temp/berendsen</A> command which performs
thermostatting but NO time integration, these fixes perform
thermostatting/barostatting AND time integration. Thus you should not
use any other time integration fix, such as <A HREF = "fix_nve.html">fix nve</A> on
atoms to which this fix is applied. Likewise, the <I>temp</I> options for
fix nvt and fix npt should not normally be used on atoms that also
have their temperature controlled by another fix - e.g. by <A HREF = "fix_nh.html">fix
langevin</A> or <A HREF = "fix_temp_rescale.html">fix temp/rescale</A>
commands.
</P>
<P>See <A HREF = "Section_howto.html#howto_16">this howto section</A> of the manual for
a discussion of different ways to compute temperature and perform
thermostatting and barostatting.
</P>
<HR>
<P>These fixes compute a temperature and pressure each timestep. To do
this, the fix creates its own computes of style "temp" and "pressure",
as if one of these two sets of commands had been issued:
</P>
<PRE>compute fix-ID_temp group-ID temp
compute fix-ID_press group-ID pressure fix-ID_temp
</PRE>
<PRE>compute fix-ID_temp all temp
compute fix-ID_press all pressure fix-ID_temp
</PRE>
<P>See the <A HREF = "compute_temp.html">compute temp</A> and <A HREF = "compute_pressure.html">compute
pressure</A> commands for details. Note that the
IDs of the new computes are the fix-ID + underscore + "temp" or fix_ID
+ underscore + "press". For fix nvt, the group for the new computes
is the same as the fix group. For fix nph and fix npt, the group for
the new computes is "all" since pressure is computed for the entire
system.
</P>
<P>Note that these are NOT the computes used by thermodynamic output (see
the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>
and <I>thermo_press</I>. This means you can change the attributes of this
fix's temperature or pressure via the
<A HREF = "compute_modify.html">compute_modify</A> command or print this temperature
or pressure during thermodynamic output via the <A HREF = "thermo_style.html">thermo_style
custom</A> command using the appropriate compute-ID.
It also means that changing attributes of <I>thermo_temp</I> or
<I>thermo_press</I> will have no effect on this fix.
</P>
<P>Like other fixes that perform thermostatting, fix nvt and fix npt can
be used with <A HREF = "compute.html">compute commands</A> that calculate a
temperature after removing a "bias" from the atom velocities.
E.g. removing the center-of-mass velocity from a group of atoms or
only calculating temperature on the x-component of velocity or only
calculating temperature for atoms in a geometric region. This is not
done by default, but only if the <A HREF = "fix_modify.html">fix_modify</A> command
is used to assign a temperature compute to this fix that includes such
a bias term. See the doc pages for individual <A HREF = "compute.html">compute
commands</A> to determine which ones include a bias. In
this case, the thermostat works in the following manner: the current
temperature is calculated taking the bias into account, bias is
removed from each atom, thermostatting is performed on the remaining
thermal degrees of freedom, and the bias is added back in.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>These fixes writes the state of all the thermostat and barostat
variables to <A HREF = "restart.html">binary restart files</A>. See the
<A HREF = "read_restart.html">read_restart</A> command for info on how to re-specify
a fix in an input script that reads a restart file, so that the
operation of the fix continues in an uninterrupted fashion.
</P>
<P>The <A HREF = "fix_modify.html">fix_modify</A> <I>temp</I> and <I>press</I> options are
supported by these fixes. You can use them to assign a
<A HREF = "compute.html">compute</A> you have defined to this fix which will be used
in its thermostatting or barostatting procedure, as described above.
If you do this, note that the kinetic energy derived from the compute
temperature should be consistent with the virial term computed using
all atoms for the pressure. LAMMPS will warn you if you choose to
compute temperature on a subset of atoms.
</P>
<P>IMPORTANT NOTE: If both the <I>temp</I> and <I>press</I> keywords are used in a
single thermo_modify command (or in two separate commands), then the
order in which the keywords are specified is important. Note that a
<A HREF = "compute_pressure.html">pressure compute</A> defines its own temperature
compute as an argument when it is specified. The <I>temp</I> keyword will
override this (for the pressure compute being used by fix npt), but
only if the <I>temp</I> keyword comes after the <I>press</I> keyword. If the
<I>temp</I> keyword comes before the <I>press</I> keyword, then the new pressure
compute specified by the <I>press</I> keyword will be unaffected by the
<I>temp</I> setting.
</P>
<P>The <A HREF = "fix_modify.html">fix_modify</A> <I>energy</I> option is supported by these
fixes to add the energy change induced by Nose/Hoover thermostatting
and barostatting to the system's potential energy as part of
<A HREF = "thermo_style.html">thermodynamic output</A>.
</P>
<P>These fixes compute a global scalar and a global vector of quantities,
which can be accessed by various <A HREF = "Section_howto.html#howto_15">output
commands</A>. The scalar value calculated by
these fixes is "extensive"; the vector values are "intensive".
</P>
<P>The scalar is the cumulative energy change due to the fix.
</P>
<P>The vector stores internal Nose/Hoover thermostat and barostat
variables. The number and meaning of the vector values depends on
which fix is used and the settings for keywords <I>tchain</I> and <I>pchain</I>,
which specify the number of Nose/Hoover chains for the thermostat and
barostat. If no thermostatting is done, then <I>tchain</I> is 0. If no
barostatting is done, then <I>pchain</I> is 0. In the following list,
"ndof" is 0, 1, 3, or 6, and is the number of degrees of freedom in
the barostat. Its value is 0 if no barostat is used, else its value
is 6 if any off-diagonal stress tensor component is barostatted, else
its value is 1 if <I>couple xyz</I> is used or <I>couple xy</I> for a 2d
simulation, otherwise its value is 3.
</P>
<P>The order of values in the global vector and their meaning is as
follows. The notation means there are tchain values for eta, followed
by tchain for eta_dot, followed by ndof for omega, etc:
</P>
<UL><LI>eta[tchain] = particle thermostat displacements (unitless)
<LI>eta_dot[tchain] = particle thermostat velocities (1/time units)
<LI>omega[ndof] = barostat displacements (unitless)
<LI>omega_dot[ndof] = barostat velocities (1/time units)
<LI>etap[pchain] = barostat thermostat displacements (unitless)
<LI>etap_dot[pchain] = barostat thermostat velocities (1/time units)
<LI>PE_eta[tchain] = potential energy of each particle thermostat displacement (energy units)
<LI>KE_eta_dot[tchain] = kinetic energy of each particle thermostat velocity (energy units)
<LI>PE_omega[ndof] = potential energy of each barostat displacement (energy units)
<LI>KE_omega_dot[ndof] = kinetic energy of each barostat velocity (energy units)
<LI>PE_etap[pchain] = potential energy of each barostat thermostat displacement (energy units)
<LI>KE_etap_dot[pchain] = kinetic energy of each barostat thermostat velocity (energy units)
<LI>PE_strain[1] = scalar strain energy (energy units)
</UL>
<P>These fixes can ramp their external temperature and pressure over
multiple runs, using the <I>start</I> and <I>stop</I> keywords of the
<A HREF = "run.html">run</A> command. See the <A HREF = "run.html">run</A> command for details of
how to do this.
</P>
<P>These fixes are not invoked during <A HREF = "minimize.html">energy
minimization</A>.
</P>
<P>These fixes can be used with either the <I>verlet</I> or <I>respa</I>
<A HREF = "run_style.html">integrators</A>. When using one of the barostat fixes
with <I>respa</I>, LAMMPS uses an integrator constructed
according to the following factorization of the Liouville propagator
(for two rRESPA levels):
</P>
<CENTER><IMG SRC = "Eqs/fix_nh1.jpg">
</CENTER>
<P>This factorization differs somewhat from that of Tuckerman et al., in that
the barostat is only updated at the outermost rRESPA level, whereas
Tuckerman's factorization requires splitting the pressure into pieces
corresponding to the forces computed at each rRESPA level. In theory, the
latter method will exhibit better numerical stability. In practice,
because Pdamp is normally chosen to be a large multiple of the
outermost rRESPA timestep, the barostat dynamics are not the
limiting factor for numerical stability. Both
factorizations are time-reversible and can be shown to preserve the phase
space measure of the underlying non-Hamiltonian equations of motion.
</P>
<P><B>Restrictions:</B>
</P>
<P>Non-periodic dimensions cannot be barostatted. <I>Z</I>, <I>xz</I>, and <I>yz</I>,
cannot be barostatted 2D simulations. <I>Xy</I>, <I>xz</I>, and <I>yz</I> can only
be barostatted if the simulation domain is triclinic and the 2nd
dimension in the keyword (<I>y</I> dimension in <I>xy</I>) is periodic. The
<A HREF = "create_box.html">create_box</A>, <A HREF = "read_data.html">read data</A>, and
<A HREF = "read_restart.html">read_restart</A> commands specify whether the
simulation box is orthogonal or non-orthogonal (triclinic) and explain
the meaning of the xy,xz,yz tilt factors.
</P>
<P>For the <I>temp</I> keyword, the final Tstop cannot be 0.0 since it would
make the external T = 0.0 at some timestep during the simulation which
is not allowed in the Nose/Hoover formulation.
</P>
<P>The <I>scaleyz yes</I> and <I>scalexz yes</I> keyword/value pairs can not be used
for 2D simulations. <I>scaleyz yes</I>, <I>scalexz yes</I>, and <I>scalexy yes</I> options
can only be used if the 2nd dimension in the keyword is periodic,
and if the tilt factor is not coupled to the barostat via keywords
<I>tri</I>, <I>yz</I>, <I>xz</I>, and <I>xy</I>.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_nve.html">fix nve</A>, <A HREF = "fix_modify.html">fix_modify</A>, <A HREF = "run_style.html">run_style</A>
</P>
<P><B>Default:</B>
</P>
<P>The keyword defaults are tchain = 3, pchain = 3, mtk = yes, tloop =
ploop = 1, nreset = 0, drag = 0.0, dilate = all, couple = none,
scaleyz = scalexz = scalexy = yes if periodic in 2nd dimension and
not coupled to barostat, otherwise no.
</P>
<HR>
<A NAME = "Martyna"></A>
<P><B>(Martyna)</B> Martyna, Tobias and Klein, J Chem Phys, 101, 4177 (1994).
</P>
<A NAME = "Parrinello"></A>
<P><B>(Parrinello)</B> Parrinello and Rahman, J Appl Phys, 52, 7182 (1981).
</P>
<A NAME = "Tuckerman"></A>
<P><B>(Tuckerman)</B> Tuckerman, Alejandre, Lopez-Rendon, Jochim, and
Martyna, J Phys A: Math Gen, 39, 5629 (2006).
</P>
<A NAME = "Shinoda"></A>
<P><B>(Shinoda)</B> Shinoda, Shiga, and Mikami, Phys Rev B, 69, 134103 (2004).
</P>
</HTML>
diff --git a/doc/fix_nh.txt b/doc/fix_nh.txt
index f7dd7f256..749097a8c 100644
--- a/doc/fix_nh.txt
+++ b/doc/fix_nh.txt
@@ -1,529 +1,529 @@
"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 nvt command :h3
fix nvt/cuda command :h3
fix npt command :h3
fix npt/cuda command :h3
fix nph command :h3
[Syntax:]
fix ID group-ID style_name keyword value ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
style_name = {nvt} or {npt} or {nph} :l
one or more keyword value pairs may be appended
keyword = {temp} or {iso} or {aniso} or {tri} or {x} or {y} or {z} or {xy} or {yz} or {xz} or {couple} or {tchain} or {pchain} or {mtk} or {tloop} or {ploop} or {nreset} or {drag} or {dilate} or {scaleyz} or {scalexz} or {scalexy}
{temp} values = Tstart Tstop Tdamp
Tstart,Tstop = external temperature at start/end of run
Tdamp = temperature damping parameter (time units)
{iso} or {aniso} or {tri} values = Pstart Pstop Pdamp
Pstart,Pstop = scalar external pressure at start/end of run (pressure units)
Pdamp = pressure damping parameter (time units)
{x} or {y} or {z} or {xy} or {yz} or {xz} values = Pstart Pstop Pdamp
Pstart,Pstop = external stress tensor component at start/end of run (pressure units)
Pdamp = stress damping parameter (time units)
{couple} = {none} or {xyz} or {xy} or {yz} or {xz}
{tchain} value = length of thermostat chain (1 = single thermostat)
{pchain} values = length of thermostat chain on barostat (0 = no thermostat)
{mtk} value = {yes} or {no} = add in MTK adjustment term or not
{tloop} value = number of sub-cycles to perform on thermostat
{ploop} value = number of sub-cycles to perform on barostat thermostat
{nreset} value = reset reference cell every this many timesteps
{drag} value = drag factor added to barostat/thermostat (0.0 = no drag)
{dilate} value = {all} or {partial}
{scaleyz} value = {yes} or {no} = scale yz with lz
{scalexz} value = {yes} or {no} = scale xz with lz
{scalexy} value = {yes} or {no} = scale xy with ly :pre
:ule
[Examples:]
fix 1 all nvt temp 300.0 300.0 100.0
fix 1 water npt temp 300.0 300.0 100.0 iso 0.0 0.0 1000.0
fix 2 jello npt temp 300.0 300.0 100.0 tri 5.0 5.0 1000.0
fix 2 ice nph x 1.0 1.0 0.5 y 2.0 2.0 0.5 z 3.0 3.0 0.5 yz 0.1 0.1 0.5 xz 0.2 0.2 0.5 xy 0.3 0.3 0.5 nreset 1000 :pre
[Description:]
These commands perform time integration on Nose-Hoover style
non-Hamiltonian equations of motion which are designed to generate
positions and velocities sampled from the canonical (nvt),
isothermal-isobaric (npt), and isenthalpic (nph) ensembles. This is
achieved by adding some dynamic variables which are coupled to the
particle velocities (thermostatting) and simulation domain dimensions
(barostatting). In addition to basic thermostatting and barostatting,
these fixes can also create a chain of thermostats coupled to the
particle thermostat, and another chain of thermostats coupled to the
barostat variables. The barostat can be coupled to the overall box
volume, or to individual dimensions, including the {xy}, {xz} and {yz}
tilt dimensions. The external pressure of the barostat can be
specified as either a scalar pressure (isobaric ensemble) or as
components of a symmetric stress tensor (constant stress ensemble).
When used correctly, the time-averaged temperature and stress tensor
of the particles will match the target values specified by
Tstart/Tstop and Pstart/Pstop.
The equations of motion used are those of Shinoda et al. in
"(Shinoda)"_#Shinoda, which combine the hydrostatic equations of
Martyna, Tobias and Klein in "(Martyna)"_#Martyna with the strain
energy proposed by Parrinello and Rahman in
"(Parrinello)"_#Parrinello. The time integration schemes closely
follow the time-reversible measure-preserving Verlet and
rRESPA integrators derived by Tuckerman et al. in "(Tuckerman)"_#Tuckerman.
:line
The thermostat for fix styles {nvt} and {npt} is specified using the
{temp} keyword. Other thermostat-related keywords are {tchain},
{tloop} and {drag}, which are discussed below.
The thermostat is applied to only the translational degrees of freedom
for the particles. The translational degrees of freedom can also have
a bias velocity removed before thermostatting takes place; see the
description below. The desired temperature at each timestep is a
ramped value during the run from {Tstart} to {Tstop}. The {Tdamp}
parameter is specified in time units and determines how rapidly the
temperature is relaxed. For example, a value of 10.0 means to relax
the temperature in a timespan of (roughly) 10 time units (e.g. tau or
fmsec or psec - see the "units"_units.html command). The atoms in the
fix group are the only ones whose velocities and positions are updated
by the velocity/position update portion of the integration.
IMPORTANT NOTE: A Nose-Hoover thermostat will not work well for
arbitrary values of {Tdamp}. If {Tdamp} is too small, the temperature
can fluctuate wildly; if it is too large, the temperature will take a
very long time to equilibrate. A good choice for many models is a
{Tdamp} of around 100 timesteps. Note that this is NOT the same as
100 time units for most "units"_units.html settings.
:line
The barostat for fix styles {npt} and {nph} is specified using one or
more of the {iso}, {aniso}, {tri}, {x}, {y}, {z}, {xy}, {xz}, {yz},
and {couple} keywords. These keywords give you the ability to specify
all 6 components of an external stress tensor, and to couple various
of these components together so that the dimensions they represent are
varied together during a constant-pressure simulation.
Other barostat-related keywords are {pchain}, {mtk}, {ploop},
{nreset}, {drag}, and {dilate}, which are discussed below.
Orthogonal simulation boxes have 3 adjustable dimensions (x,y,z).
Triclinic (non-orthogonal) simulation boxes have 6 adjustable
dimensions (x,y,z,xy,xz,yz). The "create_box"_create_box.html, "read
data"_read_data.html, and "read_restart"_read_restart.html commands
specify whether the simulation box is orthogonal or non-orthogonal
(triclinic) and explain the meaning of the xy,xz,yz tilt factors.
The target pressures for each of the 6 components of the stress tensor
can be specified independently via the {x}, {y}, {z}, {xy}, {xz}, {yz}
keywords, which correspond to the 6 simulation box dimensions. For
each component, the external pressure or tensor component at each
timestep is a ramped value during the run from {Pstart} to {Pstop}.
If a target pressure is specified for a component, then the
corresponding box dimension will change during a simulation. For
example, if the {y} keyword is used, the y-box length will change. If
the {xy} keyword is used, the xy tilt factor will change. A box
dimension will not change if that component is not specified, although
you have the option to change that dimension via the "fix
deform"_fix_deform.html command.
Note that in order to use the {xy}, {xz}, or {yz} keywords, the
simulation box must be triclinic, even if its initial tilt factors are
0.0.
For all barostat keywords, the {Pdamp} parameter operates like the
{Tdamp} parameter, determining the time scale on which pressure is
relaxed. For example, a value of 10.0 means to relax the pressure in
a timespan of (roughly) 10 time units (e.g. tau or fmsec or psec - see
the "units"_units.html command).
IMPORTANT NOTE: A Nose-Hoover barostat will not work well for
arbitrary values of {Pdamp}. If {Pdamp} is too small, the pressure
and volume can fluctuate wildly; if it is too large, the pressure will
take a very long time to equilibrate. A good choice for many models
is a {Pdamp} of around 1000 timesteps. Note that this is NOT the same
as 1000 time units for most "units"_units.html settings.
Regardless of what atoms are in the fix group, a global pressure or
stress tensor is computed for all atoms. Similarly, when the size of
the simulation box is changed, all atoms are re-scaled to new
positions, unless the keyword {dilate} is specified with a value of
{partial}, in which case only the atoms in the fix group are
re-scaled. The latter can be useful for leaving the coordinates of
atoms in a solid substrate unchanged and controlling the pressure of a
surrounding fluid.
:line
The {couple} keyword allows two or three of the diagonal components of
the pressure tensor to be "coupled" together. The value specified
with the keyword determines which are coupled. For example, {xz}
means the {Pxx} and {Pzz} components of the stress tensor are coupled.
{Xyz} means all 3 diagonal components are coupled. Coupling means two
things: the instantaneous stress will be computed as an average of the
corresponding diagonal components, and the coupled box dimensions will
be changed together in lockstep, meaning coupled dimensions will be
dilated or contracted by the same percentage every timestep. The
{Pstart}, {Pstop}, {Pdamp} parameters for any coupled dimensions must
be identical. {Couple xyz} can be used for a 2d simulation; the {z}
dimension is simply ignored.
:line
The {iso}, {aniso}, and {tri} keywords are simply shortcuts that are
equivalent to specifying several other keywords together.
The keyword {iso} means couple all 3 diagonal components together when
pressure is computed (hydrostatic pressure), and dilate/contract the
dimensions together. Using "iso Pstart Pstop Pdamp" is the same as
specifying these 4 keywords:
x Pstart Pstop Pdamp
y Pstart Pstop Pdamp
z Pstart Pstop Pdamp
couple xyz :pre
The keyword {aniso} means {x}, {y}, and {z} dimensions are controlled
independently using the {Pxx}, {Pyy}, and {Pzz} components of the
stress tensor as the driving forces, and the specified scalar external
pressure. Using "aniso Pstart Pstop Pdamp" is the same as specifying
these 4 keywords:
x Pstart Pstop Pdamp
y Pstart Pstop Pdamp
z Pstart Pstop Pdamp
couple none :pre
The keyword {tri} means {x}, {y}, {z}, {xy}, {xz}, and {yz} dimensions
are controlled independently using their individual stress components
as the driving forces, and the specified scalar pressure as the
external normal stress. Using "tri Pstart Pstop Pdamp" is the same as
specifying these 7 keywords:
x Pstart Pstop Pdamp
y Pstart Pstop Pdamp
z Pstart Pstop Pdamp
xy 0.0 0.0 Pdamp
yz 0.0 0.0 Pdamp
xz 0.0 0.0 Pdamp
couple none :pre
:line
In some cases (e.g. for solids) the pressure (volume) and/or
temperature of the system can oscillate undesirably when a Nose/Hoover
barostat and thermostat is applied. The optional {drag} keyword will
damp these oscillations, although it alters the Nose/Hoover equations.
A value of 0.0 (no drag) leaves the Nose/Hoover formalism unchanged.
A non-zero value adds a drag term; the larger the value specified, the
greater the damping effect. Performing a short run and monitoring the
pressure and temperature is the best way to determine if the drag term
is working. Typically a value between 0.2 to 2.0 is sufficient to
damp oscillations after a few periods. Note that use of the drag
keyword will interfere with energy conservation and will also change
the distribution of positions and velocities so that they do not
correspond to the nominal NVT, NPT, or NPH ensembles.
An alternative way to control initial oscillations is to use chain
thermostats. The keyword {tchain} determines the number of thermostats
in the particle thermostat. A value of 1 corresponds to the original
Nose-Hoover thermostat. The keyword {pchain} specifies the number of
thermostats in the chain thermostatting the barostat degrees of
freedom. A value of 0 corresponds to no thermostatting of the
barostat variables.
The {mtk} keyword controls whether or not the correction terms due to
Martyna, Tuckerman, and Klein are included in the equations of motion
"(Martyna)"_#Martyna. Specifying {no} reproduces the original
Hoover barostat, whose volume probability distribution function
differs from the true NPT and NPH ensembles by a factor of 1/V. Hence
using {yes} is more correct, but in many cases the difference is
negligible.
The keyword {tloop} can be used to improve the accuracy of integration
scheme at little extra cost. The initial and final updates of the
thermostat variables are broken up into {tloop} substeps, each of
length {dt}/{tloop}. This corresponds to using a first-order
Suzuki-Yoshida scheme "(Tuckerman2006)"_#Tuckerman2006. The keyword
{ploop} does the same thing for the barostat thermostat.
The keyword {nreset} controls how often the reference dimensions used
to define the strain energy are reset. If this keyword is not used,
or is given a value of zero, then the reference dimensions are set to
those of the initial simulation domain and are never changed. If the
simulation domain changes significantly during the simulation, then
the final average pressure tensor will differ significantly from the
specified values of the external stress tensor. A value of {nstep}
means that every {nstep} timesteps, the reference dimensions are set
to those of the current simulation domain.
The {scaleyz}, {scalexz}, and {scalexy} keywords control whether or
not the corresponding tilt factors are scaled with the
associated box dimensions
when barostatting triclinic periodic cells.
The default values {yes} will turn on scaling, which corresponds to
adjusting the linear dimensions of the cell while preserving its shape.
Choosing {no} ensures that the tilt factors are not scaled with the
box dimensions. See below for restrictions and default values in different
situations. In older versions of LAMMPS, scaling of tilt factors was not
performed. The old behavior can be recovered by setting all three
scale keywords to {no}.
:line
IMPORTANT NOTE: Using a barostat coupled to tilt dimensions {xy},
{xz}, {yz} can sometimes result in arbitrarily large values of the
tilt dimensions, i.e. a dramatically deformed simulation box. LAMMPS
allows the tilt factors to grow a little beyond the normal limit
of half the box length (0.6 times the box length), and then performs
flipping or re-shaping to an equivalent periodic cell. The re-shaping
operation is described in more detail in the doc page for
"fix deform"_fix_deform.html. Both the barostat dynamics and
the atom trajectories are unaffected by this operation. However,
if a tilt factor is incremented by a large amount (1.5 times the
box length) on a single timestep, LAMMPS can not accomodate
this event and will terminate the simulation
with an error. This error typically
indicates that there is something badly wrong with how the simulation
was constructed, such as specifying values of {Pstart} that are
too far from the current stress value, or specifying a timestep that
is too large. Triclinic barostatting should be used with
care. This also is true for other barostat styles, although they tend
to be more forgiving of insults. In particular, it is important to
recognize that equilibrium liquids can not support a shear stress and
that equilibrium solids can not support shear stresses that exceed the yield stress.
IMPORTANT NOTE: Unlike the "fix
temp/berendsen"_fix_temp_berendsen.html command which performs
thermostatting but NO time integration, these fixes perform
thermostatting/barostatting AND time integration. Thus you should not
use any other time integration fix, such as "fix nve"_fix_nve.html on
atoms to which this fix is applied. Likewise, the {temp} options for
fix nvt and fix npt should not normally be used on atoms that also
have their temperature controlled by another fix - e.g. by "fix
langevin"_fix_nh.html or "fix temp/rescale"_fix_temp_rescale.html
commands.
See "this howto section"_Section_howto.html#howto_16 of the manual for
a discussion of different ways to compute temperature and perform
thermostatting and barostatting.
:line
These fixes compute a temperature and pressure each timestep. To do
this, the fix creates its own computes of style "temp" and "pressure",
as if one of these two sets of commands had been issued:
compute fix-ID_temp group-ID temp
compute fix-ID_press group-ID pressure fix-ID_temp :pre
compute fix-ID_temp all temp
compute fix-ID_press all pressure fix-ID_temp :pre
See the "compute temp"_compute_temp.html and "compute
pressure"_compute_pressure.html commands for details. Note that the
IDs of the new computes are the fix-ID + underscore + "temp" or fix_ID
+ underscore + "press". For fix nvt, the group for the new computes
is the same as the fix group. For fix nph and fix npt, the group for
the new computes is "all" since pressure is computed for the entire
system.
Note that these are NOT the computes used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}
and {thermo_press}. This means you can change the attributes of this
fix's temperature or pressure via the
"compute_modify"_compute_modify.html command or print this temperature
or pressure during thermodynamic output via the "thermo_style
custom"_thermo_style.html command using the appropriate compute-ID.
It also means that changing attributes of {thermo_temp} or
{thermo_press} will have no effect on this fix.
Like other fixes that perform thermostatting, fix nvt and fix npt can
be used with "compute commands"_compute.html that calculate a
temperature after removing a "bias" from the atom velocities.
E.g. removing the center-of-mass velocity from a group of atoms or
only calculating temperature on the x-component of velocity or only
calculating temperature for atoms in a geometric region. This is not
done by default, but only if the "fix_modify"_fix_modify.html command
is used to assign a temperature compute to this fix that includes such
a bias term. See the doc pages for individual "compute
commands"_compute.html to determine which ones include a bias. In
this case, the thermostat works in the following manner: the current
temperature is calculated taking the bias into account, bias is
removed from each atom, thermostatting is performed on the remaining
thermal degrees of freedom, and the bias is added back in.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
These fixes writes the state of all the thermostat and barostat
variables to "binary restart files"_restart.html. See the
"read_restart"_read_restart.html command for info on how to re-specify
a fix in an input script that reads a restart file, so that the
operation of the fix continues in an uninterrupted fashion.
The "fix_modify"_fix_modify.html {temp} and {press} options are
supported by these fixes. You can use them to assign a
"compute"_compute.html you have defined to this fix which will be used
in its thermostatting or barostatting procedure, as described above.
If you do this, note that the kinetic energy derived from the compute
temperature should be consistent with the virial term computed using
all atoms for the pressure. LAMMPS will warn you if you choose to
compute temperature on a subset of atoms.
IMPORTANT NOTE: If both the {temp} and {press} keywords are used in a
single thermo_modify command (or in two separate commands), then the
order in which the keywords are specified is important. Note that a
"pressure compute"_compute_pressure.html defines its own temperature
compute as an argument when it is specified. The {temp} keyword will
override this (for the pressure compute being used by fix npt), but
only if the {temp} keyword comes after the {press} keyword. If the
{temp} keyword comes before the {press} keyword, then the new pressure
compute specified by the {press} keyword will be unaffected by the
{temp} setting.
The "fix_modify"_fix_modify.html {energy} option is supported by these
fixes to add the energy change induced by Nose/Hoover thermostatting
and barostatting to the system's potential energy as part of
"thermodynamic output"_thermo_style.html.
These fixes compute a global scalar and a global vector of quantities,
which can be accessed by various "output
commands"_Section_howto.html#howto_15. The scalar value calculated by
these fixes is "extensive"; the vector values are "intensive".
The scalar is the cumulative energy change due to the fix.
The vector stores internal Nose/Hoover thermostat and barostat
variables. The number and meaning of the vector values depends on
which fix is used and the settings for keywords {tchain} and {pchain},
which specify the number of Nose/Hoover chains for the thermostat and
barostat. If no thermostatting is done, then {tchain} is 0. If no
barostatting is done, then {pchain} is 0. In the following list,
"ndof" is 0, 1, 3, or 6, and is the number of degrees of freedom in
the barostat. Its value is 0 if no barostat is used, else its value
is 6 if any off-diagonal stress tensor component is barostatted, else
its value is 1 if {couple xyz} is used or {couple xy} for a 2d
simulation, otherwise its value is 3.
The order of values in the global vector and their meaning is as
follows. The notation means there are tchain values for eta, followed
by tchain for eta_dot, followed by ndof for omega, etc:
eta\[tchain\] = particle thermostat displacements (unitless)
eta_dot\[tchain\] = particle thermostat velocities (1/time units)
omega\[ndof\] = barostat displacements (unitless)
omega_dot\[ndof\] = barostat velocities (1/time units)
etap\[pchain\] = barostat thermostat displacements (unitless)
etap_dot\[pchain\] = barostat thermostat velocities (1/time units)
PE_eta\[tchain\] = potential energy of each particle thermostat displacement (energy units)
KE_eta_dot\[tchain\] = kinetic energy of each particle thermostat velocity (energy units)
PE_omega\[ndof\] = potential energy of each barostat displacement (energy units)
KE_omega_dot\[ndof\] = kinetic energy of each barostat velocity (energy units)
PE_etap\[pchain\] = potential energy of each barostat thermostat displacement (energy units)
KE_etap_dot\[pchain\] = kinetic energy of each barostat thermostat velocity (energy units)
PE_strain\[1\] = scalar strain energy (energy units) :ul
These fixes can ramp their external temperature and pressure over
multiple runs, using the {start} and {stop} keywords of the
"run"_run.html command. See the "run"_run.html command for details of
how to do this.
These fixes are not invoked during "energy
minimization"_minimize.html.
These fixes can be used with either the {verlet} or {respa}
"integrators"_run_style.html. When using one of the barostat fixes
with {respa}, LAMMPS uses an integrator constructed
according to the following factorization of the Liouville propagator
(for two rRESPA levels):
:c,image(Eqs/fix_nh1.jpg)
This factorization differs somewhat from that of Tuckerman et al., in that
the barostat is only updated at the outermost rRESPA level, whereas
Tuckerman's factorization requires splitting the pressure into pieces
corresponding to the forces computed at each rRESPA level. In theory, the
latter method will exhibit better numerical stability. In practice,
because Pdamp is normally chosen to be a large multiple of the
outermost rRESPA timestep, the barostat dynamics are not the
limiting factor for numerical stability. Both
factorizations are time-reversible and can be shown to preserve the phase
space measure of the underlying non-Hamiltonian equations of motion.
[Restrictions:]
Non-periodic dimensions cannot be barostatted. {Z}, {xz}, and {yz},
cannot be barostatted 2D simulations. {Xy}, {xz}, and {yz} can only
be barostatted if the simulation domain is triclinic and the 2nd
dimension in the keyword ({y} dimension in {xy}) is periodic. The
"create_box"_create_box.html, "read data"_read_data.html, and
"read_restart"_read_restart.html commands specify whether the
simulation box is orthogonal or non-orthogonal (triclinic) and explain
the meaning of the xy,xz,yz tilt factors.
For the {temp} keyword, the final Tstop cannot be 0.0 since it would
make the external T = 0.0 at some timestep during the simulation which
is not allowed in the Nose/Hoover formulation.
The {scaleyz yes} and {scalexz yes} keyword/value pairs can not be used
for 2D simulations. {scaleyz yes}, {scalexz yes}, and {scalexy yes} options
can only be used if the 2nd dimension in the keyword is periodic,
and if the tilt factor is not coupled to the barostat via keywords
{tri}, {yz}, {xz}, and {xy}.
[Related commands:]
"fix nve"_fix_nve.html, "fix_modify"_fix_modify.html, "run_style"_run_style.html
[Default:]
The keyword defaults are tchain = 3, pchain = 3, mtk = yes, tloop =
ploop = 1, nreset = 0, drag = 0.0, dilate = all, couple = none,
scaleyz = scalexz = scalexy = yes if periodic in 2nd dimension and
not coupled to barostat, otherwise no.
:line
:link(Martyna)
[(Martyna)] Martyna, Tobias and Klein, J Chem Phys, 101, 4177 (1994).
:link(Parrinello)
[(Parrinello)] Parrinello and Rahman, J Appl Phys, 52, 7182 (1981).
:link(Tuckerman)
[(Tuckerman)] Tuckerman, Alejandre, Lopez-Rendon, Jochim, and
Martyna, J Phys A: Math Gen, 39, 5629 (2006).
:link(Shinoda)
[(Shinoda)] Shinoda, Shiga, and Mikami, Phys Rev B, 69, 134103 (2004).
diff --git a/doc/fix_nve.html b/doc/fix_nve.html
index e08b86dcd..2a544abd0 100644
--- a/doc/fix_nve.html
+++ b/doc/fix_nve.html
@@ -1,75 +1,75 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix nve command
</H3>
<H3>fix nve/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID nve
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>nve = style name of this fix command
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all nve
</PRE>
<P><B>Description:</B>
</P>
<P>Perform constant NVE integration to update position and velocity for
atoms in the group each timestep. V is volume; E is energy. This
creates a system trajectory consistent with the microcanonical
ensemble.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various <A HREF = "Section_howto.html#howto_15">output
commands</A>. No parameter of this fix can
be used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
This fix is not invoked during <A HREF = "minimize.html">energy minimization</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_nh.html">fix nvt</A>, <A HREF = "fix_nh.html">fix npt</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_nve.txt b/doc/fix_nve.txt
index fbc23c25e..3558efda0 100644
--- a/doc/fix_nve.txt
+++ b/doc/fix_nve.txt
@@ -1,69 +1,69 @@
"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 nve command :h3
fix nve/cuda command :h3
[Syntax:]
fix ID group-ID nve :pre
ID, group-ID are documented in "fix"_fix.html command
nve = style name of this fix command :ul
[Examples:]
fix 1 all nve :pre
[Description:]
Perform constant NVE integration to update position and velocity for
atoms in the group each timestep. V is volume; E is energy. This
creates a system trajectory consistent with the microcanonical
ensemble.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various "output
commands"_Section_howto.html#howto_15. No parameter of this fix can
be used with the {start/stop} keywords of the "run"_run.html command.
This fix is not invoked during "energy minimization"_minimize.html.
[Restrictions:] none
[Related commands:]
"fix nvt"_fix_nh.html, "fix npt"_fix_nh.html
[Default:] none
diff --git a/doc/fix_nve_sphere.html b/doc/fix_nve_sphere.html
index f2f5678cd..2702bcbfb 100644
--- a/doc/fix_nve_sphere.html
+++ b/doc/fix_nve_sphere.html
@@ -1,105 +1,105 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix nve/sphere command
</H3>
<H3>fix nve/sphere/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID nve/sphere
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>nve/sphere = style name of this fix command
<LI>zero or more keyword/value pairs may be appended
<LI>keyword = <I>update</I>
<PRE> <I>update</I> value = <I>dipole</I>
dipole = update orientation of dipole moment during integration
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all nve/sphere
fix 1 all nve/sphere update dipole
</PRE>
<P><B>Description:</B>
</P>
<P>Perform constant NVE integration to update position, velocity, and
angular velocity for extended spherical particles in the group each
timestep. V is volume; E is energy. This creates a system trajectory
consistent with the microcanonical ensemble.
</P>
<P>This fix differs from the <A HREF = "fix_nve.html">fix nve</A> command, which
assumes point particles and only updates their position and velocity.
</P>
<P>If the <I>update</I> keyword is used with the <I>dipole</I> value, then the
orientation of the dipole moment of each particle is also updated
during the time integration. This option should be used for models
where a dipole moment is assigned to particles via use of the
<A HREF = "atom_style.html">atom_style dipole</A> command.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various <A HREF = "Section_howto.html#howto_15">output
commands</A>. No parameter of this fix can
be used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
This fix is not invoked during <A HREF = "minimize.html">energy minimization</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This fix requires that atoms store torque and angular velocity (omega)
and a radius as defined by the <A HREF = "atom_style.html">atom_style sphere</A>
command. If the <I>dipole</I> keyword is used, then they must also store a
dipole moment as defined by the <A HREF = "atom_style.html">atom_style dipole</A>
command.
</P>
<P>All particles in the group must be finite-size spheres. They cannot
be point particles.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_nve.html">fix nve</A>, <A HREF = "fix_nve_asphere.html">fix nve/asphere</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_nve_sphere.txt b/doc/fix_nve_sphere.txt
index 3c5864d3f..ebaeabd40 100755
--- a/doc/fix_nve_sphere.txt
+++ b/doc/fix_nve_sphere.txt
@@ -1,94 +1,94 @@
"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 nve/sphere command :h3
fix nve/sphere/omp command :h3
[Syntax:]
fix ID group-ID nve/sphere :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
nve/sphere = style name of this fix command :l
zero or more keyword/value pairs may be appended :l
keyword = {update} :l
{update} value = {dipole}
dipole = update orientation of dipole moment during integration :pre
:ule
[Examples:]
fix 1 all nve/sphere
fix 1 all nve/sphere update dipole :pre
[Description:]
Perform constant NVE integration to update position, velocity, and
angular velocity for extended spherical particles in the group each
timestep. V is volume; E is energy. This creates a system trajectory
consistent with the microcanonical ensemble.
This fix differs from the "fix nve"_fix_nve.html command, which
assumes point particles and only updates their position and velocity.
If the {update} keyword is used with the {dipole} value, then the
orientation of the dipole moment of each particle is also updated
during the time integration. This option should be used for models
where a dipole moment is assigned to particles via use of the
"atom_style dipole"_atom_style.html command.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various "output
commands"_Section_howto.html#howto_15. No parameter of this fix can
be used with the {start/stop} keywords of the "run"_run.html command.
This fix is not invoked during "energy minimization"_minimize.html.
[Restrictions:]
This fix requires that atoms store torque and angular velocity (omega)
and a radius as defined by the "atom_style sphere"_atom_style.html
command. If the {dipole} keyword is used, then they must also store a
dipole moment as defined by the "atom_style dipole"_atom_style.html
command.
All particles in the group must be finite-size spheres. They cannot
be point particles.
[Related commands:]
"fix nve"_fix_nve.html, "fix nve/asphere"_fix_nve_asphere.html
[Default:] none
diff --git a/doc/fix_qeq_comb.html b/doc/fix_qeq_comb.html
index c66b49dc4..984b6bd68 100644
--- a/doc/fix_qeq_comb.html
+++ b/doc/fix_qeq_comb.html
@@ -1,143 +1,143 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix qeq/comb command
</H3>
<H3>fix qeq/comb/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID qeq/comb Nevery precision keyword value ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>qeq/comb = style name of this fix command
<LI>Nevery = perform charge equilibration every this many steps
<LI>precision = convergence criterion for charge equilibration
<LI>zero or more keyword/value pairs may be appended
<LI>keyword = <I>file</I>
<PRE> <I>file</I> value = filename
filename = name of file to write QEQ equilibration info to
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 surface qeq/comb 10 0.0001
</PRE>
<P><B>Description:</B>
</P>
<P>Perform charge equilibration (QeQ) in conjunction with the COMB
(Charge-Optimized Many-Body) potential as described in
<A HREF = "#COMB_1">(COMB_1)</A> and <A HREF = "#COMB_2">(COMB_2)</A>. It performs the charge
equilibration portion of the calculation using the so-called QEq
method, whereby the charge on each atom is adjusted to minimize the
energy of the system. This fix can only be used with the COMB
potential; see the <A HREF = "fix_qeq_reqx.html">fix qeq/reax</A> command for a QeQ
calculation that can be used with any potential.
</P>
<P>Only charges on the atoms in the specified group are equilibrated.
The fix relies on the pair style (COMB in this case) to calculate the
per-atom electronegativity (effective force on the charges). An
electronegativity equalization calculation (or QEq) is performed in an
interative fashion, which in parallel requires communication at each
iteration for processors to exchange charge information about nearby
atoms with each other. See <A HREF = "#Rappe_and_Goddard">Rappe_and_Goddard</A> and
<A HREF = "#Rick_and_Stuart">Rick_and_Stuart</A> for details.
</P>
<P>During a run, charge equilibration is peformed every <I>Nevery</I> time
steps. Charge equilibration is also always enforced on the first step
of each run. The <I>precision</I> argument controls the tolerance for the
difference in electronegativity for all atoms during charge
equilibration. <I>Precision</I> is a trade-off between the cost of
performing charge equilibration (more iterations) and accuracy.
</P>
<P>If the <I>file</I> keyword is used, then information about each
equilibration calculation is written to the specifed file.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix.
</P>
<P>This fix produces a per-atom vector which can be accessed by various
<A HREF = "Section_howto.html#howto_15">output commands</A>. The vector stores the
gradient of the charge on each atom. The per-atom values be accessed
on any timestep.
</P>
<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
the <A HREF = "run.html">run</A> command. This fix is not invoked during <A HREF = "minimize.html">energy
minimization</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This fix command currently only supports <A HREF = "pair_comb.html">pair style <I>comb</I></A>.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_comb.html">pair_style comb</A>
</P>
<P><B>Default:</B>
</P>
<P>No file output is performed.
</P>
<HR>
<A NAME = "COMB_1"></A>
<P><B>(COMB_1)</B> J. Yu, S. B. Sinnott, S. R. Phillpot, Phys Rev B, 75, 085311 (2007),
</P>
<A NAME = "COMB_2"></A>
<P><B>(COMB_2)</B> T.-R. Shan, B. D. Devine, T. W. Kemper, S. B. Sinnott, S. R.
Phillpot, Phys Rev B, 81, 125328 (2010).
</P>
<A NAME = "Rappe_and_Goddard"></A>
<P><B>(Rappe_and_Goddard)</B> A. K. Rappe, W. A. Goddard, J Phys Chem 95, 3358
(1991).
</P>
<A NAME = "Rick_and_Stuart"></A>
<P><B>(Rick_and_Stuart)</B> S. W. Rick, S. J. Stuart, B. J. Berne, J Chem Phys
101, 16141 (1994).
</P>
</HTML>
diff --git a/doc/fix_qeq_comb.txt b/doc/fix_qeq_comb.txt
index 3fbb9dc7b..5cce65180 100644
--- a/doc/fix_qeq_comb.txt
+++ b/doc/fix_qeq_comb.txt
@@ -1,126 +1,126 @@
"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 qeq/comb command :h3
fix qeq/comb/omp command :h3
[Syntax:]
fix ID group-ID qeq/comb Nevery precision keyword value ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
qeq/comb = style name of this fix command :l
Nevery = perform charge equilibration every this many steps :l
precision = convergence criterion for charge equilibration :l
zero or more keyword/value pairs may be appended :l
keyword = {file} :l
{file} value = filename
filename = name of file to write QEQ equilibration info to :pre
:ule
[Examples:]
fix 1 surface qeq/comb 10 0.0001 :pre
[Description:]
Perform charge equilibration (QeQ) in conjunction with the COMB
(Charge-Optimized Many-Body) potential as described in
"(COMB_1)"_#COMB_1 and "(COMB_2)"_#COMB_2. It performs the charge
equilibration portion of the calculation using the so-called QEq
method, whereby the charge on each atom is adjusted to minimize the
energy of the system. This fix can only be used with the COMB
potential; see the "fix qeq/reax"_fix_qeq_reqx.html command for a QeQ
calculation that can be used with any potential.
Only charges on the atoms in the specified group are equilibrated.
The fix relies on the pair style (COMB in this case) to calculate the
per-atom electronegativity (effective force on the charges). An
electronegativity equalization calculation (or QEq) is performed in an
interative fashion, which in parallel requires communication at each
iteration for processors to exchange charge information about nearby
atoms with each other. See "Rappe_and_Goddard"_#Rappe_and_Goddard and
"Rick_and_Stuart"_#Rick_and_Stuart for details.
During a run, charge equilibration is peformed every {Nevery} time
steps. Charge equilibration is also always enforced on the first step
of each run. The {precision} argument controls the tolerance for the
difference in electronegativity for all atoms during charge
equilibration. {Precision} is a trade-off between the cost of
performing charge equilibration (more iterations) and accuracy.
If the {file} keyword is used, then information about each
equilibration calculation is written to the specifed file.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix.
This fix produces a per-atom vector which can be accessed by various
"output commands"_Section_howto.html#howto_15. The vector stores the
gradient of the charge on each atom. The per-atom values be accessed
on any timestep.
No parameter of this fix can be used with the {start/stop} keywords of
the "run"_run.html command. This fix is not invoked during "energy
minimization"_minimize.html.
[Restrictions:]
This fix command currently only supports "pair style {comb}"_pair_comb.html.
[Related commands:]
"pair_style comb"_pair_comb.html
[Default:]
No file output is performed.
:line
:link(COMB_1)
[(COMB_1)] J. Yu, S. B. Sinnott, S. R. Phillpot, Phys Rev B, 75, 085311 (2007),
:link(COMB_2)
[(COMB_2)] T.-R. Shan, B. D. Devine, T. W. Kemper, S. B. Sinnott, S. R.
Phillpot, Phys Rev B, 81, 125328 (2010).
:link(Rappe_and_Goddard)
[(Rappe_and_Goddard)] A. K. Rappe, W. A. Goddard, J Phys Chem 95, 3358
(1991).
:link(Rick_and_Stuart)
[(Rick_and_Stuart)] S. W. Rick, S. J. Stuart, B. J. Berne, J Chem Phys
101, 16141 (1994).
diff --git a/doc/fix_setforce.html b/doc/fix_setforce.html
index 6e713254d..2ac1db341 100644
--- a/doc/fix_setforce.html
+++ b/doc/fix_setforce.html
@@ -1,129 +1,129 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix setforce command
</H3>
<H3>fix setforce/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID setforce fx fy fz keyword value ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>setforce = style name of this fix command
<LI>fx,fy,fz = force component values
<LI>any of fx,fy,fz can be a variable (see below)
<LI>zero or more keyword/value pairs may be appended to args
<LI>keyword = <I>region</I>
<PRE> <I>region</I> value = region-ID
region-ID = ID of region atoms must be in to have added force
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix freeze indenter setforce 0.0 0.0 0.0
fix 2 edge setforce NULL 0.0 0.0
fix 2 edge setforce NULL 0.0 v_oscillate
</PRE>
<P><B>Description:</B>
</P>
<P>Set each component of force on each atom in the group to the specified
values fx,fy,fz. This erases all previously computed forces on the
atom, though additional fixes could add new forces. This command can
be used to freeze certain atoms in the simulation by zeroing their
force, either for running dynamics or performing an energy
minimization. For dynamics, this assumes their initial velocity is
also zero.
</P>
<P>Any of the fx,fy,fz values can be specified as NULL which means do not
alter the force component in that dimension.
</P>
<P>Any of the 3 quantities defining the force components can be specified
as an equal-style or atom-style <A HREF = "variable.html">variable</A>, namely <I>fx</I>,
<I>fy</I>, <I>fz</I>. If the value is a variable, it should be specified as
v_name, where name is the variable name. In this case, the variable
will be evaluated each timestep, and its value used to determine the
force component.
</P>
<P>Equal-style variables can specify formulas with various mathematical
functions, and include <A HREF = "thermo_style.html">thermo_style</A> command
keywords for the simulation box parameters and timestep and elapsed
time. Thus it is easy to specify a time-dependent force field.
</P>
<P>Atom-style variables can specify the same formulas as equal-style
variables but can also include per-atom values, such as atom
coordinates. Thus it is easy to specify a spatially-dependent force
field with optional time-dependence as well.
</P>
<P>If the <I>region</I> keyword is used, the atom must also be in the
specified geometric <A HREF = "region.html">region</A> in order to have force added
to it.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix.
</P>
<P>This fix computes a global 3-vector of forces, which can be accessed
by various <A HREF = "Section_howto.html#howto_15">output commands</A>. This is the
total force on the group of atoms before the forces on individual
atoms are changed by the fix. The vector values calculated by this
fix are "extensive".
</P>
<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
the <A HREF = "run.html">run</A> command.
</P>
<P>The forces due to this fix are imposed during an energy minimization,
invoked by the <A HREF = "minimize.html">minimize</A> command, but you cannot set
forces to any value besides zero when performing a minimization. Use
the <A HREF = "fix_addforce.html">fix addforce</A> command if you want to apply a
non-zero force to atoms during a minimization.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_addforce.html">fix addforce</A>, <A HREF = "fix_aveforce.html">fix aveforce</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_setforce.txt b/doc/fix_setforce.txt
index 90404f032..c215e3ed2 100644
--- a/doc/fix_setforce.txt
+++ b/doc/fix_setforce.txt
@@ -1,116 +1,116 @@
"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 setforce command :h3
fix setforce/cuda command :h3
[Syntax:]
fix ID group-ID setforce fx fy fz keyword value ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
setforce = style name of this fix command :l
fx,fy,fz = force component values :l
any of fx,fy,fz can be a variable (see below) :l
zero or more keyword/value pairs may be appended to args :l
keyword = {region} :l
{region} value = region-ID
region-ID = ID of region atoms must be in to have added force :pre
:ule
[Examples:]
fix freeze indenter setforce 0.0 0.0 0.0
fix 2 edge setforce NULL 0.0 0.0
fix 2 edge setforce NULL 0.0 v_oscillate :pre
[Description:]
Set each component of force on each atom in the group to the specified
values fx,fy,fz. This erases all previously computed forces on the
atom, though additional fixes could add new forces. This command can
be used to freeze certain atoms in the simulation by zeroing their
force, either for running dynamics or performing an energy
minimization. For dynamics, this assumes their initial velocity is
also zero.
Any of the fx,fy,fz values can be specified as NULL which means do not
alter the force component in that dimension.
Any of the 3 quantities defining the force components can be specified
as an equal-style or atom-style "variable"_variable.html, namely {fx},
{fy}, {fz}. If the value is a variable, it should be specified as
v_name, where name is the variable name. In this case, the variable
will be evaluated each timestep, and its value used to determine the
force component.
Equal-style variables can specify formulas with various mathematical
functions, and include "thermo_style"_thermo_style.html command
keywords for the simulation box parameters and timestep and elapsed
time. Thus it is easy to specify a time-dependent force field.
Atom-style variables can specify the same formulas as equal-style
variables but can also include per-atom values, such as atom
coordinates. Thus it is easy to specify a spatially-dependent force
field with optional time-dependence as well.
If the {region} keyword is used, the atom must also be in the
specified geometric "region"_region.html in order to have force added
to it.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix.
This fix computes a global 3-vector of forces, which can be accessed
by various "output commands"_Section_howto.html#howto_15. This is the
total force on the group of atoms before the forces on individual
atoms are changed by the fix. The vector values calculated by this
fix are "extensive".
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, but you cannot set
forces to any value besides zero when performing a minimization. Use
the "fix addforce"_fix_addforce.html command if you want to apply a
non-zero force to atoms during a minimization.
[Restrictions:] none
[Related commands:]
"fix addforce"_fix_addforce.html, "fix aveforce"_fix_aveforce.html
[Default:] none
diff --git a/doc/fix_shake.html b/doc/fix_shake.html
index a5aad277a..1834d16bd 100644
--- a/doc/fix_shake.html
+++ b/doc/fix_shake.html
@@ -1,139 +1,139 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix shake command
</H3>
<H3>fix shake/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID shake tol iter N keyword values ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>shake = style name of this fix command
<LI>tol = accuracy tolerance of SHAKE solution
<LI>iter = max # of iterations in each SHAKE solution
<LI>N = print SHAKE statistics every this many timesteps (0 = never)
<LI>one or more keyword/value pairs are appended
<LI>keyword = <I>b</I> or <I>a</I> or <I>t</I> or <I>m</I>
<PRE> <I>b</I> values = one or more bond types
<I>a</I> values = one or more angle types
<I>t</I> values = one or more atom types
<I>m</I> value = one or more mass values
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 sub shake 0.0001 20 10 b 4 19 a 3 5 2
fix 1 sub shake 0.0001 20 10 t 5 6 m 1.0 a 31
</PRE>
<P><B>Description:</B>
</P>
<P>Apply bond and angle constraints to specified bonds and angles in the
simulation. This typically enables a longer timestep.
</P>
<P>Each timestep the specified bonds and angles are reset to their
equilibrium lengths and angular values via the well-known SHAKE
algorithm. This is done by applying an additional constraint force so
that the new positions preserve the desired atom separations. The
equations for the additional force are solved via an iterative method
that typically converges to an accurate solution in a few iterations.
The desired tolerance (e.g. 1.0e-4 = 1 part in 10000) and maximum # of
iterations are specified as arguments. Setting the N argument will
print statistics to the screen and log file about regarding the
lengths of bonds and angles that are being constrained. Small delta
values mean SHAKE is doing a good job.
</P>
<P>In LAMMPS, only small clusters of atoms can be constrained. This is
so the constraint calculation for a cluster can be performed by a
single processor, to enable good parallel performance. A cluster is
defined as a central atom connected to others in the cluster by
constrained bonds. LAMMPS allows for the following kinds of clusters
to be constrained: one central atom bonded to 1 or 2 or 3 atoms, or
one central atom bonded to 2 others and the angle between the 3 atoms
also constrained. This means water molecules or CH2 or CH3 groups may
be constrained, but not all the C-C backbone bonds of a long polymer
chain.
</P>
<P>The <I>b</I> keyword lists bond types that will be constrained. The <I>t</I>
keyword lists atom types. All bonds connected to an atom of the
specified type will be constrained. The <I>m</I> keyword lists atom
masses. All bonds connected to atoms of the specified masses will be
constrained (within a fudge factor of MASSDELTA specified in
fix_shake.cpp). The <I>a</I> keyword lists angle types. If both bonds in
the angle are constrained then the angle will also be constrained if
its type is in the list.
</P>
<P>For all keywords, a particular bond is only constrained if both atoms
in the bond are in the group specified with the SHAKE fix.
</P>
<P>The degrees-of-freedom removed by SHAKE bonds and angles are accounted
for in temperature and pressure computations. Similarly, the SHAKE
contribution to the pressure of the system (virial) is also accounted
for.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various <A HREF = "Section_howto.html#howto_15">output
commands</A>. No parameter of this fix can
be used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
This fix is not invoked during <A HREF = "minimize.html">energy minimization</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>For computational efficiency, there can only be one shake fix defined
in a simulation.
</P>
<P>If you use a tolerance that is too large or a max-iteration count that
is too small, the constraints will not be enforced very strongly,
which can lead to poor energy conservation. You can test for this in
your system by running a constant NVE simulation with a particular set
of SHAKE parameters and monitoring the energy versus time.
</P>
<P><B>Related commands:</B> none
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_shake.txt b/doc/fix_shake.txt
index dee3239bd..ed0eb85fd 100644
--- a/doc/fix_shake.txt
+++ b/doc/fix_shake.txt
@@ -1,125 +1,125 @@
"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 shake command :h3
fix shake/cuda command :h3
[Syntax:]
fix ID group-ID shake tol iter N keyword values ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
shake = style name of this fix command :l
tol = accuracy tolerance of SHAKE solution :l
iter = max # of iterations in each SHAKE solution :l
N = print SHAKE statistics every this many timesteps (0 = never) :l
one or more keyword/value pairs are appended :l
keyword = {b} or {a} or {t} or {m} :l
{b} values = one or more bond types
{a} values = one or more angle types
{t} values = one or more atom types
{m} value = one or more mass values :pre
:ule
[Examples:]
fix 1 sub shake 0.0001 20 10 b 4 19 a 3 5 2
fix 1 sub shake 0.0001 20 10 t 5 6 m 1.0 a 31 :pre
[Description:]
Apply bond and angle constraints to specified bonds and angles in the
simulation. This typically enables a longer timestep.
Each timestep the specified bonds and angles are reset to their
equilibrium lengths and angular values via the well-known SHAKE
algorithm. This is done by applying an additional constraint force so
that the new positions preserve the desired atom separations. The
equations for the additional force are solved via an iterative method
that typically converges to an accurate solution in a few iterations.
The desired tolerance (e.g. 1.0e-4 = 1 part in 10000) and maximum # of
iterations are specified as arguments. Setting the N argument will
print statistics to the screen and log file about regarding the
lengths of bonds and angles that are being constrained. Small delta
values mean SHAKE is doing a good job.
In LAMMPS, only small clusters of atoms can be constrained. This is
so the constraint calculation for a cluster can be performed by a
single processor, to enable good parallel performance. A cluster is
defined as a central atom connected to others in the cluster by
constrained bonds. LAMMPS allows for the following kinds of clusters
to be constrained: one central atom bonded to 1 or 2 or 3 atoms, or
one central atom bonded to 2 others and the angle between the 3 atoms
also constrained. This means water molecules or CH2 or CH3 groups may
be constrained, but not all the C-C backbone bonds of a long polymer
chain.
The {b} keyword lists bond types that will be constrained. The {t}
keyword lists atom types. All bonds connected to an atom of the
specified type will be constrained. The {m} keyword lists atom
masses. All bonds connected to atoms of the specified masses will be
constrained (within a fudge factor of MASSDELTA specified in
fix_shake.cpp). The {a} keyword lists angle types. If both bonds in
the angle are constrained then the angle will also be constrained if
its type is in the list.
For all keywords, a particular bond is only constrained if both atoms
in the bond are in the group specified with the SHAKE fix.
The degrees-of-freedom removed by SHAKE bonds and angles are accounted
for in temperature and pressure computations. Similarly, the SHAKE
contribution to the pressure of the system (virial) is also accounted
for.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various "output
commands"_Section_howto.html#howto_15. No parameter of this fix can
be used with the {start/stop} keywords of the "run"_run.html command.
This fix is not invoked during "energy minimization"_minimize.html.
[Restrictions:]
For computational efficiency, there can only be one shake fix defined
in a simulation.
If you use a tolerance that is too large or a max-iteration count that
is too small, the constraints will not be enforced very strongly,
which can lead to poor energy conservation. You can test for this in
your system by running a constant NVE simulation with a particular set
of SHAKE parameters and monitoring the energy versus time.
[Related commands:] none
[Default:] none
diff --git a/doc/fix_temp_berendsen.html b/doc/fix_temp_berendsen.html
index 0762f66ee..494311d17 100644
--- a/doc/fix_temp_berendsen.html
+++ b/doc/fix_temp_berendsen.html
@@ -1,166 +1,166 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix temp/berendsen command
</H3>
<H3>fix temp/berendsen/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID temp/berendsen Tstart Tstop Tdamp
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>temp/berendsen = style name of this fix command
<LI>Tstart,Tstop = desired temperature at start/end of run
<LI>Tdamp = temperature damping parameter (time units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all temp/berendsen 300.0 300.0 100.0
</PRE>
<P><B>Description:</B>
</P>
<P>Reset the temperature of a group of atoms by using a Berendsen
thermostat <A HREF = "#Berendsen">(Berendsen)</A>, which rescales their velocities
every timestep.
</P>
<P>The thermostat is applied to only the translational degrees of freedom
for the particles, which is an important consideration if extended
spherical or aspherical particles which have rotational degrees of
freedom are being thermostatted with this fix. The translational
degrees of freedom can also have a bias velocity removed from them
before thermostatting takes place; see the description below.
</P>
<P>The desired temperature at each timestep is a ramped value during the
run from <I>Tstart</I> to <I>Tstop</I>. The <I>Tdamp</I> parameter is specified in
time units and determines how rapidly the temperature is relaxed. For
example, a value of 100.0 means to relax the temperature in a timespan
of (roughly) 100 time units (tau or fmsec or psec - see the
<A HREF = "units.html">units</A> command).
</P>
<P>IMPORTANT NOTE: Unlike the <A HREF = "fix_nh.html">fix nvt</A> command which
performs Nose/Hoover thermostatting AND time integration, this fix
does NOT perform time integration. It only modifies velocities to
effect thermostatting. Thus you must use a separate time integration
fix, like <A HREF = "fix_nve.html">fix nve</A> to actually update the positions of
atoms using the modified velocities. Likewise, this fix should not
normally be used on atoms that also have their temperature controlled
by another fix - e.g. by <A HREF = "fix_nh.html">fix nvt</A> or <A HREF = "fix_langevin.html">fix
langevin</A> commands.
</P>
<P>See <A HREF = "Section_howto.html#howto_16">this howto section</A> of the manual for
a discussion of different ways to compute temperature and perform
thermostatting.
</P>
<P>This fix computes a temperature each timestep. To do this, the fix
creates its own compute of style "temp", as if this command had been
issued:
</P>
<PRE>compute fix-ID_temp group-ID temp
</PRE>
<P>See the <A HREF = "compute_temp.html">compute temp</A> command for details. Note
that the ID of the new compute is the fix-ID + underscore + "temp",
and the group for the new compute is the same as the fix group.
</P>
<P>Note that this is NOT the compute used by thermodynamic output (see
the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>.
This means you can change the attributes of this fix's temperature
(e.g. its degrees-of-freedom) via the
<A HREF = "compute_modify.html">compute_modify</A> command or print this temperature
during thermodynamic output via the <A HREF = "thermo_style.html">thermo_style
custom</A> command using the appropriate compute-ID.
It also means that changing attributes of <I>thermo_temp</I> will have no
effect on this fix.
</P>
<P>Like other fixes that perform thermostatting, this fix can be used
with <A HREF = "compute.html">compute commands</A> that calculate a temperature
after removing a "bias" from the atom velocities. E.g. removing the
center-of-mass velocity from a group of atoms or only calculating
temperature on the x-component of velocity or only calculating
temperature for atoms in a geometric region. This is not done by
default, but only if the <A HREF = "fix_modify.html">fix_modify</A> command is used
to assign a temperature compute to this fix that includes such a bias
term. See the doc pages for individual <A HREF = "compute.html">compute
commands</A> to determine which ones include a bias. In
this case, the thermostat works in the following manner: the current
temperature is calculated taking the bias into account, bias is
removed from each atom, thermostatting is performed on the remaining
thermal degrees of freedom, and the bias is added back in.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>.
</P>
<P>The <A HREF = "fix_modify.html">fix_modify</A> <I>temp</I> option is supported by this
fix. You can use it to assign a temperature <A HREF = "compute.html">compute</A>
you have defined to this fix which will be used in its thermostatting
procedure, as described above. For consistency, the group used by
this fix and by the compute should be the same.
</P>
<P>The <A HREF = "fix_modify.html">fix_modify</A> <I>energy</I> option is supported by this
fix to add the energy change implied by a velocity rescaling to the
system's potential energy as part of <A HREF = "thermo_style.html">thermodynamic
output</A>.
</P>
<P>This fix computes a global scalar which can be accessed by various
<A HREF = "Section_howto.html#howto_15">output commands</A>. The scalar is the
cummulative energy change due to this fix. The scalar value
calculated by this fix is "extensive".
</P>
<P>This fix can ramp its target temperature over multiple runs, using the
<I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A> command. See the
<A HREF = "run.html">run</A> command for details of how to do this.
</P>
<P>This fix is not invoked during <A HREF = "minimize.html">energy minimization</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_nve.html">fix nve</A>, <A HREF = "fix_nh.html">fix nvt</A>, <A HREF = "fix_temp_rescale.html">fix
temp/rescale</A>, <A HREF = "fix_langevin.html">fix langevin</A>,
<A HREF = "fix_modify.html">fix_modify</A>, <A HREF = "compute_temp.html">compute temp</A>,
<A HREF = "fix_press_berendsen.html">fix press/berendsen</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Berendsen"></A>
<P><B>(Berendsen)</B> Berendsen, Postma, van Gunsteren, DiNola, Haak, J Chem
Phys, 81, 3684 (1984).
</P>
</HTML>
diff --git a/doc/fix_temp_berendsen.txt b/doc/fix_temp_berendsen.txt
index 8dd962041..4ac7e2b6e 100644
--- a/doc/fix_temp_berendsen.txt
+++ b/doc/fix_temp_berendsen.txt
@@ -1,160 +1,160 @@
"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 temp/berendsen command :h3
fix temp/berendsen/cuda command :h3
[Syntax:]
fix ID group-ID temp/berendsen Tstart Tstop Tdamp :pre
ID, group-ID are documented in "fix"_fix.html command
temp/berendsen = style name of this fix command
Tstart,Tstop = desired temperature at start/end of run
Tdamp = temperature damping parameter (time units) :ul
[Examples:]
fix 1 all temp/berendsen 300.0 300.0 100.0 :pre
[Description:]
Reset the temperature of a group of atoms by using a Berendsen
thermostat "(Berendsen)"_#Berendsen, which rescales their velocities
every timestep.
The thermostat is applied to only the translational degrees of freedom
for the particles, which is an important consideration if extended
spherical or aspherical particles which have rotational degrees of
freedom are being thermostatted with this fix. The translational
degrees of freedom can also have a bias velocity removed from them
before thermostatting takes place; see the description below.
The desired temperature at each timestep is a ramped value during the
run from {Tstart} to {Tstop}. The {Tdamp} parameter is specified in
time units and determines how rapidly the temperature is relaxed. For
example, a value of 100.0 means to relax the temperature in a timespan
of (roughly) 100 time units (tau or fmsec or psec - see the
"units"_units.html command).
IMPORTANT NOTE: Unlike the "fix nvt"_fix_nh.html command which
performs Nose/Hoover thermostatting AND time integration, this fix
does NOT perform time integration. It only modifies velocities to
effect thermostatting. Thus you must use a separate time integration
fix, like "fix nve"_fix_nve.html to actually update the positions of
atoms using the modified velocities. Likewise, this fix should not
normally be used on atoms that also have their temperature controlled
by another fix - e.g. by "fix nvt"_fix_nh.html or "fix
langevin"_fix_langevin.html commands.
See "this howto section"_Section_howto.html#howto_16 of the manual for
a discussion of different ways to compute temperature and perform
thermostatting.
This fix computes a temperature each timestep. To do this, the fix
creates its own compute of style "temp", as if this command had been
issued:
compute fix-ID_temp group-ID temp :pre
See the "compute temp"_compute_temp.html command for details. Note
that the ID of the new compute is the fix-ID + underscore + "temp",
and the group for the new compute is the same as the fix group.
Note that this is NOT the compute used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}.
This means you can change the attributes of this fix's temperature
(e.g. its degrees-of-freedom) via the
"compute_modify"_compute_modify.html command or print this temperature
during thermodynamic output via the "thermo_style
custom"_thermo_style.html command using the appropriate compute-ID.
It also means that changing attributes of {thermo_temp} will have no
effect on this fix.
Like other fixes that perform thermostatting, this fix can be used
with "compute commands"_compute.html that calculate a temperature
after removing a "bias" from the atom velocities. E.g. removing the
center-of-mass velocity from a group of atoms or only calculating
temperature on the x-component of velocity or only calculating
temperature for atoms in a geometric region. This is not done by
default, but only if the "fix_modify"_fix_modify.html command is used
to assign a temperature compute to this fix that includes such a bias
term. See the doc pages for individual "compute
commands"_compute.html to determine which ones include a bias. In
this case, the thermostat works in the following manner: the current
temperature is calculated taking the bias into account, bias is
removed from each atom, thermostatting is performed on the remaining
thermal degrees of freedom, and the bias is added back in.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[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 {temp} option is supported by this
fix. You can use it to assign a temperature "compute"_compute.html
you have defined to this fix which will be used in its thermostatting
procedure, as described above. For consistency, the group used by
this fix and by the compute should be the same.
The "fix_modify"_fix_modify.html {energy} option is supported by this
fix to add the energy change implied by a velocity rescaling to the
system's potential energy as part of "thermodynamic
output"_thermo_style.html.
This fix computes a global scalar which can be accessed by various
"output commands"_Section_howto.html#howto_15. The scalar is the
cummulative energy change due to this fix. The scalar value
calculated by this fix is "extensive".
This fix can ramp its target temperature over multiple runs, using the
{start} and {stop} keywords of the "run"_run.html command. See the
"run"_run.html command for details of how to do this.
This fix is not invoked during "energy minimization"_minimize.html.
[Restrictions:] none
[Related commands:]
"fix nve"_fix_nve.html, "fix nvt"_fix_nh.html, "fix
temp/rescale"_fix_temp_rescale.html, "fix langevin"_fix_langevin.html,
"fix_modify"_fix_modify.html, "compute temp"_compute_temp.html,
"fix press/berendsen"_fix_press_berendsen.html
[Default:] none
:line
:link(Berendsen)
[(Berendsen)] Berendsen, Postma, van Gunsteren, DiNola, Haak, J Chem
Phys, 81, 3684 (1984).
diff --git a/doc/fix_temp_rescale.html b/doc/fix_temp_rescale.html
index 81273ed4e..34fd4ea23 100644
--- a/doc/fix_temp_rescale.html
+++ b/doc/fix_temp_rescale.html
@@ -1,166 +1,166 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix temp/rescale command
</H3>
<H3>fix temp/rescale/cuda command
</H3>
<H3>fix temp/rescale/limit/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID temp/rescale N Tstart Tstop window fraction
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>temp/rescale = style name of this fix command
<LI>N = perform rescaling every N steps
<LI>Tstart,Tstop = desired temperature at start/end of run (temperature units)
<LI>window = only rescale if temperature is outside this window (temperature units)
<LI>fraction = rescale to target temperature by this fraction
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 3 flow temp/rescale 100 1.0 1.1 0.02 0.5
fix 3 boundary temp/rescale 1 1.0 1.5 0.05 1.0
fix 3 boundary temp/rescale 1 1.0 1.5 0.05 1.0
</PRE>
<P><B>Description:</B>
</P>
<P>Reset the temperature of a group of atoms by explicitly rescaling
their velocities.
</P>
<P>The rescaling is applied to only the translational degrees of freedom
for the particles, which is an important consideration if extended
spherical or aspherical particles which have rotational degrees of
freedom are being thermostatted with this fix. The translational
degrees of freedom can also have a bias velocity removed from them
before thermostatting takes place; see the description below.
</P>
<P>Rescaling is performed every N timesteps. The target temperature is a
ramped value between the <I>Tstart</I> and <I>Tstop</I> temperatures at the
beginning and end of the run.
</P>
<P>Rescaling is only performed if the difference between the current and
desired temperatures is greater than the <I>window</I> value. The amount
of rescaling that is applied is a <I>fraction</I> (from 0.0 to 1.0) of the
difference between the actual and desired temperature. E.g. if
<I>fraction</I> = 1.0, the temperature is reset to exactly the desired
value.
</P>
<P>IMPORTANT NOTE: Unlike the <A HREF = "fix_nh.html">fix nvt</A> command which
performs Nose/Hoover thermostatting AND time integration, this fix
does NOT perform time integration. It only modifies velocities to
effect thermostatting. Thus you must use a separate time integration
fix, like <A HREF = "fix_nve.html">fix nve</A> to actually update the positions of
atoms using the modified velocities. Likewise, this fix should not
normally be used on atoms that also have their temperature controlled
by another fix - e.g. by <A HREF = "fix_nh.html">fix nvt</A> or <A HREF = "fix_langevin.html">fix
langevin</A> commands.
</P>
<P>See <A HREF = "Section_howto.html#howto_16">this howto section</A> of the manual for
a discussion of different ways to compute temperature and perform
thermostatting.
</P>
<P>This fix computes a temperature each timestep. To do this, the fix
creates its own compute of style "temp", as if one of this command had
been issued:
</P>
<PRE>compute fix-ID_temp group-ID temp
</PRE>
<P>See the <A HREF = "compute_temp.html">compute temp</A> for details. Note that the
ID of the new compute is the fix-ID + underscore + "temp", and the
group for the new compute is the same as the fix group.
</P>
<P>Note that this is NOT the compute used by thermodynamic output (see
the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>.
This means you can change the attributes of this fix's temperature
(e.g. its degrees-of-freedom) via the
<A HREF = "compute_modify.html">compute_modify</A> command or print this temperature
during thermodynamic output via the <A HREF = "thermo_style.html">thermo_style
custom</A> command using the appropriate compute-ID.
It also means that changing attributes of <I>thermo_temp</I> will have no
effect on this fix.
</P>
<P>Like other fixes that perform thermostatting, this fix can be used
with <A HREF = "compute.html">compute commands</A> that calculate a temperature
after removing a "bias" from the atom velocities. E.g. removing the
center-of-mass velocity from a group of atoms or only calculating
temperature on the x-component of velocity or only calculating
temperature for atoms in a geometric region. This is not done by
default, but only if the <A HREF = "fix_modify.html">fix_modify</A> command is used
to assign a temperature compute to this fix that includes such a bias
term. See the doc pages for individual <A HREF = "compute.html">compute
commands</A> to determine which ones include a bias. In
this case, the thermostat works in the following manner: the current
temperature is calculated taking the bias into account, bias is
removed from each atom, thermostatting is performed on the remaining
thermal degrees of freedom, and the bias is added back in.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>.
</P>
<P>The <A HREF = "fix_modify.html">fix_modify</A> <I>temp</I> option is supported by this
fix. You can use it to assign a temperature <A HREF = "compute.html">compute</A>
you have defined to this fix which will be used in its thermostatting
procedure, as described above. For consistency, the group used by
this fix and by the compute should be the same.
</P>
<P>The <A HREF = "fix_modify.html">fix_modify</A> <I>energy</I> option is supported by this
fix to add the energy change implied by a velocity rescaling to the
system's potential energy as part of <A HREF = "thermo_style.html">thermodynamic
output</A>.
</P>
<P>This fix computes a global scalar which can be accessed by various
<A HREF = "Section_howto.html#howto_15">output commands</A>. The scalar is the
cummulative energy change due to this fix. The scalar value
calculated by this fix is "extensive".
</P>
<P>This fix can ramp its target temperature over multiple runs, using the
<I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A> command. See the
<A HREF = "run.html">run</A> command for details of how to do this.
</P>
<P>This fix is not invoked during <A HREF = "minimize.html">energy minimization</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_langevin.html">fix langevin</A>, <A HREF = "fix_nh.html">fix nvt</A>,
<A HREF = "fix_modify.html">fix_modify</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_temp_rescale.txt b/doc/fix_temp_rescale.txt
index 5fbe99e5b..0215f837f 100644
--- a/doc/fix_temp_rescale.txt
+++ b/doc/fix_temp_rescale.txt
@@ -1,159 +1,159 @@
"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 temp/rescale command :h3
fix temp/rescale/cuda command :h3
fix temp/rescale/limit/cuda command :h3
[Syntax:]
fix ID group-ID temp/rescale N Tstart Tstop window fraction :pre
ID, group-ID are documented in "fix"_fix.html command
temp/rescale = style name of this fix command
N = perform rescaling every N steps
Tstart,Tstop = desired temperature at start/end of run (temperature units)
window = only rescale if temperature is outside this window (temperature units)
fraction = rescale to target temperature by this fraction :ul
[Examples:]
fix 3 flow temp/rescale 100 1.0 1.1 0.02 0.5
fix 3 boundary temp/rescale 1 1.0 1.5 0.05 1.0
fix 3 boundary temp/rescale 1 1.0 1.5 0.05 1.0 :pre
[Description:]
Reset the temperature of a group of atoms by explicitly rescaling
their velocities.
The rescaling is applied to only the translational degrees of freedom
for the particles, which is an important consideration if extended
spherical or aspherical particles which have rotational degrees of
freedom are being thermostatted with this fix. The translational
degrees of freedom can also have a bias velocity removed from them
before thermostatting takes place; see the description below.
Rescaling is performed every N timesteps. The target temperature is a
ramped value between the {Tstart} and {Tstop} temperatures at the
beginning and end of the run.
Rescaling is only performed if the difference between the current and
desired temperatures is greater than the {window} value. The amount
of rescaling that is applied is a {fraction} (from 0.0 to 1.0) of the
difference between the actual and desired temperature. E.g. if
{fraction} = 1.0, the temperature is reset to exactly the desired
value.
IMPORTANT NOTE: Unlike the "fix nvt"_fix_nh.html command which
performs Nose/Hoover thermostatting AND time integration, this fix
does NOT perform time integration. It only modifies velocities to
effect thermostatting. Thus you must use a separate time integration
fix, like "fix nve"_fix_nve.html to actually update the positions of
atoms using the modified velocities. Likewise, this fix should not
normally be used on atoms that also have their temperature controlled
by another fix - e.g. by "fix nvt"_fix_nh.html or "fix
langevin"_fix_langevin.html commands.
See "this howto section"_Section_howto.html#howto_16 of the manual for
a discussion of different ways to compute temperature and perform
thermostatting.
This fix computes a temperature each timestep. To do this, the fix
creates its own compute of style "temp", as if one of this command had
been issued:
compute fix-ID_temp group-ID temp :pre
See the "compute temp"_compute_temp.html for details. Note that the
ID of the new compute is the fix-ID + underscore + "temp", and the
group for the new compute is the same as the fix group.
Note that this is NOT the compute used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}.
This means you can change the attributes of this fix's temperature
(e.g. its degrees-of-freedom) via the
"compute_modify"_compute_modify.html command or print this temperature
during thermodynamic output via the "thermo_style
custom"_thermo_style.html command using the appropriate compute-ID.
It also means that changing attributes of {thermo_temp} will have no
effect on this fix.
Like other fixes that perform thermostatting, this fix can be used
with "compute commands"_compute.html that calculate a temperature
after removing a "bias" from the atom velocities. E.g. removing the
center-of-mass velocity from a group of atoms or only calculating
temperature on the x-component of velocity or only calculating
temperature for atoms in a geometric region. This is not done by
default, but only if the "fix_modify"_fix_modify.html command is used
to assign a temperature compute to this fix that includes such a bias
term. See the doc pages for individual "compute
commands"_compute.html to determine which ones include a bias. In
this case, the thermostat works in the following manner: the current
temperature is calculated taking the bias into account, bias is
removed from each atom, thermostatting is performed on the remaining
thermal degrees of freedom, and the bias is added back in.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[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 {temp} option is supported by this
fix. You can use it to assign a temperature "compute"_compute.html
you have defined to this fix which will be used in its thermostatting
procedure, as described above. For consistency, the group used by
this fix and by the compute should be the same.
The "fix_modify"_fix_modify.html {energy} option is supported by this
fix to add the energy change implied by a velocity rescaling to the
system's potential energy as part of "thermodynamic
output"_thermo_style.html.
This fix computes a global scalar which can be accessed by various
"output commands"_Section_howto.html#howto_15. The scalar is the
cummulative energy change due to this fix. The scalar value
calculated by this fix is "extensive".
This fix can ramp its target temperature over multiple runs, using the
{start} and {stop} keywords of the "run"_run.html command. See the
"run"_run.html command for details of how to do this.
This fix is not invoked during "energy minimization"_minimize.html.
[Restrictions:] none
[Related commands:]
"fix langevin"_fix_langevin.html, "fix nvt"_fix_nh.html,
"fix_modify"_fix_modify.html
[Default:] none
diff --git a/doc/fix_viscosity.html b/doc/fix_viscosity.html
index 51eee268f..57e0502b3 100644
--- a/doc/fix_viscosity.html
+++ b/doc/fix_viscosity.html
@@ -1,171 +1,172 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix viscosity command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID viscosity N vdim pdim Nbin keyword value ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>viscosity = style name of this fix command
<LI>N = perform momentum exchange every N steps
<LI>vdim = <I>x</I> or <I>y</I> or <I>z</I> = which momentum component to exchange
<LI>pdim = <I>x</I> or <I>y</I> or <I>z</I> = direction of momentum transfer
<LI>Nbin = # of layers in pdim direction (must be even number)
<LI>zero or more keyword/value pairs may be appended
<LI>keyword = <I>swap</I> or <I>target</I>
<PRE> <I>swap</I> value = Nswap = number of swaps to perform every N steps
<I>vtarget</I> value = V or INF = target velocity of swap partners (velocity units)
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all viscosity 100 x z 20
fix 1 all viscosity 50 x z 20 swap 2 vtarget 1.5
</PRE>
<P><B>Description:</B>
</P>
<P>Use the Muller-Plathe algorithm described in <A HREF = "#Muller-Plathe">this
paper</A> to exchange momenta between two particles in
different regions of the simulation box every N steps. This induces a
shear velocity profile in the system. As described below this enables
a viscosity of the fluid to be calculated. This algorithm is
sometimes called a reverse non-equilibrium MD (reverse NEMD) approach
to computing viscosity. This is because the usual NEMD approach is to
impose a shear velocity profile on the system and measure the response
via an off-diagonal component of the stress tensor, which is
proportional to the momentum flux. In the Muller-Plathe method, the
momentum flux is imposed, and the shear velocity profile is the
system's response.
</P>
<P>The simulation box is divided into <I>Nbin</I> layers in the <I>pdim</I>
direction, where the layer 1 is at the low end of that dimension and
the layer <I>Nbin</I> is at the high end. Every N steps, Nswap pairs of
atoms are chosen in the following manner. Only atoms in the fix group
are considered. Nswap atoms in layer 1 with positive velocity
components in the <I>vdim</I> direction closest to the target value <I>V</I> are
selected. Similarly, Nswap atoms in the "middle" layer (see below) with
negative velocity components in the <I>vdim</I> direction closest to the
negative of the target value <I>V</I> are selected. The two sets of Nswap
atoms are paired up and their <I>vdim</I> momenta components are swapped
within each pair. This resets their velocities, typically in opposite
directions. Over time, this induces a shear velocity profile in the
system which can be measured using commands such as the following,
which writes the profile to the file tmp.profile:
</P>
<PRE>fix f1 all ave/spatial 100 10 1000 z lower 0.05 vx &
file tmp.profile units reduced
</PRE>
<P>Note that by default, Nswap = 1 and vtarget = INF, though this can be
changed by the optional <I>swap</I> and <I>vtarget</I> keywords. When vtarget =
INF, one or more atoms with the most positive and negative velocity
components are selected. Setting these parameters appropriately, in
conjunction with the swap rate N, allows the momentum flux rate to be
adjusted across a wide range of values, and the momenta to be
exchanged in large chunks or more smoothly.
</P>
<P>The "middle" layer for momenta swapping is defined as the <I>Nbin</I>/2 + 1
layer. Thus if <I>Nbin</I> = 20, the two swapping layers are 1 and 11.
This should lead to a symmetric velocity profile since the two layers
are separated by the same distance in both directions in a periodic
sense. This is why <I>Nbin</I> is restricted to being an even number.
</P>
<P>As described below, the total momentum transferred by these velocity
swaps is computed by the fix and can be output. Dividing this
quantity by time and the cross-sectional area of the simulation box
yields a momentum flux. The ratio of momentum flux to the slope of
the shear velocity profile is the viscosity of the fluid, in
appopriate units. See the <A HREF = "#Muller-Plathe">Muller-Plathe paper</A> for
details.
</P>
<P>IMPORTANT NOTE: After equilibration, if the velocity profile you
observe is not linear, then you are likely swapping momentum too
frequently and are not in a regime of linear response. In this case
you cannot accurately infer a viscosity and should try increasing
the Nevery parameter.
</P>
<P>An alternative method for calculating a viscosity is to run a NEMD
-simulation, as described in <A HREF = "Section_howto.html#howto_13">this section</A>
-of the manual. NEMD simulations deform the simmulation box via the
-<A HREF = "fix_deform.html">fix deform</A> command. Thus they cannot be run on a
-charged system using a <A HREF = "kspace_style.html">PPPM solver</A> since PPPM does
-not currently support non-orthogonal boxes. Using fix viscosity keeps
-the box orthogonal; thus it does not suffer from this limitation.
+simulation, as described in <A HREF = "Section_howto.html#howto_13">Section_howto
+13</A> of the manual. NEMD simulations
+deform the simmulation box via the <A HREF = "fix_deform.html">fix deform</A>
+command. Thus they cannot be run on a charged system using a <A HREF = "kspace_style.html">PPPM
+solver</A> since PPPM does not currently support
+non-orthogonal boxes. Using fix viscosity keeps the box orthogonal;
+thus it does not suffer from this limitation.
</P>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix.
</P>
<P>This fix computes a global scalar which can be accessed by various
<A HREF = "Section_howto.html#howto_15">output commands</A>. The scalar is the
cummulative momentum transferred between the bottom and middle of the
simulation box (in the <I>pdim</I> direction) is stored as a scalar
quantity by this fix. This quantity is zeroed when the fix is defined
and accumlates thereafter, once every N steps. The units of the
quantity are momentum = mass*velocity. The scalar value calculated by
this fix is "intensive".
</P>
<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
the <A HREF = "run.html">run</A> command. This fix is not invoked during <A HREF = "minimize.html">energy
minimization</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>Swaps conserve both momentum and kinetic energy, even if the masses of
the swapped atoms are not equal. Thus you should not need to
thermostat the system. If you do use a thermostat, you may want to
apply it only to the non-swapped dimensions (other than <I>vdim</I>).
</P>
<P>LAMMPS does not check, but you should not use this fix to swap
velocities of atoms that are in constrained molecules, e.g. via <A HREF = "fix_shake.html">fix
shake</A> or <A HREF = "fix_rigid.html">fix rigid</A>. This is because
application of the constraints will alter the amount of transferred
momentum. You should, however, be able to use flexible molecules.
See the <A HREF = "#Maginn">Maginn paper</A> for an example of using this algorithm
in a computation of alcohol molecule properties.
</P>
<P>When running a simulation with large, massive particles or molecules
in a background solvent, you may want to only exchange momenta bewteen
solvent particles.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_ave_spatial.html">fix ave/spatial</A>, <A HREF = "fix_thermal_conductivity.html">fix
thermal/conductivity</A>
</P>
<P><B>Default:</B>
</P>
<P>The option defaults are swap = 1 and vtarget = INF.
</P>
<HR>
<A NAME = "Muller-Plathe"></A>
<P><B>(Muller-Plathe)</B> Muller-Plathe, Phys Rev E, 59, 4894-4898 (1999).
</P>
<A NAME = "Maginn"></A>
<P><B>(Maginn)</B> Kelkar, Rafferty, Maginn, Siepmann, Fluid Phase Equilibria,
260, 218-231 (2007).
</P>
</HTML>
diff --git a/doc/fix_viscosity.txt b/doc/fix_viscosity.txt
index 3e3952687..511c194bb 100644
--- a/doc/fix_viscosity.txt
+++ b/doc/fix_viscosity.txt
@@ -1,156 +1,157 @@
"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 viscosity command :h3
[Syntax:]
fix ID group-ID viscosity N vdim pdim Nbin keyword value ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
viscosity = style name of this fix command :l
N = perform momentum exchange every N steps :l
vdim = {x} or {y} or {z} = which momentum component to exchange :l
pdim = {x} or {y} or {z} = direction of momentum transfer :l
Nbin = # of layers in pdim direction (must be even number) :l
zero or more keyword/value pairs may be appended :l
keyword = {swap} or {target} :l
{swap} value = Nswap = number of swaps to perform every N steps
{vtarget} value = V or INF = target velocity of swap partners (velocity units) :pre
:ule
[Examples:]
fix 1 all viscosity 100 x z 20
fix 1 all viscosity 50 x z 20 swap 2 vtarget 1.5 :pre
[Description:]
Use the Muller-Plathe algorithm described in "this
paper"_#Muller-Plathe to exchange momenta between two particles in
different regions of the simulation box every N steps. This induces a
shear velocity profile in the system. As described below this enables
a viscosity of the fluid to be calculated. This algorithm is
sometimes called a reverse non-equilibrium MD (reverse NEMD) approach
to computing viscosity. This is because the usual NEMD approach is to
impose a shear velocity profile on the system and measure the response
via an off-diagonal component of the stress tensor, which is
proportional to the momentum flux. In the Muller-Plathe method, the
momentum flux is imposed, and the shear velocity profile is the
system's response.
The simulation box is divided into {Nbin} layers in the {pdim}
direction, where the layer 1 is at the low end of that dimension and
the layer {Nbin} is at the high end. Every N steps, Nswap pairs of
atoms are chosen in the following manner. Only atoms in the fix group
are considered. Nswap atoms in layer 1 with positive velocity
components in the {vdim} direction closest to the target value {V} are
selected. Similarly, Nswap atoms in the "middle" layer (see below) with
negative velocity components in the {vdim} direction closest to the
negative of the target value {V} are selected. The two sets of Nswap
atoms are paired up and their {vdim} momenta components are swapped
within each pair. This resets their velocities, typically in opposite
directions. Over time, this induces a shear velocity profile in the
system which can be measured using commands such as the following,
which writes the profile to the file tmp.profile:
fix f1 all ave/spatial 100 10 1000 z lower 0.05 vx &
file tmp.profile units reduced :pre
Note that by default, Nswap = 1 and vtarget = INF, though this can be
changed by the optional {swap} and {vtarget} keywords. When vtarget =
INF, one or more atoms with the most positive and negative velocity
components are selected. Setting these parameters appropriately, in
conjunction with the swap rate N, allows the momentum flux rate to be
adjusted across a wide range of values, and the momenta to be
exchanged in large chunks or more smoothly.
The "middle" layer for momenta swapping is defined as the {Nbin}/2 + 1
layer. Thus if {Nbin} = 20, the two swapping layers are 1 and 11.
This should lead to a symmetric velocity profile since the two layers
are separated by the same distance in both directions in a periodic
sense. This is why {Nbin} is restricted to being an even number.
As described below, the total momentum transferred by these velocity
swaps is computed by the fix and can be output. Dividing this
quantity by time and the cross-sectional area of the simulation box
yields a momentum flux. The ratio of momentum flux to the slope of
the shear velocity profile is the viscosity of the fluid, in
appopriate units. See the "Muller-Plathe paper"_#Muller-Plathe for
details.
IMPORTANT NOTE: After equilibration, if the velocity profile you
observe is not linear, then you are likely swapping momentum too
frequently and are not in a regime of linear response. In this case
you cannot accurately infer a viscosity and should try increasing
the Nevery parameter.
An alternative method for calculating a viscosity is to run a NEMD
-simulation, as described in "this section"_Section_howto.html#howto_13
-of the manual. NEMD simulations deform the simmulation box via the
-"fix deform"_fix_deform.html command. Thus they cannot be run on a
-charged system using a "PPPM solver"_kspace_style.html since PPPM does
-not currently support non-orthogonal boxes. Using fix viscosity keeps
-the box orthogonal; thus it does not suffer from this limitation.
+simulation, as described in "Section_howto
+13"_Section_howto.html#howto_13 of the manual. NEMD simulations
+deform the simmulation box via the "fix deform"_fix_deform.html
+command. Thus they cannot be run on a charged system using a "PPPM
+solver"_kspace_style.html since PPPM does not currently support
+non-orthogonal boxes. Using fix viscosity keeps the box orthogonal;
+thus it does not suffer from this limitation.
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix.
This fix computes a global scalar which can be accessed by various
"output commands"_Section_howto.html#howto_15. The scalar is the
cummulative momentum transferred between the bottom and middle of the
simulation box (in the {pdim} direction) is stored as a scalar
quantity by this fix. This quantity is zeroed when the fix is defined
and accumlates thereafter, once every N steps. The units of the
quantity are momentum = mass*velocity. The scalar value calculated by
this fix is "intensive".
No parameter of this fix can be used with the {start/stop} keywords of
the "run"_run.html command. This fix is not invoked during "energy
minimization"_minimize.html.
[Restrictions:]
Swaps conserve both momentum and kinetic energy, even if the masses of
the swapped atoms are not equal. Thus you should not need to
thermostat the system. If you do use a thermostat, you may want to
apply it only to the non-swapped dimensions (other than {vdim}).
LAMMPS does not check, but you should not use this fix to swap
velocities of atoms that are in constrained molecules, e.g. via "fix
shake"_fix_shake.html or "fix rigid"_fix_rigid.html. This is because
application of the constraints will alter the amount of transferred
momentum. You should, however, be able to use flexible molecules.
See the "Maginn paper"_#Maginn for an example of using this algorithm
in a computation of alcohol molecule properties.
When running a simulation with large, massive particles or molecules
in a background solvent, you may want to only exchange momenta bewteen
solvent particles.
[Related commands:]
"fix ave/spatial"_fix_ave_spatial.html, "fix
thermal/conductivity"_fix_thermal_conductivity.html
[Default:]
The option defaults are swap = 1 and vtarget = INF.
:line
:link(Muller-Plathe)
[(Muller-Plathe)] Muller-Plathe, Phys Rev E, 59, 4894-4898 (1999).
:link(Maginn)
[(Maginn)] Kelkar, Rafferty, Maginn, Siepmann, Fluid Phase Equilibria,
260, 218-231 (2007).
diff --git a/doc/fix_viscous.html b/doc/fix_viscous.html
index fe03b9867..94a9c6980 100644
--- a/doc/fix_viscous.html
+++ b/doc/fix_viscous.html
@@ -1,131 +1,131 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix viscous command
</H3>
<H3>fix viscous/cuda command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID viscous gamma keyword values ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>viscous = style name of this fix command
<LI>gamma = damping coefficient (force/velocity units)
<LI>zero or more keyword/value pairs may be appended
<PRE>keyword = <I>scale</I>
<I>scale</I> values = type ratio
type = atom type (1-N)
ratio = factor to scale the damping coefficient by
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 flow viscous 0.1
fix 1 damp viscous 0.5 scale 3 2.5
</PRE>
<P><B>Description:</B>
</P>
<P>Add a viscous damping force to atoms in the group that is proportional
to the velocity of the atom. The added force can be thought of as a
frictional interaction with implicit solvent, i.e. the no-slip Stokes
drag on a spherical particle. In granular simulations this can be
useful for draining the kinetic energy from the system in a controlled
fashion. If used without additional thermostatting (to add kinetic
energy to the system), it has the effect of slowly (or rapidly)
freezing the system; hence it can also be used as a simple energy
minimization technique.
</P>
<P>The damping force F is given by F = - gamma * velocity. The larger
the coefficient, the faster the kinetic energy is reduced. If the
optional keyword <I>scale</I> is used, gamma can scaled up or down by the
specified factor for atoms of that type. It can be used multiple
times to adjust gamma for several atom types.
</P>
<P>IMPORTANT NOTE: You should specify gamma in force/velocity units.
This is not the same as mass/time units, at least for some of the
LAMMPS <A HREF = "units.html">units</A> options like "real" or "metal" that are not
self-consistent.
</P>
<P>In a Brownian dynamics context, gamma = Kb T / D, where Kb =
Boltzmann's constant, T = temperature, and D = particle diffusion
coefficient. D can be written as Kb T / (3 pi eta d), where eta =
dynamic viscosity of the frictional fluid and d = diameter of
particle. This means gamma = 3 pi eta d, and thus is proportional to
the viscosity of the fluid and the particle diameter.
</P>
<P>In the current implementation, rather than have the user specify a
viscosity, gamma is specified directly in force/velocity units. If
needed, gamma can be adjusted for atoms of different sizes
(i.e. sigma) by using the <I>scale</I> keyword.
</P>
<P>Note that Brownian dynamics models also typically include a randomized
force term to thermostat the system at a chosen temperature. The <A HREF = "fix_langevin.html">fix
langevin</A> command does this. It has the same
viscous damping term as fix viscous and adds a random force to each
atom. Hence if using fix <I>langevin</I> you do not typically need to use
fix <I>viscous</I>. Also note that the gamma of fix viscous is related to
the damping parameter of <A HREF = "fix_langevin.html">fix langevin</A>, except that
the units of gamma are force/velocity and the units of damp are time,
so that it can more easily be used as a thermostat.
</P>
<HR>
<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-<A HREF = "Section_accelerate.html">this section</A> of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various <A HREF = "Section_howto.html#howto_15">output
commands</A>. No parameter of this fix can
be used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
</P>
<P>The forces due to this fix are imposed during an energy minimization,
invoked by the <A HREF = "minimize.html">minimize</A> command. This fix should only
be used with damped dynamics minimizers that allow for
non-conservative forces. See the <A HREF = "min_style.html">min_style</A> command
for details.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_langevin.html">fix langevin</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/fix_viscous.txt b/doc/fix_viscous.txt
index bfd26b726..2e1b87837 100644
--- a/doc/fix_viscous.txt
+++ b/doc/fix_viscous.txt
@@ -1,120 +1,120 @@
"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 viscous command :h3
fix viscous/cuda command :h3
[Syntax:]
fix ID group-ID viscous gamma keyword values ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
viscous = style name of this fix command :l
gamma = damping coefficient (force/velocity units) :l
zero or more keyword/value pairs may be appended :l
keyword = {scale}
{scale} values = type ratio
type = atom type (1-N)
ratio = factor to scale the damping coefficient by :pre
:ule
[Examples:]
fix 1 flow viscous 0.1
fix 1 damp viscous 0.5 scale 3 2.5 :pre
[Description:]
Add a viscous damping force to atoms in the group that is proportional
to the velocity of the atom. The added force can be thought of as a
frictional interaction with implicit solvent, i.e. the no-slip Stokes
drag on a spherical particle. In granular simulations this can be
useful for draining the kinetic energy from the system in a controlled
fashion. If used without additional thermostatting (to add kinetic
energy to the system), it has the effect of slowly (or rapidly)
freezing the system; hence it can also be used as a simple energy
minimization technique.
The damping force F is given by F = - gamma * velocity. The larger
the coefficient, the faster the kinetic energy is reduced. If the
optional keyword {scale} is used, gamma can scaled up or down by the
specified factor for atoms of that type. It can be used multiple
times to adjust gamma for several atom types.
IMPORTANT NOTE: You should specify gamma in force/velocity units.
This is not the same as mass/time units, at least for some of the
LAMMPS "units"_units.html options like "real" or "metal" that are not
self-consistent.
In a Brownian dynamics context, gamma = Kb T / D, where Kb =
Boltzmann's constant, T = temperature, and D = particle diffusion
coefficient. D can be written as Kb T / (3 pi eta d), where eta =
dynamic viscosity of the frictional fluid and d = diameter of
particle. This means gamma = 3 pi eta d, and thus is proportional to
the viscosity of the fluid and the particle diameter.
In the current implementation, rather than have the user specify a
viscosity, gamma is specified directly in force/velocity units. If
needed, gamma can be adjusted for atoms of different sizes
(i.e. sigma) by using the {scale} keyword.
Note that Brownian dynamics models also typically include a randomized
force term to thermostat the system at a chosen temperature. The "fix
langevin"_fix_langevin.html command does this. It has the same
viscous damping term as fix viscous and adds a random force to each
atom. Hence if using fix {langevin} you do not typically need to use
fix {viscous}. Also note that the gamma of fix viscous is related to
the damping parameter of "fix langevin"_fix_langevin.html, except that
the units of gamma are force/velocity and the units of damp are time,
so that it can more easily be used as a thermostat.
:line
Styles with a {cuda} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
-"this section"_Section_accelerate.html of the manual. The accelerated
-styles take the same arguments and should produce the same results,
-except for round-off and precision issues.
+"Section_accelerate"_Section_accelerate.html of the manual. The
+accelerated styles take the same arguments and should produce the same
+results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA package. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various "output
commands"_Section_howto.html#howto_15. 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. This fix should only
be used with damped dynamics minimizers that allow for
non-conservative forces. See the "min_style"_min_style.html command
for details.
[Restrictions:] none
[Related commands:]
"fix langevin"_fix_langevin.html
[Default:] none
diff --git a/doc/fix_wall_piston.html b/doc/fix_wall_piston.html
index 17b3262da..12b25dc30 100644
--- a/doc/fix_wall_piston.html
+++ b/doc/fix_wall_piston.html
@@ -1,133 +1,133 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix wall/piston command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID wall/piston face arg ... keyword value ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>wall/piston = style name of this fix command
<LI>one face/arg pair must be appended
<LI>face = <I>zlo</I>
<LI>zero or more keyword/value pairs may be appended
<LI>keyword = <I>pos</I> or <I>vel</I> or <I>ramp</I> or <I>units</I>
<PRE> <I>pos</I> args = z
z = z coordinate at which the piston begins (distance units)
<I>vel</I> args = vz
vz = final velocity of the piston (velocity units)
<I>ramp</I> = use a linear velocity ramp from 0 to vz
<I>temp</I> args = target damp seed extent
target = target velocity for region immediately ahead of the piston
damp = damping paramter (time units)
seed = random number seed for langevin kicks
extent = extent of thermostated region (distance units)
<I>units</I> value = <I>lattice</I> or <I>box</I>
<I>lattice</I> = the wall position is defined in lattice units
<I>box</I> = the wall position is defined in simulation box units
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix xwalls all wall/piston zlo
fix walls all wall/piston zlo pos 1.0 0.0 0.0 vel 0.0 0.0 10.0 units box
fix top all wall/piston zlo vel 0.0 0.0 10.0 ramp
</PRE>
<P><B>Description:</B>
</P>
<P>Bound the simulation with a moving wall which reflect particles
in the specified group and drive the system with an effective infinite-mass
piston capable of driving shock waves.
</P>
<P>A momentum mirror technique is used, which means that if an atom (or the wall)
moves such that an atom is outside the wall on a timestep
by a distance delta (e.g. due to <A HREF = "fix_nve.html">fix nve</A>), then it is
put back inside the face by the same delta, and the velocity relative to
the moving wall is flipped in z. For instance, a stationary particle hit with a
piston wall with velocity vz, will end the timestep with a velocity of 2*vz.
</P>
<P>Currently only face <I>zlo</I> may be specified.
This creates a piston moving in the positive z direction.
Particles with z coordinate less than the wall position
are reflected to a z coordinate
greater than the wall position.
If the piston velocity is vpz and the particle velocity
before reflection is vzi, the particle velocity after
reflection is -vzi + 2*vpz.
</P>
<P>The initial position of the wall can be specified by the <I>pos</I> keyword.
</P>
<P>The final velocity of the wall can be specified by the <I>vel</I> keyword
</P>
<P>The <I>ramp</I> keyword will cause the wall/piston to adjust the velocity linearly
from zero velocity to <I>vel</I> over the course of the run. If the <I>ramp</I> keyword is omitted
then the wall/piston moves at a constant velocity defined by <I>vel</I>.
</P>
<P>The <I>temp</I> keyword will cause the region immediately in front of the wall/piston
to be thermostated with a Langevin thermostat. This region moves with the piston.
The damping and kicking are measured in the reference frame of the piston.
So, a temperature of zero would mean all particles were moving at exactly the speed
of the wall/piston.
</P>
<P>The <I>units</I> keyword determines the meaning of the distance units used
to define a wall position, but only when a numeric constant is used.
</P>
<P>A <I>box</I> value selects standard distance units as defined by the
<A HREF = "units.html">units</A> command, e.g. Angstroms for units = real or metal.
A <I>lattice</I> value means the distance units are in lattice spacings.
The <A HREF = "lattice.html">lattice</A> command must have been previously used to
define the lattice spacings.
</P>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix. No global or per-atom quantities are stored
-by this fix for access by various <A HREF = "Section_howto.html#4_15">output
-commands</A>. No parameter of this fix can be
-used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
+by this fix for access by various <A HREF = "Section_howto.html#howoto_15">output
+commands</A>. No parameter of this fix can
+be used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
This fix is not invoked during <A HREF = "minimize.html">energy minimization</A>.
</P>
<P><B>Restrictions:</B>
</P>
<P>This fix style is part of the SHOCK package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>The face that has the wall/piston must be boundary type 'm' (shrink-wrapped
with minimum a minimum value). The opposing face can be
any boundary type other than periodic.
</P>
<P>A wall/piston should not be used with rigid bodies such as those
defined by a "fix rigid" command. This is because the wall/piston
displaces atoms directly rather than exerting a force on them.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_wall.html">fix wall/reflect</A> command
</P>
<P><A HREF = "fix_append_atoms.html">fix append/atoms</A> command
</P>
<P><B>Default:</B> <I>pos</I> = 0, <I>vel</I> = 0, <I>units</I> = lattice.
</P>
<HR>
</HTML>
diff --git a/doc/fix_wall_piston.txt b/doc/fix_wall_piston.txt
index 5194733c7..f4c3a5dd4 100644
--- a/doc/fix_wall_piston.txt
+++ b/doc/fix_wall_piston.txt
@@ -1,121 +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
fix wall/piston command :h3
[Syntax:]
fix ID group-ID wall/piston face arg ... keyword value ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
wall/piston = style name of this fix command :l
one face/arg pair must be appended :l
face = {zlo} :l
zero or more keyword/value pairs may be appended :l
keyword = {pos} or {vel} or {ramp} or {units} :l
{pos} args = z
z = z coordinate at which the piston begins (distance units)
{vel} args = vz
vz = final velocity of the piston (velocity units)
{ramp} = use a linear velocity ramp from 0 to vz
{temp} args = target damp seed extent
target = target velocity for region immediately ahead of the piston
damp = damping paramter (time units)
seed = random number seed for langevin kicks
extent = extent of thermostated region (distance units)
{units} value = {lattice} or {box}
{lattice} = the wall position is defined in lattice units
{box} = the wall position is defined in simulation box units :pre
:ule
[Examples:]
fix xwalls all wall/piston zlo
fix walls all wall/piston zlo pos 1.0 0.0 0.0 vel 0.0 0.0 10.0 units box
fix top all wall/piston zlo vel 0.0 0.0 10.0 ramp :pre
[Description:]
Bound the simulation with a moving wall which reflect particles
in the specified group and drive the system with an effective infinite-mass
piston capable of driving shock waves.
A momentum mirror technique is used, which means that if an atom (or the wall)
moves such that an atom is outside the wall on a timestep
by a distance delta (e.g. due to "fix nve"_fix_nve.html), then it is
put back inside the face by the same delta, and the velocity relative to
the moving wall is flipped in z. For instance, a stationary particle hit with a
piston wall with velocity vz, will end the timestep with a velocity of 2*vz.
Currently only face {zlo} may be specified.
This creates a piston moving in the positive z direction.
Particles with z coordinate less than the wall position
are reflected to a z coordinate
greater than the wall position.
If the piston velocity is vpz and the particle velocity
before reflection is vzi, the particle velocity after
reflection is -vzi + 2*vpz.
The initial position of the wall can be specified by the {pos} keyword.
The final velocity of the wall can be specified by the {vel} keyword
The {ramp} keyword will cause the wall/piston to adjust the velocity linearly
from zero velocity to {vel} over the course of the run. If the {ramp} keyword is omitted
then the wall/piston moves at a constant velocity defined by {vel}.
The {temp} keyword will cause the region immediately in front of the wall/piston
to be thermostated with a Langevin thermostat. This region moves with the piston.
The damping and kicking are measured in the reference frame of the piston.
So, a temperature of zero would mean all particles were moving at exactly the speed
of the wall/piston.
The {units} keyword determines the meaning of the distance units used
to define a wall position, but only when a numeric constant is used.
A {box} value selects standard distance units as defined by the
"units"_units.html command, e.g. Angstroms for units = real or metal.
A {lattice} value means the distance units are in lattice spacings.
The "lattice"_lattice.html command must have been previously used to
define the lattice spacings.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various "output
-commands"_Section_howto.html#4_15. No parameter of this fix can be
-used with the {start/stop} keywords of the "run"_run.html command.
+commands"_Section_howto.html#howoto_15. No parameter of this fix can
+be used with the {start/stop} keywords of the "run"_run.html command.
This fix is not invoked during "energy minimization"_minimize.html.
[Restrictions:]
This fix style is part of the SHOCK package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
The face that has the wall/piston must be boundary type 'm' (shrink-wrapped
with minimum a minimum value). The opposing face can be
any boundary type other than periodic.
A wall/piston should not be used with rigid bodies such as those
defined by a "fix rigid" command. This is because the wall/piston
displaces atoms directly rather than exerting a force on them.
[Related commands:]
"fix wall/reflect"_fix_wall.html command
"fix append/atoms"_fix_append_atoms.html command
[Default:] {pos} = 0, {vel} = 0, {units} = lattice.
:line
diff --git a/doc/if.html b/doc/if.html
index 3baffda0f..a0014191f 100644
--- a/doc/if.html
+++ b/doc/if.html
@@ -1,162 +1,162 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>if command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>if boolean then t1 t2 ... elif boolean f1 f2 ... elif boolean f1 f2 ... else e1 e2 ...
</PRE>
<UL><LI>boolean = a Boolean expression evaluated as TRUE or FALSE (see below)
<LI>then = required word
<LI>t1,t2,...,tN = one or more LAMMPS commands to execute if condition is met, each enclosed in quotes
<LI>elif = optional word, can appear multiple times
<LI>f1,f2,...,fN = one or more LAMMPS commands to execute if elif condition is met, each enclosed in quotes (optional arguments)
<LI>else = optional argument
<LI>e1,e2,...,eN = one or more LAMMPS commands to execute if no condition is met, each enclosed in quotes (optional arguments)
</UL>
<P><B>Examples:</B>
</P>
<PRE>if "${steps} > 1000" then exit
if "$x <= $y" then "print X is smaller = $x" else "print Y is smaller = $y"
if "(${eng} > 0.0) || ($n < 1000)" then &
"timestep 0.005" &
elif $n<10000 &
"timestep 0.01" &
else &
"timestep 0.02" &
"print 'Max step reached'"
if "${eng} > ${eng_previous}" then "jump file1" else "jump file2"
</PRE>
<P><B>Description:</B>
</P>
<P>This command provides an in-then-else capability within an input
script. A Boolean expression is evaluted and the result is TRUE or
FALSE. Note that as in the examples above, the expression can contain
variables, as defined by the <A HREF = "variable.html">variable</A> command, which
will be evaluated as part of the expression. Thus a user-defined
formula that reflects the current state of the simulation can be used
to issue one or more new commands.
</P>
<P>If the result of the Boolean expression is TRUE, then one or more
commands (t1, t2, ..., tN) are executed. If it is FALSE, then Boolean
expressions associated with successive elif keywords are evaluated
until one is found to be true, in which case its commands (f1, f2,
..., fN) are executed. If no Boolean expression is TRUE, then the
commands associated witht the else keyword, namely (e1, e2, ..., eN),
are executed. The elif and else keywords and their associated
commands are optional. If they aren't specified and the initial
Boolean expression is FALSE, then no commands are executed.
</P>
<P>The syntax for Boolean expressions is described below.
</P>
<P>Each command (t1, f1, e1, etc) can be any valid LAMMPS input script
command. If the command is more than one word, it must enclosed in
quotes, so it will be treated as a single argument, as in the examples
above.
</P>
<P>IMPORTANT NOTE: If a command itself requires a quoted argument (e.g. a
<A HREF = "print.html">print</A> command), then double and single quotes can be used
and nested in the usual manner, as in the examples above and below.
-See <A HREF = "Section_commands.html#cmd_2">this section</A> of the manual for more
-details on using quotes in arguments. Only one of level of nesting is
-allowed, but that should be sufficient for most use cases.
+See <A HREF = "Section_commands.html#cmd_2">Section_commands 2</A> of the manual for
+more details on using quotes in arguments. Only one of level of
+nesting is allowed, but that should be sufficient for most use cases.
</P>
<P>Note that by using the line continuation character "&", the if command
can be spread across many lines, though it is still a single command:
</P>
<PRE>if "$a < $b" then &
"print 'Minimum value = $a'" &
"run 1000" &
else &
'print "Minimum value = $b"' &
"minimize 0.001 0.001 1000 10000"
</PRE>
<P>Note that if one of the commands to execute is an invalid LAMMPS
command, such as "exit" in the first example above, then executing the
command will cause LAMMPS to halt.
</P>
<P>Note that by jumping to a label in the same input script, the if
command can be used to break out of a loop. See the <A HREF = "variable.html">variable
delete</A> command for info on how to delete the associated
loop variable, so that it can be re-used later in the input script.
</P>
<P>Here is an example of a double loop which uses the if and
<A HREF = "jump.html">jump</A> commands to break out of the inner loop when a
condition is met, then continues iterating thru the outer loop.
</P>
<PRE>label loopa
variable a loop 5
label loopb
variable b loop 5
print "A,B = $a,$b"
run 10000
if '$b > 2' then "print 'Jumping to another script'" "jump in.script break"
next b
jump in.script loopb
label break
variable b delete
</PRE>
<PRE>next a
jump in.script loopa
</PRE>
<HR>
<P>The Boolean expressions for the if and elif keywords have a C-like
syntax. Note that each expression is a single argument within the if
command. Thus if you want to include spaces in the expression for
clarity, you must enclose the entire expression in quotes.
</P>
<P>An expression is built out of numbers:
</P>
<PRE>0.2, 100, 1.0e20, -15.4, etc
</PRE>
<P>and Boolean operators:
</P>
<PRE>A == B, A != B, A < B, A <= B, A > B, A >= B, A && B, A || B, !A
</PRE>
<P>Each A and B is a number or a variable reference like $a or ${abc},
or another Boolean expression.
</P>
<P>If a variable is used it must produce a number when evaluated and
substituted for in the expression, else an error will be generated.
</P>
<P>Expressions are evaluated left to right and have the usual C-style
precedence: the unary logical NOT operator "!" has the highest
precedence, the 4 relational operators "<", "<=", ">", and ">=" are
next; the two remaining relational operators "==" and "!=" are next;
then the logical AND operator "&&"; and finally the logical OR
operator "||" has the lowest precedence. Parenthesis can be used to
group one or more portions of an expression and/or enforce a different
order of evaluation than what would occur with the default precedence.
</P>
<P>The 6 relational operators return either a 1.0 or 0.0 depending on
whether the relationship between x and y is TRUE or FALSE. The
logical AND operator will return 1.0 if both its arguments are
non-zero, else it returns 0.0. The logical OR operator will return
1.0 if either of its arguments is non-zero, else it returns 0.0. The
logical NOT operator returns 1.0 if its argument is 0.0, else it
returns 0.0.
</P>
<P>The overall Boolean expression produces a TRUE result if the result is
non-zero. If the result is zero, the expression result is FALSE.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "variable.html">variable</A>, <A HREF = "print.html">print</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/if.txt b/doc/if.txt
index a92b9213b..494021e4a 100644
--- a/doc/if.txt
+++ b/doc/if.txt
@@ -1,156 +1,156 @@
"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
if command :h3
[Syntax:]
if boolean then t1 t2 ... elif boolean f1 f2 ... elif boolean f1 f2 ... else e1 e2 ... :pre
boolean = a Boolean expression evaluated as TRUE or FALSE (see below)
then = required word
t1,t2,...,tN = one or more LAMMPS commands to execute if condition is met, each enclosed in quotes
elif = optional word, can appear multiple times
f1,f2,...,fN = one or more LAMMPS commands to execute if elif condition is met, each enclosed in quotes (optional arguments)
else = optional argument
e1,e2,...,eN = one or more LAMMPS commands to execute if no condition is met, each enclosed in quotes (optional arguments) :ul
[Examples:]
if "$\{steps\} > 1000" then exit
if "$x <= $y" then "print X is smaller = $x" else "print Y is smaller = $y"
if "($\{eng\} > 0.0) || ($n < 1000)" then &
"timestep 0.005" &
elif $n<10000 &
"timestep 0.01" &
else &
"timestep 0.02" &
"print 'Max step reached'"
if "$\{eng\} > $\{eng_previous\}" then "jump file1" else "jump file2" :pre
[Description:]
This command provides an in-then-else capability within an input
script. A Boolean expression is evaluted and the result is TRUE or
FALSE. Note that as in the examples above, the expression can contain
variables, as defined by the "variable"_variable.html command, which
will be evaluated as part of the expression. Thus a user-defined
formula that reflects the current state of the simulation can be used
to issue one or more new commands.
If the result of the Boolean expression is TRUE, then one or more
commands (t1, t2, ..., tN) are executed. If it is FALSE, then Boolean
expressions associated with successive elif keywords are evaluated
until one is found to be true, in which case its commands (f1, f2,
..., fN) are executed. If no Boolean expression is TRUE, then the
commands associated witht the else keyword, namely (e1, e2, ..., eN),
are executed. The elif and else keywords and their associated
commands are optional. If they aren't specified and the initial
Boolean expression is FALSE, then no commands are executed.
The syntax for Boolean expressions is described below.
Each command (t1, f1, e1, etc) can be any valid LAMMPS input script
command. If the command is more than one word, it must enclosed in
quotes, so it will be treated as a single argument, as in the examples
above.
IMPORTANT NOTE: If a command itself requires a quoted argument (e.g. a
"print"_print.html command), then double and single quotes can be used
and nested in the usual manner, as in the examples above and below.
-See "this section"_Section_commands.html#cmd_2 of the manual for more
-details on using quotes in arguments. Only one of level of nesting is
-allowed, but that should be sufficient for most use cases.
+See "Section_commands 2"_Section_commands.html#cmd_2 of the manual for
+more details on using quotes in arguments. Only one of level of
+nesting is allowed, but that should be sufficient for most use cases.
Note that by using the line continuation character "&", the if command
can be spread across many lines, though it is still a single command:
if "$a < $b" then &
"print 'Minimum value = $a'" &
"run 1000" &
else &
'print "Minimum value = $b"' &
"minimize 0.001 0.001 1000 10000" :pre
Note that if one of the commands to execute is an invalid LAMMPS
command, such as "exit" in the first example above, then executing the
command will cause LAMMPS to halt.
Note that by jumping to a label in the same input script, the if
command can be used to break out of a loop. See the "variable
delete"_variable.html command for info on how to delete the associated
loop variable, so that it can be re-used later in the input script.
Here is an example of a double loop which uses the if and
"jump"_jump.html commands to break out of the inner loop when a
condition is met, then continues iterating thru the outer loop.
label loopa
variable a loop 5
label loopb
variable b loop 5
print "A,B = $a,$b"
run 10000
if '$b > 2' then "print 'Jumping to another script'" "jump in.script break"
next b
jump in.script loopb
label break
variable b delete :pre
next a
jump in.script loopa :pre
:line
The Boolean expressions for the if and elif keywords have a C-like
syntax. Note that each expression is a single argument within the if
command. Thus if you want to include spaces in the expression for
clarity, you must enclose the entire expression in quotes.
An expression is built out of numbers:
0.2, 100, 1.0e20, -15.4, etc :pre
and Boolean operators:
A == B, A != B, A < B, A <= B, A > B, A >= B, A && B, A || B, !A :pre
Each A and B is a number or a variable reference like $a or $\{abc\},
or another Boolean expression.
If a variable is used it must produce a number when evaluated and
substituted for in the expression, else an error will be generated.
Expressions are evaluated left to right and have the usual C-style
precedence: the unary logical NOT operator "!" has the highest
precedence, the 4 relational operators "<", "<=", ">", and ">=" are
next; the two remaining relational operators "==" and "!=" are next;
then the logical AND operator "&&"; and finally the logical OR
operator "||" has the lowest precedence. Parenthesis can be used to
group one or more portions of an expression and/or enforce a different
order of evaluation than what would occur with the default precedence.
The 6 relational operators return either a 1.0 or 0.0 depending on
whether the relationship between x and y is TRUE or FALSE. The
logical AND operator will return 1.0 if both its arguments are
non-zero, else it returns 0.0. The logical OR operator will return
1.0 if either of its arguments is non-zero, else it returns 0.0. The
logical NOT operator returns 1.0 if its argument is 0.0, else it
returns 0.0.
The overall Boolean expression produces a TRUE result if the result is
non-zero. If the result is zero, the expression result is FALSE.
:line
[Restrictions:] none
[Related commands:]
"variable"_variable.html, "print"_print.html
[Default:] none
diff --git a/doc/improper_class2.html b/doc/improper_class2.html
index 437bedf9e..03cccdf6a 100644
--- a/doc/improper_class2.html
+++ b/doc/improper_class2.html
@@ -1,130 +1,130 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>improper_style class2 command
</H3>
<H3>improper_style class2/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>improper_style class2
</PRE>
<P><B>Examples:</B>
</P>
<PRE>improper_style class2
improper_coeff 1 100.0 0
improper_coeff * aa 0.0 0.0 0.0 115.06 130.01 115.06
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>class2</I> improper style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/improper_class2.jpg">
</CENTER>
<P>where Ei is the improper term and Eaa is an angle-angle term. The 3 X
terms in Ei are an average over 3 out-of-plane angles.
</P>
<P>The 4 atoms in an improper quadruplet (listed in the data file read by
the <A HREF = "read_data.html">read_data</A> command) are ordered I,J,K,L. X_IJKL
refers to the angle between the plane of I,J,K and the plane of J,K,L,
and the bond JK lies in both planes. Similarly for X_KJLI and X_LJIK.
Note that atom J appears in the common bonds (JI, JK, JL) of all 3 X
terms. Thus J (the 2nd atom in the quadruplet) is the atom of
symmetry in the 3 X angles.
</P>
<P>The subscripts on the various theta's refer to different combinations
of 3 atoms (I,J,K,L) used to form a particular angle. E.g. Theta_IJL
is the angle formed by atoms I,J,L with J in the middle. Theta1,
theta2, theta3 are the equilibrium positions of those angles. Again,
atom J (the 2nd atom in the quadruplet) is the atom of symmetry in the
theta angles, since it is always the center atom.
</P>
<P>Since atom J is the atom of symmetry, normally the bonds J-I, J-K, J-L
would exist for an improper to be defined between the 4 atoms, but
this is not required.
</P>
<P>See <A HREF = "#Sun">(Sun)</A> for a description of the COMPASS class2 force field.
</P>
<P>Coefficients for the Ei and Eaa formulas must be defined for each
improper type via the <A HREF = "improper_coeff.html">improper_coeff</A> command as
in the example above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands.
</P>
<P>These are the 2 coefficients for the Ei formula:
</P>
<UL><LI>K (energy/radian^2)
<LI>X0 (degrees)
</UL>
<P>X0 is specified in degrees, but LAMMPS converts it to radians
internally; hence the units of K are in energy/radian^2.
</P>
<P>For the Eaa formula, each line in a
<A HREF = "improper_coeff.html">improper_coeff</A> command in the input script lists
7 coefficients, the first of which is "aa" to indicate they are
AngleAngle coefficients. In a data file, these coefficients should be
listed under a "AngleAngle Coeffs" heading and you must leave out the
"aa", i.e. only list 6 coefficients after the improper type.
</P>
<UL><LI>aa
<LI>M1 (energy/distance)
<LI>M2 (energy/distance)
<LI>M3 (energy/distance)
<LI>theta1 (degrees)
<LI>theta2 (degrees)
<LI>theta3 (degrees)
</UL>
<P>The theta values are specified in degrees, but LAMMPS converts them to
radians internally; hence the units of M are in energy/radian^2.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This improper style can only be used if LAMMPS was built with the
CLASS2 package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "improper_coeff.html">improper_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Sun"></A>
<P><B>(Sun)</B> Sun, J Phys Chem B 102, 7338-7364 (1998).
</P>
</HTML>
diff --git a/doc/improper_class2.txt b/doc/improper_class2.txt
index 52f93f924..f6d66b9c7 100644
--- a/doc/improper_class2.txt
+++ b/doc/improper_class2.txt
@@ -1,123 +1,123 @@
"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
improper_style class2 command :h3
improper_style class2/omp command :h3
[Syntax:]
improper_style class2 :pre
[Examples:]
improper_style class2
improper_coeff 1 100.0 0
improper_coeff * aa 0.0 0.0 0.0 115.06 130.01 115.06 :pre
[Description:]
The {class2} improper style uses the potential
:c,image(Eqs/improper_class2.jpg)
where Ei is the improper term and Eaa is an angle-angle term. The 3 X
terms in Ei are an average over 3 out-of-plane angles.
The 4 atoms in an improper quadruplet (listed in the data file read by
the "read_data"_read_data.html command) are ordered I,J,K,L. X_IJKL
refers to the angle between the plane of I,J,K and the plane of J,K,L,
and the bond JK lies in both planes. Similarly for X_KJLI and X_LJIK.
Note that atom J appears in the common bonds (JI, JK, JL) of all 3 X
terms. Thus J (the 2nd atom in the quadruplet) is the atom of
symmetry in the 3 X angles.
The subscripts on the various theta's refer to different combinations
of 3 atoms (I,J,K,L) used to form a particular angle. E.g. Theta_IJL
is the angle formed by atoms I,J,L with J in the middle. Theta1,
theta2, theta3 are the equilibrium positions of those angles. Again,
atom J (the 2nd atom in the quadruplet) is the atom of symmetry in the
theta angles, since it is always the center atom.
Since atom J is the atom of symmetry, normally the bonds J-I, J-K, J-L
would exist for an improper to be defined between the 4 atoms, but
this is not required.
See "(Sun)"_#Sun for a description of the COMPASS class2 force field.
Coefficients for the Ei and Eaa formulas must be defined for each
improper type via the "improper_coeff"_improper_coeff.html command as
in the example above, or in the data file or restart files read by the
"read_data"_read_data.html or "read_restart"_read_restart.html
commands.
These are the 2 coefficients for the Ei formula:
K (energy/radian^2)
X0 (degrees) :ul
X0 is specified in degrees, but LAMMPS converts it to radians
internally; hence the units of K are in energy/radian^2.
For the Eaa formula, each line in a
"improper_coeff"_improper_coeff.html command in the input script lists
7 coefficients, the first of which is "aa" to indicate they are
AngleAngle coefficients. In a data file, these coefficients should be
listed under a "AngleAngle Coeffs" heading and you must leave out the
"aa", i.e. only list 6 coefficients after the improper type.
aa
M1 (energy/distance)
M2 (energy/distance)
M3 (energy/distance)
theta1 (degrees)
theta2 (degrees)
theta3 (degrees) :ul
The theta values are specified in degrees, but LAMMPS converts them to
radians internally; hence the units of M are in energy/radian^2.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This improper style can only be used if LAMMPS was built with the
CLASS2 package. See the "Making LAMMPS"_Section_start.html#start_3
section for more info on packages.
[Related commands:]
"improper_coeff"_improper_coeff.html
[Default:] none
:line
:link(Sun)
[(Sun)] Sun, J Phys Chem B 102, 7338-7364 (1998).
diff --git a/doc/improper_cvff.html b/doc/improper_cvff.html
index 894c2979e..211b33f1d 100644
--- a/doc/improper_cvff.html
+++ b/doc/improper_cvff.html
@@ -1,94 +1,94 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>improper_style cvff command
</H3>
<H3>improper_style cvff/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>improper_style cvff
</PRE>
<P><B>Examples:</B>
</P>
<PRE>improper_style cvff
improper_coeff 1 80.0 -1 4
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>cvff</I> improper style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/improper_cvff.jpg">
</CENTER>
<P>where phi is the Wilson out-of-plane angle.
</P>
<P>If the 4 atoms in an improper quadruplet (listed in the data file read
by the <A HREF = "read_data.html">read_data</A> command) are ordered I,J,K,L then
the Wilson angle is between the plane of I,J,K and the plane of J,K,L.
This is essentially a dihedral angle, which is why the formula for
this improper style is the same as for <A HREF = "dihedral_harmonic.html">dihedral_style
harmonic</A>. Alternatively, you can think of
atoms J,K,L as being in a plane, and atom I above the plane, and the
Wilson angle as a measure of how far out-of-plane I is with respect to
the other 3 atoms.
</P>
<P>Note that defining 4 atoms to interact in this way, does not mean that
bonds necessarily exist between I-J, J-K, or K-L, as they would in a
linear dihedral. Normally, the bonds I-J, I-K, I-L would exist for an
improper to be defined between the 4 atoms.
</P>
<P>The following coefficients must be defined for each improper type via
the <A HREF = "improper_coeff.html">improper_coeff</A> command as in the example
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>K (energy)
<LI>d (+1 or -1)
<LI>n (0,1,2,3,4,6)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This improper style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "improper_coeff.html">improper_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/improper_cvff.txt b/doc/improper_cvff.txt
index 7bff07584..94736d3cd 100644
--- a/doc/improper_cvff.txt
+++ b/doc/improper_cvff.txt
@@ -1,88 +1,88 @@
"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
improper_style cvff command :h3
improper_style cvff/omp command :h3
[Syntax:]
improper_style cvff :pre
[Examples:]
improper_style cvff
improper_coeff 1 80.0 -1 4 :pre
[Description:]
The {cvff} improper style uses the potential
:c,image(Eqs/improper_cvff.jpg)
where phi is the Wilson out-of-plane angle.
If the 4 atoms in an improper quadruplet (listed in the data file read
by the "read_data"_read_data.html command) are ordered I,J,K,L then
the Wilson angle is between the plane of I,J,K and the plane of J,K,L.
This is essentially a dihedral angle, which is why the formula for
this improper style is the same as for "dihedral_style
harmonic"_dihedral_harmonic.html. Alternatively, you can think of
atoms J,K,L as being in a plane, and atom I above the plane, and the
Wilson angle as a measure of how far out-of-plane I is with respect to
the other 3 atoms.
Note that defining 4 atoms to interact in this way, does not mean that
bonds necessarily exist between I-J, J-K, or K-L, as they would in a
linear dihedral. Normally, the bonds I-J, I-K, I-L would exist for an
improper to be defined between the 4 atoms.
The following coefficients must be defined for each improper type via
the "improper_coeff"_improper_coeff.html command as in the example
above, or in the data file or restart files read by the
"read_data"_read_data.html or "read_restart"_read_restart.html
commands:
K (energy)
d (+1 or -1)
n (0,1,2,3,4,6) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This improper style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"improper_coeff"_improper_coeff.html
[Default:] none
diff --git a/doc/improper_harmonic.html b/doc/improper_harmonic.html
index d62ca4a8a..075a1c141 100644
--- a/doc/improper_harmonic.html
+++ b/doc/improper_harmonic.html
@@ -1,94 +1,94 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>improper_style harmonic command
</H3>
<H3>improper_style harmonic/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>improper_style harmonic
</PRE>
<P><B>Examples:</B>
</P>
<PRE>improper_style harmonic
improper_coeff 1 100.0 0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>harmonic</I> improper style uses the potential
</P>
<CENTER><IMG SRC = "Eqs/improper_harmonic.jpg">
</CENTER>
<P>where X is the improper angle, X0 is its equilibrium value, and K is a
prefactor. Note that the usual 1/2 factor is included in K.
</P>
<P>If the 4 atoms in an improper quadruplet (listed in the data file read
by the <A HREF = "read_data.html">read_data</A> command) are ordered I,J,K,L then X
is the angle between the plane of I,J,K and the plane of J,K,L.
Alternatively, you can think of atoms J,K,L as being in a plane, and
atom I above the plane, and X as a measure of how far out-of-plane I
is with respect to the other 3 atoms.
</P>
<P>Note that defining 4 atoms to interact in this way, does not mean that
bonds necessarily exist between I-J, J-K, or K-L, as they would in a
linear dihedral. Normally, the bonds I-J, I-K, I-L would exist for an
improper to be defined between the 4 atoms.
</P>
<P>The following coefficients must be defined for each improper type via
the <A HREF = "improper_coeff.html">improper_coeff</A> command as in the example
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>K (energy/radian^2)
<LI>X0 (degrees)
</UL>
<P>X0 is specified in degrees, but LAMMPS converts it to radians
internally; hence the units of K are in energy/radian^2.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This improper style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "improper_coeff.html">improper_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/improper_harmonic.txt b/doc/improper_harmonic.txt
index 0d4317130..9a0312990 100644
--- a/doc/improper_harmonic.txt
+++ b/doc/improper_harmonic.txt
@@ -1,88 +1,88 @@
"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
improper_style harmonic command :h3
improper_style harmonic/omp command :h3
[Syntax:]
improper_style harmonic :pre
[Examples:]
improper_style harmonic
improper_coeff 1 100.0 0 :pre
[Description:]
The {harmonic} improper style uses the potential
:c,image(Eqs/improper_harmonic.jpg)
where X is the improper angle, X0 is its equilibrium value, and K is a
prefactor. Note that the usual 1/2 factor is included in K.
If the 4 atoms in an improper quadruplet (listed in the data file read
by the "read_data"_read_data.html command) are ordered I,J,K,L then X
is the angle between the plane of I,J,K and the plane of J,K,L.
Alternatively, you can think of atoms J,K,L as being in a plane, and
atom I above the plane, and X as a measure of how far out-of-plane I
is with respect to the other 3 atoms.
Note that defining 4 atoms to interact in this way, does not mean that
bonds necessarily exist between I-J, J-K, or K-L, as they would in a
linear dihedral. Normally, the bonds I-J, I-K, I-L would exist for an
improper to be defined between the 4 atoms.
The following coefficients must be defined for each improper type via
the "improper_coeff"_improper_coeff.html command as in the example
above, or in the data file or restart files read by the
"read_data"_read_data.html or "read_restart"_read_restart.html
commands:
K (energy/radian^2)
X0 (degrees) :ul
X0 is specified in degrees, but LAMMPS converts it to radians
internally; hence the units of K are in energy/radian^2.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This improper style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"improper_coeff"_improper_coeff.html
[Default:] none
diff --git a/doc/improper_umbrella.html b/doc/improper_umbrella.html
index 84cdbc843..8c74bad45 100644
--- a/doc/improper_umbrella.html
+++ b/doc/improper_umbrella.html
@@ -1,96 +1,96 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>improper_style umbrella command
</H3>
<H3>improper_style umbrella/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>improper_style umbrella
</PRE>
<P><B>Examples:</B>
</P>
<PRE>improper_style umbrella
improper_coeff 1 100.0 180.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>umbrella</I> improper style uses the following potential, which is
commonly referred to as a classic inversion and used in the
<A HREF = "Section_howto.html#howto_4">DREIDING</A> force field:
</P>
<CENTER><IMG SRC = "Eqs/improper_umbrella.jpg">
</CENTER>
<P>where K is the force constant and omega is the angle between the IL
axis and the IJK plane:
</P>
<CENTER><IMG SRC = "Eqs/umbrella.jpg">
</CENTER>
<P>If omega0 = 0 the potential term has a minimum for the planar
structure. Otherwise it has two minima at +/- omega0, with a barrier
in between.
</P>
<P>See <A HREF = "#Mayo">(Mayo)</A> for a description of the DREIDING force field.
</P>
<P>The following coefficients must be defined for each improper type via
the <A HREF = "improper_coeff.html">improper_coeff</A> command as in the example
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>K (energy)
<LI>omega0 (degrees)
</UL>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This improper style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "improper_coeff.html">improper_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Mayo"></A>
<P><B>(Mayo)</B> Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
(1990),
</P>
</HTML>
diff --git a/doc/improper_umbrella.txt b/doc/improper_umbrella.txt
index 7ec8cfb1e..d5e178ff9 100644
--- a/doc/improper_umbrella.txt
+++ b/doc/improper_umbrella.txt
@@ -1,89 +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
improper_style umbrella command :h3
improper_style umbrella/omp command :h3
[Syntax:]
improper_style umbrella :pre
[Examples:]
improper_style umbrella
improper_coeff 1 100.0 180.0 :pre
[Description:]
The {umbrella} improper style uses the following potential, which is
commonly referred to as a classic inversion and used in the
"DREIDING"_Section_howto.html#howto_4 force field:
:c,image(Eqs/improper_umbrella.jpg)
where K is the force constant and omega is the angle between the IL
axis and the IJK plane:
:c,image(Eqs/umbrella.jpg)
If omega0 = 0 the potential term has a minimum for the planar
structure. Otherwise it has two minima at +/- omega0, with a barrier
in between.
See "(Mayo)"_#Mayo for a description of the DREIDING force field.
The following coefficients must be defined for each improper type via
the "improper_coeff"_improper_coeff.html command as in the example
above, or in the data file or restart files read by the
"read_data"_read_data.html or "read_restart"_read_restart.html
commands:
K (energy)
omega0 (degrees) :ul
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This improper style can only be used if LAMMPS was built with the
MOLECULAR package (which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
[Related commands:]
"improper_coeff"_improper_coeff.html
[Default:] none
:line
:link(Mayo)
[(Mayo)] Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
(1990),
diff --git a/doc/kspace_style.html b/doc/kspace_style.html
index 7e54d18de..5d6c200f5 100644
--- a/doc/kspace_style.html
+++ b/doc/kspace_style.html
@@ -1,205 +1,205 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>kspace_style command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>kspace_style style value
</PRE>
<UL><LI>style = <I>none</I> or <I>ewald</I> or <I>pppm</I> or <I>pppm/cg</I> or <I>pppm/tip4p</I> or <I>ewald/n</I> or <I>pppm/gpu</I> or <I>ewald/omp</I> or <I>pppm/omp</I> or <I>pppm/proxy</I>
<PRE> <I>none</I> value = none
<I>ewald</I> value = precision
precision = desired accuracy
<I>pppm</I> value = precision
precision = desired accuracy
<I>pppm/cg</I> value = precision (smallq)
precision = desired accuracy
smallq = cutoff for charges to be considered (optional) (charge units)
<I>pppm/tip4p</I> value = precision
precision = desired accuracy
<I>ewald/n</I> value = precision
precision = desired accuracy
<I>pppm/gpu</I> value = precision
precision = desired accuracy
<I>ewald/omp</I> value = precision
precision = desired accuracy
<I>pppm/omp</I> value = precision
precision = desired accuracy
<I>pppm/proxy</I> value = precision
precision = desired accuracy
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>kspace_style pppm 1.0e-4
kspace_style pppm/cg 1.0e-5 1.0e-6
kspace_style none
</PRE>
<P><B>Description:</B>
</P>
<P>Define a K-space solver for LAMMPS to use each timestep to compute
long-range Coulombic interactions or long-range 1/r^N interactions.
When such a solver is used in conjunction with an appropriate pair
style, the cutoff for Coulombic or other 1/r^N interactions is
effectively infinite; each charge in the system interacts with charges
in an infinite array of periodic images of the simulation domain.
</P>
<P>The <I>ewald</I> style performs a standard Ewald summation as described in
any solid-state physics text.
</P>
<P>The <I>pppm</I> style invokes a particle-particle particle-mesh solver
<A HREF = "#Hockney">(Hockney)</A> which maps atom charge to a 3d mesh, uses 3d FFTs
to solve Poisson's equation on the mesh, then interpolates electric
fields on the mesh points back to the atoms. It is closely related to
the particle-mesh Ewald technique (PME) <A HREF = "#Darden">(Darden)</A> used in
AMBER and CHARMM. The cost of traditional Ewald summation scales as
N^(3/2) where N is the number of atoms in the system. The PPPM solver
scales as Nlog(N) due to the FFTs, so it is almost always a faster
choice <A HREF = "#Pollock">(Pollock)</A>.
</P>
<P>The <I>pppm/cg</I> style is identical to the <I>pppm</I> style except that it
has an optimization for systems where most particles are uncharged.
The optional <I>smallq</I> argument defines the cutoff for the absolute
charge value which determines whether a particle is considered charged
or not. Its default value is 1.0e-5.
</P>
<P>The <I>pppm/tip4p</I> style is identical to the <I>pppm</I> style except that it
adds a charge at the massless 4th site in each TIP4P water molecule.
It should be used with <A HREF = "pair_style.html">pair styles</A> with a
<I>long/tip4p</I> in their style name.
</P>
<P>The <I>ewald/n</I> style augments <I>ewald</I> by adding long-range dispersion
sum capabilities for 1/r^N potentials and is useful for simulation of
interfaces <A HREF = "#Veld">(Veld)</A>. It also performs standard coulombic Ewald
summations, but in a more efficient manner than the <I>ewald</I> style.
The 1/r^N capability means that Lennard-Jones or Buckingham potentials
can be used with <I>ewald/n</I> without a cutoff, i.e. they become full
long-range potentials.
</P>
<P>Currently, only the <I>ewald/n</I> style can be used with non-orthogonal
(triclinic symmetry) simulation boxes.
</P>
<P>The <I>pppm/proxy</I> style is a special variant for calculations
in hybrid OpenMP/MPI parallel mode. It is functionally equivalent
with <I>pppm</I>, but it its force computation is being executed
as a single thread concurrently with a multi-threaded non-bonded
calculation for a pair style with <I>pppm/omp</I> suffix. For calcuations
across many multi-core nodes, this can have a performance benefit
over performing the real and reciprocal space part separately,
specifically when otherwise the time spent on the pair style
would slightly less than in <I>pppm</I> without threading.
</P>
<P>Note that the PPPM styles can be used with single-precision FFTs by
using the compiler switch -DFFT_SINGLE for the FFT_INC setting in your
lo-level Makefile. This setting also changes some of the PPPM
operations (e.g. mapping charge to mesh and interpolating electric
fields to particles) to be performed in single precision. This option
can speed-up long-range calulations, particularly in parallel or on
GPUs. The use of the -DFFT_SINGLE flag is discussed in <A HREF = "Section_start.html#start_2_4">this
section</A> of the manual.
</P>
<HR>
<P>When a kspace style is used, a pair style that includes the
short-range correction to the pairwise Coulombic or other 1/r^N forces
must also be selected. For Coulombic interactions, these styles are
ones that have a <I>coul/long</I> in their style name. For 1/r^6
dispersion forces in a Lennard-Jones or Buckingham potential, see the
<A HREF = "pair_lj_coul.html">pair_style lj/coul</A> or <A HREF = "pair_buck_coul.html">pair_style
buck/coul</A> commands.
</P>
<P>A precision value of 1.0e-4 means one part in 10000. This setting is
used in conjunction with the pairwise cutoff to determine the number
of K-space vectors for style <I>ewald</I> or the FFT grid size for style
<I>pppm</I>.
</P>
<P>See the <A HREF = "kspace_modify.html">kspace_modify</A> command for additional
options of the K-space solvers that can be set.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are
-functionally the same as the corresponding style without the suffix.
-They have been optimized to run faster, depending on your available
-hardware, as discussed in <A HREF = "Section_accelerate.html">this section</A> of
-the manual. The accelerated styles take the same arguments and should
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
produce the same results, except for round-off and precision issues.
</P>
<P>More specifically, the <I>pppm/gpu</I> style performs charge assignment and
force interpolation calculations on the GPU. These processes are
performed either in single or double precision, depending on whether
the -DFFT_SINGLE setting was specified in your lo-level Makefile, as
discussed above. The FFTs themselves are still calculated on the CPU.
If <I>pppm/gpu</I> is used with a GPU-enabled pair style, part of the PPPM
calculation can be performed concurrently on the GPU while other
calculations for non-bonded and bonded force calculation are performed
on the CPU.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP, and
OPT packages respectively. They are only enabled if LAMMPS was built
with those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<P><B>Restrictions:</B>
</P>
<P>A simulation must be 3d and periodic in all dimensions to use an Ewald
or PPPM solver. The only exception is if the slab option is set with
<A HREF = "kspace_modify.html">kspace_modify</A>, in which case the xy dimensions
must be periodic and the z dimension must be non-periodic.
</P>
<P>Kspace styles are part of the KSPACE package. They are only enabled
if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>The <I>ewald/n</I> style is part of the USER-EWALDN package. It is only
enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>When using a long-range pairwise TIP4P potential, you must use kspace
style <I>pppm/tip4p</I> and vice versa.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "kspace_modify.html">kspace_modify</A>, <A HREF = "pair_lj.html">pair_style
lj/cut/coul/long</A>, <A HREF = "pair_charmm.html">pair_style
lj/charmm/coul/long</A>, <A HREF = "pair_lj_coul.html">pair_style
lj/coul</A>, <A HREF = "pair_buck.html">pair_style buck/coul/long</A>
</P>
<P><B>Default:</B>
</P>
<PRE>kspace_style none
</PRE>
<HR>
<A NAME = "Darden"></A>
<P><B>(Darden)</B> Darden, York, Pedersen, J Chem Phys, 98, 10089 (1993).
</P>
<A NAME = "Hockney"></A>
<P><B>(Hockney)</B> Hockney and Eastwood, Computer Simulation Using Particles,
Adam Hilger, NY (1989).
</P>
<A NAME = "Pollock"></A>
<P><B>(Pollock)</B> Pollock and Glosli, Comp Phys Comm, 95, 93 (1996).
</P>
<A NAME = "Veld"></A>
<P><B>(Veld)</B> In 't Veld, Ismail, Grest, J Chem Phys, in press (2007).
</P>
</HTML>
diff --git a/doc/kspace_style.txt b/doc/kspace_style.txt
index b6d70f66d..d13dbf68d 100644
--- a/doc/kspace_style.txt
+++ b/doc/kspace_style.txt
@@ -1,194 +1,194 @@
"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
kspace_style command :h3
[Syntax:]
kspace_style style value :pre
style = {none} or {ewald} or {pppm} or {pppm/cg} or {pppm/tip4p} or {ewald/n} or {pppm/gpu} or {ewald/omp} or {pppm/omp} or {pppm/proxy} :ulb,l
{none} value = none
{ewald} value = precision
precision = desired accuracy
{pppm} value = precision
precision = desired accuracy
{pppm/cg} value = precision (smallq)
precision = desired accuracy
smallq = cutoff for charges to be considered (optional) (charge units)
{pppm/tip4p} value = precision
precision = desired accuracy
{ewald/n} value = precision
precision = desired accuracy
{pppm/gpu} value = precision
precision = desired accuracy
{ewald/omp} value = precision
precision = desired accuracy
{pppm/omp} value = precision
precision = desired accuracy
{pppm/proxy} value = precision
precision = desired accuracy :pre
:ule
[Examples:]
kspace_style pppm 1.0e-4
kspace_style pppm/cg 1.0e-5 1.0e-6
kspace_style none :pre
[Description:]
Define a K-space solver for LAMMPS to use each timestep to compute
long-range Coulombic interactions or long-range 1/r^N interactions.
When such a solver is used in conjunction with an appropriate pair
style, the cutoff for Coulombic or other 1/r^N interactions is
effectively infinite; each charge in the system interacts with charges
in an infinite array of periodic images of the simulation domain.
The {ewald} style performs a standard Ewald summation as described in
any solid-state physics text.
The {pppm} style invokes a particle-particle particle-mesh solver
"(Hockney)"_#Hockney which maps atom charge to a 3d mesh, uses 3d FFTs
to solve Poisson's equation on the mesh, then interpolates electric
fields on the mesh points back to the atoms. It is closely related to
the particle-mesh Ewald technique (PME) "(Darden)"_#Darden used in
AMBER and CHARMM. The cost of traditional Ewald summation scales as
N^(3/2) where N is the number of atoms in the system. The PPPM solver
scales as Nlog(N) due to the FFTs, so it is almost always a faster
choice "(Pollock)"_#Pollock.
The {pppm/cg} style is identical to the {pppm} style except that it
has an optimization for systems where most particles are uncharged.
The optional {smallq} argument defines the cutoff for the absolute
charge value which determines whether a particle is considered charged
or not. Its default value is 1.0e-5.
The {pppm/tip4p} style is identical to the {pppm} style except that it
adds a charge at the massless 4th site in each TIP4P water molecule.
It should be used with "pair styles"_pair_style.html with a
{long/tip4p} in their style name.
The {ewald/n} style augments {ewald} by adding long-range dispersion
sum capabilities for 1/r^N potentials and is useful for simulation of
interfaces "(Veld)"_#Veld. It also performs standard coulombic Ewald
summations, but in a more efficient manner than the {ewald} style.
The 1/r^N capability means that Lennard-Jones or Buckingham potentials
can be used with {ewald/n} without a cutoff, i.e. they become full
long-range potentials.
Currently, only the {ewald/n} style can be used with non-orthogonal
(triclinic symmetry) simulation boxes.
The {pppm/proxy} style is a special variant for calculations
in hybrid OpenMP/MPI parallel mode. It is functionally equivalent
with {pppm}, but it its force computation is being executed
as a single thread concurrently with a multi-threaded non-bonded
calculation for a pair style with {pppm/omp} suffix. For calcuations
across many multi-core nodes, this can have a performance benefit
over performing the real and reciprocal space part separately,
specifically when otherwise the time spent on the pair style
would slightly less than in {pppm} without threading.
Note that the PPPM styles can be used with single-precision FFTs by
using the compiler switch -DFFT_SINGLE for the FFT_INC setting in your
lo-level Makefile. This setting also changes some of the PPPM
operations (e.g. mapping charge to mesh and interpolating electric
fields to particles) to be performed in single precision. This option
can speed-up long-range calulations, particularly in parallel or on
GPUs. The use of the -DFFT_SINGLE flag is discussed in "this
section"_Section_start.html#start_2_4 of the manual.
:line
When a kspace style is used, a pair style that includes the
short-range correction to the pairwise Coulombic or other 1/r^N forces
must also be selected. For Coulombic interactions, these styles are
ones that have a {coul/long} in their style name. For 1/r^6
dispersion forces in a Lennard-Jones or Buckingham potential, see the
"pair_style lj/coul"_pair_lj_coul.html or "pair_style
buck/coul"_pair_buck_coul.html commands.
A precision value of 1.0e-4 means one part in 10000. This setting is
used in conjunction with the pairwise cutoff to determine the number
of K-space vectors for style {ewald} or the FFT grid size for style
{pppm}.
See the "kspace_modify"_kspace_modify.html command for additional
options of the K-space solvers that can be set.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are
-functionally the same as the corresponding style without the suffix.
-They have been optimized to run faster, depending on your available
-hardware, as discussed in "this section"_Section_accelerate.html of
-the manual. The accelerated styles take the same arguments and should
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
produce the same results, except for round-off and precision issues.
More specifically, the {pppm/gpu} style performs charge assignment and
force interpolation calculations on the GPU. These processes are
performed either in single or double precision, depending on whether
the -DFFT_SINGLE setting was specified in your lo-level Makefile, as
discussed above. The FFTs themselves are still calculated on the CPU.
If {pppm/gpu} is used with a GPU-enabled pair style, part of the PPPM
calculation can be performed concurrently on the GPU while other
calculations for non-bonded and bonded force calculation are performed
on the CPU.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP, and
OPT packages respectively. They are only enabled if LAMMPS was built
with those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
[Restrictions:]
A simulation must be 3d and periodic in all dimensions to use an Ewald
or PPPM solver. The only exception is if the slab option is set with
"kspace_modify"_kspace_modify.html, in which case the xy dimensions
must be periodic and the z dimension must be non-periodic.
Kspace styles are part of the KSPACE package. They are only enabled
if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
The {ewald/n} style is part of the USER-EWALDN package. It is only
enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
When using a long-range pairwise TIP4P potential, you must use kspace
style {pppm/tip4p} and vice versa.
[Related commands:]
"kspace_modify"_kspace_modify.html, "pair_style
lj/cut/coul/long"_pair_lj.html, "pair_style
lj/charmm/coul/long"_pair_charmm.html, "pair_style
lj/coul"_pair_lj_coul.html, "pair_style buck/coul/long"_pair_buck.html
[Default:]
kspace_style none :pre
:line
:link(Darden)
[(Darden)] Darden, York, Pedersen, J Chem Phys, 98, 10089 (1993).
:link(Hockney)
[(Hockney)] Hockney and Eastwood, Computer Simulation Using Particles,
Adam Hilger, NY (1989).
:link(Pollock)
[(Pollock)] Pollock and Glosli, Comp Phys Comm, 95, 93 (1996).
:link(Veld)
[(Veld)] In 't Veld, Ismail, Grest, J Chem Phys, in press (2007).
diff --git a/doc/log.html b/doc/log.html
index 2edfe3fcd..10db3c0b4 100644
--- a/doc/log.html
+++ b/doc/log.html
@@ -1,47 +1,47 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>log command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>log file
</PRE>
<UL><LI>file = name of new logfile
</UL>
<P><B>Examples:</B>
</P>
<PRE>log log.equil
</PRE>
<P><B>Description:</B>
</P>
<P>This command closes the current LAMMPS log file, opens a new file with
the specified name, and begins logging information to it. If the
specified file name is <I>none</I>, then no new log file is opened.
</P>
<P>If multiple processor partitions are being used, the file name should
be a variable, so that different processors do not attempt to write to
the same log file.
</P>
<P>The file "log.lammps" is the default log file for a LAMMPS run. The
name of the initial log file can also be set by the command-line
-switch -log. See <A HREF = "Section_start.html#start_6">this section</A> for
+switch -log. See <A HREF = "Section_start.html#start_6">Section_start 6</A> for
details.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B> none
</P>
<P><B>Default:</B>
</P>
<P>The default LAMMPS log file is named log.lammps
</P>
</HTML>
diff --git a/doc/log.txt b/doc/log.txt
index dc56bfcb6..bfd4462c4 100644
--- a/doc/log.txt
+++ b/doc/log.txt
@@ -1,42 +1,42 @@
"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
log command :h3
[Syntax:]
log file :pre
file = name of new logfile :ul
[Examples:]
log log.equil :pre
[Description:]
This command closes the current LAMMPS log file, opens a new file with
the specified name, and begins logging information to it. If the
specified file name is {none}, then no new log file is opened.
If multiple processor partitions are being used, the file name should
be a variable, so that different processors do not attempt to write to
the same log file.
The file "log.lammps" is the default log file for a LAMMPS run. The
name of the initial log file can also be set by the command-line
-switch -log. See "this section"_Section_start.html#start_6 for
+switch -log. See "Section_start 6"_Section_start.html#start_6 for
details.
[Restrictions:] none
[Related commands:] none
[Default:]
The default LAMMPS log file is named log.lammps
diff --git a/doc/neb.html b/doc/neb.html
index 25cc68b64..654953808 100644
--- a/doc/neb.html
+++ b/doc/neb.html
@@ -1,333 +1,333 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>neb command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>neb etol ftol N1 N2 Nevery filename
</PRE>
<UL><LI>etol = stopping tolerance for energy (energy units)
<LI>ftol = stopping tolerance for force (force units)
<LI>N1 = max # of iterations (timesteps) to run initial NEB
<LI>N2 = max # of iterations (timesteps) to run barrier-climbing NEB
<LI>Nevery = print replica energies and reaction coordinates every this many timesteps
<LI>filename = file specifying final atom coordinates on other side of barrier
</UL>
<P><B>Examples:</B>
</P>
<PRE>neb 0.1 0.0 1000 500 50 coords.final
neb 0.0 0.001 1000 500 50 coords.final
</PRE>
<P><B>Description:</B>
</P>
<P>Perform a nudged elastic band (NEB) calculation using multiple
replicas of a system. Two or more replicas must be used, two of which
are the end points of the transition path.
</P>
<P>NEB is a method for finding both the atomic configurations and height
of the energy barrier associated with a transition state, e.g. for an
atom to perform a diffusive hop from one energy basin to another in a
coordinated fashion with its neighbors. The implementation in LAMMPS
follows the discussion in these 3 papers: <A HREF = "#Henkelman1">(Henkelman1)</A>,
<A HREF = "#Henkelman2">(Henkelman2)</A>, and <A HREF = "#Nakano">(Nakano)</A>.
</P>
<P>Each replica runs on a partition of one or more processors. Processor
partitions are defined at run-time using the -partition command-line
-switch; see <A HREF = "Section_start.html#start_6">this section</A> of the manual.
-Note that if you have MPI installed, you can run a multi-replica
-simulation with more replicas (partitions) than you have physical
-processors, e.g you can run a 10-replica simulation on one or two
-processors. You will simply not get the performance speed-up you
+switch; see <A HREF = "Section_start.html#start_6">Section_start 6</A> of the
+manual. Note that if you have MPI installed, you can run a
+multi-replica simulation with more replicas (partitions) than you have
+physical processors, e.g you can run a 10-replica simulation on one or
+two processors. You will simply not get the performance speed-up you
would see with one or more physical processors per replica. See <A HREF = "Section_howto.html#howto_5">this
section</A> of the manual for further
discussion.
</P>
<P>NOTE: The current NEB implementation in LAMMPS restricts you to having
exactly one processor per replica.
</P>
<P>When a NEB calculation is performed, it is assumed that each replica
is running the same model, though LAMMPS does not check for this.
I.e. the simulation domain, the number of atoms, the interaction
potentials, and the starting configuration when the neb command is
issued should be the same for every replica.
</P>
<P>In a NEB calculation each atom in a replica is connected to the same
atom in adjacent replicas by springs, which induce inter-replica
forces. These forces are imposed by the <A HREF = "fix_neb.html">fix neb</A>
command, which must be used in conjunction with the neb command. The
group used to define the fix neb command specifies which atoms the
inter-replica springs are applied to. These are the NEB atoms.
Additional atoms can be present in your system, e.g. to provide a
background force field or simply to hold fixed during the NEB
procedure, but they will not be part of the barrier finding procedure.
</P>
<P>The "starting configuration" for NEB should be a state with the NEB
atoms (and all other atoms) having coordinates on one side of the
energy barrier. These coordinates will be assigned to the first
replica #1. The coordinates should be close to a local energy
minimum. A perfect energy minimum is not required, since NEB runs via
damped dynamics which will tend to drive the configuration of replica
#1 to a true energy minimum, but you will typically get better
convergence if the initial state is already at a minimum. For
example, for a system with a free surface, the surface should be fully
relaxed before attempting a NEB calculation.
</P>
<P>The final configuration is specified in the input <I>filename</I>, which is
formatted as described below. Only coordinates for NEB atoms or a
subset of them should be listed in the file; they represent the state
of the system on the other side of the barrier, at or near an energy
minimum. These coordinates will be assigned to the last replica #M.
The final coordinates of atoms not listed in <I>filename</I> are set equal
to their initial coordinates. Again, a perfect energy minimum is not
required for the final configuration, since the atoms in replica #M
will tend to move during the NEB procedure to the nearest energy
minimum. Also note that a final coordinate does not need to be
specified for a NEB atom if you expect it to only displace slightly
during the NEB procedure. For example, only the final coordinate of
the single atom diffusing into a vacancy need be specified if the
surrounding atoms will only relax slightly in the final configuration.
</P>
<P>The initial coordinates of all atoms (not just NEB atoms) in the
intermediate replicas #2,#3,...,#M-1 are set to values linearly
interpolated between the corresponding atoms in replicas #1 and #M.
</P>
<P>A NEB calculation has two stages, each of which is a minimization
procedure, performed via damped dynamics. To enable this, you must
first define an appropriate <A HREF = "min_style.html">min_style</A>, such as
<I>quickmin</I> or <I>fire</I>. The <I>cg</I>, <I>sd</I>, and <I>hftn</I> styles cannot be
used, since they perform iterative line searches in their inner loop,
which cannot be easily synchronized across multiple replicas.
</P>
<P>The minimizer tolerances for energy and force are set by <I>etol</I> and <I>ftol</I>,
the same as for
the <A HREF = "minimize.html">minimize</A> command.
</P>
<P>A non-zero <I>etol</I>
means that the NEB calculation will terminate if the energy criterion is met
by every replica. The energies being compared to
<I>etol</I> do not include any contribution from the inter-replica forces, since
these are non-conservative.
A non-zero <I>ftol</I>
means that the NEB calculation will terminate if the force criterion is met
by every replica. The forces being compared to
<I>ftol</I> include the inter-replica forces between an atom and its images
in adjacent replicas.
</P>
<P>The maximum number of iterations in each stage is set by <I>N1</I> and
<I>N2</I>. These are effectively timestep counts since each iteration of
damped dynamics is like a single timestep in a dynamics
<A HREF = "run.html">run</A>. During both stages, the potential energy of each
replica and its normalized distance along the reaction path (reaction
coordinate RD) will be printed to the screen and log file every
<I>Nevery</I> timesteps. The RD is 0 and 1 for the first and last replica.
For intermediate replicas, it is the cumulative distance (normalized
by the total cumulative distance) between adjacent replicas, where
"distance" is defined as the length of the 3N-vector of differences in
atomic coordinates, where N is the number of NEB atoms involved in the
transition. These outputs allow you to monitor NEB's progress in
finding a good energy barrier. <I>N1</I> and <I>N2</I> must both be multiples
of <I>Nevery</I>.
</P>
<P>In the first stage of NEB, the set of replicas should converge toward
the minimum energy path (MEP) of conformational states that transition
over the barrier. The MEP for a barrier is defined as a sequence of
3N-dimensional states that cross the barrier at its saddle point, each
of which has a potential energy gradient parallel to the MEP itself.
The replica states will also be roughly equally spaced along the MEP
due to the inter-replica spring force added by the <A HREF = "fix_neb.html">fix
neb</A> command.
</P>
<P>In the second stage of NEB, the replica with the highest energy
is selected and the inter-replica forces on it are converted to a
force that drives its atom coordinates to the top or saddle point of
the barrier, via the barrier-climbing calculation described in
<A HREF = "#Hinkelman2">(Henkelman2)</A>. As before, the other replicas rearrange
themselves along the MEP so as to be roughly equally spaced.
</P>
<P>When both stages are complete, if the NEB calculation was successful,
one of the replicas should be an atomic configuration at the top or
saddle point of the barrier, the potential energies for the set of
replicas should represent the energy profile of the barrier along the
MEP, and the configurations of the replicas should be a sequence of
configurations along the MEP.
</P>
<HR>
<P>A few other settings in your input script are required or advised to
perform a NEB calculation.
</P>
<P>An atom map must be defined which it is not by default for <A HREF = "atom_style.html">atom_style
atomic</A> problems. The <A HREF = "atom_modify.html">atom_modify
map</A> command can be used to do this.
</P>
<P>The "atom_modify sort 0 0.0" command should be used to turn off atom
sorting.
</P>
<P>NOTE: This sorting restriction will be removed in a future version of
NEB in LAMMPS.
</P>
<P>The minimizers in LAMMPS operate on all atoms in your system, even
non-NEB atoms, as defined above. To prevent non-NEB atoms from moving
during the minimization, you should use the <A HREF = "fix_setforce.html">fix
setforce</A> command to set the force on each of those
atoms to 0.0. This is not required, and may not even be desired in
some cases, but if those atoms move too far (e.g. because the initial
state of your system was not well-minimized), it can cause problems
for the NEB procedure.
</P>
<P>The damped dynamics <A HREF = "min_style.html">minimizers</A>, such as <I>quickmin</I>
and <I>fire</I>), adjust the position and velocity of the atoms via an
Euler integration step. Thus you must define an appropriate
<A HREF = "timestep.html">timestep</A> to use with NEB. Using the same timestep
that would be used for a dynamics <A HREF = "run.html">run</A> of your system is
advised.
</P>
<HR>
<P>The specified <I>filename</I> contains atom coordinates for the final
configuration. Only atoms with coordinates different than the initial
configuration need to be specified, i.e. those geometrically near the
barrier.
</P>
<P>The file can be ASCII text or a gzipped text file (detected by a .gz
suffix). The file should contain one line per atom, formatted
with the atom ID, followed by the final x,y,z coordinates:
</P>
<PRE>125 24.97311 1.69005 23.46956
126 1.94691 2.79640 1.92799
127 0.15906 3.46099 0.79121
...
</PRE>
<P>The lines can be listed in any order.
</P>
<HR>
<P>Four kinds of output can be generated during a NEB calculation: energy
barrier statistics, thermodynamic output by each replica, dump files,
and restart files.
</P>
<P>When running with multiple partitions (each of which is a replica in
this case), the print-out to the screen and master log.lammps file
contains a line of output, printed once every <I>Nevery</I> timesteps. It
contains the timestep, the maximum force per replica, the maximum
force per atom (in any replica), potential gradients in the initial,
final, and climbing replicas,
the forward and backward energy barriers,
the total reaction coordinate (RDT), and
the normalized reaction coordinate and potential energy of each replica.
</P>
<P>The "maximum force per replica" is
the two-norm of the 3N-length force vector for the atoms in each
replica, maximized across replicas, which is what the <I>ftol</I> setting
is checking against. In this case, N is all the atoms in each
replica. The "maximum force per atom" is the maximum force component
of any atom in any replica. The potential gradients are the two-norm
of the 3N-length force vector solely due to the interaction potential i.e.
without adding in inter-replica forces. Note that inter-replica forces
are zero in the initial and final replicas, and only affect
the direction in the climbing replica. For this reason, the "maximum
force per replica" is often equal to the potential gradient in the
climbing replica. In the first stage of NEB, there is no climbing
replica, and so the potential gradient in the highest energy replica
is reported, since this replica will become the climbing replica
in the second stage of NEB.
</P>
<P>The "reaction coordinate" (RD) for each
replica is the two-norm of the 3N-length vector of distances between
its atoms and the preceding replica's atoms, added to the RD of the
preceding replica. The RD of the first replica RD1 = 0.0;
the RD of the final replica RDN = RDT, the total reaction coordinate.
The normalized RDs are divided by RDT,
so that they form a monotonically increasing sequence
from zero to one. When computing RD, N only includes the atoms
being operated on by the fix neb command.
</P>
<P>The forward (reverse) energy barrier is the potential energy of the highest
replica minus the energy of the first (last) replica.
</P>
<P>When running on multiple partitions, LAMMPS produces additional log
files for each partition, e.g. log.lammps.0, log.lammps.1, etc. For a
NEB calculation, these contain the thermodynamic output for each
replica.
</P>
<P>If <A HREF = "dump.html">dump</A> commands in the input script define a filename
that includes a <I>universe</I> or <I>uloop</I> style <A HREF = "variable.html">variable</A>,
then one dump file (per dump command) will be created for each
replica. At the end of the NEB calculation, the final snapshot in
each file will contain the sequence of snapshots that transition the
system over the energy barrier. Earlier snapshots will show the
convergence of the replicas to the MEP.
</P>
<P>Likewise, <A HREF = "restart.html">restart</A> filenames can be specified with a
<I>universe</I> or <I>uloop</I> style <A HREF = "variable.html">variable</A>, to generate
restart files for each replica. These may be useful if the NEB
calculation fails to converge properly to the MEP, and you wish to
restart the calculation from an intermediate point with altered
parameters.
</P>
<P>There are 2 Python scripts provided in the tools/python directory,
neb_combine.py and neb_final.py, which are useful in analyzing output
from a NEB calculation. Assume a NEB simulation with M replicas, and
the NEB atoms labelled with a specific atom type.
</P>
<P>The neb_combine.py script extracts atom coords for the NEB atoms from
all M dump files and creates a single dump file where each snapshot
contains the NEB atoms from all the replicas and one copy of non-NEB
atoms from the first replica (presumed to be identical in other
replicas). This can be visualized/animated to see how the NEB atoms
relax as the NEB calculation proceeds.
</P>
<P>The neb_final.py script extracts the final snapshot from each of the M
dump files to create a single dump file with M snapshots. This can be
visualized to watch the system make its transition over the energy
barrier.
</P>
<P>To illustrate, here are images from the final snapshot produced by the
neb_combine.py script run on the dump files produced by the two
example input scripts in examples/neb. Click on them to see a larger
image.
</P>
<A HREF = "JPG/hop1.jpg"><IMG SRC = "JPG/hop1_small.jpg"></A>
<A HREF = "JPG/hop2.jpg"><IMG SRC = "JPG/hop2_small.jpg"></A>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This command can only be used if LAMMPS was built with the REPLICA
package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "prd.html">prd</A>, <A HREF = "temper.html">temper</A>, <A HREF = "fix_langevin.html">fix
langevin</A>, <A HREF = "fix_viscous.html">fix viscous</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Henkelman1"></A>
<P><B>(Henkelman1)</B> Henkelman and Jonsson, J Chem Phys, 113, 9978-9985 (2000).
</P>
<A NAME = "Henkelman2"></A>
<P><B>(Henkelman2)</B> Henkelman, Uberuaga, Jonsson, J Chem Phys, 113,
9901-9904 (2000).
</P>
<A NAME = "Nakano"></A>
<P><B>(Nakano)</B> Nakano, Comp Phys Comm, 178, 280-289 (2008).
</P>
</HTML>
diff --git a/doc/neb.txt b/doc/neb.txt
index 1965f2334..78c3a927b 100644
--- a/doc/neb.txt
+++ b/doc/neb.txt
@@ -1,324 +1,324 @@
"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
neb command :h3
[Syntax:]
neb etol ftol N1 N2 Nevery filename :pre
etol = stopping tolerance for energy (energy units)
ftol = stopping tolerance for force (force units)
N1 = max # of iterations (timesteps) to run initial NEB
N2 = max # of iterations (timesteps) to run barrier-climbing NEB
Nevery = print replica energies and reaction coordinates every this many timesteps
filename = file specifying final atom coordinates on other side of barrier :ul
[Examples:]
neb 0.1 0.0 1000 500 50 coords.final
neb 0.0 0.001 1000 500 50 coords.final :pre
[Description:]
Perform a nudged elastic band (NEB) calculation using multiple
replicas of a system. Two or more replicas must be used, two of which
are the end points of the transition path.
NEB is a method for finding both the atomic configurations and height
of the energy barrier associated with a transition state, e.g. for an
atom to perform a diffusive hop from one energy basin to another in a
coordinated fashion with its neighbors. The implementation in LAMMPS
follows the discussion in these 3 papers: "(Henkelman1)"_#Henkelman1,
"(Henkelman2)"_#Henkelman2, and "(Nakano)"_#Nakano.
Each replica runs on a partition of one or more processors. Processor
partitions are defined at run-time using the -partition command-line
-switch; see "this section"_Section_start.html#start_6 of the manual.
-Note that if you have MPI installed, you can run a multi-replica
-simulation with more replicas (partitions) than you have physical
-processors, e.g you can run a 10-replica simulation on one or two
-processors. You will simply not get the performance speed-up you
+switch; see "Section_start 6"_Section_start.html#start_6 of the
+manual. Note that if you have MPI installed, you can run a
+multi-replica simulation with more replicas (partitions) than you have
+physical processors, e.g you can run a 10-replica simulation on one or
+two processors. You will simply not get the performance speed-up you
would see with one or more physical processors per replica. See "this
section"_Section_howto.html#howto_5 of the manual for further
discussion.
NOTE: The current NEB implementation in LAMMPS restricts you to having
exactly one processor per replica.
When a NEB calculation is performed, it is assumed that each replica
is running the same model, though LAMMPS does not check for this.
I.e. the simulation domain, the number of atoms, the interaction
potentials, and the starting configuration when the neb command is
issued should be the same for every replica.
In a NEB calculation each atom in a replica is connected to the same
atom in adjacent replicas by springs, which induce inter-replica
forces. These forces are imposed by the "fix neb"_fix_neb.html
command, which must be used in conjunction with the neb command. The
group used to define the fix neb command specifies which atoms the
inter-replica springs are applied to. These are the NEB atoms.
Additional atoms can be present in your system, e.g. to provide a
background force field or simply to hold fixed during the NEB
procedure, but they will not be part of the barrier finding procedure.
The "starting configuration" for NEB should be a state with the NEB
atoms (and all other atoms) having coordinates on one side of the
energy barrier. These coordinates will be assigned to the first
replica #1. The coordinates should be close to a local energy
minimum. A perfect energy minimum is not required, since NEB runs via
damped dynamics which will tend to drive the configuration of replica
#1 to a true energy minimum, but you will typically get better
convergence if the initial state is already at a minimum. For
example, for a system with a free surface, the surface should be fully
relaxed before attempting a NEB calculation.
The final configuration is specified in the input {filename}, which is
formatted as described below. Only coordinates for NEB atoms or a
subset of them should be listed in the file; they represent the state
of the system on the other side of the barrier, at or near an energy
minimum. These coordinates will be assigned to the last replica #M.
The final coordinates of atoms not listed in {filename} are set equal
to their initial coordinates. Again, a perfect energy minimum is not
required for the final configuration, since the atoms in replica #M
will tend to move during the NEB procedure to the nearest energy
minimum. Also note that a final coordinate does not need to be
specified for a NEB atom if you expect it to only displace slightly
during the NEB procedure. For example, only the final coordinate of
the single atom diffusing into a vacancy need be specified if the
surrounding atoms will only relax slightly in the final configuration.
The initial coordinates of all atoms (not just NEB atoms) in the
intermediate replicas #2,#3,...,#M-1 are set to values linearly
interpolated between the corresponding atoms in replicas #1 and #M.
A NEB calculation has two stages, each of which is a minimization
procedure, performed via damped dynamics. To enable this, you must
first define an appropriate "min_style"_min_style.html, such as
{quickmin} or {fire}. The {cg}, {sd}, and {hftn} styles cannot be
used, since they perform iterative line searches in their inner loop,
which cannot be easily synchronized across multiple replicas.
The minimizer tolerances for energy and force are set by {etol} and {ftol},
the same as for
the "minimize"_minimize.html command.
A non-zero {etol}
means that the NEB calculation will terminate if the energy criterion is met
by every replica. The energies being compared to
{etol} do not include any contribution from the inter-replica forces, since
these are non-conservative.
A non-zero {ftol}
means that the NEB calculation will terminate if the force criterion is met
by every replica. The forces being compared to
{ftol} include the inter-replica forces between an atom and its images
in adjacent replicas.
The maximum number of iterations in each stage is set by {N1} and
{N2}. These are effectively timestep counts since each iteration of
damped dynamics is like a single timestep in a dynamics
"run"_run.html. During both stages, the potential energy of each
replica and its normalized distance along the reaction path (reaction
coordinate RD) will be printed to the screen and log file every
{Nevery} timesteps. The RD is 0 and 1 for the first and last replica.
For intermediate replicas, it is the cumulative distance (normalized
by the total cumulative distance) between adjacent replicas, where
"distance" is defined as the length of the 3N-vector of differences in
atomic coordinates, where N is the number of NEB atoms involved in the
transition. These outputs allow you to monitor NEB's progress in
finding a good energy barrier. {N1} and {N2} must both be multiples
of {Nevery}.
In the first stage of NEB, the set of replicas should converge toward
the minimum energy path (MEP) of conformational states that transition
over the barrier. The MEP for a barrier is defined as a sequence of
3N-dimensional states that cross the barrier at its saddle point, each
of which has a potential energy gradient parallel to the MEP itself.
The replica states will also be roughly equally spaced along the MEP
due to the inter-replica spring force added by the "fix
neb"_fix_neb.html command.
In the second stage of NEB, the replica with the highest energy
is selected and the inter-replica forces on it are converted to a
force that drives its atom coordinates to the top or saddle point of
the barrier, via the barrier-climbing calculation described in
"(Henkelman2)"_#Hinkelman2. As before, the other replicas rearrange
themselves along the MEP so as to be roughly equally spaced.
When both stages are complete, if the NEB calculation was successful,
one of the replicas should be an atomic configuration at the top or
saddle point of the barrier, the potential energies for the set of
replicas should represent the energy profile of the barrier along the
MEP, and the configurations of the replicas should be a sequence of
configurations along the MEP.
:line
A few other settings in your input script are required or advised to
perform a NEB calculation.
An atom map must be defined which it is not by default for "atom_style
atomic"_atom_style.html problems. The "atom_modify
map"_atom_modify.html command can be used to do this.
The "atom_modify sort 0 0.0" command should be used to turn off atom
sorting.
NOTE: This sorting restriction will be removed in a future version of
NEB in LAMMPS.
The minimizers in LAMMPS operate on all atoms in your system, even
non-NEB atoms, as defined above. To prevent non-NEB atoms from moving
during the minimization, you should use the "fix
setforce"_fix_setforce.html command to set the force on each of those
atoms to 0.0. This is not required, and may not even be desired in
some cases, but if those atoms move too far (e.g. because the initial
state of your system was not well-minimized), it can cause problems
for the NEB procedure.
The damped dynamics "minimizers"_min_style.html, such as {quickmin}
and {fire}), adjust the position and velocity of the atoms via an
Euler integration step. Thus you must define an appropriate
"timestep"_timestep.html to use with NEB. Using the same timestep
that would be used for a dynamics "run"_run.html of your system is
advised.
:line
The specified {filename} contains atom coordinates for the final
configuration. Only atoms with coordinates different than the initial
configuration need to be specified, i.e. those geometrically near the
barrier.
The file can be ASCII text or a gzipped text file (detected by a .gz
suffix). The file should contain one line per atom, formatted
with the atom ID, followed by the final x,y,z coordinates:
125 24.97311 1.69005 23.46956
126 1.94691 2.79640 1.92799
127 0.15906 3.46099 0.79121
... :pre
The lines can be listed in any order.
:line
Four kinds of output can be generated during a NEB calculation: energy
barrier statistics, thermodynamic output by each replica, dump files,
and restart files.
When running with multiple partitions (each of which is a replica in
this case), the print-out to the screen and master log.lammps file
contains a line of output, printed once every {Nevery} timesteps. It
contains the timestep, the maximum force per replica, the maximum
force per atom (in any replica), potential gradients in the initial,
final, and climbing replicas,
the forward and backward energy barriers,
the total reaction coordinate (RDT), and
the normalized reaction coordinate and potential energy of each replica.
The "maximum force per replica" is
the two-norm of the 3N-length force vector for the atoms in each
replica, maximized across replicas, which is what the {ftol} setting
is checking against. In this case, N is all the atoms in each
replica. The "maximum force per atom" is the maximum force component
of any atom in any replica. The potential gradients are the two-norm
of the 3N-length force vector solely due to the interaction potential i.e.
without adding in inter-replica forces. Note that inter-replica forces
are zero in the initial and final replicas, and only affect
the direction in the climbing replica. For this reason, the "maximum
force per replica" is often equal to the potential gradient in the
climbing replica. In the first stage of NEB, there is no climbing
replica, and so the potential gradient in the highest energy replica
is reported, since this replica will become the climbing replica
in the second stage of NEB.
The "reaction coordinate" (RD) for each
replica is the two-norm of the 3N-length vector of distances between
its atoms and the preceding replica's atoms, added to the RD of the
preceding replica. The RD of the first replica RD1 = 0.0;
the RD of the final replica RDN = RDT, the total reaction coordinate.
The normalized RDs are divided by RDT,
so that they form a monotonically increasing sequence
from zero to one. When computing RD, N only includes the atoms
being operated on by the fix neb command.
The forward (reverse) energy barrier is the potential energy of the highest
replica minus the energy of the first (last) replica.
When running on multiple partitions, LAMMPS produces additional log
files for each partition, e.g. log.lammps.0, log.lammps.1, etc. For a
NEB calculation, these contain the thermodynamic output for each
replica.
If "dump"_dump.html commands in the input script define a filename
that includes a {universe} or {uloop} style "variable"_variable.html,
then one dump file (per dump command) will be created for each
replica. At the end of the NEB calculation, the final snapshot in
each file will contain the sequence of snapshots that transition the
system over the energy barrier. Earlier snapshots will show the
convergence of the replicas to the MEP.
Likewise, "restart"_restart.html filenames can be specified with a
{universe} or {uloop} style "variable"_variable.html, to generate
restart files for each replica. These may be useful if the NEB
calculation fails to converge properly to the MEP, and you wish to
restart the calculation from an intermediate point with altered
parameters.
There are 2 Python scripts provided in the tools/python directory,
neb_combine.py and neb_final.py, which are useful in analyzing output
from a NEB calculation. Assume a NEB simulation with M replicas, and
the NEB atoms labelled with a specific atom type.
The neb_combine.py script extracts atom coords for the NEB atoms from
all M dump files and creates a single dump file where each snapshot
contains the NEB atoms from all the replicas and one copy of non-NEB
atoms from the first replica (presumed to be identical in other
replicas). This can be visualized/animated to see how the NEB atoms
relax as the NEB calculation proceeds.
The neb_final.py script extracts the final snapshot from each of the M
dump files to create a single dump file with M snapshots. This can be
visualized to watch the system make its transition over the energy
barrier.
To illustrate, here are images from the final snapshot produced by the
neb_combine.py script run on the dump files produced by the two
example input scripts in examples/neb. Click on them to see a larger
image.
:image(JPG/hop1_small.jpg,JPG/hop1.jpg)
:image(JPG/hop2_small.jpg,JPG/hop2.jpg)
:line
[Restrictions:]
This command can only be used if LAMMPS was built with the REPLICA
package. See the "Making LAMMPS"_Section_start.html#start_3 section
for more info on packages.
[Related commands:]
"prd"_prd.html, "temper"_temper.html, "fix
langevin"_fix_langevin.html, "fix viscous"_fix_viscous.html
[Default:] none
:line
:link(Henkelman1)
[(Henkelman1)] Henkelman and Jonsson, J Chem Phys, 113, 9978-9985 (2000).
:link(Henkelman2)
[(Henkelman2)] Henkelman, Uberuaga, Jonsson, J Chem Phys, 113,
9901-9904 (2000).
:link(Nakano)
[(Nakano)] Nakano, Comp Phys Comm, 178, 280-289 (2008).
diff --git a/doc/package.html b/doc/package.html
index 1d7254e15..124ae4732 100644
--- a/doc/package.html
+++ b/doc/package.html
@@ -1,269 +1,269 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>package command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>package style args
</PRE>
<UL><LI>style = <I>gpu</I> or <I>cuda</I> or <I>omp</I>
<LI>args = arguments specific to the style
<PRE> <I>gpu</I> args = mode first last split keyword value ...
mode = force or force/neigh
first = ID of first GPU to be used on each node
last = ID of last GPU to be used on each node
split = fraction of particles assigned to the GPU
zero or more keyword/value pairs may be appended
keywords = <I>threads_per_atom</I>
<I>threads_per_atom</I> value = Nthreads
Nthreads = # of GPU threads used per atom
<I>cuda</I> args = keyword value ...
one or more keyword/value pairs may be appended
keywords = <I>gpu/node</I> or <I>gpu/node/special</I> or <I>timing</I> or <I>test</I> or <I>override/bpa</I>
<I>gpu/node</I> value = N
N = number of GPUs to be used per node
<I>gpu/node/special</I> values = N gpu1 .. gpuN
N = number of GPUs to be used per node
gpu1 .. gpuN = N IDs of the GPUs to use
<I>timing</I> values = none
<I>test</I> values = id
id = atom-ID of a test particle
<I>override/bpa</I> values = flag
flag = 0 for TpA algorithm, 1 for BpA algorithm
<I>omp</I> args = Nthreads mode
Nthreads = # of OpenMP threads to associate with each MPI process
mode = force or force/neigh (optional)
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>package gpu force 0 0 1.0
package gpu force 0 0 0.75
package gpu force/neigh 0 0 1.0
package gpu force/neigh 0 1 -1.0
package cuda gpu/node/special 2 0 2
package cuda test 3948
package omp * force/neigh
package omp 4 force
</PRE>
<P><B>Description:</B>
</P>
<P>This command invokes package-specific settings. Currently the
following packages use it: GPU, USER-CUDA, and USER-OMP.
</P>
<P>To use the accelerated GPU and USER-OMP styles, the use of the package
command is required. However, as described in the "Defaults" section
below, if you use the "-sf gpu" or "-sf omp" <A HREF = "Section_start.html#start_6">command-line
options</A> to enable use of these styles,
then default package settings are enabled. In that case you only need
to use the package command if you want to change the defaults.
</P>
<P>To use the accelerate USER-CUDA styles, the package command is not
required as defaults are assigned internally. You only need to use
the package command if you want to change the defaults.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-details about using these various packages for accelerating LAMMPS
-calculations.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more details about using these various packages for accelerating
+LAMMPS calculations.
</P>
<HR>
<P>The <I>gpu</I> style invokes options associated with the use of the GPU
package.
</P>
<P>The <I>mode</I> setting specifies where neighbor list calculations will be
performed. If <I>mode</I> is force, neighbor list calculation is performed
on the CPU. If <I>mode</I> is force/neigh, neighbor list calculation is
performed on the GPU. GPU neighbor list calculation currently cannot
be used with a triclinic box. GPU neighbor list calculation currently
cannot be used with <A HREF = "pair_hybrid.html">hybrid</A> pair styles. GPU
neighbor lists are not compatible with styles that are not
GPU-enabled. When a non-GPU enabled style requires a neighbor list,
it will also be built using CPU routines. In these cases, it will
typically be more efficient to only use CPU neighbor list builds.
</P>
<P>The <I>first</I> and <I>last</I> settings specify the GPUs that will be used for
simulation. On each node, the GPU IDs in the inclusive range from
<I>first</I> to <I>last</I> will be used.
</P>
<P>The <I>split</I> setting can be used for load balancing force calculation
work between CPU and GPU cores in GPU-enabled pair styles. If 0 <
<I>split</I> < 1.0, a fixed fraction of particles is offloaded to the GPU
while force calculation for the other particles occurs simulataneously
on the CPU. If <I>split</I><0, the optimal fraction (based on CPU and GPU
timings) is calculated every 25 timesteps. If <I>split</I> = 1.0, all force
calculations for GPU accelerated pair styles are performed on the
GPU. In this case, <A HREF = "pair_hybrid.html">hybrid</A>, <A HREF = "bond_style.html">bond</A>,
<A HREF = "angle_style.html">angle</A>, <A HREF = "dihedral_style.html">dihedral</A>,
<A HREF = "improper_style.html">improper</A>, and <A HREF = "kspace_style.html">long-range</A>
calculations can be performed on the CPU while the GPU is performing
force calculations for the GPU-enabled pair style. If all CPU force
computations complete before the GPU, LAMMPS will block until the GPU
has finished before continuing the timestep.
</P>
<P>As an example, if you have two GPUs per node and 8 CPU cores per node,
and would like to run on 4 nodes (32 cores) with dynamic balancing of
force calculation across CPU and GPU cores, you could specify
</P>
<PRE>package gpu force/neigh 0 1 -1
</PRE>
<P>In this case, all CPU cores and GPU devices on the nodes would be
utilized. Each GPU device would be shared by 4 CPU cores. The CPU
cores would perform force calculations for some fraction of the
particles at the same time the GPUs performed force calculation for
the other particles.
</P>
<P>The <I>threads_per_atom</I> keyword allows control of the number of GPU
threads used per-atom to perform the short range force calculation.
By default, the value will be chosen based on the pair style, however,
the value can be set with this keyword to fine-tune performance. For
large cutoffs or with a small number of particles per GPU, increasing
the value can improve performance. The number of threads per atom must
be a power of 2 and currently cannot be greater than 32.
</P>
<HR>
<P>The <I>cuda</I> style invokes options associated with the use of the
USER-CUDA package.
</P>
<P>The <I>gpu/node</I> keyword specifies the number <I>N</I> of GPUs to be used on
each node. An MPI process with rank <I>K</I> will use the GPU (K mod N).
This implies that processes should be assigned with successive ranks
on each node, which is the default with most (or even all) MPI
implementations. The default value for <I>N</I> is 2.
</P>
<P>The <I>gpu/node/special</I> keyword also specifies the number (N) of GPUs
to be used on each node, but allows more control over their
specification. An MPI process with rank <I>K</I> will use the GPU <I>gpuI</I>
with l = (K mod N) + 1. This implies that processes should be assigned
with successive ranks on each node, which is the default with most (or
even all) MPI implementations. For example if you have three GPUs on
a machine, one of which is used for the X-Server (the GPU with the ID
1) while the others (with IDs 0 and 2) are used for computations you
would specify:
</P>
<PRE>package cuda gpu/node/special 2 0 2
</PRE>
<P>A main purpose of the <I>gpu/node/special</I> optoin is to allow two (or
more) simulations to be run on one workstation. In that case one
would set the first simulation to use GPU 0 and the second to use GPU
1. This is not necessary though, if the GPUs are in what is called
<I>compute exclusive</I> mode. Using that setting, every process will get
its own GPU automatically. This <I>compute exclusive</I> mode can be set
as root using the <I>nvidia-smi</I> tool which is part of the CUDA
installation.
</P>
<P>Note that if the <I>gpu/node/special</I> keyword is not used, the USER-CUDA
package sorts existing GPUs on each node according to their number of
multiprocessors. This way, compute GPUs will be priorized over
X-Server GPUs.
</P>
<P>Use of the <I>timing</I> keyword will output detailed timing information
for various subroutines.
</P>
<P>The <I>test</I> keyword will output info for the the specified atom at
several points during each time step. This is mainly usefull for
debugging purposes. Note that the simulation will be severly slowed
down if this option is used.
</P>
<P>The <I>override/bpa</I> keyword can be used to specify which mode is used
for pair-force evaluation. TpA = one thread per atom; BpA = one block
per atom. If this keyword is not used, a short test at the begin of
each run will determine which method is more effective (the result of
this test is part of the LAMMPS output). Therefore it is usually not
necessary to use this keyword.
</P>
<HR>
<P>The <I>omp</I> style invokes options associated with the use of the
USER-OMP package.
</P>
<P>The first argument allows to explicitly set the number of OpenMP
threads to be allocated for each MPI process. For example, if your
system has nodes with dual quad-core processors, it has a total of 8
cores per node. You could run MPI on 2 cores on each node (e.g. using
options for the mpirun command), and set the <I>Nthreads</I> setting to 4.
This would effectively use all 8 cores on each node. Since each MPI
process would spawn 4 threads (one of which runs as part of the MPI
process itself).
</P>
<P>For performance reasons, you should not set <I>Nthreads</I> to more threads
than there are physical cores (per MPI task), but LAMMPS cannot check
for this.
</P>
<P>An <I>Nthreads</I> value of '*' instructs LAMMPS to use whatever is the
default for the given OpenMP environment. This is usually determined
via the <I>OMP_NUM_THREADS</I> environment variable or the compiler
runtime. Please note that in most cases the default for OpenMP
capable compilers is to use one thread for each available CPU core
when <I>OMP_NUM_THREADS</I> is not set, which can lead to extremely bad
performance.
</P>
<P>Which combination of threads and MPI tasks gives the best performance
is difficult to predict and can depend on many components of your input.
Not all features of LAMMPS support OpenMP and the parallel efficiency
can be very different, too.
</P>
<P>The <I>mode</I> setting specifies where neighbor list calculations will be
multi-threaded as well. If <I>mode</I> is force, neighbor list calculation
is performed in serial. If <I>mode</I> is force/neigh, a multi-threaded
neighbor list build is used. Using the force/neigh setting is almost
always faster and should produce idential neighbor lists at the
expense of using some more memory (neighbor list pages are always
allocated for all threads at the same time and each thread works on
its own pages).
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This command cannot be used after the simulation box is defined by a
<A HREF = "read_data.html">read_data</A> or <A HREF = "create_box.html">create_box</A> command.
</P>
<P>The cuda style of this command can only be invoked if LAMMPS was built
with the USER-CUDA package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>The gpu style of this command can only be invoked if LAMMPS was built
with the GPU package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>The omp style of this command can only be invoked if LAMMPS was built
with the USER-OMP package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "suffix.html">suffix</A>
</P>
<P><B>Default:</B>
</P>
<P>If the "-sf gpu" <A HREF = "Section_start.html#start_6">command-line switch</A> is
used then it is as if the command "package gpu force/neigh 0 0 1" were
invoked, to specify default settings for the GPU package. If the
command-line switch is not used, then no defaults are set, and you
must specify the appropriate package command in your input script.
</P>
<P>The default settings for the USER CUDA package are "package cuda gpu
2". This is the case whether the "-sf cuda" <A HREF = "Section_start.html#start_6">command-line
switch</A> is used or not.
</P>
<P>If the "-sf omp" <A HREF = "Section_start.html#start_6">command-line switch</A> is
used then it is as if the command "package omp *" were invoked, to
specify default settings for the USER-OMP package. If the
command-line switch is not used, then no defaults are set, and you
must specify the appropriate package command in your input script.
</P>
</HTML>
diff --git a/doc/package.txt b/doc/package.txt
index e561100a3..c8b30217a 100644
--- a/doc/package.txt
+++ b/doc/package.txt
@@ -1,262 +1,262 @@
"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
package command :h3
[Syntax:]
package style args :pre
style = {gpu} or {cuda} or {omp} :ulb,l
args = arguments specific to the style :l
{gpu} args = mode first last split keyword value ...
mode = force or force/neigh
first = ID of first GPU to be used on each node
last = ID of last GPU to be used on each node
split = fraction of particles assigned to the GPU
zero or more keyword/value pairs may be appended
keywords = {threads_per_atom}
{threads_per_atom} value = Nthreads
Nthreads = # of GPU threads used per atom
{cuda} args = keyword value ...
one or more keyword/value pairs may be appended
keywords = {gpu/node} or {gpu/node/special} or {timing} or {test} or {override/bpa}
{gpu/node} value = N
N = number of GPUs to be used per node
{gpu/node/special} values = N gpu1 .. gpuN
N = number of GPUs to be used per node
gpu1 .. gpuN = N IDs of the GPUs to use
{timing} values = none
{test} values = id
id = atom-ID of a test particle
{override/bpa} values = flag
flag = 0 for TpA algorithm, 1 for BpA algorithm
{omp} args = Nthreads mode
Nthreads = # of OpenMP threads to associate with each MPI process
mode = force or force/neigh (optional) :pre
:ule
[Examples:]
package gpu force 0 0 1.0
package gpu force 0 0 0.75
package gpu force/neigh 0 0 1.0
package gpu force/neigh 0 1 -1.0
package cuda gpu/node/special 2 0 2
package cuda test 3948
package omp * force/neigh
package omp 4 force :pre
[Description:]
This command invokes package-specific settings. Currently the
following packages use it: GPU, USER-CUDA, and USER-OMP.
To use the accelerated GPU and USER-OMP styles, the use of the package
command is required. However, as described in the "Defaults" section
below, if you use the "-sf gpu" or "-sf omp" "command-line
options"_Section_start.html#start_6 to enable use of these styles,
then default package settings are enabled. In that case you only need
to use the package command if you want to change the defaults.
To use the accelerate USER-CUDA styles, the package command is not
required as defaults are assigned internally. You only need to use
the package command if you want to change the defaults.
-See "this section"_Section_accelerate.html of the manual for more
-details about using these various packages for accelerating LAMMPS
-calculations.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more details about using these various packages for accelerating
+LAMMPS calculations.
:line
The {gpu} style invokes options associated with the use of the GPU
package.
The {mode} setting specifies where neighbor list calculations will be
performed. If {mode} is force, neighbor list calculation is performed
on the CPU. If {mode} is force/neigh, neighbor list calculation is
performed on the GPU. GPU neighbor list calculation currently cannot
be used with a triclinic box. GPU neighbor list calculation currently
cannot be used with "hybrid"_pair_hybrid.html pair styles. GPU
neighbor lists are not compatible with styles that are not
GPU-enabled. When a non-GPU enabled style requires a neighbor list,
it will also be built using CPU routines. In these cases, it will
typically be more efficient to only use CPU neighbor list builds.
The {first} and {last} settings specify the GPUs that will be used for
simulation. On each node, the GPU IDs in the inclusive range from
{first} to {last} will be used.
The {split} setting can be used for load balancing force calculation
work between CPU and GPU cores in GPU-enabled pair styles. If 0 <
{split} < 1.0, a fixed fraction of particles is offloaded to the GPU
while force calculation for the other particles occurs simulataneously
on the CPU. If {split}<0, the optimal fraction (based on CPU and GPU
timings) is calculated every 25 timesteps. If {split} = 1.0, all force
calculations for GPU accelerated pair styles are performed on the
GPU. In this case, "hybrid"_pair_hybrid.html, "bond"_bond_style.html,
"angle"_angle_style.html, "dihedral"_dihedral_style.html,
"improper"_improper_style.html, and "long-range"_kspace_style.html
calculations can be performed on the CPU while the GPU is performing
force calculations for the GPU-enabled pair style. If all CPU force
computations complete before the GPU, LAMMPS will block until the GPU
has finished before continuing the timestep.
As an example, if you have two GPUs per node and 8 CPU cores per node,
and would like to run on 4 nodes (32 cores) with dynamic balancing of
force calculation across CPU and GPU cores, you could specify
package gpu force/neigh 0 1 -1 :pre
In this case, all CPU cores and GPU devices on the nodes would be
utilized. Each GPU device would be shared by 4 CPU cores. The CPU
cores would perform force calculations for some fraction of the
particles at the same time the GPUs performed force calculation for
the other particles.
The {threads_per_atom} keyword allows control of the number of GPU
threads used per-atom to perform the short range force calculation.
By default, the value will be chosen based on the pair style, however,
the value can be set with this keyword to fine-tune performance. For
large cutoffs or with a small number of particles per GPU, increasing
the value can improve performance. The number of threads per atom must
be a power of 2 and currently cannot be greater than 32.
:line
The {cuda} style invokes options associated with the use of the
USER-CUDA package.
The {gpu/node} keyword specifies the number {N} of GPUs to be used on
each node. An MPI process with rank {K} will use the GPU (K mod N).
This implies that processes should be assigned with successive ranks
on each node, which is the default with most (or even all) MPI
implementations. The default value for {N} is 2.
The {gpu/node/special} keyword also specifies the number (N) of GPUs
to be used on each node, but allows more control over their
specification. An MPI process with rank {K} will use the GPU {gpuI}
with l = (K mod N) + 1. This implies that processes should be assigned
with successive ranks on each node, which is the default with most (or
even all) MPI implementations. For example if you have three GPUs on
a machine, one of which is used for the X-Server (the GPU with the ID
1) while the others (with IDs 0 and 2) are used for computations you
would specify:
package cuda gpu/node/special 2 0 2 :pre
A main purpose of the {gpu/node/special} optoin is to allow two (or
more) simulations to be run on one workstation. In that case one
would set the first simulation to use GPU 0 and the second to use GPU
1. This is not necessary though, if the GPUs are in what is called
{compute exclusive} mode. Using that setting, every process will get
its own GPU automatically. This {compute exclusive} mode can be set
as root using the {nvidia-smi} tool which is part of the CUDA
installation.
Note that if the {gpu/node/special} keyword is not used, the USER-CUDA
package sorts existing GPUs on each node according to their number of
multiprocessors. This way, compute GPUs will be priorized over
X-Server GPUs.
Use of the {timing} keyword will output detailed timing information
for various subroutines.
The {test} keyword will output info for the the specified atom at
several points during each time step. This is mainly usefull for
debugging purposes. Note that the simulation will be severly slowed
down if this option is used.
The {override/bpa} keyword can be used to specify which mode is used
for pair-force evaluation. TpA = one thread per atom; BpA = one block
per atom. If this keyword is not used, a short test at the begin of
each run will determine which method is more effective (the result of
this test is part of the LAMMPS output). Therefore it is usually not
necessary to use this keyword.
:line
The {omp} style invokes options associated with the use of the
USER-OMP package.
The first argument allows to explicitly set the number of OpenMP
threads to be allocated for each MPI process. For example, if your
system has nodes with dual quad-core processors, it has a total of 8
cores per node. You could run MPI on 2 cores on each node (e.g. using
options for the mpirun command), and set the {Nthreads} setting to 4.
This would effectively use all 8 cores on each node. Since each MPI
process would spawn 4 threads (one of which runs as part of the MPI
process itself).
For performance reasons, you should not set {Nthreads} to more threads
than there are physical cores (per MPI task), but LAMMPS cannot check
for this.
An {Nthreads} value of '*' instructs LAMMPS to use whatever is the
default for the given OpenMP environment. This is usually determined
via the {OMP_NUM_THREADS} environment variable or the compiler
runtime. Please note that in most cases the default for OpenMP
capable compilers is to use one thread for each available CPU core
when {OMP_NUM_THREADS} is not set, which can lead to extremely bad
performance.
Which combination of threads and MPI tasks gives the best performance
is difficult to predict and can depend on many components of your input.
Not all features of LAMMPS support OpenMP and the parallel efficiency
can be very different, too.
The {mode} setting specifies where neighbor list calculations will be
multi-threaded as well. If {mode} is force, neighbor list calculation
is performed in serial. If {mode} is force/neigh, a multi-threaded
neighbor list build is used. Using the force/neigh setting is almost
always faster and should produce idential neighbor lists at the
expense of using some more memory (neighbor list pages are always
allocated for all threads at the same time and each thread works on
its own pages).
:line
[Restrictions:]
This command cannot be used after the simulation box is defined by a
"read_data"_read_data.html or "create_box"_create_box.html command.
The cuda style of this command can only be invoked if LAMMPS was built
with the USER-CUDA package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
The gpu style of this command can only be invoked if LAMMPS was built
with the GPU package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
The omp style of this command can only be invoked if LAMMPS was built
with the USER-OMP package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"suffix"_suffix.html
[Default:]
If the "-sf gpu" "command-line switch"_Section_start.html#start_6 is
used then it is as if the command "package gpu force/neigh 0 0 1" were
invoked, to specify default settings for the GPU package. If the
command-line switch is not used, then no defaults are set, and you
must specify the appropriate package command in your input script.
The default settings for the USER CUDA package are "package cuda gpu
2". This is the case whether the "-sf cuda" "command-line
switch"_Section_start.html#start_6 is used or not.
If the "-sf omp" "command-line switch"_Section_start.html#start_6 is
used then it is as if the command "package omp *" were invoked, to
specify default settings for the USER-OMP package. If the
command-line switch is not used, then no defaults are set, and you
must specify the appropriate package command in your input script.
diff --git a/doc/pair_adp.html b/doc/pair_adp.html
index 34bf49422..230d469cd 100644
--- a/doc/pair_adp.html
+++ b/doc/pair_adp.html
@@ -1,187 +1,187 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style adp command
</H3>
<H3>pair_style adp/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style adp
</PRE>
<P><B>Examples:</B>
</P>
<PRE>pair_style adp
pair_coeff * * Ta.adp Ta
pair_coeff * * ../potentials/AlCu.adp Al Al Cu
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>adp</I> computes pairwise interactions for metals and metal alloys
using the angular dependent potential (ADP) of <A HREF = "#Mishin">(Mishin)</A>,
which is a generalization of the <A HREF = "pair_eam.html">embedded atom method (EAM)
potential</A>. The LAMMPS implementation is discussed in
<A HREF = "#Singh">(Singh)</A>. The total energy Ei of an atom I is given by
</P>
<CENTER><IMG SRC = "Eqs/pair_adp.jpg">
</CENTER>
<P>where F is the embedding energy which is a function of the atomic
electron density rho, phi is a pair potential interaction, alpha and
beta are the element types of atoms I and J, and s and t = 1,2,3 and
refer to the cartesian coordinates. The mu and lambda terms represent
the dipole and quadruple distortions of the local atomic environment
which extend the original EAM framework by introducing angular forces.
</P>
<P>Note that unlike for other potentials, cutoffs for ADP potentials are
not set in the pair_style or pair_coeff command; they are specified in
the ADP potential files themselves. Likewise, the ADP potential files
list atomic masses; thus you do not need to use the <A HREF = "mass.html">mass</A>
command to specify them.
</P>
<P>The NIST WWW site distributes and documents ADP potentials:
</P>
<PRE>http://www.ctcms.nist.gov/potentials
</PRE>
<P>Note that these must be converted into the extended DYNAMO <I>setfl</I>
format discussed below.
</P>
<P>The NIST site is maintained by Chandler Becker (cbecker at nist.gov)
who is good resource for info on interatomic potentials and file
formats.
</P>
<HR>
<P>Only a single pair_coeff command is used with the <I>adp</I> style which
specifies an extended DYNAMO <I>setfl</I> file, which contains information
for M elements. These are mapped to LAMMPS atom types by specifying N
additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
</P>
<UL><LI>filename
<LI>N element names = mapping of extended <I>setfl</I> elements to atom types
</UL>
<P>As an example, the potentials/AlCu.adp file, included in the
potentials directory of the LAMMPS distrbution, is an extended <I>setfl</I>
file which has tabulated ADP values for w elements and their alloy
interactions: Cu and Al. If your LAMMPS simulation has 4 atoms types
and you want the 1st 3 to be Al, and the 4th to be Cu, you would use
the following pair_coeff command:
</P>
<PRE>pair_coeff * * AlCu.adp Al Al Al Cu
</PRE>
<P>The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three Al arguments map LAMMPS atom types 1,2,3 to the Al
element in the extended <I>setfl</I> file. The final Cu argument maps
LAMMPS atom type 4 to the Al element in the extended <I>setfl</I> file.
Note that there is no requirement that your simulation use all the
elements specified by the extended <I>setfl</I> file.
</P>
<P>If a mapping value is specified as NULL, the mapping is not performed.
This can be used when an <I>adp</I> potential is used as part of the
<I>hybrid</I> pair style. The NULL values are placeholders for atom types
that will be used with other potentials.
</P>
<P><I>Adp</I> files in the <I>potentials</I> directory of the LAMMPS distribution
have an ".adp" suffix. A DYNAMO <I>setfl</I> file extended for ADP is
formatted as follows. Basically it is the standard <I>setfl</I> format
with additional tabulated functions u and w added to the file after
the tabulated pair potentials. See the <A HREF = "pair_eam.html">pair_eam</A>
command for further details on the <I>setfl</I> format.
</P>
<UL><LI>lines 1,2,3 = comments (ignored)
<LI>line 4: Nelements Element1 Element2 ... ElementN
<LI>line 5: Nrho, drho, Nr, dr, cutoff
</UL>
<P>Following the 5 header lines are Nelements sections, one for each
element, each with the following format:
</P>
<UL><LI>line 1 = atomic number, mass, lattice constant, lattice type (e.g. FCC)
<LI>embedding function F(rho) (Nrho values)
<LI>density function rho(r) (Nr values)
</UL>
<P>Following the Nelements sections, Nr values for each pair potential
phi(r) array are listed for all i,j element pairs in the same format
as other arrays. Since these interactions are symmetric (i,j = j,i)
only phi arrays with i >= j are listed, in the following order: i,j =
(1,1), (2,1), (2,2), (3,1), (3,2), (3,3), (4,1), ..., (Nelements,
Nelements).
</P>
<P>After the phi(r) arrays, each of the u(r) arrays are listed in the
same order with the same assumptions of symmetry. Directly following
the u(r), the w(r) arrays are listed.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, no special mixing rules are needed, since
the ADP potential files specify alloy interactions explicitly.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift, table, and tail options.
</P>
<P>This pair style does not write its information to <A HREF = "restart.html">binary restart
files</A>, since it is stored in tabulated potential files.
Thus, you need to re-specify the pair_style and pair_coeff commands in
an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package (which it is by default).
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "pair_eam.html">pair_eam</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Mishin"></A>
<P><B>(Mishin)</B> Mishin, Mehl, and Papaconstantopoulos, Acta Mater, 53, 4029
(2005).
</P>
<A NAME = "Singh"></A>
<P><B>(Singh)</B> Singh and Warner, Acta Mater, 58, 5797-5805 (2010),
</P>
</HTML>
diff --git a/doc/pair_adp.txt b/doc/pair_adp.txt
index 4eef1d675..4909d738b 100644
--- a/doc/pair_adp.txt
+++ b/doc/pair_adp.txt
@@ -1,179 +1,179 @@
"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 adp command :h3
pair_style adp/omp command :h3
[Syntax:]
pair_style adp :pre
[Examples:]
pair_style adp
pair_coeff * * Ta.adp Ta
pair_coeff * * ../potentials/AlCu.adp Al Al Cu :pre
[Description:]
Style {adp} computes pairwise interactions for metals and metal alloys
using the angular dependent potential (ADP) of "(Mishin)"_#Mishin,
which is a generalization of the "embedded atom method (EAM)
potential"_pair_eam.html. The LAMMPS implementation is discussed in
"(Singh)"_#Singh. The total energy Ei of an atom I is given by
:c,image(Eqs/pair_adp.jpg)
where F is the embedding energy which is a function of the atomic
electron density rho, phi is a pair potential interaction, alpha and
beta are the element types of atoms I and J, and s and t = 1,2,3 and
refer to the cartesian coordinates. The mu and lambda terms represent
the dipole and quadruple distortions of the local atomic environment
which extend the original EAM framework by introducing angular forces.
Note that unlike for other potentials, cutoffs for ADP potentials are
not set in the pair_style or pair_coeff command; they are specified in
the ADP potential files themselves. Likewise, the ADP potential files
list atomic masses; thus you do not need to use the "mass"_mass.html
command to specify them.
The NIST WWW site distributes and documents ADP potentials:
http://www.ctcms.nist.gov/potentials :pre
Note that these must be converted into the extended DYNAMO {setfl}
format discussed below.
The NIST site is maintained by Chandler Becker (cbecker at nist.gov)
who is good resource for info on interatomic potentials and file
formats.
:line
Only a single pair_coeff command is used with the {adp} style which
specifies an extended DYNAMO {setfl} file, which contains information
for M elements. These are mapped to LAMMPS atom types by specifying N
additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
filename
N element names = mapping of extended {setfl} elements to atom types :ul
As an example, the potentials/AlCu.adp file, included in the
potentials directory of the LAMMPS distrbution, is an extended {setfl}
file which has tabulated ADP values for w elements and their alloy
interactions: Cu and Al. If your LAMMPS simulation has 4 atoms types
and you want the 1st 3 to be Al, and the 4th to be Cu, you would use
the following pair_coeff command:
pair_coeff * * AlCu.adp Al Al Al Cu :pre
The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three Al arguments map LAMMPS atom types 1,2,3 to the Al
element in the extended {setfl} file. The final Cu argument maps
LAMMPS atom type 4 to the Al element in the extended {setfl} file.
Note that there is no requirement that your simulation use all the
elements specified by the extended {setfl} file.
If a mapping value is specified as NULL, the mapping is not performed.
This can be used when an {adp} potential is used as part of the
{hybrid} pair style. The NULL values are placeholders for atom types
that will be used with other potentials.
{Adp} files in the {potentials} directory of the LAMMPS distribution
have an ".adp" suffix. A DYNAMO {setfl} file extended for ADP is
formatted as follows. Basically it is the standard {setfl} format
with additional tabulated functions u and w added to the file after
the tabulated pair potentials. See the "pair_eam"_pair_eam.html
command for further details on the {setfl} format.
lines 1,2,3 = comments (ignored)
line 4: Nelements Element1 Element2 ... ElementN
line 5: Nrho, drho, Nr, dr, cutoff :ul
Following the 5 header lines are Nelements sections, one for each
element, each with the following format:
line 1 = atomic number, mass, lattice constant, lattice type (e.g. FCC)
embedding function F(rho) (Nrho values)
density function rho(r) (Nr values) :ul
Following the Nelements sections, Nr values for each pair potential
phi(r) array are listed for all i,j element pairs in the same format
as other arrays. Since these interactions are symmetric (i,j = j,i)
only phi arrays with i >= j are listed, in the following order: i,j =
(1,1), (2,1), (2,2), (3,1), (3,2), (3,3), (4,1), ..., (Nelements,
Nelements).
After the phi(r) arrays, each of the u(r) arrays are listed in the
same order with the same assumptions of symmetry. Directly following
the u(r), the w(r) arrays are listed.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, no special mixing rules are needed, since
the ADP potential files specify alloy interactions explicitly.
This pair style does not support the "pair_modify"_pair_modify.html
shift, table, and tail options.
This pair style does not write its information to "binary restart
files"_restart.html, since it is stored in tabulated potential files.
Thus, you need to re-specify the pair_style and pair_coeff commands 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 pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package (which it is by default).
[Related commands:]
"pair_coeff"_pair_coeff.html, "pair_eam"_pair_eam.html
[Default:] none
:line
:link(Mishin)
[(Mishin)] Mishin, Mehl, and Papaconstantopoulos, Acta Mater, 53, 4029
(2005).
:link(Singh)
[(Singh)] Singh and Warner, Acta Mater, 58, 5797-5805 (2010),
diff --git a/doc/pair_airebo.html b/doc/pair_airebo.html
index 282e1affb..8bc7126e0 100644
--- a/doc/pair_airebo.html
+++ b/doc/pair_airebo.html
@@ -1,197 +1,197 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style airebo command
</H3>
<H3>pair_style airebo/omp command
</H3>
<H3>pair_style rebo command
</H3>
<H3>pair_style rebo/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style cutoff LJ_flag TORSION_flag
</PRE>
<UL><LI>style = <I>airebo</I> or <I>rebo</I>
<LI>cutoff = LJ cutoff (sigma scale factor) (AIREBO only)
<LI>LJ_flag = 0/1 to turn off/on the LJ term (AIREBO only, optional)
<LI>TORSION_flag = 0/1 to turn off/on the torsion term (AIREBO only, optional)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style airebo 3.0
pair_style airebo 2.5 1 0
pair_coeff * * ../potentials/CH.airebo H C
</PRE>
<PRE>pair_style rebo
pair_coeff * * ../potentials/CH.airebo H C
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>airebo</I> pair style computes the Adaptive Intermolecular Reactive
Empirical Bond Order (AIREBO) Potential of <A HREF = "#Stuart">(Stuart)</A> for a
system of carbon and/or hydrogen atoms. Note that this is the initial
formulation of AIREBO from 2000, not the later formulation. The
<I>rebo</I> pair style computes the Reactive Empirical Bond Order (REBO)
Potential of <A HREF = "#Brenner">(Brenner)</A>. Note that this is the so-called
2nd generation REBO from 2002, not the original REBO from 1990. As
discussed below, 2nd generation REBO is closely related to the intial
AIREBO; it is just a subset of the potential energy terms.
</P>
<P>The AIREBO potential consists of three terms:
</P>
<CENTER><IMG SRC = "Eqs/pair_airebo.jpg">
</CENTER>
<P>By default, all three terms are included. For the <I>airebo</I> style, if
the two optional flag arguments to the pair_style command are
included, the LJ and torsional terms can be turned off. Note that
both or neither of the flags must be included. If both of the LJ an
torsional terms are turned off, it becomes the 2nd-generation REBO
potential, with a small caveat on the spline fitting procedure
mentioned below. This can be specified directly as pair_style rebo
with no additional arguments.
</P>
<P>The detailed formulas for this potential are given in
<A HREF = "#Stuart">(Stuart)</A>; here we provide only a brief description.
</P>
<P>The E_REBO term has the same functional form as the hydrocarbon REBO
potential developed in <A HREF = "#Brenner">(Brenner)</A>. The coefficients for
E_REBO in AIREBO are essentially the same as Brenner's potential, but
a few fitted spline values are slightly different. For most cases the
E_REBO term in AIREBO will produce the same energies, forces and
statistical averages as the original REBO potential from which it was
derived. The E_REBO term in the AIREBO potential gives the model its
reactive capabilities and only describes short-ranged C-C, C-H and H-H
interactions (r < 2 Angstroms). These interactions have strong
coordination-dependence through a bond order parameter, which adjusts
the attraction between the I,J atoms based on the position of other
nearby atoms and thus has 3- and 4-body dependence.
</P>
<P>The E_LJ term adds longer-ranged interactions (2 < r < cutoff) using a
form similar to the standard <A HREF = "pair_lj.html">Lennard Jones potential</A>.
The E_LJ term in AIREBO contains a series of switching functions so
that the short-ranged LJ repulsion (1/r^12) does not interfere with
the energetics captured by the E_REBO term. The extent of the E_LJ
interactions is determined by the <I>cutoff</I> argument to the pair_style
command which is a scale factor. For each type pair (C-C, C-H, H-H)
the cutoff is obtained by multiplying the scale factor by the sigma
value defined in the potential file for that type pair. In the
standard AIREBO potential, sigma_CC = 3.4 Angstroms, so with a scale
factor of 3.0 (the argument in pair_style), the resulting E_LJ cutoff
would be 10.2 Angstroms.
</P>
<P>The E_TORSION term is an explicit 4-body potential that describes
various dihedral angle preferences in hydrocarbon configurations.
</P>
<P>Only a single pair_coeff command is used with the <I>airebo</I> or <I>rebo</I>
style which specifies an AIREBO potential file with parameters for C
and H. Note that the <I>rebo</I> style in LAMMPS uses the same
AIREBO-formatted potential file. These are mapped to LAMMPS atom
types by specifying N additional arguments after the filename in the
pair_coeff command, where N is the number of LAMMPS atom types:
</P>
<UL><LI>filename
<LI>N element names = mapping of AIREBO elements to atom types
</UL>
<P>As an example, if your LAMMPS simulation has 4 atom types and you want
the 1st 3 to be C, and the 4th to be H, you would use the following
pair_coeff command:
</P>
<PRE>pair_coeff * * CH.airebo C C C H
</PRE>
<P>The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three C arguments map LAMMPS atom types 1,2,3 to the C
element in the AIREBO file. The final H argument maps LAMMPS atom
type 4 to the H element in the SW file. If a mapping value is
specified as NULL, the mapping is not performed. This can be used
when a <I>airebo</I> potential is used as part of the <I>hybrid</I> pair style.
The NULL values are placeholders for atom types that will be used with
other potentials.
</P>
<P>The parameters/coefficients for the AIREBO potentials are listed in
the CH.airebo file to agree with the original <A HREF = "#Stuart">(Stuart)</A>
paper. Thus the parameters are specific to this potential and the way
it was fit, so modifying the file should be done cautiously.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>These pair styles do not support the <A HREF = "pair_modify.html">pair_modify</A>
mix, shift, table, and tail options.
</P>
<P>These pair styles do not write their information to <A HREF = "restart.html">binary restart
files</A>, since it is stored in potential files. Thus, you
need to re-specify the pair_style and pair_coeff commands in an input
script that reads a restart file.
</P>
<P>These pair styles can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. They do not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<P><B>Restrictions:</B>
</P>
<P>These pair styles are part of the MANYBODY package. They are only
enabled if LAMMPS was built with that package (which it is by
default). See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info.
</P>
<P>These pair potentials require the <A HREF = "newton.html">newton</A> setting to be
"on" for pair interactions.
</P>
<P>The CH.airebo potential file provided with LAMMPS (see the potentials
directory) is parameterized for metal <A HREF = "units.html">units</A>. You can use
the AIREBO or REBO potential with any LAMMPS units, but you would need
to create your own AIREBO potential file with coefficients listed in
the appropriate units if your simulation doesn't use "metal" units.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Stuart"></A>
<P><B>(Stuart)</B> Stuart, Tutein, Harrison, J Chem Phys, 112, 6472-6486
(2000).
</P>
<A NAME = "Brenner"></A>
<P><B>(Brenner)</B> Brenner, Shenderova, Harrison, Stuart, Ni, Sinnott, J
Physics: Condensed Matter, 14, 783-802 (2002).
</P>
</HTML>
diff --git a/doc/pair_airebo.txt b/doc/pair_airebo.txt
index 71c7ea071..8239d42a3 100644
--- a/doc/pair_airebo.txt
+++ b/doc/pair_airebo.txt
@@ -1,187 +1,187 @@
"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 airebo command :h3
pair_style airebo/omp command :h3
pair_style rebo command :h3
pair_style rebo/omp command :h3
[Syntax:]
pair_style style cutoff LJ_flag TORSION_flag :pre
style = {airebo} or {rebo}
cutoff = LJ cutoff (sigma scale factor) (AIREBO only)
LJ_flag = 0/1 to turn off/on the LJ term (AIREBO only, optional)
TORSION_flag = 0/1 to turn off/on the torsion term (AIREBO only, optional) :ul
[Examples:]
pair_style airebo 3.0
pair_style airebo 2.5 1 0
pair_coeff * * ../potentials/CH.airebo H C :pre
pair_style rebo
pair_coeff * * ../potentials/CH.airebo H C :pre
[Description:]
The {airebo} pair style computes the Adaptive Intermolecular Reactive
Empirical Bond Order (AIREBO) Potential of "(Stuart)"_#Stuart for a
system of carbon and/or hydrogen atoms. Note that this is the initial
formulation of AIREBO from 2000, not the later formulation. The
{rebo} pair style computes the Reactive Empirical Bond Order (REBO)
Potential of "(Brenner)"_#Brenner. Note that this is the so-called
2nd generation REBO from 2002, not the original REBO from 1990. As
discussed below, 2nd generation REBO is closely related to the intial
AIREBO; it is just a subset of the potential energy terms.
The AIREBO potential consists of three terms:
:c,image(Eqs/pair_airebo.jpg)
By default, all three terms are included. For the {airebo} style, if
the two optional flag arguments to the pair_style command are
included, the LJ and torsional terms can be turned off. Note that
both or neither of the flags must be included. If both of the LJ an
torsional terms are turned off, it becomes the 2nd-generation REBO
potential, with a small caveat on the spline fitting procedure
mentioned below. This can be specified directly as pair_style rebo
with no additional arguments.
The detailed formulas for this potential are given in
"(Stuart)"_#Stuart; here we provide only a brief description.
The E_REBO term has the same functional form as the hydrocarbon REBO
potential developed in "(Brenner)"_#Brenner. The coefficients for
E_REBO in AIREBO are essentially the same as Brenner's potential, but
a few fitted spline values are slightly different. For most cases the
E_REBO term in AIREBO will produce the same energies, forces and
statistical averages as the original REBO potential from which it was
derived. The E_REBO term in the AIREBO potential gives the model its
reactive capabilities and only describes short-ranged C-C, C-H and H-H
interactions (r < 2 Angstroms). These interactions have strong
coordination-dependence through a bond order parameter, which adjusts
the attraction between the I,J atoms based on the position of other
nearby atoms and thus has 3- and 4-body dependence.
The E_LJ term adds longer-ranged interactions (2 < r < cutoff) using a
form similar to the standard "Lennard Jones potential"_pair_lj.html.
The E_LJ term in AIREBO contains a series of switching functions so
that the short-ranged LJ repulsion (1/r^12) does not interfere with
the energetics captured by the E_REBO term. The extent of the E_LJ
interactions is determined by the {cutoff} argument to the pair_style
command which is a scale factor. For each type pair (C-C, C-H, H-H)
the cutoff is obtained by multiplying the scale factor by the sigma
value defined in the potential file for that type pair. In the
standard AIREBO potential, sigma_CC = 3.4 Angstroms, so with a scale
factor of 3.0 (the argument in pair_style), the resulting E_LJ cutoff
would be 10.2 Angstroms.
The E_TORSION term is an explicit 4-body potential that describes
various dihedral angle preferences in hydrocarbon configurations.
Only a single pair_coeff command is used with the {airebo} or {rebo}
style which specifies an AIREBO potential file with parameters for C
and H. Note that the {rebo} style in LAMMPS uses the same
AIREBO-formatted potential file. These are mapped to LAMMPS atom
types by specifying N additional arguments after the filename in the
pair_coeff command, where N is the number of LAMMPS atom types:
filename
N element names = mapping of AIREBO elements to atom types :ul
As an example, if your LAMMPS simulation has 4 atom types and you want
the 1st 3 to be C, and the 4th to be H, you would use the following
pair_coeff command:
pair_coeff * * CH.airebo C C C H :pre
The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three C arguments map LAMMPS atom types 1,2,3 to the C
element in the AIREBO file. The final H argument maps LAMMPS atom
type 4 to the H element in the SW file. If a mapping value is
specified as NULL, the mapping is not performed. This can be used
when a {airebo} potential is used as part of the {hybrid} pair style.
The NULL values are placeholders for atom types that will be used with
other potentials.
The parameters/coefficients for the AIREBO potentials are listed in
the CH.airebo file to agree with the original "(Stuart)"_#Stuart
paper. Thus the parameters are specific to this potential and the way
it was fit, so modifying the file should be done cautiously.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
These pair styles do not support the "pair_modify"_pair_modify.html
mix, shift, table, and tail options.
These pair styles do not write their information to "binary restart
files"_restart.html, since it is stored in potential files. Thus, you
need to re-specify the pair_style and pair_coeff commands in an input
script that reads a restart file.
These pair styles can only be used via the {pair} keyword of the
"run_style respa"_run_style.html command. They do not support the
{inner}, {middle}, {outer} keywords.
[Restrictions:]
These pair styles are part of the MANYBODY package. They are only
enabled if LAMMPS was built with that package (which it is by
default). See the "Making LAMMPS"_Section_start.html#start_3 section
for more info.
These pair potentials require the "newton"_newton.html setting to be
"on" for pair interactions.
The CH.airebo potential file provided with LAMMPS (see the potentials
directory) is parameterized for metal "units"_units.html. You can use
the AIREBO or REBO potential with any LAMMPS units, but you would need
to create your own AIREBO potential file with coefficients listed in
the appropriate units if your simulation doesn't use "metal" units.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Stuart)
[(Stuart)] Stuart, Tutein, Harrison, J Chem Phys, 112, 6472-6486
(2000).
:link(Brenner)
[(Brenner)] Brenner, Shenderova, Harrison, Stuart, Ni, Sinnott, J
Physics: Condensed Matter, 14, 783-802 (2002).
diff --git a/doc/pair_born.html b/doc/pair_born.html
index e5d4038a7..6d5ad8be7 100644
--- a/doc/pair_born.html
+++ b/doc/pair_born.html
@@ -1,164 +1,183 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style born command
</H3>
<H3>pair_style born/omp command
</H3>
<H3>pair_style born/coul/long command
</H3>
<H3>pair_style born/coul/long/cuda command
</H3>
<H3>pair_style born/coul/long/omp command
</H3>
+<H3>pair_style born/coul/wolf command
+</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style args
</PRE>
-<UL><LI>style = <I>born</I> or <I>born/coul/long</I>
+<UL><LI>style = <I>born</I> or <I>born/coul/long</I> or <I>born/coul/wolf</I>
<LI>args = list of arguments for a particular style
</UL>
<PRE> <I>born</I> args = cutoff
cutoff = global cutoff for non-Coulombic interactions (distance units)
<I>born/coul/long</I> args = cutoff (cutoff2)
+ cutoff = global cutoff for non-Coulombic (and Coulombic if only 1 arg) (distance units)
+ cutoff2 = global cutoff for Coulombic (optional) (distance units)
+ <I>born/coul/wolf</I> args = alpha cutoff (cutoff2)
+ alpha = damping parameter (inverse distance units)
cutoff = global cutoff for non-Coulombic (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
</PRE>
<P><B>Examples:</B>
</P>
<PRE>pair_style born 10.0
pair_coeff * * 6.08 0.317 2.340 24.18 11.51
pair_coeff 1 1 6.08 0.317 2.340 24.18 11.51
</PRE>
<PRE>pair_style born/coul/long 10.0
pair_style born/coul/long 10.0 8.0
pair_coeff * * 6.08 0.317 2.340 24.18 11.51
pair_coeff 1 1 6.08 0.317 2.340 24.18 11.51
</PRE>
+<PRE>pair_style born/coul/wolf 0.25 10.0
+pair_style born/coul/wolf 0.25 10.0 9.0
+pair_coeff * * 6.08 0.317 2.340 24.18 11.51
+pair_coeff 1 1 6.08 0.317 2.340 24.18 11.51
+</PRE>
<P><B>Description:</B>
</P>
<P>The <I>born</I> style computes the Born-Mayer-Huggins or Tosi/Fumi
potential described in <A HREF = "#FumiTosi">(Fumi and Tosi)</A>, given by
</P>
<CENTER><IMG SRC = "Eqs/pair_born.jpg">
</CENTER>
<P>where sigma is an interaction-dependent length parameter, rho is an
ionic-pair dependent length parameter, and Rc is the cutoff.
</P>
<P>The <I>born/coul/long</I> style adds a Coulombic term as described for the
-<A HREF = "pair_lj.html">lj/cut</A> pair styles. An additional damping factor is
-applied to the Coulombic term so it can be used in conjunction with
+<A HREF = "pair_coul.html">coul/long</A> pair style. An additional damping factor
+is applied to the Coulombic term so it can be used in conjunction with
the <A HREF = "kspace_style.html">kspace_style</A> command and its <I>ewald</I> or <I>pppm</I>
option. The Coulombic cutoff specified for this style means that
pairwise interactions within this distance are computed directly;
interactions outside that distance are computed in reciprocal space.
</P>
+<P>If one cutoff is specified for the <I>born/coul/long</I> style, it is used
+for both the A,C,D and Coulombic terms. If two cutoffs are specified,
+the first is used as the cutoff for the A,C,D terms, and the second is
+the cutoff for the Coulombic term.
+</P>
+<P>The <I>born/coul/wolf</I> style adds a Coulombic term as described for the
+Wolf potential in the <A HREF = "pair_coul.html">coul/wolf</A> pair style.
+</P>
<P>If one cutoff is specified for the <I>born/coulk/long</I> style, it is used
for both the A,C,D and Coulombic terms. If two cutoffs are specified,
the first is used as the cutoff for the A,C,D terms, and the second is
the cutoff for the Coulombic term.
</P>
<P>Note that these potentials are related to the <A HREF = "pair_born.html">Buckingham
potential</A>.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>A (energy units)
<LI>rho (distance units)
<LI>sigma (distance units)
<LI>C (energy units * distance units^6)
<LI>D (energy units * distance units^8)
<LI>cutoff (distance units)
</UL>
<P>The second coefficient, rho, must be greater than zero.
</P>
<P>The last coefficient is optional. If not specified, the global A,C,D
cutoff specified in the pair_style command is used.
</P>
-<P>For <I>buck/coul/long</I> no Coulombic cutoff can be specified for an
-individual I,J type pair. All type pairs use the same global
-Coulombic cutoff specified in the pair_style command.
+<P>For <I>buck/coul/long</I> and <I>born/coul/wolf</I> no Coulombic cutoff can be
+specified for an individual I,J type pair. All type pairs use the
+same global Coulombic cutoff specified in the pair_style command.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>These pair styles do not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
</P>
<P>These styles support the <A HREF = "pair_modify.html">pair_modify</A> shift option
for the energy of the exp(), 1/r^6, and 1/r^8 portion of the pair
interaction.
</P>
<P>The <I>born/coul/long</I> pair style does not support the
<A HREF = "pair_modify.html">pair_modify</A> table option since a tabulation
capability has not yet been added to this potential.
</P>
<P>These styles support the pair_modify tail option for adding long-range
tail corrections to energy and pressure.
</P>
<P>Thess styles writes thei information to binary <A HREF = "restart.html">restart</A>
files, so pair_style and pair_coeff commands do not need to be
specified in an input script that reads a restart file.
</P>
<P>These styles can only be used via the <I>pair</I> keyword of the <A HREF = "run_style.html">run_style
respa</A> command. They do not support the <I>inner</I>,
<I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>The <I>born/coul/long</I> style is part of the KSPACE package. It is only
enabled if LAMMPS was built with that package (which it is by
default). See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "pair_buck.html">pair_style buck</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "FumiTosi"></A>
<P>Fumi and Tosi, J Phys Chem Solids, 25, 31 (1964),
Fumi and Tosi, J Phys Chem Solids, 25, 45 (1964).
</P>
</HTML>
diff --git a/doc/pair_born.txt b/doc/pair_born.txt
index 652e7b4dd..99b0a56c2 100644
--- a/doc/pair_born.txt
+++ b/doc/pair_born.txt
@@ -1,154 +1,172 @@
"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 born command :h3
pair_style born/omp command :h3
pair_style born/coul/long command :h3
pair_style born/coul/long/cuda command :h3
pair_style born/coul/long/omp command :h3
+pair_style born/coul/wolf command :h3
[Syntax:]
pair_style style args :pre
-style = {born} or {born/coul/long}
+style = {born} or {born/coul/long} or {born/coul/wolf}
args = list of arguments for a particular style :ul
{born} args = cutoff
cutoff = global cutoff for non-Coulombic interactions (distance units)
{born/coul/long} args = cutoff (cutoff2)
+ cutoff = global cutoff for non-Coulombic (and Coulombic if only 1 arg) (distance units)
+ cutoff2 = global cutoff for Coulombic (optional) (distance units)
+ {born/coul/wolf} args = alpha cutoff (cutoff2)
+ alpha = damping parameter (inverse distance units)
cutoff = global cutoff for non-Coulombic (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units) :pre
[Examples:]
pair_style born 10.0
pair_coeff * * 6.08 0.317 2.340 24.18 11.51
pair_coeff 1 1 6.08 0.317 2.340 24.18 11.51 :pre
pair_style born/coul/long 10.0
pair_style born/coul/long 10.0 8.0
pair_coeff * * 6.08 0.317 2.340 24.18 11.51
pair_coeff 1 1 6.08 0.317 2.340 24.18 11.51 :pre
+pair_style born/coul/wolf 0.25 10.0
+pair_style born/coul/wolf 0.25 10.0 9.0
+pair_coeff * * 6.08 0.317 2.340 24.18 11.51
+pair_coeff 1 1 6.08 0.317 2.340 24.18 11.51 :pre
+
[Description:]
The {born} style computes the Born-Mayer-Huggins or Tosi/Fumi
potential described in "(Fumi and Tosi)"_#FumiTosi, given by
:c,image(Eqs/pair_born.jpg)
where sigma is an interaction-dependent length parameter, rho is an
ionic-pair dependent length parameter, and Rc is the cutoff.
The {born/coul/long} style adds a Coulombic term as described for the
-"lj/cut"_pair_lj.html pair styles. An additional damping factor is
-applied to the Coulombic term so it can be used in conjunction with
+"coul/long"_pair_coul.html pair style. An additional damping factor
+is applied to the Coulombic term so it can be used in conjunction with
the "kspace_style"_kspace_style.html command and its {ewald} or {pppm}
option. The Coulombic cutoff specified for this style means that
pairwise interactions within this distance are computed directly;
interactions outside that distance are computed in reciprocal space.
+If one cutoff is specified for the {born/coul/long} style, it is used
+for both the A,C,D and Coulombic terms. If two cutoffs are specified,
+the first is used as the cutoff for the A,C,D terms, and the second is
+the cutoff for the Coulombic term.
+
+The {born/coul/wolf} style adds a Coulombic term as described for the
+Wolf potential in the "coul/wolf"_pair_coul.html pair style.
+
If one cutoff is specified for the {born/coulk/long} style, it is used
for both the A,C,D and Coulombic terms. If two cutoffs are specified,
the first is used as the cutoff for the A,C,D terms, and the second is
the cutoff for the Coulombic term.
Note that these potentials are related to the "Buckingham
potential"_pair_born.html.
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 units)
rho (distance units)
sigma (distance units)
C (energy units * distance units^6)
D (energy units * distance units^8)
cutoff (distance units) :ul
The second coefficient, rho, must be greater than zero.
The last coefficient is optional. If not specified, the global A,C,D
cutoff specified in the pair_style command is used.
-For {buck/coul/long} no Coulombic cutoff can be specified for an
-individual I,J type pair. All type pairs use the same global
-Coulombic cutoff specified in the pair_style command.
+For {buck/coul/long} and {born/coul/wolf} no Coulombic cutoff can be
+specified for an individual I,J type pair. All type pairs use the
+same global Coulombic cutoff specified in the pair_style command.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
These pair styles do not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
These styles support the "pair_modify"_pair_modify.html shift option
for the energy of the exp(), 1/r^6, and 1/r^8 portion of the pair
interaction.
The {born/coul/long} pair style does not support the
"pair_modify"_pair_modify.html table option since a tabulation
capability has not yet been added to this potential.
These styles support the pair_modify tail option for adding long-range
tail corrections to energy and pressure.
Thess styles writes thei information to binary "restart"_restart.html
files, so pair_style and pair_coeff commands do not need to be
specified in an input script that reads a restart file.
These styles can only be used via the {pair} keyword of the "run_style
respa"_run_style.html command. They do not support the {inner},
{middle}, {outer} keywords.
:line
[Restrictions:]
The {born/coul/long} style is part of the KSPACE package. It is only
enabled if LAMMPS was built with that package (which it is by
default). See the "Making LAMMPS"_Section_start.html#start_3 section
for more info.
[Related commands:]
"pair_coeff"_pair_coeff.html, "pair_style buck"_pair_buck.html
[Default:] none
:line
:link(FumiTosi)
Fumi and Tosi, J Phys Chem Solids, 25, 31 (1964),
Fumi and Tosi, J Phys Chem Solids, 25, 45 (1964).
diff --git a/doc/pair_buck.html b/doc/pair_buck.html
index a7b8c76aa..8c0d4f27f 100644
--- a/doc/pair_buck.html
+++ b/doc/pair_buck.html
@@ -1,178 +1,178 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style buck command
</H3>
<H3>pair_style buck/cuda command
</H3>
<H3>pair_style buck/omp command
</H3>
<H3>pair_style buck/coul/cut command
</H3>
<H3>pair_style buck/coul/cut/cuda command
</H3>
<H3>pair_style buck/coul/cut/omp command
</H3>
<H3>pair_style buck/coul/long command
</H3>
<H3>pair_style buck/coul/long/cuda command
</H3>
<H3>pair_style buck/coul/long/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style args
</PRE>
<UL><LI>style = <I>buck</I> or <I>buck/coul/cut</I> or <I>buck/coul/long</I>
<LI>args = list of arguments for a particular style
</UL>
<PRE> <I>buck</I> args = cutoff
cutoff = global cutoff for Buckingham interactions (distance units)
<I>buck/coul/cut</I> args = cutoff (cutoff2)
cutoff = global cutoff for Buckingham (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
<I>buck/coul/long</I> args = cutoff (cutoff2)
cutoff = global cutoff for Buckingham (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
</PRE>
<P><B>Examples:</B>
</P>
<PRE>pair_style buck 2.5
pair_coeff * * 100.0 1.5 200.0
pair_coeff * * 100.0 1.5 200.0 3.0
</PRE>
<PRE>pair_style buck/coul/cut 10.0
pair_style buck/coul/cut 10.0 8.0
pair_coeff * * 100.0 1.5 200.0
pair_coeff 1 1 100.0 1.5 200.0 9.0
pair_coeff 1 1 100.0 1.5 200.0 9.0 8.0
</PRE>
<PRE>pair_style buck/coul/long 10.0
pair_style buck/coul/long 10.0 8.0
pair_coeff * * 100.0 1.5 200.0
pair_coeff 1 1 100.0 1.5 200.0 9.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>buck</I> style computes a Buckingham potential (exp/6 instead of
Lennard-Jones 12/6) given by
</P>
<CENTER><IMG SRC = "Eqs/pair_buck.jpg">
</CENTER>
<P>where rho is an ionic-pair dependent length parameter, and Rc is the
cutoff.
</P>
<P>The <I>buck/coul/cut</I> and <I>buck/coul/long</I> styles add a Coulombic term
as described for the <A HREF = "pair_lj.html">lj/cut</A> pair styles. For
<I>buck/coul/long</I>, an additional damping factor is applied to the
Coulombic term so it can be used in conjunction with the
<A HREF = "kspace_style.html">kspace_style</A> command and its <I>ewald</I> or <I>pppm</I>
option. The Coulombic cutoff specified for this style means that
pairwise interactions within this distance are computed directly;
interactions outside that distance are computed in reciprocal space.
</P>
<P>If one cutoff is specified for the <I>born/coul/cut</I> and
<I>born/coulk/long</I> styles, it is used for both the A,C and Coulombic
terms. If two cutoffs are specified, the first is used as the cutoff
for the A,C terms, and the second is the cutoff for the Coulombic
term.
</P>
<P>Note that these potentials are related to the <A HREF = "pair_born.html">Born-Mayer-Huggins
potential</A>.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>A (energy units)
<LI>rho (distance units)
<LI>C (energy-distance^6 units)
<LI>cutoff (distance units)
<LI>cutoff2 (distance units)
</UL>
<P>The second coefficient, rho, must be greater than zero.
</P>
<P>The latter 2 coefficients are optional. If not specified, the global
A,C and Coulombic cutoffs are used. If only one cutoff is specified,
it is used as the cutoff for both A,C and Coulombic interactions for
this type pair. If both coefficients are specified, they are used as
the A,C and Coulombic cutoffs for this type pair. You cannot specify
2 cutoffs for style <I>buck</I>, since it has no Coulombic terms.
</P>
<P>For <I>buck/coul/long</I> only the LJ cutoff can be specified since a
Coulombic cutoff cannot be specified for an individual I,J type pair.
All type pairs use the same global Coulombic cutoff specified in the
pair_style command.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>These pair styles do not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
</P>
<P>These styles support the <A HREF = "pair_modify.html">pair_modify</A> shift option
for the energy of the exp() and 1/r^6 portion of the pair interaction.
</P>
<P>The <I>buck/coul/long</I> pair style does not support the
<A HREF = "pair_modify.html">pair_modify</A> table option since a tabulation
capability has not yet been added to this potential.
</P>
<P>These styles support the pair_modify tail option for adding long-range
tail corrections to energy and pressure for the A,C terms in the
pair interaction.
</P>
<P>These styles write their information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>These styles can only be used via the <I>pair</I> keyword of the <A HREF = "run_style.html">run_style
respa</A> command. They do not support the <I>inner</I>,
<I>middle</I>, <I>outer</I> keywords.
</P>
<P><B>Restrictions:</B>
</P>
<P>The <I>buck/coul/long</I> style is part of the KSPACE package. It is only
enabled if LAMMPS was built with that package (which it is by
default). See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "pair_born.html">pair_style born</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_buck.txt b/doc/pair_buck.txt
index 1f875f9ac..94e42ac20 100644
--- a/doc/pair_buck.txt
+++ b/doc/pair_buck.txt
@@ -1,164 +1,164 @@
"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 buck command :h3
pair_style buck/cuda command :h3
pair_style buck/omp command :h3
pair_style buck/coul/cut command :h3
pair_style buck/coul/cut/cuda command :h3
pair_style buck/coul/cut/omp command :h3
pair_style buck/coul/long command :h3
pair_style buck/coul/long/cuda command :h3
pair_style buck/coul/long/omp command :h3
[Syntax:]
pair_style style args :pre
style = {buck} or {buck/coul/cut} or {buck/coul/long}
args = list of arguments for a particular style :ul
{buck} args = cutoff
cutoff = global cutoff for Buckingham interactions (distance units)
{buck/coul/cut} args = cutoff (cutoff2)
cutoff = global cutoff for Buckingham (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{buck/coul/long} args = cutoff (cutoff2)
cutoff = global cutoff for Buckingham (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units) :pre
[Examples:]
pair_style buck 2.5
pair_coeff * * 100.0 1.5 200.0
pair_coeff * * 100.0 1.5 200.0 3.0 :pre
pair_style buck/coul/cut 10.0
pair_style buck/coul/cut 10.0 8.0
pair_coeff * * 100.0 1.5 200.0
pair_coeff 1 1 100.0 1.5 200.0 9.0
pair_coeff 1 1 100.0 1.5 200.0 9.0 8.0 :pre
pair_style buck/coul/long 10.0
pair_style buck/coul/long 10.0 8.0
pair_coeff * * 100.0 1.5 200.0
pair_coeff 1 1 100.0 1.5 200.0 9.0 :pre
[Description:]
The {buck} style computes a Buckingham potential (exp/6 instead of
Lennard-Jones 12/6) given by
:c,image(Eqs/pair_buck.jpg)
where rho is an ionic-pair dependent length parameter, and Rc is the
cutoff.
The {buck/coul/cut} and {buck/coul/long} styles add a Coulombic term
as described for the "lj/cut"_pair_lj.html pair styles. For
{buck/coul/long}, an additional damping factor is applied to the
Coulombic term so it can be used in conjunction with the
"kspace_style"_kspace_style.html command and its {ewald} or {pppm}
option. The Coulombic cutoff specified for this style means that
pairwise interactions within this distance are computed directly;
interactions outside that distance are computed in reciprocal space.
If one cutoff is specified for the {born/coul/cut} and
{born/coulk/long} styles, it is used for both the A,C and Coulombic
terms. If two cutoffs are specified, the first is used as the cutoff
for the A,C terms, and the second is the cutoff for the Coulombic
term.
Note that these potentials are related to the "Born-Mayer-Huggins
potential"_pair_born.html.
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:
A (energy units)
rho (distance units)
C (energy-distance^6 units)
cutoff (distance units)
cutoff2 (distance units) :ul
The second coefficient, rho, must be greater than zero.
The latter 2 coefficients are optional. If not specified, the global
A,C and Coulombic cutoffs are used. If only one cutoff is specified,
it is used as the cutoff for both A,C and Coulombic interactions for
this type pair. If both coefficients are specified, they are used as
the A,C and Coulombic cutoffs for this type pair. You cannot specify
2 cutoffs for style {buck}, since it has no Coulombic terms.
For {buck/coul/long} only the LJ cutoff can be specified since a
Coulombic cutoff cannot be specified for an individual I,J type pair.
All type pairs use the same global Coulombic cutoff specified in the
pair_style command.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
These pair styles do not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
These styles support the "pair_modify"_pair_modify.html shift option
for the energy of the exp() and 1/r^6 portion of the pair interaction.
The {buck/coul/long} pair style does not support the
"pair_modify"_pair_modify.html table option since a tabulation
capability has not yet been added to this potential.
These styles support the pair_modify tail option for adding long-range
tail corrections to energy and pressure for the A,C terms in the
pair interaction.
These styles write their 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.
These styles can only be used via the {pair} keyword of the "run_style
respa"_run_style.html command. They do not support the {inner},
{middle}, {outer} keywords.
[Restrictions:]
The {buck/coul/long} style is part of the KSPACE package. It is only
enabled if LAMMPS was built with that package (which it is by
default). See the "Making LAMMPS"_Section_start.html#start_3 section
for more info.
[Related commands:]
"pair_coeff"_pair_coeff.html, "pair_style born"_pair_born.html
[Default:] none
diff --git a/doc/pair_buck_coul.html b/doc/pair_buck_coul.html
index 149fe36e3..863850dbc 100644
--- a/doc/pair_buck_coul.html
+++ b/doc/pair_buck_coul.html
@@ -1,178 +1,178 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style buck/coul command
</H3>
<H3>pair_style buck/coul/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style buck/coul flag_buck flag_coul cutoff (cutoff2)
</PRE>
<UL><LI>flag_buck = <I>long</I> or <I>cut</I>
<PRE> <I>long</I> = use Kspace long-range summation for the dispersion term 1/r^6
<I>cut</I> = use a cutoff
</PRE>
<LI>flag_coul = <I>long</I> or <I>off</I>
<PRE> <I>long</I> = use Kspace long-range summation for the Coulombic term 1/r
<I>off</I> = omit the Coulombic term
</PRE>
<LI>cutoff = global cutoff for Buckingham (and Coulombic if only 1 cutoff) (distance units)
<LI>cutoff2 = global cutoff for Coulombic (optional) (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style buck/coul cut off 2.5
pair_style buck/coul cut long 2.5 4.0
pair_style buck/coul long long 2.5 4.0
pair_coeff * * 1 1
pair_coeff 1 1 1 3 4
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>buck/coul</I> style computes a Buckingham potential (exp/6 instead of
Lennard-Jones 12/6) and Coulombic potential, given by
</P>
<CENTER><IMG SRC = "Eqs/pair_buck.jpg">
</CENTER>
<CENTER><IMG SRC = "Eqs/pair_coulomb.jpg">
</CENTER>
<P>Rc is the cutoff. If one cutoff is specified in the pair_style
command, it is used for both the Buckingham and Coulombic terms. If
two cutoffs are specified, they are used as cutoffs for the Buckingham
and Coulombic terms respectively.
</P>
<P>The purpose of this pair style is to capture long-range interactions
resulting from both attractive 1/r^6 Buckingham and Coulombic 1/r
interactions. This is done by use of the <I>flag_buck</I> and <I>flag_coul</I>
settings. The "<A HREF = "#Ismail">Ismail</A> paper has more details on when it is
appropriate to include long-range 1/r^6 interactions, using this
potential.
</P>
<P>If <I>flag_buck</I> is set to <I>long</I>, no cutoff is used on the Buckingham
1/r^6 dispersion term. The long-range portion is calculated by using
the <A HREF = "kspace_style.html">kspace_style ewald/n</A> command. The specified
Buckingham cutoff then determines which portion of the Buckingham
interactions are computed directly by the pair potential versus which
part is computed in reciprocal space via the Kspace style. If
<I>flag_buck</I> is set to <I>cut</I>, the Buckingham interactions are simply
cutoff, as with <A HREF = "pair_buck.html">pair_style buck</A>.
</P>
<P>If <I>flag_coul</I> is set to <I>long</I>, no cutoff is used on the Coulombic
interactions. The long-range portion is calculated by using any
style, including <I>ewald/n</I> of the <A HREF = "kspace_style.html">kspace_style</A>
command. Note that if <I>flag_buck</I> is also set to long, then only the
<I>ewald/n</I> Kspace style can perform the long-range calculations for
both the Buckingham and Coulombic interactions. If <I>flag_coul</I> is set
to <I>off</I>, Coulombic interactions are not computed.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>A (energy units)
<LI>rho (distance units)
<LI>C (energy-distance^6 units)
<LI>cutoff (distance units)
<LI>cutoff2 (distance units)
</UL>
<P>The second coefficient, rho, must be greater than zero.
</P>
<P>The latter 2 coefficients are optional. If not specified, the global
Buckingham and Coulombic cutoffs specified in the pair_style command
are used. If only one cutoff is specified, it is used as the cutoff
for both Buckingham and Coulombic interactions for this type pair. If
both coefficients are specified, they are used as the Buckingham and
Coulombic cutoffs for this type pair. Note that if you are using
<I>flag_buck</I> set to <I>long</I>, you cannot specify a Buckingham cutoff for
an atom type pair, since only one global Buckingham cutoff is allowed.
Similarly, if you are using <I>flag_coul</I> set to <I>long</I>, you cannot
specify a Coulombic cutoff for an atom type pair, since only one
global Coulombic cutoff is allowed.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>This pair styles does not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
</P>
<P>This pair style supports the <A HREF = "pair_modify.html">pair_modify</A> shift
option for the energy of the exp() and 1/r^6 portion of the pair
interaction, assuming <I>flag_buck</I> is <I>cut</I>.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift option for the energy of the Buckingham portion of the pair
interaction.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
table option since a tabulation capability has not yet been added to
this potential.
</P>
<P>This pair style write its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style supports the use of the <I>inner</I>, <I>middle</I>, and <I>outer</I>
keywords of the <A HREF = "run_style.html">run_style respa</A> command, meaning the
pairwise forces can be partitioned by distance at different levels of
the rRESPA hierarchy. See the <A HREF = "run_style.html">run_style</A> command for
details.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This style is part of the USER-EWALDN package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Ismail"></A>
<P><B>(Ismail)</B> Ismail, Tsige, In 't Veld, Grest, Molecular Physics
(accepted) (2007).
</P>
</HTML>
diff --git a/doc/pair_buck_coul.txt b/doc/pair_buck_coul.txt
index 4db211709..e6eaf14ba 100644
--- a/doc/pair_buck_coul.txt
+++ b/doc/pair_buck_coul.txt
@@ -1,166 +1,166 @@
"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 buck/coul command :h3
pair_style buck/coul/omp command :h3
[Syntax:]
pair_style buck/coul flag_buck flag_coul cutoff (cutoff2) :pre
flag_buck = {long} or {cut} :ulb,l
{long} = use Kspace long-range summation for the dispersion term 1/r^6
{cut} = use a cutoff :pre
flag_coul = {long} or {off} :l
{long} = use Kspace long-range summation for the Coulombic term 1/r
{off} = omit the Coulombic term :pre
cutoff = global cutoff for Buckingham (and Coulombic if only 1 cutoff) (distance units) :l
cutoff2 = global cutoff for Coulombic (optional) (distance units) :l,ule
[Examples:]
pair_style buck/coul cut off 2.5
pair_style buck/coul cut long 2.5 4.0
pair_style buck/coul long long 2.5 4.0
pair_coeff * * 1 1
pair_coeff 1 1 1 3 4 :pre
[Description:]
The {buck/coul} style computes a Buckingham potential (exp/6 instead of
Lennard-Jones 12/6) and Coulombic potential, given by
:c,image(Eqs/pair_buck.jpg)
:c,image(Eqs/pair_coulomb.jpg)
Rc is the cutoff. If one cutoff is specified in the pair_style
command, it is used for both the Buckingham and Coulombic terms. If
two cutoffs are specified, they are used as cutoffs for the Buckingham
and Coulombic terms respectively.
The purpose of this pair style is to capture long-range interactions
resulting from both attractive 1/r^6 Buckingham and Coulombic 1/r
interactions. This is done by use of the {flag_buck} and {flag_coul}
settings. The ""Ismail"_#Ismail paper has more details on when it is
appropriate to include long-range 1/r^6 interactions, using this
potential.
If {flag_buck} is set to {long}, no cutoff is used on the Buckingham
1/r^6 dispersion term. The long-range portion is calculated by using
the "kspace_style ewald/n"_kspace_style.html command. The specified
Buckingham cutoff then determines which portion of the Buckingham
interactions are computed directly by the pair potential versus which
part is computed in reciprocal space via the Kspace style. If
{flag_buck} is set to {cut}, the Buckingham interactions are simply
cutoff, as with "pair_style buck"_pair_buck.html.
If {flag_coul} is set to {long}, no cutoff is used on the Coulombic
interactions. The long-range portion is calculated by using any
style, including {ewald/n} of the "kspace_style"_kspace_style.html
command. Note that if {flag_buck} is also set to long, then only the
{ewald/n} Kspace style can perform the long-range calculations for
both the Buckingham and Coulombic interactions. If {flag_coul} is set
to {off}, Coulombic interactions are not computed.
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:
A (energy units)
rho (distance units)
C (energy-distance^6 units)
cutoff (distance units)
cutoff2 (distance units) :ul
The second coefficient, rho, must be greater than zero.
The latter 2 coefficients are optional. If not specified, the global
Buckingham and Coulombic cutoffs specified in the pair_style command
are used. If only one cutoff is specified, it is used as the cutoff
for both Buckingham and Coulombic interactions for this type pair. If
both coefficients are specified, they are used as the Buckingham and
Coulombic cutoffs for this type pair. Note that if you are using
{flag_buck} set to {long}, you cannot specify a Buckingham cutoff for
an atom type pair, since only one global Buckingham cutoff is allowed.
Similarly, if you are using {flag_coul} set to {long}, you cannot
specify a Coulombic cutoff for an atom type pair, since only one
global Coulombic cutoff is allowed.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
This pair styles does not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
This pair style supports the "pair_modify"_pair_modify.html shift
option for the energy of the exp() and 1/r^6 portion of the pair
interaction, assuming {flag_buck} is {cut}.
This pair style does not support the "pair_modify"_pair_modify.html
shift option for the energy of the Buckingham portion of the pair
interaction.
This pair style does not support the "pair_modify"_pair_modify.html
table option since a tabulation capability has not yet been added to
this potential.
This pair style write 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 supports the use of the {inner}, {middle}, and {outer}
keywords of the "run_style respa"_run_style.html command, meaning the
pairwise forces can be partitioned by distance at different levels of
the rRESPA hierarchy. See the "run_style"_run_style.html command for
details.
:line
[Restrictions:]
This style is part of the USER-EWALDN package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Ismail)
[(Ismail)] Ismail, Tsige, In 't Veld, Grest, Molecular Physics
(accepted) (2007).
diff --git a/doc/pair_charmm.html b/doc/pair_charmm.html
index 40ba0d540..43fb29de6 100644
--- a/doc/pair_charmm.html
+++ b/doc/pair_charmm.html
@@ -1,212 +1,212 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style lj/charmm/coul/charmm command
</H3>
<H3>pair_style lj/charmm/coul/charmm/cuda command
</H3>
<H3>pair_style lj/charmm/coul/charmm/omp command
</H3>
<H3>pair_style lj/charmm/coul/charmm/implicit command
</H3>
<H3>pair_style lj/charmm/coul/charmm/implicit/cuda command
</H3>
<H3>pair_style lj/charmm/coul/charmm/implicit/omp command
</H3>
<H3>pair_style lj/charmm/coul/long command
</H3>
<H3>pair_style lj/charmm/coul/long/cuda command
</H3>
<H3>pair_style lj/charmm/coul/long/gpu command
</H3>
<H3>pair_style lj/charmm/coul/long/opt command
</H3>
<H3>pair_style lj/charmm/coul/long/omp command
</H3>
<H3>pair_style lj/charmm/coul/pppm/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style args
</PRE>
<UL><LI>style = <I>lj/charmm/coul/charmm</I> or <I>lj/charmm/coul/charmm/implicit</I> or <I>lj/charmm/coul/long</I>
<LI>args = list of arguments for a particular style
</UL>
<PRE> <I>lj/charmm/coul/charmm</I> args = inner outer (inner2) (outer2)
inner, outer = global switching cutoffs for Lennard Jones (and Coulombic if only 2 args)
inner2, outer2 = global switching cutoffs for Coulombic (optional)
<I>lj/charmm/coul/charmm/implicit</I> args = inner outer (inner2) (outer2)
inner, outer = global switching cutoffs for LJ (and Coulombic if only 2 args)
inner2, outer2 = global switching cutoffs for Coulombic (optional)
<I>lj/charmm/coul/long</I> args = inner outer (cutoff)
inner, outer = global switching cutoffs for LJ (and Coulombic if only 2 args)
cutoff = global cutoff for Coulombic (optional, outer is Coulombic cutoff if only 2 args)
</PRE>
<P><B>Examples:</B>
</P>
<PRE>pair_style lj/charmm/coul/charmm 8.0 10.0
pair_style lj/charmm/coul/charmm 8.0 10.0 7.0 9.0
pair_coeff * * 100.0 2.0
pair_coeff 1 1 100.0 2.0 150.0 3.5
</PRE>
<PRE>pair_style lj/charmm/coul/charmm/implicit 8.0 10.0
pair_style lj/charmm/coul/charmm/implicit 8.0 10.0 7.0 9.0
pair_coeff * * 100.0 2.0
pair_coeff 1 1 100.0 2.0 150.0 3.5
</PRE>
<PRE>pair_style lj/charmm/coul/long 8.0 10.0
pair_style lj/charmm/coul/long 8.0 10.0 9.0
pair_coeff * * 100.0 2.0
pair_coeff 1 1 100.0 2.0 150.0 3.5
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>lj/charmm</I> styles compute LJ and Coulombic interactions with an
additional switching function S(r) that ramps the energy and force
smoothly to zero between an inner and outer cutoff. It is a widely
used potential in the <A HREF = "http://www.scripps.edu/brooks">CHARMM</A> MD code.
See <A HREF = "#MacKerell">(MacKerell)</A> for a description of the CHARMM force
field.
</P>
<CENTER><IMG SRC = "Eqs/pair_charmm.jpg">
</CENTER>
<P>Both the LJ and Coulombic terms require an inner and outer cutoff.
They can be the same for both formulas or different depending on
whether 2 or 4 arguments are used in the pair_style command. In each
case, the inner cutoff distance must be less than the outer cutoff.
It it typical to make the difference between the 2 cutoffs about 1.0
Angstrom.
</P>
<P>Style <I>lj/charmm/coul/charmm/implicit</I> computes the same formulas as
style <I>lj/charmm/coul/charmm</I> except that an additional 1/r term is
included in the Coulombic formula. The Coulombic energy thus varies
as 1/r^2. This is effectively a distance-dependent dielectric term
which is a simple model for an implicit solvent with additional
screening. It is designed for use in a simulation of an unsolvated
biomolecule (no explicit water molecules).
</P>
<P>Styles <I>lj/charmm/coul/long</I> and <I>lj/charmm/coul/pppm/omp</I> compute
the same formulas as style <I>lj/charmm/coul/charmm</I> except that an
additional damping factor is applied to the Coulombic term, as in
the discussion for pair style <I>lj/cut/coul/long</I>. Only one Coulombic
cutoff is specified for <I>lj/charmm/coul/long</I>; if only 2 arguments
are used in the pair_style command, then the outer LJ cutoff is
used as the single Coulombic cutoff. Style <I>lj/charmm/coul/pppm/omp</I>
is a variant for use with K-space style <A HREF = "kspace_style.html"><I>pppm/proxy</I></A>
and OpenMP multi-threading and will perform the corresponding
reciprocal space calculation concurrently with the pair calculation
in a separate thread. For certain parallel setups, this may have
a performance benefit over performing k-space style and pair style
separately and one after the other.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>epsilon_14 (energy units)
<LI>sigma_14 (distance units)
</UL>
<P>Note that sigma is defined in the LJ formula as the zero-crossing
distance for the potential, not as the energy minimum at 2^(1/6)
sigma.
</P>
<P>The latter 2 coefficients are optional. If they are specified, they
are used in the LJ formula between 2 atoms of these types which are
also first and fourth atoms in any dihedral. No cutoffs are specified
because this CHARMM force field does not allow varying cutoffs for
individual atom pairs; all pairs use the global cutoff(s) specified in
the pair_style command.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon, sigma, epsilon_14,
and sigma_14 coefficients for all of the lj/charmm pair styles can be
mixed. The default mix value is <I>arithmetic</I> to coincide with the
usual settings for the CHARMM force field. See the "pair_modify"
command for details.
</P>
<P>None of the lj/charmm pair styles support the
<A HREF = "pair_modify.html">pair_modify</A> shift option, since the Lennard-Jones
portion of the pair interaction is smoothed to 0.0 at the cutoff.
</P>
<P>The <I>lj/charmm/coul/long</I> style supports the
<A HREF = "pair_modify.html">pair_modify</A> table option since it can tabulate the
short-range portion of the long-range Coulombic interaction.
</P>
<P>None of the lj/charmm pair styles support the
<A HREF = "pair_modify.html">pair_modify</A> tail option for adding long-range tail
corrections to energy and pressure, since the Lennard-Jones portion of
the pair interaction is smoothed to 0.0 at the cutoff.
</P>
<P>All of the lj/charmm pair styles write their information to <A HREF = "restart.html">binary
restart files</A>, so pair_style and pair_coeff commands do
not need to be specified in an input script that reads a restart file.
</P>
<P>The lj/charmm/coul/long pair style supports the use of the <I>inner</I>,
<I>middle</I>, and <I>outer</I> keywords of the <A HREF = "run_style.html">run_style respa</A>
command, meaning the pairwise forces can be partitioned by distance at
different levels of the rRESPA hierarchy. The other styles only
support the <I>pair</I> keyword of run_style respa. See the
<A HREF = "run_style.html">run_style</A> command for details.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>The <I>lj/charmm/coul/charmm</I> and <I>lj/charmm/coul/charmm/implicit</I>
styles are part of the MOLECULE package. The <I>lj/charmm/coul/long</I>
style is part of the KSPACE package. They are only enabled if LAMMPS
was built with those packages. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info. Note that
the MOLECULE and KSPACE packages are installed by default.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "MacKerell"></A>
<P><B>(MacKerell)</B> MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field,
Fischer, Gao, Guo, Ha, et al, J Phys Chem, 102, 3586 (1998).
</P>
</HTML>
diff --git a/doc/pair_charmm.txt b/doc/pair_charmm.txt
index e7cf05054..bafeed18d 100644
--- a/doc/pair_charmm.txt
+++ b/doc/pair_charmm.txt
@@ -1,194 +1,194 @@
"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 lj/charmm/coul/charmm command :h3
pair_style lj/charmm/coul/charmm/cuda command :h3
pair_style lj/charmm/coul/charmm/omp command :h3
pair_style lj/charmm/coul/charmm/implicit command :h3
pair_style lj/charmm/coul/charmm/implicit/cuda command :h3
pair_style lj/charmm/coul/charmm/implicit/omp command :h3
pair_style lj/charmm/coul/long command :h3
pair_style lj/charmm/coul/long/cuda command :h3
pair_style lj/charmm/coul/long/gpu command :h3
pair_style lj/charmm/coul/long/opt command :h3
pair_style lj/charmm/coul/long/omp command :h3
pair_style lj/charmm/coul/pppm/omp command :h3
[Syntax:]
pair_style style args :pre
style = {lj/charmm/coul/charmm} or {lj/charmm/coul/charmm/implicit} or {lj/charmm/coul/long}
args = list of arguments for a particular style :ul
{lj/charmm/coul/charmm} args = inner outer (inner2) (outer2)
inner, outer = global switching cutoffs for Lennard Jones (and Coulombic if only 2 args)
inner2, outer2 = global switching cutoffs for Coulombic (optional)
{lj/charmm/coul/charmm/implicit} args = inner outer (inner2) (outer2)
inner, outer = global switching cutoffs for LJ (and Coulombic if only 2 args)
inner2, outer2 = global switching cutoffs for Coulombic (optional)
{lj/charmm/coul/long} args = inner outer (cutoff)
inner, outer = global switching cutoffs for LJ (and Coulombic if only 2 args)
cutoff = global cutoff for Coulombic (optional, outer is Coulombic cutoff if only 2 args) :pre
[Examples:]
pair_style lj/charmm/coul/charmm 8.0 10.0
pair_style lj/charmm/coul/charmm 8.0 10.0 7.0 9.0
pair_coeff * * 100.0 2.0
pair_coeff 1 1 100.0 2.0 150.0 3.5 :pre
pair_style lj/charmm/coul/charmm/implicit 8.0 10.0
pair_style lj/charmm/coul/charmm/implicit 8.0 10.0 7.0 9.0
pair_coeff * * 100.0 2.0
pair_coeff 1 1 100.0 2.0 150.0 3.5 :pre
pair_style lj/charmm/coul/long 8.0 10.0
pair_style lj/charmm/coul/long 8.0 10.0 9.0
pair_coeff * * 100.0 2.0
pair_coeff 1 1 100.0 2.0 150.0 3.5 :pre
[Description:]
The {lj/charmm} styles compute LJ and Coulombic interactions with an
additional switching function S(r) that ramps the energy and force
smoothly to zero between an inner and outer cutoff. It is a widely
used potential in the "CHARMM"_http://www.scripps.edu/brooks MD code.
See "(MacKerell)"_#MacKerell for a description of the CHARMM force
field.
:c,image(Eqs/pair_charmm.jpg)
Both the LJ and Coulombic terms require an inner and outer cutoff.
They can be the same for both formulas or different depending on
whether 2 or 4 arguments are used in the pair_style command. In each
case, the inner cutoff distance must be less than the outer cutoff.
It it typical to make the difference between the 2 cutoffs about 1.0
Angstrom.
Style {lj/charmm/coul/charmm/implicit} computes the same formulas as
style {lj/charmm/coul/charmm} except that an additional 1/r term is
included in the Coulombic formula. The Coulombic energy thus varies
as 1/r^2. This is effectively a distance-dependent dielectric term
which is a simple model for an implicit solvent with additional
screening. It is designed for use in a simulation of an unsolvated
biomolecule (no explicit water molecules).
Styles {lj/charmm/coul/long} and {lj/charmm/coul/pppm/omp} compute
the same formulas as style {lj/charmm/coul/charmm} except that an
additional damping factor is applied to the Coulombic term, as in
the discussion for pair style {lj/cut/coul/long}. Only one Coulombic
cutoff is specified for {lj/charmm/coul/long}; if only 2 arguments
are used in the pair_style command, then the outer LJ cutoff is
used as the single Coulombic cutoff. Style {lj/charmm/coul/pppm/omp}
is a variant for use with K-space style "{pppm/proxy}"_kspace_style.html
and OpenMP multi-threading and will perform the corresponding
reciprocal space calculation concurrently with the pair calculation
in a separate thread. For certain parallel setups, this may have
a performance benefit over performing k-space style and pair style
separately and one after the other.
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:
epsilon (energy units)
sigma (distance units)
epsilon_14 (energy units)
sigma_14 (distance units) :ul
Note that sigma is defined in the LJ formula as the zero-crossing
distance for the potential, not as the energy minimum at 2^(1/6)
sigma.
The latter 2 coefficients are optional. If they are specified, they
are used in the LJ formula between 2 atoms of these types which are
also first and fourth atoms in any dihedral. No cutoffs are specified
because this CHARMM force field does not allow varying cutoffs for
individual atom pairs; all pairs use the global cutoff(s) specified in
the pair_style command.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon, sigma, epsilon_14,
and sigma_14 coefficients for all of the lj/charmm pair styles can be
mixed. The default mix value is {arithmetic} to coincide with the
usual settings for the CHARMM force field. See the "pair_modify"
command for details.
None of the lj/charmm pair styles support the
"pair_modify"_pair_modify.html shift option, since the Lennard-Jones
portion of the pair interaction is smoothed to 0.0 at the cutoff.
The {lj/charmm/coul/long} style supports the
"pair_modify"_pair_modify.html table option since it can tabulate the
short-range portion of the long-range Coulombic interaction.
None of the lj/charmm pair styles support the
"pair_modify"_pair_modify.html tail option for adding long-range tail
corrections to energy and pressure, since the Lennard-Jones portion of
the pair interaction is smoothed to 0.0 at the cutoff.
All of the lj/charmm pair styles write their 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.
The lj/charmm/coul/long pair style supports the use of the {inner},
{middle}, and {outer} keywords of the "run_style respa"_run_style.html
command, meaning the pairwise forces can be partitioned by distance at
different levels of the rRESPA hierarchy. The other styles only
support the {pair} keyword of run_style respa. See the
"run_style"_run_style.html command for details.
:line
[Restrictions:]
The {lj/charmm/coul/charmm} and {lj/charmm/coul/charmm/implicit}
styles are part of the MOLECULE package. The {lj/charmm/coul/long}
style is part of the KSPACE package. They are only enabled if LAMMPS
was built with those packages. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info. Note that
the MOLECULE and KSPACE packages are installed by default.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(MacKerell)
[(MacKerell)] MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field,
Fischer, Gao, Guo, Ha, et al, J Phys Chem, 102, 3586 (1998).
diff --git a/doc/pair_class2.html b/doc/pair_class2.html
index b4fc59715..3afbdf6f7 100644
--- a/doc/pair_class2.html
+++ b/doc/pair_class2.html
@@ -1,187 +1,187 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style lj/class2 command
</H3>
<H3>pair_style lj/class2/cuda command
</H3>
<H3>pair_style lj/class2/gpu command
</H3>
<H3>pair_style lj/class2/omp command
</H3>
<H3>pair_style lj/class2/coul/cut command
</H3>
<H3>pair_style lj/class2/coul/cut/cuda command
</H3>
<H3>pair_style lj/class2/coul/cut/omp command
</H3>
<H3>pair_style lj/class2/coul/long command
</H3>
<H3>pair_style lj/class2/coul/long/cuda command
</H3>
<H3>pair_style lj/class2/coul/long/gpu command
</H3>
<H3>pair_style lj/class2/coul/long/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style args
</PRE>
<UL><LI>style = <I>lj/class2</I> or <I>lj/class2/coul/cut</I> or <I>lj/class2/coul/long</I>
<LI>args = list of arguments for a particular style
</UL>
<PRE> <I>lj/class2</I> args = cutoff
cutoff = global cutoff for class 2 interactions (distance units)
<I>lj/class2/coul/cut</I> args = cutoff (cutoff2)
cutoff = global cutoff for class 2 (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
<I>lj/class2/coul/long</I> args = cutoff (cutoff2)
cutoff = global cutoff for class 2 (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
</PRE>
<P><B>Examples:</B>
</P>
<PRE>pair_style lj/class2 10.0
pair_coeff * * 100.0 2.5
pair_coeff 1 2* 100.0 2.5 9.0
</PRE>
<PRE>pair_style lj/class2/coul/cut 10.0
pair_style lj/class2/coul/cut 10.0 8.0
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0
pair_coeff 1 1 100.0 3.5 9.0 9.0
</PRE>
<PRE>pair_style lj/class2/coul/long 10.0
pair_style lj/class2/coul/long 10.0 8.0
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>lj/class2</I> styles compute a 6/9 Lennard-Jones potential given by
</P>
<CENTER><IMG SRC = "Eqs/pair_class2.jpg">
</CENTER>
<P>Rc is the cutoff.
</P>
<P>The <I>lj/class2/coul/cut</I> and <I>lj/class2/coul/long</I> styles add a
Coulombic term as described for the <A HREF = "pair_lj.html">lj/cut</A> pair
styles.
</P>
<P>See <A HREF = "#Sun">(Sun)</A> for a description of the COMPASS class2 force field.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>cutoff1 (distance units)
<LI>cutoff2 (distance units)
</UL>
<P>The latter 2 coefficients are optional. If not specified, the global
class 2 and Coulombic cutoffs are used. If only one cutoff is
specified, it is used as the cutoff for both class 2 and Coulombic
interactions for this type pair. If both coefficients are specified,
they are used as the class 2 and Coulombic cutoffs for this type pair.
You cannot specify 2 cutoffs for style <I>lj/class2</I>, since it has no
Coulombic terms.
</P>
<P>For <I>lj/class2/coul/long</I> only the class 2 cutoff can be specified
since a Coulombic cutoff cannot be specified for an individual I,J
type pair. All type pairs use the same global Coulombic cutoff
specified in the pair_style command.
</P>
<HR>
<P>If the pair_coeff command is not used to define coefficients for a
particular I != J type pair, the mixing rule for epsilon and sigma for
all class2 potentials is to use the <I>sixthpower</I> formulas documented
by the <A HREF = "pair_modify.html">pair_modify</A> command. The <A HREF = "pair_modify.html">pair_modify
mix</A> setting is thus ignored for class2 potentials
for epsilon and sigma. However it is still followed for mixing the
cutoff distance.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/class2 pair styles can be mixed.
Epsilon and sigma are always mixed with the value <I>sixthpower</I>. The
cutoff distance is mixed by whatever option is set by the pair_modify
command (default = geometric). See the "pair_modify" command for
details.
</P>
<P>All of the lj/class2 pair styles support the
<A HREF = "pair_modify.html">pair_modify</A> shift option for the energy of the
Lennard-Jones portion of the pair interaction.
</P>
<P>The <I>lj/class2/coul/long</I> pair style does not support the
<A HREF = "pair_modify.html">pair_modify</A> table option since a tabulation
capability has not yet been added to this potential.
</P>
<P>All of the lj/class2 pair styles support the
<A HREF = "pair_modify.html">pair_modify</A> tail option for adding a long-range
tail correction to the energy and pressure of the Lennard-Jones
portion of the pair interaction.
</P>
<P>All of the lj/class2 pair styles write their information to <A HREF = "restart.html">binary
restart files</A>, so pair_style and pair_coeff commands do
not need to be specified in an input script that reads a restart file.
</P>
<P>All of the lj/class2 pair styles can only be used via the <I>pair</I>
keyword of the <A HREF = "run_style.html">run_style respa</A> command. They do not
support the <I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<P><B>Restrictions:</B>
</P>
<P>These styles are part of the CLASS2 package. They are only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Sun"></A>
<P><B>(Sun)</B> Sun, J Phys Chem B 102, 7338-7364 (1998).
</P>
</HTML>
diff --git a/doc/pair_class2.txt b/doc/pair_class2.txt
index 301372749..d7b376a60 100644
--- a/doc/pair_class2.txt
+++ b/doc/pair_class2.txt
@@ -1,170 +1,170 @@
"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 lj/class2 command :h3
pair_style lj/class2/cuda command :h3
pair_style lj/class2/gpu command :h3
pair_style lj/class2/omp command :h3
pair_style lj/class2/coul/cut command :h3
pair_style lj/class2/coul/cut/cuda command :h3
pair_style lj/class2/coul/cut/omp command :h3
pair_style lj/class2/coul/long command :h3
pair_style lj/class2/coul/long/cuda command :h3
pair_style lj/class2/coul/long/gpu command :h3
pair_style lj/class2/coul/long/omp command :h3
[Syntax:]
pair_style style args :pre
style = {lj/class2} or {lj/class2/coul/cut} or {lj/class2/coul/long}
args = list of arguments for a particular style :ul
{lj/class2} args = cutoff
cutoff = global cutoff for class 2 interactions (distance units)
{lj/class2/coul/cut} args = cutoff (cutoff2)
cutoff = global cutoff for class 2 (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{lj/class2/coul/long} args = cutoff (cutoff2)
cutoff = global cutoff for class 2 (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units) :pre
[Examples:]
pair_style lj/class2 10.0
pair_coeff * * 100.0 2.5
pair_coeff 1 2* 100.0 2.5 9.0 :pre
pair_style lj/class2/coul/cut 10.0
pair_style lj/class2/coul/cut 10.0 8.0
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0
pair_coeff 1 1 100.0 3.5 9.0 9.0 :pre
pair_style lj/class2/coul/long 10.0
pair_style lj/class2/coul/long 10.0 8.0
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0 :pre
[Description:]
The {lj/class2} styles compute a 6/9 Lennard-Jones potential given by
:c,image(Eqs/pair_class2.jpg)
Rc is the cutoff.
The {lj/class2/coul/cut} and {lj/class2/coul/long} styles add a
Coulombic term as described for the "lj/cut"_pair_lj.html pair
styles.
See "(Sun)"_#Sun for a description of the COMPASS class2 force field.
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:
epsilon (energy units)
sigma (distance units)
cutoff1 (distance units)
cutoff2 (distance units) :ul
The latter 2 coefficients are optional. If not specified, the global
class 2 and Coulombic cutoffs are used. If only one cutoff is
specified, it is used as the cutoff for both class 2 and Coulombic
interactions for this type pair. If both coefficients are specified,
they are used as the class 2 and Coulombic cutoffs for this type pair.
You cannot specify 2 cutoffs for style {lj/class2}, since it has no
Coulombic terms.
For {lj/class2/coul/long} only the class 2 cutoff can be specified
since a Coulombic cutoff cannot be specified for an individual I,J
type pair. All type pairs use the same global Coulombic cutoff
specified in the pair_style command.
:line
If the pair_coeff command is not used to define coefficients for a
particular I != J type pair, the mixing rule for epsilon and sigma for
all class2 potentials is to use the {sixthpower} formulas documented
by the "pair_modify"_pair_modify.html command. The "pair_modify
mix"_pair_modify.html setting is thus ignored for class2 potentials
for epsilon and sigma. However it is still followed for mixing the
cutoff distance.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/class2 pair styles can be mixed.
Epsilon and sigma are always mixed with the value {sixthpower}. The
cutoff distance is mixed by whatever option is set by the pair_modify
command (default = geometric). See the "pair_modify" command for
details.
All of the lj/class2 pair styles support the
"pair_modify"_pair_modify.html shift option for the energy of the
Lennard-Jones portion of the pair interaction.
The {lj/class2/coul/long} pair style does not support the
"pair_modify"_pair_modify.html table option since a tabulation
capability has not yet been added to this potential.
All of the lj/class2 pair styles support the
"pair_modify"_pair_modify.html tail option for adding a long-range
tail correction to the energy and pressure of the Lennard-Jones
portion of the pair interaction.
All of the lj/class2 pair styles write their 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.
All of the lj/class2 pair styles can only be used via the {pair}
keyword of the "run_style respa"_run_style.html command. They do not
support the {inner}, {middle}, {outer} keywords.
[Restrictions:]
These styles are part of the CLASS2 package. They are only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Sun)
[(Sun)] Sun, J Phys Chem B 102, 7338-7364 (1998).
diff --git a/doc/pair_coeff.html b/doc/pair_coeff.html
index 1c9c6777e..0ac1a684b 100644
--- a/doc/pair_coeff.html
+++ b/doc/pair_coeff.html
@@ -1,182 +1,184 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_coeff command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_coeff I J args
</PRE>
<UL><LI>I,J = atom types (see asterisk form below)
<LI>args = coefficients for one or more pairs of atom types
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_coeff 1 2 1.0 1.0 2.5
pair_coeff 2 * 1.0 1.0
pair_coeff 3* 1*2 1.0 1.0 2.5
pair_coeff * * 1.0 1.0
pair_coeff * * nialhjea 1 1 2
pair_coeff * 3 morse.table ENTRY1
pair_coeff 1 2 lj/cut 1.0 1.0 2.5 (for pair_style hybrid)
</PRE>
<P><B>Description:</B>
</P>
<P>Specify the pairwise force field coefficients for one or more pairs of
atom types. The number and meaning of the coefficients depends on the
pair style. Pair coefficients can also be set in the data file read
by the <A HREF = "read_data.html">read_data</A> command or in a restart file.
</P>
<P>I and J can be specified in one of two ways. Explicit numeric values
can be used for each, as in the 1st example above. I <= J is
required. LAMMPS sets the coefficients for the symmetric J,I
interaction to the same values.
</P>
<P>A wildcard asterisk can be used in place of or in conjunction with the
I,J arguments to set the coefficients for multiple pairs of atom
types. This takes the form "*" or "*n" or "n*" or "m*n". If N = the
number of atom types, then an asterisk with no numeric values means all
types from 1 to N. A leading asterisk means all types from 1 to n
(inclusive). A trailing asterisk means all types from n to N
(inclusive). A middle asterisk means all types from m to n
(inclusive). Note that only type pairs with I <= J are considered; if
asterisks imply type pairs where J < I, they are ignored.
</P>
<P>Note that a pair_coeff command can override a previous setting for the
same I,J pair. For example, these commands set the coeffs for all I,J
pairs, then overwrite the coeffs for just the I,J = 2,3 pair:
</P>
<PRE>pair_coeff * * 1.0 1.0 2.5
pair_coeff 2 3 2.0 1.0 1.12
</PRE>
<P>A line in a data file that specifies pair coefficients uses the exact
same format as the arguments of the pair_coeff command in an input
script, with the exception of the I,J type arguments. In each line of
the "Pair Coeffs" section of a data file, only a single type I is
specified, which sets the coefficients for type I interacting with
type I. This is because the section has exactly N lines, where N =
the number of atom types. For this reason, the wild-card asterisk
should also not be used as part of the I argument. Thus in a data
file, the line corresponding to the 1st example above would be listed
as
</P>
<PRE>2 1.0 1.0 2.5
</PRE>
<P>For many potentials, if coefficients for type pairs with I != J are
not set explicitly by a pair_coeff command, the values are inferred
from the I,I and J,J settings by mixing rules; see the
<A HREF = "pair_modify.html">pair_modify</A> command for a discussion. Details on
this option as it pertains to individual potentials are described on
the doc page for the potential.
</P>
<HR>
<P>Here is an alphabetic list of pair styles defined in LAMMPS. Click on
the style to display the formula it computes, arguments specified in
the pair_style command, and coefficients specified by the associated
<A HREF = "pair_coeff.html">pair_coeff</A> command:
</P>
<UL><LI><A HREF = "pair_hybrid.html">pair_style hybrid</A> - multiple styles of pairwise interactions
<LI><A HREF = "pair_hybrid.html">pair_style hybrid/overlay</A> - multiple styles of superposed pairwise interactions
</UL>
<UL><LI><A HREF = "pair_adp.html">pair_style adp</A> - angular dependent potential (ADP) of Mishin
<LI><A HREF = "pair_airebo.html">pair_style airebo</A> - AIREBO potential of Stuart
<LI><A HREF = "pair_born.html">pair_style born</A> - Born-Mayer-Huggins potential
-<LI><A HREF = "pair_born.html">pair_style born/coul/long</A> - Born-Mayer-Huggins with long-range Coulomb
+<LI><A HREF = "pair_born.html">pair_style born/coul/long</A> - Born-Mayer-Huggins with long-range Coulombics
+<LI><A HREF = "pair_born.html">pair_style born/coul/wolf</A> - Born-Mayer-Huggins with Coulombics via Wolf potential
<LI><A HREF = "pair_brownian.html">pair_style brownian</A> - Brownian potential for Fast Lubrication Dynamics
<LI><A HREF = "pair_brownian.html">pair_style brownian/poly</A> - Brownian potential for Fast Lubrication Dynamics with polydispersity
<LI><A HREF = "pair_buck.html">pair_style buck</A> - Buckingham potential
<LI><A HREF = "pair_buck.html">pair_style buck/coul/cut</A> - Buckingham with cutoff Coulomb
<LI><A HREF = "pair_buck.html">pair_style buck/coul/long</A> - Buckingham with long-range Coulomb
<LI><A HREF = "pair_colloid.html">pair_style colloid</A> - integrated colloidal potential
<LI><A HREF = "pair_comb.html">pair_style comb</A> - charge-optimized many-body (COMB) potential
<LI><A HREF = "pair_coul.html">pair_style coul/cut</A> - cutoff Coulombic potential
<LI><A HREF = "pair_coul.html">pair_style coul/debye</A> - cutoff Coulombic potential with Debye screening
<LI><A HREF = "pair_coul.html">pair_style coul/long</A> - long-range Coulombic potential
+<LI><A HREF = "pair_coul.html">pair_style coul/wolf</A> - Coulombics via Wolf potential
<LI><A HREF = "pair_dipole.html">pair_style dipole/cut</A> - point dipoles with cutoff
<LI><A HREF = "pair_dpd.html">pair_style dpd</A> - dissipative particle dynamics (DPD)
<LI><A HREF = "pair_dpd.html">pair_style dpd/tstat</A> - DPD thermostatting
<LI><A HREF = "pair_dsmc.html">pair_style dsmc</A> - Direct Simulation Monte Carlo (DSMC)
<LI><A HREF = "pair_eam.html">pair_style eam</A> - embedded atom method (EAM)
<LI><A HREF = "pair_eam.html">pair_style eam/alloy</A> - alloy EAM
<LI><A HREF = "pair_eam.html">pair_style eam/fs</A> - Finnis-Sinclair EAM
<LI><A HREF = "pair_eim.html">pair_style eim</A> - embedded ion method (EIM)
<LI><A HREF = "pair_gauss.html">pair_style gauss</A> - Gaussian potential
<LI><A HREF = "pair_gayberne.html">pair_style gayberne</A> - Gay-Berne ellipsoidal potential
<LI><A HREF = "pair_gran.html">pair_style gran/hertz/history</A> - granular potential with Hertzian interactions
<LI><A HREF = "pair_gran.html">pair_style gran/hooke</A> - granular potential with history effects
<LI><A HREF = "pair_gran.html">pair_style gran/hooke/history</A> - granular potential without history effects
<LI><A HREF = "pair_hbond_dreiding.html">pair_style hbond/dreiding/lj</A> - DREIDING hydrogen bonding LJ potential
<LI><A HREF = "pair_hbond_dreiding.html">pair_style hbond/dreiding/morse</A> - DREIDING hydrogen bonding Morse potential
<LI><A HREF = "pair_line_lj.html">pair_style line/lj</A> - LJ potential between line segments
<LI><A HREF = "pair_charmm.html">pair_style lj/charmm/coul/charmm</A> - CHARMM potential with cutoff Coulomb
<LI><A HREF = "pair_charmm.html">pair_style lj/charmm/coul/charmm/implicit</A> - CHARMM for implicit solvent
<LI><A HREF = "pair_charmm.html">pair_style lj/charmm/coul/long</A> - CHARMM with long-range Coulomb
<LI><A HREF = "pair_class2.html">pair_style lj/class2</A> - COMPASS (class 2) force field with no Coulomb
<LI><A HREF = "pair_class2.html">pair_style lj/class2/coul/cut</A> - COMPASS with cutoff Coulomb
<LI><A HREF = "pair_class2.html">pair_style lj/class2/coul/long</A> - COMPASS with long-range Coulomb
<LI><A HREF = "pair_lj.html">pair_style lj/cut</A> - cutoff Lennard-Jones potential with no Coulomb
<LI><A HREF = "pair_lj.html">pair_style lj/cut/coul/cut</A> - LJ with cutoff Coulomb
<LI><A HREF = "pair_lj.html">pair_style lj/cut/coul/debye</A> - LJ with Debye screening added to Coulomb
<LI><A HREF = "pair_lj.html">pair_style lj/cut/coul/long</A> - LJ with long-range Coulomb
<LI><A HREF = "pair_lj.html">pair_style lj/cut/coul/long/tip4p</A> - LJ with long-range Coulomb for TIP4P water
<LI><A HREF = "pair_lj_expand.html">pair_style lj/expand</A> - Lennard-Jones for variable size particles
<LI><A HREF = "pair_gromacs.html">pair_style lj/gromacs</A> - GROMACS-style Lennard-Jones potential
<LI><A HREF = "pair_gromacs.html">pair_style lj/gromacs/coul/gromacs</A> - GROMACS-style LJ and Coulombic potential
<LI><A HREF = "pair_lj_smooth.html">pair_style lj/smooth</A> - smoothed Lennard-Jones potential
<LI><A HREF = "pair_lj96.html">pair_style lj96/cut</A> - Lennard-Jones 9/6 potential
<LI><A HREF = "pair_lubricate.html">pair_style lubricate</A> - hydrodynamic lubrication forces
<LI><A HREF = "pair_lubricate.html">pair_style lubricate/poly</A> - hydrodynamic lubrication forces with polydispersity
<LI><A HREF = "pair_lubricateU.html">pair_style lubricateU</A> - hydrodynamic lubrication forces for Fast Lubrication Dynamics
<LI><A HREF = "pair_lubricateU.html">pair_style lubricateU/poly</A> - hydrodynamic lubrication forces for Fast Lubrication Dynamics with polydispersity
<LI><A HREF = "pair_meam.html">pair_style meam</A> - modified embedded atom method (MEAM)
<LI><A HREF = "pair_morse.html">pair_style morse</A> - Morse potential
<LI><A HREF = "pair_peri.html">pair_style peri/lps</A> - peridynamic LPS potential
<LI><A HREF = "pair_peri.html">pair_style peri/pmb</A> - peridynamic PMB potential
<LI><A HREF = "pair_reax.html">pair_style reax</A> - ReaxFF potential
<LI><A HREF = "pair_airebo.html">pair_style rebo</A> - 2nd-generation REBO potential of Brenner
<LI><A HREF = "pair_resquared.html">pair_style resquared</A> - Everaers RE-Squared ellipsoidal potential
<LI><A HREF = "pair_soft.html">pair_style soft</A> - Soft (cosine) potential
<LI><A HREF = "pair_sw.html">pair_style sw</A> - Stillinger-Weber 3-body potential
<LI><A HREF = "pair_table.html">pair_style table</A> - tabulated pair potential
<LI><A HREF = "pair_tersoff.html">pair_style tersoff</A> - Tersoff 3-body potential
<LI><A HREF = "pair_tersoff_zbl.html">pair_style tersoff/zbl</A> - Tersoff/ZBL 3-body potential
<LI><A HREF = "pair_tri_lj.html">pair_style tri/lj</A> - LJ potential between triangles
<LI><A HREF = "pair_yukawa.html">pair_style yukawa</A> - Yukawa potential
<LI><A HREF = "pair_yukawa_colloid.html">pair_style yukawa/colloid</A> - screened Yukawa potential for finite-size particles
</UL>
<P>There are also additional pair styles submitted by users which are
included in the LAMMPS distribution. The list of these with links to
the individual styles are given in the pair section of <A HREF = "Section_commands.html#cmd_5">this
page</A>.
</P>
<P>There are also additional accelerated pair styles included in the
LAMMPS distribution for faster performance on CPUs and GPUs. The list
of these with links to the individual styles are given in the pair
section of <A HREF = "Section_commands.html#cmd_5">this page</A>.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This command must come after the simulation box is defined by a
<A HREF = "read_data.html">read_data</A>, <A HREF = "read_restart.html">read_restart</A>, or
<A HREF = "create_box.html">create_box</A> command.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_style.html">pair_style</A>, <A HREF = "pair_modify.html">pair_modify</A>,
<A HREF = "read_data.html">read_data</A>, <A HREF = "read_restart.html">read_restart</A>,
<A HREF = "pair_write.html">pair_write</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_coeff.txt b/doc/pair_coeff.txt
index 4c8ca53f5..1b66fe2a3 100644
--- a/doc/pair_coeff.txt
+++ b/doc/pair_coeff.txt
@@ -1,177 +1,179 @@
"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_coeff command :h3
[Syntax:]
pair_coeff I J args :pre
I,J = atom types (see asterisk form below)
args = coefficients for one or more pairs of atom types :ul
[Examples:]
pair_coeff 1 2 1.0 1.0 2.5
pair_coeff 2 * 1.0 1.0
pair_coeff 3* 1*2 1.0 1.0 2.5
pair_coeff * * 1.0 1.0
pair_coeff * * nialhjea 1 1 2
pair_coeff * 3 morse.table ENTRY1
pair_coeff 1 2 lj/cut 1.0 1.0 2.5 (for pair_style hybrid) :pre
[Description:]
Specify the pairwise force field coefficients for one or more pairs of
atom types. The number and meaning of the coefficients depends on the
pair style. Pair coefficients can also be set in the data file read
by the "read_data"_read_data.html command or in a restart file.
I and J can be specified in one of two ways. Explicit numeric values
can be used for each, as in the 1st example above. I <= J is
required. LAMMPS sets the coefficients for the symmetric J,I
interaction to the same values.
A wildcard asterisk can be used in place of or in conjunction with the
I,J arguments to set the coefficients for multiple pairs of atom
types. This takes the form "*" or "*n" or "n*" or "m*n". If N = the
number of atom types, then an asterisk with no numeric values means all
types from 1 to N. A leading asterisk means all types from 1 to n
(inclusive). A trailing asterisk means all types from n to N
(inclusive). A middle asterisk means all types from m to n
(inclusive). Note that only type pairs with I <= J are considered; if
asterisks imply type pairs where J < I, they are ignored.
Note that a pair_coeff command can override a previous setting for the
same I,J pair. For example, these commands set the coeffs for all I,J
pairs, then overwrite the coeffs for just the I,J = 2,3 pair:
pair_coeff * * 1.0 1.0 2.5
pair_coeff 2 3 2.0 1.0 1.12 :pre
A line in a data file that specifies pair coefficients uses the exact
same format as the arguments of the pair_coeff command in an input
script, with the exception of the I,J type arguments. In each line of
the "Pair Coeffs" section of a data file, only a single type I is
specified, which sets the coefficients for type I interacting with
type I. This is because the section has exactly N lines, where N =
the number of atom types. For this reason, the wild-card asterisk
should also not be used as part of the I argument. Thus in a data
file, the line corresponding to the 1st example above would be listed
as
2 1.0 1.0 2.5 :pre
For many potentials, if coefficients for type pairs with I != J are
not set explicitly by a pair_coeff command, the values are inferred
from the I,I and J,J settings by mixing rules; see the
"pair_modify"_pair_modify.html command for a discussion. Details on
this option as it pertains to individual potentials are described on
the doc page for the potential.
:line
Here is an alphabetic list of pair styles defined in LAMMPS. Click on
the style to display the formula it computes, arguments specified in
the pair_style command, and coefficients specified by the associated
"pair_coeff"_pair_coeff.html command:
"pair_style hybrid"_pair_hybrid.html - multiple styles of pairwise interactions
"pair_style hybrid/overlay"_pair_hybrid.html - multiple styles of superposed pairwise interactions :ul
"pair_style adp"_pair_adp.html - angular dependent potential (ADP) of Mishin
"pair_style airebo"_pair_airebo.html - AIREBO potential of Stuart
"pair_style born"_pair_born.html - Born-Mayer-Huggins potential
-"pair_style born/coul/long"_pair_born.html - Born-Mayer-Huggins with long-range Coulomb
+"pair_style born/coul/long"_pair_born.html - Born-Mayer-Huggins with long-range Coulombics
+"pair_style born/coul/wolf"_pair_born.html - Born-Mayer-Huggins with Coulombics via Wolf potential
"pair_style brownian"_pair_brownian.html - Brownian potential for Fast Lubrication Dynamics
"pair_style brownian/poly"_pair_brownian.html - Brownian potential for Fast Lubrication Dynamics with polydispersity
"pair_style buck"_pair_buck.html - Buckingham potential
"pair_style buck/coul/cut"_pair_buck.html - Buckingham with cutoff Coulomb
"pair_style buck/coul/long"_pair_buck.html - Buckingham with long-range Coulomb
"pair_style colloid"_pair_colloid.html - integrated colloidal potential
"pair_style comb"_pair_comb.html - charge-optimized many-body (COMB) potential
"pair_style coul/cut"_pair_coul.html - cutoff Coulombic potential
"pair_style coul/debye"_pair_coul.html - cutoff Coulombic potential with Debye screening
"pair_style coul/long"_pair_coul.html - long-range Coulombic potential
+"pair_style coul/wolf"_pair_coul.html - Coulombics via Wolf potential
"pair_style dipole/cut"_pair_dipole.html - point dipoles with cutoff
"pair_style dpd"_pair_dpd.html - dissipative particle dynamics (DPD)
"pair_style dpd/tstat"_pair_dpd.html - DPD thermostatting
"pair_style dsmc"_pair_dsmc.html - Direct Simulation Monte Carlo (DSMC)
"pair_style eam"_pair_eam.html - embedded atom method (EAM)
"pair_style eam/alloy"_pair_eam.html - alloy EAM
"pair_style eam/fs"_pair_eam.html - Finnis-Sinclair EAM
"pair_style eim"_pair_eim.html - embedded ion method (EIM)
"pair_style gauss"_pair_gauss.html - Gaussian potential
"pair_style gayberne"_pair_gayberne.html - Gay-Berne ellipsoidal potential
"pair_style gran/hertz/history"_pair_gran.html - granular potential with Hertzian interactions
"pair_style gran/hooke"_pair_gran.html - granular potential with history effects
"pair_style gran/hooke/history"_pair_gran.html - granular potential without history effects
"pair_style hbond/dreiding/lj"_pair_hbond_dreiding.html - DREIDING hydrogen bonding LJ potential
"pair_style hbond/dreiding/morse"_pair_hbond_dreiding.html - DREIDING hydrogen bonding Morse potential
"pair_style line/lj"_pair_line_lj.html - LJ potential between line segments
"pair_style lj/charmm/coul/charmm"_pair_charmm.html - CHARMM potential with cutoff Coulomb
"pair_style lj/charmm/coul/charmm/implicit"_pair_charmm.html - CHARMM for implicit solvent
"pair_style lj/charmm/coul/long"_pair_charmm.html - CHARMM with long-range Coulomb
"pair_style lj/class2"_pair_class2.html - COMPASS (class 2) force field with no Coulomb
"pair_style lj/class2/coul/cut"_pair_class2.html - COMPASS with cutoff Coulomb
"pair_style lj/class2/coul/long"_pair_class2.html - COMPASS with long-range Coulomb
"pair_style lj/cut"_pair_lj.html - cutoff Lennard-Jones potential with no Coulomb
"pair_style lj/cut/coul/cut"_pair_lj.html - LJ with cutoff Coulomb
"pair_style lj/cut/coul/debye"_pair_lj.html - LJ with Debye screening added to Coulomb
"pair_style lj/cut/coul/long"_pair_lj.html - LJ with long-range Coulomb
"pair_style lj/cut/coul/long/tip4p"_pair_lj.html - LJ with long-range Coulomb for TIP4P water
"pair_style lj/expand"_pair_lj_expand.html - Lennard-Jones for variable size particles
"pair_style lj/gromacs"_pair_gromacs.html - GROMACS-style Lennard-Jones potential
"pair_style lj/gromacs/coul/gromacs"_pair_gromacs.html - GROMACS-style LJ and Coulombic potential
"pair_style lj/smooth"_pair_lj_smooth.html - smoothed Lennard-Jones potential
"pair_style lj96/cut"_pair_lj96.html - Lennard-Jones 9/6 potential
"pair_style lubricate"_pair_lubricate.html - hydrodynamic lubrication forces
"pair_style lubricate/poly"_pair_lubricate.html - hydrodynamic lubrication forces with polydispersity
"pair_style lubricateU"_pair_lubricateU.html - hydrodynamic lubrication forces for Fast Lubrication Dynamics
"pair_style lubricateU/poly"_pair_lubricateU.html - hydrodynamic lubrication forces for Fast Lubrication Dynamics with polydispersity
"pair_style meam"_pair_meam.html - modified embedded atom method (MEAM)
"pair_style morse"_pair_morse.html - Morse potential
"pair_style peri/lps"_pair_peri.html - peridynamic LPS potential
"pair_style peri/pmb"_pair_peri.html - peridynamic PMB potential
"pair_style reax"_pair_reax.html - ReaxFF potential
"pair_style rebo"_pair_airebo.html - 2nd-generation REBO potential of Brenner
"pair_style resquared"_pair_resquared.html - Everaers RE-Squared ellipsoidal potential
"pair_style soft"_pair_soft.html - Soft (cosine) potential
"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_zbl.html - Tersoff/ZBL 3-body potential
"pair_style tri/lj"_pair_tri_lj.html - LJ potential between triangles
"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
the individual styles are given in the pair section of "this
page"_Section_commands.html#cmd_5.
There are also additional accelerated pair styles included in the
LAMMPS distribution for faster performance on CPUs and GPUs. The list
of these with links to the individual styles are given in the pair
section of "this page"_Section_commands.html#cmd_5.
:line
[Restrictions:]
This command must come after the simulation box is defined by a
"read_data"_read_data.html, "read_restart"_read_restart.html, or
"create_box"_create_box.html command.
[Related commands:]
"pair_style"_pair_style.html, "pair_modify"_pair_modify.html,
"read_data"_read_data.html, "read_restart"_read_restart.html,
"pair_write"_pair_write.html
[Default:] none
diff --git a/doc/pair_colloid.html b/doc/pair_colloid.html
index a1754fd5d..b8ebae042 100644
--- a/doc/pair_colloid.html
+++ b/doc/pair_colloid.html
@@ -1,210 +1,210 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style colloid command
</H3>
<H3>pair_style colloid/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style colloid cutoff
</PRE>
<UL><LI>cutoff = global cutoff for colloidal interactions (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style colloid 10.0
pair_coeff * * 25 1.0 10.0 10.0
pair_coeff 1 1 144 1.0 0.0 0.0 3.0
pair_coeff 1 2 75.398 1.0 0.0 10.0 9.0
pair_coeff 2 2 39.478 1.0 10.0 10.0 25.0
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>colloid</I> computes pairwise interactions between large colloidal
particles and small solvent particles using 3 formulas. A colloidal
particle has a size > sigma; a solvent particle is the usual
Lennard-Jones particle of size sigma.
</P>
<P>The colloid-colloid interaction energy is given by
</P>
<CENTER><IMG SRC = "Eqs/pair_colloid_cc.jpg">
</CENTER>
<P>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
<A HREF = "#Everaers">(Everaers)</A>.
</P>
<P>The colloid-solvent interaction energy is given by
</P>
<CENTER><IMG SRC = "Eqs/pair_colloid_cs.jpg">
</CENTER>
<P>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.
</P>
<P>The solvent-solvent interaction energy is given by the usual
Lennard-Jones formula
</P>
<CENTER><IMG SRC = "Eqs/pair_colloid_ss.jpg">
</CENTER>
<P>with A_ss set appropriately, which results from letting both particle
sizes go to zero.
</P>
<P>When used in combination with <A HREF = "pair_colloid.html">pair_style
yukawa/colloid</A>, the two terms become the so-called
DLVO potential, which combines electrostatic repulsion and van der
Waals attraction.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>A (energy units)
<LI>sigma (distance units)
<LI>d1 (distance units)
<LI>d2 (distance units)
<LI>cutoff (distance units)
</UL>
<P>A is the Hamaker energy prefactor and should typically be set as
follows:
</P>
<UL><LI>A_cc = colloid/colloid = 4 pi^2 = 39.5
<LI>A_cs = colloid/solvent = sqrt(A_cc*A_ss)
<LI>A_ss = solvent/solvent = 144 (assuming epsilon = 1, so that 144/36 = 4)
</UL>
<P>Sigma is the size of the solvent particle or the constituent particles
integrated over in the colloidal particle and should typically be set
as follows:
</P>
<UL><LI>Sigma_cc = colloid/colloid = 1.0
<LI>Sigma_cs = colloid/solvent = arithmetic mixing between colloid sigma and solvent sigma
<LI>Sigma_ss = solvent/solvent = 1.0 or whatever size the solvent particle is
</UL>
<P>Thus typically Sigma_cs = 1.0, unless the solvent particle's size !=
1.0.
</P>
<P>D1 and d2 are particle diameters, so that d1 = 2*a1 and d2 = 2*a2 in
the formulas above. Both d1 and d2 must be values >= 0. If d1 > 0
and d2 > 0, then the pair interacts via the colloid-colloid formula
above. If d1 = 0 and d2 = 0, then the pair interacts via the
solvent-solvent formula. I.e. a d value of 0 is a Lennard-Jones
particle of size sigma. If either d1 = 0 or d2 = 0 and the other is
larger, then the pair interacts via the colloid-solvent formula.
</P>
<P>Note that the diameter of a particular particle type may appear in
multiple pair_coeff commands, as it interacts with other particle
types. You should insure the particle diameter is specified
consistently each time it appears.
</P>
<P>The last coefficient is optional. If not specified, the global cutoff
specified in the pair_style command is used. However, you typically
want different cutoffs for interactions between different particle
sizes. E.g. if colloidal particles of diameter 10 are used with
solvent particles of diameter 1, then a solvent-solvent cutoff of 2.5
would correspond to a colloid-colloid cutoff of 25. A good
rule-of-thumb is to use a colloid-solvent cutoff that is half the big
diameter + 4 times the small diameter. I.e. 9 = 5 + 4 for the
colloid-solvent cutoff in this case.
</P>
<P>IMPORTANT NOTE: When using pair_style colloid for a mixture with 2 (or
more) widely different particles sizes (e.g. sigma=10 colloids in a
background sigam=1 LJ fluid), you will likely want to use these
commands for efficiency: <A HREF = "neighbor.html">neighbor multi</A> and
<A HREF = "communicate.html">communicate multi</A>.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the A, sigma, d1, and d2
coefficients and cutoff distance for this pair style can be mixed. A
is an energy value mixed like a LJ epsilon. D1 and d2 are distance
values and are mixed like sigma. The default mix value is
<I>geometric</I>. See the "pair_modify" command for details.
</P>
<P>This pair style supports the <A HREF = "pair_modify.html">pair_modify</A> shift
option for the energy of the pair interaction.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for this pair style.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding long-range tail corrections to energy and
pressure.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This style is part of the COLLOID package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>Normally, this pair style should be used with finite-size particles
which have a diameter, e.g. see the <A HREF = "atom_style.html">atom_style
sphere</A> command. However, this is not a requirement,
since the only definition of particle size is via the pair_coeff
parameters for each type. In other words, the physical radius of the
particle is ignored. Thus you should insure that the d1,d2 parameters
you specify are consistent with the physical size of the particles of
that type.
</P>
<P>Per-particle polydispersity is not yet supported by this pair style;
only per-type polydispersity is enabled via the pair_coeff parameters.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Everaers"></A>
<P><B>(Everaers)</B> Everaers, Ejtehadi, Phys Rev E, 67, 041710 (2003).
</P>
</HTML>
diff --git a/doc/pair_colloid.txt b/doc/pair_colloid.txt
index 8a442ea07..b68f8d9d6 100644
--- a/doc/pair_colloid.txt
+++ b/doc/pair_colloid.txt
@@ -1,203 +1,203 @@
"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 colloid command :h3
pair_style colloid/omp command :h3
[Syntax:]
pair_style colloid cutoff :pre
cutoff = global cutoff for colloidal interactions (distance units) :ul
[Examples:]
pair_style colloid 10.0
pair_coeff * * 25 1.0 10.0 10.0
pair_coeff 1 1 144 1.0 0.0 0.0 3.0
pair_coeff 1 2 75.398 1.0 0.0 10.0 9.0
pair_coeff 2 2 39.478 1.0 10.0 10.0 25.0 :pre
[Description:]
Style {colloid} computes pairwise interactions between large colloidal
particles and small solvent particles using 3 formulas. A colloidal
particle has a size > sigma; a solvent particle is the usual
Lennard-Jones particle of size sigma.
The colloid-colloid interaction energy is given by
:c,image(Eqs/pair_colloid_cc.jpg)
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
"(Everaers)"_#Everaers.
The colloid-solvent interaction energy is given by
:c,image(Eqs/pair_colloid_cs.jpg)
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.
The solvent-solvent interaction energy is given by the usual
Lennard-Jones formula
:c,image(Eqs/pair_colloid_ss.jpg)
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
"read_data"_read_data.html or "read_restart"_read_restart.html
commands, or by mixing as described below:
A (energy units)
sigma (distance units)
d1 (distance units)
d2 (distance units)
cutoff (distance units) :ul
A is the Hamaker energy prefactor and should typically be set as
follows:
A_cc = colloid/colloid = 4 pi^2 = 39.5
A_cs = colloid/solvent = sqrt(A_cc*A_ss)
A_ss = solvent/solvent = 144 (assuming epsilon = 1, so that 144/36 = 4) :ul
Sigma is the size of the solvent particle or the constituent particles
integrated over in the colloidal particle and should typically be set
as follows:
Sigma_cc = colloid/colloid = 1.0
Sigma_cs = colloid/solvent = arithmetic mixing between colloid sigma and solvent sigma
Sigma_ss = solvent/solvent = 1.0 or whatever size the solvent particle is :ul
Thus typically Sigma_cs = 1.0, unless the solvent particle's size !=
1.0.
D1 and d2 are particle diameters, so that d1 = 2*a1 and d2 = 2*a2 in
the formulas above. Both d1 and d2 must be values >= 0. If d1 > 0
and d2 > 0, then the pair interacts via the colloid-colloid formula
above. If d1 = 0 and d2 = 0, then the pair interacts via the
solvent-solvent formula. I.e. a d value of 0 is a Lennard-Jones
particle of size sigma. If either d1 = 0 or d2 = 0 and the other is
larger, then the pair interacts via the colloid-solvent formula.
Note that the diameter of a particular particle type may appear in
multiple pair_coeff commands, as it interacts with other particle
types. You should insure the particle diameter is specified
consistently each time it appears.
The last coefficient is optional. If not specified, the global cutoff
specified in the pair_style command is used. However, you typically
want different cutoffs for interactions between different particle
sizes. E.g. if colloidal particles of diameter 10 are used with
solvent particles of diameter 1, then a solvent-solvent cutoff of 2.5
would correspond to a colloid-colloid cutoff of 25. A good
rule-of-thumb is to use a colloid-solvent cutoff that is half the big
diameter + 4 times the small diameter. I.e. 9 = 5 + 4 for the
colloid-solvent cutoff in this case.
IMPORTANT NOTE: When using pair_style colloid for a mixture with 2 (or
more) widely different particles sizes (e.g. sigma=10 colloids in a
background sigam=1 LJ fluid), you will likely want to use these
commands for efficiency: "neighbor multi"_neighbor.html and
"communicate multi"_communicate.html.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the A, sigma, d1, and d2
coefficients and cutoff distance for this pair style can be mixed. A
is an energy value mixed like a LJ epsilon. D1 and d2 are distance
values and are mixed like sigma. 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#start_3 section for more info.
Normally, this pair style should be used with finite-size particles
which have a diameter, e.g. see the "atom_style
sphere"_atom_style.html command. However, this is not a requirement,
since the only definition of particle size is via the pair_coeff
parameters for each type. In other words, the physical radius of the
particle is ignored. Thus you should insure that the d1,d2 parameters
you specify are consistent with the physical size of the particles of
that type.
Per-particle polydispersity is not yet supported by this pair style;
only per-type polydispersity is enabled via the pair_coeff parameters.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Everaers)
[(Everaers)] Everaers, Ejtehadi, Phys Rev E, 67, 041710 (2003).
diff --git a/doc/pair_comb.html b/doc/pair_comb.html
index 55ec1beb1..62c64c55e 100644
--- a/doc/pair_comb.html
+++ b/doc/pair_comb.html
@@ -1,263 +1,263 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style comb command
</H3>
<H3>pair_style comb/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style comb
</PRE>
<P><B>Examples:</B>
</P>
<PRE>pair_style comb
pair_coeff * * ../potentials/ffield.comb Si
pair_coeff * * ../potentials/ffield.comb Hf Si O
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>comb</I> computes a variable charge COMB (Charge-Optimized
Many-Body) potential as described in <A HREF = "#COMB_1">(COMB_1)</A> and
<A HREF = "#COMB_2">(COMB_2)</A>. The energy E of a system of atoms
is given by
</P>
<CENTER><IMG SRC = "Eqs/pair_comb1.jpg">
</CENTER>
<P>where <I>E<sub>T</sub></I> is the total potential energy of the system,
<I>E<sup>S</sup><sub>i</sub></I> is the self-energy term of atom <I>i</I>,
<I>V<sub>ij</sub></I> is the interatomic potential between the <I>i</I>th and
<I>j</I>th atoms, <I>r<sub>ij</sub></I> is the distance of the atoms <I>i</I> and
<I>j</I>, and <I>q<sub>i</sub></I> and <I>q<sub>j</sub></I> are charges of the atoms,
and <I>E<sup>BB</sup><sub>i</sub></I> is the bond-bending term of atom <I>i</I>.
</P>
<P>The interatomic potential energy <I>V<sub>ij</sub></I> consists of four
components: two-body short-range repulsion,
<I>U<sup>R</sup><sub>ij</sub></I>, many-body short-range attraction,
<I>U<sup>A</sup><sub>ij</sub></I>, long-range Coulombic electrostatic
interaction, <I>U<sup>I</sup><sub>ij</sub></I>, and van der Waals energy,
<I>U<sup>V</sup><sub>ij</sub></I>, which are defined as:
</P>
<CENTER><IMG SRC = "Eqs/pair_comb2.jpg">
</CENTER>
<P>The short-range repulsion and attraction are based on the
<A HREF = "#Tersoff">Tersoff</A> potential (see the <A HREF = "pair_tersoff.html">pair_style
tersoff</A> command); thus for a zero-charge pure
element system with no van der Waals interaction, the COMB potential
reduces to Tersoff potential, typically truncated at a short cutoff,
e.g. 3 to 4 Angstroms. The long-range Coulombic term uses the Wolf
summation method described in <A HREF = "#Wolf">Wolf</A>, spherically truncated at a
longer cutoff, e.g. 12 Angstroms.
</P>
<P>The COMB potential is a variable charge potential. The equilibrium
charge on each atom is calculated by the electronegativity
equalization (QEq) method. See <A HREF = "#Rick">Rick</A> for further details.
This is implemented by the <A HREF = "fix_qeq_comb.html">fix qeq/comb</A> command,
which should normally be specified in the input script when running a
model with the COMB potential. The <A HREF = "fix_qeq_comb.html">fix qeq/comb</A>
command has options that determine how often charge equilibration is
performed, its convergence criterion, and which atoms are included in
the calculation.
</P>
<P>Only a single pair_coeff command is used with the <I>comb</I> style which
specifies the COMB potential file with parameters for all needed
elements. These are mapped to LAMMPS atom types by specifying N
additional arguments after the potential file in the pair_coeff
command, where N is the number of LAMMPS atom types. The provided
potential file <I>ffield.comb</I> contains all currently-available COMB
parameterizations: for Si, Cu, Hf, Ti, O, their oxides and Zr, Zn and
U metals.
</P>
<P>For example, if your LAMMPS simulation of a Si/SiO<sub>2</sub>/
HfO<sub>2</sub> interface has 4 atom types, and you want the 1st and
last to be Si, the 2nd to be Hf, and the 3rd to be O, and you would
use the following pair_coeff command:
</P>
<PRE>pair_coeff * * ../potentials/ffield.comb Si Hf O Si
</PRE>
<P>The first two arguments must be * * so as to span all LAMMPS atom
types. The first and last Si arguments map LAMMPS atom types 1 and 4
to the Si element in the <I>ffield.comb</I> file. The second Hf argument
maps LAMMPS atom type 2 to the Hf element, and the third O argument
maps LAMMPS atom type 3 to the O element in the potential file. If a
mapping value is specified as NULL, the mapping is not performed.
This can be used when a <I>comb</I> potential is used as part of the
<I>hybrid</I> pair style. The NULL values are placeholders for atom types
that will be used with other potentials.
</P>
<P>The <I>ffield.comb</I> potential file is in the <I>potentials</I> directory of
the LAMMPS distribution. Lines that are not blank or comments
(starting with #) define parameters for a triplet of elements. The 49
parameters in a single entry correspond to coefficients in the formula
above:
</P>
<UL><LI>element 1 (the center atom in a 3-body interaction)
<LI>element 2 (the atom bonded to the center atom)
<LI>element 3 (the atom influencing the 1-2 bond in a bond-order sense)
<LI>m
<LI>c
<LI>d
<LI>h (cos_theta0 (can be a value -1 or 1))
<LI>n
<LI>beta
<LI>lambda21, lambda2 of element 1 (1/distance units)
<LI>lambda22, lambda2 of element 2 (1/distance units)
<LI>B of element 1 (energy units)
<LI>B of element 2 (energy units)
<LI>R (cutoff, distance units, 0.5*(r_outer + r_inner))
<LI>D (cutoff, distance units, R - r_inner)
<LI>lambda11, lambda1 of element 1 (1/distance units)
<LI>lambda12, lambda1 of element 2 (1/distance units)
<LI>A of element 1 (energy units)
<LI>A of element 2 (energy units)
<LI>K_LP_1 (energy units, 1st order Legendre polynomial coefficient)
<LI>K_LP_3 (energy units, 3rd order Legendre polynomial coefficient)
<LI>K_LP_6 (energy units, 6th order Legendre polynomial coefficient)
<LI>A123 (cos_theta, theta = equilibrium MOM or OMO bond angles)
<LI>Aconf (cos_theta, theta = equilibrium MOM or OMO bond-bending coefficient)
<LI>addrep (energy units, additional repulsion)
<LI>R_omiga_a (unit-less scaler for A)
<LI>R_omiga_b (unit-less scaler for B)
<LI>R_omiga_c (unit-less scaler for 0.5*(lambda21+lambda22))
<LI>R_omiga_d (unit-less scaler for 0.5*(lambda11+lambda12))
<LI>QL1 (charge units, lower charge limit for element 1)
<LI>QU1 (charge units, upper charge limit for element 1)
<LI>DL1 (distance units, ion radius of element 1 with charge QL1)
<LI>DU1 (distance units, ion radius of element 1 with charge QU1)
<LI>QL2 (charge units, lower charge limit for element 2)
<LI>QU2 (charge units, upper charge limit for element 2)
<LI>DL2 (distance units, ion radius of element 2 with charge QL2)
<LI>DU2 (distance units, ion radius of element 2 with charge QU2)
<LI>chi (energy units, self energy 1st power term)
<LI>dJ (energy units, self energy 2nd power term)
<LI>dK (energy units, self energy 3rd power term)
<LI>dL (energy units, self energy 4th power term)
<LI>dM (energy units, self energy 6th power term)
<LI>esm (distance units, orbital exponent)
<LI>cmn1 (self energy penalty, rho 1 of element 1)
<LI>cml1 (self energy penalty, rho 1 of element 2)
<LI>cmn2 (self energy penalty, rho 2 of element 1)
<LI>cmn2 (self energy penalty, rho 2 of element 2)
<LI>coulcut (long range Coulombic cutoff, distance units)
<LI>hfocor (coordination term)
</UL>
<P>The parameterization of COMB potentials start with a pure element
(e.g. Si, Cu) then extend to its oxide and polymorphs
(e.g. SiO<sub>2</sub>, Cu<sub>2</sub>O). For interactions not
involving oxygen (e.g. Si-Cu or Hf-Zr), the COMB potential uses a
mixing rule to generate these parameters. For furthur details on the
parameterization and parameters, see the <A HREF = "pair_tersoff.html">Tersoff</A>
doc page and the COMB publications <A HREF = "#COMB_1">(COMB_1)</A> and
<A HREF = "#COMB_2">(COMB_2)</A>. For more details on 3-body interaction types
(e.g. SiSiO vs SiOSi), the mixing rule, and how to generate the
potential file, please see the <A HREF = "pair_tersoff.html">Tersoff</A> doc page.
</P>
<P>In the potentials directory, the file <I>ffield.comb</I> provides the
LAMMPS parameters for COMB's Si, Cu, Ti, Hf and their oxides, as well
as pure U, Zn and Zr metals. This file can be used for pure elements
(e.g. Si, Zr), binary oxides, binary alloys (e.g. SiCu, TiZr), and
complex systems. Note that alloys and complex systems require all
3-body entries be pre-defined in the potential file.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, mixing is performed by LAMMPS as
described above from values in the potential file.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift, table, and tail options.
</P>
<P>This pair style does not write its information to <A HREF = "restart.html">binary restart
files</A>, since it is stored in potential files. Thus, you
need to re-specify the pair_style, pair_coeff, and <A HREF = "fix_qeq_comb.html">fix
qeq/comb</A> commands in an input script that reads a
restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package (which it is by default). See
the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section for more info.
</P>
<P>This pair style requires the <A HREF = "newton.html">newton</A> setting to be "on"
for pair interactions.
</P>
<P>The COMB potentials in the <I>ffield.comb</I> file provided with LAMMPS
(see the potentials directory) are parameterized for metal
<A HREF = "units.html">units</A>. You can use the COMB potential with any LAMMPS
units, but you would need to create your own COMB potential file with
coefficients listed in the appropriate units if your simulation
doesn't use "metal" units.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_style.html">pair_style</A>, <A HREF = "pair_coeff.html">pair_coeff</A>,
<A HREF = "fix_qeq_comb.html">fix_qeq/comb</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "COMB_1"></A>
<P><B>(COMB_1)</B> J. Yu, S. B. Sinnott, S. R. Phillpot, Phys Rev B, 75, 085311 (2007),
</P>
<A NAME = "COMB_2"></A>
<P><B>(COMB_2)</B> T.-R. Shan, B. D. Devine, T. W. Kemper, S. B. Sinnott, S. R.
Phillpot, Phys Rev B, 81, 125328 (2010).
</P>
<A NAME = "Tersoff"></A>
<P><B>(Tersoff)</B> J. Tersoff, Phys Rev B, 37, 6991 (1988).
</P>
<A NAME = "Rick"></A>
<P><B>(Rick)</B> S. W. Rick, S. J. Stuart, B. J. Berne, J Chem Phys 101, 6141
(1994).
</P>
<A NAME = "Wolf"></A>
<P><B>(Wolf)</B> D. Wolf, P. Keblinski, S. R. Phillpot, J. Eggebrecht, J Chem
Phys, 110, 8254 (1999).
</P>
</HTML>
diff --git a/doc/pair_comb.txt b/doc/pair_comb.txt
index 9ec7ede78..2ea8f2fc7 100644
--- a/doc/pair_comb.txt
+++ b/doc/pair_comb.txt
@@ -1,252 +1,252 @@
"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 comb command :h3
pair_style comb/omp command :h3
[Syntax:]
pair_style comb :pre
[Examples:]
pair_style comb
pair_coeff * * ../potentials/ffield.comb Si
pair_coeff * * ../potentials/ffield.comb Hf Si O :pre
[Description:]
Style {comb} computes a variable charge COMB (Charge-Optimized
Many-Body) potential as described in "(COMB_1)"_#COMB_1 and
"(COMB_2)"_#COMB_2. The energy E of a system of atoms
is given by
:c,image(Eqs/pair_comb1.jpg)
where {E<sub>T</sub>} is the total potential energy of the system,
{E<sup>S</sup><sub>i</sub>} is the self-energy term of atom {i},
{V<sub>ij</sub>} is the interatomic potential between the {i}th and
{j}th atoms, {r<sub>ij</sub>} is the distance of the atoms {i} and
{j}, and {q<sub>i</sub>} and {q<sub>j</sub>} are charges of the atoms,
and {E<sup>BB</sup><sub>i</sub>} is the bond-bending term of atom {i}.
The interatomic potential energy {V<sub>ij</sub>} consists of four
components: two-body short-range repulsion,
{U<sup>R</sup><sub>ij</sub>}, many-body short-range attraction,
{U<sup>A</sup><sub>ij</sub>}, long-range Coulombic electrostatic
interaction, {U<sup>I</sup><sub>ij</sub>}, and van der Waals energy,
{U<sup>V</sup><sub>ij</sub>}, which are defined as:
:c,image(Eqs/pair_comb2.jpg)
The short-range repulsion and attraction are based on the
"Tersoff"_#Tersoff potential (see the "pair_style
tersoff"_pair_tersoff.html command); thus for a zero-charge pure
element system with no van der Waals interaction, the COMB potential
reduces to Tersoff potential, typically truncated at a short cutoff,
e.g. 3 to 4 Angstroms. The long-range Coulombic term uses the Wolf
summation method described in "Wolf"_#Wolf, spherically truncated at a
longer cutoff, e.g. 12 Angstroms.
The COMB potential is a variable charge potential. The equilibrium
charge on each atom is calculated by the electronegativity
equalization (QEq) method. See "Rick"_#Rick for further details.
This is implemented by the "fix qeq/comb"_fix_qeq_comb.html command,
which should normally be specified in the input script when running a
model with the COMB potential. The "fix qeq/comb"_fix_qeq_comb.html
command has options that determine how often charge equilibration is
performed, its convergence criterion, and which atoms are included in
the calculation.
Only a single pair_coeff command is used with the {comb} style which
specifies the COMB potential file with parameters for all needed
elements. These are mapped to LAMMPS atom types by specifying N
additional arguments after the potential file in the pair_coeff
command, where N is the number of LAMMPS atom types. The provided
potential file {ffield.comb} contains all currently-available COMB
parameterizations: for Si, Cu, Hf, Ti, O, their oxides and Zr, Zn and
U metals.
For example, if your LAMMPS simulation of a Si/SiO<sub>2</sub>/
HfO<sub>2</sub> interface has 4 atom types, and you want the 1st and
last to be Si, the 2nd to be Hf, and the 3rd to be O, and you would
use the following pair_coeff command:
pair_coeff * * ../potentials/ffield.comb Si Hf O Si :pre
The first two arguments must be * * so as to span all LAMMPS atom
types. The first and last Si arguments map LAMMPS atom types 1 and 4
to the Si element in the {ffield.comb} file. The second Hf argument
maps LAMMPS atom type 2 to the Hf element, and the third O argument
maps LAMMPS atom type 3 to the O element in the potential file. If a
mapping value is specified as NULL, the mapping is not performed.
This can be used when a {comb} potential is used as part of the
{hybrid} pair style. The NULL values are placeholders for atom types
that will be used with other potentials.
The {ffield.comb} potential file is in the {potentials} directory of
the LAMMPS distribution. Lines that are not blank or comments
(starting with #) define parameters for a triplet of elements. The 49
parameters in a single entry correspond to coefficients in the formula
above:
element 1 (the center atom in a 3-body interaction)
element 2 (the atom bonded to the center atom)
element 3 (the atom influencing the 1-2 bond in a bond-order sense)
m
c
d
h (cos_theta0 (can be a value -1 or 1))
n
beta
lambda21, lambda2 of element 1 (1/distance units)
lambda22, lambda2 of element 2 (1/distance units)
B of element 1 (energy units)
B of element 2 (energy units)
R (cutoff, distance units, 0.5*(r_outer + r_inner))
D (cutoff, distance units, R - r_inner)
lambda11, lambda1 of element 1 (1/distance units)
lambda12, lambda1 of element 2 (1/distance units)
A of element 1 (energy units)
A of element 2 (energy units)
K_LP_1 (energy units, 1st order Legendre polynomial coefficient)
K_LP_3 (energy units, 3rd order Legendre polynomial coefficient)
K_LP_6 (energy units, 6th order Legendre polynomial coefficient)
A123 (cos_theta, theta = equilibrium MOM or OMO bond angles)
Aconf (cos_theta, theta = equilibrium MOM or OMO bond-bending coefficient)
addrep (energy units, additional repulsion)
R_omiga_a (unit-less scaler for A)
R_omiga_b (unit-less scaler for B)
R_omiga_c (unit-less scaler for 0.5*(lambda21+lambda22))
R_omiga_d (unit-less scaler for 0.5*(lambda11+lambda12))
QL1 (charge units, lower charge limit for element 1)
QU1 (charge units, upper charge limit for element 1)
DL1 (distance units, ion radius of element 1 with charge QL1)
DU1 (distance units, ion radius of element 1 with charge QU1)
QL2 (charge units, lower charge limit for element 2)
QU2 (charge units, upper charge limit for element 2)
DL2 (distance units, ion radius of element 2 with charge QL2)
DU2 (distance units, ion radius of element 2 with charge QU2)
chi (energy units, self energy 1st power term)
dJ (energy units, self energy 2nd power term)
dK (energy units, self energy 3rd power term)
dL (energy units, self energy 4th power term)
dM (energy units, self energy 6th power term)
esm (distance units, orbital exponent)
cmn1 (self energy penalty, rho 1 of element 1)
cml1 (self energy penalty, rho 1 of element 2)
cmn2 (self energy penalty, rho 2 of element 1)
cmn2 (self energy penalty, rho 2 of element 2)
coulcut (long range Coulombic cutoff, distance units)
hfocor (coordination term) :ul
The parameterization of COMB potentials start with a pure element
(e.g. Si, Cu) then extend to its oxide and polymorphs
(e.g. SiO<sub>2</sub>, Cu<sub>2</sub>O). For interactions not
involving oxygen (e.g. Si-Cu or Hf-Zr), the COMB potential uses a
mixing rule to generate these parameters. For furthur details on the
parameterization and parameters, see the "Tersoff"_pair_tersoff.html
doc page and the COMB publications "(COMB_1)"_#COMB_1 and
"(COMB_2)"_#COMB_2. For more details on 3-body interaction types
(e.g. SiSiO vs SiOSi), the mixing rule, and how to generate the
potential file, please see the "Tersoff"_pair_tersoff.html doc page.
In the potentials directory, the file {ffield.comb} provides the
LAMMPS parameters for COMB's Si, Cu, Ti, Hf and their oxides, as well
as pure U, Zn and Zr metals. This file can be used for pure elements
(e.g. Si, Zr), binary oxides, binary alloys (e.g. SiCu, TiZr), and
complex systems. Note that alloys and complex systems require all
3-body entries be pre-defined in the potential file.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, mixing is performed by LAMMPS as
described above from values in the potential file.
This pair style does not support the "pair_modify"_pair_modify.html
shift, table, and tail options.
This pair style does not write its information to "binary restart
files"_restart.html, since it is stored in potential files. Thus, you
need to re-specify the pair_style, pair_coeff, and "fix
qeq/comb"_fix_qeq_comb.html commands 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 pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package (which it is by default). See
the "Making LAMMPS"_Section_start.html#start_3 section for more info.
This pair style requires the "newton"_newton.html setting to be "on"
for pair interactions.
The COMB potentials in the {ffield.comb} file provided with LAMMPS
(see the potentials directory) are parameterized for metal
"units"_units.html. You can use the COMB potential with any LAMMPS
units, but you would need to create your own COMB potential file with
coefficients listed in the appropriate units if your simulation
doesn't use "metal" units.
[Related commands:]
"pair_style"_pair_style.html, "pair_coeff"_pair_coeff.html,
"fix_qeq/comb"_fix_qeq_comb.html
[Default:] none
:line
:link(COMB_1)
[(COMB_1)] J. Yu, S. B. Sinnott, S. R. Phillpot, Phys Rev B, 75, 085311 (2007),
:link(COMB_2)
[(COMB_2)] T.-R. Shan, B. D. Devine, T. W. Kemper, S. B. Sinnott, S. R.
Phillpot, Phys Rev B, 81, 125328 (2010).
:link(Tersoff)
[(Tersoff)] J. Tersoff, Phys Rev B, 37, 6991 (1988).
:link(Rick)
[(Rick)] S. W. Rick, S. J. Stuart, B. J. Berne, J Chem Phys 101, 6141
(1994).
:link(Wolf)
[(Wolf)] D. Wolf, P. Keblinski, S. R. Phillpot, J. Eggebrecht, J Chem
Phys, 110, 8254 (1999).
diff --git a/doc/pair_coul.html b/doc/pair_coul.html
index 9e0951880..5aad58b33 100644
--- a/doc/pair_coul.html
+++ b/doc/pair_coul.html
@@ -1,164 +1,196 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style coul/cut command
</H3>
<H3>pair_style coul/cut/omp command
</H3>
<H3>pair_style coul/debye command
</H3>
<H3>pair_style coul/debye/omp command
</H3>
<H3>pair_style coul/long command
</H3>
<H3>pair_style coul/long/omp command
</H3>
<H3>pair_style coul/long/gpu command
</H3>
+<H3>pair_style coul/wolf command
+</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style coul/cut cutoff
pair_style coul/debye kappa cutoff
pair_style coul/long cutoff
pair_style coul/long/gpu cutoff
+pair_sytle coul/wolf alpha cutoff
</PRE>
<UL><LI>cutoff = global cutoff for Coulombic interactions
<LI>kappa = Debye length (inverse distance units)
+<LI>alpha = damping parameter (inverse distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style coul/cut 2.5
pair_coeff * *
pair_coeff 2 2 3.5
</PRE>
<PRE>pair_style coul/debye 1.4 3.0
pair_coeff * *
pair_coeff 2 2 3.5
</PRE>
<PRE>pair_style coul/long 10.0
pair_coeff * *
</PRE>
+<P>pair_style coul/wolf 0.2 9.0
+pair_coeff * *
+</P>
<P><B>Description:</B>
</P>
<P>The <I>coul/cut</I> style computes the standard Coulombic interaction
potential given by
</P>
<CENTER><IMG SRC = "Eqs/pair_coulomb.jpg">
</CENTER>
<P>where C is an energy-conversion constant, Qi and Qj are the charges on
the 2 atoms, and epsilon is the dielectric constant which can be set
by the <A HREF = "dielectric.html">dielectric</A> command. The cutoff Rc truncates
the interaction distance.
</P>
<P>Style <I>coul/debye</I> adds an additional exp() damping factor to the
Coulombic term, given by
</P>
<CENTER><IMG SRC = "Eqs/pair_debye.jpg">
</CENTER>
<P>where kappa is the Debye length. This potential is another way to
mimic the screening effect of a polar solvent.
</P>
+<P>Style <I>coul/wolf</I> computes Coulombic interactions via the Wolf
+summation method, described in <A HREF = "#Wolf">Wolf</A>, given by:
+</P>
+<CENTER><IMG SRC = "Eqs/pair_coul_wolf.jpg">
+</CENTER>
+<P>where <I>alpha</I> is the damping parameter, and erc() and erfc() are
+error-fuction and complementary error-function terms. This potential
+is essentially a short-range, spherically-truncated,
+charge-neutralized, shifted, pairwise <I>1/r</I> summation. With a
+manipulation of adding and substracting a self term (for i = j) to the
+first and second term on the right-hand-side, respectively, and a
+small enough <I>alpha</I> damping parameter, the second term shrinks and
+the potential becomes a rapidly-converging real-space summation. With
+a long enough cutoff and small enough alpha parameter, the energy and
+forces calcluated by the Wolf summation method approach those of the
+Ewald sum. So it is a means of getting effective long-range
+interactions with a short-range potential.
+</P>
<P>Style <I>coul/long</I> computes the same Coulombic interactions as style
<I>coul/cut</I> except that an additional damping factor is applied so it
can be used in conjunction with the <A HREF = "kspace_style.html">kspace_style</A>
command and its <I>ewald</I> or <I>pppm</I> option. The Coulombic cutoff
specified for this style means that pairwise interactions within this
distance are computed directly; interactions outside that distance are
computed in reciprocal space.
</P>
<P>These potentials are designed to be combined with other pair
potentials via the <A HREF = "pair_hybrid.html">pair_style hybrid/overlay</A>
command. This is because they have no repulsive core. Hence if they
are used by themselves, there will be no repulsion to keep two
oppositely charged particles from overlapping each other.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>cutoff (distance units)
</UL>
<P>For <I>coul/cut</I> and <I>coul/debye</I>, the cutoff coefficient is optional.
If it is not used (as in some of the examples above), the default
global value specified in the pair_style command is used.
</P>
<P>For <I>coul/long</I> no cutoff can be specified for an individual I,J type
pair via the pair_coeff command. All type pairs use the same global
Coulombic cutoff specified in the pair_style command.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the cutoff distance for the
<I>coul/cut</I> style can be mixed. The default mix value is <I>geometric</I>.
See the "pair_modify" command for details.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> shift option is not relevant
for these pair styles.
</P>
<P>The <I>coul/long</I> style supports the <A HREF = "pair_modify.html">pair_modify</A>
table option for tabulation of the short-range portion of the
long-range Coulombic interaction.
</P>
<P>These pair styles do not support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding long-range tail corrections to energy and
pressure.
</P>
<P>These pair styles write their information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>The <I>coul/long</I> style is part of the KSPACE package. It is only
enabled if LAMMPS was built with that package (which it is by
default). See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "pair_hybrid.html">pair_style
hybrid/overlay</A>
</P>
<P><B>Default:</B> none
</P>
+<HR>
+
+<A NAME = "Wolf"></A>
+
+<P><B>(Wolf)</B> D. Wolf, P. Keblinski, S. R. Phillpot, J. Eggebrecht, J Chem
+Phys, 110, 8254 (1999).
+</P>
</HTML>
diff --git a/doc/pair_coul.txt b/doc/pair_coul.txt
index 44168cd1c..42b0582de 100644
--- a/doc/pair_coul.txt
+++ b/doc/pair_coul.txt
@@ -1,153 +1,183 @@
"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 coul/cut command :h3
pair_style coul/cut/omp command :h3
pair_style coul/debye command :h3
pair_style coul/debye/omp command :h3
pair_style coul/long command :h3
pair_style coul/long/omp command :h3
pair_style coul/long/gpu command :h3
+pair_style coul/wolf command :h3
[Syntax:]
pair_style coul/cut cutoff
pair_style coul/debye kappa cutoff
pair_style coul/long cutoff
-pair_style coul/long/gpu cutoff :pre
+pair_style coul/long/gpu cutoff
+pair_sytle coul/wolf alpha cutoff :pre
cutoff = global cutoff for Coulombic interactions
-kappa = Debye length (inverse distance units) :ul
+kappa = Debye length (inverse distance units)
+alpha = damping parameter (inverse distance units) :ul
[Examples:]
pair_style coul/cut 2.5
pair_coeff * *
pair_coeff 2 2 3.5 :pre
pair_style coul/debye 1.4 3.0
pair_coeff * *
pair_coeff 2 2 3.5 :pre
pair_style coul/long 10.0
pair_coeff * * :pre
+pair_style coul/wolf 0.2 9.0
+pair_coeff * *
+
[Description:]
The {coul/cut} style computes the standard Coulombic interaction
potential given by
:c,image(Eqs/pair_coulomb.jpg)
where C is an energy-conversion constant, Qi and Qj are the charges on
the 2 atoms, and epsilon is the dielectric constant which can be set
by the "dielectric"_dielectric.html command. The cutoff Rc truncates
the interaction distance.
Style {coul/debye} adds an additional exp() damping factor to the
Coulombic term, given by
:c,image(Eqs/pair_debye.jpg)
where kappa is the Debye length. This potential is another way to
mimic the screening effect of a polar solvent.
+Style {coul/wolf} computes Coulombic interactions via the Wolf
+summation method, described in "Wolf"_#Wolf, given by:
+
+:c,image(Eqs/pair_coul_wolf.jpg)
+
+where {alpha} is the damping parameter, and erc() and erfc() are
+error-fuction and complementary error-function terms. This potential
+is essentially a short-range, spherically-truncated,
+charge-neutralized, shifted, pairwise {1/r} summation. With a
+manipulation of adding and substracting a self term (for i = j) to the
+first and second term on the right-hand-side, respectively, and a
+small enough {alpha} damping parameter, the second term shrinks and
+the potential becomes a rapidly-converging real-space summation. With
+a long enough cutoff and small enough alpha parameter, the energy and
+forces calcluated by the Wolf summation method approach those of the
+Ewald sum. So it is a means of getting effective long-range
+interactions with a short-range potential.
+
Style {coul/long} computes the same Coulombic interactions as style
{coul/cut} except that an additional damping factor is applied so it
can be used in conjunction with the "kspace_style"_kspace_style.html
command and its {ewald} or {pppm} option. The Coulombic cutoff
specified for this style means that pairwise interactions within this
distance are computed directly; interactions outside that distance are
computed in reciprocal space.
These potentials are designed to be combined with other pair
potentials via the "pair_style hybrid/overlay"_pair_hybrid.html
command. This is because they have no repulsive core. Hence if they
are used by themselves, there will be no repulsion to keep two
oppositely charged particles from overlapping each other.
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:
cutoff (distance units) :ul
For {coul/cut} and {coul/debye}, the cutoff coefficient is optional.
If it is not used (as in some of the examples above), the default
global value specified in the pair_style command is used.
For {coul/long} no cutoff can be specified for an individual I,J type
pair via the pair_coeff command. All type pairs use the same global
Coulombic cutoff specified in the pair_style command.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the cutoff distance for the
{coul/cut} style can be mixed. The default mix value is {geometric}.
See the "pair_modify" command for details.
The "pair_modify"_pair_modify.html shift option is not relevant
for these pair styles.
The {coul/long} style supports the "pair_modify"_pair_modify.html
table option for tabulation of the short-range portion of the
long-range Coulombic interaction.
These pair styles do not support the "pair_modify"_pair_modify.html
tail option for adding long-range tail corrections to energy and
pressure.
These pair styles write their 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:]
The {coul/long} style is part of the KSPACE package. It is only
enabled if LAMMPS was built with that package (which it is by
default). See the "Making LAMMPS"_Section_start.html#start_3 section
for more info.
[Related commands:]
"pair_coeff"_pair_coeff.html, "pair_style
hybrid/overlay"_pair_hybrid.html
[Default:] none
+
+:line
+
+:link(Wolf)
+[(Wolf)] D. Wolf, P. Keblinski, S. R. Phillpot, J. Eggebrecht, J Chem
+Phys, 110, 8254 (1999).
diff --git a/doc/pair_dipole.html b/doc/pair_dipole.html
index 0c259887b..3f1a5ce94 100644
--- a/doc/pair_dipole.html
+++ b/doc/pair_dipole.html
@@ -1,216 +1,216 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style dipole/cut command
</H3>
<H3>pair_style dipole/cut/omp command
</H3>
<H3>pair_style dipole/sf command
</H3>
<H3>pair_style dipole/sf/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style dipole/cut cutoff (cutoff2)
</PRE>
<PRE>pair_style dipole/sf cutoff (cutoff2)
</PRE>
<UL><LI>cutoff = global cutoff LJ (and Coulombic if only 1 arg) (distance units)
<LI>cutoff2 = global cutoff for Coulombic (optional) (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style dipole/cut 10.0
pair_coeff * * 1.0 1.0
pair_coeff 2 3 1.0 1.0 2.5 4.0
</PRE>
<PRE>pair_style dipole/sf 9.0
pair_coeff * * 1.0 1.0
pair_coeff 2 3 1.0 1.0 2.5 4.0
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>dipole/cut</I> computes interactions between pairs of particles
that each have a charge and/or a point dipole moment. In addition to
the usual Lennard-Jones interaction between the particles (Elj) the
charge-charge (Eqq), charge-dipole (Eqp), and dipole-dipole (Epp)
interactions are computed by these formulas for the energy (E), force
(F), and torque (T) between particles I and J.
</P>
<CENTER><IMG SRC = "Eqs/pair_dipole.jpg">
</CENTER>
<P>where qi and qj are the charges on the two particles, pi and pj are
the dipole moment vectors of the two particles, r is their separation
distance, and the vector r = Ri - Rj is the separation vector between
the two particles. Note that Eqq and Fqq are simply Coulombic energy
and force, Fij = -Fji as symmetric forces, and Tij != -Tji since the
torques do not act symmetrically. These formulas are discussed in
<A HREF = "#Allen">(Allen)</A> and in <A HREF = "#Toukmaji">(Toukmaji)</A>.
</P>
<P>Style <I>dipole/sf</I> computes "shifted-force" interactions between pairs
of particles that each have a charge and/or a point dipole moment. In
general, a shifted-force potential is a (sligthly) modified potential
containing extra terms that make both the energy and its derivative go
to zero at the cutoff distance; this removes (cutoff-related) problems
in energy conservation and any numerical instability in the equations
of motion <A HREF = "#Allen">(Allen)</A>. Shifted-force interactions for the
Lennard-Jones (E_LJ), charge-charge (Eqq), charge-dipole (Eqp),
dipole-charge (Epq) and dipole-dipole (Epp) potentials are computed by
these formulas for the energy (E), force (F), and torque (T) between
particles I and J:
</P>
<CENTER><IMG SRC = "Eqs/pair_dipole_sf.jpg">
</CENTER>
<CENTER><IMG SRC = "Eqs/pair_dipole_sf2.jpg">
</CENTER>
<P>where epsilon and sigma are the standard LJ parameters, r_c is the
cutoff, qi and qj are the charges on the two particles, pi and pj are
the dipole moment vectors of the two particles, r is their separation
distance, and the vector r = Ri - Rj is the separation vector between
the two particles. Note that Eqq and Fqq are simply Coulombic energy
and force, Fij = -Fji as symmetric forces, and Tij != -Tji since the
torques do not act symmetrically. The shifted-force formula for the
Lennard-Jones potential is reported in <A HREF = "#Stoddard">(Stoddard)</A>. The
original (unshifted) formulas for the electrostatic potentials, forces
and torques can be found in <A HREF = "#Price">(Price)</A>. The shifted-force
electrostatic potentials have been obtained by applying equation 5.13
of <A HREF = "#Allen">(Allen)</A>. The formulas for the corresponding forces and
torques have been obtained by applying the 'chain rule' as in appendix
C.3 of <A HREF = "#Allen">(Allen)</A>.
</P>
<P>If one cutoff is specified in the pair_style command, it is used for
both the LJ and Coulombic (q,p) terms. If two cutoffs are specified,
they are used as cutoffs for the LJ and Coulombic (q,p) terms
respectively.
</P>
<P>Atoms with dipole moments should be integrated using the <A HREF = "fix_nve_sphere.html">fix
nve/sphere update dipole</A> command to rotate the
dipole moments. The <A HREF = "compute_temp_sphere.html">compute temp/sphere</A>
command can be used to monitor the temperature, since it includes
rotational degrees of freedom. The <A HREF = "atom_style.html">atom_style
dipole</A> command should be used since it defines the
point dipoles and their rotational state. The magnitude of the dipole
moment for each type of particle can be defined by the
<A HREF = "dipole.html">dipole</A> command or in the "Dipoles" section of the data
file read in by the <A HREF = "read_data.html">read_data</A> command. Their initial
orientation can be defined by the <A HREF = "set.html">set dipole</A> command or in
the "Atoms" section of the data file.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>cutoff1 (distance units)
<LI>cutoff2 (distance units)
</UL>
<P>The latter 2 coefficients are optional. If not specified, the global
LJ and Coulombic cutoffs specified in the pair_style command are used.
If only one cutoff is specified, it is used as the cutoff for both LJ
and Coulombic interactions for this type pair. If both coefficients
are specified, they are used as the LJ and Coulombic cutoffs for this
type pair.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distances for this pair style can be mixed. The default
mix value is <I>geometric</I>. See the "pair_modify" command for details.
</P>
<P>For atom type pairs I,J and I != J, the A, sigma, d1, and d2
coefficients and cutoff distance for this pair style can be mixed. A
is an energy value mixed like a LJ epsilon. D1 and d2 are distance
values and are mixed like sigma. The default mix value is
<I>geometric</I>. See the "pair_modify" command for details.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift option for the energy of the Lennard-Jones portion of the pair
interaction; such energy goes to zero at the cutoff by construction.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for this pair style.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding long-range tail corrections to energy and
pressure.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<P><B>Restrictions:</B>
</P>
<P>The <I>dipole/cut</I> style is part of the DIPOLE package. It is only
enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>The <I>dipole/sf</I> style is part of the USER-MISC package. It is only
enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Allen"></A>
<P><B>(Allen)</B> Allen and Tildesley, Computer Simulation of Liquids,
Clarendon Press, Oxford, 1987.
</P>
<A NAME = "Toukmaji"></A>
<P><B>(Toukmaji)</B> Toukmaji, Sagui, Board, and Darden, J Chem Phys, 113,
10913 (2000).
</P>
<A NAME = "Stoddard"></A>
<P><B>(Stoddard)</B> Stoddard and Ford, Phys Rev A, 8, 1504 (1973).
</P>
<A NAME = "Price"></A>
<P><B>(Price)</B> Price, Stone and Alderton, Mol Phys, 52, 987 (1984).
</P>
</HTML>
diff --git a/doc/pair_dipole.txt b/doc/pair_dipole.txt
index d71ffef2e..f41ceb434 100755
--- a/doc/pair_dipole.txt
+++ b/doc/pair_dipole.txt
@@ -1,202 +1,202 @@
"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 dipole/cut command :h3
pair_style dipole/cut/omp command :h3
pair_style dipole/sf command :h3
pair_style dipole/sf/omp command :h3
[Syntax:]
pair_style dipole/cut cutoff (cutoff2) :pre
pair_style dipole/sf cutoff (cutoff2) :pre
cutoff = global cutoff LJ (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units) :ul
[Examples:]
pair_style dipole/cut 10.0
pair_coeff * * 1.0 1.0
pair_coeff 2 3 1.0 1.0 2.5 4.0 :pre
pair_style dipole/sf 9.0
pair_coeff * * 1.0 1.0
pair_coeff 2 3 1.0 1.0 2.5 4.0 :pre
[Description:]
Style {dipole/cut} computes interactions between pairs of particles
that each have a charge and/or a point dipole moment. In addition to
the usual Lennard-Jones interaction between the particles (Elj) the
charge-charge (Eqq), charge-dipole (Eqp), and dipole-dipole (Epp)
interactions are computed by these formulas for the energy (E), force
(F), and torque (T) between particles I and J.
:c,image(Eqs/pair_dipole.jpg)
where qi and qj are the charges on the two particles, pi and pj are
the dipole moment vectors of the two particles, r is their separation
distance, and the vector r = Ri - Rj is the separation vector between
the two particles. Note that Eqq and Fqq are simply Coulombic energy
and force, Fij = -Fji as symmetric forces, and Tij != -Tji since the
torques do not act symmetrically. These formulas are discussed in
"(Allen)"_#Allen and in "(Toukmaji)"_#Toukmaji.
Style {dipole/sf} computes "shifted-force" interactions between pairs
of particles that each have a charge and/or a point dipole moment. In
general, a shifted-force potential is a (sligthly) modified potential
containing extra terms that make both the energy and its derivative go
to zero at the cutoff distance; this removes (cutoff-related) problems
in energy conservation and any numerical instability in the equations
of motion "(Allen)"_#Allen. Shifted-force interactions for the
Lennard-Jones (E_LJ), charge-charge (Eqq), charge-dipole (Eqp),
dipole-charge (Epq) and dipole-dipole (Epp) potentials are computed by
these formulas for the energy (E), force (F), and torque (T) between
particles I and J:
:c,image(Eqs/pair_dipole_sf.jpg)
:c,image(Eqs/pair_dipole_sf2.jpg)
where epsilon and sigma are the standard LJ parameters, r_c is the
cutoff, qi and qj are the charges on the two particles, pi and pj are
the dipole moment vectors of the two particles, r is their separation
distance, and the vector r = Ri - Rj is the separation vector between
the two particles. Note that Eqq and Fqq are simply Coulombic energy
and force, Fij = -Fji as symmetric forces, and Tij != -Tji since the
torques do not act symmetrically. The shifted-force formula for the
Lennard-Jones potential is reported in "(Stoddard)"_#Stoddard. The
original (unshifted) formulas for the electrostatic potentials, forces
and torques can be found in "(Price)"_#Price. The shifted-force
electrostatic potentials have been obtained by applying equation 5.13
of "(Allen)"_#Allen. The formulas for the corresponding forces and
torques have been obtained by applying the 'chain rule' as in appendix
C.3 of "(Allen)"_#Allen.
If one cutoff is specified in the pair_style command, it is used for
both the LJ and Coulombic (q,p) terms. If two cutoffs are specified,
they are used as cutoffs for the LJ and Coulombic (q,p) terms
respectively.
Atoms with dipole moments should be integrated using the "fix
nve/sphere update dipole"_fix_nve_sphere.html command to rotate the
dipole moments. The "compute temp/sphere"_compute_temp_sphere.html
command can be used to monitor the temperature, since it includes
rotational degrees of freedom. The "atom_style
dipole"_atom_style.html command should be used since it defines the
point dipoles and their rotational state. The magnitude of the dipole
moment for each type of particle can be defined by the
"dipole"_dipole.html command or in the "Dipoles" section of the data
file read in by the "read_data"_read_data.html command. Their initial
orientation can be defined by the "set dipole"_set.html command or in
the "Atoms" section of the data file.
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:
epsilon (energy units)
sigma (distance units)
cutoff1 (distance units)
cutoff2 (distance units) :ul
The latter 2 coefficients are optional. If not specified, the global
LJ and Coulombic cutoffs specified in the pair_style command are used.
If only one cutoff is specified, it is used as the cutoff for both LJ
and Coulombic interactions for this type pair. If both coefficients
are specified, they are used as the LJ and Coulombic cutoffs for this
type pair.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distances for this pair style can be mixed. The default
mix value is {geometric}. See the "pair_modify" command for details.
For atom type pairs I,J and I != J, the A, sigma, d1, and d2
coefficients and cutoff distance for this pair style can be mixed. A
is an energy value mixed like a LJ epsilon. D1 and d2 are distance
values and are mixed like sigma. The default mix value is
{geometric}. See the "pair_modify" command for details.
This pair style does not support the "pair_modify"_pair_modify.html
shift option for the energy of the Lennard-Jones portion of the pair
interaction; such energy goes to zero at the cutoff by construction.
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.
[Restrictions:]
The {dipole/cut} style is part of the DIPOLE package. It is only
enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
The {dipole/sf} style is part of the USER-MISC package. It is only
enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Allen)
[(Allen)] Allen and Tildesley, Computer Simulation of Liquids,
Clarendon Press, Oxford, 1987.
:link(Toukmaji)
[(Toukmaji)] Toukmaji, Sagui, Board, and Darden, J Chem Phys, 113,
10913 (2000).
:link(Stoddard)
[(Stoddard)] Stoddard and Ford, Phys Rev A, 8, 1504 (1973).
:link(Price)
[(Price)] Price, Stone and Alderton, Mol Phys, 52, 987 (1984).
diff --git a/doc/pair_dpd.html b/doc/pair_dpd.html
index 40d1dae1f..b6c46cce0 100644
--- a/doc/pair_dpd.html
+++ b/doc/pair_dpd.html
@@ -1,188 +1,188 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style dpd command
</H3>
<H3>pair_style dpd/omp command
</H3>
<H3>pair_style dpd/tstat command
</H3>
<H3>pair_style dpd/tstat/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style dpd T cutoff seed
pair_style dpd/tstat Tstart Tstop cutoff seed
</PRE>
<UL><LI>T = temperature (temperature units)
<LI>Tstart,Tstop = desired temperature at start/end of run (temperature units)
<LI>cutoff = global cutoff for DPD interactions (distance units)
<LI>seed = random # seed (positive integer)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style dpd 1.0 2.5 34387
pair_coeff * * 3.0 1.0
pair_coeff 1 1 3.0 1.0 1.0
</PRE>
<PRE>pair_style dpd/tstat 1.0 1.0 2.5 34387
pair_coeff * * 1.0
pair_coeff 1 1 1.0 1.0
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>dpd</I> computes a force field for dissipative particle dynamics
(DPD) following the exposition in <A HREF = "#Groot">(Groot)</A>.
</P>
<P>Style <I>dpd/tstat</I> invokes a DPD thermostat on pairwise interactions,
which is equivalent to the non-conservative portion of the DPD force
field. This thermostat can be used in conjunction with any <A HREF = "pair_style.html">pair
style</A>, and in leiu of per-particle thermostats like
<A HREF = "fix_langevin.html">fix langevin</A> or ensemble thermostats like Nose
Hoover as implemented by <A HREF = "fix_nh.html">fix nvt</A>. To use <I>dpd/stat</I>
with another pair style, use the <A HREF = "pair_hybrid.html">pair_style
hybrid/overlay</A> command to compute both the desired
pair interaction and the thermostat for each pair of particles.
</P>
<P>For style <I>dpd</I>, the force on atom I due to atom J is given as a sum
of 3 terms
</P>
<CENTER><IMG SRC = "Eqs/pair_dpd.jpg">
</CENTER>
<P>where Fc is a conservative force, Fd is a dissipative force, and Fr is
a random force. Rij is a unit vector in the direction Ri - Rj, Vij is
the vector difference in velocities of the two atoms = Vi - Vj, alpha
is a Gaussian random number with zero mean and unit variance, dt is
the timestep size, and w(r) is a weighting factor that varies between
0 and 1. Rc is the cutoff. Sigma is set equal to sqrt(2 Kb T gamma),
where Kb is the Boltzmann constant and T is the temperature parameter
in the pair_style command.
</P>
<P>For style <I>dpd/tstat</I>, the force on atom I due to atom J is the same
as the above equation, except that the conservative Fc term is
dropped. Also, during the run, T is set each timestep to a ramped
value from Tstart to Tstop.
</P>
<P>For style <I>dpd</I>, the pairwise energy associated with style <I>dpd</I> is
only due to the conservative force term Fc, and is shifted to be zero
at the cutoff distance Rc. The pairwise virial is calculated using
all 3 terms. For style <I>dpd/tstat</I> there is no pairwise energy, but
the last two terms of the formula make a contribution to the virial.
</P>
<P>For style <I>dpd</I>, the following coefficients must be defined for each
pair of atoms types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in
the examples above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>A (force units)
<LI>gamma (force/velocity units)
<LI>cutoff (distance units)
</UL>
<P>The last coefficient is optional. If not specified, the global DPD
cutoff is used. Note that sigma is set equal to sqrt(2 T gamma),
where T is the temperature set by the <A HREF = "pair_style.html">pair_style</A>
command so it does not need to be specified.
</P>
<P>For style <I>dpd/tstat</I>, the coefficiencts defined for each pair of
atoms types via the <A HREF = "pair_coeff.html">pair_coeff</A> command is the same,
except that A is not included.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>These pair styles do not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
</P>
<P>These pair styles do not support the <A HREF = "pair_modify.html">pair_modify</A>
shift option for the energy of the pair interaction. Note that as
discussed above, the energy due to the conservative Fc term is already
shifted to be 0.0 at the cutoff distance Rc.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for these pair styles.
</P>
<P>These pair style do not support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding long-range tail corrections to energy and
pressure.
</P>
<P>These pair styles writes their information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file. Note
that the user-specified random number seed is stored in the restart
file, so when a simulation is restarted, each processor will
re-initialize its random number generator the same way it did
initially. This means the random forces will be random, but will not
be the same as they would have been if the original simulation had
continued past the restart time.
</P>
<P>These pair styles can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. They do not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<P>The <I>dpd/tstat</I> style can ramp its target temperature over multiple
runs, using the <I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A>
command. See the <A HREF = "run.html">run</A> command for details of how to do
this.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>The default frequency for rebuilding neighbor lists is every 10 steps
(see the <A HREF = "neigh_modify.html">neigh_modify</A> command). This may be too
infrequent for style <I>dpd</I> simulations since particles move rapidly
and can overlap by large amounts. If this setting yields a non-zero
number of "dangerous" reneighborings (printed at the end of a
simulation), you should experiment with forcing reneighboring more
often and see if system energies/trajectories change.
</P>
<P>These pair styles requires you to use the <A HREF = "communicate.html">communicate vel
yes</A> option so that velocites are stored by ghost
atoms.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "fix_nh.html">fix nvt</A>, <A HREF = "fix_langevin.html">fix
langevin</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Groot"></A>
<P><B>(Groot)</B> Groot and Warren, J Chem Phys, 107, 4423-35 (1997).
</P>
</HTML>
diff --git a/doc/pair_dpd.txt b/doc/pair_dpd.txt
index 2b60a5937..0638e753e 100644
--- a/doc/pair_dpd.txt
+++ b/doc/pair_dpd.txt
@@ -1,179 +1,179 @@
"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 dpd command :h3
pair_style dpd/omp command :h3
pair_style dpd/tstat command :h3
pair_style dpd/tstat/omp command :h3
[Syntax:]
pair_style dpd T cutoff seed
pair_style dpd/tstat Tstart Tstop cutoff seed :pre
T = temperature (temperature units)
Tstart,Tstop = desired temperature at start/end of run (temperature units)
cutoff = global cutoff for DPD interactions (distance units)
seed = random # seed (positive integer) :ul
[Examples:]
pair_style dpd 1.0 2.5 34387
pair_coeff * * 3.0 1.0
pair_coeff 1 1 3.0 1.0 1.0 :pre
pair_style dpd/tstat 1.0 1.0 2.5 34387
pair_coeff * * 1.0
pair_coeff 1 1 1.0 1.0 :pre
[Description:]
Style {dpd} computes a force field for dissipative particle dynamics
(DPD) following the exposition in "(Groot)"_#Groot.
Style {dpd/tstat} invokes a DPD thermostat on pairwise interactions,
which is equivalent to the non-conservative portion of the DPD force
field. This thermostat can be used in conjunction with any "pair
style"_pair_style.html, and in leiu of per-particle thermostats like
"fix langevin"_fix_langevin.html or ensemble thermostats like Nose
Hoover as implemented by "fix nvt"_fix_nh.html. To use {dpd/stat}
with another pair style, use the "pair_style
hybrid/overlay"_pair_hybrid.html command to compute both the desired
pair interaction and the thermostat for each pair of particles.
For style {dpd}, the force on atom I due to atom J is given as a sum
of 3 terms
:c,image(Eqs/pair_dpd.jpg)
where Fc is a conservative force, Fd is a dissipative force, and Fr is
a random force. Rij is a unit vector in the direction Ri - Rj, Vij is
the vector difference in velocities of the two atoms = Vi - Vj, alpha
is a Gaussian random number with zero mean and unit variance, dt is
the timestep size, and w(r) is a weighting factor that varies between
0 and 1. Rc is the cutoff. Sigma is set equal to sqrt(2 Kb T gamma),
where Kb is the Boltzmann constant and T is the temperature parameter
in the pair_style command.
For style {dpd/tstat}, the force on atom I due to atom J is the same
as the above equation, except that the conservative Fc term is
dropped. Also, during the run, T is set each timestep to a ramped
value from Tstart to Tstop.
For style {dpd}, the pairwise energy associated with style {dpd} is
only due to the conservative force term Fc, and is shifted to be zero
at the cutoff distance Rc. The pairwise virial is calculated using
all 3 terms. For style {dpd/tstat} there is no pairwise energy, but
the last two terms of the formula make a contribution to the virial.
For style {dpd}, 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:
A (force units)
gamma (force/velocity units)
cutoff (distance units) :ul
The last coefficient is optional. If not specified, the global DPD
cutoff is used. Note that sigma is set equal to sqrt(2 T gamma),
where T is the temperature set by the "pair_style"_pair_style.html
command so it does not need to be specified.
For style {dpd/tstat}, the coefficiencts defined for each pair of
atoms types via the "pair_coeff"_pair_coeff.html command is the same,
except that A is not included.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
These pair styles do not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
These pair styles do not support the "pair_modify"_pair_modify.html
shift option for the energy of the pair interaction. Note that as
discussed above, the energy due to the conservative Fc term is already
shifted to be 0.0 at the cutoff distance Rc.
The "pair_modify"_pair_modify.html table option is not relevant
for these pair styles.
These pair style do not support the "pair_modify"_pair_modify.html
tail option for adding long-range tail corrections to energy and
pressure.
These pair styles writes their 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. Note
that the user-specified random number seed is stored in the restart
file, so when a simulation is restarted, each processor will
re-initialize its random number generator the same way it did
initially. This means the random forces will be random, but will not
be the same as they would have been if the original simulation had
continued past the restart time.
These pair styles can only be used via the {pair} keyword of the
"run_style respa"_run_style.html command. They do not support the
{inner}, {middle}, {outer} keywords.
The {dpd/tstat} style can ramp its target temperature over multiple
runs, using the {start} and {stop} keywords of the "run"_run.html
command. See the "run"_run.html command for details of how to do
this.
:line
[Restrictions:]
The default frequency for rebuilding neighbor lists is every 10 steps
(see the "neigh_modify"_neigh_modify.html command). This may be too
infrequent for style {dpd} simulations since particles move rapidly
and can overlap by large amounts. If this setting yields a non-zero
number of "dangerous" reneighborings (printed at the end of a
simulation), you should experiment with forcing reneighboring more
often and see if system energies/trajectories change.
These pair styles requires you to use the "communicate vel
yes"_communicate.html option so that velocites are stored by ghost
atoms.
[Related commands:]
"pair_coeff"_pair_coeff.html, "fix nvt"_fix_nh.html, "fix
langevin"_fix_langevin.html
[Default:] none
:line
:link(Groot)
[(Groot)] Groot and Warren, J Chem Phys, 107, 4423-35 (1997).
diff --git a/doc/pair_eam.html b/doc/pair_eam.html
index 4f695c52e..8237e2a52 100644
--- a/doc/pair_eam.html
+++ b/doc/pair_eam.html
@@ -1,462 +1,462 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style eam command
</H3>
<H3>pair_style eam/cuda command
</H3>
<H3>pair_style eam/omp command
</H3>
<H3>pair_style eam/opt command
</H3>
<H3>pair_style eam/alloy command
</H3>
<H3>pair_style eam/alloy/cuda command
</H3>
<H3>pair_style eam/alloy/omp command
</H3>
<H3>pair_style eam/alloy/opt command
</H3>
<H3>pair_style eam/cd command
</H3>
<H3>pair_style eam/cd/omp command
</H3>
<H3>pair_style eam/fs command
</H3>
<H3>pair_style eam/fs/cuda command
</H3>
<H3>pair_style eam/fs/omp command
</H3>
<H3>pair_style eam/fs/opt command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style
</PRE>
<UL><LI>style = <I>eam</I> or <I>eam/alloy</I> or <I>eam/cd</I> or <I>eam/fs</I>
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style eam
pair_coeff * * cuu3
pair_coeff 1*3 1*3 niu3.eam
</PRE>
<PRE>pair_style eam/alloy
pair_coeff * * ../potentials/NiAlH_jea.eam.alloy Ni Al Ni Ni
</PRE>
<PRE>pair_style eam/cd
pair_coeff * * ../potentials/FeCr.cdeam Fe Cr
</PRE>
<PRE>pair_style eam/fs
pair_coeff * * NiAlH_jea.eam.fs Ni Al Ni Ni
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>eam</I> computes pairwise interactions for metals and metal alloys
using embedded-atom method (EAM) potentials <A HREF = "#Daw">(Daw)</A>. The total
energy Ei of an atom I is given by
</P>
<CENTER><IMG SRC = "Eqs/pair_eam.jpg">
</CENTER>
<P>where F is the embedding energy which is a function of the atomic
electron density rho, phi is a pair potential interaction, and alpha
and beta are the element types of atoms I and J. The multi-body
nature of the EAM potential is a result of the embedding energy term.
Both summations in the formula are over all neighbors J of atom I
within the cutoff distance.
</P>
<P>The cutoff distance and the tabulated values of the functionals F,
rho, and phi are listed in one or more files which are specified by
the <A HREF = "pair_coeff.html">pair_coeff</A> command. These are ASCII text files
in a DYNAMO-style format which is described below. DYNAMO was the
original serial EAM MD code, written by the EAM originators. Several
DYNAMO potential files for different metals are included in the
"potentials" directory of the LAMMPS distribution. All of these files
are parameterized in terms of LAMMPS <A HREF = "units.html">metal units</A>.
</P>
<P>IMPORTANT NOTE: The <I>eam</I> style reads single-element EAM potentials in
the DYNAMO <I>funcfl</I> format. Either single element or alloy systems
can be modeled using multiple <I>funcfl</I> files and style <I>eam</I>. For the
alloy case LAMMPS mixes the single-element potentials to produce alloy
potentials, the same way that DYNAMO does. Alternatively, a single
DYNAMO <I>setfl</I> file or Finnis/Sinclair EAM file can be used by LAMMPS
to model alloy systems by invoking the <I>eam/alloy</I> or <I>eam/cd</I> or
<I>eam/fs</I> styles as described below. These files require no mixing
since they specify alloy interactions explicitly.
</P>
<P>Note that unlike for other potentials, cutoffs for EAM potentials are
not set in the pair_style or pair_coeff command; they are specified in
the EAM potential files themselves. Likewise, the EAM potential files
list atomic masses; thus you do not need to use the <A HREF = "mass.html">mass</A>
command to specify them.
</P>
<P>There are several WWW sites that distribute and document EAM
potentials stored in DYNAMO or other formats:
</P>
<PRE>http://www.ctcms.nist.gov/potentials
http://cst-www.nrl.navy.mil/ccm6/ap
http://enpub.fulton.asu.edu/cms/potentials/main/main.htm
</PRE>
<P>These potentials should be usable with LAMMPS, though the alternate
formats would need to be converted to the DYNAMO format used by LAMMPS
and described on this page. The NIST site is maintained by Chandler
Becker (cbecker at nist.gov) who is good resource for info on
interatomic potentials and file formats.
</P>
<HR>
<P>For style <I>eam</I>, potential values are read from a file that is in the
DYNAMO single-element <I>funcfl</I> format. If the DYNAMO file was created
by a Fortran program, it cannot have "D" values in it for exponents.
C only recognizes "e" or "E" for scientific notation.
</P>
<P>Note that unlike for other potentials, cutoffs for EAM potentials are
not set in the pair_style or pair_coeff command; they are specified in
the EAM potential files themselves.
</P>
<P>For style <I>eam</I> a potential file must be assigned to each I,I pair of
atom types by using one or more pair_coeff commands, each with a
single argument:
</P>
<UL><LI>filename
</UL>
<P>Thus the following command
</P>
<PRE>pair_coeff *2 1*2 cuu3.eam
</PRE>
<P>will read the cuu3 potential file and use the tabulated Cu values for
F, phi, rho that it contains for type pairs 1,1 and 2,2 (type pairs
1,2 and 2,1 are ignored). In effect, this makes atom types 1 and 2 in
LAMMPS be Cu atoms. Different single-element files can be assigned to
different atom types to model an alloy system. The mixing to create
alloy potentials for type pairs with I != J is done automatically the
same way that the serial DYNAMO code originally did it; you do not
need to specify coefficients for these type pairs.
</P>
<P><I>Funcfl</I> files in the <I>potentials</I> directory of the LAMMPS
distribution have an ".eam" suffix. A DYNAMO single-element <I>funcfl</I>
file is formatted as follows:
</P>
<UL><LI>line 1: comment (ignored)
<LI>line 2: atomic number, mass, lattice constant, lattice type (e.g. FCC)
<LI>line 3: Nrho, drho, Nr, dr, cutoff
</UL>
<P>On line 2, all values but the mass are ignored by LAMMPS. The mass is
in mass <A HREF = "units.html">units</A>, e.g. mass number or grams/mole for metal
units. The cubic lattice constant is in Angstroms. On line 3, Nrho
and Nr are the number of tabulated values in the subsequent arrays,
drho and dr are the spacing in density and distance space for the
values in those arrays, and the specified cutoff becomes the pairwise
cutoff used by LAMMPS for the potential. The units of dr are
Angstroms; I'm not sure of the units for drho - some measure of
electron density.
</P>
<P>Following the three header lines are three arrays of tabulated values:
</P>
<UL><LI>embedding function F(rho) (Nrho values)
<LI>effective charge function Z(r) (Nr values)
<LI>density function rho(r) (Nr values)
</UL>
<P>The values for each array can be listed as multiple values per line,
so long as each array starts on a new line. For example, the
individual Z(r) values are for r = 0,dr,2*dr, ... (Nr-1)*dr.
</P>
<P>The units for the embedding function F are eV. The units for the
density function rho are the same as for drho (see above, electron
density). The units for the effective charge Z are "atomic charge" or
sqrt(Hartree * Bohr-radii). For two interacting atoms i,j this is used
by LAMMPS to compute the pair potential term in the EAM energy
expression as r*phi, in units of eV-Angstroms, via the formula
</P>
<PRE>r*phi = 27.2 * 0.529 * Zi * Zj
</PRE>
<P>where 1 Hartree = 27.2 eV and 1 Bohr = 0.529 Angstroms.
</P>
<HR>
<P>Style <I>eam/alloy</I> computes pairwise interactions using the same
formula as style <I>eam</I>. However the associated
<A HREF = "pair_coeff.html">pair_coeff</A> command reads a DYNAMO <I>setfl</I> file
instead of a <I>funcfl</I> file. <I>Setfl</I> files can be used to model a
single-element or alloy system. In the alloy case, as explained
above, <I>setfl</I> files contain explicit tabulated values for alloy
interactions. Thus they allow more generality than <I>funcfl</I> files for
modeling alloys.
</P>
<P>For style <I>eam/alloy</I>, potential values are read from a file that is
in the DYNAMO multi-element <I>setfl</I> format, except that element names
(Ni, Cu, etc) are added to one of the lines in the file. If the
DYNAMO file was created by a Fortran program, it cannot have "D"
values in it for exponents. C only recognizes "e" or "E" for
scientific notation.
</P>
<P>Only a single pair_coeff command is used with the <I>eam/alloy</I> style
which specifies a DYNAMO <I>setfl</I> file, which contains information for
M elements. These are mapped to LAMMPS atom types by specifying N
additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
</P>
<UL><LI>filename
<LI>N element names = mapping of <I>setfl</I> elements to atom types
</UL>
<P>As an example, the potentials/NiAlH_jea.eam.alloy file is a <I>setfl</I>
file which has tabulated EAM values for 3 elements and their alloy
interactions: Ni, Al, and H. If your LAMMPS simulation has 4 atoms
types and you want the 1st 3 to be Ni, and the 4th to be Al, you would
use the following pair_coeff command:
</P>
<PRE>pair_coeff * * NiAlH_jea.eam.alloy Ni Ni Ni Al
</PRE>
<P>The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three Ni arguments map LAMMPS atom types 1,2,3 to the Ni
element in the <I>setfl</I> file. The final Al argument maps LAMMPS atom
type 4 to the Al element in the <I>setfl</I> file. Note that there is no
requirement that your simulation use all the elements specified by the
<I>setfl</I> file.
</P>
<P>If a mapping value is specified as NULL, the mapping is not performed.
This can be used when an <I>eam/alloy</I> potential is used as part of the
<I>hybrid</I> pair style. The NULL values are placeholders for atom types
that will be used with other potentials.
</P>
<P><I>Setfl</I> files in the <I>potentials</I> directory of the LAMMPS distribution
have an ".eam.alloy" suffix. A DYNAMO multi-element <I>setfl</I> file is
formatted as follows:
</P>
<UL><LI>lines 1,2,3 = comments (ignored)
<LI>line 4: Nelements Element1 Element2 ... ElementN
<LI>line 5: Nrho, drho, Nr, dr, cutoff
</UL>
<P>In a DYNAMO <I>setfl</I> file, line 4 only lists Nelements = the # of
elements in the <I>setfl</I> file. For LAMMPS, the element name (Ni, Cu,
etc) of each element must be added to the line, in the order the
elements appear in the file.
</P>
<P>The meaning and units of the values in line 5 is the same as for the
<I>funcfl</I> file described above. Note that the cutoff (in Angstroms) is
a global value, valid for all pairwise interactions for all element
pairings.
</P>
<P>Following the 5 header lines are Nelements sections, one for each
element, each with the following format:
</P>
<UL><LI>line 1 = atomic number, mass, lattice constant, lattice type (e.g. FCC)
<LI>embedding function F(rho) (Nrho values)
<LI>density function rho(r) (Nr values)
</UL>
<P>As with the <I>funcfl</I> files, only the mass (in mass <A HREF = "units.html">units</A>,
e.g. mass number or grams/mole for metal units) is used by LAMMPS from
the 1st line. The cubic lattice constant is in Angstroms. The F and
rho arrays are unique to a single element and have the same format and
units as in a <I>funcfl</I> file.
</P>
<P>Following the Nelements sections, Nr values for each pair potential
phi(r) array are listed for all i,j element pairs in the same format
as other arrays. Since these interactions are symmetric (i,j = j,i)
only phi arrays with i >= j are listed, in the following order: i,j =
(1,1), (2,1), (2,2), (3,1), (3,2), (3,3), (4,1), ..., (Nelements,
Nelements). Unlike the effective charge array Z(r) in <I>funcfl</I> files,
the tabulated values for each phi function are listed in <I>setfl</I> files
directly as r*phi (in units of eV-Angstroms), since they are for atom
pairs.
</P>
<HR>
<P>Style <I>eam/cd</I> is similar to the <I>eam/alloy</I> style, except that it
computes alloy pairwise interactions using the concentration-dependent
embedded-atom method (CD-EAM). This model can reproduce the enthalpy
of mixing of alloys over the full composition range, as described in
<A HREF = "#Stukowski">(Stukowski)</A>.
</P>
<P>The pair_coeff command is specified the same as for the <I>eam/alloy</I>
style. However the DYNAMO <I>setfl</I> file must has two
lines added to it, at the end of the file:
</P>
<UL><LI>line 1: Comment line (ignored)
<LI>line 2: N Coefficient0 Coefficient1 ... CoeffincientN
</UL>
<P>The last line begins with the degree <I>N</I> of the polynomial function
<I>h(x)</I> that modifies the cross interaction between A and B elements.
Then <I>N+1</I> coefficients for the terms of the polynomial are then
listed.
</P>
<P>Modified EAM <I>setfl</I> files used with the <I>eam/cd</I> style must contain
exactly two elements, i.e. in the current implementation the <I>eam/cd</I>
style only supports binary alloys. The first and second elements in
the input EAM file are always taken as the <I>A</I> and <I>B</I> species.
</P>
<P><I>CD-EAM</I> files in the <I>potentials</I> directory of the LAMMPS
distribution have a ".cdeam" suffix.
</P>
<HR>
<P>Style <I>eam/fs</I> computes pairwise interactions for metals and metal
alloys using a generalized form of EAM potentials due to Finnis and
Sinclair <A HREF = "#Finnis">(Finnis)</A>. The total energy Ei of an atom I is
given by
</P>
<CENTER><IMG SRC = "Eqs/pair_eam_fs.jpg">
</CENTER>
<P>This has the same form as the EAM formula above, except that rho is
now a functional specific to the atomic types of both atoms I and J,
so that different elements can contribute differently to the total
electron density at an atomic site depending on the identity of the
element at that atomic site.
</P>
<P>The associated <A HREF = "pair_coeff.html">pair_coeff</A> command for style <I>eam/fs</I>
reads a DYNAMO <I>setfl</I> file that has been extended to include
additional rho_alpha_beta arrays of tabulated values. A discussion of
how FS EAM differs from conventional EAM alloy potentials is given in
<A HREF = "#Ackland1">(Ackland1)</A>. An example of such a potential is the same
author's Fe-P FS potential <A HREF = "#Ackland2">(Ackland2)</A>. Note that while FS
potentials always specify the embedding energy with a square root
dependence on the total density, the implementation in LAMMPS does not
require that; the user can tabulate any functional form desired in the
FS potential files.
</P>
<P>For style <I>eam/fs</I>, the form of the pair_coeff command is exactly the
same as for style <I>eam/alloy</I>, e.g.
</P>
<PRE>pair_coeff * * NiAlH_jea.eam.fs Ni Ni Ni Al
</PRE>
<P>where there are N additional arguments after the filename, where N is
the number of LAMMPS atom types. The N values determine the mapping
of LAMMPS atom types to EAM elements in the file, as described above
for style <I>eam/alloy</I>. As with <I>eam/alloy</I>, if a mapping value is
NULL, the mapping is not performed. This can be used when an <I>eam/fs</I>
potential is used as part of the <I>hybrid</I> pair style. The NULL values
are used as placeholders for atom types that will be used with other
potentials.
</P>
<P>FS EAM files include more information than the DYNAMO <I>setfl</I> format
files read by <I>eam/alloy</I>, in that i,j density functionals for all
pairs of elements are included as needed by the Finnis/Sinclair
formulation of the EAM.
</P>
<P>FS EAM files in the <I>potentials</I> directory of the LAMMPS distribution
have an ".eam.fs" suffix. They are formatted as follows:
</P>
<UL><LI>lines 1,2,3 = comments (ignored)
<LI>line 4: Nelements Element1 Element2 ... ElementN
<LI>line 5: Nrho, drho, Nr, dr, cutoff
</UL>
<P>The 5-line header section is identical to an EAM <I>setfl</I> file.
</P>
<P>Following the header are Nelements sections, one for each element I,
each with the following format:
</P>
<UL><LI>line 1 = atomic number, mass, lattice constant, lattice type (e.g. FCC)
<LI>embedding function F(rho) (Nrho values)
<LI>density function rho(r) for element I at element 1 (Nr values)
<LI>density function rho(r) for element I at element 2
<LI>...
<LI>density function rho(r) for element I at element Nelement
</UL>
<P>The units of these quantities in line 1 are the same as for <I>setfl</I>
files. Note that the rho(r) arrays in Finnis/Sinclair can be
asymmetric (i,j != j,i) so there are Nelements^2 of them listed in the
file.
</P>
<P>Following the Nelements sections, Nr values for each pair potential
phi(r) array are listed in the same manner (r*phi, units of
eV-Angstroms) as in EAM <I>setfl</I> files. Note that in Finnis/Sinclair,
the phi(r) arrays are still symmetric, so only phi arrays for i >= j
are listed.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
+<P>See <A HREF = "Section_accelerate.html">Section_accerlate</A> of the manual for more
instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, mixing is performed by LAMMPS as
described above with the individual styles. You never need to specify
a pair_coeff command with I != J arguments for the eam styles.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift, table, and tail options.
</P>
<P>The eam pair styles do not write their information to <A HREF = "restart.html">binary restart
files</A>, since it is stored in tabulated potential files.
Thus, you need to re-specify the pair_style and pair_coeff commands in
an input script that reads a restart file.
</P>
<P>The eam pair styles can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. They do not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>All of these styles except the <I>eam/cd</I> style are part of the MANYBODY
package. They are only enabled if LAMMPS was built with that package
(which it is by default). See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>The <I>eam/cd</I> style is part of the USER-MISC package and also requires
the MANYBODY package. It is only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Ackland1"></A>
<P><B>(Ackland1)</B> Ackland, Condensed Matter (2005).
</P>
<A NAME = "Ackland2"></A>
<P><B>(Ackland2)</B> Ackland, Mendelev, Srolovitz, Han and Barashev, Journal
of Physics: Condensed Matter, 16, S2629 (2004).
</P>
<A NAME = "Daw"></A>
<P><B>(Daw)</B> Daw, Baskes, Phys Rev Lett, 50, 1285 (1983).
Daw, Baskes, Phys Rev B, 29, 6443 (1984).
</P>
<A NAME = "Finnis"></A>
<P><B>(Finnis)</B> Finnis, Sinclair, Philosophical Magazine A, 50, 45 (1984).
</P>
<A NAME = "Stukowski"></A>
<P><B>(Stukowski)</B> Stukowski, Sadigh, Erhart, Caro; Modeling Simulation
Materials Science & Engineering, 7, 075005 (2009).
</P>
</HTML>
diff --git a/doc/pair_eam.txt b/doc/pair_eam.txt
index d0b06bf07..90883c971 100644
--- a/doc/pair_eam.txt
+++ b/doc/pair_eam.txt
@@ -1,440 +1,440 @@
"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 eam command :h3
pair_style eam/cuda command :h3
pair_style eam/omp command :h3
pair_style eam/opt command :h3
pair_style eam/alloy command :h3
pair_style eam/alloy/cuda command :h3
pair_style eam/alloy/omp command :h3
pair_style eam/alloy/opt command :h3
pair_style eam/cd command :h3
pair_style eam/cd/omp command :h3
pair_style eam/fs command :h3
pair_style eam/fs/cuda command :h3
pair_style eam/fs/omp command :h3
pair_style eam/fs/opt command :h3
[Syntax:]
pair_style style :pre
style = {eam} or {eam/alloy} or {eam/cd} or {eam/fs} :ul
[Examples:]
pair_style eam
pair_coeff * * cuu3
pair_coeff 1*3 1*3 niu3.eam :pre
pair_style eam/alloy
pair_coeff * * ../potentials/NiAlH_jea.eam.alloy Ni Al Ni Ni :pre
pair_style eam/cd
pair_coeff * * ../potentials/FeCr.cdeam Fe Cr :pre
pair_style eam/fs
pair_coeff * * NiAlH_jea.eam.fs Ni Al Ni Ni :pre
[Description:]
Style {eam} computes pairwise interactions for metals and metal alloys
using embedded-atom method (EAM) potentials "(Daw)"_#Daw. The total
energy Ei of an atom I is given by
:c,image(Eqs/pair_eam.jpg)
where F is the embedding energy which is a function of the atomic
electron density rho, phi is a pair potential interaction, and alpha
and beta are the element types of atoms I and J. The multi-body
nature of the EAM potential is a result of the embedding energy term.
Both summations in the formula are over all neighbors J of atom I
within the cutoff distance.
The cutoff distance and the tabulated values of the functionals F,
rho, and phi are listed in one or more files which are specified by
the "pair_coeff"_pair_coeff.html command. These are ASCII text files
in a DYNAMO-style format which is described below. DYNAMO was the
original serial EAM MD code, written by the EAM originators. Several
DYNAMO potential files for different metals are included in the
"potentials" directory of the LAMMPS distribution. All of these files
are parameterized in terms of LAMMPS "metal units"_units.html.
IMPORTANT NOTE: The {eam} style reads single-element EAM potentials in
the DYNAMO {funcfl} format. Either single element or alloy systems
can be modeled using multiple {funcfl} files and style {eam}. For the
alloy case LAMMPS mixes the single-element potentials to produce alloy
potentials, the same way that DYNAMO does. Alternatively, a single
DYNAMO {setfl} file or Finnis/Sinclair EAM file can be used by LAMMPS
to model alloy systems by invoking the {eam/alloy} or {eam/cd} or
{eam/fs} styles as described below. These files require no mixing
since they specify alloy interactions explicitly.
Note that unlike for other potentials, cutoffs for EAM potentials are
not set in the pair_style or pair_coeff command; they are specified in
the EAM potential files themselves. Likewise, the EAM potential files
list atomic masses; thus you do not need to use the "mass"_mass.html
command to specify them.
There are several WWW sites that distribute and document EAM
potentials stored in DYNAMO or other formats:
http://www.ctcms.nist.gov/potentials
http://cst-www.nrl.navy.mil/ccm6/ap
http://enpub.fulton.asu.edu/cms/potentials/main/main.htm :pre
These potentials should be usable with LAMMPS, though the alternate
formats would need to be converted to the DYNAMO format used by LAMMPS
and described on this page. The NIST site is maintained by Chandler
Becker (cbecker at nist.gov) who is good resource for info on
interatomic potentials and file formats.
:line
For style {eam}, potential values are read from a file that is in the
DYNAMO single-element {funcfl} format. If the DYNAMO file was created
by a Fortran program, it cannot have "D" values in it for exponents.
C only recognizes "e" or "E" for scientific notation.
Note that unlike for other potentials, cutoffs for EAM potentials are
not set in the pair_style or pair_coeff command; they are specified in
the EAM potential files themselves.
For style {eam} a potential file must be assigned to each I,I pair of
atom types by using one or more pair_coeff commands, each with a
single argument:
filename :ul
Thus the following command
pair_coeff *2 1*2 cuu3.eam :pre
will read the cuu3 potential file and use the tabulated Cu values for
F, phi, rho that it contains for type pairs 1,1 and 2,2 (type pairs
1,2 and 2,1 are ignored). In effect, this makes atom types 1 and 2 in
LAMMPS be Cu atoms. Different single-element files can be assigned to
different atom types to model an alloy system. The mixing to create
alloy potentials for type pairs with I != J is done automatically the
same way that the serial DYNAMO code originally did it; you do not
need to specify coefficients for these type pairs.
{Funcfl} files in the {potentials} directory of the LAMMPS
distribution have an ".eam" suffix. A DYNAMO single-element {funcfl}
file is formatted as follows:
line 1: comment (ignored)
line 2: atomic number, mass, lattice constant, lattice type (e.g. FCC)
line 3: Nrho, drho, Nr, dr, cutoff :ul
On line 2, all values but the mass are ignored by LAMMPS. The mass is
in mass "units"_units.html, e.g. mass number or grams/mole for metal
units. The cubic lattice constant is in Angstroms. On line 3, Nrho
and Nr are the number of tabulated values in the subsequent arrays,
drho and dr are the spacing in density and distance space for the
values in those arrays, and the specified cutoff becomes the pairwise
cutoff used by LAMMPS for the potential. The units of dr are
Angstroms; I'm not sure of the units for drho - some measure of
electron density.
Following the three header lines are three arrays of tabulated values:
embedding function F(rho) (Nrho values)
effective charge function Z(r) (Nr values)
density function rho(r) (Nr values) :ul
The values for each array can be listed as multiple values per line,
so long as each array starts on a new line. For example, the
individual Z(r) values are for r = 0,dr,2*dr, ... (Nr-1)*dr.
The units for the embedding function F are eV. The units for the
density function rho are the same as for drho (see above, electron
density). The units for the effective charge Z are "atomic charge" or
sqrt(Hartree * Bohr-radii). For two interacting atoms i,j this is used
by LAMMPS to compute the pair potential term in the EAM energy
expression as r*phi, in units of eV-Angstroms, via the formula
r*phi = 27.2 * 0.529 * Zi * Zj :pre
where 1 Hartree = 27.2 eV and 1 Bohr = 0.529 Angstroms.
:line
Style {eam/alloy} computes pairwise interactions using the same
formula as style {eam}. However the associated
"pair_coeff"_pair_coeff.html command reads a DYNAMO {setfl} file
instead of a {funcfl} file. {Setfl} files can be used to model a
single-element or alloy system. In the alloy case, as explained
above, {setfl} files contain explicit tabulated values for alloy
interactions. Thus they allow more generality than {funcfl} files for
modeling alloys.
For style {eam/alloy}, potential values are read from a file that is
in the DYNAMO multi-element {setfl} format, except that element names
(Ni, Cu, etc) are added to one of the lines in the file. If the
DYNAMO file was created by a Fortran program, it cannot have "D"
values in it for exponents. C only recognizes "e" or "E" for
scientific notation.
Only a single pair_coeff command is used with the {eam/alloy} style
which specifies a DYNAMO {setfl} file, which contains information for
M elements. These are mapped to LAMMPS atom types by specifying N
additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
filename
N element names = mapping of {setfl} elements to atom types :ul
As an example, the potentials/NiAlH_jea.eam.alloy file is a {setfl}
file which has tabulated EAM values for 3 elements and their alloy
interactions: Ni, Al, and H. If your LAMMPS simulation has 4 atoms
types and you want the 1st 3 to be Ni, and the 4th to be Al, you would
use the following pair_coeff command:
pair_coeff * * NiAlH_jea.eam.alloy Ni Ni Ni Al :pre
The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three Ni arguments map LAMMPS atom types 1,2,3 to the Ni
element in the {setfl} file. The final Al argument maps LAMMPS atom
type 4 to the Al element in the {setfl} file. Note that there is no
requirement that your simulation use all the elements specified by the
{setfl} file.
If a mapping value is specified as NULL, the mapping is not performed.
This can be used when an {eam/alloy} potential is used as part of the
{hybrid} pair style. The NULL values are placeholders for atom types
that will be used with other potentials.
{Setfl} files in the {potentials} directory of the LAMMPS distribution
have an ".eam.alloy" suffix. A DYNAMO multi-element {setfl} file is
formatted as follows:
lines 1,2,3 = comments (ignored)
line 4: Nelements Element1 Element2 ... ElementN
line 5: Nrho, drho, Nr, dr, cutoff :ul
In a DYNAMO {setfl} file, line 4 only lists Nelements = the # of
elements in the {setfl} file. For LAMMPS, the element name (Ni, Cu,
etc) of each element must be added to the line, in the order the
elements appear in the file.
The meaning and units of the values in line 5 is the same as for the
{funcfl} file described above. Note that the cutoff (in Angstroms) is
a global value, valid for all pairwise interactions for all element
pairings.
Following the 5 header lines are Nelements sections, one for each
element, each with the following format:
line 1 = atomic number, mass, lattice constant, lattice type (e.g. FCC)
embedding function F(rho) (Nrho values)
density function rho(r) (Nr values) :ul
As with the {funcfl} files, only the mass (in mass "units"_units.html,
e.g. mass number or grams/mole for metal units) is used by LAMMPS from
the 1st line. The cubic lattice constant is in Angstroms. The F and
rho arrays are unique to a single element and have the same format and
units as in a {funcfl} file.
Following the Nelements sections, Nr values for each pair potential
phi(r) array are listed for all i,j element pairs in the same format
as other arrays. Since these interactions are symmetric (i,j = j,i)
only phi arrays with i >= j are listed, in the following order: i,j =
(1,1), (2,1), (2,2), (3,1), (3,2), (3,3), (4,1), ..., (Nelements,
Nelements). Unlike the effective charge array Z(r) in {funcfl} files,
the tabulated values for each phi function are listed in {setfl} files
directly as r*phi (in units of eV-Angstroms), since they are for atom
pairs.
:line
Style {eam/cd} is similar to the {eam/alloy} style, except that it
computes alloy pairwise interactions using the concentration-dependent
embedded-atom method (CD-EAM). This model can reproduce the enthalpy
of mixing of alloys over the full composition range, as described in
"(Stukowski)"_#Stukowski.
The pair_coeff command is specified the same as for the {eam/alloy}
style. However the DYNAMO {setfl} file must has two
lines added to it, at the end of the file:
line 1: Comment line (ignored)
line 2: N Coefficient0 Coefficient1 ... CoeffincientN :ul
The last line begins with the degree {N} of the polynomial function
{h(x)} that modifies the cross interaction between A and B elements.
Then {N+1} coefficients for the terms of the polynomial are then
listed.
Modified EAM {setfl} files used with the {eam/cd} style must contain
exactly two elements, i.e. in the current implementation the {eam/cd}
style only supports binary alloys. The first and second elements in
the input EAM file are always taken as the {A} and {B} species.
{CD-EAM} files in the {potentials} directory of the LAMMPS
distribution have a ".cdeam" suffix.
:line
Style {eam/fs} computes pairwise interactions for metals and metal
alloys using a generalized form of EAM potentials due to Finnis and
Sinclair "(Finnis)"_#Finnis. The total energy Ei of an atom I is
given by
:c,image(Eqs/pair_eam_fs.jpg)
This has the same form as the EAM formula above, except that rho is
now a functional specific to the atomic types of both atoms I and J,
so that different elements can contribute differently to the total
electron density at an atomic site depending on the identity of the
element at that atomic site.
The associated "pair_coeff"_pair_coeff.html command for style {eam/fs}
reads a DYNAMO {setfl} file that has been extended to include
additional rho_alpha_beta arrays of tabulated values. A discussion of
how FS EAM differs from conventional EAM alloy potentials is given in
"(Ackland1)"_#Ackland1. An example of such a potential is the same
author's Fe-P FS potential "(Ackland2)"_#Ackland2. Note that while FS
potentials always specify the embedding energy with a square root
dependence on the total density, the implementation in LAMMPS does not
require that; the user can tabulate any functional form desired in the
FS potential files.
For style {eam/fs}, the form of the pair_coeff command is exactly the
same as for style {eam/alloy}, e.g.
pair_coeff * * NiAlH_jea.eam.fs Ni Ni Ni Al :pre
where there are N additional arguments after the filename, where N is
the number of LAMMPS atom types. The N values determine the mapping
of LAMMPS atom types to EAM elements in the file, as described above
for style {eam/alloy}. As with {eam/alloy}, if a mapping value is
NULL, the mapping is not performed. This can be used when an {eam/fs}
potential is used as part of the {hybrid} pair style. The NULL values
are used as placeholders for atom types that will be used with other
potentials.
FS EAM files include more information than the DYNAMO {setfl} format
files read by {eam/alloy}, in that i,j density functionals for all
pairs of elements are included as needed by the Finnis/Sinclair
formulation of the EAM.
FS EAM files in the {potentials} directory of the LAMMPS distribution
have an ".eam.fs" suffix. They are formatted as follows:
lines 1,2,3 = comments (ignored)
line 4: Nelements Element1 Element2 ... ElementN
line 5: Nrho, drho, Nr, dr, cutoff :ul
The 5-line header section is identical to an EAM {setfl} file.
Following the header are Nelements sections, one for each element I,
each with the following format:
line 1 = atomic number, mass, lattice constant, lattice type (e.g. FCC)
embedding function F(rho) (Nrho values)
density function rho(r) for element I at element 1 (Nr values)
density function rho(r) for element I at element 2
...
density function rho(r) for element I at element Nelement :ul
The units of these quantities in line 1 are the same as for {setfl}
files. Note that the rho(r) arrays in Finnis/Sinclair can be
asymmetric (i,j != j,i) so there are Nelements^2 of them listed in the
file.
Following the Nelements sections, Nr values for each pair potential
phi(r) array are listed in the same manner (r*phi, units of
eV-Angstroms) as in EAM {setfl} files. Note that in Finnis/Sinclair,
the phi(r) arrays are still symmetric, so only phi arrays for i >= j
are listed.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
+See "Section_accerlate"_Section_accelerate.html of the manual for more
instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, mixing is performed by LAMMPS as
described above with the individual styles. You never need to specify
a pair_coeff command with I != J arguments for the eam styles.
This pair style does not support the "pair_modify"_pair_modify.html
shift, table, and tail options.
The eam pair styles do not write their information to "binary restart
files"_restart.html, since it is stored in tabulated potential files.
Thus, you need to re-specify the pair_style and pair_coeff commands in
an input script that reads a restart file.
The eam pair styles can only be used via the {pair} keyword of the
"run_style respa"_run_style.html command. They do not support the
{inner}, {middle}, {outer} keywords.
:line
[Restrictions:]
All of these styles except the {eam/cd} style are part of the MANYBODY
package. They are only enabled if LAMMPS was built with that package
(which it is by default). See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
The {eam/cd} style is part of the USER-MISC package and also requires
the MANYBODY package. It is only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Ackland1)
[(Ackland1)] Ackland, Condensed Matter (2005).
:link(Ackland2)
[(Ackland2)] Ackland, Mendelev, Srolovitz, Han and Barashev, Journal
of Physics: Condensed Matter, 16, S2629 (2004).
:link(Daw)
[(Daw)] Daw, Baskes, Phys Rev Lett, 50, 1285 (1983).
Daw, Baskes, Phys Rev B, 29, 6443 (1984).
:link(Finnis)
[(Finnis)] Finnis, Sinclair, Philosophical Magazine A, 50, 45 (1984).
:link(Stukowski)
[(Stukowski)] Stukowski, Sadigh, Erhart, Caro; Modeling Simulation
Materials Science & Engineering, 7, 075005 (2009).
diff --git a/doc/pair_edip.html b/doc/pair_edip.html
index 1c09c8ed4..fb65ffbda 100644
--- a/doc/pair_edip.html
+++ b/doc/pair_edip.html
@@ -1,170 +1,170 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style edip command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style edip
</PRE>
<PRE>pair_style edip/omp
</PRE>
<P><B>Examples:</B>
</P>
<P>pair_style edip
pair_coeff * * Si.edip Si
</P>
<P><B>Description:</B>
</P>
<P>The <I>edip</I> style computes a 3-body <A HREF = "#EDIP">EDIP</A> potential which is
popular for modeling silicon materials where it can have advantages
over other models such as the <A HREF = "pair_sw.html">Stillinger-Weber</A> or
<A HREF = "pair_tersoff.html">Tersoff</A> potentials. In EDIP, the energy E of a
system of atoms is
</P>
<CENTER><IMG SRC = "Eqs/pair_edip.jpg">
</CENTER>
<P>where phi2 is a two-body term and phi3 is a three-body term. The
summations in the formula are over all neighbors J and K of atom I
within a cutoff distance = a.
Both terms depend on the local environment of atom I through its
effective coordination number defined by Z, which is unity for a
cutoff distance < c and gently goes to 0 at distance = a.
</P>
<P>Only a single pair_coeff command is used with the <I>edip</I> style which
specifies a EDIP potential file with parameters for all
needed elements. These are mapped to LAMMPS atom types by specifying
N additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
</P>
<UL><LI>filename
<LI>N element names = mapping of EDIP elements to atom types
</UL>
<P>As an example, imagine a file Si.edip has EDIP values for Si.
</P>
<P>EDIP files in the <I>potentials</I> directory of the LAMMPS
distribution have a ".edip" suffix. Lines that are not blank or
comments (starting with #) define parameters for a triplet of
elements. The parameters in a single entry correspond to the two-body
and three-body coefficients in the formula above:
</P>
<UL><LI>element 1 (the center atom in a 3-body interaction)
<LI>element 2
<LI>element 3
<LI>A (energy units)
<LI>B (distance units)
<LI>cutoffA (distance units)
<LI>cutoffC (distance units)
<LI>alpha
<LI>beta
<LI>eta
<LI>gamma (distance units)
<LI>lambda (energy units)
<LI>mu
<LI>tho
<LI>sigma (distance units)
<LI>Q0
<LI>u1
<LI>u2
<LI>u3
<LI>u4
</UL>
<P>The A, B, beta, sigma parameters are used only for two-body interactions.
The eta, gamma, lambda, mu, Q0 and all u1 to u4 parameters are used only
for three-body interactions. The alpha and cutoffC parameters are used
for the coordination environment function only.
</P>
<P>The EDIP potential file must contain entries for all the
elements listed in the pair_coeff command. It can also contain
entries for additional elements not being used in a particular
simulation; LAMMPS ignores those entries.
</P>
<P>For a single-element simulation, only a single entry is required
(e.g. SiSiSi). For a two-element simulation, the file must contain 8
entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that
specify EDIP parameters for all permutations of the two elements
interacting in three-body configurations. Thus for 3 elements, 27
entries would be required, etc.
</P>
<P>At the moment, only a single element parametrization is
implemented. However, the author is not aware of other
multi-element EDIP parametrizations. If you know any and
you are interest in that, please contact the author of
the EDIP package.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift, table, and tail options.
</P>
<P>This pair style does not write its information to <A HREF = "restart.html">binary restart
files</A>, since it is stored in potential files. Thus, you
need to re-specify the pair_style and pair_coeff commands in an input
script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This angle style can only be used if LAMMPS was built with the
USER-MISC package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info on packages.
</P>
<P>This pair style requires the <A HREF = "newton.html">newton</A> setting to be "on"
for pair interactions.
</P>
<P>The EDIP potential files provided with LAMMPS (see the potentials directory)
are parameterized for metal <A HREF = "units.html">units</A>.
You can use the SW potential with any LAMMPS units, but you would need
to create your own EDIP potential file with coefficients listed in the
appropriate units if your simulation doesn't use "metal" units.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "EDIP"></A>
<P><B>(EDIP)</B> J. F. Justo et al., Phys. Rev. B 58, 2539 (1998).
</P>
</HTML>
diff --git a/doc/pair_edip.txt b/doc/pair_edip.txt
index 3494ce68f..5fcf6e5d6 100644
--- a/doc/pair_edip.txt
+++ b/doc/pair_edip.txt
@@ -1,163 +1,163 @@
"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 edip command :h3
[Syntax:]
pair_style edip :pre
pair_style edip/omp :pre
[Examples:]
pair_style edip
pair_coeff * * Si.edip Si
[Description:]
The {edip} style computes a 3-body "EDIP"_#EDIP potential which is
popular for modeling silicon materials where it can have advantages
over other models such as the "Stillinger-Weber"_pair_sw.html or
"Tersoff"_pair_tersoff.html potentials. In EDIP, the energy E of a
system of atoms is
:c,image(Eqs/pair_edip.jpg)
where phi2 is a two-body term and phi3 is a three-body term. The
summations in the formula are over all neighbors J and K of atom I
within a cutoff distance = a.
Both terms depend on the local environment of atom I through its
effective coordination number defined by Z, which is unity for a
cutoff distance < c and gently goes to 0 at distance = a.
Only a single pair_coeff command is used with the {edip} style which
specifies a EDIP potential file with parameters for all
needed elements. These are mapped to LAMMPS atom types by specifying
N additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
filename
N element names = mapping of EDIP elements to atom types :ul
As an example, imagine a file Si.edip has EDIP values for Si.
EDIP files in the {potentials} directory of the LAMMPS
distribution have a ".edip" suffix. Lines that are not blank or
comments (starting with #) define parameters for a triplet of
elements. The parameters in a single entry correspond to the two-body
and three-body coefficients in the formula above:
element 1 (the center atom in a 3-body interaction)
element 2
element 3
A (energy units)
B (distance units)
cutoffA (distance units)
cutoffC (distance units)
alpha
beta
eta
gamma (distance units)
lambda (energy units)
mu
tho
sigma (distance units)
Q0
u1
u2
u3
u4 :ul
The A, B, beta, sigma parameters are used only for two-body interactions.
The eta, gamma, lambda, mu, Q0 and all u1 to u4 parameters are used only
for three-body interactions. The alpha and cutoffC parameters are used
for the coordination environment function only.
The EDIP potential file must contain entries for all the
elements listed in the pair_coeff command. It can also contain
entries for additional elements not being used in a particular
simulation; LAMMPS ignores those entries.
For a single-element simulation, only a single entry is required
(e.g. SiSiSi). For a two-element simulation, the file must contain 8
entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that
specify EDIP parameters for all permutations of the two elements
interacting in three-body configurations. Thus for 3 elements, 27
entries would be required, etc.
At the moment, only a single element parametrization is
implemented. However, the author is not aware of other
multi-element EDIP parametrizations. If you know any and
you are interest in that, please contact the author of
the EDIP package.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
This pair style does not support the "pair_modify"_pair_modify.html
shift, table, and tail options.
This pair style does not write its information to "binary restart
files"_restart.html, since it is stored in potential files. Thus, you
need to re-specify the pair_style and pair_coeff commands 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 angle style can only be used if LAMMPS was built with the
USER-MISC package. See the "Making LAMMPS"_Section_start.html#start_3
section for more info on packages.
This pair style requires the "newton"_newton.html setting to be "on"
for pair interactions.
The EDIP potential files provided with LAMMPS (see the potentials directory)
are parameterized for metal "units"_units.html.
You can use the SW potential with any LAMMPS units, but you would need
to create your own EDIP potential file with coefficients listed in the
appropriate units if your simulation doesn't use "metal" units.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(EDIP)
[(EDIP)] J. F. Justo et al., Phys. Rev. B 58, 2539 (1998).
diff --git a/doc/pair_eim.html b/doc/pair_eim.html
index 484cb2505..680353a8c 100644
--- a/doc/pair_eim.html
+++ b/doc/pair_eim.html
@@ -1,177 +1,177 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style eim command
</H3>
<H3>pair_style eim/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style
</PRE>
<UL><LI>style = <I>eim</I>
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style eim
pair_coeff * * Na Cl ../potentials/ffield.eim Na Cl
pair_coeff * * Na Cl ffield.eim Na Na Na Cl
pair_coeff * * Na Cl ../potentials/ffield.eim Cl NULL Na
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>eim</I> computes pairwise interactions for ionic compounds
using embedded-ion method (EIM) potentials <A HREF = "#Zhou">(Zhou)</A>. The
energy of the system E is given by
</P>
<CENTER><IMG SRC = "Eqs/pair_eim1.jpg">
</CENTER>
<P>The first term is a double pairwise sum over the J neighbors of all I
atoms, where phi_ij is a pair potential. The second term sums over
the embedding energy E_i of atom I, which is a function of its charge
q_i and the electrical potential sigma_i at its location. E_i, q_i,
and sigma_i are calculated as
</P>
<CENTER><IMG SRC = "Eqs/pair_eim2.jpg">
</CENTER>
<P>where eta_ji is a pairwise function describing electron flow from atom
I to atom J, and psi_ij is another pairwise function. The multi-body
nature of the EIM potential is a result of the embedding energy term.
A complete list of all the pair functions used in EIM is summarized
below
</P>
<CENTER><IMG SRC = "Eqs/pair_eim3.jpg">
</CENTER>
<P>Here E_b, r_e, r_(c,phi), alpha, beta, A_(psi), zeta, r_(s,psi),
r_(c,psi), A_(eta), r_(s,eta), r_(c,eta), chi, and pair function type
p are parameters, with subscripts ij indicating the two species of
atoms in the atomic pair.
</P>
<P>IMPORTANT NOTE: Even though the EIM potential is treating atoms as
charged ions, you should not use a LAMMPS <A HREF = "atom_style.html">atom_style</A>
that stores a charge on each atom and thus requires you to assign a
charge to each atom, e.g. the <I>charge</I> or <I>full</I> atom styles. This is
because the EIM potential infers the charge on an atom from the
equation above for q_i; you do not assign charges explicitly.
</P>
<HR>
<P>All the EIM parameters are listed in a potential file which is
specified by the <A HREF = "pair_coeff.html">pair_coeff</A> command. This is an
ASCII text file in a format described below. The "ffield.eim" file
included in the "potentials" directory of the LAMMPS distribution
currently includes nine elements Li, Na, K, Rb, Cs, F, Cl, Br, and I.
A system with any combination of these elements can be modeled. This
file is parameterized in terms of LAMMPS <A HREF = "units.html">metal units</A>.
</P>
<P>Note that unlike other potentials, cutoffs for EIM potentials are not
set in the pair_style or pair_coeff command; they are specified in the
EIM potential file itself. Likewise, the EIM potential file lists
atomic masses; thus you do not need to use the <A HREF = "mass.html">mass</A>
command to specify them.
</P>
<P>Only a single pair_coeff command is used with the <I>eim</I> style which
specifies an EIM potential file and the element(s) to extract
information for. The EIM elements are mapped to LAMMPS atom types by
specifying N additional arguments after the filename in the pair_coeff
command, where N is the number of LAMMPS atom types:
</P>
<UL><LI>Elem1, Elem2, ...
<LI>EIM potential file
<LI>N element names = mapping of EIM elements to atom types
</UL>
<P>As an example like one of those above, suppose you want to model a
system with Na and Cl atoms. If your LAMMPS simulation has 4 atoms
types and you want the 1st 3 to be Na, and the 4th to be Cl, you would
use the following pair_coeff command:
</P>
<PRE>pair_coeff * * Na Cl ffield.eim Na Na Na Cl
</PRE>
<P>The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The filename is the EIM potential file. The Na and Cl arguments
(before the file name) are the two elements for which info will be
extracted from the potentail file. The first three trailing Na
arguments map LAMMPS atom types 1,2,3 to the EIM Na element. The
final Cl argument maps LAMMPS atom type 4 to the EIM Cl element.
</P>
<P>If a mapping value is specified as NULL, the mapping is not performed.
This can be used when an <I>eim</I> potential is used as part of the
<I>hybrid</I> pair style. The NULL values are placeholders for atom types
that will be used with other potentials.
</P>
<P>The ffield.eim file in the <I>potentials</I> directory of the LAMMPS
distribution is formated as follows:
</P>
<P>Lines starting with # are comments and are ignored by LAMMPS. Lines
starting with "global:" include three global values. The first value
divides the cations from anions, i.e., any elements with
electronegativity above this value are viewed as anions, and any
elements with electronegativity below this value are viewed as
cations. The second and third values are related to the cutoff
function - i.e. the 0.510204, 1.64498, and 0.010204 shown in the above
equation can be derived from these values.
</P>
<P>Lines starting with "element:" are formatted as follows: name of
element, atomic number, atomic mass, electronic negativity, atomic
radius (LAMMPS ignores it), ionic radius (LAMMPS ignores it), cohesive
energy (LAMMPS ignores it), and q0 (must be 0).
</P>
<P>Lines starting with "pair:" are entered as: element 1, element 2,
r_(c,phi), r_(c,phi) (redundant for historical reasons), E_b, r_e,
alpha, beta, r_(c,eta), A_(eta), r_(s,eta), r_(c,psi), A_(psi), zeta,
r_(s,psi), and p.
</P>
<P>The lines in the file can be in any order; LAMMPS extracts the info it
needs.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This style is part of the MANYBODY package. It is only enabled if
LAMMPS was built with that package (which it is by default).
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Zhou"></A>
<P><B>(Zhou)</B> Zhou, submitted for publication (2010). Please contact
Xiaowang Zhou (Sandia) for details via email at xzhou at sandia.gov.
</P>
</HTML>
diff --git a/doc/pair_eim.txt b/doc/pair_eim.txt
index 21c054005..0c2b5439e 100644
--- a/doc/pair_eim.txt
+++ b/doc/pair_eim.txt
@@ -1,170 +1,170 @@
"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 eim command :h3
pair_style eim/omp command :h3
[Syntax:]
pair_style style :pre
style = {eim} :ul
[Examples:]
pair_style eim
pair_coeff * * Na Cl ../potentials/ffield.eim Na Cl
pair_coeff * * Na Cl ffield.eim Na Na Na Cl
pair_coeff * * Na Cl ../potentials/ffield.eim Cl NULL Na :pre
[Description:]
Style {eim} computes pairwise interactions for ionic compounds
using embedded-ion method (EIM) potentials "(Zhou)"_#Zhou. The
energy of the system E is given by
:c,image(Eqs/pair_eim1.jpg)
The first term is a double pairwise sum over the J neighbors of all I
atoms, where phi_ij is a pair potential. The second term sums over
the embedding energy E_i of atom I, which is a function of its charge
q_i and the electrical potential sigma_i at its location. E_i, q_i,
and sigma_i are calculated as
:c,image(Eqs/pair_eim2.jpg)
where eta_ji is a pairwise function describing electron flow from atom
I to atom J, and psi_ij is another pairwise function. The multi-body
nature of the EIM potential is a result of the embedding energy term.
A complete list of all the pair functions used in EIM is summarized
below
:c,image(Eqs/pair_eim3.jpg)
Here E_b, r_e, r_(c,phi), alpha, beta, A_(psi), zeta, r_(s,psi),
r_(c,psi), A_(eta), r_(s,eta), r_(c,eta), chi, and pair function type
p are parameters, with subscripts ij indicating the two species of
atoms in the atomic pair.
IMPORTANT NOTE: Even though the EIM potential is treating atoms as
charged ions, you should not use a LAMMPS "atom_style"_atom_style.html
that stores a charge on each atom and thus requires you to assign a
charge to each atom, e.g. the {charge} or {full} atom styles. This is
because the EIM potential infers the charge on an atom from the
equation above for q_i; you do not assign charges explicitly.
:line
All the EIM parameters are listed in a potential file which is
specified by the "pair_coeff"_pair_coeff.html command. This is an
ASCII text file in a format described below. The "ffield.eim" file
included in the "potentials" directory of the LAMMPS distribution
currently includes nine elements Li, Na, K, Rb, Cs, F, Cl, Br, and I.
A system with any combination of these elements can be modeled. This
file is parameterized in terms of LAMMPS "metal units"_units.html.
Note that unlike other potentials, cutoffs for EIM potentials are not
set in the pair_style or pair_coeff command; they are specified in the
EIM potential file itself. Likewise, the EIM potential file lists
atomic masses; thus you do not need to use the "mass"_mass.html
command to specify them.
Only a single pair_coeff command is used with the {eim} style which
specifies an EIM potential file and the element(s) to extract
information for. The EIM elements are mapped to LAMMPS atom types by
specifying N additional arguments after the filename in the pair_coeff
command, where N is the number of LAMMPS atom types:
Elem1, Elem2, ...
EIM potential file
N element names = mapping of EIM elements to atom types :ul
As an example like one of those above, suppose you want to model a
system with Na and Cl atoms. If your LAMMPS simulation has 4 atoms
types and you want the 1st 3 to be Na, and the 4th to be Cl, you would
use the following pair_coeff command:
pair_coeff * * Na Cl ffield.eim Na Na Na Cl :pre
The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The filename is the EIM potential file. The Na and Cl arguments
(before the file name) are the two elements for which info will be
extracted from the potentail file. The first three trailing Na
arguments map LAMMPS atom types 1,2,3 to the EIM Na element. The
final Cl argument maps LAMMPS atom type 4 to the EIM Cl element.
If a mapping value is specified as NULL, the mapping is not performed.
This can be used when an {eim} potential is used as part of the
{hybrid} pair style. The NULL values are placeholders for atom types
that will be used with other potentials.
The ffield.eim file in the {potentials} directory of the LAMMPS
distribution is formated as follows:
Lines starting with # are comments and are ignored by LAMMPS. Lines
starting with "global:" include three global values. The first value
divides the cations from anions, i.e., any elements with
electronegativity above this value are viewed as anions, and any
elements with electronegativity below this value are viewed as
cations. The second and third values are related to the cutoff
function - i.e. the 0.510204, 1.64498, and 0.010204 shown in the above
equation can be derived from these values.
Lines starting with "element:" are formatted as follows: name of
element, atomic number, atomic mass, electronic negativity, atomic
radius (LAMMPS ignores it), ionic radius (LAMMPS ignores it), cohesive
energy (LAMMPS ignores it), and q0 (must be 0).
Lines starting with "pair:" are entered as: element 1, element 2,
r_(c,phi), r_(c,phi) (redundant for historical reasons), E_b, r_e,
alpha, beta, r_(c,eta), A_(eta), r_(s,eta), r_(c,psi), A_(psi), zeta,
r_(s,psi), and p.
The lines in the file can be in any order; LAMMPS extracts the info it
needs.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Restrictions:]
This style is part of the MANYBODY package. It is only enabled if
LAMMPS was built with that package (which it is by default).
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Zhou)
[(Zhou)] Zhou, submitted for publication (2010). Please contact
Xiaowang Zhou (Sandia) for details via email at xzhou at sandia.gov.
diff --git a/doc/pair_gauss.html b/doc/pair_gauss.html
index 64ecda5fb..d29ba2e5c 100644
--- a/doc/pair_gauss.html
+++ b/doc/pair_gauss.html
@@ -1,163 +1,163 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style gauss command
</H3>
<H3>pair_style gauss/omp command
</H3>
<H3>pair_style gauss/cut command
</H3>
<H3>pair_style gauss/cut/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style gauss cutoff
pair_style gauss/cut cutoff
</PRE>
<UL><LI>cutoff = global cutoff for Gauss interactions (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style gauss 12.0
pair_coeff * * 1.0 0.9
pair_coeff 1 4 1.0 0.9 10.0
</PRE>
<PRE>pair_style gauss/cut 3.5
pair_coeff 1 4 0.2805 1.45 0.112
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>gauss</I> computes a tethering potential of the form
</P>
<CENTER><IMG SRC = "Eqs/pair_gauss.jpg">
</CENTER>
<P>between an atom and its corresponding tether site which will typically
be a frozen atom in the simulation. Rc is the cutoff.
</P>
<P>The following coefficients must be defined for each pair of atom types
via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples above,
or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>A (energy units)
<LI>B (1/distance^2 units)
<LI>cutoff (distance units)
</UL>
<P>The last coefficient is optional. If not specified, the global cutoff
is used.
</P>
<P>Style <I>gauss/cut</I> computes a generalized Gaussian interaction potential
between pairs of particles:
</P>
<CENTER><IMG SRC = "Eqs/pair_gauss_cut.jpg">
</CENTER>
<P>where H determines together with the standard deviation sigma_h the
peak height of the Gaussian function, and r_mh the peak position.
Examples of the use of the Gaussian potentials include implicit
solvent simulations of salt ions <A HREF = "#Lenart">(Lenart)</A> and of surfactants
<A HREF = "#Jusufi">(Jusufi)</A>. In these instances the Gaussian potential mimics
the hydration barrier between a pair of particles. The hydration
barrier is located at r_mh and has a width of sigma_h. The prefactor
determines the hight of the potential barrier.
</P>
<P>The following coefficients must be defined for each pair of atom types
via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the example above,
or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>H (energy * distance units)
<LI>r_mh (distance units)
<LI>sigma_h (distance units)
</UL>
<P>The global cutoff (r_c) specified in the pair_style command is used.
</P>
<HR>
<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
the same as the corresponding style without the suffix. They have
been optimized to run faster, depending on your available hardware, as
-discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>These pair style do not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
</P>
<P>The <I>gauss</I> style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift option. There is no effect due to the Gaussian well beyond the
cutoff; hence reasonable cutoffs need to be specified.
</P>
<P>The <I>gauss/cut</I> style supports the <A HREF = "pair_modify.html">pair_modify</A> shift
option for the energy of the Gauss-potential portion of the pair
interaction.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table and tail options are not
relevant for this pair style.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
table option, since a tabulation capability does not exist for this
potential.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<P>Thes <I>gauss</I> pair style tallies an "occupancy" count of how many Gaussian-well
sites have an atom within the distance at which the force is a maximum
= sqrt(0.5/b). This quantity can be accessed via the <A HREF = "compute_pair.html">compute
pair</A> command as a vector of values of length 1.
</P>
<P>To print this quantity to the log file (with a descriptive column
heading) the following commands could be included in an input script:
</P>
<PRE>compute gauss all pair gauss
variable occ equal c_gauss[1]
thermo_style custom step temp epair v_occ
</PRE>
<HR>
<P><B>Restrictions:</B>
</P>
<P>The <I>gauss/cut</I> style is part of the "user-misc" package. It is only enabled
if LAMMPS is build with that package. See the <A HREF = "Section_start.html#3">Making of LAMMPS</A>
section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>,
<A HREF = "pair_coul_diel.html">pair_style coul/diel</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_gauss.txt b/doc/pair_gauss.txt
index 63462f918..62092ce38 100644
--- a/doc/pair_gauss.txt
+++ b/doc/pair_gauss.txt
@@ -1,156 +1,156 @@
"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 gauss command :h3
pair_style gauss/omp command :h3
pair_style gauss/cut command :h3
pair_style gauss/cut/omp command :h3
[Syntax:]
pair_style gauss cutoff
pair_style gauss/cut cutoff :pre
cutoff = global cutoff for Gauss interactions (distance units) :ul
[Examples:]
pair_style gauss 12.0
pair_coeff * * 1.0 0.9
pair_coeff 1 4 1.0 0.9 10.0 :pre
pair_style gauss/cut 3.5
pair_coeff 1 4 0.2805 1.45 0.112 :pre
[Description:]
Style {gauss} computes a tethering potential of the form
:c,image(Eqs/pair_gauss.jpg)
between an atom and its corresponding tether site which will typically
be a frozen atom in the simulation. Rc is the cutoff.
The following coefficients must be defined for each pair of atom 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:
A (energy units)
B (1/distance^2 units)
cutoff (distance units) :ul
The last coefficient is optional. If not specified, the global cutoff
is used.
Style {gauss/cut} computes a generalized Gaussian interaction potential
between pairs of particles:
:c,image(Eqs/pair_gauss_cut.jpg)
where H determines together with the standard deviation sigma_h the
peak height of the Gaussian function, and r_mh the peak position.
Examples of the use of the Gaussian potentials include implicit
solvent simulations of salt ions "(Lenart)"_#Lenart and of surfactants
"(Jusufi)"_#Jusufi. In these instances the Gaussian potential mimics
the hydration barrier between a pair of particles. The hydration
barrier is located at r_mh and has a width of sigma_h. The prefactor
determines the hight of the potential barrier.
The following coefficients must be defined for each pair of atom types
via the "pair_coeff"_pair_coeff.html command as in the example above,
or in the data file or restart files read by the
"read_data"_read_data.html or "read_restart"_read_restart.html
commands:
H (energy * distance units)
r_mh (distance units)
sigma_h (distance units) :ul
The global cutoff (r_c) specified in the pair_style command is used.
:line
Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
the same as the corresponding style without the suffix. They have
been optimized to run faster, depending on your available hardware, as
-discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
These pair style do not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
The {gauss} style does not support the "pair_modify"_pair_modify.html
shift option. There is no effect due to the Gaussian well beyond the
cutoff; hence reasonable cutoffs need to be specified.
The {gauss/cut} style supports the "pair_modify"_pair_modify.html shift
option for the energy of the Gauss-potential portion of the pair
interaction.
The "pair_modify"_pair_modify.html table and tail options are not
relevant for this pair style.
This pair style does not support the "pair_modify"_pair_modify.html
table option, since a tabulation capability does not exist for this
potential.
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.
Thes {gauss} pair style tallies an "occupancy" count of how many Gaussian-well
sites have an atom within the distance at which the force is a maximum
= sqrt(0.5/b). This quantity can be accessed via the "compute
pair"_compute_pair.html command as a vector of values of length 1.
To print this quantity to the log file (with a descriptive column
heading) the following commands could be included in an input script:
compute gauss all pair gauss
variable occ equal c_gauss\[1\]
thermo_style custom step temp epair v_occ :pre
:line
[Restrictions:]
The {gauss/cut} style is part of the "user-misc" package. It is only enabled
if LAMMPS is build with that package. See the "Making of LAMMPS"_Section_start.html#3
section for more info.
[Related commands:]
"pair_coeff"_pair_coeff.html,
"pair_style coul/diel"_pair_coul_diel.html
[Default:] none
diff --git a/doc/pair_gayberne.html b/doc/pair_gayberne.html
index ff4e001ce..de5b34c3b 100644
--- a/doc/pair_gayberne.html
+++ b/doc/pair_gayberne.html
@@ -1,240 +1,240 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style gayberne command
</H3>
<H3>pair_style gayberne/gpu command
</H3>
<H3>pair_style gayberne/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style gayberne gamma upsilon mu cutoff
</PRE>
<UL><LI>gamma = shift for potential minimum (typically 1)
<LI>upsilon = exponent for eta orientation-dependent energy function
<LI>mu = exponent for chi orientation-dependent energy function
<LI>cutoff = global cutoff for interactions (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style gayberne 1.0 1.0 1.0 10.0
pair_coeff * * 1.0 1.7 1.7 3.4 3.4 1.0 1.0 1.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>gayberne</I> styles compute a Gay-Berne anisotropic LJ interaction
<A HREF = "#Berardi">(Berardi)</A> between pairs of ellipsoidal particles or an
ellipsoidal and spherical particle via the formulas
</P>
<CENTER><IMG SRC = "Eqs/pair_gayberne.jpg">
</CENTER>
<P>where A1 and A2 are the transformation matrices from the simulation
box frame to the body frame and r12 is the center to center vector
between the particles. Ur controls the shifted distance dependent
interaction based on the distance of closest approach of the two
particles (h12) and the user-specified shift parameter gamma. When
both particles are spherical, the formula reduces to the usual
Lennard-Jones interaction (see details below for when Gay-Berne treats
a particle as "spherical").
</P>
<P>For large uniform molecules it has been shown that the energy
parameters are approximately representable in terms of local contact
curvatures <A HREF = "#Everaers">(Everaers)</A>:
</P>
<CENTER><IMG SRC = "Eqs/pair_gayberne2.jpg">
</CENTER>
<P>The variable names utilized as potential parameters are for the most
part taken from <A HREF = "#Everaers">(Everaers)</A> in order to be consistent with
the <A HREF = "pair_resquared.html">RE-squared pair potential</A>. Details on the
upsilon and mu parameters are given
<A HREF = "PDF/pair_resquared_extra.pdf">here</A>.
</P>
<P>More details of the Gay-Berne formulation are given in the references
listed below and in <A HREF = "PDF/pair_gayberne_extra.pdf">this supplementary
document</A>.
</P>
<P>Use of this pair style requires the NVE, NVT, or NPT fixes with the
<I>asphere</I> extension (e.g. <A HREF = "fix_nve_asphere.html">fix nve/asphere</A>) in
order to integrate particle rotation. Additionally, <A HREF = "atom_style.html">atom_style
ellipsoid</A> should be used since it defines the
rotational state and the size and shape of each ellipsoidal particle.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>epsilon = well depth (energy units)
<LI>sigma = minimum effective particle radii (distance units)
<LI>epsilon_i_a = relative well depth of type I for side-to-side interactions
<LI>epsilon_i_b = relative well depth of type I for face-to-face interactions
<LI>epsilon_i_c = relative well depth of type I for end-to-end interactions
<LI>epsilon_j_a = relative well depth of type J for side-to-side interactions
<LI>epsilon_j_b = relative well depth of type J for face-to-face interactions
<LI>epsilon_j_c = relative well depth of type J for end-to-end interactions
<LI>cutoff (distance units)
</UL>
<P>The last coefficient is optional. If not specified, the global
cutoff specified in the pair_style command is used.
</P>
<P>It is typical with the Gay-Berne potential to define <I>sigma</I> as the
minimum of the 3 shape diameters of the particles involved in an I,I
interaction, though this is not required. Note that this is a
different meaning for <I>sigma</I> than the <A HREF = "pair_resquared.html">pair_style
resquared</A> potential uses.
</P>
<P>The epsilon_i and epsilon_j coefficients are actually defined for atom
types, not for pairs of atom types. Thus, in a series of pair_coeff
commands, they only need to be specified once for each atom type.
</P>
<P>Specifically, if any of epsilon_i_a, epsilon_i_b, epsilon_i_c are
non-zero, the three values are assigned to atom type I. If all the
epsilon_i values are zero, they are ignored. If any of epsilon_j_a,
epsilon_j_b, epsilon_j_c are non-zero, the three values are assigned
to atom type J. If all three epsilon_i values are zero, they are
ignored. Thus the typical way to define the epsilon_i and epsilon_j
coefficients is to list their values in "pair_coeff I J" commands when
I = J, but set them to 0.0 when I != J. If you do list them when I !=
J, you should insure they are consistent with their values in other
pair_coeff commands.
</P>
<P>Note that if this potential is being used as a sub-style of
<A HREF = "pair_hybrid.html">pair_style hybrid</A>, and there is no "pair_coeff I I"
setting made for Gay-Berne for a particular type I (because I-I
interactions are computed by another hybrid pair potential), then you
still need to insure the epsilon a,b,c coefficients are assigned to
that type in a "pair_coeff I J" command.
</P>
<P>IMPORTANT NOTE: If the epsilon a = b = c for an atom type, and if the
shape of the particle itself is spherical, meaning its 3 shape
parameters are all the same, then the particle is treated as an LJ
sphere by the Gay-Berne potential. This is significant because if two
LJ spheres interact, then the simple Lennard-Jones formula is used to
compute their interaction energy/force using the specified epsilon and
sigma as the standard LJ parameters. This is much cheaper to compute
than the full Gay-Berne formula. To treat the particle as a LJ sphere
with sigma = D, you should normally set epsilon a = b = c = 1.0, set
the pair_coeff sigma = D, and also set the 3 shape parameters for the
particle to D. The one exception is that if the 3 shape parameters
are set to 0.0, which is a valid way in LAMMPS to specify a point
particle, then the Gay-Berne potential will treat that as shape
parameters of 1.0 (i.e. a LJ particle with sigma = 1), since it
requires finite-size particles. In this case you should still set the
pair_coeff sigma to 1.0 as well.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for this pair style can be mixed. The default mix
value is <I>geometric</I>. See the "pair_modify" command for details.
</P>
<P>This pair styles supports the <A HREF = "pair_modify.html">pair_modify</A> shift
option for the energy of the Lennard-Jones portion of the pair
interaction, but only for sphere-sphere interactions. There is no
shifting performed for ellipsoidal interactions due to the anisotropic
dependence of the interaction.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for this pair style.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding long-range tail corrections to energy and
pressure.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>The <I>gayberne</I> style is part of the ASPHERE package. It is only
enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>These pair style require that atoms store torque and a quaternion to
represent their orientation, as defined by the
<A HREF = "atom_style.html">atom_style</A>. It also require they store a per-type
<A HREF = "shape.html">shape</A>. The particles cannot store a per-particle
diameter.
</P>
<P>This pair style requires that atoms be ellipsoids as defined by the
<A HREF = "atom_style.html">atom_style ellipsoid</A> command.
</P>
<P>Particles acted on by the potential can be extended aspherical or
spherical particles, or point particles. Spherical particles have all
3 of their shape parameters equal to each other. Point particles have
all 3 of their shape parameters equal to 0.0.
</P>
<P>The Gay-Berne potential does not become isotropic as r increases
<A HREF = "#Everaers">(Everaers)</A>. The distance-of-closest-approach
approximation used by LAMMPS becomes less accurate when high-aspect
ratio ellipsoids are used.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "fix_nve_asphere.html">fix nve/asphere</A>,
<A HREF = "compute_temp_asphere.html">compute temp/asphere</A>, <A HREF = "pair_resquared.html">pair_style
resquared</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Everaers"></A>
<P><B>(Everaers)</B> Everaers and Ejtehadi, Phys Rev E, 67, 041710 (2003).
</P>
<A NAME = "Berardi"></A>
<P><B>(Berardi)</B> Berardi, Fava, Zannoni, Chem Phys Lett, 297, 8-14 (1998).
Berardi, Muccioli, Zannoni, J Chem Phys, 128, 024905 (2008).
</P>
<A NAME = "Perram"></A>
<P><B>(Perram)</B> Perram and Rasmussen, Phys Rev E, 54, 6565-6572 (1996).
</P>
<A NAME = "Allen"></A>
<P><B>(Allen)</B> Allen and Germano, Mol Phys 104, 3225-3235 (2006).
</P>
</HTML>
diff --git a/doc/pair_gayberne.txt b/doc/pair_gayberne.txt
index 9b3363c00..a83b4f43c 100755
--- a/doc/pair_gayberne.txt
+++ b/doc/pair_gayberne.txt
@@ -1,229 +1,229 @@
"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 gayberne command :h3
pair_style gayberne/gpu command :h3
pair_style gayberne/omp command :h3
[Syntax:]
pair_style gayberne gamma upsilon mu cutoff :pre
gamma = shift for potential minimum (typically 1)
upsilon = exponent for eta orientation-dependent energy function
mu = exponent for chi orientation-dependent energy function
cutoff = global cutoff for interactions (distance units) :ul
[Examples:]
pair_style gayberne 1.0 1.0 1.0 10.0
pair_coeff * * 1.0 1.7 1.7 3.4 3.4 1.0 1.0 1.0 :pre
[Description:]
The {gayberne} styles compute a Gay-Berne anisotropic LJ interaction
"(Berardi)"_#Berardi between pairs of ellipsoidal particles or an
ellipsoidal and spherical particle via the formulas
:c,image(Eqs/pair_gayberne.jpg)
where A1 and A2 are the transformation matrices from the simulation
box frame to the body frame and r12 is the center to center vector
between the particles. Ur controls the shifted distance dependent
interaction based on the distance of closest approach of the two
particles (h12) and the user-specified shift parameter gamma. When
both particles are spherical, the formula reduces to the usual
Lennard-Jones interaction (see details below for when Gay-Berne treats
a particle as "spherical").
For large uniform molecules it has been shown that the energy
parameters are approximately representable in terms of local contact
curvatures "(Everaers)"_#Everaers:
:c,image(Eqs/pair_gayberne2.jpg)
The variable names utilized as potential parameters are for the most
part taken from "(Everaers)"_#Everaers in order to be consistent with
the "RE-squared pair potential"_pair_resquared.html. Details on the
upsilon and mu parameters are given
"here"_PDF/pair_resquared_extra.pdf.
More details of the Gay-Berne formulation are given in the references
listed below and in "this supplementary
document"_PDF/pair_gayberne_extra.pdf.
Use of this pair style requires the NVE, NVT, or NPT fixes with the
{asphere} extension (e.g. "fix nve/asphere"_fix_nve_asphere.html) in
order to integrate particle rotation. Additionally, "atom_style
ellipsoid"_atom_style.html should be used since it defines the
rotational state and the size and shape of each ellipsoidal particle.
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:
epsilon = well depth (energy units)
sigma = minimum effective particle radii (distance units)
epsilon_i_a = relative well depth of type I for side-to-side interactions
epsilon_i_b = relative well depth of type I for face-to-face interactions
epsilon_i_c = relative well depth of type I for end-to-end interactions
epsilon_j_a = relative well depth of type J for side-to-side interactions
epsilon_j_b = relative well depth of type J for face-to-face interactions
epsilon_j_c = relative well depth of type J for end-to-end interactions
cutoff (distance units) :ul
The last coefficient is optional. If not specified, the global
cutoff specified in the pair_style command is used.
It is typical with the Gay-Berne potential to define {sigma} as the
minimum of the 3 shape diameters of the particles involved in an I,I
interaction, though this is not required. Note that this is a
different meaning for {sigma} than the "pair_style
resquared"_pair_resquared.html potential uses.
The epsilon_i and epsilon_j coefficients are actually defined for atom
types, not for pairs of atom types. Thus, in a series of pair_coeff
commands, they only need to be specified once for each atom type.
Specifically, if any of epsilon_i_a, epsilon_i_b, epsilon_i_c are
non-zero, the three values are assigned to atom type I. If all the
epsilon_i values are zero, they are ignored. If any of epsilon_j_a,
epsilon_j_b, epsilon_j_c are non-zero, the three values are assigned
to atom type J. If all three epsilon_i values are zero, they are
ignored. Thus the typical way to define the epsilon_i and epsilon_j
coefficients is to list their values in "pair_coeff I J" commands when
I = J, but set them to 0.0 when I != J. If you do list them when I !=
J, you should insure they are consistent with their values in other
pair_coeff commands.
Note that if this potential is being used as a sub-style of
"pair_style hybrid"_pair_hybrid.html, and there is no "pair_coeff I I"
setting made for Gay-Berne for a particular type I (because I-I
interactions are computed by another hybrid pair potential), then you
still need to insure the epsilon a,b,c coefficients are assigned to
that type in a "pair_coeff I J" command.
IMPORTANT NOTE: If the epsilon a = b = c for an atom type, and if the
shape of the particle itself is spherical, meaning its 3 shape
parameters are all the same, then the particle is treated as an LJ
sphere by the Gay-Berne potential. This is significant because if two
LJ spheres interact, then the simple Lennard-Jones formula is used to
compute their interaction energy/force using the specified epsilon and
sigma as the standard LJ parameters. This is much cheaper to compute
than the full Gay-Berne formula. To treat the particle as a LJ sphere
with sigma = D, you should normally set epsilon a = b = c = 1.0, set
the pair_coeff sigma = D, and also set the 3 shape parameters for the
particle to D. The one exception is that if the 3 shape parameters
are set to 0.0, which is a valid way in LAMMPS to specify a point
particle, then the Gay-Berne potential will treat that as shape
parameters of 1.0 (i.e. a LJ particle with sigma = 1), since it
requires finite-size particles. In this case you should still set the
pair_coeff sigma to 1.0 as well.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for this pair style can be mixed. The default mix
value is {geometric}. See the "pair_modify" command for details.
This pair styles supports the "pair_modify"_pair_modify.html shift
option for the energy of the Lennard-Jones portion of the pair
interaction, but only for sphere-sphere interactions. There is no
shifting performed for ellipsoidal interactions due to the anisotropic
dependence of the 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:]
The {gayberne} style is part of the ASPHERE package. It is only
enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
These pair style require that atoms store torque and a quaternion to
represent their orientation, as defined by the
"atom_style"_atom_style.html. It also require they store a per-type
"shape"_shape.html. The particles cannot store a per-particle
diameter.
This pair style requires that atoms be ellipsoids as defined by the
"atom_style ellipsoid"_atom_style.html command.
Particles acted on by the potential can be extended aspherical or
spherical particles, or point particles. Spherical particles have all
3 of their shape parameters equal to each other. Point particles have
all 3 of their shape parameters equal to 0.0.
The Gay-Berne potential does not become isotropic as r increases
"(Everaers)"_#Everaers. The distance-of-closest-approach
approximation used by LAMMPS becomes less accurate when high-aspect
ratio ellipsoids are used.
[Related commands:]
"pair_coeff"_pair_coeff.html, "fix nve/asphere"_fix_nve_asphere.html,
"compute temp/asphere"_compute_temp_asphere.html, "pair_style
resquared"_pair_resquared.html
[Default:] none
:line
:link(Everaers)
[(Everaers)] Everaers and Ejtehadi, Phys Rev E, 67, 041710 (2003).
:link(Berardi)
[(Berardi)] Berardi, Fava, Zannoni, Chem Phys Lett, 297, 8-14 (1998).
Berardi, Muccioli, Zannoni, J Chem Phys, 128, 024905 (2008).
:link(Perram)
[(Perram)] Perram and Rasmussen, Phys Rev E, 54, 6565-6572 (1996).
:link(Allen)
[(Allen)] Allen and Germano, Mol Phys 104, 3225-3235 (2006).
diff --git a/doc/pair_gran.html b/doc/pair_gran.html
index f175e8f2c..d9862cbe6 100644
--- a/doc/pair_gran.html
+++ b/doc/pair_gran.html
@@ -1,264 +1,264 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style gran/hooke command
</H3>
<H3>pair_style gran/cuda command
</H3>
<H3>pair_style gran/omp command
</H3>
<H3>pair_style gran/hooke/history command
</H3>
<H3>pair_style gran/hooke/history/omp command
</H3>
<H3>pair_style gran/hertz/history command
</H3>
<H3>pair_style gran/hertz/history/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style Kn Kt gamma_n gamma_t xmu dampflag
</PRE>
<UL><LI>style = <I>gran/hooke</I> or <I>gran/hooke/history</I> or <I>gran/hertz/history</I>
<LI>Kn = elastic constant for normal particle repulsion (force/distance units or pressure units - see discussion below)
<LI>Kt = elastic constant for tangential contact (force/distance units or pressure units - see discussion below)
<LI>gamma_n = damping coefficient for collisions in normal direction (1/time units or 1/time-distance units - see discussion below)
<LI>gamma_t = damping coefficient for collisions in tangential direction (1/time units or 1/time-distance units - see discussion below)
<LI>xmu = static yield criterion (unitless fraction between 0.0 and 1.0)
<LI>dampflag = 0 or 1 if tangential damping force is excluded or included
</UL>
<P>IMPORTANT NOTE: Versions of LAMMPS before 9Jan09 had different style
names for granular force fields. This is to emphasize the fact that
the Hertzian equation has changed to model polydispersity more
accurately. A side effect of the change is that the Kn, Kt, gamma_n,
and gamma_t coefficients in the pair_style command must be specified
with different values in order to reproduce calculations made with
earlier versions of LAMMPS, even for monodisperse systems. See the
NOTE below for details.
</P>
<P><B>Examples:</B>
</P>
<PRE>pair_style gran/hooke/history 200000.0 NULL 50.0 NULL 0.5 1
pair_style gran/hooke 200000.0 70000.0 50.0 30.0 0.5 0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>gran</I> styles use the following formulas for the frictional force
between two granular particles, as described in
<A HREF = "#Brilliantov">(Brilliantov)</A>, <A HREF = "#Silbert">(Silbert)</A>, and
<A HREF = "#Zhang">(Zhang)</A>, when the distance r between two particles of radii
Ri and Rj is less than their contact distance d = Ri + Rj. There is
no force between the particles when r > d.
</P>
<P>The two Hookean styles use this formula:
</P>
<CENTER><IMG SRC = "Eqs/pair_gran_hooke.jpg">
</CENTER>
<P>The Hertzian style uses this formula:
</P>
<CENTER><IMG SRC = "Eqs/pair_gran_hertz.jpg">
</CENTER>
<P>In both equations the first parenthesized term is the normal force
between the two particles and the second parenthesized term is the
tangential force. The normal force has 2 terms, a contact force and a
damping force. The tangential force also has 2 terms: a shear force
and a damping force. The shear force is a "history" effect that
accounts for the tangential displacement between the particles for the
duration of the time they are in contact. This term is included in
pair styles <I>hooke/history</I> and <I>hertz/history</I>, but is not included
in pair style <I>hooke</I>. The tangential damping force term is included
in all three pair styles if <I>dampflag</I> is set to 1; it is not included
if <I>dampflag</I> is set to 0.
</P>
<P>The other quantities in the equations are as follows:
</P>
<UL><LI>delta = d - r = overlap distance of 2 particles
<LI>Kn = elastic constant for normal contact
<LI>Kt = elastic constant for tangential contact
<LI>gamma_n = viscoelastic damping constant for normal contact
<LI>gamma_t = viscoelastic damping constant for tangential contact
<LI>m_eff = Mi Mj / (Mi + Mj) = effective mass of 2 particles of mass Mi and Mj
<LI>Delta St = tangential displacement vector between 2 spherical particles which is truncated to satisfy a frictional yield criterion
<LI>n_ij = unit vector along the line connecting the centers of the 2 particles
<LI>Vn = normal component of the relative velocity of the 2 particles
<LI>Vt = tangential component of the relative velocity of the 2 particles
</UL>
<P>The Kn, Kt, gamma_n, and gamma_t coefficients are specified as
parameters to the pair_style command. If a NULL is used for Kt, then
a default value is used where Kt = 2/7 Kn. If a NULL is used for
gamma_t, then a default value is used where gamma_t = 1/2 gamma_n.
</P>
<P>The interpretation and units for these 4 coefficients are different in
the Hookean versus Hertzian equations.
</P>
<P>The Hookean model is one where the normal push-back force for two
overlapping particles is a linear function of the overlap distance.
Thus the specified Kn is in units of (force/distance). Note that this
push-back force is independent of absolute particle size (in the
monodisperse case) and of the relative sizes of the two particles (in
the polydisperse case). This model also applies to the other terms in
the force equation so that the specified gamma_n is in units of
(1/time), Kt is in units of (force/distance), and gamma_t is in units
of (1/time).
</P>
<P>The Hertzian model is one where the normal push-back force for two
overlapping particles is proportional to the area of overlap of the
two particles, and is thus a non-linear function of overlap distance.
Thus Kn has units of force per area and is thus specified in units of
(pressure). The effects of absolute particle size (monodispersity)
and relative size (polydispersity) are captured in the radii-dependent
pre-factors. When these pre-factors are carried through to the other
terms in the force equation it means that the specified gamma_n is in
units of (1/(time*distance)), Kt is in units of (pressure), and
gamma_t is in units of (1/(time*distance)).
</P>
<P>Note that in the Hookean case, Kn can be thought of as a linear spring
constant with units of force/distance. In the Hertzian case, Kn is
like a non-linear spring constant with units of force/area or
pressure, and as shown in the <A HREF = "#Zhang">(Zhang)</A> paper, Kn = 4G /
(3(1-nu)) where nu = the Poisson ratio, G = shear modulus = E /
(2(1+nu)), and E = Young's modulus. Similarly, Kt = 8G / (2-nu).
Thus in the Hertzian case Kn and Kt can be set to values that
corresponds to properties of the material being modeled. This is also
true in the Hookean case, except that a spring constant must be chosen
that is appropriate for the absolute size of particles in the model.
Since relative particle sizes are not accounted for, the Hookean
styles may not be a suitable model for polydisperse systems.
</P>
<P>IMPORTANT NOTE: In versions of LAMMPS before 9Jan09, the equation for
Hertzian interactions did not include the sqrt(RiRj/Ri+Rj) term and
thus was not as accurate for polydisperse systems. For monodisperse
systems, sqrt(RiRj/Ri+Rj) is a constant factor that effectively scales
all 4 coefficients: Kn, Kt, gamma_n, gamma_t. Thus you can set the
values of these 4 coefficients appropriately in the current code to
reproduce the results of a previous Hertzian monodisperse calculation.
For example, for the common case of a monodisperse system with
particles of diameter 1, all 4 of these coefficients should now be set
2x larger than they were previously.
</P>
<P>Xmu is also specified in the pair_style command and is the upper limit
of the tangential force through the Coulomb criterion Ft = xmu*Fn,
where Ft and Fn are the total tangential and normal force components
in the formulas above. Thus in the Hookean case, the tangential force
between 2 particles grows according to a tangential spring and
dash-pot model until Ft/Fn = xmu and is then held at Ft = Fn*xmu until
the particles lose contact. In the Hertzian case, a similar analogy
holds, though the spring is no longer linear.
</P>
<P>For granular styles there are no additional coefficients to set for
each pair of atom types via the <A HREF = "pair_coeff.html">pair_coeff</A> command.
All settings are global and are made via the pair_style command.
However you must still use the <A HREF = "pair_coeff.html">pair_coeff</A> for all
pairs of granular atom types. For example the command
</P>
<PRE>pair_coeff * *
</PRE>
<P>should be used if all atoms in the simulation interact via a granular
potential (i.e. one of the pair styles above is used). If a granular
potential is used as a sub-style of <A HREF = "pair_hybrid.html">pair_style
hybrid</A>, then specific atom types can be used in the
pair_coeff command to determine which atoms interact via a granular
potential.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> mix, shift, table, and tail options
are not relevant for granular pair styles.
</P>
<P>These pair styles write their information to <A HREF = "restart.html">binary restart
files</A>, so a pair_style command does not need to be
specified in an input script that reads a restart file.
</P>
<P>These pair styles can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. They do not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<P>The single() function of these pair styles returns 0.0 for the energy
of a pairwise interaction, since energy is not conserved in these
dissipative potentials. It also returns only the normal component of
the pairwise interaction force. However, the single() function also
calculates 4 extra pairwise quantities. The first 3 are the
components of the tangential force between particles I and J, acting
on particle I. <I>P4</I> is the magnitude of this tangential force. These
extra quantites can be accessed by the <A HREF = "compute_pair_local.html">compute
pair/local</A> command, as <I>p1</I>, <I>p2</I>, <I>p3</I>,
<I>p4</I>.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P>All the granular pair styles are part of the GRANULAR package. It is
only enabled if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>These pair styles require that atoms store torque and angular velocity
(omega) as defined by the <A HREF = "atom_style.html">atom_style</A>. They also
require a per-particle radius is stored. The <I>sphere</I> atom style does
all of this.
</P>
<P>This pair style requires you to use the <A HREF = "communicate.html">communicate vel
yes</A> option so that velocites are stored by ghost
atoms.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Brilliantov"></A>
<P><B>(Brilliantov)</B> Brilliantov, Spahn, Hertzsch, Poschel, Phys Rev E, 53,
p 5382-5392 (1996).
</P>
<A NAME = "Silbert"></A>
<P><B>(Silbert)</B> Silbert, Ertas, Grest, Halsey, Levine, Plimpton, Phys Rev
E, 64, p 051302 (2001).
</P>
<A NAME = "Zhang"></A>
<P><B>(Zhang)</B> Zhang and Makse, Phys Rev E, 72, p 011301 (2005).
</P>
</HTML>
diff --git a/doc/pair_gran.txt b/doc/pair_gran.txt
index 3dfa8b3a9..d84b2ae48 100644
--- a/doc/pair_gran.txt
+++ b/doc/pair_gran.txt
@@ -1,245 +1,245 @@
"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 gran/hooke command :h3
pair_style gran/cuda command :h3
pair_style gran/omp command :h3
pair_style gran/hooke/history command :h3
pair_style gran/hooke/history/omp command :h3
pair_style gran/hertz/history command :h3
pair_style gran/hertz/history/omp command :h3
[Syntax:]
pair_style style Kn Kt gamma_n gamma_t xmu dampflag :pre
style = {gran/hooke} or {gran/hooke/history} or {gran/hertz/history} :ulb,l
Kn = elastic constant for normal particle repulsion (force/distance units or pressure units - see discussion below) :l
Kt = elastic constant for tangential contact (force/distance units or pressure units - see discussion below) :l
gamma_n = damping coefficient for collisions in normal direction (1/time units or 1/time-distance units - see discussion below) :l
gamma_t = damping coefficient for collisions in tangential direction (1/time units or 1/time-distance units - see discussion below) :l
xmu = static yield criterion (unitless fraction between 0.0 and 1.0) :l
dampflag = 0 or 1 if tangential damping force is excluded or included :l,ule
IMPORTANT NOTE: Versions of LAMMPS before 9Jan09 had different style
names for granular force fields. This is to emphasize the fact that
the Hertzian equation has changed to model polydispersity more
accurately. A side effect of the change is that the Kn, Kt, gamma_n,
and gamma_t coefficients in the pair_style command must be specified
with different values in order to reproduce calculations made with
earlier versions of LAMMPS, even for monodisperse systems. See the
NOTE below for details.
[Examples:]
pair_style gran/hooke/history 200000.0 NULL 50.0 NULL 0.5 1
pair_style gran/hooke 200000.0 70000.0 50.0 30.0 0.5 0 :pre
[Description:]
The {gran} styles use the following formulas for the frictional force
between two granular particles, as described in
"(Brilliantov)"_#Brilliantov, "(Silbert)"_#Silbert, and
"(Zhang)"_#Zhang, when the distance r between two particles of radii
Ri and Rj is less than their contact distance d = Ri + Rj. There is
no force between the particles when r > d.
The two Hookean styles use this formula:
:c,image(Eqs/pair_gran_hooke.jpg)
The Hertzian style uses this formula:
:c,image(Eqs/pair_gran_hertz.jpg)
In both equations the first parenthesized term is the normal force
between the two particles and the second parenthesized term is the
tangential force. The normal force has 2 terms, a contact force and a
damping force. The tangential force also has 2 terms: a shear force
and a damping force. The shear force is a "history" effect that
accounts for the tangential displacement between the particles for the
duration of the time they are in contact. This term is included in
pair styles {hooke/history} and {hertz/history}, but is not included
in pair style {hooke}. The tangential damping force term is included
in all three pair styles if {dampflag} is set to 1; it is not included
if {dampflag} is set to 0.
The other quantities in the equations are as follows:
delta = d - r = overlap distance of 2 particles
Kn = elastic constant for normal contact
Kt = elastic constant for tangential contact
gamma_n = viscoelastic damping constant for normal contact
gamma_t = viscoelastic damping constant for tangential contact
m_eff = Mi Mj / (Mi + Mj) = effective mass of 2 particles of mass Mi and Mj
Delta St = tangential displacement vector between 2 spherical particles \
which is truncated to satisfy a frictional yield criterion
n_ij = unit vector along the line connecting the centers of the 2 particles
Vn = normal component of the relative velocity of the 2 particles
Vt = tangential component of the relative velocity of the 2 particles :ul
The Kn, Kt, gamma_n, and gamma_t coefficients are specified as
parameters to the pair_style command. If a NULL is used for Kt, then
a default value is used where Kt = 2/7 Kn. If a NULL is used for
gamma_t, then a default value is used where gamma_t = 1/2 gamma_n.
The interpretation and units for these 4 coefficients are different in
the Hookean versus Hertzian equations.
The Hookean model is one where the normal push-back force for two
overlapping particles is a linear function of the overlap distance.
Thus the specified Kn is in units of (force/distance). Note that this
push-back force is independent of absolute particle size (in the
monodisperse case) and of the relative sizes of the two particles (in
the polydisperse case). This model also applies to the other terms in
the force equation so that the specified gamma_n is in units of
(1/time), Kt is in units of (force/distance), and gamma_t is in units
of (1/time).
The Hertzian model is one where the normal push-back force for two
overlapping particles is proportional to the area of overlap of the
two particles, and is thus a non-linear function of overlap distance.
Thus Kn has units of force per area and is thus specified in units of
(pressure). The effects of absolute particle size (monodispersity)
and relative size (polydispersity) are captured in the radii-dependent
pre-factors. When these pre-factors are carried through to the other
terms in the force equation it means that the specified gamma_n is in
units of (1/(time*distance)), Kt is in units of (pressure), and
gamma_t is in units of (1/(time*distance)).
Note that in the Hookean case, Kn can be thought of as a linear spring
constant with units of force/distance. In the Hertzian case, Kn is
like a non-linear spring constant with units of force/area or
pressure, and as shown in the "(Zhang)"_#Zhang paper, Kn = 4G /
(3(1-nu)) where nu = the Poisson ratio, G = shear modulus = E /
(2(1+nu)), and E = Young's modulus. Similarly, Kt = 8G / (2-nu).
Thus in the Hertzian case Kn and Kt can be set to values that
corresponds to properties of the material being modeled. This is also
true in the Hookean case, except that a spring constant must be chosen
that is appropriate for the absolute size of particles in the model.
Since relative particle sizes are not accounted for, the Hookean
styles may not be a suitable model for polydisperse systems.
IMPORTANT NOTE: In versions of LAMMPS before 9Jan09, the equation for
Hertzian interactions did not include the sqrt(RiRj/Ri+Rj) term and
thus was not as accurate for polydisperse systems. For monodisperse
systems, sqrt(RiRj/Ri+Rj) is a constant factor that effectively scales
all 4 coefficients: Kn, Kt, gamma_n, gamma_t. Thus you can set the
values of these 4 coefficients appropriately in the current code to
reproduce the results of a previous Hertzian monodisperse calculation.
For example, for the common case of a monodisperse system with
particles of diameter 1, all 4 of these coefficients should now be set
2x larger than they were previously.
Xmu is also specified in the pair_style command and is the upper limit
of the tangential force through the Coulomb criterion Ft = xmu*Fn,
where Ft and Fn are the total tangential and normal force components
in the formulas above. Thus in the Hookean case, the tangential force
between 2 particles grows according to a tangential spring and
dash-pot model until Ft/Fn = xmu and is then held at Ft = Fn*xmu until
the particles lose contact. In the Hertzian case, a similar analogy
holds, though the spring is no longer linear.
For granular styles there are no additional coefficients to set for
each pair of atom types via the "pair_coeff"_pair_coeff.html command.
All settings are global and are made via the pair_style command.
However you must still use the "pair_coeff"_pair_coeff.html for all
pairs of granular atom types. For example the command
pair_coeff * * :pre
should be used if all atoms in the simulation interact via a granular
potential (i.e. one of the pair styles above is used). If a granular
potential is used as a sub-style of "pair_style
hybrid"_pair_hybrid.html, then specific atom types can be used in the
pair_coeff command to determine which atoms interact via a granular
potential.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
The "pair_modify"_pair_modify.html mix, shift, table, and tail options
are not relevant for granular pair styles.
These pair styles write their information to "binary restart
files"_restart.html, so a pair_style command does not need to be
specified in an input script that reads a restart file.
These pair styles can only be used via the {pair} keyword of the
"run_style respa"_run_style.html command. They do not support the
{inner}, {middle}, {outer} keywords.
The single() function of these pair styles returns 0.0 for the energy
of a pairwise interaction, since energy is not conserved in these
dissipative potentials. It also returns only the normal component of
the pairwise interaction force. However, the single() function also
calculates 4 extra pairwise quantities. The first 3 are the
components of the tangential force between particles I and J, acting
on particle I. {P4} is the magnitude of this tangential force. These
extra quantites can be accessed by the "compute
pair/local"_compute_pair_local.html command, as {p1}, {p2}, {p3},
{p4}.
:line
[Restrictions:] none
All the granular pair styles are part of the GRANULAR package. It is
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
These pair styles require that atoms store torque and angular velocity
(omega) as defined by the "atom_style"_atom_style.html. They also
require a per-particle radius is stored. The {sphere} atom style does
all of this.
This pair style requires you to use the "communicate vel
yes"_communicate.html option so that velocites are stored by ghost
atoms.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Brilliantov)
[(Brilliantov)] Brilliantov, Spahn, Hertzsch, Poschel, Phys Rev E, 53,
p 5382-5392 (1996).
:link(Silbert)
[(Silbert)] Silbert, Ertas, Grest, Halsey, Levine, Plimpton, Phys Rev
E, 64, p 051302 (2001).
:link(Zhang)
[(Zhang)] Zhang and Makse, Phys Rev E, 72, p 011301 (2005).
diff --git a/doc/pair_gromacs.html b/doc/pair_gromacs.html
index aa8051d5c..3f84634b5 100644
--- a/doc/pair_gromacs.html
+++ b/doc/pair_gromacs.html
@@ -1,165 +1,165 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style lj/gromacs command
</H3>
<H3>pair_style lj/gromacs/cuda command
</H3>
<H3>pair_style lj/gromacs/omp command
</H3>
<H3>pair_style lj/gromacs/coul/gromacs command
</H3>
<H3>pair_style lj/gromacs/coul/gromacs/cuda command
</H3>
<H3>pair_style lj/gromacs/coul/gromacs/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style args
</PRE>
<UL><LI>style = <I>lj/gromacs</I> or <I>lj/gromacs/coul/gromacs</I>
<LI>args = list of arguments for a particular style
</UL>
<PRE> <I>lj/gromacs</I> args = inner outer
inner, outer = global switching cutoffs for Lennard Jones
<I>lj/gromacs/coul/gromacs</I> args = inner outer (inner2) (outer2)
inner, outer = global switching cutoffs for Lennard Jones (and Coulombic if only 2 args)
inner2, outer2 = global switching cutoffs for Coulombic (optional)
</PRE>
<P><B>Examples:</B>
</P>
<PRE>pair_style lj/gromacs 9.0 12.0
pair_coeff * * 100.0 2.0
pair_coeff 2 2 100.0 2.0 8.0 10.0
</PRE>
<PRE>pair_style lj/gromacs/coul/gromacs 9.0 12.0
pair_style lj/gromacs/coul/gromacs 8.0 10.0 7.0 9.0
pair_coeff * * 100.0 2.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>lj/gromacs</I> styles compute shifted LJ and Coulombic interactions
with an additional switching function S(r) that ramps the energy and force
smoothly to zero between an inner and outer cutoff. It is a commonly
used potential in the <A HREF = "http://www.gromacs.org">GROMACS</A> MD code and for
the coarse-grained models of <A HREF = "#Marrink">(Marrink)</A>.
</P>
<CENTER><IMG SRC = "Eqs/pair_gromacs.jpg">
</CENTER>
<P>R1 is the inner cutoff; Rc is the outer cutoff. The coefficients A, B,
and C are computed by LAMMPS to perform the shifting and smoothing.
The function
S(r) is actually applied once to each term of the LJ formula and once
to the Coulombic formula, so there are 2 or 3 sets of A,B,C coefficients
depending on which pair_style is used. The boundary conditions
applied to the smoothing function are as follows: S(r1) = S'(r1) = 0,
S(rc) = -F(rc), S'(rc) = -F'(rc), where F(r) is the corresponding term
in the LJ or Coulombic potential energy function and a
single quote represents a derivative with respect to r.
</P>
<P>The inner and outer cutoff for the LJ and Coulombic terms can be the
same or different depending on whether 2 or 4 arguments are used in
the pair_style command. The inner LJ cutoff must be > 0, but the
inner Coulombic cutoff can be >= 0.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>inner (distance units)
<LI>outer (distance units)
</UL>
<P>Note that sigma is defined in the LJ formula as the zero-crossing
distance for the potential, not as the energy minimum at 2^(1/6)
sigma.
</P>
<P>The last 2 coefficients are optional inner and outer cutoffs for style
<I>lj/gromacs</I>. If not specified, the global <I>inner</I> and <I>outer</I> values
are used.
</P>
<P>The last 2 coefficients cannot be used with style
<I>lj/gromacs/coul/gromacs</I> because this force field does not allow
varying cutoffs for individual atom pairs; all pairs use the global
cutoff(s) specified in the pair_style command.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/cut pair styles can be mixed.
The default mix value is <I>geometric</I>. See the "pair_modify" command
for details.
</P>
<P>None of the GROMACS pair styles support the
<A HREF = "pair_modify.html">pair_modify</A> shift option, since the Lennard-Jones
portion of the pair interaction is already smoothed to 0.0 at the
cutoff.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for this pair style.
</P>
<P>None of the GROMACS pair styles support the
<A HREF = "pair_modify.html">pair_modify</A> tail option for adding long-range tail
corrections to energy and pressure, since there are no corrections for
a potential that goes to 0.0 at the cutoff.
</P>
<P>All of the GROMACS pair styles write their information to <A HREF = "restart.html">binary
restart files</A>, so pair_style and pair_coeff commands do
not need to be specified in an input script that reads a restart file.
</P>
<P>All of the GROMACS pair styles can only be used via the <I>pair</I>
keyword of the <A HREF = "run_style.html">run_style respa</A> command. They do not
support the <I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Marrink"></A>
<P><B>(Marrink)</B> Marrink, de Vries, Mark, J Phys Chem B, 108, 750-760 (2004).
</P>
</HTML>
diff --git a/doc/pair_gromacs.txt b/doc/pair_gromacs.txt
index 5fc8ef3c4..d276615d1 100644
--- a/doc/pair_gromacs.txt
+++ b/doc/pair_gromacs.txt
@@ -1,153 +1,153 @@
"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 lj/gromacs command :h3
pair_style lj/gromacs/cuda command :h3
pair_style lj/gromacs/omp command :h3
pair_style lj/gromacs/coul/gromacs command :h3
pair_style lj/gromacs/coul/gromacs/cuda command :h3
pair_style lj/gromacs/coul/gromacs/omp command :h3
[Syntax:]
pair_style style args :pre
style = {lj/gromacs} or {lj/gromacs/coul/gromacs}
args = list of arguments for a particular style :ul
{lj/gromacs} args = inner outer
inner, outer = global switching cutoffs for Lennard Jones
{lj/gromacs/coul/gromacs} args = inner outer (inner2) (outer2)
inner, outer = global switching cutoffs for Lennard Jones (and Coulombic if only 2 args)
inner2, outer2 = global switching cutoffs for Coulombic (optional) :pre
[Examples:]
pair_style lj/gromacs 9.0 12.0
pair_coeff * * 100.0 2.0
pair_coeff 2 2 100.0 2.0 8.0 10.0 :pre
pair_style lj/gromacs/coul/gromacs 9.0 12.0
pair_style lj/gromacs/coul/gromacs 8.0 10.0 7.0 9.0
pair_coeff * * 100.0 2.0 :pre
[Description:]
The {lj/gromacs} styles compute shifted LJ and Coulombic interactions
with an additional switching function S(r) that ramps the energy and force
smoothly to zero between an inner and outer cutoff. It is a commonly
used potential in the "GROMACS"_http://www.gromacs.org MD code and for
the coarse-grained models of "(Marrink)"_#Marrink.
:c,image(Eqs/pair_gromacs.jpg)
R1 is the inner cutoff; Rc is the outer cutoff. The coefficients A, B,
and C are computed by LAMMPS to perform the shifting and smoothing.
The function
S(r) is actually applied once to each term of the LJ formula and once
to the Coulombic formula, so there are 2 or 3 sets of A,B,C coefficients
depending on which pair_style is used. The boundary conditions
applied to the smoothing function are as follows: S(r1) = S'(r1) = 0,
S(rc) = -F(rc), S'(rc) = -F'(rc), where F(r) is the corresponding term
in the LJ or Coulombic potential energy function and a
single quote represents a derivative with respect to r.
The inner and outer cutoff for the LJ and Coulombic terms can be the
same or different depending on whether 2 or 4 arguments are used in
the pair_style command. The inner LJ cutoff must be > 0, but the
inner Coulombic cutoff can be >= 0.
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:
epsilon (energy units)
sigma (distance units)
inner (distance units)
outer (distance units) :ul
Note that sigma is defined in the LJ formula as the zero-crossing
distance for the potential, not as the energy minimum at 2^(1/6)
sigma.
The last 2 coefficients are optional inner and outer cutoffs for style
{lj/gromacs}. If not specified, the global {inner} and {outer} values
are used.
The last 2 coefficients cannot be used with style
{lj/gromacs/coul/gromacs} because this force field does not allow
varying cutoffs for individual atom pairs; all pairs use the global
cutoff(s) specified in the pair_style command.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/cut pair styles can be mixed.
The default mix value is {geometric}. See the "pair_modify" command
for details.
None of the GROMACS pair styles support the
"pair_modify"_pair_modify.html shift option, since the Lennard-Jones
portion of the pair interaction is already smoothed to 0.0 at the
cutoff.
The "pair_modify"_pair_modify.html table option is not relevant
for this pair style.
None of the GROMACS pair styles support the
"pair_modify"_pair_modify.html tail option for adding long-range tail
corrections to energy and pressure, since there are no corrections for
a potential that goes to 0.0 at the cutoff.
All of the GROMACS pair styles write their 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.
All of the GROMACS pair styles can only be used via the {pair}
keyword of the "run_style respa"_run_style.html command. They do not
support the {inner}, {middle}, {outer} keywords.
:line
[Restrictions:] none
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Marrink)
[(Marrink)] Marrink, de Vries, Mark, J Phys Chem B, 108, 750-760 (2004).
diff --git a/doc/pair_hbond_dreiding.html b/doc/pair_hbond_dreiding.html
index d412af1ef..32c2e16e1 100644
--- a/doc/pair_hbond_dreiding.html
+++ b/doc/pair_hbond_dreiding.html
@@ -1,235 +1,235 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style hbond/dreiding/lj command
</H3>
<H3>pair_style hbond/dreiding/lj/omp command
</H3>
<H3>pair_style hbond/dreiding/morse command
</H3>
<H3>pair_style hbond/dreiding/morse/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style N inner_distance_cutoff outer_distance_cutoff angle_cutof
</PRE>
<UL><LI>style = <I>hbond/dreiding/lj</I> or <I>hbond/dreiding/morse</I>
<LI>n = cosine angle periodicity
<LI>inner_distance_cutoff = global inner spline cutoff for Donor-Acceptor interactions (distance units)
<LI>outer_distance_cutoff = global cutoff for Donor-Acceptor interactions (distance units)
<LI>angle_cutoff = global angle cutoff for Acceptor-Hydrogen-Donor
<LI>interactions (degrees)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style hbond/dreiding/lj 4 4.5 5.0 90
pair_coeff * * 3 i 100.0 3.1
pair_coeff * * 2*5 i 100.0 3.1 2 15.0 20.0 135.0
</PRE>
<PRE>pair_style hbond/dreiding/morse 2 3.0 4.6 75.0
pair_coeff * * 3 j 100.0 1.0 2.0
pair_coeff * * 2*5 j 100.0 1.0 2.0 4.0 6.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>hbond/dreiding</I> styles compute the Acceptor-Hydrogen-Donor (AHD)
3-body hydrogen bond interaction for the
<A HREF = "Section_howto.html#howto_4">DREIDING</A> force field, given by:
</P>
<CENTER><IMG SRC = "Eqs/pair_hbond_dreiding.jpg">
</CENTER>
<P>where Rin is the inner spline distance cutoff, Rout is the outer
distance cutoff, theta_c is the angle cutoff, and n is the cosine
periodicity.
</P>
<P>Here, <I>r</I> is the radial distance between the donor (D) and acceptor
(A) atoms and <I>theta</I> is the bond angle between the acceptor, the
hydrogen (H) and the donor atoms:
</P>
<CENTER><IMG SRC = "Eqs/dreiding_hbond.jpg">
</CENTER>
<P>These 3-body interactions can be defined for pairs of acceptor and
donor atoms, based on atom types. For each donor/acceptor atom pair,
the 3rd atom in the interaction is a hydrogen permanently bonded to
the donor atom, e.g. in a bond list read in from a data file via the
<A HREF = "read_data.html">read_data</A> command. The atom types of possible
hydrogen atoms for each donor/acceptor type pair are specified by the
<A HREF = "pair_coeff.html">pair_coeff</A> command (see below).
</P>
<P>Style <I>hbond/dreiding/lj</I> is the original DREIDING potential of
<A HREF = "#Mayo">(Mayo)</A>. It uses a LJ 12/10 functional for the Donor-Acceptor
interactions. To match the results in the original paper, use n = 4.
</P>
<P>Style <I>hbond/dreiding/morse</I> is an improved version using a Morse
potential for the Donor-Acceptor interactions. <A HREF = "#Liu">(Liu)</A> showed
that the Morse form gives improved results for Dendrimer simulations,
when n = 2.
</P>
<P>See this <A HREF = "Section_howto.html#howto_4">howto section</A> of the manual for
more information on the DREIDING forcefield.
</P>
<P>Because the Dreiding hydrogen bond potential is only one portion of
an overall force field which typically includes other pairwise
interactions, it is common to use it as a sub-style in a <A HREF = "pair_hybrid.html">pair_style
hybrid or hybrid/overlay</A> command.
</P>
<P>The following coefficients must be defined for pairs of eligible
donor/acceptor types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as
in the examples above.
</P>
<P>IMPORTANT NOTE: Unlike other pair styles and their associated
<A HREF = "pair_coeff.html">pair_coeff</A> commands, you do not need to specify
pair_coeff settings for all possible I,J type pairs. Only I,J type
pairs for atoms which act as joint donors/acceptors need to be
specified; all other type pairs are assumed to be inactive.
</P>
<P>IMPORTANT NOTE: A <A HREF = "pair_coeff.html">pair_coeff</A> command can be
speficied multiple times for the same donor/acceptor type pair. This
enables multiple hydrogen types to be assigned to the same
donor/acceptor type pair. For other pair_styles, if the pair_coeff
command is re-used for the same I.J type pair, the settings for that
type pair are overwritten. For the hydrogen bond potentials this is
not the case; the settings are cummulative. This means the only way
to turn off a previous setting, is to re-use the pair_style command
and start over.
</P>
<P>For the <I>hbond/dreiding/lj</I> style the list of coefficients is as
follows:
</P>
<UL><LI>K = hydrogen atom type = 1 to Ntypes
<LI>donor flag = <I>i</I> or <I>j</I>
<LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>n = exponent in formula above
<LI>distance cutoff (distance units)
<LI>angle cutoff (degrees)
</UL>
<P>For the <I>hbond/dreiding/morse</I> style the list of coefficients is as
follows:
</P>
<UL><LI>K = hydrogen atom type = 1 to Ntypes
<LI>donor flag = <I>i</I> or <I>j</I>
<LI>D0 (energy units)
<LI>alpha (1/distance units)
<LI>r0 (distance units)
<LI>n = exponent in formula above
<LI>distance cutoff (distance units)
<LI>angle cutoff (degrees)
</UL>
<P>A single hydrogen atom type K can be specified, or a wild-card
asterisk can be used in place of or in conjunction with the K
arguments to select multiple types as hydrogens. This takes the form
"*" or "*n" or "n*" or "m*n". See the <A HREF = "pair_coeff">pair_coeff</A> command
doc page for details.
</P>
<P>If the donor flag is <I>i</I>, then the atom of type I in the pair_coeff
command is treated as the donor, and J is the acceptor. If the donor
flag is <I>j</I>, then the atom of type J in the pair_coeff command is
treated as the donor and I is the donor. This option is required
because the <A HREF = "pair_coeff.html">pair_coeff</A> command requires that I <= J.
</P>
<P>Epsilon and sigma are settings for the hydrogen bond potential based
on a Lennard-Jones functional form. Note that sigma is defined as the
zero-crossing distance for the potential, not as the energy minimum at
2^(1/6) sigma.
</P>
<P>D0 and alpha and r0 are settings for the hydrogen bond potential based
on a Morse functional form.
</P>
<P>The last 3 coefficients for both styles are optional. If not
specified, the global n, distance cutoff, and angle cutoff specified
in the pair_style command are used. If you wish to only override the
2nd or 3rd optional parameter, you must also specify the preceding
optional parameters.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>These pair styles do not support mixing. You must explicitly identify
each donor/acceptor type pair.
</P>
<P>These styles do not support the <A HREF = "pair_modify.html">pair_modify</A> shift
option for the energy of the interactions.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant for
these pair styles.
</P>
<P>These pair styles do not support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding long-range tail corrections to energy and
pressure.
</P>
<P>These pair styles do not write their information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands need to be
re-specified in an input script that reads a restart file.
</P>
<P>These pair styles can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. They do not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<P>These pair styles tally a count of how many hydrogen bonding
interactions they calculate each timestep and the hbond energy. These
quantities can be accessed via the <A HREF = "compute_pair.html">compute pair</A>
command as a vector of values of length 2.
</P>
<P>To print these quantities to the log file (with a descriptive column
heading) the following commands could be included in an input script:
</P>
<PRE>compute hb all pair hbond/dreiding/lj
variable n_hbond equal c_hb[1] #number hbonds
variable E_hbond equal c_hb[2] #hbond energy
thermo_style custom step temp epair v_E_hbond
</PRE>
<HR>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Mayo"></A>
<P><B>(Mayo)</B> Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
(1990).
</P>
<A NAME = "Liu"></A>
<P><B>(Liu)</B> Liu, Bryantsev, Diallo, Goddard III, J. Am. Chem. Soc 131 (8)
2798 (2009)
</P>
</HTML>
diff --git a/doc/pair_hbond_dreiding.txt b/doc/pair_hbond_dreiding.txt
index afc469a4a..1b0361fc1 100644
--- a/doc/pair_hbond_dreiding.txt
+++ b/doc/pair_hbond_dreiding.txt
@@ -1,225 +1,225 @@
"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 hbond/dreiding/lj command :h3
pair_style hbond/dreiding/lj/omp command :h3
pair_style hbond/dreiding/morse command :h3
pair_style hbond/dreiding/morse/omp command :h3
[Syntax:]
pair_style style N inner_distance_cutoff outer_distance_cutoff angle_cutof :pre
style = {hbond/dreiding/lj} or {hbond/dreiding/morse}
n = cosine angle periodicity
inner_distance_cutoff = global inner spline cutoff for Donor-Acceptor interactions (distance units)
outer_distance_cutoff = global cutoff for Donor-Acceptor interactions (distance units)
angle_cutoff = global angle cutoff for Acceptor-Hydrogen-Donor
interactions (degrees) :ul
[Examples:]
pair_style hbond/dreiding/lj 4 4.5 5.0 90
pair_coeff * * 3 i 100.0 3.1
pair_coeff * * 2*5 i 100.0 3.1 2 15.0 20.0 135.0 :pre
pair_style hbond/dreiding/morse 2 3.0 4.6 75.0
pair_coeff * * 3 j 100.0 1.0 2.0
pair_coeff * * 2*5 j 100.0 1.0 2.0 4.0 6.0 :pre
[Description:]
The {hbond/dreiding} styles compute the Acceptor-Hydrogen-Donor (AHD)
3-body hydrogen bond interaction for the
"DREIDING"_Section_howto.html#howto_4 force field, given by:
:c,image(Eqs/pair_hbond_dreiding.jpg)
where Rin is the inner spline distance cutoff, Rout is the outer
distance cutoff, theta_c is the angle cutoff, and n is the cosine
periodicity.
Here, {r} is the radial distance between the donor (D) and acceptor
(A) atoms and {theta} is the bond angle between the acceptor, the
hydrogen (H) and the donor atoms:
:c,image(Eqs/dreiding_hbond.jpg)
These 3-body interactions can be defined for pairs of acceptor and
donor atoms, based on atom types. For each donor/acceptor atom pair,
the 3rd atom in the interaction is a hydrogen permanently bonded to
the donor atom, e.g. in a bond list read in from a data file via the
"read_data"_read_data.html command. The atom types of possible
hydrogen atoms for each donor/acceptor type pair are specified by the
"pair_coeff"_pair_coeff.html command (see below).
Style {hbond/dreiding/lj} is the original DREIDING potential of
"(Mayo)"_#Mayo. It uses a LJ 12/10 functional for the Donor-Acceptor
interactions. To match the results in the original paper, use n = 4.
Style {hbond/dreiding/morse} is an improved version using a Morse
potential for the Donor-Acceptor interactions. "(Liu)"_#Liu showed
that the Morse form gives improved results for Dendrimer simulations,
when n = 2.
See this "howto section"_Section_howto.html#howto_4 of the manual for
more information on the DREIDING forcefield.
Because the Dreiding hydrogen bond potential is only one portion of
an overall force field which typically includes other pairwise
interactions, it is common to use it as a sub-style in a "pair_style
hybrid or hybrid/overlay"_pair_hybrid.html command.
The following coefficients must be defined for pairs of eligible
donor/acceptor types via the "pair_coeff"_pair_coeff.html command as
in the examples above.
IMPORTANT NOTE: Unlike other pair styles and their associated
"pair_coeff"_pair_coeff.html commands, you do not need to specify
pair_coeff settings for all possible I,J type pairs. Only I,J type
pairs for atoms which act as joint donors/acceptors need to be
specified; all other type pairs are assumed to be inactive.
IMPORTANT NOTE: A "pair_coeff"_pair_coeff.html command can be
speficied multiple times for the same donor/acceptor type pair. This
enables multiple hydrogen types to be assigned to the same
donor/acceptor type pair. For other pair_styles, if the pair_coeff
command is re-used for the same I.J type pair, the settings for that
type pair are overwritten. For the hydrogen bond potentials this is
not the case; the settings are cummulative. This means the only way
to turn off a previous setting, is to re-use the pair_style command
and start over.
For the {hbond/dreiding/lj} style the list of coefficients is as
follows:
K = hydrogen atom type = 1 to Ntypes
donor flag = {i} or {j}
epsilon (energy units)
sigma (distance units)
n = exponent in formula above
distance cutoff (distance units)
angle cutoff (degrees) :ul
For the {hbond/dreiding/morse} style the list of coefficients is as
follows:
K = hydrogen atom type = 1 to Ntypes
donor flag = {i} or {j}
D0 (energy units)
alpha (1/distance units)
r0 (distance units)
n = exponent in formula above
distance cutoff (distance units)
angle cutoff (degrees) :ul
A single hydrogen atom type K can be specified, or a wild-card
asterisk can be used in place of or in conjunction with the K
arguments to select multiple types as hydrogens. This takes the form
"*" or "*n" or "n*" or "m*n". See the "pair_coeff"_pair_coeff command
doc page for details.
If the donor flag is {i}, then the atom of type I in the pair_coeff
command is treated as the donor, and J is the acceptor. If the donor
flag is {j}, then the atom of type J in the pair_coeff command is
treated as the donor and I is the donor. This option is required
because the "pair_coeff"_pair_coeff.html command requires that I <= J.
Epsilon and sigma are settings for the hydrogen bond potential based
on a Lennard-Jones functional form. Note that sigma is defined as the
zero-crossing distance for the potential, not as the energy minimum at
2^(1/6) sigma.
D0 and alpha and r0 are settings for the hydrogen bond potential based
on a Morse functional form.
The last 3 coefficients for both styles are optional. If not
specified, the global n, distance cutoff, and angle cutoff specified
in the pair_style command are used. If you wish to only override the
2nd or 3rd optional parameter, you must also specify the preceding
optional parameters.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
These pair styles do not support mixing. You must explicitly identify
each donor/acceptor type pair.
These styles do not support the "pair_modify"_pair_modify.html shift
option for the energy of the interactions.
The "pair_modify"_pair_modify.html table option is not relevant for
these pair styles.
These pair styles do not support the "pair_modify"_pair_modify.html
tail option for adding long-range tail corrections to energy and
pressure.
These pair styles do not write their information to "binary restart
files"_restart.html, so pair_style and pair_coeff commands need to be
re-specified in an input script that reads a restart file.
These pair styles can only be used via the {pair} keyword of the
"run_style respa"_run_style.html command. They do not support the
{inner}, {middle}, {outer} keywords.
These pair styles tally a count of how many hydrogen bonding
interactions they calculate each timestep and the hbond energy. These
quantities can be accessed via the "compute pair"_compute_pair.html
command as a vector of values of length 2.
To print these quantities to the log file (with a descriptive column
heading) the following commands could be included in an input script:
compute hb all pair hbond/dreiding/lj
variable n_hbond equal c_hb\[1\] #number hbonds
variable E_hbond equal c_hb\[2\] #hbond energy
thermo_style custom step temp epair v_E_hbond :pre
:line
[Restrictions:] none
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Mayo)
[(Mayo)] Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
(1990).
:link(Liu)
[(Liu)] Liu, Bryantsev, Diallo, Goddard III, J. Am. Chem. Soc 131 (8)
2798 (2009)
diff --git a/doc/pair_hybrid.html b/doc/pair_hybrid.html
index 7fcba348d..7c729a727 100644
--- a/doc/pair_hybrid.html
+++ b/doc/pair_hybrid.html
@@ -1,293 +1,294 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style hybrid command
</H3>
<H3>pair_style hybrid/omp command
</H3>
<H3>pair_style hybrid/overlay command
</H3>
<H3>pair_style hybrid/overlay/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style hybrid style1 args style2 args ...
pair_style hybrid/overlay style1 args style2 args ...
</PRE>
<UL><LI>style1,style2 = list of one or more pair styles and their arguments
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style hybrid lj/cut/coul/cut 10.0 eam lj/cut 5.0
pair_coeff 1*2 1*2 eam niu3
pair_coeff 3 3 lj/cut/coul/cut 1.0 1.0
pair_coeff 1*2 3 lj/cut 0.5 1.2
</PRE>
<PRE>pair_style hybrid/overlay lj/cut 2.5 coul/long 2.0
pair_coeff * * lj/cut 1.0 1.0
pair_coeff * * coul/long
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>hybrid</I> and <I>hybrid/overlay</I> styles enable the use of multiple
pair styles in one simulation. With the <I>hybrid</I> style, exactly one
pair style is assigned to each pair of atom types. With the
<I>hybrid/overlay</I> style, one or more pair styles can be assigned to
each pair of atom types. The assignment of pair styles to type pairs
is made via the <A HREF = "pair_coeff.html">pair_coeff</A> command.
</P>
<P>Here are two examples of hybrid simulations. The <I>hybrid</I> style could
be used for a simulation of a metal droplet on a LJ surface. The
metal atoms interact with each other via an <I>eam</I> potential, the
surface atoms interact with each other via a <I>lj/cut</I> potential, and
the metal/surface interaction is also computed via a <I>lj/cut</I>
potential. The <I>hybrid/overlay</I> style could be used as in the 2nd
example above, where multiple potentials are superposed in an additive
fashion to compute the interaction between atoms. In this example,
using <I>lj/cut</I> and <I>coul/long</I> together gives the same result as if
the <I>lj/cut/coul/long</I> potential were used by itself. In this case,
it would be more efficient to use the single combined potential, but
in general any combination of pair potentials can be used together in
to produce an interaction that is not encoded in any single pair_style
file, e.g. adding Coulombic forces between granular particles.
</P>
<P>All pair styles that will be used are listed as "sub-styles" following
the <I>hybrid</I> or <I>hybrid/overlay</I> keyword, in any order. Each
sub-style's name is followed by its usual arguments, as illustrated in
the example above. See the doc pages of individual pair styles for a
listing and explanation of the appropriate arguments.
</P>
<P>In the pair_coeff commands, the name of a pair style must be added
after the I,J type specification, with the remaining coefficients
being those appropriate to that style. For example, consider a
simulation with 3 atom types: types 1 and 2 are Ni atoms, type 3 are
LJ atoms with charges. The following commands would set up a hybrid
simulation:
</P>
<PRE>pair_style hybrid eam/alloy lj/cut/coul/cut 10.0 lj/cut 8.0
pair_coeff * * eam/alloy nialhjea Ni Ni NULL
pair_coeff 3 3 lj/cut/coul/cut 1.0 1.0
pair_coeff 1*2 3 lj/cut 0.8 1.3
</PRE>
<P>If pair coefficients are specified in the data file read via the
<A HREF = "read_data.html">read_data</A> command, then the same rule applies.
E.g. "eam/alloy" or "lj/cut" must be added after the atom type, for
each line in the "Pair Coeffs" section, e.g.
</P>
<PRE>Pair Coeffs
</PRE>
<PRE>1 lj/cut/coul/cut 1.0 1.0
...
</PRE>
<P>Note that the pair_coeff command for some potentials such as
<A HREF = "pair_eam.html">pair_style eam/alloy</A> includes a mapping specification
of elements to all atom types, which in the hybrid case, can include
atom types not assigned to the <I>eam/alloy</I> potential. The NULL
keyword is used by many such potentials (eam/alloy, Tersoff, AIREBO,
etc), to denote an atom type that will be assigned to a different
sub-style.
</P>
<P>For the <I>hybrid</I> style, each atom type pair I,J is assigned to exactly
one sub-style. Just as with a simulation using a single pair style,
if you specify the same atom type pair in a second pair_coeff command,
the previous assignment will be overwritten.
</P>
<P>For the <I>hybrid/overlay</I> style, each atom type pair I,J can be
assigned to one or more sub-styles. If you specify the same atom type
pair in a second pair_coeff command with a new sub-style, then the
second sub-style is added to the list of potentials that will be
calculated for two interacting atoms of those types. If you specify
the same atom type pair in a second pair_coeff command with a
sub-style that has already been defined for that pair of atoms, then
the new pair coefficients simply override the previous ones, as in the
normal usage of the pair_coeff command. E.g. these two sets of
commands are the same:
</P>
<PRE>pair_style lj/cut 2.5
pair_coeff * * 1.0 1.0
pair_coeff 2 2 1.5 0.8
</PRE>
<PRE>pair_style hybrid/overlay lj/cut 2.5
pair_coeff * * lj/cut 1.0 1.0
pair_coeff 2 2 lj/cut 1.5 0.8
</PRE>
<P>Coefficients must be defined for each pair of atoms types via the
<A HREF = "pair_coeff.html">pair_coeff</A> command as described above, or in the
data file or restart files read by the <A HREF = "read_data.html">read_data</A> or
<A HREF = "read_restart.html">read_restart</A> commands, or by mixing as described
below.
</P>
<P>For both the <I>hybrid</I> and <I>hybrid/overlay</I> styles, every atom type
pair I,J (where I <= J) must be assigned to at least one sub-style via
the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples above, or
in the data file read by the <A HREF = "read_data.html">read_data</A>, or by mixing
as described below.
</P>
<P>If you want there to be no interactions between a particular pair of
atom types, you have 3 choices. You can assign the type pair to some
sub-style and use the <A HREF = "neigh_modify.html">neigh_modify exclude type</A>
command. You can assign it to some sub-style and set the coefficients
so that there is effectively no interaction (e.g. epsilon = 0.0 in a
LJ potential). Or, for <I>hybrid</I> and <I>hybrid/overlay</I> simulations, you
can use this form of the pair_coeff command in your input script:
</P>
<PRE>pair_coeff 2 3 none
</PRE>
<P>or this form in the "Pair Coeffs" section of the data file:
</P>
<PRE>3 none
</PRE>
<P>If an assignment to <I>none</I> is made in a simulation with the
<I>hybrid/overlay</I> pair style, it wipes out all previous assignments of
that atom type pair to sub-styles.
</P>
<P>Note that you may need to use an <A HREF = "atom_style.html">atom_style</A> hybrid
command in your input script, if atoms in the simulation will need
attributes from several atom styles, due to using multiple pair
potentials.
</P>
<HR>
<P>The potential energy contribution to the overall system due to an
individual sub-style can be accessed and output via the <A HREF = "compute_pair.html">compute
pair</A> command.
</P>
<HR>
<P>IMPORTANT: Several of the potentials defined via the pair_style
command in LAMMPS are really many-body potentials, such as Tersoff,
AIREBO, MEAM, ReaxFF, etc. The way to think about using these
potentials in a hybrid setting is as follows.
</P>
<P>A subset of atom types is assigned to the many-body potential with a
single <A HREF = "pair_coeff.html">pair_coeff</A> command, using "* *" to include
all types and the NULL keywords described above to exclude specific
types not assigned to that potential. If types 1,3,4 were assigned in
that way (but not type 2), this means that all many-body interactions
between all atoms of types 1,3,4 will be computed by that potential.
Pair_style hybrid allows interactions between type pairs 2-2, 1-2,
2-3, 2-4 to be specified for computation by other pair styles. You
could even add a second interaction for 1-1 to be computed by another
pair style, assuming pair_style hybrid/overlay is used.
</P>
<P>But you should not, as a general rule, attempt to exclude the
many-body interactions for some subset of the type pairs within the
set of 1,3,4 interactions, e.g. exclude 1-1 or 1-3 interactions. That
is not conceptually well-defined for many-body interactions, since the
potential will typically calculate energies and foces for small groups
of atoms, e.g. 3 or 4 atoms, using the neighbor lists of the atoms to
find the additional atoms in the group. It is typically non-physical
to think of excluding an interaction between a particular pair of
atoms when the potential computes 3-body or 4-body interactions.
</P>
<P>However, you can still use the pair_coeff none setting or the
<A HREF = "neigh_modify.html">neigh_modify exclude</A> command to exclude certain
type pairs from the neighbor list that will be passed to a manybody
sub-style. This will alter the calculations made by a many-body
potential, since it builds its list of 3-body, 4-body, etc
interactions from the pair list. You will need to think carefully as
to whether it produces a physically meaningful result for your model.
</P>
<P>For example, imagine you have two atom types in your model, type 1 for
atoms in one surface, and type 2 for atoms in the other, and you wish
to use a Tersoff potential to compute interactions within each
surface, but not between surfaces. Then either of these two command
sequences would implement that model:
</P>
<PRE>pair_style hybrid tersoff
pair_coeff * * tersoff SiC.tersoff C C
pair_coeff 1 2 none
</PRE>
<PRE>pair_style tersoff
pair_coeff * * SiC.tersoff C C
neigh_modify exclude type 1 2
</PRE>
<P>Either way, only neighbor lists with 1-1 or 2-2 interactions would be
passed to the Tersoff potential, which means it would compute no
3-body interactions containing both type 1 and 2 atoms.
</P>
<HR>
<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual.
</P>
<P>Since the <I>hybrid</I> and <I>hybrid/overlay</I> styles delegate computation
to the individual sub-styles, the suffix versions of the <I>hybrid</I>
and <I>hybrid/overlay</I> styles are used to propagate the corresponding
suffix to all sub-styles, if those versions exist. Otherwise the
non-accelerated version will be used.
</P>
<P>The individual accelerated sub-styles are part of the USER-CUDA, GPU,
USER-OMP and OPT packages, respectively. They are only enabled if
LAMMPS was built with those packages. See the
<A HREF = "Section_start.html#start_3">Making LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>Any pair potential settings made via the
<A HREF = "pair_modify.html">pair_modify</A> command are passed along to all
sub-styles of the hybrid potential.
</P>
<P>For atom type pairs I,J and I != J, if the sub-style assigned to I,I
and J,J is the same, and if the sub-style allows for mixing, then the
coefficients for I,J can be mixed. This means you do not have to
specify a pair_coeff command for I,J since the I,J type pair will be
assigned automatically to the I,I sub-style and its coefficients
generated by the mixing rule used by that sub-style. For the
<I>hybrid/overlay</I> style, there is an additional requirement that both
the I,I and J,J pairs are assigned to a single sub-style. See the
"pair_modify" command for details of mixing rules. See the See the
doc page for the sub-style to see if allows for mixing.
</P>
<P>The hybrid pair styles supports the <A HREF = "pair_modify.html">pair_modify</A>
shift, table, and tail options for an I,J pair interaction, if the
associated sub-style supports it.
</P>
<P>For the hybrid pair styles, the list of sub-styles and their
respective settings are written to <A HREF = "restart.html">binary restart
files</A>, so a <A HREF = "pair_style.html">pair_style</A> command does
not need to specified in an input script that reads a restart file.
However, the coefficient information is not stored in the restart
file. Thus, pair_coeff commands need to be re-specified in the
restart input script.
</P>
<P>These pair styles support the use of the <I>inner</I>, <I>middle</I>, and
<I>outer</I> keywords of the <A HREF = "run_style.html">run_style respa</A> command, if
their sub-styles do.
</P>
<P><B>Restrictions:</B>
</P>
<P>When using a long-range Coulombic solver (via the
<A HREF = "kspace_style.html">kspace_style</A> command) with a hybrid pair_style,
one or more sub-styles will be of the "long" variety,
e.g. <I>lj/cut/coul/long</I> or <I>buck/coul/long</I>. You must insure that the
short-range Coulombic cutoff used by each of these long pair styles is
the same or else LAMMPS will generate an error.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_hybrid.txt b/doc/pair_hybrid.txt
index b93fe360d..2828fc21b 100644
--- a/doc/pair_hybrid.txt
+++ b/doc/pair_hybrid.txt
@@ -1,285 +1,286 @@
"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 hybrid command :h3
pair_style hybrid/omp command :h3
pair_style hybrid/overlay command :h3
pair_style hybrid/overlay/omp command :h3
[Syntax:]
pair_style hybrid style1 args style2 args ...
pair_style hybrid/overlay style1 args style2 args ... :pre
style1,style2 = list of one or more pair styles and their arguments :ul
[Examples:]
pair_style hybrid lj/cut/coul/cut 10.0 eam lj/cut 5.0
pair_coeff 1*2 1*2 eam niu3
pair_coeff 3 3 lj/cut/coul/cut 1.0 1.0
pair_coeff 1*2 3 lj/cut 0.5 1.2 :pre
pair_style hybrid/overlay lj/cut 2.5 coul/long 2.0
pair_coeff * * lj/cut 1.0 1.0
pair_coeff * * coul/long :pre
[Description:]
The {hybrid} and {hybrid/overlay} styles enable the use of multiple
pair styles in one simulation. With the {hybrid} style, exactly one
pair style is assigned to each pair of atom types. With the
{hybrid/overlay} style, one or more pair styles can be assigned to
each pair of atom types. The assignment of pair styles to type pairs
is made via the "pair_coeff"_pair_coeff.html command.
Here are two examples of hybrid simulations. The {hybrid} style could
be used for a simulation of a metal droplet on a LJ surface. The
metal atoms interact with each other via an {eam} potential, the
surface atoms interact with each other via a {lj/cut} potential, and
the metal/surface interaction is also computed via a {lj/cut}
potential. The {hybrid/overlay} style could be used as in the 2nd
example above, where multiple potentials are superposed in an additive
fashion to compute the interaction between atoms. In this example,
using {lj/cut} and {coul/long} together gives the same result as if
the {lj/cut/coul/long} potential were used by itself. In this case,
it would be more efficient to use the single combined potential, but
in general any combination of pair potentials can be used together in
to produce an interaction that is not encoded in any single pair_style
file, e.g. adding Coulombic forces between granular particles.
All pair styles that will be used are listed as "sub-styles" following
the {hybrid} or {hybrid/overlay} keyword, in any order. Each
sub-style's name is followed by its usual arguments, as illustrated in
the example above. See the doc pages of individual pair styles for a
listing and explanation of the appropriate arguments.
In the pair_coeff commands, the name of a pair style must be added
after the I,J type specification, with the remaining coefficients
being those appropriate to that style. For example, consider a
simulation with 3 atom types: types 1 and 2 are Ni atoms, type 3 are
LJ atoms with charges. The following commands would set up a hybrid
simulation:
pair_style hybrid eam/alloy lj/cut/coul/cut 10.0 lj/cut 8.0
pair_coeff * * eam/alloy nialhjea Ni Ni NULL
pair_coeff 3 3 lj/cut/coul/cut 1.0 1.0
pair_coeff 1*2 3 lj/cut 0.8 1.3 :pre
If pair coefficients are specified in the data file read via the
"read_data"_read_data.html command, then the same rule applies.
E.g. "eam/alloy" or "lj/cut" must be added after the atom type, for
each line in the "Pair Coeffs" section, e.g.
Pair Coeffs :pre
1 lj/cut/coul/cut 1.0 1.0
... :pre
Note that the pair_coeff command for some potentials such as
"pair_style eam/alloy"_pair_eam.html includes a mapping specification
of elements to all atom types, which in the hybrid case, can include
atom types not assigned to the {eam/alloy} potential. The NULL
keyword is used by many such potentials (eam/alloy, Tersoff, AIREBO,
etc), to denote an atom type that will be assigned to a different
sub-style.
For the {hybrid} style, each atom type pair I,J is assigned to exactly
one sub-style. Just as with a simulation using a single pair style,
if you specify the same atom type pair in a second pair_coeff command,
the previous assignment will be overwritten.
For the {hybrid/overlay} style, each atom type pair I,J can be
assigned to one or more sub-styles. If you specify the same atom type
pair in a second pair_coeff command with a new sub-style, then the
second sub-style is added to the list of potentials that will be
calculated for two interacting atoms of those types. If you specify
the same atom type pair in a second pair_coeff command with a
sub-style that has already been defined for that pair of atoms, then
the new pair coefficients simply override the previous ones, as in the
normal usage of the pair_coeff command. E.g. these two sets of
commands are the same:
pair_style lj/cut 2.5
pair_coeff * * 1.0 1.0
pair_coeff 2 2 1.5 0.8 :pre
pair_style hybrid/overlay lj/cut 2.5
pair_coeff * * lj/cut 1.0 1.0
pair_coeff 2 2 lj/cut 1.5 0.8 :pre
Coefficients must be defined for each pair of atoms types via the
"pair_coeff"_pair_coeff.html command as described 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.
For both the {hybrid} and {hybrid/overlay} styles, every atom type
pair I,J (where I <= J) must be assigned to at least one sub-style via
the "pair_coeff"_pair_coeff.html command as in the examples above, or
in the data file read by the "read_data"_read_data.html, or by mixing
as described below.
If you want there to be no interactions between a particular pair of
atom types, you have 3 choices. You can assign the type pair to some
sub-style and use the "neigh_modify exclude type"_neigh_modify.html
command. You can assign it to some sub-style and set the coefficients
so that there is effectively no interaction (e.g. epsilon = 0.0 in a
LJ potential). Or, for {hybrid} and {hybrid/overlay} simulations, you
can use this form of the pair_coeff command in your input script:
pair_coeff 2 3 none :pre
or this form in the "Pair Coeffs" section of the data file:
3 none :pre
If an assignment to {none} is made in a simulation with the
{hybrid/overlay} pair style, it wipes out all previous assignments of
that atom type pair to sub-styles.
Note that you may need to use an "atom_style"_atom_style.html hybrid
command in your input script, if atoms in the simulation will need
attributes from several atom styles, due to using multiple pair
potentials.
:line
The potential energy contribution to the overall system due to an
individual sub-style can be accessed and output via the "compute
pair"_compute_pair.html command.
:line
IMPORTANT: Several of the potentials defined via the pair_style
command in LAMMPS are really many-body potentials, such as Tersoff,
AIREBO, MEAM, ReaxFF, etc. The way to think about using these
potentials in a hybrid setting is as follows.
A subset of atom types is assigned to the many-body potential with a
single "pair_coeff"_pair_coeff.html command, using "* *" to include
all types and the NULL keywords described above to exclude specific
types not assigned to that potential. If types 1,3,4 were assigned in
that way (but not type 2), this means that all many-body interactions
between all atoms of types 1,3,4 will be computed by that potential.
Pair_style hybrid allows interactions between type pairs 2-2, 1-2,
2-3, 2-4 to be specified for computation by other pair styles. You
could even add a second interaction for 1-1 to be computed by another
pair style, assuming pair_style hybrid/overlay is used.
But you should not, as a general rule, attempt to exclude the
many-body interactions for some subset of the type pairs within the
set of 1,3,4 interactions, e.g. exclude 1-1 or 1-3 interactions. That
is not conceptually well-defined for many-body interactions, since the
potential will typically calculate energies and foces for small groups
of atoms, e.g. 3 or 4 atoms, using the neighbor lists of the atoms to
find the additional atoms in the group. It is typically non-physical
to think of excluding an interaction between a particular pair of
atoms when the potential computes 3-body or 4-body interactions.
However, you can still use the pair_coeff none setting or the
"neigh_modify exclude"_neigh_modify.html command to exclude certain
type pairs from the neighbor list that will be passed to a manybody
sub-style. This will alter the calculations made by a many-body
potential, since it builds its list of 3-body, 4-body, etc
interactions from the pair list. You will need to think carefully as
to whether it produces a physically meaningful result for your model.
For example, imagine you have two atom types in your model, type 1 for
atoms in one surface, and type 2 for atoms in the other, and you wish
to use a Tersoff potential to compute interactions within each
surface, but not between surfaces. Then either of these two command
sequences would implement that model:
pair_style hybrid tersoff
pair_coeff * * tersoff SiC.tersoff C C
pair_coeff 1 2 none :pre
pair_style tersoff
pair_coeff * * SiC.tersoff C C
neigh_modify exclude type 1 2 :pre
Either way, only neighbor lists with 1-1 or 2-2 interactions would be
passed to the Tersoff potential, which means it would compute no
3-body interactions containing both type 1 and 2 atoms.
:line
Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual.
Since the {hybrid} and {hybrid/overlay} styles delegate computation
to the individual sub-styles, the suffix versions of the {hybrid}
and {hybrid/overlay} styles are used to propagate the corresponding
suffix to all sub-styles, if those versions exist. Otherwise the
non-accelerated version will be used.
The individual accelerated sub-styles are part of the USER-CUDA, GPU,
USER-OMP and OPT packages, respectively. They are only enabled if
LAMMPS was built with those packages. See the
"Making LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
Any pair potential settings made via the
"pair_modify"_pair_modify.html command are passed along to all
sub-styles of the hybrid potential.
For atom type pairs I,J and I != J, if the sub-style assigned to I,I
and J,J is the same, and if the sub-style allows for mixing, then the
coefficients for I,J can be mixed. This means you do not have to
specify a pair_coeff command for I,J since the I,J type pair will be
assigned automatically to the I,I sub-style and its coefficients
generated by the mixing rule used by that sub-style. For the
{hybrid/overlay} style, there is an additional requirement that both
the I,I and J,J pairs are assigned to a single sub-style. See the
"pair_modify" command for details of mixing rules. See the See the
doc page for the sub-style to see if allows for mixing.
The hybrid pair styles supports the "pair_modify"_pair_modify.html
shift, table, and tail options for an I,J pair interaction, if the
associated sub-style supports it.
For the hybrid pair styles, the list of sub-styles and their
respective settings are written to "binary restart
files"_restart.html, so a "pair_style"_pair_style.html command does
not need to specified in an input script that reads a restart file.
However, the coefficient information is not stored in the restart
file. Thus, pair_coeff commands need to be re-specified in the
restart input script.
These pair styles support the use of the {inner}, {middle}, and
{outer} keywords of the "run_style respa"_run_style.html command, if
their sub-styles do.
[Restrictions:]
When using a long-range Coulombic solver (via the
"kspace_style"_kspace_style.html command) with a hybrid pair_style,
one or more sub-styles will be of the "long" variety,
e.g. {lj/cut/coul/long} or {buck/coul/long}. You must insure that the
short-range Coulombic cutoff used by each of these long pair styles is
the same or else LAMMPS will generate an error.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
diff --git a/doc/pair_line_lj.html b/doc/pair_line_lj.html
index 26e28931b..41d106fec 100644
--- a/doc/pair_line_lj.html
+++ b/doc/pair_line_lj.html
@@ -1,141 +1,141 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style line/lj command
</H3>
<H3>pair_style line/lj/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style line/lj cutoff
</PRE>
<P>cutoff = global cutoff for interactions (distance units)
</P>
<P><B>Examples:</B>
</P>
<PRE>pair_style line/lj 3.0
pair_coeff * * 1.0 1.0
pair_coeff 1 1 1.0 1.5 2.5
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>line/lj</I> treats particles which are line segments as a set of
small spherical particles that tile the line segment length as
explained below. Interactions between two line segments, each with N1
and N2 spherical particles, are calculated as the pairwise sum of
N1*N2 Lennard-Jones interactions. Interactions between a line segment
with N spherical particles and a point particle are treated as the
pairwise sum of N Lennard-Jones interactions. See the <A HREF = "pair_lj.html">pair_style
lj/cut</A> doc page for the definition of Lennard-Jones
interactions.
</P>
<P>The cutoff distance for an interaction between 2 line segments, or
between a line segment and a point particle, is calculated from the
position of the line segment (its center), not between pairs of
individual spheres comprising the line segment. Thus an interaction
is either calculated in its entirety or not at all.
</P>
<P>The set of non-overlapping spherical particles that represent a line
segment, for purposes of this pair style, are generated in the
following manner. Their size is a function of the line segment length
and the specified sigma for that particle type. If a line segment has
a length L and is of type I, then the number of spheres N that
represent the segment is calculated as N = L/sigma_II, rounded up to
an integer value. Thus if L is not evenly divisibly by sigam_II, N is
incremented to include one extra sphere. In this case, the spheres
must be slightly smaller than sigma_II so as not to overlap, so a new
sigma-prime is chosen as the sphere diameter, such that L/N =
sigma-prime. Thus the line segment interacts with other segments or
point particles as a collection of N spheres of diameter sigma-prime,
evenly spaced along the line segment, so as to exactly cover its
length.
</P>
<P>The LJ interaction between 2 spheres on different line segments of
types I,J is computed with an arithmetic mixing of the sigma values of
the 2 spheres and using the specified epsilon value for I,J atom
types. Note that because the sigma values for line segment spheres is
computed using only sigma_II values, specific to the line segment's
type, this means that any specified sigma_IJ values (for I != J) are
effectively ignored.
</P>
<P>For style <I>line/lj</I>, the following coefficients must be defined for
each pair of atoms types via the <A HREF = "pair_coeff.html">pair_coeff</A> command
as in the examples above, or in the data file or restart files read by
the <A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>cutoff (distance units)
</UL>
<P>The last coefficient is optional. If not specified, the global cutoff
is used.
</P>
<HR>
<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of this pair style can be mixed. The
default mix value is <I>geometric</I>. See the "pair_modify" command for
details.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift, table, and tail options.
</P>
<P>This pair style does not write its information to <A HREF = "restart.html">binary restart
files</A>.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This style is part of the ASPHERE package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#2_3">Making
LAMMPS</A> section for more info.
</P>
<P>Defining particles to be line segments so they participate in
line/line or line/particle interactions requires the use the
<A HREF = "atom_style.html">atom_style line</A> command.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "pair_tri_lj.html">pair_style tri/lj</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_line_lj.txt b/doc/pair_line_lj.txt
index 7fc679eb4..cfa4ffe79 100644
--- a/doc/pair_line_lj.txt
+++ b/doc/pair_line_lj.txt
@@ -1,135 +1,135 @@
"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 line/lj command :h3
pair_style line/lj/omp command :h3
[Syntax:]
pair_style line/lj cutoff :pre
cutoff = global cutoff for interactions (distance units)
[Examples:]
pair_style line/lj 3.0
pair_coeff * * 1.0 1.0
pair_coeff 1 1 1.0 1.5 2.5 :pre
[Description:]
Style {line/lj} treats particles which are line segments as a set of
small spherical particles that tile the line segment length as
explained below. Interactions between two line segments, each with N1
and N2 spherical particles, are calculated as the pairwise sum of
N1*N2 Lennard-Jones interactions. Interactions between a line segment
with N spherical particles and a point particle are treated as the
pairwise sum of N Lennard-Jones interactions. See the "pair_style
lj/cut"_pair_lj.html doc page for the definition of Lennard-Jones
interactions.
The cutoff distance for an interaction between 2 line segments, or
between a line segment and a point particle, is calculated from the
position of the line segment (its center), not between pairs of
individual spheres comprising the line segment. Thus an interaction
is either calculated in its entirety or not at all.
The set of non-overlapping spherical particles that represent a line
segment, for purposes of this pair style, are generated in the
following manner. Their size is a function of the line segment length
and the specified sigma for that particle type. If a line segment has
a length L and is of type I, then the number of spheres N that
represent the segment is calculated as N = L/sigma_II, rounded up to
an integer value. Thus if L is not evenly divisibly by sigam_II, N is
incremented to include one extra sphere. In this case, the spheres
must be slightly smaller than sigma_II so as not to overlap, so a new
sigma-prime is chosen as the sphere diameter, such that L/N =
sigma-prime. Thus the line segment interacts with other segments or
point particles as a collection of N spheres of diameter sigma-prime,
evenly spaced along the line segment, so as to exactly cover its
length.
The LJ interaction between 2 spheres on different line segments of
types I,J is computed with an arithmetic mixing of the sigma values of
the 2 spheres and using the specified epsilon value for I,J atom
types. Note that because the sigma values for line segment spheres is
computed using only sigma_II values, specific to the line segment's
type, this means that any specified sigma_IJ values (for I != J) are
effectively ignored.
For style {line/lj}, 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:
epsilon (energy units)
sigma (distance units)
cutoff (distance units) :ul
The last coefficient is optional. If not specified, the global cutoff
is used.
:line
Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of this pair style can be mixed. The
default mix value is {geometric}. See the "pair_modify" command for
details.
This pair style does not support the "pair_modify"_pair_modify.html
shift, table, and tail options.
This pair style does not write its information to "binary restart
files"_restart.html.
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 ASPHERE 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.
Defining particles to be line segments so they participate in
line/line or line/particle interactions requires the use the
"atom_style line"_atom_style.html command.
[Related commands:]
"pair_coeff"_pair_coeff.html, "pair_style tri/lj"_pair_tri_lj.html
[Default:] none
diff --git a/doc/pair_lj.html b/doc/pair_lj.html
index 91fba09a4..35b16764d 100644
--- a/doc/pair_lj.html
+++ b/doc/pair_lj.html
@@ -1,279 +1,279 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style lj/cut command
</H3>
<H3>pair_style lj/cut/cuda command
</H3>
<H3>pair_style lj/cut/experimental/cuda command
</H3>
<H3>pair_style lj/cut/gpu command
</H3>
<H3>pair_style lj/cut/omp command
</H3>
<H3>pair_style lj/cut/opt command
</H3>
<H3>pair_style lj/cut/omp command
</H3>
<H3>pair_style lj/cut/coul/cut command
</H3>
<H3>pair_style lj/cut/coul/cut/cuda command
</H3>
<H3>pair_style lj/cut/coul/cut/gpu command
</H3>
<H3>pair_style lj/cut/coul/cut/omp command
</H3>
<H3>pair_style lj/cut/coul/debye command
</H3>
<H3>pair_style lj/cut/coul/debye/cuda command
</H3>
<H3>pair_style lj/cut/coul/debye/omp command
</H3>
<H3>pair_style lj/cut/coul/long command
</H3>
<H3>pair_style lj/cut/coul/long/cuda command
</H3>
<H3>pair_style lj/cut/coul/long/gpu command
</H3>
<H3>pair_style lj/cut/coul/long/opt command
</H3>
<H3>pair_style lj/cut/coul/long/omp command
</H3>
<H3>pair_style lj/cut/coul/long/tip4p command
</H3>
<H3>pair_style lj/cut/coul/long/tip4p/omp command
</H3>
<H3>pair_style lj/cut/coul/long/tip4p/opt command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style args
</PRE>
<UL><LI>style = <I>lj/cut</I> or <I>lj/cut/coul/cut</I> or <I>lj/cut/coul/debye</I> or <I>lj/cut/coul/long</I> or <I>lj/cut/coul/long/tip4p</I>
<LI>args = list of arguments for a particular style
</UL>
<PRE> <I>lj/cut</I> args = cutoff
cutoff = global cutoff for Lennard Jones interactions (distance units)
<I>lj/cut/coul/cut</I> args = cutoff (cutoff2)
cutoff = global cutoff for LJ (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
<I>lj/cut/coul/debye</I> args = kappa cutoff (cutoff2)
kappa = Debye length (inverse distance units)
cutoff = global cutoff for LJ (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
<I>lj/cut/coul/long</I> args = cutoff (cutoff2)
cutoff = global cutoff for LJ (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
<I>lj/cut/coul/long/tip4p</I> args = otype htype btype atype qdist cutoff (cutoff2)
otype,htype = atom types for TIP4P O and H
btype,atype = bond and angle types for TIP4P waters
qdist = distance from O atom to massless charge (distance units)
cutoff = global cutoff for LJ (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
</PRE>
<P><B>Examples:</B>
</P>
<PRE>pair_style lj/cut 2.5
pair_coeff * * 1 1
pair_coeff 1 1 1 1.1 2.8
</PRE>
<PRE>pair_style lj/cut/coul/cut 10.0
pair_style lj/cut/coul/cut 10.0 8.0
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0
pair_coeff 1 1 100.0 3.5 9.0 9.0
</PRE>
<PRE>pair_style lj/cut/coul/debye 1.5 3.0
pair_style lj/cut/coul/debye 1.5 2.5 5.0
pair_coeff * * 1.0 1.0
pair_coeff 1 1 1.0 1.5 2.5
pair_coeff 1 1 1.0 1.5 2.5 5.0
</PRE>
<PRE>pair_style lj/cut/coul/long 10.0
pair_style lj/cut/coul/long 10.0 8.0
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0
</PRE>
<PRE>pair_style lj/cut/coul/long/tip4p 1 2 7 8 0.3 12.0
pair_style lj/cut/coul/long/tip4p 1 2 7 8 0.3 12.0 10.0
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>lj/cut</I> styles compute the standard 12/6 Lennard-Jones potential,
given by
</P>
<CENTER><IMG SRC = "Eqs/pair_lj.jpg">
</CENTER>
<P>Rc is the cutoff.
</P>
<P>Style <I>lj/cut/coul/cut</I> adds a Coulombic pairwise interaction given by
</P>
<CENTER><IMG SRC = "Eqs/pair_coulomb.jpg">
</CENTER>
<P>where C is an energy-conversion constant, Qi and Qj are the charges on
the 2 atoms, and epsilon is the dielectric constant which can be set
by the <A HREF = "dielectric.html">dielectric</A> command. If one cutoff is
specified in the pair_style command, it is used for both the LJ and
Coulombic terms. If two cutoffs are specified, they are used as
cutoffs for the LJ and Coulombic terms respectively.
</P>
<P>Style <I>lj/cut/coul/debye</I> adds an additional exp() damping factor
to the Coulombic term, given by
</P>
<CENTER><IMG SRC = "Eqs/pair_debye.jpg">
</CENTER>
<P>where kappa is the Debye length. This potential is another way to
mimic the screening effect of a polar solvent.
</P>
<P>Style <I>lj/cut/coul/long</I> computes the same Coulombic interactions as
style <I>lj/cut/coul/cut</I> except that an additional damping factor is
applied to the Coulombic term so it can be used in conjunction with
the <A HREF = "kspace_style.html">kspace_style</A> command and its <I>ewald</I> or <I>pppm</I>
option. The Coulombic cutoff specified for this style means that
pairwise interactions within this distance are computed directly;
interactions outside that distance are computed in reciprocal space.
</P>
<P>Style <I>lj/cut/coul/long/tip4p</I> implements the TIP4P water model of
<A HREF = "#Jorgensen">(Jorgensen)</A>, which introduces a massless site located a
short distance away from the oxygen atom along the bisector of the HOH
angle. The atomic types of the oxygen and hydrogen atoms, the bond
and angle types for OH and HOH interactions, and the distance to the
massless charge site are specified as pair_style arguments.
</P>
<P>IMPORTANT NOTE: For each TIP4P water molecule in your system, the atom
IDs for the O and 2 H atoms must be consecutive, with the O atom
first. This is to enable LAMMPS to "find" the 2 H atoms associated
with each O atom. For example, if the atom ID of an O atom in a TIP4P
water molecule is 500, then its 2 H atoms must have IDs 501 and 502.
</P>
<P>See the <A HREF = "Section_howto.html#howto_8">howto section</A> for more
information on how to use the TIP4P pair style.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>cutoff1 (distance units)
<LI>cutoff2 (distance units)
</UL>
<P>Note that sigma is defined in the LJ formula as the zero-crossing
distance for the potential, not as the energy minimum at 2^(1/6)
sigma.
</P>
<P>The latter 2 coefficients are optional. If not specified, the global
LJ and Coulombic cutoffs specified in the pair_style command are used.
If only one cutoff is specified, it is used as the cutoff for both LJ
and Coulombic interactions for this type pair. If both coefficients
are specified, they are used as the LJ and Coulombic cutoffs for this
type pair. You cannot specify 2 cutoffs for style <I>lj/cut</I>, since it
has no Coulombic terms.
</P>
<P>For <I>lj/cut/coul/long</I> and <I>lj/cut/coul/long/tip4p</I> only the LJ cutoff
can be specified since a Coulombic cutoff cannot be specified for an
individual I,J type pair. All type pairs use the same global
Coulombic cutoff specified in the pair_style command.
</P>
<P>Styles <I>lj/cut/coul/pppm/omp</I> and <I>lj/cut/coul/pppm/tip4p/omp</I>
are variants of <I>lj/cut/coul/long/omp</I> and <I>lj/cut/coul/long/tip4p/omp</I>
for use with k-space styles <A HREF = "kspace_style.html"><I>pppm/proxy</I></A> and
<A HREF = "kspace_style.html"><I>pppm/tip4p/proxy</I></A>, respectively and OpenMP
multi-threading and will perform the corresponding reciprocal
space calculation concurrently with the pair calculation
in a separate thread. For certain parallel setups, this may have
a performance benefit over performing k-space style and pair style
separately and one after the other.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/cut pair styles can be mixed.
The default mix value is <I>geometric</I>. See the "pair_modify" command
for details.
</P>
<P>All of the lj/cut pair styles support the
<A HREF = "pair_modify.html">pair_modify</A> shift option for the energy of the
Lennard-Jones portion of the pair interaction.
</P>
<P>The <I>lj/cut/coul/long</I> and <I>lj/cut/coul/long/tip4p</I> pair styles
support the <A HREF = "pair_modify.html">pair_modify</A> table option since they can
tabulate the short-range portion of the long-range Coulombic
interaction.
</P>
<P>All of the lj/cut pair styles support the
<A HREF = "pair_modify.html">pair_modify</A> tail option for adding a long-range
tail correction to the energy and pressure for the Lennard-Jones
portion of the pair interaction.
</P>
<P>All of the lj/cut pair styles write their information to <A HREF = "restart.html">binary
restart files</A>, so pair_style and pair_coeff commands do
not need to be specified in an input script that reads a restart file.
</P>
<P>The lj/cut and lj/cut/coul/long pair styles support the use of the
<I>inner</I>, <I>middle</I>, and <I>outer</I> keywords of the <A HREF = "run_style.html">run_style
respa</A> command, meaning the pairwise forces can be
partitioned by distance at different levels of the rRESPA hierarchy.
The other styles only support the <I>pair</I> keyword of run_style respa.
See the <A HREF = "run_style.html">run_style</A> command for details.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>The <I>lj/cut/coul/long</I> and <I>lj/cut/coul/long/tip4p</I> styles are part of
the KSPACE package. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info. Note that the KSPACE package is installed by
default.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Jorgensen"></A>
<P><B>(Jorgensen)</B> Jorgensen, Chandrasekhar, Madura, Impey, Klein, J Chem
Phys, 79, 926 (1983).
</P>
</HTML>
diff --git a/doc/pair_lj.txt b/doc/pair_lj.txt
index 13e4584e5..1385059e0 100644
--- a/doc/pair_lj.txt
+++ b/doc/pair_lj.txt
@@ -1,251 +1,251 @@
"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 lj/cut command :h3
pair_style lj/cut/cuda command :h3
pair_style lj/cut/experimental/cuda command :h3
pair_style lj/cut/gpu command :h3
pair_style lj/cut/omp command :h3
pair_style lj/cut/opt command :h3
pair_style lj/cut/omp command :h3
pair_style lj/cut/coul/cut command :h3
pair_style lj/cut/coul/cut/cuda command :h3
pair_style lj/cut/coul/cut/gpu command :h3
pair_style lj/cut/coul/cut/omp command :h3
pair_style lj/cut/coul/debye command :h3
pair_style lj/cut/coul/debye/cuda command :h3
pair_style lj/cut/coul/debye/omp command :h3
pair_style lj/cut/coul/long command :h3
pair_style lj/cut/coul/long/cuda command :h3
pair_style lj/cut/coul/long/gpu command :h3
pair_style lj/cut/coul/long/opt command :h3
pair_style lj/cut/coul/long/omp command :h3
pair_style lj/cut/coul/long/tip4p command :h3
pair_style lj/cut/coul/long/tip4p/omp command :h3
pair_style lj/cut/coul/long/tip4p/opt command :h3
[Syntax:]
pair_style style args :pre
style = {lj/cut} or {lj/cut/coul/cut} or {lj/cut/coul/debye} or {lj/cut/coul/long} or {lj/cut/coul/long/tip4p}
args = list of arguments for a particular style :ul
{lj/cut} args = cutoff
cutoff = global cutoff for Lennard Jones interactions (distance units)
{lj/cut/coul/cut} args = cutoff (cutoff2)
cutoff = global cutoff for LJ (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{lj/cut/coul/debye} args = kappa cutoff (cutoff2)
kappa = Debye length (inverse distance units)
cutoff = global cutoff for LJ (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{lj/cut/coul/long} args = cutoff (cutoff2)
cutoff = global cutoff for LJ (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{lj/cut/coul/long/tip4p} args = otype htype btype atype qdist cutoff (cutoff2)
otype,htype = atom types for TIP4P O and H
btype,atype = bond and angle types for TIP4P waters
qdist = distance from O atom to massless charge (distance units)
cutoff = global cutoff for LJ (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units) :pre
[Examples:]
pair_style lj/cut 2.5
pair_coeff * * 1 1
pair_coeff 1 1 1 1.1 2.8 :pre
pair_style lj/cut/coul/cut 10.0
pair_style lj/cut/coul/cut 10.0 8.0
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0
pair_coeff 1 1 100.0 3.5 9.0 9.0 :pre
pair_style lj/cut/coul/debye 1.5 3.0
pair_style lj/cut/coul/debye 1.5 2.5 5.0
pair_coeff * * 1.0 1.0
pair_coeff 1 1 1.0 1.5 2.5
pair_coeff 1 1 1.0 1.5 2.5 5.0 :pre
pair_style lj/cut/coul/long 10.0
pair_style lj/cut/coul/long 10.0 8.0
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0 :pre
pair_style lj/cut/coul/long/tip4p 1 2 7 8 0.3 12.0
pair_style lj/cut/coul/long/tip4p 1 2 7 8 0.3 12.0 10.0
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0 :pre
[Description:]
The {lj/cut} styles compute the standard 12/6 Lennard-Jones potential,
given by
:c,image(Eqs/pair_lj.jpg)
Rc is the cutoff.
Style {lj/cut/coul/cut} adds a Coulombic pairwise interaction given by
:c,image(Eqs/pair_coulomb.jpg)
where C is an energy-conversion constant, Qi and Qj are the charges on
the 2 atoms, and epsilon is the dielectric constant which can be set
by the "dielectric"_dielectric.html command. If one cutoff is
specified in the pair_style command, it is used for both the LJ and
Coulombic terms. If two cutoffs are specified, they are used as
cutoffs for the LJ and Coulombic terms respectively.
Style {lj/cut/coul/debye} adds an additional exp() damping factor
to the Coulombic term, given by
:c,image(Eqs/pair_debye.jpg)
where kappa is the Debye length. This potential is another way to
mimic the screening effect of a polar solvent.
Style {lj/cut/coul/long} computes the same Coulombic interactions as
style {lj/cut/coul/cut} except that an additional damping factor is
applied to the Coulombic term so it can be used in conjunction with
the "kspace_style"_kspace_style.html command and its {ewald} or {pppm}
option. The Coulombic cutoff specified for this style means that
pairwise interactions within this distance are computed directly;
interactions outside that distance are computed in reciprocal space.
Style {lj/cut/coul/long/tip4p} implements the TIP4P water model of
"(Jorgensen)"_#Jorgensen, which introduces a massless site located a
short distance away from the oxygen atom along the bisector of the HOH
angle. The atomic types of the oxygen and hydrogen atoms, the bond
and angle types for OH and HOH interactions, and the distance to the
massless charge site are specified as pair_style arguments.
IMPORTANT NOTE: For each TIP4P water molecule in your system, the atom
IDs for the O and 2 H atoms must be consecutive, with the O atom
first. This is to enable LAMMPS to "find" the 2 H atoms associated
with each O atom. For example, if the atom ID of an O atom in a TIP4P
water molecule is 500, then its 2 H atoms must have IDs 501 and 502.
See the "howto section"_Section_howto.html#howto_8 for more
information on how to use the TIP4P pair style.
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:
epsilon (energy units)
sigma (distance units)
cutoff1 (distance units)
cutoff2 (distance units) :ul
Note that sigma is defined in the LJ formula as the zero-crossing
distance for the potential, not as the energy minimum at 2^(1/6)
sigma.
The latter 2 coefficients are optional. If not specified, the global
LJ and Coulombic cutoffs specified in the pair_style command are used.
If only one cutoff is specified, it is used as the cutoff for both LJ
and Coulombic interactions for this type pair. If both coefficients
are specified, they are used as the LJ and Coulombic cutoffs for this
type pair. You cannot specify 2 cutoffs for style {lj/cut}, since it
has no Coulombic terms.
For {lj/cut/coul/long} and {lj/cut/coul/long/tip4p} only the LJ cutoff
can be specified since a Coulombic cutoff cannot be specified for an
individual I,J type pair. All type pairs use the same global
Coulombic cutoff specified in the pair_style command.
Styles {lj/cut/coul/pppm/omp} and {lj/cut/coul/pppm/tip4p/omp}
are variants of {lj/cut/coul/long/omp} and {lj/cut/coul/long/tip4p/omp}
for use with k-space styles "{pppm/proxy}"_kspace_style.html and
"{pppm/tip4p/proxy}"_kspace_style.html, respectively and OpenMP
multi-threading and will perform the corresponding reciprocal
space calculation concurrently with the pair calculation
in a separate thread. For certain parallel setups, this may have
a performance benefit over performing k-space style and pair style
separately and one after the other.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/cut pair styles can be mixed.
The default mix value is {geometric}. See the "pair_modify" command
for details.
All of the lj/cut pair styles support the
"pair_modify"_pair_modify.html shift option for the energy of the
Lennard-Jones portion of the pair interaction.
The {lj/cut/coul/long} and {lj/cut/coul/long/tip4p} pair styles
support the "pair_modify"_pair_modify.html table option since they can
tabulate the short-range portion of the long-range Coulombic
interaction.
All of the lj/cut pair styles support the
"pair_modify"_pair_modify.html tail option for adding a long-range
tail correction to the energy and pressure for the Lennard-Jones
portion of the pair interaction.
All of the lj/cut pair styles write their 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.
The lj/cut and lj/cut/coul/long pair styles support the use of the
{inner}, {middle}, and {outer} keywords of the "run_style
respa"_run_style.html command, meaning the pairwise forces can be
partitioned by distance at different levels of the rRESPA hierarchy.
The other styles only support the {pair} keyword of run_style respa.
See the "run_style"_run_style.html command for details.
:line
[Restrictions:]
The {lj/cut/coul/long} and {lj/cut/coul/long/tip4p} styles are part of
the KSPACE package. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info. Note that the KSPACE package is installed by
default.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Jorgensen)
[(Jorgensen)] Jorgensen, Chandrasekhar, Madura, Impey, Klein, J Chem
Phys, 79, 926 (1983).
diff --git a/doc/pair_lj96.html b/doc/pair_lj96.html
index 97d794d73..940459abb 100644
--- a/doc/pair_lj96.html
+++ b/doc/pair_lj96.html
@@ -1,115 +1,115 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style lj96/cut command
</H3>
<H3>pair_style lj96/cut/cuda command
</H3>
<H3>pair_style lj96/cut/gpu command
</H3>
<H3>pair_style lj96/cut/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style lj96/cut cutoff
</PRE>
<UL><LI>cutoff = global cutoff for lj96/cut interactions (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style lj96/cut 2.5
pair_coeff * * 1.0 1.0 4.0
pair_coeff 1 1 1.0 1.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>lj96/cut</I> style compute a 9/6 Lennard-Jones potential, instead
of the standard 12/6 potential, given by
</P>
<CENTER><IMG SRC = "Eqs/pair_lj96.jpg">
</CENTER>
<P>Rc is the cutoff.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>cutoff (distance units)
</UL>
<P>The last coefficient is optional. If not specified, the global LJ
cutoff specified in the pair_style command is used.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/cut pair styles can be mixed.
The default mix value is <I>geometric</I>. See the "pair_modify" command
for details.
</P>
<P>This pair style supports the <A HREF = "pair_modify.html">pair_modify</A> shift
option for the energy of the pair interaction.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for this pair style.
</P>
<P>This pair style supports the <A HREF = "pair_modify.html">pair_modify</A> tail
option for adding a long-range tail correction to the energy and
pressure of the pair interaction.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style supports the use of the <I>inner</I>, <I>middle</I>, and <I>outer</I>
keywords of the <A HREF = "run_style.html">run_style respa</A> command, meaning the
pairwise forces can be partitioned by distance at different levels of
the rRESPA hierarchy. See the <A HREF = "run_style.html">run_style</A> command for
details.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_lj96.txt b/doc/pair_lj96.txt
index dcdb3632c..2a6280a35 100644
--- a/doc/pair_lj96.txt
+++ b/doc/pair_lj96.txt
@@ -1,107 +1,107 @@
"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 lj96/cut command :h3
pair_style lj96/cut/cuda command :h3
pair_style lj96/cut/gpu command :h3
pair_style lj96/cut/omp command :h3
[Syntax:]
pair_style lj96/cut cutoff :pre
cutoff = global cutoff for lj96/cut interactions (distance units) :ul
[Examples:]
pair_style lj96/cut 2.5
pair_coeff * * 1.0 1.0 4.0
pair_coeff 1 1 1.0 1.0 :pre
[Description:]
The {lj96/cut} style compute a 9/6 Lennard-Jones potential, instead
of the standard 12/6 potential, given by
:c,image(Eqs/pair_lj96.jpg)
Rc is the cutoff.
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:
epsilon (energy units)
sigma (distance units)
cutoff (distance units) :ul
The last coefficient is optional. If not specified, the global LJ
cutoff specified in the pair_style command is used.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/cut pair styles can be mixed.
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 supports the "pair_modify"_pair_modify.html tail
option for adding a long-range tail correction to the energy and
pressure of the pair interaction.
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 supports the use of the {inner}, {middle}, and {outer}
keywords of the "run_style respa"_run_style.html command, meaning the
pairwise forces can be partitioned by distance at different levels of
the rRESPA hierarchy. See the "run_style"_run_style.html command for
details.
:line
[Restrictions:] none
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
diff --git a/doc/pair_lj_coul.html b/doc/pair_lj_coul.html
index 9faaba871..eae07c2a2 100644
--- a/doc/pair_lj_coul.html
+++ b/doc/pair_lj_coul.html
@@ -1,181 +1,181 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style lj/coul command
</H3>
<H3>pair_style lj/coul/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style lj/coul flag_lj flag_coul cutoff (cutoff2)
</PRE>
<UL><LI>flag_lj = <I>long</I> or <I>cut</I>
<PRE> <I>long</I> = use Kspace long-range summation for the dispersion term 1/r^6
<I>cut</I> = use a cutoff
</PRE>
<LI>flag_coul = <I>long</I> or <I>off</I>
<PRE> <I>long</I> = use Kspace long-range summation for the Coulombic term 1/r
<I>off</I> = omit the Coulombic term
</PRE>
<LI>cutoff = global cutoff for LJ (and Coulombic if only 1 cutoff) (distance units)
<LI>cutoff2 = global cutoff for Coulombic (optional) (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style lj/coul cut off 2.5
pair_style lj/coul cut long 2.5 4.0
pair_style lj/coul long long 2.5 4.0
pair_coeff * * 1 1
pair_coeff 1 1 1 3 4
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>lj/coul</I> style computes the standard 12/6 Lennard-Jones and
Coulombic potentials, given by
</P>
<CENTER><IMG SRC = "Eqs/pair_lj.jpg">
</CENTER>
<CENTER><IMG SRC = "Eqs/pair_coulomb.jpg">
</CENTER>
<P>where C is an energy-conversion constant, Qi and Qj are the charges on
the 2 atoms, epsilon is the dielectric constant which can be set by
the <A HREF = "dielectric.html">dielectric</A> command, and Rc is the cutoff. If
one cutoff is specified in the pair_style command, it is used for both
the LJ and Coulombic terms. If two cutoffs are specified, they are
used as cutoffs for the LJ and Coulombic terms respectively.
</P>
<P>The purpose of this pair style is to capture long-range interactions
resulting from both attractive 1/r^6 Lennard-Jones and Coulombic 1/r
interactions. This is done by use of the <I>flag_lj</I> and <I>flag_coul</I>
settings. The <A HREF = "#Veld">In 't Veld</A> paper has more details on when it is
appropriate to include long-range 1/r^6 interactions, using this
potential.
</P>
<P>If <I>flag_lj</I> is set to <I>long</I>, no cutoff is used on the LJ 1/r^6
dispersion term. The long-range portion is calculated by using the
<A HREF = "kspace_style.html">kspace_style ewald/n</A> command. The specified LJ
cutoff then determines which portion of the LJ interactions are
computed directly by the pair potential versus which part is computed
in reciprocal space via the Kspace style. If <I>flag_lj</I> is set to
<I>cut</I>, the LJ interactions are simply cutoff, as with <A HREF = "pair_lj.html">pair_style
lj/cut</A>.
</P>
<P>If <I>flag_coul</I> is set to <I>long</I>, no cutoff is used on the Coulombic
interactions. The long-range portion is calculated by using any
style, including <I>ewald/n</I> of the <A HREF = "kspace_style.html">kspace_style</A>
command. Note that if <I>flag_lj</I> is also set to long, then only the
<I>ewald/n</I> Kspace style can perform the long-range calculations for
both the LJ and Coulombic interactions. If <I>flag_coul</I> is set to
<I>off</I>, Coulombic interactions are not computed.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>cutoff1 (distance units)
<LI>cutoff2 (distance units)
</UL>
<P>Note that sigma is defined in the LJ formula as the zero-crossing
distance for the potential, not as the energy minimum at 2^(1/6)
sigma.
</P>
<P>The latter 2 coefficients are optional. If not specified, the global
LJ and Coulombic cutoffs specified in the pair_style command are used.
If only one cutoff is specified, it is used as the cutoff for both LJ
and Coulombic interactions for this type pair. If both coefficients
are specified, they are used as the LJ and Coulombic cutoffs for this
type pair. Note that if you are using <I>flag_lj</I> set to <I>long</I>, you
cannot specify a LJ cutoff for an atom type pair, since only one
global LJ cutoff is allowed. Similarly, if you are using <I>flag_coul</I>
set to <I>long</I>, you cannot specify a Coulombic cutoff for an atom type
pair, since only one global Coulombic cutoff is allowed.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/cut pair styles can be mixed.
The default mix value is <I>geometric</I>. See the "pair_modify" command
for details.
</P>
<P>This pair style supports the <A HREF = "pair_modify.html">pair_modify</A> shift
option for the energy of the Lennard-Jones portion of the pair
interaction, assuming <I>flag_lj</I> is <I>cut</I>.
</P>
<P>This pair style supports the <A HREF = "pair_modify.html">pair_modify</A> table
option since it can tabulate the short-range portion of the long-range
Coulombic interaction.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding a long-range tail correction to the
Lennard-Jones portion of the energy and pressure.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style supports the use of the <I>inner</I>, <I>middle</I>, and <I>outer</I>
keywords of the <A HREF = "run_style.html">run_style respa</A> command, meaning the
pairwise forces can be partitioned by distance at different levels of
the rRESPA hierarchy. See the <A HREF = "run_style.html">run_style</A> command for
details.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This style is part of the USER-EWALDN package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Veld"></A>
<P><B>(In 't Veld)</B> In 't Veld, Ismail, Grest, J Chem Phys (accepted) (2007).
</P>
</HTML>
diff --git a/doc/pair_lj_coul.txt b/doc/pair_lj_coul.txt
index 1593ca417..2a3ebdc97 100644
--- a/doc/pair_lj_coul.txt
+++ b/doc/pair_lj_coul.txt
@@ -1,169 +1,169 @@
"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 lj/coul command :h3
pair_style lj/coul/omp command :h3
[Syntax:]
pair_style lj/coul flag_lj flag_coul cutoff (cutoff2) :pre
flag_lj = {long} or {cut} :ulb,l
{long} = use Kspace long-range summation for the dispersion term 1/r^6
{cut} = use a cutoff :pre
flag_coul = {long} or {off} :l
{long} = use Kspace long-range summation for the Coulombic term 1/r
{off} = omit the Coulombic term :pre
cutoff = global cutoff for LJ (and Coulombic if only 1 cutoff) (distance units) :l
cutoff2 = global cutoff for Coulombic (optional) (distance units) :l,ule
[Examples:]
pair_style lj/coul cut off 2.5
pair_style lj/coul cut long 2.5 4.0
pair_style lj/coul long long 2.5 4.0
pair_coeff * * 1 1
pair_coeff 1 1 1 3 4 :pre
[Description:]
The {lj/coul} style computes the standard 12/6 Lennard-Jones and
Coulombic potentials, given by
:c,image(Eqs/pair_lj.jpg)
:c,image(Eqs/pair_coulomb.jpg)
where C is an energy-conversion constant, Qi and Qj are the charges on
the 2 atoms, epsilon is the dielectric constant which can be set by
the "dielectric"_dielectric.html command, and Rc is the cutoff. If
one cutoff is specified in the pair_style command, it is used for both
the LJ and Coulombic terms. If two cutoffs are specified, they are
used as cutoffs for the LJ and Coulombic terms respectively.
The purpose of this pair style is to capture long-range interactions
resulting from both attractive 1/r^6 Lennard-Jones and Coulombic 1/r
interactions. This is done by use of the {flag_lj} and {flag_coul}
settings. The "In 't Veld"_#Veld paper has more details on when it is
appropriate to include long-range 1/r^6 interactions, using this
potential.
If {flag_lj} is set to {long}, no cutoff is used on the LJ 1/r^6
dispersion term. The long-range portion is calculated by using the
"kspace_style ewald/n"_kspace_style.html command. The specified LJ
cutoff then determines which portion of the LJ interactions are
computed directly by the pair potential versus which part is computed
in reciprocal space via the Kspace style. If {flag_lj} is set to
{cut}, the LJ interactions are simply cutoff, as with "pair_style
lj/cut"_pair_lj.html.
If {flag_coul} is set to {long}, no cutoff is used on the Coulombic
interactions. The long-range portion is calculated by using any
style, including {ewald/n} of the "kspace_style"_kspace_style.html
command. Note that if {flag_lj} is also set to long, then only the
{ewald/n} Kspace style can perform the long-range calculations for
both the LJ and Coulombic interactions. If {flag_coul} is set to
{off}, Coulombic interactions are not computed.
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:
epsilon (energy units)
sigma (distance units)
cutoff1 (distance units)
cutoff2 (distance units) :ul
Note that sigma is defined in the LJ formula as the zero-crossing
distance for the potential, not as the energy minimum at 2^(1/6)
sigma.
The latter 2 coefficients are optional. If not specified, the global
LJ and Coulombic cutoffs specified in the pair_style command are used.
If only one cutoff is specified, it is used as the cutoff for both LJ
and Coulombic interactions for this type pair. If both coefficients
are specified, they are used as the LJ and Coulombic cutoffs for this
type pair. Note that if you are using {flag_lj} set to {long}, you
cannot specify a LJ cutoff for an atom type pair, since only one
global LJ cutoff is allowed. Similarly, if you are using {flag_coul}
set to {long}, you cannot specify a Coulombic cutoff for an atom type
pair, since only one global Coulombic cutoff is allowed.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/cut pair styles can be mixed.
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 Lennard-Jones portion of the pair
interaction, assuming {flag_lj} is {cut}.
This pair style supports the "pair_modify"_pair_modify.html table
option since it can tabulate the short-range portion of the long-range
Coulombic interaction.
This pair style does not support the "pair_modify"_pair_modify.html
tail option for adding a long-range tail correction to the
Lennard-Jones portion of the 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 supports the use of the {inner}, {middle}, and {outer}
keywords of the "run_style respa"_run_style.html command, meaning the
pairwise forces can be partitioned by distance at different levels of
the rRESPA hierarchy. See the "run_style"_run_style.html command for
details.
:line
[Restrictions:]
This style is part of the USER-EWALDN package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Veld)
[(In 't Veld)] In 't Veld, Ismail, Grest, J Chem Phys (accepted) (2007).
diff --git a/doc/pair_lj_cubic.html b/doc/pair_lj_cubic.html
index b5d72b845..9bd2996a9 100644
--- a/doc/pair_lj_cubic.html
+++ b/doc/pair_lj_cubic.html
@@ -1,136 +1,136 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style lj/cubic command
</H3>
<H3>pair_style lj/cubic/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style lj/cubic
</PRE>
<P><B>Examples:</B>
</P>
<PRE>pair_style lj/cubic
pair_coeff * * 1.0 0.8908987
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>lj/cubic</I> style computes a truncated LJ interaction potential whose
energy and force are continuous everywhere.
Inside the inflection point the interaction is identical to the
standard 12/6 <A HREF = "pair_lj.html">Lennard-Jones</A> potential.
The LJ function outside the inflection point is replaced
with a cubic function of distance. The energy, force, and second
derivative are continuous at the inflection point.
The cubic coefficient A3 is chosen so
that both energy and force go to zero at the cutoff distance.
Outside the cutoff distance the energy and force are zero.
</P>
<CENTER><IMG SRC = "Eqs/pair_lj_cubic.jpg">
</CENTER>
<P>The location of the inflection point rs is defined
by the LJ diameter, rs/sigma = (26/7)^1/6. The cutoff distance
is defined by rc/rs = 67/48 or rc/sigma = 1.737....
The analytic expression for the
the cubic coefficient
A3*rmin^3/epsilon = 27.93... is given in the paper by
Holian and Ravelo <A HREF = "#Holian">(Holian)</A>.
</P>
<P>This potential is commonly used to study the shock mechanics
of FCC solids, as in Ravelo et al. <A HREF = "#Ravelo">(Ravelo)</A>.
</P>
<P>The following coefficients must be defined for each pair of atom
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the example
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
</UL>
<P>Note that sigma is defined in the LJ formula as the zero-crossing
distance for the potential, not as the energy minimum, which
is located at rmin = 2^(1/6)*sigma. In the above example, sigma = 0.8908987,
so rmin = 1.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/cut pair styles can be mixed.
The default mix value is <I>geometric</I>. See the "pair_modify" command
for details.
</P>
<P>The lj/cubic pair style does not support the
<A HREF = "pair_modify.html">pair_modify</A> shift option,
since pair interaction is already smoothed to 0.0 at the
cutoff.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for this pair style.
</P>
<P>The lj/cubic pair style does not support the
<A HREF = "pair_modify.html">pair_modify</A> tail option for adding long-range tail
corrections to energy and pressure, since there are no corrections for
a potential that goes to 0.0 at the cutoff.
</P>
<P>The lj/cubic pair style writes its information to <A HREF = "restart.html">binary
restart files</A>, so pair_style and pair_coeff commands do
not need to be specified in an input script that reads a restart file.
</P>
<P>The lj/cubic pair style can only be used via the <I>pair</I>
keyword of the <A HREF = "run_style.html">run_style respa</A> command. It does not
support the <I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Holian"></A>
<A NAME = "Ravelo"></A><B>(Holian)</B> Holian and Ravelo, Phys Rev B, 51, 11275 (1995).
<P><B>(Ravelo)</B> Ravelo, Holian, Germann and Lomdahl, Phys Rev B, 70, 014103 (2004).
</P>
</HTML>
diff --git a/doc/pair_lj_cubic.txt b/doc/pair_lj_cubic.txt
index 5d60cb12b..f1f17c9f9 100644
--- a/doc/pair_lj_cubic.txt
+++ b/doc/pair_lj_cubic.txt
@@ -1,128 +1,128 @@
"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 lj/cubic command :h3
pair_style lj/cubic/omp command :h3
[Syntax:]
pair_style lj/cubic :pre
[Examples:]
pair_style lj/cubic
pair_coeff * * 1.0 0.8908987 :pre
[Description:]
The {lj/cubic} style computes a truncated LJ interaction potential whose
energy and force are continuous everywhere.
Inside the inflection point the interaction is identical to the
standard 12/6 "Lennard-Jones"_pair_lj.html potential.
The LJ function outside the inflection point is replaced
with a cubic function of distance. The energy, force, and second
derivative are continuous at the inflection point.
The cubic coefficient A3 is chosen so
that both energy and force go to zero at the cutoff distance.
Outside the cutoff distance the energy and force are zero.
:c,image(Eqs/pair_lj_cubic.jpg)
The location of the inflection point rs is defined
by the LJ diameter, rs/sigma = (26/7)^1/6. The cutoff distance
is defined by rc/rs = 67/48 or rc/sigma = 1.737....
The analytic expression for the
the cubic coefficient
A3*rmin^3/epsilon = 27.93... is given in the paper by
Holian and Ravelo "(Holian)"_#Holian.
This potential is commonly used to study the shock mechanics
of FCC solids, as in Ravelo et al. "(Ravelo)"_#Ravelo.
The following coefficients must be defined for each pair of atom
types via the "pair_coeff"_pair_coeff.html command as in the example
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:
epsilon (energy units)
sigma (distance units) :ul
Note that sigma is defined in the LJ formula as the zero-crossing
distance for the potential, not as the energy minimum, which
is located at rmin = 2^(1/6)*sigma. In the above example, sigma = 0.8908987,
so rmin = 1.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/cut pair styles can be mixed.
The default mix value is {geometric}. See the "pair_modify" command
for details.
The lj/cubic pair style does not support the
"pair_modify"_pair_modify.html shift option,
since pair interaction is already smoothed to 0.0 at the
cutoff.
The "pair_modify"_pair_modify.html table option is not relevant
for this pair style.
The lj/cubic pair style does not support the
"pair_modify"_pair_modify.html tail option for adding long-range tail
corrections to energy and pressure, since there are no corrections for
a potential that goes to 0.0 at the cutoff.
The lj/cubic 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.
The lj/cubic 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:] none
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Holian)
[(Holian)] Holian and Ravelo, Phys Rev B, 51, 11275 (1995).
:link(Ravelo)
[(Ravelo)] Ravelo, Holian, Germann and Lomdahl, Phys Rev B, 70, 014103 (2004).
diff --git a/doc/pair_lj_expand.html b/doc/pair_lj_expand.html
index 9173bc7d5..91b3130a6 100644
--- a/doc/pair_lj_expand.html
+++ b/doc/pair_lj_expand.html
@@ -1,119 +1,119 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style lj/expand command
</H3>
<H3>pair_style lj/expand/cuda command
</H3>
<H3>pair_style lj/expand/gpu command
</H3>
<H3>pair_style lj/expand/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style lj/expand cutoff
</PRE>
<UL><LI>cutoff = global cutoff for lj/expand interactions (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style lj/expand 2.5
pair_coeff * * 1.0 1.0 0.5
pair_coeff 1 1 1.0 1.0 -0.2 2.0
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>lj/expand</I> computes a LJ interaction with a distance shifted by
delta which can be useful when particles are of different sizes, since
it is different that using different sigma values in a standard LJ
formula:
</P>
<CENTER><IMG SRC = "Eqs/pair_lj_expand.jpg">
</CENTER>
<P>Rc is the cutoff which does not include the delta distance. I.e. the
actual force cutoff is the sum of cutoff + delta.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>delta (distance units)
<LI>cutoff (distance units)
</UL>
<P>The delta values can be positive or negative. The last coefficient is
optional. If not specified, the global LJ cutoff is used.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon, sigma, and shift
coefficients and cutoff distance for this pair style can be mixed.
Shift is always mixed via an <I>arithmetic</I> rule. The other
coefficients are mixed according to the pair_modify mix value. The
default mix value is <I>geometric</I>. See the "pair_modify" command for
details.
</P>
<P>This pair style supports the <A HREF = "pair_modify.html">pair_modify</A> shift
option for the energy of the pair interaction.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for this pair style.
</P>
<P>This pair style supports the <A HREF = "pair_modify.html">pair_modify</A> tail
option for adding a long-range tail correction to the energy and
pressure of the pair interaction.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_lj_expand.txt b/doc/pair_lj_expand.txt
index fc9fd047e..d2be5a81c 100644
--- a/doc/pair_lj_expand.txt
+++ b/doc/pair_lj_expand.txt
@@ -1,111 +1,111 @@
"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 lj/expand command :h3
pair_style lj/expand/cuda command :h3
pair_style lj/expand/gpu command :h3
pair_style lj/expand/omp command :h3
[Syntax:]
pair_style lj/expand cutoff :pre
cutoff = global cutoff for lj/expand interactions (distance units) :ul
[Examples:]
pair_style lj/expand 2.5
pair_coeff * * 1.0 1.0 0.5
pair_coeff 1 1 1.0 1.0 -0.2 2.0 :pre
[Description:]
Style {lj/expand} computes a LJ interaction with a distance shifted by
delta which can be useful when particles are of different sizes, since
it is different that using different sigma values in a standard LJ
formula:
:c,image(Eqs/pair_lj_expand.jpg)
Rc is the cutoff which does not include the delta distance. I.e. the
actual force cutoff is the sum of cutoff + delta.
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:
epsilon (energy units)
sigma (distance units)
delta (distance units)
cutoff (distance units) :ul
The delta values can be positive or negative. The last coefficient is
optional. If not specified, the global LJ cutoff is used.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon, sigma, and shift
coefficients and cutoff distance for this pair style can be mixed.
Shift is always mixed via an {arithmetic} rule. The other
coefficients are mixed according to the pair_modify mix value. 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 supports the "pair_modify"_pair_modify.html tail
option for adding a long-range tail correction to the energy and
pressure of the pair interaction.
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:] none
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
diff --git a/doc/pair_lj_sf.html b/doc/pair_lj_sf.html
index 7ff901105..6da69b3e6 100644
--- a/doc/pair_lj_sf.html
+++ b/doc/pair_lj_sf.html
@@ -1,120 +1,120 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style lj/sf command
</H3>
<H3>pair_style lj/sf/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style lj/sf cutoff
</PRE>
<UL><LI>cutoff = global cutoff for Lennard-Jones interactions (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style lj/sf 2.5
pair_coeff * * 1.0 1.0
pair_coeff 1 1 1.0 1.0 3.0
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>lj/sf</I> computes a truncated and force-shifted LJ interaction
(Shifted Force Lennard-Jones), so that both the potential and the
force go continuously to zero at the cutoff <A HREF = "#Toxvaerd">(Toxvaerd)</A>:
</P>
<CENTER><IMG SRC = "Eqs/pair_lj_sf.jpg">
</CENTER>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>cutoff (distance units)
</UL>
<P>The last coefficient is optional. If not specified, the global
LJ cutoff specified in the pair_style command is used.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma
coefficients and cutoff distance for this pair style can be mixed.
Rin is a cutoff value and is mixed like the cutoff. The
default mix value is <I>geometric</I>. See the "pair_modify" command for
details.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> shift option is not relevant for
this pair style, since the pair interaction goes to 0.0 at the cutoff.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for this pair style.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding long-range tail corrections to energy and
pressure, since the energy of the pair interaction is smoothed to 0.0
at the cutoff.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This pair style is part of the USER-MISC package. It is only enabled
if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Toxvaerd"></A>
<P><B>(Toxvaerd)</B> Toxvaerd, Dyre, J Chem Phys, 134, 081102 (2011).
</P>
</HTML>
diff --git a/doc/pair_lj_sf.txt b/doc/pair_lj_sf.txt
index a56cf7485..be0d94f5a 100644
--- a/doc/pair_lj_sf.txt
+++ b/doc/pair_lj_sf.txt
@@ -1,113 +1,113 @@
"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 lj/sf command :h3
pair_style lj/sf/omp command :h3
[Syntax:]
pair_style lj/sf cutoff :pre
cutoff = global cutoff for Lennard-Jones interactions (distance units) :ul
[Examples:]
pair_style lj/sf 2.5
pair_coeff * * 1.0 1.0
pair_coeff 1 1 1.0 1.0 3.0 :pre
[Description:]
Style {lj/sf} computes a truncated and force-shifted LJ interaction
(Shifted Force Lennard-Jones), so that both the potential and the
force go continuously to zero at the cutoff "(Toxvaerd)"_#Toxvaerd:
:c,image(Eqs/pair_lj_sf.jpg)
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:
epsilon (energy units)
sigma (distance units)
cutoff (distance units) :ul
The last coefficient is optional. If not specified, the global
LJ cutoff specified in the pair_style command is used.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma
coefficients and cutoff distance for this pair style can be mixed.
Rin is a cutoff value and is mixed like the cutoff. The
default mix value is {geometric}. See the "pair_modify" command for
details.
The "pair_modify"_pair_modify.html shift option is not relevant for
this pair style, since the pair interaction goes to 0.0 at the cutoff.
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, since the energy of the pair interaction is smoothed to 0.0
at the cutoff.
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 pair style is part of the USER-MISC package. It is only enabled
if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Toxvaerd)
[(Toxvaerd)] Toxvaerd, Dyre, J Chem Phys, 134, 081102 (2011).
diff --git a/doc/pair_lj_smooth.html b/doc/pair_lj_smooth.html
index 0805dd5f0..57af043e7 100644
--- a/doc/pair_lj_smooth.html
+++ b/doc/pair_lj_smooth.html
@@ -1,128 +1,128 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style lj/smooth command
</H3>
<H3>pair_style lj/smooth/cuda command
</H3>
<H3>pair_style lj/smooth/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style lj/smooth Rin Rc
</PRE>
<UL><LI>Rin = inner cutoff beyond which force smoothing will be applied (distance units)
<LI>Rc = outer cutoff for lj/smooth interactions (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style lj/smooth 8.0 10.0
pair_coeff * * 10.0 1.5
pair_coeff 1 1 20.0 1.3 7.0 9.0
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>lj/smooth</I> computes a LJ interaction with a force smoothing
applied between the inner and outer cutoff.
</P>
<CENTER><IMG SRC = "Eqs/pair_lj_smooth.jpg">
</CENTER>
<P>The polynomial coefficients C1, C2, C3, C4 are computed by LAMMPS to
cause the force to vary smoothly from the inner cutoff Rin to the
outer cutoff Rc.
</P>
<P>At the inner cutoff the force and its 1st derivative
will match the unsmoothed LJ formula. At the outer cutoff the force
and its 1st derivative will be 0.0. The inner cutoff cannot be 0.0.
</P>
<P>IMPORTANT NOTE: this force smoothing causes the energy to be
discontinuous both in its values and 1st derivative. This can lead to
poor energy conservation and may require the use of a thermostat.
Plot the energy and force resulting from this formula via the
<A HREF = "pair_write.html">pair_write</A> command to see the effect.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>innner (distance units)
<LI>outer (distance units)
</UL>
<P>The last 2 coefficients are optional inner and outer cutoffs. If not
specified, the global values for Rin and Rc are used.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon, sigma, Rin
coefficients and the cutoff distance for this pair style can be mixed.
Rin is a cutoff value and is mixed like the cutoff. The other
coefficients are mixed according to the pair_modify mix option. The
default mix value is <I>geometric</I>. See the "pair_modify" command for
details.
</P>
<P>This pair style supports the <A HREF = "pair_modify.html">pair_modify</A> shift
option for the energy of the pair interaction.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for this pair style.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding long-range tail corrections to energy and
pressure, since the energy of the pair interaction is smoothed to 0.0
at the cutoff.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_lj_smooth.txt b/doc/pair_lj_smooth.txt
index b08bb4743..a2d37902c 100644
--- a/doc/pair_lj_smooth.txt
+++ b/doc/pair_lj_smooth.txt
@@ -1,121 +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 lj/smooth command :h3
pair_style lj/smooth/cuda command :h3
pair_style lj/smooth/omp command :h3
[Syntax:]
pair_style lj/smooth Rin Rc :pre
Rin = inner cutoff beyond which force smoothing will be applied (distance units)
Rc = outer cutoff for lj/smooth interactions (distance units) :ul
[Examples:]
pair_style lj/smooth 8.0 10.0
pair_coeff * * 10.0 1.5
pair_coeff 1 1 20.0 1.3 7.0 9.0 :pre
[Description:]
Style {lj/smooth} computes a LJ interaction with a force smoothing
applied between the inner and outer cutoff.
:c,image(Eqs/pair_lj_smooth.jpg)
The polynomial coefficients C1, C2, C3, C4 are computed by LAMMPS to
cause the force to vary smoothly from the inner cutoff Rin to the
outer cutoff Rc.
At the inner cutoff the force and its 1st derivative
will match the unsmoothed LJ formula. At the outer cutoff the force
and its 1st derivative will be 0.0. The inner cutoff cannot be 0.0.
IMPORTANT NOTE: this force smoothing causes the energy to be
discontinuous both in its values and 1st derivative. This can lead to
poor energy conservation and may require the use of a thermostat.
Plot the energy and force resulting from this formula via the
"pair_write"_pair_write.html command to see the effect.
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:
epsilon (energy units)
sigma (distance units)
innner (distance units)
outer (distance units) :ul
The last 2 coefficients are optional inner and outer cutoffs. If not
specified, the global values for Rin and Rc are used.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon, sigma, Rin
coefficients and the cutoff distance for this pair style can be mixed.
Rin is a cutoff value and is mixed like the cutoff. The other
coefficients are mixed according to the pair_modify mix option. 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, since the energy of the pair interaction is smoothed to 0.0
at the cutoff.
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:] none
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
diff --git a/doc/pair_morse.html b/doc/pair_morse.html
index eaf5f1608..42ab9eb6d 100644
--- a/doc/pair_morse.html
+++ b/doc/pair_morse.html
@@ -1,113 +1,113 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style morse command
</H3>
<H3>pair_style morse/cuda command
</H3>
<H3>pair_style morse/gpu command
</H3>
<H3>pair_style morse/omp command
</H3>
<H3>pair_style morse/opt command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style morse cutoff
</PRE>
<UL><LI>cutoff = global cutoff for Morse interactions (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style morse 2.5
pair_coeff * * 100.0 2.0 1.5
pair_coeff 1 1 100.0 2.0 1.5 3.0
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>morse</I> computes pairwise interactions with the formula
</P>
<CENTER><IMG SRC = "Eqs/pair_morse.jpg">
</CENTER>
<P>Rc is the cutoff.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>D0 (energy units)
<LI>alpha (1/distance units)
<LI>r0 (distance units)
<LI>cutoff (distance units)
</UL>
<P>The last coefficient is optional. If not specified, the global morse
cutoff is used.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>None of these pair styles support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
</P>
<P>All of these pair styles support the <A HREF = "pair_modify.html">pair_modify</A>
shift option for the energy of the pair interaction.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table options is not relevant for
the Morse pair styles.
</P>
<P>None of these pair styles support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding long-range tail corrections to energy and
pressure.
</P>
<P>All of these pair styles write their information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>These pair styles can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. They do not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_morse.txt b/doc/pair_morse.txt
index b31acbb5a..5c8293e6b 100644
--- a/doc/pair_morse.txt
+++ b/doc/pair_morse.txt
@@ -1,104 +1,104 @@
"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 morse command :h3
pair_style morse/cuda command :h3
pair_style morse/gpu command :h3
pair_style morse/omp command :h3
pair_style morse/opt command :h3
[Syntax:]
pair_style morse cutoff :pre
cutoff = global cutoff for Morse interactions (distance units) :ul
[Examples:]
pair_style morse 2.5
pair_coeff * * 100.0 2.0 1.5
pair_coeff 1 1 100.0 2.0 1.5 3.0 :pre
[Description:]
Style {morse} computes pairwise interactions with the formula
:c,image(Eqs/pair_morse.jpg)
Rc is the cutoff.
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:
D0 (energy units)
alpha (1/distance units)
r0 (distance units)
cutoff (distance units) :ul
The last coefficient is optional. If not specified, the global morse
cutoff is used.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
None of these pair styles support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
All of these pair styles support the "pair_modify"_pair_modify.html
shift option for the energy of the pair interaction.
The "pair_modify"_pair_modify.html table options is not relevant for
the Morse pair styles.
None of these pair styles support the "pair_modify"_pair_modify.html
tail option for adding long-range tail corrections to energy and
pressure.
All of these pair styles write their 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.
These pair styles can only be used via the {pair} keyword of the
"run_style respa"_run_style.html command. They do not support the
{inner}, {middle}, {outer} keywords.
:line
[Restrictions:] none
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
diff --git a/doc/pair_peri.html b/doc/pair_peri.html
index 33bcbd17c..c5871b982 100644
--- a/doc/pair_peri.html
+++ b/doc/pair_peri.html
@@ -1,156 +1,156 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style peri/pmb command
</H3>
<H3>pair_style peri/pmb/omp command
</H3>
<H3>pair_style peri/lps command
</H3>
<H3>pair_style peri/lps/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style
</PRE>
<UL><LI>style = <I>peri/pmb</I> or <I>peri/lps</I>
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style peri/pmb
pair_coeff * * 1.6863e22 0.0015001 0.0005 0.25
</PRE>
<PRE>pair_style peri/lps
pair_coeff * * 14.9e9 14.9e9 0.0015001 0.0005 0.25
</PRE>
<P><B>Description:</B>
</P>
<P>The peridynamic pair styles implement material models that can be used
at the mescscopic and macroscopic scales.
</P>
<P>Style <I>peri/pmb</I> implements the Peridynamic bond-based prototype
microelastic brittle (PMB) model.
</P>
<P>Style <I>peri/lps</I> implements the Peridynamic state-based linear
peridynamic solid (LPS) model.
</P>
<P>The canonical papers on Peridynamics are <A HREF = "#Silling2000">(Silling 2000)</A>
and <A HREF = "#Silling2007">(Silling 2007)</A>. The implementation of Peridynamics
in LAMMPS is described in <A HREF = "#Parks">(Parks)</A>. Also see the <A HREF = "http://www.sandia.gov/~mlparks/papers/PDLAMMPS.pdf">PDLAMMPS
user guide</A> for
more details about the implementation of peridynamics in LAMMPS.
</P>
<P>The following coefficients must be defined for each pair of atom types
via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples above,
or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below.
</P>
<P>For the <I>peri/pmb</I> style:
</P>
<UL><LI>c (energy/distance/volume^2 units)
<LI>horizon (distance units)
<LI>s00 (unitless)
<LI>alpha (unitless)
</UL>
<P>C is the effectively a spring constant for Peridynamic bonds, the
horizon is a cutoff distance for truncating interactions, and s00 and
alpha are used as a bond breaking criteria. The units of c are such
that c/distance = stiffness/volume^2, where stiffness is
energy/distance^2 and volume is distance^3. See the users guide for
more details.
</P>
<P>For the <I>peri/lps</I> style:
</P>
<UL><LI>K (force/area units)
<LI>G (force/area units)
<LI>horizon (distance units)
<LI>s00 (unitless)
<LI>alpha (unitless)
</UL>
<P>K is the bulk modulus and G is the shear modulus. The horizon is a
cutoff distance for truncating interactions, and s00 and alpha are
used as a bond breaking criteria. See the users guide for more
details.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>These pair styles do not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
</P>
<P>These pair styles do not support the <A HREF = "pair_modify.html">pair_modify</A>
shift option.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table and tail options are not
relevant for these pair styles.
</P>
<P>These pair styles write their information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>These pair styles can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. They do not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>The <I>peri/pmb</I> and <I>peri/lps</I> styles are part of the PERI
package. They are only enabled if LAMMPS was built with that package.
See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section for more
info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Parks"></A>
<P><B>(Parks)</B> Parks, Lehoucq, Plimpton, Silling, Comp Phys Comm, 179(11), 777-783 (2008).
</P>
<A NAME = "Silling2000"></A>
<P><B>(Silling 2000)</B> Silling, J Mech Phys Solids, 48, 175-209 (2000).
</P>
<A NAME = "Silling2007"></A>
<P><B>(Silling 2007)</B> Silling, Epton, Weckner, Xu, Askari, J Elasticity, 88, 151-184 (2007).
</P>
</HTML>
diff --git a/doc/pair_peri.txt b/doc/pair_peri.txt
index 00f663649..acaea14e3 100644
--- a/doc/pair_peri.txt
+++ b/doc/pair_peri.txt
@@ -1,145 +1,145 @@
"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 peri/pmb command :h3
pair_style peri/pmb/omp command :h3
pair_style peri/lps command :h3
pair_style peri/lps/omp command :h3
[Syntax:]
pair_style style :pre
style = {peri/pmb} or {peri/lps} :ul
[Examples:]
pair_style peri/pmb
pair_coeff * * 1.6863e22 0.0015001 0.0005 0.25 :pre
pair_style peri/lps
pair_coeff * * 14.9e9 14.9e9 0.0015001 0.0005 0.25 :pre
[Description:]
The peridynamic pair styles implement material models that can be used
at the mescscopic and macroscopic scales.
Style {peri/pmb} implements the Peridynamic bond-based prototype
microelastic brittle (PMB) model.
Style {peri/lps} implements the Peridynamic state-based linear
peridynamic solid (LPS) model.
The canonical papers on Peridynamics are "(Silling 2000)"_#Silling2000
and "(Silling 2007)"_#Silling2007. The implementation of Peridynamics
in LAMMPS is described in "(Parks)"_#Parks. Also see the "PDLAMMPS
user guide"_http://www.sandia.gov/~mlparks/papers/PDLAMMPS.pdf for
more details about the implementation of peridynamics in LAMMPS.
The following coefficients must be defined for each pair of atom 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.
For the {peri/pmb} style:
c (energy/distance/volume^2 units)
horizon (distance units)
s00 (unitless)
alpha (unitless) :ul
C is the effectively a spring constant for Peridynamic bonds, the
horizon is a cutoff distance for truncating interactions, and s00 and
alpha are used as a bond breaking criteria. The units of c are such
that c/distance = stiffness/volume^2, where stiffness is
energy/distance^2 and volume is distance^3. See the users guide for
more details.
For the {peri/lps} style:
K (force/area units)
G (force/area units)
horizon (distance units)
s00 (unitless)
alpha (unitless) :ul
K is the bulk modulus and G is the shear modulus. The horizon is a
cutoff distance for truncating interactions, and s00 and alpha are
used as a bond breaking criteria. See the users guide for more
details.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
These pair styles do not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
These pair styles do not support the "pair_modify"_pair_modify.html
shift option.
The "pair_modify"_pair_modify.html table and tail options are not
relevant for these pair styles.
These pair styles write their 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.
These pair styles can only be used via the {pair} keyword of the
"run_style respa"_run_style.html command. They do not support the
{inner}, {middle}, {outer} keywords.
:line
[Restrictions:]
The {peri/pmb} and {peri/lps} styles are part of the PERI
package. They are only enabled if LAMMPS was built with that package.
See the "Making LAMMPS"_Section_start.html#start_3 section for more
info.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Parks)
[(Parks)] Parks, Lehoucq, Plimpton, Silling, Comp Phys Comm, 179(11), 777-783 (2008).
:link(Silling2000)
[(Silling 2000)] Silling, J Mech Phys Solids, 48, 175-209 (2000).
:link(Silling2007)
[(Silling 2007)] Silling, Epton, Weckner, Xu, Askari, J Elasticity, 88, 151-184 (2007).
diff --git a/doc/pair_resquared.html b/doc/pair_resquared.html
index 63e274fb5..ebca4fe03 100644
--- a/doc/pair_resquared.html
+++ b/doc/pair_resquared.html
@@ -1,243 +1,243 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style resquared command
</H3>
<H3>pair_style resquared/gpu command
</H3>
<H3>pair_style resquared/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style resquared cutoff
</PRE>
<UL><LI>cutoff = global cutoff for interactions (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style resquared 10.0
pair_coeff * * 1.0 1.0 1.7 3.4 3.4 1.0 1.0 1.0
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>resquared</I> computes the RE-squared anisotropic interaction
<A HREF = "#Everaers">(Everaers)</A>, <A HREF = "#Babadi">(Babadi)</A> between pairs of
ellipsoidal and/or spherical Lennard-Jones particles. For ellipsoidal
interactions, the potential considers the ellipsoid as being comprised
of small spheres of size sigma. LJ particles are a single sphere of
size sigma. The distinction is made to allow the pair style to make
efficient calculations of ellipsoid/solvent interactions.
</P>
<P>Details for the equations used are given in the references below and
in <A HREF = "PDF/pair_resquared_extra.pdf">this supplementary document</A>.
</P>
<P>Use of this pair style requires the NVE, NVT, or NPT fixes with the
<I>asphere</I> extension (e.g. <A HREF = "fix_nve_asphere.html">fix nve/asphere</A>) in
order to integrate particle rotation. Additionally, <A HREF = "atom_style.html">atom_style
ellipsoid</A> should be used since it defines the
rotational state and the size and shape of each ellipsoidal particle.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>A12 = Energy Prefactor/Hamaker constant (energy units)
<LI>sigma = atomic interaction diameter (distance units)
<LI>epsilon_i_a = relative well depth of type I for side-to-side interactions
<LI>epsilon_i_b = relative well depth of type I for face-to-face interactions
<LI>epsilon_i_c = relative well depth of type I for end-to-end interactions
<LI>epsilon_j_a = relative well depth of type J for side-to-side interactions
<LI>epsilon_j_b = relative well depth of type J for face-to-face interactions
<LI>epsilon_j_c = relative well depth of type J for end-to-end interactions
<LI>cutoff (distance units)
</UL>
<P>The parameters used depend on the type of the interacting particles,
i.e. ellipsoids or LJ spheres. The type of a particle is determined
by the diameters specified for its 3 shape paramters. If all 3 shape
parameters = 0.0, then the particle is treated as an LJ sphere. The
epsilon_i_* or epsilon_j_* parameters are ignored for LJ spheres. If
the 3 shape paraemters are > 0.0, then the particle is treated as an
ellipsoid (even if the 3 parameters are equal to each other).
</P>
<P>A12 specifies the energy prefactor which depends on the types of the
two interacting particles.
</P>
<P>For ellipsoid/ellipsoid interactions, the interaction is computed by
the formulas in the supplementary docuement referenced above. A12 is
the Hamaker constant as described in <A HREF = "#Everaers">(Everaers)</A>. In LJ
units:
</P>
<CENTER><IMG SRC = "Eqs/pair_resquared.jpg">
</CENTER>
<P>where rho gives the number density of the spherical particles
composing the ellipsoids and epsilon_LJ determines the interaction
strength of the spherical particles.
</P>
<P>For ellipsoid/LJ sphere interactions, the interaction is also computed
by the formulas in the supplementary docuement referenced above. A12
has a modifed form (see <A HREF = "PDF/pair_resquared_extra.pdf">here</A> for
details):
</P>
<CENTER><IMG SRC = "Eqs/pair_resquared2.jpg">
</CENTER>
<P>For ellipsoid/LJ sphere interactions, a correction to the distance-
of-closest approach equation has been implemented to reduce the error
from two particles of disparate sizes; see <A HREF = "PDF/pair_resquared_extra.pdf">this supplementary
document</A>.
</P>
<P>For LJ sphere/LJ sphere interactions, the interaction is computed
using the standard Lennard-Jones formula, which is much cheaper to
compute than the ellipsoidal formulas. A12 is used as epsilon in the
standard LJ formula:
</P>
<CENTER><IMG SRC = "Eqs/pair_resquared3.jpg">
</CENTER>
<P>and the specified <I>sigma</I> is used as the sigma in the standard LJ
formula.
</P>
<P>When one of both of the interacting particles are ellipsoids, then
<I>sigma</I> specifies the diameter of the continuous distribution of
constituent particles within each ellipsoid used to model the
RE-squared potential. Note that this is a different meaning for
<I>sigma</I> than the <A HREF = "pair_gayberne.html">pair_style gayberne</A> potential
uses.
</P>
<P>The epsilon_i and epsilon_j coefficients are defined for atom types,
not for pairs of atom types. Thus, in a series of pair_coeff
commands, they only need to be specified once for each atom type.
</P>
<P>Specifically, if any of epsilon_i_a, epsilon_i_b, epsilon_i_c are
non-zero, the three values are assigned to atom type I. If all the
epsilon_i values are zero, they are ignored. If any of epsilon_j_a,
epsilon_j_b, epsilon_j_c are non-zero, the three values are assigned
to atom type J. If all three epsilon_i values are zero, they are
ignored. Thus the typical way to define the epsilon_i and epsilon_j
coefficients is to list their values in "pair_coeff I J" commands when
I = J, but set them to 0.0 when I != J. If you do list them when I !=
J, you should insure they are consistent with their values in other
pair_coeff commands.
</P>
<P>Note that if this potential is being used as a sub-style of
<A HREF = "pair_hybrid.html">pair_style hybrid</A>, and there is no "pair_coeff I I"
setting made for RE-squared for a particular type I (because I-I
interactions are computed by another hybrid pair potential), then you
still need to insure the epsilon a,b,c coefficients are assigned to
that type in a "pair_coeff I J" command.
</P>
<P>For large uniform molecules it has been shown that the epsilon_*_*
energy parameters are approximately representable in terms of local
contact curvatures <A HREF = "#Everaers">(Everaers)</A>:
</P>
<CENTER><IMG SRC = "Eqs/pair_resquared4.jpg">
</CENTER>
<P>where a, b, and c give the particle diameters.
</P>
<P>The last coefficient is optional. If not specified, the global cutoff
specified in the pair_style command is used.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance can be mixed, but only for sphere pairs. The
default mix value is <I>geometric</I>. See the "pair_modify" command for
details. Other type pairs cannot be mixed, due to the different
meanings of the energy prefactors used to calculate the interactions
and the implicit dependence of the ellipsoid-sphere interaction on the
equation for the Hamaker constant presented here. Mixing of sigma and
epsilon followed by calculation of the energy prefactors using the
equations above is recommended.
</P>
<P>This pair styles supports the <A HREF = "pair_modify.html">pair_modify</A> shift
option for the energy of the Lennard-Jones portion of the pair
interaction, but only for sphere-sphere interactions. There is no
shifting performed for ellipsoidal interactions due to the anisotropic
dependence of the interaction.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for this pair style.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding long-range tail corrections to energy and
pressure.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords of the <A HREF = "run_style.html">run_style
command</A>.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This style is part of the ASPHERE package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>This pair style requires that atoms be ellipsoids as defined by the
<A HREF = "atom_style.html">atom_style ellipsoid</A> command.
</P>
<P>Particles acted on by the potential can be extended aspherical or
spherical particles, or point particles. Spherical particles have all
3 of their shape parameters equal to each other. Point particles have
all 3 of their shape parameters equal to 0.0.
</P>
<P>The distance-of-closest-approach approximation used by LAMMPS becomes
less accurate when high-aspect ratio ellipsoids are used.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "fix_nve_asphere.html">fix nve/asphere</A>,
<A HREF = "compute_temp_asphere.html">compute temp/asphere</A>, <A HREF = "pair_gayberne.html">pair_style
gayberne</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Everaers"></A>
<P><B>(Everaers)</B> Everaers and Ejtehadi, Phys Rev E, 67, 041710 (2003).
</P>
<A NAME = "Babadi"></A>
<P><B>(Berardi)</B> Babadi, Ejtehadi, Everaers, J Comp Phys, 219, 770-779 (2006).
</P>
</HTML>
diff --git a/doc/pair_resquared.txt b/doc/pair_resquared.txt
index 0762b0522..d364346f7 100755
--- a/doc/pair_resquared.txt
+++ b/doc/pair_resquared.txt
@@ -1,234 +1,234 @@
"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 resquared command :h3
pair_style resquared/gpu command :h3
pair_style resquared/omp command :h3
[Syntax:]
pair_style resquared cutoff :pre
cutoff = global cutoff for interactions (distance units) :ul
[Examples:]
pair_style resquared 10.0
pair_coeff * * 1.0 1.0 1.7 3.4 3.4 1.0 1.0 1.0 :pre
[Description:]
Style {resquared} computes the RE-squared anisotropic interaction
"(Everaers)"_#Everaers, "(Babadi)"_#Babadi between pairs of
ellipsoidal and/or spherical Lennard-Jones particles. For ellipsoidal
interactions, the potential considers the ellipsoid as being comprised
of small spheres of size sigma. LJ particles are a single sphere of
size sigma. The distinction is made to allow the pair style to make
efficient calculations of ellipsoid/solvent interactions.
Details for the equations used are given in the references below and
in "this supplementary document"_PDF/pair_resquared_extra.pdf.
Use of this pair style requires the NVE, NVT, or NPT fixes with the
{asphere} extension (e.g. "fix nve/asphere"_fix_nve_asphere.html) in
order to integrate particle rotation. Additionally, "atom_style
ellipsoid"_atom_style.html should be used since it defines the
rotational state and the size and shape of each ellipsoidal particle.
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:
A12 = Energy Prefactor/Hamaker constant (energy units)
sigma = atomic interaction diameter (distance units)
epsilon_i_a = relative well depth of type I for side-to-side interactions
epsilon_i_b = relative well depth of type I for face-to-face interactions
epsilon_i_c = relative well depth of type I for end-to-end interactions
epsilon_j_a = relative well depth of type J for side-to-side interactions
epsilon_j_b = relative well depth of type J for face-to-face interactions
epsilon_j_c = relative well depth of type J for end-to-end interactions
cutoff (distance units) :ul
The parameters used depend on the type of the interacting particles,
i.e. ellipsoids or LJ spheres. The type of a particle is determined
by the diameters specified for its 3 shape paramters. If all 3 shape
parameters = 0.0, then the particle is treated as an LJ sphere. The
epsilon_i_* or epsilon_j_* parameters are ignored for LJ spheres. If
the 3 shape paraemters are > 0.0, then the particle is treated as an
ellipsoid (even if the 3 parameters are equal to each other).
A12 specifies the energy prefactor which depends on the types of the
two interacting particles.
For ellipsoid/ellipsoid interactions, the interaction is computed by
the formulas in the supplementary docuement referenced above. A12 is
the Hamaker constant as described in "(Everaers)"_#Everaers. In LJ
units:
:c,image(Eqs/pair_resquared.jpg)
where rho gives the number density of the spherical particles
composing the ellipsoids and epsilon_LJ determines the interaction
strength of the spherical particles.
For ellipsoid/LJ sphere interactions, the interaction is also computed
by the formulas in the supplementary docuement referenced above. A12
has a modifed form (see "here"_PDF/pair_resquared_extra.pdf for
details):
:c,image(Eqs/pair_resquared2.jpg)
For ellipsoid/LJ sphere interactions, a correction to the distance-
of-closest approach equation has been implemented to reduce the error
from two particles of disparate sizes; see "this supplementary
document"_PDF/pair_resquared_extra.pdf.
For LJ sphere/LJ sphere interactions, the interaction is computed
using the standard Lennard-Jones formula, which is much cheaper to
compute than the ellipsoidal formulas. A12 is used as epsilon in the
standard LJ formula:
:c,image(Eqs/pair_resquared3.jpg)
and the specified {sigma} is used as the sigma in the standard LJ
formula.
When one of both of the interacting particles are ellipsoids, then
{sigma} specifies the diameter of the continuous distribution of
constituent particles within each ellipsoid used to model the
RE-squared potential. Note that this is a different meaning for
{sigma} than the "pair_style gayberne"_pair_gayberne.html potential
uses.
The epsilon_i and epsilon_j coefficients are defined for atom types,
not for pairs of atom types. Thus, in a series of pair_coeff
commands, they only need to be specified once for each atom type.
Specifically, if any of epsilon_i_a, epsilon_i_b, epsilon_i_c are
non-zero, the three values are assigned to atom type I. If all the
epsilon_i values are zero, they are ignored. If any of epsilon_j_a,
epsilon_j_b, epsilon_j_c are non-zero, the three values are assigned
to atom type J. If all three epsilon_i values are zero, they are
ignored. Thus the typical way to define the epsilon_i and epsilon_j
coefficients is to list their values in "pair_coeff I J" commands when
I = J, but set them to 0.0 when I != J. If you do list them when I !=
J, you should insure they are consistent with their values in other
pair_coeff commands.
Note that if this potential is being used as a sub-style of
"pair_style hybrid"_pair_hybrid.html, and there is no "pair_coeff I I"
setting made for RE-squared for a particular type I (because I-I
interactions are computed by another hybrid pair potential), then you
still need to insure the epsilon a,b,c coefficients are assigned to
that type in a "pair_coeff I J" command.
For large uniform molecules it has been shown that the epsilon_*_*
energy parameters are approximately representable in terms of local
contact curvatures "(Everaers)"_#Everaers:
:c,image(Eqs/pair_resquared4.jpg)
where a, b, and c give the particle diameters.
The last coefficient is optional. If not specified, the global cutoff
specified in the pair_style command is used.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance can be mixed, but only for sphere pairs. The
default mix value is {geometric}. See the "pair_modify" command for
details. Other type pairs cannot be mixed, due to the different
meanings of the energy prefactors used to calculate the interactions
and the implicit dependence of the ellipsoid-sphere interaction on the
equation for the Hamaker constant presented here. Mixing of sigma and
epsilon followed by calculation of the energy prefactors using the
equations above is recommended.
This pair styles supports the "pair_modify"_pair_modify.html shift
option for the energy of the Lennard-Jones portion of the pair
interaction, but only for sphere-sphere interactions. There is no
shifting performed for ellipsoidal interactions due to the anisotropic
dependence of the 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 of the "run_style
command"_run_style.html.
:line
[Restrictions:]
This style is part of the ASPHERE package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
This pair style requires that atoms be ellipsoids as defined by the
"atom_style ellipsoid"_atom_style.html command.
Particles acted on by the potential can be extended aspherical or
spherical particles, or point particles. Spherical particles have all
3 of their shape parameters equal to each other. Point particles have
all 3 of their shape parameters equal to 0.0.
The distance-of-closest-approach approximation used by LAMMPS becomes
less accurate when high-aspect ratio ellipsoids are used.
[Related commands:]
"pair_coeff"_pair_coeff.html, "fix nve/asphere"_fix_nve_asphere.html,
"compute temp/asphere"_compute_temp_asphere.html, "pair_style
gayberne"_pair_gayberne.html
[Default:] none
:line
:link(Everaers)
[(Everaers)] Everaers and Ejtehadi, Phys Rev E, 67, 041710 (2003).
:link(Babadi)
[(Berardi)] Babadi, Ejtehadi, Everaers, J Comp Phys, 219, 770-779 (2006).
diff --git a/doc/pair_sdk.html b/doc/pair_sdk.html
index d382c03a9..c2f9a76c3 100644
--- a/doc/pair_sdk.html
+++ b/doc/pair_sdk.html
@@ -1,166 +1,166 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style lj/sdk command
</H3>
<H3>pair_style lj/sdk/gpu command
</H3>
<H3>pair_style lj/sdk/omp command
</H3>
<H3>pair_style lj/sdk/coul/long command
</H3>
<H3>pair_style lj/sdk/coul/long/gpu command
</H3>
<H3>pair_style lj/sdk/coul/long/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style args
</PRE>
<UL><LI>style = <I>lj/sdk</I> or <I>lj/sdk/coul/long</I>
<LI>args = list of arguments for a particular style
</UL>
<PRE> <I>lj/sdk</I> args = cutoff
cutoff = global cutoff for Lennard Jones interactions (distance units)
<I>lj/sdk/coul/long</I> args = cutoff (cutoff2)
cutoff = global cutoff for LJ (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
</PRE>
<P><B>Examples:</B>
</P>
<PRE>pair_style lj/sdk 2.5
pair_coeff 1 1 lj12_6 1 1.1 2.8
</PRE>
<PRE>pair_style lj/sdk/coul/long 10.0
pair_style lj/sdk/coul/long 10.0 12.0
pair_coeff 1 1 lj9_6 100.0 3.5 12.0
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>lj/sdk</I> styles compute a 9/6, 12/4, or 12/6 Lennard-Jones potential,
given by
</P>
<CENTER><IMG SRC = "Eqs/pair_cmm.jpg">
</CENTER>
<P>as required for the SDK Coarse-grained MD parametrization discussed in
<A HREF = "#Shinoda">(Shinoda)</A> and <A HREF = "#DeVane">(DeVane)</A>. Rc is the cutoff.
</P>
<P>Style <I>lj/sdk/coul/long</I> computes the adds Coulombic interactions
with an additional damping factor applied so it can be used in
conjunction with the <A HREF = "kspace_style.html">kspace_style</A> command and
its <I>ewald</I> or <I>pppm</I> or <I>pppm/cg</I> option. The Coulombic cutoff
specified for this style means that pairwise interactions within
this distance are computed directly; interactions outside that
distance are computed in reciprocal space.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>cg_type (lj9_6, lj12_4, or lj12_6)
<LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>cutoff1 (distance units)
</UL>
<P>Note that sigma is defined in the LJ formula as the zero-crossing
distance for the potential, not as the energy minimum. The prefactors
are chosen so that the potential minimum is at -epsilon.
</P>
<P>The latter 2 coefficients are optional. If not specified, the global
LJ and Coulombic cutoffs specified in the pair_style command are used.
If only one cutoff is specified, it is used as the cutoff for both LJ
and Coulombic interactions for this type pair. If both coefficients
are specified, they are used as the LJ and Coulombic cutoffs for this
type pair.
</P>
<P>For <I>lj/sdk/coul/long</I> only the LJ cutoff can be specified since a
Coulombic cutoff cannot be specified for an individual I,J type pair.
All type pairs use the same global Coulombic cutoff specified in the
pair_style command.
</P>
<HR>
<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I> or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have been
-optimized to run faster, depending on your available hardware, as
-discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP, and
OPT packages respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, and rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/sdk pair styles <I>cannot</I> be mixed,
since different pairs may have different exponents. So all parameters
for all pairs have to be specified explicitly through the "pair_coeff"
command. Defining then in a data file is also not supported, due to
limitations of that file format.
</P>
<P>All of the lj/sdk pair styles support the
<A HREF = "pair_modify.html">pair_modify</A> shift option for the energy of the
Lennard-Jones portion of the pair interaction.
</P>
<P>The <I>lj/sdk/coul/long</I> pair styles support the
<A HREF = "pair_modify.html">pair_modify</A> table option since they can tabulate
the short-range portion of the long-range Coulombic interaction.
</P>
<P>All of the lj/sdk pair styles write their information to <A HREF = "restart.html">binary
restart files</A>, so pair_style and pair_coeff commands do
not need to be specified in an input script that reads a restart file.
</P>
<P>The lj/sdk and lj/cut/coul/long pair styles do not support
the use of the <I>inner</I>, <I>middle</I>, and <I>outer</I> keywords of the <A HREF = "run_style.html">run_style
respa</A> command.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>All of the lj/sdk pair styles are part of the USER-CG-CMM package.
The <I>lj/sdk/coul/long</I> style also requires the KSPACE package to be
built (which is enabled by default). They are only enabled if LAMMPS
was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "angle_sdk.html">angle_style sdk</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Shinoda"></A>
<P><B>(Shinoda)</B> Shinoda, DeVane, Klein, Mol Sim, 33, 27 (2007).
</P>
<A NAME = "DeVane"></A>
<P><B>(DeVane)</B> Shinoda, DeVane, Klein, Soft Matter, 4, 2453-2462 (2008).
</P>
</HTML>
diff --git a/doc/pair_sdk.txt b/doc/pair_sdk.txt
index 476fd06fe..536be2a6e 100644
--- a/doc/pair_sdk.txt
+++ b/doc/pair_sdk.txt
@@ -1,154 +1,154 @@
"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 lj/sdk command :h3
pair_style lj/sdk/gpu command :h3
pair_style lj/sdk/omp command :h3
pair_style lj/sdk/coul/long command :h3
pair_style lj/sdk/coul/long/gpu command :h3
pair_style lj/sdk/coul/long/omp command :h3
[Syntax:]
pair_style style args :pre
style = {lj/sdk} or {lj/sdk/coul/long}
args = list of arguments for a particular style :ul
{lj/sdk} args = cutoff
cutoff = global cutoff for Lennard Jones interactions (distance units)
{lj/sdk/coul/long} args = cutoff (cutoff2)
cutoff = global cutoff for LJ (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units) :pre
[Examples:]
pair_style lj/sdk 2.5
pair_coeff 1 1 lj12_6 1 1.1 2.8 :pre
pair_style lj/sdk/coul/long 10.0
pair_style lj/sdk/coul/long 10.0 12.0
pair_coeff 1 1 lj9_6 100.0 3.5 12.0 :pre
[Description:]
The {lj/sdk} styles compute a 9/6, 12/4, or 12/6 Lennard-Jones potential,
given by
:c,image(Eqs/pair_cmm.jpg)
as required for the SDK Coarse-grained MD parametrization discussed in
"(Shinoda)"_#Shinoda and "(DeVane)"_#DeVane. Rc is the cutoff.
Style {lj/sdk/coul/long} computes the adds Coulombic interactions
with an additional damping factor applied so it can be used in
conjunction with the "kspace_style"_kspace_style.html command and
its {ewald} or {pppm} or {pppm/cg} option. The Coulombic cutoff
specified for this style means that pairwise interactions within
this distance are computed directly; interactions outside that
distance are computed in reciprocal space.
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:
cg_type (lj9_6, lj12_4, or lj12_6)
epsilon (energy units)
sigma (distance units)
cutoff1 (distance units) :ul
Note that sigma is defined in the LJ formula as the zero-crossing
distance for the potential, not as the energy minimum. The prefactors
are chosen so that the potential minimum is at -epsilon.
The latter 2 coefficients are optional. If not specified, the global
LJ and Coulombic cutoffs specified in the pair_style command are used.
If only one cutoff is specified, it is used as the cutoff for both LJ
and Coulombic interactions for this type pair. If both coefficients
are specified, they are used as the LJ and Coulombic cutoffs for this
type pair.
For {lj/sdk/coul/long} only the LJ cutoff can be specified since a
Coulombic cutoff cannot be specified for an individual I,J type pair.
All type pairs use the same global Coulombic cutoff specified in the
pair_style command.
:line
Styles with a {cuda}, {gpu}, {omp} or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have been
-optimized to run faster, depending on your available hardware, as
-discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP, and
OPT packages respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, and rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of the lj/sdk pair styles {cannot} be mixed,
since different pairs may have different exponents. So all parameters
for all pairs have to be specified explicitly through the "pair_coeff"
command. Defining then in a data file is also not supported, due to
limitations of that file format.
All of the lj/sdk pair styles support the
"pair_modify"_pair_modify.html shift option for the energy of the
Lennard-Jones portion of the pair interaction.
The {lj/sdk/coul/long} pair styles support the
"pair_modify"_pair_modify.html table option since they can tabulate
the short-range portion of the long-range Coulombic interaction.
All of the lj/sdk pair styles write their 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.
The lj/sdk and lj/cut/coul/long pair styles do not support
the use of the {inner}, {middle}, and {outer} keywords of the "run_style
respa"_run_style.html command.
:line
[Restrictions:]
All of the lj/sdk pair styles are part of the USER-CG-CMM package.
The {lj/sdk/coul/long} style also requires the KSPACE package to be
built (which is enabled by default). They are only enabled if LAMMPS
was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"pair_coeff"_pair_coeff.html, "angle_style sdk"_angle_sdk.html
[Default:] none
:line
:link(Shinoda)
[(Shinoda)] Shinoda, DeVane, Klein, Mol Sim, 33, 27 (2007).
:link(DeVane)
[(DeVane)] Shinoda, DeVane, Klein, Soft Matter, 4, 2453-2462 (2008).
diff --git a/doc/pair_soft.html b/doc/pair_soft.html
index 145056ece..0376c6fe5 100644
--- a/doc/pair_soft.html
+++ b/doc/pair_soft.html
@@ -1,140 +1,140 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style soft command
</H3>
<H3>pair_style soft/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style soft cutoff
</PRE>
<UL><LI>cutoff = global cutoff for soft interactions (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style soft 2.5
pair_coeff * * 10.0
pair_coeff 1 1 10.0 3.0
</PRE>
<PRE>pair_style soft 2.5
pair_coeff * * 0.0
variable prefactor equal ramp(0,30)
fix 1 all adapt 1 pair soft a * * v_prefactor
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>soft</I> computes pairwise interactions with the formula
</P>
<CENTER><IMG SRC = "Eqs/pair_soft.jpg">
</CENTER>
<P>It is useful for pushing apart overlapping atoms, since it does not
blow up as r goes to 0. A is a pre-factor that can be made to vary in
time from the start to the end of the run (see discussion below),
e.g. to start with a very soft potential and slowly harden the
interactions over time. Rc is the cutoff. See the <A HREF = "fix_nve_limit.html">fix
nve/limit</A> command for another way to push apart
overlapping atoms.
</P>
<P>The following coefficients must be defined for each pair of atom types
via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples above,
or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>A (energy units)
<LI>cutoff (distance units)
</UL>
<P>The last coefficient is optional. If not specified, the global soft
cutoff is used.
</P>
<P>IMPORTANT NOTE: The syntax for <A HREF = "pair_coeff.html">pair_coeff</A> with a
single A coeff is different in the current version of LAMMPS than in
older versions which took two values, Astart and Astop, to ramp
between them. This functionality is now available in a more general
form through the <A HREF = "fix_adapt.html">fix adapt</A> command, as explained
below. Note that if you use an old input script and specify Astart
and Astop without a cutoff, then LAMMPS will interpret that as A and a
cutoff, which is probabably not what you want.
</P>
<P>The <A HREF = "fix_adapt.html">fix adapt</A> command can be used to vary A for one
or more pair types over the course of a simulation, in which case
pair_coeff settings for A must still be specified, but will be
overridden. For example these commands will vary the prefactor A for
all pairwise interactions from 0.0 at the beginning to 30.0 at the end
of a run:
</P>
<PRE>variable prefactor equal ramp(0,30)
fix 1 all adapt 1 pair soft a * * v_prefactor
</PRE>
<P>Note that a formula defined by an <A HREF = "variable.html">equal-style variable</A>
can use the current timestep, elapsed time in the current run, elapsed
time since the beginning of a series of runs, as well as access other
variables.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the A coefficient and cutoff
distance for this pair style can be mixed. A is always mixed via a
<I>geometric</I> rule. The cutoff is mixed according to the pair_modify
mix value. The default mix value is <I>geometric</I>. See the
"pair_modify" command for details.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift option, since the pair interaction goes to 0.0 at the cutoff.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table and tail options are not
relevant for this pair style.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "fix_nve_limit.html">fix nve/limit</A>, <A HREF = "fix_adapt.html">fix
adapt</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_soft.txt b/doc/pair_soft.txt
index 14f68d7c4..d95c0d23c 100644
--- a/doc/pair_soft.txt
+++ b/doc/pair_soft.txt
@@ -1,134 +1,134 @@
"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 soft command :h3
pair_style soft/omp command :h3
[Syntax:]
pair_style soft cutoff :pre
cutoff = global cutoff for soft interactions (distance units) :ul
[Examples:]
pair_style soft 2.5
pair_coeff * * 10.0
pair_coeff 1 1 10.0 3.0 :pre
pair_style soft 2.5
pair_coeff * * 0.0
variable prefactor equal ramp(0,30)
fix 1 all adapt 1 pair soft a * * v_prefactor :pre
[Description:]
Style {soft} computes pairwise interactions with the formula
:c,image(Eqs/pair_soft.jpg)
It is useful for pushing apart overlapping atoms, since it does not
blow up as r goes to 0. A is a pre-factor that can be made to vary in
time from the start to the end of the run (see discussion below),
e.g. to start with a very soft potential and slowly harden the
interactions over time. Rc is the cutoff. See the "fix
nve/limit"_fix_nve_limit.html command for another way to push apart
overlapping atoms.
The following coefficients must be defined for each pair of atom 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 units)
cutoff (distance units) :ul
The last coefficient is optional. If not specified, the global soft
cutoff is used.
IMPORTANT NOTE: The syntax for "pair_coeff"_pair_coeff.html with a
single A coeff is different in the current version of LAMMPS than in
older versions which took two values, Astart and Astop, to ramp
between them. This functionality is now available in a more general
form through the "fix adapt"_fix_adapt.html command, as explained
below. Note that if you use an old input script and specify Astart
and Astop without a cutoff, then LAMMPS will interpret that as A and a
cutoff, which is probabably not what you want.
The "fix adapt"_fix_adapt.html command can be used to vary A for one
or more pair types over the course of a simulation, in which case
pair_coeff settings for A must still be specified, but will be
overridden. For example these commands will vary the prefactor A for
all pairwise interactions from 0.0 at the beginning to 30.0 at the end
of a run:
variable prefactor equal ramp(0,30)
fix 1 all adapt 1 pair soft a * * v_prefactor :pre
Note that a formula defined by an "equal-style variable"_variable.html
can use the current timestep, elapsed time in the current run, elapsed
time since the beginning of a series of runs, as well as access other
variables.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
: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 always mixed via a
{geometric} rule. The cutoff is mixed according to the pair_modify
mix value. The default mix value is {geometric}. See the
"pair_modify" command for details.
This pair style does not support the "pair_modify"_pair_modify.html
shift option, since the pair interaction goes to 0.0 at the cutoff.
The "pair_modify"_pair_modify.html table and tail options are not
relevant for this pair style.
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:] none
[Related commands:]
"pair_coeff"_pair_coeff.html, "fix nve/limit"_fix_nve_limit.html, "fix
adapt"_fix_adapt.html
[Default:] none
diff --git a/doc/pair_style.html b/doc/pair_style.html
index c192fce8a..c146e10b2 100644
--- a/doc/pair_style.html
+++ b/doc/pair_style.html
@@ -1,192 +1,194 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style args
</PRE>
<UL><LI>style = one of the styles from the list below
<LI>args = arguments used by a particular style
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style lj/cut 2.5
pair_style eam/alloy
pair_style hybrid lj/charmm/coul/long 10.0 eam
pair_style table linear 1000
pair_style none
</PRE>
<P><B>Description:</B>
</P>
<P>Set the formula(s) LAMMPS uses to compute pairwise interactions. In
LAMMPS, pair potentials are defined between pairs of atoms that are
within a cutoff distance and the set of active interactions typically
changes over time. See the <A HREF = "bond_style.html">bond_style</A> command to
define potentials between pairs of bonded atoms, which typically
remain in place for the duration of a simulation.
</P>
<P>In LAMMPS, pairwise force fields encompass a variety of interactions,
some of which include many-body effects, e.g. EAM, Stillinger-Weber,
Tersoff, REBO potentials. They are still classified as "pairwise"
potentials because the set of interacting atoms changes with time
(unlike molecular bonds) and thus a neighbor list is used to find
nearby interacting atoms.
</P>
<P>Hybrid models where specified pairs of atom types interact via
different pair potentials can be setup using the <I>hybrid</I> pair style.
</P>
<P>The coefficients associated with a pair style are typically set for
each pair of atom types, and are specified by the
<A HREF = "pair_coeff.html">pair_coeff</A> command or read from a file by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> command sets options for mixing of
type I-J interaction coefficients and adding energy offsets or tail
corrections to Lennard-Jones potentials. Details on these options as
they pertain to individual potentials are described on the doc page
for the potential. Likewise, info on whether the potential
information is stored in a <A HREF = "write_restart.html">restart file</A> is listed
on the potential doc page.
</P>
<P>In the formulas listed for each pair style, <I>E</I> is the energy of a
pairwise interaction between two atoms separated by a distance <I>r</I>.
The force between the atoms is the negative derivative of this
expression.
</P>
<P>If the pair_style command has a cutoff argument, it sets global
cutoffs for all pairs of atom types. The distance(s) can be smaller
or larger than the dimensions of the simulation box.
</P>
<P>Typically, the global cutoff value can be overridden for a specific
pair of atom types by the <A HREF = "pair_coeff.html">pair_coeff</A> command. The
pair style settings (including global cutoffs) can be changed by a
subsequent pair_style command using the same style. This will reset
the cutoffs for all atom type pairs, including those previously set
explicitly by a <A HREF = "pair_coeff.html">pair_coeff</A> command. The exceptions
to this are that pair_style <I>table</I> and <I>hybrid</I> settings cannot be
reset. A new pair_style command for these styles will wipe out all
previously specified pair_coeff values.
</P>
<HR>
<P>Here is an alphabetic list of pair styles defined in LAMMPS. Click on
the style to display the formula it computes, arguments specified in
the pair_style command, and coefficients specified by the associated
<A HREF = "pair_coeff.html">pair_coeff</A> command:
</P>
<UL><LI><A HREF = "pair_none.html">pair_style none</A> - turn off pairwise interactions
<LI><A HREF = "pair_hybrid.html">pair_style hybrid</A> - multiple styles of pairwise interactions
<LI><A HREF = "pair_hybrid.html">pair_style hybrid/overlay</A> - multiple styles of superposed pairwise interactions
</UL>
<UL><LI><A HREF = "pair_adp.html">pair_style adp</A> - angular dependent potential (ADP) of Mishin
<LI><A HREF = "pair_airebo.html">pair_style airebo</A> - AIREBO potential of Stuart
<LI><A HREF = "pair_born.html">pair_style born</A> - Born-Mayer-Huggins potential
-<LI><A HREF = "pair_born.html">pair_style born/coul/long</A> - Born-Mayer-Huggins with long-range Coulomb
+<LI><A HREF = "pair_born.html">pair_style born/coul/long</A> - Born-Mayer-Huggins with long-range Coulombics
+<LI><A HREF = "pair_born.html">pair_style born/coul/wolf</A> - Born-Mayer-Huggins with Coulombics via Wolf potential
<LI><A HREF = "pair_brownian.html">pair_style brownian</A> - Brownian potential for Fast Lubrication Dynamics
<LI><A HREF = "pair_brownian.html">pair_style brownian/poly</A> - Brownian potential for Fast Lubrication Dynamics with polydispersity
<LI><A HREF = "pair_buck.html">pair_style buck</A> - Buckingham potential
<LI><A HREF = "pair_buck.html">pair_style buck/coul/cut</A> - Buckingham with cutoff Coulomb
<LI><A HREF = "pair_buck.html">pair_style buck/coul/long</A> - Buckingham with long-range Coulomb
<LI><A HREF = "pair_colloid.html">pair_style colloid</A> - integrated colloidal potential
<LI><A HREF = "pair_comb.html">pair_style comb</A> - charge-optimized many-body (COMB) potential
<LI><A HREF = "pair_coul.html">pair_style coul/cut</A> - cutoff Coulombic potential
<LI><A HREF = "pair_coul.html">pair_style coul/debye</A> - cutoff Coulombic potential with Debye screening
<LI><A HREF = "pair_coul.html">pair_style coul/long</A> - long-range Coulombic potential
+<LI><A HREF = "pair_coul.html">pair_style coul/wolf</A> - Coulombics via Wolf potential
<LI><A HREF = "pair_dipole.html">pair_style dipole/cut</A> - point dipoles with cutoff
<LI><A HREF = "pair_dpd.html">pair_style dpd</A> - dissipative particle dynamics (DPD)
<LI><A HREF = "pair_dpd.html">pair_style dpd/tstat</A> - DPD thermostatting
<LI><A HREF = "pair_dsmc.html">pair_style dsmc</A> - Direct Simulation Monte Carlo (DSMC)
<LI><A HREF = "pair_eam.html">pair_style eam</A> - embedded atom method (EAM)
<LI><A HREF = "pair_eam.html">pair_style eam/alloy</A> - alloy EAM
<LI><A HREF = "pair_eam.html">pair_style eam/fs</A> - Finnis-Sinclair EAM
<LI><A HREF = "pair_eim.html">pair_style eim</A> - embedded ion method (EIM)
<LI><A HREF = "pair_gauss.html">pair_style gauss</A> - Gaussian potential
<LI><A HREF = "pair_gayberne.html">pair_style gayberne</A> - Gay-Berne ellipsoidal potential
<LI><A HREF = "pair_gran.html">pair_style gran/hertz/history</A> - granular potential with Hertzian interactions
<LI><A HREF = "pair_gran.html">pair_style gran/hooke</A> - granular potential with history effects
<LI><A HREF = "pair_gran.html">pair_style gran/hooke/history</A> - granular potential without history effects
<LI><A HREF = "pair_hbond_dreiding.html">pair_style hbond/dreiding/lj</A> - DREIDING hydrogen bonding LJ potential
<LI><A HREF = "pair_hbond_dreiding.html">pair_style hbond/dreiding/morse</A> - DREIDING hydrogen bonding Morse potential
<LI><A HREF = "pair_line_lj.html">pair_style line/lj</A> - LJ potential between line segments
<LI><A HREF = "pair_charmm.html">pair_style lj/charmm/coul/charmm</A> - CHARMM potential with cutoff Coulomb
<LI><A HREF = "pair_charmm.html">pair_style lj/charmm/coul/charmm/implicit</A> - CHARMM for implicit solvent
<LI><A HREF = "pair_charmm.html">pair_style lj/charmm/coul/long</A> - CHARMM with long-range Coulomb
<LI><A HREF = "pair_class2.html">pair_style lj/class2</A> - COMPASS (class 2) force field with no Coulomb
<LI><A HREF = "pair_class2.html">pair_style lj/class2/coul/cut</A> - COMPASS with cutoff Coulomb
<LI><A HREF = "pair_class2.html">pair_style lj/class2/coul/long</A> - COMPASS with long-range Coulomb
<LI><A HREF = "pair_lj.html">pair_style lj/cut</A> - cutoff Lennard-Jones potential with no Coulomb
<LI><A HREF = "pair_lj.html">pair_style lj/cut/coul/cut</A> - LJ with cutoff Coulomb
<LI><A HREF = "pair_lj.html">pair_style lj/cut/coul/debye</A> - LJ with Debye screening added to Coulomb
<LI><A HREF = "pair_lj.html">pair_style lj/cut/coul/long</A> - LJ with long-range Coulomb
<LI><A HREF = "pair_lj.html">pair_style lj/cut/coul/long/tip4p</A> - LJ with long-range Coulomb for TIP4P water
<LI><A HREF = "pair_lj_expand.html">pair_style lj/expand</A> - Lennard-Jones for variable size particles
<LI><A HREF = "pair_gromacs.html">pair_style lj/gromacs</A> - GROMACS-style Lennard-Jones potential
<LI><A HREF = "pair_gromacs.html">pair_style lj/gromacs/coul/gromacs</A> - GROMACS-style LJ and Coulombic potential
<LI><A HREF = "pair_lj_smooth.html">pair_style lj/smooth</A> - smoothed Lennard-Jones potential
<LI><A HREF = "pair_lj96.html">pair_style lj96/cut</A> - Lennard-Jones 9/6 potential
<LI><A HREF = "pair_lubricate.html">pair_style lubricate</A> - hydrodynamic lubrication forces
<LI><A HREF = "pair_lubricate.html">pair_style lubricate/poly</A> - hydrodynamic lubrication forces with polydispersity
<LI><A HREF = "pair_lubricateU.html">pair_style lubricateU</A> - hydrodynamic lubrication forces for Fast Lubrication Dynamics
<LI><A HREF = "pair_lubricateU.html">pair_style lubricateU/poly</A> - hydrodynamic lubrication forces for Fast Lubrication with polydispersity
<LI><A HREF = "pair_meam.html">pair_style meam</A> - modified embedded atom method (MEAM)
<LI><A HREF = "pair_morse.html">pair_style morse</A> - Morse potential
<LI><A HREF = "pair_peri.html">pair_style peri/lps</A> - peridynamic LPS potential
<LI><A HREF = "pair_peri.html">pair_style peri/pmb</A> - peridynamic PMB potential
<LI><A HREF = "pair_reax.html">pair_style reax</A> - ReaxFF potential
<LI><A HREF = "pair_airebo.html">pair_style rebo</A> - 2nd generation REBO potential of Brenner
<LI><A HREF = "pair_resquared.html">pair_style resquared</A> - Everaers RE-Squared ellipsoidal potential
<LI><A HREF = "pair_soft.html">pair_style soft</A> - Soft (cosine) potential
<LI><A HREF = "pair_sw.html">pair_style sw</A> - Stillinger-Weber 3-body potential
<LI><A HREF = "pair_table.html">pair_style table</A> - tabulated pair potential
<LI><A HREF = "pair_tersoff.html">pair_style tersoff</A> - Tersoff 3-body potential
<LI><A HREF = "pair_tersoff_zbl.html">pair_style tersoff/zbl</A> - Tersoff/ZBL 3-body potential
<LI><A HREF = "pair_tri_lj.html">pair_style tri/lj</A> - LJ potential between triangles
<LI><A HREF = "pair_yukawa.html">pair_style yukawa</A> - Yukawa potential
<LI><A HREF = "pair_yukawa_colloid.html">pair_style yukawa/colloid</A> - screened Yukawa potential for finite-size particles
</UL>
<P>There are also additional pair styles submitted by users which are
included in the LAMMPS distribution. The list of these with links to
the individual styles are given in the pair section of <A HREF = "Section_commands.html#cmd_5">this
page</A>.
</P>
<P>There are also additional accelerated pair styles included in the
LAMMPS distribution for faster performance on CPUs and GPUs. The list
of these with links to the individual styles are given in the pair
section of <A HREF = "Section_commands.html#cmd_5">this page</A>.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This command must be used before any coefficients are set by the
<A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "read_data.html">read_data</A>, or
<A HREF = "read_restart.html">read_restart</A> commands.
</P>
<P>Some pair styles are part of specific packages. They are only enabled
if LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info on packages.
The doc pages for individual pair potentials tell if it is part of a
package.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "read_data.html">read_data</A>,
<A HREF = "pair_modify.html">pair_modify</A>, <A HREF = "kspace_style.html">kspace_style</A>,
<A HREF = "dielectric.html">dielectric</A>, <A HREF = "pair_write.html">pair_write</A>
</P>
<P><B>Default:</B>
</P>
<PRE>pair_style none
</PRE>
</HTML>
diff --git a/doc/pair_style.txt b/doc/pair_style.txt
index c7489246b..6535e69e2 100644
--- a/doc/pair_style.txt
+++ b/doc/pair_style.txt
@@ -1,187 +1,189 @@
"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 command :h3
[Syntax:]
pair_style style args :pre
style = one of the styles from the list below
args = arguments used by a particular style :ul
[Examples:]
pair_style lj/cut 2.5
pair_style eam/alloy
pair_style hybrid lj/charmm/coul/long 10.0 eam
pair_style table linear 1000
pair_style none :pre
[Description:]
Set the formula(s) LAMMPS uses to compute pairwise interactions. In
LAMMPS, pair potentials are defined between pairs of atoms that are
within a cutoff distance and the set of active interactions typically
changes over time. See the "bond_style"_bond_style.html command to
define potentials between pairs of bonded atoms, which typically
remain in place for the duration of a simulation.
In LAMMPS, pairwise force fields encompass a variety of interactions,
some of which include many-body effects, e.g. EAM, Stillinger-Weber,
Tersoff, REBO potentials. They are still classified as "pairwise"
potentials because the set of interacting atoms changes with time
(unlike molecular bonds) and thus a neighbor list is used to find
nearby interacting atoms.
Hybrid models where specified pairs of atom types interact via
different pair potentials can be setup using the {hybrid} pair style.
The coefficients associated with a pair style are typically set for
each pair of atom types, and are specified by the
"pair_coeff"_pair_coeff.html command or read from a file by the
"read_data"_read_data.html or "read_restart"_read_restart.html
commands.
The "pair_modify"_pair_modify.html command sets options for mixing of
type I-J interaction coefficients and adding energy offsets or tail
corrections to Lennard-Jones potentials. Details on these options as
they pertain to individual potentials are described on the doc page
for the potential. Likewise, info on whether the potential
information is stored in a "restart file"_write_restart.html is listed
on the potential doc page.
In the formulas listed for each pair style, {E} is the energy of a
pairwise interaction between two atoms separated by a distance {r}.
The force between the atoms is the negative derivative of this
expression.
If the pair_style command has a cutoff argument, it sets global
cutoffs for all pairs of atom types. The distance(s) can be smaller
or larger than the dimensions of the simulation box.
Typically, the global cutoff value can be overridden for a specific
pair of atom types by the "pair_coeff"_pair_coeff.html command. The
pair style settings (including global cutoffs) can be changed by a
subsequent pair_style command using the same style. This will reset
the cutoffs for all atom type pairs, including those previously set
explicitly by a "pair_coeff"_pair_coeff.html command. The exceptions
to this are that pair_style {table} and {hybrid} settings cannot be
reset. A new pair_style command for these styles will wipe out all
previously specified pair_coeff values.
:line
Here is an alphabetic list of pair styles defined in LAMMPS. Click on
the style to display the formula it computes, arguments specified in
the pair_style command, and coefficients specified by the associated
"pair_coeff"_pair_coeff.html command:
"pair_style none"_pair_none.html - turn off pairwise interactions
"pair_style hybrid"_pair_hybrid.html - multiple styles of pairwise interactions
"pair_style hybrid/overlay"_pair_hybrid.html - multiple styles of superposed pairwise interactions :ul
"pair_style adp"_pair_adp.html - angular dependent potential (ADP) of Mishin
"pair_style airebo"_pair_airebo.html - AIREBO potential of Stuart
"pair_style born"_pair_born.html - Born-Mayer-Huggins potential
-"pair_style born/coul/long"_pair_born.html - Born-Mayer-Huggins with long-range Coulomb
+"pair_style born/coul/long"_pair_born.html - Born-Mayer-Huggins with long-range Coulombics
+"pair_style born/coul/wolf"_pair_born.html - Born-Mayer-Huggins with Coulombics via Wolf potential
"pair_style brownian"_pair_brownian.html - Brownian potential for Fast Lubrication Dynamics
"pair_style brownian/poly"_pair_brownian.html - Brownian potential for Fast Lubrication Dynamics with polydispersity
"pair_style buck"_pair_buck.html - Buckingham potential
"pair_style buck/coul/cut"_pair_buck.html - Buckingham with cutoff Coulomb
"pair_style buck/coul/long"_pair_buck.html - Buckingham with long-range Coulomb
"pair_style colloid"_pair_colloid.html - integrated colloidal potential
"pair_style comb"_pair_comb.html - charge-optimized many-body (COMB) potential
"pair_style coul/cut"_pair_coul.html - cutoff Coulombic potential
"pair_style coul/debye"_pair_coul.html - cutoff Coulombic potential with Debye screening
"pair_style coul/long"_pair_coul.html - long-range Coulombic potential
+"pair_style coul/wolf"_pair_coul.html - Coulombics via Wolf potential
"pair_style dipole/cut"_pair_dipole.html - point dipoles with cutoff
"pair_style dpd"_pair_dpd.html - dissipative particle dynamics (DPD)
"pair_style dpd/tstat"_pair_dpd.html - DPD thermostatting
"pair_style dsmc"_pair_dsmc.html - Direct Simulation Monte Carlo (DSMC)
"pair_style eam"_pair_eam.html - embedded atom method (EAM)
"pair_style eam/alloy"_pair_eam.html - alloy EAM
"pair_style eam/fs"_pair_eam.html - Finnis-Sinclair EAM
"pair_style eim"_pair_eim.html - embedded ion method (EIM)
"pair_style gauss"_pair_gauss.html - Gaussian potential
"pair_style gayberne"_pair_gayberne.html - Gay-Berne ellipsoidal potential
"pair_style gran/hertz/history"_pair_gran.html - granular potential with Hertzian interactions
"pair_style gran/hooke"_pair_gran.html - granular potential with history effects
"pair_style gran/hooke/history"_pair_gran.html - granular potential without history effects
"pair_style hbond/dreiding/lj"_pair_hbond_dreiding.html - DREIDING hydrogen bonding LJ potential
"pair_style hbond/dreiding/morse"_pair_hbond_dreiding.html - DREIDING hydrogen bonding Morse potential
"pair_style line/lj"_pair_line_lj.html - LJ potential between line segments
"pair_style lj/charmm/coul/charmm"_pair_charmm.html - CHARMM potential with cutoff Coulomb
"pair_style lj/charmm/coul/charmm/implicit"_pair_charmm.html - CHARMM for implicit solvent
"pair_style lj/charmm/coul/long"_pair_charmm.html - CHARMM with long-range Coulomb
"pair_style lj/class2"_pair_class2.html - COMPASS (class 2) force field with no Coulomb
"pair_style lj/class2/coul/cut"_pair_class2.html - COMPASS with cutoff Coulomb
"pair_style lj/class2/coul/long"_pair_class2.html - COMPASS with long-range Coulomb
"pair_style lj/cut"_pair_lj.html - cutoff Lennard-Jones potential with no Coulomb
"pair_style lj/cut/coul/cut"_pair_lj.html - LJ with cutoff Coulomb
"pair_style lj/cut/coul/debye"_pair_lj.html - LJ with Debye screening added to Coulomb
"pair_style lj/cut/coul/long"_pair_lj.html - LJ with long-range Coulomb
"pair_style lj/cut/coul/long/tip4p"_pair_lj.html - LJ with long-range Coulomb for TIP4P water
"pair_style lj/expand"_pair_lj_expand.html - Lennard-Jones for variable size particles
"pair_style lj/gromacs"_pair_gromacs.html - GROMACS-style Lennard-Jones potential
"pair_style lj/gromacs/coul/gromacs"_pair_gromacs.html - GROMACS-style LJ and Coulombic potential
"pair_style lj/smooth"_pair_lj_smooth.html - smoothed Lennard-Jones potential
"pair_style lj96/cut"_pair_lj96.html - Lennard-Jones 9/6 potential
"pair_style lubricate"_pair_lubricate.html - hydrodynamic lubrication forces
"pair_style lubricate/poly"_pair_lubricate.html - hydrodynamic lubrication forces with polydispersity
"pair_style lubricateU"_pair_lubricateU.html - hydrodynamic lubrication forces for Fast Lubrication Dynamics
"pair_style lubricateU/poly"_pair_lubricateU.html - hydrodynamic lubrication forces for Fast Lubrication with polydispersity
"pair_style meam"_pair_meam.html - modified embedded atom method (MEAM)
"pair_style morse"_pair_morse.html - Morse potential
"pair_style peri/lps"_pair_peri.html - peridynamic LPS potential
"pair_style peri/pmb"_pair_peri.html - peridynamic PMB potential
"pair_style reax"_pair_reax.html - ReaxFF potential
"pair_style rebo"_pair_airebo.html - 2nd generation REBO potential of Brenner
"pair_style resquared"_pair_resquared.html - Everaers RE-Squared ellipsoidal potential
"pair_style soft"_pair_soft.html - Soft (cosine) potential
"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_zbl.html - Tersoff/ZBL 3-body potential
"pair_style tri/lj"_pair_tri_lj.html - LJ potential between triangles
"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
the individual styles are given in the pair section of "this
page"_Section_commands.html#cmd_5.
There are also additional accelerated pair styles included in the
LAMMPS distribution for faster performance on CPUs and GPUs. The list
of these with links to the individual styles are given in the pair
section of "this page"_Section_commands.html#cmd_5.
:line
[Restrictions:]
This command must be used before any coefficients are set by the
"pair_coeff"_pair_coeff.html, "read_data"_read_data.html, or
"read_restart"_read_restart.html commands.
Some pair styles are part of specific packages. They are only enabled
if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
The doc pages for individual pair potentials tell if it is part of a
package.
[Related commands:]
"pair_coeff"_pair_coeff.html, "read_data"_read_data.html,
"pair_modify"_pair_modify.html, "kspace_style"_kspace_style.html,
"dielectric"_dielectric.html, "pair_write"_pair_write.html
[Default:]
pair_style none :pre
diff --git a/doc/pair_sw.html b/doc/pair_sw.html
index 6ea6f9127..67165ac0b 100644
--- a/doc/pair_sw.html
+++ b/doc/pair_sw.html
@@ -1,213 +1,213 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style sw command
</H3>
<H3>pair_style sw/cuda command
</H3>
<H3>pair_style sw/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style sw
</PRE>
<P><B>Examples:</B>
</P>
<PRE>pair_style sw
pair_coeff * * si.sw Si
pair_coeff * * GaN.sw Ga N Ga
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>sw</I> style computes a 3-body <A HREF = "#Stillinger">Stillinger-Weber</A>
potential for the energy E of a system of atoms as
</P>
<CENTER><IMG SRC = "Eqs/pair_sw.jpg">
</CENTER>
<P>where phi2 is a two-body term and phi3 is a three-body term. The
summations in the formula are over all neighbors J and K of atom I
within a cutoff distance = a*sigma.
</P>
<P>Only a single pair_coeff command is used with the <I>sw</I> style which
specifies a Stillinger-Weber potential file with parameters for all
needed elements. These are mapped to LAMMPS atom types by specifying
N additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
</P>
<UL><LI>filename
<LI>N element names = mapping of SW elements to atom types
</UL>
<P>As an example, imagine a file SiC.sw has Stillinger-Weber values for
Si and C. If your LAMMPS simulation has 4 atoms types and you want
the 1st 3 to be Si, and the 4th to be C, you would use the following
pair_coeff command:
</P>
<PRE>pair_coeff * * SiC.sw Si Si Si C
</PRE>
<P>The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three Si arguments map LAMMPS atom types 1,2,3 to the Si
element in the SW file. The final C argument maps LAMMPS atom type 4
to the C element in the SW file. If a mapping value is specified as
NULL, the mapping is not performed. This can be used when a <I>sw</I>
potential is used as part of the <I>hybrid</I> pair style. The NULL values
are placeholders for atom types that will be used with other
potentials.
</P>
<P>Stillinger-Weber files in the <I>potentials</I> directory of the LAMMPS
distribution have a ".sw" suffix. Lines that are not blank or
comments (starting with #) define parameters for a triplet of
elements. The parameters in a single entry correspond to the two-body
and three-body coefficients in the formula above:
</P>
<UL><LI>element 1 (the center atom in a 3-body interaction)
<LI>element 2
<LI>element 3
<LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>a
<LI>lambda
<LI>gamma
<LI>costheta0
<LI>A
<LI>B
<LI>p
<LI>q
<LI>tol
</UL>
<P>The A, B, p, and q parameters are used only for two-body
interactions. The lambda and costheta0 parameters are used only for
three-body interactions. The epsilon, sigma and a parameters are used
for both two-body and three-body interactions. gamma is used only in the
three-body interactions, but is defined for pairs of atoms.
The non-annotated parameters are unitless.
</P>
<P>LAMMPS introduces an additional performance-optimization parameter tol
that is used for both two-body and three-body interactions. In the
Stillinger-Weber potential, the interaction energies become negligibly
small at atomic separations substantially less than the theoretical
cutoff distances. LAMMPS therefore defines a virtual cutoff distance
based on a user defined tolerance tol. The use of the virtual cutoff
distance in constructing atom neighbor lists can significantly reduce
the neighbor list sizes and therefore the computational cost. LAMMPS
provides a <I>tol</I> value for each of the three-body entries so that they
can be separately controlled. If tol = 0.0, then the standard
Stillinger-Weber cutoff is used.
</P>
<P>The Stillinger-Weber potential file must contain entries for all the
elements listed in the pair_coeff command. It can also contain
entries for additional elements not being used in a particular
simulation; LAMMPS ignores those entries.
</P>
<P>For a single-element simulation, only a single entry is required
(e.g. SiSiSi). For a two-element simulation, the file must contain 8
entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that
specify SW parameters for all permutations of the two elements
interacting in three-body configurations. Thus for 3 elements, 27
entries would be required, etc.
</P>
<P>As annotated above, the first element in the entry is the center atom
in a three-body interaction. Thus an entry for SiCC means a Si atom
with 2 C atoms as neighbors. The parameter values used for the
two-body interaction come from the entry where the 2nd and 3rd
elements are the same. Thus the two-body parameters for Si
interacting with C, comes from the SiCC entry. The three-body
parameters can in principle be specific to the three elements of the
configuration. In the literature, however, the three-body parameters
are usually defined by simple formulas involving two sets of pair-wise
parameters, corresponding to the ij and ik pairs, where i is the
center atom. The user must ensure that the correct combining rule is
used to calculate the values of the threebody parameters for
alloys. Note also that the function phi3 contains two exponential
screening factors with parameter values from the ij pair and ik
pairs. So phi3 for a C atom bonded to a Si atom and a second C atom
will depend on the three-body parameters for the CSiC entry, and also
on the two-body parameters for the CCC and CSiSi entries. Since the
order of the two neighbors is arbitrary, the threebody parameters for
entries CSiC and CCSi should be the same. Similarly, the two-body
parameters for entries SiCC and CSiSi should also be the same. The
parameters used only for two-body interactions (A, B, p, and q) in
entries whose 2nd and 3rd element are different (e.g. SiCSi) are not
used for anything and can be set to 0.0 if desired.
This is also true for the parameters in phi3 that are
taken from the ij and ik pairs (sigma, a, gamma)
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, mixing is performed by LAMMPS as
described above from values in the potential file.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift, table, and tail options.
</P>
<P>This pair style does not write its information to <A HREF = "restart.html">binary restart
files</A>, since it is stored in potential files. Thus, you
need to re-specify the pair_style and pair_coeff commands in an input
script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package (which it is by default). See
the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section for more info.
</P>
<P>This pair style requires the <A HREF = "newton.html">newton</A> setting to be "on"
for pair interactions.
</P>
<P>The Stillinger-Weber potential files provided with LAMMPS (see the
potentials directory) are parameterized for metal <A HREF = "units.html">units</A>.
You can use the SW potential with any LAMMPS units, but you would need
to create your own SW potential file with coefficients listed in the
appropriate units if your simulation doesn't use "metal" units.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Stillinger"></A>
<P><B>(Stillinger)</B> Stillinger and Weber, Phys Rev B, 31, 5262 (1985).
</P>
</HTML>
diff --git a/doc/pair_sw.txt b/doc/pair_sw.txt
index 6395470c8..b6a8113b7 100644
--- a/doc/pair_sw.txt
+++ b/doc/pair_sw.txt
@@ -1,205 +1,205 @@
"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 sw command :h3
pair_style sw/cuda command :h3
pair_style sw/omp command :h3
[Syntax:]
pair_style sw :pre
[Examples:]
pair_style sw
pair_coeff * * si.sw Si
pair_coeff * * GaN.sw Ga N Ga :pre
[Description:]
The {sw} style computes a 3-body "Stillinger-Weber"_#Stillinger
potential for the energy E of a system of atoms as
:c,image(Eqs/pair_sw.jpg)
where phi2 is a two-body term and phi3 is a three-body term. The
summations in the formula are over all neighbors J and K of atom I
within a cutoff distance = a*sigma.
Only a single pair_coeff command is used with the {sw} style which
specifies a Stillinger-Weber potential file with parameters for all
needed elements. These are mapped to LAMMPS atom types by specifying
N additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
filename
N element names = mapping of SW elements to atom types :ul
As an example, imagine a file SiC.sw has Stillinger-Weber values for
Si and C. If your LAMMPS simulation has 4 atoms types and you want
the 1st 3 to be Si, and the 4th to be C, you would use the following
pair_coeff command:
pair_coeff * * SiC.sw Si Si Si C :pre
The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three Si arguments map LAMMPS atom types 1,2,3 to the Si
element in the SW file. The final C argument maps LAMMPS atom type 4
to the C element in the SW file. If a mapping value is specified as
NULL, the mapping is not performed. This can be used when a {sw}
potential is used as part of the {hybrid} pair style. The NULL values
are placeholders for atom types that will be used with other
potentials.
Stillinger-Weber files in the {potentials} directory of the LAMMPS
distribution have a ".sw" suffix. Lines that are not blank or
comments (starting with #) define parameters for a triplet of
elements. The parameters in a single entry correspond to the two-body
and three-body coefficients in the formula above:
element 1 (the center atom in a 3-body interaction)
element 2
element 3
epsilon (energy units)
sigma (distance units)
a
lambda
gamma
costheta0
A
B
p
q
tol :ul
The A, B, p, and q parameters are used only for two-body
interactions. The lambda and costheta0 parameters are used only for
three-body interactions. The epsilon, sigma and a parameters are used
for both two-body and three-body interactions. gamma is used only in the
three-body interactions, but is defined for pairs of atoms.
The non-annotated parameters are unitless.
LAMMPS introduces an additional performance-optimization parameter tol
that is used for both two-body and three-body interactions. In the
Stillinger-Weber potential, the interaction energies become negligibly
small at atomic separations substantially less than the theoretical
cutoff distances. LAMMPS therefore defines a virtual cutoff distance
based on a user defined tolerance tol. The use of the virtual cutoff
distance in constructing atom neighbor lists can significantly reduce
the neighbor list sizes and therefore the computational cost. LAMMPS
provides a {tol} value for each of the three-body entries so that they
can be separately controlled. If tol = 0.0, then the standard
Stillinger-Weber cutoff is used.
The Stillinger-Weber potential file must contain entries for all the
elements listed in the pair_coeff command. It can also contain
entries for additional elements not being used in a particular
simulation; LAMMPS ignores those entries.
For a single-element simulation, only a single entry is required
(e.g. SiSiSi). For a two-element simulation, the file must contain 8
entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that
specify SW parameters for all permutations of the two elements
interacting in three-body configurations. Thus for 3 elements, 27
entries would be required, etc.
As annotated above, the first element in the entry is the center atom
in a three-body interaction. Thus an entry for SiCC means a Si atom
with 2 C atoms as neighbors. The parameter values used for the
two-body interaction come from the entry where the 2nd and 3rd
elements are the same. Thus the two-body parameters for Si
interacting with C, comes from the SiCC entry. The three-body
parameters can in principle be specific to the three elements of the
configuration. In the literature, however, the three-body parameters
are usually defined by simple formulas involving two sets of pair-wise
parameters, corresponding to the ij and ik pairs, where i is the
center atom. The user must ensure that the correct combining rule is
used to calculate the values of the threebody parameters for
alloys. Note also that the function phi3 contains two exponential
screening factors with parameter values from the ij pair and ik
pairs. So phi3 for a C atom bonded to a Si atom and a second C atom
will depend on the three-body parameters for the CSiC entry, and also
on the two-body parameters for the CCC and CSiSi entries. Since the
order of the two neighbors is arbitrary, the threebody parameters for
entries CSiC and CCSi should be the same. Similarly, the two-body
parameters for entries SiCC and CSiSi should also be the same. The
parameters used only for two-body interactions (A, B, p, and q) in
entries whose 2nd and 3rd element are different (e.g. SiCSi) are not
used for anything and can be set to 0.0 if desired.
This is also true for the parameters in phi3 that are
taken from the ij and ik pairs (sigma, a, gamma)
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, mixing is performed by LAMMPS as
described above from values in the potential file.
This pair style does not support the "pair_modify"_pair_modify.html
shift, table, and tail options.
This pair style does not write its information to "binary restart
files"_restart.html, since it is stored in potential files. Thus, you
need to re-specify the pair_style and pair_coeff commands 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 pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package (which it is by default). See
the "Making LAMMPS"_Section_start.html#start_3 section for more info.
This pair style requires the "newton"_newton.html setting to be "on"
for pair interactions.
The Stillinger-Weber potential files provided with LAMMPS (see the
potentials directory) are parameterized for metal "units"_units.html.
You can use the SW potential with any LAMMPS units, but you would need
to create your own SW potential file with coefficients listed in the
appropriate units if your simulation doesn't use "metal" units.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Stillinger)
[(Stillinger)] Stillinger and Weber, Phys Rev B, 31, 5262 (1985).
diff --git a/doc/pair_table.html b/doc/pair_table.html
index 6b59e441b..23f0f5bd8 100644
--- a/doc/pair_table.html
+++ b/doc/pair_table.html
@@ -1,238 +1,238 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style table command
</H3>
<H3>pair_style table/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style table style N
</PRE>
<UL><LI>style = <I>lookup</I> or <I>linear</I> or <I>spline</I> or <I>bitmap</I> = method of interpolation
<LI>N = use N values in <I>lookup</I>, <I>linear</I>, <I>spline</I> tables
<LI>N = use 2^N values in <I>bitmap</I> tables
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style table linear 1000
pair_style table bitmap 12
pair_coeff * 3 morse.table ENTRY1
pair_coeff * 3 morse.table ENTRY1 7.0
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>table</I> creates interpolation tables of length <I>N</I> from pair
potential and force values listed in a file(s) as a function of
distance. The files are read by the <A HREF = "pair_coeff.html">pair_coeff</A>
command.
</P>
<P>The interpolation tables are created by fitting cubic splines to the
file values and interpolating energy and force values at each of <I>N</I>
distances. During a simulation, these tables are used to interpolate
energy and force values as needed. The interpolation is done in one
of 4 styles: <I>lookup</I>, <I>linear</I>, <I>spline</I>, or <I>bitmap</I>.
</P>
<P>For the <I>lookup</I> style, the distance between 2 atoms is used to find
the nearest table entry, which is the energy or force.
</P>
<P>For the <I>linear</I> style, the pair distance is used to find 2
surrounding table values from which an energy or force is computed by
linear interpolation.
</P>
<P>For the <I>spline</I> style, a cubic spline coefficients are computed and
stored at each of the <I>N</I> values in the table. The pair distance is
used to find the appropriate set of coefficients which are used to
evaluate a cubic polynomial which computes the energy or force.
</P>
<P>For the <I>bitmap</I> style, the N means to create interpolation tables
that are 2^N in length. <The pair distance is used to index into the
table via a fast bit-mapping technique <A HREF = "#Wolff">(Wolff)</A> and a linear
interpolation is performed between adjacent table values.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above.
</P>
<UL><LI>filename
<LI>keyword
<LI>cutoff (distance units)
</UL>
<P>The filename specifies a file containing tabulated energy and force
values. The keyword specifies a section of the file. The cutoff is
an optional coefficient. If not specified, the outer cutoff in the
table itself (see below) will be used to build an interpolation table
that extend to the largest tabulated distance. If specified, only
file values up to the cutoff are used to create the interpolation
table. The format of this file is described below.
</P>
<HR>
<P>Here are some guidelines for using the pair_style table command to
best effect:
</P>
<UL><LI>Vary the number of table points; you may need to use more than you think
to get good resolution.
<LI>Always use the <A HREF = "pair_write.html">pair_write</A> command to produce a plot
of what the final interpolated potential looks like. This can show up
interpolation "features" you may not like.
<LI>Start with the linear style; it's the style least likely to have problems.
<LI>Use <I>N</I> in the pair_style command equal to the "N" in the tabulation
file, and use the "RSQ" or "BITMAP" parameter, so additional interpolation
is not needed. See discussion below.
<LI>Use as large an inner cutoff as possible. This avoids fitting splines
to very steep parts of the potential.
</UL>
<HR>
<P>The format of a tabulated file is as follows (without the
parenthesized comments):
</P>
<PRE># Morse potential for Fe (one or more comment or blank lines)
</PRE>
<PRE>MORSE_FE (keyword is first text on line)
N 500 R 1.0 10.0 (N, R, RSQ, BITMAP, FPRIME parameters)
(blank)
1 1.0 25.5 102.34 (index, r, energy, force)
2 1.02 23.4 98.5
...
500 10.0 0.001 0.003
</PRE>
<P>A section begins with a non-blank line whose 1st character is not a
"#"; blank lines or lines starting with "#" can be used as comments
between sections. The first line begins with a keyword which
identifies the section. The line can contain additional text, but the
initial text must match the argument specified in the pair_coeff
command. The next line lists (in any order) one or more parameters
for the table. Each parameter is a keyword followed by one or more
numeric values.
</P>
<P>The parameter "N" is required and its value is the number of table
entries that follow. Note that this may be different than the <I>N</I>
specified in the <A HREF = "pair_style.html">pair_style table</A> command. Let
Ntable = <I>N</I> in the pair_style command, and Nfile = "N" in the
tabulated file. What LAMMPS does is a preliminary interpolation by
creating splines using the Nfile tabulated values as nodal points. It
uses these to interpolate as needed to generate energy and force
values at Ntable different points. The resulting tables of length
Ntable are then used as described above, when computing energy and
force for individual pair distances. This means that if you want the
interpolation tables of length Ntable to match exactly what is in the
tabulated file (with effectively no preliminary interpolation), you
should set Ntable = Nfile, and use the "RSQ" or "BITMAP" parameter.
</P>
<P>All other parameters are optional. If "R" or "RSQ" or "BITMAP" does
not appear, then the distances in each line of the table are used
as-is to perform spline interpolation. In this case, the table values
can be spaced in <I>r</I> uniformly or however you wish to position table
values in regions of large gradients.
</P>
<P>If used, the parameters "R" or "RSQ" are followed by 2 values <I>rlo</I>
and <I>rhi</I>. If specified, the distance associated with each energy and
force value is computed from these 2 values (at high accuracy), rather
than using the (low-accuracy) value listed in each line of the table.
For "R", distances uniformly spaced between <I>rlo</I> and <I>rhi</I> are
computed; for "RSQ", squared distances uniformly spaced between
<I>rlo*rlo</I> and <I>rhi*rhi</I> are computed.
</P>
<P>If used, the parameter "BITMAP" is also followed by 2 values <I>rlo</I> and
<I>rhi</I>. These values, along with the "N" value determine the ordering
of the N lines that follow and what distance is associated with each.
This ordering is complex, so it is not documented here, since this
file is typically produced by the <A HREF = "pair_write.html">pair_write</A> command
with its <I>bitmap</I> option. When the table is in BITMAP format, the "N"
parameter in the file must be equal to 2^M where M is the value
specified in the pair_style command. Also, a cutoff parameter cannot
be used as an optional 3rd argument in the pair_coeff command; the
entire table extent as specified in the file must be used.
</P>
<P>If used, the parameter "FPRIME" is followed by 2 values <I>fplo</I> and
<I>fphi</I> which are the derivative of the force at the innermost and
outermost distances listed in the table. These values are needed by
the spline construction routines. If not specified by the "FPRIME"
parameter, they are estimated (less accurately) by the first 2 and
last 2 force values in the table. This parameter is not used by
BITMAP tables.
</P>
<P>Following a blank line, the next N lines list the tabulated values.
On each line, the 1st value is the index from 1 to N, the 2nd value is
r (in distance units), the 3rd value is the energy (in energy units),
and the 4th is the force (in force units). The r values must increase
from one line to the next (unless the BITMAP parameter is specified).
</P>
<P>Note that one file can contain many sections, each with a tabulated
potential. LAMMPS reads the file section by section until it finds
one that matches the specified keyword.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>This pair style does not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> shift, table, and tail options are
not relevant for this pair style.
</P>
<P>This pair style writes the settings for the "pair_style table" command
to <A HREF = "restart.html">binary restart files</A>, so a pair_style command does
not need to specified in an input script that reads a restart file.
However, the coefficient information is not stored in the restart
file, since it is tabulated in the potential files. Thus, pair_coeff
commands do need to be specified in the restart input script.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Wolff"></A>
<P><B>(Wolff)</B> Wolff and Rudd, Comp Phys Comm, 120, 200-32 (1999).
</P>
</HTML>
diff --git a/doc/pair_table.txt b/doc/pair_table.txt
index 64bdb31f4..c6916de68 100644
--- a/doc/pair_table.txt
+++ b/doc/pair_table.txt
@@ -1,231 +1,231 @@
"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 table command :h3
pair_style table/omp command :h3
[Syntax:]
pair_style table style N :pre
style = {lookup} or {linear} or {spline} or {bitmap} = method of interpolation
N = use N values in {lookup}, {linear}, {spline} tables
N = use 2^N values in {bitmap} tables :ul
[Examples:]
pair_style table linear 1000
pair_style table bitmap 12
pair_coeff * 3 morse.table ENTRY1
pair_coeff * 3 morse.table ENTRY1 7.0 :pre
[Description:]
Style {table} creates interpolation tables of length {N} from pair
potential and force values listed in a file(s) as a function of
distance. The files are read by the "pair_coeff"_pair_coeff.html
command.
The interpolation tables are created by fitting cubic splines to the
file values and interpolating energy and force values at each of {N}
distances. During a simulation, these tables are used to interpolate
energy and force values as needed. The interpolation is done in one
of 4 styles: {lookup}, {linear}, {spline}, or {bitmap}.
For the {lookup} style, the distance between 2 atoms is used to find
the nearest table entry, which is the energy or force.
For the {linear} style, the pair distance is used to find 2
surrounding table values from which an energy or force is computed by
linear interpolation.
For the {spline} style, a cubic spline coefficients are computed and
stored at each of the {N} values in the table. The pair distance is
used to find the appropriate set of coefficients which are used to
evaluate a cubic polynomial which computes the energy or force.
For the {bitmap} style, the N means to create interpolation tables
that are 2^N in length. <The pair distance is used to index into the
table via a fast bit-mapping technique "(Wolff)"_#Wolff and a linear
interpolation is performed between adjacent table values.
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.
filename
keyword
cutoff (distance units) :ul
The filename specifies a file containing tabulated energy and force
values. The keyword specifies a section of the file. The cutoff is
an optional coefficient. If not specified, the outer cutoff in the
table itself (see below) will be used to build an interpolation table
that extend to the largest tabulated distance. If specified, only
file values up to the cutoff are used to create the interpolation
table. The format of this file is described below.
:line
Here are some guidelines for using the pair_style table command to
best effect:
Vary the number of table points; you may need to use more than you think
to get good resolution. :ulb,l
Always use the "pair_write"_pair_write.html command to produce a plot
of what the final interpolated potential looks like. This can show up
interpolation "features" you may not like. :l
Start with the linear style; it's the style least likely to have problems. :l
Use {N} in the pair_style command equal to the "N" in the tabulation
file, and use the "RSQ" or "BITMAP" parameter, so additional interpolation
is not needed. See discussion below. :l
Use as large an inner cutoff as possible. This avoids fitting splines
to very steep parts of the potential. :l,ule
:line
The format of a tabulated file is as follows (without the
parenthesized comments):
# Morse potential for Fe (one or more comment or blank lines) :pre
MORSE_FE (keyword is first text on line)
N 500 R 1.0 10.0 (N, R, RSQ, BITMAP, FPRIME parameters)
(blank)
1 1.0 25.5 102.34 (index, r, energy, force)
2 1.02 23.4 98.5
...
500 10.0 0.001 0.003 :pre
A section begins with a non-blank line whose 1st character is not a
"#"; blank lines or lines starting with "#" can be used as comments
between sections. The first line begins with a keyword which
identifies the section. The line can contain additional text, but the
initial text must match the argument specified in the pair_coeff
command. The next line lists (in any order) one or more parameters
for the table. Each parameter is a keyword followed by one or more
numeric values.
The parameter "N" is required and its value is the number of table
entries that follow. Note that this may be different than the {N}
specified in the "pair_style table"_pair_style.html command. Let
Ntable = {N} in the pair_style command, and Nfile = "N" in the
tabulated file. What LAMMPS does is a preliminary interpolation by
creating splines using the Nfile tabulated values as nodal points. It
uses these to interpolate as needed to generate energy and force
values at Ntable different points. The resulting tables of length
Ntable are then used as described above, when computing energy and
force for individual pair distances. This means that if you want the
interpolation tables of length Ntable to match exactly what is in the
tabulated file (with effectively no preliminary interpolation), you
should set Ntable = Nfile, and use the "RSQ" or "BITMAP" parameter.
All other parameters are optional. If "R" or "RSQ" or "BITMAP" does
not appear, then the distances in each line of the table are used
as-is to perform spline interpolation. In this case, the table values
can be spaced in {r} uniformly or however you wish to position table
values in regions of large gradients.
If used, the parameters "R" or "RSQ" are followed by 2 values {rlo}
and {rhi}. If specified, the distance associated with each energy and
force value is computed from these 2 values (at high accuracy), rather
than using the (low-accuracy) value listed in each line of the table.
For "R", distances uniformly spaced between {rlo} and {rhi} are
computed; for "RSQ", squared distances uniformly spaced between
{rlo*rlo} and {rhi*rhi} are computed.
If used, the parameter "BITMAP" is also followed by 2 values {rlo} and
{rhi}. These values, along with the "N" value determine the ordering
of the N lines that follow and what distance is associated with each.
This ordering is complex, so it is not documented here, since this
file is typically produced by the "pair_write"_pair_write.html command
with its {bitmap} option. When the table is in BITMAP format, the "N"
parameter in the file must be equal to 2^M where M is the value
specified in the pair_style command. Also, a cutoff parameter cannot
be used as an optional 3rd argument in the pair_coeff command; the
entire table extent as specified in the file must be used.
If used, the parameter "FPRIME" is followed by 2 values {fplo} and
{fphi} which are the derivative of the force at the innermost and
outermost distances listed in the table. These values are needed by
the spline construction routines. If not specified by the "FPRIME"
parameter, they are estimated (less accurately) by the first 2 and
last 2 force values in the table. This parameter is not used by
BITMAP tables.
Following a blank line, the next N lines list the tabulated values.
On each line, the 1st value is the index from 1 to N, the 2nd value is
r (in distance units), the 3rd value is the energy (in energy units),
and the 4th is the force (in force units). The r values must increase
from one line to the next (unless the BITMAP parameter is specified).
Note that one file can contain many sections, each with a tabulated
potential. LAMMPS reads the file section by section until it finds
one that matches the specified keyword.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
This pair style does not support mixing. Thus, coefficients for all
I,J pairs must be specified explicitly.
The "pair_modify"_pair_modify.html shift, table, and tail options are
not relevant for this pair style.
This pair style writes the settings for the "pair_style table" command
to "binary restart files"_restart.html, so a pair_style command does
not need to specified in an input script that reads a restart file.
However, the coefficient information is not stored in the restart
file, since it is tabulated in the potential files. Thus, pair_coeff
commands do need to be specified in the restart input script.
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:] none
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Wolff)
[(Wolff)] Wolff and Rudd, Comp Phys Comm, 120, 200-32 (1999).
diff --git a/doc/pair_tersoff.html b/doc/pair_tersoff.html
index 2faa21534..ef109da04 100644
--- a/doc/pair_tersoff.html
+++ b/doc/pair_tersoff.html
@@ -1,259 +1,259 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style tersoff command
</H3>
<H3>pair_style tersoff/table command
</H3>
<H3>pair_style tersoff/cuda
</H3>
<H3>pair_style tersoff/omp
</H3>
<H3>pair_style tersoff/table/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style style
</PRE>
<P>style = <I>tersoff</I> or <I>tersoff/table</I> or <I>tersoff/cuda</I> or <I>tersoff/omp</I> or <I>tersoff/table/omp</I>
</P>
<P><B>Examples:</B>
</P>
<PRE>pair_style tersoff
pair_coeff * * Si.tersoff Si
pair_coeff * * SiC.tersoff Si C Si
</PRE>
<PRE>pair_style tersoff/table
pair_coeff * * SiCGe.tersoff Si(D)
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>tersoff</I> style computes a 3-body Tersoff potential
<A HREF = "#Tersoff_1">(Tersoff_1)</A> for the energy E of a system of atoms as
</P>
<CENTER><IMG SRC = "Eqs/pair_tersoff_1.jpg">
</CENTER>
<P>where f_R is a two-body term and f_A includes three-body interactions.
The summations in the formula are over all neighbors J and K of atom I
within a cutoff distance = R + D.
</P>
<P>The <I>tersoff/table</I> style uses tabulated forms for the two-body,
environment and angular functions. Linear interpolation is performed
between adjacent table entries. The table length is chosen to be
accurate within 10^-6 with respect to the <I>tersoff</I> style energy.
The <I>tersoff/table</I> should give better performance in terms of speed.
</P>
<P>Only a single pair_coeff command is used with the <I>tersoff</I> style
which specifies a Tersoff potential file with parameters for all
needed elements. These are mapped to LAMMPS atom types by specifying
N additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
</P>
<UL><LI>filename
<LI>N element names = mapping of Tersoff elements to atom types
</UL>
<P>As an example, imagine the SiC.tersoff file has Tersoff values for Si
and C. If your LAMMPS simulation has 4 atoms types and you want the
1st 3 to be Si, and the 4th to be C, you would use the following
pair_coeff command:
</P>
<PRE>pair_coeff * * SiC.tersoff Si Si Si C
</PRE>
<P>The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three Si arguments map LAMMPS atom types 1,2,3 to the Si
element in the Tersoff file. The final C argument maps LAMMPS atom
type 4 to the C element in the Tersoff file. If a mapping value is
specified as NULL, the mapping is not performed. This can be used
when a <I>tersoff</I> potential is used as part of the <I>hybrid</I> pair style.
The NULL values are placeholders for atom types that will be used with
other potentials.
</P>
<P>Tersoff files in the <I>potentials</I> directory of the LAMMPS distribution
have a ".tersoff" suffix. Lines that are not blank or comments
(starting with #) define parameters for a triplet of elements. The
parameters in a single entry correspond to coefficients in the formula
above:
</P>
<UL><LI>element 1 (the center atom in a 3-body interaction)
<LI>element 2 (the atom bonded to the center atom)
<LI>element 3 (the atom influencing the 1-2 bond in a bond-order sense)
<LI>m
<LI>gamma
<LI>lambda3 (1/distance units)
<LI>c
<LI>d
<LI>costheta0 (can be a value < -1 or > 1)
<LI>n
<LI>beta
<LI>lambda2 (1/distance units)
<LI>B (energy units)
<LI>R (distance units)
<LI>D (distance units)
<LI>lambda1 (1/distance units)
<LI>A (energy units)
</UL>
<P>The n, beta, lambda2, B, lambda1, and A parameters are only used for
two-body interactions. The m, gamma, lambda3, c, d, and costheta0
parameters are only used for three-body interactions. The R and D
parameters are used for both two-body and three-body interactions. The
non-annotated parameters are unitless. The value of m must be 3 or 1.
</P>
<P>The Tersoff potential file must contain entries for all the elements
listed in the pair_coeff command. It can also contain entries for
additional elements not being used in a particular simulation; LAMMPS
ignores those entries.
</P>
<P>For a single-element simulation, only a single entry is required
(e.g. SiSiSi). For a two-element simulation, the file must contain 8
entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that
specify Tersoff parameters for all permutations of the two elements
interacting in three-body configurations. Thus for 3 elements, 27
entries would be required, etc.
</P>
<P>As annotated above, the first element in the entry is the center atom
in a three-body interaction and it is bonded to the 2nd atom and the
bond is influenced by the 3rd atom. Thus an entry for SiCC means Si
bonded to a C with another C atom influencing the bond. Thus
three-body parameters for SiCSi and SiSiC entries will not, in
general, be the same. The parameters used for the two-body
interaction come from the entry where the 2nd element is repeated.
Thus the two-body parameters for Si interacting with C, comes from the
SiCC entry.
</P>
<P>The parameters used for a particular
three-body interaction come from the entry with the corresponding
three elements. The parameters used only for two-body interactions
(n, beta, lambda2, B, lambda1, and A) in entries whose 2nd and 3rd
element are different (e.g. SiCSi) are not used for anything and can
be set to 0.0 if desired.
</P>
<P>Note that the twobody parameters in entries such as SiCC and CSiSi
are often the same, due to the common use of symmetric mixing rules,
but this is not always the case. For example, the beta and n parameters in
Tersoff_2 <A HREF = "#Tersoff_2">(Tersoff_2)</A> are not symmetric.
</P>
<P>We chose the above form so as to enable users to define all commonly
used variants of the Tersoff potential. In particular, our form
reduces to the original Tersoff form when m = 3 and gamma = 1, while
it reduces to the form of <A HREF = "#Albe">Albe et al.</A> when beta = 1 and m = 1.
Note that in the current Tersoff implementation in LAMMPS, m must be
specified as either 3 or 1. Tersoff used a slightly different but
equivalent form for alloys, which we will refer to as Tersoff_2
potential <A HREF = "#Tersoff_2">(Tersoff_2)</A>. The <I>tersoff/table</I> style implements
Tersoff_2 parameterization only.
</P>
<P>LAMMPS parameter values for Tersoff_2 can be obtained as follows:
gamma_ijk = omega_ik, lambda3 = 0 and the value of
m has no effect. The parameters for species i and j can be calculated
using the Tersoff_2 mixing rules:
</P>
<CENTER><IMG SRC = "Eqs/pair_tersoff_2.jpg">
</CENTER>
<P>Tersoff_2 parameters R and S must be converted to the LAMMPS
parameters R and D (R is different in both forms), using the following
relations: R=(R'+S')/2 and D=(S'-R')/2, where the primes indicate the
Tersoff_2 parameters.
</P>
<P>In the potentials directory, the file SiCGe.tersoff provides the
LAMMPS parameters for Tersoff's various versions of Si, as well as his
alloy parameters for Si, C, and Ge. This file can be used for pure Si,
(three different versions), pure C, pure Ge, binary SiC, and binary
SiGe. LAMMPS will generate an error if this file is used with any
combination involving C and Ge, since there are no entries for the GeC
interactions (Tersoff did not publish parameters for this
cross-interaction.) Tersoff files are also provided for the SiC alloy
(SiC.tersoff) and the GaN (GaN.tersoff) alloys.
</P>
<P>Many thanks to Rutuparna Narulkar, David Farrell, and Xiaowang Zhou
for helping clarify how Tersoff parameters for alloys have been
defined in various papers.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, mixing is performed by LAMMPS as
described above from values in the potential file.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift, table, and tail options.
</P>
<P>This pair style does not write its information to <A HREF = "restart.html">binary restart
files</A>, since it is stored in potential files. Thus, you
need to re-specify the pair_style and pair_coeff commands in an input
script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package (which it is by default). See
the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section for more info.
</P>
<P>This pair style requires the <A HREF = "newton.html">newton</A> setting to be "on"
for pair interactions.
</P>
<P>The Tersoff potential files provided with LAMMPS (see the potentials
directory) are parameterized for metal <A HREF = "units.html">units</A>. You can
use the Tersoff potential with any LAMMPS units, but you would need to
create your own Tersoff potential file with coefficients listed in the
appropriate units if your simulation doesn't use "metal" units.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Tersoff_1"></A>
<P><B>(Tersoff_1)</B> J. Tersoff, Phys Rev B, 37, 6991 (1988).
</P>
<A NAME = "Albe"></A>
<P><B>(Albe)</B> J. Nord, K. Albe, P. Erhart, and K. Nordlund, J. Phys.:
Condens. Matter, 15, 5649(2003).
</P>
<A NAME = "Tersoff_2"></A>
<P><B>(Tersoff_2)</B> J. Tersoff, Phys Rev B, 39, 5566 (1989); errata (PRB 41, 3248)
</P>
</HTML>
diff --git a/doc/pair_tersoff.txt b/doc/pair_tersoff.txt
index d822ac777..58a88abaa 100644
--- a/doc/pair_tersoff.txt
+++ b/doc/pair_tersoff.txt
@@ -1,247 +1,247 @@
"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 tersoff command :h3
pair_style tersoff/table command :h3
pair_style tersoff/cuda :h3
pair_style tersoff/omp :h3
pair_style tersoff/table/omp command :h3
[Syntax:]
pair_style style :pre
style = {tersoff} or {tersoff/table} or {tersoff/cuda} or {tersoff/omp} or {tersoff/table/omp}
[Examples:]
pair_style tersoff
pair_coeff * * Si.tersoff Si
pair_coeff * * SiC.tersoff Si C Si :pre
pair_style tersoff/table
pair_coeff * * SiCGe.tersoff Si(D) :pre
[Description:]
The {tersoff} style computes a 3-body Tersoff potential
"(Tersoff_1)"_#Tersoff_1 for the energy E of a system of atoms as
:c,image(Eqs/pair_tersoff_1.jpg)
where f_R is a two-body term and f_A includes three-body interactions.
The summations in the formula are over all neighbors J and K of atom I
within a cutoff distance = R + D.
The {tersoff/table} style uses tabulated forms for the two-body,
environment and angular functions. Linear interpolation is performed
between adjacent table entries. The table length is chosen to be
accurate within 10^-6 with respect to the {tersoff} style energy.
The {tersoff/table} should give better performance in terms of speed.
Only a single pair_coeff command is used with the {tersoff} style
which specifies a Tersoff potential file with parameters for all
needed elements. These are mapped to LAMMPS atom types by specifying
N additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
filename
N element names = mapping of Tersoff elements to atom types :ul
As an example, imagine the SiC.tersoff file has Tersoff values for Si
and C. If your LAMMPS simulation has 4 atoms types and you want the
1st 3 to be Si, and the 4th to be C, you would use the following
pair_coeff command:
pair_coeff * * SiC.tersoff Si Si Si C :pre
The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three Si arguments map LAMMPS atom types 1,2,3 to the Si
element in the Tersoff file. The final C argument maps LAMMPS atom
type 4 to the C element in the Tersoff file. If a mapping value is
specified as NULL, the mapping is not performed. This can be used
when a {tersoff} potential is used as part of the {hybrid} pair style.
The NULL values are placeholders for atom types that will be used with
other potentials.
Tersoff files in the {potentials} directory of the LAMMPS distribution
have a ".tersoff" suffix. Lines that are not blank or comments
(starting with #) define parameters for a triplet of elements. The
parameters in a single entry correspond to coefficients in the formula
above:
element 1 (the center atom in a 3-body interaction)
element 2 (the atom bonded to the center atom)
element 3 (the atom influencing the 1-2 bond in a bond-order sense)
m
gamma
lambda3 (1/distance units)
c
d
costheta0 (can be a value < -1 or > 1)
n
beta
lambda2 (1/distance units)
B (energy units)
R (distance units)
D (distance units)
lambda1 (1/distance units)
A (energy units) :ul
The n, beta, lambda2, B, lambda1, and A parameters are only used for
two-body interactions. The m, gamma, lambda3, c, d, and costheta0
parameters are only used for three-body interactions. The R and D
parameters are used for both two-body and three-body interactions. The
non-annotated parameters are unitless. The value of m must be 3 or 1.
The Tersoff potential file must contain entries for all the elements
listed in the pair_coeff command. It can also contain entries for
additional elements not being used in a particular simulation; LAMMPS
ignores those entries.
For a single-element simulation, only a single entry is required
(e.g. SiSiSi). For a two-element simulation, the file must contain 8
entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that
specify Tersoff parameters for all permutations of the two elements
interacting in three-body configurations. Thus for 3 elements, 27
entries would be required, etc.
As annotated above, the first element in the entry is the center atom
in a three-body interaction and it is bonded to the 2nd atom and the
bond is influenced by the 3rd atom. Thus an entry for SiCC means Si
bonded to a C with another C atom influencing the bond. Thus
three-body parameters for SiCSi and SiSiC entries will not, in
general, be the same. The parameters used for the two-body
interaction come from the entry where the 2nd element is repeated.
Thus the two-body parameters for Si interacting with C, comes from the
SiCC entry.
The parameters used for a particular
three-body interaction come from the entry with the corresponding
three elements. The parameters used only for two-body interactions
(n, beta, lambda2, B, lambda1, and A) in entries whose 2nd and 3rd
element are different (e.g. SiCSi) are not used for anything and can
be set to 0.0 if desired.
Note that the twobody parameters in entries such as SiCC and CSiSi
are often the same, due to the common use of symmetric mixing rules,
but this is not always the case. For example, the beta and n parameters in
Tersoff_2 "(Tersoff_2)"_#Tersoff_2 are not symmetric.
We chose the above form so as to enable users to define all commonly
used variants of the Tersoff potential. In particular, our form
reduces to the original Tersoff form when m = 3 and gamma = 1, while
it reduces to the form of "Albe et al."_#Albe when beta = 1 and m = 1.
Note that in the current Tersoff implementation in LAMMPS, m must be
specified as either 3 or 1. Tersoff used a slightly different but
equivalent form for alloys, which we will refer to as Tersoff_2
potential "(Tersoff_2)"_#Tersoff_2. The {tersoff/table} style implements
Tersoff_2 parameterization only.
LAMMPS parameter values for Tersoff_2 can be obtained as follows:
gamma_ijk = omega_ik, lambda3 = 0 and the value of
m has no effect. The parameters for species i and j can be calculated
using the Tersoff_2 mixing rules:
:c,image(Eqs/pair_tersoff_2.jpg)
Tersoff_2 parameters R and S must be converted to the LAMMPS
parameters R and D (R is different in both forms), using the following
relations: R=(R'+S')/2 and D=(S'-R')/2, where the primes indicate the
Tersoff_2 parameters.
In the potentials directory, the file SiCGe.tersoff provides the
LAMMPS parameters for Tersoff's various versions of Si, as well as his
alloy parameters for Si, C, and Ge. This file can be used for pure Si,
(three different versions), pure C, pure Ge, binary SiC, and binary
SiGe. LAMMPS will generate an error if this file is used with any
combination involving C and Ge, since there are no entries for the GeC
interactions (Tersoff did not publish parameters for this
cross-interaction.) Tersoff files are also provided for the SiC alloy
(SiC.tersoff) and the GaN (GaN.tersoff) alloys.
Many thanks to Rutuparna Narulkar, David Farrell, and Xiaowang Zhou
for helping clarify how Tersoff parameters for alloys have been
defined in various papers.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, mixing is performed by LAMMPS as
described above from values in the potential file.
This pair style does not support the "pair_modify"_pair_modify.html
shift, table, and tail options.
This pair style does not write its information to "binary restart
files"_restart.html, since it is stored in potential files. Thus, you
need to re-specify the pair_style and pair_coeff commands 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 pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package (which it is by default). See
the "Making LAMMPS"_Section_start.html#start_3 section for more info.
This pair style requires the "newton"_newton.html setting to be "on"
for pair interactions.
The Tersoff potential files provided with LAMMPS (see the potentials
directory) are parameterized for metal "units"_units.html. You can
use the Tersoff potential with any LAMMPS units, but you would need to
create your own Tersoff potential file with coefficients listed in the
appropriate units if your simulation doesn't use "metal" units.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Tersoff_1)
[(Tersoff_1)] J. Tersoff, Phys Rev B, 37, 6991 (1988).
:link(Albe)
[(Albe)] J. Nord, K. Albe, P. Erhart, and K. Nordlund, J. Phys.:
Condens. Matter, 15, 5649(2003).
:link(Tersoff_2)
[(Tersoff_2)] J. Tersoff, Phys Rev B, 39, 5566 (1989); errata (PRB 41, 3248)
diff --git a/doc/pair_tersoff_zbl.html b/doc/pair_tersoff_zbl.html
index be760ba0d..202601f7a 100644
--- a/doc/pair_tersoff_zbl.html
+++ b/doc/pair_tersoff_zbl.html
@@ -1,267 +1,267 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style tersoff/zbl command
</H3>
<H3>pair_style tersoff/zbl/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style tersoff/zbl
</PRE>
<P><B>Examples:</B>
</P>
<PRE>pair_style tersoff/zbl
pair_coeff * * SiC.tersoff.zbl Si C Si
</PRE>
<P><B>Description:</B>
</P>
<P>The <I>tersoff/zbl</I> style computes a 3-body Tersoff potential
<A HREF = "#Tersoff_1">(Tersoff_1)</A> with a close-separation pairwise modification
based on a Coulomb potential and the Ziegler-Biersack-Littmark
universal screening function <A HREF = "#ZBL">(ZBL)</A>, giving the energy E of a
system of atoms as
</P>
<CENTER><IMG SRC = "Eqs/pair_tersoff_zbl.jpg">
</CENTER>
<P>The f_F term is a fermi-like function used to smoothly connect the ZBL
repulsive potential with the Tersoff potential. There are 2
parameters used to adjust it: A_F and r_C. A_F controls how "sharp"
the transition is between the two, and r_C is essentially the cutoff
for the ZBL potential.
</P>
<P>For the ZBL portion, there are two terms. The first is the Coulomb
repulsive term, with Z1, Z2 as the number of protons in each nucleus,
e as the electron charge (1 for metal and real units) and epsilon0 as
the permittivity of vacuum. The second part is the ZBL universal
screening function, with a0 being the Bohr radius (typically 0.529
Angstroms), and the remainder of the coefficients provided by the
original paper. This screening function should be applicable to most
systems. However, it is only accurate for small separations
(i.e. less than 1 Angstrom).
</P>
<P>For the Tersoff portion, f_R is a two-body term and f_A includes
three-body interactions. The summations in the formula are over all
neighbors J and K of atom I within a cutoff distance = R + D.
</P>
<P>Only a single pair_coeff command is used with the <I>tersoff/zbl</I> style
which specifies a Tersoff/ZBL potential file with parameters for all
needed elements. These are mapped to LAMMPS atom types by specifying
N additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
</P>
<UL><LI>filename
<LI>N element names = mapping of Tersoff/ZBL elements to atom types
</UL>
<P>As an example, imagine the SiC.tersoff.zbl file has Tersoff/ZBL values
for Si and C. If your LAMMPS simulation has 4 atoms types and you
want the 1st 3 to be Si, and the 4th to be C, you would use the
following pair_coeff command:
</P>
<PRE>pair_coeff * * SiC.tersoff Si Si Si C
</PRE>
<P>The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three Si arguments map LAMMPS atom types 1,2,3 to the Si
element in the Tersoff/ZBL file. The final C argument maps LAMMPS
atom type 4 to the C element in the Tersoff/ZBL file. If a mapping
value is specified as NULL, the mapping is not performed. This can be
used when a <I>tersoff/zbl</I> potential is used as part of the <I>hybrid</I>
pair style. The NULL values are placeholders for atom types that will
be used with other potentials.
</P>
<P>Tersoff/ZBL files in the <I>potentials</I> directory of the LAMMPS
distribution have a ".tersoff.zbl" suffix. Lines that are not blank
or comments (starting with #) define parameters for a triplet of
elements. The parameters in a single entry correspond to coefficients
in the formula above:
</P>
<UL><LI>element 1 (the center atom in a 3-body interaction)
<LI>element 2 (the atom bonded to the center atom)
<LI>element 3 (the atom influencing the 1-2 bond in a bond-order sense)
<LI>m
<LI>gamma
<LI>lambda3 (1/distance units)
<LI>c
<LI>d
<LI>costheta0 (can be a value < -1 or > 1)
<LI>n
<LI>beta
<LI>lambda2 (1/distance units)
<LI>B (energy units)
<LI>R (distance units)
<LI>D (distance units)
<LI>lambda1 (1/distance units)
<LI>A (energy units)
<LI>Z_i
<LI>Z_j
<LI>ZBLcut (distance units)
<LI>ZBLexpscale (1/distance units)
</UL>
<P>The n, beta, lambda2, B, lambda1, and A parameters are only used for
two-body interactions. The m, gamma, lambda3, c, d, and costheta0
parameters are only used for three-body interactions. The R and D
parameters are used for both two-body and three-body interactions. The
Z_i,Z_j, ZBLcut, ZBLexpscale parameters are used in the ZBL repulsive
portion of the potential and in the Fermi-like function. The
non-annotated parameters are unitless. The value of m must be 3 or 1.
</P>
<P>The Tersoff/ZBL potential file must contain entries for all the
elements listed in the pair_coeff command. It can also contain
entries for additional elements not being used in a particular
simulation; LAMMPS ignores those entries.
</P>
<P>For a single-element simulation, only a single entry is required
(e.g. SiSiSi). For a two-element simulation, the file must contain 8
entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that
specify Tersoff parameters for all permutations of the two elements
interacting in three-body configurations. Thus for 3 elements, 27
entries would be required, etc.
</P>
<P>As annotated above, the first element in the entry is the center atom
in a three-body interaction and it is bonded to the 2nd atom and the
bond is influenced by the 3rd atom. Thus an entry for SiCC means Si
bonded to a C with another C atom influencing the bond. Thus
three-body parameters for SiCSi and SiSiC entries will not, in
general, be the same. The parameters used for the two-body
interaction come from the entry where the 2nd element is repeated.
Thus the two-body parameters for Si interacting with C, comes from the
SiCC entry. By symmetry, the twobody parameters in the SiCC and CSiSi
entries should thus be the same. The parameters used for a particular
three-body interaction come from the entry with the corresponding
three elements. The parameters used only for two-body interactions
(n, beta, lambda2, B, lambda1, and A) in entries whose 2nd and 3rd
element are different (e.g. SiCSi) are not used for anything and can
be set to 0.0 if desired.
</P>
<P>We chose the above form so as to enable users to define all commonly
used variants of the Tersoff portion of the potential. In particular,
our form reduces to the original Tersoff form when m = 3 and gamma =
1, while it reduces to the form of <A HREF = "#Albe">Albe et al.</A> when beta = 1
and m = 1. Note that in the current Tersoff implementation in LAMMPS,
m must be specified as either 3 or 1. Tersoff used a slightly
different but equivalent form for alloys, which we will refer to as
Tersoff_2 potential <A HREF = "#Tersoff_2">(Tersoff_2)</A>.
</P>
<P>LAMMPS parameter values for Tersoff_2 can be obtained as follows:
gamma = 1, just as for Tersoff_1, but now lambda3 = 0 and the value of
m has no effect. The parameters for species i and j can be calculated
using the Tersoff_2 mixing rules:
</P>
<CENTER><IMG SRC = "Eqs/pair_tersoff_2.jpg">
</CENTER>
<P>Values not shown are determined by the first atom type. Finally, the
Tersoff_2 parameters R and S must be converted to the LAMMPS
parameters R and D (R is different in both forms), using the following
relations: R=(R'+S')/2 and D=(S'-R')/2, where the primes indicate the
Tersoff_2 parameters.
</P>
<P>In the potentials directory, the file SiCGe.tersoff provides the
LAMMPS parameters for Tersoff's various versions of Si, as well as his
alloy parameters for Si, C, and Ge. This file can be used for pure Si,
(three different versions), pure C, pure Ge, binary SiC, and binary
SiGe. LAMMPS will generate an error if this file is used with any
combination involving C and Ge, since there are no entries for the GeC
interactions (Tersoff did not publish parameters for this
cross-interaction.) Tersoff files are also provided for the SiC alloy
(SiC.tersoff) and the GaN (GaN.tersoff) alloys.
</P>
<P>Many thanks to Rutuparna Narulkar, David Farrell, and Xiaowang Zhou
for helping clarify how Tersoff parameters for alloys have been
defined in various papers. Also thanks to Ram Devanathan for
providing the base ZBL implementation.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, mixing is performed by LAMMPS as
described above from values in the potential file.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift, table, and tail options.
</P>
<P>This pair style does not write its information to <A HREF = "restart.html">binary restart
files</A>, since it is stored in potential files. Thus, you
need to re-specify the pair_style and pair_coeff commands in an input
script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package (which it is by default). See
the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section for more info.
</P>
<P>This pair style requires the <A HREF = "newton.html">newton</A> setting to be "on"
for pair interactions.
</P>
<P>The Tersoff/ZBL potential files provided with LAMMPS (see the
potentials directory) are parameterized for metal <A HREF = "units.html">units</A>.
You can use the Tersoff potential with any LAMMPS units, but you would
need to create your own Tersoff potential file with coefficients
listed in the appropriate units if your simulation doesn't use "metal"
units.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Tersoff_1"></A>
<P><B>(Tersoff_1)</B> J. Tersoff, Phys Rev B, 37, 6991 (1988).
</P>
<A NAME = "ZBL"></A>
<P><B>(ZBL)</B> J.F. Ziegler, J.P. Biersack, U. Littmark, 'Stopping and Ranges
of Ions in Matter' Vol 1, 1985, Pergamon Press.
</P>
<A NAME = "Albe"></A>
<P><B>(Albe)</B> J. Nord, K. Albe, P. Erhartand K. Nordlund, J. Phys.:
Condens. Matter, 15, 5649(2003).
</P>
<A NAME = "Tersoff_2"></A>
<P><B>(Tersoff_2)</B> J. Tersoff, Phys Rev B, 39, 5566 (1989)
</P>
</HTML>
diff --git a/doc/pair_tersoff_zbl.txt b/doc/pair_tersoff_zbl.txt
index bf69d712b..53888cd03 100644
--- a/doc/pair_tersoff_zbl.txt
+++ b/doc/pair_tersoff_zbl.txt
@@ -1,257 +1,257 @@
"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 tersoff/zbl command :h3
pair_style tersoff/zbl/omp command :h3
[Syntax:]
pair_style tersoff/zbl :pre
[Examples:]
pair_style tersoff/zbl
pair_coeff * * SiC.tersoff.zbl Si C Si :pre
[Description:]
The {tersoff/zbl} style computes a 3-body Tersoff potential
"(Tersoff_1)"_#Tersoff_1 with a close-separation pairwise modification
based on a Coulomb potential and the Ziegler-Biersack-Littmark
universal screening function "(ZBL)"_#ZBL, giving the energy E of a
system of atoms as
:c,image(Eqs/pair_tersoff_zbl.jpg)
The f_F term is a fermi-like function used to smoothly connect the ZBL
repulsive potential with the Tersoff potential. There are 2
parameters used to adjust it: A_F and r_C. A_F controls how "sharp"
the transition is between the two, and r_C is essentially the cutoff
for the ZBL potential.
For the ZBL portion, there are two terms. The first is the Coulomb
repulsive term, with Z1, Z2 as the number of protons in each nucleus,
e as the electron charge (1 for metal and real units) and epsilon0 as
the permittivity of vacuum. The second part is the ZBL universal
screening function, with a0 being the Bohr radius (typically 0.529
Angstroms), and the remainder of the coefficients provided by the
original paper. This screening function should be applicable to most
systems. However, it is only accurate for small separations
(i.e. less than 1 Angstrom).
For the Tersoff portion, f_R is a two-body term and f_A includes
three-body interactions. The summations in the formula are over all
neighbors J and K of atom I within a cutoff distance = R + D.
Only a single pair_coeff command is used with the {tersoff/zbl} style
which specifies a Tersoff/ZBL potential file with parameters for all
needed elements. These are mapped to LAMMPS atom types by specifying
N additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
filename
N element names = mapping of Tersoff/ZBL elements to atom types :ul
As an example, imagine the SiC.tersoff.zbl file has Tersoff/ZBL values
for Si and C. If your LAMMPS simulation has 4 atoms types and you
want the 1st 3 to be Si, and the 4th to be C, you would use the
following pair_coeff command:
pair_coeff * * SiC.tersoff Si Si Si C :pre
The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three Si arguments map LAMMPS atom types 1,2,3 to the Si
element in the Tersoff/ZBL file. The final C argument maps LAMMPS
atom type 4 to the C element in the Tersoff/ZBL file. If a mapping
value is specified as NULL, the mapping is not performed. This can be
used when a {tersoff/zbl} potential is used as part of the {hybrid}
pair style. The NULL values are placeholders for atom types that will
be used with other potentials.
Tersoff/ZBL files in the {potentials} directory of the LAMMPS
distribution have a ".tersoff.zbl" suffix. Lines that are not blank
or comments (starting with #) define parameters for a triplet of
elements. The parameters in a single entry correspond to coefficients
in the formula above:
element 1 (the center atom in a 3-body interaction)
element 2 (the atom bonded to the center atom)
element 3 (the atom influencing the 1-2 bond in a bond-order sense)
m
gamma
lambda3 (1/distance units)
c
d
costheta0 (can be a value < -1 or > 1)
n
beta
lambda2 (1/distance units)
B (energy units)
R (distance units)
D (distance units)
lambda1 (1/distance units)
A (energy units)
Z_i
Z_j
ZBLcut (distance units)
ZBLexpscale (1/distance units) :ul
The n, beta, lambda2, B, lambda1, and A parameters are only used for
two-body interactions. The m, gamma, lambda3, c, d, and costheta0
parameters are only used for three-body interactions. The R and D
parameters are used for both two-body and three-body interactions. The
Z_i,Z_j, ZBLcut, ZBLexpscale parameters are used in the ZBL repulsive
portion of the potential and in the Fermi-like function. The
non-annotated parameters are unitless. The value of m must be 3 or 1.
The Tersoff/ZBL potential file must contain entries for all the
elements listed in the pair_coeff command. It can also contain
entries for additional elements not being used in a particular
simulation; LAMMPS ignores those entries.
For a single-element simulation, only a single entry is required
(e.g. SiSiSi). For a two-element simulation, the file must contain 8
entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that
specify Tersoff parameters for all permutations of the two elements
interacting in three-body configurations. Thus for 3 elements, 27
entries would be required, etc.
As annotated above, the first element in the entry is the center atom
in a three-body interaction and it is bonded to the 2nd atom and the
bond is influenced by the 3rd atom. Thus an entry for SiCC means Si
bonded to a C with another C atom influencing the bond. Thus
three-body parameters for SiCSi and SiSiC entries will not, in
general, be the same. The parameters used for the two-body
interaction come from the entry where the 2nd element is repeated.
Thus the two-body parameters for Si interacting with C, comes from the
SiCC entry. By symmetry, the twobody parameters in the SiCC and CSiSi
entries should thus be the same. The parameters used for a particular
three-body interaction come from the entry with the corresponding
three elements. The parameters used only for two-body interactions
(n, beta, lambda2, B, lambda1, and A) in entries whose 2nd and 3rd
element are different (e.g. SiCSi) are not used for anything and can
be set to 0.0 if desired.
We chose the above form so as to enable users to define all commonly
used variants of the Tersoff portion of the potential. In particular,
our form reduces to the original Tersoff form when m = 3 and gamma =
1, while it reduces to the form of "Albe et al."_#Albe when beta = 1
and m = 1. Note that in the current Tersoff implementation in LAMMPS,
m must be specified as either 3 or 1. Tersoff used a slightly
different but equivalent form for alloys, which we will refer to as
Tersoff_2 potential "(Tersoff_2)"_#Tersoff_2.
LAMMPS parameter values for Tersoff_2 can be obtained as follows:
gamma = 1, just as for Tersoff_1, but now lambda3 = 0 and the value of
m has no effect. The parameters for species i and j can be calculated
using the Tersoff_2 mixing rules:
:c,image(Eqs/pair_tersoff_2.jpg)
Values not shown are determined by the first atom type. Finally, the
Tersoff_2 parameters R and S must be converted to the LAMMPS
parameters R and D (R is different in both forms), using the following
relations: R=(R'+S')/2 and D=(S'-R')/2, where the primes indicate the
Tersoff_2 parameters.
In the potentials directory, the file SiCGe.tersoff provides the
LAMMPS parameters for Tersoff's various versions of Si, as well as his
alloy parameters for Si, C, and Ge. This file can be used for pure Si,
(three different versions), pure C, pure Ge, binary SiC, and binary
SiGe. LAMMPS will generate an error if this file is used with any
combination involving C and Ge, since there are no entries for the GeC
interactions (Tersoff did not publish parameters for this
cross-interaction.) Tersoff files are also provided for the SiC alloy
(SiC.tersoff) and the GaN (GaN.tersoff) alloys.
Many thanks to Rutuparna Narulkar, David Farrell, and Xiaowang Zhou
for helping clarify how Tersoff parameters for alloys have been
defined in various papers. Also thanks to Ram Devanathan for
providing the base ZBL implementation.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, mixing is performed by LAMMPS as
described above from values in the potential file.
This pair style does not support the "pair_modify"_pair_modify.html
shift, table, and tail options.
This pair style does not write its information to "binary restart
files"_restart.html, since it is stored in potential files. Thus, you
need to re-specify the pair_style and pair_coeff commands 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 pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package (which it is by default). See
the "Making LAMMPS"_Section_start.html#start_3 section for more info.
This pair style requires the "newton"_newton.html setting to be "on"
for pair interactions.
The Tersoff/ZBL potential files provided with LAMMPS (see the
potentials directory) are parameterized for metal "units"_units.html.
You can use the Tersoff potential with any LAMMPS units, but you would
need to create your own Tersoff potential file with coefficients
listed in the appropriate units if your simulation doesn't use "metal"
units.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Tersoff_1)
[(Tersoff_1)] J. Tersoff, Phys Rev B, 37, 6991 (1988).
:link(ZBL)
[(ZBL)] J.F. Ziegler, J.P. Biersack, U. Littmark, 'Stopping and Ranges
of Ions in Matter' Vol 1, 1985, Pergamon Press.
:link(Albe)
[(Albe)] J. Nord, K. Albe, P. Erhartand K. Nordlund, J. Phys.:
Condens. Matter, 15, 5649(2003).
:link(Tersoff_2)
[(Tersoff_2)] J. Tersoff, Phys Rev B, 39, 5566 (1989)
diff --git a/doc/pair_tri_lj.html b/doc/pair_tri_lj.html
index 19a1847ac..cbf14115e 100644
--- a/doc/pair_tri_lj.html
+++ b/doc/pair_tri_lj.html
@@ -1,144 +1,144 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style tri/lj command
</H3>
<H3>pair_style tri/lj/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style tri/lj cutoff
</PRE>
<P>cutoff = global cutoff for interactions (distance units)
</P>
<P><B>Examples:</B>
</P>
<PRE>pair_style tri/lj 3.0
pair_coeff * * 1.0 1.0
pair_coeff 1 1 1.0 1.5 2.5
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>tri/lj</I> treats particles which are triangles as a set of small
spherical particles that tile the triangle surface as explained below.
Interactions between two triangles, each with N1 and N2 spherical
particles, are calculated as the pairwise sum of N1*N2 Lennard-Jones
interactions. Interactions between a triangle with N spherical
particles and a point particle are treated as the pairwise sum of N
Lennard-Jones interactions. See the <A HREF = "pair_lj.html">pair_style lj/cut</A>
doc page for the definition of Lennard-Jones interactions.
</P>
<P>The cutoff distance for an interaction between 2 triangles, or between
a triangle and a point particle, is calculated from the position of
the triangle (its centroid), not between pairs of individual spheres
comprising the triangle. Thus an interaction is either calculated in
its entirety or not at all.
</P>
<P>The set of non-overlapping spherical particles that represent a
triangle, for purposes of this pair style, are generated in the
following manner. Assume the triangle is of type I, and sigma_II has
been specified. We want a set of spheres with centers in the plane of
the triangle, none of them larger in diameter than sigma_II, which
completely cover the triangle's area, but with minimial overlap and a
minimal total number of spheres. This is done in a recursive manner.
Place a sphere at the centroid of the original triangle. Calculate
what diameter it must have to just cover all 3 corner points of the
triangle. If that diameter is equal to or smaller than sigma_II, then
include a sphere of the calculated diameter in the set of covering
spheres. It the diameter is larger than sigma_II, then split the
triangle into 2 triangles by bisecting its longest side. Repeat the
process on each sub-triangle, recursing as far as needed to generate a
set of covering spheres. When finished, the original criteria are
met, and the set of covering spheres shoule be near minimal in number
and overlap, at least for input triangles with a reasonable
aspect-ratio.
</P>
<P>The LJ interaction between 2 spheres on different triangles of types
I,J is computed with an arithmetic mixing of the sigma values of the 2
spheres and using the specified epsilon value for I,J atom types.
Note that because the sigma values for triangles spheres is computed
using only sigma_II values, specific to the triangles's type, this
means that any specified sigma_IJ values (for I != J) are effectively
ignored.
</P>
<P>For style <I>tri/lj</I>, the following coefficients must be defined for
each pair of atoms types via the <A HREF = "pair_coeff.html">pair_coeff</A> command
as in the examples above, or in the data file or restart files read by
the <A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands:
</P>
<UL><LI>epsilon (energy units)
<LI>sigma (distance units)
<LI>cutoff (distance units)
</UL>
<P>The last coefficient is optional. If not specified, the global cutoff
is used.
</P>
<HR>
<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of this pair style can be mixed. The
default mix value is <I>geometric</I>. See the "pair_modify" command for
details.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
shift, table, and tail options.
</P>
<P>This pair style does not write its information to <A HREF = "restart.html">binary restart
files</A>.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This style is part of the ASPHERE package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#2_3">Making
LAMMPS</A> section for more info.
</P>
<P>Defining particles to be triangles so they participate in tri/tri or
tri/particle interactions requires the use the <A HREF = "atom_style.html">atom_style
tri</A> command.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>, <A HREF = "pair_line_lj.html">pair_style line/lj</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_tri_lj.txt b/doc/pair_tri_lj.txt
index c83401f88..6fb9553bb 100644
--- a/doc/pair_tri_lj.txt
+++ b/doc/pair_tri_lj.txt
@@ -1,138 +1,138 @@
"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 tri/lj command :h3
pair_style tri/lj/omp command :h3
[Syntax:]
pair_style tri/lj cutoff :pre
cutoff = global cutoff for interactions (distance units)
[Examples:]
pair_style tri/lj 3.0
pair_coeff * * 1.0 1.0
pair_coeff 1 1 1.0 1.5 2.5 :pre
[Description:]
Style {tri/lj} treats particles which are triangles as a set of small
spherical particles that tile the triangle surface as explained below.
Interactions between two triangles, each with N1 and N2 spherical
particles, are calculated as the pairwise sum of N1*N2 Lennard-Jones
interactions. Interactions between a triangle with N spherical
particles and a point particle are treated as the pairwise sum of N
Lennard-Jones interactions. See the "pair_style lj/cut"_pair_lj.html
doc page for the definition of Lennard-Jones interactions.
The cutoff distance for an interaction between 2 triangles, or between
a triangle and a point particle, is calculated from the position of
the triangle (its centroid), not between pairs of individual spheres
comprising the triangle. Thus an interaction is either calculated in
its entirety or not at all.
The set of non-overlapping spherical particles that represent a
triangle, for purposes of this pair style, are generated in the
following manner. Assume the triangle is of type I, and sigma_II has
been specified. We want a set of spheres with centers in the plane of
the triangle, none of them larger in diameter than sigma_II, which
completely cover the triangle's area, but with minimial overlap and a
minimal total number of spheres. This is done in a recursive manner.
Place a sphere at the centroid of the original triangle. Calculate
what diameter it must have to just cover all 3 corner points of the
triangle. If that diameter is equal to or smaller than sigma_II, then
include a sphere of the calculated diameter in the set of covering
spheres. It the diameter is larger than sigma_II, then split the
triangle into 2 triangles by bisecting its longest side. Repeat the
process on each sub-triangle, recursing as far as needed to generate a
set of covering spheres. When finished, the original criteria are
met, and the set of covering spheres shoule be near minimal in number
and overlap, at least for input triangles with a reasonable
aspect-ratio.
The LJ interaction between 2 spheres on different triangles of types
I,J is computed with an arithmetic mixing of the sigma values of the 2
spheres and using the specified epsilon value for I,J atom types.
Note that because the sigma values for triangles spheres is computed
using only sigma_II values, specific to the triangles's type, this
means that any specified sigma_IJ values (for I != J) are effectively
ignored.
For style {tri/lj}, 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:
epsilon (energy units)
sigma (distance units)
cutoff (distance units) :ul
The last coefficient is optional. If not specified, the global cutoff
is used.
:line
Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of this pair style can be mixed. The
default mix value is {geometric}. See the "pair_modify" command for
details.
This pair style does not support the "pair_modify"_pair_modify.html
shift, table, and tail options.
This pair style does not write its information to "binary restart
files"_restart.html.
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 ASPHERE 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.
Defining particles to be triangles so they participate in tri/tri or
tri/particle interactions requires the use the "atom_style
tri"_atom_style.html command.
[Related commands:]
"pair_coeff"_pair_coeff.html, "pair_style line/lj"_pair_line_lj.html
[Default:] none
diff --git a/doc/pair_yukawa.html b/doc/pair_yukawa.html
index 51cdc757c..201835362 100644
--- a/doc/pair_yukawa.html
+++ b/doc/pair_yukawa.html
@@ -1,108 +1,108 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style yukawa command
</H3>
<H3>pair_style yukawa/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style yukawa kappa cutoff
</PRE>
<UL><LI>kappa = screening length (inverse distance units)
<LI>cutoff = global cutoff for Yukawa interactions (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style yukawa 2.0 2.5
pair_coeff 1 1 100.0 2.3
pair_coeff * * 100.0
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>yukawa</I> computes pairwise interactions with the formula
</P>
<CENTER><IMG SRC = "Eqs/pair_yukawa.jpg">
</CENTER>
<P>Rc is the cutoff.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>A (energy*distance units)
<LI>cutoff (distance units)
</UL>
<P>The last coefficient is optional. If not specified, the global yukawa
cutoff is used.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>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 <I>geometric</I>. See the
"pair_modify" command for details.
</P>
<P>This pair style supports the <A HREF = "pair_modify.html">pair_modify</A> shift
option for the energy of the pair interaction.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for this pair style.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding long-range tail corrections to energy and
pressure.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_yukawa.txt b/doc/pair_yukawa.txt
index 41b72a83a..a7f6d6eb1 100644
--- a/doc/pair_yukawa.txt
+++ b/doc/pair_yukawa.txt
@@ -1,102 +1,102 @@
"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 command :h3
pair_style yukawa/omp command :h3
[Syntax:]
pair_style yukawa kappa cutoff :pre
kappa = screening length (inverse distance units)
cutoff = global cutoff for Yukawa interactions (distance units) :ul
[Examples:]
pair_style yukawa 2.0 2.5
pair_coeff 1 1 100.0 2.3
pair_coeff * * 100.0 :pre
[Description:]
Style {yukawa} computes pairwise interactions with the formula
:c,image(Eqs/pair_yukawa.jpg)
Rc is the cutoff.
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 last coefficient is optional. If not specified, the global yukawa
cutoff is used.
:line
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
: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:] none
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
diff --git a/doc/pair_yukawa_colloid.html b/doc/pair_yukawa_colloid.html
index fcb543318..b41a2f669 100644
--- a/doc/pair_yukawa_colloid.html
+++ b/doc/pair_yukawa_colloid.html
@@ -1,152 +1,152 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_style yukawa/colloid command
</H3>
<H3>pair_style yukawa/colloid/omp command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_style yukawa/colloid kappa cutoff
</PRE>
<UL><LI>kappa = screening length (inverse distance units)
<LI>cutoff = global cutoff for colloidal Yukawa interactions (distance units)
</UL>
<P><B>Examples:</B>
</P>
<PRE>pair_style yukawa/colloid 2.0 2.5
pair_coeff 1 1 100.0 2.3
pair_coeff * * 100.0
</PRE>
<P><B>Description:</B>
</P>
<P>Style <I>yukawa/colloid</I> computes pairwise interactions with the formula
</P>
<CENTER><IMG SRC = "Eqs/pair_yukawa_colloid.jpg">
</CENTER>
<P>where Ri and Rj are the radii of the two particles and Rc is the
cutoff.
</P>
<P>In contrast to <A HREF = "pair_yukawa.html">pair_style yukawa</A>, this functional
form arises from the Coulombic interaction between two colloid
particles, screened due to the presence of an electrolyte.
<A HREF = "pair_yukawa.html">Pair_style yukawa</A> is a screened Coulombic potential
between two point-charges and uses no such approximation.
</P>
<P>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.
</P>
<P>When used in combination with <A HREF = "pair_colloid.html">pair_style colloid</A>,
the two terms become the so-called DLVO potential, which combines
electrostatic repulsion and van der Waals attraction.
</P>
<P>The following coefficients must be defined for each pair of atoms
types via the <A HREF = "pair_coeff.html">pair_coeff</A> command as in the examples
above, or in the data file or restart files read by the
<A HREF = "read_data.html">read_data</A> or <A HREF = "read_restart.html">read_restart</A>
commands, or by mixing as described below:
</P>
<UL><LI>A (energy/distance units)
<LI>cutoff (distance units)
</UL>
<P>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 <A HREF = "pair_yukawa.html">pair_style yukawa</A>. For low surface
potentials, i.e. less than about 25 mV, A can be written as:
</P>
<PRE>A = 2 * PI * R*eps*eps0 * kappa * psi^2
</PRE>
<P>where
</P>
<UL><LI>R = colloid radius (distance units)
<LI>eps0 = permittivity of free space (charge^2/energy/distance units)
<LI>eps = relative permittivity of fluid medium (dimensionless)
<LI>kappa = inverse screening length (1/distance units)
<LI>psi = surface potential (energy/charge units)
</UL>
<P>The last coefficient is optional. If not specified, the global
yukawa/colloid cutoff is used.
</P>
<HR>
-<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in <A HREF = "Section_accelerate.html">this section</A> of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>omp</I>, or <I>opt</I> suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A> of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_6">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for more
-instructions on how to use the accelerated styles effectively.
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
+more instructions on how to use the accelerated styles effectively.
</P>
<HR>
<P><B>Mixing, shift, table, tail correction, restart, rRESPA info</B>:
</P>
<P>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 <I>geometric</I>. See the
"pair_modify" command for details.
</P>
<P>This pair style supports the <A HREF = "pair_modify.html">pair_modify</A> shift
option for the energy of the pair interaction.
</P>
<P>The <A HREF = "pair_modify.html">pair_modify</A> table option is not relevant
for this pair style.
</P>
<P>This pair style does not support the <A HREF = "pair_modify.html">pair_modify</A>
tail option for adding long-range tail corrections to energy and
pressure.
</P>
<P>This pair style writes its information to <A HREF = "restart.html">binary restart
files</A>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
</P>
<P>This pair style can only be used via the <I>pair</I> keyword of the
<A HREF = "run_style.html">run_style respa</A> command. It does not support the
<I>inner</I>, <I>middle</I>, <I>outer</I> keywords.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This style is part of the COLLOID package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>This pair style requires that atoms be finite-size spheres with a
diameter, as defined by the <A HREF = "atom_style.html">atom_style sphere</A>
command.
</P>
<P>Per-particle polydispersity is not yet supported by this pair style;
per-type polydispersity is allowed. This means all particles of the
same type must have the same diameter. Each type can have a different
diameter.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_coeff.html">pair_coeff</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/pair_yukawa_colloid.txt b/doc/pair_yukawa_colloid.txt
index fc85fe3db..70eb071d5 100644
--- a/doc/pair_yukawa_colloid.txt
+++ b/doc/pair_yukawa_colloid.txt
@@ -1,146 +1,146 @@
"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
pair_style yukawa/colloid/omp 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
-Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
-the same as the corresponding style without the suffix. They have
-been optimized to run faster, depending on your available hardware,
-as discussed in "this section"_Section_accelerate.html of the manual.
-The accelerated styles take the same arguments and should produce the
-same results, except for round-off and precision issues.
+Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
+the same as the corresponding style without the suffix. They have
+been optimized to run faster, depending on your available hardware, as
+discussed in "Section_accelerate"_Section_accelerate.html of the
+manual. The accelerated styles take the same arguments and should
+produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
packages, respectively. They are only enabled if LAMMPS was built with
those packages. See the "Making LAMMPS"_Section_start.html#start_3
section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_6 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
-See "this section"_Section_accelerate.html of the manual for more
-instructions on how to use the accelerated styles effectively.
+See "Section_accelerate"_Section_accelerate.html of the manual for
+more instructions on how to use the accelerated styles effectively.
: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#start_3 section for more info.
This pair style requires that atoms be finite-size spheres with a
diameter, as defined by the "atom_style sphere"_atom_style.html
command.
Per-particle polydispersity is not yet supported by this pair style;
per-type polydispersity is allowed. This means all particles of the
same type must have the same diameter. Each type can have a different
diameter.
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
diff --git a/doc/partition.html b/doc/partition.html
index 6bd24564a..c1c901de9 100644
--- a/doc/partition.html
+++ b/doc/partition.html
@@ -1,78 +1,78 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>partition command
</H3>
<P><B>Syntax:</B>
</P>
-<PRE>partition style Np command ...
+<PRE>partition style N command ...
</PRE>
<UL><LI>style = <I>yes</I> or <I>no</I>
-<LI>Np = partition number (see asterisk form below)
+<LI>N = partition number (see asterisk form below)
<LI>command = any LAMMPS command
</UL>
<P><B>Examples:</B>
</P>
<PRE>partition yes 1 processors 4 10 6
partition no 5 print "Active partition"
partition yes *5 fix all nve
partition yes 6* fix all nvt temp 1.0 1.0 0.1
</PRE>
<P><B>Description:</B>
</P>
<P>This command invokes the specified command on a subset of the
partitions of processors you have defined via the -partition
-command-line switch. See <A HREF = "Section_start.html#start_6">this section</A>
+command-line switch. See <A HREF = "Section_start.html#start_6">Section_start 6</A>
for an explanation of the switch.
</P>
<P>Normally, every input script command in your script is invoked by
every partition. This behavior can be modified by defining world- or
universe-style <A HREF = "variable.html">variables</A> that have different values
for each partition. This mechanism can be used to cause your script
to jump to different input script files on different partitions, if
such a variable is used in a <A HREF = "jump.html">jump</A> command.
</P>
<P>The "partition" command is another mechanism for having as input
script operate differently on different partitions. It is basically a
prefix on any LAMMPS command. The commmand will only be invoked on
-the partition(s) specified by the <I>style</I> and <I>Np</I> arguments.
+the partition(s) specified by the <I>style</I> and <I>N</I> arguments.
</P>
-<P>If the <I>style</I> is <I>yes</I>, the command will be invoked on any
-partition which matches the Np argument. If the <I>style</I> is <I>no</I>
-the command will be invoked on all the partitions which do not
-match the Np argument.
+<P>If the <I>style</I> is <I>yes</I>, the command will be invoked on any partition
+which matches the <I>N</I> argument. If the <I>style</I> is <I>no</I> the command
+will be invoked on all the partitions which do not match the Np
+argument.
</P>
-<P>Partitions are numbered from 1 to N, where N is the number of
+<P>Partitions are numbered from 1 to Np, where Np is the number of
partitions specified by the <A HREF = "Section_start.html#start_6">-partition command-line
switch</A>.
</P>
-<P>Np can be specified in one of two ways. An explicit numeric value can
-be used, as in the 1st example above. Or a wild-card asterisk can be
-used to span a range of partition numbers. This takes the form "*" or
-"*n" or "n*" or "m*n". An asterisk with no numeric values means all
-partitions from 1 to N. A leading asterisk means all partitions from
-1 to n (inclusive). A trailing asterisk means all partitions from n
-to N (inclusive). A middle asterisk means all partitions from m to n
-(inclusive).
+<P><I>N</I> can be specified in one of two ways. An explicit numeric value
+can be used, as in the 1st example above. Or a wild-card asterisk can
+be used to span a range of partition numbers. This takes the form "*"
+or "*n" or "n*" or "m*n". An asterisk with no numeric values means
+all partitions from 1 to Np. A leading asterisk means all partitions
+from 1 to n (inclusive). A trailing asterisk means all partitions
+from n to Np (inclusive). A middle asterisk means all partitions from
+m to n (inclusive).
</P>
<P>This command can be useful for the "run_style verlet/split" command
which imposed requirements on how the <A HREF = "processors.html">processors</A>
command lays out a 3d grid of processors in each of 2 partitions.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B> none
</P>
<P><A HREF = "run_style.html">run_style verlet/split</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/partition.txt b/doc/partition.txt
index 6fb8c54d9..6fe21d6a2 100644
--- a/doc/partition.txt
+++ b/doc/partition.txt
@@ -1,73 +1,73 @@
"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
partition command :h3
[Syntax:]
-partition style Np command ... :pre
+partition style N command ... :pre
style = {yes} or {no}
-Np = partition number (see asterisk form below)
+N = partition number (see asterisk form below)
command = any LAMMPS command :ul
[Examples:]
partition yes 1 processors 4 10 6
partition no 5 print "Active partition"
partition yes *5 fix all nve
partition yes 6* fix all nvt temp 1.0 1.0 0.1 :pre
[Description:]
This command invokes the specified command on a subset of the
partitions of processors you have defined via the -partition
-command-line switch. See "this section"_Section_start.html#start_6
+command-line switch. See "Section_start 6"_Section_start.html#start_6
for an explanation of the switch.
Normally, every input script command in your script is invoked by
every partition. This behavior can be modified by defining world- or
universe-style "variables"_variable.html that have different values
for each partition. This mechanism can be used to cause your script
to jump to different input script files on different partitions, if
such a variable is used in a "jump"_jump.html command.
The "partition" command is another mechanism for having as input
script operate differently on different partitions. It is basically a
prefix on any LAMMPS command. The commmand will only be invoked on
-the partition(s) specified by the {style} and {Np} arguments.
+the partition(s) specified by the {style} and {N} arguments.
-If the {style} is {yes}, the command will be invoked on any
-partition which matches the Np argument. If the {style} is {no}
-the command will be invoked on all the partitions which do not
-match the Np argument.
+If the {style} is {yes}, the command will be invoked on any partition
+which matches the {N} argument. If the {style} is {no} the command
+will be invoked on all the partitions which do not match the Np
+argument.
-Partitions are numbered from 1 to N, where N is the number of
+Partitions are numbered from 1 to Np, where Np is the number of
partitions specified by the "-partition command-line
switch"_Section_start.html#start_6.
-Np can be specified in one of two ways. An explicit numeric value can
-be used, as in the 1st example above. Or a wild-card asterisk can be
-used to span a range of partition numbers. This takes the form "*" or
-"*n" or "n*" or "m*n". An asterisk with no numeric values means all
-partitions from 1 to N. A leading asterisk means all partitions from
-1 to n (inclusive). A trailing asterisk means all partitions from n
-to N (inclusive). A middle asterisk means all partitions from m to n
-(inclusive).
+{N} can be specified in one of two ways. An explicit numeric value
+can be used, as in the 1st example above. Or a wild-card asterisk can
+be used to span a range of partition numbers. This takes the form "*"
+or "*n" or "n*" or "m*n". An asterisk with no numeric values means
+all partitions from 1 to Np. A leading asterisk means all partitions
+from 1 to n (inclusive). A trailing asterisk means all partitions
+from n to Np (inclusive). A middle asterisk means all partitions from
+m to n (inclusive).
This command can be useful for the "run_style verlet/split" command
which imposed requirements on how the "processors"_processors.html
command lays out a 3d grid of processors in each of 2 partitions.
[Restrictions:] none
[Related commands:] none
"run_style verlet/split"_run_style.html
[Default:] none
diff --git a/doc/prd.html b/doc/prd.html
index 270a48c0a..baad8b3df 100644
--- a/doc/prd.html
+++ b/doc/prd.html
@@ -1,314 +1,314 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>prd command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>prd N t_event n_dephase t_dephase t_correlate compute-ID seed keyword value ...
</PRE>
<UL><LI>N = # of timesteps to run (not including dephasing/quenching)
<LI>t_event = timestep interval between event checks
<LI>n_dephase = number of velocity randomizations to perform in each dephase run
<LI>t_dephase = number of timesteps to run dynamics after each velocity randomization during dephase
<LI>t_correlate = number of timesteps within which 2 consecutive events are considered to be correlated
<LI>compute-ID = ID of the compute used for event detection
<LI>random_seed = random # seed (positive integer)
<LI>zero or more keyword/value pairs may be appended
<LI>keyword = <I>min</I> or <I>temp</I> or <I>vel</I>
<PRE> <I>min</I> values = etol ftol maxiter maxeval
etol = stopping tolerance for energy, used in quenching
ftol = stopping tolerance for force, used in quenching
maxiter = max iterations of minimize, used in quenching
maxeval = max number of force/energy evaluations, used in quenching
<I>temp</I> value = Tdephase
Tdephase = target temperature for velocity randomization, used in dephasing
<I>vel</I> values = loop dist
loop = <I>all</I> or <I>local</I> or <I>geom</I>, used in dephasing
dist = <I>uniform</I> or <I>gaussian</I>, used in dephasing
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>prd 5000 100 10 10 100 1 54982
prd 5000 100 10 10 100 1 54982 min 0.1 0.1 100 200
</PRE>
<P><B>Description:</B>
</P>
<P>Run a parallel replica dynamics (PRD) simulation using multiple
replicas of a system. One or more replicas can be used.
</P>
<P>PRD is described in <A HREF = "#Voter">this paper</A> by Art Voter. It is a method
for performing accelerated dynamics that is suitable for
infrequent-event systems that obey first-order kinetics. A good
overview of accelerated dynamics methods for such systems in given in
<A HREF = "#Voter2">this review paper</A> from the same group. To quote from the
paper: "The dynamical evolution is characterized by vibrational
excursions within a potential basin, punctuated by occasional
transitions between basins." The transition probability is
characterized by p(t) = k*exp(-kt) where k is the rate constant.
Running multiple replicas gives an effective enhancement in the
timescale spanned by the multiple simulations, while waiting for an
event to occur.
</P>
<P>Each replica runs on a partition of one or more processors. Processor
partitions are defined at run-time using the -partition command-line
-switch; see <A HREF = "Section_start.html#start_6">this section</A> of the manual.
-Note that if you have MPI installed, you can run a multi-replica
-simulation with more replicas (partitions) than you have physical
-processors, e.g you can run a 10-replica simulation on one or two
-processors. For PRD, this makes little sense, since this offers no
-effective parallel speed-up in searching for infrequent events. See
-<A HREF = "Section_howto.html#howto_5">this section</A> of the manual for further
+switch; see <A HREF = "Section_start.html#start_6">Section_start 6</A> of the
+manual. Note that if you have MPI installed, you can run a
+multi-replica simulation with more replicas (partitions) than you have
+physical processors, e.g you can run a 10-replica simulation on one or
+two processors. For PRD, this makes little sense, since this offers
+no effective parallel speed-up in searching for infrequent events. See
+<A HREF = "Section_howto.html#howto_5">Section_howto 5</A> of the manual for further
discussion.
</P>
<P>When a PRD simulation is performed, it is assumed that each replica is
running the same model, though LAMMPS does not check for this.
I.e. the simulation domain, the number of atoms, the interaction
potentials, etc should be the same for every replica.
</P>
<P>A PRD run has several stages, which are repeated each time an "event"
occurs in one of the replicas, as defined below. The logic for a PRD
run is as follows:
</P>
<PRE>while (time remains):
dephase for n_dephase*t_dephase steps
until (event occurs on some replica):
run dynamics for t_event steps
quench
check for uncorrelated event on any replica
until (no correlated event occurs):
run dynamics for t_correlate steps
quench
check for correlated event on this replica
event replica shares state with all replicas
</PRE>
<P>Before this loop begins, the state of the system on replica 0 is
shared with all replicas, so that all replicas begin from the same
initial state. The first potential energy basin is identified by
quenching (an energy minimization, see below) the initial state and
storing the resulting coordinates for reference.
</P>
<P>In the first stage, dephasing is performed by each replica
independently to eliminate correlations between replicas. This is
done by choosing a random set of velocities, based on the
<I>random_seed</I> that is specified, and running <I>t_dephase</I> timesteps of
dynamics. This is repeated <I>n_dephase</I> times. If the <I>temp</I> keyword
is not specified, the target temperature for velocity randomization
for each replica is the current temperature of that replica.
Otherwise, it is the specified <I>Tdephase</I> temperature. The style of
velocity randomization is controlled using the keyword <I>vel</I> with
arguments that have the same meaning as their counterparts in the
<A HREF = "velocity.html">velocity</A> command.
</P>
<P>In the second stage, each replica runs dynamics continuously, stopping
every <I>t_event</I> steps to check if a transition event has occurred.
This check is performed by quenching the system and comparing the
resulting atom coordinates to the coordinates from the previous basin.
The first time through the PRD loop, the "previous basin" is the set
of quenched coordinates from the initial state of the system.
</P>
<P>A quench is an energy minimization and is performed by whichever
algorithm has been defined by the <A HREF = "min_style.html">min_style</A> command.
Minimization parameters may be set via the
<A HREF = "min_modify.html">min_modify</A> command and by the <I>min</I> keyword of the
PRD command. The latter are the settings that would be used with the
<A HREF = "minimize.html">minimize</A> command. Note that typically, you do not
need to perform a highly-converged minimization to detect a transition
event.
</P>
<P>The event check is performed by a compute with the specified
<I>compute-ID</I>. Currently there is only one compute that works with the
PRD commmand, which is the <A HREF = "compute_event_displace.html">compute
event/displace</A> command. Other
event-checking computes may be added. <A HREF = "compute_event_displace.html">Compute
event/displace</A> checks whether any atom in
the compute group has moved further than a specified threshold
distance. If so, an "event" has occurred.
</P>
<P>In the third stage, the replica on which the event occurred (event
replica) continues to run dynamics to search for correlated events.
This is done by running dynamics for <I>t_correlate</I> steps, quenching
every <I>t_event</I> steps, and checking if another event has occurred.
The first time no correlated event occurs, the final state of the
event replica is shared with all replicas, the new basin reference
coordinates are updated with the quenched state, and the outer loop
begins again. While the replica event is searching for correlated
events, all the other replicas also run dynamics and event checking
with the same schedule, but the final states are always overwritten by
the state of the event replica.
</P>
<HR>
<P>Four kinds of output can be generated during a PRD run: event
statistics, thermodynamic output by each replica, dump files, and
restart files.
</P>
<P>When running with multiple partitions (each of which is a replica in
this case), the print-out to the screen and master log.lammps file is
limited to event statistics. Note that if a PRD run is performed on
only a single replica then the event statistics will be intermixed
with the usual thermodynamic output discussed below.
</P>
<P>The quantities printed each time an event occurs are the timestep,
CPU time, clock, event number, a correlation flag,
the number of coincident events, and the replica number of the chosen event.
</P>
<P>The timestep is the usual LAMMPS timestep, except that time does not
advance during dephasing or quenches, but only during dynamics. Note
that are two kinds of dynamics in the PRD loop listed above. The
first is when all replicas are performing independent dynamics. The
second is when correlated events are being searched for and only one
replica is running dynamics.
</P>
<P>The CPU time is the total processor time since the start of the PRD
run.
</P>
<P>The clock is the same as the timestep except that it advances by M
steps every timestep during the first kind of dynamics when the M
replicas are running independently. The clock represents the real
time that effectively elapses during a PRD simulation of <I>N</I> steps on
M replicas. If most of the PRD run is spent in the second stage of
the loop above, searching for infrequent events, then the clock will
advance nearly N*M steps. Note the clock time between events will be
drawn from p(t).
</P>
<P>The event number is a counter that increments with each event, whether
it is uncorrelated or correlated.
</P>
<P>The correlation flag will be 0 when an uncorrelated event occurs
during the second stage of the loop listed above, i.e. when all
replicas are running independently. The correlation flag will be 1
when a correlated event occurs during the third stage of the loop
listed above, i.e. when only one replica is running dynamics.
</P>
<P>When more than one replica detects an event at the end of the second
stage, then one of them is chosen at random. The number of coincident
events is the number of replicas that detected an event. Normally, we
expect this value to be 1. If it is often greater than 1, then either
the number of replicas is too large, or <I>t_event</I> is too large.
</P>
<P>The replica number is the ID of the replica (from 0 to M-1) that
found the event.
</P>
<HR>
<P>When running on multiple partitions, LAMMPS produces additional log
files for each partition, e.g. log.lammps.0, log.lammps.1, etc. For
the PRD command, these contain the thermodynamic output for each
replica. You will see short runs and minimizations corresponding to
the dynamics and quench operations of the loop listed above. The
timestep will be reset aprpopriately depending on whether the
operation advances time or not.
</P>
<P>After the PRD command completes, timing statistics for the PRD run are
printed in each replica's log file, giving a breakdown of how much CPU
time was spent in each stage (dephasing, dynamics, quenching, etc).
</P>
<HR>
<P>Any <A HREF = "dump.html">dump files</A> defined in the input script, will be
written to during a PRD run at timesteps corresponding to both
uncorrelated and correlated events. This means the the requested dump
frequency in the <A HREF = "dump.html">dump</A> command is ignored. There will be
one dump file (per dump command) created for all partitions.
</P>
<P>The atom coordinates of the dump snapshot are those of the minimum
energy configuration resulting from quenching following a transition
event. The timesteps written into the dump files correspond to the
timestep at which the event occurred and NOT the clock. A dump
snapshot corresponding to the initial minimum state used for event
detection is written to the dump file at the beginning of each PRD
run.
</P>
<HR>
<P>If the <A HREF = "restart.html">restart</A> command is used, a single restart file
for all the partitions is generated, which allows a PRD run to be
continued by a new input script in the usual manner.
</P>
<P>The restart file is generated at the end of the loop listed above. If
no correlated events are found, this means it contains a snapshot of
the system at time T + <I>t_correlate</I>, where T is the time at which the
uncorrelated event occurred. If correlated events were found, then it
contains a snapshot of the system at time T + <I>t_correlate</I>, where T
is the time of the last correlated event.
</P>
<P>The restart frequency specified in the <A HREF = "restart.html">restart</A> command
is interpreted differently when performing a PRD run. It does not
mean the timestep interval between restart files. Instead it means an
event interval for uncorrelated events. Thus a frequency of 1 means
write a restart file every time an uncorrelated event occurs. A
frequency of 10 means write a restart file every 10th uncorrelated
event.
</P>
<P>When an input script reads a restart file from a previous PRD run, the
new script can be run on a different number of replicas or processors.
However, it is assumed that <I>t_correlate</I> in the new PRD command is
the same as it was previously. If not, the calculation of the "clock"
value for the first event in the new run will be slightly off.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This command can only be used if LAMMPS was built with the REPLICA
package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info on packages.
</P>
<P><I>N</I> and <I>t_correlate</I> settings must be integer multiples of
<I>t_event</I>.
</P>
<P>Runs restarted from restart file written during a PRD run will not
produce identical results due to changes in the random numbers used
for dephasing.
</P>
<P>This command cannot be used when any fixes are defined that keep track
of elapsed time to perform time-dependent operations. Examples
include the "ave" fixes such as <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A>. Also <A HREF = "fix_dt_reset.html">fix
dt/reset</A> and <A HREF = "fix_deposit.html">fix deposit</A>.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_event_displace.html">compute event/displace</A>,
<A HREF = "min_modify.html">min_modify</A>, <A HREF = "min_style.html">min_style</A>,
<A HREF = "run_style.html">run_style</A>, <A HREF = "minimize.html">minimize</A>,
<A HREF = "velocity.html">velocity</A>, <A HREF = "temper.html">temper</A>, <A HREF = "neb.html">neb</A>,
<A HREF = "tad.html">tad</A>
</P>
<P><B>Default:</B>
</P>
<P>The option defaults are <I>min</I> = 0.1 0.1 40 50, no <I>temp</I> setting, and
<I>vel</I> = <I>geom</I> <I>gaussian</I>.
</P>
<HR>
<A NAME = "Voter"></A>
<P><B>(Voter)</B> Voter, Phys Rev B, 57, 13985 (1998).
</P>
<A NAME = "Voter2"></A>
<P><B>(Voter2)</B> Voter, Montalenti, Germann, Annual Review of Materials
Research 32, 321 (2002).
</P>
</HTML>
diff --git a/doc/prd.txt b/doc/prd.txt
index 33130c17b..52c5406ee 100644
--- a/doc/prd.txt
+++ b/doc/prd.txt
@@ -1,297 +1,297 @@
"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
prd command :h3
[Syntax:]
prd N t_event n_dephase t_dephase t_correlate compute-ID seed keyword value ... :pre
N = # of timesteps to run (not including dephasing/quenching) :ulb,l
t_event = timestep interval between event checks :l
n_dephase = number of velocity randomizations to perform in each dephase run :l
t_dephase = number of timesteps to run dynamics after each velocity randomization during dephase :l
t_correlate = number of timesteps within which 2 consecutive events are considered to be correlated :l
compute-ID = ID of the compute used for event detection :l
random_seed = random # seed (positive integer) :l
zero or more keyword/value pairs may be appended :l
keyword = {min} or {temp} or {vel} :l
{min} values = etol ftol maxiter maxeval
etol = stopping tolerance for energy, used in quenching
ftol = stopping tolerance for force, used in quenching
maxiter = max iterations of minimize, used in quenching
maxeval = max number of force/energy evaluations, used in quenching
{temp} value = Tdephase
Tdephase = target temperature for velocity randomization, used in dephasing
{vel} values = loop dist
loop = {all} or {local} or {geom}, used in dephasing
dist = {uniform} or {gaussian}, used in dephasing :pre
:ule
[Examples:]
prd 5000 100 10 10 100 1 54982
prd 5000 100 10 10 100 1 54982 min 0.1 0.1 100 200 :pre
[Description:]
Run a parallel replica dynamics (PRD) simulation using multiple
replicas of a system. One or more replicas can be used.
PRD is described in "this paper"_#Voter by Art Voter. It is a method
for performing accelerated dynamics that is suitable for
infrequent-event systems that obey first-order kinetics. A good
overview of accelerated dynamics methods for such systems in given in
"this review paper"_#Voter2 from the same group. To quote from the
paper: "The dynamical evolution is characterized by vibrational
excursions within a potential basin, punctuated by occasional
transitions between basins." The transition probability is
characterized by p(t) = k*exp(-kt) where k is the rate constant.
Running multiple replicas gives an effective enhancement in the
timescale spanned by the multiple simulations, while waiting for an
event to occur.
Each replica runs on a partition of one or more processors. Processor
partitions are defined at run-time using the -partition command-line
-switch; see "this section"_Section_start.html#start_6 of the manual.
-Note that if you have MPI installed, you can run a multi-replica
-simulation with more replicas (partitions) than you have physical
-processors, e.g you can run a 10-replica simulation on one or two
-processors. For PRD, this makes little sense, since this offers no
-effective parallel speed-up in searching for infrequent events. See
-"this section"_Section_howto.html#howto_5 of the manual for further
+switch; see "Section_start 6"_Section_start.html#start_6 of the
+manual. Note that if you have MPI installed, you can run a
+multi-replica simulation with more replicas (partitions) than you have
+physical processors, e.g you can run a 10-replica simulation on one or
+two processors. For PRD, this makes little sense, since this offers
+no effective parallel speed-up in searching for infrequent events. See
+"Section_howto 5"_Section_howto.html#howto_5 of the manual for further
discussion.
When a PRD simulation is performed, it is assumed that each replica is
running the same model, though LAMMPS does not check for this.
I.e. the simulation domain, the number of atoms, the interaction
potentials, etc should be the same for every replica.
A PRD run has several stages, which are repeated each time an "event"
occurs in one of the replicas, as defined below. The logic for a PRD
run is as follows:
while (time remains):
dephase for n_dephase*t_dephase steps
until (event occurs on some replica):
run dynamics for t_event steps
quench
check for uncorrelated event on any replica
until (no correlated event occurs):
run dynamics for t_correlate steps
quench
check for correlated event on this replica
event replica shares state with all replicas :pre
Before this loop begins, the state of the system on replica 0 is
shared with all replicas, so that all replicas begin from the same
initial state. The first potential energy basin is identified by
quenching (an energy minimization, see below) the initial state and
storing the resulting coordinates for reference.
In the first stage, dephasing is performed by each replica
independently to eliminate correlations between replicas. This is
done by choosing a random set of velocities, based on the
{random_seed} that is specified, and running {t_dephase} timesteps of
dynamics. This is repeated {n_dephase} times. If the {temp} keyword
is not specified, the target temperature for velocity randomization
for each replica is the current temperature of that replica.
Otherwise, it is the specified {Tdephase} temperature. The style of
velocity randomization is controlled using the keyword {vel} with
arguments that have the same meaning as their counterparts in the
"velocity"_velocity.html command.
In the second stage, each replica runs dynamics continuously, stopping
every {t_event} steps to check if a transition event has occurred.
This check is performed by quenching the system and comparing the
resulting atom coordinates to the coordinates from the previous basin.
The first time through the PRD loop, the "previous basin" is the set
of quenched coordinates from the initial state of the system.
A quench is an energy minimization and is performed by whichever
algorithm has been defined by the "min_style"_min_style.html command.
Minimization parameters may be set via the
"min_modify"_min_modify.html command and by the {min} keyword of the
PRD command. The latter are the settings that would be used with the
"minimize"_minimize.html command. Note that typically, you do not
need to perform a highly-converged minimization to detect a transition
event.
The event check is performed by a compute with the specified
{compute-ID}. Currently there is only one compute that works with the
PRD commmand, which is the "compute
event/displace"_compute_event_displace.html command. Other
event-checking computes may be added. "Compute
event/displace"_compute_event_displace.html checks whether any atom in
the compute group has moved further than a specified threshold
distance. If so, an "event" has occurred.
In the third stage, the replica on which the event occurred (event
replica) continues to run dynamics to search for correlated events.
This is done by running dynamics for {t_correlate} steps, quenching
every {t_event} steps, and checking if another event has occurred.
The first time no correlated event occurs, the final state of the
event replica is shared with all replicas, the new basin reference
coordinates are updated with the quenched state, and the outer loop
begins again. While the replica event is searching for correlated
events, all the other replicas also run dynamics and event checking
with the same schedule, but the final states are always overwritten by
the state of the event replica.
:line
Four kinds of output can be generated during a PRD run: event
statistics, thermodynamic output by each replica, dump files, and
restart files.
When running with multiple partitions (each of which is a replica in
this case), the print-out to the screen and master log.lammps file is
limited to event statistics. Note that if a PRD run is performed on
only a single replica then the event statistics will be intermixed
with the usual thermodynamic output discussed below.
The quantities printed each time an event occurs are the timestep,
CPU time, clock, event number, a correlation flag,
the number of coincident events, and the replica number of the chosen event.
The timestep is the usual LAMMPS timestep, except that time does not
advance during dephasing or quenches, but only during dynamics. Note
that are two kinds of dynamics in the PRD loop listed above. The
first is when all replicas are performing independent dynamics. The
second is when correlated events are being searched for and only one
replica is running dynamics.
The CPU time is the total processor time since the start of the PRD
run.
The clock is the same as the timestep except that it advances by M
steps every timestep during the first kind of dynamics when the M
replicas are running independently. The clock represents the real
time that effectively elapses during a PRD simulation of {N} steps on
M replicas. If most of the PRD run is spent in the second stage of
the loop above, searching for infrequent events, then the clock will
advance nearly N*M steps. Note the clock time between events will be
drawn from p(t).
The event number is a counter that increments with each event, whether
it is uncorrelated or correlated.
The correlation flag will be 0 when an uncorrelated event occurs
during the second stage of the loop listed above, i.e. when all
replicas are running independently. The correlation flag will be 1
when a correlated event occurs during the third stage of the loop
listed above, i.e. when only one replica is running dynamics.
When more than one replica detects an event at the end of the second
stage, then one of them is chosen at random. The number of coincident
events is the number of replicas that detected an event. Normally, we
expect this value to be 1. If it is often greater than 1, then either
the number of replicas is too large, or {t_event} is too large.
The replica number is the ID of the replica (from 0 to M-1) that
found the event.
:line
When running on multiple partitions, LAMMPS produces additional log
files for each partition, e.g. log.lammps.0, log.lammps.1, etc. For
the PRD command, these contain the thermodynamic output for each
replica. You will see short runs and minimizations corresponding to
the dynamics and quench operations of the loop listed above. The
timestep will be reset aprpopriately depending on whether the
operation advances time or not.
After the PRD command completes, timing statistics for the PRD run are
printed in each replica's log file, giving a breakdown of how much CPU
time was spent in each stage (dephasing, dynamics, quenching, etc).
:line
Any "dump files"_dump.html defined in the input script, will be
written to during a PRD run at timesteps corresponding to both
uncorrelated and correlated events. This means the the requested dump
frequency in the "dump"_dump.html command is ignored. There will be
one dump file (per dump command) created for all partitions.
The atom coordinates of the dump snapshot are those of the minimum
energy configuration resulting from quenching following a transition
event. The timesteps written into the dump files correspond to the
timestep at which the event occurred and NOT the clock. A dump
snapshot corresponding to the initial minimum state used for event
detection is written to the dump file at the beginning of each PRD
run.
:line
If the "restart"_restart.html command is used, a single restart file
for all the partitions is generated, which allows a PRD run to be
continued by a new input script in the usual manner.
The restart file is generated at the end of the loop listed above. If
no correlated events are found, this means it contains a snapshot of
the system at time T + {t_correlate}, where T is the time at which the
uncorrelated event occurred. If correlated events were found, then it
contains a snapshot of the system at time T + {t_correlate}, where T
is the time of the last correlated event.
The restart frequency specified in the "restart"_restart.html command
is interpreted differently when performing a PRD run. It does not
mean the timestep interval between restart files. Instead it means an
event interval for uncorrelated events. Thus a frequency of 1 means
write a restart file every time an uncorrelated event occurs. A
frequency of 10 means write a restart file every 10th uncorrelated
event.
When an input script reads a restart file from a previous PRD run, the
new script can be run on a different number of replicas or processors.
However, it is assumed that {t_correlate} in the new PRD command is
the same as it was previously. If not, the calculation of the "clock"
value for the first event in the new run will be slightly off.
:line
[Restrictions:]
This command can only be used if LAMMPS was built with the REPLICA
package. See the "Making LAMMPS"_Section_start.html#start_3 section
for more info on packages.
{N} and {t_correlate} settings must be integer multiples of
{t_event}.
Runs restarted from restart file written during a PRD run will not
produce identical results due to changes in the random numbers used
for dephasing.
This command cannot be used when any fixes are defined that keep track
of elapsed time to perform time-dependent operations. Examples
include the "ave" fixes such as "fix
ave/spatial"_fix_ave_spatial.html. Also "fix
dt/reset"_fix_dt_reset.html and "fix deposit"_fix_deposit.html.
[Related commands:]
"compute event/displace"_compute_event_displace.html,
"min_modify"_min_modify.html, "min_style"_min_style.html,
"run_style"_run_style.html, "minimize"_minimize.html,
"velocity"_velocity.html, "temper"_temper.html, "neb"_neb.html,
"tad"_tad.html
[Default:]
The option defaults are {min} = 0.1 0.1 40 50, no {temp} setting, and
{vel} = {geom} {gaussian}.
:line
:link(Voter)
[(Voter)] Voter, Phys Rev B, 57, 13985 (1998).
:link(Voter2)
[(Voter2)] Voter, Montalenti, Germann, Annual Review of Materials
Research 32, 321 (2002).
diff --git a/doc/processors.html b/doc/processors.html
index 92c7f312f..945a5d5cb 100644
--- a/doc/processors.html
+++ b/doc/processors.html
@@ -1,202 +1,331 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>processors command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>processors Px Py Pz keyword args ...
</PRE>
-<UL><LI>Px,Py,Pz = # of processors in each dimension of a 3d grid
+<UL><LI>Px,Py,Pz = # of processors in each dimension of 3d grid overlaying the simulation domain
<LI>zero or more keyword/arg pairs may be appended
-<LI>keyword = <I>grid</I> or <I>numa</I> or <I>part</I>
+<LI>keyword = <I>grid</I> or <I>map</I> or <I>part</I> or <I>file</I>
-<PRE> <I>grid</I> arg = <I>cart</I> or <I>cart/reorder</I> or <I>xyz</I> or <I>xzy</I> or <I>yxz</I> or <I>yzx</I> or <I>zxy</I> or <I>zyx</I>
- cart = use MPI_Cart() methods to layout 3d grid of procs with reorder = 0
- cart/reorder = use MPI_Cart() methods to layout 3d grid of procs with reorder = 1
- xyz,xzy,yxz,yzx,zxy,zyx = layout 3d grid of procs in IJK order, where I varies fastest, then J, and K slowest
+<PRE> <I>grid</I> arg = gstyle params ...
+ gstyle = <I>onelevel</I> or <I>twolevel</I> or <I>numa</I> or <I>custom</I>
+ onelevel params = none
+ twolevel params = Nc Cx Cy Cz
+ Nc = number of cores per node
+ Cx,Cy,Cz = # of cores in each dimension of 3d sub-grid assigned to each node
+ numa params = none
+ custom params = infile
+ infile = file containing grid layout
+ <I>map</I> arg = <I>cart</I> or <I>cart/reorder</I> or <I>xyz</I> or <I>xzy</I> or <I>yxz</I> or <I>yzx</I> or <I>zxy</I> or <I>zyx</I>
+ cart = use MPI_Cart() methods to map processors to 3d grid with reorder = 0
+ cart/reorder = use MPI_Cart() methods to map processors to 3d grid with reorder = 1
+ xyz,xzy,yxz,yzx,zxy,zyx = map procesors to 3d grid in IJK ordering
<I>numa</I> arg = none
<I>part</I> args = Psend Precv cstyle
Psend = partition # (1 to Np) which will send its processor layout
Precv = partition # (1 to Np) which will recv the processor layout
cstyle = <I>multiple</I>
- <I>multiple</I> = Psend layout will be multiple of Precv layout in each dimension
+ <I>multiple</I> = Psend grid will be multiple of Precv grid in each dimension
+ <I>file</I> arg = outfile
+ outfile = name of file to write 3d grid of processors to
</PRE>
</UL>
<P><B>Examples:</B>
</P>
-<PRE>processors 2 4 4
-processors * * 5
-processors * * * grid xyz
-processors * * * numa
+<PRE>processors * * 5
+processors 2 4 4
+processors * * 8 map xyz
+processors * * * grid numa
+processors * * * grid twolevel 4 * * 1
+processors 4 8 16 grid custom myfile
processors * * * part 1 2 multiple
</PRE>
<P><B>Description:</B>
</P>
<P>Specify how processors are mapped as a 3d logical grid to the global
simulation box. This involves 2 steps. First if there are P
processors it means choosing a factorization P = Px by Py by Pz so
that there are Px processors in the x dimension, and similarly for the
-y and z dimensions. Second, the P processors (with MPI ranks 0 to
-P-1) are mapped to the logical grid so that each grid cell is a
-processor. The arguments to this command control each of these 2
-steps.
+y and z dimensions. Second, the P processors are mapped to the
+logical 3d grid. The arguments to this command control each of these
+2 steps.
</P>
<P>The Px, Py, Pz parameters affect the factorization. Any of the 3
parameters can be specified with an asterisk "*", which means LAMMPS
-will choose the number of processors in that dimension. It will do
-this based on the size and shape of the global simulation box so as to
-minimize the surface-to-volume ratio of each processor's sub-domain.
+will choose the number of processors in that dimension of the grid.
+It will do this based on the size and shape of the global simulation
+box so as to minimize the surface-to-volume ratio of each processor's
+sub-domain.
</P>
<P>Since LAMMPS does not load-balance by changing the grid of 3d
-processors on-the-fly, this choosing explicit values for Px or Py or
-Pz can be used to override the LAMMPS default if it is known to be
-sub-optimal for a particular problem. For example, a problem where
-the extent of atoms will change dramatically in a particular dimension
-over the course of the simulation.
+processors on-the-fly, choosing explicit values for Px or Py or Pz can
+be used to override the LAMMPS default if it is known to be
+sub-optimal for a particular problem. E.g. a problem where the extent
+of atoms will change dramatically in a particular dimension over the
+course of the simulation.
</P>
<P>The product of Px, Py, Pz must equal P, the total # of processors
LAMMPS is running on. For a <A HREF = "dimension.html">2d simulation</A>, Pz must
-equal 1. If multiple partitions are being used then P is the number
-of processors in this partition; see <A HREF = "Section_start.html#start_6">this
-section</A> for an explanation of the
--partition command-line switch.
+equal 1.
</P>
-<P>Note that if you run on a large, prime number of processors P, then a
-grid such as 1 x P x 1 will be required, which may incur extra
+<P>Note that if you run on a prime number of processors P, then a grid
+such as 1 x P x 1 will be required, which may incur extra
communication costs due to the high surface area of each processor's
sub-domain.
</P>
+<P>Also note that if multiple partitions are being used then P is the
+number of processors in this partition; see <A HREF = "Section_start.html#start_6">this
+section</A> for an explanation of the
+-partition command-line switch. Also note that you can prefix the
+processors command with the <A HREF = "partition.html">partition</A> command to
+easily specify different Px,Py,Pz values for different partitions.
+</P>
+<P>You can use the <A HREF = "partition.html">partition</A> command to specify
+different processor grids for different partitions, e.g.
+</P>
+<PRE>partition yes 1 processors 4 4 4
+partition yes 2 processors 2 3 2
+</PRE>
<HR>
-<P>The <I>grid</I> keyword affects how processor IDs are mapped to the 3d grid
-of processors.
+<P>The <I>grid</I> keyword affects the factorization of P into Px,Py,Pz and it
+can also affect how the P processor IDs are mapped to the 3d grid of
+processors.
+</P>
+<P>The <I>onelevel</I> style creates a 3d grid that is compatible with the
+Px,Py,Pz settings, and which minimizes the surface-to-volume ratio of
+each processor's sub-domain, as described above. The mapping of
+processors to the grid is determined by the <I>map</I> keyword setting.
+</P>
+<P>The <I>twolevel</I> style can be used on machines with multicore nodes to
+minimize off-node communication. It insures that contiguous
+sub-sections of the 3d grid are assigned to all the cores of a node.
+For example if <I>Nc</I> is 4, then 2x2x1 or 2x1x2 or 1x2x2 sub-sections of
+the 3d grid will correspond to the cores of each node. This affects
+both the factorization and mapping steps.
+</P>
+<P>The <I>Cx</I>, <I>Cy</I>, <I>Cz</I> settings are similar to the <I>Px</I>, <I>Py</I>, <I>Pz</I>
+settings, only their product should equal <I>Nc</I>. Any of the 3
+parameters can be specified with an asterisk "*", which means LAMMPS
+will choose the number of cores in that dimension of the node's
+sub-grid. As with Px,Py,Pz, it will do this based on the size and
+shape of the global simulation box so as to minimize the
+surface-to-volume ratio of each processor's sub-domain.
</P>
-<P>The <I>cart</I> style uses the family of MPI Cartesian functions to do
-this, namely MPI_Cart_create(), MPI_Cart_get(), MPI_Cart_shift(), and
-MPI_Cart_rank(). It invokes the MPI_Cart_create() function with its
-reorder flag = 0, so that MPI is not free to reorder the processors.
+<P>IMPORTANT NOTE: For the <I>twolevel</I> style to work correctly, it
+assumes the MPI ranks of processors LAMMPS is running on are ordered
+by core and then by node. E.g. if you are running on 2 quad-core
+nodes, for a total of 8 processors, then it assumes processors 0,1,2,3
+are on node 1, and processors 4,5,6,7 are on node 2. This is the
+default rank ordering for most MPI implementations, but some MPIs
+provide options for this ordering, e.g. via environment variable
+settings.
+</P>
+<P>The <I>numa</I> style operates similar to the <I>twolevel</I> keyword except
+that it auto-detects which cores are running on which nodes.
+Currently, it does this in only 2 levels, but it may be extended in
+the future to account for socket topology and other non-uniform memory
+access (NUMA) costs. It also uses a different algorithm than the
+<I>twolevel</I> keyword for doing the two-level factorization of the
+simulation box into a 3d processor grid to minimize off-node
+communication, and it does its own MPI-based mapping of nodes and
+cores to the logical 3d grid. Thus it may produce a different layout
+of the processors than the <I>twolevel</I> options.
+</P>
+<P>The <I>numa</I> style will give an error if the number of MPI processes is
+not divisible by the number of cores used per node, or any of the Px
+or Py of Pz values is greater than 1.
+</P>
+<P>IMPORTANT NOTE: Unlike the <I>twolevel</I> style, the <I>numa</I> style does not
+require any particular ordering of MPI ranks i norder to work
+correctly. This is because it auto-detects which processes are
+running on which nodes.
+</P>
+<P>The <I>custom</I> style uses the file <I>infile</I> to define both the 3d
+factorization and the mapping of processors to the grid.
+</P>
+<P>The file should have the following format. Any number of initial
+blank or comment lines (starting with a "#" character) can be present.
+The first non-blank, non-comment line should have
+3 values:
+</P>
+<PRE>Px Py Py
+</PRE>
+<P>These must be compatible with the total number of processors
+and the Px, Py, Pz settings of the processors commmand.
+</P>
+<P>This line should be immediately followed by
+P = Px*Py*Pz lines of the form:
+</P>
+<PRE>ID I J K
+</PRE>
+<P>where ID is a processor ID (from 0 to P-1) and I,J,K are the
+processors location in the 3d grid. I must be a number from 1 to Px
+(inclusive) and similarly for J and K. The P lines can be listed in
+any order, but no processor ID should appear more than once.
+</P>
+<HR>
+
+<P>The <I>map</I> keyword affects how the P processor IDs (from 0 to P-1) are
+mapped to the 3d grid of processors. It is only used by the
+<I>onelevel</I> and <I>twolevel</I> grid settings.
+</P>
+<P>The <I>cart</I> style uses the family of MPI Cartesian functions to perform
+the mapping, namely MPI_Cart_create(), MPI_Cart_get(),
+MPI_Cart_shift(), and MPI_Cart_rank(). It invokes the
+MPI_Cart_create() function with its reorder flag = 0, so that MPI is
+not free to reorder the processors.
</P>
<P>The <I>cart/reorder</I> style does the same thing as the <I>cart</I> style
-except it sets the reorder flag to 1, so that MPI is free to reorder
+except it sets the reorder flag to 1, so that MPI can reorder
processors if it desires.
</P>
<P>The <I>xyz</I>, <I>xzy</I>, <I>yxz</I>, <I>yzx</I>, <I>zxy</I>, and <I>zyx</I> styles are all
-similar. If the style is IJK, then it explicitly maps the P
-processors to the grid so that the processor ID in the I direction
-varies fastest, the processor ID in the J direction varies next
-fastest, and the processor ID in the K direction varies slowest. For
-example, if you select style <I>xyz</I> and you have a 2x2x2 grid of 8
-processors, the assignments of the 8 octants of the simulation domain
-will be:
+similar. If the style is IJK, then it maps the P processors to the
+grid so that the processor ID in the I direction varies fastest, the
+processor ID in the J direction varies next fastest, and the processor
+ID in the K direction varies slowest. For example, if you select
+style <I>xyz</I> and you have a 2x2x2 grid of 8 processors, the assignments
+of the 8 octants of the simulation domain will be:
</P>
<PRE>proc 0 = lo x, lo y, lo z octant
proc 1 = hi x, lo y, lo z octant
proc 2 = lo x, hi y, lo z octant
proc 3 = hi x, hi y, lo z octant
proc 4 = lo x, lo y, hi z octant
proc 5 = hi x, lo y, hi z octant
proc 6 = lo x, hi y, hi z octant
proc 7 = hi x, hi y, hi z octant
</PRE>
<P>Note that, in principle, an MPI implementation on a particular machine
should be aware of both the machine's network topology and the
specific subset of processors and nodes that were assigned to your
simulation. Thus its MPI_Cart calls can optimize the assignment of
-MPI processes to the 3d grid to minimize communication costs. However
-in practice, few if any MPI implementations actually do this. So it
-is likely that the <I>cart</I> and <I>cart/reorder</I> styles simply give the
-same result as one of the IJK styles.
-</P>
-<HR>
-
-<P>The <I>numa</I> keyword affects both the factorization of P into Px,Py,Pz
-and the mapping of processors to the 3d grid.
-</P>
-<P>It will perform a two-level factorization of the simulation box to
-minimize inter-node communication. This can improve parallel
-efficiency by reducing network traffic. When this keyword is set, the
-simulation box is first divided across nodes. Then within each node,
-the subdomain is further divided between the cores of each node.
+MPI processes to the 3d grid to minimize communication costs. In
+practice, however, few if any MPI implementations actually do this.
+So it is likely that the <I>cart</I> and <I>cart/reorder</I> styles simply give
+the same result as one of the IJK styles.
</P>
-<P>The numa setting will be ignored if (a) there are less than 4 cores
-per node, or (b) the number of MPI processes is not divisible by the
-number of cores used per node, or (c) only 1 node is allocated, or (d)
-any of the Px or Py of Pz values is greater than 1.
+<P>Also note, that for the <I>twolevel</I> grid style, the <I>map</I> setting is
+used to first map the nodes to the 3d grid, then again to the cores
+within each node. For the latter step, the <I>cart</I> and <I>cart/reorder</I>
+styles are not supported, so an <I>xyz</I> style is used in their place.
</P>
<HR>
-<P>The <I>part</I> keyword can be useful when running in multi-partition mode,
-e.g. with the <A HREF = "run_style.html<A HREF = "Section_start.html#start_6">-partition">>run_style verlet/split</A> command. It
-specifies a dependency bewteen a sending partition <I>Psend</I> and a
-receiving partition <I>Precv</I> which is enforced when each is setting up
-their own mapping of the partitions processors to the simulation box.
-Each of <I>Psend</I> and <I>Precv</I> must be integers from 1 to Np, where Np is
-the number of partitions you have defined via the <A HREF = </A>
-command-line switch</A>.
+<P>The <I>part</I> keyword affects the factorization of P into Px,Py,Pz.
+</P>
+<P>It can be useful when running in multi-partition mode, e.g. with the
+<A HREF = "run_style.html">run_style verlet/split</A> command. It specifies a
+dependency bewteen a sending partition <I>Psend</I> and a receiving
+partition <I>Precv</I> which is enforced when each is setting up their own
+mapping of their processors to the simulation box. Each of <I>Psend</I>
+and <I>Precv</I> must be integers from 1 to Np, where Np is the number of
+partitions you have defined via the <A HREF = "Section_start.html#start_6">-partition command-line
+switch</A>.
</P>
<P>A "dependency" means that the sending partition will create its 3d
logical grid as Px by Py by Pz and after it has done this, it will
send the Px,Py,Pz values to the receiving partition. The receiving
partition will wait to receive these values before creating its own 3d
logical grid and will use the sender's Px,Py,Pz values as a
constraint. The nature of the constraint is determined by the
<I>cstyle</I> argument.
</P>
<P>For a <I>cstyle</I> of <I>multiple</I>, each dimension of the sender's processor
grid is required to be an integer multiple of the corresponding
dimension in the receiver's processor grid. This is a requirement of
the <A HREF = "run_style.html">run_style verlet/split</A> command.
</P>
<P>For example, assume the sending partition creates a 4x6x10 grid = 240
processor grid. If the receiving partition is running on 80
processors, it could create a 4x2x10 grid, but it will not create a
2x4x10 grid, since in the y-dimension, 6 is not an integer multiple of
4.
</P>
-<HR>
-
-<P>Note that you can use the <A HREF = "partition.html">partition</A> command to
-specify different processor grids for different partitions, e.g.
-</P>
-<PRE>partition yes 1 processors 4 4 4
-partition yes 2 processors 2 3 2
-</PRE>
<P>IMPORTANT NOTE: If you use the <A HREF = "partition.html">partition</A> command to
invoke different "processsors" commands on different partitions, and
you also use the <I>part</I> keyword, then you must insure that both the
sending and receiving partitions invoke the "processors" command that
connects the 2 partitions via the <I>part</I> keyword. LAMMPS cannot
easily check for this, but your simulation will likely hang in its
setup phase if this error has been made.
</P>
<HR>
+<P>The <I>file</I> keyword writes the mapping of the factorization of P
+processors and their mapping to the 3d grid to the specified file
+<I>outfile</I>. This is useful to check that you assigned physical
+processors in the manner you desired, which can be tricky to figure
+out, especially when running on multiple partitions or on, a multicore
+machine or when the processor ranks were reordered by use of the
+<A HREF = "Section_start.html#start_6">-reorder command-line switch</A> or due to
+use of MPI-specific launch options such as a config file.
+</P>
+<P>If you have multiple partitions you should insure that each one writes
+to a different file, e.g. using a <A HREF = "variable.html">world-style variable</A>
+for the filename. The file has a self-explanatory header, followed by
+one-line per processor in this format:
+</P>
+<P>world-ID universe-ID original-ID: I J K: name
+</P>
+<P>The IDs are the processor's rank in this simulation (the world), the
+universe (of multiple simulations), and the original MPI communicator
+used to instantiate LAMMPS, respectively. The world and universe IDs
+will only be different if you are running on more than one partition;
+see the <A HREF = "Section_start.html#start_6">-partition command-line switch</A>.
+The universe and original IDs will only be different if you used the
+<A HREF = "Section_start.html#start_6">-reorder command-line switch</A> to reorder
+the processors differently than their rank in the original
+communicator LAMMPS was instantiated with.
+</P>
+<P>I,J,K are the indices of the processor in the 3d logical grid, each
+from 1 to Nd, where Nd is the number of processors in that dimension
+of the grid.
+</P>
+<P>The <I>name</I> is what is returned by a call to MPI_Get_processor_name()
+and should represent an identifier relevant to the physical processors
+in your machine. Note that depending on the MPI implementation,
+multiple cores can have the same <I>name</I>.
+</P>
+<HR>
+
<P><B>Restrictions:</B>
</P>
<P>This command cannot be used after the simulation box is defined by a
<A HREF = "read_data.html">read_data</A> or <A HREF = "create_box.html">create_box</A> command.
It can be used before a restart file is read to change the 3d
processor grid from what is specified in the restart file.
</P>
-<P>The <I>numa</I> keyword cannot be used with the <I>part</I> keyword, or
-with any <I>grid</I> setting other than <I>cart</I>.
+<P>The <I>grid numa</I> keyword only currently works with the <I>map cart</I>
+option.
+</P>
+<P>The <I>part</I> keyword (for the receiving partition) only works with the
+<I>grid onelevel</I> or <I>grid twolevel</I> options.
+</P>
+<P><B>Related commands:</B>
</P>
-<P><B>Related commands:</B> none
+<P><A HREF = "partition.html">partition</A>, <A HREF = "Section_start.html#start_6">-reorder command-line
+switch</A>
</P>
<P><B>Default:</B>
</P>
-<P>The option defaults are Px Py Pz = * * *, grid = cart, numa = 0.
+<P>The option defaults are Px Py Pz = * * *, grid = onelevel, and map =
+cart.
</P>
</HTML>
diff --git a/doc/processors.txt b/doc/processors.txt
index 1a7f28dde..a8123eee1 100644
--- a/doc/processors.txt
+++ b/doc/processors.txt
@@ -1,193 +1,322 @@
"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
processors command :h3
[Syntax:]
processors Px Py Pz keyword args ... :pre
-Px,Py,Pz = # of processors in each dimension of a 3d grid :ulb,l
+Px,Py,Pz = # of processors in each dimension of 3d grid overlaying the simulation domain :ulb,l
zero or more keyword/arg pairs may be appended :l
-keyword = {grid} or {numa} or {part} :l
- {grid} arg = {cart} or {cart/reorder} or {xyz} or {xzy} or {yxz} or {yzx} or {zxy} or {zyx}
- cart = use MPI_Cart() methods to layout 3d grid of procs with reorder = 0
- cart/reorder = use MPI_Cart() methods to layout 3d grid of procs with reorder = 1
- xyz,xzy,yxz,yzx,zxy,zyx = layout 3d grid of procs in IJK order, where I varies fastest, then J, and K slowest
+keyword = {grid} or {map} or {part} or {file} :l
+ {grid} arg = gstyle params ...
+ gstyle = {onelevel} or {twolevel} or {numa} or {custom}
+ onelevel params = none
+ twolevel params = Nc Cx Cy Cz
+ Nc = number of cores per node
+ Cx,Cy,Cz = # of cores in each dimension of 3d sub-grid assigned to each node
+ numa params = none
+ custom params = infile
+ infile = file containing grid layout
+ {map} arg = {cart} or {cart/reorder} or {xyz} or {xzy} or {yxz} or {yzx} or {zxy} or {zyx}
+ cart = use MPI_Cart() methods to map processors to 3d grid with reorder = 0
+ cart/reorder = use MPI_Cart() methods to map processors to 3d grid with reorder = 1
+ xyz,xzy,yxz,yzx,zxy,zyx = map procesors to 3d grid in IJK ordering
{numa} arg = none
{part} args = Psend Precv cstyle
Psend = partition # (1 to Np) which will send its processor layout
Precv = partition # (1 to Np) which will recv the processor layout
cstyle = {multiple}
- {multiple} = Psend layout will be multiple of Precv layout in each dimension :pre
+ {multiple} = Psend grid will be multiple of Precv grid in each dimension
+ {file} arg = outfile
+ outfile = name of file to write 3d grid of processors to :pre
:ule
[Examples:]
+processors * * 5
processors 2 4 4
-processors * * 5
-processors * * * grid xyz
-processors * * * numa
+processors * * 8 map xyz
+processors * * * grid numa
+processors * * * grid twolevel 4 * * 1
+processors 4 8 16 grid custom myfile
processors * * * part 1 2 multiple :pre
[Description:]
Specify how processors are mapped as a 3d logical grid to the global
simulation box. This involves 2 steps. First if there are P
processors it means choosing a factorization P = Px by Py by Pz so
that there are Px processors in the x dimension, and similarly for the
-y and z dimensions. Second, the P processors (with MPI ranks 0 to
-P-1) are mapped to the logical grid so that each grid cell is a
-processor. The arguments to this command control each of these 2
-steps.
+y and z dimensions. Second, the P processors are mapped to the
+logical 3d grid. The arguments to this command control each of these
+2 steps.
The Px, Py, Pz parameters affect the factorization. Any of the 3
parameters can be specified with an asterisk "*", which means LAMMPS
-will choose the number of processors in that dimension. It will do
-this based on the size and shape of the global simulation box so as to
-minimize the surface-to-volume ratio of each processor's sub-domain.
+will choose the number of processors in that dimension of the grid.
+It will do this based on the size and shape of the global simulation
+box so as to minimize the surface-to-volume ratio of each processor's
+sub-domain.
Since LAMMPS does not load-balance by changing the grid of 3d
-processors on-the-fly, this choosing explicit values for Px or Py or
-Pz can be used to override the LAMMPS default if it is known to be
-sub-optimal for a particular problem. For example, a problem where
-the extent of atoms will change dramatically in a particular dimension
-over the course of the simulation.
+processors on-the-fly, choosing explicit values for Px or Py or Pz can
+be used to override the LAMMPS default if it is known to be
+sub-optimal for a particular problem. E.g. a problem where the extent
+of atoms will change dramatically in a particular dimension over the
+course of the simulation.
The product of Px, Py, Pz must equal P, the total # of processors
LAMMPS is running on. For a "2d simulation"_dimension.html, Pz must
-equal 1. If multiple partitions are being used then P is the number
-of processors in this partition; see "this
-section"_Section_start.html#start_6 for an explanation of the
--partition command-line switch.
+equal 1.
-Note that if you run on a large, prime number of processors P, then a
-grid such as 1 x P x 1 will be required, which may incur extra
+Note that if you run on a prime number of processors P, then a grid
+such as 1 x P x 1 will be required, which may incur extra
communication costs due to the high surface area of each processor's
sub-domain.
+Also note that if multiple partitions are being used then P is the
+number of processors in this partition; see "this
+section"_Section_start.html#start_6 for an explanation of the
+-partition command-line switch. Also note that you can prefix the
+processors command with the "partition"_partition.html command to
+easily specify different Px,Py,Pz values for different partitions.
+
+You can use the "partition"_partition.html command to specify
+different processor grids for different partitions, e.g.
+
+partition yes 1 processors 4 4 4
+partition yes 2 processors 2 3 2 :pre
+
:line
-The {grid} keyword affects how processor IDs are mapped to the 3d grid
-of processors.
+The {grid} keyword affects the factorization of P into Px,Py,Pz and it
+can also affect how the P processor IDs are mapped to the 3d grid of
+processors.
-The {cart} style uses the family of MPI Cartesian functions to do
-this, namely MPI_Cart_create(), MPI_Cart_get(), MPI_Cart_shift(), and
-MPI_Cart_rank(). It invokes the MPI_Cart_create() function with its
-reorder flag = 0, so that MPI is not free to reorder the processors.
+The {onelevel} style creates a 3d grid that is compatible with the
+Px,Py,Pz settings, and which minimizes the surface-to-volume ratio of
+each processor's sub-domain, as described above. The mapping of
+processors to the grid is determined by the {map} keyword setting.
+
+The {twolevel} style can be used on machines with multicore nodes to
+minimize off-node communication. It insures that contiguous
+sub-sections of the 3d grid are assigned to all the cores of a node.
+For example if {Nc} is 4, then 2x2x1 or 2x1x2 or 1x2x2 sub-sections of
+the 3d grid will correspond to the cores of each node. This affects
+both the factorization and mapping steps.
+
+The {Cx}, {Cy}, {Cz} settings are similar to the {Px}, {Py}, {Pz}
+settings, only their product should equal {Nc}. Any of the 3
+parameters can be specified with an asterisk "*", which means LAMMPS
+will choose the number of cores in that dimension of the node's
+sub-grid. As with Px,Py,Pz, it will do this based on the size and
+shape of the global simulation box so as to minimize the
+surface-to-volume ratio of each processor's sub-domain.
+
+IMPORTANT NOTE: For the {twolevel} style to work correctly, it
+assumes the MPI ranks of processors LAMMPS is running on are ordered
+by core and then by node. E.g. if you are running on 2 quad-core
+nodes, for a total of 8 processors, then it assumes processors 0,1,2,3
+are on node 1, and processors 4,5,6,7 are on node 2. This is the
+default rank ordering for most MPI implementations, but some MPIs
+provide options for this ordering, e.g. via environment variable
+settings.
+
+The {numa} style operates similar to the {twolevel} keyword except
+that it auto-detects which cores are running on which nodes.
+Currently, it does this in only 2 levels, but it may be extended in
+the future to account for socket topology and other non-uniform memory
+access (NUMA) costs. It also uses a different algorithm than the
+{twolevel} keyword for doing the two-level factorization of the
+simulation box into a 3d processor grid to minimize off-node
+communication, and it does its own MPI-based mapping of nodes and
+cores to the logical 3d grid. Thus it may produce a different layout
+of the processors than the {twolevel} options.
+
+The {numa} style will give an error if the number of MPI processes is
+not divisible by the number of cores used per node, or any of the Px
+or Py of Pz values is greater than 1.
+
+IMPORTANT NOTE: Unlike the {twolevel} style, the {numa} style does not
+require any particular ordering of MPI ranks i norder to work
+correctly. This is because it auto-detects which processes are
+running on which nodes.
+
+The {custom} style uses the file {infile} to define both the 3d
+factorization and the mapping of processors to the grid.
+
+The file should have the following format. Any number of initial
+blank or comment lines (starting with a "#" character) can be present.
+The first non-blank, non-comment line should have
+3 values:
+
+Px Py Py :pre
+
+These must be compatible with the total number of processors
+and the Px, Py, Pz settings of the processors commmand.
+
+This line should be immediately followed by
+P = Px*Py*Pz lines of the form:
+
+ID I J K :pre
+
+where ID is a processor ID (from 0 to P-1) and I,J,K are the
+processors location in the 3d grid. I must be a number from 1 to Px
+(inclusive) and similarly for J and K. The P lines can be listed in
+any order, but no processor ID should appear more than once.
+
+:line
+
+The {map} keyword affects how the P processor IDs (from 0 to P-1) are
+mapped to the 3d grid of processors. It is only used by the
+{onelevel} and {twolevel} grid settings.
+
+The {cart} style uses the family of MPI Cartesian functions to perform
+the mapping, namely MPI_Cart_create(), MPI_Cart_get(),
+MPI_Cart_shift(), and MPI_Cart_rank(). It invokes the
+MPI_Cart_create() function with its reorder flag = 0, so that MPI is
+not free to reorder the processors.
The {cart/reorder} style does the same thing as the {cart} style
-except it sets the reorder flag to 1, so that MPI is free to reorder
+except it sets the reorder flag to 1, so that MPI can reorder
processors if it desires.
The {xyz}, {xzy}, {yxz}, {yzx}, {zxy}, and {zyx} styles are all
-similar. If the style is IJK, then it explicitly maps the P
-processors to the grid so that the processor ID in the I direction
-varies fastest, the processor ID in the J direction varies next
-fastest, and the processor ID in the K direction varies slowest. For
-example, if you select style {xyz} and you have a 2x2x2 grid of 8
-processors, the assignments of the 8 octants of the simulation domain
-will be:
+similar. If the style is IJK, then it maps the P processors to the
+grid so that the processor ID in the I direction varies fastest, the
+processor ID in the J direction varies next fastest, and the processor
+ID in the K direction varies slowest. For example, if you select
+style {xyz} and you have a 2x2x2 grid of 8 processors, the assignments
+of the 8 octants of the simulation domain will be:
proc 0 = lo x, lo y, lo z octant
proc 1 = hi x, lo y, lo z octant
proc 2 = lo x, hi y, lo z octant
proc 3 = hi x, hi y, lo z octant
proc 4 = lo x, lo y, hi z octant
proc 5 = hi x, lo y, hi z octant
proc 6 = lo x, hi y, hi z octant
proc 7 = hi x, hi y, hi z octant :pre
Note that, in principle, an MPI implementation on a particular machine
should be aware of both the machine's network topology and the
specific subset of processors and nodes that were assigned to your
simulation. Thus its MPI_Cart calls can optimize the assignment of
-MPI processes to the 3d grid to minimize communication costs. However
-in practice, few if any MPI implementations actually do this. So it
-is likely that the {cart} and {cart/reorder} styles simply give the
-same result as one of the IJK styles.
+MPI processes to the 3d grid to minimize communication costs. In
+practice, however, few if any MPI implementations actually do this.
+So it is likely that the {cart} and {cart/reorder} styles simply give
+the same result as one of the IJK styles.
-:line
-
-The {numa} keyword affects both the factorization of P into Px,Py,Pz
-and the mapping of processors to the 3d grid.
-
-It will perform a two-level factorization of the simulation box to
-minimize inter-node communication. This can improve parallel
-efficiency by reducing network traffic. When this keyword is set, the
-simulation box is first divided across nodes. Then within each node,
-the subdomain is further divided between the cores of each node.
-
-The numa setting will be ignored if (a) there are less than 4 cores
-per node, or (b) the number of MPI processes is not divisible by the
-number of cores used per node, or (c) only 1 node is allocated, or (d)
-any of the Px or Py of Pz values is greater than 1.
+Also note, that for the {twolevel} grid style, the {map} setting is
+used to first map the nodes to the 3d grid, then again to the cores
+within each node. For the latter step, the {cart} and {cart/reorder}
+styles are not supported, so an {xyz} style is used in their place.
:line
-The {part} keyword can be useful when running in multi-partition mode,
-e.g. with the "run_style verlet/split"_run_style.html command. It
-specifies a dependency bewteen a sending partition {Psend} and a
-receiving partition {Precv} which is enforced when each is setting up
-their own mapping of the partitions processors to the simulation box.
-Each of {Psend} and {Precv} must be integers from 1 to Np, where Np is
-the number of partitions you have defined via the "-partition
-command-line switch"__Section_start.html#start_6.
+The {part} keyword affects the factorization of P into Px,Py,Pz.
+
+It can be useful when running in multi-partition mode, e.g. with the
+"run_style verlet/split"_run_style.html command. It specifies a
+dependency bewteen a sending partition {Psend} and a receiving
+partition {Precv} which is enforced when each is setting up their own
+mapping of their processors to the simulation box. Each of {Psend}
+and {Precv} must be integers from 1 to Np, where Np is the number of
+partitions you have defined via the "-partition command-line
+switch"_Section_start.html#start_6.
A "dependency" means that the sending partition will create its 3d
logical grid as Px by Py by Pz and after it has done this, it will
send the Px,Py,Pz values to the receiving partition. The receiving
partition will wait to receive these values before creating its own 3d
logical grid and will use the sender's Px,Py,Pz values as a
constraint. The nature of the constraint is determined by the
{cstyle} argument.
For a {cstyle} of {multiple}, each dimension of the sender's processor
grid is required to be an integer multiple of the corresponding
dimension in the receiver's processor grid. This is a requirement of
the "run_style verlet/split"_run_style.html command.
For example, assume the sending partition creates a 4x6x10 grid = 240
processor grid. If the receiving partition is running on 80
processors, it could create a 4x2x10 grid, but it will not create a
2x4x10 grid, since in the y-dimension, 6 is not an integer multiple of
4.
-:line
-
-Note that you can use the "partition"_partition.html command to
-specify different processor grids for different partitions, e.g.
-
-partition yes 1 processors 4 4 4
-partition yes 2 processors 2 3 2 :pre
-
IMPORTANT NOTE: If you use the "partition"_partition.html command to
invoke different "processsors" commands on different partitions, and
you also use the {part} keyword, then you must insure that both the
sending and receiving partitions invoke the "processors" command that
connects the 2 partitions via the {part} keyword. LAMMPS cannot
easily check for this, but your simulation will likely hang in its
setup phase if this error has been made.
:line
+The {file} keyword writes the mapping of the factorization of P
+processors and their mapping to the 3d grid to the specified file
+{outfile}. This is useful to check that you assigned physical
+processors in the manner you desired, which can be tricky to figure
+out, especially when running on multiple partitions or on, a multicore
+machine or when the processor ranks were reordered by use of the
+"-reorder command-line switch"_Section_start.html#start_6 or due to
+use of MPI-specific launch options such as a config file.
+
+If you have multiple partitions you should insure that each one writes
+to a different file, e.g. using a "world-style variable"_variable.html
+for the filename. The file has a self-explanatory header, followed by
+one-line per processor in this format:
+
+world-ID universe-ID original-ID: I J K: name
+
+The IDs are the processor's rank in this simulation (the world), the
+universe (of multiple simulations), and the original MPI communicator
+used to instantiate LAMMPS, respectively. The world and universe IDs
+will only be different if you are running on more than one partition;
+see the "-partition command-line switch"_Section_start.html#start_6.
+The universe and original IDs will only be different if you used the
+"-reorder command-line switch"_Section_start.html#start_6 to reorder
+the processors differently than their rank in the original
+communicator LAMMPS was instantiated with.
+
+I,J,K are the indices of the processor in the 3d logical grid, each
+from 1 to Nd, where Nd is the number of processors in that dimension
+of the grid.
+
+The {name} is what is returned by a call to MPI_Get_processor_name()
+and should represent an identifier relevant to the physical processors
+in your machine. Note that depending on the MPI implementation,
+multiple cores can have the same {name}.
+
+:line
+
[Restrictions:]
This command cannot be used after the simulation box is defined by a
"read_data"_read_data.html or "create_box"_create_box.html command.
It can be used before a restart file is read to change the 3d
processor grid from what is specified in the restart file.
-The {numa} keyword cannot be used with the {part} keyword, or
-with any {grid} setting other than {cart}.
+The {grid numa} keyword only currently works with the {map cart}
+option.
+
+The {part} keyword (for the receiving partition) only works with the
+{grid onelevel} or {grid twolevel} options.
+
+[Related commands:]
-[Related commands:] none
+"partition"_partition.html, "-reorder command-line
+switch"_Section_start.html#start_6
[Default:]
-The option defaults are Px Py Pz = * * *, grid = cart, numa = 0.
+The option defaults are Px Py Pz = * * *, grid = onelevel, and map =
+cart.
diff --git a/doc/read_data.html b/doc/read_data.html
index fcf68f468..bf57ec18e 100644
--- a/doc/read_data.html
+++ b/doc/read_data.html
@@ -1,811 +1,811 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>read_data command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>read_data file
</PRE>
<UL><LI>file = name of data file to read in
</UL>
<P><B>Examples:</B>
</P>
<PRE>read_data data.lj
read_data ../run7/data.polymer.gz
</PRE>
<P><B>Description:</B>
</P>
<P>Read in a data file containing information LAMMPS needs to run a
simulation. The file can be ASCII text or a gzipped text file
(detected by a .gz suffix). This is one of 3 ways to specify initial
atom coordinates; see the <A HREF = "read_restart.html">read_restart</A> and
<A HREF = "create_atoms.html">create_atoms</A> commands for alternative methods.
</P>
<P>The structure of the data file is important, though many settings and
sections are optional or can come in any order. See the examples
directory for sample data files for different problems.
</P>
<P>A data file has a header and a body. The header appears first. The
first line of the header is always skipped; it typically contains a
description of the file. Then lines are read one at a time. Lines
can have a trailing comment starting with '#' that is ignored. If the
line is blank (only whitespace after comment is deleted), it is
skipped. If the line contains a header keyword, the corresponding
value(s) is read from the line. If it doesn't contain a header
keyword, the line begins the body of the file.
</P>
<P>The body of the file contains zero or more sections. The first line
of a section has only a keyword. The next line is skipped. The
remaining lines of the section contain values. The number of lines
depends on the section keyword as described below. Zero or more blank
lines can be used between sections. Sections can appear in any order,
with a few exceptions as noted below.
</P>
<P>The formatting of individual lines in the data file (indentation,
spacing between words and numbers) is not important except that header
and section keywords (e.g. atoms, xlo xhi, Masses, Bond Coeffs) must
be capitalized as shown and can't have extra white space between their
words - e.g. two spaces or a tab between "Bond" and "Coeffs" is not
valid.
</P>
<HR>
<P>These are the recognized header keywords. Header lines can come in
any order. The value(s) are read from the beginning of the line.
Thus the keyword <I>atoms</I> should be in a line like "1000 atoms"; the
keyword <I>ylo yhi</I> should be in a line like "-10.0 10.0 ylo yhi"; the
keyword <I>xy xz yz</I> should be in a line like "0.0 5.0 6.0 xy xz yz".
All these settings have a default value of 0, except the lo/hi box
size defaults are -0.5 and 0.5. A line need only appear if the value
is different than the default.
</P>
<UL><LI><I>atoms</I> = # of atoms in system
<LI><I>bonds</I> = # of bonds in system
<LI><I>angles</I> = # of angles in system
<LI><I>dihedrals</I> = # of dihedrals in system
<LI><I>impropers</I> = # of impropers in system
<LI><I>atom types</I> = # of atom types in system
<LI><I>bond types</I> = # of bond types in system
<LI><I>angle types</I> = # of angle types in system
<LI><I>dihedral types</I> = # of dihedral types in system
<LI><I>improper types</I> = # of improper types in system
<LI><I>extra bond per atom</I> = leave space for this many new bonds per atom
<LI><I>ellipsoids</I> = # of ellipsoids in system
<LI><I>lines</I> = # of line segments in system
<LI><I>triangles</I> = # of triangles in system
<LI><I>xlo xhi</I> = simulation box boundaries in x dimension
<LI><I>ylo yhi</I> = simulation box boundaries in y dimension
<LI><I>zlo zhi</I> = simulation box boundaries in z dimension
<LI><I>xy xz yz</I> = simulation box tilt factors for triclinic system
</UL>
<P>The initial simulation box size is determined by the lo/hi settings.
In any dimension, the system may be periodic or non-periodic; see the
<A HREF = "boundary.html">boundary</A> command.
</P>
<P>If the <I>xy xz yz</I> line does not appear, LAMMPS will set up an
axis-aligned (orthogonal) simulation box. If the line does appear,
LAMMPS creates a non-orthogonal simulation domain shaped as a
parallelepiped with triclinic symmetry. The parallelepiped has its
"origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors starting
from the origin given by A = (xhi-xlo,0,0); B = (xy,yhi-ylo,0); C =
(xz,yz,zhi-zlo). <I>Xy,xz,yz</I> can be 0.0 or positive or negative values
and are called "tilt factors" because they are the amount of
displacement applied to faces of an originally orthogonal box to
transform it into the parallelepiped.
</P>
<P>The tilt factors (xy,xz,yz) can not skew the box more than half the
distance of the corresponding parallel box length. For example, if
xlo = 2 and xhi = 12, then the x box length is 10 and the xy tilt
factor must be between -5 and 5. Similarly, both xz and yz must be
between -(xhi-xlo)/2 and +(yhi-ylo)/2. Note that this is not a
limitation, since if the maximum tilt factor is 5 (as in this
example), then configurations with tilt = ..., -15, -5, 5, 15, 25,
... are all geometrically equivalent.
</P>
-<P>See <A HREF = "Section_howto.html#howto_12">this section</A> of the doc pages for a
-geometric description of triclinic boxes, as defined by LAMMPS, and
-how to transform these parameters to and from other commonly used
+<P>See <A HREF = "Section_howto.html#howto_12">Section_howto 12</A> of the doc pages
+for a geometric description of triclinic boxes, as defined by LAMMPS,
+and how to transform these parameters to and from other commonly used
triclinic representations.
</P>
<P>When a triclinic system is used, the simulation domain must be
periodic in any dimensions with a non-zero tilt factor, as defined by
the <A HREF = "boundary.html">boundary</A> command. I.e. if the xy tilt factor is
non-zero, then both the x and y dimensions must be periodic.
Similarly, x and z must be periodic if xz is non-zero and y and z must
be periodic if yz is non-zero. Also note that if your simulation will
tilt the box, e.g. via the <A HREF = "fix_deform.html">fix deform</A> command, the
simulation box must be defined as triclinic, even if the tilt factors
are initially 0.0.
</P>
<P>For 2d simulations, the <I>zlo zhi</I> values should be set to bound the z
coords for atoms that appear in the file; the default of -0.5 0.5 is
valid if all z coords are 0.0. For 2d triclinic simulations, the xz
and yz tilt factors must be 0.0.
</P>
<P>If the system is periodic (in a dimension), then atom coordinates can
be outside the bounds (in that dimension); they will be remapped (in a
periodic sense) back inside the box.
</P>
<P>IMPORTANT NOTE: If the system is non-periodic (in a dimension), then
all atoms in the data file must have coordinates (in that dimension)
that are "greater than or equal to" the lo value and "less than or
equal to" the hi value. If the non-periodic dimension is of style
"fixed" (see the <A HREF = "boundary.html">boundary</A> command), then the atom
coords must be strictly "less than" the hi value, due to the way
LAMMPS assign atoms to processors. Note that you should not make the
lo/hi values radically smaller/larger than the extent of the atoms.
For example, if your atoms extend from 0 to 50, you should not specify
the box bounds as -10000 and 10000. This is because LAMMPS uses the
specified box size to layout the 3d grid of processors. A huge
(mostly empty) box will be sub-optimal for performance when using
"fixed" boundary conditions (see the <A HREF = "boundary.html">boundary</A>
command). When using "shrink-wrap" boundary conditions (see the
<A HREF = "boundary.html">boundary</A> command), a huge (mostly empty) box may cause
a parallel simulation to lose atoms the first time that LAMMPS
shrink-wraps the box around the atoms.
</P>
<P>The "extra bond per atom" setting should be used if new bonds will be
added to the system when a simulation runs, e.g. by using the <A HREF = "fix_bond_create.html">fix
bond/create</A> command. This will pre-allocate
space in LAMMPS data structures for storing the new bonds.
</P>
<P>The "ellipsoids" and "lines" and "triangles" settings are only used
with <A HREF = "atom_style.html">atom_style ellipsoid or line or tri</A> and
specifies how many of the atoms are finite-size ellipsoids or lines or
triangles; the remainder are point particles. See the discussion of
ellipsoidflag and the <I>Ellipsoids</I> section below. See the discussion
of lineflag and the <I>Lines</I> section below. See the discussion of
triangleflag and the <I>Triangles</I> section below.
</P>
<HR>
<P>These are the section keywords for the body of the file.
</P>
<UL><LI><I>Atoms, Velocities, Masses, Ellipsoids, Lines, Triangles</I> = atom-property sections
<LI><I>Bonds, Angles, Dihedrals, Impropers</I> = molecular topology sections
<LI><I>Pair Coeffs, Bond Coeffs, Angle Coeffs, Dihedral Coeffs, Improper Coeffs</I> = force field sections
<LI><I>BondBond Coeffs, BondAngle Coeffs, MiddleBondTorsion Coeffs, EndBondTorsion Coeffs, AngleTorsion Coeffs, AngleAngleTorsion Coeffs, BondBond13 Coeffs, AngleAngle Coeffs</I> = class 2 force field sections
</UL>
<P>Each section is listed below in alphabetic order. The format of each
section is described including the number of lines it must contain and
rules (if any) for where it can appear in the data file.
</P>
<P>Any individual line in the various sections can have a trailing
comment starting with "#" for annotation purposes. E.g. in the
Atoms section:
</P>
<PRE>10 1 17 -1.0 10.0 5.0 6.0 # salt ion
</PRE>
<HR>
<P><I>Angle Coeffs</I> section:
</P>
<UL><LI>one line per angle type
<LI>line syntax: ID coeffs
<PRE> ID = angle type (1-N)
coeffs = list of coeffs
</PRE>
<LI>example:
<PRE> 6 70 108.5 0 0
</PRE>
</UL>
<P>The number and meaning of the coefficients are specific to the defined
angle style. See the <A HREF = "angle_style.html">angle_style</A> and
<A HREF = "angle_coeff.html">angle_coeff</A> commands for details. Coefficients can
also be set via the <A HREF = "angle_coeff.html">angle_coeff</A> command in the
input script.
</P>
<HR>
<P><I>AngleAngle Coeffs</I> section:
</P>
<UL><LI>one line per improper type
<LI>line syntax: ID coeffs
<PRE> ID = improper type (1-N)
coeffs = list of coeffs (see <A HREF = "improper_coeff.html">improper_coeff</A>)
</PRE>
</UL>
<HR>
<P><I>AngleAngleTorsion Coeffs</I> section:
</P>
<UL><LI>one line per dihedral type
<LI>line syntax: ID coeffs
<PRE> ID = dihedral type (1-N)
coeffs = list of coeffs (see <A HREF = "dihedral_coeff.html">dihedral_coeff</A>)
</PRE>
</UL>
<HR>
<P><I>Angles</I> section:
</P>
<UL><LI>one line per angle
<LI>line syntax: ID type atom1 atom2 atom3
<PRE> ID = number of angle (1-Nangles)
type = angle type (1-Nangletype)
atom1,atom2,atom3 = IDs of 1st,2nd,3rd atoms in angle
</PRE>
example:
<BR>
<PRE> 2 2 17 29 430
</PRE>
</UL>
<P>The 3 atoms are ordered linearly within the angle. Thus the central
atom (around which the angle is computed) is the atom2 in the list.
E.g. H,O,H for a water molecule. The <I>Angles</I> section must appear
after the <I>Atoms</I> section. All values in this section must be
integers (1, not 1.0).
</P>
<HR>
<P><I>AngleTorsion Coeffs</I> section:
</P>
<UL><LI>one line per dihedral type
<LI>line syntax: ID coeffs
<PRE> ID = dihedral type (1-N)
coeffs = list of coeffs (see <A HREF = "dihedral_coeff.html">dihedral_coeff</A>)
</PRE>
</UL>
<HR>
<P><I>Atoms</I> section:
</P>
<UL><LI>one line per atom
<LI>line syntax: depends on atom style
</UL>
<P>An <I>Atoms</I> section must appear in the data file if natoms > 0 in the
header section. The atoms can be listed in any order. These are the
line formats for each <A HREF = "atom_style.html">atom style</A> in LAMMPS. As
discussed below, each line can optionally have 3 flags (nx,ny,nz)
appended to it, which indicate which image of a periodic simulation
box the atom is in. These may be important to include for some kinds
of analysis.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >angle</TD><TD > atom-ID molecule-ID atom-type x y z</TD></TR>
<TR><TD >atomic</TD><TD > atom-ID atom-type x y z</TD></TR>
<TR><TD >bond</TD><TD > atom-ID molecule-ID atom-type x y z</TD></TR>
<TR><TD >charge</TD><TD > atom-ID atom-type q x y z</TD></TR>
<TR><TD >dipole</TD><TD > atom-ID atom-type q x y z mux muy muz</TD></TR>
<TR><TD >electron</TD><TD > atom-ID atom-type q spin eradius x y z</TD></TR>
<TR><TD >ellipsoid</TD><TD > atom-ID atom-type ellipsoidflag density x y z</TD></TR>
<TR><TD >full</TD><TD > atom-ID molecule-ID atom-type q x y z</TD></TR>
<TR><TD >line</TD><TD > atom-ID molecule-ID atom-type lineflag density x y z</TD></TR>
<TR><TD >meso</TD><TD > atom-ID atom-type rho e cv x y z</TD></TR>
<TR><TD >molecular</TD><TD > atom-ID molecule-ID atom-type x y z</TD></TR>
<TR><TD >peri</TD><TD > atom-ID atom-type volume density x y z</TD></TR>
<TR><TD >sphere</TD><TD > atom-ID atom-type diameter density x y z</TD></TR>
<TR><TD >tri</TD><TD > atom-ID molecule-ID atom-type triangleflag density x y z</TD></TR>
<TR><TD >wavepacket</TD><TD > atom-ID atom-type charge spin eradius etag cs_re cs_im x y z</TD></TR>
<TR><TD >hybrid</TD><TD > atom-ID atom-type x y z sub-style1 sub-style2 ...
</TD></TR></TABLE></DIV>
<P>The keywords have these meanings:
</P>
<UL><LI>atom-ID = integer ID of atom
<LI>molecule-ID = integer ID of molecule the atom belongs to
<LI>atom-type = type of atom (1-Ntype)
<LI>q = charge on atom (charge units)
<LI>diameter = diameter of spherical atom (distance units)
<LI>ellipsoidflag = 1 for ellipsoidal particles, 0 for point particles
<LI>lineflag = 1 for line segment particles, 0 for point particles
<LI>triangleflag = 1 for triangular particles, 0 for point particles
<LI>density = density of particle (mass/distance^3 or mass/distance^2 or mass/distance units, depending on dimensionality of particle)
<LI>volume = volume of atom (distance^3 units)
<LI>x,y,z = coordinates of atom
<LI>mux,muy,muz = components of dipole moment of atom (dipole units)
<LI>rho = density (need units) for SPH particles
<LI>e = energy (need units) for SPH particles
<LI>cv = heat capacity (need units) for SPH particles
<LI>spin = electron spin (+1/-1), 0 = nuclei, 2 = fixed-core, 3 = pseudo-cores (i.e. ECP)
<LI>eradius = electron radius (or fixed-core radius)
<LI>etag = integer ID of electron that each wavepacket belongs to
<LI>cs_re,cs_im = real/imaginary parts of wavepacket coefficients
</UL>
<P>The units for these quantities depend on the unit style; see the
<A HREF = "units.html">units</A> command for details.
</P>
<P>For 2d simulations specify z as 0.0, or a value within the <I>zlo zhi</I>
setting in the data file header.
</P>
<P>The atom-ID is used to identify the atom throughout the simulation and
in dump files. Normally, it is a unique value from 1 to Natoms for
each atom. Unique values larger than Natoms can be used, but they
will cause extra memory to be allocated on each processor, if an atom
map array is used (see the <A HREF = "atom_modify.html">atom_modify</A> command).
If an atom map array is not used (e.g. an atomic system with no
bonds), and velocities are not assigned in the data file, and you
don't care if unique atom IDs appear in dump files, then the atom-IDs
can all be set to 0.
</P>
<P>The molecule ID is a 2nd identifier attached to an atom. Normally, it
is a number from 1 to N, identifying which molecule the atom belongs
to. It can be 0 if it is an unbonded atom or if you don't care to
keep track of molecule assignments.
</P>
<P>The diameter specifies the size of a finite-size spherical particle.
It can be set to 0.0, which means that atom is a point particle.
</P>
<P>The ellipsoidflag, lineflag, and triangleflag determine whether the
particle is a finite-size ellipsoid or line or triangle of finite
size, or a point particle. Additional attributes must be defined for
each ellipsoid in the <I>Ellipsoids</I> section. Additional attributes
must be defined for each line in the <I>Lines</I> section. Additional
attributes must be defined for each triangle in the <I>Triangles</I>
section.
</P>
<P>Some pair styles and fixes and computes that operate on finite-size
particles allow for a mixture of finite-size and point particles. See
the doc pages of individual commands for details.
</P>
<P>The density is used in conjunction with the particle volume for
finite-size particles to set the mass of the particle as mass =
density * volume. In this context, volume can be a 3d quantity (for
spheres or ellipsoids), a 2d quantity (for triangles), or a 1d
quantity (for line segments). If the volume is 0.0, meaning a point
particle, then the density value is used as the mass.
</P>
<P>For atom_style hybrid, following the 5 initial values (ID,type,x,y,z),
specific values for each sub-style must be listed. The order of the
sub-styles is the same as they were listed in the
<A HREF = "atom_style.html">atom_style</A> command. The sub-style specific values
are those that are not the 5 standard ones (ID,type,x,y,z). For
example, for the "charge" sub-style, a "q" value would appear. For
the "full" sub-style, a "molecule-ID" and "q" would appear. These are
listed in the same order they appear as listed above. Thus if
</P>
<PRE>atom_style hybrid charge sphere
</PRE>
<P>were used in the input script, each atom line would have these fields:
</P>
<PRE>atom-ID atom-type x y z q diameter density
</PRE>
<P>Atom lines (all lines or none of them) can optionally list 3 trailing
integer values: nx,ny,nz. For periodic dimensions, they specify which
image of the simulation box the atom is considered to be in. An image
of 0 means it is inside the box as defined. A value of 2 means add 2
box lengths to get the true value. A value of -1 means subtract 1 box
length to get the true value. LAMMPS updates these flags as atoms
cross periodic boundaries during the simulation. The flags can be
output with atom snapshots via the <A HREF = "dump.html">dump</A> command.
</P>
<P>If nx,ny,nz values are not set in the data file, LAMMPS initializes
them to 0. If image information is needed for later analysis and they
are not all initially 0, it's important to set them correctly in the
data file. Also, if you plan to use the <A HREF = "replicate.html">replicate</A>
command to generate a larger system, these flags must be listed
correctly for bonded atoms when the bond crosses a periodic boundary.
I.e. the values of the image flags should be different by 1 (in the
appropriate dimension) for the two atoms in such a bond.
</P>
<P>Atom velocities and other atom quantities not defined above are set to
0.0 when the <I>Atoms</I> section is read. Velocities can be set later by
a <I>Velocities</I> section in the data file or by a
<A HREF = "velocity.html">velocity</A> or <A HREF = "set.html">set</A> command in the input
script.
</P>
<HR>
<P><I>Bond Coeffs</I> section:
</P>
<UL><LI>one line per bond type
<LI>line syntax: ID coeffs
<PRE> ID = bond type (1-N)
coeffs = list of coeffs
</PRE>
<LI>example:
<PRE> 4 250 1.49
</PRE>
</UL>
<P>The number and meaning of the coefficients are specific to the defined
bond style. See the <A HREF = "bond_style.html">bond_style</A> and
<A HREF = "bond_coeff.html">bond_coeff</A> commands for details. Coefficients can
also be set via the <A HREF = "bond_coeff.html">bond_coeff</A> command in the input
script.
</P>
<HR>
<P><I>BondAngle Coeffs</I> section:
</P>
<UL><LI>one line per angle type
<LI>line syntax: ID coeffs
<PRE> ID = angle type (1-N)
coeffs = list of coeffs (see class 2 section of <A HREF = "angle_coeff.html">angle_coeff</A>)
</PRE>
</UL>
<HR>
<P><I>BondBond Coeffs</I> section:
</P>
<UL><LI>one line per angle type
<LI>line syntax: ID coeffs
<PRE> ID = angle type (1-N)
coeffs = list of coeffs (see class 2 section of <A HREF = "angle_coeff.html">angle_coeff</A>)
</PRE>
</UL>
<HR>
<P><I>BondBond13 Coeffs</I> section:
</P>
<UL><LI>one line per dihedral type
<LI>line syntax: ID coeffs
<PRE> ID = dihedral type (1-N)
coeffs = list of coeffs (see class 2 section of <A HREF = "dihedral_coeff.html">dihedral_coeff</A>)
</PRE>
</UL>
<HR>
<P><I>Bonds</I> section:
</P>
<UL><LI>one line per bond
<LI>line syntax: ID type atom1 atom2
<PRE> ID = bond number (1-Nbonds)
type = bond type (1-Nbondtype)
atom1,atom2 = IDs of 1st,2nd atoms in bond
</PRE>
<LI>example:
<PRE> 12 3 17 29
</PRE>
</UL>
<P>The <I>Bonds</I> section must appear after the <I>Atoms</I> section. All values
in this section must be integers (1, not 1.0).
</P>
<HR>
<P><I>Dihedral Coeffs</I> section:
</P>
<UL><LI>one line per dihedral type
<LI>line syntax: ID coeffs
<PRE> ID = dihedral type (1-N)
coeffs = list of coeffs
</PRE>
<LI>example:
<PRE> 3 0.6 1 0 1
</PRE>
</UL>
<P>The number and meaning of the coefficients are specific to the defined
dihedral style. See the <A HREF = "dihedral_style.html">dihedral_style</A> and
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> commands for details.
Coefficients can also be set via the
<A HREF = "dihedral_coeff.html">dihedral_coeff</A> command in the input script.
</P>
<HR>
<P><I>Dihedrals</I> section:
</P>
<UL><LI>one line per dihedral
<LI>line syntax: ID type atom1 atom2 atom3 atom4
<PRE> ID = number of dihedral (1-Ndihedrals)
type = dihedral type (1-Ndihedraltype)
atom1,atom2,atom3,atom4 = IDs of 1st,2nd,3rd,4th atoms in dihedral
</PRE>
<LI>example:
<PRE> 12 4 17 29 30 21
</PRE>
</UL>
<P>The 4 atoms are ordered linearly within the dihedral. The <I>Dihedrals</I>
section must appear after the <I>Atoms</I> section. All values in this
section must be integers (1, not 1.0).
</P>
<HR>
<P><I>Ellipsoids</I> section:
</P>
<UL><LI>one line per ellipsoid
<LI>line syntax: atom-ID shapex shapey shapez quatw quati quatj quatk
<LI> atom-ID = ID of atom which is an ellipsoid
shapex,shapey,shapez = 3 diameters of ellipsoid (distance units)
quatw,quati,quatj,quatk = quaternion components for orientation of atom
example:
<PRE> 12 1 2 1 1 0 0 0
</PRE>
</UL>
<P>The <I>Ellipsoids</I> section must appear if <A HREF = "atom_style.html">atom_style
ellipsoid</A> is used and any atoms are listed in the
<I>Atoms</I> section with an ellipsoidflag = 1. The number of ellipsoids
should be specified in the header section via the "ellipsoids"
keyword.
</P>
<P>The 3 shape values specify the 3 diameters or aspect ratios of a
finite-size ellipsoidal particle, when it is oriented along the 3
coordinate axes. They must all be non-zero values.
</P>
<P>The values <I>quatw</I>, <I>quati</I>, <I>quatj</I>, and <I>quatk</I> set the orientation
of the atom as a quaternion (4-vector). Note that the shape
attributes specify the aspect ratios of an ellipsoidal particle, which
is oriented by default with its x-axis along the simulation box's
x-axis, and similarly for y and z. If this body is rotated (via the
right-hand rule) by an angle theta around a unit vector (a,b,c), then
the quaternion that represents its new orientation is given by
(cos(theta/2), a*sin(theta/2), b*sin(theta/2), c*sin(theta/2)). These
4 components are quatw, quati, quatj, and quatk as specified above.
LAMMPS normalizes each atom's quaternion in case (a,b,c) is not
specified as a unit vector.
</P>
<P>The <I>Ellipsoids</I> section must appear after the <I>Atoms</I> section.
</P>
<HR>
<P><I>EndBondTorsion Coeffs</I> section:
</P>
<UL><LI>one line per dihedral type
<LI>line syntax: ID coeffs
<PRE> ID = dihedral type (1-N)
coeffs = list of coeffs (see class 2 section of <A HREF = "dihedral_coeff.html">dihedral_coeff</A>)
</PRE>
</UL>
<HR>
<P><I>Improper Coeffs</I> section:
</P>
<UL><LI>one line per improper type
<LI>line syntax: ID coeffs
<PRE> ID = improper type (1-N)
coeffs = list of coeffs
</PRE>
<LI>example:
<PRE> 2 20 0.0548311
</PRE>
</UL>
<P>The number and meaning of the coefficients are specific to the defined
improper style. See the <A HREF = "improper_style.html">improper_style</A> and
<A HREF = "improper_coeff.html">improper_coeff</A> commands for details.
Coefficients can also be set via the
<A HREF = "improper_coeff.html">improper_coeff</A> command in the input script.
</P>
<HR>
<P><I>Impropers</I> section:
</P>
<UL><LI>one line per improper
<LI>line syntax: ID type atom1 atom2 atom3 atom4
<PRE> ID = number of improper (1-Nimpropers)
type = improper type (1-Nimpropertype)
atom1,atom2,atom3,atom4 = IDs of 1st,2nd,3rd,4th atoms in improper
</PRE>
<LI>example:
<PRE> 12 3 17 29 13 100
</PRE>
</UL>
<P>The ordering of the 4 atoms determines the definition of the improper
angle used in the formula for each <A HREF = "improper_style.html">improper
style</A>. See the doc pages for individual styles
for details.
</P>
<P>The <I>Impropers</I> section must appear after the <I>Atoms</I> section. All
values in this section must be integers (1, not 1.0).
</P>
<HR>
<P><I>Lines</I> section:
</P>
<UL><LI>one line per line segment
<LI>line syntax: atom-ID x1 y1 x2 y2
<LI> atom-ID = ID of atom which is a line segment
x1,y1 = 1st end point
x2,y2 = 2nd end point
example:
<PRE> 12 1.0 0.0 2.0 0.0
</PRE>
</UL>
<P>The <I>Lines</I> section must appear if <A HREF = "atom_style.html">atom_style line</A>
is used and any atoms are listed in the <I>Atoms</I> section with a
lineflag = 1. The number of lines should be specified in the header
section via the "lines" keyword.
</P>
<P>The 2 end points are the end points of the line segment. The ordering
of the 2 points should be such that using a right-hand rule to cross
the line segment with a unit vector in the +z direction, gives an
"outward" normal vector perpendicular to the line segment.
I.e. normal = (c2-c1) x (0,0,1). This orientation may be important
for defining some interactions.
</P>
<P>The <I>Lines</I> section must appear after the <I>Atoms</I> section.
</P>
<HR>
<P><I>Masses</I> section:
</P>
<UL><LI>one line per atom type
<LI>line syntax: ID mass
<PRE> ID = atom type (1-N)
mass = mass value
</PRE>
<LI>example:
<PRE> 3 1.01
</PRE>
</UL>
<P>This defines the mass of each atom type. This can also be set via the
<A HREF = "mass.html">mass</A> command in the input script. This section cannot be
used for atom styles that define a mass for individual atoms -
e.g. <A HREF = "atom_style.html">atom_style sphere</A>.
</P>
<HR>
<P><I>MiddleBondTorsion Coeffs</I> section:
</P>
<UL><LI>one line per dihedral type
<LI>line syntax: ID coeffs
<PRE> ID = dihedral type (1-N)
coeffs = list of coeffs (see class 2 section of <A HREF = "dihedral_coeff.html">dihedral_coeff</A>)
</PRE>
</UL>
<HR>
<P><I>Pair Coeffs</I> section:
</P>
<UL><LI>one line per atom type
<LI>line syntax: ID coeffs
<PRE> ID = atom type (1-N)
coeffs = list of coeffs
</PRE>
<LI>example:
<PRE> 3 0.022 2.35197 0.022 2.35197
</PRE>
</UL>
<P>The number and meaning of the coefficients are specific to the defined
pair style. See the <A HREF = "pair_style.html">pair_style</A> and
<A HREF = "pair_coeff.html">pair_coeff</A> commands for details. Coefficients can
also be set via the <A HREF = "pair_coeff.html">pair_coeff</A> command in the input
script.
</P>
<HR>
<P><I>Triangles</I> section:
</P>
<UL><LI>one line per triangle
<LI>line syntax: atom-ID x1 y1 x2 y2
<LI> atom-ID = ID of atom which is a line segment
x1,y1,z1 = 1st corner point
x2,y2,z2 = 2nd corner point
x3,y3,z3 = 3rd corner point
example:
<PRE> 12 0.0 0.0 0.0 2.0 0.0 1.0 0.0 2.0 1.0
</PRE>
</UL>
<P>The <I>Triangles</I> section must appear if <A HREF = "atom_style.html">atom_style
tri</A> is used and any atoms are listed in the <I>Atoms</I>
section with a triangleflag = 1. The number of lines should be
specified in the header section via the "triangles" keyword.
</P>
<P>The 3 corner points are the corner points of the triangle. The
ordering of the 3 points should be such that using a right-hand rule
to go from point1 to point2 to point3 gives an "outward" normal vector
to the face of the triangle. I.e. normal = (c2-c1) x (c3-c1). This
orientation may be important for defining some interactions.
</P>
<P>The <I>Triangles</I> section must appear after the <I>Atoms</I> section.
</P>
<HR>
<P><I>Velocities</I> section:
</P>
<UL><LI>one line per atom
<LI>line syntax: depends on atom style
</UL>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >all styles except those listed</TD><TD > atom-ID vx vy vz</TD></TR>
<TR><TD >dipole</TD><TD > atom-ID vx vy vz wx wy wz</TD></TR>
<TR><TD >electron</TD><TD > atom-ID vx vy vz evel</TD></TR>
<TR><TD >ellipsoid</TD><TD > atom-ID vx vy vz lx ly lz</TD></TR>
<TR><TD >sphere</TD><TD > atom-ID vx vy vz wx wy wz
</TD></TR></TABLE></DIV>
<P>where the keywords have these meanings:
</P>
<P>vx,vy,vz = translational velocity of atom
lx,ly,lz = angular momentum of aspherical atom
wx,wy,wz = angular velocity of spherical atom
evel = electron radial velocity (0 for fixed-core):ul
</P>
<P>The velocity lines can appear in any order. This section can only be
used after an <I>Atoms</I> section. This is because the <I>Atoms</I> section
must have assigned a unique atom ID to each atom so that velocities
can be assigned to them.
</P>
<P>Vx, vy, vz, and evel are in <A HREF = "units.html">units</A> of velocity. Lx, ly,
lz are in units of angular momentum (distance-velocity-mass). Wx, Wy,
Wz are in units of angular velocity (radians/time).
</P>
<P>Translational velocities can also be set by the
<A HREF = "velocity.html">velocity</A> command in the input script.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>To read gzipped data files, you must compile LAMMPS with the
-DLAMMPS_GZIP option - see the <A HREF = "Section_start.html#start_2">Making
LAMMPS</A> section of the documentation.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "read_restart.html">read_restart</A>, <A HREF = "create_atoms.html">create_atoms</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/read_data.txt b/doc/read_data.txt
index b9fcccd0f..fd28395df 100644
--- a/doc/read_data.txt
+++ b/doc/read_data.txt
@@ -1,719 +1,719 @@
"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
read_data command :h3
[Syntax:]
read_data file :pre
file = name of data file to read in :ul
[Examples:]
read_data data.lj
read_data ../run7/data.polymer.gz :pre
[Description:]
Read in a data file containing information LAMMPS needs to run a
simulation. The file can be ASCII text or a gzipped text file
(detected by a .gz suffix). This is one of 3 ways to specify initial
atom coordinates; see the "read_restart"_read_restart.html and
"create_atoms"_create_atoms.html commands for alternative methods.
The structure of the data file is important, though many settings and
sections are optional or can come in any order. See the examples
directory for sample data files for different problems.
A data file has a header and a body. The header appears first. The
first line of the header is always skipped; it typically contains a
description of the file. Then lines are read one at a time. Lines
can have a trailing comment starting with '#' that is ignored. If the
line is blank (only whitespace after comment is deleted), it is
skipped. If the line contains a header keyword, the corresponding
value(s) is read from the line. If it doesn't contain a header
keyword, the line begins the body of the file.
The body of the file contains zero or more sections. The first line
of a section has only a keyword. The next line is skipped. The
remaining lines of the section contain values. The number of lines
depends on the section keyword as described below. Zero or more blank
lines can be used between sections. Sections can appear in any order,
with a few exceptions as noted below.
The formatting of individual lines in the data file (indentation,
spacing between words and numbers) is not important except that header
and section keywords (e.g. atoms, xlo xhi, Masses, Bond Coeffs) must
be capitalized as shown and can't have extra white space between their
words - e.g. two spaces or a tab between "Bond" and "Coeffs" is not
valid.
:line
These are the recognized header keywords. Header lines can come in
any order. The value(s) are read from the beginning of the line.
Thus the keyword {atoms} should be in a line like "1000 atoms"; the
keyword {ylo yhi} should be in a line like "-10.0 10.0 ylo yhi"; the
keyword {xy xz yz} should be in a line like "0.0 5.0 6.0 xy xz yz".
All these settings have a default value of 0, except the lo/hi box
size defaults are -0.5 and 0.5. A line need only appear if the value
is different than the default.
{atoms} = # of atoms in system
{bonds} = # of bonds in system
{angles} = # of angles in system
{dihedrals} = # of dihedrals in system
{impropers} = # of impropers in system
{atom types} = # of atom types in system
{bond types} = # of bond types in system
{angle types} = # of angle types in system
{dihedral types} = # of dihedral types in system
{improper types} = # of improper types in system
{extra bond per atom} = leave space for this many new bonds per atom
{ellipsoids} = # of ellipsoids in system
{lines} = # of line segments in system
{triangles} = # of triangles in system
{xlo xhi} = simulation box boundaries in x dimension
{ylo yhi} = simulation box boundaries in y dimension
{zlo zhi} = simulation box boundaries in z dimension
{xy xz yz} = simulation box tilt factors for triclinic system :ul
The initial simulation box size is determined by the lo/hi settings.
In any dimension, the system may be periodic or non-periodic; see the
"boundary"_boundary.html command.
If the {xy xz yz} line does not appear, LAMMPS will set up an
axis-aligned (orthogonal) simulation box. If the line does appear,
LAMMPS creates a non-orthogonal simulation domain shaped as a
parallelepiped with triclinic symmetry. The parallelepiped has its
"origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors starting
from the origin given by A = (xhi-xlo,0,0); B = (xy,yhi-ylo,0); C =
(xz,yz,zhi-zlo). {Xy,xz,yz} can be 0.0 or positive or negative values
and are called "tilt factors" because they are the amount of
displacement applied to faces of an originally orthogonal box to
transform it into the parallelepiped.
The tilt factors (xy,xz,yz) can not skew the box more than half the
distance of the corresponding parallel box length. For example, if
xlo = 2 and xhi = 12, then the x box length is 10 and the xy tilt
factor must be between -5 and 5. Similarly, both xz and yz must be
between -(xhi-xlo)/2 and +(yhi-ylo)/2. Note that this is not a
limitation, since if the maximum tilt factor is 5 (as in this
example), then configurations with tilt = ..., -15, -5, 5, 15, 25,
... are all geometrically equivalent.
-See "this section"_Section_howto.html#howto_12 of the doc pages for a
-geometric description of triclinic boxes, as defined by LAMMPS, and
-how to transform these parameters to and from other commonly used
+See "Section_howto 12"_Section_howto.html#howto_12 of the doc pages
+for a geometric description of triclinic boxes, as defined by LAMMPS,
+and how to transform these parameters to and from other commonly used
triclinic representations.
When a triclinic system is used, the simulation domain must be
periodic in any dimensions with a non-zero tilt factor, as defined by
the "boundary"_boundary.html command. I.e. if the xy tilt factor is
non-zero, then both the x and y dimensions must be periodic.
Similarly, x and z must be periodic if xz is non-zero and y and z must
be periodic if yz is non-zero. Also note that if your simulation will
tilt the box, e.g. via the "fix deform"_fix_deform.html command, the
simulation box must be defined as triclinic, even if the tilt factors
are initially 0.0.
For 2d simulations, the {zlo zhi} values should be set to bound the z
coords for atoms that appear in the file; the default of -0.5 0.5 is
valid if all z coords are 0.0. For 2d triclinic simulations, the xz
and yz tilt factors must be 0.0.
If the system is periodic (in a dimension), then atom coordinates can
be outside the bounds (in that dimension); they will be remapped (in a
periodic sense) back inside the box.
IMPORTANT NOTE: If the system is non-periodic (in a dimension), then
all atoms in the data file must have coordinates (in that dimension)
that are "greater than or equal to" the lo value and "less than or
equal to" the hi value. If the non-periodic dimension is of style
"fixed" (see the "boundary"_boundary.html command), then the atom
coords must be strictly "less than" the hi value, due to the way
LAMMPS assign atoms to processors. Note that you should not make the
lo/hi values radically smaller/larger than the extent of the atoms.
For example, if your atoms extend from 0 to 50, you should not specify
the box bounds as -10000 and 10000. This is because LAMMPS uses the
specified box size to layout the 3d grid of processors. A huge
(mostly empty) box will be sub-optimal for performance when using
"fixed" boundary conditions (see the "boundary"_boundary.html
command). When using "shrink-wrap" boundary conditions (see the
"boundary"_boundary.html command), a huge (mostly empty) box may cause
a parallel simulation to lose atoms the first time that LAMMPS
shrink-wraps the box around the atoms.
The "extra bond per atom" setting should be used if new bonds will be
added to the system when a simulation runs, e.g. by using the "fix
bond/create"_fix_bond_create.html command. This will pre-allocate
space in LAMMPS data structures for storing the new bonds.
The "ellipsoids" and "lines" and "triangles" settings are only used
with "atom_style ellipsoid or line or tri"_atom_style.html and
specifies how many of the atoms are finite-size ellipsoids or lines or
triangles; the remainder are point particles. See the discussion of
ellipsoidflag and the {Ellipsoids} section below. See the discussion
of lineflag and the {Lines} section below. See the discussion of
triangleflag and the {Triangles} section below.
:line
These are the section keywords for the body of the file.
{Atoms, Velocities, Masses, Ellipsoids, Lines, Triangles} = atom-property sections
{Bonds, Angles, Dihedrals, Impropers} = molecular topology sections
{Pair Coeffs, Bond Coeffs, Angle Coeffs, Dihedral Coeffs, \
Improper Coeffs} = force field sections
{BondBond Coeffs, BondAngle Coeffs, MiddleBondTorsion Coeffs, \
EndBondTorsion Coeffs, AngleTorsion Coeffs, AngleAngleTorsion Coeffs, \
BondBond13 Coeffs, AngleAngle Coeffs} = class 2 force field sections :ul
Each section is listed below in alphabetic order. The format of each
section is described including the number of lines it must contain and
rules (if any) for where it can appear in the data file.
Any individual line in the various sections can have a trailing
comment starting with "#" for annotation purposes. E.g. in the
Atoms section:
10 1 17 -1.0 10.0 5.0 6.0 # salt ion :pre
:line
{Angle Coeffs} section:
one line per angle type :ulb,l
line syntax: ID coeffs :l
ID = angle type (1-N)
coeffs = list of coeffs :pre
example: :l
6 70 108.5 0 0 :pre
:ule
The number and meaning of the coefficients are specific to the defined
angle style. See the "angle_style"_angle_style.html and
"angle_coeff"_angle_coeff.html commands for details. Coefficients can
also be set via the "angle_coeff"_angle_coeff.html command in the
input script.
:line
{AngleAngle Coeffs} section:
one line per improper type :ulb,l
line syntax: ID coeffs :l
ID = improper type (1-N)
coeffs = list of coeffs (see "improper_coeff"_improper_coeff.html) :pre
:ule
:line
{AngleAngleTorsion Coeffs} section:
one line per dihedral type :ulb,l
line syntax: ID coeffs :l
ID = dihedral type (1-N)
coeffs = list of coeffs (see "dihedral_coeff"_dihedral_coeff.html) :pre
:ule
:line
{Angles} section:
one line per angle :ulb,l
line syntax: ID type atom1 atom2 atom3 :l
ID = number of angle (1-Nangles)
type = angle type (1-Nangletype)
atom1,atom2,atom3 = IDs of 1st,2nd,3rd atoms in angle :pre
example: :b
2 2 17 29 430 :pre
:ule
The 3 atoms are ordered linearly within the angle. Thus the central
atom (around which the angle is computed) is the atom2 in the list.
E.g. H,O,H for a water molecule. The {Angles} section must appear
after the {Atoms} section. All values in this section must be
integers (1, not 1.0).
:line
{AngleTorsion Coeffs} section:
one line per dihedral type :ulb,l
line syntax: ID coeffs :l
ID = dihedral type (1-N)
coeffs = list of coeffs (see "dihedral_coeff"_dihedral_coeff.html) :pre
:ule
:line
{Atoms} section:
one line per atom
line syntax: depends on atom style :ul
An {Atoms} section must appear in the data file if natoms > 0 in the
header section. The atoms can be listed in any order. These are the
line formats for each "atom style"_atom_style.html in LAMMPS. As
discussed below, each line can optionally have 3 flags (nx,ny,nz)
appended to it, which indicate which image of a periodic simulation
box the atom is in. These may be important to include for some kinds
of analysis.
angle: atom-ID molecule-ID atom-type x y z
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
dipole: atom-ID atom-type q x y z mux muy muz
electron: atom-ID atom-type q spin eradius x y z
ellipsoid: atom-ID atom-type ellipsoidflag density x y z
full: atom-ID molecule-ID atom-type q x y z
line: atom-ID molecule-ID atom-type lineflag density x y z
meso: atom-ID atom-type rho e cv x y z
molecular: atom-ID molecule-ID atom-type x y z
peri: atom-ID atom-type volume density x y z
sphere: atom-ID atom-type diameter density x y z
tri: atom-ID molecule-ID atom-type triangleflag density x y z
wavepacket: atom-ID atom-type charge spin eradius etag cs_re cs_im x y z
hybrid: atom-ID atom-type x y z sub-style1 sub-style2 ... :tb(s=:)
The keywords have these meanings:
atom-ID = integer ID of atom
molecule-ID = integer ID of molecule the atom belongs to
atom-type = type of atom (1-Ntype)
q = charge on atom (charge units)
diameter = diameter of spherical atom (distance units)
ellipsoidflag = 1 for ellipsoidal particles, 0 for point particles
lineflag = 1 for line segment particles, 0 for point particles
triangleflag = 1 for triangular particles, 0 for point particles
density = density of particle (mass/distance^3 or mass/distance^2 or mass/distance units, depending on dimensionality of particle)
volume = volume of atom (distance^3 units)
x,y,z = coordinates of atom
mux,muy,muz = components of dipole moment of atom (dipole units)
rho = density (need units) for SPH particles
e = energy (need units) for SPH particles
cv = heat capacity (need units) for SPH particles
spin = electron spin (+1/-1), 0 = nuclei, 2 = fixed-core, 3 = pseudo-cores (i.e. ECP)
eradius = electron radius (or fixed-core radius)
etag = integer ID of electron that each wavepacket belongs to
cs_re,cs_im = real/imaginary parts of wavepacket coefficients :ul
The units for these quantities depend on the unit style; see the
"units"_units.html command for details.
For 2d simulations specify z as 0.0, or a value within the {zlo zhi}
setting in the data file header.
The atom-ID is used to identify the atom throughout the simulation and
in dump files. Normally, it is a unique value from 1 to Natoms for
each atom. Unique values larger than Natoms can be used, but they
will cause extra memory to be allocated on each processor, if an atom
map array is used (see the "atom_modify"_atom_modify.html command).
If an atom map array is not used (e.g. an atomic system with no
bonds), and velocities are not assigned in the data file, and you
don't care if unique atom IDs appear in dump files, then the atom-IDs
can all be set to 0.
The molecule ID is a 2nd identifier attached to an atom. Normally, it
is a number from 1 to N, identifying which molecule the atom belongs
to. It can be 0 if it is an unbonded atom or if you don't care to
keep track of molecule assignments.
The diameter specifies the size of a finite-size spherical particle.
It can be set to 0.0, which means that atom is a point particle.
The ellipsoidflag, lineflag, and triangleflag determine whether the
particle is a finite-size ellipsoid or line or triangle of finite
size, or a point particle. Additional attributes must be defined for
each ellipsoid in the {Ellipsoids} section. Additional attributes
must be defined for each line in the {Lines} section. Additional
attributes must be defined for each triangle in the {Triangles}
section.
Some pair styles and fixes and computes that operate on finite-size
particles allow for a mixture of finite-size and point particles. See
the doc pages of individual commands for details.
The density is used in conjunction with the particle volume for
finite-size particles to set the mass of the particle as mass =
density * volume. In this context, volume can be a 3d quantity (for
spheres or ellipsoids), a 2d quantity (for triangles), or a 1d
quantity (for line segments). If the volume is 0.0, meaning a point
particle, then the density value is used as the mass.
For atom_style hybrid, following the 5 initial values (ID,type,x,y,z),
specific values for each sub-style must be listed. The order of the
sub-styles is the same as they were listed in the
"atom_style"_atom_style.html command. The sub-style specific values
are those that are not the 5 standard ones (ID,type,x,y,z). For
example, for the "charge" sub-style, a "q" value would appear. For
the "full" sub-style, a "molecule-ID" and "q" would appear. These are
listed in the same order they appear as listed above. Thus if
atom_style hybrid charge sphere :pre
were used in the input script, each atom line would have these fields:
atom-ID atom-type x y z q diameter density :pre
Atom lines (all lines or none of them) can optionally list 3 trailing
integer values: nx,ny,nz. For periodic dimensions, they specify which
image of the simulation box the atom is considered to be in. An image
of 0 means it is inside the box as defined. A value of 2 means add 2
box lengths to get the true value. A value of -1 means subtract 1 box
length to get the true value. LAMMPS updates these flags as atoms
cross periodic boundaries during the simulation. The flags can be
output with atom snapshots via the "dump"_dump.html command.
If nx,ny,nz values are not set in the data file, LAMMPS initializes
them to 0. If image information is needed for later analysis and they
are not all initially 0, it's important to set them correctly in the
data file. Also, if you plan to use the "replicate"_replicate.html
command to generate a larger system, these flags must be listed
correctly for bonded atoms when the bond crosses a periodic boundary.
I.e. the values of the image flags should be different by 1 (in the
appropriate dimension) for the two atoms in such a bond.
Atom velocities and other atom quantities not defined above are set to
0.0 when the {Atoms} section is read. Velocities can be set later by
a {Velocities} section in the data file or by a
"velocity"_velocity.html or "set"_set.html command in the input
script.
:line
{Bond Coeffs} section:
one line per bond type :ulb,l
line syntax: ID coeffs :l
ID = bond type (1-N)
coeffs = list of coeffs :pre
example: :l
4 250 1.49 :pre
:ule
The number and meaning of the coefficients are specific to the defined
bond style. See the "bond_style"_bond_style.html and
"bond_coeff"_bond_coeff.html commands for details. Coefficients can
also be set via the "bond_coeff"_bond_coeff.html command in the input
script.
:line
{BondAngle Coeffs} section:
one line per angle type :ulb,l
line syntax: ID coeffs :l
ID = angle type (1-N)
coeffs = list of coeffs (see class 2 section of "angle_coeff"_angle_coeff.html) :pre
:ule
:line
{BondBond Coeffs} section:
one line per angle type :ulb,l
line syntax: ID coeffs :l
ID = angle type (1-N)
coeffs = list of coeffs (see class 2 section of "angle_coeff"_angle_coeff.html) :pre
:ule
:line
{BondBond13 Coeffs} section:
one line per dihedral type :ulb,l
line syntax: ID coeffs :l
ID = dihedral type (1-N)
coeffs = list of coeffs (see class 2 section of "dihedral_coeff"_dihedral_coeff.html) :pre
:ule
:line
{Bonds} section:
one line per bond :ulb,l
line syntax: ID type atom1 atom2 :l
ID = bond number (1-Nbonds)
type = bond type (1-Nbondtype)
atom1,atom2 = IDs of 1st,2nd atoms in bond :pre
example: :l
12 3 17 29 :pre
:ule
The {Bonds} section must appear after the {Atoms} section. All values
in this section must be integers (1, not 1.0).
:line
{Dihedral Coeffs} section:
one line per dihedral type :ulb,l
line syntax: ID coeffs :l
ID = dihedral type (1-N)
coeffs = list of coeffs :pre
example: :l
3 0.6 1 0 1 :pre
:ule
The number and meaning of the coefficients are specific to the defined
dihedral style. See the "dihedral_style"_dihedral_style.html and
"dihedral_coeff"_dihedral_coeff.html commands for details.
Coefficients can also be set via the
"dihedral_coeff"_dihedral_coeff.html command in the input script.
:line
{Dihedrals} section:
one line per dihedral :ulb,l
line syntax: ID type atom1 atom2 atom3 atom4 :l
ID = number of dihedral (1-Ndihedrals)
type = dihedral type (1-Ndihedraltype)
atom1,atom2,atom3,atom4 = IDs of 1st,2nd,3rd,4th atoms in dihedral :pre
example: :l
12 4 17 29 30 21 :pre
:ule
The 4 atoms are ordered linearly within the dihedral. The {Dihedrals}
section must appear after the {Atoms} section. All values in this
section must be integers (1, not 1.0).
:line
{Ellipsoids} section:
one line per ellipsoid :ulb,l
line syntax: atom-ID shapex shapey shapez quatw quati quatj quatk :l
atom-ID = ID of atom which is an ellipsoid
shapex,shapey,shapez = 3 diameters of ellipsoid (distance units)
quatw,quati,quatj,quatk = quaternion components for orientation of atom
example: :l
12 1 2 1 1 0 0 0 :pre
:ule
The {Ellipsoids} section must appear if "atom_style
ellipsoid"_atom_style.html is used and any atoms are listed in the
{Atoms} section with an ellipsoidflag = 1. The number of ellipsoids
should be specified in the header section via the "ellipsoids"
keyword.
The 3 shape values specify the 3 diameters or aspect ratios of a
finite-size ellipsoidal particle, when it is oriented along the 3
coordinate axes. They must all be non-zero values.
The values {quatw}, {quati}, {quatj}, and {quatk} set the orientation
of the atom as a quaternion (4-vector). Note that the shape
attributes specify the aspect ratios of an ellipsoidal particle, which
is oriented by default with its x-axis along the simulation box's
x-axis, and similarly for y and z. If this body is rotated (via the
right-hand rule) by an angle theta around a unit vector (a,b,c), then
the quaternion that represents its new orientation is given by
(cos(theta/2), a*sin(theta/2), b*sin(theta/2), c*sin(theta/2)). These
4 components are quatw, quati, quatj, and quatk as specified above.
LAMMPS normalizes each atom's quaternion in case (a,b,c) is not
specified as a unit vector.
The {Ellipsoids} section must appear after the {Atoms} section.
:line
{EndBondTorsion Coeffs} section:
one line per dihedral type :ulb,l
line syntax: ID coeffs :l
ID = dihedral type (1-N)
coeffs = list of coeffs (see class 2 section of "dihedral_coeff"_dihedral_coeff.html) :pre
:ule
:line
{Improper Coeffs} section:
one line per improper type :ulb,l
line syntax: ID coeffs :l
ID = improper type (1-N)
coeffs = list of coeffs :pre
example: :l
2 20 0.0548311 :pre
:ule
The number and meaning of the coefficients are specific to the defined
improper style. See the "improper_style"_improper_style.html and
"improper_coeff"_improper_coeff.html commands for details.
Coefficients can also be set via the
"improper_coeff"_improper_coeff.html command in the input script.
:line
{Impropers} section:
one line per improper :ulb,l
line syntax: ID type atom1 atom2 atom3 atom4 :l
ID = number of improper (1-Nimpropers)
type = improper type (1-Nimpropertype)
atom1,atom2,atom3,atom4 = IDs of 1st,2nd,3rd,4th atoms in improper :pre
example: :l
12 3 17 29 13 100 :pre
:ule
The ordering of the 4 atoms determines the definition of the improper
angle used in the formula for each "improper
style"_improper_style.html. See the doc pages for individual styles
for details.
The {Impropers} section must appear after the {Atoms} section. All
values in this section must be integers (1, not 1.0).
:line
{Lines} section:
one line per line segment :ulb,l
line syntax: atom-ID x1 y1 x2 y2 :l
atom-ID = ID of atom which is a line segment
x1,y1 = 1st end point
x2,y2 = 2nd end point
example: :l
12 1.0 0.0 2.0 0.0 :pre
:ule
The {Lines} section must appear if "atom_style line"_atom_style.html
is used and any atoms are listed in the {Atoms} section with a
lineflag = 1. The number of lines should be specified in the header
section via the "lines" keyword.
The 2 end points are the end points of the line segment. The ordering
of the 2 points should be such that using a right-hand rule to cross
the line segment with a unit vector in the +z direction, gives an
"outward" normal vector perpendicular to the line segment.
I.e. normal = (c2-c1) x (0,0,1). This orientation may be important
for defining some interactions.
The {Lines} section must appear after the {Atoms} section.
:line
{Masses} section:
one line per atom type :ulb,l
line syntax: ID mass :l
ID = atom type (1-N)
mass = mass value :pre
example: :l
3 1.01 :pre
:ule
This defines the mass of each atom type. This can also be set via the
"mass"_mass.html command in the input script. This section cannot be
used for atom styles that define a mass for individual atoms -
e.g. "atom_style sphere"_atom_style.html.
:line
{MiddleBondTorsion Coeffs} section:
one line per dihedral type :ulb,l
line syntax: ID coeffs :l
ID = dihedral type (1-N)
coeffs = list of coeffs (see class 2 section of "dihedral_coeff"_dihedral_coeff.html) :pre
:ule
:line
{Pair Coeffs} section:
one line per atom type :ulb,l
line syntax: ID coeffs :l
ID = atom type (1-N)
coeffs = list of coeffs :pre
example: :l
3 0.022 2.35197 0.022 2.35197 :pre
:ule
The number and meaning of the coefficients are specific to the defined
pair style. See the "pair_style"_pair_style.html and
"pair_coeff"_pair_coeff.html commands for details. Coefficients can
also be set via the "pair_coeff"_pair_coeff.html command in the input
script.
:line
{Triangles} section:
one line per triangle :ulb,l
line syntax: atom-ID x1 y1 x2 y2 :l
atom-ID = ID of atom which is a line segment
x1,y1,z1 = 1st corner point
x2,y2,z2 = 2nd corner point
x3,y3,z3 = 3rd corner point
example: :l
12 0.0 0.0 0.0 2.0 0.0 1.0 0.0 2.0 1.0 :pre
:ule
The {Triangles} section must appear if "atom_style
tri"_atom_style.html is used and any atoms are listed in the {Atoms}
section with a triangleflag = 1. The number of lines should be
specified in the header section via the "triangles" keyword.
The 3 corner points are the corner points of the triangle. The
ordering of the 3 points should be such that using a right-hand rule
to go from point1 to point2 to point3 gives an "outward" normal vector
to the face of the triangle. I.e. normal = (c2-c1) x (c3-c1). This
orientation may be important for defining some interactions.
The {Triangles} section must appear after the {Atoms} section.
:line
{Velocities} section:
one line per atom
line syntax: depends on atom style :ul
all styles except those listed: atom-ID vx vy vz
dipole: atom-ID vx vy vz wx wy wz
electron: atom-ID vx vy vz evel
ellipsoid: atom-ID vx vy vz lx ly lz
sphere: atom-ID vx vy vz wx wy wz :tb(s=:)
where the keywords have these meanings:
vx,vy,vz = translational velocity of atom
lx,ly,lz = angular momentum of aspherical atom
wx,wy,wz = angular velocity of spherical atom
evel = electron radial velocity (0 for fixed-core):ul
The velocity lines can appear in any order. This section can only be
used after an {Atoms} section. This is because the {Atoms} section
must have assigned a unique atom ID to each atom so that velocities
can be assigned to them.
Vx, vy, vz, and evel are in "units"_units.html of velocity. Lx, ly,
lz are in units of angular momentum (distance-velocity-mass). Wx, Wy,
Wz are in units of angular velocity (radians/time).
Translational velocities can also be set by the
"velocity"_velocity.html command in the input script.
:line
[Restrictions:]
To read gzipped data files, you must compile LAMMPS with the
-DLAMMPS_GZIP option - see the "Making
LAMMPS"_Section_start.html#start_2 section of the documentation.
[Related commands:]
"read_restart"_read_restart.html, "create_atoms"_create_atoms.html
[Default:] none
diff --git a/doc/region.html b/doc/region.html
index a9b089de7..58832093d 100644
--- a/doc/region.html
+++ b/doc/region.html
@@ -1,309 +1,309 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>region command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>region ID style args keyword arg ...
</PRE>
<UL><LI>ID = user-assigned name for the region
<LI>style = <I>delete</I> or <I>block</I> or <I>cone</I> or <I>cylinder</I> or <I>plane</I> or <I>prism</I> or <I>sphere</I> or <I>union</I> or <I>intersect</I>
<PRE> <I>delete</I> = no args
<I>block</I> args = xlo xhi ylo yhi zlo zhi
xlo,xhi,ylo,yhi,zlo,zhi = bounds of block in all dimensions (distance units)
<I>cone</I> args = dim c1 c2 radlo radhi lo hi
dim = <I>x</I> or <I>y</I> or <I>z</I> = axis of cone
c1,c2 = coords of cone axis in other 2 dimensions (distance units)
radlo,radhi = cone radii at lo and hi end (distance units)
lo,hi = bounds of cone in dim (distance units)
<I>cylinder</I> args = dim c1 c2 radius lo hi
dim = <I>x</I> or <I>y</I> or <I>z</I> = axis of cylinder
c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
radius = cylinder radius (distance units)
lo,hi = bounds of cylinder in dim (distance units)
<I>plane</I> args = px py pz nx ny nz
px,py,pz = point on the plane (distance units)
nx,ny,nz = direction normal to plane (distance units)
<I>prism</I> args = xlo xhi ylo yhi zlo zhi xy xz yz
xlo,xhi,ylo,yhi,zlo,zhi = bounds of untilted prism (distance units)
xy = distance to tilt y in x direction (distance units)
xz = distance to tilt z in x direction (distance units)
yz = distance to tilt z in y direction (distance units)
<I>sphere</I> args = x y z radius
x,y,z = center of sphere (distance units)
radius = radius of sphere (distance units)
<I>union</I> args = N reg-ID1 reg-ID2 ...
N = # of regions to follow, must be 2 or greater
reg-ID1,reg-ID2, ... = IDs of regions to join together
<I>intersect</I> args = N reg-ID1 reg-ID2 ...
N = # of regions to follow, must be 2 or greater
reg-ID1,reg-ID2, ... = IDs of regions to intersect
</PRE>
<LI>zero or more keyword/arg pairs may be appended
<LI>keyword = <I>side</I> or <I>units</I> or <I>move</I> or <I>rotate</I>
<PRE> <I>side</I> value = <I>in</I> or <I>out</I>
<I>in</I> = the region is inside the specified geometry
<I>out</I> = the region is outside the specified geometry
<I>units</I> value = <I>lattice</I> or <I>box</I>
<I>lattice</I> = the geometry is defined in lattice units
<I>box</I> = the geometry is defined in simulation box units
<I>move</I> args = v_x v_y v_z
v_x,v_y,v_z = equal-style variables for x,y,z displacement of region over time
<I>rotate</I> args = v_theta Px Py Pz Rx Ry Rz
v_theta = equal-style variable for rotaton of region over time (in radians)
Px,Py,Pz = origin for axis of rotation (distance units)
Rx,Ry,Rz = axis of rotation vector
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>region 1 block -3.0 5.0 INF 10.0 INF INF
region 2 sphere 0.0 0.0 0.0 5 side out
region void cylinder y 2 3 5 -5.0 EDGE units box
region 1 prism 0 10 0 10 0 10 2 0 0
region outside union 4 side1 side2 side3 side4
region 2 sphere 0.0 0.0 0.0 5 side out move v_left v_up NULL
</PRE>
<P><B>Description:</B>
</P>
<P>This command defines a geometric region of space. Various other
commands use regions. For example, the region can be filled with
atoms via the <A HREF = "create_atoms.html">create_atoms</A> command. Or a bounding
box around the region, can be used to define the simulation box via
the <A HREF = "create_box.html">create_box</A> command. Or the atoms in the region
can be identified as a group via the <A HREF = "group.html">group</A> command, or
deleted via the <A HREF = "delete_atoms.html">delete_atoms</A> command. Or the
surface of the region can be used as a boundary wall via the <A HREF = "fix_wall_region.html">fix
wall/region</A> command.
</P>
<P>Commands which use regions typically test whether an atom's position
is contained in the region or not. For this purpose, coordinates
exactly on the region boundary are considered to be interior to the
region. This means, for example, for a spherical region, an atom on
the sphere surface would be part of the region if the sphere were
defined with the <I>side in</I> keyword, but would not be part of the
region if it were defined using the <I>side out</I> keyword. See more
details on the <I>side</I> keyword below.
</P>
<P>Normally, regions in LAMMPS are "static", meaning their geometric
extent does not change with time. If the <I>move</I> or <I>rotate</I> keyword
is used, as described below, the region becomes "dynamic", meaning
it's location or orientation changes with time. This may be useful,
for example, when thermostatting a region, via the compute temp/region
command, or when the fix wall/region command uses a region surface as
a bounding wall on particle motion, i.e. a rotating container.
</P>
<P>The <I>delete</I> style removes the named region. Since there is little
overhead to defining extra regions, there is normally no need to do
this, unless you are defining and discarding large numbers of regions
in your input script.
</P>
<P>The lo/hi values for <I>block</I> or <I>cone</I> or <I>cylinder</I> or <I>prism</I> styles
can be specified as EDGE or INF. EDGE means they extend all the way
to the global simulation box boundary. Note that this is the current
box boundary; if the box changes size during a simulation, the region
does not. INF means a large negative or positive number (1.0e20), so
it should encompass the simulation box even if it changes size. If a
region is defined before the simulation box has been created (via
<A HREF = "create_box.html">create_box</A> or <A HREF = "read_data.html">read_data</A> or
<A HREF = "read_restart.html">read_restart</A> commands), then an EDGE or INF
parameter cannot be used. For a <I>prism</I> region, a non-zero tilt
factor in any pair of dimensions cannot be used if both the lo/hi
values in either of those dimensions are INF. E.g. if the xy tilt is
non-zero, then xlo and xhi cannot both be INF, nor can ylo and yhi.
</P>
<P>IMPORTANT NOTE: Regions in LAMMPS do not get wrapped across periodic
boundaries, as specified by the <A HREF = "boundary.html">boundary</A> command. For
example, a spherical region that is defined so that it overlaps a
periodic boundary is not treated as 2 half-spheres, one on either side
of the simulation box.
</P>
<P>IMPORTANT NOTE: Regions in LAMMPS are always 3d geometric objects,
regardless of whether the <A HREF = "dimension.html">dimension</A> of a simulation
is 2d or 3d. Thus when using regions in a 2d simulation, you should
be careful to define the region so that its intersection with the 2d
x-y plane of the simulation has the 2d geometric extent you want.
</P>
<P>For style <I>cone</I>, an axis-aligned cone is defined which is like a
<I>cylinder</I> except that two different radii (one at each end) can be
defined. Either of the radii (but not both) can be 0.0.
</P>
<P>For style <I>cone</I> and <I>cylinder</I>, the c1,c2 params are coordinates in
the 2 other dimensions besides the cylinder axis dimension. For dim =
x, c1/c2 = y/z; for dim = y, c1/c2 = x/z; for dim = z, c1/c2 = x/y.
Thus the third example above specifies a cylinder with its axis in the
y-direction located at x = 2.0 and z = 3.0, with a radius of 5.0, and
extending in the y-direction from -5.0 to the upper box boundary.
</P>
<P>For style <I>plane</I>, a plane is defined which contain the point
(px,py,pz) and has a normal vector (nx,ny,nz). The normal vector does
not have to be of unit length. The "inside" of the plane is the
half-space in the direction of the normal vector; see the discussion
of the <I>side</I> option below.
</P>
<P>For style <I>prism</I>, a parallelepiped is defined (it's too hard to spell
parallelepiped in an input script!). The parallelepiped has its
"origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors starting
from the origin given by A = (xhi-xlo,0,0); B = (xy,yhi-ylo,0); C =
(xz,yz,zhi-zlo). <I>Xy,xz,yz</I> can be 0.0 or positive or negative values
and are called "tilt factors" because they are the amount of
displacement applied to faces of an originally orthogonal box to
transform it into the parallelepiped.
</P>
<P>A prism region that will be used with the <A HREF = "create_box.html">create_box</A>
command to define a triclinic simulation box must have tilt factors
(xy,xz,yz) that do not skew the box more than half the distance of
corresponding the parallel box length. For example, if xlo = 2 and
xhi = 12, then the x box length is 10 and the xy tilt factor must be
between -5 and 5. Similarly, both xz and yz must be between
-(xhi-xlo)/2 and +(yhi-ylo)/2. Note that this is not a limitation,
since if the maximum tilt factor is 5 (as in this example), then
configurations with tilt = ..., -15, -5, 5, 15, 25, ... are all
geometrically equivalent.
</P>
-<P>See <A HREF = "Section_howto.html#howto_12">this section</A> of the doc pages for a
-geometric description of triclinic boxes, as defined by LAMMPS, and
-how to transform these parameters to and from other commonly used
+<P>See <A HREF = "Section_howto.html#howto_12">Section_howto 12</A> of the doc pages
+for a geometric description of triclinic boxes, as defined by LAMMPS,
+and how to transform these parameters to and from other commonly used
triclinic representations.
</P>
<P>The <I>union</I> style creates a region consisting of the volume of all the
listed regions combined. The <I>intersect</I> style creates a region
consisting of the volume that is common to all the listed regions.
</P>
<HR>
<P>The <I>side</I> keyword determines whether the region is considered to be
inside or outside of the specified geometry. Using this keyword in
conjunction with <I>union</I> and <I>intersect</I> regions, complex geometries
can be built up. For example, if the interior of two spheres were
each defined as regions, and a <I>union</I> style with <I>side</I> = out was
constructed listing the region-IDs of the 2 spheres, the resulting
region would be all the volume in the simulation box that was outside
both of the spheres.
</P>
<P>The <I>units</I> keyword determines the meaning of the distance units used
to define the region for any argument above listed as having distance
units. It also affects the scaling of the velocity vector specfied
with the <I>vel</I> keyword, the amplitude vector specified with the
<I>wiggle</I> keyword, and the rotation point specified with the <I>rotate</I>
keyword, since they each involve a distance metric.
</P>
<P>A <I>box</I> value selects standard distance units as defined by the
<A HREF = "units.html">units</A> command, e.g. Angstroms for units = real or metal.
A <I>lattice</I> value means the distance units are in lattice spacings.
The <A HREF = "lattice.html">lattice</A> command must have been previously used to
define the lattice spacings which are used as follows:
</P>
<UL><LI>For style <I>block</I>, the lattice spacing in dimension x is applied to
xlo and xhi, similarly the spacings in dimensions y,z are applied to
ylo/yhi and zlo/zhi.
<LI>For style <I>cone</I>, the lattice spacing in argument <I>dim</I> is applied to
lo and hi. The spacings in the two radial dimensions are applied to
c1 and c2. The two cone radii are scaled by the lattice
spacing in the dimension corresponding to c1.
<LI>For style <I>cylinder</I>, the lattice spacing in argument <I>dim</I> is applied
to lo and hi. The spacings in the two radial dimensions are applied
to c1 and c2. The cylinder radius is scaled by the lattice
spacing in the dimension corresponding to c1.
<LI>For style <I>plane</I>, the lattice spacing in dimension x is applied to
px and nx, similarly the spacings in dimensions y,z are applied to
py/ny and pz/nz.
<LI>For style <I>prism</I>, the lattice spacing in dimension x is applied to
xlo and xhi, similarly for ylo/yhi and zlo/zhi. The lattice spacing
in dimension x is applied to xy and xz, and the spacing in dimension y
to yz.
<LI>For style <I>sphere</I>, the lattice spacing in dimensions x,y,z are
applied to the sphere center x,y,z. The spacing in dimension x is
applied to the sphere radius.
</UL>
<HR>
<P>If the <I>move</I> or <I>rotate</I> keywords are used, the region is "dynamic",
meaning its location or orientation changes with time. These keywords
cannot be used with a <I>union</I> or <I>intersect</I> style region. Instead,
the keywords should be used to make the individual sub-regions of the
<I>union</I> or <I>intersect</I> region dynamic. Normally, each sub-region
should be "dynamic" in the same manner (e.g. rotate around the same
point), though this is not a requirement.
</P>
<P>The <I>move</I> keyword allows one or more <A HREF = "variable.html">equal-style
variables</A> to be used to specify the x,y,z displacement
of the region, typically as a function of time. A variable is
specified as v_name, where name is the variable name. Any of the
three variables can be specified as NULL, in which case no
displacement is calculated in that dimension.
</P>
<P>Note that equal-style variables can specify formulas with various
mathematical functions, and include <A HREF = "thermo_style.html">thermo_style</A>
command keywords for the simulation box parameters and timestep and
elapsed time. Thus it is easy to specify a region displacement that
change as a function of time or spans consecutive runs in a continuous
fashion. For the latter, see the <I>start</I> and <I>stop</I> keywords of the
<A HREF = "run.html">run</A> command and the <I>elaplong</I> keyword of <A HREF = "thermo_style.html">thermo_style
custom</A> for details.
</P>
<P>For example, these commands would displace a region from its initial
position, in the positive x direction, effectively at a constant
velocity:
</P>
<PRE>variable dx equal ramp(0,10)
region 2 sphere 10.0 10.0 0.0 5 move v_dx NULL NULL
</PRE>
<P>Note that the initial displacemet is 0.0, though that is not required.
</P>
<P>Either of these varaibles would "wiggle" the region back and forth in
the y direction:
</P>
<PRE>variable dy equal swiggle(0,5,100)
variable dysame equal 5*sin(2*PI*elaplong*dt/100)
region 2 sphere 10.0 10.0 0.0 5 move NULL v_dy NULL
</PRE>
<P>The <I>rotate</I> keyword rotates the region around a rotation axis <I>R</I> =
(Rx,Ry,Rz) that goes thru a point <I>P</I> = (Px,Py,Pz). The rotation
angle is calculated, presumably as a function of time, by a variable
specified as v_theta, where theta is the variable name. The variable
should generate its result in radians. The direction of rotation for
the region around the rotation axis is consistent with the right-hand
rule: if your right-hand thumb points along <I>R</I>, then your fingers
wrap around the axis in the direction of rotation.
</P>
<P>The <I>move</I> and <I>rotate</I> keywords can be used together. In this case,
the displacement specified by the <I>move</I> keyword is applied to the <I>P</I>
point of the <I>rotate</I> keyword.
</P>
<P><B>Restrictions:</B>
</P>
<P>A prism cannot be of 0.0 thickness in any dimension; use a small z
thickness for 2d simulations. For 2d simulations, the xz and yz
parameters must be 0.0.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "lattice.html">lattice</A>, <A HREF = "create_atoms.html">create_atoms</A>,
<A HREF = "delete_atoms.html">delete_atoms</A>, <A HREF = "group.html">group</A>
</P>
<P><B>Default:</B>
</P>
<P>The option defaults are side = in, units = lattice, and no move or
rotation.
</P>
</HTML>
diff --git a/doc/region.txt b/doc/region.txt
index c8da7594f..74744ab50 100644
--- a/doc/region.txt
+++ b/doc/region.txt
@@ -1,298 +1,298 @@
"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
region command :h3
[Syntax:]
region ID style args keyword arg ... :pre
ID = user-assigned name for the region :ulb,l
style = {delete} or {block} or {cone} or {cylinder} or {plane} or {prism} or {sphere} or {union} or {intersect} :l
{delete} = no args
{block} args = xlo xhi ylo yhi zlo zhi
xlo,xhi,ylo,yhi,zlo,zhi = bounds of block in all dimensions (distance units)
{cone} args = dim c1 c2 radlo radhi lo hi
dim = {x} or {y} or {z} = axis of cone
c1,c2 = coords of cone axis in other 2 dimensions (distance units)
radlo,radhi = cone radii at lo and hi end (distance units)
lo,hi = bounds of cone in dim (distance units)
{cylinder} args = dim c1 c2 radius lo hi
dim = {x} or {y} or {z} = axis of cylinder
c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
radius = cylinder radius (distance units)
lo,hi = bounds of cylinder in dim (distance units)
{plane} args = px py pz nx ny nz
px,py,pz = point on the plane (distance units)
nx,ny,nz = direction normal to plane (distance units)
{prism} args = xlo xhi ylo yhi zlo zhi xy xz yz
xlo,xhi,ylo,yhi,zlo,zhi = bounds of untilted prism (distance units)
xy = distance to tilt y in x direction (distance units)
xz = distance to tilt z in x direction (distance units)
yz = distance to tilt z in y direction (distance units)
{sphere} args = x y z radius
x,y,z = center of sphere (distance units)
radius = radius of sphere (distance units)
{union} args = N reg-ID1 reg-ID2 ...
N = # of regions to follow, must be 2 or greater
reg-ID1,reg-ID2, ... = IDs of regions to join together
{intersect} args = N reg-ID1 reg-ID2 ...
N = # of regions to follow, must be 2 or greater
reg-ID1,reg-ID2, ... = IDs of regions to intersect :pre
zero or more keyword/arg pairs may be appended :l
keyword = {side} or {units} or {move} or {rotate} :l
{side} value = {in} or {out}
{in} = the region is inside the specified geometry
{out} = the region is outside the specified geometry
{units} value = {lattice} or {box}
{lattice} = the geometry is defined in lattice units
{box} = the geometry is defined in simulation box units
{move} args = v_x v_y v_z
v_x,v_y,v_z = equal-style variables for x,y,z displacement of region over time
{rotate} args = v_theta Px Py Pz Rx Ry Rz
v_theta = equal-style variable for rotaton of region over time (in radians)
Px,Py,Pz = origin for axis of rotation (distance units)
Rx,Ry,Rz = axis of rotation vector :pre
:ule
[Examples:]
region 1 block -3.0 5.0 INF 10.0 INF INF
region 2 sphere 0.0 0.0 0.0 5 side out
region void cylinder y 2 3 5 -5.0 EDGE units box
region 1 prism 0 10 0 10 0 10 2 0 0
region outside union 4 side1 side2 side3 side4
region 2 sphere 0.0 0.0 0.0 5 side out move v_left v_up NULL :pre
[Description:]
This command defines a geometric region of space. Various other
commands use regions. For example, the region can be filled with
atoms via the "create_atoms"_create_atoms.html command. Or a bounding
box around the region, can be used to define the simulation box via
the "create_box"_create_box.html command. Or the atoms in the region
can be identified as a group via the "group"_group.html command, or
deleted via the "delete_atoms"_delete_atoms.html command. Or the
surface of the region can be used as a boundary wall via the "fix
wall/region"_fix_wall_region.html command.
Commands which use regions typically test whether an atom's position
is contained in the region or not. For this purpose, coordinates
exactly on the region boundary are considered to be interior to the
region. This means, for example, for a spherical region, an atom on
the sphere surface would be part of the region if the sphere were
defined with the {side in} keyword, but would not be part of the
region if it were defined using the {side out} keyword. See more
details on the {side} keyword below.
Normally, regions in LAMMPS are "static", meaning their geometric
extent does not change with time. If the {move} or {rotate} keyword
is used, as described below, the region becomes "dynamic", meaning
it's location or orientation changes with time. This may be useful,
for example, when thermostatting a region, via the compute temp/region
command, or when the fix wall/region command uses a region surface as
a bounding wall on particle motion, i.e. a rotating container.
The {delete} style removes the named region. Since there is little
overhead to defining extra regions, there is normally no need to do
this, unless you are defining and discarding large numbers of regions
in your input script.
The lo/hi values for {block} or {cone} or {cylinder} or {prism} styles
can be specified as EDGE or INF. EDGE means they extend all the way
to the global simulation box boundary. Note that this is the current
box boundary; if the box changes size during a simulation, the region
does not. INF means a large negative or positive number (1.0e20), so
it should encompass the simulation box even if it changes size. If a
region is defined before the simulation box has been created (via
"create_box"_create_box.html or "read_data"_read_data.html or
"read_restart"_read_restart.html commands), then an EDGE or INF
parameter cannot be used. For a {prism} region, a non-zero tilt
factor in any pair of dimensions cannot be used if both the lo/hi
values in either of those dimensions are INF. E.g. if the xy tilt is
non-zero, then xlo and xhi cannot both be INF, nor can ylo and yhi.
IMPORTANT NOTE: Regions in LAMMPS do not get wrapped across periodic
boundaries, as specified by the "boundary"_boundary.html command. For
example, a spherical region that is defined so that it overlaps a
periodic boundary is not treated as 2 half-spheres, one on either side
of the simulation box.
IMPORTANT NOTE: Regions in LAMMPS are always 3d geometric objects,
regardless of whether the "dimension"_dimension.html of a simulation
is 2d or 3d. Thus when using regions in a 2d simulation, you should
be careful to define the region so that its intersection with the 2d
x-y plane of the simulation has the 2d geometric extent you want.
For style {cone}, an axis-aligned cone is defined which is like a
{cylinder} except that two different radii (one at each end) can be
defined. Either of the radii (but not both) can be 0.0.
For style {cone} and {cylinder}, the c1,c2 params are coordinates in
the 2 other dimensions besides the cylinder axis dimension. For dim =
x, c1/c2 = y/z; for dim = y, c1/c2 = x/z; for dim = z, c1/c2 = x/y.
Thus the third example above specifies a cylinder with its axis in the
y-direction located at x = 2.0 and z = 3.0, with a radius of 5.0, and
extending in the y-direction from -5.0 to the upper box boundary.
For style {plane}, a plane is defined which contain the point
(px,py,pz) and has a normal vector (nx,ny,nz). The normal vector does
not have to be of unit length. The "inside" of the plane is the
half-space in the direction of the normal vector; see the discussion
of the {side} option below.
For style {prism}, a parallelepiped is defined (it's too hard to spell
parallelepiped in an input script!). The parallelepiped has its
"origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors starting
from the origin given by A = (xhi-xlo,0,0); B = (xy,yhi-ylo,0); C =
(xz,yz,zhi-zlo). {Xy,xz,yz} can be 0.0 or positive or negative values
and are called "tilt factors" because they are the amount of
displacement applied to faces of an originally orthogonal box to
transform it into the parallelepiped.
A prism region that will be used with the "create_box"_create_box.html
command to define a triclinic simulation box must have tilt factors
(xy,xz,yz) that do not skew the box more than half the distance of
corresponding the parallel box length. For example, if xlo = 2 and
xhi = 12, then the x box length is 10 and the xy tilt factor must be
between -5 and 5. Similarly, both xz and yz must be between
-(xhi-xlo)/2 and +(yhi-ylo)/2. Note that this is not a limitation,
since if the maximum tilt factor is 5 (as in this example), then
configurations with tilt = ..., -15, -5, 5, 15, 25, ... are all
geometrically equivalent.
-See "this section"_Section_howto.html#howto_12 of the doc pages for a
-geometric description of triclinic boxes, as defined by LAMMPS, and
-how to transform these parameters to and from other commonly used
+See "Section_howto 12"_Section_howto.html#howto_12 of the doc pages
+for a geometric description of triclinic boxes, as defined by LAMMPS,
+and how to transform these parameters to and from other commonly used
triclinic representations.
The {union} style creates a region consisting of the volume of all the
listed regions combined. The {intersect} style creates a region
consisting of the volume that is common to all the listed regions.
:line
The {side} keyword determines whether the region is considered to be
inside or outside of the specified geometry. Using this keyword in
conjunction with {union} and {intersect} regions, complex geometries
can be built up. For example, if the interior of two spheres were
each defined as regions, and a {union} style with {side} = out was
constructed listing the region-IDs of the 2 spheres, the resulting
region would be all the volume in the simulation box that was outside
both of the spheres.
The {units} keyword determines the meaning of the distance units used
to define the region for any argument above listed as having distance
units. It also affects the scaling of the velocity vector specfied
with the {vel} keyword, the amplitude vector specified with the
{wiggle} keyword, and the rotation point specified with the {rotate}
keyword, since they each involve a distance metric.
A {box} value selects standard distance units as defined by the
"units"_units.html command, e.g. Angstroms for units = real or metal.
A {lattice} value means the distance units are in lattice spacings.
The "lattice"_lattice.html command must have been previously used to
define the lattice spacings which are used as follows:
For style {block}, the lattice spacing in dimension x is applied to
xlo and xhi, similarly the spacings in dimensions y,z are applied to
ylo/yhi and zlo/zhi. :ulb,l
For style {cone}, the lattice spacing in argument {dim} is applied to
lo and hi. The spacings in the two radial dimensions are applied to
c1 and c2. The two cone radii are scaled by the lattice
spacing in the dimension corresponding to c1. :l
For style {cylinder}, the lattice spacing in argument {dim} is applied
to lo and hi. The spacings in the two radial dimensions are applied
to c1 and c2. The cylinder radius is scaled by the lattice
spacing in the dimension corresponding to c1. :l
For style {plane}, the lattice spacing in dimension x is applied to
px and nx, similarly the spacings in dimensions y,z are applied to
py/ny and pz/nz. :l
For style {prism}, the lattice spacing in dimension x is applied to
xlo and xhi, similarly for ylo/yhi and zlo/zhi. The lattice spacing
in dimension x is applied to xy and xz, and the spacing in dimension y
to yz. :l
For style {sphere}, the lattice spacing in dimensions x,y,z are
applied to the sphere center x,y,z. The spacing in dimension x is
applied to the sphere radius. :l,ule
:line
If the {move} or {rotate} keywords are used, the region is "dynamic",
meaning its location or orientation changes with time. These keywords
cannot be used with a {union} or {intersect} style region. Instead,
the keywords should be used to make the individual sub-regions of the
{union} or {intersect} region dynamic. Normally, each sub-region
should be "dynamic" in the same manner (e.g. rotate around the same
point), though this is not a requirement.
The {move} keyword allows one or more "equal-style
variables"_variable.html to be used to specify the x,y,z displacement
of the region, typically as a function of time. A variable is
specified as v_name, where name is the variable name. Any of the
three variables can be specified as NULL, in which case no
displacement is calculated in that dimension.
Note that equal-style variables can specify formulas with various
mathematical functions, and include "thermo_style"_thermo_style.html
command keywords for the simulation box parameters and timestep and
elapsed time. Thus it is easy to specify a region displacement that
change as a function of time or spans consecutive runs in a continuous
fashion. For the latter, see the {start} and {stop} keywords of the
"run"_run.html command and the {elaplong} keyword of "thermo_style
custom"_thermo_style.html for details.
For example, these commands would displace a region from its initial
position, in the positive x direction, effectively at a constant
velocity:
variable dx equal ramp(0,10)
region 2 sphere 10.0 10.0 0.0 5 move v_dx NULL NULL :pre
Note that the initial displacemet is 0.0, though that is not required.
Either of these varaibles would "wiggle" the region back and forth in
the y direction:
variable dy equal swiggle(0,5,100)
variable dysame equal 5*sin(2*PI*elaplong*dt/100)
region 2 sphere 10.0 10.0 0.0 5 move NULL v_dy NULL :pre
The {rotate} keyword rotates the region around a rotation axis {R} =
(Rx,Ry,Rz) that goes thru a point {P} = (Px,Py,Pz). The rotation
angle is calculated, presumably as a function of time, by a variable
specified as v_theta, where theta is the variable name. The variable
should generate its result in radians. The direction of rotation for
the region around the rotation axis is consistent with the right-hand
rule: if your right-hand thumb points along {R}, then your fingers
wrap around the axis in the direction of rotation.
The {move} and {rotate} keywords can be used together. In this case,
the displacement specified by the {move} keyword is applied to the {P}
point of the {rotate} keyword.
[Restrictions:]
A prism cannot be of 0.0 thickness in any dimension; use a small z
thickness for 2d simulations. For 2d simulations, the xz and yz
parameters must be 0.0.
[Related commands:]
"lattice"_lattice.html, "create_atoms"_create_atoms.html,
"delete_atoms"_delete_atoms.html, "group"_group.html
[Default:]
The option defaults are side = in, units = lattice, and no move or
rotation.
diff --git a/doc/run_style.html b/doc/run_style.html
index f885210b2..abe21ecdd 100644
--- a/doc/run_style.html
+++ b/doc/run_style.html
@@ -1,262 +1,263 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>run_style command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>run_style style args
</PRE>
<UL><LI>style = <I>verlet</I> or <I>verlet/split</I> or <I>respa</I>
<PRE> <I>verlet</I> args = none
<I>verlet/split</I> args = none
<I>respa</I> args = N n1 n2 ... keyword values ...
N = # of levels of rRESPA
n1, n2, ... = loop factor between rRESPA levels (N-1 values)
zero or more keyword/value pairings may be appended to the loop factors
keyword = <I>bond</I> or <I>angle</I> or <I>dihedral</I> or <I>improper</I> or
<I>pair</I> or <I>inner</I> or <I>middle</I> or <I>outer</I> or <I>kspace</I>
<I>bond</I> value = M
M = which level (1-N) to compute bond forces in
<I>angle</I> value = M
M = which level (1-N) to compute angle forces in
<I>dihedral</I> value = M
M = which level (1-N) to compute dihedral forces in
<I>improper</I> value = M
M = which level (1-N) to compute improper forces in
<I>pair</I> value = M
M = which level (1-N) to compute pair forces in
<I>inner</I> values = M cut1 cut2
M = which level (1-N) to compute pair inner forces in
cut1 = inner cutoff between pair inner and
pair middle or outer (distance units)
cut2 = outer cutoff between pair inner and
pair middle or outer (distance units)
<I>middle</I> values = M cut1 cut2
M = which level (1-N) to compute pair middle forces in
cut1 = inner cutoff between pair middle and pair outer (distance units)
cut2 = outer cutoff between pair middle and pair outer (distance units)
<I>outer</I> value = M
M = which level (1-N) to compute pair outer forces in
<I>kspace</I> value = M
M = which level (1-N) to compute kspace forces in
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>run_style verlet
run_style respa 4 2 2 2 bond 1 dihedral 2 pair 3 kspace 4
run_style respa 4 2 2 2 bond 1 dihedral 2 inner 3 5.0 6.0 outer 4 kspace 4
</PRE>
<P><B>Description:</B>
</P>
<P>Choose the style of time integrator used for molecular dynamics
simulations performed by LAMMPS.
</P>
<P>The <I>verlet</I> style is a standard velocity-Verlet integrator.
</P>
<HR>
<P>The <I>verlet/split</I> style is also a velocity-Verlet integrator, but it
splits the force calculation within each timestep over 2 partitions of
-processors. See <A HREF = "Section_start.html#start_6">this section</A> for an
+processors. See <A HREF = "Section_start.html#start_6">Section_start 6</A> for an
explanation of the -partition command-line switch.
</P>
<P>Specifically, this style performs all computation except the
<A HREF = "kspace_style.html">kspace_style</A> portion of the force field on the 1st
partition. This include the <A HREF = "pair_style.html">pair style</A>, <A HREF = "bond_style.html">bond
style</A>, <A HREF = "neighbor.html">neighbor list building</A>,
<A HREF = "fix.html">fixes</A> including time intergration, and output. The
<A HREF = "kspace_style.html">kspace_style</A> portion of the calculation is
performed on the 2nd partition.
</P>
<P>This is most useful for the PPPM kspace_style when its performance on
a large number of processors degrades due to the cost of communication
in its 3d FFTs. In this scenario, splitting your P total processors
into 2 subsets of processors, P1 in the 1st partition and P2 in the
2nd partition, can enable your simulation to run faster. This is
because the long-range forces in PPPM can be calculated at the same
time as pair-wise and bonded forces are being calculated, and the FFTs
can actually speed up when running on fewer processors.
</P>
<P>To use this style, you must define 2 partitions where P1 is a multiple
of P2. Typically having P1 be 3x larger than P2 is a good choice.
The 3d processor layouts in each partition must overlay in the
following sense. If P1 is a Px1 by Py1 by Pz1 grid, and P2 = Px2 by
Py2 by Pz2, then Px1 must be an integer multiple of Px2, and similarly
for Py1 a multiple of Py2, and Pz1 a multiple of Pz2.
</P>
<P>Typically the best way to do this is to let the 1st partition choose
its onn optimal layout, then require the 2nd partition's layout to
match the integer multiple constraint. See the
<A HREF = "processors.html">processors</A> command with its <I>part</I> keyword for a way
to control this, e.g.
</P>
<PRE>procssors * * * part 1 2 multiple
</PRE>
<P>You can also use the <A HREF = "partition.html">partition</A> command to explicitly
specity the processor layout on each partition. E.g. for 2 partitions
of 60 and 15 processors each:
</P>
<PRE>partition yes 1 processors 3 4 5
partition yes 2 processors 3 1 5
</PRE>
<P>When you run in 2-partition mode with the <I>verlet/split</I> style, the
thermodyanmic data for the entire simulation will be output to the log
and screen file of the 1st partition, which are log.lammps.0 and
screen.0 by default; see the "-plog and -pscreen command-line
switches"Section_start.html#start_6 to change this. The log and
screen file for the 2nd partition will not contain thermodynamic
output beyone the 1st timestep of the run.
</P>
-<P>See <A HREF = "Section_accelerate.html">this section</A> of the manual for
+<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
performance details of the speed-up offered by the <I>verlet/split</I>
style. One important performance consideration is the assignemnt of
logical processors in the 2 partitions to the physical cores of a
-parallel machine. <A HREF = "Section_accelerate.html">This section</A> discusses
-how to optimize this mapping.
+parallel machine. The <A HREF = "processors.html">processors</A> command has
+options to support this, and strategies are discussed in
+<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual.
</P>
<HR>
<P>The <I>respa</I> style implements the rRESPA multi-timescale integrator
<A HREF = "#Tuckerman">(Tuckerman)</A> with N hierarchical levels, where level 1 is
the innermost loop (shortest timestep) and level N is the outermost
loop (largest timestep). The loop factor arguments specify what the
looping factor is between levels. N1 specifies the number of
iterations of level 1 for a single iteration of level 2, N2 is the
iterations of level 2 per iteration of level 3, etc. N-1 looping
parameters must be specified.
</P>
<P>The <A HREF = "timestep.html">timestep</A> command sets the timestep for the
outermost rRESPA level. Thus if the example command above for a
4-level rRESPA had an outer timestep of 4.0 fmsec, the inner timestep
would be 8x smaller or 0.5 fmsec. All other LAMMPS commands that
specify number of timesteps (e.g. <A HREF = "neigh_modify.html">neigh_modify</A>
parameters, <A HREF = "dump.html">dump</A> every N timesteps, etc) refer to the
outermost timesteps.
</P>
<P>The rRESPA keywords enable you to specify at what level of the
hierarchy various forces will be computed. If not specified, the
defaults are that bond forces are computed at level 1 (innermost
loop), angle forces are computed where bond forces are, dihedral
forces are computed where angle forces are, improper forces are
computed where dihedral forces are, pair forces are computed at the
outermost level, and kspace forces are computed where pair forces are.
The inner, middle, outer forces have no defaults.
</P>
<P>The <I>inner</I> and <I>middle</I> keywords take additional arguments for
cutoffs that are used by the pairwise force computations. If the 2
cutoffs for <I>inner</I> are 5.0 and 6.0, this means that all pairs up to
6.0 apart are computed by the inner force. Those between 5.0 and 6.0
have their force go ramped to 0.0 so the overlap with the next regime
(middle or outer) is smooth. The next regime (middle or outer) will
compute forces for all pairs from 5.0 outward, with those from 5.0 to
6.0 having their value ramped in an inverse manner.
</P>
<P>Only some pair potentials support the use of the <I>inner</I> and <I>middle</I>
and <I>outer</I> keywords. If not, only the <I>pair</I> keyword can be used
with that pair style, meaning all pairwise forces are computed at the
same rRESPA level. See the doc pages for individual pair styles for
details.
</P>
<P>When using rRESPA (or for any MD simulation) care must be taken to
choose a timestep size(s) that insures the Hamiltonian for the chosen
ensemble is conserved. For the constant NVE ensemble, total energy
must be conserved. Unfortunately, it is difficult to know <I>a priori</I>
how well energy will be conserved, and a fairly long test simulation
(~10 ps) is usually necessary in order to verify that no long-term
drift in energy occurs with the trial set of parameters.
</P>
<P>With that caveat, a few rules-of-thumb may be useful in selecting
<I>respa</I> settings. The following applies mostly to biomolecular
simulations using the CHARMM or a similar all-atom force field, but
the concepts are adaptable to other problems. Without SHAKE, bonds
involving hydrogen atoms exhibit high-frequency vibrations and require
a timestep on the order of 0.5 fmsec in order to conserve energy. The
relatively inexpensive force computations for the bonds, angles,
impropers, and dihedrals can be computed on this innermost 0.5 fmsec
step. The outermost timestep cannot be greater than 4.0 fmsec without
risking energy drift. Smooth switching of forces between the levels
of the rRESPA hierarchy is also necessary to avoid drift, and a 1-2
angstrom "healing distance" (the distance between the outer and inner
cutoffs) works reasonably well. We thus recommend the following
settings for use of the <I>respa</I> style without SHAKE in biomolecular
simulations:
</P>
<PRE>timestep 4.0
run_style respa 4 2 2 2 inner 2 4.5 6.0 middle 3 8.0 10.0 outer 4
</PRE>
<P>With these settings, users can expect good energy conservation and
roughly a 2.5 fold speedup over the <I>verlet</I> style with a 0.5 fmsec
timestep.
</P>
<P>If SHAKE is used with the <I>respa</I> style, time reversibility is lost,
but substantially longer time steps can be achieved. For biomolecular
simulations using the CHARMM or similar all-atom force field, bonds
involving hydrogen atoms exhibit high frequency vibrations and require
a time step on the order of 0.5 fmsec in order to conserve energy.
These high frequency modes also limit the outer time step sizes since
the modes are coupled. It is therefore desirable to use SHAKE with
respa in order to freeze out these high frequency motions and increase
the size of the time steps in the respa hierarchy. The following
settings can be used for biomolecular simulations with SHAKE and
rRESPA:
</P>
<PRE>fix 2 all shake 0.000001 500 0 m 1.0 a 1
timestep 4.0
run_style respa 2 2 inner 1 4.0 5.0 outer 2
</PRE>
<P>With these settings, users can expect good energy conservation and
roughly a 1.5 fold speedup over the <I>verlet</I> style with SHAKE and a
2.0 fmsec timestep.
</P>
<P>For non-biomolecular simulations, the <I>respa</I> style can be
advantageous if there is a clear separation of time scales - fast and
slow modes in the simulation. Even a LJ system can benefit from
rRESPA if the interactions are divided by the inner, middle and outer
keywords. A 2-fold or more speedup can be obtained while maintaining
good energy conservation. In real units, for a pure LJ fluid at
liquid density, with a sigma of 3.0 angstroms, and epsilon of 0.1
Kcal/mol, the following settings seem to work well:
</P>
<PRE>timestep 36.0
run_style respa 3 3 4 inner 1 3.0 4.0 middle 2 6.0 7.0 outer 3
</PRE>
<HR>
<P><B>Restrictions:</B>
</P>
<P>The <I>verlet/split</I> style can only be used if LAMMPS was built with the
REPLICA package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info on packages.
</P>
<P>Whenever using rRESPA, the user should experiment with trade-offs in
speed and accuracy for their system, and verify that they are
conserving energy to adequate precision.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "timestep.html">timestep</A>, <A HREF = "run.html">run</A>
</P>
<P><B>Default:</B>
</P>
<PRE>run_style verlet
</PRE>
<HR>
<A NAME = "Tuckerman"></A>
<P><B>(Tuckerman)</B> Tuckerman, Berne and Martyna, J Chem Phys, 97, p 1990
(1992).
</P>
</HTML>
diff --git a/doc/run_style.txt b/doc/run_style.txt
index ea9715d82..2484fc4df 100644
--- a/doc/run_style.txt
+++ b/doc/run_style.txt
@@ -1,254 +1,255 @@
"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
run_style command :h3
[Syntax:]
run_style style args :pre
style = {verlet} or {verlet/split} or {respa} :ulb,l
{verlet} args = none
{verlet/split} args = none
{respa} args = N n1 n2 ... keyword values ...
N = # of levels of rRESPA
n1, n2, ... = loop factor between rRESPA levels (N-1 values)
zero or more keyword/value pairings may be appended to the loop factors
keyword = {bond} or {angle} or {dihedral} or {improper} or
{pair} or {inner} or {middle} or {outer} or {kspace}
{bond} value = M
M = which level (1-N) to compute bond forces in
{angle} value = M
M = which level (1-N) to compute angle forces in
{dihedral} value = M
M = which level (1-N) to compute dihedral forces in
{improper} value = M
M = which level (1-N) to compute improper forces in
{pair} value = M
M = which level (1-N) to compute pair forces in
{inner} values = M cut1 cut2
M = which level (1-N) to compute pair inner forces in
cut1 = inner cutoff between pair inner and
pair middle or outer (distance units)
cut2 = outer cutoff between pair inner and
pair middle or outer (distance units)
{middle} values = M cut1 cut2
M = which level (1-N) to compute pair middle forces in
cut1 = inner cutoff between pair middle and pair outer (distance units)
cut2 = outer cutoff between pair middle and pair outer (distance units)
{outer} value = M
M = which level (1-N) to compute pair outer forces in
{kspace} value = M
M = which level (1-N) to compute kspace forces in :pre
:ule
[Examples:]
run_style verlet
run_style respa 4 2 2 2 bond 1 dihedral 2 pair 3 kspace 4
run_style respa 4 2 2 2 bond 1 dihedral 2 inner 3 5.0 6.0 outer 4 kspace 4 :pre
[Description:]
Choose the style of time integrator used for molecular dynamics
simulations performed by LAMMPS.
The {verlet} style is a standard velocity-Verlet integrator.
:line
The {verlet/split} style is also a velocity-Verlet integrator, but it
splits the force calculation within each timestep over 2 partitions of
-processors. See "this section"_Section_start.html#start_6 for an
+processors. See "Section_start 6"_Section_start.html#start_6 for an
explanation of the -partition command-line switch.
Specifically, this style performs all computation except the
"kspace_style"_kspace_style.html portion of the force field on the 1st
partition. This include the "pair style"_pair_style.html, "bond
style"_bond_style.html, "neighbor list building"_neighbor.html,
"fixes"_fix.html including time intergration, and output. The
"kspace_style"_kspace_style.html portion of the calculation is
performed on the 2nd partition.
This is most useful for the PPPM kspace_style when its performance on
a large number of processors degrades due to the cost of communication
in its 3d FFTs. In this scenario, splitting your P total processors
into 2 subsets of processors, P1 in the 1st partition and P2 in the
2nd partition, can enable your simulation to run faster. This is
because the long-range forces in PPPM can be calculated at the same
time as pair-wise and bonded forces are being calculated, and the FFTs
can actually speed up when running on fewer processors.
To use this style, you must define 2 partitions where P1 is a multiple
of P2. Typically having P1 be 3x larger than P2 is a good choice.
The 3d processor layouts in each partition must overlay in the
following sense. If P1 is a Px1 by Py1 by Pz1 grid, and P2 = Px2 by
Py2 by Pz2, then Px1 must be an integer multiple of Px2, and similarly
for Py1 a multiple of Py2, and Pz1 a multiple of Pz2.
Typically the best way to do this is to let the 1st partition choose
its onn optimal layout, then require the 2nd partition's layout to
match the integer multiple constraint. See the
"processors"_processors.html command with its {part} keyword for a way
to control this, e.g.
procssors * * * part 1 2 multiple :pre
You can also use the "partition"_partition.html command to explicitly
specity the processor layout on each partition. E.g. for 2 partitions
of 60 and 15 processors each:
partition yes 1 processors 3 4 5
partition yes 2 processors 3 1 5 :pre
When you run in 2-partition mode with the {verlet/split} style, the
thermodyanmic data for the entire simulation will be output to the log
and screen file of the 1st partition, which are log.lammps.0 and
screen.0 by default; see the "-plog and -pscreen command-line
switches"Section_start.html#start_6 to change this. The log and
screen file for the 2nd partition will not contain thermodynamic
output beyone the 1st timestep of the run.
-See "this section"_Section_accelerate.html of the manual for
+See "Section_accelerate"_Section_accelerate.html of the manual for
performance details of the speed-up offered by the {verlet/split}
style. One important performance consideration is the assignemnt of
logical processors in the 2 partitions to the physical cores of a
-parallel machine. "This section"_Section_accelerate.html discusses
-how to optimize this mapping.
+parallel machine. The "processors"_processors.html command has
+options to support this, and strategies are discussed in
+"Section_accelerate"_Section_accelerate.html of the manual.
:line
The {respa} style implements the rRESPA multi-timescale integrator
"(Tuckerman)"_#Tuckerman with N hierarchical levels, where level 1 is
the innermost loop (shortest timestep) and level N is the outermost
loop (largest timestep). The loop factor arguments specify what the
looping factor is between levels. N1 specifies the number of
iterations of level 1 for a single iteration of level 2, N2 is the
iterations of level 2 per iteration of level 3, etc. N-1 looping
parameters must be specified.
The "timestep"_timestep.html command sets the timestep for the
outermost rRESPA level. Thus if the example command above for a
4-level rRESPA had an outer timestep of 4.0 fmsec, the inner timestep
would be 8x smaller or 0.5 fmsec. All other LAMMPS commands that
specify number of timesteps (e.g. "neigh_modify"_neigh_modify.html
parameters, "dump"_dump.html every N timesteps, etc) refer to the
outermost timesteps.
The rRESPA keywords enable you to specify at what level of the
hierarchy various forces will be computed. If not specified, the
defaults are that bond forces are computed at level 1 (innermost
loop), angle forces are computed where bond forces are, dihedral
forces are computed where angle forces are, improper forces are
computed where dihedral forces are, pair forces are computed at the
outermost level, and kspace forces are computed where pair forces are.
The inner, middle, outer forces have no defaults.
The {inner} and {middle} keywords take additional arguments for
cutoffs that are used by the pairwise force computations. If the 2
cutoffs for {inner} are 5.0 and 6.0, this means that all pairs up to
6.0 apart are computed by the inner force. Those between 5.0 and 6.0
have their force go ramped to 0.0 so the overlap with the next regime
(middle or outer) is smooth. The next regime (middle or outer) will
compute forces for all pairs from 5.0 outward, with those from 5.0 to
6.0 having their value ramped in an inverse manner.
Only some pair potentials support the use of the {inner} and {middle}
and {outer} keywords. If not, only the {pair} keyword can be used
with that pair style, meaning all pairwise forces are computed at the
same rRESPA level. See the doc pages for individual pair styles for
details.
When using rRESPA (or for any MD simulation) care must be taken to
choose a timestep size(s) that insures the Hamiltonian for the chosen
ensemble is conserved. For the constant NVE ensemble, total energy
must be conserved. Unfortunately, it is difficult to know {a priori}
how well energy will be conserved, and a fairly long test simulation
(~10 ps) is usually necessary in order to verify that no long-term
drift in energy occurs with the trial set of parameters.
With that caveat, a few rules-of-thumb may be useful in selecting
{respa} settings. The following applies mostly to biomolecular
simulations using the CHARMM or a similar all-atom force field, but
the concepts are adaptable to other problems. Without SHAKE, bonds
involving hydrogen atoms exhibit high-frequency vibrations and require
a timestep on the order of 0.5 fmsec in order to conserve energy. The
relatively inexpensive force computations for the bonds, angles,
impropers, and dihedrals can be computed on this innermost 0.5 fmsec
step. The outermost timestep cannot be greater than 4.0 fmsec without
risking energy drift. Smooth switching of forces between the levels
of the rRESPA hierarchy is also necessary to avoid drift, and a 1-2
angstrom "healing distance" (the distance between the outer and inner
cutoffs) works reasonably well. We thus recommend the following
settings for use of the {respa} style without SHAKE in biomolecular
simulations:
timestep 4.0
run_style respa 4 2 2 2 inner 2 4.5 6.0 middle 3 8.0 10.0 outer 4 :pre
With these settings, users can expect good energy conservation and
roughly a 2.5 fold speedup over the {verlet} style with a 0.5 fmsec
timestep.
If SHAKE is used with the {respa} style, time reversibility is lost,
but substantially longer time steps can be achieved. For biomolecular
simulations using the CHARMM or similar all-atom force field, bonds
involving hydrogen atoms exhibit high frequency vibrations and require
a time step on the order of 0.5 fmsec in order to conserve energy.
These high frequency modes also limit the outer time step sizes since
the modes are coupled. It is therefore desirable to use SHAKE with
respa in order to freeze out these high frequency motions and increase
the size of the time steps in the respa hierarchy. The following
settings can be used for biomolecular simulations with SHAKE and
rRESPA:
fix 2 all shake 0.000001 500 0 m 1.0 a 1
timestep 4.0
run_style respa 2 2 inner 1 4.0 5.0 outer 2 :pre
With these settings, users can expect good energy conservation and
roughly a 1.5 fold speedup over the {verlet} style with SHAKE and a
2.0 fmsec timestep.
For non-biomolecular simulations, the {respa} style can be
advantageous if there is a clear separation of time scales - fast and
slow modes in the simulation. Even a LJ system can benefit from
rRESPA if the interactions are divided by the inner, middle and outer
keywords. A 2-fold or more speedup can be obtained while maintaining
good energy conservation. In real units, for a pure LJ fluid at
liquid density, with a sigma of 3.0 angstroms, and epsilon of 0.1
Kcal/mol, the following settings seem to work well:
timestep 36.0
run_style respa 3 3 4 inner 1 3.0 4.0 middle 2 6.0 7.0 outer 3 :pre
:line
[Restrictions:]
The {verlet/split} style can only be used if LAMMPS was built with the
REPLICA package. See the "Making LAMMPS"_Section_start.html#start_3
section for more info on packages.
Whenever using rRESPA, the user should experiment with trade-offs in
speed and accuracy for their system, and verify that they are
conserving energy to adequate precision.
[Related commands:]
"timestep"_timestep.html, "run"_run.html
[Default:]
run_style verlet :pre
:line
:link(Tuckerman)
[(Tuckerman)] Tuckerman, Berne and Martyna, J Chem Phys, 97, p 1990
(1992).
diff --git a/doc/tad.html b/doc/tad.html
index 08a87fc8b..459bdb1c1 100644
--- a/doc/tad.html
+++ b/doc/tad.html
@@ -1,317 +1,318 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>tad command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>tad N t_event T_lo T_hi delta tmax compute-ID keyword value ...
</PRE>
<UL><LI>N = # of timesteps to run (not including dephasing/quenching)
<LI>t_event = timestep interval between event checks
<LI>T_lo = temperature at which event times are desired
<LI>T_hi = temperature at which MD simulation is performed
<LI>delta = desired confidence level for stopping criterion
<LI>tmax = reciprocal of lowest expected preexponential factor (time units)
<LI>compute-ID = ID of the compute used for event detection
<LI>zero or more keyword/value pairs may be appended
<LI>keyword = <I>min</I> or <I>neb</I> or <I>min_style</I> or <I>neb_style</I> or <I>neb_log</I>
<PRE> <I>min</I> values = etol ftol maxiter maxeval
etol = stopping tolerance for energy (energy units)
ftol = stopping tolerance for force (force units)
maxiter = max iterations of minimize
maxeval = max number of force/energy evaluations
<I>neb</I> values = ftol N1 N2 Nevery
etol = stopping tolerance for energy (energy units)
ftol = stopping tolerance for force (force units)
N1 = max # of iterations (timesteps) to run initial NEB
N2 = max # of iterations (timesteps) to run barrier-climbing NEB
Nevery = print NEB statistics every this many timesteps
<I>min_style</I> value = <I>cg</I> or <I>hftn</I> or <I>sd</I> or <I>quickmin</I> or <I>fire</I>
<I>neb_style</I> value = <I>quickmin</I> or <I>fire</I>
<I>neb_log</I> value = file where NEB statistics are printed
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>tad 2000 50 1800 2300 0.01 0.01 event
tad 2000 50 1800 2300 0.01 0.01 event &
min 1e-05 1e-05 100 100 &
neb 0.0 0.01 200 200 20 &
min_style cg &
neb_style fire &
neb_log log.neb
</PRE>
<P><B>Description:</B>
</P>
<P>Run a temperature accelerated dynamics (TAD) simulation. This method
requires two or more partitions to perform NEB transition state
searches.
</P>
<P>TAD is described in <A HREF = "#Voter">this paper</A> by Art Voter. It is a method
that uses accelerated dynamics at an elevated temperature to generate
results at a specified lower temperature. A good overview of
accelerated dynamics methods for such systems is given in <A HREF = "#Voter2">this review
paper</A> from the same group. In general, these methods assume
that the long-time dynamics is dominated by infrequent events i.e. the
system is is confined to low energy basins for long periods,
punctuated by brief, randomly-occurring transitions to adjacent
basins. TAD is suitable for infrequent-event systems, where in
addition, the transition kinetics are well-approximated by harmonic
transition state theory (hTST). In hTST, the temperature dependence of
transition rates follows the Arrhenius relation. As a consequence a
set of event times generated in a high-temperature simulation can be
mapped to a set of much longer estimated times in the low-temperature
system. However, because this mapping involves the energy barrier of
the transition event, which is different for each event, the first
event at the high temperature may not be the earliest event at the low
temperature. TAD handles this by first generating a set of possible
events from the current basin. After each event, the simulation is
reflected backwards into the current basin. This is repeated until
the stopping criterion is satisfied, at which point the event with the
earliest low-temperature occurrence time is selected. The stopping
criterion is that the confidence measure be greater than
1-<I>delta</I>. The confidence measure is the probability that no earlier
low-temperature event will occur at some later time in the
high-temperature simulation. hTST provides an lower bound for this
probability, based on the user-specified minimum pre-exponential
factor (reciprocal of <I>tmax</I>).
</P>
<P>In order to estimate the energy barrier for each event, the TAD method
invokes the <A HREF = "neb.html">NEB</A> method. Each NEB replica runs on a
partition of processors. The current NEB implementation in LAMMPS
restricts you to having exactly one processor per replica. For more
information, see the documentation for the <A HREF = "neb.html">neb</A> command. In
the current LAMMPS implementation of TAD, all the non-NEB TAD
operations are performed on the first partition, while the other
-partitions remain idle. See <A HREF = "Section_howto.html#howto_5">this section</A>
-of the manual for further discussion of multi-replica simulations.
+partitions remain idle. See <A HREF = "Section_howto.html#howto_5">Section_howto
+5</A> of the manual for further discussion of
+multi-replica simulations.
</P>
<P>A TAD run has several stages, which are repeated each time an event is
performed. The logic for a TAD run is as follows:
</P>
<PRE>while (time remains):
while (time < tstop):
until (event occurs):
run dynamics for t_event steps
quench
run neb calculation using all replicas
compute tlo from energy barrier
update earliest event
update tstop
reflect back into current basin
execute earliest event
</PRE>
<P>Before this outer loop begins, the initial potential energy basin is
identified by quenching (an energy minimization, see below) the
initial state and storing the resulting coordinates for reference.
</P>
<P>Inside the inner loop, dynamics is run continuously according to
whatever integrator has been specified by the user, stopping every
<I>t_event</I> steps to check if a transition event has occurred. This
check is performed by quenching the system and comparing the resulting
atom coordinates to the coordinates from the previous basin.
</P>
<P>A quench is an energy minimization and is performed by whichever
algorithm has been defined by the <I>min</I> and <I>min_style</I> keywords or
their default values. Note that typically, you do not need to perform
a highly-converged minimization to detect a transition event.
</P>
<P>The event check is performed by a compute with the specified
<I>compute-ID</I>. Currently there is only one compute that works with the
TAD commmand, which is the <A HREF = "compute_event_displace.html">compute
event/displace</A> command. Other
event-checking computes may be added. <A HREF = "compute_event_displace.html">Compute
event/displace</A> checks whether any atom in
the compute group has moved further than a specified threshold
distance. If so, an "event" has occurred.
</P>
<P>The neb calculation is similar to that invoked by the <A HREF = "neb.html">neb</A>
command, except that the final state is generated internally, instead
of being read in from a file. The TAD implementation provides default
values for the NEB settings, which can be overridden using the <I>neb</I>
and <I>neb_style</I> keywords.
</P>
<HR>
<P>A key aspect of the TAD method is setting the stopping criterion
appropriately. If this criterion is too conservative, then many
events must be generated before one is finally executed. Conversely,
if this criterion is too aggressive, high-entropy high-barrier events
will be over-sampled, while low-entropy low-barrier events will be
under-sampled. If the lowest pre-exponential factor is known fairly
accurately, then it can be used to estimate <I>tmax</I>, and the value of
<I>delta</I> can be set to the desired confidence level e.g. <I>delta</I> = 0.05
corresponds to 95% confidence. However, for systems where the dynamics
are not well characterized (the most common case), it will be
necessary to experiment with the values of <I>delta</I> and <I>tmax</I> to get a
good trade-off between accuracy and performance.
</P>
<P>A second key aspect is the choice of <I>t_hi</I>. A larger value greatly
increases the rate at which new events are generated. However, too
large a value introduces errors due to anharmonicity (not accounted
for within hTST). Once again, for any given system, experimentation is
necessary to determine the best value of <I>t_hi</I>.
</P>
<HR>
<P>Five kinds of output can be generated during a TAD run: event
statistics, NEB statistics, thermodynamic output by each replica, dump
files, and restart files.
</P>
<P>Event statistics are printed to the screen and master log.lammps file
each time an event is executed. The quantities are the timestep, CPU
time, global event number <I>N</I>, local event number <I>M</I>, event status,
energy barrier, time margin, <I>t_lo</I> and <I>delt_lo</I>. The timestep is
the usual LAMMPS timestep, which corresponds to the high-temperature
time at which the event was detected, in units of timestep. The CPU
time is the total processor time since the start of the TAD run. The
global event number <I>N</I> is a counter that increments with each
executed event. The local event number <I>M</I> is a counter that resets to
zero upon entering each new basin. The event status is <I>E</I> when an
event is executed, and is <I>D</I> for an event that is detected, while
<I>DF</I> is for a detected event that is also the earliest (first) event
at the low temperature.
</P>
<P>The time margin is the ratio of the high temperature time in the
current basin to the stopping time. This last number can be used to
judge whether the stopping time is too short or too long (see above).
</P>
<P><I>t_lo</I> is the low-temperature event time when the current basin was
entered, in units of timestep. del<I>t_lo</I> is the time of each detected
event, measured relative to <I>t_lo</I>. <I>delt_lo</I> is equal to the
high-temperature time since entering the current basin, scaled by an
exponential factor that depends on the hi/lo temperature ratio and the
energy barrier for that event.
</P>
<P>On lines for executed events, with status <I>E</I>, the global event number
is incremented by one,
the local event number and time margin are reset to zero,
while the global event number, energy barrier, and
<I>delt_lo</I> match the last event with status <I>DF</I>
in the immediately preceding block of detected events.
The low-temperature event time <I>t_lo</I> is incremented by <I>delt_lo</I>.
</P>
<P>The NEB statistics are written to the file specified by the <I>neb_log</I>
keyword. If the keyword value is "none", then no NEB statistics are
printed out. The statistics are written every <I>Nevery</I> timesteps. See
the <A HREF = "neb.html">neb</A> command for a full description of the NEB
statistics. When invoked from TAD, NEB statistics are never printed to
the screen.
</P>
<P>Because the NEB calculation must run on multiple partitions, LAMMPS
produces additional screen and log files for each partition,
e.g. log.lammps.0, log.lammps.1, etc. For the TAD command, these
contain the thermodynamic output of each NEB replica. In addition, the
log file for the first partition, log.lammps.0, will contain
thermodynamic output from short runs and minimizations corresponding
to the dynamics and quench operations, as well as a line for each new
detected event, as described above.
</P>
<P>After the TAD command completes, timing statistics for the TAD run are
printed in each replica's log file, giving a breakdown of how much CPU
time was spent in each stage (NEB, dynamics, quenching, etc).
</P>
<P>Any <A HREF = "dump.html">dump files</A> defined in the input script will be written
to during a TAD run at timesteps when an event is executed. This
means the the requested dump frequency in the <A HREF = "dump.html">dump</A> command
is ignored. There will be one dump file (per dump command) created
for all partitions. The atom coordinates of the dump snapshot are
those of the minimum energy configuration resulting from quenching
following the executed event. The timesteps written into the dump
files correspond to the timestep at which the event occurred and NOT
the clock. A dump snapshot corresponding to the initial minimum state
used for event detection is written to the dump file at the beginning
of each TAD run.
</P>
<P>If the <A HREF = "restart.html">restart</A> command is used, a single restart file
for all the partitions is generated, which allows a TAD run to be
continued by a new input script in the usual manner. The restart file
is generated after an event is executed. The restart file contains a
snapshot of the system in the new quenched state, including the event
number and the low-temperature time. The restart frequency specified
in the <A HREF = "restart.html">restart</A> command is interpreted differently when
performing a TAD run. It does not mean the timestep interval between
restart files. Instead it means an event interval for executed
events. Thus a frequency of 1 means write a restart file every time
an event is executed. A frequency of 10 means write a restart file
every 10th executed event. When an input script reads a restart file
from a previous TAD run, the new script can be run on a different
number of replicas or processors.
</P>
<P>Note that within a single state, the dynamics will typically
temporarily continue beyond the event that is ultimately chosen, until
the stopping criterionis satisfied. When the event is eventually
executed, the timestep counter is reset to the value when the event
was detected. Similarly, after each quench and NEB minimization, the
timestep counter is reset to the value at the start of the
minimization. This means that the timesteps listed in the replica log
files do not always increase monotonically. However, the timestep
values printed to the master log file, dump files, and restart files
are always monotonically increasing.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This command can only be used if LAMMPS was built with the REPLICA
package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info on packages.
</P>
<P><I>N</I> setting must be integer multiple of <I>t_event</I>.
</P>
<P>Runs restarted from restart files written during a TAD run will only
produce identical results if the user-specified integrator supports
exact restarts. So <A HREF = "fix_nh.html">fix nvt</A> will produce an exact
restart, but <A HREF = "fix_langevin.html">fix langevin</A> will not.
</P>
<P>This command cannot be used when any fixes are defined that keep track
of elapsed time to perform time-dependent operations. Examples
include the "ave" fixes such as <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A>. Also <A HREF = "fix_dt_reset.html">fix
dt/reset</A> and <A HREF = "fix_deposit.html">fix deposit</A>.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_event_displace.html">compute event/displace</A>,
<A HREF = "min_modify.html">min_modify</A>, <A HREF = "min_style.html">min_style</A>,
<A HREF = "run_style.html">run_style</A>, <A HREF = "minimize.html">minimize</A>,
<A HREF = "temper.html">temper</A>, <A HREF = "neb.html">neb</A>,
<A HREF = "prd.html">prd</A>
</P>
<P><B>Default:</B>
</P>
<P>The option defaults are <I>min</I> = 0.1 0.1 40 50, <I>neb</I> = 0.01 100 100
10, <I>min_style</I> = <I>cg</I>, <I>neb_style</I> = <I>quickmin</I>, and <I>neb_log</I> =
"none"
</P>
<HR>
<A NAME = "Voter"></A>
<P><B>(Voter)</B> Sørensen and Voter, J Chem Phys, 112, 9599 (2000)
</P>
<A NAME = "Voter2"></A>
<P><B>(Voter2)</B> Voter, Montalenti, Germann, Annual Review of Materials
Research 32, 321 (2002).
</P>
</HTML>
diff --git a/doc/tad.txt b/doc/tad.txt
index adb10fcc3..e62e92a66 100644
--- a/doc/tad.txt
+++ b/doc/tad.txt
@@ -1,304 +1,305 @@
"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
tad command :h3
[Syntax:]
tad N t_event T_lo T_hi delta tmax compute-ID \
keyword value ... :pre
N = # of timesteps to run (not including dephasing/quenching) :ulb,l
t_event = timestep interval between event checks :l
T_lo = temperature at which event times are desired :l
T_hi = temperature at which MD simulation is performed :l
delta = desired confidence level for stopping criterion :l
tmax = reciprocal of lowest expected preexponential factor (time units) :l
compute-ID = ID of the compute used for event detection :l
zero or more keyword/value pairs may be appended :l
keyword = {min} or {neb} or {min_style} or {neb_style} or {neb_log} :l
{min} values = etol ftol maxiter maxeval
etol = stopping tolerance for energy (energy units)
ftol = stopping tolerance for force (force units)
maxiter = max iterations of minimize
maxeval = max number of force/energy evaluations
{neb} values = ftol N1 N2 Nevery
etol = stopping tolerance for energy (energy units)
ftol = stopping tolerance for force (force units)
N1 = max # of iterations (timesteps) to run initial NEB
N2 = max # of iterations (timesteps) to run barrier-climbing NEB
Nevery = print NEB statistics every this many timesteps
{min_style} value = {cg} or {hftn} or {sd} or {quickmin} or {fire}
{neb_style} value = {quickmin} or {fire}
{neb_log} value = file where NEB statistics are printed :pre
:ule
[Examples:]
tad 2000 50 1800 2300 0.01 0.01 event
tad 2000 50 1800 2300 0.01 0.01 event &
min 1e-05 1e-05 100 100 &
neb 0.0 0.01 200 200 20 &
min_style cg &
neb_style fire &
neb_log log.neb :pre
[Description:]
Run a temperature accelerated dynamics (TAD) simulation. This method
requires two or more partitions to perform NEB transition state
searches.
TAD is described in "this paper"_#Voter by Art Voter. It is a method
that uses accelerated dynamics at an elevated temperature to generate
results at a specified lower temperature. A good overview of
accelerated dynamics methods for such systems is given in "this review
paper"_#Voter2 from the same group. In general, these methods assume
that the long-time dynamics is dominated by infrequent events i.e. the
system is is confined to low energy basins for long periods,
punctuated by brief, randomly-occurring transitions to adjacent
basins. TAD is suitable for infrequent-event systems, where in
addition, the transition kinetics are well-approximated by harmonic
transition state theory (hTST). In hTST, the temperature dependence of
transition rates follows the Arrhenius relation. As a consequence a
set of event times generated in a high-temperature simulation can be
mapped to a set of much longer estimated times in the low-temperature
system. However, because this mapping involves the energy barrier of
the transition event, which is different for each event, the first
event at the high temperature may not be the earliest event at the low
temperature. TAD handles this by first generating a set of possible
events from the current basin. After each event, the simulation is
reflected backwards into the current basin. This is repeated until
the stopping criterion is satisfied, at which point the event with the
earliest low-temperature occurrence time is selected. The stopping
criterion is that the confidence measure be greater than
1-{delta}. The confidence measure is the probability that no earlier
low-temperature event will occur at some later time in the
high-temperature simulation. hTST provides an lower bound for this
probability, based on the user-specified minimum pre-exponential
factor (reciprocal of {tmax}).
In order to estimate the energy barrier for each event, the TAD method
invokes the "NEB"_neb.html method. Each NEB replica runs on a
partition of processors. The current NEB implementation in LAMMPS
restricts you to having exactly one processor per replica. For more
information, see the documentation for the "neb"_neb.html command. In
the current LAMMPS implementation of TAD, all the non-NEB TAD
operations are performed on the first partition, while the other
-partitions remain idle. See "this section"_Section_howto.html#howto_5
-of the manual for further discussion of multi-replica simulations.
+partitions remain idle. See "Section_howto
+5"_Section_howto.html#howto_5 of the manual for further discussion of
+multi-replica simulations.
A TAD run has several stages, which are repeated each time an event is
performed. The logic for a TAD run is as follows:
while (time remains):
while (time < tstop):
until (event occurs):
run dynamics for t_event steps
quench
run neb calculation using all replicas
compute tlo from energy barrier
update earliest event
update tstop
reflect back into current basin
execute earliest event :pre
Before this outer loop begins, the initial potential energy basin is
identified by quenching (an energy minimization, see below) the
initial state and storing the resulting coordinates for reference.
Inside the inner loop, dynamics is run continuously according to
whatever integrator has been specified by the user, stopping every
{t_event} steps to check if a transition event has occurred. This
check is performed by quenching the system and comparing the resulting
atom coordinates to the coordinates from the previous basin.
A quench is an energy minimization and is performed by whichever
algorithm has been defined by the {min} and {min_style} keywords or
their default values. Note that typically, you do not need to perform
a highly-converged minimization to detect a transition event.
The event check is performed by a compute with the specified
{compute-ID}. Currently there is only one compute that works with the
TAD commmand, which is the "compute
event/displace"_compute_event_displace.html command. Other
event-checking computes may be added. "Compute
event/displace"_compute_event_displace.html checks whether any atom in
the compute group has moved further than a specified threshold
distance. If so, an "event" has occurred.
The neb calculation is similar to that invoked by the "neb"_neb.html
command, except that the final state is generated internally, instead
of being read in from a file. The TAD implementation provides default
values for the NEB settings, which can be overridden using the {neb}
and {neb_style} keywords.
:line
A key aspect of the TAD method is setting the stopping criterion
appropriately. If this criterion is too conservative, then many
events must be generated before one is finally executed. Conversely,
if this criterion is too aggressive, high-entropy high-barrier events
will be over-sampled, while low-entropy low-barrier events will be
under-sampled. If the lowest pre-exponential factor is known fairly
accurately, then it can be used to estimate {tmax}, and the value of
{delta} can be set to the desired confidence level e.g. {delta} = 0.05
corresponds to 95% confidence. However, for systems where the dynamics
are not well characterized (the most common case), it will be
necessary to experiment with the values of {delta} and {tmax} to get a
good trade-off between accuracy and performance.
A second key aspect is the choice of {t_hi}. A larger value greatly
increases the rate at which new events are generated. However, too
large a value introduces errors due to anharmonicity (not accounted
for within hTST). Once again, for any given system, experimentation is
necessary to determine the best value of {t_hi}.
:line
Five kinds of output can be generated during a TAD run: event
statistics, NEB statistics, thermodynamic output by each replica, dump
files, and restart files.
Event statistics are printed to the screen and master log.lammps file
each time an event is executed. The quantities are the timestep, CPU
time, global event number {N}, local event number {M}, event status,
energy barrier, time margin, {t_lo} and {delt_lo}. The timestep is
the usual LAMMPS timestep, which corresponds to the high-temperature
time at which the event was detected, in units of timestep. The CPU
time is the total processor time since the start of the TAD run. The
global event number {N} is a counter that increments with each
executed event. The local event number {M} is a counter that resets to
zero upon entering each new basin. The event status is {E} when an
event is executed, and is {D} for an event that is detected, while
{DF} is for a detected event that is also the earliest (first) event
at the low temperature.
The time margin is the ratio of the high temperature time in the
current basin to the stopping time. This last number can be used to
judge whether the stopping time is too short or too long (see above).
{t_lo} is the low-temperature event time when the current basin was
entered, in units of timestep. del{t_lo} is the time of each detected
event, measured relative to {t_lo}. {delt_lo} is equal to the
high-temperature time since entering the current basin, scaled by an
exponential factor that depends on the hi/lo temperature ratio and the
energy barrier for that event.
On lines for executed events, with status {E}, the global event number
is incremented by one,
the local event number and time margin are reset to zero,
while the global event number, energy barrier, and
{delt_lo} match the last event with status {DF}
in the immediately preceding block of detected events.
The low-temperature event time {t_lo} is incremented by {delt_lo}.
The NEB statistics are written to the file specified by the {neb_log}
keyword. If the keyword value is "none", then no NEB statistics are
printed out. The statistics are written every {Nevery} timesteps. See
the "neb"_neb.html command for a full description of the NEB
statistics. When invoked from TAD, NEB statistics are never printed to
the screen.
Because the NEB calculation must run on multiple partitions, LAMMPS
produces additional screen and log files for each partition,
e.g. log.lammps.0, log.lammps.1, etc. For the TAD command, these
contain the thermodynamic output of each NEB replica. In addition, the
log file for the first partition, log.lammps.0, will contain
thermodynamic output from short runs and minimizations corresponding
to the dynamics and quench operations, as well as a line for each new
detected event, as described above.
After the TAD command completes, timing statistics for the TAD run are
printed in each replica's log file, giving a breakdown of how much CPU
time was spent in each stage (NEB, dynamics, quenching, etc).
Any "dump files"_dump.html defined in the input script will be written
to during a TAD run at timesteps when an event is executed. This
means the the requested dump frequency in the "dump"_dump.html command
is ignored. There will be one dump file (per dump command) created
for all partitions. The atom coordinates of the dump snapshot are
those of the minimum energy configuration resulting from quenching
following the executed event. The timesteps written into the dump
files correspond to the timestep at which the event occurred and NOT
the clock. A dump snapshot corresponding to the initial minimum state
used for event detection is written to the dump file at the beginning
of each TAD run.
If the "restart"_restart.html command is used, a single restart file
for all the partitions is generated, which allows a TAD run to be
continued by a new input script in the usual manner. The restart file
is generated after an event is executed. The restart file contains a
snapshot of the system in the new quenched state, including the event
number and the low-temperature time. The restart frequency specified
in the "restart"_restart.html command is interpreted differently when
performing a TAD run. It does not mean the timestep interval between
restart files. Instead it means an event interval for executed
events. Thus a frequency of 1 means write a restart file every time
an event is executed. A frequency of 10 means write a restart file
every 10th executed event. When an input script reads a restart file
from a previous TAD run, the new script can be run on a different
number of replicas or processors.
Note that within a single state, the dynamics will typically
temporarily continue beyond the event that is ultimately chosen, until
the stopping criterionis satisfied. When the event is eventually
executed, the timestep counter is reset to the value when the event
was detected. Similarly, after each quench and NEB minimization, the
timestep counter is reset to the value at the start of the
minimization. This means that the timesteps listed in the replica log
files do not always increase monotonically. However, the timestep
values printed to the master log file, dump files, and restart files
are always monotonically increasing.
:line
[Restrictions:]
This command can only be used if LAMMPS was built with the REPLICA
package. See the "Making LAMMPS"_Section_start.html#start_3 section
for more info on packages.
{N} setting must be integer multiple of {t_event}.
Runs restarted from restart files written during a TAD run will only
produce identical results if the user-specified integrator supports
exact restarts. So "fix nvt"_fix_nh.html will produce an exact
restart, but "fix langevin"_fix_langevin.html will not.
This command cannot be used when any fixes are defined that keep track
of elapsed time to perform time-dependent operations. Examples
include the "ave" fixes such as "fix
ave/spatial"_fix_ave_spatial.html. Also "fix
dt/reset"_fix_dt_reset.html and "fix deposit"_fix_deposit.html.
[Related commands:]
"compute event/displace"_compute_event_displace.html,
"min_modify"_min_modify.html, "min_style"_min_style.html,
"run_style"_run_style.html, "minimize"_minimize.html,
"temper"_temper.html, "neb"_neb.html,
"prd"_prd.html
[Default:]
The option defaults are {min} = 0.1 0.1 40 50, {neb} = 0.01 100 100
10, {min_style} = {cg}, {neb_style} = {quickmin}, and {neb_log} =
"none"
:line
:link(Voter)
[(Voter)] Sørensen and Voter, J Chem Phys, 112, 9599 (2000)
:link(Voter2)
[(Voter2)] Voter, Montalenti, Germann, Annual Review of Materials
Research 32, 321 (2002).
diff --git a/doc/temper.html b/doc/temper.html
index 514db7886..01157902a 100644
--- a/doc/temper.html
+++ b/doc/temper.html
@@ -1,137 +1,137 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>temper command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>temper N M temp fix-ID seed1 seed2 index
</PRE>
<UL><LI>N = total # of timesteps to run
<LI>M = attempt a tempering swap every this many steps
<LI>temp = initial temperature for this ensemble
<LI>fix-ID = ID of the fix that will control temperature during the run
<LI>seed1 = random # seed used to decide on adjacent temperature to partner with
<LI>seed2 = random # seed for Boltzmann factor in Metropolis swap
<LI>index = which temperature (0 to N-1) I am simulating (optional)
</UL>
<P><B>Examples:</B>
</P>
<PRE>temper 100000 100 $t tempfix 0 58728
temper 40000 100 $t tempfix 0 32285 $w
</PRE>
<P><B>Description:</B>
</P>
<P>Run a parallel tempering or replica exchange simulation using multiple
replicas (ensembles) of a system. Two or more replicas must be used.
</P>
<P>Each replica runs on a partition of one or more processors. Processor
partitions are defined at run-time using the -partition command-line
-switch; see <A HREF = "Section_start.html#start_6">this section</A> of the manual.
-Note that if you have MPI installed, you can run a multi-replica
-simulation with more replicas (partitions) than you have physical
-processors, e.g you can run a 10-replica simulation on one or two
-processors. You will simply not get the performance speed-up you
+switch; see <A HREF = "Section_start.html#start_6">Section_start 6</A> of the
+manual. Note that if you have MPI installed, you can run a
+multi-replica simulation with more replicas (partitions) than you have
+physical processors, e.g you can run a 10-replica simulation on one or
+two processors. You will simply not get the performance speed-up you
would see with one or more physical processors per replica. See <A HREF = "Section_howto.html#howto_5">this
section</A> of the manual for further
discussion.
</P>
<P>Each replica's temperature is controlled at a different value by a fix
with <I>fix-ID</I> that controls temperature. Possible fix styles are
<A HREF = "fix_nh.html">nvt</A>, <A HREF = "fix_nh.html">temp/berendsen</A>,
<A HREF = "fix_langevin.html">langevin</A> and <A HREF = "fix_temp_rescale.html">temp/rescale</A>.
The desired temperature is specified by <I>temp</I>, which is typically a
variable previously set in the input script, so that each partition is
assigned a different temperature. See the <A HREF = "variable.html">variable</A>
command for more details. For example:
</P>
<PRE>variable t world 300.0 310.0 320.0 330.0
fix myfix all nvt $t $t 100.0
temper 100000 100 $t myfix 3847 58382
</PRE>
<P>would define 4 temperatures, and assign one of them to the thermostat
used by each replica, and to the temper command.
</P>
<P>As the tempering simulation runs for <I>N</I> timesteps, a temperature swap
between adjacent ensembles will be attempted every <I>M</I> timesteps. If
<I>seed1</I> is 0, then the swap attempts will alternate between odd and
even pairings. If <I>seed1</I> is non-zero then it is used as a seed in a
random number generator to randomly choose an odd or even pairing each
time. Each attempted swap of temperatures is either accepted or
rejected based on a Boltzmann-weighted Metropolis criterion which uses
<I>seed2</I> in the random number generator.
</P>
<P>As a tempering run proceeds, multiple log files and screen output
files are created, one per replica. By default these files are named
log.lammps.M and screen.M where M is the replica number from 0 to N-1,
with N = # of replicas. See the <A HREF = "Section_start.html#start_6">section on command-line
switches</A> for info on how to change these
names.
</P>
<P>The main screen and log file (log.lammps) will list information about
which temperature is assigned to each replica at each thermodynamic
output timestep. E.g. for a simulation with 16 replicas:
</P>
<PRE>Running on 16 partitions of processors
Step T0 T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15
0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
500 1 0 3 2 5 4 6 7 8 9 10 11 12 13 14 15
1000 2 0 4 1 5 3 6 7 8 9 10 11 12 14 13 15
1500 2 1 4 0 5 3 6 7 9 8 10 11 12 14 13 15
2000 2 1 3 0 6 4 5 7 10 8 9 11 12 14 13 15
2500 2 1 3 0 6 4 5 7 11 8 9 10 12 14 13 15
...
</PRE>
<P>The column headings T0 to TN-1 mean which temperature is currently
assigned to the replica 0 to N-1. Thus the columns represent replicas
and the value in each column is its temperature (also numbered 0 to
N-1). For example, a 0 in the 4th column (column T3, step 2500) means
that the 4th replica is assigned temperature 0, i.e. the lowest
temperature. You can verify this time sequence of temperature
assignments for the Nth replica by comparing the Nth column of screen
output to the thermodynamic data in the corresponding log.lammps.N or
screen.N files as time proceeds.
</P>
<P>The last argument <I>index</I> in the temper command is optional and is
used when restarting a tempering run from a set of restart files (one
for each replica) which had previously swapped to new temperatures.
The <I>index</I> value (from 0 to N-1, where N is the # of replicas)
identifies which temperature the replica was simulating on the
timestep the restart files were written. Obviously, this argument
must be a variable so that each partition has the correct value. Set
the variable to the <I>N</I> values listed in the log file for the previous
run for the replica temperatures at that timestep. For example if the
log file listed the following for a simulation with 5 replicas:
</P>
<PRE>500000 2 4 0 1 3
</PRE>
<P>then a setting of
</P>
<PRE>variable w world 2 4 0 1 3
</PRE>
<P>would be used to restart the run with a tempering command like the
example above with $w as the last argument.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This command can only be used if LAMMPS was built with the REPLICA
package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A> section
for more info on packages.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "variable.html">variable</A>, <A HREF = "prd.html">prd</A>, <A HREF = "neb.html">neb</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
diff --git a/doc/temper.txt b/doc/temper.txt
index 70f1e2f0d..803c505cd 100644
--- a/doc/temper.txt
+++ b/doc/temper.txt
@@ -1,132 +1,132 @@
"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
temper command :h3
[Syntax:]
temper N M temp fix-ID seed1 seed2 index :pre
N = total # of timesteps to run
M = attempt a tempering swap every this many steps
temp = initial temperature for this ensemble
fix-ID = ID of the fix that will control temperature during the run
seed1 = random # seed used to decide on adjacent temperature to partner with
seed2 = random # seed for Boltzmann factor in Metropolis swap
index = which temperature (0 to N-1) I am simulating (optional) :ul
[Examples:]
temper 100000 100 $t tempfix 0 58728
temper 40000 100 $t tempfix 0 32285 $w :pre
[Description:]
Run a parallel tempering or replica exchange simulation using multiple
replicas (ensembles) of a system. Two or more replicas must be used.
Each replica runs on a partition of one or more processors. Processor
partitions are defined at run-time using the -partition command-line
-switch; see "this section"_Section_start.html#start_6 of the manual.
-Note that if you have MPI installed, you can run a multi-replica
-simulation with more replicas (partitions) than you have physical
-processors, e.g you can run a 10-replica simulation on one or two
-processors. You will simply not get the performance speed-up you
+switch; see "Section_start 6"_Section_start.html#start_6 of the
+manual. Note that if you have MPI installed, you can run a
+multi-replica simulation with more replicas (partitions) than you have
+physical processors, e.g you can run a 10-replica simulation on one or
+two processors. You will simply not get the performance speed-up you
would see with one or more physical processors per replica. See "this
section"_Section_howto.html#howto_5 of the manual for further
discussion.
Each replica's temperature is controlled at a different value by a fix
with {fix-ID} that controls temperature. Possible fix styles are
"nvt"_fix_nh.html, "temp/berendsen"_fix_nh.html,
"langevin"_fix_langevin.html and "temp/rescale"_fix_temp_rescale.html.
The desired temperature is specified by {temp}, which is typically a
variable previously set in the input script, so that each partition is
assigned a different temperature. See the "variable"_variable.html
command for more details. For example:
variable t world 300.0 310.0 320.0 330.0
fix myfix all nvt $t $t 100.0
temper 100000 100 $t myfix 3847 58382 :pre
would define 4 temperatures, and assign one of them to the thermostat
used by each replica, and to the temper command.
As the tempering simulation runs for {N} timesteps, a temperature swap
between adjacent ensembles will be attempted every {M} timesteps. If
{seed1} is 0, then the swap attempts will alternate between odd and
even pairings. If {seed1} is non-zero then it is used as a seed in a
random number generator to randomly choose an odd or even pairing each
time. Each attempted swap of temperatures is either accepted or
rejected based on a Boltzmann-weighted Metropolis criterion which uses
{seed2} in the random number generator.
As a tempering run proceeds, multiple log files and screen output
files are created, one per replica. By default these files are named
log.lammps.M and screen.M where M is the replica number from 0 to N-1,
with N = # of replicas. See the "section on command-line
switches"_Section_start.html#start_6 for info on how to change these
names.
The main screen and log file (log.lammps) will list information about
which temperature is assigned to each replica at each thermodynamic
output timestep. E.g. for a simulation with 16 replicas:
Running on 16 partitions of processors
Step T0 T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15
0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
500 1 0 3 2 5 4 6 7 8 9 10 11 12 13 14 15
1000 2 0 4 1 5 3 6 7 8 9 10 11 12 14 13 15
1500 2 1 4 0 5 3 6 7 9 8 10 11 12 14 13 15
2000 2 1 3 0 6 4 5 7 10 8 9 11 12 14 13 15
2500 2 1 3 0 6 4 5 7 11 8 9 10 12 14 13 15
... :pre
The column headings T0 to TN-1 mean which temperature is currently
assigned to the replica 0 to N-1. Thus the columns represent replicas
and the value in each column is its temperature (also numbered 0 to
N-1). For example, a 0 in the 4th column (column T3, step 2500) means
that the 4th replica is assigned temperature 0, i.e. the lowest
temperature. You can verify this time sequence of temperature
assignments for the Nth replica by comparing the Nth column of screen
output to the thermodynamic data in the corresponding log.lammps.N or
screen.N files as time proceeds.
The last argument {index} in the temper command is optional and is
used when restarting a tempering run from a set of restart files (one
for each replica) which had previously swapped to new temperatures.
The {index} value (from 0 to N-1, where N is the # of replicas)
identifies which temperature the replica was simulating on the
timestep the restart files were written. Obviously, this argument
must be a variable so that each partition has the correct value. Set
the variable to the {N} values listed in the log file for the previous
run for the replica temperatures at that timestep. For example if the
log file listed the following for a simulation with 5 replicas:
500000 2 4 0 1 3 :pre
then a setting of
variable w world 2 4 0 1 3 :pre
would be used to restart the run with a tempering command like the
example above with $w as the last argument.
:line
[Restrictions:]
This command can only be used if LAMMPS was built with the REPLICA
package. See the "Making LAMMPS"_Section_start.html#start_3 section
for more info on packages.
[Related commands:]
"variable"_variable.html, "prd"_prd.html, "neb"_neb.html
[Default:] none
diff --git a/doc/thermo_style.html b/doc/thermo_style.html
index 3c5844354..8641eb138 100644
--- a/doc/thermo_style.html
+++ b/doc/thermo_style.html
@@ -1,324 +1,324 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>thermo_style command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>thermo_style style args
</PRE>
<UL><LI>style = <I>one</I> or <I>multi</I> or <I>custom</I>
<LI>args = list of arguments for a particular style
<PRE> <I>one</I> args = none
<I>multi</I> args = none
<I>custom</I> args = list of attributes
possible attributes = step, elapsed, elaplong, dt, cpu, tpcpu, spcpu,
atoms, temp, press, pe, ke, etotal, enthalpy,
evdwl, ecoul, epair, ebond, eangle, edihed, eimp,
emol, elong, etail,
vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi,
xy, xz, yz, xlat, ylat, zlat,
pxx, pyy, pzz, pxy, pxz, pyz,
fmax, fnorm,
cella, cellb, cellc, cellalpha, cellbeta, cellgamma,
c_ID, c_ID[I], c_ID[I][J],
f_ID, f_ID[I], f_ID[I][J],
v_name
step = timestep
elapsed = timesteps since start of this run
elaplong = timesteps since start of initial run in a series of runs
dt = timestep size
cpu = elapsed CPU time in seconds
tpcpu = time per CPU second
spcpu = timesteps per CPU second
atoms = # of atoms
temp = temperature
press = pressure
pe = total potential energy
ke = kinetic energy
etotal = total energy (pe + ke)
enthalpy = enthalpy (etotal + press*vol)
evdwl = VanderWaal pairwise energy
ecoul = Coulombic pairwise energy
epair = pairwise energy (evdwl + ecoul + elong + etail)
ebond = bond energy
eangle = angle energy
edihed = dihedral energy
eimp = improper energy
emol = molecular energy (ebond + eangle + edihed + eimp)
elong = long-range kspace energy
etail = VanderWaal energy long-range tail correction
vol = volume
lx,ly,lz = box lengths in x,y,z
xlo,xhi,ylo,yhi,zlo,zhi = box boundaries
xy,xz,yz = box tilt for triclinic (non-orthogonal) simulation boxes
xlat,ylat,zlat = lattice spacings as calculated by <A HREF = "lattice.html">lattice</A> command
pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor
fmax = max component of force on any atom in any dimension
fnorm = length of force vector for all atoms
cella,cellb,cellc = periodic cell lattice constants a,b,c
cellalpha, cellbeta, cellgamma = periodic cell angles alpha,beta,gamma
c_ID = global scalar value calculated by a compute with ID
c_ID[I] = Ith component of global vector calculated by a compute with ID
c_ID[I][J] = I,J component of global array calculated by a compute with ID
f_ID = global scalar value calculated by a fix with ID
f_ID[I] = Ith component of global vector calculated by a fix with ID
f_ID[I][J] = I,J component of global array calculated by a fix with ID
v_name = scalar value calculated by an equal-style variable with name
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>thermo_style multi
thermo_style custom step temp pe etotal press vol
thermo_style custom step temp etotal c_myTemp v_abc
</PRE>
<P><B>Description:</B>
</P>
<P>Set the style and content for printing thermodynamic data to the
screen and log file.
</P>
<P>Style <I>one</I> prints a one-line summary of thermodynamic info that is
the equivalent of "thermo_style custom step temp epair emol etotal
press". The line contains only numeric values.
</P>
<P>Style <I>multi</I> prints a multiple-line listing of thermodynamic info
that is the equivalent of "thermo_style custom etotal ke temp pe ebond
eangle edihed eimp evdwl ecoul elong press". The listing contains
numeric values and a string ID for each quantity.
</P>
<P>Style <I>custom</I> is the most general setting and allows you to specify
which of the keywords listed above you want printed on each
thermodynamic timestep. Note that the keywords c_ID, f_ID, v_name are
references to <A HREF = "compute.html">computes</A>, <A HREF = "fix.html">fixes</A>, and
equal-style <A HREF = "variable.html"">variables</A> that have been defined
elsewhere in the input script or can even be new styles which users
have added to LAMMPS (see the <A HREF = "Section_modify.html">Section_modify</A>
section of the documentation). Thus the <I>custom</I> style provides a
flexible means of outputting essentially any desired quantity as a
simulation proceeds.
</P>
<P>All styles except <I>custom</I> have <I>vol</I> appended to their list of
outputs if the simulation box volume changes during the simulation.
</P>
<P>The values printed by the various keywords are instantaneous values,
calculated on the current timestep. Time-averaged quantities, which
include values from previous timesteps, can be output by using the
f_ID keyword and accessing a fix that does time-averaging such as the
<A HREF = "fix_ave_time.html">fix ave/time</A> command.
</P>
<P>Options invoked by the <A HREF = "thermo_modify.html">thermo_modify</A> command can
be used to set the one- or multi-line format of the print-out, the
normalization of thermodynamic output (total values versus per-atom
values for extensive quantities (ones which scale with the number of
atoms in the system), and the numeric precision of each printed value.
</P>
<P>IMPORTANT NOTE: When you use a "thermo_style" command, all
thermodynamic settings are restored to their default values, including
those previously set by a <A HREF = "thermo_modify.html">thermo_modify</A> command.
Thus if your input script specifies a thermo_style command, you should
use the thermo_modify command after it.
</P>
<HR>
<P>Several of the thermodynamic quantities require a temperature to be
computed: "temp", "press", "ke", "etotal", "enthalpy", "pxx", etc. By
default this is done by using a <I>temperature</I> compute which is created
when LAMMPS starts up, as if this command had been issued:
</P>
<PRE>compute thermo_temp all temp
</PRE>
<P>See the <A HREF = "compute_temp.html">compute temp</A> command for details. Note
that the ID of this compute is <I>thermo_temp</I> and the group is <I>all</I>.
You can change the attributes of this temperature (e.g. its
degrees-of-freedom) via the <A HREF = "compute_modify.html">compute_modify</A>
command. Alternatively, you can directly assign a new compute (that
calculates temperature) which you have defined, to be used for
calculating any thermodynamic quantity that requires a temperature.
This is done via the <A HREF = "thermo_modify.html">thermo_modify</A> command.
</P>
<P>Several of the thermodynamic quantities require a pressure to be
computed: "press", "enthalpy", "pxx", etc. By default this is done by
using a <I>pressure</I> compute which is created when LAMMPS starts up, as
if this command had been issued:
</P>
<PRE>compute thermo_press all pressure thermo_temp
</PRE>
<P>See the <A HREF = "compute_pressure.html">compute pressure</A> command for details.
Note that the ID of this compute is <I>thermo_press</I> and the group is
<I>all</I>. You can change the attributes of this pressure via the
<A HREF = "compute_modify.html">compute_modify</A> command. Alternatively, you can
directly assign a new compute (that calculates pressure) which you
have defined, to be used for calculating any thermodynamic quantity
that requires a pressure. This is done via the
<A HREF = "thermo_modify.html">thermo_modify</A> command.
</P>
<P>Several of the thermodynamic quantities require a potential energy to
be computed: "pe", "etotal", "ebond", etc. This is done by using a
<I>pe</I> compute which is created when LAMMPS starts up, as if this
command had been issued:
</P>
<PRE>compute thermo_pe all pe
</PRE>
<P>See the <A HREF = "compute_pe.html">compute pe</A> command for details. Note that
the ID of this compute is <I>thermo_pe</I> and the group is <I>all</I>. You can
change the attributes of this potential energy via the
<A HREF = "compute_modify.html">compute_modify</A> command.
</P>
<HR>
<P>The kinetic energy of the system <I>ke</I> is inferred from the temperature
of the system with 1/2 Kb T of energy for each degree of freedom.
Thus, using different <A HREF = "compute.html">compute commands</A> for calculating
temperature, via the <A HREF = "thermo_modify.html">thermo_modify temp</A> command,
may yield different kinetic energies, since different computes that
calculate temperature can subtract out different non-thermal
components of velocity and/or include different degrees of freedom
(translational, rotational, etc).
</P>
<P>The potential energy of the system <I>pe</I> will include contributions
from fixes if the <A HREF = "fix_modify.html">fix_modify thermo</A> option is set
for a fix that calculates such a contribution. For example, the <A HREF = "fix_wall.html">fix
wall/lj93</A> fix calculates the energy of atoms
interacting with the wall. See the doc pages for "individual fixes"
to see which ones contribute.
</P>
<P>A long-range tail correction <I>etail</I> for the VanderWaal pairwise
energy will be non-zero only if the <A HREF = "pair_modify.html">pair_modify
tail</A> option is turned on. The <I>etail</I> contribution
is included in <I>evdwl</I>, <I>pe</I>, and <I>etotal</I>, and the corresponding tail
correction to the pressure is included in <I>press</I> and <I>pxx</I>, <I>pyy</I>,
etc.
</P>
<HR>
<P>The <I>step</I>, <I>elapsed</I>, and <I>elaplong</I> keywords refer to timestep
count. <I>Step</I> is the current timestep, or iteration count when a
<A HREF = "minimize.html">minimization</A> is being performed. <I>Elapsed</I> is the
number of timesteps elapsed since the beginning of this run.
<I>Elaplong</I> is the number of timesteps elapsed since the beginning of
an initial run in a series of runs. See the <I>start</I> and <I>stop</I>
keywords for the <A HREF = "run.html">run</A> for info on how to invoke a series of
runs that keep track of an initial starting time. If these keywords
are not used, then <I>elapsed</I> and <I>elaplong</I> are the same value.
</P>
<P>The <I>cpu</I> keyword is elapsed CPU seconds since the beginning of this
run. The <I>tpcpu</I> and <I>spcpu</I> keywords are measures of how fast your
simulation is currently running. The <I>tpcpu</I> keyword is simulation
time per CPU second, where simulation time is in time
<A HREF = "units.html">units</A>. E.g. for metal units, the <I>tpcpu</I> value would be
picoseconds per CPU second. The <I>spcpu</I> keyword is the number of
timesteps per CPU second. Both quantities are on-the-fly metrics,
measured relative to the last time they were invoked. Thus if you are
printing out thermodyamic output every 100 timesteps, the two keywords
will continually output the time and timestep rate for the last 100
steps. The <I>tpcpu</I> keyword does not attempt to track any changes in
timestep size, e.g. due to using the <A HREF = "fix_dt_reset.html">fix dt/reset</A>
command.
</P>
<P>The <I>fmax</I> and <I>fnorm</I> keywords are useful for monitoring the progress
of an <A HREF = "minimize.html">energy minimization</A>. The <I>fmax</I> keyword
calculates the maximum force in any dimension on any atom in the
system, or the infinity-norm of the force vector for the system. The
<I>fnorm</I> keyword calculates the 2-norm or length of the force vector.
</P>
<P>The keywords <I>cella</I>, <I>cellb</I>, <I>cellc</I>, <I>cellalpha</I>, <I>cellbeta</I>,
<I>cellgamma</I>, correspond to the usual crystallographic quantities that
define the periodic unit cell of a crystal. See <A HREF = "Section_howto.html#howto_12">this
section</A> of the doc pages for a geometric
description of triclinic periodic cells, including a precise defintion
of these quantities in terms of the internal LAMMPS cell dimensions
<I>lx</I>, <I>ly</I>, <I>lz</I>, <I>yz</I>, <I>xz</I>, <I>xy</I>,
</P>
<HR>
<P>The <I>c_ID</I> and <I>c_ID[I]</I> and <I>c_ID[I][J]</I> keywords allow global
values calculated by a compute to be output. As discussed on the
<A HREF = "compute.html">compute</A> doc page, computes can calculate global,
per-atom, or local values. Only global values can be referenced by
this command. However, per-atom compute values can be referenced in a
<A HREF = "variable.html">variable</A> and the variable referenced by thermo_style
custom, as discussed below.
</P>
<P>The ID in the keyword should be replaced by the actual ID of a compute
that has been defined elsewhere in the input script. See the
<A HREF = "compute.html">compute</A> command for details. If the compute calculates
a global scalar, vector, or array, then the keyword formats with 0, 1,
or 2 brackets will reference a scalar value from the compute.
</P>
<P>Note that some computes calculate "intensive" global quantities like
temperature; others calculate "extensive" global quantities like
kinetic energy that are summed over all atoms in the compute group.
Intensive quantities are printed directly without normalization by
thermo_style custom. Extensive quantities may be normalized by the
total number of atoms in the simulation (NOT the number of atoms in
the compute group) when output, depending on the <A HREF = "thermo_modify.html">thermo_modify
norm</A> option being used.
</P>
<P>The <I>f_ID</I> and <I>f_ID[I]</I> and <I>f_ID[I][J]</I> keywords allow global
values calculated by a fix to be output. As discussed on the
<A HREF = "fix.html">fix</A> doc page, fixes can calculate global, per-atom, or
local values. Only global values can be referenced by this command.
However, per-atom fix values can be referenced in a
<A HREF = "variable.html">variable</A> and the variable referenced by thermo_style
custom, as discussed below.
</P>
<P>The ID in the keyword should be replaced by the actual ID of a fix
that has been defined elsewhere in the input script. See the
<A HREF = "fix.html">fix</A> command for details. If the fix calculates a global
scalar, vector, or array, then the keyword formats with 0, 1, or 2
brackets will reference a scalar value from the fix.
</P>
<P>Note that some fixes calculate "intensive" global quantities like
timestep size; others calculate "extensive" global quantities like
energy that are summed over all atoms in the fix group. Intensive
quantities are printed directly without normalization by thermo_style
custom. Extensive quantities may be normalized by the total number of
atoms in the simulation (NOT the number of atoms in the fix group)
when output, depending on the <A HREF = "thermo_modify.html">thermo_modify norm</A>
option being used.
</P>
<P>The <I>v_name</I> keyword allow the current value of a variable to be
output. The name in the keyword should be replaced by the variable
name that has been defined elsewhere in the input script. Only
equal-style variables can be referenced. See the
<A HREF = "variable.html">variable</A> command for details. Variables of style
<I>equal</I> can reference per-atom properties or thermodynamic keywords,
or they can invoke other computes, fixes, or variables when evaluated,
so this is a very general means of creating thermodynamic output.
</P>
-<P>See <A HREF = "Section_modify.html">this section</A> for information on how to add
+<P>See <A HREF = "Section_modify.html">Section_modify</A> for information on how to add
new compute and fix styles to LAMMPS to calculate quantities that can
then be referenced with these keywords to generate thermodynamic
output.
</P>
<HR>
<P><B>Restrictions:</B>
</P>
<P>This command must come after the simulation box is defined by a
<A HREF = "read_data.html">read_data</A>, <A HREF = "read_restart.html">read_restart</A>, or
<A HREF = "create_box.html">create_box</A> command.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "thermo.html">thermo</A>, <A HREF = "thermo_modify.html">thermo_modify</A>,
<A HREF = "fix_modify.html">fix_modify</A>, <A HREF = "compute_temp.html">compute temp</A>,
<A HREF = "compute_pressure.html">compute pressure</A>
</P>
<P><B>Default:</B>
</P>
<PRE>thermo_style one
</PRE>
</HTML>
diff --git a/doc/thermo_style.txt b/doc/thermo_style.txt
index 8f4a64148..0e77cb728 100644
--- a/doc/thermo_style.txt
+++ b/doc/thermo_style.txt
@@ -1,316 +1,316 @@
"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
thermo_style command :h3
[Syntax:]
thermo_style style args :pre
style = {one} or {multi} or {custom} :ulb,l
args = list of arguments for a particular style :l
{one} args = none
{multi} args = none
{custom} args = list of attributes
possible attributes = step, elapsed, elaplong, dt, cpu, tpcpu, spcpu,
atoms, temp, press, pe, ke, etotal, enthalpy,
evdwl, ecoul, epair, ebond, eangle, edihed, eimp,
emol, elong, etail,
vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi,
xy, xz, yz, xlat, ylat, zlat,
pxx, pyy, pzz, pxy, pxz, pyz,
fmax, fnorm,
cella, cellb, cellc, cellalpha, cellbeta, cellgamma,
c_ID, c_ID\[I\], c_ID\[I\]\[J\],
f_ID, f_ID\[I\], f_ID\[I\]\[J\],
v_name
step = timestep
elapsed = timesteps since start of this run
elaplong = timesteps since start of initial run in a series of runs
dt = timestep size
cpu = elapsed CPU time in seconds
tpcpu = time per CPU second
spcpu = timesteps per CPU second
atoms = # of atoms
temp = temperature
press = pressure
pe = total potential energy
ke = kinetic energy
etotal = total energy (pe + ke)
enthalpy = enthalpy (etotal + press*vol)
evdwl = VanderWaal pairwise energy
ecoul = Coulombic pairwise energy
epair = pairwise energy (evdwl + ecoul + elong + etail)
ebond = bond energy
eangle = angle energy
edihed = dihedral energy
eimp = improper energy
emol = molecular energy (ebond + eangle + edihed + eimp)
elong = long-range kspace energy
etail = VanderWaal energy long-range tail correction
vol = volume
lx,ly,lz = box lengths in x,y,z
xlo,xhi,ylo,yhi,zlo,zhi = box boundaries
xy,xz,yz = box tilt for triclinic (non-orthogonal) simulation boxes
xlat,ylat,zlat = lattice spacings as calculated by "lattice"_lattice.html command
pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor
fmax = max component of force on any atom in any dimension
fnorm = length of force vector for all atoms
cella,cellb,cellc = periodic cell lattice constants a,b,c
cellalpha, cellbeta, cellgamma = periodic cell angles alpha,beta,gamma
c_ID = global scalar value calculated by a compute with ID
c_ID\[I\] = Ith component of global vector calculated by a compute with ID
c_ID\[I\]\[J\] = I,J component of global array calculated by a compute with ID
f_ID = global scalar value calculated by a fix with ID
f_ID\[I\] = Ith component of global vector calculated by a fix with ID
f_ID\[I\]\[J\] = I,J component of global array calculated by a fix with ID
v_name = scalar value calculated by an equal-style variable with name :pre
:ule
[Examples:]
thermo_style multi
thermo_style custom step temp pe etotal press vol
thermo_style custom step temp etotal c_myTemp v_abc :pre
[Description:]
Set the style and content for printing thermodynamic data to the
screen and log file.
Style {one} prints a one-line summary of thermodynamic info that is
the equivalent of "thermo_style custom step temp epair emol etotal
press". The line contains only numeric values.
Style {multi} prints a multiple-line listing of thermodynamic info
that is the equivalent of "thermo_style custom etotal ke temp pe ebond
eangle edihed eimp evdwl ecoul elong press". The listing contains
numeric values and a string ID for each quantity.
Style {custom} is the most general setting and allows you to specify
which of the keywords listed above you want printed on each
thermodynamic timestep. Note that the keywords c_ID, f_ID, v_name are
references to "computes"_compute.html, "fixes"_fix.html, and
equal-style "variables"_variable.html" that have been defined
elsewhere in the input script or can even be new styles which users
have added to LAMMPS (see the "Section_modify"_Section_modify.html
section of the documentation). Thus the {custom} style provides a
flexible means of outputting essentially any desired quantity as a
simulation proceeds.
All styles except {custom} have {vol} appended to their list of
outputs if the simulation box volume changes during the simulation.
The values printed by the various keywords are instantaneous values,
calculated on the current timestep. Time-averaged quantities, which
include values from previous timesteps, can be output by using the
f_ID keyword and accessing a fix that does time-averaging such as the
"fix ave/time"_fix_ave_time.html command.
Options invoked by the "thermo_modify"_thermo_modify.html command can
be used to set the one- or multi-line format of the print-out, the
normalization of thermodynamic output (total values versus per-atom
values for extensive quantities (ones which scale with the number of
atoms in the system), and the numeric precision of each printed value.
IMPORTANT NOTE: When you use a "thermo_style" command, all
thermodynamic settings are restored to their default values, including
those previously set by a "thermo_modify"_thermo_modify.html command.
Thus if your input script specifies a thermo_style command, you should
use the thermo_modify command after it.
:line
Several of the thermodynamic quantities require a temperature to be
computed: "temp", "press", "ke", "etotal", "enthalpy", "pxx", etc. By
default this is done by using a {temperature} compute which is created
when LAMMPS starts up, as if this command had been issued:
compute thermo_temp all temp :pre
See the "compute temp"_compute_temp.html command for details. Note
that the ID of this compute is {thermo_temp} and the group is {all}.
You can change the attributes of this temperature (e.g. its
degrees-of-freedom) via the "compute_modify"_compute_modify.html
command. Alternatively, you can directly assign a new compute (that
calculates temperature) which you have defined, to be used for
calculating any thermodynamic quantity that requires a temperature.
This is done via the "thermo_modify"_thermo_modify.html command.
Several of the thermodynamic quantities require a pressure to be
computed: "press", "enthalpy", "pxx", etc. By default this is done by
using a {pressure} compute which is created when LAMMPS starts up, as
if this command had been issued:
compute thermo_press all pressure thermo_temp :pre
See the "compute pressure"_compute_pressure.html command for details.
Note that the ID of this compute is {thermo_press} and the group is
{all}. You can change the attributes of this pressure via the
"compute_modify"_compute_modify.html command. Alternatively, you can
directly assign a new compute (that calculates pressure) which you
have defined, to be used for calculating any thermodynamic quantity
that requires a pressure. This is done via the
"thermo_modify"_thermo_modify.html command.
Several of the thermodynamic quantities require a potential energy to
be computed: "pe", "etotal", "ebond", etc. This is done by using a
{pe} compute which is created when LAMMPS starts up, as if this
command had been issued:
compute thermo_pe all pe :pre
See the "compute pe"_compute_pe.html command for details. Note that
the ID of this compute is {thermo_pe} and the group is {all}. You can
change the attributes of this potential energy via the
"compute_modify"_compute_modify.html command.
:line
The kinetic energy of the system {ke} is inferred from the temperature
of the system with 1/2 Kb T of energy for each degree of freedom.
Thus, using different "compute commands"_compute.html for calculating
temperature, via the "thermo_modify temp"_thermo_modify.html command,
may yield different kinetic energies, since different computes that
calculate temperature can subtract out different non-thermal
components of velocity and/or include different degrees of freedom
(translational, rotational, etc).
The potential energy of the system {pe} will include contributions
from fixes if the "fix_modify thermo"_fix_modify.html option is set
for a fix that calculates such a contribution. For example, the "fix
wall/lj93"_fix_wall.html fix calculates the energy of atoms
interacting with the wall. See the doc pages for "individual fixes"
to see which ones contribute.
A long-range tail correction {etail} for the VanderWaal pairwise
energy will be non-zero only if the "pair_modify
tail"_pair_modify.html option is turned on. The {etail} contribution
is included in {evdwl}, {pe}, and {etotal}, and the corresponding tail
correction to the pressure is included in {press} and {pxx}, {pyy},
etc.
:line
The {step}, {elapsed}, and {elaplong} keywords refer to timestep
count. {Step} is the current timestep, or iteration count when a
"minimization"_minimize.html is being performed. {Elapsed} is the
number of timesteps elapsed since the beginning of this run.
{Elaplong} is the number of timesteps elapsed since the beginning of
an initial run in a series of runs. See the {start} and {stop}
keywords for the "run"_run.html for info on how to invoke a series of
runs that keep track of an initial starting time. If these keywords
are not used, then {elapsed} and {elaplong} are the same value.
The {cpu} keyword is elapsed CPU seconds since the beginning of this
run. The {tpcpu} and {spcpu} keywords are measures of how fast your
simulation is currently running. The {tpcpu} keyword is simulation
time per CPU second, where simulation time is in time
"units"_units.html. E.g. for metal units, the {tpcpu} value would be
picoseconds per CPU second. The {spcpu} keyword is the number of
timesteps per CPU second. Both quantities are on-the-fly metrics,
measured relative to the last time they were invoked. Thus if you are
printing out thermodyamic output every 100 timesteps, the two keywords
will continually output the time and timestep rate for the last 100
steps. The {tpcpu} keyword does not attempt to track any changes in
timestep size, e.g. due to using the "fix dt/reset"_fix_dt_reset.html
command.
The {fmax} and {fnorm} keywords are useful for monitoring the progress
of an "energy minimization"_minimize.html. The {fmax} keyword
calculates the maximum force in any dimension on any atom in the
system, or the infinity-norm of the force vector for the system. The
{fnorm} keyword calculates the 2-norm or length of the force vector.
The keywords {cella}, {cellb}, {cellc}, {cellalpha}, {cellbeta},
{cellgamma}, correspond to the usual crystallographic quantities that
define the periodic unit cell of a crystal. See "this
section"_Section_howto.html#howto_12 of the doc pages for a geometric
description of triclinic periodic cells, including a precise defintion
of these quantities in terms of the internal LAMMPS cell dimensions
{lx}, {ly}, {lz}, {yz}, {xz}, {xy},
:line
The {c_ID} and {c_ID\[I\]} and {c_ID\[I\]\[J\]} keywords allow global
values calculated by a compute to be output. As discussed on the
"compute"_compute.html doc page, computes can calculate global,
per-atom, or local values. Only global values can be referenced by
this command. However, per-atom compute values can be referenced in a
"variable"_variable.html and the variable referenced by thermo_style
custom, as discussed below.
The ID in the keyword should be replaced by the actual ID of a compute
that has been defined elsewhere in the input script. See the
"compute"_compute.html command for details. If the compute calculates
a global scalar, vector, or array, then the keyword formats with 0, 1,
or 2 brackets will reference a scalar value from the compute.
Note that some computes calculate "intensive" global quantities like
temperature; others calculate "extensive" global quantities like
kinetic energy that are summed over all atoms in the compute group.
Intensive quantities are printed directly without normalization by
thermo_style custom. Extensive quantities may be normalized by the
total number of atoms in the simulation (NOT the number of atoms in
the compute group) when output, depending on the "thermo_modify
norm"_thermo_modify.html option being used.
The {f_ID} and {f_ID\[I\]} and {f_ID\[I\]\[J\]} keywords allow global
values calculated by a fix to be output. As discussed on the
"fix"_fix.html doc page, fixes can calculate global, per-atom, or
local values. Only global values can be referenced by this command.
However, per-atom fix values can be referenced in a
"variable"_variable.html and the variable referenced by thermo_style
custom, as discussed below.
The ID in the keyword should be replaced by the actual ID of a fix
that has been defined elsewhere in the input script. See the
"fix"_fix.html command for details. If the fix calculates a global
scalar, vector, or array, then the keyword formats with 0, 1, or 2
brackets will reference a scalar value from the fix.
Note that some fixes calculate "intensive" global quantities like
timestep size; others calculate "extensive" global quantities like
energy that are summed over all atoms in the fix group. Intensive
quantities are printed directly without normalization by thermo_style
custom. Extensive quantities may be normalized by the total number of
atoms in the simulation (NOT the number of atoms in the fix group)
when output, depending on the "thermo_modify norm"_thermo_modify.html
option being used.
The {v_name} keyword allow the current value of a variable to be
output. The name in the keyword should be replaced by the variable
name that has been defined elsewhere in the input script. Only
equal-style variables can be referenced. See the
"variable"_variable.html command for details. Variables of style
{equal} can reference per-atom properties or thermodynamic keywords,
or they can invoke other computes, fixes, or variables when evaluated,
so this is a very general means of creating thermodynamic output.
-See "this section"_Section_modify.html for information on how to add
+See "Section_modify"_Section_modify.html for information on how to add
new compute and fix styles to LAMMPS to calculate quantities that can
then be referenced with these keywords to generate thermodynamic
output.
:line
[Restrictions:]
This command must come after the simulation box is defined by a
"read_data"_read_data.html, "read_restart"_read_restart.html, or
"create_box"_create_box.html command.
[Related commands:]
"thermo"_thermo.html, "thermo_modify"_thermo_modify.html,
"fix_modify"_fix_modify.html, "compute temp"_compute_temp.html,
"compute pressure"_compute_pressure.html
[Default:]
thermo_style one :pre
diff --git a/src/ASPHERE/compute_erotate_asphere.h b/src/ASPHERE/compute_erotate_asphere.h
index 927442579..374293757 100644
--- a/src/ASPHERE/compute_erotate_asphere.h
+++ b/src/ASPHERE/compute_erotate_asphere.h
@@ -1,43 +1,61 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(erotate/asphere,ComputeERotateAsphere)
#else
#ifndef LMP_COMPUTE_EROTATE_ASPHERE_H
#define LMP_COMPUTE_EROTATE_ASPHERE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeERotateAsphere : public Compute {
public:
ComputeERotateAsphere(class LAMMPS *, int, char **);
void init();
double compute_scalar();
private:
double pfactor;
class AtomVecEllipsoid *avec_ellipsoid;
class AtomVecLine *avec_line;
class AtomVecTri *avec_tri;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute erotate/asphere requires atom style ellipsoid or line or tri
+
+UNDOCUMENTED
+
+E: Compute erotate/asphere requires extended particles
+
+This compute cannot be used with point paritlces.
+
+*/
diff --git a/src/ASPHERE/compute_temp_asphere.h b/src/ASPHERE/compute_temp_asphere.h
index dde67a1bd..e6bfc5af2 100644
--- a/src/ASPHERE/compute_temp_asphere.h
+++ b/src/ASPHERE/compute_temp_asphere.h
@@ -1,51 +1,86 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(temp/asphere,ComputeTempAsphere)
#else
#ifndef LMP_COMPUTE_TEMP_ASPHERE_H
#define LMP_COMPUTE_TEMP_ASPHERE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeTempAsphere : public Compute {
public:
ComputeTempAsphere(class LAMMPS *, int, char **);
~ComputeTempAsphere();
void init();
double compute_scalar();
void compute_vector();
void remove_bias(int, double *);
void restore_bias(int, double *);
private:
int fix_dof,mode;
double tfactor;
char *id_bias;
class Compute *tbias; // ptr to additional bias compute
class AtomVecEllipsoid *avec;
void dof_compute();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute temp/asphere requires atom style ellipsoid
+
+UNDOCUMENTED
+
+E: Compute temp/asphere requires extended particles
+
+This compute cannot be used with point paritlces.
+
+E: Could not find compute ID for temperature bias
+
+Self-explanatory.
+
+E: Bias compute does not calculate temperature
+
+The specified compute must compute temperature.
+
+E: Bias compute does not calculate a velocity bias
+
+The specified compute must compute a bias for temperature.
+
+E: Bias compute group does not match compute group
+
+The specified compute must operate on the same group as the parent
+compute.
+
+*/
diff --git a/src/ASPHERE/fix_nh_asphere.h b/src/ASPHERE/fix_nh_asphere.h
index 794502aec..21a9c713d 100644
--- a/src/ASPHERE/fix_nh_asphere.h
+++ b/src/ASPHERE/fix_nh_asphere.h
@@ -1,38 +1,51 @@
/* ----------------------------------------------------------------------
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_NH_ASPHERE_H
#define LMP_FIX_NH_ASPHERE_H
#include "fix_nh.h"
namespace LAMMPS_NS {
class FixNHAsphere : public FixNH {
public:
FixNHAsphere(class LAMMPS *, int, char **);
virtual ~FixNHAsphere() {}
void init();
protected:
double dtq;
class AtomVecEllipsoid *avec;
void nve_v();
void nve_x();
void nh_v_temp();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Compute nvt/nph/npt asphere requires atom style ellipsoid
+
+UNDOCUMENTED
+
+E: Fix nvt/nph/npt asphere requires extended particles
+
+The shape setting for a particle in the fix group has shape = 0.0,
+which means it is a point particle.
+
+*/
diff --git a/src/ASPHERE/fix_nph_asphere.h b/src/ASPHERE/fix_nph_asphere.h
index 87a8b1ce1..7dfd99226 100644
--- a/src/ASPHERE/fix_nph_asphere.h
+++ b/src/ASPHERE/fix_nph_asphere.h
@@ -1,36 +1,48 @@
/* ----------------------------------------------------------------------
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(nph/asphere,FixNPHAsphere)
#else
#ifndef LMP_FIX_NPH_ASPHERE_H
#define LMP_FIX_NPH_ASPHERE_H
#include "fix_nh_asphere.h"
namespace LAMMPS_NS {
class FixNPHAsphere : public FixNHAsphere {
public:
FixNPHAsphere(class LAMMPS *, int, char **);
~FixNPHAsphere() {}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Temperature control can not be used with fix nph/asphere
+
+Self-explanatory.
+
+E: Pressure control must be used with fix nph/asphere
+
+Self-explanatory.
+
+*/
diff --git a/src/ASPHERE/fix_npt_asphere.h b/src/ASPHERE/fix_npt_asphere.h
index fb8f3cf5c..1b874928e 100644
--- a/src/ASPHERE/fix_npt_asphere.h
+++ b/src/ASPHERE/fix_npt_asphere.h
@@ -1,36 +1,48 @@
/* ----------------------------------------------------------------------
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(npt/asphere,FixNPTAsphere)
#else
#ifndef LMP_FIX_NPT_ASPHERE_H
#define LMP_FIX_NPT_ASPHERE_H
#include "fix_nh_asphere.h"
namespace LAMMPS_NS {
class FixNPTAsphere : public FixNHAsphere {
public:
FixNPTAsphere(class LAMMPS *, int, char **);
~FixNPTAsphere() {}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Temperature control must be used with fix npt/asphere
+
+Self-explanatory.
+
+E: Pressure control must be used with fix npt/asphere
+
+Self-explanatory.
+
+*/
diff --git a/src/ASPHERE/fix_nve_asphere.h b/src/ASPHERE/fix_nve_asphere.h
index d9a659a8b..685a2d276 100644
--- a/src/ASPHERE/fix_nve_asphere.h
+++ b/src/ASPHERE/fix_nve_asphere.h
@@ -1,41 +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(nve/asphere,FixNVEAsphere)
#else
#ifndef LMP_FIX_NVE_ASPHERE_H
#define LMP_FIX_NVE_ASPHERE_H
#include "fix_nve.h"
namespace LAMMPS_NS {
class FixNVEAsphere : public FixNVE {
public:
FixNVEAsphere(class LAMMPS *, int, char **);
void init();
void initial_integrate(int);
void final_integrate();
private:
double dtq;
class AtomVecEllipsoid *avec;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Compute nve/asphere requires atom style ellipsoid
+
+UNDOCUMENTED
+
+E: Fix nve/asphere requires extended particles
+
+This fix can only be used for particles with a shape setting.
+
+*/
diff --git a/src/ASPHERE/fix_nve_asphere_noforce.h b/src/ASPHERE/fix_nve_asphere_noforce.h
index c1708ff7b..cc1c49739 100755
--- a/src/ASPHERE/fix_nve_asphere_noforce.h
+++ b/src/ASPHERE/fix_nve_asphere_noforce.h
@@ -1,41 +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.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/asphere/noforce,FixNVEAsphereNoforce)
#else
#ifndef LMP_FIX_NVE_ASPHERE_NOFORCE_H
#define LMP_FIX_NVE_ASPHERE_NOFORCE_H
#include "fix_nve_noforce.h"
namespace LAMMPS_NS {
class FixNVEAsphereNoforce : public FixNVENoforce {
public:
FixNVEAsphereNoforce(class LAMMPS *, int, char **);
void initial_integrate(int);
void init();
private:
double dtq;
class AtomVecEllipsoid *avec;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix nve/asphere/noforce requires atom style ellipsoid
+
+UNDOCUMENTED
+
+E: Fix nve/asphere/noforce requires extended particles
+
+UNDOCUMENTED
+
+*/
diff --git a/src/ASPHERE/fix_nve_line.h b/src/ASPHERE/fix_nve_line.h
index 7d6e96204..7ad52fdb0 100644
--- a/src/ASPHERE/fix_nve_line.h
+++ b/src/ASPHERE/fix_nve_line.h
@@ -1,44 +1,66 @@
/* ----------------------------------------------------------------------
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(nve/line,FixNVELine)
#else
#ifndef LMP_FIX_NVE_LINE_H
#define LMP_FIX_NVE_LINE_H
#include "fix_nve.h"
namespace LAMMPS_NS {
class FixNVELine : public FixNVE {
public:
FixNVELine(class LAMMPS *, int, char **);
~FixNVELine() {}
int setmask();
void init();
void initial_integrate(int);
void final_integrate();
private:
double MINUSPI,TWOPI;
class AtomVecLine *avec;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix nve/line requires atom style line
+
+UNDOCUMENTED
+
+E: Fix nve/line can only be used for 2d simulations
+
+UNDOCUMENTED
+
+E: Fix nve/line requires line particles
+
+UNDOCUMENTED
+
+*/
diff --git a/src/ASPHERE/fix_nve_tri.h b/src/ASPHERE/fix_nve_tri.h
index e268b6b1e..d676a140d 100644
--- a/src/ASPHERE/fix_nve_tri.h
+++ b/src/ASPHERE/fix_nve_tri.h
@@ -1,44 +1,66 @@
/* ----------------------------------------------------------------------
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(nve/tri,FixNVETri)
#else
#ifndef LMP_FIX_NVE_TRI_H
#define LMP_FIX_NVE_TRI_H
#include "fix_nve.h"
namespace LAMMPS_NS {
class FixNVETri : public FixNVE {
public:
FixNVETri(class LAMMPS *, int, char **);
~FixNVETri() {}
int setmask();
void init();
void initial_integrate(int);
void final_integrate();
private:
double dtq;
class AtomVecTri *avec;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix nve/tri requires atom style tri
+
+UNDOCUMENTED
+
+E: Fix nve/line can only be used for 3d simulations
+
+UNDOCUMENTED
+
+E: Fix nve/tri requires tri particles
+
+UNDOCUMENTED
+
+*/
diff --git a/src/ASPHERE/fix_nvt_asphere.h b/src/ASPHERE/fix_nvt_asphere.h
index 59f1111e1..223c073ec 100644
--- a/src/ASPHERE/fix_nvt_asphere.h
+++ b/src/ASPHERE/fix_nvt_asphere.h
@@ -1,36 +1,48 @@
/* ----------------------------------------------------------------------
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(nvt/asphere,FixNVTAsphere)
#else
#ifndef LMP_FIX_NVT_ASPHERE_H
#define LMP_FIX_NVT_ASPHERE_H
#include "fix_nh_asphere.h"
namespace LAMMPS_NS {
class FixNVTAsphere : public FixNHAsphere {
public:
FixNVTAsphere(class LAMMPS *, int, char **);
~FixNVTAsphere() {}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Temperature control must be used with fix nvt/asphere
+
+Self-explanatory.
+
+E: Pressure control can not be used with fix nvt/asphere
+
+Self-explanatory.
+
+*/
diff --git a/src/ASPHERE/pair_gayberne.h b/src/ASPHERE/pair_gayberne.h
index 0923d6112..64db9f4f7 100644
--- a/src/ASPHERE/pair_gayberne.h
+++ b/src/ASPHERE/pair_gayberne.h
@@ -1,75 +1,106 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(gayberne,PairGayBerne)
#else
#ifndef LMP_PAIR_GAYBERNE_H
#define LMP_PAIR_GAYBERNE_H
#include "pair.h"
namespace LAMMPS_NS {
class PairGayBerne : public Pair {
public:
PairGayBerne(LAMMPS *lmp);
virtual ~PairGayBerne();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
virtual void init_style();
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
protected:
enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
double cut_global;
double **cut;
double gamma,upsilon,mu; // Gay-Berne parameters
double **shape1; // per-type radii in x, y and z
double **shape2; // per-type radii in x, y and z SQUARED
double *lshape; // precalculation based on the shape
double **well; // well depth scaling along each axis ^ -1.0/mu
double **epsilon,**sigma; // epsilon and sigma values for atom-type pairs
int **form;
double **lj1,**lj2,**lj3,**lj4;
double **offset;
int *setwell;
class AtomVecEllipsoid *avec;
void allocate();
double gayberne_analytic(const int i, const int j, double a1[3][3],
double a2[3][3], double b1[3][3], double b2[3][3],
double g1[3][3], double g2[3][3], double *r12,
const double rsq, double *fforce, double *ttor,
double *rtor);
double gayberne_lj(const int i, const int j, double a1[3][3],
double b1[3][3],double g1[3][3],double *r12,
const double rsq, double *fforce, double *ttor);
void compute_eta_torque(double m[3][3], double m2[3][3],
double *s, double ans[3][3]);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Pair gayberne requires atom style ellipsoid
+
+UNDOCUMENTED
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair gayberne requires atoms with same type have same shape
+
+UNDOCUMENTED
+
+E: Pair gayberne epsilon a,b,c coeffs are not all set
+
+Each atom type involved in pair_style gayberne must
+have these 3 coefficients set at least once.
+
+E: Bad matrix inversion in mldivide3
+
+UNDOCUMENTED
+
+*/
diff --git a/src/ASPHERE/pair_line_lj.h b/src/ASPHERE/pair_line_lj.h
index 4b60c80ea..a23c741eb 100644
--- a/src/ASPHERE/pair_line_lj.h
+++ b/src/ASPHERE/pair_line_lj.h
@@ -1,61 +1,79 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(line/lj,PairLineLJ)
#else
#ifndef LMP_PAIR_LINE_LJ_H
#define LMP_PAIR_LINE_LJ_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLineLJ : public Pair {
public:
PairLineLJ(class LAMMPS *);
virtual ~PairLineLJ();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
double init_one(int, int);
protected:
double cut_global;
double **cut;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4;
class AtomVecLine *avec;
struct Discrete {
double dx,dy;
double sigma;
};
Discrete *discrete; // list of all discretes for all lines
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
void allocate();
void discretize(int, double);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Pair line/lj requires atom style line
+
+UNDOCUMENTED
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/ASPHERE/pair_resquared.h b/src/ASPHERE/pair_resquared.h
index dbc45ac0c..7e69ce6eb 100644
--- a/src/ASPHERE/pair_resquared.h
+++ b/src/ASPHERE/pair_resquared.h
@@ -1,97 +1,131 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(resquared,PairRESquared)
#else
#ifndef LMP_PAIR_RESQUARED_H
#define LMP_PAIR_RESQUARED_H
#include "pair.h"
namespace LAMMPS_NS {
class PairRESquared : public Pair {
public:
PairRESquared(LAMMPS *lmp);
virtual ~PairRESquared();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
virtual void init_style();
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
protected:
enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
double cut_global;
double **cut;
double **shape1; // per-type radii in x, y and z
double **shape2; // per-type radii in x, y and z SQUARED
double *lshape; // product of the radii
double **well; // well depth scaling along each axis
double **epsilon,**sigma; // epsilon and sigma values for atom-type pairs
int **form;
double **lj1,**lj2,**lj3,**lj4;
double **offset;
int *setwell;
class AtomVecEllipsoid *avec;
// per-particle temporaries for RE-squared calculation
struct RE2Vars {
// per particle precomputations for energy, force, torque
double A[3][3]; // Rotation matrix (lab->body)
double aTe[3][3]; // A'*E
double gamma[3][3]; // A'*S^2*A
// per particle precomputations for torque
double sa[3][3]; // S^2*A;
double lA[3][3][3]; // -A*rotation generator (x,y, or z)
double lAtwo[3][3][3]; // A'*S^2*lA
double lAsa[3][3][3]; // lAtwo+lA'*sa
};
void allocate();
void precompute_i(const int i,RE2Vars &ws);
double det_prime(const double m[3][3], const double m2[3][3]);
double resquared_analytic(const int i, const int j,
const RE2Vars &wi, const RE2Vars &wj,
const double *r, const double rsq,
double *fforce, double *ttor,
double *rtor);
double resquared_lj(const int i, const int j, const RE2Vars &wi,
const double *r, const double rsq, double *fforce,
double *ttor, bool calc_torque);
double cr60; // 60^1/3
double b_alpha; // 45/56
double solv_f_a; // 3.0/(4.0*PI*-36)
double solv_f_r; // 3.0/(4.0*PI*2025)
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Pair resquared requires atom style ellipsoid
+
+UNDOCUMENTED
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair gayberne requires atoms with same type have same shape
+
+UNDOCUMENTED
+
+E: Pair resquared epsilon a,b,c coeffs are not all set
+
+Self-explanatory.
+
+E: Pair resquared epsilon and sigma coeffs are not all set
+
+Self-explanatory.
+
+E: Bad matrix inversion in mldivide3
+
+UNDOCUMENTED
+
+*/
diff --git a/src/ASPHERE/pair_tri_lj.h b/src/ASPHERE/pair_tri_lj.h
index fb0028cce..97c7ad4a2 100644
--- a/src/ASPHERE/pair_tri_lj.h
+++ b/src/ASPHERE/pair_tri_lj.h
@@ -1,61 +1,79 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(tri/lj,PairTriLJ)
#else
#ifndef LMP_PAIR_TRI_LJ_H
#define LMP_PAIR_TRI_LJ_H
#include "pair.h"
namespace LAMMPS_NS {
class PairTriLJ : public Pair {
public:
PairTriLJ(class LAMMPS *);
virtual ~PairTriLJ();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
double init_one(int, int);
protected:
double cut_global;
double **cut;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4;
class AtomVecTri *avec;
struct Discrete {
double dx,dy,dz;
double sigma;
};
Discrete *discrete; // list of all discretes for all lines
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
void allocate();
void discretize(int, double, double *, double *, double *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Pair tri/lj requires atom style tri
+
+UNDOCUMENTED
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/CLASS2/angle_class2.h b/src/CLASS2/angle_class2.h
index f24ecce52..7db51c2e0 100644
--- a/src/CLASS2/angle_class2.h
+++ b/src/CLASS2/angle_class2.h
@@ -1,51 +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.
------------------------------------------------------------------------- */
#ifdef ANGLE_CLASS
AngleStyle(class2,AngleClass2)
#else
#ifndef LMP_ANGLE_CLASS2_H
#define LMP_ANGLE_CLASS2_H
#include "stdio.h"
#include "angle.h"
namespace LAMMPS_NS {
class AngleClass2 : public Angle {
public:
AngleClass2(class LAMMPS *);
virtual ~AngleClass2();
virtual void compute(int, int);
void coeff(int, char **);
double equilibrium_angle(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, int, int, int);
protected:
double *theta0,*k2,*k3,*k4;
double *bb_k,*bb_r1,*bb_r2;
double *ba_k1,*ba_k2,*ba_r1,*ba_r2;
int *setflag_a,*setflag_bb,*setflag_ba;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for angle coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/CLASS2/bond_class2.h b/src/CLASS2/bond_class2.h
index 3c201e923..233117bbb 100644
--- a/src/CLASS2/bond_class2.h
+++ b/src/CLASS2/bond_class2.h
@@ -1,48 +1,56 @@
/* ----------------------------------------------------------------------
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 BOND_CLASS
BondStyle(class2,BondClass2)
#else
#ifndef LMP_BOND_CLASS2_H
#define LMP_BOND_CLASS2_H
#include "stdio.h"
#include "bond.h"
namespace LAMMPS_NS {
class BondClass2 : public Bond {
public:
BondClass2(class LAMMPS *);
virtual ~BondClass2();
virtual void compute(int, int);
void coeff(int, char **);
double equilibrium_distance(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, double, int, int);
protected:
double *r0,*k2,*k3,*k4;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for bond coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/CLASS2/dihedral_class2.h b/src/CLASS2/dihedral_class2.h
index b7a519a27..cc1f13674 100644
--- a/src/CLASS2/dihedral_class2.h
+++ b/src/CLASS2/dihedral_class2.h
@@ -1,56 +1,73 @@
/* ----------------------------------------------------------------------
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 DIHEDRAL_CLASS
DihedralStyle(class2,DihedralClass2)
#else
#ifndef LMP_DIHEDRAL_CLASS2_H
#define LMP_DIHEDRAL_CLASS2_H
#include "stdio.h"
#include "dihedral.h"
namespace LAMMPS_NS {
class DihedralClass2 : public Dihedral {
public:
DihedralClass2(class LAMMPS *);
virtual ~DihedralClass2();
virtual void compute(int, int);
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
protected:
double *k1,*k2,*k3;
double *phi1,*phi2,*phi3;
double *mbt_f1,*mbt_f2,*mbt_f3,*mbt_r0;
double *ebt_f1_1,*ebt_f2_1,*ebt_f3_1,*ebt_r0_1;
double *ebt_f1_2,*ebt_f2_2,*ebt_f3_2,*ebt_r0_2;
double *at_f1_1,*at_f2_1,*at_f3_1,*at_theta0_1;
double *at_f1_2,*at_f2_2,*at_f3_2,*at_theta0_2;
double *aat_k,*aat_theta0_1,*aat_theta0_2;
double *bb13t_k,*bb13t_r10,*bb13t_r30;
int *setflag_d,*setflag_mbt,*setflag_ebt;
int *setflag_at,*setflag_aat,*setflag_bb13t;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: Dihedral problem: %d %ld %d %d %d %d
+
+Conformation of the 4 listed dihedral atoms is extreme; you may want
+to check your simulation geometry. :dd
+
+E: Invalid coeffs for this dihedral style
+
+Cannot set class 2 coeffs in data file for this dihedral style.
+
+E: Incorrect args for dihedral coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/CLASS2/improper_class2.h b/src/CLASS2/improper_class2.h
index cbee3ac81..58508fda1 100644
--- a/src/CLASS2/improper_class2.h
+++ b/src/CLASS2/improper_class2.h
@@ -1,51 +1,64 @@
/* ----------------------------------------------------------------------
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 IMPROPER_CLASS
ImproperStyle(class2,ImproperClass2)
#else
#ifndef LMP_IMPROPER_CLASS2_H
#define LMP_IMPROPER_CLASS2_H
#include "stdio.h"
#include "improper.h"
namespace LAMMPS_NS {
class ImproperClass2 : public Improper {
public:
ImproperClass2(class LAMMPS *);
virtual ~ImproperClass2();
virtual void compute(int, int);
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
protected:
double *k0,*chi0;
double *aa_k1,*aa_k2,*aa_k3,*aa_theta0_1,*aa_theta0_2,*aa_theta0_3;
int *setflag_i,*setflag_aa;
void allocate();
void angleangle(int, int);
void cross(double *, double *, double *);
double dot(double *, double *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: Improper problem: %d %ld %d %d %d %d
+
+Conformation of the 4 listed improper atoms is extreme; you may want
+to check your simulation geometry. :dd
+
+E: Incorrect args for improper coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/CLASS2/pair_lj_class2.h b/src/CLASS2/pair_lj_class2.h
index 6a24e51e9..766f5787b 100644
--- a/src/CLASS2/pair_lj_class2.h
+++ b/src/CLASS2/pair_lj_class2.h
@@ -1,53 +1,67 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/class2,PairLJClass2)
#else
#ifndef LMP_PAIR_LJ_CLASS2_H
#define LMP_PAIR_LJ_CLASS2_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJClass2 : public Pair {
public:
PairLJClass2(class LAMMPS *);
virtual ~PairLJClass2();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
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 &);
protected:
double cut_global;
double **cut;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/CLASS2/pair_lj_class2_coul_cut.h b/src/CLASS2/pair_lj_class2_coul_cut.h
index 1efa60a39..823bfe6c1 100644
--- a/src/CLASS2/pair_lj_class2_coul_cut.h
+++ b/src/CLASS2/pair_lj_class2_coul_cut.h
@@ -1,55 +1,73 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/class2/coul/cut,PairLJClass2CoulCut)
#else
#ifndef LMP_PAIR_LJ_CLASS2_COUL_CUT_H
#define LMP_PAIR_LJ_CLASS2_COUL_CUT_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJClass2CoulCut : public Pair {
public:
PairLJClass2CoulCut(class LAMMPS *);
virtual ~PairLJClass2CoulCut();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
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 &);
protected:
double cut_lj_global,cut_coul_global;
double **cut_lj,**cut_ljsq;
double **cut_coul,**cut_coulsq;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style lj/class2/coul/cut requires atom attribute q
+
+The atom style defined does not have this attribute.
+
+*/
diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp
index 34ff47d80..3dbf8e2ec 100644
--- a/src/CLASS2/pair_lj_class2_coul_long.cpp
+++ b/src/CLASS2/pair_lj_class2_coul_long.cpp
@@ -1,468 +1,468 @@
/* ----------------------------------------------------------------------
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 "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_lj_class2_coul_long.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "kspace.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
/* ---------------------------------------------------------------------- */
PairLJClass2CoulLong::PairLJClass2CoulLong(LAMMPS *lmp) : Pair(lmp) {}
/* ---------------------------------------------------------------------- */
PairLJClass2CoulLong::~PairLJClass2CoulLong()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
}
/* ---------------------------------------------------------------------- */
void PairLJClass2CoulLong::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
double rsq,r,rinv,r2inv,r3inv,r6inv,forcecoul,forcelj;
double grij,expm2,prefactor,t,erfc;
double factor_coul,factor_lj;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = ecoul = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
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];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = qqrd2e * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else forcecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
rinv = sqrt(r2inv);
r3inv = r2inv*rinv;
r6inv = r3inv*r3inv;
forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
} else forcelj = 0.0;
fpair = (forcecoul + factor_lj*forcelj) * r2inv;
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) {
if (rsq < cut_coulsq) {
ecoul = prefactor*erfc;
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
} else ecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
offset[itype][jtype];
evdwl *= factor_lj;
} else evdwl = 0.0;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,ecoul,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairLJClass2CoulLong::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut_lj,n+1,n+1,"pair:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"pair:cut_ljsq");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairLJClass2CoulLong::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul = cut_lj_global;
else cut_coul = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairLJClass2CoulLong::coeff(int narg, char **arg)
{
if (narg < 4 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_lj_one = cut_lj_global;
if (narg == 5) cut_lj_one = force->numeric(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
epsilon[i][j] = epsilon_one;
sigma[i][j] = sigma_one;
cut_lj[i][j] = cut_lj_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairLJClass2CoulLong::init_style()
{
if (!atom->q_flag)
error->all(FLERR,"Pair style lj/class2/coul/long requires atom attribute q");
neighbor->request(this);
cut_coulsq = cut_coul * cut_coul;
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairLJClass2CoulLong::init_one(int i, int j)
{
// always mix epsilon,sigma via sixthpower rules
// mix distance via user-defined rule
if (setflag[i][j] == 0) {
epsilon[i][j] = 2.0 * sqrt(epsilon[i][i]*epsilon[j][j]) *
pow(sigma[i][i],3.0) * pow(sigma[j][j],3.0) /
(pow(sigma[i][i],6.0) + pow(sigma[j][j],6.0));
sigma[i][j] =
pow((0.5 * (pow(sigma[i][i],6.0) + pow(sigma[j][j],6.0))),1.0/6.0);
cut_lj[i][j] = mix_distance(cut_lj[i][i],cut_lj[j][j]);
}
double cut = MAX(cut_lj[i][j],cut_coul);
cut_ljsq[i][j] = cut_lj[i][j] * cut_lj[i][j];
lj1[i][j] = 18.0 * epsilon[i][j] * pow(sigma[i][j],9.0);
lj2[i][j] = 18.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
lj3[i][j] = 2.0 * epsilon[i][j] * pow(sigma[i][j],9.0);
lj4[i][j] = 3.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
if (offset_flag) {
double ratio = sigma[i][j] / cut_lj[i][j];
offset[i][j] = epsilon[i][j] * (2.0*pow(ratio,9.0) - 3.0*pow(ratio,6.0));
} else offset[i][j] = 0.0;
cut_ljsq[j][i] = cut_ljsq[i][j];
lj1[j][i] = lj1[i][j];
lj2[j][i] = lj2[i][j];
lj3[j][i] = lj3[i][j];
lj4[j][i] = lj4[i][j];
offset[j][i] = offset[i][j];
// compute I,J contribution to long-range tail correction
// count total # of atoms of type I and J via Allreduce
if (tail_flag) {
int *type = atom->type;
int nlocal = atom->nlocal;
double count[2],all[2];
count[0] = count[1] = 0.0;
for (int k = 0; k < nlocal; k++) {
if (type[k] == i) count[0] += 1.0;
if (type[k] == j) count[1] += 1.0;
}
MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
double sig3 = sigma[i][j]*sigma[i][j]*sigma[i][j];
double sig6 = sig3*sig3;
double rc3 = cut_lj[i][j]*cut_lj[i][j]*cut_lj[i][j];
double rc6 = rc3*rc3;
etail_ij = 2.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
sig6 * (sig3 - 3.0*rc3) / (3.0*rc6);
ptail_ij = 2.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
sig6 * (sig3 - 2.0*rc3) / rc6;
}
return cut;
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairLJClass2CoulLong::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&epsilon[i][j],sizeof(double),1,fp);
fwrite(&sigma[i][j],sizeof(double),1,fp);
fwrite(&cut_lj[i][j],sizeof(double),1,fp);
}
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairLJClass2CoulLong::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
fread(&epsilon[i][j],sizeof(double),1,fp);
fread(&sigma[i][j],sizeof(double),1,fp);
fread(&cut_lj[i][j],sizeof(double),1,fp);
}
MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairLJClass2CoulLong::write_restart_settings(FILE *fp)
{
fwrite(&cut_lj_global,sizeof(double),1,fp);
fwrite(&cut_coul,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairLJClass2CoulLong::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&cut_lj_global,sizeof(double),1,fp);
fread(&cut_coul,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
double PairLJClass2CoulLong::single(int i, int j, int itype, int jtype,
double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double r2inv,r,rinv,r3inv,r6inv,grij,expm2,t,erfc,prefactor;
double forcecoul,forcelj,phicoul,philj;
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = force->qqrd2e * atom->q[i]*atom->q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else forcecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
rinv = sqrt(r2inv);
r3inv = r2inv*rinv;
r6inv = r3inv*r3inv;
forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
} else forcelj = 0.0;
fforce = (forcecoul + factor_lj*forcelj) * r2inv;
double eng = 0.0;
if (rsq < cut_coulsq) {
phicoul = prefactor*erfc;
if (factor_coul < 1.0) phicoul -= (1.0-factor_coul)*prefactor;
eng += phicoul;
}
if (rsq < cut_ljsq[itype][jtype]) {
philj = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
offset[itype][jtype];
eng += factor_lj*philj;
}
return eng;
}
/* ---------------------------------------------------------------------- */
-void *PairLJClass2CoulLong::extract(char *str, int &dim)
+void *PairLJClass2CoulLong::extract(const char *str, int &dim)
{
dim = 0;
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
return NULL;
}
diff --git a/src/CLASS2/pair_lj_class2_coul_long.h b/src/CLASS2/pair_lj_class2_coul_long.h
index ab903987b..0e5ebd6a1 100644
--- a/src/CLASS2/pair_lj_class2_coul_long.h
+++ b/src/CLASS2/pair_lj_class2_coul_long.h
@@ -1,57 +1,80 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/class2/coul/long,PairLJClass2CoulLong)
#else
#ifndef LMP_PAIR_LJ_CLASS2_COUL_LONG_H
#define LMP_PAIR_LJ_CLASS2_COUL_LONG_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJClass2CoulLong : public Pair {
public:
PairLJClass2CoulLong(class LAMMPS *);
virtual ~PairLJClass2CoulLong();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
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 &);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
double cut_lj_global;
double **cut_lj,**cut_ljsq;
double cut_coul,cut_coulsq;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
double g_ewald;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style lj/class2/coul/long requires atom attribute q
+
+The atom style defined does not have this attribute.
+
+E: Pair style is incompatible with KSpace style
+
+If a pair style with a long-range Coulombic component is selected,
+then a kspace style must also be used.
+
+*/
diff --git a/src/COLLOID/fix_wall_colloid.h b/src/COLLOID/fix_wall_colloid.h
index 4b1734cf7..9e9ff0445 100644
--- a/src/COLLOID/fix_wall_colloid.h
+++ b/src/COLLOID/fix_wall_colloid.h
@@ -1,41 +1,58 @@
/* ----------------------------------------------------------------------
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(wall/colloid,FixWallColloid)
#else
#ifndef LMP_FIX_WALL_COLLOID_H
#define LMP_FIX_WALL_COLLOID_H
#include "fix_wall.h"
namespace LAMMPS_NS {
class FixWallColloid : public FixWall {
public:
FixWallColloid(class LAMMPS *, int, char **);
void init();
void precompute(int);
void wall_particle(int, int, double);
private:
double coeff1[6],coeff2[6],coeff3[6],coeff4[6],offset[6];
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Fix wall/colloid requires atom style sphere
+
+UNDOCUMENTED
+
+E: Fix wall/colloid requires extended particles
+
+Self-explanatory.
+
+E: Particle on or inside fix wall surface
+
+Particles must be "exterior" to the wall in order for energy/force to
+be calculated.
+
+*/
diff --git a/src/COLLOID/pair_colloid.h b/src/COLLOID/pair_colloid.h
index 266fd9657..78fc7444a 100644
--- a/src/COLLOID/pair_colloid.h
+++ b/src/COLLOID/pair_colloid.h
@@ -1,57 +1,83 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(colloid,PairColloid)
#else
#ifndef LMP_PAIR_COLLOID_H
#define LMP_PAIR_COLLOID_H
#include "pair.h"
namespace LAMMPS_NS {
class PairColloid : public Pair {
public:
PairColloid(class LAMMPS *);
virtual ~PairColloid();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
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 &);
enum {SMALL_SMALL,SMALL_LARGE,LARGE_LARGE};
protected:
double cut_global;
double **cut;
double **a12,**d1,**d2,**diameter,**a1,**a2,**offset;
double **sigma,**sigma3,**sigma6;
double **lj1,**lj2,**lj3,**lj4;
int **form;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Overlapping small/large in pair colloid
+
+This potential is inifinte when there is an overlap.
+
+E: Overlapping large/large in pair colloid
+
+This potential is infinite when there is an overlap.
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Invalid d1 or d2 value for pair colloid coeff
+
+Neither d1 or d2 can be < 0.
+
+*/
diff --git a/src/COLLOID/pair_yukawa_colloid.h b/src/COLLOID/pair_yukawa_colloid.h
index 6db573a6a..57beb3755 100644
--- a/src/COLLOID/pair_yukawa_colloid.h
+++ b/src/COLLOID/pair_yukawa_colloid.h
@@ -1,40 +1,52 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(yukawa/colloid,PairYukawaColloid)
#else
#ifndef LMP_PAIR_YUKAWA_COLLOID_H
#define LMP_PAIR_YUKAWA_COLLOID_H
#include "pair_yukawa.h"
namespace LAMMPS_NS {
class PairYukawaColloid : public PairYukawa {
public:
PairYukawaColloid(class LAMMPS *);
virtual ~PairYukawaColloid() {}
virtual void compute(int, int);
void init_style();
double init_one(int, int);
double single(int, int, int, int, double, double, double, double &);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Pair yukawa/colloid requires atom style sphere
+
+UNDOCUMENTED
+
+E: Pair yukawa/colloid requires atoms with same type have same radius
+
+UNDOCUMENTED
+
+*/
diff --git a/src/DIPOLE/atom_vec_dipole.h b/src/DIPOLE/atom_vec_dipole.h
index c41a9e508..6aa17157b 100644
--- a/src/DIPOLE/atom_vec_dipole.h
+++ b/src/DIPOLE/atom_vec_dipole.h
@@ -1,66 +1,83 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(dipole,AtomVecDipole)
#else
#ifndef LMP_ATOM_VEC_DIPOLE_H
#define LMP_ATOM_VEC_DIPOLE_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecDipole : public AtomVec {
public:
AtomVecDipole(class LAMMPS *, int, char **);
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
int pack_comm_hybrid(int, int *, double *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int unpack_comm_hybrid(int, int, double *);
int pack_reverse(int, int, double *);
void unpack_reverse(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, 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 **);
bigint memory_usage();
private:
int *tag,*type,*mask,*image;
double **x,**v,**f;
double *q,**mu,**omega,**torque;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+*/
diff --git a/src/DIPOLE/pair_dipole_cut.h b/src/DIPOLE/pair_dipole_cut.h
index a828d6307..fbd8df64f 100644
--- a/src/DIPOLE/pair_dipole_cut.h
+++ b/src/DIPOLE/pair_dipole_cut.h
@@ -1,54 +1,70 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(dipole/cut,PairDipoleCut)
#else
#ifndef LMP_PAIR_DIPOLE_CUT_H
#define LMP_PAIR_DIPOLE_CUT_H
#include "pair.h"
namespace LAMMPS_NS {
class PairDipoleCut : public Pair {
public:
PairDipoleCut(class LAMMPS *);
virtual ~PairDipoleCut();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
protected:
double cut_lj_global,cut_coul_global;
double **cut_lj,**cut_ljsq;
double **cut_coul,**cut_coulsq;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args in pair_style command
+
+Self-explanatory.
+
+E: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair dipole/cut requires atom attributes q, mu, torque
+
+UNDOCUMENTED
+
+*/
diff --git a/src/FLD/pair_brownian.h b/src/FLD/pair_brownian.h
index 0ec34215f..cc3f672e8 100644
--- a/src/FLD/pair_brownian.h
+++ b/src/FLD/pair_brownian.h
@@ -1,58 +1,88 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(brownian,PairBrownian)
#else
#ifndef LMP_PAIR_BROWNIAN_H
#define LMP_PAIR_BROWNIAN_H
#include "pair.h"
namespace LAMMPS_NS {
class PairBrownian : public Pair {
public:
PairBrownian(class LAMMPS *);
virtual ~PairBrownian();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
virtual double init_one(int, int);
virtual void init_style();
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
protected:
double cut_inner_global,cut_global;
double t_target,mu;
int flaglog,flagfld;
int seed;
double **cut_inner,**cut;
double R0,RT0;
class RanMars *random;
void set_3_orthogonal_vectors(double*,double*,double*);
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair brownian requires atom style sphere
+
+UNDOCUMENTED
+
+W: Pair brownian needs newton pair on for momentum conservation
+
+UNDOCUMENTED
+
+E: Pair brownian requires extended particles
+
+UNDOCUMENTED
+
+E: Pair brownian requires monodisperse particles
+
+UNDOCUMENTED
+
+*/
diff --git a/src/FLD/pair_brownian_poly.h b/src/FLD/pair_brownian_poly.h
index e92d926df..90a1e7033 100644
--- a/src/FLD/pair_brownian_poly.h
+++ b/src/FLD/pair_brownian_poly.h
@@ -1,39 +1,55 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(brownian/poly,PairBrownianPoly)
#else
#ifndef LMP_PAIR_BROWNIAN_POLY_H
#define LMP_PAIR_BROWNIAN_POLY_H
#include "pair_brownian.h"
namespace LAMMPS_NS {
class PairBrownianPoly : public PairBrownian {
public:
PairBrownianPoly(class LAMMPS *);
~PairBrownianPoly() {}
void compute(int, int);
double init_one(int, int);
void init_style();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Pair brownian/poly requires newton pair off
+
+UNDOCUMENTED
+
+E: Pair brownian/poly requires atom style sphere
+
+UNDOCUMENTED
+
+E: Pair brownian/poly requires extended particles
+
+UNDOCUMENTED
+
+*/
diff --git a/src/FLD/pair_lubricate.h b/src/FLD/pair_lubricate.h
index 10cd0c7ec..b79d2333d 100644
--- a/src/FLD/pair_lubricate.h
+++ b/src/FLD/pair_lubricate.h
@@ -1,59 +1,89 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lubricate,PairLubricate)
#else
#ifndef LMP_PAIR_LUBRICATE_H
#define LMP_PAIR_LUBRICATE_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLubricate : public Pair {
public:
PairLubricate(class LAMMPS *);
virtual ~PairLubricate();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
double init_one(int, int);
virtual void init_style();
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
int pre_adapt(char *, int, int, int, int);
void adapt(int, int, int, int, int, double);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
protected:
double mu,cut_inner_global,cut_global;
int flaglog,flagfld,shearing;
double Ef[3][3];
double R0,RT0,RS0;
double **cut_inner,**cut;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair lubricate requires atom style sphere
+
+UNDOCUMENTED
+
+E: Pair lubricate requires ghost atoms store velocity
+
+Use the communicate vel yes command to enable this.
+
+E: Pair lubricate requires monodisperse particles
+
+UNDOCUMENTED
+
+E: Using pair lubricate with inconsistent fix deform remap option
+
+UNDOCUMENTED
+
+*/
diff --git a/src/FLD/pair_lubricateU.h b/src/FLD/pair_lubricateU.h
index 49bd43b9d..8cedc76db 100644
--- a/src/FLD/pair_lubricateU.h
+++ b/src/FLD/pair_lubricateU.h
@@ -1,74 +1,100 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lubricateU,PairLubricateU)
#else
#ifndef LMP_PAIR_LUBRICATEU_H
#define LMP_PAIR_LUBRICATEU_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLubricateU : public Pair {
public:
PairLubricateU(class LAMMPS *);
virtual ~PairLubricateU();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
double init_one(int, int);
virtual void init_style();
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
protected:
double cut_inner_global,cut_global;
double mu;
int flaglog;
double gdot,Ef[3][3];
double **cut_inner,**cut;
void allocate();
double R0,RT0,RS0;
int nmax;
double **fl,**Tl,**xl;
int cgmax;
double *bcg,*xcg,*rcg,*rcg1,*pcg,*RU;
void compute_RE();
virtual void compute_RE(double **);
void compute_RU();
virtual void compute_RU(double **);
virtual void compute_Fh(double **);
void stage_one();
void intermediates(int, double **);
void stage_two(double **);
void copy_vec_uo(int, double *, double **, double **);
void copy_uo_vec(int, double **, double **, double *);
double dot_vec_vec(int , double *, double *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair lubricateU requires atom style sphere
+
+UNDOCUMENTED
+
+E: Pair lubricateU requires ghost atoms store velocity
+
+UNDOCUMENTED
+
+E: Pair lubricateU requires monodisperse particles
+
+UNDOCUMENTED
+
+*/
diff --git a/src/FLD/pair_lubricateU_poly.h b/src/FLD/pair_lubricateU_poly.h
index 4596a13da..8eb8cc228 100644
--- a/src/FLD/pair_lubricateU_poly.h
+++ b/src/FLD/pair_lubricateU_poly.h
@@ -1,45 +1,71 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lubricateU/poly,PairLubricateUPoly)
#else
#ifndef LMP_PAIR_LUBRICATEU_POLY_H
#define LMP_PAIR_LUBRICATEU_POLY_H
#include "pair_lubricateU.h"
namespace LAMMPS_NS {
class PairLubricateUPoly : public PairLubricateU {
public:
PairLubricateUPoly(class LAMMPS *);
~PairLubricateUPoly() {}
void compute(int, int);
void settings(int, char **);
void init_style();
private:
void iterate(double **, int);
void compute_RE(double **);
void compute_RU(double **);
void compute_Fh(double **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Pair lubricateU/poly requires newton pair off
+
+UNDOCUMENTED
+
+E: Pair lubricateU/poly requires ghost atoms store velocity
+
+UNDOCUMENTED
+
+E: Pair lubricate/poly requires atom style sphere
+
+UNDOCUMENTED
+
+E: Pair lubricate/poly requires extended particles
+
+UNDOCUMENTED
+
+*/
diff --git a/src/FLD/pair_lubricate_poly.h b/src/FLD/pair_lubricate_poly.h
index e13edd331..f4be3abee 100644
--- a/src/FLD/pair_lubricate_poly.h
+++ b/src/FLD/pair_lubricate_poly.h
@@ -1,38 +1,62 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lubricate/poly,PairLubricatePoly)
#else
#ifndef LMP_PAIR_LUBRICATE_POLY_H
#define LMP_PAIR_LUBRICATE_POLY_H
#include "pair_lubricate.h"
namespace LAMMPS_NS {
class PairLubricatePoly : public PairLubricate {
public:
PairLubricatePoly(class LAMMPS *);
~PairLubricatePoly() {}
void compute(int, int);
void init_style();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Pair lubricate/poly requires newton pair off
+
+UNDOCUMENTED
+
+E: Pair lubricate/poly requires ghost atoms store velocity
+
+UNDOCUMENTED
+
+E: Pair lubricate/poly requires atom style sphere
+
+UNDOCUMENTED
+
+E: Pair lubricate/poly requires extended particles
+
+UNDOCUMENTED
+
+E: Using pair lubricate/poly with inconsistent fix deform remap option
+
+UNDOCUMENTED
+
+*/
diff --git a/src/GPU/Install.sh b/src/GPU/Install.sh
index 854726495..e84cc2b6f 100644
--- a/src/GPU/Install.sh
+++ b/src/GPU/Install.sh
@@ -1,133 +1,129 @@
# Install/unInstall package files in LAMMPS
# edit 2 Makefile.package files to include/exclude GPU info
# do not install child files if parent does not exist
if (test $1 = 1) then
if (test -e ../Makefile.package) then
sed -i -e 's/[^ \t]*gpu[^ \t]* //' ../Makefile.package
sed -i -e 's|^PKG_PATH =[ \t]*|&-L../../lib/gpu |' ../Makefile.package
sed -i -e 's|^PKG_LIB =[ \t]*|&-lgpu |' ../Makefile.package
sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(gpu_SYSINC) |' ../Makefile.package
sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(gpu_SYSLIB) |' ../Makefile.package
sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(gpu_SYSPATH) |' ../Makefile.package
fi
if (test -e ../Makefile.package.settings) then
sed -i -e '/^include.*gpu.*$/d' ../Makefile.package.settings
sed -i '4 i include ..\/..\/lib\/gpu\/Makefile.lammps' ../Makefile.package.settings
fi
if (test -e ../pair_gayberne.cpp) then
cp pair_gayberne_gpu.cpp ..
cp pair_gayberne_gpu.h ..
cp pair_resquared_gpu.cpp ..
cp pair_resquared_gpu.h ..
fi
if (test -e ../pair_lj_cut_coul_long.cpp) then
cp pair_lj_cut_coul_long_gpu.cpp ..
cp pair_lj_cut_coul_long_gpu.h ..
fi
if (test -e ../pair_lj_class2.cpp) then
cp pair_lj_class2_gpu.cpp ..
cp pair_lj_class2_gpu.h ..
fi
if (test -e ../pair_lj_class2_coul_long.cpp) then
cp pair_lj_class2_coul_long_gpu.cpp ..
cp pair_lj_class2_coul_long_gpu.h ..
fi
if (test -e ../pair_lj_charmm_coul_long.cpp) then
cp pair_lj_charmm_coul_long_gpu.cpp ..
cp pair_lj_charmm_coul_long_gpu.h ..
fi
if (test -e ../pair_coul_long.cpp) then
cp pair_coul_long_gpu.cpp ..
cp pair_coul_long_gpu.h ..
fi
if (test -e ../pair_lj_sdk.cpp) then
cp pair_lj_sdk_gpu.cpp ..
cp pair_lj_sdk_gpu.h ..
fi
if (test -e ../pair_lj_sdk_coul_long.cpp) then
cp pair_lj_sdk_coul_long_gpu.cpp ..
cp pair_lj_sdk_coul_long_gpu.h ..
fi
if (test -e ../pppm.cpp) then
cp pppm_gpu.cpp ..
cp pppm_gpu.h ..
fi
cp pair_lj_cut_gpu.cpp ..
cp pair_morse_gpu.cpp ..
cp pair_lj96_cut_gpu.cpp ..
cp pair_lj_expand_gpu.cpp ..
cp pair_lj_cut_coul_cut_gpu.cpp ..
cp fix_gpu.cpp ..
cp pair_lj_cut_gpu.h ..
cp pair_morse_gpu.h ..
cp pair_lj96_cut_gpu.h ..
cp pair_lj_expand_gpu.h ..
cp pair_lj_cut_coul_cut_gpu.h ..
cp fix_gpu.h ..
cp gpu_extra.h ..
elif (test $1 = 0) then
if (test -e ../Makefile.package) then
sed -i -e 's/[^ \t]*gpu[^ \t]* //' ../Makefile.package
fi
if (test -e ../Makefile.package.settings) then
sed -i -e '/^include.*gpu.*$/d' ../Makefile.package.settings
fi
rm -f ../pppm_gpu.cpp
rm -f ../pair_gayberne_gpu.cpp
rm -f ../pair_resquared_gpu.cpp
rm -f ../pair_lj_cut_gpu.cpp
rm -f ../pair_morse_gpu.cpp
rm -f ../pair_lj96_cut_gpu.cpp
rm -f ../pair_lj_expand_gpu.cpp
rm -f ../pair_lj_cut_coul_cut_gpu.cpp
rm -f ../pair_lj_cut_coul_long_gpu.cpp
rm -f ../pair_lj_class2_gpu.cpp
rm -f ../pair_lj_class2_coul_long_gpu.cpp
rm -f ../pair_lj_charmm_coul_long_gpu.cpp
rm -f ../pair_coul_long_gpu.cpp
- rm -f ../pair_lj_sdk_gpu.cpp
- rm -f ../pair_lj_sdk_coul_long_gpu.cpp
rm -f ../fix_gpu.cpp
rm -f ../pppm_gpu.h
rm -f ../pair_gayberne_gpu.h
rm -f ../pair_resquared_gpu.h
rm -f ../pair_lj_cut_gpu.h
rm -f ../pair_morse_gpu.h
rm -f ../pair_lj96_cut_gpu.h
rm -f ../pair_lj_expand_gpu.h
rm -f ../pair_lj_cut_coul_cut_gpu.h
rm -f ../pair_lj_cut_coul_long_gpu.h
rm -f ../pair_lj_class2_gpu.h
rm -f ../pair_lj_class2_coul_long_gpu.h
rm -f ../pair_lj_charmm_coul_long_gpu.h
rm -f ../pair_coul_long_gpu.h
- rm -f ../pair_lj_sdk_gpu.h
- rm -f ../pair_lj_sdk_coul_long_gpu.h
rm -f ../fix_gpu.h
rm -f ../gpu_extra.h
fi
diff --git a/src/GPU/fix_gpu.h b/src/GPU/fix_gpu.h
index fb38f7c7c..b21310cb5 100644
--- a/src/GPU/fix_gpu.h
+++ b/src/GPU/fix_gpu.h
@@ -1,47 +1,87 @@
/* ----------------------------------------------------------------------
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(GPU,FixGPU)
#else
#ifndef LMP_FIX_GPU_H
#define LMP_FIX_GPU_H
#include "fix.h"
namespace LAMMPS_NS {
class FixGPU : public Fix {
public:
FixGPU(class LAMMPS *, int, char **);
~FixGPU();
int setmask();
void init();
void setup(int);
void min_setup(int);
void post_force(int);
void min_post_force(int);
double memory_usage();
private:
int _gpu_mode;
double _particle_split;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Cannot use fix GPU with USER-CUDA mode enabled
+
+UNDOCUMENTED
+
+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: Cannot use force/neigh with triclinic box
+
+This is a current limitation of the GPU implementation
+in LAMMPS.
+
+E: Cannot use force/hybrid_neigh with triclinic box
+
+UNDOCUMENTED
+
+E: No OpenMP support compiled in
+
+UNDOCUMENTED
+
+E: Cannot use pair hybrid with GPU neighbor builds
+
+See documentation for fix gpu.
+
+E: Fix GPU split must be positive for hybrid pair styles
+
+UNDOCUMENTED
+
+E: Cannot use neigh_modify exclude with GPU neighbor builds
+
+This is a current limitation of the GPU implementation
+in LAMMPS.
+
+*/
diff --git a/src/GPU/pair_coul_long_gpu.h b/src/GPU/pair_coul_long_gpu.h
index d381c83a0..b15f732ec 100644
--- a/src/GPU/pair_coul_long_gpu.h
+++ b/src/GPU/pair_coul_long_gpu.h
@@ -1,47 +1,67 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(coul/long/gpu,PairCoulLongGPU)
#else
#ifndef LMP_PAIR_COUL_LONG_GPU_H
#define LMP_PAIR_COUL_LONG_GPU_H
#include "pair_coul_long.h"
namespace LAMMPS_NS {
class PairCoulLongGPU : public PairCoulLong {
public:
PairCoulLongGPU(LAMMPS *lmp);
~PairCoulLongGPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
int *gpulist;
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Pair style coul/long/gpu requires atom attribute q
+
+UNDOCUMENTED
+
+E: Cannot use newton pair with coul/long/gpu pair style
+
+UNDOCUMENTED
+
+E: Pair style is incompatible with KSpace style
+
+If a pair style with a long-range Coulombic component is selected,
+then a kspace style must also be used.
+
+*/
diff --git a/src/GPU/pair_gayberne_gpu.h b/src/GPU/pair_gayberne_gpu.h
index 656ca5eed..5e182f512 100644
--- a/src/GPU/pair_gayberne_gpu.h
+++ b/src/GPU/pair_gayberne_gpu.h
@@ -1,48 +1,72 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(gayberne/gpu,PairGayBerneGPU)
#else
#ifndef LMP_PAIR_GAYBERNE_GPU_H
#define LMP_PAIR_GAYBERNE_GPU_H
#include "pair_gayberne.h"
namespace LAMMPS_NS {
class PairGayBerneGPU : public PairGayBerne {
public:
PairGayBerneGPU(LAMMPS *lmp);
~PairGayBerneGPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
int *gpulist;
int quat_nmax;
double **quat;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Pair gayberne requires atom style ellipsoid
+
+UNDOCUMENTED
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Cannot use newton pair with gayberne/gpu pair style
+
+UNDOCUMENTED
+
+E: Pair gayberne/gpu requires atom style ellipsoid
+
+UNDOCUMENTED
+
+E: Pair gayberne/gpu requires atoms with same type have same shape
+
+UNDOCUMENTED
+
+*/
diff --git a/src/GPU/pair_lj96_cut_gpu.h b/src/GPU/pair_lj96_cut_gpu.h
index e7916fbe4..992b2b8e2 100644
--- a/src/GPU/pair_lj96_cut_gpu.h
+++ b/src/GPU/pair_lj96_cut_gpu.h
@@ -1,47 +1,58 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj96/cut/gpu,PairLJ96CutGPU)
#else
#ifndef LMP_PAIR_LJ_96_GPU_H
#define LMP_PAIR_LJ_96_GPU_H
#include "pair_lj96_cut.h"
namespace LAMMPS_NS {
class PairLJ96CutGPU : public PairLJ96Cut {
public:
PairLJ96CutGPU(LAMMPS *lmp);
~PairLJ96CutGPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
int *gpulist;
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Cannot use newton pair with lj96/cut/gpu pair style
+
+UNDOCUMENTED
+
+*/
diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.h b/src/GPU/pair_lj_charmm_coul_long_gpu.h
index f51f9d4fc..96c2e2f1a 100644
--- a/src/GPU/pair_lj_charmm_coul_long_gpu.h
+++ b/src/GPU/pair_lj_charmm_coul_long_gpu.h
@@ -1,47 +1,67 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/charmm/coul/long/gpu,PairLJCharmmCoulLongGPU)
#else
#ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_GPU_H
#define LMP_PAIR_LJ_CHARMM_COUL_LONG_GPU_H
#include "pair_lj_charmm_coul_long.h"
namespace LAMMPS_NS {
class PairLJCharmmCoulLongGPU : public PairLJCharmmCoulLong {
public:
PairLJCharmmCoulLongGPU(LAMMPS *lmp);
~PairLJCharmmCoulLongGPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
int *gpulist;
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Pair style lj/charmm/coul/long/gpu requires atom attribute q
+
+UNDOCUMENTED
+
+E: Cannot use newton pair with lj/charmm/coul/long/gpu pair style
+
+UNDOCUMENTED
+
+E: Pair style is incompatible with KSpace style
+
+If a pair style with a long-range Coulombic component is selected,
+then a kspace style must also be used.
+
+*/
diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.h b/src/GPU/pair_lj_class2_coul_long_gpu.h
index ea0ab27c5..7c5136d35 100644
--- a/src/GPU/pair_lj_class2_coul_long_gpu.h
+++ b/src/GPU/pair_lj_class2_coul_long_gpu.h
@@ -1,47 +1,67 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/class2/coul/long/gpu,PairLJClass2CoulLongGPU)
#else
#ifndef LMP_PAIR_LJ_CLASS2_COUL_LONG_GPU_H
#define LMP_PAIR_LJ_CLASS2_COUL_LONG_GPU_H
#include "pair_lj_class2_coul_long.h"
namespace LAMMPS_NS {
class PairLJClass2CoulLongGPU : public PairLJClass2CoulLong {
public:
PairLJClass2CoulLongGPU(LAMMPS *lmp);
~PairLJClass2CoulLongGPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
int *gpulist;
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Pair style lj/class2/coul/long/gpu requires atom attribute q
+
+UNDOCUMENTED
+
+E: Cannot use newton pair with lj/class2/coul/long/gpu pair style
+
+UNDOCUMENTED
+
+E: Pair style is incompatible with KSpace style
+
+If a pair style with a long-range Coulombic component is selected,
+then a kspace style must also be used.
+
+*/
diff --git a/src/GPU/pair_lj_class2_gpu.h b/src/GPU/pair_lj_class2_gpu.h
index ea03bd74a..a7e286a14 100644
--- a/src/GPU/pair_lj_class2_gpu.h
+++ b/src/GPU/pair_lj_class2_gpu.h
@@ -1,47 +1,58 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/class2/gpu,PairLJClass2GPU)
#else
#ifndef LMP_PAIR_LJ_CLASS2_GPU_H
#define LMP_PAIR_LJ_CLASS2_GPU_H
#include "pair_lj_class2.h"
namespace LAMMPS_NS {
class PairLJClass2GPU : public PairLJClass2 {
public:
PairLJClass2GPU(LAMMPS *lmp);
~PairLJClass2GPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
int *gpulist;
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Cannot use newton pair with lj/class2/gpu pair style
+
+UNDOCUMENTED
+
+*/
diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.h b/src/GPU/pair_lj_cut_coul_cut_gpu.h
index 12108e8e9..6deb28eaf 100644
--- a/src/GPU/pair_lj_cut_coul_cut_gpu.h
+++ b/src/GPU/pair_lj_cut_coul_cut_gpu.h
@@ -1,47 +1,62 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/cut/coul/cut/gpu,PairLJCutCoulCutGPU)
#else
#ifndef LMP_PAIR_LJ_CUT_COUL_CUT_GPU_H
#define LMP_PAIR_LJ_CUT_COUL_CUT_GPU_H
#include "pair_lj_cut_coul_cut.h"
namespace LAMMPS_NS {
class PairLJCutCoulCutGPU : public PairLJCutCoulCut {
public:
PairLJCutCoulCutGPU(LAMMPS *lmp);
~PairLJCutCoulCutGPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
int *gpulist;
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Pair style lj/cut/coul/cut/gpu requires atom attribute q
+
+UNDOCUMENTED
+
+E: Cannot use newton pair with lj/cut/coul/cut/gpu pair style
+
+UNDOCUMENTED
+
+*/
diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.h b/src/GPU/pair_lj_cut_coul_long_gpu.h
index f30d8a215..91a1784e8 100644
--- a/src/GPU/pair_lj_cut_coul_long_gpu.h
+++ b/src/GPU/pair_lj_cut_coul_long_gpu.h
@@ -1,47 +1,67 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/cut/coul/long/gpu,PairLJCutCoulLongGPU)
#else
#ifndef LMP_PAIR_LJ_CUT_COUL_LONG_GPU_H
#define LMP_PAIR_LJ_CUT_COUL_LONG_GPU_H
#include "pair_lj_cut_coul_long.h"
namespace LAMMPS_NS {
class PairLJCutCoulLongGPU : public PairLJCutCoulLong {
public:
PairLJCutCoulLongGPU(LAMMPS *lmp);
~PairLJCutCoulLongGPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
int *gpulist;
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Pair style lj/cut/coul/long/gpu requires atom attribute q
+
+UNDOCUMENTED
+
+E: Cannot use newton pair with lj/cut/coul/long/gpu pair style
+
+UNDOCUMENTED
+
+E: Pair style is incompatible with KSpace style
+
+If a pair style with a long-range Coulombic component is selected,
+then a kspace style must also be used.
+
+*/
diff --git a/src/GPU/pair_lj_cut_gpu.h b/src/GPU/pair_lj_cut_gpu.h
index 20b1bf3ae..93032a972 100644
--- a/src/GPU/pair_lj_cut_gpu.h
+++ b/src/GPU/pair_lj_cut_gpu.h
@@ -1,47 +1,58 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/cut/gpu,PairLJCutGPU)
#else
#ifndef LMP_PAIR_LJ_LIGHT_GPU_H
#define LMP_PAIR_LJ_LIGHT_GPU_H
#include "pair_lj_cut.h"
namespace LAMMPS_NS {
class PairLJCutGPU : public PairLJCut {
public:
PairLJCutGPU(LAMMPS *lmp);
~PairLJCutGPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
int *gpulist;
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Cannot use newton pair with lj/cut/gpu pair style
+
+UNDOCUMENTED
+
+*/
diff --git a/src/GPU/pair_lj_expand_gpu.h b/src/GPU/pair_lj_expand_gpu.h
index f02d10a4c..57e8135f4 100644
--- a/src/GPU/pair_lj_expand_gpu.h
+++ b/src/GPU/pair_lj_expand_gpu.h
@@ -1,47 +1,58 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/expand/gpu,PairLJExpandGPU)
#else
#ifndef LMP_PAIR_LJE_LIGHT_GPU_H
#define LMP_PAIR_LJE_LIGHT_GPU_H
#include "pair_lj_expand.h"
namespace LAMMPS_NS {
class PairLJExpandGPU : public PairLJExpand {
public:
PairLJExpandGPU(LAMMPS *lmp);
~PairLJExpandGPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
int *gpulist;
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Cannot use newton pair with lj/expand/gpu pair style
+
+UNDOCUMENTED
+
+*/
diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp
deleted file mode 100644
index 4ce92e543..000000000
--- a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp
+++ /dev/null
@@ -1,350 +0,0 @@
-/* ----------------------------------------------------------------------
- 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: Mike Brown (SNL)
-------------------------------------------------------------------------- */
-
-#include "lmptype.h"
-#include "math.h"
-#include "stdio.h"
-#include "stdlib.h"
-#include "pair_lj_sdk_coul_long_gpu.h"
-#include "atom.h"
-#include "atom_vec.h"
-#include "comm.h"
-#include "force.h"
-#include "neighbor.h"
-#include "neigh_list.h"
-#include "integrate.h"
-#include "memory.h"
-#include "error.h"
-#include "neigh_request.h"
-#include "universe.h"
-#include "update.h"
-#include "domain.h"
-#include "string.h"
-#include "kspace.h"
-#include "gpu_extra.h"
-
-#define EWALD_F 1.12837917
-#define EWALD_P 0.3275911
-#define A1 0.254829592
-#define A2 -0.284496736
-#define A3 1.421413741
-#define A4 -1.453152027
-#define A5 1.061405429
-
-// External functions from cuda library for atom decomposition
-
-int cmml_gpu_init(const int ntypes, double **cutsq, int **lj_type,
- double **host_lj1, double **host_lj2, double **host_lj3,
- double **host_lj4, double **offset, double *special_lj,
- const int nlocal, const int nall, const int max_nbors,
- const int maxspecial, const double cell_size, int &gpu_mode,
- FILE *screen, double **host_cut_ljsq, double host_cut_coulsq,
- double *host_special_coul, const double qqrd2e,
- const double g_ewald);
-void cmml_gpu_clear();
-int ** cmml_gpu_compute_n(const int ago, const int inum, const int nall,
- double **host_x, int *host_type, double *sublo,
- double *subhi, int *tag, int **nspecial,
- int **special, const bool eflag, const bool vflag,
- const bool eatom, const bool vatom, int &host_start,
- int **ilist, int **jnum, const double cpu_time,
- bool &success, double *host_q, double *boxlo,
- double *prd);
-void cmml_gpu_compute(const int ago, const int inum, const int nall,
- double **host_x, int *host_type, int *ilist, int *numj,
- int **firstneigh, const bool eflag, const bool vflag,
- const bool eatom, const bool vatom, int &host_start,
- const double cpu_time, bool &success, double *host_q,
- const int nlocal, double *boxlo, double *prd);
-double cmml_gpu_bytes();
-
-#include "lj_sdk_common.h"
-
-using namespace LAMMPS_NS;
-using namespace LJSDKParms;
-
-/* ---------------------------------------------------------------------- */
-
-PairLJSDKCoulLongGPU::PairLJSDKCoulLongGPU(LAMMPS *lmp) :
- PairLJSDKCoulLong(lmp), gpu_mode(GPU_FORCE)
-{
- respa_enable = 0;
- cpu_time = 0.0;
-}
-
-/* ----------------------------------------------------------------------
- free all arrays
-------------------------------------------------------------------------- */
-
-PairLJSDKCoulLongGPU::~PairLJSDKCoulLongGPU()
-{
- cmml_gpu_clear();
-}
-
-/* ---------------------------------------------------------------------- */
-
-void PairLJSDKCoulLongGPU::compute(int eflag, int vflag)
-{
- if (eflag || vflag) ev_setup(eflag,vflag);
- else evflag = vflag_fdotr = 0;
-
- int nall = atom->nlocal + atom->nghost;
- int inum, host_start;
-
- bool success = true;
- int *ilist, *numneigh, **firstneigh;
- if (gpu_mode != GPU_FORCE) {
- inum = atom->nlocal;
- firstneigh = cmml_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
- atom->type, domain->sublo, domain->subhi,
- atom->tag, atom->nspecial, atom->special,
- eflag, vflag, eflag_atom, vflag_atom,
- host_start, &ilist, &numneigh, cpu_time,
- success, atom->q, domain->boxlo,
- domain->prd);
- } else {
- inum = list->inum;
- ilist = list->ilist;
- numneigh = list->numneigh;
- firstneigh = list->firstneigh;
- cmml_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
- ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
- vflag_atom, host_start, cpu_time, success, atom->q,
- atom->nlocal, domain->boxlo, domain->prd);
- }
- if (!success)
- error->one(FLERR,"Out of memory on GPGPU");
-
- if (host_start<inum) {
- cpu_time = MPI_Wtime();
- if (evflag) {
- if (eflag) cpu_compute<1,1>(host_start, inum, ilist, numneigh, firstneigh);
- else cpu_compute<1,0>(host_start, inum, ilist, numneigh, firstneigh);
- } else cpu_compute<0,0>(host_start, inum, ilist, numneigh, firstneigh);
- cpu_time = MPI_Wtime() - cpu_time;
- }
-}
-
-/* ----------------------------------------------------------------------
- init specific to this pair style
-------------------------------------------------------------------------- */
-
-void PairLJSDKCoulLongGPU::init_style()
-{
- if (!atom->q_flag)
- error->all(FLERR,"Pair style lj/sdk/coul/long/gpu requires atom attribute q");
- if (force->newton_pair)
- error->all(FLERR,"Cannot use newton pair with lj/sdk/coul/long/gpu pair style");
-
- // Repeat cutsq calculation because done after call to init_style
- double maxcut = -1.0;
- double cut;
- for (int i = 1; i <= atom->ntypes; i++) {
- for (int j = i; j <= atom->ntypes; j++) {
- if (setflag[i][j] != 0 || (setflag[i][i] != 0 && setflag[j][j] != 0)) {
- cut = init_one(i,j);
- cut *= cut;
- if (cut > maxcut)
- maxcut = cut;
- cutsq[i][j] = cutsq[j][i] = cut;
- } else
- cutsq[i][j] = cutsq[j][i] = 0.0;
- }
- }
- double cell_size = sqrt(maxcut) + neighbor->skin;
-
- cut_coulsq = cut_coul * cut_coul;
-
- // insure use of KSpace long-range solver, set g_ewald
-
- if (force->kspace == NULL)
- error->all(FLERR,"Pair style is incompatible with KSpace style");
- g_ewald = force->kspace->g_ewald;
-
- // setup force tables
-
- if (ncoultablebits) init_tables();
-
- int maxspecial=0;
- if (atom->molecular)
- maxspecial=atom->maxspecial;
- int success = cmml_gpu_init(atom->ntypes+1, cutsq, lj_type, lj1, lj2, lj3,
- lj4, offset, force->special_lj, atom->nlocal,
- atom->nlocal+atom->nghost, 300, maxspecial,
- cell_size, gpu_mode, screen, cut_ljsq,
- cut_coulsq, force->special_coul,
- force->qqrd2e, g_ewald);
- GPU_EXTRA::check_flag(success,error,world);
-
- if (gpu_mode == GPU_FORCE) {
- int irequest = neighbor->request(this);
- neighbor->requests[irequest]->half = 0;
- neighbor->requests[irequest]->full = 1;
- }
-}
-
-/* ---------------------------------------------------------------------- */
-
-double PairLJSDKCoulLongGPU::memory_usage()
-{
- double bytes = Pair::memory_usage();
- return bytes + cmml_gpu_bytes();
-}
-
-/* ---------------------------------------------------------------------- */
-template <int EVFLAG, int EFLAG>
-void PairLJSDKCoulLongGPU::cpu_compute(int start, int inum, int *ilist,
- int *numneigh, int **firstneigh)
-{
- int i,j,ii,jj;
- double qtmp,xtmp,ytmp,ztmp;
- double r,rsq,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
-
- const double * const * const x = atom->x;
- double * const * const f = atom->f;
- const double * const q = atom->q;
- const int * const type = atom->type;
- const int nlocal = atom->nlocal;
- const double * const special_coul = force->special_coul;
- const double * const special_lj = force->special_lj;
- const double qqrd2e = force->qqrd2e;
- double fxtmp,fytmp,fztmp;
-
- // loop over neighbors of my atoms
-
- for (ii = start; ii < inum; ii++) {
- i = ilist[ii];
- qtmp = q[i];
- xtmp = x[i][0];
- ytmp = x[i][1];
- ztmp = x[i][2];
- fxtmp=fytmp=fztmp=0.0;
-
- const int itype = type[i];
- const int * const jlist = firstneigh[i];
- const int jnum = numneigh[i];
-
- for (jj = 0; jj < jnum; jj++) {
- j = jlist[jj];
- factor_lj = special_lj[sbmask(j)];
- factor_coul = special_coul[sbmask(j)];
- j &= NEIGHMASK;
-
- const double delx = xtmp - x[j][0];
- const double dely = ytmp - x[j][1];
- const double delz = ztmp - x[j][2];
- const double rsq = delx*delx + dely*dely + delz*delz;
- const int jtype = type[j];
-
- double evdwl = 0.0;
- double ecoul = 0.0;
- double fpair = 0.0;
-
- if (rsq < cutsq[itype][jtype]) {
- r2inv = 1.0/rsq;
- const int ljt = lj_type[itype][jtype];
-
- if (rsq < cut_coulsq) {
- if (!ncoultablebits || rsq <= tabinnersq) {
- const double r = sqrt(rsq);
- const double grij = g_ewald * r;
- const double expm2 = exp(-grij*grij);
- const double t = 1.0 / (1.0 + EWALD_P*grij);
- const double erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
- const double prefactor = qqrd2e * qtmp*q[j]/r;
- forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
- if (EFLAG) ecoul = prefactor*erfc;
- if (factor_coul < 1.0) {
- forcecoul -= (1.0-factor_coul)*prefactor;
- if (EFLAG) ecoul -= (1.0-factor_coul)*prefactor;
- }
- } else {
- union_int_float_t rsq_lookup;
- rsq_lookup.f = rsq;
- int itable = rsq_lookup.i & ncoulmask;
- itable >>= ncoulshiftbits;
- const double fraction = (rsq_lookup.f - rtable[itable]) *
- drtable[itable];
- const double table = ftable[itable] + fraction*dftable[itable];
- forcecoul = qtmp*q[j] * table;
- if (EFLAG) {
- const double table2 = etable[itable] + fraction*detable[itable];
- ecoul = qtmp*q[j] * table2;
- }
- if (factor_coul < 1.0) {
- const double table2 = ctable[itable] + fraction*dctable[itable];
- const double prefactor = qtmp*q[j] * table2;
- forcecoul -= (1.0-factor_coul)*prefactor;
- if (EFLAG) ecoul -= (1.0-factor_coul)*prefactor;
- }
- }
- } else {
- forcecoul = 0.0;
- ecoul = 0.0;
- }
-
-
- if (rsq < cut_ljsq[itype][jtype]) {
-
- if (ljt == LJ12_4) {
- const double r4inv=r2inv*r2inv;
- forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
- - lj2[itype][jtype]);
-
- if (EFLAG)
- evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
- - lj4[itype][jtype]) - offset[itype][jtype];
-
- } else if (ljt == LJ9_6) {
- const double r3inv = r2inv*sqrt(r2inv);
- const double r6inv = r3inv*r3inv;
- forcelj = r6inv*(lj1[itype][jtype]*r3inv
- - lj2[itype][jtype]);
- if (EFLAG)
- evdwl = r6inv*(lj3[itype][jtype]*r3inv
- - lj4[itype][jtype]) - offset[itype][jtype];
-
- } else if (ljt == LJ12_6) {
- const double r6inv = r2inv*r2inv*r2inv;
- forcelj = r6inv*(lj1[itype][jtype]*r6inv
- - lj2[itype][jtype]);
- if (EFLAG)
- evdwl = r6inv*(lj3[itype][jtype]*r6inv
- - lj4[itype][jtype]) - offset[itype][jtype];
- }
-
- if (EFLAG) evdwl *= factor_lj;
-
- } else {
- forcelj=0.0;
- evdwl = 0.0;
- }
-
- fpair = (forcecoul + factor_lj*forcelj) * r2inv;
-
- fxtmp += delx*fpair;
- fytmp += dely*fpair;
- fztmp += delz*fpair;
-
- if (EVFLAG) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
- }
- }
- f[i][0] += fxtmp;
- f[i][1] += fytmp;
- f[i][2] += fztmp;
- }
-}
diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.h b/src/GPU/pair_lj_sdk_coul_long_gpu.h
deleted file mode 100644
index cb6cb4fe3..000000000
--- a/src/GPU/pair_lj_sdk_coul_long_gpu.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* ----------------------------------------------------------------------
- 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 PAIR_CLASS
-
-PairStyle(lj/sdk/coul/long/gpu,PairLJSDKCoulLongGPU)
-PairStyle(cg/cmm/coul/long/gpu,PairLJSDKCoulLongGPU)
-
-#else
-
-#ifndef LMP_PAIR_LJ_SDK_COUL_LONG_GPU_H
-#define LMP_PAIR_LJ_SDK_COUL_LONG_GPU_H
-
-#include "pair_lj_sdk_coul_long.h"
-
-namespace LAMMPS_NS {
-
-class PairLJSDKCoulLongGPU : public PairLJSDKCoulLong {
- public:
- PairLJSDKCoulLongGPU(LAMMPS *lmp);
- ~PairLJSDKCoulLongGPU();
- template <int, int>
- void cpu_compute(int, int, int *, int *, int **);
- void compute(int, int);
- void init_style();
- double memory_usage();
-
- enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
-
- private:
- int gpu_mode;
- double cpu_time;
- int *gpulist;
-};
-
-}
-#endif
-#endif
-
diff --git a/src/GPU/pair_lj_sdk_gpu.cpp b/src/GPU/pair_lj_sdk_gpu.cpp
deleted file mode 100644
index bb5e7d3e0..000000000
--- a/src/GPU/pair_lj_sdk_gpu.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-/* ----------------------------------------------------------------------
- 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: Mike Brown (SNL)
-------------------------------------------------------------------------- */
-
-#include "lmptype.h"
-#include "math.h"
-#include "stdio.h"
-#include "stdlib.h"
-#include "pair_lj_sdk_gpu.h"
-#include "atom.h"
-#include "atom_vec.h"
-#include "comm.h"
-#include "force.h"
-#include "neighbor.h"
-#include "neigh_list.h"
-#include "integrate.h"
-#include "memory.h"
-#include "error.h"
-#include "neigh_request.h"
-#include "universe.h"
-#include "update.h"
-#include "domain.h"
-#include "string.h"
-#include "gpu_extra.h"
-
-// External functions from cuda library for atom decomposition
-
-int cmm_gpu_init(const int ntypes, double **cutsq, int **cg_types,
- double **host_lj1, double **host_lj2, double **host_lj3,
- double **host_lj4, double **offset, double *special_lj,
- const int nlocal, const int nall, const int max_nbors,
- const int maxspecial, const double cell_size, int &gpu_mode,
- FILE *screen);
-void cmm_gpu_clear();
-int ** cmm_gpu_compute_n(const int ago, const int inum, const int nall,
- double **host_x, int *host_type, double *sublo,
- double *subhi, int *tag, int **nspecial,
- int **special, const bool eflag, const bool vflag,
- const bool eatom, const bool vatom, int &host_start,
- int **ilist, int **jnum,
- const double cpu_time, bool &success);
-void cmm_gpu_compute(const int ago, const int inum, const int nall,
- double **host_x, int *host_type, int *ilist, int *numj,
- int **firstneigh, const bool eflag, const bool vflag,
- const bool eatom, const bool vatom, int &host_start,
- const double cpu_time, bool &success);
-double cmm_gpu_bytes();
-
-#include "lj_sdk_common.h"
-
-using namespace LAMMPS_NS;
-using namespace LJSDKParms;
-
-/* ---------------------------------------------------------------------- */
-
-PairLJSDKGPU::PairLJSDKGPU(LAMMPS *lmp) : PairLJSDK(lmp), gpu_mode(GPU_FORCE)
-{
- respa_enable = 0;
- cpu_time = 0.0;
-}
-
-/* ----------------------------------------------------------------------
- free all arrays
-------------------------------------------------------------------------- */
-
-PairLJSDKGPU::~PairLJSDKGPU()
-{
- cmm_gpu_clear();
-}
-
-/* ---------------------------------------------------------------------- */
-
-void PairLJSDKGPU::compute(int eflag, int vflag)
-{
- if (eflag || vflag) ev_setup(eflag,vflag);
- else evflag = vflag_fdotr = 0;
-
- int nall = atom->nlocal + atom->nghost;
- int inum, host_start;
-
- bool success = true;
- int *ilist, *numneigh, **firstneigh;
- if (gpu_mode != GPU_FORCE) {
- inum = atom->nlocal;
- firstneigh = cmm_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
- atom->type, domain->sublo, domain->subhi,
- atom->tag, atom->nspecial, atom->special,
- eflag, vflag, eflag_atom, vflag_atom,
- host_start, &ilist, &numneigh, cpu_time,
- success);
- } else {
- inum = list->inum;
- ilist = list->ilist;
- numneigh = list->numneigh;
- firstneigh = list->firstneigh;
- cmm_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
- ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
- vflag_atom, host_start, cpu_time, success);
- }
- if (!success)
- error->one(FLERR,"Out of memory on GPGPU");
-
- if (host_start<inum) {
- cpu_time = MPI_Wtime();
- if (evflag) {
- if (eflag) cpu_compute<1,1>(host_start, inum, ilist, numneigh, firstneigh);
- else cpu_compute<1,0>(host_start, inum, ilist, numneigh, firstneigh);
- } else cpu_compute<0,0>(host_start, inum, ilist, numneigh, firstneigh);
- cpu_time = MPI_Wtime() - cpu_time;
- }
-}
-
-/* ----------------------------------------------------------------------
- init specific to this pair style
-------------------------------------------------------------------------- */
-
-void PairLJSDKGPU::init_style()
-{
- if (force->newton_pair)
- error->all(FLERR,"Cannot use newton pair with lj/sdk/gpu pair style");
-
- // Repeat cutsq calculation because done after call to init_style
- double maxcut = -1.0;
- double cut;
- for (int i = 1; i <= atom->ntypes; i++) {
- for (int j = i; j <= atom->ntypes; j++) {
- if (setflag[i][j] != 0 || (setflag[i][i] != 0 && setflag[j][j] != 0)) {
- cut = init_one(i,j);
- cut *= cut;
- if (cut > maxcut)
- maxcut = cut;
- cutsq[i][j] = cutsq[j][i] = cut;
- } else
- cutsq[i][j] = cutsq[j][i] = 0.0;
- }
- }
- double cell_size = sqrt(maxcut) + neighbor->skin;
-
- int maxspecial=0;
- if (atom->molecular)
- maxspecial=atom->maxspecial;
- int success = cmm_gpu_init(atom->ntypes+1,cutsq,lj_type,lj1,lj2,lj3,lj4,
- offset, force->special_lj, atom->nlocal,
- atom->nlocal+atom->nghost, 300, maxspecial,
- cell_size, gpu_mode, screen);
- GPU_EXTRA::check_flag(success,error,world);
-
- if (gpu_mode == GPU_FORCE) {
- int irequest = neighbor->request(this);
- neighbor->requests[irequest]->half = 0;
- neighbor->requests[irequest]->full = 1;
- }
-}
-
-/* ---------------------------------------------------------------------- */
-
-double PairLJSDKGPU::memory_usage()
-{
- double bytes = Pair::memory_usage();
- return bytes + cmm_gpu_bytes();
-}
-
-/* ---------------------------------------------------------------------- */
-template <int EVFLAG, int EFLAG>
-void PairLJSDKGPU::cpu_compute(int start, int inum, int *ilist,
- int *numneigh, int **firstneigh)
-{
- int i,j,ii,jj,jtype;
- double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
- double rsq,r2inv,forcelj,factor_lj;
-
- const double * const * const x = atom->x;
- double * const * const f = atom->f;
- const int * const type = atom->type;
- const int nlocal = atom->nlocal;
- const double * const special_lj = force->special_lj;
- double fxtmp,fytmp,fztmp;
-
- // loop over neighbors of my atoms
-
- for (ii = start; ii < inum; ii++) {
- i = ilist[ii];
- xtmp = x[i][0];
- ytmp = x[i][1];
- ztmp = x[i][2];
- fxtmp=fytmp=fztmp=0.0;
-
- const int itype = type[i];
- const int * const jlist = firstneigh[i];
- const int jnum = numneigh[i];
-
- for (jj = 0; jj < jnum; jj++) {
- j = jlist[jj];
- factor_lj = special_lj[sbmask(j)];
- j &= NEIGHMASK;
-
- 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];
-
- if (rsq < cutsq[itype][jtype]) {
- r2inv = 1.0/rsq;
- const int ljt = lj_type[itype][jtype];
-
- if (ljt == LJ12_4) {
- const double r4inv=r2inv*r2inv;
- forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
- - lj2[itype][jtype]);
-
- if (EFLAG)
- evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
- - lj4[itype][jtype]) - offset[itype][jtype];
-
- } else if (ljt == LJ9_6) {
- const double r3inv = r2inv*sqrt(r2inv);
- const double r6inv = r3inv*r3inv;
- forcelj = r6inv*(lj1[itype][jtype]*r3inv
- - lj2[itype][jtype]);
- if (EFLAG)
- evdwl = r6inv*(lj3[itype][jtype]*r3inv
- - lj4[itype][jtype]) - offset[itype][jtype];
-
- } else if (ljt == LJ12_6) {
- const double r6inv = r2inv*r2inv*r2inv;
- forcelj = r6inv*(lj1[itype][jtype]*r6inv
- - lj2[itype][jtype]);
- if (EFLAG)
- evdwl = r6inv*(lj3[itype][jtype]*r6inv
- - lj4[itype][jtype]) - offset[itype][jtype];
- } else continue;
-
- fpair = factor_lj*forcelj*r2inv;
-
- fxtmp += delx*fpair;
- fytmp += dely*fpair;
- fztmp += delz*fpair;
-
- if (EVFLAG) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
- }
- }
- f[i][0] += fxtmp;
- f[i][1] += fytmp;
- f[i][2] += fztmp;
- }
-}
diff --git a/src/GPU/pair_lj_sdk_gpu.h b/src/GPU/pair_lj_sdk_gpu.h
deleted file mode 100644
index cb5e30bd4..000000000
--- a/src/GPU/pair_lj_sdk_gpu.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ----------------------------------------------------------------------
- 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 PAIR_CLASS
-
-PairStyle(lj/sdk/gpu,PairLJSDKGPU)
-PairStyle(cg/cmm/gpu,PairLJSDKGPU)
-
-#else
-
-#ifndef LMP_PAIR_LJ_SDK_GPU_H
-#define LMP_PAIR_LJ_SDK_GPU_H
-
-#include "pair_lj_sdk.h"
-
-namespace LAMMPS_NS {
-
-class PairLJSDKGPU : public PairLJSDK {
- public:
- PairLJSDKGPU(LAMMPS *lmp);
- ~PairLJSDKGPU();
- template <int, int>
- void cpu_compute(int, int, int *, int *, int **);
- void compute(int, int);
- void init_style();
- double memory_usage();
-
- enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
-
- private:
- int gpu_mode;
- double cpu_time;
- int *gpulist;
-};
-
-}
-#endif
-#endif
diff --git a/src/GPU/pair_morse_gpu.h b/src/GPU/pair_morse_gpu.h
index 702382819..7567d18ce 100644
--- a/src/GPU/pair_morse_gpu.h
+++ b/src/GPU/pair_morse_gpu.h
@@ -1,47 +1,58 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(morse/gpu,PairMorseGPU)
#else
#ifndef LMP_PAIR_MORSE_GPU_H
#define LMP_PAIR_MORSE_GPU_H
#include "pair_morse.h"
namespace LAMMPS_NS {
class PairMorseGPU : public PairMorse {
public:
PairMorseGPU(LAMMPS *lmp);
~PairMorseGPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
int *gpulist;
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Cannot use newton pair with morse/gpu pair style
+
+UNDOCUMENTED
+
+*/
diff --git a/src/GPU/pair_resquared_gpu.h b/src/GPU/pair_resquared_gpu.h
index 54d5513a0..1e188cae6 100644
--- a/src/GPU/pair_resquared_gpu.h
+++ b/src/GPU/pair_resquared_gpu.h
@@ -1,48 +1,72 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(resquared/gpu,PairRESquaredGPU)
#else
#ifndef LMP_PAIR_RESQUARED_GPU_H
#define LMP_PAIR_RESQUARED_GPU_H
#include "pair_resquared.h"
namespace LAMMPS_NS {
class PairRESquaredGPU : public PairRESquared {
public:
PairRESquaredGPU(LAMMPS *lmp);
~PairRESquaredGPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
int *gpulist;
int quat_nmax;
double **quat;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Pair gayberne requires atom style ellipsoid
+
+UNDOCUMENTED
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Cannot use newton pair with resquared/gpu pair style
+
+UNDOCUMENTED
+
+E: Pair resquared/gpu requires atom style ellipsoid
+
+UNDOCUMENTED
+
+E: Pair resquared/gpu requires atoms with same type have same shape
+
+UNDOCUMENTED
+
+*/
diff --git a/src/GPU/pppm_gpu.h b/src/GPU/pppm_gpu.h
index 4b971e9f3..75dac24dc 100644
--- a/src/GPU/pppm_gpu.h
+++ b/src/GPU/pppm_gpu.h
@@ -1,55 +1,89 @@
/* ----------------------------------------------------------------------
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 KSPACE_CLASS
KSpaceStyle(pppm/gpu,PPPMGPU)
#else
#ifndef LMP_PPPM_GPU_H
#define LMP_PPPM_GPU_H
#include "pppm.h"
namespace LAMMPS_NS {
class PPPMGPU : public PPPM {
public:
PPPMGPU(class LAMMPS *, int, char **);
virtual ~PPPMGPU();
virtual void init();
virtual void compute(int, int);
virtual double memory_usage();
protected:
FFT_SCALAR ***density_brick_gpu, ***vd_brick;
virtual void allocate();
virtual void deallocate();
virtual void brick2fft();
virtual void fillbrick();
virtual void poisson(int, int);
double poisson_time;
FFT_SCALAR ***create_3d_offset(int, int, int, int, int, int, const char *,
FFT_SCALAR *, int);
void destroy_3d_offset(FFT_SCALAR ***, int, int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot use order greater than 8 with pppm/gpu.
+
+UNDOCUMENTED
+
+E: Out of memory on GPGPU
+
+UNDOCUMENTED
+
+E: Out of range atoms - cannot compute PPPM
+
+One or more atoms are attempting to map their charge to a PPPM grid
+point that is not owned by a processor. This is likely for one of two
+reasons, both of them bad. First, it may mean that an atom near the
+boundary of a processor's sub-domain has moved more than 1/2 the
+"neighbor skin distance"_neighbor.html without neighbor lists being
+rebuilt and atoms being migrated to new processors. This also means
+you may be missing pairwise interactions that need to be computed.
+The solution is to change the re-neighboring criteria via the
+"neigh_modify"_neigh_modify command. The safest settings are "delay 0
+every 1 check yes". Second, it may mean that an atom has moved far
+outside a processor's sub-domain or even the entire simulation box.
+This indicates bad physics, e.g. due to highly overlapping atoms, too
+large a timestep, etc.
+
+*/
diff --git a/src/GRANULAR/fix_freeze.h b/src/GRANULAR/fix_freeze.h
index 0ed1b72b1..678325321 100644
--- a/src/GRANULAR/fix_freeze.h
+++ b/src/GRANULAR/fix_freeze.h
@@ -1,45 +1,64 @@
/* ----------------------------------------------------------------------
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(freeze,FixFreeze)
#else
#ifndef LMP_FIX_FREEZE_H
#define LMP_FIX_FREEZE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixFreeze : public Fix {
public:
FixFreeze(class LAMMPS *, int, char **);
int setmask();
void init();
void setup(int);
void post_force(int);
void post_force_respa(int, int, int);
double compute_vector(int);
private:
int force_flag;
double foriginal[3],foriginal_all[3];
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix freeze requires atom attribute torque
+
+The atom style defined does not have this attribute.
+
+E: More than one fix freeze
+
+Only one of these fixes can be defined, since the granular pair
+potentials access it.
+
+*/
diff --git a/src/GRANULAR/fix_pour.h b/src/GRANULAR/fix_pour.h
index 188059713..58575c6ae 100644
--- a/src/GRANULAR/fix_pour.h
+++ b/src/GRANULAR/fix_pour.h
@@ -1,71 +1,151 @@
/* ----------------------------------------------------------------------
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(pour,FixPour)
#else
#ifndef LMP_FIX_POUR_H
#define LMP_FIX_POUR_H
#include "fix.h"
namespace LAMMPS_NS {
class FixPour : public Fix {
friend class PairGranHertzHistory;
friend class PairGranHertzHistoryOMP;
friend class PairGranHooke;
friend class PairGranHookeOMP;
friend class PairGranHookeHistory;
friend class PairGranHookeHistoryOMP;
friend class PairGranHookeCuda;
public:
FixPour(class LAMMPS *, int, char **);
~FixPour();
int setmask();
void init();
void pre_exchange();
void reset_dt();
private:
int ninsert,ntype,seed;
double radius_lo,radius_hi;
double density_lo,density_hi;
double volfrac;
int maxattempt;
int region_style;
double rate;
double vxlo,vxhi,vylo,vyhi,vy,vz;
double xlo,xhi,ylo,yhi,zlo,zhi;
double xc,yc,rc;
double grav;
int me,nprocs;
int *recvcounts,*displs;
int nfreq,nfirst,ninserted,nper;
double lo_current,hi_current;
class FixShearHistory *fix_history;
class RanPark *random;
int overlap(int);
void xyz_random(double, double *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix pour requires atom attributes radius, rmass
+
+The atom style defined does not have these attributes.
+
+E: Fix pour region ID does not exist
+
+Self-explanatory.
+
+E: Must specify a region in fix pour
+
+The region keyword must be specified with this fix.
+
+E: Fix pour region does not support a bounding box
+
+Not all regions represent bounded volumes. You cannot use
+such a region with the fix pour command.
+
+E: Fix pour region cannot be dynamic
+
+Only static regions can be used with fix pour.
+
+E: Insertion region extends outside simulation box
+
+Region specified with fix pour command extends outside the global
+simulation box.
+
+E: Must use a z-axis cylinder with fix pour
+
+The axis of the cylinder region used with the fix pour command must
+be oriented along the z dimension.
+
+E: Must use a block or cylinder region with fix pour
+
+Self-explanatory.
+
+E: Must use a block region with fix pour for 2d simulations
+
+Self-explanatory.
+
+E: No fix gravity defined for fix pour
+
+Cannot add poured particles without gravity to move them.
+
+E: Cannot use fix pour with triclinic box
+
+This feature is not yet supported.
+
+E: Gravity must point in -z to use with fix pour in 3d
+
+Gravity must be pointing "down" in a 3d box, i.e. theta = 180.0.
+
+E: Gravity must point in -y to use with fix pour in 2d
+
+Gravity must be pointing "down" in a 2d box.
+
+E: Gravity changed since fix pour was created
+
+Gravity must be static and not dynamic for use with fix pour.
+
+W: Less insertions than requested
+
+Less atom insertions occurred on this timestep due to the fix pour
+command than were scheduled. This is probably because there were too
+many overlaps detected.
+
+E: Cannot change timestep with fix pour
+
+This fix pre-computes some values based on the timestep, so it cannot
+be changed during a simulation run.
+
+*/
diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h
index 343511c86..51732c837 100644
--- a/src/GRANULAR/fix_wall_gran.h
+++ b/src/GRANULAR/fix_wall_gran.h
@@ -1,76 +1,111 @@
/* ----------------------------------------------------------------------
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(wall/gran,FixWallGran)
#else
#ifndef LMP_FIX_WALL_GRAN_H
#define LMP_FIX_WALL_GRAN_H
#include "fix.h"
namespace LAMMPS_NS {
class FixWallGran : public Fix {
public:
FixWallGran(class LAMMPS *, int, char **);
virtual ~FixWallGran();
int setmask();
void init();
void setup(int);
virtual void post_force(int);
virtual void post_force_respa(int, int, int);
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
void set_arrays(int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
void reset_dt();
protected:
int wallstyle,pairstyle,wiggle,wshear,axis;
double kn,kt,gamman,gammat,xmu;
double lo,hi,cylradius;
double amplitude,period,omega,vshear;
double dt;
int nlevels_respa;
int time_origin;
bigint laststep;
int *touch;
double **shear;
int shearupdate;
void hooke(double, double, double, double, double *,
double *, double *, double *, double *, double, double);
void hooke_history(double, double, double, double, double *,
double *, double *, double *, double *, double, double,
double *);
void hertz_history(double, double, double, double, double *,
double *, double *, double *, double *, double, double,
double *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix wall/gran requires atom style sphere
+
+UNDOCUMENTED
+
+E: Cannot use wall in periodic dimension
+
+Self-explanatory.
+
+E: Cannot wiggle and shear fix wall/gran
+
+Cannot specify both options at the same time.
+
+E: Invalid wiggle direction for fix wall/gran
+
+Self-explanatory.
+
+E: Invalid shear direction for fix wall/gran
+
+Self-explanatory.
+
+E: Fix wall/gran is incompatible with Pair style
+
+Must use a granular pair style to define the parameters needed for
+this fix.
+
+*/
diff --git a/src/GRANULAR/pair_gran_hertz_history.h b/src/GRANULAR/pair_gran_hertz_history.h
index 1b86354fb..0cb762c4f 100644
--- a/src/GRANULAR/pair_gran_hertz_history.h
+++ b/src/GRANULAR/pair_gran_hertz_history.h
@@ -1,38 +1,48 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(gran/hertz/history,PairGranHertzHistory)
#else
#ifndef LMP_PAIR_GRAN_HERTZ_HISTORY_H
#define LMP_PAIR_GRAN_HERTZ_HISTORY_H
#include "pair_gran_hooke_history.h"
namespace LAMMPS_NS {
class PairGranHertzHistory : public PairGranHookeHistory {
public:
PairGranHertzHistory(class LAMMPS *);
virtual void compute(int, int);
void settings(int, char **);
double single(int, int, int, int, double, double, double, double &);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/GRANULAR/pair_gran_hooke_history.h b/src/GRANULAR/pair_gran_hooke_history.h
index 2e88fc2d4..fea371365 100644
--- a/src/GRANULAR/pair_gran_hooke_history.h
+++ b/src/GRANULAR/pair_gran_hooke_history.h
@@ -1,67 +1,94 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(gran/hooke/history,PairGranHookeHistory)
#else
#ifndef LMP_PAIR_GRAN_HOOKE_HISTORY_H
#define LMP_PAIR_GRAN_HOOKE_HISTORY_H
#include "pair.h"
namespace LAMMPS_NS {
class PairGranHookeHistory : public Pair {
public:
PairGranHookeHistory(class LAMMPS *);
virtual ~PairGranHookeHistory();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
void init_style();
void init_list(int, class NeighList *);
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 &);
void reset_dt();
protected:
double kn,kt,gamman,gammat,xmu;
int dampflag;
double dt;
int freeze_group_bit;
int history;
bigint laststep;
class FixShearHistory *fix_history;
char *suffix;
double *onerad_dynamic,*onerad_frozen;
double *maxrad_dynamic,*maxrad_frozen;
int neighprev;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair granular requires atom style sphere
+
+UNDOCUMENTED
+
+E: Pair granular requires ghost atoms store velocity
+
+Use the communicate vel yes command to enable this.
+
+E: Pair granular with shear history requires newton pair off
+
+This is a current restriction of the implementation of pair
+granular styles with history.
+
+*/
diff --git a/src/KSPACE/ewald.h b/src/KSPACE/ewald.h
index e88b8989a..243dc7166 100644
--- a/src/KSPACE/ewald.h
+++ b/src/KSPACE/ewald.h
@@ -1,60 +1,108 @@
/* ----------------------------------------------------------------------
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 KSPACE_CLASS
KSpaceStyle(ewald,Ewald)
#else
#ifndef LMP_EWALD_H
#define LMP_EWALD_H
#include "kspace.h"
namespace LAMMPS_NS {
class Ewald : public KSpace {
public:
Ewald(class LAMMPS *, int, char **);
virtual ~Ewald();
void init();
void setup();
virtual void compute(int, int);
double memory_usage();
protected:
double precision;
int kcount,kmax,kmax3d,kmax_created;
double gsqmx,qsum,qsqsum,volume;
int nmax;
double unitk[3];
int *kxvecs,*kyvecs,*kzvecs;
double *ug;
double **eg,**vg;
double **ek;
double *sfacrl,*sfacim,*sfacrl_all,*sfacim_all;
double ***cs,***sn;
virtual void eik_dot_r();
void coeffs();
virtual void allocate();
void deallocate();
void slabcorr(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot use Ewald with triclinic box
+
+This feature is not yet supported.
+
+E: Cannot use Ewald with 2d simulation
+
+The kspace style ewald cannot be used in 2d simulations. You can use
+2d Ewald in a 3d simulation; see the kspace_modify command.
+
+E: Kspace style requires atom attribute q
+
+The atom style defined does not have these attributes.
+
+E: Cannot use nonperiodic boundaries with Ewald
+
+For kspace style ewald, all 3 dimensions must have periodic boundaries
+unless you use the kspace_modify command to define a 2d slab with a
+non-periodic z dimension.
+
+E: Incorrect boundaries with slab Ewald
+
+Must have periodic x,y dimensions and non-periodic z dimension to use
+2d slab option with Ewald.
+
+E: KSpace style is incompatible with Pair style
+
+Setting a kspace style requires that a pair style with a long-range
+Coulombic component be selected.
+
+E: Cannot use kspace solver on system with no charge
+
+No atoms in system have a non-zero charge.
+
+W: System is not charge neutral, net charge = %g
+
+The total charge on all atoms on the system is not 0.0, which
+is not valid for Ewald or PPPM.
+
+*/
diff --git a/src/KSPACE/fft3d.h b/src/KSPACE/fft3d.h
index 824a92ee3..6bef24037 100644
--- a/src/KSPACE/fft3d.h
+++ b/src/KSPACE/fft3d.h
@@ -1,325 +1,327 @@
/* -*- c++ -*- ----------------------------------------------------------
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.
------------------------------------------------------------------------- */
// User-settable FFT precision
// FFT_PRECISION = 1 is single-precision complex (4-byte real, 4-byte imag)
// FFT_PRECISION = 2 is double-precision complex (8-byte real, 8-byte imag)
#ifdef FFT_SINGLE
#define FFT_PRECISION 1
typedef float FFT_SCALAR;
#else
#define FFT_PRECISION 2
typedef double FFT_SCALAR;
#endif
// set default fftw library. switch to FFT_FFTW3 when convenient.
#ifdef FFT_FFTW
#define FFT_FFTW2
#endif
// -------------------------------------------------------------------------
// Data types for single-precision complex
#if FFT_PRECISION == 1
#if defined(FFT_SGI)
#include "fft.h"
typedef complex FFT_DATA;
#define FFT_1D cfft1d
#define FFT_1D_INIT cfft1di
extern "C" {
int cfft1d(int, int, FFT_DATA *, int, FFT_DATA *);
FFT_DATA *cfft1di(int, FFT_DATA *);
}
#elif defined(FFT_SCSL)
#include <scsl_fft.h>
typedef scsl_complex FFT_DATA;
typedef float FFT_PREC;
#define FFT_1D ccfft
#define FFT_1D_INIT ccfft
extern "C" {
int ccfft(int, int, FFT_PREC, FFT_DATA *, FFT_DATA *,
FFT_PREC *, FFT_PREC *, int *);
}
#elif defined(FFT_ACML)
typedef struct {
float re;
float im;
} FFT_DATA;
#define FFT_1D cfft1m_
extern "C" {
void cfft1m_(int *, int *, int *, FFT_DATA *, FFT_DATA *, int *);
}
#elif defined(FFT_INTEL)
typedef struct {
float re;
float im;
} FFT_DATA;
#define FFT_1D cfft1d_
#define FFT_1D_INIT cfft1d_
extern "C" {
void cfft1d_(FFT_DATA *, int *, int *, FFT_DATA *);
}
#elif defined(FFT_MKL)
#include "mkl_dfti.h"
typedef float _Complex FFT_DATA;
#define FFT_MKL_PREC DFTI_SINGLE
#elif defined(FFT_DEC)
typedef struct {
float re;
float im;
} FFT_DATA;
#define FFT_1D cfft_
extern "C" {
void cfft_(char *, char *, char *, FFT_DATA *, FFT_DATA *, int *, int *);
}
#elif defined(FFT_T3E)
#include <complex.h>
typedef complex single FFT_DATA;
#define FFT_1D GGFFT
#define FFT_1D_INIT GGFFT
extern "C" {
void GGFFT(int *, int *, double *, FFT_DATA *, FFT_DATA *,
double *, double *, int *);
}
#elif defined(FFT_FFTW2)
#if defined(FFTW_SIZE)
#include "sfftw.h"
#else
#include "fftw.h"
#endif
typedef FFTW_COMPLEX FFT_DATA;
#elif defined(FFT_FFTW3)
#include "fftw3.h"
typedef fftwf_complex FFT_DATA;
#define FFTW_API(function) fftwf_ ## function
#else
/* use a stripped down version of kiss fft as default fft */
#ifndef FFT_KISSFFT
#define FFT_KISSFFT
#endif
#define kiss_fft_scalar float
typedef struct {
kiss_fft_scalar re;
kiss_fft_scalar im;
} FFT_DATA;
struct kiss_fft_state;
typedef struct kiss_fft_state* kiss_fft_cfg;
#endif
// -------------------------------------------------------------------------
// Data types for double-precision complex
#elif FFT_PRECISION == 2
#if defined(FFT_SGI)
#include "fft.h"
typedef zomplex FFT_DATA;
#define FFT_1D zfft1d
#define FFT_1D_INIT zfft1di
extern "C" {
int zfft1d(int, int, FFT_DATA *, int, FFT_DATA *);
FFT_DATA *zfft1di(int, FFT_DATA *);
}
#elif defined(FFT_SCSL)
#include <scsl_fft.h>
typedef scsl_zomplex FFT_DATA;
typedef double FFT_PREC;
#define FFT_1D zzfft
#define FFT_1D_INIT zzfft
extern "C" {
int zzfft(int, int, FFT_PREC, FFT_DATA *, FFT_DATA *,
FFT_PREC *, FFT_PREC *, int *);
}
#elif defined(FFT_ACML)
typedef struct {
double re;
double im;
} FFT_DATA;
#define FFT_1D zfft1m_
extern "C" {
void zfft1m_(int *, int *, int *, FFT_DATA *, FFT_DATA *, int *);
}
#elif defined(FFT_INTEL)
typedef struct {
double re;
double im;
} FFT_DATA;
#define FFT_1D zfft1d_
#define FFT_1D_INIT zfft1d_
extern "C" {
void zfft1d_(FFT_DATA *, int *, int *, FFT_DATA *);
}
#elif defined(FFT_MKL)
#include "mkl_dfti.h"
typedef double _Complex FFT_DATA;
#define FFT_MKL_PREC DFTI_DOUBLE
#elif defined(FFT_DEC)
typedef struct {
double re;
double im;
} FFT_DATA;
#define FFT_1D zfft_
extern "C" {
void zfft_(char *, char *, char *, FFT_DATA *, FFT_DATA *, int *, int *);
}
#elif defined(FFT_T3E)
#include <complex.h>
typedef complex double FFT_DATA;
#define FFT_1D CCFFT
#define FFT_1D_INIT CCFFT
extern "C" {
void CCFFT(int *, int *, double *, FFT_DATA *, FFT_DATA *,
double *, double *, int *);
}
#elif defined(FFT_FFTW2)
#if defined(FFTW_SIZE)
#include "dfftw.h"
#else
#include "fftw.h"
#endif
typedef FFTW_COMPLEX FFT_DATA;
#elif defined(FFT_FFTW3)
#include "fftw3.h"
typedef fftw_complex FFT_DATA;
#define FFTW_API(function) fftw_ ## function
#else
/* use a stripped down version of kiss fft as default fft */
#ifndef FFT_KISSFFT
#define FFT_KISSFFT
#endif
#define kiss_fft_scalar double
typedef struct {
kiss_fft_scalar re;
kiss_fft_scalar im;
} FFT_DATA;
struct kiss_fft_state;
typedef struct kiss_fft_state* kiss_fft_cfg;
#endif
#else
#error "FFT_PRECISION needs to be either 1 (=single) or 2 (=double)"
#endif
// -------------------------------------------------------------------------
// details of how to do a 3d FFT
struct fft_plan_3d {
struct remap_plan_3d *pre_plan; // remap from input -> 1st FFTs
struct remap_plan_3d *mid1_plan; // remap from 1st -> 2nd FFTs
struct remap_plan_3d *mid2_plan; // remap from 2nd -> 3rd FFTs
struct remap_plan_3d *post_plan; // remap from 3rd FFTs -> output
FFT_DATA *copy; // memory for remap results (if needed)
FFT_DATA *scratch; // scratch space for remaps
int total1,total2,total3; // # of 1st,2nd,3rd FFTs (times length)
int length1,length2,length3; // length of 1st,2nd,3rd FFTs
int pre_target; // where to put remap results
int mid1_target,mid2_target;
int scaled; // whether to scale FFT results
int normnum; // # of values to rescale
double norm; // normalization factor for rescaling
// system specific 1d FFT info
#if defined(FFT_SGI)
FFT_DATA *coeff1;
FFT_DATA *coeff2;
FFT_DATA *coeff3;
#elif defined(FFT_SCSL)
FFT_PREC *coeff1;
FFT_PREC *coeff2;
FFT_PREC *coeff3;
FFT_PREC *work1;
FFT_PREC *work2;
FFT_PREC *work3;
#elif defined(FFT_ACML)
FFT_DATA *coeff1;
FFT_DATA *coeff2;
FFT_DATA *coeff3;
#elif defined(FFT_INTEL)
FFT_DATA *coeff1;
FFT_DATA *coeff2;
FFT_DATA *coeff3;
#elif defined(FFT_MKL)
DFTI_DESCRIPTOR *handle_fast;
DFTI_DESCRIPTOR *handle_mid;
DFTI_DESCRIPTOR *handle_slow;
#elif defined(FFT_T3E)
double *coeff1;
double *coeff2;
double *coeff3;
double *work1;
double *work2;
double *work3;
#elif defined(FFT_FFTW2)
fftw_plan plan_fast_forward;
fftw_plan plan_fast_backward;
fftw_plan plan_mid_forward;
fftw_plan plan_mid_backward;
fftw_plan plan_slow_forward;
fftw_plan plan_slow_backward;
#elif defined(FFT_FFTW3)
FFTW_API(plan) plan_fast_forward;
FFTW_API(plan) plan_fast_backward;
FFTW_API(plan) plan_mid_forward;
FFTW_API(plan) plan_mid_backward;
FFTW_API(plan) plan_slow_forward;
FFTW_API(plan) plan_slow_backward;
#elif defined(FFT_KISSFFT)
kiss_fft_cfg cfg_fast_forward;
kiss_fft_cfg cfg_fast_backward;
kiss_fft_cfg cfg_mid_forward;
kiss_fft_cfg cfg_mid_backward;
kiss_fft_cfg cfg_slow_forward;
kiss_fft_cfg cfg_slow_backward;
#endif
};
// function prototypes
void fft_3d(FFT_DATA *, FFT_DATA *, int, struct fft_plan_3d *);
struct fft_plan_3d *fft_3d_create_plan(MPI_Comm, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int *);
void fft_3d_destroy_plan(struct fft_plan_3d *);
void factor(int, int *, int *);
void bifactor(int, int *, int *);
void fft_1d_only(FFT_DATA *, int, int, struct fft_plan_3d *);
+/* ERROR/WARNING messages:
+*/
diff --git a/src/KSPACE/fft3d_wrap.h b/src/KSPACE/fft3d_wrap.h
index a7a86bcf6..6b73207be 100644
--- a/src/KSPACE/fft3d_wrap.h
+++ b/src/KSPACE/fft3d_wrap.h
@@ -1,36 +1,44 @@
/* -*- c++ -*- ----------------------------------------------------------
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_FFT3D_WRAP_H
#define LMP_FFT3D_WRAP_H
#include "pointers.h"
#include "fft3d.h"
namespace LAMMPS_NS {
class FFT3d : protected Pointers {
public:
FFT3d(class LAMMPS *, MPI_Comm,int,int,int,int,int,int,int,int,int,
int,int,int,int,int,int,int,int,int *);
~FFT3d();
void compute(FFT_SCALAR *, FFT_SCALAR *, int);
void timing1d(FFT_SCALAR *, int, int);
private:
struct fft_plan_3d *plan;
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Could not create 3d FFT plan
+
+The FFT setup in pppm failed.
+
+*/
diff --git a/src/KSPACE/pair_born_coul_long.cpp b/src/KSPACE/pair_born_coul_long.cpp
index 2e607cd74..88112d549 100644
--- a/src/KSPACE/pair_born_coul_long.cpp
+++ b/src/KSPACE/pair_born_coul_long.cpp
@@ -1,497 +1,497 @@
/* ----------------------------------------------------------------------
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: Ahmed Ismail (SNL)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_born_coul_long.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "kspace.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
/* ---------------------------------------------------------------------- */
PairBornCoulLong::PairBornCoulLong(LAMMPS *lmp) : Pair(lmp) {}
/* ---------------------------------------------------------------------- */
PairBornCoulLong::~PairBornCoulLong()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(a);
memory->destroy(rho);
memory->destroy(sigma);
memory->destroy(c);
memory->destroy(d);
memory->destroy(rhoinv);
memory->destroy(born1);
memory->destroy(born2);
memory->destroy(born3);
memory->destroy(offset);
}
}
/* ---------------------------------------------------------------------- */
void PairBornCoulLong::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
double rsq,r2inv,r6inv,forcecoul,forceborn,factor_coul,factor_lj;
double grij,expm2,prefactor,t,erfc;
double r,rexp;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = ecoul = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
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];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
r2inv = 1.0/rsq;
r = sqrt(rsq);
if (rsq < cut_coulsq) {
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = qqrd2e * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else forcecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
r6inv = r2inv*r2inv*r2inv;
rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
+ born3[itype][jtype]*r2inv*r6inv;
} else forceborn = 0.0;
fpair = (forcecoul + factor_lj*forceborn) * r2inv;
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) {
if (rsq < cut_coulsq) {
ecoul = prefactor*erfc;
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
} else ecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv
+ d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
evdwl *= factor_lj;
} else evdwl = 0.0;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,ecoul,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairBornCoulLong::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut_lj,n+1,n+1,"pair:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"pair:cut_ljsq");
memory->create(a,n+1,n+1,"pair:a");
memory->create(rho,n+1,n+1,"pair:rho");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(c,n+1,n+1,"pair:c");
memory->create(d,n+1,n+1,"pair:d");
memory->create(rhoinv,n+1,n+1,"pair:rhoinv");
memory->create(born1,n+1,n+1,"pair:born1");
memory->create(born2,n+1,n+1,"pair:born2");
memory->create(born3,n+1,n+1,"pair:born3");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairBornCoulLong::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul = cut_lj_global;
else cut_coul = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairBornCoulLong::coeff(int narg, char **arg)
{
if (narg < 7 || narg > 8) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a_one = force->numeric(arg[2]);
double rho_one = force->numeric(arg[3]);
double sigma_one = force->numeric(arg[4]);
if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients");
double c_one = force->numeric(arg[5]);
double d_one = force->numeric(arg[6]);
double cut_lj_one = cut_lj_global;
if (narg == 8) cut_lj_one = force->numeric(arg[7]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
a[i][j] = a_one;
rho[i][j] = rho_one;
sigma[i][j] = sigma_one;
c[i][j] = c_one;
d[i][j] = d_one;
cut_lj[i][j] = cut_lj_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairBornCoulLong::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
double cut = MAX(cut_lj[i][j],cut_coul);
cut_ljsq[i][j] = cut_lj[i][j] * cut_lj[i][j];
rhoinv[i][j] = 1.0/rho[i][j];
born1[i][j] = a[i][j]/rho[i][j];
born2[i][j] = 6.0*c[i][j];
born3[i][j] = 8.0*d[i][j];
if (offset_flag) {
double rexp = exp(-cut_lj[i][j]*rhoinv[i][j]);
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0) +
d[i][j]/pow(cut_lj[i][j],8.0);
} else offset[i][j] = 0.0;
cut_ljsq[j][i] = cut_ljsq[i][j];
a[j][i] = a[i][j];
c[j][i] = c[i][j];
d[j][i] = d[i][j];
rhoinv[j][i] = rhoinv[i][j];
sigma[j][i] = sigma[i][j];
born1[j][i] = born1[i][j];
born2[j][i] = born2[i][j];
born3[j][i] = born3[i][j];
offset[j][i] = offset[i][j];
// compute I,J contribution to long-range tail correction
// count total # of atoms of type I and J via Allreduce
if (tail_flag) {
int *type = atom->type;
int nlocal = atom->nlocal;
double count[2],all[2];
count[0] = count[1] = 0.0;
for (int k = 0; k < nlocal; k++) {
if (type[k] == i) count[0] += 1.0;
if (type[k] == j) count[1] += 1.0;
}
MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
double rho1 = rho[i][j];
double rho2 = rho1*rho1;
double rho3 = rho2*rho1;
double rc = cut_lj[i][j];
double rc2 = rc*rc;
double rc3 = rc2*rc;
double rc5 = rc3*rc2;
etail_ij = 2.0*MY_PI*all[0]*all[1] *
(a[i][j]*exp((sigma[i][j]-rc)/rho1)*rho1*
(rc2 + 2.0*rho1*rc + 2.0*rho2) -
c[i][j]/(3.0*rc3) + d[i][j]/(5.0*rc5));
ptail_ij = (-1/3.0)*2.0*MY_PI*all[0]*all[1] *
(-a[i][j]*exp((sigma[i][j]-rc)/rho1) *
(rc3 + 3.0*rho1*rc2 + 6.0*rho2*rc + 6.0*rho3) +
2.0*c[i][j]/rc3 - 8.0*d[i][j]/(5.0*rc5));
}
return cut;
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairBornCoulLong::init_style()
{
if (!atom->q_flag)
error->all(FLERR,"Pair style born/coul/long requires atom attribute q");
cut_coulsq = cut_coul * cut_coul;
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
neighbor->request(this);
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairBornCoulLong::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&a[i][j],sizeof(double),1,fp);
fwrite(&rho[i][j],sizeof(double),1,fp);
fwrite(&sigma[i][j],sizeof(double),1,fp);
fwrite(&c[i][j],sizeof(double),1,fp);
fwrite(&d[i][j],sizeof(double),1,fp);
fwrite(&cut_lj[i][j],sizeof(double),1,fp);
}
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairBornCoulLong::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
fread(&a[i][j],sizeof(double),1,fp);
fread(&rho[i][j],sizeof(double),1,fp);
fread(&sigma[i][j],sizeof(double),1,fp);
fread(&c[i][j],sizeof(double),1,fp);
fread(&d[i][j],sizeof(double),1,fp);
fread(&cut_lj[i][j],sizeof(double),1,fp);
}
MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&d[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairBornCoulLong::write_restart_settings(FILE *fp)
{
fwrite(&cut_lj_global,sizeof(double),1,fp);
fwrite(&cut_coul,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairBornCoulLong::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&cut_lj_global,sizeof(double),1,fp);
fread(&cut_coul,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
double PairBornCoulLong::single(int i, int j, int itype, int jtype,
double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double r2inv,r6inv,r,rexp,grij,expm2,t,erfc,prefactor;
double forcecoul,forceborn,phicoul,phiborn;
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = force->qqrd2e * atom->q[i]*atom->q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else forcecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
r6inv = r2inv*r2inv*r2inv;
r = sqrt(rsq);
rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv +
born3[itype][jtype]*r2inv*r6inv;
} else forceborn = 0.0;
fforce = (forcecoul + factor_lj*forceborn) * r2inv;
double eng = 0.0;
if (rsq < cut_coulsq) {
phicoul = prefactor*erfc;
if (factor_coul < 1.0) phicoul -= (1.0-factor_coul)*prefactor;
eng += phicoul;
}
if (rsq < cut_ljsq[itype][jtype]) {
phiborn = a[itype][jtype]*rexp - c[itype][jtype]*r6inv +
d[itype][jtype]*r2inv*r6inv - offset[itype][jtype];
eng += factor_lj*phiborn;
}
return eng;
}
/* ---------------------------------------------------------------------- */
-void *PairBornCoulLong::extract(char *str, int &dim)
+void *PairBornCoulLong::extract(const char *str, int &dim)
{
dim = 0;
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
return NULL;
}
diff --git a/src/KSPACE/pair_born_coul_long.h b/src/KSPACE/pair_born_coul_long.h
index 3a8c910db..5debacd85 100644
--- a/src/KSPACE/pair_born_coul_long.h
+++ b/src/KSPACE/pair_born_coul_long.h
@@ -1,57 +1,85 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(born/coul/long,PairBornCoulLong)
#else
#ifndef LMP_PAIR_BORN_COUL_LONG_H
#define LMP_PAIR_BORN_COUL_LONG_H
#include "pair.h"
namespace LAMMPS_NS {
class PairBornCoulLong : public Pair {
public:
PairBornCoulLong(class LAMMPS *);
virtual ~PairBornCoulLong();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
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 &);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
double cut_lj_global;
double **cut_lj,**cut_ljsq;
double cut_coul,cut_coulsq;
double **a,**rho,**sigma,**c,**d;
double **rhoinv,**born1,**born2,**born3,**offset;
double g_ewald;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+E: Pair style born/coul/long requires atom attribute q
+
+An atom style that defines this attribute must be used.
+
+E: Pair style is incompatible with KSpace style
+
+If a pair style with a long-range Coulombic component is selected,
+then a kspace style must also be used.
+
+*/
diff --git a/src/KSPACE/pair_buck_coul_long.cpp b/src/KSPACE/pair_buck_coul_long.cpp
index a68029f36..f3fa4d50d 100644
--- a/src/KSPACE/pair_buck_coul_long.cpp
+++ b/src/KSPACE/pair_buck_coul_long.cpp
@@ -1,467 +1,467 @@
/* ----------------------------------------------------------------------
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 "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_buck_coul_long.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "kspace.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
/* ---------------------------------------------------------------------- */
PairBuckCoulLong::PairBuckCoulLong(LAMMPS *lmp) : Pair(lmp) {}
/* ---------------------------------------------------------------------- */
PairBuckCoulLong::~PairBuckCoulLong()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(a);
memory->destroy(rho);
memory->destroy(c);
memory->destroy(rhoinv);
memory->destroy(buck1);
memory->destroy(buck2);
memory->destroy(offset);
}
}
/* ---------------------------------------------------------------------- */
void PairBuckCoulLong::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
double rsq,r2inv,r6inv,forcecoul,forcebuck,factor_coul,factor_lj;
double grij,expm2,prefactor,t,erfc;
double r,rexp;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = ecoul = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
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];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
r2inv = 1.0/rsq;
r = sqrt(rsq);
if (rsq < cut_coulsq) {
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = qqrd2e * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else forcecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
r6inv = r2inv*r2inv*r2inv;
rexp = exp(-r*rhoinv[itype][jtype]);
forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
} else forcebuck = 0.0;
fpair = (forcecoul + factor_lj*forcebuck) * r2inv;
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) {
if (rsq < cut_coulsq) {
ecoul = prefactor*erfc;
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
} else ecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
offset[itype][jtype];
evdwl *= factor_lj;
} else evdwl = 0.0;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,ecoul,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairBuckCoulLong::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut_lj,n+1,n+1,"pair:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"pair:cut_ljsq");
memory->create(a,n+1,n+1,"pair:a");
memory->create(rho,n+1,n+1,"pair:rho");
memory->create(c,n+1,n+1,"pair:c");
memory->create(rhoinv,n+1,n+1,"pair:rhoinv");
memory->create(buck1,n+1,n+1,"pair:buck1");
memory->create(buck2,n+1,n+1,"pair:buck2");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairBuckCoulLong::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul = cut_lj_global;
else cut_coul = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairBuckCoulLong::coeff(int narg, char **arg)
{
if (narg < 5 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a_one = force->numeric(arg[2]);
double rho_one = force->numeric(arg[3]);
if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients");
double c_one = force->numeric(arg[4]);
double cut_lj_one = cut_lj_global;
if (narg == 6) cut_lj_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
a[i][j] = a_one;
rho[i][j] = rho_one;
c[i][j] = c_one;
cut_lj[i][j] = cut_lj_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairBuckCoulLong::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
double cut = MAX(cut_lj[i][j],cut_coul);
cut_ljsq[i][j] = cut_lj[i][j] * cut_lj[i][j];
rhoinv[i][j] = 1.0/rho[i][j];
buck1[i][j] = a[i][j]/rho[i][j];
buck2[i][j] = 6.0*c[i][j];
if (offset_flag) {
double rexp = exp(-cut_lj[i][j]/rho[i][j]);
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0);
} else offset[i][j] = 0.0;
cut_ljsq[j][i] = cut_ljsq[i][j];
a[j][i] = a[i][j];
c[j][i] = c[i][j];
rhoinv[j][i] = rhoinv[i][j];
buck1[j][i] = buck1[i][j];
buck2[j][i] = buck2[i][j];
offset[j][i] = offset[i][j];
// compute I,J contribution to long-range tail correction
// count total # of atoms of type I and J via Allreduce
if (tail_flag) {
int *type = atom->type;
int nlocal = atom->nlocal;
double count[2],all[2];
count[0] = count[1] = 0.0;
for (int k = 0; k < nlocal; k++) {
if (type[k] == i) count[0] += 1.0;
if (type[k] == j) count[1] += 1.0;
}
MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
double rho1 = rho[i][j];
double rho2 = rho1*rho1;
double rho3 = rho2*rho1;
double rc = cut_lj[i][j];
double rc2 = rc*rc;
double rc3 = rc2*rc;
etail_ij = 2.0*MY_PI*all[0]*all[1]*
(a[i][j]*exp(-rc/rho1)*rho1*(rc2 + 2.0*rho1*rc + 2.0*rho2) -
c[i][j]/(3.0*rc3));
ptail_ij = (-1/3.0)*2.0*MY_PI*all[0]*all[1]*
(-a[i][j]*exp(-rc/rho1)*
(rc3 + 3.0*rho1*rc2 + 6.0*rho2*rc + 6.0*rho3) + 2.0*c[i][j]/rc3);
}
return cut;
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairBuckCoulLong::init_style()
{
if (!atom->q_flag)
error->all(FLERR,"Pair style buck/coul/long requires atom attribute q");
cut_coulsq = cut_coul * cut_coul;
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
neighbor->request(this);
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairBuckCoulLong::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&a[i][j],sizeof(double),1,fp);
fwrite(&rho[i][j],sizeof(double),1,fp);
fwrite(&c[i][j],sizeof(double),1,fp);
fwrite(&cut_lj[i][j],sizeof(double),1,fp);
}
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairBuckCoulLong::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
fread(&a[i][j],sizeof(double),1,fp);
fread(&rho[i][j],sizeof(double),1,fp);
fread(&c[i][j],sizeof(double),1,fp);
fread(&cut_lj[i][j],sizeof(double),1,fp);
}
MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairBuckCoulLong::write_restart_settings(FILE *fp)
{
fwrite(&cut_lj_global,sizeof(double),1,fp);
fwrite(&cut_coul,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairBuckCoulLong::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&cut_lj_global,sizeof(double),1,fp);
fread(&cut_coul,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
double PairBuckCoulLong::single(int i, int j, int itype, int jtype,
double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double r2inv,r6inv,r,rexp,grij,expm2,t,erfc,prefactor;
double forcecoul,forcebuck,phicoul,phibuck;
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = force->qqrd2e * atom->q[i]*atom->q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else forcecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
r6inv = r2inv*r2inv*r2inv;
r = sqrt(rsq);
rexp = exp(-r*rhoinv[itype][jtype]);
forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
} else forcebuck = 0.0;
fforce = (forcecoul + factor_lj*forcebuck) * r2inv;
double eng = 0.0;
if (rsq < cut_coulsq) {
phicoul = prefactor*erfc;
if (factor_coul < 1.0) phicoul -= (1.0-factor_coul)*prefactor;
eng += phicoul;
}
if (rsq < cut_ljsq[itype][jtype]) {
phibuck = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
offset[itype][jtype];
eng += factor_lj*phibuck;
}
return eng;
}
/* ---------------------------------------------------------------------- */
-void *PairBuckCoulLong::extract(char *str, int &dim)
+void *PairBuckCoulLong::extract(const char *str, int &dim)
{
dim = 0;
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
return NULL;
}
diff --git a/src/KSPACE/pair_buck_coul_long.h b/src/KSPACE/pair_buck_coul_long.h
index 44b82d99d..96de53c26 100644
--- a/src/KSPACE/pair_buck_coul_long.h
+++ b/src/KSPACE/pair_buck_coul_long.h
@@ -1,57 +1,85 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(buck/coul/long,PairBuckCoulLong)
#else
#ifndef LMP_PAIR_BUCK_COUL_LONG_H
#define LMP_PAIR_BUCK_COUL_LONG_H
#include "pair.h"
namespace LAMMPS_NS {
class PairBuckCoulLong : public Pair {
public:
PairBuckCoulLong(class LAMMPS *);
virtual ~PairBuckCoulLong();
void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
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 &);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
double cut_lj_global;
double **cut_lj,**cut_ljsq;
double cut_coul,cut_coulsq;
double **a,**rho,**c;
double **rhoinv,**buck1,**buck2,**offset;
double g_ewald;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+E: Pair style buck/coul/long requires atom attribute q
+
+The atom style defined does not have these attributes.
+
+E: Pair style is incompatible with KSpace style
+
+If a pair style with a long-range Coulombic component is selected,
+then a kspace style must also be used.
+
+*/
diff --git a/src/KSPACE/pair_coul_long.cpp b/src/KSPACE/pair_coul_long.cpp
index 6a3f70b35..0ec33fb71 100644
--- a/src/KSPACE/pair_coul_long.cpp
+++ b/src/KSPACE/pair_coul_long.cpp
@@ -1,570 +1,570 @@
/* ----------------------------------------------------------------------
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: Paul Crozier (SNL)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_coul_long.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "kspace.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "update.h"
#include "integrate.h"
#include "respa.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
/* ---------------------------------------------------------------------- */
PairCoulLong::PairCoulLong(LAMMPS *lmp) : Pair(lmp)
{
ftable = NULL;
}
/* ---------------------------------------------------------------------- */
PairCoulLong::~PairCoulLong()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(scale);
}
if (ftable) free_tables();
}
/* ---------------------------------------------------------------------- */
void PairCoulLong::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itable,itype,jtype;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,ecoul,fpair;
double fraction,table;
double r,r2inv,forcecoul,factor_coul;
double grij,expm2,prefactor,t,erfc;
int *ilist,*jlist,*numneigh,**firstneigh;
double rsq;
ecoul = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
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];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cut_coulsq) {
r2inv = 1.0/rsq;
if (!ncoultablebits || rsq <= tabinnersq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = qqrd2e * scale[itype][jtype] * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
itable = rsq_lookup.i & ncoulmask;
itable >>= ncoulshiftbits;
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = scale[itype][jtype] * qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = scale[itype][jtype] * qtmp*q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
fpair = forcecoul * r2inv;
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) {
if (!ncoultablebits || rsq <= tabinnersq)
ecoul = prefactor*erfc;
else {
table = etable[itable] + fraction*detable[itable];
ecoul = scale[itype][jtype] * qtmp*q[j] * table;
}
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
0.0,ecoul,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairCoulLong::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(scale,n+1,n+1,"pair:scale");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairCoulLong::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_coul = force->numeric(arg[0]);
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairCoulLong::coeff(int narg, char **arg)
{
if (narg != 2) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
scale[i][j] = 1.0;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairCoulLong::init_style()
{
if (!atom->q_flag)
error->all(FLERR,"Pair style lj/cut/coul/long requires atom attribute q");
neighbor->request(this);
cut_coulsq = cut_coul * cut_coul;
// set & error check interior rRESPA cutoffs
if (strstr(update->integrate_style,"respa") &&
((Respa *) update->integrate)->level_inner >= 0) {
cut_respa = ((Respa *) update->integrate)->cutoff;
if (cut_coul < cut_respa[3])
error->all(FLERR,"Pair cutoff < Respa interior cutoff");
} else cut_respa = NULL;
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
// setup force tables
if (ncoultablebits) init_tables();
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairCoulLong::init_one(int i, int j)
{
scale[j][i] = scale[i][j];
return cut_coul;
}
/* ----------------------------------------------------------------------
setup force tables used in compute routines
------------------------------------------------------------------------- */
void PairCoulLong::init_tables()
{
int masklo,maskhi;
double r,grij,expm2,derfc,rsw;
double qqrd2e = force->qqrd2e;
tabinnersq = tabinner*tabinner;
init_bitmap(tabinner,cut_coul,ncoultablebits,
masklo,maskhi,ncoulmask,ncoulshiftbits);
int ntable = 1;
for (int i = 0; i < ncoultablebits; i++) ntable *= 2;
// linear lookup tables of length N = 2^ncoultablebits
// stored value = value at lower edge of bin
// d values = delta from lower edge to upper edge of bin
if (ftable) free_tables();
memory->create(rtable,ntable,"pair:rtable");
memory->create(ftable,ntable,"pair:ftable");
memory->create(ctable,ntable,"pair:ctable");
memory->create(etable,ntable,"pair:etable");
memory->create(drtable,ntable,"pair:drtable");
memory->create(dftable,ntable,"pair:dftable");
memory->create(dctable,ntable,"pair:dctable");
memory->create(detable,ntable,"pair:detable");
if (cut_respa == NULL) {
vtable = ptable = dvtable = dptable = NULL;
} else {
memory->create(vtable,ntable,"pair:vtable");
memory->create(ptable,ntable,"pair:ptable");
memory->create(dvtable,ntable,"pair:dvtable");
memory->create(dptable,ntable,"pair:dptable");
}
union_int_float_t rsq_lookup;
union_int_float_t minrsq_lookup;
int itablemin;
minrsq_lookup.i = 0 << ncoulshiftbits;
minrsq_lookup.i |= maskhi;
for (int i = 0; i < ntable; i++) {
rsq_lookup.i = i << ncoulshiftbits;
rsq_lookup.i |= masklo;
if (rsq_lookup.f < tabinnersq) {
rsq_lookup.i = i << ncoulshiftbits;
rsq_lookup.i |= maskhi;
}
r = sqrtf(rsq_lookup.f);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
derfc = erfc(grij);
if (cut_respa == NULL) {
rtable[i] = rsq_lookup.f;
ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
ctable[i] = qqrd2e/r;
etable[i] = qqrd2e/r * derfc;
} else {
rtable[i] = rsq_lookup.f;
ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2 - 1.0);
ctable[i] = 0.0;
etable[i] = qqrd2e/r * derfc;
ptable[i] = qqrd2e/r;
vtable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
} else {
ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
ctable[i] = qqrd2e/r;
}
}
}
minrsq_lookup.f = MIN(minrsq_lookup.f,rsq_lookup.f);
}
tabinnersq = minrsq_lookup.f;
int ntablem1 = ntable - 1;
for (int i = 0; i < ntablem1; i++) {
drtable[i] = 1.0/(rtable[i+1] - rtable[i]);
dftable[i] = ftable[i+1] - ftable[i];
dctable[i] = ctable[i+1] - ctable[i];
detable[i] = etable[i+1] - etable[i];
}
if (cut_respa) {
for (int i = 0; i < ntablem1; i++) {
dvtable[i] = vtable[i+1] - vtable[i];
dptable[i] = ptable[i+1] - ptable[i];
}
}
// get the delta values for the last table entries
// tables are connected periodically between 0 and ntablem1
drtable[ntablem1] = 1.0/(rtable[0] - rtable[ntablem1]);
dftable[ntablem1] = ftable[0] - ftable[ntablem1];
dctable[ntablem1] = ctable[0] - ctable[ntablem1];
detable[ntablem1] = etable[0] - etable[ntablem1];
if (cut_respa) {
dvtable[ntablem1] = vtable[0] - vtable[ntablem1];
dptable[ntablem1] = ptable[0] - ptable[ntablem1];
}
// get the correct delta values at itablemax
// smallest r is in bin itablemin
// largest r is in bin itablemax, which is itablemin-1,
// or ntablem1 if itablemin=0
// deltas at itablemax only needed if corresponding rsq < cut*cut
// if so, compute deltas between rsq and cut*cut
double f_tmp,c_tmp,e_tmp,p_tmp,v_tmp;
itablemin = minrsq_lookup.i & ncoulmask;
itablemin >>= ncoulshiftbits;
int itablemax = itablemin - 1;
if (itablemin == 0) itablemax = ntablem1;
rsq_lookup.i = itablemax << ncoulshiftbits;
rsq_lookup.i |= maskhi;
if (rsq_lookup.f < cut_coulsq) {
rsq_lookup.f = cut_coulsq;
r = sqrtf(rsq_lookup.f);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
derfc = erfc(grij);
if (cut_respa == NULL) {
f_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
c_tmp = qqrd2e/r;
e_tmp = qqrd2e/r * derfc;
} else {
f_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2 - 1.0);
c_tmp = 0.0;
e_tmp = qqrd2e/r * derfc;
p_tmp = qqrd2e/r;
v_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
f_tmp += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
c_tmp = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
} else {
f_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
c_tmp = qqrd2e/r;
}
}
}
drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);
dftable[itablemax] = f_tmp - ftable[itablemax];
dctable[itablemax] = c_tmp - ctable[itablemax];
detable[itablemax] = e_tmp - etable[itablemax];
if (cut_respa) {
dvtable[itablemax] = v_tmp - vtable[itablemax];
dptable[itablemax] = p_tmp - ptable[itablemax];
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairCoulLong::write_restart(FILE *fp)
{
write_restart_settings(fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairCoulLong::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairCoulLong::write_restart_settings(FILE *fp)
{
fwrite(&cut_coul,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairCoulLong::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&cut_coul,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ----------------------------------------------------------------------
free memory for tables used in pair computations
------------------------------------------------------------------------- */
void PairCoulLong::free_tables()
{
memory->destroy(rtable);
memory->destroy(drtable);
memory->destroy(ftable);
memory->destroy(dftable);
memory->destroy(ctable);
memory->destroy(dctable);
memory->destroy(etable);
memory->destroy(detable);
memory->destroy(vtable);
memory->destroy(dvtable);
memory->destroy(ptable);
memory->destroy(dptable);
}
/* ---------------------------------------------------------------------- */
double PairCoulLong::single(int i, int j, int itype, int jtype,
double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double r2inv,r,grij,expm2,t,erfc,prefactor;
double fraction,table,forcecoul,phicoul;
int itable;
r2inv = 1.0/rsq;
if (!ncoultablebits || rsq <= tabinnersq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = force->qqrd2e * atom->q[i]*atom->q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
itable = rsq_lookup.i & ncoulmask;
itable >>= ncoulshiftbits;
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = atom->q[i]*atom->q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = atom->q[i]*atom->q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
fforce = forcecoul * r2inv;
if (!ncoultablebits || rsq <= tabinnersq)
phicoul = prefactor*erfc;
else {
table = etable[itable] + fraction*detable[itable];
phicoul = atom->q[i]*atom->q[j] * table;
}
if (factor_coul < 1.0) phicoul -= (1.0-factor_coul)*prefactor;
return phicoul;
}
/* ---------------------------------------------------------------------- */
-void *PairCoulLong::extract(char *str, int &dim)
+void *PairCoulLong::extract(const char *str, int &dim)
{
if (strcmp(str,"cut_coul") == 0) {
dim = 0;
return (void *) &cut_coul;
}
if (strcmp(str,"scale") == 0) {
dim = 2;
return (void *) scale;
}
return NULL;
}
diff --git a/src/KSPACE/pair_coul_long.h b/src/KSPACE/pair_coul_long.h
index 59e2c7609..d67aea814 100644
--- a/src/KSPACE/pair_coul_long.h
+++ b/src/KSPACE/pair_coul_long.h
@@ -1,62 +1,90 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(coul/long,PairCoulLong)
#else
#ifndef LMP_PAIR_COUL_LONG_H
#define LMP_PAIR_COUL_LONG_H
#include "pair.h"
namespace LAMMPS_NS {
class PairCoulLong : public Pair {
public:
PairCoulLong(class LAMMPS *);
~PairCoulLong();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
virtual void init_style();
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
virtual void read_restart_settings(FILE *);
virtual double single(int, int, int, int, double, double, double, double &);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
double cut_coul,cut_coulsq;
double *cut_respa;
double g_ewald;
double **scale;
double tabinnersq;
double *rtable,*drtable,*ftable,*dftable,*ctable,*dctable;
double *etable,*detable,*ptable,*dptable,*vtable,*dvtable;
int ncoulshiftbits,ncoulmask;
void allocate();
void init_tables();
void free_tables();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style lj/cut/coul/long requires atom attribute q
+
+The atom style defined does not have this attribute.
+
+E: Pair cutoff < Respa interior cutoff
+
+One or more pairwise cutoffs are too short to use with the specified
+rRESPA cutoffs.
+
+E: Pair style is incompatible with KSpace style
+
+If a pair style with a long-range Coulombic component is selected,
+then a kspace style must also be used.
+
+*/
diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp
index 1ff61a5ec..bee8e33ca 100644
--- a/src/KSPACE/pair_lj_charmm_coul_long.cpp
+++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp
@@ -1,1197 +1,1197 @@
/* ----------------------------------------------------------------------
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: Paul Crozier (SNL)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_lj_charmm_coul_long.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "kspace.h"
#include "update.h"
#include "integrate.h"
#include "respa.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER}; // same as in pair.cpp
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
/* ---------------------------------------------------------------------- */
PairLJCharmmCoulLong::PairLJCharmmCoulLong(LAMMPS *lmp) : Pair(lmp)
{
respa_enable = 1;
ftable = NULL;
implicit = 0;
mix_flag = ARITHMETIC;
}
/* ---------------------------------------------------------------------- */
PairLJCharmmCoulLong::~PairLJCharmmCoulLong()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(eps14);
memory->destroy(sigma14);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(lj14_1);
memory->destroy(lj14_2);
memory->destroy(lj14_3);
memory->destroy(lj14_4);
}
if (ftable) free_tables();
}
/* ---------------------------------------------------------------------- */
void PairLJCharmmCoulLong::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype,itable;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
double fraction,table;
double r,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
double grij,expm2,prefactor,t,erfc;
double philj,switch1,switch2;
int *ilist,*jlist,*numneigh,**firstneigh;
double rsq;
evdwl = ecoul = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
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];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
if (rsq < cut_bothsq) {
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = qqrd2e * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
itable = rsq_lookup.i & ncoulmask;
itable >>= ncoulshiftbits;
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = qtmp*q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
} else forcecoul = 0.0;
if (rsq < cut_ljsq) {
r6inv = r2inv*r2inv*r2inv;
jtype = type[j];
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
switch2 = 12.0*rsq * (cut_ljsq-rsq) *
(rsq-cut_lj_innersq) / denom_lj;
philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
forcelj = forcelj*switch1 + philj*switch2;
}
} else forcelj = 0.0;
fpair = (forcecoul + factor_lj*forcelj) * r2inv;
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) {
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq)
ecoul = prefactor*erfc;
else {
table = etable[itable] + fraction*detable[itable];
ecoul = qtmp*q[j] * table;
}
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
} else ecoul = 0.0;
if (rsq < cut_ljsq) {
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
evdwl *= switch1;
}
evdwl *= factor_lj;
} else evdwl = 0.0;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,ecoul,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ---------------------------------------------------------------------- */
void PairLJCharmmCoulLong::compute_inner()
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,fpair;
double rsq,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
double rsw;
int *ilist,*jlist,*numneigh,**firstneigh;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
inum = listinner->inum;
ilist = listinner->ilist;
numneigh = listinner->numneigh;
firstneigh = listinner->firstneigh;
double cut_out_on = cut_respa[0];
double cut_out_off = cut_respa[1];
double cut_out_diff = cut_out_off - cut_out_on;
double cut_out_on_sq = cut_out_on*cut_out_on;
double cut_out_off_sq = cut_out_off*cut_out_off;
// loop over neighbors of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
if (rsq < cut_out_off_sq) {
r2inv = 1.0/rsq;
forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*forcecoul;
r6inv = r2inv*r2inv*r2inv;
jtype = type[j];
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
fpair = (forcecoul + factor_lj*forcelj) * r2inv;
if (rsq > cut_out_on_sq) {
rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
fpair *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
}
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;
}
}
}
}
}
/* ---------------------------------------------------------------------- */
void PairLJCharmmCoulLong::compute_middle()
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,fpair;
double rsq,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
double philj,switch1,switch2;
double rsw;
int *ilist,*jlist,*numneigh,**firstneigh;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
inum = listmiddle->inum;
ilist = listmiddle->ilist;
numneigh = listmiddle->numneigh;
firstneigh = listmiddle->firstneigh;
double cut_in_off = cut_respa[0];
double cut_in_on = cut_respa[1];
double cut_out_on = cut_respa[2];
double cut_out_off = cut_respa[3];
double cut_in_diff = cut_in_on - cut_in_off;
double cut_out_diff = cut_out_off - cut_out_on;
double cut_in_off_sq = cut_in_off*cut_in_off;
double cut_in_on_sq = cut_in_on*cut_in_on;
double cut_out_on_sq = cut_out_on*cut_out_on;
double cut_out_off_sq = cut_out_off*cut_out_off;
// loop over neighbors of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
if (rsq < cut_out_off_sq && rsq > cut_in_off_sq) {
r2inv = 1.0/rsq;
forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*forcecoul;
r6inv = r2inv*r2inv*r2inv;
jtype = type[j];
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
switch2 = 12.0*rsq * (cut_ljsq-rsq) *
(rsq-cut_lj_innersq) / denom_lj;
philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
forcelj = forcelj*switch1 + philj*switch2;
}
fpair = (forcecoul + factor_lj*forcelj) * r2inv;
if (rsq < cut_in_on_sq) {
rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
fpair *= rsw*rsw*(3.0 - 2.0*rsw);
}
if (rsq > cut_out_on_sq) {
rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
}
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;
}
}
}
}
}
/* ---------------------------------------------------------------------- */
void PairLJCharmmCoulLong::compute_outer(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype,itable;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
double fraction,table;
double r,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
double grij,expm2,prefactor,t,erfc;
double philj,switch1,switch2;
double rsw;
int *ilist,*jlist,*numneigh,**firstneigh;
double rsq;
evdwl = ecoul = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = 0;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
inum = listouter->inum;
ilist = listouter->ilist;
numneigh = listouter->numneigh;
firstneigh = listouter->firstneigh;
double cut_in_off = cut_respa[2];
double cut_in_on = cut_respa[3];
double cut_in_diff = cut_in_on - cut_in_off;
double cut_in_off_sq = cut_in_off*cut_in_off;
double cut_in_on_sq = cut_in_on*cut_in_on;
// loop over neighbors of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cut_bothsq) {
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = qqrd2e * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2 - 1.0);
if (rsq > cut_in_off_sq) {
if (rsq < cut_in_on_sq) {
rsw = (r - cut_in_off)/cut_in_diff;
forcecoul += prefactor*rsw*rsw*(3.0 - 2.0*rsw);
if (factor_coul < 1.0)
forcecoul -=
(1.0-factor_coul)*prefactor*rsw*rsw*(3.0 - 2.0*rsw);
} else {
forcecoul += prefactor;
if (factor_coul < 1.0)
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
itable = rsq_lookup.i & ncoulmask;
itable >>= ncoulshiftbits;
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = qtmp*q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
} else forcecoul = 0.0;
if (rsq < cut_ljsq && rsq > cut_in_off_sq) {
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
switch2 = 12.0*rsq * (cut_ljsq-rsq) *
(rsq-cut_lj_innersq) / denom_lj;
philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
forcelj = forcelj*switch1 + philj*switch2;
}
if (rsq < cut_in_on_sq) {
rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
forcelj *= rsw*rsw*(3.0 - 2.0*rsw);
}
} else forcelj = 0.0;
fpair = (forcecoul + forcelj) * r2inv;
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) {
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq) {
ecoul = prefactor*erfc;
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
} else {
table = etable[itable] + fraction*detable[itable];
ecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ptable[itable] + fraction*dptable[itable];
prefactor = qtmp*q[j] * table;
ecoul -= (1.0-factor_coul)*prefactor;
}
}
} else ecoul = 0.0;
if (rsq < cut_ljsq) {
r6inv = r2inv*r2inv*r2inv;
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
evdwl *= switch1;
}
evdwl *= factor_lj;
} else evdwl = 0.0;
}
if (vflag) {
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq) {
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else {
table = vtable[itable] + fraction*dvtable[itable];
forcecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ptable[itable] + fraction*dptable[itable];
prefactor = qtmp*q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
} else forcecoul = 0.0;
if (rsq <= cut_in_off_sq) {
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
switch2 = 12.0*rsq * (cut_ljsq-rsq) *
(rsq-cut_lj_innersq) / denom_lj;
philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
forcelj = forcelj*switch1 + philj*switch2;
}
} else if (rsq <= cut_in_on_sq) {
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
switch2 = 12.0*rsq * (cut_ljsq-rsq) *
(rsq-cut_lj_innersq) / denom_lj;
philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
forcelj = forcelj*switch1 + philj*switch2;
}
}
fpair = (forcecoul + factor_lj*forcelj) * r2inv;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,ecoul,fpair,delx,dely,delz);
}
}
}
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairLJCharmmCoulLong::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(eps14,n+1,n+1,"pair:eps14");
memory->create(sigma14,n+1,n+1,"pair:sigma14");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(lj14_1,n+1,n+1,"pair:lj14_1");
memory->create(lj14_2,n+1,n+1,"pair:lj14_2");
memory->create(lj14_3,n+1,n+1,"pair:lj14_3");
memory->create(lj14_4,n+1,n+1,"pair:lj14_4");
}
/* ----------------------------------------------------------------------
global settings
unlike other pair styles,
there are no individual pair settings that these override
------------------------------------------------------------------------- */
void PairLJCharmmCoulLong::settings(int narg, char **arg)
{
if (narg != 2 && narg != 3) error->all(FLERR,"Illegal pair_style command");
cut_lj_inner = force->numeric(arg[0]);
cut_lj = force->numeric(arg[1]);
if (narg == 2) cut_coul = cut_lj;
else cut_coul = force->numeric(arg[2]);
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairLJCharmmCoulLong::coeff(int narg, char **arg)
{
if (narg != 4 && narg != 6) error->all(FLERR,"Illegal pair_coeff command");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double eps14_one = epsilon_one;
double sigma14_one = sigma_one;
if (narg == 6) {
eps14_one = force->numeric(arg[4]);
sigma14_one = force->numeric(arg[5]);
}
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
epsilon[i][j] = epsilon_one;
sigma[i][j] = sigma_one;
eps14[i][j] = eps14_one;
sigma14[i][j] = sigma14_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairLJCharmmCoulLong::init_style()
{
if (!atom->q_flag)
error->all(FLERR,"Pair style lj/charmm/coul/long requires atom attribute q");
// request regular or rRESPA neighbor lists
int irequest;
if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
int respa = 0;
if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
if (respa == 0) irequest = neighbor->request(this);
else if (respa == 1) {
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 1;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respainner = 1;
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 3;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respaouter = 1;
} else {
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 1;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respainner = 1;
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 2;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respamiddle = 1;
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 3;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respaouter = 1;
}
} else irequest = neighbor->request(this);
// require cut_lj_inner < cut_lj
if (cut_lj_inner >= cut_lj)
error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
cut_lj_innersq = cut_lj_inner * cut_lj_inner;
cut_ljsq = cut_lj * cut_lj;
cut_coulsq = cut_coul * cut_coul;
cut_bothsq = MAX(cut_ljsq,cut_coulsq);
denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) *
(cut_ljsq-cut_lj_innersq);
// set & error check interior rRESPA cutoffs
if (strstr(update->integrate_style,"respa") &&
((Respa *) update->integrate)->level_inner >= 0) {
cut_respa = ((Respa *) update->integrate)->cutoff;
if (MIN(cut_lj,cut_coul) < cut_respa[3])
error->all(FLERR,"Pair cutoff < Respa interior cutoff");
if (cut_lj_inner < cut_respa[1])
error->all(FLERR,"Pair inner cutoff < Respa interior cutoff");
} else cut_respa = NULL;
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
// setup force tables
if (ncoultablebits) init_tables();
}
/* ----------------------------------------------------------------------
neighbor callback to inform pair style of neighbor list to use
regular or rRESPA
------------------------------------------------------------------------- */
void PairLJCharmmCoulLong::init_list(int id, NeighList *ptr)
{
if (id == 0) list = ptr;
else if (id == 1) listinner = ptr;
else if (id == 2) listmiddle = ptr;
else if (id == 3) listouter = ptr;
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairLJCharmmCoulLong::init_one(int i, int j)
{
if (setflag[i][j] == 0) {
epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
sigma[i][i],sigma[j][j]);
sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
eps14[i][j] = mix_energy(eps14[i][i],eps14[j][j],
sigma14[i][i],sigma14[j][j]);
sigma14[i][j] = mix_distance(sigma14[i][i],sigma14[j][j]);
}
double cut = MAX(cut_lj,cut_coul);
lj1[i][j] = 48.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
lj2[i][j] = 24.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
lj14_1[i][j] = 48.0 * eps14[i][j] * pow(sigma14[i][j],12.0);
lj14_2[i][j] = 24.0 * eps14[i][j] * pow(sigma14[i][j],6.0);
lj14_3[i][j] = 4.0 * eps14[i][j] * pow(sigma14[i][j],12.0);
lj14_4[i][j] = 4.0 * eps14[i][j] * pow(sigma14[i][j],6.0);
lj1[j][i] = lj1[i][j];
lj2[j][i] = lj2[i][j];
lj3[j][i] = lj3[i][j];
lj4[j][i] = lj4[i][j];
lj14_1[j][i] = lj14_1[i][j];
lj14_2[j][i] = lj14_2[i][j];
lj14_3[j][i] = lj14_3[i][j];
lj14_4[j][i] = lj14_4[i][j];
return cut;
}
/* ----------------------------------------------------------------------
setup force tables used in compute routines
------------------------------------------------------------------------- */
void PairLJCharmmCoulLong::init_tables()
{
int masklo,maskhi;
double r,grij,expm2,derfc,rsw;
double qqrd2e = force->qqrd2e;
tabinnersq = tabinner*tabinner;
init_bitmap(tabinner,cut_coul,ncoultablebits,
masklo,maskhi,ncoulmask,ncoulshiftbits);
int ntable = 1;
for (int i = 0; i < ncoultablebits; i++) ntable *= 2;
// linear lookup tables of length N = 2^ncoultablebits
// stored value = value at lower edge of bin
// d values = delta from lower edge to upper edge of bin
if (ftable) free_tables();
memory->create(rtable,ntable,"pair:rtable");
memory->create(ftable,ntable,"pair:ftable");
memory->create(ctable,ntable,"pair:ctable");
memory->create(etable,ntable,"pair:etable");
memory->create(drtable,ntable,"pair:drtable");
memory->create(dftable,ntable,"pair:dftable");
memory->create(dctable,ntable,"pair:dctable");
memory->create(detable,ntable,"pair:detable");
if (cut_respa == NULL) {
vtable = ptable = dvtable = dptable = NULL;
} else {
memory->create(vtable,ntable,"pair:vtable");
memory->create(ptable,ntable,"pair:ptable");
memory->create(dvtable,ntable,"pair:dvtable");
memory->create(dptable,ntable,"pair:dptable");
}
union_int_float_t rsq_lookup;
union_int_float_t minrsq_lookup;
int itablemin;
minrsq_lookup.i = 0 << ncoulshiftbits;
minrsq_lookup.i |= maskhi;
for (int i = 0; i < ntable; i++) {
rsq_lookup.i = i << ncoulshiftbits;
rsq_lookup.i |= masklo;
if (rsq_lookup.f < tabinnersq) {
rsq_lookup.i = i << ncoulshiftbits;
rsq_lookup.i |= maskhi;
}
r = sqrtf(rsq_lookup.f);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
derfc = erfc(grij);
if (cut_respa == NULL) {
rtable[i] = rsq_lookup.f;
ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
ctable[i] = qqrd2e/r;
etable[i] = qqrd2e/r * derfc;
} else {
rtable[i] = rsq_lookup.f;
ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2 - 1.0);
ctable[i] = 0.0;
etable[i] = qqrd2e/r * derfc;
ptable[i] = qqrd2e/r;
vtable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
} else {
ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
ctable[i] = qqrd2e/r;
}
}
}
minrsq_lookup.f = MIN(minrsq_lookup.f,rsq_lookup.f);
}
tabinnersq = minrsq_lookup.f;
int ntablem1 = ntable - 1;
for (int i = 0; i < ntablem1; i++) {
drtable[i] = 1.0/(rtable[i+1] - rtable[i]);
dftable[i] = ftable[i+1] - ftable[i];
dctable[i] = ctable[i+1] - ctable[i];
detable[i] = etable[i+1] - etable[i];
}
if (cut_respa) {
for (int i = 0; i < ntablem1; i++) {
dvtable[i] = vtable[i+1] - vtable[i];
dptable[i] = ptable[i+1] - ptable[i];
}
}
// get the delta values for the last table entries
// tables are connected periodically between 0 and ntablem1
drtable[ntablem1] = 1.0/(rtable[0] - rtable[ntablem1]);
dftable[ntablem1] = ftable[0] - ftable[ntablem1];
dctable[ntablem1] = ctable[0] - ctable[ntablem1];
detable[ntablem1] = etable[0] - etable[ntablem1];
if (cut_respa) {
dvtable[ntablem1] = vtable[0] - vtable[ntablem1];
dptable[ntablem1] = ptable[0] - ptable[ntablem1];
}
// get the correct delta values at itablemax
// smallest r is in bin itablemin
// largest r is in bin itablemax, which is itablemin-1,
// or ntablem1 if itablemin=0
// deltas at itablemax only needed if corresponding rsq < cut*cut
// if so, compute deltas between rsq and cut*cut
double f_tmp,c_tmp,e_tmp,p_tmp,v_tmp;
itablemin = minrsq_lookup.i & ncoulmask;
itablemin >>= ncoulshiftbits;
int itablemax = itablemin - 1;
if (itablemin == 0) itablemax = ntablem1;
rsq_lookup.i = itablemax << ncoulshiftbits;
rsq_lookup.i |= maskhi;
if (rsq_lookup.f < cut_coulsq) {
rsq_lookup.f = cut_coulsq;
r = sqrtf(rsq_lookup.f);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
derfc = erfc(grij);
if (cut_respa == NULL) {
f_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
c_tmp = qqrd2e/r;
e_tmp = qqrd2e/r * derfc;
} else {
f_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2 - 1.0);
c_tmp = 0.0;
e_tmp = qqrd2e/r * derfc;
p_tmp = qqrd2e/r;
v_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
f_tmp += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
c_tmp = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
} else {
f_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
c_tmp = qqrd2e/r;
}
}
}
drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);
dftable[itablemax] = f_tmp - ftable[itablemax];
dctable[itablemax] = c_tmp - ctable[itablemax];
detable[itablemax] = e_tmp - etable[itablemax];
if (cut_respa) {
dvtable[itablemax] = v_tmp - vtable[itablemax];
dptable[itablemax] = p_tmp - ptable[itablemax];
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairLJCharmmCoulLong::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&epsilon[i][j],sizeof(double),1,fp);
fwrite(&sigma[i][j],sizeof(double),1,fp);
fwrite(&eps14[i][j],sizeof(double),1,fp);
fwrite(&sigma14[i][j],sizeof(double),1,fp);
}
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairLJCharmmCoulLong::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
fread(&epsilon[i][j],sizeof(double),1,fp);
fread(&sigma[i][j],sizeof(double),1,fp);
fread(&eps14[i][j],sizeof(double),1,fp);
fread(&sigma14[i][j],sizeof(double),1,fp);
}
MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&eps14[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&sigma14[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairLJCharmmCoulLong::write_restart_settings(FILE *fp)
{
fwrite(&cut_lj_inner,sizeof(double),1,fp);
fwrite(&cut_lj,sizeof(double),1,fp);
fwrite(&cut_coul,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairLJCharmmCoulLong::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&cut_lj_inner,sizeof(double),1,fp);
fread(&cut_lj,sizeof(double),1,fp);
fread(&cut_coul,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ----------------------------------------------------------------------
free memory for tables used in pair computations
------------------------------------------------------------------------- */
void PairLJCharmmCoulLong::free_tables()
{
memory->destroy(rtable);
memory->destroy(drtable);
memory->destroy(ftable);
memory->destroy(dftable);
memory->destroy(ctable);
memory->destroy(dctable);
memory->destroy(etable);
memory->destroy(detable);
memory->destroy(vtable);
memory->destroy(dvtable);
memory->destroy(ptable);
memory->destroy(dptable);
}
/* ---------------------------------------------------------------------- */
double PairLJCharmmCoulLong::single(int i, int j, int itype, int jtype,
double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double r2inv,r6inv,r,grij,expm2,t,erfc,prefactor;
double switch1,switch2,fraction,table,forcecoul,forcelj,phicoul,philj;
int itable;
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = force->qqrd2e * atom->q[i]*atom->q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
itable = rsq_lookup.i & ncoulmask;
itable >>= ncoulshiftbits;
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = atom->q[i]*atom->q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = atom->q[i]*atom->q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
} else forcecoul = 0.0;
if (rsq < cut_ljsq) {
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
switch2 = 12.0*rsq * (cut_ljsq-rsq) *
(rsq-cut_lj_innersq) / denom_lj;
philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
forcelj = forcelj*switch1 + philj*switch2;
}
} else forcelj = 0.0;
fforce = (forcecoul + factor_lj*forcelj) * r2inv;
double eng = 0.0;
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq)
phicoul = prefactor*erfc;
else {
table = etable[itable] + fraction*detable[itable];
phicoul = atom->q[i]*atom->q[j] * table;
}
if (factor_coul < 1.0) phicoul -= (1.0-factor_coul)*prefactor;
eng += phicoul;
}
if (rsq < cut_ljsq) {
philj = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
philj *= switch1;
}
eng += factor_lj*philj;
}
return eng;
}
/* ---------------------------------------------------------------------- */
-void *PairLJCharmmCoulLong::extract(char *str, int &dim)
+void *PairLJCharmmCoulLong::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str,"lj14_1") == 0) return (void *) lj14_1;
if (strcmp(str,"lj14_2") == 0) return (void *) lj14_2;
if (strcmp(str,"lj14_3") == 0) return (void *) lj14_3;
if (strcmp(str,"lj14_4") == 0) return (void *) lj14_4;
dim = 0;
if (strcmp(str,"implicit") == 0) return (void *) &implicit;
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
return NULL;
}
diff --git a/src/KSPACE/pair_lj_charmm_coul_long.h b/src/KSPACE/pair_lj_charmm_coul_long.h
index 515d5d429..47cf005d7 100644
--- a/src/KSPACE/pair_lj_charmm_coul_long.h
+++ b/src/KSPACE/pair_lj_charmm_coul_long.h
@@ -1,75 +1,112 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/charmm/coul/long,PairLJCharmmCoulLong)
#else
#ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_H
#define LMP_PAIR_LJ_CHARMM_COUL_LONG_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJCharmmCoulLong : public Pair {
public:
PairLJCharmmCoulLong(class LAMMPS *);
virtual ~PairLJCharmmCoulLong();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
void init_list(int, class NeighList *);
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 &);
void compute_inner();
void compute_middle();
void compute_outer(int, int);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
int implicit;
double cut_lj_inner,cut_lj;
double cut_lj_innersq,cut_ljsq;
double cut_coul,cut_coulsq;
double cut_bothsq;
double denom_lj;
double **epsilon,**sigma,**eps14,**sigma14;
double **lj1,**lj2,**lj3,**lj4,**offset;
double **lj14_1,**lj14_2,**lj14_3,**lj14_4;
double *cut_respa;
double g_ewald;
double tabinnersq;
double *rtable,*drtable,*ftable,*dftable,*ctable,*dctable;
double *etable,*detable,*ptable,*dptable,*vtable,*dvtable;
int ncoulshiftbits,ncoulmask;
void allocate();
void init_tables();
void free_tables();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style lj/charmm/coul/long requires atom attribute q
+
+The atom style defined does not have these attributes.
+
+E: Pair inner cutoff >= Pair outer cutoff
+
+The specified cutoffs for the pair style are inconsistent.
+
+E: Pair cutoff < Respa interior cutoff
+
+One or more pairwise cutoffs are too short to use with the specified
+rRESPA cutoffs.
+
+E: Pair inner cutoff < Respa interior cutoff
+
+One or more pairwise cutoffs are too short to use with the specified
+rRESPA cutoffs.
+
+E: Pair style is incompatible with KSpace style
+
+If a pair style with a long-range Coulombic component is selected,
+then a kspace style must also be used.
+
+*/
diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp
index ff8fb1fd2..1b619974d 100644
--- a/src/KSPACE/pair_lj_cut_coul_long.cpp
+++ b/src/KSPACE/pair_lj_cut_coul_long.cpp
@@ -1,1130 +1,1130 @@
/* ----------------------------------------------------------------------
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: Paul Crozier (SNL)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_lj_cut_coul_long.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "kspace.h"
#include "update.h"
#include "integrate.h"
#include "respa.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
/* ---------------------------------------------------------------------- */
PairLJCutCoulLong::PairLJCutCoulLong(LAMMPS *lmp) : Pair(lmp)
{
respa_enable = 1;
ftable = NULL;
}
/* ---------------------------------------------------------------------- */
PairLJCutCoulLong::~PairLJCutCoulLong()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
if (ftable) free_tables();
}
/* ---------------------------------------------------------------------- */
void PairLJCutCoulLong::compute(int eflag, int vflag)
{
int i,ii,j,jj,inum,jnum,itype,jtype,itable;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
double fraction,table;
double r,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
double grij,expm2,prefactor,t,erfc;
int *ilist,*jlist,*numneigh,**firstneigh;
double rsq;
evdwl = ecoul = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
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];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = qqrd2e * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
itable = rsq_lookup.i & ncoulmask;
itable >>= ncoulshiftbits;
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = qtmp*q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
} else forcecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
} else forcelj = 0.0;
fpair = (forcecoul + factor_lj*forcelj) * r2inv;
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) {
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq)
ecoul = prefactor*erfc;
else {
table = etable[itable] + fraction*detable[itable];
ecoul = qtmp*q[j] * table;
}
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
} else ecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
offset[itype][jtype];
evdwl *= factor_lj;
} else evdwl = 0.0;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,ecoul,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ---------------------------------------------------------------------- */
void PairLJCutCoulLong::compute_inner()
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,fpair;
double rsq,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
double rsw;
int *ilist,*jlist,*numneigh,**firstneigh;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
inum = listinner->inum;
ilist = listinner->ilist;
numneigh = listinner->numneigh;
firstneigh = listinner->firstneigh;
double cut_out_on = cut_respa[0];
double cut_out_off = cut_respa[1];
double cut_out_diff = cut_out_off - cut_out_on;
double cut_out_on_sq = cut_out_on*cut_out_on;
double cut_out_off_sq = cut_out_off*cut_out_off;
// loop over neighbors of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
if (rsq < cut_out_off_sq) {
r2inv = 1.0/rsq;
forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*forcecoul;
jtype = type[j];
if (rsq < cut_ljsq[itype][jtype]) {
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
} else forcelj = 0.0;
fpair = (forcecoul + factor_lj*forcelj) * r2inv;
if (rsq > cut_out_on_sq) {
rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
fpair *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
}
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;
}
}
}
}
}
/* ---------------------------------------------------------------------- */
void PairLJCutCoulLong::compute_middle()
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,fpair;
double rsq,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
double rsw;
int *ilist,*jlist,*numneigh,**firstneigh;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
inum = listmiddle->inum;
ilist = listmiddle->ilist;
numneigh = listmiddle->numneigh;
firstneigh = listmiddle->firstneigh;
double cut_in_off = cut_respa[0];
double cut_in_on = cut_respa[1];
double cut_out_on = cut_respa[2];
double cut_out_off = cut_respa[3];
double cut_in_diff = cut_in_on - cut_in_off;
double cut_out_diff = cut_out_off - cut_out_on;
double cut_in_off_sq = cut_in_off*cut_in_off;
double cut_in_on_sq = cut_in_on*cut_in_on;
double cut_out_on_sq = cut_out_on*cut_out_on;
double cut_out_off_sq = cut_out_off*cut_out_off;
// loop over neighbors of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
if (rsq < cut_out_off_sq && rsq > cut_in_off_sq) {
r2inv = 1.0/rsq;
forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*forcecoul;
jtype = type[j];
if (rsq < cut_ljsq[itype][jtype]) {
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
} else forcelj = 0.0;
fpair = (forcecoul + factor_lj*forcelj) * r2inv;
if (rsq < cut_in_on_sq) {
rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
fpair *= rsw*rsw*(3.0 - 2.0*rsw);
}
if (rsq > cut_out_on_sq) {
rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
}
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;
}
}
}
}
}
/* ---------------------------------------------------------------------- */
void PairLJCutCoulLong::compute_outer(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype,itable;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
double fraction,table;
double r,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
double grij,expm2,prefactor,t,erfc;
double rsw;
int *ilist,*jlist,*numneigh,**firstneigh;
double rsq;
evdwl = ecoul = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = 0;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
inum = listouter->inum;
ilist = listouter->ilist;
numneigh = listouter->numneigh;
firstneigh = listouter->firstneigh;
double cut_in_off = cut_respa[2];
double cut_in_on = cut_respa[3];
double cut_in_diff = cut_in_on - cut_in_off;
double cut_in_off_sq = cut_in_off*cut_in_off;
double cut_in_on_sq = cut_in_on*cut_in_on;
// loop over neighbors of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = qqrd2e * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2 - 1.0);
if (rsq > cut_in_off_sq) {
if (rsq < cut_in_on_sq) {
rsw = (r - cut_in_off)/cut_in_diff;
forcecoul += prefactor*rsw*rsw*(3.0 - 2.0*rsw);
if (factor_coul < 1.0)
forcecoul -= (1.0-factor_coul)*prefactor*rsw*rsw*(3.0 - 2.0*rsw);
} else {
forcecoul += prefactor;
if (factor_coul < 1.0)
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
itable = rsq_lookup.i & ncoulmask;
itable >>= ncoulshiftbits;
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = qtmp*q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
} else forcecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype] && rsq > cut_in_off_sq) {
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
if (rsq < cut_in_on_sq) {
rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
forcelj *= rsw*rsw*(3.0 - 2.0*rsw);
}
} else forcelj = 0.0;
fpair = (forcecoul + forcelj) * r2inv;
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) {
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq) {
ecoul = prefactor*erfc;
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
} else {
table = etable[itable] + fraction*detable[itable];
ecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ptable[itable] + fraction*dptable[itable];
prefactor = qtmp*q[j] * table;
ecoul -= (1.0-factor_coul)*prefactor;
}
}
} else ecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
r6inv = r2inv*r2inv*r2inv;
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
offset[itype][jtype];
evdwl *= factor_lj;
} else evdwl = 0.0;
}
if (vflag) {
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq) {
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else {
table = vtable[itable] + fraction*dvtable[itable];
forcecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ptable[itable] + fraction*dptable[itable];
prefactor = qtmp*q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
} else forcecoul = 0.0;
if (rsq <= cut_in_off_sq) {
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
} else if (rsq <= cut_in_on_sq)
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
fpair = (forcecoul + factor_lj*forcelj) * r2inv;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,ecoul,fpair,delx,dely,delz);
}
}
}
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairLJCutCoulLong::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut_lj,n+1,n+1,"pair:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"pair:cut_ljsq");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairLJCutCoulLong::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul = cut_lj_global;
else cut_coul = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairLJCutCoulLong::coeff(int narg, char **arg)
{
if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_lj_one = cut_lj_global;
if (narg == 5) cut_lj_one = force->numeric(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
epsilon[i][j] = epsilon_one;
sigma[i][j] = sigma_one;
cut_lj[i][j] = cut_lj_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairLJCutCoulLong::init_style()
{
if (!atom->q_flag)
error->all(FLERR,"Pair style lj/cut/coul/long requires atom attribute q");
// request regular or rRESPA neighbor lists
int irequest;
if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
int respa = 0;
if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
if (respa == 0) irequest = neighbor->request(this);
else if (respa == 1) {
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 1;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respainner = 1;
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 3;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respaouter = 1;
} else {
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 1;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respainner = 1;
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 2;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respamiddle = 1;
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 3;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respaouter = 1;
}
} else irequest = neighbor->request(this);
cut_coulsq = cut_coul * cut_coul;
// set rRESPA cutoffs
if (strstr(update->integrate_style,"respa") &&
((Respa *) update->integrate)->level_inner >= 0)
cut_respa = ((Respa *) update->integrate)->cutoff;
else cut_respa = NULL;
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
// setup force tables
if (ncoultablebits) init_tables();
}
/* ----------------------------------------------------------------------
neighbor callback to inform pair style of neighbor list to use
regular or rRESPA
------------------------------------------------------------------------- */
void PairLJCutCoulLong::init_list(int id, NeighList *ptr)
{
if (id == 0) list = ptr;
else if (id == 1) listinner = ptr;
else if (id == 2) listmiddle = ptr;
else if (id == 3) listouter = ptr;
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairLJCutCoulLong::init_one(int i, int j)
{
if (setflag[i][j] == 0) {
epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
sigma[i][i],sigma[j][j]);
sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
cut_lj[i][j] = mix_distance(cut_lj[i][i],cut_lj[j][j]);
}
double cut = MAX(cut_lj[i][j],cut_coul);
cut_ljsq[i][j] = cut_lj[i][j] * cut_lj[i][j];
lj1[i][j] = 48.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
lj2[i][j] = 24.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
if (offset_flag) {
double ratio = sigma[i][j] / cut_lj[i][j];
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
} else offset[i][j] = 0.0;
cut_ljsq[j][i] = cut_ljsq[i][j];
lj1[j][i] = lj1[i][j];
lj2[j][i] = lj2[i][j];
lj3[j][i] = lj3[i][j];
lj4[j][i] = lj4[i][j];
offset[j][i] = offset[i][j];
// check interior rRESPA cutoff
if (cut_respa && MIN(cut_lj[i][j],cut_coul) < cut_respa[3])
error->all(FLERR,"Pair cutoff < Respa interior cutoff");
// compute I,J contribution to long-range tail correction
// count total # of atoms of type I and J via Allreduce
if (tail_flag) {
int *type = atom->type;
int nlocal = atom->nlocal;
double count[2],all[2];
count[0] = count[1] = 0.0;
for (int k = 0; k < nlocal; k++) {
if (type[k] == i) count[0] += 1.0;
if (type[k] == j) count[1] += 1.0;
}
MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
double sig2 = sigma[i][j]*sigma[i][j];
double sig6 = sig2*sig2*sig2;
double rc3 = cut_lj[i][j]*cut_lj[i][j]*cut_lj[i][j];
double rc6 = rc3*rc3;
double rc9 = rc3*rc6;
etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
sig6 * (sig6 - 3.0*rc6) / (9.0*rc9);
ptail_ij = 16.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
sig6 * (2.0*sig6 - 3.0*rc6) / (9.0*rc9);
}
return cut;
}
/* ----------------------------------------------------------------------
setup force tables used in compute routines
------------------------------------------------------------------------- */
void PairLJCutCoulLong::init_tables()
{
int masklo,maskhi;
double r,grij,expm2,derfc,rsw;
double qqrd2e = force->qqrd2e;
tabinnersq = tabinner*tabinner;
init_bitmap(tabinner,cut_coul,ncoultablebits,
masklo,maskhi,ncoulmask,ncoulshiftbits);
int ntable = 1;
for (int i = 0; i < ncoultablebits; i++) ntable *= 2;
// linear lookup tables of length N = 2^ncoultablebits
// stored value = value at lower edge of bin
// d values = delta from lower edge to upper edge of bin
if (ftable) free_tables();
memory->create(rtable,ntable,"pair:rtable");
memory->create(ftable,ntable,"pair:ftable");
memory->create(ctable,ntable,"pair:ctable");
memory->create(etable,ntable,"pair:etable");
memory->create(drtable,ntable,"pair:drtable");
memory->create(dftable,ntable,"pair:dftable");
memory->create(dctable,ntable,"pair:dctable");
memory->create(detable,ntable,"pair:detable");
if (cut_respa == NULL) {
vtable = ptable = dvtable = dptable = NULL;
} else {
memory->create(vtable,ntable*sizeof(double),"pair:vtable");
memory->create(ptable,ntable*sizeof(double),"pair:ptable");
memory->create(dvtable,ntable*sizeof(double),"pair:dvtable");
memory->create(dptable,ntable*sizeof(double),"pair:dptable");
}
union_int_float_t rsq_lookup;
union_int_float_t minrsq_lookup;
int itablemin;
minrsq_lookup.i = 0 << ncoulshiftbits;
minrsq_lookup.i |= maskhi;
for (int i = 0; i < ntable; i++) {
rsq_lookup.i = i << ncoulshiftbits;
rsq_lookup.i |= masklo;
if (rsq_lookup.f < tabinnersq) {
rsq_lookup.i = i << ncoulshiftbits;
rsq_lookup.i |= maskhi;
}
r = sqrtf(rsq_lookup.f);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
derfc = erfc(grij);
if (cut_respa == NULL) {
rtable[i] = rsq_lookup.f;
ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
ctable[i] = qqrd2e/r;
etable[i] = qqrd2e/r * derfc;
} else {
rtable[i] = rsq_lookup.f;
ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2 - 1.0);
ctable[i] = 0.0;
etable[i] = qqrd2e/r * derfc;
ptable[i] = qqrd2e/r;
vtable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
} else {
ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
ctable[i] = qqrd2e/r;
}
}
}
minrsq_lookup.f = MIN(minrsq_lookup.f,rsq_lookup.f);
}
tabinnersq = minrsq_lookup.f;
int ntablem1 = ntable - 1;
for (int i = 0; i < ntablem1; i++) {
drtable[i] = 1.0/(rtable[i+1] - rtable[i]);
dftable[i] = ftable[i+1] - ftable[i];
dctable[i] = ctable[i+1] - ctable[i];
detable[i] = etable[i+1] - etable[i];
}
if (cut_respa) {
for (int i = 0; i < ntablem1; i++) {
dvtable[i] = vtable[i+1] - vtable[i];
dptable[i] = ptable[i+1] - ptable[i];
}
}
// get the delta values for the last table entries
// tables are connected periodically between 0 and ntablem1
drtable[ntablem1] = 1.0/(rtable[0] - rtable[ntablem1]);
dftable[ntablem1] = ftable[0] - ftable[ntablem1];
dctable[ntablem1] = ctable[0] - ctable[ntablem1];
detable[ntablem1] = etable[0] - etable[ntablem1];
if (cut_respa) {
dvtable[ntablem1] = vtable[0] - vtable[ntablem1];
dptable[ntablem1] = ptable[0] - ptable[ntablem1];
}
// get the correct delta values at itablemax
// smallest r is in bin itablemin
// largest r is in bin itablemax, which is itablemin-1,
// or ntablem1 if itablemin=0
// deltas at itablemax only needed if corresponding rsq < cut*cut
// if so, compute deltas between rsq and cut*cut
double f_tmp,c_tmp,e_tmp,p_tmp,v_tmp;
itablemin = minrsq_lookup.i & ncoulmask;
itablemin >>= ncoulshiftbits;
int itablemax = itablemin - 1;
if (itablemin == 0) itablemax = ntablem1;
rsq_lookup.i = itablemax << ncoulshiftbits;
rsq_lookup.i |= maskhi;
if (rsq_lookup.f < cut_coulsq) {
rsq_lookup.f = cut_coulsq;
r = sqrtf(rsq_lookup.f);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
derfc = erfc(grij);
if (cut_respa == NULL) {
f_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
c_tmp = qqrd2e/r;
e_tmp = qqrd2e/r * derfc;
} else {
f_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2 - 1.0);
c_tmp = 0.0;
e_tmp = qqrd2e/r * derfc;
p_tmp = qqrd2e/r;
v_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
f_tmp += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
c_tmp = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
} else {
f_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
c_tmp = qqrd2e/r;
}
}
}
drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);
dftable[itablemax] = f_tmp - ftable[itablemax];
dctable[itablemax] = c_tmp - ctable[itablemax];
detable[itablemax] = e_tmp - etable[itablemax];
if (cut_respa) {
dvtable[itablemax] = v_tmp - vtable[itablemax];
dptable[itablemax] = p_tmp - ptable[itablemax];
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairLJCutCoulLong::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&epsilon[i][j],sizeof(double),1,fp);
fwrite(&sigma[i][j],sizeof(double),1,fp);
fwrite(&cut_lj[i][j],sizeof(double),1,fp);
}
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairLJCutCoulLong::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
fread(&epsilon[i][j],sizeof(double),1,fp);
fread(&sigma[i][j],sizeof(double),1,fp);
fread(&cut_lj[i][j],sizeof(double),1,fp);
}
MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairLJCutCoulLong::write_restart_settings(FILE *fp)
{
fwrite(&cut_lj_global,sizeof(double),1,fp);
fwrite(&cut_coul,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairLJCutCoulLong::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&cut_lj_global,sizeof(double),1,fp);
fread(&cut_coul,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ----------------------------------------------------------------------
free memory for tables used in pair computations
------------------------------------------------------------------------- */
void PairLJCutCoulLong::free_tables()
{
memory->destroy(rtable);
memory->destroy(drtable);
memory->destroy(ftable);
memory->destroy(dftable);
memory->destroy(ctable);
memory->destroy(dctable);
memory->destroy(etable);
memory->destroy(detable);
memory->destroy(vtable);
memory->destroy(dvtable);
memory->destroy(ptable);
memory->destroy(dptable);
}
/* ---------------------------------------------------------------------- */
double PairLJCutCoulLong::single(int i, int j, int itype, int jtype,
double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double r2inv,r6inv,r,grij,expm2,t,erfc,prefactor;
double fraction,table,forcecoul,forcelj,phicoul,philj;
int itable;
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = force->qqrd2e * atom->q[i]*atom->q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else {
union_int_float_t rsq_lookup_single;
rsq_lookup_single.f = rsq;
itable = rsq_lookup_single.i & ncoulmask;
itable >>= ncoulshiftbits;
fraction = (rsq_lookup_single.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = atom->q[i]*atom->q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = atom->q[i]*atom->q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
} else forcecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
} else forcelj = 0.0;
fforce = (forcecoul + factor_lj*forcelj) * r2inv;
double eng = 0.0;
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq)
phicoul = prefactor*erfc;
else {
table = etable[itable] + fraction*detable[itable];
phicoul = atom->q[i]*atom->q[j] * table;
}
if (factor_coul < 1.0) phicoul -= (1.0-factor_coul)*prefactor;
eng += phicoul;
}
if (rsq < cut_ljsq[itype][jtype]) {
philj = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
offset[itype][jtype];
eng += factor_lj*philj;
}
return eng;
}
/* ---------------------------------------------------------------------- */
-void *PairLJCutCoulLong::extract(char *str, int &dim)
+void *PairLJCutCoulLong::extract(const char *str, int &dim)
{
dim = 0;
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
return NULL;
}
diff --git a/src/KSPACE/pair_lj_cut_coul_long.h b/src/KSPACE/pair_lj_cut_coul_long.h
index 585f0ddb5..5ba9c1360 100644
--- a/src/KSPACE/pair_lj_cut_coul_long.h
+++ b/src/KSPACE/pair_lj_cut_coul_long.h
@@ -1,70 +1,98 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/cut/coul/long,PairLJCutCoulLong)
#else
#ifndef LMP_PAIR_LJ_CUT_COUL_LONG_H
#define LMP_PAIR_LJ_CUT_COUL_LONG_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJCutCoulLong : public Pair {
public:
PairLJCutCoulLong(class LAMMPS *);
virtual ~PairLJCutCoulLong();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
virtual void init_style();
void init_list(int, class NeighList *);
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
virtual void read_restart_settings(FILE *);
virtual double single(int, int, int, int, double, double, double, double &);
void compute_inner();
void compute_middle();
void compute_outer(int, int);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
double cut_lj_global;
double **cut_lj,**cut_ljsq;
double cut_coul,cut_coulsq;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
double *cut_respa;
double g_ewald;
double tabinnersq;
double *rtable,*drtable,*ftable,*dftable,*ctable,*dctable;
double *etable,*detable,*ptable,*dptable,*vtable,*dvtable;
int ncoulshiftbits,ncoulmask;
void allocate();
void init_tables();
void free_tables();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style lj/cut/coul/long requires atom attribute q
+
+The atom style defined does not have this attribute.
+
+E: Pair style is incompatible with KSpace style
+
+If a pair style with a long-range Coulombic component is selected,
+then a kspace style must also be used.
+
+E: Pair cutoff < Respa interior cutoff
+
+One or more pairwise cutoffs are too short to use with the specified
+rRESPA cutoffs.
+
+*/
diff --git a/src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp b/src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp
index ece15c683..0ed7d439a 100644
--- a/src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp
+++ b/src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp
@@ -1,516 +1,516 @@
/* ----------------------------------------------------------------------
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: Amalie Frischknecht and Ahmed Ismail (SNL)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_lj_cut_coul_long_tip4p.h"
#include "angle.h"
#include "atom.h"
#include "bond.h"
#include "comm.h"
#include "domain.h"
#include "force.h"
#include "kspace.h"
#include "update.h"
#include "respa.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
/* ---------------------------------------------------------------------- */
PairLJCutCoulLongTIP4P::PairLJCutCoulLongTIP4P(LAMMPS *lmp) :
PairLJCutCoulLong(lmp)
{
single_enable = 0;
respa_enable = 0;
// TIP4P cannot compute virial as F dot r
// due to find_M() finding bonded H atoms which are not near O atom
no_virial_fdotr_compute = 1;
}
/* ---------------------------------------------------------------------- */
void PairLJCutCoulLongTIP4P::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype,itable;
int n,vlist[6];
int iH1,iH2,jH1,jH2;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
double fraction,table;
double delxOM, delyOM, delzOM;
double r,r2inv,r6inv,forcecoul,forcelj,cforce;
double factor_coul,factor_lj;
double grij,expm2,prefactor,t,erfc,ddotf;
double xiM[3],xjM[3],fO[3],fH[3],fd[3],f1[3],v[6],xH1[3],xH2[3];
double *x1,*x2;
int *ilist,*jlist,*numneigh,**firstneigh;
double rsq;
evdwl = ecoul = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
double **f = atom->f;
double **x = atom->x;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
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];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
if (itype == typeO) {
find_M(i,iH1,iH2,xiM);
x1 = xiM;
} else x1 = x[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
r2inv = 1.0/rsq;
if (rsq < cut_ljsq[itype][jtype]) {
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
forcelj *= factor_lj * r2inv;
f[i][0] += delx*forcelj;
f[i][1] += dely*forcelj;
f[i][2] += delz*forcelj;
f[j][0] -= delx*forcelj;
f[j][1] -= dely*forcelj;
f[j][2] -= delz*forcelj;
if (eflag) {
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
offset[itype][jtype];
evdwl *= factor_lj;
} else evdwl = 0.0;
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,forcelj,delx,dely,delz);
}
// adjust rsq and delxyz for off-site O charge(s)
if (itype == typeO || jtype == typeO) {
if (jtype == typeO) {
find_M(j,jH1,jH2,xjM);
x2 = xjM;
} else x2 = x[j];
delx = x1[0] - x2[0];
dely = x1[1] - x2[1];
delz = x1[2] - x2[2];
rsq = delx*delx + dely*dely + delz*delz;
}
// test current rsq against cutoff and compute Coulombic force
if (rsq < cut_coulsq) {
r2inv = 1 / rsq;
if (!ncoultablebits || rsq <= tabinnersq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = qqrd2e * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) {
forcecoul -= (1.0-factor_coul)*prefactor;
}
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
itable = rsq_lookup.i & ncoulmask;
itable >>= ncoulshiftbits;
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = qtmp*q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
cforce = forcecoul * r2inv;
// if i,j are not O atoms, force is applied directly
// if i or j are O atoms, force is on fictitious atom & partitioned
// force partitioning due to Feenstra, J Comp Chem, 20, 786 (1999)
// f_f = fictitious force, fO = f_f (1 - 2 alpha), fH = alpha f_f
// preserves total force and torque on water molecule
// virial = sum(r x F) where each water's atoms are near xi and xj
// vlist stores 2,4,6 atoms whose forces contribute to virial
n = 0;
if (itype != typeO) {
f[i][0] += delx * cforce;
f[i][1] += dely * cforce;
f[i][2] += delz * cforce;
if (vflag) {
v[0] = x[i][0] * delx * cforce;
v[1] = x[i][1] * dely * cforce;
v[2] = x[i][2] * delz * cforce;
v[3] = x[i][0] * dely * cforce;
v[4] = x[i][0] * delz * cforce;
v[5] = x[i][1] * delz * cforce;
vlist[n++] = i;
}
} else {
fd[0] = delx*cforce;
fd[1] = dely*cforce;
fd[2] = delz*cforce;
delxOM = x[i][0] - x1[0];
delyOM = x[i][1] - x1[1];
delzOM = x[i][2] - x1[2];
ddotf = (delxOM * fd[0] + delyOM * fd[1] + delzOM * fd[2]) /
(qdist*qdist);
f1[0] = ddotf * delxOM;
f1[1] = ddotf * delyOM;
f1[2] = ddotf * delzOM;
fO[0] = fd[0] - alpha * (fd[0] - f1[0]);
fO[1] = fd[1] - alpha * (fd[1] - f1[1]);
fO[2] = fd[2] - alpha * (fd[2] - f1[2]);
fH[0] = 0.5 * alpha * (fd[0] - f1[0]);
fH[1] = 0.5 * alpha * (fd[1] - f1[1]);
fH[2] = 0.5 * alpha * (fd[2] - f1[2]);
f[i][0] += fO[0];
f[i][1] += fO[1];
f[i][2] += fO[2];
f[iH1][0] += fH[0];
f[iH1][1] += fH[1];
f[iH1][2] += fH[2];
f[iH2][0] += fH[0];
f[iH2][1] += fH[1];
f[iH2][2] += fH[2];
if (vflag) {
domain->closest_image(x[i],x[iH1],xH1);
domain->closest_image(x[i],x[iH2],xH2);
v[0] = x[i][0]*fO[0] + xH1[0]*fH[0] + xH2[0]*fH[0];
v[1] = x[i][1]*fO[1] + xH1[1]*fH[1] + xH2[1]*fH[1];
v[2] = x[i][2]*fO[2] + xH1[2]*fH[2] + xH2[2]*fH[2];
v[3] = x[i][0]*fO[1] + xH1[0]*fH[1] + xH2[0]*fH[1];
v[4] = x[i][0]*fO[2] + xH1[0]*fH[2] + xH2[0]*fH[2];
v[5] = x[i][1]*fO[2] + xH1[1]*fH[2] + xH2[1]*fH[2];
vlist[n++] = i;
vlist[n++] = iH1;
vlist[n++] = iH2;
}
}
if (jtype != typeO) {
f[j][0] -= delx * cforce;
f[j][1] -= dely * cforce;
f[j][2] -= delz * cforce;
if (vflag) {
v[0] -= x[j][0] * delx * cforce;
v[1] -= x[j][1] * dely * cforce;
v[2] -= x[j][2] * delz * cforce;
v[3] -= x[j][0] * dely * cforce;
v[4] -= x[j][0] * delz * cforce;
v[5] -= x[j][1] * delz * cforce;
vlist[n++] = j;
}
} else {
fd[0] = -delx*cforce;
fd[1] = -dely*cforce;
fd[2] = -delz*cforce;
delxOM = x[j][0] - x2[0];
delyOM = x[j][1] - x2[1];
delzOM = x[j][2] - x2[2];
ddotf = (delxOM * fd[0] + delyOM * fd[1] + delzOM * fd[2]) /
(qdist*qdist);
f1[0] = ddotf * delxOM;
f1[1] = ddotf * delyOM;
f1[2] = ddotf * delzOM;
fO[0] = fd[0] - alpha * (fd[0] - f1[0]);
fO[1] = fd[1] - alpha * (fd[1] - f1[1]);
fO[2] = fd[2] - alpha * (fd[2] - f1[2]);
fH[0] = 0.5 * alpha * (fd[0] - f1[0]);
fH[1] = 0.5 * alpha * (fd[1] - f1[1]);
fH[2] = 0.5 * alpha * (fd[2] - f1[2]);
f[j][0] += fO[0];
f[j][1] += fO[1];
f[j][2] += fO[2];
f[jH1][0] += fH[0];
f[jH1][1] += fH[1];
f[jH1][2] += fH[2];
f[jH2][0] += fH[0];
f[jH2][1] += fH[1];
f[jH2][2] += fH[2];
if (vflag) {
domain->closest_image(x[j],x[jH1],xH1);
domain->closest_image(x[j],x[jH2],xH2);
v[0] += x[j][0]*fO[0] + xH1[0]*fH[0] + xH2[0]*fH[0];
v[1] += x[j][1]*fO[1] + xH1[1]*fH[1] + xH2[1]*fH[1];
v[2] += x[j][2]*fO[2] + xH1[2]*fH[2] + xH2[2]*fH[2];
v[3] += x[j][0]*fO[1] + xH1[0]*fH[1] + xH2[0]*fH[1];
v[4] += x[j][0]*fO[2] + xH1[0]*fH[2] + xH2[0]*fH[2];
v[5] += x[j][1]*fO[2] + xH1[1]*fH[2] + xH2[1]*fH[2];
vlist[n++] = j;
vlist[n++] = jH1;
vlist[n++] = jH2;
}
}
if (eflag) {
if (!ncoultablebits || rsq <= tabinnersq)
ecoul = prefactor*erfc;
else {
table = etable[itable] + fraction*detable[itable];
ecoul = qtmp*q[j] * table;
}
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
} else ecoul = 0.0;
if (evflag) ev_tally_list(n,vlist,ecoul,v);
}
}
}
}
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairLJCutCoulLongTIP4P::settings(int narg, char **arg)
{
if (narg < 6 || narg > 7) error->all(FLERR,"Illegal pair_style command");
typeO = force->inumeric(arg[0]);
typeH = force->inumeric(arg[1]);
typeB = force->inumeric(arg[2]);
typeA = force->inumeric(arg[3]);
qdist = force->numeric(arg[4]);
cut_lj_global = force->numeric(arg[5]);
if (narg == 6) cut_coul = cut_lj_global;
else cut_coul = force->numeric(arg[6]);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
}
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairLJCutCoulLongTIP4P::init_style()
{
if (atom->tag_enable == 0)
error->all(FLERR,"Pair style lj/cut/coul/long/tip4p requires atom IDs");
if (!force->newton_pair)
error->all(FLERR,"Pair style lj/cut/coul/long/tip4p requires newton pair on");
if (!atom->q_flag)
error->all(FLERR,"Pair style lj/cut/coul/long/tip4p requires atom attribute q");
if ( (strcmp(force->kspace_style,"pppm/tip4p") != 0) &&
(strcmp(force->kspace_style,"pppm/tip4p/proxy") != 0) )
error->all(FLERR,"Pair style is incompatible with KSpace style");
if (force->bond == NULL)
error->all(FLERR,"Must use a bond style with TIP4P potential");
if (force->angle == NULL)
error->all(FLERR,"Must use an angle style with TIP4P potential");
PairLJCutCoulLong::init_style();
// set alpha parameter
double theta = force->angle->equilibrium_angle(typeA);
double blen = force->bond->equilibrium_distance(typeB);
alpha = qdist / (cos(0.5*theta) * blen);
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairLJCutCoulLongTIP4P::write_restart_settings(FILE *fp)
{
fwrite(&typeO,sizeof(int),1,fp);
fwrite(&typeH,sizeof(int),1,fp);
fwrite(&typeB,sizeof(int),1,fp);
fwrite(&typeA,sizeof(int),1,fp);
fwrite(&qdist,sizeof(double),1,fp);
fwrite(&cut_lj_global,sizeof(double),1,fp);
fwrite(&cut_coul,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairLJCutCoulLongTIP4P::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&typeO,sizeof(int),1,fp);
fread(&typeH,sizeof(int),1,fp);
fread(&typeB,sizeof(int),1,fp);
fread(&typeA,sizeof(int),1,fp);
fread(&qdist,sizeof(double),1,fp);
fread(&cut_lj_global,sizeof(double),1,fp);
fread(&cut_coul,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&typeO,1,MPI_INT,0,world);
MPI_Bcast(&typeH,1,MPI_INT,0,world);
MPI_Bcast(&typeB,1,MPI_INT,0,world);
MPI_Bcast(&typeA,1,MPI_INT,0,world);
MPI_Bcast(&qdist,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ----------------------------------------------------------------------
find 2 H atoms bonded to O atom i
compute position xM of fictitious charge site for O atom
also return local indices iH1,iH2 of H atoms
------------------------------------------------------------------------- */
void PairLJCutCoulLongTIP4P::find_M(int i, int &iH1, int &iH2, double *xM)
{
// test that O is correctly bonded to 2 succesive H atoms
iH1 = atom->map(atom->tag[i] + 1);
iH2 = atom->map(atom->tag[i] + 2);
if (iH1 == -1 || iH2 == -1) error->one(FLERR,"TIP4P hydrogen is missing");
if (atom->type[iH1] != typeH || atom->type[iH2] != typeH)
error->one(FLERR,"TIP4P hydrogen has incorrect atom type");
double **x = atom->x;
double delx1 = x[iH1][0] - x[i][0];
double dely1 = x[iH1][1] - x[i][1];
double delz1 = x[iH1][2] - x[i][2];
domain->minimum_image(delx1,dely1,delz1);
double delx2 = x[iH2][0] - x[i][0];
double dely2 = x[iH2][1] - x[i][1];
double delz2 = x[iH2][2] - x[i][2];
domain->minimum_image(delx2,dely2,delz2);
xM[0] = x[i][0] + alpha * 0.5 * (delx1 + delx2);
xM[1] = x[i][1] + alpha * 0.5 * (dely1 + dely2);
xM[2] = x[i][2] + alpha * 0.5 * (delz1 + delz2);
}
/* ---------------------------------------------------------------------- */
-void *PairLJCutCoulLongTIP4P::extract(char *str, int &dim)
+void *PairLJCutCoulLongTIP4P::extract(const char *str, int &dim)
{
dim = 0;
if (strcmp(str,"qdist") == 0) return (void *) &qdist;
if (strcmp(str,"typeO") == 0) return (void *) &typeO;
if (strcmp(str,"typeH") == 0) return (void *) &typeH;
if (strcmp(str,"typeA") == 0) return (void *) &typeA;
if (strcmp(str,"typeB") == 0) return (void *) &typeB;
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
return NULL;
}
diff --git a/src/KSPACE/pair_lj_cut_coul_long_tip4p.h b/src/KSPACE/pair_lj_cut_coul_long_tip4p.h
index 2206e0c93..20060ea0f 100644
--- a/src/KSPACE/pair_lj_cut_coul_long_tip4p.h
+++ b/src/KSPACE/pair_lj_cut_coul_long_tip4p.h
@@ -1,49 +1,98 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/cut/coul/long/tip4p,PairLJCutCoulLongTIP4P)
#else
#ifndef LMP_PAIR_LJ_CUT_COUL_LONG_TIP4P_H
#define LMP_PAIR_LJ_CUT_COUL_LONG_TIP4P_H
#include "pair_lj_cut_coul_long.h"
namespace LAMMPS_NS {
class PairLJCutCoulLongTIP4P : public PairLJCutCoulLong {
public:
PairLJCutCoulLongTIP4P(class LAMMPS *);
virtual void compute(int, int);
void settings(int, char **);
void init_style();
void write_restart_settings(FILE *fp);
void read_restart_settings(FILE *fp);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
int typeH,typeO; // atom types of TIP4P water H and O atoms
int typeA,typeB; // angle and bond types of TIP4P water
double qdist; // distance from O site to negative charge
double alpha; // geometric constraint parameter for TIP4P
void find_M(int, int &, int &, double *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Pair style lj/cut/coul/long/tip4p requires atom IDs
+
+There are no atom IDs defined in the system and the TIP4P potential
+requires them to find O,H atoms with a water molecule.
+
+E: Pair style lj/cut/coul/long/tip4p requires newton pair on
+
+This is because the computation of constraint forces within a water
+molecule adds forces to atoms owned by other processors.
+
+E: Pair style lj/cut/coul/long/tip4p requires atom attribute q
+
+The atom style defined does not have these attributes.
+
+E: Pair style is incompatible with KSpace style
+
+If a pair style with a long-range Coulombic component is selected,
+then a kspace style must also be used.
+
+E: Must use a bond style with TIP4P potential
+
+TIP4P potentials assume bond lengths in water are constrained
+by a fix shake command.
+
+E: Must use an angle style with TIP4P potential
+
+TIP4P potentials assume angles in water are constrained by a fix shake
+command.
+
+E: TIP4P hydrogen is missing
+
+The TIP4P pairwise computation failed to find the correct H atom
+within a water molecule.
+
+E: TIP4P hydrogen has incorrect atom type
+
+The TIP4P pairwise computation found an H atom whose type does not
+agree with the specified H type.
+
+*/
diff --git a/src/KSPACE/pppm.h b/src/KSPACE/pppm.h
index eb3532f2b..dc7bfdd1f 100644
--- a/src/KSPACE/pppm.h
+++ b/src/KSPACE/pppm.h
@@ -1,114 +1,218 @@
/* -*- c++ -*- ----------------------------------------------------------
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 KSPACE_CLASS
KSpaceStyle(pppm,PPPM)
#else
#ifndef LMP_PPPM_H
#define LMP_PPPM_H
#include "lmptype.h"
#include "mpi.h"
#ifdef FFT_SINGLE
typedef float FFT_SCALAR;
#define MPI_FFT_SCALAR MPI_FLOAT
#else
typedef double FFT_SCALAR;
#define MPI_FFT_SCALAR MPI_DOUBLE
#endif
#include "kspace.h"
namespace LAMMPS_NS {
class PPPM : public KSpace {
public:
PPPM(class LAMMPS *, int, char **);
virtual ~PPPM();
virtual void init();
virtual void setup();
virtual void compute(int, int);
virtual void timing(int, double &, double &);
virtual double memory_usage();
protected:
int me,nprocs;
double precision;
int nfactors;
int *factors;
double qsum,qsqsum;
double cutoff;
double volume;
double delxinv,delyinv,delzinv,delvolinv;
double shift,shiftone;
int nxlo_in,nylo_in,nzlo_in,nxhi_in,nyhi_in,nzhi_in;
int nxlo_out,nylo_out,nzlo_out,nxhi_out,nyhi_out,nzhi_out;
int nxlo_ghost,nxhi_ghost,nylo_ghost,nyhi_ghost,nzlo_ghost,nzhi_ghost;
int nxlo_fft,nylo_fft,nzlo_fft,nxhi_fft,nyhi_fft,nzhi_fft;
int nlower,nupper;
int ngrid,nfft,nbuf,nfft_both;
FFT_SCALAR ***density_brick;
FFT_SCALAR ***vdx_brick,***vdy_brick,***vdz_brick;
double *greensfn;
double **vg;
double *fkx,*fky,*fkz;
FFT_SCALAR *density_fft;
FFT_SCALAR *work1,*work2;
FFT_SCALAR *buf1,*buf2;
double *gf_b;
FFT_SCALAR **rho1d,**rho_coeff;
class FFT3d *fft1,*fft2;
class Remap *remap;
int **part2grid; // storage for particle -> grid mapping
int nmax;
int triclinic; // domain settings, orthog or triclinic
double *boxlo;
// TIP4P settings
int typeH,typeO; // atom types of TIP4P water H and O atoms
double qdist; // distance from O site to negative charge
double alpha; // geometric factor
void set_grid();
virtual void allocate();
virtual void deallocate();
int factorable(int);
double rms(double, double, bigint, double, double **);
double diffpr(double, double, double, double, double **);
void compute_gf_denom();
double gf_denom(double, double, double);
virtual void particle_map();
virtual void make_rho();
virtual void brick2fft();
virtual void fillbrick();
virtual void poisson(int, int);
virtual void fieldforce();
void procs2grid2d(int,int,int,int *, int*);
void compute_rho1d(const FFT_SCALAR &, const FFT_SCALAR &,
const FFT_SCALAR &);
void compute_rho_coeff();
void slabcorr(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot (yet) use PPPM with triclinic box
+
+This feature is not yet supported.
+
+E: Cannot use PPPM with 2d simulation
+
+The kspace style pppm cannot be used in 2d simulations. You can use
+2d PPPM in a 3d simulation; see the kspace_modify command.
+
+E: Kspace style requires atom attribute q
+
+The atom style defined does not have these attributes.
+
+E: Cannot use nonperiodic boundaries with PPPM
+
+For kspace style pppm, all 3 dimensions must have periodic boundaries
+unless you use the kspace_modify command to define a 2d slab with a
+non-periodic z dimension.
+
+E: Incorrect boundaries with slab PPPM
+
+Must have periodic x,y dimensions and non-periodic z dimension to use
+2d slab option with PPPM.
+
+E: PPPM order cannot be greater than %d
+
+Self-explanatory.
+
+E: KSpace style is incompatible with Pair style
+
+Setting a kspace style requires that a pair style with a long-range
+Coulombic component be selected.
+
+E: Bond and angle potentials must be defined for TIP4P
+
+Cannot use TIP4P pair potential unless bond and angle potentials
+are defined.
+
+E: Bad TIP4P angle type for PPPM/TIP4P
+
+Specified angle type is not valid.
+
+E: Bad TIP4P bond type for PPPM/TIP4P
+
+Specified bond type is not valid.
+
+E: Cannot use kspace solver on system with no charge
+
+No atoms in system have a non-zero charge.
+
+W: System is not charge neutral, net charge = %g
+
+The total charge on all atoms on the system is not 0.0, which
+is not valid for Ewald or PPPM.
+
+W: Reducing PPPM order b/c stencil extends beyond neighbor processor
+
+LAMMPS is attempting this in order to allow the simulation
+to run. It should not effect the PPPM accuracy.
+
+E: PPPM grid is too large
+
+The global PPPM grid is larger than OFFSET in one or more dimensions.
+OFFSET is currently set to 4096. You likely need to decrease the
+requested precision.
+
+E: PPPM order has been reduced to 0
+
+LAMMPS has attempted to reduce the PPPM order to enable the simulation
+to run, but can reduce the order no further. Try increasing the
+accuracy of PPPM by reducing the tolerance size, thus inducing a
+larger PPPM grid.
+
+E: Cannot compute PPPM G
+
+LAMMPS failed to compute a valid approximation for the PPPM g_ewald
+factor that partitions the computation between real space and k-space.
+
+E: Out of range atoms - cannot compute PPPM
+
+One or more atoms are attempting to map their charge to a PPPM grid
+point that is not owned by a processor. This is likely for one of two
+reasons, both of them bad. First, it may mean that an atom near the
+boundary of a processor's sub-domain has moved more than 1/2 the
+"neighbor skin distance"_neighbor.html without neighbor lists being
+rebuilt and atoms being migrated to new processors. This also means
+you may be missing pairwise interactions that need to be computed.
+The solution is to change the re-neighboring criteria via the
+"neigh_modify"_neigh_modify command. The safest settings are "delay 0
+every 1 check yes". Second, it may mean that an atom has moved far
+outside a processor's sub-domain or even the entire simulation box.
+This indicates bad physics, e.g. due to highly overlapping atoms, too
+large a timestep, etc.
+
+*/
diff --git a/src/KSPACE/pppm_cg.h b/src/KSPACE/pppm_cg.h
index 298f4b938..9e2fe8832 100644
--- a/src/KSPACE/pppm_cg.h
+++ b/src/KSPACE/pppm_cg.h
@@ -1,48 +1,74 @@
/* ----------------------------------------------------------------------
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 KSPACE_CLASS
KSpaceStyle(pppm/cg,PPPMCG)
#else
#ifndef LMP_PPPM_CG_H
#define LMP_PPPM_CG_H
#include "pppm.h"
namespace LAMMPS_NS {
class PPPMCG : public PPPM {
public:
PPPMCG(class LAMMPS *, int, char **);
virtual ~PPPMCG();
virtual void compute(int eflag, int vflag);
virtual double memory_usage();
protected:
int num_charged;
int *is_charged;
double smallq;
virtual void particle_map();
virtual void make_rho();
virtual void fieldforce();
virtual void slabcorr(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Out of range atoms - cannot compute PPPM
+
+One or more atoms are attempting to map their charge to a PPPM grid
+point that is not owned by a processor. This is likely for one of two
+reasons, both of them bad. First, it may mean that an atom near the
+boundary of a processor's sub-domain has moved more than 1/2 the
+"neighbor skin distance"_neighbor.html without neighbor lists being
+rebuilt and atoms being migrated to new processors. This also means
+you may be missing pairwise interactions that need to be computed.
+The solution is to change the re-neighboring criteria via the
+"neigh_modify"_neigh_modify command. The safest settings are "delay 0
+every 1 check yes". Second, it may mean that an atom has moved far
+outside a processor's sub-domain or even the entire simulation box.
+This indicates bad physics, e.g. due to highly overlapping atoms, too
+large a timestep, etc.
+
+*/
diff --git a/src/KSPACE/pppm_tip4p.h b/src/KSPACE/pppm_tip4p.h
index 35dd747ad..6afb0ae03 100644
--- a/src/KSPACE/pppm_tip4p.h
+++ b/src/KSPACE/pppm_tip4p.h
@@ -1,45 +1,79 @@
/* ----------------------------------------------------------------------
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 KSPACE_CLASS
KSpaceStyle(pppm/tip4p,PPPMTIP4P)
#else
#ifndef LMP_PPPM_TIP4P_H
#define LMP_PPPM_TIP4P_H
#include "pppm.h"
namespace LAMMPS_NS {
class PPPMTIP4P : public PPPM {
public:
PPPMTIP4P(class LAMMPS *, int, char **);
virtual ~PPPMTIP4P () {};
void init();
protected:
virtual void particle_map();
virtual void make_rho();
virtual void fieldforce();
private:
void find_M(int, int &, int &, double *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Kspace style pppm/tip4p requires newton on
+
+UNDOCUMENTED
+
+E: Out of range atoms - cannot compute PPPM
+
+One or more atoms are attempting to map their charge to a PPPM grid
+point that is not owned by a processor. This is likely for one of two
+reasons, both of them bad. First, it may mean that an atom near the
+boundary of a processor's sub-domain has moved more than 1/2 the
+"neighbor skin distance"_neighbor.html without neighbor lists being
+rebuilt and atoms being migrated to new processors. This also means
+you may be missing pairwise interactions that need to be computed.
+The solution is to change the re-neighboring criteria via the
+"neigh_modify"_neigh_modify command. The safest settings are "delay 0
+every 1 check yes". Second, it may mean that an atom has moved far
+outside a processor's sub-domain or even the entire simulation box.
+This indicates bad physics, e.g. due to highly overlapping atoms, too
+large a timestep, etc.
+
+E: TIP4P hydrogen is missing
+
+The TIP4P pairwise computation failed to find the correct H atom
+within a water molecule.
+
+E: TIP4P hydrogen has incorrect atom type
+
+The TIP4P pairwise computation found an H atom whose type does not
+agree with the specified H type.
+
+*/
diff --git a/src/KSPACE/remap_wrap.h b/src/KSPACE/remap_wrap.h
index dd57e18d1..60ba810bd 100644
--- a/src/KSPACE/remap_wrap.h
+++ b/src/KSPACE/remap_wrap.h
@@ -1,35 +1,43 @@
/* -*- c++ -*- ----------------------------------------------------------
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_REMAP_WRAP_H
#define LMP_REMAP_WRAP_H
#include "pointers.h"
#include "remap.h"
namespace LAMMPS_NS {
class Remap : protected Pointers {
public:
Remap(class LAMMPS *, MPI_Comm,int,int,int,int,int,int,
int,int,int,int,int,int,int,int,int,int);
~Remap();
void perform(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR *);
private:
struct remap_plan_3d *plan;
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Could not create 3d remap plan
+
+The FFT setup in pppm failed.
+
+*/
diff --git a/src/MANYBODY/fix_qeq_comb.h b/src/MANYBODY/fix_qeq_comb.h
index 48c7947f0..df48bb98a 100644
--- a/src/MANYBODY/fix_qeq_comb.h
+++ b/src/MANYBODY/fix_qeq_comb.h
@@ -1,54 +1,81 @@
/* ----------------------------------------------------------------------
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(qeq/comb,FixQEQComb)
#else
#ifndef LMP_FIX_QEQ_COMB_H
#define LMP_FIX_QEQ_COMB_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
class FixQEQComb : public Fix {
public:
FixQEQComb(class LAMMPS *, int, char **);
virtual ~FixQEQComb();
int setmask();
virtual void init();
void setup(int);
virtual void post_force(int);
void post_force_respa(int,int,int);
double memory_usage();
protected:
int me,firstflag;
double precision;
int nlevels_respa;
bigint ngroup;
FILE *fp;
class PairComb *comb;
int nmax;
double *qf,*q1,*q2;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot open fix qeq/comb file %s
+
+The output file for the fix qeq/combs command cannot be opened.
+Check that the path and name are correct.
+
+E: Fix qeq/comb requires atom attribute q
+
+An atom style with charge must be used to perform charge equilibration.
+
+E: Must use pair_style comb with fix qeq/comb
+
+Self-explanatory.
+
+E: Fix qeq/comb group has no atoms
+
+Self-explanatory.
+
+*/
diff --git a/src/MANYBODY/pair_adp.h b/src/MANYBODY/pair_adp.h
index f50a3e408..3e68846e5 100644
--- a/src/MANYBODY/pair_adp.h
+++ b/src/MANYBODY/pair_adp.h
@@ -1,94 +1,120 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(adp,PairADP)
#else
#ifndef LMP_PAIR_ADP_H
#define LMP_PAIR_ADP_H
#include "pair.h"
namespace LAMMPS_NS {
class PairADP : public Pair {
public:
PairADP(class LAMMPS *);
virtual ~PairADP();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();
protected:
int nmax; // allocated size of per-atom arrays
double cutforcesq,cutmax;
// per-atom arrays
double *rho,*fp;
double **mu, **lambda;
// potentials as array data
int nrho,nr;
int nfrho,nrhor,nz2r;
int nu2r, nw2r;
double **frho,**rhor,**z2r;
double **u2r, **w2r;
int *type2frho,**type2rhor,**type2z2r;
int **type2u2r,**type2w2r;
// potentials in spline form used for force computation
double dr,rdr,drho,rdrho;
double ***rhor_spline,***frho_spline,***z2r_spline;
double ***u2r_spline, ***w2r_spline;
// potentials as file data
int *map; // which element each atom type maps to
struct Setfl {
char **elements;
int nelements,nrho,nr;
double drho,dr,cut;
double *mass;
double **frho,**rhor,***z2r;
double ***u2r, ***w2r;
};
Setfl *setfl;
void allocate();
void array2spline();
void interpolate(int, double, double *, double **);
void grab(FILE *, int, double *);
void read_file(char *);
void file2array();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: No matching element in ADP potential file
+
+UNDOCUMENTED
+
+E: Cannot open ADP potential file %s
+
+UNDOCUMENTED
+
+E: Incorrect element names in ADP potential file
+
+UNDOCUMENTED
+
+*/
diff --git a/src/MANYBODY/pair_airebo.h b/src/MANYBODY/pair_airebo.h
index 2f78fc451..9d3f69b25 100644
--- a/src/MANYBODY/pair_airebo.h
+++ b/src/MANYBODY/pair_airebo.h
@@ -1,176 +1,215 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(airebo,PairAIREBO)
#else
#ifndef LMP_PAIR_AIREBO_H
#define LMP_PAIR_AIREBO_H
#include "pair.h"
#include "math.h"
#include "math_const.h"
namespace LAMMPS_NS {
class PairAIREBO : public Pair {
public:
PairAIREBO(class LAMMPS *);
virtual ~PairAIREBO();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
double memory_usage();
protected:
int **pages; // neighbor list pages
int *map; // 0 (C), 1 (H), or -1 (NULL) for each type
int me;
int ljflag,torflag; // 0/1 if LJ,torsion terms included
int maxlocal; // size of numneigh, firstneigh arrays
int maxpage; // # of pages currently allocated
int pgsize; // size of neighbor page
int oneatom; // max # of neighbors for one atom
double cutlj; // user-specified LJ cutoff
double cutljrebosq; // cut for when to compute
// REBO neighs of ghost atoms
double **cutljsq; // LJ cutoffs for C,H types
double **lj1,**lj2,**lj3,**lj4; // pre-computed LJ coeffs for C,H types
double cut3rebo; // maximum distance for 3rd REBO neigh
int *REBO_numneigh; // # of pair neighbors for each atom
int **REBO_firstneigh; // ptr to 1st neighbor of each atom
double *closestdistsq; // closest owned atom dist to each ghost
double *nC,*nH; // sum of weighting fns with REBO neighs
double smin,Nmin,Nmax,NCmin,NCmax,thmin,thmax;
double rcmin[2][2],rcmax[2][2],rcmaxsq[2][2],rcmaxp[2][2];
double Q[2][2],alpha[2][2],A[2][2],rho[2][2],BIJc[2][2][3],Beta[2][2][3];
double rcLJmin[2][2],rcLJmax[2][2],rcLJmaxsq[2][2],bLJmin[2][2],bLJmax[2][2];
double epsilon[2][2],sigma[2][2],epsilonT[2][2];
// spline coefficients
double gCdom[5],gC1[4][6],gC2[4][6],gHdom[4],gH[3][6];
double pCCdom[2][2],pCHdom[2][2],pCC[4][4][16],pCH[4][4][16];
double piCCdom[3][2],piCHdom[3][2],piHHdom[3][2];
double piCC[4][4][9][64],piCH[4][4][9][64],piHH[4][4][9][64];
double Tijdom[3][2],Tijc[4][4][9][64];
// spline knot values
double PCCf[5][5],PCCdfdx[5][5],PCCdfdy[5][5],PCHf[5][5];
double PCHdfdx[5][5],PCHdfdy[5][5];
double piCCf[5][5][11],piCCdfdx[5][5][11];
double piCCdfdy[5][5][11],piCCdfdz[5][5][11];
double piCHf[5][5][11],piCHdfdx[5][5][11];
double piCHdfdy[5][5][11],piCHdfdz[5][5][11];
double piHHf[5][5][11],piHHdfdx[5][5][11];
double piHHdfdy[5][5][11],piHHdfdz[5][5][11];
double Tf[5][5][10],Tdfdx[5][5][10],Tdfdy[5][5][10],Tdfdz[5][5][10];
void REBO_neigh();
void FREBO(int, int);
void FLJ(int, int);
void TORSION(int, int);
double bondorder(int, int, double *, double, double, double **, int);
double bondorderLJ(int, int, double *, double, double,
double *, double, double **, int);
double gSpline(double, double, int, double *, double *);
double PijSpline(double, double, int, int, double *);
double piRCSpline(double, double, double, int, int, double *);
double TijSpline(double, double, double, double *);
void add_pages(int howmany=1);
void read_file(char *);
double Sp5th(double, double *, double *);
double Spbicubic(double, double, double *, double *);
double Sptricubic(double, double, double, double *, double *);
void spline_init();
void allocate();
// ----------------------------------------------------------------------
// S'(t) and S(t) cutoff functions
// added to header for inlining
// ----------------------------------------------------------------------
/* ----------------------------------------------------------------------
cutoff function Sprime
return cutoff and dX = derivative
no side effects
------------------------------------------------------------------------- */
inline double Sp(double Xij, double Xmin, double Xmax, double &dX) const {
double cutoff;
double t = (Xij-Xmin) / (Xmax-Xmin);
if (t <= 0.0) {
cutoff = 1.0;
dX = 0.0;
} else if (t >= 1.0) {
cutoff = 0.0;
dX = 0.0;
} else {
cutoff = 0.5 * (1.0+cos(t*MathConst::MY_PI));
dX = (-0.5*MathConst::MY_PI*sin(t*MathConst::MY_PI)) / (Xmax-Xmin);
}
return cutoff;
};
/* ----------------------------------------------------------------------
LJ cutoff function Sp2
return cutoff and dX = derivative
no side effects
------------------------------------------------------------------------- */
inline double Sp2(double Xij, double Xmin, double Xmax, double &dX) const {
double cutoff;
double t = (Xij-Xmin) / (Xmax-Xmin);
if (t <= 0.0) {
cutoff = 1.0;
dX = 0.0;
} else if (t >= 1.0) {
cutoff = 0.0;
dX = 0.0;
} else {
cutoff = (1.0-(t*t*(3.0-2.0*t)));
dX = 6.0*(t*t-t) / (Xmax-Xmin);
}
return cutoff;
};
/* kronecker delta function returning a double */
inline double kronecker(const int a, const int b) const {
return (a == b) ? 1.0 : 0.0;
};
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style AIREBO requires atom IDs
+
+This is a requirement to use the AIREBO potential.
+
+E: Pair style AIREBO requires newton pair on
+
+See the newton command. This is a restriction to use the AIREBO
+potential.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+E: Neighbor list overflow, boost neigh_modify one or page
+
+There are too many neighbors of a single atom. Use the neigh_modify
+command to increase the neighbor page size and the max number of
+neighbors allowed for one atom.
+
+E: Cannot open AIREBO potential file %s
+
+The specified AIREBO potential file cannot be opened. Check that the
+path and name are correct.
+
+*/
diff --git a/src/MANYBODY/pair_comb.h b/src/MANYBODY/pair_comb.h
index 19bc849b4..25f698e7b 100644
--- a/src/MANYBODY/pair_comb.h
+++ b/src/MANYBODY/pair_comb.h
@@ -1,181 +1,245 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(comb,PairComb)
#else
#ifndef LMP_PAIR_COMB_H
#define LMP_PAIR_COMB_H
#include "pair.h"
namespace LAMMPS_NS {
class PairComb : public Pair {
public:
PairComb(class LAMMPS *);
virtual ~PairComb();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
double memory_usage();
virtual double yasu_char(double *, int &);
protected:
struct Param {
double lam11,lam12,lam21,lam22;
double c,d,h;
double gamma,powerm;
double powern,beta;
double biga1,biga2,bigb1,bigb2;
double bigd,bigr;
double cut,cutsq;
double c1,c2,c3,c4;
double plp1,plp3,plp6,a123,aconf;
double rlm1,rlm2;
double romiga,romigb,romigc,romigd,addrep;
double QU1,QL1,DU1,DL1,Qo1,dQ1,aB1,bB1,nD1,bD1;
double QU2,QL2,DU2,DL2,Qo2,dQ2,aB2,bB2,nD2,bD2;
double chi,dj,dk,dl,dm,esm1,esm2,cmn1,cmn2,cml1,cml2;
double coulcut, lcut, lcutsq, hfocor;
int ielement,jelement,kelement;
int powermint;
};
double cutmax; // max cutoff for all elements
int nelements; // # of unique elements
char **elements; // names of unique elements
int ***elem2param; // mapping from element triplets to parameters
int *map; // mapping from atom types to elements
int nparams; // # of stored parameter sets
int maxparam; // max # of parameter sets
double precision;
Param *params; // parameter set for an I-J-K interaction
int nmax;
double *qf;
double *esm, **fafb, **dfafb, **ddfafb, **phin, **dphin, **erpaw;
double *charge;
int **intype, *typeno;
int *NCo, cor_flag, cuo_flag, cuo_flag1, cuo_flag2;
double **bbij;
void allocate();
virtual void read_file(char *);
void setup();
virtual void repulsive(Param *, double, double &, int,
double &, double, double);
double zeta(Param *, double, double, double *, double *);
void force_zeta(Param *, int, int, int, double, double, double, double,
double &, double &, double &);
void attractive(Param *, double, double, double, double *, double *,
double *, double *, double *);
double elp(Param *, double, double, double *, double *);
void flp(Param *, double, double, double *, double *, double *,
double *, double *);
double comb_fc(double, Param *);
double comb_fc_d(double, Param *);
double comb_fc2(double);
double comb_fc2_d(double);
double comb_fc3(double);
double comb_fc3_d(double);
virtual double comb_fa(double, Param *, double,double);
virtual double comb_fa_d(double, Param *, double,double);
double comb_bij(double, Param *);
double comb_bij_d(double, Param *);
inline double comb_gijk(const double costheta, const Param * const param) const {
const double comb_c = param->c * param->c;
const double comb_d = param->d * param->d;
const double hcth = param->h - costheta;
return param->gamma*(1.0 + comb_c/comb_d - comb_c / (comb_d + hcth*hcth));
}
inline double comb_gijk_d(const double costheta, const Param * const param) const {
const double comb_c = param->c * param->c;
const double comb_d = param->d * param->d;
const double hcth = param->h - costheta;
const double numerator = -2.0 * comb_c * hcth;
const double denominator = 1.0/(comb_d + hcth*hcth);
return param->gamma*numerator*denominator*denominator;
}
void comb_zetaterm_d(double, double *, double, double *, double,
double *, double *, double *, Param *);
void costheta_d(double *, double, double *, double,
double *, double *, double *);
double self(Param *, double, double);
void sm_table();
void potal_calc(double &, double &, double &);
void tri_point(double, int &, int &, int &, double &, double &,
double &, int &);
void direct(int,int,int,int,double,double,double,double,double,double,
double,double,double,double &,double &);
void field(Param *,double,double,double,double &,double &);
double qfo_self(Param *, double, double);
void qfo_short(Param *, int, int, double, double, double,
double &, double &);
void qfo_direct (int, int, int, int, double, double, double, double,
double, double &);
void qfo_field(Param *, double,double ,double ,double &, double &);
void qsolve(double *);
void Over_cor(Param *, double, int, double &, double &);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
int pack_comm(int , int *, double *, int, int *);
void unpack_comm(int , int , double *);
// Short range neighbor list
void add_pages(int howmany=1);
void Short_neigh();
int maxpage, pgsize, oneatom, **pages;
int *sht_num, **sht_first; // short-range neighbor list
double cutmin;
// vector functions, inline for efficiency
inline double vec3_dot(const double x[3], const double y[3]) const {
return x[0]*y[0] + x[1]*y[1] + x[2]*y[2];
}
inline void vec3_add(const double x[3], const double y[3],
double * const z) const {
z[0] = x[0]+y[0]; z[1] = x[1]+y[1]; z[2] = x[2]+y[2];
}
inline void vec3_scale(const double k, const double x[3],
double y[3]) const {
y[0] = k*x[0]; y[1] = k*x[1]; y[2] = k*x[2];
}
inline void vec3_scaleadd(const double k, const double x[3],
const double y[3], double * const z) const {
z[0] = k*x[0]+y[0];
z[1] = k*x[1]+y[1];
z[2] = k*x[2]+y[2];
}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style COMB requires atom IDs
+
+This is a requirement to use the AIREBO potential.
+
+E: Pair style COMB requires newton pair on
+
+See the newton command. This is a restriction to use the COMB
+potential.
+
+E: Pair style COMB requires atom attribute q
+
+Self-explanatory.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+E: Cannot open COMB potential file %s
+
+The specified COMB potential file cannot be opened. Check that the
+path and name are correct.
+
+E: Incorrect format in COMB potential file
+
+Incorrect number of words per line in the potential file.
+
+E: Illegal COMB parameter
+
+One or more of the coefficients defined in the potential file is
+invalid.
+
+E: Potential file has duplicate entry
+
+The potential file for a SW or Tersoff potential has more than
+one entry for the same 3 ordered elements.
+
+E: Potential file is missing an entry
+
+The potential file for a SW or Tersoff potential does not have a
+needed entry.
+
+W: Pair COMB charge %.10f with force %.10f hit min barrier
+
+Something is possibly wrong with your model.
+
+W: Pair COMB charge %.10f with force %.10f hit max barrier
+
+Something is possibly wrong with your model.
+
+*/
diff --git a/src/MANYBODY/pair_eam.h b/src/MANYBODY/pair_eam.h
index 1b7b1f1f0..f31b6e291 100644
--- a/src/MANYBODY/pair_eam.h
+++ b/src/MANYBODY/pair_eam.h
@@ -1,114 +1,133 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(eam,PairEAM)
#else
#ifndef LMP_PAIR_EAM_H
#define LMP_PAIR_EAM_H
#include "stdio.h"
#include "pair.h"
namespace LAMMPS_NS {
class PairEAM : public Pair {
public:
// public variables so UESR-ATC package can access them
double cutmax;
// potentials as array data
int nrho,nr;
int nfrho,nrhor,nz2r;
double **frho,**rhor,**z2r;
int *type2frho,**type2rhor,**type2z2r;
// potentials in spline form used for force computation
double dr,rdr,drho,rdrho;
double ***rhor_spline,***frho_spline,***z2r_spline;
PairEAM(class LAMMPS *);
virtual ~PairEAM();
virtual void compute(int, int);
void settings(int, char **);
virtual void coeff(int, char **);
void init_style();
double init_one(int, int);
double single(int, int, int, int, double, double, double, double &);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();
void swap_eam(double *, double **);
protected:
int nmax; // allocated size of per-atom arrays
double cutforcesq;
// per-atom arrays
double *rho,*fp;
// potentials as file data
int *map; // which element each atom type maps to
struct Funcfl {
char *file;
int nrho,nr;
double drho,dr,cut,mass;
double *frho,*rhor,*zr;
};
Funcfl *funcfl;
int nfuncfl;
struct Setfl {
char **elements;
int nelements,nrho,nr;
double drho,dr,cut;
double *mass;
double **frho,**rhor,***z2r;
};
Setfl *setfl;
struct Fs {
char **elements;
int nelements,nrho,nr;
double drho,dr,cut;
double *mass;
double **frho,***rhor,***z2r;
};
Fs *fs;
void allocate();
void array2spline();
void interpolate(int, double, double *, double **);
void grab(FILE *, int, double *);
virtual void read_file(char *);
virtual void file2array();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Cannot open EAM potential file %s
+
+The specified EAM potential file cannot be opened. Check that the
+path and name are correct.
+
+*/
diff --git a/src/MANYBODY/pair_eam_alloy.h b/src/MANYBODY/pair_eam_alloy.h
index f2439c027..96abbf2ef 100644
--- a/src/MANYBODY/pair_eam_alloy.h
+++ b/src/MANYBODY/pair_eam_alloy.h
@@ -1,43 +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 PAIR_CLASS
PairStyle(eam/alloy,PairEAMAlloy)
#else
#ifndef LMP_PAIR_EAM_ALLOY_H
#define LMP_PAIR_EAM_ALLOY_H
#include "pair_eam.h"
namespace LAMMPS_NS {
// need virtual public b/c of how eam/alloy/opt inherits from it
class PairEAMAlloy : virtual public PairEAM {
public:
PairEAMAlloy(class LAMMPS *);
virtual ~PairEAMAlloy() {}
void coeff(int, char **);
protected:
void read_file(char *);
void file2array();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: No matching element in EAM potential file
+
+The EAM potential file does not contain elements that match the
+requested elements.
+
+E: Cannot open EAM potential file %s
+
+The specified EAM potential file cannot be opened. Check that the
+path and name are correct.
+
+E: Incorrect element names in EAM potential file
+
+The element names in the EAM file do not match those requested.
+
+*/
diff --git a/src/MANYBODY/pair_eam_fs.h b/src/MANYBODY/pair_eam_fs.h
index 3524c81e9..b482e843e 100644
--- a/src/MANYBODY/pair_eam_fs.h
+++ b/src/MANYBODY/pair_eam_fs.h
@@ -1,43 +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 PAIR_CLASS
PairStyle(eam/fs,PairEAMFS)
#else
#ifndef LMP_PAIR_EAM_FS_H
#define LMP_PAIR_EAM_FS_H
#include "pair_eam.h"
namespace LAMMPS_NS {
// need virtual public b/c of how eam/fs/opt inherits from it
class PairEAMFS : virtual public PairEAM {
public:
PairEAMFS(class LAMMPS *);
virtual ~PairEAMFS() {}
void coeff(int, char **);
protected:
void read_file(char *);
void file2array();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: No matching element in EAM potential file
+
+The EAM potential file does not contain elements that match the
+requested elements.
+
+E: Cannot open EAM potential file %s
+
+The specified EAM potential file cannot be opened. Check that the
+path and name are correct.
+
+E: Incorrect element names in EAM potential file
+
+The element names in the EAM file do not match those requested.
+
+*/
diff --git a/src/MANYBODY/pair_eim.h b/src/MANYBODY/pair_eim.h
index cc4939c81..f34cc6cc3 100644
--- a/src/MANYBODY/pair_eim.h
+++ b/src/MANYBODY/pair_eim.h
@@ -1,101 +1,132 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(eim,PairEIM)
#else
#ifndef LMP_PAIR_EIM_H
#define LMP_PAIR_EIM_H
#include "stdio.h"
#include "pair.h"
namespace LAMMPS_NS {
class PairEIM : public Pair {
public:
PairEIM(class LAMMPS *);
virtual ~PairEIM();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();
protected:
double **cutforcesq,cutmax;
int nmax;
double *rho,*fp;
int rhofp;
int *map; // which element each atom type maps to
int nelements; // # of elements to read from potential file
char **elements; // element names
struct Setfl {
double division,rbig,rsmall;
int nr;
int *ielement,*tp;
double *mass,*negativity,*ra,*ri,*Ec,*q0;
double *rcutphiA,*rcutphiR,*Eb,*r0,*alpha,*beta,
*rcutq,*Asigma,*rq,*rcutsigma,*Ac,*zeta,
*rs;
double dr,cut;
double ***Fij,***Gij,***phiij;
double **cuts;
};
Setfl *setfl;
// potentials as array data
int nr;
int nFij,nGij,nphiij;
double **Fij,**Gij,**phiij;
int **type2Fij,**type2Gij,**type2phiij;
// potentials in spline form used for force computation
double dr,rdr;
double *negativity,*q0;
double ***Fij_spline,***Gij_spline,***phiij_spline;
void allocate();
void array2spline();
void interpolate(int, double, double *, double **, double);
int grabglobal(FILE *);
int grabsingle(FILE *, int);
int grabpair(FILE *, int, int);
double funccutoff(double, double, double);
double funcphi(int, int, double);
double funcsigma(int, int, double);
double funccoul(int, int, double);
void read_file(char *);
void deallocate_setfl();
void file2array();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Cannot open EIM potential file %s
+
+The specified EIM potential file cannot be opened. Check that the
+path and name are correct.
+
+E: Could not grab global entry from EIM potential file
+
+Self-explanatory.
+
+E: Could not grab element entry from EIM potential file
+
+Self-explanatory
+
+E: Could not grab pair entry from EIM potential file
+
+Self-explanatory.
+
+*/
diff --git a/src/MANYBODY/pair_rebo.h b/src/MANYBODY/pair_rebo.h
index e46d00d9a..aefe145b2 100644
--- a/src/MANYBODY/pair_rebo.h
+++ b/src/MANYBODY/pair_rebo.h
@@ -1,36 +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.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(rebo,PairREBO)
#else
#ifndef LMP_PAIR_REBO_H
#define LMP_PAIR_REBO_H
#include "pair_airebo.h"
namespace LAMMPS_NS {
class PairREBO : public PairAIREBO {
public:
PairREBO(class LAMMPS *);
void settings(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/MANYBODY/pair_sw.h b/src/MANYBODY/pair_sw.h
index ddd23df16..76b3d5528 100644
--- a/src/MANYBODY/pair_sw.h
+++ b/src/MANYBODY/pair_sw.h
@@ -1,70 +1,122 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(sw,PairSW)
#else
#ifndef LMP_PAIR_SW_H
#define LMP_PAIR_SW_H
#include "pair.h"
namespace LAMMPS_NS {
class PairSW : public Pair {
public:
PairSW(class LAMMPS *);
virtual ~PairSW();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
double init_one(int, int);
void init_style();
protected:
struct Param {
double epsilon,sigma;
double littlea,lambda,gamma,costheta;
double biga,bigb;
double powerp,powerq;
double tol;
double cut,cutsq;
double sigma_gamma,lambda_epsilon,lambda_epsilon2;
double c1,c2,c3,c4,c5,c6;
int ielement,jelement,kelement;
};
double cutmax; // max cutoff for all elements
int nelements; // # of unique elements
char **elements; // names of unique elements
int ***elem2param; // mapping from element triplets to parameters
int *map; // mapping from atom types to elements
int nparams; // # of stored parameter sets
int maxparam; // max # of parameter sets
Param *params; // parameter set for an I-J-K interaction
void allocate();
void read_file(char *);
void setup();
void twobody(Param *, double, double &, int, double &);
void threebody(Param *, Param *, Param *, double, double, double *, double *,
double *, double *, int, double &);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style Stillinger-Weber requires atom IDs
+
+This is a requirement to use the SW potential.
+
+E: Pair style Stillinger-Weber requires newton pair on
+
+See the newton command. This is a restriction to use the SW
+potential.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+E: Cannot open Stillinger-Weber potential file %s
+
+The specified SW potential file cannot be opened. Check that the path
+and name are correct.
+
+E: Incorrect format in Stillinger-Weber potential file
+
+Incorrect number of words per line in the potential file.
+
+E: Illegal Stillinger-Weber parameter
+
+One or more of the coefficients defined in the potential file is
+invalid.
+
+E: Potential file has duplicate entry
+
+The potential file for a SW or Tersoff potential has more than
+one entry for the same 3 ordered elements.
+
+E: Potential file is missing an entry
+
+The potential file for a SW or Tersoff potential does not have a
+needed entry.
+
+*/
diff --git a/src/MANYBODY/pair_tersoff.h b/src/MANYBODY/pair_tersoff.h
index 92dbe635b..b5902abba 100644
--- a/src/MANYBODY/pair_tersoff.h
+++ b/src/MANYBODY/pair_tersoff.h
@@ -1,129 +1,181 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(tersoff,PairTersoff)
#else
#ifndef LMP_PAIR_TERSOFF_H
#define LMP_PAIR_TERSOFF_H
#include "pair.h"
namespace LAMMPS_NS {
class PairTersoff : public Pair {
public:
PairTersoff(class LAMMPS *);
virtual ~PairTersoff();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
protected:
struct Param {
double lam1,lam2,lam3;
double c,d,h;
double gamma,powerm;
double powern,beta;
double biga,bigb,bigd,bigr;
double cut,cutsq;
double c1,c2,c3,c4;
int ielement,jelement,kelement;
int powermint;
double Z_i,Z_j;
double ZBLcut,ZBLexpscale;
};
Param *params; // parameter set for an I-J-K interaction
char **elements; // names of unique elements
int ***elem2param; // mapping from element triplets to parameters
int *map; // mapping from atom types to elements
double cutmax; // max cutoff for all elements
int nelements; // # of unique elements
int nparams; // # of stored parameter sets
int maxparam; // max # of parameter sets
void allocate();
virtual void read_file(char *);
void setup();
virtual void repulsive(Param *, double, double &, int, double &);
double zeta(Param *, double, double, double *, double *);
virtual void force_zeta(Param *, double, double, double &,
double &, int, double &);
void attractive(Param *, double, double, double, double *, double *,
double *, double *, double *);
double ters_fc(double, Param *);
double ters_fc_d(double, Param *);
virtual double ters_fa(double, Param *);
virtual double ters_fa_d(double, Param *);
double ters_bij(double, Param *);
double ters_bij_d(double, Param *);
void ters_zetaterm_d(double, double *, double, double *, double,
double *, double *, double *, Param *);
void costheta_d(double *, double, double *, double,
double *, double *, double *);
// inlined functions for efficiency
inline double ters_gijk(const double costheta,
const Param * const param) const {
const double ters_c = param->c * param->c;
const double ters_d = param->d * param->d;
const double hcth = param->h - costheta;
return param->gamma*(1.0 + ters_c/ters_d - ters_c / (ters_d + hcth*hcth));
}
inline double ters_gijk_d(const double costheta,
const Param * const param) const {
const double ters_c = param->c * param->c;
const double ters_d = param->d * param->d;
const double hcth = param->h - costheta;
const double numerator = -2.0 * ters_c * hcth;
const double denominator = 1.0/(ters_d + hcth*hcth);
return param->gamma*numerator*denominator*denominator;
}
inline double vec3_dot(const double x[3], const double y[3]) const {
return x[0]*y[0] + x[1]*y[1] + x[2]*y[2];
}
inline void vec3_add(const double x[3], const double y[3],
double * const z) const {
z[0] = x[0]+y[0]; z[1] = x[1]+y[1]; z[2] = x[2]+y[2];
}
inline void vec3_scale(const double k, const double x[3],
double y[3]) const {
y[0] = k*x[0]; y[1] = k*x[1]; y[2] = k*x[2];
}
inline void vec3_scaleadd(const double k, const double x[3],
const double y[3], double * const z) const {
z[0] = k*x[0]+y[0];
z[1] = k*x[1]+y[1];
z[2] = k*x[2]+y[2];
}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style Tersoff requires atom IDs
+
+This is a requirement to use the Tersoff potential.
+
+E: Pair style Tersoff requires newton pair on
+
+See the newton command. This is a restriction to use the Tersoff
+potential.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+E: Cannot open Tersoff potential file %s
+
+The specified Tersoff potential file cannot be opened. Check that the
+path and name are correct.
+
+E: Incorrect format in Tersoff potential file
+
+Incorrect number of words per line in the potential file.
+
+E: Illegal Tersoff parameter
+
+One or more of the coefficients defined in the potential file is
+invalid.
+
+E: Potential file has duplicate entry
+
+The potential file for a SW or Tersoff potential has more than
+one entry for the same 3 ordered elements.
+
+E: Potential file is missing an entry
+
+The potential file for a SW or Tersoff potential does not have a
+needed entry.
+
+*/
diff --git a/src/MANYBODY/pair_tersoff_zbl.h b/src/MANYBODY/pair_tersoff_zbl.h
index 6006de1c6..c46412098 100644
--- a/src/MANYBODY/pair_tersoff_zbl.h
+++ b/src/MANYBODY/pair_tersoff_zbl.h
@@ -1,50 +1,72 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(tersoff/zbl,PairTersoffZBL)
#else
#ifndef LMP_PAIR_TERSOFF_ZBL_H
#define LMP_PAIR_TERSOFF_ZBL_H
#include "pair_tersoff.h"
namespace LAMMPS_NS {
class PairTersoffZBL : public PairTersoff {
public:
PairTersoffZBL(class LAMMPS *);
~PairTersoffZBL() {}
private:
double global_a_0; // Bohr radius for Coulomb repulsion
double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion
double global_e; // proton charge (negative of electron charge)
void read_file(char *);
void repulsive(Param *, double, double &, int, double &);
double ters_fa(double, Param *);
double ters_fa_d(double, Param *);
double F_fermi(double, Param *);
double F_fermi_d(double, Param *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Pair tersoff/zbl requires metal or real units
+
+This is a current restriction of this pair potential.
+
+E: Cannot open Tersoff potential file %s
+
+The specified Tersoff potential file cannot be opened. Check that the
+path and name are correct.
+
+E: Incorrect format in Tersoff potential file
+
+Incorrect number of words per line in the potential file.
+
+E: Illegal Tersoff parameter
+
+One or more of the coefficients defined in the potential file is
+invalid.
+
+*/
diff --git a/src/MC/fix_bond_break.h b/src/MC/fix_bond_break.h
index 597a7e93f..daac664fa 100644
--- a/src/MC/fix_bond_break.h
+++ b/src/MC/fix_bond_break.h
@@ -1,60 +1,87 @@
/* ----------------------------------------------------------------------
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(bond/break,FixBondBreak)
#else
#ifndef LMP_FIX_BOND_BREAK_H
#define LMP_FIX_BOND_BREAK_H
#include "fix.h"
namespace LAMMPS_NS {
class FixBondBreak : public Fix {
public:
FixBondBreak(class LAMMPS *, int, char **);
~FixBondBreak();
int setmask();
void init();
void post_integrate();
void post_integrate_respa(int,int);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double compute_vector(int);
double memory_usage();
private:
int me;
int btype,seed;
double cutsq,fraction;
int breakcount,breakcounttotal;
int nmax;
int *partner;
double *distsq,*probability;
class RanMars *random;
int nlevels_respa;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Invalid bond type in fix bond/break command
+
+Self-explanatory.
+
+E: Cannot use fix bond/break with non-molecular systems
+
+Self-explanatory.
+
+E: Fix bond/break requires special_bonds = 0,1,1
+
+This is a restriction of the current fix bond/break implementation.
+
+W: Broken bonds will not alter angles, dihedrals, or impropers
+
+See the doc page for fix bond/break for more info on this
+restriction.
+
+*/
diff --git a/src/MC/fix_bond_create.h b/src/MC/fix_bond_create.h
index a54fd5d82..08d229acc 100644
--- a/src/MC/fix_bond_create.h
+++ b/src/MC/fix_bond_create.h
@@ -1,74 +1,133 @@
/* ----------------------------------------------------------------------
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(bond/create,FixBondCreate)
#else
#ifndef LMP_FIX_BOND_CREATE_H
#define LMP_FIX_BOND_CREATE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixBondCreate : public Fix {
public:
FixBondCreate(class LAMMPS *, int, char **);
~FixBondCreate();
int setmask();
void init();
void init_list(int, class NeighList *);
void setup(int);
void post_integrate();
void post_integrate_respa(int, int);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
double compute_vector(int);
double memory_usage();
private:
int me;
int iatomtype,jatomtype;
int btype,seed;
int imaxbond,jmaxbond;
int inewtype,jnewtype;
double cutsq,fraction;
int createcount,createcounttotal; // bond formation stats
int nmax;
int *bondcount; // count of created bonds this atom is part of
int *partner; // ID of preferred atom for this atom to bond to
double *distsq; // distance to preferred bond partner
double *probability; // random # to use in decision to form bond
class RanMars *random;
class NeighList *list;
int countflag,commflag;
int nlevels_respa;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Invalid atom type in fix bond/create command
+
+Self-explanatory.
+
+E: Invalid bond type in fix bond/create command
+
+Self-explanatory.
+
+E: Cannot use fix bond/create with non-molecular systems
+
+Self-explanatory.
+
+E: Inconsistent iparam/jparam values in fix bond/create command
+
+If itype and jtype are the same, then their maxbond and newtype
+settings must also be the same.
+
+E: Fix bond/create cutoff is longer than pairwise cutoff
+
+This is not allowed because bond creation is done using the
+pairwise neighbor list.
+
+E: Fix bond/create requires special_bonds lj = 0,1,1
+
+Self-explanatory.
+
+E: Fix bond/create requires special_bonds coul = 0,1,1
+
+Self-explanatory.
+
+W: Created bonds will not create angles, dihedrals, or impropers
+
+See the doc page for fix bond/create for more info on this
+restriction.
+
+E: Could not count initial bonds in fix bond/create
+
+Could not find one of the atoms in a bond on this processor.
+
+E: New bond exceeded bonds per atom in fix bond/create
+
+See the read_data command for info on setting the "extra bond per
+atom" header value to allow for additional bonds to be formed.
+
+E: New bond exceeded special list size in fix bond/create
+
+See the special_bonds extra command for info on how to leave space in
+the special bonds list to allow for additional bonds to be formed.
+
+*/
diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp
index 1984f9f40..4003e437f 100644
--- a/src/MC/fix_bond_swap.cpp
+++ b/src/MC/fix_bond_swap.cpp
@@ -1,689 +1,689 @@
/* ----------------------------------------------------------------------
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 "math.h"
#include "stdlib.h"
#include "string.h"
#include "fix_bond_swap.h"
#include "atom.h"
#include "force.h"
#include "pair.h"
#include "bond.h"
#include "angle.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "group.h"
#include "comm.h"
#include "domain.h"
#include "modify.h"
#include "compute.h"
#include "random_mars.h"
#include "memory.h"
#include "error.h"
#include "update.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg != 6) error->all(FLERR,"Illegal fix bond/swap command");
vector_flag = 1;
size_vector = 2;
global_freq = 1;
extvector = 0;
fraction = atof(arg[3]);
double cutoff = atof(arg[4]);
cutsq = cutoff*cutoff;
// initialize Marsaglia RNG with processor-unique seed
int seed = atoi(arg[5]);
random = new RanMars(lmp,seed + comm->me);
// create a new compute temp style
// id = fix-ID + temp, compute group = fix group
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] = "all";
- newarg[2] = "temp";
+ newarg[1] = (char *) "all";
+ newarg[2] = (char *) "temp";
modify->add_compute(3,newarg);
delete [] newarg;
tflag = 1;
// initialize atom list
nmax = 0;
alist = NULL;
naccept = foursome = 0;
}
/* ---------------------------------------------------------------------- */
FixBondSwap::~FixBondSwap()
{
delete random;
// delete temperature if fix created it
if (tflag) modify->delete_compute(id_temp);
delete [] id_temp;
memory->destroy(alist);
}
/* ---------------------------------------------------------------------- */
int FixBondSwap::setmask()
{
int mask = 0;
mask |= PRE_NEIGHBOR;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixBondSwap::init()
{
// require an atom style with molecule IDs
if (atom->molecule == NULL)
error->all(FLERR,"Must use atom style with molecule IDs with fix bond/swap");
int icompute = modify->find_compute(id_temp);
if (icompute < 0)
error->all(FLERR,"Temperature ID for fix bond/swap does not exist");
temperature = modify->compute[icompute];
// pair and bonds must be defined
// no dihedral or improper potentials allowed
// special bonds must be 0 1 1
if (force->pair == NULL || force->bond == NULL)
error->all(FLERR,"Fix bond/swap requires pair and bond styles");
if (force->pair->single_enable == 0)
error->all(FLERR,"Pair style does not support fix bond/swap");
if (force->angle == NULL && atom->nangles > 0 && comm->me == 0)
error->warning(FLERR,"Fix bond/swap will ignore defined angles");
if (force->dihedral || force->improper)
error->all(FLERR,"Fix bond/swap cannot use dihedral or improper styles");
if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
force->special_lj[3] != 1.0)
error->all(FLERR,"Fix bond/swap requires special_bonds = 0,1,1");
// need a half neighbor list, built when ever re-neighboring occurs
int irequest = neighbor->request((void *) this);
neighbor->requests[irequest]->pair = 0;
neighbor->requests[irequest]->fix = 1;
// zero out stats
naccept = foursome = 0;
angleflag = 0;
if (force->angle) angleflag = 1;
}
/* ---------------------------------------------------------------------- */
void FixBondSwap::init_list(int id, NeighList *ptr)
{
list = ptr;
}
/* ---------------------------------------------------------------------- */
void FixBondSwap::pre_neighbor()
{
int i,j,ii,jj,m,inum,jnum;
int inext,iprev,ilast,jnext,jprev,jlast,ibond,iangle,jbond,jangle;
int itag,inexttag,iprevtag,ilasttag,jtag,jnexttag,jprevtag,jlasttag;
int ibondtype,jbondtype,iangletype,inextangletype,jangletype,jnextangletype;
int i1,i2,i3,j1,j2,j3,tmp;
int *ilist,*jlist,*numneigh,**firstneigh;
double delta,factor;
// compute current temp for Boltzmann factor test
double t_current = temperature->compute_scalar();
// local ptrs to atom arrays
int *tag = atom->tag;
int *mask = atom->mask;
int *molecule = atom->molecule;
int *num_bond = atom->num_bond;
int **bond_atom = atom->bond_atom;
int **bond_type = atom->bond_type;
int *num_angle = atom->num_angle;
int **angle_atom1 = atom->angle_atom1;
int **angle_atom2 = atom->angle_atom2;
int **angle_atom3 = atom->angle_atom3;
int **angle_type = atom->angle_type;
int **nspecial = atom->nspecial;
int **special = atom->special;
int newton_bond = force->newton_bond;
int nlocal = atom->nlocal;
type = atom->type;
x = atom->x;
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
// randomize list of my owned atoms that are in fix group
// grow atom list if necessary
if (nlocal > nmax) {
memory->destroy(alist);
nmax = atom->nmax;
memory->create(alist,nmax,"bondswap:alist");
}
int neligible = 0;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
if (mask[i] & groupbit)
alist[neligible++] = i;
}
for (i = 0; i < neligible; i++) {
j = static_cast<int> (random->uniform() * neligible);
tmp = alist[i];
alist[i] = alist[j];
alist[j] = tmp;
}
// examine ntest of my eligible atoms for potential swaps
// atom i is randomly selected via atom list
// look at all j neighbors of atom i
// atom j must be on-processor (j < nlocal)
// atom j must be in fix group
// i and j must be same distance from chain end (mol[i] = mol[j])
// NOTE: must use extra parens in if test on mask[j] & groupbit
int ntest = static_cast<int> (fraction * neligible);
int accept = 0;
for (int itest = 0; itest < ntest; itest++) {
i = alist[itest];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
if (j >= nlocal) continue;
if ((mask[j] & groupbit) == 0) continue;
if (molecule[i] != molecule[j]) continue;
// look at all bond partners of atoms i and j
// use num_bond for this, not special list, so also find bondtypes
// inext,jnext = bonded atoms
// inext,jnext must be on-processor (inext,jnext < nlocal)
// inext,jnext must be same dist from chain end (mol[inext] = mol[jnext])
// since swaps may occur between two ends of a single chain, insure
// the 4 atoms are unique (no duplicates): inext != jnext, inext != j
// all 4 old and new bonds must have length < cutoff
for (ibond = 0; ibond < num_bond[i]; ibond++) {
inext = atom->map(bond_atom[i][ibond]);
if (inext >= nlocal || inext < 0) continue;
ibondtype = bond_type[i][ibond];
for (jbond = 0; jbond < num_bond[j]; jbond++) {
jnext = atom->map(bond_atom[j][jbond]);
if (jnext >= nlocal || jnext < 0) continue;
jbondtype = bond_type[j][jbond];
if (molecule[inext] != molecule[jnext]) continue;
if (inext == jnext || inext == j) continue;
if (dist_rsq(i,inext) >= cutsq) continue;
if (dist_rsq(j,jnext) >= cutsq) continue;
if (dist_rsq(i,jnext) >= cutsq) continue;
if (dist_rsq(j,inext) >= cutsq) continue;
// if angles are enabled:
// find other atoms i,inext,j,jnext are in angles with
// and angletypes: i/j angletype, i/j nextangletype
// use num_angle for this, not special list, so also find angletypes
// 4 atoms consecutively along 1st chain: iprev,i,inext,ilast
// 4 atoms consecutively along 2nd chain: jprev,j,jnext,jlast
// prev or last atom can be non-existent at end of chain
// set prev/last = -1 in this case
// if newton bond = 0, then angles are stored by all 4 atoms
// so require that iprev,ilast,jprev,jlast be owned by this proc
// so all copies of angles can be updated if a swap takes place
if (angleflag) {
itag = tag[i];
inexttag = tag[inext];
jtag = tag[j];
jnexttag = tag[jnext];
iprev = -1;
for (iangle = 0; iangle < num_angle[i]; iangle++) {
i1 = angle_atom1[i][iangle];
i2 = angle_atom2[i][iangle];
i3 = angle_atom3[i][iangle];
if (i2 == itag && i3 == inexttag) iprev = atom->map(i1);
else if (i1 == inexttag && i2 == itag) iprev = atom->map(i3);
if (iprev >= 0) {
iangletype = angle_type[i][iangle];
break;
}
}
if (!newton_bond && iprev >= nlocal) continue;
ilast = -1;
for (iangle = 0; iangle < num_angle[inext]; iangle++) {
i1 = angle_atom1[inext][iangle];
i2 = angle_atom2[inext][iangle];
i3 = angle_atom3[inext][iangle];
if (i1 == itag && i2 == inexttag) ilast = atom->map(i3);
else if (i2 == inexttag && i3 == itag) ilast = atom->map(i1);
if (ilast >= 0) {
inextangletype = angle_type[inext][iangle];
break;
}
}
if (!newton_bond && ilast >= nlocal) continue;
jprev = -1;
for (jangle = 0; jangle < num_angle[j]; jangle++) {
j1 = angle_atom1[j][jangle];
j2 = angle_atom2[j][jangle];
j3 = angle_atom3[j][jangle];
if (j2 == jtag && j3 == jnexttag) jprev = atom->map(j1);
else if (j1 == jnexttag && j2 == jtag) jprev = atom->map(j3);
if (jprev >= 0) {
jangletype = angle_type[j][jangle];
break;
}
}
if (!newton_bond && jprev >= nlocal) continue;
jlast = -1;
for (jangle = 0; jangle < num_angle[jnext]; jangle++) {
j1 = angle_atom1[jnext][jangle];
j2 = angle_atom2[jnext][jangle];
j3 = angle_atom3[jnext][jangle];
if (j1 == jtag && j2 == jnexttag) jlast = atom->map(j3);
else if (j2 == jnexttag && j3 == jtag) jlast = atom->map(j1);
if (jlast >= 0) {
jnextangletype = angle_type[jnext][jangle];
break;
}
}
if (!newton_bond && jlast >= nlocal) continue;
}
// valid foursome found between 2 chains:
// chains = iprev-i-inext-ilast and jprev-j-jnext-jlast
// prev or last values are -1 if do not exist due to end of chain
// OK to call angle_eng with -1 atom, since just return 0.0
// current energy of foursome =
// E_nb(i,j) + E_nb(i,jnext) + E_nb(inext,j) + E_nb(inext,jnext) +
// E_bond(i,inext) + E_bond(j,jnext) +
// E_angle(iprev,i,inext) + E_angle(i,inext,ilast) +
// E_angle(jprev,j,jnext) + E_angle(j,jnext,jlast)
// new energy of foursome with swapped bonds =
// E_nb(i,j) + E_nb(i,inext) + E_nb(j,jnext) + E_nb(inext,jnext) +
// E_bond(i,jnext) + E_bond(j,inext) +
// E_angle(iprev,i,jnext) + E_angle(i,jnext,jlast) +
// E_angle(jprev,j,inext) + E_angle(j,inext,ilast)
// energy delta = add/subtract differing terms between 2 formulas
foursome++;
delta = pair_eng(i,inext) + pair_eng(j,jnext) -
pair_eng(i,jnext) - pair_eng(inext,j);
delta += bond_eng(ibondtype,i,jnext) + bond_eng(jbondtype,j,inext) -
bond_eng(ibondtype,i,inext) - bond_eng(jbondtype,j,jnext);
if (angleflag)
delta += angle_eng(iangletype,iprev,i,jnext) +
angle_eng(jnextangletype,i,jnext,jlast) +
angle_eng(jangletype,jprev,j,inext) +
angle_eng(inextangletype,j,inext,ilast) -
angle_eng(iangletype,iprev,i,inext) -
angle_eng(inextangletype,i,inext,ilast) -
angle_eng(jangletype,jprev,j,jnext) -
angle_eng(jnextangletype,j,jnext,jlast);
// if delta <= 0, accept swap
// if delta > 0, compute Boltzmann factor with current temperature
// only accept if greater than random value
// whether accept or not, exit test loop
if (delta < 0.0) accept = 1;
else {
factor = exp(-delta/force->boltz/t_current);
if (random->uniform() < factor) accept = 1;
}
goto done;
}
}
}
}
done:
if (!accept) return;
naccept++;
// change bond partners of affected atoms
// on atom i: bond i-inext changes to i-jnext
// on atom j: bond j-jnext changes to j-inext
// on atom inext: bond inext-i changes to inext-j
// on atom jnext: bond jnext-j changes to jnext-i
for (ibond = 0; ibond < num_bond[i]; ibond++)
if (bond_atom[i][ibond] == tag[inext]) bond_atom[i][ibond] = tag[jnext];
for (jbond = 0; jbond < num_bond[j]; jbond++)
if (bond_atom[j][jbond] == tag[jnext]) bond_atom[j][jbond] = tag[inext];
for (ibond = 0; ibond < num_bond[inext]; ibond++)
if (bond_atom[inext][ibond] == tag[i]) bond_atom[inext][ibond] = tag[j];
for (jbond = 0; jbond < num_bond[jnext]; jbond++)
if (bond_atom[jnext][jbond] == tag[j]) bond_atom[jnext][jbond] = tag[i];
// set global tags of 4 atoms in bonds
itag = tag[i];
inexttag = tag[inext];
jtag = tag[j];
jnexttag = tag[jnext];
// change 1st special neighbors of affected atoms: i,j,inext,jnext
// don't need to change 2nd/3rd special neighbors for any atom
// since special bonds = 0 1 1 means they are never used
for (m = 0; m < nspecial[i][0]; m++)
if (special[i][m] == inexttag) special[i][m] = jnexttag;
for (m = 0; m < nspecial[j][0]; m++)
if (special[j][m] == jnexttag) special[j][m] = inexttag;
for (m = 0; m < nspecial[inext][0]; m++)
if (special[inext][m] == itag) special[inext][m] = jtag;
for (m = 0; m < nspecial[jnext][0]; m++)
if (special[jnext][m] == jtag) special[jnext][m] = itag;
// done if no angles
if (!angleflag) return;
// set global tags of 4 additional atoms in angles, 0 if no angle
if (iprev >= 0) iprevtag = tag[iprev];
else iprevtag = 0;
if (ilast >= 0) ilasttag = tag[ilast];
else ilasttag = 0;
if (jprev >= 0) jprevtag = tag[jprev];
else jprevtag = 0;
if (jlast >= 0) jlasttag = tag[jlast];
else jlasttag = 0;
// change angle partners of affected atoms
// must check if each angle is stored as a-b-c or c-b-a
// on atom i:
// angle iprev-i-inext changes to iprev-i-jnext
// angle i-inext-ilast changes to i-jnext-jlast
// on atom j:
// angle jprev-j-jnext changes to jprev-j-inext
// angle j-jnext-jlast changes to j-inext-ilast
// on atom inext:
// angle iprev-i-inext changes to jprev-j-inext
// angle i-inext-ilast changes to j-inext-ilast
// on atom jnext:
// angle jprev-j-jnext changes to iprev-i-jnext
// angle j-jnext-jlast changes to i-jnext-jlast
for (iangle = 0; iangle < num_angle[i]; iangle++) {
i1 = angle_atom1[i][iangle];
i2 = angle_atom2[i][iangle];
i3 = angle_atom3[i][iangle];
if (i1 == iprevtag && i2 == itag && i3 == inexttag)
angle_atom3[i][iangle] = jnexttag;
else if (i1 == inexttag && i2 == itag && i3 == iprevtag)
angle_atom1[i][iangle] = jnexttag;
else if (i1 == itag && i2 == inexttag && i3 == ilasttag) {
angle_atom2[i][iangle] = jnexttag;
angle_atom3[i][iangle] = jlasttag;
} else if (i1 == ilasttag && i2 == inexttag && i3 == itag) {
angle_atom1[i][iangle] = jlasttag;
angle_atom2[i][iangle] = jnexttag;
}
}
for (jangle = 0; jangle < num_angle[j]; jangle++) {
j1 = angle_atom1[j][jangle];
j2 = angle_atom2[j][jangle];
j3 = angle_atom3[j][jangle];
if (j1 == jprevtag && j2 == jtag && j3 == jnexttag)
angle_atom3[j][jangle] = inexttag;
else if (j1 == jnexttag && j2 == jtag && j3 == jprevtag)
angle_atom1[j][jangle] = inexttag;
else if (j1 == jtag && j2 == jnexttag && j3 == jlasttag) {
angle_atom2[j][jangle] = inexttag;
angle_atom3[j][jangle] = ilasttag;
} else if (j1 == jlasttag && j2 == jnexttag && j3 == jtag) {
angle_atom1[j][jangle] = ilasttag;
angle_atom2[j][jangle] = inexttag;
}
}
for (iangle = 0; iangle < num_angle[inext]; iangle++) {
i1 = angle_atom1[inext][iangle];
i2 = angle_atom2[inext][iangle];
i3 = angle_atom3[inext][iangle];
if (i1 == iprevtag && i2 == itag && i3 == inexttag) {
angle_atom1[inext][iangle] = jprevtag;
angle_atom2[inext][iangle] = jtag;
} else if (i1 == inexttag && i2 == itag && i3 == iprevtag) {
angle_atom2[inext][iangle] = jtag;
angle_atom3[inext][iangle] = jprevtag;
} else if (i1 == itag && i2 == inexttag && i3 == ilasttag)
angle_atom1[inext][iangle] = jtag;
else if (i1 == ilasttag && i2 == inexttag && i3 == itag)
angle_atom3[inext][iangle] = jtag;
}
for (jangle = 0; jangle < num_angle[jnext]; jangle++) {
j1 = angle_atom1[jnext][jangle];
j2 = angle_atom2[jnext][jangle];
j3 = angle_atom3[jnext][jangle];
if (j1 == jprevtag && j2 == jtag && j3 == jnexttag) {
angle_atom1[jnext][jangle] = iprevtag;
angle_atom2[jnext][jangle] = itag;
} else if (j1 == jnexttag && j2 == jtag && j3 == jprevtag) {
angle_atom2[jnext][jangle] = itag;
angle_atom3[jnext][jangle] = iprevtag;
} else if (j1 == jtag && j2 == jnexttag && j3 == jlasttag)
angle_atom1[jnext][jangle] = itag;
else if (j1 == jlasttag && j2 == jnexttag && j3 == jtag)
angle_atom3[jnext][jangle] = itag;
}
// done if newton bond set
if (newton_bond) return;
// change angles stored by iprev,ilast,jprev,jlast
// on atom iprev: angle iprev-i-inext changes to iprev-i-jnext
// on atom jprev: angle jprev-j-jnext changes to jprev-j-inext
// on atom ilast: angle i-inext-ilast changes to j-inext-ilast
// on atom jlast: angle j-jnext-jlast changes to i-jnext-jlast
for (iangle = 0; iangle < num_angle[iprev]; iangle++) {
i1 = angle_atom1[iprev][iangle];
i2 = angle_atom2[iprev][iangle];
i3 = angle_atom3[iprev][iangle];
if (i1 == iprevtag && i2 == itag && i3 == inexttag)
angle_atom3[iprev][iangle] = jnexttag;
else if (i1 == inexttag && i2 == itag && i3 == iprevtag)
angle_atom1[iprev][iangle] = jnexttag;
}
for (jangle = 0; jangle < num_angle[jprev]; jangle++) {
j1 = angle_atom1[jprev][jangle];
j2 = angle_atom2[jprev][jangle];
j3 = angle_atom3[jprev][jangle];
if (j1 == jprevtag && j2 == jtag && j3 == jnexttag)
angle_atom3[jprev][jangle] = inexttag;
else if (j1 == jnexttag && j2 == jtag && j3 == jprevtag)
angle_atom1[jprev][jangle] = inexttag;
}
for (iangle = 0; iangle < num_angle[ilast]; iangle++) {
i1 = angle_atom1[ilast][iangle];
i2 = angle_atom2[ilast][iangle];
i3 = angle_atom3[ilast][iangle];
if (i1 == itag && i2 == inexttag && i3 == ilasttag)
angle_atom1[ilast][iangle] = jtag;
else if (i1 == ilasttag && i2 == inexttag && i3 == itag)
angle_atom3[ilast][iangle] = jtag;
}
for (jangle = 0; jangle < num_angle[jlast]; jangle++) {
j1 = angle_atom1[jlast][jangle];
j2 = angle_atom2[jlast][jangle];
j3 = angle_atom3[jlast][jangle];
if (j1 == jtag && j2 == jnexttag && j3 == jlasttag)
angle_atom1[jlast][jangle] = itag;
else if (j1 == jlasttag && j2 == jnexttag && j3 == jtag)
angle_atom3[jlast][jangle] = itag;
}
}
/* ---------------------------------------------------------------------- */
int FixBondSwap::modify_param(int narg, char **arg)
{
if (strcmp(arg[0],"temp") == 0) {
if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
if (tflag) {
modify->delete_compute(id_temp);
tflag = 0;
}
delete [] id_temp;
int n = strlen(arg[1]) + 1;
id_temp = new char[n];
strcpy(id_temp,arg[1]);
int icompute = modify->find_compute(id_temp);
if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
temperature = modify->compute[icompute];
if (temperature->tempflag == 0)
error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
if (temperature->igroup != igroup && comm->me == 0)
error->warning(FLERR,"Group for fix_modify temp != fix group");
return 2;
}
return 0;
}
/* ----------------------------------------------------------------------
compute squared distance between atoms I,J
must use minimum_image since J was found thru atom->map()
------------------------------------------------------------------------- */
double FixBondSwap::dist_rsq(int i, int j)
{
double delx = x[i][0] - x[j][0];
double dely = x[i][1] - x[j][1];
double delz = x[i][2] - x[j][2];
domain->minimum_image(delx,dely,delz);
return (delx*delx + dely*dely + delz*delz);
}
/* ----------------------------------------------------------------------
return pairwise interaction energy between atoms I,J
will always be full non-bond interaction, so factors = 1 in single() call
------------------------------------------------------------------------- */
double FixBondSwap::pair_eng(int i, int j)
{
double tmp;
double rsq = dist_rsq(i,j);
return force->pair->single(i,j,type[i],type[j],rsq,1.0,1.0,tmp);
}
/* ---------------------------------------------------------------------- */
double FixBondSwap::bond_eng(int btype, int i, int j)
{
double rsq = dist_rsq(i,j);
return force->bond->single(btype,rsq,i,j);
}
/* ---------------------------------------------------------------------- */
double FixBondSwap::angle_eng(int atype, int i, int j, int k)
{
// test for non-existent angle at end of chain
if (i == -1 || k == -1) return 0.0;
return force->angle->single(atype,i,j,k);
}
/* ----------------------------------------------------------------------
return bond swapping stats
n = 1 is # of swaps
n = 2 is # of attempted swaps
------------------------------------------------------------------------- */
double FixBondSwap::compute_vector(int n)
{
double one,all;
if (n == 0) one = naccept;
else one = foursome;
MPI_Allreduce(&one,&all,1,MPI_DOUBLE,MPI_SUM,world);
return all;
}
/* ----------------------------------------------------------------------
memory usage of alist
------------------------------------------------------------------------- */
double FixBondSwap::memory_usage()
{
double bytes = nmax * sizeof(int);
return bytes;
}
diff --git a/src/MC/fix_bond_swap.h b/src/MC/fix_bond_swap.h
index b8f991364..ce549c484 100644
--- a/src/MC/fix_bond_swap.h
+++ b/src/MC/fix_bond_swap.h
@@ -1,63 +1,117 @@
/* ----------------------------------------------------------------------
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(bond/swap,FixBondSwap)
#else
#ifndef LMP_FIX_BONDSWAP_H
#define LMP_FIX_BONDSWAP_H
#include "fix.h"
#include "pair.h"
namespace LAMMPS_NS {
class FixBondSwap : public Fix {
public:
FixBondSwap(class LAMMPS *, int, char **);
~FixBondSwap();
int setmask();
void init();
void init_list(int, class NeighList *);
void pre_neighbor();
int modify_param(int, char **);
double compute_vector(int);
double memory_usage();
private:
double fraction,cutsq;
int nmax,tflag;
int *alist;
int naccept,foursome;
int angleflag;
char *id_temp;
int *type;
double **x;
class NeighList *list;
class Compute *temperature;
class RanMars *random;
double dist_rsq(int, int);
double pair_eng(int, int);
double bond_eng(int, int, int);
double angle_eng(int, int, int, int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Must use atom style with molecule IDs with fix bond/swap
+
+Self-explanatory.
+
+E: Temperature ID for fix bond/swap does not exist
+
+Self-explanatory.
+
+E: Fix bond/swap requires pair and bond styles
+
+Self-explanatory.
+
+E: Pair style does not support fix bond/swap
+
+The pair style does not have a single() function, so it can
+not be invoked by fix bond/swap.
+
+W: Fix bond/swap will ignore defined angles
+
+See the doc page for fix bond/swap for more info on this
+restriction.
+
+E: Fix bond/swap cannot use dihedral or improper styles
+
+These styles cannot be defined when using this fix.
+
+E: Fix bond/swap requires special_bonds = 0,1,1
+
+Self-explanatory.
+
+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: Group for fix_modify temp != fix group
+
+The fix_modify command is specifying a temperature computation that
+computes a temperature on a different group of atoms than the fix
+itself operates on. This is probably not what you want to do.
+
+*/
diff --git a/src/MC/fix_gcmc.h b/src/MC/fix_gcmc.h
index 77b9f300e..0b1fa206c 100644
--- a/src/MC/fix_gcmc.h
+++ b/src/MC/fix_gcmc.h
@@ -1,78 +1,112 @@
/* ----------------------------------------------------------------------
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(gcmc,FixGCMC)
#else
#ifndef LMP_FIX_GCMC_H
#define LMP_FIX_GCMC_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
class FixGCMC : public Fix {
public:
FixGCMC(class LAMMPS *, int, char **);
~FixGCMC();
int setmask();
void init();
void pre_exchange();
void attempt_move();
void attempt_deletion();
void attempt_insertion();
double energy(int, double *);
double compute_vector(int);
double memory_usage();
void write_restart(FILE *);
void restart(char *);
private:
int ntype,nevery,seed;
int ncycles,nexchanges,nmcmoves;
int ngas; // # of gas molecules (or atoms) on all procs
int ngas_local; // # of gas molecules (or atoms) on this proc
int ngas_before; // # of gas molecules (or atoms) on procs < this proc
int molflag; // 0 = atomic, 1 = molecular system
double nmove_attempts;
double nmove_successes;
double ndel_attempts;
double ndel_successes;
double ninsert_attempts;
double ninsert_successes;
int nmax;
double reservoir_temperature;
double chemical_potential;
double displace;
double beta,zz,sigma,volume;
double xlo,xhi,ylo,yhi,zlo,zhi;
double *sublo,*subhi;
int *local_gas_list;
double **cutsq;
class Pair *pair;
class RanPark *random_equal;
class RanPark *random_unequal;
void options(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Invalid atom type in fix GCMC command
+
+UNDOCUMENTED
+
+E: Cannot do GCMC on atoms in atom_modify first group
+
+UNDOCUMENTED
+
+W: Fix GCMC may delete atom with non-zero molecule ID
+
+UNDOCUMENTED
+
+E: Fix GCMC molecule command requires atom attribute molecule
+
+UNDOCUMENTED
+
+E: Fix GCMC molecule feature does not yet work
+
+UNDOCUMENTED
+
+E: Fix GCMC incompatible with given pair_style
+
+UNDOCUMENTED
+
+*/
diff --git a/src/MC/pair_dsmc.h b/src/MC/pair_dsmc.h
index 7e2b784f7..66c2f767d 100644
--- a/src/MC/pair_dsmc.h
+++ b/src/MC/pair_dsmc.h
@@ -1,109 +1,135 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(dsmc,PairDSMC)
#else
#ifndef LMP_PAIR_DSMC_H
#define LMP_PAIR_DSMC_H
#include "pair.h"
namespace LAMMPS_NS {
class PairDSMC : public Pair {
public:
PairDSMC(class LAMMPS *);
virtual ~PairDSMC();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
virtual void read_restart_settings(FILE *);
private:
double cut_global;
double **cut;
double **sigma;
double cellx;
double celly;
double cellz;
int ncellsx;
int ncellsy;
int ncellsz;
int total_ncells;
int total_number_of_collisions;
int recompute_vsigmamax_stride;
int vsigmamax_samples;
double T_ref;
double kT_ref;
double two_pi;
double max_cell_size;
int seed;
int number_of_A;
int number_of_B;
int max_particle_list;
class RanMars *random;
int **particle_list;
int **first;
int **number;
double **V_sigma_max;
int max_particles;
int *next_particle;
int itype;
int jtype;
double imass;
double jmass;
double total_mass;
double reduced_mass;
double imass_tmass;
double jmass_tmass;
double vol;
double weighting;
void allocate();
void recompute_V_sigma_max(int);
double V_sigma(int, int);
void scatter_random(int, int, int);
int convert_double_to_equivalent_int(double);
inline void subtract3d(const double *v1, const double *v2, double *v3) {
v3[0] = v2[0] - v1[0];
v3[1] = v2[1] - v1[1];
v3[2] = v2[2] - v1[2];
}
inline double dot3d(const double *v1, const double *v2) {
return( v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2] );
}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: Pair dsmc: num_of_collisions > number_of_A
+
+Collision model in DSMC is breaking down.
+
+W: Pair dsmc: num_of_collisions > number_of_B
+
+Collision model in DSMC is breaking down.
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Tried to convert a double to int, but input_double > INT_MAX
+
+Self-explanatory.
+
+*/
diff --git a/src/MEAM/pair_meam.cpp b/src/MEAM/pair_meam.cpp
index fda4c6b3c..4afb5e1d0 100644
--- a/src/MEAM/pair_meam.cpp
+++ b/src/MEAM/pair_meam.cpp
@@ -1,944 +1,945 @@
/* ----------------------------------------------------------------------
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: Greg Wagner (SNL)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_meam.h"
#include "atom.h"
#include "force.h"
#include "comm.h"
#include "memory.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define MAXLINE 1024
enum{FCC,BCC,HCP,DIM,DIAMOND,B1,C11,L12,B2};
int nkeywords = 21;
-char *keywords[] = {"Ec","alpha","rho0","delta","lattce",
- "attrac","repuls","nn2","Cmin","Cmax","rc","delr",
- "augt1","gsmooth_factor","re","ialloy","mixture_ref_t",
- "erose_form","zbl","emb_lin_neg","bkgd_dyn"};
+const char *keywords[] = {"Ec","alpha","rho0","delta","lattce",
+ "attrac","repuls","nn2","Cmin","Cmax","rc","delr",
+ "augt1","gsmooth_factor","re","ialloy",
+ "mixture_ref_t","erose_form","zbl",
+ "emb_lin_neg","bkgd_dyn"};
/* ---------------------------------------------------------------------- */
PairMEAM::PairMEAM(LAMMPS *lmp) : Pair(lmp)
{
single_enable = 0;
restartinfo = 0;
one_coeff = 1;
nmax = 0;
rho = rho0 = rho1 = rho2 = rho3 = frhop = NULL;
gamma = dgamma1 = dgamma2 = dgamma3 = arho2b = NULL;
arho1 = arho2 = arho3 = arho3b = t_ave = tsq_ave = NULL;
maxneigh = 0;
scrfcn = dscrfcn = fcpair = NULL;
nelements = 0;
elements = NULL;
mass = NULL;
// set comm size needed by this Pair
comm_forward = 38;
comm_reverse = 30;
}
/* ----------------------------------------------------------------------
free all arrays
check if allocated, since class can be destructed when incomplete
------------------------------------------------------------------------- */
PairMEAM::~PairMEAM()
{
meam_cleanup_();
memory->destroy(rho);
memory->destroy(rho0);
memory->destroy(rho1);
memory->destroy(rho2);
memory->destroy(rho3);
memory->destroy(frhop);
memory->destroy(gamma);
memory->destroy(dgamma1);
memory->destroy(dgamma2);
memory->destroy(dgamma3);
memory->destroy(arho2b);
memory->destroy(arho1);
memory->destroy(arho2);
memory->destroy(arho3);
memory->destroy(arho3b);
memory->destroy(t_ave);
memory->destroy(tsq_ave);
memory->destroy(scrfcn);
memory->destroy(dscrfcn);
memory->destroy(fcpair);
for (int i = 0; i < nelements; i++) delete [] elements[i];
delete [] elements;
delete [] mass;
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] map;
delete [] fmap;
}
}
/* ---------------------------------------------------------------------- */
void PairMEAM::compute(int eflag, int vflag)
{
int i,j,ii,n,inum_half,errorflag;
double evdwl;
int *ilist_half,*numneigh_half,**firstneigh_half;
int *numneigh_full,**firstneigh_full;
evdwl = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = eflag_global = vflag_global =
eflag_atom = vflag_atom = 0;
// grow local arrays if necessary
if (atom->nmax > nmax) {
memory->destroy(rho);
memory->destroy(rho0);
memory->destroy(rho1);
memory->destroy(rho2);
memory->destroy(rho3);
memory->destroy(frhop);
memory->destroy(gamma);
memory->destroy(dgamma1);
memory->destroy(dgamma2);
memory->destroy(dgamma3);
memory->destroy(arho2b);
memory->destroy(arho1);
memory->destroy(arho2);
memory->destroy(arho3);
memory->destroy(arho3b);
memory->destroy(t_ave);
memory->destroy(tsq_ave);
nmax = atom->nmax;
memory->create(rho,nmax,"pair:rho");
memory->create(rho0,nmax,"pair:rho0");
memory->create(rho1,nmax,"pair:rho1");
memory->create(rho2,nmax,"pair:rho2");
memory->create(rho3,nmax,"pair:rho3");
memory->create(frhop,nmax,"pair:frhop");
memory->create(gamma,nmax,"pair:gamma");
memory->create(dgamma1,nmax,"pair:dgamma1");
memory->create(dgamma2,nmax,"pair:dgamma2");
memory->create(dgamma3,nmax,"pair:dgamma3");
memory->create(arho2b,nmax,"pair:arho2b");
memory->create(arho1,nmax,3,"pair:arho1");
memory->create(arho2,nmax,6,"pair:arho2");
memory->create(arho3,nmax,10,"pair:arho3");
memory->create(arho3b,nmax,3,"pair:arho3b");
memory->create(t_ave,nmax,3,"pair:t_ave");
memory->create(tsq_ave,nmax,3,"pair:tsq_ave");
}
// neighbor list info
inum_half = listhalf->inum;
ilist_half = listhalf->ilist;
numneigh_half = listhalf->numneigh;
firstneigh_half = listhalf->firstneigh;
numneigh_full = listfull->numneigh;
firstneigh_full = listfull->firstneigh;
// strip neighbor lists of any special bond flags before using with MEAM
// necessary before doing neigh_f2c and neigh_c2f conversions each step
if (neighbor->ago == 0) {
neigh_strip(inum_half,ilist_half,numneigh_half,firstneigh_half);
neigh_strip(inum_half,ilist_half,numneigh_full,firstneigh_full);
}
// check size of scrfcn based on half neighbor list
int nlocal = atom->nlocal;
int nall = nlocal + atom->nghost;
n = 0;
for (ii = 0; ii < inum_half; ii++) n += numneigh_half[ilist_half[ii]];
if (n > maxneigh) {
memory->destroy(scrfcn);
memory->destroy(dscrfcn);
memory->destroy(fcpair);
maxneigh = n;
memory->create(scrfcn,maxneigh,"pair:scrfcn");
memory->create(dscrfcn,maxneigh,"pair:dscrfcn");
memory->create(fcpair,maxneigh,"pair:fcpair");
}
// zero out local arrays
for (i = 0; i < nall; i++) {
rho0[i] = 0.0;
arho2b[i] = 0.0;
arho1[i][0] = arho1[i][1] = arho1[i][2] = 0.0;
for (j = 0; j < 6; j++) arho2[i][j] = 0.0;
for (j = 0; j < 10; j++) arho3[i][j] = 0.0;
arho3b[i][0] = arho3b[i][1] = arho3b[i][2] = 0.0;
t_ave[i][0] = t_ave[i][1] = t_ave[i][2] = 0.0;
tsq_ave[i][0] = tsq_ave[i][1] = tsq_ave[i][2] = 0.0;
}
double **x = atom->x;
double **f = atom->f;
int *type = atom->type;
int ntype = atom->ntypes;
// change neighbor list indices to Fortran indexing
neigh_c2f(inum_half,ilist_half,numneigh_half,firstneigh_half);
neigh_c2f(inum_half,ilist_half,numneigh_full,firstneigh_full);
// 3 stages of MEAM calculation
// loop over my atoms followed by communication
int ifort;
int offset = 0;
errorflag = 0;
for (ii = 0; ii < inum_half; ii++) {
i = ilist_half[ii];
ifort = i+1;
meam_dens_init_(&ifort,&nmax,&ntype,type,fmap,&x[0][0],
&numneigh_half[i],firstneigh_half[i],
&numneigh_full[i],firstneigh_full[i],
&scrfcn[offset],&dscrfcn[offset],&fcpair[offset],
rho0,&arho1[0][0],&arho2[0][0],arho2b,
&arho3[0][0],&arho3b[0][0],&t_ave[0][0],&tsq_ave[0][0],
&errorflag);
if (errorflag) {
char str[128];
sprintf(str,"MEAM library error %d",errorflag);
error->one(FLERR,str);
}
offset += numneigh_half[i];
}
comm->reverse_comm_pair(this);
meam_dens_final_(&nlocal,&nmax,&eflag_either,&eflag_global,&eflag_atom,
&eng_vdwl,eatom,&ntype,type,fmap,
&arho1[0][0],&arho2[0][0],arho2b,&arho3[0][0],
&arho3b[0][0],&t_ave[0][0],&tsq_ave[0][0],gamma,dgamma1,
dgamma2,dgamma3,rho,rho0,rho1,rho2,rho3,frhop,&errorflag);
if (errorflag) {
char str[128];
sprintf(str,"MEAM library error %d",errorflag);
error->one(FLERR,str);
}
comm->forward_comm_pair(this);
offset = 0;
// vptr is first value in vatom if it will be used by meam_force()
// else vatom may not exist, so pass dummy ptr
double *vptr;
if (vflag_atom) vptr = &vatom[0][0];
else vptr = &cutmax;
for (ii = 0; ii < inum_half; ii++) {
i = ilist_half[ii];
ifort = i+1;
meam_force_(&ifort,&nmax,&eflag_either,&eflag_global,&eflag_atom,
&vflag_atom,&eng_vdwl,eatom,&ntype,type,fmap,&x[0][0],
&numneigh_half[i],firstneigh_half[i],
&numneigh_full[i],firstneigh_full[i],
&scrfcn[offset],&dscrfcn[offset],&fcpair[offset],
dgamma1,dgamma2,dgamma3,rho0,rho1,rho2,rho3,frhop,
&arho1[0][0],&arho2[0][0],arho2b,&arho3[0][0],&arho3b[0][0],
&t_ave[0][0],&tsq_ave[0][0],&f[0][0],vptr,&errorflag);
if (errorflag) {
char str[128];
sprintf(str,"MEAM library error %d",errorflag);
error->one(FLERR,str);
}
offset += numneigh_half[i];
}
// change neighbor list indices back to C indexing
neigh_f2c(inum_half,ilist_half,numneigh_half,firstneigh_half);
neigh_f2c(inum_half,ilist_half,numneigh_full,firstneigh_full);
if (vflag_fdotr) virial_fdotr_compute();
}
/* ---------------------------------------------------------------------- */
void PairMEAM::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
map = new int[n+1];
fmap = new int[n];
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairMEAM::settings(int narg, char **arg)
{
if (narg != 0) error->all(FLERR,"Illegal pair_style command");
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairMEAM::coeff(int narg, char **arg)
{
int i,j,m,n;
if (!allocated) allocate();
if (narg < 6) error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all(FLERR,"Incorrect args for pair coefficients");
// read MEAM element names between 2 filenames
// nelements = # of MEAM elements
// elements = list of unique element names
if (nelements) {
for (i = 0; i < nelements; i++) delete [] elements[i];
delete [] elements;
delete [] mass;
}
nelements = narg - 4 - atom->ntypes;
if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients");
elements = new char*[nelements];
mass = new double[nelements];
for (i = 0; i < nelements; i++) {
n = strlen(arg[i+3]) + 1;
elements[i] = new char[n];
strcpy(elements[i],arg[i+3]);
}
// read MEAM library and parameter files
// pass all parameters to MEAM package
// tell MEAM package that setup is done
read_files(arg[2],arg[2+nelements+1]);
meam_setup_done_(&cutmax);
// read args that map atom types to MEAM elements
// map[i] = which element the Ith atom type is, -1 if not mapped
for (i = 4 + nelements; i < narg; i++) {
m = i - (4+nelements) + 1;
for (j = 0; j < nelements; j++)
if (strcmp(arg[i],elements[j]) == 0) break;
if (j < nelements) map[m] = j;
else if (strcmp(arg[i],"NULL") == 0) map[m] = -1;
else error->all(FLERR,"Incorrect args for pair coefficients");
}
// clear setflag since coeff() called once with I,J = * *
n = atom->ntypes;
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
// set setflag i,j for type pairs where both are mapped to elements
// set mass for i,i in atom class
int count = 0;
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
if (map[i] >= 0 && map[j] >= 0) {
setflag[i][j] = 1;
if (i == j) atom->set_mass(i,mass[map[i]]);
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairMEAM::init_style()
{
if (force->newton_pair == 0)
error->all(FLERR,"Pair style MEAM requires newton pair on");
// need full and half neighbor list
int irequest_full = neighbor->request(this);
neighbor->requests[irequest_full]->id = 1;
neighbor->requests[irequest_full]->half = 0;
neighbor->requests[irequest_full]->full = 1;
int irequest_half = neighbor->request(this);
neighbor->requests[irequest_half]->id = 2;
neighbor->requests[irequest_half]->half = 0;
neighbor->requests[irequest_half]->half_from_full = 1;
neighbor->requests[irequest_half]->otherlist = irequest_full;
// setup Fortran-style mapping array needed by MEAM package
// fmap is indexed from 1:ntypes by Fortran and stores a Fortran index
// if type I is not a MEAM atom, fmap stores a 0
for (int i = 1; i <= atom->ntypes; i++) fmap[i-1] = map[i] + 1;
}
/* ----------------------------------------------------------------------
neighbor callback to inform pair style of neighbor list to use
half or full
------------------------------------------------------------------------- */
void PairMEAM::init_list(int id, NeighList *ptr)
{
if (id == 1) listfull = ptr;
else if (id == 2) listhalf = ptr;
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairMEAM::init_one(int i, int j)
{
return cutmax;
}
/* ---------------------------------------------------------------------- */
void PairMEAM::read_files(char *globalfile, char *userfile)
{
// open global meamf file on proc 0
FILE *fp;
if (comm->me == 0) {
fp = fopen(globalfile,"r");
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open MEAM potential file %s",globalfile);
error->one(FLERR,str);
}
}
// allocate parameter arrays
int params_per_line = 19;
int *lat = new int[nelements];
int *ielement = new int[nelements];
int *ibar = new int[nelements];
double *z = new double[nelements];
double *atwt = new double[nelements];
double *alpha = new double[nelements];
double *b0 = new double[nelements];
double *b1 = new double[nelements];
double *b2 = new double[nelements];
double *b3 = new double[nelements];
double *alat = new double[nelements];
double *esub = new double[nelements];
double *asub = new double[nelements];
double *t0 = new double[nelements];
double *t1 = new double[nelements];
double *t2 = new double[nelements];
double *t3 = new double[nelements];
double *rozero = new double[nelements];
bool *found = new bool[nelements];
for (int i = 0; i < nelements; i++) found[i] = false;
// read each set of params from global MEAM file
// one set of params can span multiple lines
// store params if element name is in element list
// if element name appears multiple times, only store 1st entry
int i,n,nwords;
char **words = new char*[params_per_line+1];
char line[MAXLINE],*ptr;
int eof = 0;
int nset = 0;
while (1) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fp);
if (ptr == NULL) {
eof = 1;
fclose(fp);
} else n = strlen(line) + 1;
}
MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) break;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
// strip comment, skip line if blank
if (ptr = strchr(line,'#')) *ptr = '\0';
nwords = atom->count_words(line);
if (nwords == 0) continue;
// concatenate additional lines until have params_per_line words
while (nwords < params_per_line) {
n = strlen(line);
if (comm->me == 0) {
ptr = fgets(&line[n],MAXLINE-n,fp);
if (ptr == NULL) {
eof = 1;
fclose(fp);
} else n = strlen(line) + 1;
}
MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) break;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
if (ptr = strchr(line,'#')) *ptr = '\0';
nwords = atom->count_words(line);
}
if (nwords != params_per_line)
error->all(FLERR,"Incorrect format in MEAM potential file");
// words = ptrs to all words in line
// strip single and double quotes from words
nwords = 0;
words[nwords++] = strtok(line,"' \t\n\r\f");
while (words[nwords++] = strtok(NULL,"' \t\n\r\f")) continue;
// skip if element name isn't in element list
for (i = 0; i < nelements; i++)
if (strcmp(words[0],elements[i]) == 0) break;
if (i == nelements) continue;
// skip if element already appeared
if (found[i] == true) continue;
found[i] = true;
// map lat string to an integer
if (strcmp(words[1],"fcc") == 0) lat[i] = FCC;
else if (strcmp(words[1],"bcc") == 0) lat[i] = BCC;
else if (strcmp(words[1],"hcp") == 0) lat[i] = HCP;
else if (strcmp(words[1],"dim") == 0) lat[i] = DIM;
else if (strcmp(words[1],"dia") == 0) lat[i] = DIAMOND;
else error->all(FLERR,"Unrecognized lattice type in MEAM file 1");
// store parameters
z[i] = atof(words[2]);
ielement[i] = atoi(words[3]);
atwt[i] = atof(words[4]);
alpha[i] = atof(words[5]);
b0[i] = atof(words[6]);
b1[i] = atof(words[7]);
b2[i] = atof(words[8]);
b3[i] = atof(words[9]);
alat[i] = atof(words[10]);
esub[i] = atof(words[11]);
asub[i] = atof(words[12]);
t0[i] = atof(words[13]);
t1[i] = atof(words[14]);
t2[i] = atof(words[15]);
t3[i] = atof(words[16]);
rozero[i] = atof(words[17]);
ibar[i] = atoi(words[18]);
nset++;
}
// error if didn't find all elements in file
if (nset != nelements)
error->all(FLERR,"Did not find all elements in MEAM library file");
// pass element parameters to MEAM package
meam_setup_global_(&nelements,lat,z,ielement,atwt,alpha,b0,b1,b2,b3,
alat,esub,asub,t0,t1,t2,t3,rozero,ibar);
// set element masses
for (i = 0; i < nelements; i++) mass[i] = atwt[i];
// clean-up memory
delete [] words;
delete [] lat;
delete [] ielement;
delete [] ibar;
delete [] z;
delete [] atwt;
delete [] alpha;
delete [] b0;
delete [] b1;
delete [] b2;
delete [] b3;
delete [] alat;
delete [] esub;
delete [] asub;
delete [] t0;
delete [] t1;
delete [] t2;
delete [] t3;
delete [] rozero;
delete [] found;
// done if user param file is NULL
if (strcmp(userfile,"NULL") == 0) return;
// open user param file on proc 0
if (comm->me == 0) {
fp = fopen(userfile,"r");
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open MEAM potential file %s",userfile);
error->one(FLERR,str);
}
}
// read settings
// pass them one at a time to MEAM package
// match strings to list of corresponding ints
int which;
double value;
int nindex,index[3];
int maxparams = 6;
char **params = new char*[maxparams];
int nparams;
eof = 0;
while (1) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fp);
if (ptr == NULL) {
eof = 1;
fclose(fp);
} else n = strlen(line) + 1;
}
MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) break;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
// strip comment, skip line if blank
if (ptr = strchr(line,'#')) *ptr = '\0';
nparams = atom->count_words(line);
if (nparams == 0) continue;
// words = ptrs to all words in line
nparams = 0;
params[nparams++] = strtok(line,"=(), '\t\n\r\f");
while (nparams < maxparams &&
(params[nparams++] = strtok(NULL,"=(), '\t\n\r\f")))
continue;
nparams--;
for (which = 0; which < nkeywords; which++)
if (strcmp(params[0],keywords[which]) == 0) break;
if (which == nkeywords) {
char str[128];
sprintf(str,"Keyword %s in MEAM parameter file not recognized",
params[0]);
error->all(FLERR,str);
}
nindex = nparams - 2;
for (i = 0; i < nindex; i++) index[i] = atoi(params[i+1]);
// map lattce_meam value to an integer
if (which == 4) {
if (strcmp(params[nparams-1],"fcc") == 0) value = FCC;
else if (strcmp(params[nparams-1],"bcc") == 0) value = BCC;
else if (strcmp(params[nparams-1],"hcp") == 0) value = HCP;
else if (strcmp(params[nparams-1],"dim") == 0) value = DIM;
else if (strcmp(params[nparams-1],"dia") == 0) value = DIAMOND;
else if (strcmp(params[nparams-1],"b1") == 0) value = B1;
else if (strcmp(params[nparams-1],"c11") == 0) value = C11;
else if (strcmp(params[nparams-1],"l12") == 0) value = L12;
else if (strcmp(params[nparams-1],"b2") == 0) value = B2;
else error->all(FLERR,"Unrecognized lattice type in MEAM file 2");
}
else value = atof(params[nparams-1]);
// pass single setting to MEAM package
int errorflag = 0;
meam_setup_param_(&which,&value,&nindex,index,&errorflag);
if (errorflag) {
char str[128];
sprintf(str,"MEAM library error %d",errorflag);
error->all(FLERR,str);
}
}
delete [] params;
}
/* ---------------------------------------------------------------------- */
int PairMEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
{
int i,j,k,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = rho0[j];
buf[m++] = rho1[j];
buf[m++] = rho2[j];
buf[m++] = rho3[j];
buf[m++] = frhop[j];
buf[m++] = gamma[j];
buf[m++] = dgamma1[j];
buf[m++] = dgamma2[j];
buf[m++] = dgamma3[j];
buf[m++] = arho2b[j];
buf[m++] = arho1[j][0];
buf[m++] = arho1[j][1];
buf[m++] = arho1[j][2];
buf[m++] = arho2[j][0];
buf[m++] = arho2[j][1];
buf[m++] = arho2[j][2];
buf[m++] = arho2[j][3];
buf[m++] = arho2[j][4];
buf[m++] = arho2[j][5];
for (k = 0; k < 10; k++) buf[m++] = arho3[j][k];
buf[m++] = arho3b[j][0];
buf[m++] = arho3b[j][1];
buf[m++] = arho3b[j][2];
buf[m++] = t_ave[j][0];
buf[m++] = t_ave[j][1];
buf[m++] = t_ave[j][2];
buf[m++] = tsq_ave[j][0];
buf[m++] = tsq_ave[j][1];
buf[m++] = tsq_ave[j][2];
}
return comm_forward;
}
/* ---------------------------------------------------------------------- */
void PairMEAM::unpack_comm(int n, int first, double *buf)
{
int i,k,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
rho0[i] = buf[m++];
rho1[i] = buf[m++];
rho2[i] = buf[m++];
rho3[i] = buf[m++];
frhop[i] = buf[m++];
gamma[i] = buf[m++];
dgamma1[i] = buf[m++];
dgamma2[i] = buf[m++];
dgamma3[i] = buf[m++];
arho2b[i] = buf[m++];
arho1[i][0] = buf[m++];
arho1[i][1] = buf[m++];
arho1[i][2] = buf[m++];
arho2[i][0] = buf[m++];
arho2[i][1] = buf[m++];
arho2[i][2] = buf[m++];
arho2[i][3] = buf[m++];
arho2[i][4] = buf[m++];
arho2[i][5] = buf[m++];
for (k = 0; k < 10; k++) arho3[i][k] = buf[m++];
arho3b[i][0] = buf[m++];
arho3b[i][1] = buf[m++];
arho3b[i][2] = buf[m++];
t_ave[i][0] = buf[m++];
t_ave[i][1] = buf[m++];
t_ave[i][2] = buf[m++];
tsq_ave[i][0] = buf[m++];
tsq_ave[i][1] = buf[m++];
tsq_ave[i][2] = buf[m++];
}
}
/* ---------------------------------------------------------------------- */
int PairMEAM::pack_reverse_comm(int n, int first, double *buf)
{
int i,k,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
buf[m++] = rho0[i];
buf[m++] = arho2b[i];
buf[m++] = arho1[i][0];
buf[m++] = arho1[i][1];
buf[m++] = arho1[i][2];
buf[m++] = arho2[i][0];
buf[m++] = arho2[i][1];
buf[m++] = arho2[i][2];
buf[m++] = arho2[i][3];
buf[m++] = arho2[i][4];
buf[m++] = arho2[i][5];
for (k = 0; k < 10; k++) buf[m++] = arho3[i][k];
buf[m++] = arho3b[i][0];
buf[m++] = arho3b[i][1];
buf[m++] = arho3b[i][2];
buf[m++] = t_ave[i][0];
buf[m++] = t_ave[i][1];
buf[m++] = t_ave[i][2];
buf[m++] = tsq_ave[i][0];
buf[m++] = tsq_ave[i][1];
buf[m++] = tsq_ave[i][2];
}
return comm_reverse;
}
/* ---------------------------------------------------------------------- */
void PairMEAM::unpack_reverse_comm(int n, int *list, double *buf)
{
int i,j,k,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
rho0[j] += buf[m++];
arho2b[j] += buf[m++];
arho1[j][0] += buf[m++];
arho1[j][1] += buf[m++];
arho1[j][2] += buf[m++];
arho2[j][0] += buf[m++];
arho2[j][1] += buf[m++];
arho2[j][2] += buf[m++];
arho2[j][3] += buf[m++];
arho2[j][4] += buf[m++];
arho2[j][5] += buf[m++];
for (k = 0; k < 10; k++) arho3[j][k] += buf[m++];
arho3b[j][0] += buf[m++];
arho3b[j][1] += buf[m++];
arho3b[j][2] += buf[m++];
t_ave[j][0] += buf[m++];
t_ave[j][1] += buf[m++];
t_ave[j][2] += buf[m++];
tsq_ave[j][0] += buf[m++];
tsq_ave[j][1] += buf[m++];
tsq_ave[j][2] += buf[m++];
}
}
/* ----------------------------------------------------------------------
memory usage of local atom-based arrays
------------------------------------------------------------------------- */
double PairMEAM::memory_usage()
{
double bytes = 11 * nmax * sizeof(double);
bytes += (3 + 6 + 10 + 3 + 3 + 3) * nmax * sizeof(double);
bytes += 3 * maxneigh * sizeof(double);
return bytes;
}
/* ----------------------------------------------------------------------
strip special bond flags from neighbor list entries
are not used with MEAM
need to do here so Fortran lib doesn't see them
done once per reneighbor so that neigh_f2c and neigh_c2f don't see them
------------------------------------------------------------------------- */
void PairMEAM::neigh_strip(int inum, int *ilist,
int *numneigh, int **firstneigh)
{
int i,j,ii,jnum;
int *jlist;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
jlist = firstneigh[i];
jnum = numneigh[i];
for (j = 0; j < jnum; j++) jlist[j] &= NEIGHMASK;
}
}
/* ----------------------------------------------------------------------
toggle neighbor list indices between zero- and one-based values
needed for access by MEAM Fortran library
------------------------------------------------------------------------- */
void PairMEAM::neigh_f2c(int inum, int *ilist, int *numneigh, int **firstneigh)
{
int i,j,ii,jnum;
int *jlist;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
jlist = firstneigh[i];
jnum = numneigh[i];
for (j = 0; j < jnum; j++) jlist[j]--;
}
}
void PairMEAM::neigh_c2f(int inum, int *ilist, int *numneigh, int **firstneigh)
{
int i,j,ii,jnum;
int *jlist;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
jlist = firstneigh[i];
jnum = numneigh[i];
for (j = 0; j < jnum; j++) jlist[j]++;
}
}
diff --git a/src/MEAM/pair_meam.h b/src/MEAM/pair_meam.h
index 267f0e3f3..7c99150d4 100644
--- a/src/MEAM/pair_meam.h
+++ b/src/MEAM/pair_meam.h
@@ -1,105 +1,155 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(meam,PairMEAM)
#else
#ifndef LMP_PAIR_MEAM_H
#define LMP_PAIR_MEAM_H
extern "C" {
void meam_setup_global_(int *, int *, double *, int *, double *, double *,
double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *,
double *, double *, int *);
void meam_setup_param_(int *, double *, int *, int *, int *);
void meam_setup_done_(double *);
void meam_dens_init_(int *, int *, int *, int *, int *,
double *, int *, int *, int *, int *,
double *, double *, double *, double *,
double *, double *,
double *, double *, double *, double *, double *,
int *);
void meam_dens_final_(int *, int *, int *, int *, int *, double *, double *,
int *, int *, int *,
double *, double *, double *, double *,
double *, double *, double *,
double *, double *, double *, double *,
double *, double *,
double *, double *, double *, double *, int *);
void meam_force_(int *, int *, int *, int *, int *, int *,
double *, double *, int *, int *, int *,
double *, int *, int *, int *, int *, double *, double *,
double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *, int *);
void meam_cleanup_();
}
#include "pair.h"
namespace LAMMPS_NS {
class PairMEAM : public Pair {
public:
PairMEAM(class LAMMPS *);
~PairMEAM();
void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
void init_list(int, class NeighList *);
double init_one(int, int);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();
private:
double cutmax; // max cutoff for all elements
int nelements; // # of unique elements
char **elements; // names of unique elements
double *mass; // mass of each element
int *map; // mapping from atom types to elements
int *fmap; // Fortran version of map array for MEAM lib
int maxneigh;
double *scrfcn,*dscrfcn,*fcpair;
int nmax;
double *rho,*rho0,*rho1,*rho2,*rho3,*frhop;
double *gamma,*dgamma1,*dgamma2,*dgamma3,*arho2b;
double **arho1,**arho2,**arho3,**arho3b,**t_ave,**tsq_ave;
void allocate();
void read_files(char *, char *);
void neigh_strip(int, int *, int *, int **);
void neigh_f2c(int, int *, int *, int **);
void neigh_c2f(int, int *, int *, int **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: MEAM library error %d
+
+A call to the MEAM Fortran library returned an error.
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style MEAM requires newton pair on
+
+See the newton command. This is a restriction to use the MEAM
+potential.
+
+E: Cannot open MEAM potential file %s
+
+The specified MEAM potential file cannot be opened. Check that the
+path and name are correct.
+
+E: Incorrect format in MEAM potential file
+
+Incorrect number of words per line in the potential file.
+
+E: Unrecognized lattice type in MEAM file 1
+
+The lattice type in an entry of the MEAM library file is not
+valid.
+
+E: Did not find all elements in MEAM library file
+
+The requested elements were not found in the MEAM file.
+
+E: Keyword %s in MEAM parameter file not recognized
+
+Self-explanatory.
+
+E: Unrecognized lattice type in MEAM file 2
+
+The lattice type in an entry of the MEAM parameter file is not
+valid.
+
+*/
diff --git a/src/MOLECULE/angle_charmm.h b/src/MOLECULE/angle_charmm.h
index affd5f1ec..51a4554fe 100644
--- a/src/MOLECULE/angle_charmm.h
+++ b/src/MOLECULE/angle_charmm.h
@@ -1,48 +1,56 @@
/* ----------------------------------------------------------------------
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 ANGLE_CLASS
AngleStyle(charmm,AngleCharmm)
#else
#ifndef LMP_ANGLE_CHARMM_H
#define LMP_ANGLE_CHARMM_H
#include "stdio.h"
#include "angle.h"
namespace LAMMPS_NS {
class AngleCharmm : public Angle {
public:
AngleCharmm(class LAMMPS *);
virtual ~AngleCharmm();
virtual void compute(int, int);
void coeff(int, char **);
double equilibrium_angle(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, int, int, int);
protected:
double *k,*theta0,*k_ub,*r_ub;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for angle coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/angle_cosine.h b/src/MOLECULE/angle_cosine.h
index 6b73cf50f..064bd43bd 100644
--- a/src/MOLECULE/angle_cosine.h
+++ b/src/MOLECULE/angle_cosine.h
@@ -1,48 +1,56 @@
/* ----------------------------------------------------------------------
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 ANGLE_CLASS
AngleStyle(cosine,AngleCosine)
#else
#ifndef LMP_ANGLE_COSINE_H
#define LMP_ANGLE_COSINE_H
#include "stdio.h"
#include "angle.h"
namespace LAMMPS_NS {
class AngleCosine : public Angle {
public:
AngleCosine(class LAMMPS *);
virtual ~AngleCosine();
virtual void compute(int, int);
void coeff(int, char **);
double equilibrium_angle(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, int, int, int);
protected:
double *k;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for angle coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/angle_cosine_delta.h b/src/MOLECULE/angle_cosine_delta.h
index 52399422f..08dede2ba 100644
--- a/src/MOLECULE/angle_cosine_delta.h
+++ b/src/MOLECULE/angle_cosine_delta.h
@@ -1,38 +1,41 @@
/* ----------------------------------------------------------------------
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 ANGLE_CLASS
AngleStyle(cosine/delta,AngleCosineDelta)
#else
#ifndef LMP_ANGLE_COSINE_DELTA_H
#define LMP_ANGLE_COSINE_DELTA_H
#include "stdio.h"
#include "angle_cosine_squared.h"
namespace LAMMPS_NS {
class AngleCosineDelta : public AngleCosineSquared {
public:
AngleCosineDelta(class LAMMPS *);
virtual void compute(int, int);
double single(int, int, int, int);
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/MOLECULE/angle_cosine_periodic.h b/src/MOLECULE/angle_cosine_periodic.h
index fa0a56ab8..5c0aeb119 100644
--- a/src/MOLECULE/angle_cosine_periodic.h
+++ b/src/MOLECULE/angle_cosine_periodic.h
@@ -1,49 +1,57 @@
/* ----------------------------------------------------------------------
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 ANGLE_CLASS
AngleStyle(cosine/periodic, AngleCosinePeriodic)
#else
#ifndef LMP_ANGLE_PERIODIC_H
#define LMP_ANGLE_PERIODIC_H
#include "stdio.h"
#include "angle.h"
namespace LAMMPS_NS {
class AngleCosinePeriodic : public Angle {
public:
AngleCosinePeriodic(class LAMMPS *);
virtual ~AngleCosinePeriodic();
virtual void compute(int, int);
void coeff(int, char **);
double equilibrium_angle(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, int, int, int);
protected:
double *k;
int *multiplicity,*b;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for angle coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/angle_cosine_squared.h b/src/MOLECULE/angle_cosine_squared.h
index ee6ce023f..e3d1f52da 100644
--- a/src/MOLECULE/angle_cosine_squared.h
+++ b/src/MOLECULE/angle_cosine_squared.h
@@ -1,48 +1,56 @@
/* ----------------------------------------------------------------------
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 ANGLE_CLASS
AngleStyle(cosine/squared,AngleCosineSquared)
#else
#ifndef LMP_ANGLE_COSINE_SQUARED_H
#define LMP_ANGLE_COSINE_SQUARED_H
#include "stdio.h"
#include "angle.h"
namespace LAMMPS_NS {
class AngleCosineSquared : public Angle {
public:
AngleCosineSquared(class LAMMPS *);
virtual ~AngleCosineSquared();
virtual void compute(int, int);
void coeff(int, char **);
double equilibrium_angle(int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual double single(int, int, int, int);
protected:
double *k,*theta0;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for angle coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/angle_harmonic.h b/src/MOLECULE/angle_harmonic.h
index 7c13d926f..84d219ee1 100644
--- a/src/MOLECULE/angle_harmonic.h
+++ b/src/MOLECULE/angle_harmonic.h
@@ -1,48 +1,56 @@
/* ----------------------------------------------------------------------
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 ANGLE_CLASS
AngleStyle(harmonic,AngleHarmonic)
#else
#ifndef LMP_ANGLE_HARMONIC_H
#define LMP_ANGLE_HARMONIC_H
#include "stdio.h"
#include "angle.h"
namespace LAMMPS_NS {
class AngleHarmonic : public Angle {
public:
AngleHarmonic(class LAMMPS *);
virtual ~AngleHarmonic();
virtual void compute(int, int);
void coeff(int, char **);
double equilibrium_angle(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, int, int, int);
protected:
double *k,*theta0;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for angle coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/angle_hybrid.h b/src/MOLECULE/angle_hybrid.h
index 8f12bcb3d..8f00c7ada 100644
--- a/src/MOLECULE/angle_hybrid.h
+++ b/src/MOLECULE/angle_hybrid.h
@@ -1,59 +1,95 @@
/* ----------------------------------------------------------------------
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 ANGLE_CLASS
AngleStyle(hybrid,AngleHybrid)
#else
#ifndef LMP_ANGLE_HYBRID_H
#define LMP_ANGLE_HYBRID_H
#include "stdio.h"
#include "angle.h"
namespace LAMMPS_NS {
class AngleHybrid : public Angle {
public:
int nstyles; // # of different angle styles
Angle **styles; // class list for each Angle style
char **keywords; // keyword for each Angle style
AngleHybrid(class LAMMPS *);
~AngleHybrid();
void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
double equilibrium_angle(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, int, int, int);
double memory_usage();
private:
int *map; // which style each angle type points to
int *nanglelist; // # of angles in sub-style anglelists
int *maxangle; // max # of angles sub-style lists can store
int ***anglelist; // anglelist for each sub-style
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Angle style hybrid cannot use same pair style twice
+
+Self-explanatory.
+
+E: Angle style hybrid cannot have hybrid as an argument
+
+Self-explanatory.
+
+E: Angle style hybrid cannot have none as an argument
+
+Self-explanatory.
+
+E: Angle coeff for hybrid has invalid style
+
+Angle style hybrid uses another angle style as one of its
+coefficients. The angle style used in the angle_coeff command or read
+from a restart file is not recognized.
+
+E: Invoked angle equil angle on angle style none
+
+Self-explanatory.
+
+E: Invoked angle single on angle style none
+
+Self-explanatory.
+
+*/
diff --git a/src/MOLECULE/angle_table.h b/src/MOLECULE/angle_table.h
index b40440834..fe3df9cae 100644
--- a/src/MOLECULE/angle_table.h
+++ b/src/MOLECULE/angle_table.h
@@ -1,76 +1,119 @@
/* ----------------------------------------------------------------------
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 ANGLE_CLASS
AngleStyle(table,AngleTable)
#else
#ifndef LMP_ANGLE_TABLE_H
#define LMP_ANGLE_TABLE_H
#include "stdio.h"
#include "angle.h"
namespace LAMMPS_NS {
class AngleTable : public Angle {
public:
AngleTable(class LAMMPS *);
virtual ~AngleTable();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
double equilibrium_angle(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, int, int, int);
protected:
int tabstyle,tablength;
double *theta0;
struct Table {
int ninput,fpflag;
double fplo,fphi,theta0;
double *afile,*efile,*ffile;
double *e2file,*f2file;
double delta,invdelta,deltasq6;
double *ang,*e,*de,*f,*df,*e2,*f2;
};
int ntables;
Table *tables;
int *tabindex;
void allocate();
void null_table(Table *);
void free_table(Table *);
void read_table(Table *, char *, char *);
void bcast_table(Table *);
void spline_table(Table *);
void compute_table(Table *);
void param_extract(Table *, char *);
void spline(double *, double *, int, double, double, double *);
double splint(double *, double *, double *, int, double);
void uf_lookup(int, double, double &, double &);
void u_lookup(int, double, double &);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Unknown table style in angle style table
+
+Self-explanatory.
+
+E: Illegal number of angle table entries
+
+There must be at least 2 table entries.
+
+E: Invalid angle table length
+
+Length must be 2 or greater.
+
+E: Angle table must range from 0 to 180 degrees
+
+Self-explanatory.
+
+E: Cannot open file %s
+
+The specified file cannot be opened. Check that the path and name are
+correct.
+
+E: Did not find keyword in table file
+
+Keyword used in pair_coeff command was not found in table file.
+
+E: Invalid keyword in angle table parameters
+
+Self-explanatory.
+
+E: Angle table parameters did not set N
+
+List of angle table parameters must include N setting.
+
+*/
diff --git a/src/MOLECULE/atom_vec_angle.h b/src/MOLECULE/atom_vec_angle.h
index def4f6774..e340c3296 100644
--- a/src/MOLECULE/atom_vec_angle.h
+++ b/src/MOLECULE/atom_vec_angle.h
@@ -1,71 +1,88 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(angle,AtomVecAngle)
#else
#ifndef LMP_ATOM_VEC_ANGLE_H
#define LMP_ATOM_VEC_ANGLE_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecAngle : public AtomVec {
public:
AtomVecAngle(class LAMMPS *, int, char **);
virtual ~AtomVecAngle() {}
void grow(int);
void grow_reset();
void copy(int, int, int);
virtual int pack_comm(int, int *, double *, int, int *);
virtual int pack_comm_vel(int, int *, double *, int, int *);
virtual void unpack_comm(int, int, double *);
virtual void unpack_comm_vel(int, int, double *);
int pack_reverse(int, int, double *);
void unpack_reverse(int, int *, double *);
virtual int pack_border(int, int *, double *, int, int *);
virtual int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
virtual void unpack_border(int, int, double *);
virtual void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, int, double *);
virtual int pack_exchange(int, double *);
virtual 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 **);
bigint memory_usage();
protected:
int *tag,*type,*mask,*image;
double **x,**v,**f;
int *molecule;
int **nspecial,**special;
int *num_bond;
int **bond_type,**bond_atom;
int *num_angle;
int **angle_type;
int **angle_atom1,**angle_atom2,**angle_atom3;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+*/
diff --git a/src/MOLECULE/atom_vec_bond.h b/src/MOLECULE/atom_vec_bond.h
index 6f7c79303..0da71d3b2 100644
--- a/src/MOLECULE/atom_vec_bond.h
+++ b/src/MOLECULE/atom_vec_bond.h
@@ -1,67 +1,84 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(bond,AtomVecBond)
#else
#ifndef LMP_ATOM_VEC_BOND_H
#define LMP_ATOM_VEC_BOND_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecBond : public AtomVec {
public:
AtomVecBond(class LAMMPS *, int, char **);
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int pack_reverse(int, int, double *);
void unpack_reverse(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, 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 **);
bigint memory_usage();
private:
int *tag,*type,*mask,*image;
double **x,**v,**f;
int *molecule;
int **nspecial,**special;
int *num_bond;
int **bond_type,**bond_atom;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+*/
diff --git a/src/MOLECULE/atom_vec_full.h b/src/MOLECULE/atom_vec_full.h
index 8749c183d..c188c1426 100644
--- a/src/MOLECULE/atom_vec_full.h
+++ b/src/MOLECULE/atom_vec_full.h
@@ -1,78 +1,95 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(full,AtomVecFull)
#else
#ifndef LMP_ATOM_VEC_FULL_H
#define LMP_ATOM_VEC_FULL_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecFull : public AtomVec {
public:
AtomVecFull(class LAMMPS *, int, char **);
virtual ~AtomVecFull() {}
void grow(int);
void grow_reset();
void copy(int, int, int);
virtual int pack_comm(int, int *, double *, int, int *);
virtual int pack_comm_vel(int, int *, double *, int, int *);
virtual void unpack_comm(int, int, double *);
virtual void unpack_comm_vel(int, int, double *);
int pack_reverse(int, int, double *);
void unpack_reverse(int, int *, double *);
virtual int pack_border(int, int *, double *, int, int *);
virtual int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
virtual void unpack_border(int, int, double *);
virtual void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, int, double *);
virtual int pack_exchange(int, double *);
virtual 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 **);
bigint memory_usage();
protected:
int *tag,*type,*mask,*image;
double **x,**v,**f;
double *q;
int *molecule;
int **nspecial,**special;
int *num_bond;
int **bond_type,**bond_atom;
int *num_angle;
int **angle_type;
int **angle_atom1,**angle_atom2,**angle_atom3;
int *num_dihedral;
int **dihedral_type;
int **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
int *num_improper;
int **improper_type;
int **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+*/
diff --git a/src/MOLECULE/atom_vec_molecular.h b/src/MOLECULE/atom_vec_molecular.h
index 6b3fa4003..66c1ddb1a 100644
--- a/src/MOLECULE/atom_vec_molecular.h
+++ b/src/MOLECULE/atom_vec_molecular.h
@@ -1,76 +1,93 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(molecular,AtomVecMolecular)
#else
#ifndef LMP_ATOM_VEC_MOLECULAR_H
#define LMP_ATOM_VEC_MOLECULAR_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecMolecular : public AtomVec {
public:
AtomVecMolecular(class LAMMPS *, int, char **);
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int pack_reverse(int, int, double *);
void unpack_reverse(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, 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 **);
bigint memory_usage();
private:
int *tag,*type,*mask,*image;
double **x,**v,**f;
int *molecule;
int **nspecial,**special;
int *num_bond;
int **bond_type,**bond_atom;
int *num_angle;
int **angle_type;
int **angle_atom1,**angle_atom2,**angle_atom3;
int *num_dihedral;
int **dihedral_type;
int **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
int *num_improper;
int **improper_type;
int **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+*/
diff --git a/src/MOLECULE/bond_fene.h b/src/MOLECULE/bond_fene.h
index 6fb262c33..88f50952c 100644
--- a/src/MOLECULE/bond_fene.h
+++ b/src/MOLECULE/bond_fene.h
@@ -1,50 +1,77 @@
/* ----------------------------------------------------------------------
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 BOND_CLASS
BondStyle(fene,BondFENE)
#else
#ifndef LMP_BOND_FENE_H
#define LMP_BOND_FENE_H
#include "stdio.h"
#include "bond.h"
namespace LAMMPS_NS {
class BondFENE : public Bond {
public:
BondFENE(class LAMMPS *);
virtual ~BondFENE();
virtual void compute(int, int);
void coeff(int, char **);
void init_style();
double equilibrium_distance(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, double, int, int);
protected:
double TWO_1_3;
double *k,*r0,*epsilon,*sigma;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: FENE bond too long: %ld %d %d %g
+
+A FENE bond has stretched dangerously far. It's interaction strength
+will be truncated to attempt to prevent the bond from blowing up. :dd
+
+E: Bad FENE bond
+
+Two atoms in a FENE bond have become so far apart that the bond cannot
+be computed.
+
+E: Incorrect args for bond coefficients
+
+Self-explanatory. Check the input script or data file.
+
+W: Use special bonds = 0,1,1 with bond style fene
+
+Most FENE models need this setting for the special_bonds command.
+
+W: FENE bond too long: %ld %g
+
+A FENE bond has stretched dangerously far. It's interaction strength
+will be truncated to attempt to prevent the bond from blowing up. :dd
+
+*/
diff --git a/src/MOLECULE/bond_fene_expand.h b/src/MOLECULE/bond_fene_expand.h
index 89f28c4bf..bae8a7327 100644
--- a/src/MOLECULE/bond_fene_expand.h
+++ b/src/MOLECULE/bond_fene_expand.h
@@ -1,50 +1,77 @@
/* ----------------------------------------------------------------------
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 BOND_CLASS
BondStyle(fene/expand,BondFENEExpand)
#else
#ifndef LMP_BOND_FENE_EXPAND_H
#define LMP_BOND_FENE_EXPAND_H
#include "stdio.h"
#include "bond.h"
namespace LAMMPS_NS {
class BondFENEExpand : public Bond {
public:
BondFENEExpand(class LAMMPS *);
virtual ~BondFENEExpand();
virtual void compute(int, int);
void coeff(int, char **);
void init_style();
double equilibrium_distance(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, double, int, int);
protected:
double TWO_1_3;
double *k,*r0,*epsilon,*sigma,*shift;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: FENE bond too long: %ld %d %d %g
+
+A FENE bond has stretched dangerously far. It's interaction strength
+will be truncated to attempt to prevent the bond from blowing up. :dd
+
+E: Bad FENE bond
+
+Two atoms in a FENE bond have become so far apart that the bond cannot
+be computed.
+
+E: Incorrect args for bond coefficients
+
+Self-explanatory. Check the input script or data file.
+
+W: Use special bonds = 0,1,1 with bond style fene/expand
+
+Most FENE models need this setting for the special_bonds command.
+
+W: FENE bond too long: %ld %g
+
+A FENE bond has stretched dangerously far. It's interaction strength
+will be truncated to attempt to prevent the bond from blowing up. :dd
+
+*/
diff --git a/src/MOLECULE/bond_harmonic.h b/src/MOLECULE/bond_harmonic.h
index 87eefd6a0..7594fe225 100644
--- a/src/MOLECULE/bond_harmonic.h
+++ b/src/MOLECULE/bond_harmonic.h
@@ -1,48 +1,56 @@
/* ----------------------------------------------------------------------
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 BOND_CLASS
BondStyle(harmonic,BondHarmonic)
#else
#ifndef LMP_BOND_HARMONIC_H
#define LMP_BOND_HARMONIC_H
#include "stdio.h"
#include "bond.h"
namespace LAMMPS_NS {
class BondHarmonic : public Bond {
public:
BondHarmonic(class LAMMPS *);
virtual ~BondHarmonic();
virtual void compute(int, int);
void coeff(int, char **);
double equilibrium_distance(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, double, int, int);
protected:
double *k,*r0;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for bond coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/bond_morse.h b/src/MOLECULE/bond_morse.h
index 1dcf3653e..e5bcdbe8f 100644
--- a/src/MOLECULE/bond_morse.h
+++ b/src/MOLECULE/bond_morse.h
@@ -1,48 +1,56 @@
/* ----------------------------------------------------------------------
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 BOND_CLASS
BondStyle(morse,BondMorse)
#else
#ifndef LMP_BOND_MORSE_H
#define LMP_BOND_MORSE_H
#include "stdio.h"
#include "bond.h"
namespace LAMMPS_NS {
class BondMorse : public Bond {
public:
BondMorse(class LAMMPS *);
virtual ~BondMorse();
virtual void compute(int, int);
void coeff(int, char **);
double equilibrium_distance(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, double, int, int);
protected:
double *d0,*alpha,*r0;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for bond coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/bond_nonlinear.h b/src/MOLECULE/bond_nonlinear.h
index 8d715e2e6..c3051af18 100644
--- a/src/MOLECULE/bond_nonlinear.h
+++ b/src/MOLECULE/bond_nonlinear.h
@@ -1,48 +1,56 @@
/* ----------------------------------------------------------------------
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 BOND_CLASS
BondStyle(nonlinear,BondNonlinear)
#else
#ifndef LMP_BOND_NONLINEAR_H
#define LMP_BOND_NONLINEAR_H
#include "stdio.h"
#include "bond.h"
namespace LAMMPS_NS {
class BondNonlinear : public Bond {
public:
BondNonlinear(class LAMMPS *);
virtual ~BondNonlinear();
virtual void compute(int, int);
void coeff(int, char **);
double equilibrium_distance(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, double, int, int);
protected:
double *epsilon,*r0,*lamda;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for bond coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/bond_quartic.h b/src/MOLECULE/bond_quartic.h
index 628d2c237..528e76e09 100644
--- a/src/MOLECULE/bond_quartic.h
+++ b/src/MOLECULE/bond_quartic.h
@@ -1,50 +1,72 @@
/* ----------------------------------------------------------------------
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 BOND_CLASS
BondStyle(quartic,BondQuartic)
#else
#ifndef LMP_BOND_QUARTIC_H
#define LMP_BOND_QUARTIC_H
#include "stdio.h"
#include "bond.h"
namespace LAMMPS_NS {
class BondQuartic : public Bond {
public:
BondQuartic(class LAMMPS *);
virtual ~BondQuartic();
virtual void compute(int, int);
void coeff(int, char **);
void init_style();
double equilibrium_distance(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, double, int, int);
protected:
double TWO_1_3;
double *k,*b1,*b2,*rc,*u0;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for bond coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style does not support bond_style quartic
+
+The pair style does not have a single() function, so it can
+not be invoked by bond_style quartic.
+
+E: Bond style quartic cannot be used with 3,4-body interactions
+
+No angle, dihedral, or improper styles can be defined when using
+bond style quartic.
+
+E: Bond style quartic requires special_bonds = 1,1,1
+
+This is a restriction of the current bond quartic implementation.
+
+*/
diff --git a/src/MOLECULE/bond_table.h b/src/MOLECULE/bond_table.h
index 810693262..31c335cb4 100644
--- a/src/MOLECULE/bond_table.h
+++ b/src/MOLECULE/bond_table.h
@@ -1,77 +1,120 @@
/* ----------------------------------------------------------------------
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 BOND_CLASS
BondStyle(table,BondTable)
#else
#ifndef LMP_BOND_TABLE_H
#define LMP_BOND_TABLE_H
#include "stdio.h"
#include "bond.h"
namespace LAMMPS_NS {
class BondTable : public Bond {
public:
BondTable(class LAMMPS *);
virtual ~BondTable();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
double equilibrium_distance(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, double, int, int);
protected:
int tabstyle,tablength;
double *r0;
struct Table {
int ninput,fpflag;
double fplo,fphi,r0;
double lo,hi;
double *rfile,*efile,*ffile;
double *e2file,*f2file;
double delta,invdelta,deltasq6;
double *r,*e,*de,*f,*df,*e2,*f2;
};
int ntables;
Table *tables;
int *tabindex;
void allocate();
void null_table(Table *);
void free_table(Table *);
void read_table(Table *, char *, char *);
void bcast_table(Table *);
void spline_table(Table *);
void compute_table(Table *);
void param_extract(Table *, char *);
void spline(double *, double *, int, double, double, double *);
double splint(double *, double *, double *, int, double);
void uf_lookup(int, double, double &, double &);
void u_lookup(int, double, double &);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Unknown table style in bond style table
+
+Self-explanatory.
+
+E: Illegal number of bond table entries
+
+There must be at least 2 table entries.
+
+E: Invalid bond table length
+
+Length must be 2 or greater.
+
+E: Bond table values are not increasing
+
+The values in the tabulated file must be monotonically increasing.
+
+E: Cannot open file %s
+
+The specified file cannot be opened. Check that the path and name are
+correct.
+
+E: Did not find keyword in table file
+
+Keyword used in pair_coeff command was not found in table file.
+
+E: Invalid keyword in bond table parameters
+
+Self-explanatory.
+
+E: Bond table parameters did not set N
+
+List of bond table parameters must include N setting.
+
+*/
diff --git a/src/MOLECULE/dihedral_charmm.h b/src/MOLECULE/dihedral_charmm.h
index f00a6e1a6..44a93357f 100644
--- a/src/MOLECULE/dihedral_charmm.h
+++ b/src/MOLECULE/dihedral_charmm.h
@@ -1,50 +1,76 @@
/* ----------------------------------------------------------------------
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 DIHEDRAL_CLASS
DihedralStyle(charmm,DihedralCharmm)
#else
#ifndef LMP_DIHEDRAL_CHARMM_H
#define LMP_DIHEDRAL_CHARMM_H
#include "stdio.h"
#include "dihedral.h"
namespace LAMMPS_NS {
class DihedralCharmm : public Dihedral {
public:
DihedralCharmm(class LAMMPS *);
virtual ~DihedralCharmm();
virtual void compute(int, int);
void coeff(int, char **);
void init_style();
void write_restart(FILE *);
void read_restart(FILE *);
protected:
double *k,*weight,*cos_shift,*sin_shift;
int *multiplicity,*shift;
double **lj14_1,**lj14_2,**lj14_3,**lj14_4;
int implicit,weightflag;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: Dihedral problem: %d %ld %d %d %d %d
+
+Conformation of the 4 listed dihedral atoms is extreme; you may want
+to check your simulation geometry. :dd
+
+E: Incorrect args for dihedral coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Incorrect multiplicity arg for dihedral coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Incorrect weight arg for dihedral coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Dihedral charmm is incompatible with Pair style
+
+Dihedral style charmm must be used with a pair style charmm
+in order for the 1-4 epsilon/sigma parameters to be defined.
+
+*/
diff --git a/src/MOLECULE/dihedral_harmonic.h b/src/MOLECULE/dihedral_harmonic.h
index 1645cf501..ce78bcd99 100644
--- a/src/MOLECULE/dihedral_harmonic.h
+++ b/src/MOLECULE/dihedral_harmonic.h
@@ -1,47 +1,68 @@
/* ----------------------------------------------------------------------
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 DIHEDRAL_CLASS
DihedralStyle(harmonic,DihedralHarmonic)
#else
#ifndef LMP_DIHEDRAL_HARMONIC_H
#define LMP_DIHEDRAL_HARMONIC_H
#include "stdio.h"
#include "dihedral.h"
namespace LAMMPS_NS {
class DihedralHarmonic : public Dihedral {
public:
DihedralHarmonic(class LAMMPS *);
virtual ~DihedralHarmonic();
virtual void compute(int, int);
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
protected:
double *k,*cos_shift,*sin_shift;
int *sign,*multiplicity;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: Dihedral problem: %d %ld %d %d %d %d
+
+Conformation of the 4 listed dihedral atoms is extreme; you may want
+to check your simulation geometry. :dd
+
+E: Incorrect args for dihedral coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Incorrect sign arg for dihedral coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Incorrect multiplicity arg for dihedral coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/dihedral_helix.h b/src/MOLECULE/dihedral_helix.h
index a6a4261da..6f254ad94 100644
--- a/src/MOLECULE/dihedral_helix.h
+++ b/src/MOLECULE/dihedral_helix.h
@@ -1,46 +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.
------------------------------------------------------------------------- */
#ifdef DIHEDRAL_CLASS
DihedralStyle(helix,DihedralHelix)
#else
#ifndef LMP_DIHEDRAL_HELIX_H
#define LMP_DIHEDRAL_HELIX_H
#include "stdio.h"
#include "dihedral.h"
namespace LAMMPS_NS {
class DihedralHelix : public Dihedral {
public:
DihedralHelix(class LAMMPS *);
virtual ~DihedralHelix();
virtual void compute(int, int);
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
protected:
double *aphi,*bphi,*cphi;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: Dihedral problem: %d %ld %d %d %d %d
+
+Conformation of the 4 listed dihedral atoms is extreme; you may want
+to check your simulation geometry. :dd
+
+E: Incorrect args for dihedral coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/dihedral_hybrid.h b/src/MOLECULE/dihedral_hybrid.h
index 9c4b73499..bee1e58b2 100644
--- a/src/MOLECULE/dihedral_hybrid.h
+++ b/src/MOLECULE/dihedral_hybrid.h
@@ -1,57 +1,79 @@
/* ----------------------------------------------------------------------
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 DIHEDRAL_CLASS
DihedralStyle(hybrid,DihedralHybrid)
#else
#ifndef LMP_DIHEDRAL_HYBRID_H
#define LMP_DIHEDRAL_HYBRID_H
#include "stdio.h"
#include "dihedral.h"
namespace LAMMPS_NS {
class DihedralHybrid : public Dihedral {
public:
int nstyles; // # of different dihedral styles
Dihedral **styles; // class list for each Dihedral style
char **keywords; // keyword for each dihedral style
DihedralHybrid(class LAMMPS *);
~DihedralHybrid();
void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
void write_restart(FILE *);
void read_restart(FILE *);
double memory_usage();
private:
int *map; // which style each dihedral type points to
int *ndihedrallist; // # of dihedrals in sub-style dihedrallists
int *maxdihedral; // max # of dihedrals sub-style lists can store
int ***dihedrallist; // dihedrallist for each sub-style
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Dihedral style hybrid cannot use same dihedral style twice
+
+Self-explanatory.
+
+E: Dihedral style hybrid cannot have hybrid as an argument
+
+Self-explanatory.
+
+E: Dihedral style hybrid cannot have none as an argument
+
+Self-explanatory.
+
+E: Dihedral coeff for hybrid has invalid style
+
+Dihedral style hybrid uses another dihedral style as one of its
+coefficients. The dihedral style used in the dihedral_coeff command
+or read from a restart file is not recognized.
+
+*/
diff --git a/src/MOLECULE/dihedral_multi_harmonic.h b/src/MOLECULE/dihedral_multi_harmonic.h
index da4d46fe7..8ba96dc0c 100644
--- a/src/MOLECULE/dihedral_multi_harmonic.h
+++ b/src/MOLECULE/dihedral_multi_harmonic.h
@@ -1,46 +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.
------------------------------------------------------------------------- */
#ifdef DIHEDRAL_CLASS
DihedralStyle(multi/harmonic,DihedralMultiHarmonic)
#else
#ifndef LMP_DIHEDRAL_MULTI_HARMONIC_H
#define LMP_DIHEDRAL_MULTI_HARMONIC_H
#include "stdio.h"
#include "dihedral.h"
namespace LAMMPS_NS {
class DihedralMultiHarmonic : public Dihedral {
public:
DihedralMultiHarmonic(class LAMMPS *);
virtual ~DihedralMultiHarmonic();
virtual void compute(int, int);
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
protected:
double *a1,*a2,*a3,*a4,*a5;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: Dihedral problem: %d %ld %d %d %d %d
+
+Conformation of the 4 listed dihedral atoms is extreme; you may want
+to check your simulation geometry. :dd
+
+E: Incorrect args for dihedral coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/dihedral_opls.h b/src/MOLECULE/dihedral_opls.h
index 772ae6e6b..887507324 100644
--- a/src/MOLECULE/dihedral_opls.h
+++ b/src/MOLECULE/dihedral_opls.h
@@ -1,46 +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.
------------------------------------------------------------------------- */
#ifdef DIHEDRAL_CLASS
DihedralStyle(opls,DihedralOPLS)
#else
#ifndef LMP_DIHEDRAL_OPLS_H
#define LMP_DIHEDRAL_OPLS_H
#include "stdio.h"
#include "dihedral.h"
namespace LAMMPS_NS {
class DihedralOPLS : public Dihedral {
public:
DihedralOPLS(class LAMMPS *);
virtual ~DihedralOPLS();
virtual void compute(int, int);
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
protected:
double *k1,*k2,*k3,*k4;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: Dihedral problem: %d %ld %d %d %d %d
+
+Conformation of the 4 listed dihedral atoms is extreme; you may want
+to check your simulation geometry. :dd
+
+E: Incorrect args for dihedral coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/improper_cvff.h b/src/MOLECULE/improper_cvff.h
index 86de363a1..410522952 100644
--- a/src/MOLECULE/improper_cvff.h
+++ b/src/MOLECULE/improper_cvff.h
@@ -1,47 +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 IMPROPER_CLASS
ImproperStyle(cvff,ImproperCvff)
#else
#ifndef LMP_IMPROPER_CVFF_H
#define LMP_IMPROPER_CVFF_H
#include "stdio.h"
#include "improper.h"
namespace LAMMPS_NS {
class ImproperCvff : public Improper {
public:
ImproperCvff(class LAMMPS *);
virtual ~ImproperCvff();
virtual void compute(int, int);
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
protected:
double *k;
int *sign,*multiplicity;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: Improper problem: %d %ld %d %d %d %d
+
+Conformation of the 4 listed improper atoms is extreme; you may want
+to check your simulation geometry. :dd
+
+E: Incorrect args for improper coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/improper_harmonic.h b/src/MOLECULE/improper_harmonic.h
index b3d5ef81f..5e5c0bf22 100644
--- a/src/MOLECULE/improper_harmonic.h
+++ b/src/MOLECULE/improper_harmonic.h
@@ -1,46 +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.
------------------------------------------------------------------------- */
#ifdef IMPROPER_CLASS
ImproperStyle(harmonic,ImproperHarmonic)
#else
#ifndef LMP_IMPROPER_HARMONIC_H
#define LMP_IMPROPER_HARMONIC_H
#include "stdio.h"
#include "improper.h"
namespace LAMMPS_NS {
class ImproperHarmonic : public Improper {
public:
ImproperHarmonic(class LAMMPS *);
virtual ~ImproperHarmonic();
virtual void compute(int, int);
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
protected:
double *k,*chi;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: Improper problem: %d %ld %d %d %d %d
+
+Conformation of the 4 listed improper atoms is extreme; you may want
+to check your simulation geometry. :dd
+
+E: Incorrect args for improper coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/improper_hybrid.h b/src/MOLECULE/improper_hybrid.h
index 8e866fbf2..6a542811b 100644
--- a/src/MOLECULE/improper_hybrid.h
+++ b/src/MOLECULE/improper_hybrid.h
@@ -1,56 +1,78 @@
/* ----------------------------------------------------------------------
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 IMPROPER_CLASS
ImproperStyle(hybrid,ImproperHybrid)
#else
#ifndef LMP_IMPROPER_HYBRID_H
#define LMP_IMPROPER_HYBRID_H
#include "stdio.h"
#include "improper.h"
namespace LAMMPS_NS {
class ImproperHybrid : public Improper {
public:
int nstyles; // # of different improper styles
Improper **styles; // class list for each Improper style
char **keywords; // keyword for each improper style
ImproperHybrid(class LAMMPS *);
~ImproperHybrid();
void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
double memory_usage();
private:
int *map; // which style each improper type points to
int *nimproperlist; // # of impropers in sub-style improperlists
int *maximproper; // max # of impropers sub-style lists can store
int ***improperlist; // improperlist for each sub-style
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Improper style hybrid cannot use same improper style twice
+
+Self-explanatory.
+
+E: Improper style hybrid cannot have hybrid as an argument
+
+Self-explanatory.
+
+E: Improper style hybrid cannot have none as an argument
+
+Self-explanatory.
+
+E: Improper coeff for hybrid has invalid style
+
+Improper style hybrid uses another improper style as one of its
+coefficients. The improper style used in the improper_coeff command
+or read from a restart file is not recognized.
+
+*/
diff --git a/src/MOLECULE/improper_umbrella.h b/src/MOLECULE/improper_umbrella.h
index 483979826..6a566d606 100644
--- a/src/MOLECULE/improper_umbrella.h
+++ b/src/MOLECULE/improper_umbrella.h
@@ -1,46 +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.
------------------------------------------------------------------------- */
#ifdef IMPROPER_CLASS
ImproperStyle(umbrella,ImproperUmbrella)
#else
#ifndef LMP_IMPROPER_UMBRELLA_H
#define LMP_IMPROPER_UMBRELLA_H
#include "stdio.h"
#include "improper.h"
namespace LAMMPS_NS {
class ImproperUmbrella : public Improper {
public:
ImproperUmbrella(class LAMMPS *);
virtual ~ImproperUmbrella();
virtual void compute(int, int);
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
protected:
double *kw, *w0, *C;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: Improper problem: %d %ld %d %d %d %d
+
+Conformation of the 4 listed improper atoms is extreme; you may want
+to check your simulation geometry. :dd
+
+E: Incorrect args for improper coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.h b/src/MOLECULE/pair_hbond_dreiding_lj.h
index 1304743b8..942a5bfa4 100644
--- a/src/MOLECULE/pair_hbond_dreiding_lj.h
+++ b/src/MOLECULE/pair_hbond_dreiding_lj.h
@@ -1,66 +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.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(hbond/dreiding/lj,PairHbondDreidingLJ)
#else
#ifndef LMP_PAIR_HBOND_DREIDING_LJ_H
#define LMP_PAIR_HBOND_DREIDING_LJ_H
#include "pair.h"
namespace LAMMPS_NS {
class PairHbondDreidingLJ : public Pair {
public:
PairHbondDreidingLJ(class LAMMPS *);
virtual ~PairHbondDreidingLJ();
virtual void compute(int, int);
void settings(int, char **);
virtual void coeff(int, char **);
virtual void init_style();
double init_one(int, int);
virtual double single(int, int, int, int, double, double, double, double &);
protected:
double cut_inner_global,cut_outer_global,cut_angle_global;
int ap_global;
struct Param {
double epsilon,sigma;
double lj1,lj2,lj3,lj4;
double d0,alpha,r0;
double morse1;
double denom_vdw;
double cut_inner,cut_outer,cut_innersq,cut_outersq,cut_angle,offset;
int ap;
};
Param *params; // parameter set for an I-J-K interaction
int nparams; // number of parameters read
int maxparam;
int *donor; // 1 if this type is ever a donor, else 0
int *acceptor; // 1 if this type is ever an acceptor, else 0
int ***type2param; // mapping from D,A,H to params, -1 if no map
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair inner cutoff >= Pair outer cutoff
+
+The specified cutoffs for the pair style are inconsistent.
+
+E: Pair style hbond/dreiding requires molecular system
+
+Self-explanatory.
+
+E: Pair style hbond/dreiding requires atom IDs
+
+Self-explanatory.
+
+E: Pair style hbond/dreiding requires an atom map, see atom_modify
+
+Self-explanatory.
+
+E: Pair style hbond/dreiding requires newton pair on
+
+See the newton command for details.
+
+E: No pair hbond/dreiding coefficients set
+
+Self-explanatory.
+
+*/
diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.h b/src/MOLECULE/pair_hbond_dreiding_morse.h
index 05eabb2e1..a9cd5037b 100644
--- a/src/MOLECULE/pair_hbond_dreiding_morse.h
+++ b/src/MOLECULE/pair_hbond_dreiding_morse.h
@@ -1,40 +1,72 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(hbond/dreiding/morse,PairHbondDreidingMorse)
#else
#ifndef LMP_PAIR_HBOND_DREIDING_MORSE_H
#define LMP_PAIR_HBOND_DREIDING_MORSE_H
#include "pair_hbond_dreiding_lj.h"
namespace LAMMPS_NS {
class PairHbondDreidingMorse : public PairHbondDreidingLJ {
public:
PairHbondDreidingMorse(class LAMMPS *);
virtual ~PairHbondDreidingMorse() {};
virtual void compute(int, int);
void coeff(int, char **);
void init_style();
double single(int, int, int, int, double, double, double, double &);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair inner cutoff >= Pair outer cutoff
+
+The specified cutoffs for the pair style are inconsistent.
+
+E: Pair style hbond/dreiding requires molecular system
+
+Self-explanatory.
+
+E: Pair style hbond/dreiding requires atom IDs
+
+Self-explanatory.
+
+E: Pair style hbond/dreiding requires an atom map, see atom_modify
+
+Self-explanatory.
+
+E: Pair style hbond/dreiding requires newton pair on
+
+See the newton command for details.
+
+E: No pair hbond/dreiding coefficients set
+
+Self-explanatory.
+
+*/
diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
index 875f4c95a..bb67d9ca9 100644
--- a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
+++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
@@ -1,507 +1,508 @@
/* ----------------------------------------------------------------------
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: Paul Crozier (SNL)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_lj_charmm_coul_charmm.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER}; // same as in pair.cpp
/* ---------------------------------------------------------------------- */
PairLJCharmmCoulCharmm::PairLJCharmmCoulCharmm(LAMMPS *lmp) : Pair(lmp)
{
implicit = 0;
mix_flag = ARITHMETIC;
}
/* ---------------------------------------------------------------------- */
PairLJCharmmCoulCharmm::~PairLJCharmmCoulCharmm()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(eps14);
memory->destroy(sigma14);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(lj14_1);
memory->destroy(lj14_2);
memory->destroy(lj14_3);
memory->destroy(lj14_4);
}
}
/* ---------------------------------------------------------------------- */
void PairLJCharmmCoulCharmm::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
double rsq,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
double philj,switch1,switch2;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = ecoul = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
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];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
if (rsq < cut_bothsq) {
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
if (rsq > cut_coul_innersq) {
switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
(cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / denom_coul;
switch2 = 12.0*rsq * (cut_coulsq-rsq) *
(rsq-cut_coul_innersq) / denom_coul;
forcecoul *= switch1 + switch2;
}
} else forcecoul = 0.0;
if (rsq < cut_ljsq) {
r6inv = r2inv*r2inv*r2inv;
jtype = type[j];
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
switch2 = 12.0*rsq * (cut_ljsq-rsq) *
(rsq-cut_lj_innersq) / denom_lj;
philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
forcelj = forcelj*switch1 + philj*switch2;
}
} else forcelj = 0.0;
fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
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) {
if (rsq < cut_coulsq) {
ecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
if (rsq > cut_coul_innersq) {
switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
(cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) /
denom_coul;
ecoul *= switch1;
}
ecoul *= factor_coul;
} else ecoul = 0.0;
if (rsq < cut_ljsq) {
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
evdwl *= switch1;
}
evdwl *= factor_lj;
} else evdwl = 0.0;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,ecoul,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairLJCharmmCoulCharmm::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(eps14,n+1,n+1,"pair:eps14");
memory->create(sigma14,n+1,n+1,"pair:sigma14");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(lj14_1,n+1,n+1,"pair:lj14_1");
memory->create(lj14_2,n+1,n+1,"pair:lj14_2");
memory->create(lj14_3,n+1,n+1,"pair:lj14_3");
memory->create(lj14_4,n+1,n+1,"pair:lj14_4");
}
/* ----------------------------------------------------------------------
global settings
unlike other pair styles,
there are no individual pair settings that these override
------------------------------------------------------------------------- */
void PairLJCharmmCoulCharmm::settings(int narg, char **arg)
{
if (narg != 2 && narg != 4)
error->all(FLERR,"Illegal pair_style command");
cut_lj_inner = force->numeric(arg[0]);
cut_lj = force->numeric(arg[1]);
if (narg == 2) {
cut_coul_inner = cut_lj_inner;
cut_coul = cut_lj;
} else {
cut_coul_inner = force->numeric(arg[2]);
cut_coul = force->numeric(arg[3]);
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairLJCharmmCoulCharmm::coeff(int narg, char **arg)
{
if (narg != 4 && narg != 6)
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double eps14_one = epsilon_one;
double sigma14_one = sigma_one;
if (narg == 6) {
eps14_one = force->numeric(arg[4]);
sigma14_one = force->numeric(arg[5]);
}
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
epsilon[i][j] = epsilon_one;
sigma[i][j] = sigma_one;
eps14[i][j] = eps14_one;
sigma14[i][j] = sigma14_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairLJCharmmCoulCharmm::init_style()
{
if (!atom->q_flag)
- error->all(FLERR,"Pair style lj/charmm/coul/charmm requires atom attribute q");
+ error->all(FLERR,
+ "Pair style lj/charmm/coul/charmm requires atom attribute q");
neighbor->request(this);
// require cut_lj_inner < cut_lj, cut_coul_inner < cut_coul
if (cut_lj_inner >= cut_lj || cut_coul_inner >= cut_coul)
error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
cut_lj_innersq = cut_lj_inner * cut_lj_inner;
cut_ljsq = cut_lj * cut_lj;
cut_coul_innersq = cut_coul_inner * cut_coul_inner;
cut_coulsq = cut_coul * cut_coul;
cut_bothsq = MAX(cut_ljsq,cut_coulsq);
denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) *
(cut_ljsq-cut_lj_innersq);
denom_coul = (cut_coulsq-cut_coul_innersq) * (cut_coulsq-cut_coul_innersq) *
(cut_coulsq-cut_coul_innersq);
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairLJCharmmCoulCharmm::init_one(int i, int j)
{
if (setflag[i][j] == 0) {
epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
sigma[i][i],sigma[j][j]);
sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
eps14[i][j] = mix_energy(eps14[i][i],eps14[j][j],
sigma14[i][i],sigma14[j][j]);
sigma14[i][j] = mix_distance(sigma14[i][i],sigma14[j][j]);
}
double cut = MAX(cut_lj,cut_coul);
lj1[i][j] = 48.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
lj2[i][j] = 24.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
lj14_1[i][j] = 48.0 * eps14[i][j] * pow(sigma14[i][j],12.0);
lj14_2[i][j] = 24.0 * eps14[i][j] * pow(sigma14[i][j],6.0);
lj14_3[i][j] = 4.0 * eps14[i][j] * pow(sigma14[i][j],12.0);
lj14_4[i][j] = 4.0 * eps14[i][j] * pow(sigma14[i][j],6.0);
lj1[j][i] = lj1[i][j];
lj2[j][i] = lj2[i][j];
lj3[j][i] = lj3[i][j];
lj4[j][i] = lj4[i][j];
lj14_1[j][i] = lj14_1[i][j];
lj14_2[j][i] = lj14_2[i][j];
lj14_3[j][i] = lj14_3[i][j];
lj14_4[j][i] = lj14_4[i][j];
return cut;
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairLJCharmmCoulCharmm::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&epsilon[i][j],sizeof(double),1,fp);
fwrite(&sigma[i][j],sizeof(double),1,fp);
fwrite(&eps14[i][j],sizeof(double),1,fp);
fwrite(&sigma14[i][j],sizeof(double),1,fp);
}
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairLJCharmmCoulCharmm::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
fread(&epsilon[i][j],sizeof(double),1,fp);
fread(&sigma[i][j],sizeof(double),1,fp);
fread(&eps14[i][j],sizeof(double),1,fp);
fread(&sigma14[i][j],sizeof(double),1,fp);
}
MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&eps14[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&sigma14[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairLJCharmmCoulCharmm::write_restart_settings(FILE *fp)
{
fwrite(&cut_lj_inner,sizeof(double),1,fp);
fwrite(&cut_lj,sizeof(double),1,fp);
fwrite(&cut_coul_inner,sizeof(double),1,fp);
fwrite(&cut_coul,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairLJCharmmCoulCharmm::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&cut_lj_inner,sizeof(double),1,fp);
fread(&cut_lj,sizeof(double),1,fp);
fread(&cut_coul_inner,sizeof(double),1,fp);
fread(&cut_coul,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_coul_inner,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
double PairLJCharmmCoulCharmm::single(int i, int j, int itype, int jtype,
double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double r2inv,r6inv,forcecoul,forcelj,phicoul,philj;
double switch1,switch2;
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
forcecoul = force->qqrd2e * atom->q[i]*atom->q[j]*sqrt(r2inv);
if (rsq > cut_coul_innersq) {
switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
(cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / denom_coul;
switch2 = 12.0*rsq * (cut_coulsq-rsq) *
(rsq-cut_coul_innersq) / denom_coul;
forcecoul *= switch1 + switch2;
}
} else forcecoul = 0.0;
if (rsq < cut_ljsq) {
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
switch2 = 12.0*rsq * (cut_ljsq-rsq) *
(rsq-cut_lj_innersq) / denom_lj;
philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
forcelj = forcelj*switch1 + philj*switch2;
}
} else forcelj = 0.0;
fforce = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
double eng = 0.0;
if (rsq < cut_coulsq) {
phicoul = force->qqrd2e * atom->q[i]*atom->q[j]*sqrt(r2inv);
if (rsq > cut_coul_innersq) {
switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
(cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) /
denom_coul;
phicoul *= switch1;
}
eng += factor_coul*phicoul;
}
if (rsq < cut_ljsq) {
philj = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
philj *= switch1;
}
eng += factor_lj*philj;
}
return eng;
}
/* ---------------------------------------------------------------------- */
-void *PairLJCharmmCoulCharmm::extract(char *str, int &dim)
+void *PairLJCharmmCoulCharmm::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str,"lj14_1") == 0) return (void *) lj14_1;
if (strcmp(str,"lj14_2") == 0) return (void *) lj14_2;
if (strcmp(str,"lj14_3") == 0) return (void *) lj14_3;
if (strcmp(str,"lj14_4") == 0) return (void *) lj14_4;
dim = 0;
if (strcmp(str,"implicit") == 0) return (void *) &implicit;
return NULL;
}
diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.h b/src/MOLECULE/pair_lj_charmm_coul_charmm.h
index 2b3dae227..03e453d9e 100644
--- a/src/MOLECULE/pair_lj_charmm_coul_charmm.h
+++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.h
@@ -1,58 +1,80 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/charmm/coul/charmm,PairLJCharmmCoulCharmm)
#else
#ifndef LMP_PAIR_LJ_CHARMM_COUL_CHARMM_H
#define LMP_PAIR_LJ_CHARMM_COUL_CHARMM_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJCharmmCoulCharmm : public Pair {
public:
PairLJCharmmCoulCharmm(class LAMMPS *);
virtual ~PairLJCharmmCoulCharmm();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
virtual double single(int, int, int, int, double, double, double, double &);
- virtual void *extract(char *, int &);
+ virtual void *extract(const char *, int &);
protected:
int implicit;
double cut_lj_inner,cut_lj,cut_coul_inner,cut_coul;
double cut_lj_innersq,cut_ljsq,cut_coul_innersq,cut_coulsq,cut_bothsq;
double denom_lj,denom_coul;
double **epsilon,**sigma,**eps14,**sigma14;
double **lj1,**lj2,**lj3,**lj4;
double **lj14_1,**lj14_2,**lj14_3,**lj14_4;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style lj/charmm/coul/charmm requires atom attribute q
+
+The atom style defined does not have these attributes.
+
+E: Pair inner cutoff >= Pair outer cutoff
+
+The specified cutoffs for the pair style are inconsistent.
+
+*/
diff --git a/src/OPT/pair_lj_cut_coul_long_tip4p_opt.h b/src/OPT/pair_lj_cut_coul_long_tip4p_opt.h
index 902ec3970..5f6f111ae 100644
--- a/src/OPT/pair_lj_cut_coul_long_tip4p_opt.h
+++ b/src/OPT/pair_lj_cut_coul_long_tip4p_opt.h
@@ -1,50 +1,59 @@
/* -*- c++ -*- ----------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/cut/coul/long/tip4p/opt,PairLJCutCoulLongTIP4POpt)
#else
#ifndef LMP_PAIR_LJ_CUT_COUL_LONG_TIP4P_OPT_H
#define LMP_PAIR_LJ_CUT_COUL_LONG_TIP4P_OPT_H
#include "pair_lj_cut_coul_long_tip4p.h"
namespace LAMMPS_NS {
class PairLJCutCoulLongTIP4POpt : public PairLJCutCoulLongTIP4P {
public:
PairLJCutCoulLongTIP4POpt(class LAMMPS *);
virtual ~PairLJCutCoulLongTIP4POpt();
virtual void compute(int, int);
virtual double memory_usage();
protected:
// this is to cache m-shift corrected positions.
int maxmpos; // size of the following arrays
int *h1idx, *h2idx; // local index of hydrogen atoms
double **mpos; // coordinates corrected for m-shift.
void find_M_permissive(int, int &, int &, double *);
template < const int, const int, const int, const int, const int >
void eval();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: TIP4P hydrogen is missing
+
+The TIP4P pairwise computation failed to find the correct H atom
+within a water molecule.
+
+*/
diff --git a/src/PERI/atom_vec_peri.h b/src/PERI/atom_vec_peri.h
index ca59123a1..6b5c59511 100644
--- a/src/PERI/atom_vec_peri.h
+++ b/src/PERI/atom_vec_peri.h
@@ -1,66 +1,87 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(peri,AtomVecPeri)
#else
#ifndef LMP_ATOM_VEC_PERI_H
#define LMP_ATOM_VEC_PERI_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecPeri : public AtomVec {
public:
AtomVecPeri(class LAMMPS *, int, char **);
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
int pack_comm_hybrid(int, int *, double *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int unpack_comm_hybrid(int, int, double *);
int pack_reverse(int, int, double *);
void unpack_reverse(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, 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 **);
bigint memory_usage();
private:
int *tag,*type,*mask,*image;
double **x,**v,**f;
double *vfrac,*density,*rmass,*s0,**x0;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+E: Invalid mass value
+
+Self-explanatory.
+
+*/
diff --git a/src/PERI/compute_damage_atom.h b/src/PERI/compute_damage_atom.h
index 325292894..a09272faf 100644
--- a/src/PERI/compute_damage_atom.h
+++ b/src/PERI/compute_damage_atom.h
@@ -1,44 +1,63 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(damage/atom,ComputeDamageAtom)
#else
#ifndef LMP_COMPUTE_DAMAGE_ATOM_H
#define LMP_COMPUTE_DAMAGE_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeDamageAtom : public Compute {
public:
ComputeDamageAtom(class LAMMPS *, int, char **);
~ComputeDamageAtom();
void init();
void compute_peratom();
double memory_usage();
private:
int nmax;
double *damage;
int ifix_peri;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+W: More than one compute damage/atom
+
+It is not efficient to use compute ke/atom more than once.
+
+E: Compute damage/atom requires peridynamic potential
+
+Damage is a Peridynamic-specific metric. It requires you
+to be running a Peridynamics simulation.
+
+*/
diff --git a/src/PERI/fix_peri_neigh.h b/src/PERI/fix_peri_neigh.h
index c823403a4..19fda12d6 100644
--- a/src/PERI/fix_peri_neigh.h
+++ b/src/PERI/fix_peri_neigh.h
@@ -1,73 +1,82 @@
/* ----------------------------------------------------------------------
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(PERI_NEIGH,FixPeriNeigh)
#else
#ifndef LMP_FIX_PERI_NEIGH_H
#define LMP_FIX_PERI_NEIGH_H
#include "fix.h"
namespace LAMMPS_NS {
class FixPeriNeigh : public Fix {
friend class PairPeriPMB;
friend class PairPeriPMBOMP;
friend class PairPeriLPS;
friend class PairPeriLPSOMP;
friend class ComputeDamageAtom;
public:
FixPeriNeigh(class LAMMPS *,int, char **);
virtual ~FixPeriNeigh();
int setmask();
void init();
void init_list(int, class NeighList *);
void setup(int);
void min_setup(int);
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
void write_restart(FILE *);
void restart(char *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
protected:
int first; // flag for first time initialization
int maxpartner; // max # of peridynamic neighs for any atom
int *npartner; // # of neighbors for each atom
int **partner; // neighs for each atom, stored as global IDs
double **r0; // initial distance to partners
double *vinter; // sum of vfrac for bonded neighbors
double *wvolume; // weighted volume of particle
class NeighList *list;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Duplicate particle in PeriDynamic bond - simulation box is too small
+
+This is likely because your box length is shorter than 2 times
+the bond length.
+
+*/
diff --git a/src/PERI/pair_peri_lps.h b/src/PERI/pair_peri_lps.h
index 602172ffa..3d382acdf 100644
--- a/src/PERI/pair_peri_lps.h
+++ b/src/PERI/pair_peri_lps.h
@@ -1,65 +1,110 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(peri/lps,PairPeriLPS)
#else
#ifndef LMP_PAIR_PERI_LPS_H
#define LMP_PAIR_PERI_LPS_H
#include "pair.h"
namespace LAMMPS_NS {
class PairPeriLPS : public Pair {
public:
PairPeriLPS(class LAMMPS *);
virtual ~PairPeriLPS();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
double init_one(int, int);
void init_style();
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 &);
double memory_usage();
double influence_function(double, double, double);
void compute_dilatation();
protected:
int ifix_peri;
double **bulkmodulus;
double **shearmodulus;
double **s00, **alpha;
double **cut;
double *s0_new;
double *theta;
int nmax;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+E: Pair style peri requires atom style peri
+
+UNDOCUMENTED
+
+E: Pair peri requires an atom map, see atom_modify
+
+Even for atomic systems, an atom map is required to find Peridynamic
+bonds. Use the atom_modify command to define one.
+
+E: Pair peri requires a lattice be defined
+
+Use the lattice command for this purpose.
+
+E: Pair peri lattice is not identical in x, y, and z
+
+The lattice defined by the lattice command must be cubic.
+
+E: Fix peri neigh does not exist
+
+Somehow a fix that the pair style defines has been deleted.
+
+E: Divide by 0 in influence function of pair peri/lps
+
+This should not normally occur. It is likely a problem with your
+model.
+
+*/
diff --git a/src/PERI/pair_peri_pmb.h b/src/PERI/pair_peri_pmb.h
index 1065ba523..4b4d1a764 100644
--- a/src/PERI/pair_peri_pmb.h
+++ b/src/PERI/pair_peri_pmb.h
@@ -1,58 +1,98 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(peri/pmb,PairPeriPMB)
#else
#ifndef LMP_PAIR_PERI_PMB_H
#define LMP_PAIR_PERI_PMB_H
#include "pair.h"
namespace LAMMPS_NS {
class PairPeriPMB : public Pair {
public:
PairPeriPMB(class LAMMPS *);
virtual ~PairPeriPMB();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
double init_one(int, int);
void init_style();
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 memory_usage();
protected:
int ifix_peri;
double **kspring;
double **s00, **alpha;
double **cut;
double *s0_new;
int nmax;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+E: Pair style peri requires atom style peri
+
+UNDOCUMENTED
+
+E: Pair peri requires an atom map, see atom_modify
+
+Even for atomic systems, an atom map is required to find Peridynamic
+bonds. Use the atom_modify command to define one.
+
+E: Pair peri requires a lattice be defined
+
+Use the lattice command for this purpose.
+
+E: Pair peri lattice is not identical in x, y, and z
+
+The lattice defined by the lattice command must be cubic.
+
+E: Fix peri neigh does not exist
+
+Somehow a fix that the pair style defines has been deleted.
+
+*/
diff --git a/src/POEMS/fix_poems.h b/src/POEMS/fix_poems.h
index 8d4196409..7bb2ab22a 100644
--- a/src/POEMS/fix_poems.h
+++ b/src/POEMS/fix_poems.h
@@ -1,115 +1,193 @@
/* ----------------------------------------------------------------------
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(poems,FixPOEMS)
#else
#ifndef LMP_FIX_POEMS_H
#define LMP_FIX_POEMS_H
#include "fix.h"
namespace LAMMPS_NS {
class FixPOEMS : public Fix {
public:
FixPOEMS(class LAMMPS *, int narg, char **arg);
~FixPOEMS();
int setmask();
void init();
void setup(int);
void initial_integrate(int);
void post_force(int);
void final_integrate();
void initial_integrate_respa(int, int, int);
void post_force_respa(int, int, int);
void final_integrate_respa(int, int);
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
double memory_usage();
void pre_neighbor();
int dof(int);
void deform(int);
void reset_dt();
private:
int me;
double dtv,dtf,dthalf;
double *step_respa;
int nlevels_respa;
double total_ke;
// atom assignment to rigid bodies
// double count joint atoms as being in multiple bodies
int *natom2body; // # of bodies each atom is part of
int **atom2body; // list of bodies each atom is part of
double **displace; // atom displace in body coords for 1st body it's in
// rigid body properties
// only nrigid double counts joint atoms as being in multiple bodies
// other quantities only count a joint atom as being in 1st body
int nbody; // # of rigid bodies
int *nrigid; // # of atoms in each rigid body
double *masstotal; // total mass of each rigid body
double **xcm; // coords of center-of-mass of each rigid body
double **vcm; // velocity of center-of-mass of each
double **fcm; // force on center-of-mass of each
double **inertia; // 6 inertia components of each (xx,yy,zz,xy,yz,xz)
double **ex_space,**ey_space,**ez_space;
// orientation of each body in space coords
double **angmom; // angular momentum of each in space coords
double **omega; // angular velocity of each in space coords
double **torque; // torque on each rigid body in space coords
double **sum,**all; // work vectors
// joint attributes between pairs of rigid bodies
int ncluster; // # of independent clusters of coupled bodies
int njoint; // # of interbody joints
int **jointbody; // indices of 2 rigid bodies in each joint (1-N)
double **xjoint; // coords of each joint point
int nfree; // # of isolated unconnected bodies
int *freelist; // indices of isolated bodies (1-N)
// POEMS object
class Workspace *poems;
// internal class functions
void readfile(char *);
int readline(FILE *, char **, int *);
void jointbuild();
void sortlist(int, int **);
int loopcheck(int, int, int **);
int jacobi(double **, double *, double **);
void rotate(double **, int, int, int, int, double, double);
void omega_from_mq(double *, double *, double *, double *,
double *, double *);
void set_v();
void set_xv();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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 poems group ID
+
+A group ID used in the fix poems command does not exist.
+
+E: Must use a molecular atom style with fix poems molecule
+
+Self-explanatory.
+
+E: No rigid bodies defined
+
+The fix specification did not end up defining any rigid bodies.
+
+E: Atom in too many rigid bodies - boost MAXBODY
+
+Fix poems has a parameter MAXBODY (in fix_poems.cpp) which determines
+the maximum number of rigid bodies a single atom can belong to (i.e. a
+multibody joint). The bodies you have defined exceed this limit.
+
+E: One or zero atoms in rigid body
+
+Any rigid body defined by the fix rigid command must contain 2 or more
+atoms.
+
+W: More than one fix poems
+
+It is not efficient to use fix poems more than once.
+
+E: POEMS fix must come before NPT/NPH fix
+
+NPT/NPH fix must be defined in input script after all poems fixes,
+else the fix contribution to the pressure virial is incorrect.
+
+E: Insufficient Jacobi rotations for POEMS body
+
+Eigensolve for rigid body was not sufficiently accurate.
+
+E: Rigid body has degenerate moment of inertia
+
+Fix poems will only work with bodies (collections of atoms) that have
+non-zero principal moments of inertia. This means they must be 3 or
+more non-collinear atoms, even with joint atoms removed.
+
+E: Bad principal moments
+
+Fix rigid did not compute the principal moments of inertia of a rigid
+group of atoms correctly.
+
+E: Cannot open fix poems file %s
+
+The specified file cannot be opened. Check that the path and name are
+correct.
+
+W: No joints between rigid bodies, use fix rigid instead
+
+The bodies defined by fix poems are not connected by joints. POEMS
+will integrate the body motion, but it would be more efficient to use
+fix rigid.
+
+E: Cyclic loop in joint connections
+
+Fix poems cannot (yet) work with coupled bodies whose joints connect
+the bodies in a ring (or cycle).
+
+E: Tree structure in joint connections
+
+Fix poems cannot (yet) work with coupled bodies whose joints connect
+the bodies in a tree structure.
+
+*/
diff --git a/src/REAX/fix_reax_bonds.h b/src/REAX/fix_reax_bonds.h
index a4c2f7098..dadf0a7db 100644
--- a/src/REAX/fix_reax_bonds.h
+++ b/src/REAX/fix_reax_bonds.h
@@ -1,49 +1,73 @@
/* ----------------------------------------------------------------------
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(reax/bonds,FixReaxBonds)
#else
#ifndef LMP_FIX_REAX_BONDS_H
#define LMP_FIX_REAX_BONDS_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
class FixReaxBonds : public Fix {
public:
FixReaxBonds(class LAMMPS *, int, char **);
~FixReaxBonds();
int setmask();
void init();
void setup(int);
void end_of_step();
private:
int me;
int nfreq;
FILE *fp;
void OutputReaxBonds(bigint, FILE*);
int nint(const double&);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot open fix reax/bonds file %s
+
+The output file for the fix reax/bonds command cannot be opened.
+Check that the path and name are correct.
+
+E: Cannot use fix reax/bonds without pair_style reax
+
+Self-explantory.
+
+E: Fix reax/bonds numbonds > nsbmax_most
+
+The limit of the number of bonds expected by the ReaxFF force field
+was exceeded.
+
+*/
diff --git a/src/REAX/pair_reax.h b/src/REAX/pair_reax.h
index a051c97dc..f9f87dd00 100644
--- a/src/REAX/pair_reax.h
+++ b/src/REAX/pair_reax.h
@@ -1,96 +1,142 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(reax,PairREAX)
#else
#ifndef LMP_PAIR_REAX_H
#define LMP_PAIR_REAX_H
#include "pair.h"
namespace LAMMPS_NS {
class PairREAX : public Pair {
public:
PairREAX(class LAMMPS *);
~PairREAX();
void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
double memory_usage();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
private:
double cutmax;
double rcutvsq,rcutbsq;
int iprune,ihb,ihbnew,itripstaball;
double hbcut,swb;
double swa;
double swc0, swc1, swc2, swc3, swc4, swc5, swc6, swc7;
double precision;
int packflag;
struct ff_params {
double rcutsq;
int np;
double *params;
};
ff_params *param_list;
int *map;
int nentries;
double chpot;
int *arow_ptr,*acol_ind;
double *ch,*elcvec;
double *rcg,*wcg,*pcg,*poldcg,*qcg;
double *aval;
int nmax,matmax;
void allocate();
void read_files(char *, char *);
void neigh_f2c(int, int *, int *, int **);
void neigh_c2f(int, int *, int *, int **);
void write_reax_positions();
void write_reax_vlist();
void read_reax_forces();
void read_reax_atom_virial();
void taper_setup();
double taper_E(const double &, const double &);
double taper_F(const double &, const double &);
void compute_charge(double &);
void sparse_product(const int &, const int &, const int &, double[],
int[], int[], double[], double[]);
void cg_solve(const int &, const int &, double[], int[],
int[], double[], double[]);
void charge_reax(const int &, const int &, double[],
double[], int[], int[], double[]);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Reax_defs.h setting for NATDEF is too small
+
+Edit the setting in the ReaxFF library and re-compile the
+library and re-build LAMMPS.
+
+E: Reax_defs.h setting for NNEIGHMAXDEF is too small
+
+Edit the setting in the ReaxFF library and re-compile the
+library and re-build LAMMPS.
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Cannot currently use pair reax with pair hybrid
+
+This is not yet supported.
+
+E: Pair style reax requires atom IDs
+
+This is a requirement to use the ReaxFF potential.
+
+E: Pair style reax requires newton pair on
+
+This is a requirement to use the ReaxFF potential.
+
+W: Not using real units with pair reax
+
+This is most likely an error, unless you have created your own ReaxFF
+parameter file in a different set of units.
+
+E: Invalid REAX atom type
+
+There is a mis-match between LAMMPS atom types and the elements
+listed in the ReaxFF force field file.
+
+*/
diff --git a/src/REPLICA/compute_event_displace.cpp b/src/REPLICA/compute_event_displace.cpp
index 3f5f401c4..fb2e13298 100644
--- a/src/REPLICA/compute_event_displace.cpp
+++ b/src/REPLICA/compute_event_displace.cpp
@@ -1,157 +1,158 @@
/* ----------------------------------------------------------------------
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: Mike Brown (SNL)
------------------------------------------------------------------------- */
#include "mpi.h"
#include "math.h"
#include "stdlib.h"
#include "string.h"
#include "compute_event_displace.h"
#include "atom.h"
#include "domain.h"
#include "modify.h"
#include "fix_event.h"
#include "memory.h"
#include "error.h"
#include "update.h"
using namespace LAMMPS_NS;
#define INVOKED_SCALAR 1
/* ---------------------------------------------------------------------- */
ComputeEventDisplace::ComputeEventDisplace(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg != 4) error->all(FLERR,"Illegal compute event/displace command");
scalar_flag = 1;
extscalar = 0;
double displace_dist = atof(arg[3]);
if (displace_dist <= 0.0)
error->all(FLERR,"Distance must be > 0 for compute event/displace");
displace_distsq = displace_dist * displace_dist;
// fix event ID will be set later by PRD
id_event = NULL;
}
/* ---------------------------------------------------------------------- */
ComputeEventDisplace::~ComputeEventDisplace()
{
delete [] id_event;
}
/* ---------------------------------------------------------------------- */
void ComputeEventDisplace::init()
{
// if id_event is not set, this compute is not active
// if set by PRD, then find fix which stores original atom coords
// check if it is correct style
if (id_event != NULL) {
int ifix = modify->find_fix(id_event);
- if (ifix < 0) error->all(FLERR,"Could not find compute event/displace fix ID");
+ if (ifix < 0) error->all(FLERR,
+ "Could not find compute event/displace fix ID");
fix_event = (FixEvent*) modify->fix[ifix];
if (strcmp(fix_event->style,"EVENT/PRD") != 0 &&
strcmp(fix_event->style,"EVENT/TAD") != 0)
error->all(FLERR,"Compute event/displace has invalid fix event assigned");
}
triclinic = domain->triclinic;
}
/* ----------------------------------------------------------------------
return non-zero if an atom has moved > displace_dist since last event
------------------------------------------------------------------------- */
double ComputeEventDisplace::compute_scalar()
{
invoked_scalar = update->ntimestep;
if (id_event == NULL) return 0.0;
double event = 0.0;
double **xevent = fix_event->array_atom;
double **x = atom->x;
int *mask = atom->mask;
int *image = atom->image;
int nlocal = atom->nlocal;
double *h = domain->h;
double xprd = domain->xprd;
double yprd = domain->yprd;
double zprd = domain->zprd;
int xbox,ybox,zbox;
double dx,dy,dz,rsq;
if (triclinic == 0) {
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
xbox = (image[i] & 1023) - 512;
ybox = (image[i] >> 10 & 1023) - 512;
zbox = (image[i] >> 20) - 512;
dx = x[i][0] + xbox*xprd - xevent[i][0];
dy = x[i][1] + ybox*yprd - xevent[i][1];
dz = x[i][2] + zbox*zprd - xevent[i][2];
rsq = dx*dx + dy*dy + dz*dz;
if (rsq >= displace_distsq) {
event = 1.0;
break;
}
}
} else {
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
xbox = (image[i] & 1023) - 512;
ybox = (image[i] >> 10 & 1023) - 512;
zbox = (image[i] >> 20) - 512;
dx = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox - xevent[i][0];
dy = x[i][1] + h[1]*ybox + h[3]*zbox - xevent[i][1];
dz = x[i][2] + h[2]*zbox - xevent[i][2];
rsq = dx*dx + dy*dy + dz*dz;
if (rsq >= displace_distsq) {
event = 1.0;
break;
}
}
}
MPI_Allreduce(&event,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
return scalar;
}
/* ---------------------------------------------------------------------- */
-void ComputeEventDisplace::reset_extra_compute_fix(char *id_new)
+void ComputeEventDisplace::reset_extra_compute_fix(const char *id_new)
{
delete [] id_event;
id_event = NULL;
if (id_new == NULL) return;
int n = strlen(id_new) + 1;
id_event = new char[n];
strcpy(id_event,id_new);
}
diff --git a/src/REPLICA/compute_event_displace.h b/src/REPLICA/compute_event_displace.h
index 21cf8d09f..87135d2be 100644
--- a/src/REPLICA/compute_event_displace.h
+++ b/src/REPLICA/compute_event_displace.h
@@ -1,45 +1,68 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(event/displace,ComputeEventDisplace)
#else
#ifndef LMP_COMPUTE_EVENT_DISPLACE_H
#define LMP_COMPUTE_EVENT_DISPLACE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeEventDisplace : public Compute {
public:
ComputeEventDisplace(class LAMMPS *, int, char **);
~ComputeEventDisplace();
void init();
double compute_scalar();
- void reset_extra_compute_fix(char *);
+ void reset_extra_compute_fix(const char *);
private:
int triclinic;
double displace_distsq;
char *id_event;
class FixEvent *fix_event;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Distance must be > 0 for compute event/displace
+
+Self-explanatory.
+
+E: Could not find compute event/displace fix ID
+
+Self-explanatory.
+
+E: Compute event/displace has invalid fix event assigned
+
+This is an internal LAMMPS error. Please report it to the
+developers.
+
+*/
diff --git a/src/REPLICA/fix_event.h b/src/REPLICA/fix_event.h
index 41ce7f261..6f8db4878 100644
--- a/src/REPLICA/fix_event.h
+++ b/src/REPLICA/fix_event.h
@@ -1,51 +1,61 @@
/* ----------------------------------------------------------------------
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_EVENT_H
#define LMP_FIX_EVENT_H
#include "fix.h"
namespace LAMMPS_NS {
class FixEvent : public Fix {
public:
FixEvent(class LAMMPS *, int, char **);
virtual ~FixEvent()=0; // Use destructor to make base class virtual
int setmask();
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
virtual void write_restart(FILE *);
virtual void restart(char *);
// methods specific to FixEvent
void store_event(); // store quenched atoms
void restore_event(); // restore quenched atoms
void store_state(); // store hot atoms
void restore_state(); // restore hot atoms
private:
double **xevent; // atom coords at last event
double **xold; // atom coords for reset/restore
double **vold; // atom vels for reset/restore
int *imageold; // image flags for reset/restore
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/REPLICA/fix_event_prd.h b/src/REPLICA/fix_event_prd.h
index b1312d8de..11dcbb361 100644
--- a/src/REPLICA/fix_event_prd.h
+++ b/src/REPLICA/fix_event_prd.h
@@ -1,53 +1,63 @@
/* ----------------------------------------------------------------------
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(EVENT/PRD,FixEventPRD)
#else
#ifndef LMP_FIX_EVENT_PRD_H
#define LMP_FIX_EVENT_PRD_H
#include "fix_event.h"
namespace LAMMPS_NS {
class FixEventPRD : public FixEvent {
public:
int event_number; // event counter
bigint event_timestep; // timestep of last event on any replica
int clock; // total elapsed timesteps across all replicas
int replica_number; // replica where last event occured
int correlated_event; // 1 if last event was correlated, 0 otherwise
int ncoincident; // # of simultaneous events on different replicas
FixEventPRD(class LAMMPS *, int, char **);
~FixEventPRD() {}
void write_restart(FILE *);
void restart(char *);
// methods specific to FixEventPRD, invoked by PRD
void store_event_prd(bigint, int);
private:
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/REPLICA/fix_event_tad.h b/src/REPLICA/fix_event_tad.h
index 97e1ad29d..e75450477 100644
--- a/src/REPLICA/fix_event_tad.h
+++ b/src/REPLICA/fix_event_tad.h
@@ -1,51 +1,61 @@
/* ----------------------------------------------------------------------
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(EVENT/TAD,FixEventTAD)
#else
#ifndef LMP_FIX_EVENT_TAD_H
#define LMP_FIX_EVENT_TAD_H
#include "fix_event.h"
namespace LAMMPS_NS {
class FixEventTAD : public FixEvent {
public:
int event_number; // event counter
bigint event_timestep; // timestep of last event
double tlo; // event time at low temperature
double ebarrier; // energy barrier for this event
FixEventTAD(class LAMMPS *, int, char **);
~FixEventTAD() {}
void write_restart(FILE *);
void restart(char *);
// methods specific to FixEventTAD, invoked by TAD
void store_event_tad(bigint);
private:
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/REPLICA/fix_neb.h b/src/REPLICA/fix_neb.h
index 06b2c24ca..140ad6069 100644
--- a/src/REPLICA/fix_neb.h
+++ b/src/REPLICA/fix_neb.h
@@ -1,57 +1,75 @@
/* ----------------------------------------------------------------------
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(neb,FixNEB)
#else
#ifndef LMP_FIX_NEB_H
#define LMP_FIX_NEB_H
#include "fix.h"
namespace LAMMPS_NS {
class FixNEB : public Fix {
public:
double veng,plen,nlen;
int rclimber;
double gradvnorm;
FixNEB(class LAMMPS *, int, char **);
~FixNEB();
int setmask();
void init();
void min_setup(int);
void min_post_force(int);
private:
double kspring;
int ireplica,nreplica;
int procnext,procprev;
MPI_Comm uworld;
char *id_pe;
class Compute *pe;
int nebatoms;
double **xprev,**xnext;
double **tangent;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Potential energy ID for fix neb does not exist
+
+Self-explanatory.
+
+E: Atom count changed in fix neb
+
+This is not allowed in a NEB calculation.
+
+*/
diff --git a/src/REPLICA/neb.h b/src/REPLICA/neb.h
index 363396764..bc88426e4 100644
--- a/src/REPLICA/neb.h
+++ b/src/REPLICA/neb.h
@@ -1,64 +1,125 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(neb,NEB)
#else
#ifndef LMP_NEB_H
#define LMP_NEB_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class NEB : protected Pointers {
public:
NEB(class LAMMPS *);
NEB(class LAMMPS *, double, double, int, int, int, double *, double *);
~NEB();
void command(int, char **); // process neb command
void run(); // run NEB
double ebf,ebr; // forward and reverse energy barriers
private:
int me,me_universe; // my proc ID in world and universe
int ireplica,nreplica;
MPI_Comm uworld;
MPI_Comm roots; // MPI comm with 1 root proc from each world
FILE *fp;
int compressed;
double etol; // energy tolerance convergence criterion
double ftol; // force tolerance convergence criterion
int n1steps, n2steps; // number of steps in stage 1 and 2
int nevery; // output interval
char *infile; // name of file containing final state
class FixNEB *fneb;
int nall; // per-replica dimension of array all
double **all; // PE,plen,nlen,gradvnorm from each replica
double *rdist; // normalize reaction distance, 0 to 1
void readfile(char *);
void open(char *);
void print_status();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: NEB command before simulation box is defined
+
+Self-explanatory.
+
+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: Cannot use NEB with a single replica
+
+Self-explanatory.
+
+E: Can only use NEB with 1-processor replicas
+
+This is current restriction for NEB as implemented in LAMMPS.
+
+E: Cannot use NEB with atom_modify sort enabled
+
+This is current restriction for NEB implemented in LAMMPS.
+
+E: Cannot use NEB unless atom map exists
+
+Use the atom_modify command to create an atom map.
+
+E: NEB requires use of fix neb
+
+Self-explanatory.
+
+E: NEB requires damped dynamics minimizer
+
+Use a different minimization style.
+
+E: Too many timesteps for NEB
+
+You must use a number of timesteps that fit in a 32-bit integer
+for NEB.
+
+E: Too many timesteps
+
+UNDOCUMENTED
+
+E: Incorrect format in NEB coordinate file
+
+Self-explanatory.
+
+E: Cannot open gzipped file
+
+LAMMPS is attempting to open a gzipped version of the specified file
+but was unsuccessful. Check that the path and name are correct.
+
+E: Cannot open file %s
+
+The specified file cannot be opened. Check that the path and name are
+correct.
+
+*/
diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp
index ff20afe73..cc0ec9d0c 100644
--- a/src/REPLICA/prd.cpp
+++ b/src/REPLICA/prd.cpp
@@ -1,822 +1,822 @@
/* ----------------------------------------------------------------------
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: Mike Brown (SNL)
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "mpi.h"
#include "math.h"
#include "stdlib.h"
#include "string.h"
#include "prd.h"
#include "universe.h"
#include "update.h"
#include "atom.h"
#include "domain.h"
#include "region.h"
#include "comm.h"
#include "velocity.h"
#include "integrate.h"
#include "min.h"
#include "neighbor.h"
#include "modify.h"
#include "compute.h"
#include "fix.h"
#include "fix_event_prd.h"
#include "force.h"
#include "pair.h"
#include "random_park.h"
#include "random_mars.h"
#include "output.h"
#include "dump.h"
#include "finish.h"
#include "timer.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PRD::PRD(LAMMPS *lmp) : Pointers(lmp) {}
/* ----------------------------------------------------------------------
perform PRD simulation on one or more replicas
------------------------------------------------------------------------- */
void PRD::command(int narg, char **arg)
{
int flag,ireplica;
// error checks
if (domain->box_exist == 0)
error->all(FLERR,"PRD command before simulation box is defined");
if (universe->nworlds != universe->nprocs &&
atom->map_style == 0)
error->all(FLERR,"Cannot use PRD with multi-processor replicas "
"unless atom map exists");
if (universe->nworlds == 1 && comm->me == 0)
error->warning(FLERR,"Running PRD with only one replica");
if (narg < 7) error->universe_all(FLERR,"Illegal prd command");
nsteps = atoi(arg[0]);
t_event = atoi(arg[1]);
n_dephase = atoi(arg[2]);
t_dephase = atoi(arg[3]);
t_corr = atoi(arg[4]);
char id_compute[strlen(arg[5])+1];
strcpy(id_compute,arg[5]);
int seed = atoi(arg[6]);
options(narg-7,&arg[7]);
// total # of timesteps must be multiple of t_event
if (t_event <= 0) error->universe_all(FLERR,"Invalid t_event in prd command");
if (nsteps % t_event)
error->universe_all(FLERR,"PRD nsteps must be multiple of t_event");
if (t_corr % t_event)
error->universe_all(FLERR,"PRD t_corr must be multiple of t_event");
// local storage
int me_universe = universe->me;
int nprocs_universe = universe->nprocs;
int nreplica = universe->nworlds;
int iworld = universe->iworld;
MPI_Comm_rank(world,&me);
MPI_Comm_size(world,&nprocs);
// comm_replica = communicator between same proc across replicas
// not used if replicas have unequal number of procs
// equal_size_replicas = 1 if all replicas have same # of procs
int color = me;
MPI_Comm_split(universe->uworld,color,0,&comm_replica);
flag = 0;
if (nreplica*nprocs == nprocs_universe) flag = 1;
MPI_Allreduce(&flag,&equal_size_replicas,1,MPI_INT,MPI_MIN,universe->uworld);
// workspace for inter-replica communication via gathers
natoms = atom->natoms;
displacements = NULL;
tagall = NULL;
xall = NULL;
imageall = NULL;
if (nreplica != nprocs_universe) {
displacements = new int[nprocs];
memory->create(tagall,natoms,"prd:tagall");
memory->create(xall,natoms,3,"prd:xall");
memory->create(imageall,natoms,"prd:imageall");
}
// random_select = same RNG for each replica for multiple event selection
// random_dephase = unique RNG for each replica for dephasing
random_select = new RanPark(lmp,seed);
random_dephase = new RanMars(lmp,seed+iworld);
// create ComputeTemp class to monitor temperature
char **args = new char*[3];
args[0] = (char *) "prd_temp";
args[1] = (char *) "all";
args[2] = (char *) "temp";
modify->add_compute(3,args);
temperature = modify->compute[modify->ncompute-1];
// create Velocity class for velocity creation in dephasing
// pass it temperature compute, loop_setting, dist_setting settings
atom->check_mass();
velocity = new Velocity(lmp);
velocity->init_external("all");
args[0] = (char *) "temp";
args[1] = (char *) "prd_temp";
velocity->options(2,args);
args[0] = (char *) "loop";
args[1] = (char *) loop_setting;
if (loop_setting) velocity->options(2,args);
args[0] = (char *) "dist";
args[1] = (char *) dist_setting;
if (dist_setting) velocity->options(2,args);
// create FixEventPRD class to store event and pre-quench states
args[0] = (char *) "prd_event";
args[1] = (char *) "all";
args[2] = (char *) "EVENT/PRD";
modify->add_fix(3,args);
fix_event = (FixEventPRD *) modify->fix[modify->nfix-1];
// create Finish for timing output
finish = new Finish(lmp);
// string clean-up
delete [] args;
delete [] loop_setting;
delete [] dist_setting;
// assign FixEventPRD to event-detection compute
// necessary so it will know atom coords at last event
int icompute = modify->find_compute(id_compute);
if (icompute < 0) error->all(FLERR,"Could not find compute ID for PRD");
compute_event = modify->compute[icompute];
compute_event->reset_extra_compute_fix("prd_event");
// reset reneighboring criteria since will perform minimizations
neigh_every = neighbor->every;
neigh_delay = neighbor->delay;
neigh_dist_check = neighbor->dist_check;
if (neigh_every != 1 || neigh_delay != 0 || neigh_dist_check != 1) {
if (me == 0)
error->warning(FLERR,"Resetting reneighboring criteria during PRD");
}
neighbor->every = 1;
neighbor->delay = 0;
neighbor->dist_check = 1;
// initialize PRD as if one long dynamics run
update->whichflag = 1;
update->nsteps = nsteps;
update->beginstep = update->firststep = update->ntimestep;
update->endstep = update->laststep = update->firststep + nsteps;
update->restrict_output = 1;
if (update->laststep < 0 || update->laststep > MAXBIGINT)
error->all(FLERR,"Too many timesteps");
lmp->init();
// init minimizer settings and minimizer itself
update->etol = etol;
update->ftol = ftol;
update->max_eval = maxeval;
update->minimize->init();
// cannot use PRD with time-dependent fixes or regions or atom sorting
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->time_depend)
error->all(FLERR,"Cannot use PRD with a time-dependent fix defined");
for (int i = 0; i < domain->nregion; i++)
if (domain->regions[i]->dynamic_check())
error->all(FLERR,"Cannot use PRD with a time-dependent region defined");
if (atom->sortfreq > 0)
error->all(FLERR,"Cannot use PRD with atom_modify sort enabled");
// perform PRD simulation
if (me_universe == 0 && universe->uscreen)
fprintf(universe->uscreen,"Setting up PRD ...\n");
if (me_universe == 0) {
if (universe->uscreen)
fprintf(universe->uscreen,"Step CPU Clock Event "
"Correlated Coincident Replica\n");
if (universe->ulogfile)
fprintf(universe->ulogfile,"Step CPU Clock Event "
"Correlated Coincident Replica\n");
}
// store hot state and quenched event for replica 0
// use share_event() to copy that info to all replicas
// this insures all start from same place
// need this line if quench() does only setup_minimal()
// update->minimize->setup();
fix_event->store_state();
quench();
ncoincident = 0;
share_event(0,0);
timer->init();
timer->barrier_start(TIME_LOOP);
time_start = timer->array[TIME_LOOP];
log_event();
// do full init/setup since are starting all replicas after event
// replica 0 bcasts temp to all replicas if temp_dephase is not set
update->whichflag = 1;
lmp->init();
update->integrate->setup();
if (temp_flag == 0) {
if (universe->iworld == 0) temp_dephase = temperature->compute_scalar();
MPI_Bcast(&temp_dephase,1,MPI_DOUBLE,universe->root_proc[0],
universe->uworld);
}
// main loop: look for events until out of time
// (1) dephase independently on each proc after event
// (2) loop: dynamics, store state, quench, check event, restore state
// (3) share and record event
nbuild = ndanger = 0;
time_dephase = time_dynamics = time_quench = time_comm = time_output = 0.0;
timer->barrier_start(TIME_LOOP);
time_start = timer->array[TIME_LOOP];
while (update->ntimestep < update->endstep) {
dephase();
ireplica = -1;
while (update->ntimestep < update->endstep) {
dynamics();
fix_event->store_state();
quench();
ireplica = check_event();
if (ireplica >= 0) break;
fix_event->restore_state();
}
if (ireplica < 0) break;
// potentially more efficient for correlated events if don't
// share until correlated check has completed
// this will complicate the dump (always on replica 0)
share_event(ireplica,1);
log_event();
int restart_flag = 0;
if (output->restart_every && universe->iworld == 0)
if (fix_event->event_number % output->restart_every == 0)
restart_flag = 1;
// correlated event loop
// other procs could be dephasing during this time
int corr_endstep = update->ntimestep + t_corr;
while (update->ntimestep < corr_endstep) {
if (update->ntimestep == update->endstep) {
restart_flag = 0;
break;
}
dynamics();
fix_event->store_state();
quench();
int corr_event_check = check_event(ireplica);
if (corr_event_check >= 0) {
share_event(ireplica,2);
log_event();
corr_endstep = update->ntimestep + t_corr;
} else fix_event->restore_state();
}
// full init/setup since are starting all replicas after event
// event replica bcasts temp to all replicas if temp_dephase is not set
update->whichflag = 1;
lmp->init();
update->integrate->setup();
timer->barrier_start(TIME_LOOP);
if (t_corr > 0) replicate(ireplica);
if (temp_flag == 0) {
if (ireplica == universe->iworld)
temp_dephase = temperature->compute_scalar();
MPI_Bcast(&temp_dephase,1,MPI_DOUBLE,universe->root_proc[ireplica],
universe->uworld);
}
timer->barrier_stop(TIME_LOOP);
time_comm += timer->array[TIME_LOOP];
// write restart file of hot coords
if (restart_flag) {
timer->barrier_start(TIME_LOOP);
output->write_restart(update->ntimestep);
timer->barrier_stop(TIME_LOOP);
time_output += timer->array[TIME_LOOP];
}
}
// set total timers and counters so Finish() will process them
timer->array[TIME_LOOP] = time_start;
timer->barrier_stop(TIME_LOOP);
timer->array[TIME_PAIR] = time_dephase;
timer->array[TIME_BOND] = time_dynamics;
timer->array[TIME_KSPACE] = time_quench;
timer->array[TIME_COMM] = time_comm;
timer->array[TIME_OUTPUT] = time_output;
neighbor->ncalls = nbuild;
neighbor->ndanger = ndanger;
if (me_universe == 0) {
if (universe->uscreen)
fprintf(universe->uscreen,
"Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
" atoms\n",
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
if (universe->ulogfile)
fprintf(universe->ulogfile,
"Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
" atoms\n",
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
}
finish->end(2);
update->whichflag = 0;
update->firststep = update->laststep = 0;
update->beginstep = update->endstep = 0;
update->restrict_output = 0;
// reset reneighboring criteria
neighbor->every = neigh_every;
neighbor->delay = neigh_delay;
neighbor->dist_check = neigh_dist_check;
// clean up
delete [] displacements;
memory->destroy(tagall);
memory->destroy(xall);
memory->destroy(imageall);
MPI_Comm_free(&comm_replica);
delete random_select;
delete random_dephase;
delete velocity;
delete finish;
modify->delete_compute("prd_temp");
modify->delete_fix("prd_event");
compute_event->reset_extra_compute_fix(NULL);
}
/* ----------------------------------------------------------------------
dephasing = one or more short runs with new random velocities
------------------------------------------------------------------------- */
void PRD::dephase()
{
bigint ntimestep_hold = update->ntimestep;
update->whichflag = 1;
update->nsteps = n_dephase*t_dephase;
timer->barrier_start(TIME_LOOP);
for (int i = 0; i < n_dephase; i++) {
int seed = static_cast<int> (random_dephase->uniform() * MAXSMALLINT);
if (seed == 0) seed = 1;
velocity->create(temp_dephase,seed);
update->integrate->run(t_dephase);
if (temp_flag == 0) temp_dephase = temperature->compute_scalar();
}
timer->barrier_stop(TIME_LOOP);
time_dephase += timer->array[TIME_LOOP];
update->integrate->cleanup();
finish->end(0);
// reset timestep as if dephase did not occur
// clear timestep storage from computes, since now invalid
update->ntimestep = ntimestep_hold;
for (int i = 0; i < modify->ncompute; i++)
if (modify->compute[i]->timeflag) modify->compute[i]->clearstep();
}
/* ----------------------------------------------------------------------
single short dynamics run
------------------------------------------------------------------------- */
void PRD::dynamics()
{
update->whichflag = 1;
update->nsteps = t_event;
lmp->init();
update->integrate->setup();
// this may be needed if don't do full init
//modify->addstep_compute_all(update->ntimestep);
int ncalls = neighbor->ncalls;
timer->barrier_start(TIME_LOOP);
update->integrate->run(t_event);
timer->barrier_stop(TIME_LOOP);
time_dynamics += timer->array[TIME_LOOP];
nbuild += neighbor->ncalls - ncalls;
ndanger += neighbor->ndanger;
update->integrate->cleanup();
finish->end(0);
}
/* ----------------------------------------------------------------------
quench minimization
------------------------------------------------------------------------- */
void PRD::quench()
{
bigint ntimestep_hold = update->ntimestep;
bigint endstep_hold = update->endstep;
// need to change whichflag so that minimize->setup() calling
// modify->setup() will call fix->min_setup()
update->whichflag = 2;
update->nsteps = maxiter;
update->endstep = update->laststep = update->firststep + maxiter;
if (update->laststep < 0 || update->laststep > MAXBIGINT)
error->all(FLERR,"Too many iterations");
// full init works
lmp->init();
update->minimize->setup();
// partial init does not work
//modify->addstep_compute_all(update->ntimestep);
//update->minimize->setup_minimal(1);
int ncalls = neighbor->ncalls;
timer->barrier_start(TIME_LOOP);
update->minimize->run(maxiter);
timer->barrier_stop(TIME_LOOP);
time_quench += timer->array[TIME_LOOP];
if (neighbor->ncalls == ncalls) quench_reneighbor = 0;
else quench_reneighbor = 1;
update->minimize->cleanup();
finish->end(0);
// reset timestep as if dephase did not occur
// clear timestep storage from computes, since now invalid
update->ntimestep = ntimestep_hold;
update->endstep = update->laststep = endstep_hold;
for (int i = 0; i < modify->ncompute; i++)
if (modify->compute[i]->timeflag) modify->compute[i]->clearstep();
}
/* ----------------------------------------------------------------------
check for an event in any replica
if replica_num is non-negative only check for event on replica_num
if multiple events, choose one at random
return -1 if no event
else return ireplica = world in which event occured
------------------------------------------------------------------------- */
int PRD::check_event(int replica_num)
{
int worldflag,universeflag,scanflag,replicaflag,ireplica;
worldflag = 0;
if (compute_event->compute_scalar() > 0.0) worldflag = 1;
if (replica_num >= 0 && replica_num != universe->iworld) worldflag = 0;
timer->barrier_start(TIME_LOOP);
if (me == 0) MPI_Allreduce(&worldflag,&universeflag,1,
MPI_INT,MPI_SUM,comm_replica);
MPI_Bcast(&universeflag,1,MPI_INT,0,world);
ncoincident = universeflag;
if (!universeflag) ireplica = -1;
else {
if (universeflag > 1) {
int iwhich = static_cast<int>
(universeflag*random_select->uniform()) + 1;
if (me == 0) MPI_Scan(&worldflag,&scanflag,1,
MPI_INT,MPI_SUM,comm_replica);
MPI_Bcast(&scanflag,1,MPI_INT,0,world);
if (scanflag != iwhich) worldflag = 0;
}
if (worldflag) replicaflag = universe->iworld;
else replicaflag = 0;
if (me == 0) MPI_Allreduce(&replicaflag,&ireplica,1,
MPI_INT,MPI_SUM,comm_replica);
MPI_Bcast(&ireplica,1,MPI_INT,0,world);
}
timer->barrier_stop(TIME_LOOP);
time_comm += timer->array[TIME_LOOP];
return ireplica;
}
/* ----------------------------------------------------------------------
share quenched and hot coords owned by ireplica with all replicas
all replicas store event in fix_event
replica 0 dumps event snapshot
flag = 0 = called before PRD run
flag = 1 = called during PRD run = not correlated event
flag = 2 = called during PRD run = correlated event
------------------------------------------------------------------------- */
void PRD::share_event(int ireplica, int flag)
{
timer->barrier_start(TIME_LOOP);
// communicate quenched coords to all replicas and store as event
// decrement event counter if flag = 0 since not really an event
replicate(ireplica);
timer->barrier_stop(TIME_LOOP);
time_comm += timer->array[TIME_LOOP];
// adjust time for last correlated event check (not on first event)
int corr_adjust = t_corr;
if (fix_event->event_number < 1 || flag == 2) corr_adjust = 0;
// delta = time since last correlated event check
int delta = update->ntimestep - fix_event->event_timestep - corr_adjust;
// if this is a correlated event, time elapsed only on one partition
if (flag != 2) delta *= universe->nworlds;
delta += corr_adjust;
// don't change the clock or timestep if this is a restart
if (flag == 0 && fix_event->event_number != 0)
fix_event->store_event_prd(fix_event->event_timestep,0);
else {
fix_event->store_event_prd(update->ntimestep,delta);
fix_event->replica_number = ireplica;
fix_event->correlated_event = 0;
if (flag == 2) fix_event->correlated_event = 1;
fix_event->ncoincident = ncoincident;
}
if (flag == 0) fix_event->event_number--;
// dump snapshot of quenched coords
// must reneighbor and compute forces before dumping
// since replica 0 possibly has new state from another replica
// addstep_compute_all insures eng/virial are calculated if needed
if (output->ndump && universe->iworld == 0) {
timer->barrier_start(TIME_LOOP);
modify->addstep_compute_all(update->ntimestep);
update->integrate->setup_minimal(1);
output->write_dump(update->ntimestep);
timer->barrier_stop(TIME_LOOP);
time_output += timer->array[TIME_LOOP];
}
// restore and communicate hot coords to all replicas
fix_event->restore_state();
timer->barrier_start(TIME_LOOP);
replicate(ireplica);
timer->barrier_stop(TIME_LOOP);
time_comm += timer->array[TIME_LOOP];
}
/* ----------------------------------------------------------------------
universe proc 0 prints event info
------------------------------------------------------------------------- */
void PRD::log_event()
{
timer->array[TIME_LOOP] = time_start;
if (universe->me == 0) {
if (universe->uscreen)
fprintf(universe->uscreen,
BIGINT_FORMAT " %.3f %d %d %d %d %d\n",
fix_event->event_timestep,
timer->elapsed(TIME_LOOP),
fix_event->clock,
fix_event->event_number,fix_event->correlated_event,
fix_event->ncoincident,
fix_event->replica_number);
if (universe->ulogfile)
fprintf(universe->ulogfile,
BIGINT_FORMAT " %.3f %d %d %d %d %d\n",
fix_event->event_timestep,
timer->elapsed(TIME_LOOP),
fix_event->clock,
fix_event->event_number,fix_event->correlated_event,
fix_event->ncoincident,
fix_event->replica_number);
}
}
/* ----------------------------------------------------------------------
communicate atom coords and image flags in ireplica to all other replicas
one proc per replica:
direct overwrite via bcast
equal procs per replica and no replica reneighbored:
direct overwrite via bcast
unequal procs per replica or reneighboring occurred:
collect to root proc of event replica
bcast to roots of other replicas
bcast within each replica
each proc extracts info for atoms it owns using atom IDs
------------------------------------------------------------------------- */
void PRD::replicate(int ireplica)
{
int nreplica = universe->nworlds;
int nprocs_universe = universe->nprocs;
int i,m,flag,commflag;
int counts[nprocs];
if (nreplica == nprocs_universe) commflag = 0;
else if (equal_size_replicas) {
flag = 0;
if (quench_reneighbor) flag = 1;
MPI_Allreduce(&flag,&commflag,1,MPI_INT,MPI_MAX,universe->uworld);
} else commflag = 1;
if (commflag == 0) {
MPI_Bcast(atom->image,atom->nlocal,MPI_INT,ireplica,comm_replica);
MPI_Bcast(atom->x[0],3*atom->nlocal,MPI_DOUBLE,ireplica,comm_replica);
} else {
if (universe->iworld == ireplica) {
MPI_Gather(&atom->nlocal,1,MPI_INT,counts,1,MPI_INT,0,world);
displacements[0] = 0;
for (i = 0; i < nprocs-1; i++)
displacements[i+1] = displacements[i] + counts[i];
MPI_Gatherv(atom->tag,atom->nlocal,MPI_INT,
tagall,counts,displacements,MPI_INT,0,world);
MPI_Gatherv(atom->image,atom->nlocal,MPI_INT,
imageall,counts,displacements,MPI_INT,0,world);
for (i = 0; i < nprocs; i++) counts[i] *= 3;
for (i = 0; i < nprocs-1; i++)
displacements[i+1] = displacements[i] + counts[i];
MPI_Gatherv(atom->x[0],3*atom->nlocal,MPI_DOUBLE,
xall[0],counts,displacements,MPI_DOUBLE,0,world);
}
if (me == 0) {
MPI_Bcast(tagall,natoms,MPI_INT,ireplica,comm_replica);
MPI_Bcast(imageall,natoms,MPI_INT,ireplica,comm_replica);
MPI_Bcast(xall[0],3*natoms,MPI_DOUBLE,ireplica,comm_replica);
}
MPI_Bcast(tagall,natoms,MPI_INT,0,world);
MPI_Bcast(imageall,natoms,MPI_INT,0,world);
MPI_Bcast(xall[0],3*natoms,MPI_DOUBLE,0,world);
double **x = atom->x;
int nlocal = atom->nlocal;
for (i = 0; i < natoms; i++) {
m = atom->map(tagall[i]);
if (m >= 0 && m < nlocal) {
x[m][0] = xall[i][0];
x[m][1] = xall[i][1];
x[m][2] = xall[i][2];
atom->image[m] = imageall[i];
}
}
}
}
/* ----------------------------------------------------------------------
parse optional parameters at end of PRD input line
------------------------------------------------------------------------- */
void PRD::options(int narg, char **arg)
{
if (narg < 0) error->all(FLERR,"Illegal prd command");
// set defaults
etol = 0.1;
ftol = 0.1;
maxiter = 40;
maxeval = 50;
temp_flag = 0;
- char *str = "geom";
+ char *str = (char *) "geom";
int n = strlen(str) + 1;
loop_setting = new char[n];
strcpy(loop_setting,str);
- str = "gaussian";
+ str = (char *) "gaussian";
n = strlen(str) + 1;
dist_setting = new char[n];
strcpy(dist_setting,str);
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"min") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal prd command");
etol = atof(arg[iarg+1]);
ftol = atof(arg[iarg+2]);
maxiter = atoi(arg[iarg+3]);
maxeval = atoi(arg[iarg+4]);
if (maxiter < 0) error->all(FLERR,"Illegal prd command");
iarg += 5;
} else if (strcmp(arg[iarg],"temp") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal prd command");
temp_flag = 1;
temp_dephase = atof(arg[iarg+1]);
if (temp_dephase <= 0.0) error->all(FLERR,"Illegal prd command");
iarg += 2;
} else if (strcmp(arg[iarg],"vel") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal prd command");
delete [] loop_setting;
delete [] dist_setting;
if (strcmp(arg[iarg+1],"all") == 0) loop_setting = NULL;
else if (strcmp(arg[iarg+1],"local") == 0) loop_setting = NULL;
else if (strcmp(arg[iarg+1],"geom") == 0) loop_setting = NULL;
else error->all(FLERR,"Illegal prd command");
int n = strlen(arg[iarg+1]) + 1;
loop_setting = new char[n];
strcpy(loop_setting,arg[iarg+1]);
if (strcmp(arg[iarg+2],"uniform") == 0) dist_setting = NULL;
else if (strcmp(arg[iarg+2],"gaussian") == 0) dist_setting = NULL;
else error->all(FLERR,"Illegal prd command");
n = strlen(arg[iarg+2]) + 1;
dist_setting = new char[n];
strcpy(dist_setting,arg[iarg+2]);
iarg += 3;
} else error->all(FLERR,"Illegal prd command");
}
}
diff --git a/src/REPLICA/prd.h b/src/REPLICA/prd.h
index c060718de..69c3d38e5 100644
--- a/src/REPLICA/prd.h
+++ b/src/REPLICA/prd.h
@@ -1,75 +1,143 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(prd,PRD)
#else
#ifndef LMP_PRD_H
#define LMP_PRD_H
#include "pointers.h"
namespace LAMMPS_NS {
class PRD : protected Pointers {
public:
PRD(class LAMMPS *);
~PRD() {}
void command(int, char **);
private:
int me,nprocs;
int nsteps,t_event,n_dephase,t_dephase,t_corr;
double etol,ftol,temp_dephase;
int maxiter,maxeval,temp_flag;
char *loop_setting,*dist_setting;
int equal_size_replicas,natoms;
int neigh_every,neigh_delay,neigh_dist_check;
int nbuild,ndanger;
int quench_reneighbor;
double time_dephase,time_dynamics,time_quench,time_comm,time_output;
double time_start;
MPI_Comm comm_replica;
int *tagall,*displacements,*imageall;
double **xall;
int ncoincident;
class RanPark *random_select;
class RanMars *random_dephase;
class Compute *compute_event;
class FixEventPRD *fix_event;
class Velocity *velocity;
class Compute *temperature;
class Finish *finish;
void dephase();
void dynamics();
void quench();
int check_event(int replica = -1);
void share_event(int, int);
void log_event();
void replicate(int);
void options(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: PRD command before simulation box is defined
+
+The prd command cannot be used before a read_data,
+read_restart, or create_box command.
+
+E: Cannot use PRD with multi-processor replicas unless atom map exists
+
+Use the atom_modify command to create an atom map.
+
+W: Running PRD with only one replica
+
+This is allowed, but you will get no parallel speed-up.
+
+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: Invalid t_event in prd command
+
+Self-explanatory.
+
+E: PRD nsteps must be multiple of t_event
+
+Self-explanatory.
+
+E: PRD t_corr must be multiple of t_event
+
+Self-explanatory.
+
+E: Could not find compute ID for PRD
+
+Self-explanatory.
+
+W: Resetting reneighboring criteria during PRD
+
+A PRD simulation requires that neigh_modify settings be delay = 0,
+every = 1, check = yes. Since these settings were not in place,
+LAMMPS changed them and will restore them to their original values
+after the PRD simulation.
+
+E: Too many timesteps
+
+UNDOCUMENTED
+
+E: Cannot use PRD with a time-dependent fix defined
+
+PRD alters the timestep in ways that will mess up these fixes.
+
+E: Cannot use PRD with a time-dependent region defined
+
+PRD alters the timestep in ways that will mess up these regions.
+
+E: Cannot use PRD with atom_modify sort enabled
+
+This is a current restriction of PRD. You must turn off sorting,
+which is enabled by default, via the atom_modify command.
+
+E: Too many iterations
+
+You must use a number of iterations that fit in a 32-bit integer
+for minimization.
+
+*/
diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp
index 50e352ebd..9bc23ac48 100644
--- a/src/REPLICA/tad.cpp
+++ b/src/REPLICA/tad.cpp
@@ -1,1014 +1,1014 @@
/* ----------------------------------------------------------------------
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: Aidan Thompson (SNL)
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "mpi.h"
#include "math.h"
#include "stdlib.h"
#include "string.h"
#include "tad.h"
#include "universe.h"
#include "update.h"
#include "atom.h"
#include "domain.h"
#include "region.h"
#include "comm.h"
#include "velocity.h"
#include "integrate.h"
#include "min.h"
#include "neighbor.h"
#include "modify.h"
#include "neb.h"
#include "compute.h"
#include "fix.h"
#include "fix_event_tad.h"
#include "fix_store_state.h"
#include "force.h"
#include "pair.h"
#include "random_park.h"
#include "random_mars.h"
#include "output.h"
#include "dump.h"
#include "finish.h"
#include "timer.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
TAD::TAD(LAMMPS *lmp) : Pointers(lmp) {}
/* ---------------------------------------------------------------------- */
TAD::~TAD()
{
memory->sfree(fix_event_list);
if (neb_logfilename != NULL) delete [] neb_logfilename;
delete [] min_style;
delete [] min_style_neb;
}
/* ----------------------------------------------------------------------
perform TAD simulation on root proc
other procs only used for NEB calcs
------------------------------------------------------------------------- */
void TAD::command(int narg, char **arg)
{
fix_event_list = NULL;
n_event_list = 0;
nmax_event_list = 0;
nmin_event_list = 10;
// error checks
if (domain->box_exist == 0)
error->all(FLERR,"Tad command before simulation box is defined");
if (universe->nworlds == 1)
error->all(FLERR,"Cannot use TAD with a single replica for NEB");
if (universe->nworlds != universe->nprocs)
error->all(FLERR,"Can only use TAD with 1-processor replicas for NEB");
if (atom->sortfreq > 0)
error->all(FLERR,"Cannot use TAD with atom_modify sort enabled for NEB");
if (atom->map_style == 0)
error->all(FLERR,"Cannot use TAD unless atom map exists for NEB");
if (narg < 7) error->universe_all(FLERR,"Illegal tad command");
nsteps = atoi(arg[0]);
t_event = atoi(arg[1]);
templo = atof(arg[2]);
temphi = atof(arg[3]);
delta_conf = atof(arg[4]);
tmax = atof(arg[5]);
char id_compute[strlen(arg[6])+1];
strcpy(id_compute,arg[6]);
options(narg-7,&arg[7]);
// total # of timesteps must be multiple of t_event
if (t_event <= 0) error->universe_all(FLERR,"Invalid t_event in tad command");
if (nsteps % t_event)
error->universe_all(FLERR,"TAD nsteps must be multiple of t_event");
if (delta_conf <= 0.0 || delta_conf >= 1.0)
error->universe_all(FLERR,"Invalid delta_conf in tad command");
if (tmax <= 0.0)
error->universe_all(FLERR,"Invalid tmax in tad command");
// deltconf = (ln(1/delta))/freq_min (timestep units)
deltconf = -log(delta_conf)*tmax/update->dt;
// local storage
int me_universe = universe->me;
int nprocs_universe = universe->nprocs;
MPI_Comm_rank(world,&me);
MPI_Comm_size(world,&nprocs);
delta_beta = (1.0/templo - 1.0/temphi) / force->boltz;
ratio_beta = templo/temphi;
// create FixEventTAD object to store last event
int narg2 = 3;
char **args = new char*[narg2];
args[0] = (char *) "tad_event";
args[1] = (char *) "all";
args[2] = (char *) "EVENT/TAD";
modify->add_fix(narg2,args);
fix_event = (FixEventTAD *) modify->fix[modify->nfix-1];
delete [] args;
// create FixStoreState object to store revert state
narg2 = 13;
args = new char*[narg2];
args[0] = (char *) "tad_revert";
args[1] = (char *) "all";
args[2] = (char *) "store/state";
args[3] = (char *) "0";
args[4] = (char *) "x";
args[5] = (char *) "y";
args[6] = (char *) "z";
args[7] = (char *) "ix";
args[8] = (char *) "iy";
args[9] = (char *) "iz";
args[10] = (char *) "vx";
args[11] = (char *) "vy";
args[12] = (char *) "vz";
modify->add_fix(narg2,args);
fix_revert = (FixStoreState *) modify->fix[modify->nfix-1];
delete [] args;
// create Finish for timing output
finish = new Finish(lmp);
// assign FixEventTAD to event-detection compute
// necessary so it will know atom coords at last event
int icompute = modify->find_compute(id_compute);
if (icompute < 0) error->all(FLERR,"Could not find compute ID for TAD");
compute_event = modify->compute[icompute];
compute_event->reset_extra_compute_fix("tad_event");
// reset reneighboring criteria since will perform minimizations
neigh_every = neighbor->every;
neigh_delay = neighbor->delay;
neigh_dist_check = neighbor->dist_check;
if (neigh_every != 1 || neigh_delay != 0 || neigh_dist_check != 1) {
if (me_universe == 0)
error->warning(FLERR,"Resetting reneighboring criteria during TAD");
}
neighbor->every = 1;
neighbor->delay = 0;
neighbor->dist_check = 1;
// initialize TAD as if one long dynamics run
update->whichflag = 1;
update->nsteps = nsteps;
update->beginstep = update->firststep = update->ntimestep;
update->endstep = update->laststep = update->firststep + nsteps;
update->restrict_output = 1;
if (update->laststep < 0 || update->laststep > MAXBIGINT)
error->all(FLERR,"Too many timesteps");
lmp->init();
// set minimize style for quench
narg2 = 1;
args = new char*[narg2];
args[0] = min_style;
update->create_minimize(narg2,args);
delete [] args;
// init minimizer settings and minimizer itself
update->etol = etol;
update->ftol = ftol;
update->max_eval = maxeval;
update->minimize->init();
// perform TAD simulation
if (me_universe == 0 && universe->uscreen)
fprintf(universe->uscreen,"Setting up TAD ...\n");
if (me_universe == 0) {
if (universe->uscreen)
fprintf(universe->uscreen,
"Step CPU N M Status Barrier Margin t_lo delt_lo\n"
);
if (universe->ulogfile)
fprintf(universe->ulogfile,
"Step CPU N M Status Barrier Margin t_lo delt_lo\n"
);
}
ulogfile_lammps = universe->ulogfile;
uscreen_lammps = universe->uscreen;
ulogfile_neb = NULL;
uscreen_neb = NULL;
if (me_universe == 0 && neb_logfilename)
ulogfile_neb = fopen(neb_logfilename,"w");
// store hot state and quenched event, only on replica 0
// need this line if quench() does only setup_minimal()
// update->minimize->setup();
// This should work with if uncommented, but does not
// if (universe->iworld == 0) {
fix_event->store_state();
quench();
timer->init();
timer->barrier_start(TIME_LOOP);
time_start = timer->array[TIME_LOOP];
fix_event->store_event_tad(update->ntimestep);
log_event(0);
fix_event->restore_state();
// do full init/setup
update->whichflag = 1;
lmp->init();
update->integrate->setup();
// }
// main loop: look for events until out of time
// (1) dynamics, store state, quench, check event, restore state
// (2) if event, perform NEB, record in fix_event_list
// (3) if confident, pick earliest event
nbuild = ndanger = 0;
time_neb = time_dynamics = time_quench = time_comm = time_output = 0.0;
timer->barrier_start(TIME_LOOP);
time_start = timer->array[TIME_LOOP];
int confident_flag, event_flag;
if (universe->iworld == 0) {
while (update->ntimestep < update->endstep) {
// initialize list of possible events
initialize_event_list();
confident_flag = 0;
while (update->ntimestep < update->endstep) {
event_flag = 0;
while (update->ntimestep < update->endstep) {
dynamics();
fix_event->store_state();
quench();
event_flag = check_event();
MPI_Bcast(&event_flag,1,MPI_INT,0,universe->uworld);
if (event_flag) break;
// restore hot state
fix_event->restore_state();
// store hot state in revert
fix_revert->end_of_step();
}
if (!event_flag) break;
add_event();
perform_neb(n_event_list-1);
compute_tlo(n_event_list-1);
confident_flag = check_confidence();
MPI_Bcast(&confident_flag,1,MPI_INT,0,universe->uworld);
if (confident_flag) break;
if (universe->iworld == 0) revert();
}
if (!confident_flag) break;
perform_event(event_first);
// need to sync timestep with TAD
MPI_Bcast(&(update->ntimestep),1,MPI_INT,0,universe->uworld);
int restart_flag = 0;
if (output->restart_every && universe->iworld == 0)
if (fix_event->event_number % output->restart_every == 0)
restart_flag = 1;
// full init/setup since are starting after event
update->whichflag = 1;
lmp->init();
update->integrate->setup();
// write restart file of hot coords
if (restart_flag) {
timer->barrier_start(TIME_LOOP);
output->write_restart(update->ntimestep);
timer->barrier_stop(TIME_LOOP);
time_output += timer->array[TIME_LOOP];
}
}
} else {
while (update->ntimestep < update->endstep) {
confident_flag = 0;
while (update->ntimestep < update->endstep) {
event_flag = 0;
while (update->ntimestep < update->endstep) {
update->ntimestep += t_event;
MPI_Bcast(&event_flag,1,MPI_INT,0,universe->uworld);
if (event_flag) break;
}
if (!event_flag) break;
perform_neb(-1);
MPI_Bcast(&confident_flag,1,MPI_INT,0,universe->uworld);
if (confident_flag) break;
}
if (!confident_flag) break;
// need to sync timestep with TAD
MPI_Bcast(&(update->ntimestep),1,MPI_INT,0,universe->uworld);
}
}
// set total timers and counters so Finish() will process them
timer->array[TIME_LOOP] = time_start;
timer->barrier_stop(TIME_LOOP);
timer->array[TIME_PAIR] = time_neb;
timer->array[TIME_BOND] = time_dynamics;
timer->array[TIME_KSPACE] = time_quench;
timer->array[TIME_COMM] = time_comm;
timer->array[TIME_OUTPUT] = time_output;
neighbor->ncalls = nbuild;
neighbor->ndanger = ndanger;
if (me_universe == 0) {
if (universe->uscreen)
fprintf(universe->uscreen,
"Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
" atoms\n",
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
if (universe->ulogfile)
fprintf(universe->ulogfile,
"Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
" atoms\n",
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
}
if (me_universe == 0) fclose(ulogfile_neb);
finish->end(3);
update->whichflag = 0;
update->firststep = update->laststep = 0;
update->beginstep = update->endstep = 0;
update->restrict_output = 0;
// reset reneighboring criteria
neighbor->every = neigh_every;
neighbor->delay = neigh_delay;
neighbor->dist_check = neigh_dist_check;
delete finish;
modify->delete_fix("tad_event");
modify->delete_fix("tad_revert");
delete_event_list();
compute_event->reset_extra_compute_fix(NULL);
}
/* ----------------------------------------------------------------------
single short dynamics run
------------------------------------------------------------------------- */
void TAD::dynamics()
{
update->whichflag = 1;
update->nsteps = t_event;
lmp->init();
update->integrate->setup();
// this may be needed if don't do full init
//modify->addstep_compute_all(update->ntimestep);
int ncalls = neighbor->ncalls;
timer->barrier_start(TIME_LOOP);
update->integrate->run(t_event);
timer->barrier_stop(TIME_LOOP);
time_dynamics += timer->array[TIME_LOOP];
nbuild += neighbor->ncalls - ncalls;
ndanger += neighbor->ndanger;
update->integrate->cleanup();
finish->end(0);
}
/* ----------------------------------------------------------------------
quench minimization
------------------------------------------------------------------------- */
void TAD::quench()
{
bigint ntimestep_hold = update->ntimestep;
bigint endstep_hold = update->endstep;
// need to change whichflag so that minimize->setup() calling
// modify->setup() will call fix->min_setup()
update->whichflag = 2;
update->nsteps = maxiter;
update->endstep = update->laststep = update->firststep + maxiter;
if (update->laststep < 0 || update->laststep > MAXBIGINT)
error->all(FLERR,"Too many iterations");
// full init works
lmp->init();
update->minimize->setup();
// partial init does not work
//modify->addstep_compute_all(update->ntimestep);
//update->minimize->setup_minimal(1);
int ncalls = neighbor->ncalls;
timer->barrier_start(TIME_LOOP);
update->minimize->run(maxiter);
timer->barrier_stop(TIME_LOOP);
time_quench += timer->array[TIME_LOOP];
if (neighbor->ncalls == ncalls) quench_reneighbor = 0;
else quench_reneighbor = 1;
update->minimize->cleanup();
finish->end(1);
// reset timestep as if quench did not occur
// clear timestep storage from computes, since now invalid
update->ntimestep = ntimestep_hold;
update->endstep = update->laststep = endstep_hold;
for (int i = 0; i < modify->ncompute; i++)
if (modify->compute[i]->timeflag) modify->compute[i]->clearstep();
}
/* ----------------------------------------------------------------------
check for an event
return 0 if no event
return 1 if event
------------------------------------------------------------------------- */
int TAD::check_event()
{
int flag;
flag = 0;
if (compute_event->compute_scalar() > 0.0) flag = 1;
return flag;
}
/* ----------------------------------------------------------------------
universe proc 0 prints event info
------------------------------------------------------------------------- */
void TAD::log_event(int ievent)
{
timer->array[TIME_LOOP] = time_start;
if (universe->me == 0) {
double tfrac = 0.0;
if (universe->uscreen)
fprintf(universe->uscreen,
BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
fix_event->event_timestep,
timer->elapsed(TIME_LOOP),
fix_event->event_number,ievent,
"E ",
fix_event->ebarrier,tfrac,
fix_event->tlo,deltfirst);
if (universe->ulogfile)
fprintf(universe->ulogfile,
BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
fix_event->event_timestep,
timer->elapsed(TIME_LOOP),
fix_event->event_number,ievent,
"E ",
fix_event->ebarrier,tfrac,
fix_event->tlo,deltfirst);
}
// dump snapshot of quenched coords
// must reneighbor and compute forces before dumping
// addstep_compute_all insures eng/virial are calculated if needed
if (output->ndump && universe->iworld == 0) {
timer->barrier_start(TIME_LOOP);
modify->addstep_compute_all(update->ntimestep);
update->integrate->setup_minimal(1);
output->write_dump(update->ntimestep);
timer->barrier_stop(TIME_LOOP);
time_output += timer->array[TIME_LOOP];
}
}
/* ----------------------------------------------------------------------
parse optional parameters at end of TAD input line
------------------------------------------------------------------------- */
void TAD::options(int narg, char **arg)
{
if (narg < 0) error->all(FLERR,"Illegal tad command");
// set defaults
etol = 0.1;
ftol = 0.1;
maxiter = 40;
maxeval = 50;
etol_neb = 0.01;
ftol_neb = 0.01;
n1steps_neb = 100;
n2steps_neb = 100;
nevery_neb = 10;
min_style = new char[3];
strcpy(min_style,"cg");
min_style_neb = new char[9];
strcpy(min_style_neb,"quickmin");
neb_logfilename = NULL;
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"min") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal tad command");
etol = atof(arg[iarg+1]);
ftol = atof(arg[iarg+2]);
maxiter = atoi(arg[iarg+3]);
maxeval = atoi(arg[iarg+4]);
if (maxiter < 0 || maxeval < 0 ||
etol < 0.0 || ftol < 0.0 )
error->all(FLERR,"Illegal tad command");
iarg += 5;
} else if (strcmp(arg[iarg],"neb") == 0) {
if (iarg+6 > narg) error->all(FLERR,"Illegal tad command");
etol_neb = atof(arg[iarg+1]);
ftol_neb = atof(arg[iarg+2]);
n1steps_neb = atoi(arg[iarg+3]);
n2steps_neb = atoi(arg[iarg+4]);
nevery_neb = atoi(arg[iarg+5]);
if (etol_neb < 0.0 || ftol_neb < 0.0 ||
n1steps_neb < 0 || n2steps_neb < 0 ||
nevery_neb < 0) error->all(FLERR,"Illegal tad command");
iarg += 6;
} else if (strcmp(arg[iarg],"min_style") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal tad command");
int n = strlen(arg[iarg+1]) + 1;
delete [] min_style;
min_style = new char[n];
strcpy(min_style,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"neb_style") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal tad command");
int n = strlen(arg[iarg+1]) + 1;
delete [] min_style_neb;
min_style_neb = new char[n];
strcpy(min_style_neb,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"neb_log") == 0) {
delete [] neb_logfilename;
if (iarg+2 > narg) error->all(FLERR,"Illegal tad command");
if (strcmp(arg[iarg+1],"none") == 0) neb_logfilename = NULL;
else {
int n = strlen(arg[iarg+1]) + 1;
neb_logfilename = new char[n];
strcpy(neb_logfilename,arg[iarg+1]);
}
iarg += 2;
} else error->all(FLERR,"Illegal tad command");
}
}
/* ----------------------------------------------------------------------
perform NEB calculation
------------------------------------------------------------------------- */
void TAD::perform_neb(int ievent)
{
double **x = atom->x;
int nlocal = atom->nlocal;
double *buf_final;
memory->create(buf_final,3*nlocal,"tad:buffinal");
// set system to quenched state of event ievent
if (universe->iworld == 0) {
fix_event_list[ievent]->restore_event();
int ii = 0;
for (int i = 0; i < nlocal; i++) {
buf_final[ii++] = x[i][0];
buf_final[ii++] = x[i][1];
buf_final[ii++] = x[i][2];
}
}
MPI_Bcast(buf_final,3*nlocal,MPI_DOUBLE,universe->root_proc[0],
universe->uworld);
double *buf_init;
memory->create(buf_init,3*nlocal,"tad:bufinit");
// set system to quenched state of fix_event
if (universe->iworld == 0) {
fix_event->restore_event();
int ii = 0;
for (int i = 0; i < nlocal; i++) {
buf_init[ii++] = x[i][0];
buf_init[ii++] = x[i][1];
buf_init[ii++] = x[i][2];
}
}
MPI_Bcast(buf_init,3*nlocal,MPI_DOUBLE,universe->root_proc[0],
universe->uworld);
// create FixNEB object to support NEB
int narg2 = 4;
char **args = new char*[narg2];
args[0] = (char *) "neb";
args[1] = (char *) "all";
args[2] = (char *) "neb";
char str[128];
args[3] = str;
double kspring = 1.0;
sprintf(args[3],"%f",kspring);
modify->add_fix(narg2,args);
fix_neb = (Fix *) modify->fix[modify->nfix-1];
delete [] args;
// switch minimize style to quickmin for NEB
narg2 = 1;
args = new char*[narg2];
args[0] = min_style_neb;
update->create_minimize(narg2,args);
delete [] args;
// create NEB object
neb = new NEB(lmp,etol_neb,ftol_neb,n1steps_neb,
n2steps_neb,nevery_neb,buf_init,buf_final);
// free up temporary arrays
memory->destroy(buf_init);
memory->destroy(buf_final);
// run NEB
int beginstep_hold = update->beginstep;
int endstep_hold = update->endstep;
int ntimestep_hold = update->ntimestep;
int nsteps_hold = update->nsteps;
if (universe->me == 0) {
universe->ulogfile = ulogfile_neb;
universe->uscreen = uscreen_neb;
}
// Had to bypass timer interface
// because timer->array is reset
// inside neb->run()
// timer->barrier_start(TIME_LOOP);
// neb->run();
// timer->barrier_stop(TIME_LOOP);
// time_neb += timer->array[TIME_LOOP];
MPI_Barrier(world);
double time_tmp = MPI_Wtime();
neb->run();
MPI_Barrier(world);
time_neb += MPI_Wtime() - time_tmp;
if (universe->me == 0) {
universe->ulogfile = ulogfile_lammps;
universe->uscreen = uscreen_lammps;
}
// extract barrier energy from NEB
if (universe->iworld == 0)
fix_event_list[ievent]->ebarrier = neb->ebf;
update->beginstep = update->firststep = beginstep_hold;
update->endstep = update->laststep = endstep_hold;
update->ntimestep = ntimestep_hold;
update->nsteps = nsteps_hold;
// switch minimize style back for quench
narg2 = 1;
args = new char*[narg2];
args[0] = min_style;
update->create_minimize(narg2,args);
update->etol = etol;
update->ftol = ftol;
delete [] args;
// clean up
modify->delete_fix("neb");
delete neb;
}
/* ----------------------------------------------------------------------
check if confidence criterion for tstop is satisfied
return 0 if not satisfied
return 1 if satisfied
------------------------------------------------------------------------- */
int TAD::check_confidence()
{
int flag;
// update stopping time
deltstop = deltconf*pow(deltfirst/deltconf, ratio_beta);
flag = 0;
if (deltstop < update->ntimestep - fix_event->event_timestep) flag = 1;
return flag;
}
/* ----------------------------------------------------------------------
reflect back in to starting state
------------------------------------------------------------------------- */
void TAD::revert()
{
double **x = atom->x;
double **v = atom->v;
int *image = atom->image;
int nlocal = atom->nlocal;
double **array_atom = fix_revert->array_atom;
for (int i = 0; i < nlocal; i++) {
x[i][0] = array_atom[i][0];
x[i][1] = array_atom[i][1];
x[i][2] = array_atom[i][2];
image[i] = ((int(array_atom[i][5]) + 512 & 1023) << 20) |
((int(array_atom[i][4]) + 512 & 1023) << 10) |
(int(array_atom[i][3]) + 512 & 1023);
v[i][0] = -array_atom[i][6];
v[i][1] = -array_atom[i][7];
v[i][2] = -array_atom[i][8];
}
}
/* ----------------------------------------------------------------------
Initialize list of possible events
------------------------------------------------------------------------- */
void TAD::initialize_event_list() {
// First delete old events, if any
delete_event_list();
// Create new list
n_event_list = 0;
grow_event_list(nmin_event_list);
}
/* ----------------------------------------------------------------------
Delete list of possible events
------------------------------------------------------------------------- */
void TAD::delete_event_list() {
for (int i = 0; i < n_event_list; i++) {
char str[128];
sprintf(str,"tad_event_%d",i);
modify->delete_fix(str);
}
memory->sfree(fix_event_list);
fix_event_list = NULL;
n_event_list = 0;
nmax_event_list = 0;
}
/* ----------------------------------------------------------------------
add event
------------------------------------------------------------------------- */
void TAD::add_event()
{
// create FixEventTAD object to store possible event
int narg = 3;
char **args = new char*[narg];
char str[128];
sprintf(str,"tad_event_%d",n_event_list);
args[0] = str;
args[1] = (char *) "all";
args[2] = (char *) "EVENT/TAD";
modify->add_fix(narg,args);
if (n_event_list == nmax_event_list)
grow_event_list(nmax_event_list+nmin_event_list);
n_event_list += 1;
int ievent = n_event_list-1;
fix_event_list[ievent] = (FixEventTAD *) modify->fix[modify->nfix-1];
// store quenched state for new event
fix_event_list[ievent]->store_event_tad(update->ntimestep);
// store hot state for new event
fix_event->restore_state();
fix_event_list[ievent]->store_state();
// string clean-up
delete [] args;
}
/* ----------------------------------------------------------------------
compute cold time for event ievent
------------------------------------------------------------------------- */
void TAD::compute_tlo(int ievent)
{
double deltlo,delthi,ebarrier;
ebarrier = fix_event_list[ievent]->ebarrier;
delthi = fix_event_list[ievent]->event_timestep
- fix_event->event_timestep;
deltlo = delthi*exp(ebarrier*delta_beta);
fix_event_list[ievent]->tlo = fix_event->tlo + deltlo;
// update first event
- char* statstr = "D ";
+ char* statstr = (char *) "D ";
if (ievent == 0) {
deltfirst = deltlo;
event_first = ievent;
- statstr = "DF";
+ statstr = (char *) "DF";
} else if (deltlo < deltfirst) {
deltfirst = deltlo;
event_first = ievent;
- statstr = "DF";
+ statstr = (char *) "DF";
}
// first-replica output about each event
timer->array[TIME_LOOP] = time_start;
if (universe->me == 0) {
double tfrac = 0.0;
if (ievent > 0) tfrac = delthi/deltstop;
if (universe->uscreen)
fprintf(universe->uscreen,
BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
fix_event_list[ievent]->event_timestep,
timer->elapsed(TIME_LOOP),
fix_event->event_number,
ievent,statstr,ebarrier,tfrac,
fix_event->tlo,deltlo);
if (universe->ulogfile)
fprintf(universe->ulogfile,
BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
fix_event_list[ievent]->event_timestep,
timer->elapsed(TIME_LOOP),
fix_event->event_number,
ievent,statstr,ebarrier,tfrac,
fix_event->tlo,deltlo);
}
}
/* ----------------------------------------------------------------------
perform event
------------------------------------------------------------------------- */
void TAD::perform_event(int ievent)
{
// reset timestep to that of event
update->ntimestep = fix_event_list[ievent]->event_timestep;
// Copy event to current event
// Should really use copy constructor for this
fix_event->tlo = fix_event_list[ievent]->tlo;
fix_event->ebarrier = fix_event_list[ievent]->ebarrier;
fix_event->event_number++;
fix_event->event_timestep = update->ntimestep;
fix_event_list[ievent]->restore_event();
fix_event->store_event_tad(fix_event_list[ievent]->event_timestep);
// output stats and dump for quenched state
log_event(ievent);
// load and store hot state
fix_event_list[ievent]->restore_state();
fix_event->store_state();
}
/* ----------------------------------------------------------------------
Allocate list of pointers to events
------------------------------------------------------------------------- */
void TAD::grow_event_list(int nmax) {
if (nmax_event_list > nmax) return;
fix_event_list = (FixEventTAD **)
memory->srealloc(fix_event_list,nmax*sizeof(FixEventTAD *),"tad:eventlist");
nmax_event_list = nmax;
}
diff --git a/src/REPLICA/tad.h b/src/REPLICA/tad.h
index 84143f37c..b9962ad5f 100644
--- a/src/REPLICA/tad.h
+++ b/src/REPLICA/tad.h
@@ -1,88 +1,154 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(tad,TAD)
#else
#ifndef LMP_TAD_H
#define LMP_TAD_H
#include "pointers.h"
namespace LAMMPS_NS {
class TAD : protected Pointers {
public:
TAD(class LAMMPS *);
~TAD();
void command(int, char **);
private:
int me,nprocs;
int nsteps,t_event;
double templo,temphi,delta_conf,tmax;
double etol,ftol,etol_neb,ftol_neb;
int maxiter,maxeval,n1steps_neb,n2steps_neb,nevery_neb;
char *min_style, *min_style_neb;
double delta_beta,ratio_beta;
double deltconf,deltstop,deltfirst; // Times since last event
int event_first;
int neigh_every,neigh_delay,neigh_dist_check;
int nbuild,ndanger;
int quench_reneighbor;
double time_dynamics,time_quench,time_neb,time_comm,time_output;
double time_start;
class NEB *neb; // NEB object
class Fix *fix_neb; // FixNEB object
class Compute *compute_event; // compute to detect event
class FixEventTAD *fix_event; // current event/state
class FixStoreState *fix_revert; // revert state
FixEventTAD **fix_event_list; // list of possible events
int n_event_list; // number of events
int nmax_event_list; // allocated events
int nmin_event_list; // minimum allocation
char *neb_logfilename; // filename for ulogfile_neb
FILE *uscreen_neb; // neb universe screen output
FILE *ulogfile_neb; // neb universe logfile
FILE *uscreen_lammps; // lammps universe screen output
FILE *ulogfile_lammps; // lammps universe logfile
class Finish *finish;
void dynamics();
void quench();
int check_event();
int check_confidence();
void perform_neb(int);
void log_event(int);
void options(int, char **);
void revert();
void add_event();
void perform_event(int);
void compute_tlo(int);
void grow_event_list(int);
void initialize_event_list();
void delete_event_list();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Tad command before simulation box is defined
+
+Self-explanatory.
+
+E: Cannot use TAD with a single replica for NEB
+
+NEB requires multiple replicas.
+
+E: Can only use TAD with 1-processor replicas for NEB
+
+This is current restriction for NEB as implemented in LAMMPS.
+
+E: Cannot use TAD with atom_modify sort enabled for NEB
+
+This is a current restriction of NEB.
+
+E: Cannot use TAD unless atom map exists for NEB
+
+See atom_modify map command to set this.
+
+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: Invalid t_event in tad command
+
+The value must be greater than 0.
+
+E: TAD nsteps must be multiple of t_event
+
+Self-explanatory.
+
+E: Invalid delta_conf in tad command
+
+The value must be between 0 and 1 inclusive.
+
+E: Invalid tmax in tad command
+
+The value must be greater than 0.0.
+
+E: Could not find compute ID for TAD
+
+Self-explanatory.
+
+W: Resetting reneighboring criteria during TAD
+
+A TAD simulation requires that neigh_modify settings be delay = 0,
+every = 1, check = yes. Since these settings were not in place,
+LAMMPS changed them and will restore them to their original values
+after the PRD simulation.
+
+E: Too many timesteps
+
+UNDOCUMENTED
+
+E: Too many iterations
+
+You must use a number of iterations that fit in a 32-bit integer
+for minimization.
+
+*/
diff --git a/src/REPLICA/temper.h b/src/REPLICA/temper.h
index 58c3a7aa7..abda20d76 100644
--- a/src/REPLICA/temper.h
+++ b/src/REPLICA/temper.h
@@ -1,59 +1,106 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(temper,Temper)
#else
#ifndef LMP_TEMPER_H
#define LMP_TEMPER_H
#include "pointers.h"
namespace LAMMPS_NS {
class Temper : protected Pointers {
public:
Temper(class LAMMPS *);
~Temper();
void command(int, char **);
private:
int me,me_universe; // my proc ID in world and universe
int iworld,nworlds; // world info
double boltz; // copy from output->boltz
MPI_Comm roots; // MPI comm with 1 root proc from each world
class RanPark *ranswap,*ranboltz; // RNGs for swapping and Boltz factor
int nevery; // # of timesteps between swaps
int nswaps; // # of tempering swaps to perform
int seed_swap; // 0 = toggle swaps, n = RNG for swap direction
int seed_boltz; // seed for Boltz factor comparison
int whichfix; // index of temperature fix to use
int fixstyle; // what kind of temperature fix is used
int my_set_temp; // which set temp I am simulating
double *set_temp; // static list of replica set temperatures
int *temp2world; // temp2world[i] = world simulating set temp i
int *world2temp; // world2temp[i] = temp simulated by world i
int *world2root; // world2root[i] = root proc of world i
void scale_velocities(int, int);
void print_status();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Must have more than one processor partition to temper
+
+Cannot use the temper command with only one processor partition. Use
+the -partition command-line option.
+
+E: Temper command before simulation box is defined
+
+The temper command cannot be used before a read_data, read_restart, or
+create_box command.
+
+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: Tempering fix ID is not defined
+
+The fix ID specified by the temper command does not exist.
+
+E: Invalid frequency in temper command
+
+Nevery must be > 0.
+
+E: Non integer # of swaps in temper command
+
+Swap frequency in temper command must evenly divide the total # of
+timesteps.
+
+E: Tempering temperature fix is not valid
+
+The fix specified by the temper command is not one that controls
+temperature (nvt or langevin).
+
+E: Too many timesteps
+
+UNDOCUMENTED
+
+E: Tempering could not find thermo_pe compute
+
+This compute is created by the thermo command. It must have been
+explicitly deleted by a uncompute command.
+
+*/
diff --git a/src/REPLICA/verlet_split.cpp b/src/REPLICA/verlet_split.cpp
index e84cbc81e..fe8ad48e2 100644
--- a/src/REPLICA/verlet_split.cpp
+++ b/src/REPLICA/verlet_split.cpp
@@ -1,508 +1,521 @@
/* -------------------------------------------------------------------------
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: Yuxing Peng and Chris Knight (U Chicago)
------------------------------------------------------------------------- */
#include "string.h"
#include "verlet_split.h"
#include "universe.h"
#include "neighbor.h"
#include "domain.h"
#include "comm.h"
#include "atom.h"
#include "atom_vec.h"
#include "force.h"
#include "pair.h"
#include "bond.h"
#include "angle.h"
#include "dihedral.h"
#include "improper.h"
#include "kspace.h"
#include "output.h"
#include "update.h"
#include "modify.h"
#include "timer.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
VerletSplit::VerletSplit(LAMMPS *lmp, int narg, char **arg) :
Verlet(lmp, narg, arg)
{
// error checks on partitions
if (universe->nworlds != 2)
error->universe_all(FLERR,"Verlet/split requires 2 partitions");
if (universe->procs_per_world[0] % universe->procs_per_world[1])
error->universe_all(FLERR,"Verlet/split requires Rspace partition "
"size be multiple of Kspace partition size");
// master = 1 for Rspace procs, 0 for Kspace procs
if (universe->iworld == 0) master = 1;
else master = 0;
ratio = universe->procs_per_world[0] / universe->procs_per_world[1];
// Kspace root proc broadcasts info about Kspace proc layout to Rspace procs
int kspace_procgrid[3];
if (universe->me == universe->root_proc[1]) {
kspace_procgrid[0] = comm->procgrid[0];
kspace_procgrid[1] = comm->procgrid[1];
kspace_procgrid[2] = comm->procgrid[2];
}
MPI_Bcast(kspace_procgrid,3,MPI_INT,universe->root_proc[1],universe->uworld);
int ***kspace_grid2proc;
memory->create(kspace_grid2proc,kspace_procgrid[0],
kspace_procgrid[1],kspace_procgrid[2],
"verlet/split:kspace_grid2proc");
if (universe->me == universe->root_proc[1]) {
for (int i = 0; i < comm->procgrid[0]; i++)
for (int j = 0; j < comm->procgrid[1]; j++)
for (int k = 0; k < comm->procgrid[2]; k++)
kspace_grid2proc[i][j][k] = comm->grid2proc[i][j][k];
}
MPI_Bcast(&kspace_grid2proc[0][0][0],
kspace_procgrid[0]*kspace_procgrid[1]*kspace_procgrid[2],MPI_INT,
universe->root_proc[1],universe->uworld);
// Rspace partition must be multiple of Kspace partition in each dim
// so atoms of one Kspace proc coincide with atoms of several Rspace procs
if (master) {
int flag = 0;
if (comm->procgrid[0] % kspace_procgrid[0]) flag = 1;
if (comm->procgrid[1] % kspace_procgrid[1]) flag = 1;
if (comm->procgrid[2] % kspace_procgrid[2]) flag = 1;
if (flag)
error->one(FLERR,
"Verlet/split requires Rspace partition layout be "
"multiple of Kspace partition layout in each dim");
}
// block = 1 Kspace proc with set of Rspace procs it overlays
// me_block = 0 for Kspace proc
// me_block = 1 to ratio for Rspace procs
// block = MPI communicator for that set of procs
int iblock,key;
if (!master) {
iblock = comm->me;
key = 0;
} else {
int kpx = comm->myloc[0] / (comm->procgrid[0]/kspace_procgrid[0]);
int kpy = comm->myloc[1] / (comm->procgrid[1]/kspace_procgrid[1]);
int kpz = comm->myloc[2] / (comm->procgrid[2]/kspace_procgrid[2]);
iblock = kspace_grid2proc[kpx][kpy][kpz];
key = 1;
}
MPI_Comm_split(universe->uworld,iblock,key,&block);
MPI_Comm_rank(block,&me_block);
// output block groupings to universe screen/logfile
// bmap is ordered by block and then by proc within block
int *bmap = new int[universe->nprocs];
for (int i = 0; i < universe->nprocs; i++) bmap[i] = -1;
bmap[iblock*(ratio+1)+me_block] = universe->me;
int *bmapall = new int[universe->nprocs];
MPI_Allreduce(bmap,bmapall,universe->nprocs,MPI_INT,MPI_MAX,universe->uworld);
if (universe->me == 0) {
if (universe->uscreen) {
- fprintf(universe->uscreen,"Rspace/Kspace procs in each block:\n");
+ fprintf(universe->uscreen,
+ "Per-block Rspace/Kspace proc IDs (original proc IDs):\n");
int m = 0;
for (int i = 0; i < universe->nprocs/(ratio+1); i++) {
fprintf(universe->uscreen," block %d:",i);
int kspace_proc = bmapall[m];
for (int j = 1; j <= ratio; j++)
fprintf(universe->uscreen," %d",bmapall[m+j]);
- fprintf(universe->uscreen," %d\n",kspace_proc);
- /*
+ fprintf(universe->uscreen," %d",kspace_proc);
kspace_proc = bmapall[m];
- for (int j = 1; j <= ratio; j++)
- fprintf(universe->uscreen," %d",
- universe->proc2original[bmapall[m+j]]);
- fprintf(universe->uscreen," %d\n",universe->proc2original[kspace_proc]);
- */
+ for (int j = 1; j <= ratio; j++) {
+ if (j == 1) fprintf(universe->uscreen," (");
+ else fprintf(universe->uscreen," ");
+ fprintf(universe->uscreen,"%d",
+ universe->uni2orig[bmapall[m+j]]);
+ }
+ fprintf(universe->uscreen," %d)\n",universe->uni2orig[kspace_proc]);
m += ratio + 1;
}
}
if (universe->ulogfile) {
- fprintf(universe->ulogfile,"Rspace/Kspace procs in each block:\n");
+ fprintf(universe->ulogfile,
+ "Per-block Rspace/Kspace proc IDs (original proc IDs):\n");
int m = 0;
for (int i = 0; i < universe->nprocs/(ratio+1); i++) {
fprintf(universe->ulogfile," block %d:",i);
- int kspace_proc = bmapall[m++];
+ int kspace_proc = bmapall[m];
for (int j = 1; j <= ratio; j++)
- fprintf(universe->ulogfile," %d",bmapall[m++]);
- fprintf(universe->ulogfile," %d\n",kspace_proc);
+ fprintf(universe->ulogfile," %d",bmapall[m+j]);
+
+ fprintf(universe->ulogfile," %d",kspace_proc);
+ kspace_proc = bmapall[m];
+ for (int j = 1; j <= ratio; j++) {
+ if (j == 1) fprintf(universe->ulogfile," (");
+ else fprintf(universe->ulogfile," ");
+ fprintf(universe->ulogfile,"%d",
+ universe->uni2orig[bmapall[m+j]]);
+ }
+ fprintf(universe->ulogfile," %d)\n",universe->uni2orig[kspace_proc]);
+ m += ratio + 1;
}
}
}
memory->destroy(kspace_grid2proc);
delete [] bmap;
delete [] bmapall;
// size/disp = vectors for MPI gather/scatter within block
qsize = new int[ratio+1];
qdisp = new int[ratio+1];
xsize = new int[ratio+1];
xdisp = new int[ratio+1];
// f_kspace = Rspace copy of Kspace forces
// allocate dummy version for Kspace partition
maxatom = 0;
f_kspace = NULL;
if (!master) memory->create(f_kspace,1,1,"verlet/split:f_kspace");
}
/* ---------------------------------------------------------------------- */
VerletSplit::~VerletSplit()
{
delete [] qsize;
delete [] qdisp;
delete [] xsize;
delete [] xdisp;
memory->destroy(f_kspace);
MPI_Comm_free(&block);
}
/* ----------------------------------------------------------------------
initialization before run
------------------------------------------------------------------------- */
void VerletSplit::init()
{
if (!force->kspace && comm->me == 0)
error->warning(FLERR,"No Kspace calculation with verlet/split");
if (force->kspace_match("tip4p",0)) tip4p_flag = 1;
else tip4p_flag = 0;
Verlet::init();
}
/* ----------------------------------------------------------------------
run for N steps
master partition does everything but Kspace
servant partition does just Kspace
communicate back and forth every step:
atom coords from master -> servant
kspace forces from servant -> master
also box bounds from master -> servant if necessary
------------------------------------------------------------------------- */
void VerletSplit::run(int n)
{
int nflag,ntimestep,sortflag;
// sync both partitions before start timer
MPI_Barrier(universe->uworld);
timer->init();
timer->barrier_start(TIME_LOOP);
// setup initial Rspace <-> Kspace comm params
rk_setup();
// flags for timestepping iterations
int n_post_integrate = modify->n_post_integrate;
int n_pre_exchange = modify->n_pre_exchange;
int n_pre_neighbor = modify->n_pre_neighbor;
int n_pre_force = modify->n_pre_force;
int n_post_force = modify->n_post_force;
int n_end_of_step = modify->n_end_of_step;
if (atom->sortfreq > 0) sortflag = 1;
else sortflag = 0;
for (int i = 0; i < n; i++) {
ntimestep = ++update->ntimestep;
ev_set(ntimestep);
// initial time integration
if (master) {
modify->initial_integrate(vflag);
if (n_post_integrate) modify->post_integrate();
}
// regular communication vs neighbor list rebuild
if (master) nflag = neighbor->decide();
MPI_Bcast(&nflag,1,MPI_INT,1,block);
if (master) {
if (nflag == 0) {
timer->stamp();
comm->forward_comm();
timer->stamp(TIME_COMM);
} else {
if (n_pre_exchange) modify->pre_exchange();
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
if (domain->box_change) {
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
}
timer->stamp();
comm->exchange();
if (sortflag && ntimestep >= atom->nextsort) atom->sort();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
timer->stamp(TIME_COMM);
if (n_pre_neighbor) modify->pre_neighbor();
neighbor->build();
timer->stamp(TIME_NEIGHBOR);
}
}
// if reneighboring occurred, re-setup Rspace <-> Kspace comm params
// comm Rspace atom coords to Kspace procs
if (nflag) rk_setup();
r2k_comm();
// force computations
force_clear();
if (master) {
if (n_pre_force) modify->pre_force(vflag);
timer->stamp();
if (force->pair) {
force->pair->compute(eflag,vflag);
timer->stamp(TIME_PAIR);
}
if (atom->molecular) {
if (force->bond) force->bond->compute(eflag,vflag);
if (force->angle) force->angle->compute(eflag,vflag);
if (force->dihedral) force->dihedral->compute(eflag,vflag);
if (force->improper) force->improper->compute(eflag,vflag);
timer->stamp(TIME_BOND);
}
if (force->newton) {
comm->reverse_comm();
timer->stamp(TIME_COMM);
}
} else {
if (force->kspace) {
timer->stamp();
force->kspace->compute(eflag,vflag);
timer->stamp(TIME_KSPACE);
}
// TIP4P PPPM puts forces on ghost atoms, so must reverse_comm()
if (tip4p_flag && force->newton) {
comm->reverse_comm();
timer->stamp(TIME_COMM);
}
}
// comm and sum Kspace forces back to Rspace procs
k2r_comm();
// force modifications, final time integration, diagnostics
// all output
if (master) {
if (n_post_force) modify->post_force(vflag);
modify->final_integrate();
if (n_end_of_step) modify->end_of_step();
if (ntimestep == output->next) {
timer->stamp();
output->write(ntimestep);
timer->stamp(TIME_OUTPUT);
}
}
}
}
/* ----------------------------------------------------------------------
setup params for Rspace <-> Kspace communication
called initially and after every reneighbor
also communcicate atom charges from Rspace to KSpace since static
------------------------------------------------------------------------- */
void VerletSplit::rk_setup()
{
// grow f_kspace array on master procs if necessary
if (master) {
if (atom->nlocal > maxatom) {
memory->destroy(f_kspace);
maxatom = atom->nmax;
memory->create(f_kspace,maxatom,3,"verlet/split:f_kspace");
}
}
// qsize = # of atoms owned by each master proc in block
int n = 0;
if (master) n = atom->nlocal;
MPI_Gather(&n,1,MPI_INT,qsize,1,MPI_INT,0,block);
// setup qdisp, xsize, xdisp based on qsize
// only needed by Kspace proc
// set Kspace nlocal to sum of Rspace nlocals
// insure Kspace atom arrays are large enough
if (!master) {
qsize[0] = qdisp[0] = xsize[0] = xdisp[0] = 0;
for (int i = 1; i <= ratio; i++) {
qdisp[i] = qdisp[i-1]+qsize[i-1];
xsize[i] = 3*qsize[i];
xdisp[i] = xdisp[i-1]+xsize[i-1];
}
atom->nlocal = qdisp[ratio] + qsize[ratio];
while (atom->nmax <= atom->nlocal) atom->avec->grow(0);
atom->nghost = 0;
}
// one-time gather of Rspace atom charges to Kspace proc
MPI_Gatherv(atom->q,n,MPI_DOUBLE,atom->q,qsize,qdisp,MPI_DOUBLE,0,block);
// for TIP4P also need to send atom type and tag
// KSpace procs need to acquire ghost atoms and map all their atoms
// map_clear() call is in lieu of comm->exchange() which performs map_clear
// borders() call acquires ghost atoms and maps them
if (tip4p_flag) {
MPI_Gatherv(atom->type,n,MPI_INT,atom->type,qsize,qdisp,MPI_INT,0,block);
MPI_Gatherv(atom->tag,n,MPI_INT,atom->tag,qsize,qdisp,MPI_INT,0,block);
if (!master) {
if (triclinic) domain->x2lamda(atom->nlocal);
if (domain->box_change) comm->setup();
timer->stamp();
atom->map_clear();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
timer->stamp(TIME_COMM);
}
}
}
/* ----------------------------------------------------------------------
communicate Rspace atom coords to Kspace
also eflag,vflag and box bounds if needed
------------------------------------------------------------------------- */
void VerletSplit::r2k_comm()
{
MPI_Status status;
int n = 0;
if (master) n = atom->nlocal;
MPI_Gatherv(atom->x[0],n*3,MPI_DOUBLE,atom->x[0],xsize,xdisp,
MPI_DOUBLE,0,block);
// send eflag,vflag from Rspace to Kspace
if (me_block == 1) {
int flags[2];
flags[0] = eflag; flags[1] = vflag;
MPI_Send(flags,2,MPI_INT,0,0,block);
} else if (!master) {
int flags[2];
MPI_Recv(flags,2,MPI_DOUBLE,1,0,block,&status);
eflag = flags[0]; vflag = flags[1];
}
// send box bounds from Rspace to Kspace if simulation box is dynamic
if (domain->box_change) {
if (me_block == 1) {
MPI_Send(domain->boxlo,3,MPI_DOUBLE,0,0,block);
MPI_Send(domain->boxhi,3,MPI_DOUBLE,0,0,block);
} else if (!master) {
MPI_Recv(domain->boxlo,3,MPI_DOUBLE,1,0,block,&status);
MPI_Recv(domain->boxhi,3,MPI_DOUBLE,1,0,block,&status);
domain->set_global_box();
domain->set_local_box();
force->kspace->setup();
}
}
// for TIP4P, Kspace partition needs to update its ghost atoms
if (tip4p_flag && !master) {
timer->stamp();
comm->forward_comm();
timer->stamp(TIME_COMM);
}
}
/* ----------------------------------------------------------------------
communicate and sum Kspace atom forces back to Rspace
------------------------------------------------------------------------- */
void VerletSplit::k2r_comm()
{
if (eflag) MPI_Bcast(&force->kspace->energy,1,MPI_DOUBLE,0,block);
if (vflag) MPI_Bcast(force->kspace->virial,6,MPI_DOUBLE,0,block);
int n = 0;
if (master) n = atom->nlocal;
MPI_Scatterv(atom->f[0],xsize,xdisp,MPI_DOUBLE,
f_kspace[0],n*3,MPI_DOUBLE,0,block);
if (master) {
double **f = atom->f;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
f[i][0] += f_kspace[i][0];
f[i][1] += f_kspace[i][1];
f[i][2] += f_kspace[i][2];
}
}
}
/* ----------------------------------------------------------------------
memory usage of Kspace force array on master procs
------------------------------------------------------------------------- */
bigint VerletSplit::memory_usage()
{
bigint bytes = maxatom*3 * sizeof(double);
return bytes;
}
diff --git a/src/REPLICA/verlet_split.h b/src/REPLICA/verlet_split.h
index 080a6057e..c75b49d1a 100644
--- a/src/REPLICA/verlet_split.h
+++ b/src/REPLICA/verlet_split.h
@@ -1,54 +1,74 @@
/* -------------------------------------------------------------------------
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 INTEGRATE_CLASS
IntegrateStyle(verlet/split,VerletSplit)
#else
#ifndef LMP_VERLET_SPLIT_H
#define LMP_VERLET_SPLIT_H
#include "verlet.h"
namespace LAMMPS_NS {
class VerletSplit : public Verlet {
public:
VerletSplit(class LAMMPS *, int, char **);
~VerletSplit();
void init();
void run(int);
bigint memory_usage();
private:
int master; // 1 if an Rspace proc, 0 if Kspace
int me_block; // proc ID within Rspace/Kspace block
int ratio; // ratio of Rspace procs to Kspace procs
int *qsize,*qdisp,*xsize,*xdisp; // MPI gather/scatter params for block comm
MPI_Comm block; // communicator within one block
int tip4p_flag; // 1 if PPPM/tip4p so do extra comm
double **f_kspace; // copy of Kspace forces on Rspace procs
int maxatom;
void rk_setup();
void r2k_comm();
void k2r_comm();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Verlet/split requires 2 partitions
+
+UNDOCUMENTED
+
+E: Verlet/split requires Rspace partition size be multiple of Kspace partition size
+
+UNDOCUMENTED
+
+E: Verlet/split requires Rspace partition layout be multiple of Kspace partition layout in each dim
+
+UNDOCUMENTED
+
+W: No Kspace calculation with verlet/split
+
+UNDOCUMENTED
+
+*/
diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp
index 39e7a7c09..4a87d616f 100644
--- a/src/SHOCK/fix_append_atoms.cpp
+++ b/src/SHOCK/fix_append_atoms.cpp
@@ -1,495 +1,495 @@
/* ----------------------------------------------------------------------
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 "math.h"
#include "string.h"
#include "stdlib.h"
#include "fix_append_atoms.h"
#include "atom.h"
#include "atom_vec.h"
#include "comm.h"
#include "modify.h"
#include "domain.h"
#include "lattice.h"
#include "update.h"
#include "random_mars.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
#define BIG 1.0e30
#define EPSILON 1.0e-6
/* ---------------------------------------------------------------------- */
FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
force_reneighbor = 1;
next_reneighbor = -1;
box_change = 1;
time_depend = 1;
if (narg < 4) error->all(FLERR,"Illegal fix append_atoms command");
// default settings
scaleflag = 1;
spatflag=0;
xloflag = xhiflag = yloflag = yhiflag = zloflag = zhiflag = 0;
tempflag = 0;
ranflag = 0;
ranx = 0.0;
rany = 0.0;
ranz = 0.0;
randomx = NULL;
randomt = NULL;
int iarg = 0;
iarg = 3;
while (iarg < narg) {
if (strcmp(arg[iarg],"xlo") == 0) {
error->all(FLERR,"Only zhi currently implemented for append_atoms");
xloflag = 1;
iarg++;
if (domain->boundary[0][0] != 3)
error->all(FLERR,"Append boundary must be shrink/minimum");
} else if (strcmp(arg[iarg],"xhi") == 0) {
error->all(FLERR,"Only zhi currently implemented for append_atom");
xhiflag = 1;
iarg++;
if (domain->boundary[0][1] != 3)
error->all(FLERR,"Append boundary must be shrink/minimum");
} else if (strcmp(arg[iarg],"ylo") == 0) {
error->all(FLERR,"Only zhi currently implemented for append_atom");
yloflag = 1;
iarg++;
if (domain->boundary[1][0] != 3)
error->all(FLERR,"Append boundary must be shrink/minimum");
} else if (strcmp(arg[iarg],"yhi") == 0) {
error->all(FLERR,"Only zhi currently implemented for append_atom");
yhiflag = 1;
iarg++;
if (domain->boundary[1][1] != 3)
error->all(FLERR,"Append boundary must be shrink/minimum");
} else if (strcmp(arg[iarg],"zlo") == 0) {
error->all(FLERR,"Only zhi currently implemented for append_atom");
zloflag = 1;
iarg++;
if (domain->boundary[2][0] != 3)
error->all(FLERR,"Append boundary must be shrink/minimum");
} else if (strcmp(arg[iarg],"zhi") == 0) {
zhiflag = 1;
iarg++;
if (domain->boundary[2][1] != 3)
error->all(FLERR,"Append boundary must be shrink/minimum");
} else if (strcmp(arg[iarg],"freq") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix append_atoms command");
freq = atoi(arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"spatial") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix append_atoms command");
if (strcmp(arg[iarg+1],"f_") == 0)
error->all(FLERR,
"Bad fix ID in fix append_atoms command");
spatflag = 1;
int n = strlen(arg[iarg+1]);
spatlead = atof(arg[iarg+2]);
char *suffix = new char[n];
strcpy(suffix,&arg[iarg+1][2]);
n = strlen(suffix) + 1;
spatialid = new char[n];
strcpy(spatialid,suffix);
delete [] suffix;
iarg += 3;
} else if (strcmp(arg[iarg],"size") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix append_atoms command");
size = atof(arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"units") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix append_atoms command");
if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
else error->all(FLERR,"Illegal fix append_atoms command");
iarg += 2;
} else if (strcmp(arg[iarg],"random") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal fix append_atoms command");
ranflag = 1;
ranx = atof(arg[iarg+1]);
rany = atof(arg[iarg+2]);
ranz = atof(arg[iarg+3]);
xseed = atoi(arg[iarg+4]);
if (xseed <= 0) error->all(FLERR,"Illegal fix append_atoms command");
randomx = new RanMars(lmp,xseed + comm->me);
iarg += 5;
} else if (strcmp(arg[iarg],"temp") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal fix append_atoms command");
tempflag = 1;
t_target = atof(arg[iarg+1]);
t_period = atof(arg[iarg+2]);
tseed = atoi(arg[iarg+3]);
t_extent = atof(arg[iarg+4]);
if (t_target <= 0) error->all(FLERR,"Illegal fix append_atoms command");
if (t_period <= 0) error->all(FLERR,"Illegal fix append_atoms command");
if (t_extent <= 0) error->all(FLERR,"Illegal fix append_atoms command");
if (tseed <= 0) error->all(FLERR,"Illegal fix append_atoms command");
randomt = new RanMars(lmp,tseed + comm->me);
gfactor1 = new double[atom->ntypes+1];
gfactor2 = new double[atom->ntypes+1];
iarg += 5;
} else error->all(FLERR,"Illegal fix append_atoms command");
}
if ((xloflag || xhiflag) && domain->xperiodic)
error->all(FLERR,"Cannot use append_atoms in periodic dimension");
if ((yloflag || yhiflag) && domain->yperiodic)
error->all(FLERR,"Cannot use append_atoms in periodic dimension");
if ((zloflag || zhiflag) && domain->zperiodic)
error->all(FLERR,"Cannot use append_atoms in periodic dimension");
if (domain->triclinic == 1)
error->all(FLERR,"Cannot append atoms to a triclinic box");
// setup scaling
if (scaleflag && domain->lattice == NULL)
error->all(FLERR,"Use of fix append_atoms with undefined lattice");
double xscale,yscale,zscale;
if (scaleflag) {
xscale = domain->lattice->xlattice;
yscale = domain->lattice->ylattice;
zscale = domain->lattice->zlattice;
}
else xscale = yscale = zscale = 1.0;
if (xloflag || xhiflag) size *= xscale;
if (yloflag || yhiflag) size *= yscale;
if (zloflag || zhiflag) size *= zscale;
if (ranflag) {
ranx *= xscale;
rany *= yscale;
ranz *= zscale;
}
}
/* ---------------------------------------------------------------------- */
FixAppendAtoms::~FixAppendAtoms()
{
if (ranflag) delete randomx;
if (tempflag) {
delete randomt;
delete [] gfactor1;
delete [] gfactor2;
}
}
/* ---------------------------------------------------------------------- */
int FixAppendAtoms::setmask()
{
int mask = 0;
mask |= PRE_EXCHANGE;
mask |= INITIAL_INTEGRATE;
mask |= POST_FORCE;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixAppendAtoms::initial_integrate(int vflag)
{
if (update->ntimestep % freq == 0) {
next_reneighbor = update->ntimestep;
}
}
/* ---------------------------------------------------------------------- */
void FixAppendAtoms::setup(int vflag)
{
/*** CALL TO CREATE GROUP? SEE POST_FORCE ***/
post_force(vflag);
}
/* ---------------------------------------------------------------------- */
int FixAppendAtoms::get_spatial()
{
if (update->ntimestep % freq == 0) {
int ifix = modify->find_fix(spatialid);
if (ifix < 0)
error->all(FLERR,"Fix ID for fix ave/spatial does not exist");
Fix *fix = modify->fix[ifix];
int failed = 0;
int count = 0;
while (failed < 2) {
double tmp = fix->compute_vector(2*count);
if (tmp == 0.0) failed++;
else failed = 0;
count++;
}
double pos[count-2];
double val[count-2];
for (int loop=0; loop < count-2; loop++) {
pos[loop] = fix->compute_vector(2*loop);
val[loop] = fix->compute_vector(2*loop+1);
}
// Always ignore the first and last
double binsize = 2.0;
double min_energy=0.0;
double max_energy=0.0;
int header = static_cast<int> (size / binsize);
advance = 0;
for (int loop=1; loop <= header; loop++) {
max_energy += val[loop];
}
for (int loop=count-2-2*header; loop <=count-3-header; loop++) {
min_energy += val[loop];
}
max_energy /= header;
min_energy /= header;
double shockfront_min = 0.0;
double shockfront_max = 0.0;
double shockfront_loc = 0.0;
int front_found1 = 0;
for (int loop=count-3-header; loop > header; loop--) {
if (front_found1 == 1) continue;
if (val[loop] > min_energy + 0.1*(max_energy - min_energy)) {
shockfront_max = pos[loop];
front_found1=1;
}
}
int front_found2 = 0;
for (int loop=header+1; loop <=count-3-header; loop++) {
if (val[loop] > min_energy + 0.6*(max_energy - min_energy)) {
shockfront_min = pos[loop];
front_found2=1;
}
}
if (front_found1 + front_found2 == 0) shockfront_loc = 0.0;
else if (front_found1 + front_found2 == 1) shockfront_loc = shockfront_max + shockfront_min;
else if (front_found1 == 1 && front_found2 == 1 && shockfront_max-shockfront_min > spatlead/2.0) shockfront_loc = shockfront_max;
else shockfront_loc = (shockfront_max + shockfront_min) / 2.0;
if (comm->me == 0) printf("SHOCK: %g %g %g %g %g\n", shockfront_loc, shockfront_min, shockfront_max, domain->boxlo[2], domain->boxhi[2]);
if (domain->boxhi[2] - shockfront_loc < spatlead) advance = 1;
}
advance_sum = 0;
MPI_Allreduce(&advance,&advance_sum,1,MPI_INT,MPI_SUM,world);
if (advance_sum > 0) return 1;
else return 0;
}
/* ---------------------------------------------------------------------- */
void FixAppendAtoms::post_force(int vflag)
{
double **f = atom->f;
double **v = atom->v;
double **x = atom->x;
int *type = atom->type;
int nlocal = atom->nlocal;
double gamma1,gamma2;
double tsqrt = sqrt(t_target);
if (atom->mass) {
if (tempflag) {
for (int i = 1; i <= atom->ntypes; i++) {
gfactor1[i] = -atom->mass[i] / t_period / force->ftm2v;
gfactor2[i] = sqrt(atom->mass[i]) *
sqrt(24.0*force->boltz/t_period/update->dt/force->mvv2e) /
force->ftm2v;
}
}
for (int i = 0; i < nlocal; i++) {
// SET TEMP AHEAD OF SHOCK
if (tempflag && x[i][2] >= domain->boxhi[2] - t_extent ) {
gamma1 = gfactor1[type[i]];
gamma2 = gfactor2[type[i]] * tsqrt;
f[i][0] += gamma1*v[i][0] + gamma2*(randomt->uniform()-0.5);
f[i][1] += gamma1*v[i][1] + gamma2*(randomt->uniform()-0.5);
f[i][2] += gamma1*v[i][2] + gamma2*(randomt->uniform()-0.5);
}
// FREEZE ATOMS AT BOUNDARY
if (x[i][2] >= domain->boxhi[2] - size) {
f[i][0] = 0.0;
f[i][1] = 0.0;
f[i][2] = 0.0;
v[i][0] = 0.0;
v[i][1] = 0.0;
v[i][2] = 0.0;
}
}
} else {
double *rmass = atom->rmass;
double boltz = force->boltz;
double dt = update->dt;
double mvv2e = force->mvv2e;
double ftm2v = force->ftm2v;
for (int i = 0; i < nlocal; i++) {
// set temp ahead of shock
if (tempflag && x[i][2] >= domain->boxhi[2] - t_extent ) {
gamma1 = -rmass[i] / t_period / ftm2v;
gamma2 = sqrt(rmass[i]) * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
gamma2 *= tsqrt;
f[i][0] += gamma1*v[i][0] + gamma2*(randomt->uniform()-0.5);
f[i][1] += gamma1*v[i][1] + gamma2*(randomt->uniform()-0.5);
f[i][2] += gamma1*v[i][2] + gamma2*(randomt->uniform()-0.5);
}
// freeze atoms at boundary
if (x[i][2] >= domain->boxhi[2] - size) {
f[i][0] = 0.0;
f[i][1] = 0.0;
f[i][2] = 0.0;
v[i][0] = 0.0;
v[i][1] = 0.0;
v[i][2] = 0.0;
}
}
}
}
/* ---------------------------------------------------------------------- */
void FixAppendAtoms::pre_exchange()
{
int ntimestep = update->ntimestep;
int addnode = 0;
if (ntimestep % freq == 0) {
if (spatflag==1) if (get_spatial()==0) return;
if (comm->myloc[2] == comm->procgrid[2]-1) {
if (domain->lattice) {
nbasis = domain->lattice->nbasis;
basistype = new int[nbasis];
for (int i = 0; i < nbasis; i++) basistype[i] = 1;
- } else error->all(FLERR,"must define lattice to append_atoms");
+ } else error->all(FLERR,"Must define lattice to append_atoms");
double bboxlo[3],bboxhi[3];
bboxlo[0] = domain->sublo[0]; bboxhi[0] = domain->subhi[0];
bboxlo[1] = domain->sublo[1]; bboxhi[1] = domain->subhi[1];
bboxlo[2] = domain->subhi[2]; bboxhi[2] = domain->subhi[2]+size;
double xmin,ymin,zmin,xmax,ymax,zmax;
xmin = ymin = zmin = BIG;
xmax = ymax = zmax = -BIG;
domain->lattice->bbox(1,bboxlo[0],bboxlo[1],bboxlo[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxhi[0],bboxlo[1],bboxlo[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxlo[0],bboxhi[1],bboxlo[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxhi[0],bboxhi[1],bboxlo[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxlo[0],bboxlo[1],bboxhi[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxhi[0],bboxlo[1],bboxhi[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxlo[0],bboxhi[1],bboxhi[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxhi[0],bboxhi[1],bboxhi[2],
xmin,ymin,zmin,xmax,ymax,zmax);
int ilo,ihi,jlo,jhi,klo,khi;
ilo = static_cast<int> (xmin);
jlo = static_cast<int> (ymin);
klo = static_cast<int> (zmin);
ihi = static_cast<int> (xmax);
jhi = static_cast<int> (ymax);
khi = static_cast<int> (zmax);
if (xmin < 0.0) ilo--;
if (ymin < 0.0) jlo--;
if (zmin < 0.0) klo--;
double **basis = domain->lattice->basis;
double x[3];
double *sublo = domain->sublo;
double *subhi = domain->subhi;
double *mass = atom->mass;
int i,j,k,m;
for (k = klo; k <= khi; k++) {
for (j = jlo; j <= jhi; j++) {
for (i = ilo; i <= ihi; i++) {
for (m = 0; m < nbasis; m++) {
x[0] = i + basis[m][0];
x[1] = j + basis[m][1];
x[2] = k + basis[m][2];
int flag = 0;
// convert from lattice coords to box coords
domain->lattice->lattice2box(x[0],x[1],x[2]);
if (x[0] >= sublo[0] && x[0] < subhi[0] &&
x[1] >= sublo[1] && x[1] < subhi[1] &&
x[2] >= subhi[2] && x[2] < subhi[2]+size) flag = 1;
else if (domain->dimension == 2 && x[1] >= domain->boxhi[1] &&
comm->myloc[1] == comm->procgrid[1]-1 &&
x[0] >= sublo[0] && x[0] < subhi[0]) flag = 1;
if (flag) {
if (ranflag) {
x[0] += ranx * 2.0*(randomx->uniform()-0.5);
x[1] += rany * 2.0*(randomx->uniform()-0.5);
x[2] += ranz * 2.0*(randomx->uniform()-0.5);
}
addnode++;
atom->avec->create_atom(basistype[m],x);
}
}
}
}
}
}
int addtotal = 0;
MPI_Barrier(world);
MPI_Allreduce(&addnode,&addtotal,1,MPI_INT,MPI_SUM,world);
if (addtotal) {
domain->reset_box();
if (atom->tag_enable) {
atom->tag_extend();
atom->natoms += addtotal;
if (atom->map_style) {
atom->nghost = 0;
atom->map_init();
atom->map_set();
}
}
}
}
}
diff --git a/src/SHOCK/fix_append_atoms.h b/src/SHOCK/fix_append_atoms.h
index 3d101b921..cdd942840 100644
--- a/src/SHOCK/fix_append_atoms.h
+++ b/src/SHOCK/fix_append_atoms.h
@@ -1,56 +1,106 @@
/* ----------------------------------------------------------------------
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(append_atoms,FixAppendAtoms)
#else
#ifndef FIX_APPEND_ATOMS_H
#define FIX_APPEND_ATOMS_H
#include "fix.h"
namespace LAMMPS_NS {
class FixAppendAtoms : public Fix {
public:
FixAppendAtoms(class LAMMPS *, int, char **);
~FixAppendAtoms();
int setmask();
void setup(int);
void pre_exchange();
void initial_integrate(int);
void post_force(int);
private:
int get_spatial();
int spatflag, xloflag, xhiflag, yloflag, yhiflag, zloflag, zhiflag;
int ranflag, tempflag, xseed, tseed;
double ranx, rany, ranz, t_target, t_period, t_extent;
class RanMars *randomx;
class RanMars *randomt;
int scaleflag, freq;
int *basistype, nbasis;
int advance, advance_sum;
double size, spatlead;
char *spatialid;
double tfactor;
double *gfactor1,*gfactor2;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Only zhi currently implemented for append_atoms
+
+UNDOCUMENTED
+
+E: Append boundary must be shrink/minimum
+
+UNDOCUMENTED
+
+E: Only zhi currently implemented for append_atom
+
+UNDOCUMENTED
+
+E: Bad fix ID in fix append_atoms command
+
+UNDOCUMENTED
+
+E: Cannot use append_atoms in periodic dimension
+
+UNDOCUMENTED
+
+E: Cannot append atoms to a triclinic box
+
+UNDOCUMENTED
+
+E: Use of fix append_atoms with undefined lattice
+
+UNDOCUMENTED
+
+E: Fix ID for fix ave/spatial does not exist
+
+Self-explanatory.
+
+E: Must define lattice to append_atoms
+
+UNDOCUMENTED
+
+U: must define lattice to append_atoms
+
+UNDOCUMENTED
+
+*/
diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp
index 1ba47ee14..267989f30 100644
--- a/src/SHOCK/fix_msst.cpp
+++ b/src/SHOCK/fix_msst.cpp
@@ -1,960 +1,960 @@
/* ----------------------------------------------------------------------
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: Laurence Fried (LLNL), Evan Reed (LLNL, Stanford)
implementation of the Multi-Scale Shock Method
See Reed, Fried, Joannopoulos, Phys Rev Lett, 90, 235503 (2003)
------------------------------------------------------------------------- */
#include "string.h"
#include "stdlib.h"
#include "math.h"
#include "fix_msst.h"
#include "atom.h"
#include "force.h"
#include "comm.h"
#include "output.h"
#include "modify.h"
#include "compute.h"
#include "kspace.h"
#include "update.h"
#include "respa.h"
#include "domain.h"
#include "error.h"
#include "thermo.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal fix msst command");
restart_global = 1;
box_change = 1;
time_integrate = 1;
scalar_flag = 1;
vector_flag = 1;
size_vector = 4;
global_freq = 1;
extscalar = 1;
extvector = 0;
// set defaults
velocity = 0.0;
dilation[0] = dilation[1] = dilation[2] = 1.0;
p0 = 0.0;
v0 = 1.0;
e0 = 0.0;
qmass = 1.0e1;
mu = 0.0;
direction = 2;
p0_set = 0;
v0_set = 0;
e0_set = 0;
tscale = 0.01;
if ( strcmp(arg[3],"x") == 0 )
direction = 0;
else if ( strcmp(arg[3],"y") == 0 )
direction = 1;
else if ( strcmp(arg[3],"z") == 0 )
direction = 2;
else {
error->all(FLERR,"Illegal fix msst command");
}
velocity = atof(arg[4]);
if ( velocity < 0 )
error->all(FLERR,"Illegal fix msst command");
for ( int iarg = 5; iarg < narg; iarg++ ) {
if ( strcmp(arg[iarg],"q") == 0 ) {
qmass = atof(arg[iarg+1]);
iarg++;
} else if ( strcmp(arg[iarg],"mu") == 0 ) {
mu = atof(arg[iarg+1]);
iarg++;
} else if ( strcmp(arg[iarg],"p0") == 0 ) {
p0 = atof(arg[iarg+1]);
iarg++;
p0_set = 1;
} else if ( strcmp(arg[iarg],"v0") == 0 ) {
v0 = atof(arg[iarg+1]);
v0_set = 1;
iarg++;
} else if ( strcmp(arg[iarg],"e0") == 0 ) {
e0 = atof(arg[iarg+1]);
e0_set = 1;
iarg++;
} else if ( strcmp(arg[iarg],"tscale") == 0 ) {
tscale = atof(arg[iarg+1]);
if (tscale < 0.0 || tscale > 1.0)
error->all(FLERR,"Fix msst tscale must satisfy 0 <= tscale < 1");
iarg++;
} else error->all(FLERR,"Illegal fix msst command");
}
if (comm->me == 0) {
if (screen) {
fprintf(screen,"MSST parameters:\n");
if (direction == 0) fprintf(screen," Shock in x direction\n");
else if (direction == 1) fprintf(screen," Shock in y direction\n");
else if (direction == 2) fprintf(screen," Shock in z direction\n");
fprintf(screen," Cell mass-like parameter qmass "
"(units of mass^2/length^4) = %12.5e\n", qmass);
fprintf(screen," Shock velocity = %12.5e\n", velocity);
fprintf(screen," Artificial viscosity "
"(units of mass/length/time) = %12.5e\n", mu);
if (p0_set)
fprintf(screen," Initial pressure specified to be %12.5e\n", p0);
else fprintf(screen," Initial pressure calculated on first step\n");
if (v0_set)
fprintf(screen," Initial volume specified to be %12.5e\n", v0);
else fprintf(screen," Initial volume calculated on first step\n");
if (e0_set)
fprintf(screen," Initial energy specified to be %12.5e\n", e0);
else fprintf(screen," Initial energy calculated on first step\n");
}
if (logfile) {
fprintf(logfile,"MSST parameters:\n");
if (direction == 0) fprintf(logfile," Shock in x direction\n");
else if (direction == 1) fprintf(logfile," Shock in y direction\n");
else if (direction == 2) fprintf(logfile," Shock in z direction\n");
fprintf(logfile," Cell mass-like parameter qmass "
"(units of mass^2/length^4) = %12.5e\n", qmass);
fprintf(logfile," Shock velocity = %12.5e\n", velocity);
fprintf(logfile," Artificial viscosity "
"(units of mass/length/time) = %12.5e\n", mu);
if (p0_set)
fprintf(logfile," Initial pressure specified to be %12.5e\n", p0);
else fprintf(logfile," Initial pressure calculated on first step\n");
if (v0_set)
fprintf(logfile," Initial volume specified to be %12.5e\n", v0);
else fprintf(logfile," Initial volume calculated on first step\n");
if (e0_set)
fprintf(logfile," Initial energy specified to be %12.5e\n", e0);
else fprintf(logfile," Initial energy calculated on first step\n");
}
}
// check for periodicity in controlled dimensions
if (domain->nonperiodic) error->all(FLERR,"Fix msst requires a periodic box");
// 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] = "all";
- newarg[2] = "temp";
+ newarg[1] = (char *) "all";
+ newarg[2] = (char *) "temp";
modify->add_compute(3,newarg);
delete [] newarg;
tflag = 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] = "all";
- newarg[2] = "pressure";
+ newarg[1] = (char *) "all";
+ newarg[2] = (char *) "pressure";
newarg[3] = id_temp;
modify->add_compute(4,newarg);
delete [] newarg;
pflag = 1;
// create a new compute potential energy compute
n = strlen(id) + 3;
id_pe = new char[n];
strcpy(id_pe,id);
strcat(id_pe,"_pe");
newarg = new char*[3];
newarg[0] = id_pe;
newarg[1] = (char*)"all";
newarg[2] = (char*)"pe";
modify->add_compute(3,newarg);
delete [] newarg;
peflag = 1;
// initialize the time derivative of the volume.
omega[0] = omega[1] = omega[2] = 0.0;
nrigid = 0;
rfix = NULL;
old_velocity = new double* [atom->nlocal];
for ( int j = 0; j < atom->nlocal; j++ ) {
old_velocity[j] = new double [3];
}
atoms_allocated = atom->nlocal;
}
/* ---------------------------------------------------------------------- */
FixMSST::~FixMSST()
{
delete [] rfix;
// delete temperature and pressure if fix created them
if (tflag) modify->delete_compute(id_temp);
if (pflag) modify->delete_compute(id_press);
if (peflag) modify->delete_compute(id_pe);
delete [] id_temp;
delete [] id_press;
delete [] id_pe;
for ( int j = 0; j < atoms_allocated; j++ ) {
delete [] old_velocity[j];
}
delete [] old_velocity;
}
/* ---------------------------------------------------------------------- */
int FixMSST::setmask()
{
int mask = 0;
mask |= INITIAL_INTEGRATE;
mask |= FINAL_INTEGRATE;
mask |= THERMO_ENERGY;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixMSST::init()
{
if (atom->mass == NULL)
error->all(FLERR,"Cannot use fix msst without per-type mass defined");
// set compute ptrs
int itemp = modify->find_compute(id_temp);
int ipress = modify->find_compute(id_press);
int ipe = modify->find_compute(id_pe);
if (itemp < 0 || ipress < 0|| ipe < 0)
error->all(FLERR,"Could not find fix msst compute ID");
if (modify->compute[itemp]->tempflag == 0)
error->all(FLERR,"Fix msst compute ID does not compute temperature");
if (modify->compute[ipress]->pressflag == 0)
error->all(FLERR,"Fix msst compute ID does not compute pressure");
if (modify->compute[ipe]->peflag == 0)
error->all(FLERR,"Fix msst compute ID does not compute potential energy");
temperature = modify->compute[itemp];
pressure = modify->compute[ipress];
pe = modify->compute[ipe];
dtv = update->dt;
dtf = 0.5 * update->dt * force->ftm2v;
dthalf = 0.5 * update->dt;
boltz = force->boltz;
nktv2p = force->nktv2p;
mvv2e = force->mvv2e;
double mass = 0.0;
for (int i = 0; i < atom->nlocal; i++) mass += atom->mass[atom->type[i]];
MPI_Allreduce(&mass,&total_mass,1,MPI_DOUBLE,MPI_SUM,world);
total_mass = total_mass;
if (force->kspace) kspace_flag = 1;
else kspace_flag = 0;
// detect if any fix rigid exist so rigid bodies move when box is dilated
// rfix[] = indices to each fix rigid
delete [] rfix;
nrigid = 0;
rfix = NULL;
for (int i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"rigid") == 0 ||
strcmp(modify->fix[i]->style,"poems") == 0) nrigid++;
if (nrigid) {
rfix = new int[nrigid];
nrigid = 0;
for (int i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"rigid") == 0 ||
strcmp(modify->fix[i]->style,"poems") == 0) rfix[nrigid++] = i;
}
}
/* ----------------------------------------------------------------------
compute T,P before integrator starts
------------------------------------------------------------------------- */
void FixMSST::setup(int vflag)
{
lagrangian_position = 0.0;
temperature->compute_vector();
pressure->compute_vector();
couple();
velocity_sum = compute_vsum();
if ( v0_set == 0 ) {
v0 = compute_vol();
v0_set = 1;
if (comm->me == 0) {
if ( screen ) fprintf(screen,"Fix MSST v0 = %12.5e\n", v0);
if ( logfile ) fprintf(logfile,"Fix MSST v0 = %12.5e\n", v0);
}
}
if ( p0_set == 0 ) {
p0 = p_current[direction];
p0_set = 1;
if ( comm->me == 0 ) {
if ( screen ) fprintf(screen,"Fix MSST p0 = %12.5e\n", p0);
if ( logfile ) fprintf(logfile,"Fix MSST p0 = %12.5e\n", p0);
}
}
if ( e0_set == 0 ) {
e0 = compute_etotal();
e0_set = 1;
if ( comm->me == 0 ) {
if ( screen ) fprintf(screen,"Fix MSST e0 = to be %12.5e\n",e0);
if ( logfile ) fprintf(logfile,"Fix MSST e0 = to be %12.5e\n",e0);
}
}
temperature->compute_vector();
double *ke_tensor = temperature->vector;
double ke_temp = ke_tensor[0]+ke_tensor[1]+ke_tensor[2];
if (ke_temp > 0.0 && tscale > 0.0 ) {
// transfer energy from atom velocities to cell volume motion
// to bias initial compression
double **v = atom->v;
int *mask = atom->mask;
double sqrt_initial_temperature_scaling = sqrt(1.0-tscale);
double fac1 = tscale*total_mass/qmass*ke_temp/force->mvv2e;
omega[direction]=-1*sqrt(fac1);
double fac2 = omega[direction]/v0;
if ( comm->me == 0 && tscale != 1.0) {
if ( screen )
fprintf(screen,"Fix MSST initial strain rate of %12.5e established "
"by reducing temperature by factor of %12.5e\n",
fac2,tscale);
if ( logfile )
fprintf(logfile,"Fix MSST initial strain rate of %12.5e established "
"by reducing temperature by factor of %12.5e\n",
fac2,tscale);
}
for (int i = 0; i < atom->nlocal; i++) {
if (mask[i] & groupbit) {
for (int k = 0; k < 3; k++ ) {
v[i][k]*=sqrt_initial_temperature_scaling;
}
}
}
}
// trigger virial computation on next timestep
pressure->addstep(update->ntimestep+1);
}
/* ----------------------------------------------------------------------
1st half of Verlet update
------------------------------------------------------------------------- */
void FixMSST::initial_integrate(int vflag)
{
int sd;
double p_msst; // MSST driving pressure.
int i, k;
double vol;
int nlocal = atom->nlocal;
int *mask = atom->mask;
double **v = atom->v;
double **f = atom->f;
double *mass = atom->mass;
int *type = atom->type;
double **x = atom->x;
// check to see if old_velocity is correctly allocated
check_alloc(nlocal);
sd = direction;
// compute new pressure and volume.
temperature->compute_vector();
pressure->compute_vector();
couple();
vol = compute_vol();
// propagate the time derivative of
// the volume 1/2 step at fixed vol, r, rdot.
p_msst = nktv2p * mvv2e * velocity * velocity * total_mass *
( v0 - vol)/( v0 * v0);
double A = total_mass * ( p_current[sd] - p0 - p_msst ) /
(qmass * nktv2p * mvv2e);
double B = total_mass * mu / ( qmass * vol );
// prevent blow-up of the volume.
if ( vol > v0 && A > 0.0 ) {
A = -A;
}
// use taylor expansion to avoid singularity at B == 0.
if ( B * dthalf > 1.0e-06 ) {
omega[sd] = ( omega[sd] + A * ( exp(B * dthalf) - 1.0 ) / B )
* exp(-B * dthalf);
} else {
omega[sd] = omega[sd] + (A - B * omega[sd]) * dthalf +
0.5 * (B * B * omega[sd] - A * B ) * dthalf * dthalf;
}
// propagate velocity sum 1/2 step by
// temporarily propagating the velocities.
velocity_sum = compute_vsum();
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
for ( k = 0; k < 3; k++ ) {
double C = f[i][k] * force->ftm2v / mass[type[i]];
double D = mu * omega[sd] * omega[sd] /
(velocity_sum * mass[type[i]] * vol );
old_velocity[i][k] = v[i][k];
if ( k == direction ) {
D = D - 2.0 * omega[sd] / vol;
}
if ( fabs(dthalf * D) > 1.0e-06 ) {
double expd = exp(D * dthalf);
v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
} else {
v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
0.5 * (D * D * v[i][k] + C * D ) * dthalf * dthalf;
}
}
}
}
velocity_sum = compute_vsum();
// reset the velocities.
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
for ( k = 0; k < 3; k++ ) {
v[i][k] = old_velocity[i][k];
}
}
}
// propagate velocities 1/2 step using the new velocity sum.
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
for ( k = 0; k < 3; k++ ) {
double C = f[i][k] * force->ftm2v / mass[type[i]];
double D = mu * omega[sd] * omega[sd] /
(velocity_sum * mass[type[i]] * vol );
if ( k == direction ) {
D = D - 2.0 * omega[sd] / vol;
}
if ( fabs(dthalf * D) > 1.0e-06 ) {
double expd = exp(D * dthalf);
v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
} else {
v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
0.5 * (D * D * v[i][k] + C * D ) * dthalf * dthalf;
}
}
}
}
// propagate the volume 1/2 step.
double vol1 = vol + omega[sd] * dthalf;
// rescale positions and change box size.
dilation[sd] = vol1/vol;
remap(0);
// propagate particle positions 1 time step.
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
x[i][0] += dtv * v[i][0];
x[i][1] += dtv * v[i][1];
x[i][2] += dtv * v[i][2];
}
}
// propagate the volume 1/2 step.
double vol2 = vol1 + omega[sd] * dthalf;
// rescale positions and change box size.
dilation[sd] = vol2/vol1;
remap(0);
if (kspace_flag) force->kspace->setup();
}
/* ----------------------------------------------------------------------
2nd half of Verlet update
------------------------------------------------------------------------- */
void FixMSST::final_integrate()
{
int i;
// v update only for atoms in MSST group
double **v = atom->v;
double **f = atom->f;
double *mass = atom->mass;
int *type = atom->type;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double vol = compute_vol();
double p_msst;
int sd = direction;
// propagate particle velocities 1/2 step.
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
for ( int k = 0; k < 3; k++ ) {
double C = f[i][k] * force->ftm2v / mass[type[i]];
double D = mu * omega[sd] * omega[sd] /
(velocity_sum * mass[type[i]] * vol );
if ( k == direction ) {
D = D - 2.0 * omega[sd] / vol;
}
if ( fabs(dthalf * D) > 1.0e-06 ) {
double expd = exp(D * dthalf);
v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
} else {
v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
0.5 * (D * D * v[i][k] + C * D ) * dthalf * dthalf;
}
}
}
}
// compute new pressure and volume.
temperature->compute_vector();
pressure->compute_vector();
couple();
velocity_sum = compute_vsum();
vol = compute_vol();
// propagate the time derivative of the volume 1/2 step at fixed V, r, rdot.
p_msst = nktv2p * mvv2e * velocity * velocity * total_mass *
( v0 - vol )/( v0 * v0 );
double A = total_mass * ( p_current[sd] - p0 - p_msst ) /
( qmass * nktv2p * mvv2e );
double B = total_mass * mu / ( qmass * vol );
// prevent blow-up of the volume.
if ( vol > v0 && A > 0.0 ) {
A = -A;
}
// use taylor expansion to avoid singularity at B == 0.
if ( B * dthalf > 1.0e-06 ) {
omega[sd] = ( omega[sd] + A *
( exp(B * dthalf) - 1.0 ) / B ) * exp(-B * dthalf);
} else {
omega[sd] = omega[sd] + (A - B * omega[sd]) * dthalf +
0.5 * (B * B * omega[sd] - A * B ) * dthalf * dthalf;
}
// calculate Lagrangian position of computational cell
lagrangian_position -= velocity*vol/v0*update->dt;
// trigger virial computation on next timestep
pressure->addstep(update->ntimestep+1);
}
/* ---------------------------------------------------------------------- */
void FixMSST::couple()
{
double *tensor = pressure->vector;
p_current[0] = tensor[0];
p_current[1] = tensor[1];
p_current[2] = tensor[2];
}
/* ----------------------------------------------------------------------
change box size
remap owned or owned+ghost atoms depending on flag
if rigid bodies exist, scale rigid body centers-of-mass
------------------------------------------------------------------------- */
void FixMSST::remap(int flag)
{
int i,n;
double oldlo,oldhi,ctr;
double **v = atom->v;
if (flag) n = atom->nlocal + atom->nghost;
else n = atom->nlocal;
// convert pertinent atoms and rigid bodies to lamda coords
domain->x2lamda(n);
if (nrigid)
for (i = 0; i < nrigid; i++)
modify->fix[rfix[i]]->deform(0);
// reset global and local box to new size/shape
for (i = 0; i < 3; i++) {
if ( direction == i ) {
oldlo = domain->boxlo[i];
oldhi = domain->boxhi[i];
ctr = 0.5 * (oldlo + oldhi);
domain->boxlo[i] = (oldlo-ctr)*dilation[i] + ctr;
domain->boxhi[i] = (oldhi-ctr)*dilation[i] + ctr;
}
}
domain->set_global_box();
domain->set_local_box();
// convert pertinent atoms and rigid bodies back to box coords
domain->lamda2x(n);
if (nrigid)
for (i = 0; i < nrigid; i++)
modify->fix[rfix[i]]->deform(1);
for (i = 0; i < n; i++) {
v[i][direction] = v[i][direction] *
dilation[direction];
}
}
/* ----------------------------------------------------------------------
pack entire state of Fix into one write
------------------------------------------------------------------------- */
void FixMSST::write_restart(FILE *fp)
{
int n = 0;
double list[4];
list[n++] = omega[direction];
list[n++] = e0;
list[n++] = v0;
list[n++] = p0;
if (comm->me == 0) {
int size = n * sizeof(double);
fwrite(&size,sizeof(int),1,fp);
fwrite(&list,sizeof(double),n,fp);
}
}
/* ----------------------------------------------------------------------
use state info from restart file to restart the Fix
------------------------------------------------------------------------- */
void FixMSST::restart(char *buf)
{
int n = 0;
double *list = (double *) buf;
omega[direction] = list[n++];
e0 = list[n++];
v0 = list[n++];
p0 = list[n++];
p0_set = 1;
v0_set = 1;
e0_set = 1;
}
/* ---------------------------------------------------------------------- */
int FixMSST::modify_param(int narg, char **arg)
{
if (strcmp(arg[0],"temp") == 0) {
if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
if (tflag) {
modify->delete_compute(id_temp);
tflag = 0;
}
delete [] id_temp;
int n = strlen(arg[1]) + 1;
id_temp = new char[n];
strcpy(id_temp,arg[1]);
int icompute = modify->find_compute(id_temp);
if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
temperature = modify->compute[icompute];
if (temperature->tempflag == 0)
error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
if (temperature->igroup != 0 && comm->me == 0)
error->warning(FLERR,"Temperature for MSST is not for group all");
return 2;
} else if (strcmp(arg[0],"press") == 0) {
if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
if (pflag) {
modify->delete_compute(id_press);
pflag = 0;
}
delete [] id_press;
int n = strlen(arg[1]) + 1;
id_press = new char[n];
strcpy(id_press,arg[1]);
int icompute = modify->find_compute(id_press);
if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
pressure = modify->compute[icompute];
if (pressure->pressflag == 0)
error->all(FLERR,"Fix_modify pressure ID does not compute pressure");
return 2;
}
return 0;
}
/* ---------------------------------------------------------------------- */
double FixMSST::compute_scalar()
{
// compute new pressure and volume.
temperature->compute_vector();
pressure->compute_vector();
couple();
double volume = compute_vol();
double energy = 0.0;
int i;
i = direction;
energy = qmass * omega[i] * omega[i] / (2.0 * total_mass) * mvv2e;
energy -= 0.5 * total_mass * velocity * velocity *
(1.0 - volume/ v0) *
(1.0 - volume/ v0) * mvv2e;
energy -= p0 * ( v0 - volume ) / nktv2p;
return energy;
}
/* ----------------------------------------------------------------------
return a single element from the following vector,
[dhug,dray,lgr_vel,lgr_pos]
------------------------------------------------------------------------- */
double FixMSST::compute_vector(int n)
{
if (n == 0) {
return compute_hugoniot();
} else if (n == 1) {
return compute_rayleigh();
} else if (n == 2) {
return compute_lagrangian_speed();
} else if (n == 3) {
return compute_lagrangian_position();
}
return 0.0;
}
/* ----------------------------------------------------------------------
Computes the deviation of the current point
from the Hugoniot in Kelvin for the MSST.
------------------------------------------------------------------------- */
double FixMSST::compute_hugoniot()
{
double v, e, p;
double dhugo;
e = compute_etotal();
temperature->compute_vector();
pressure->compute_vector();
p = pressure->vector[direction];
v = compute_vol();
dhugo = (0.5 * (p + p0 ) * ( v0 - v)) /
force->nktv2p + e0 - e;
dhugo /= temperature->dof * force->boltz;
return dhugo;
}
/* ----------------------------------------------------------------------
Computes the deviation of the current point from the Rayleigh
in pressure units for the MSST.
------------------------------------------------------------------------- */
double FixMSST::compute_rayleigh()
{
double v, p;
double drayleigh;
temperature->compute_vector();
pressure->compute_vector();
p = pressure->vector[direction];
v = compute_vol();
drayleigh = p - p0 -
total_mass * velocity * velocity * force->mvv2e *
(1.0 - v / v0 ) * force->nktv2p / v0;
return drayleigh;
}
/* ----------------------------------------------------------------------
Computes the speed of the MSST computational cell in the
unshocked material rest-frame
------------------------------------------------------------------------- */
double FixMSST::compute_lagrangian_speed()
{
double v = compute_vol();
return velocity*(1.0-v/v0);
}
/* ----------------------------------------------------------------------
Computes the distance behind the
shock front of the MSST computational cell.
------------------------------------------------------------------------- */
double FixMSST::compute_lagrangian_position()
{
return lagrangian_position;
}
/* ---------------------------------------------------------------------- */
double FixMSST::compute_etotal()
{
double epot,ekin,etot;
epot = pe->compute_scalar();
if (thermo_energy) epot -= compute_scalar();
ekin = temperature->compute_scalar();
ekin *= 0.5 * temperature->dof * force->boltz;
etot = epot+ekin;
return etot;
}
/* ---------------------------------------------------------------------- */
double FixMSST::compute_vol()
{
if (domain->dimension == 3)
return domain->xprd * domain->yprd * domain->zprd;
else
return domain->xprd * domain->yprd;
}
/* ----------------------------------------------------------------------
Checks to see if the allocated size of old_velocity is >= n
The number of local atoms can change during a parallel run.
------------------------------------------------------------------------- */
void FixMSST::check_alloc(int n)
{
if ( atoms_allocated < n ) {
for ( int j = 0; j < atoms_allocated; j++ ) {
delete [] old_velocity[j];
}
delete [] old_velocity;
old_velocity = new double* [n];
for ( int j = 0; j < n; j++ )
old_velocity[j] = new double [3];
atoms_allocated = n;
}
}
double FixMSST::compute_vsum()
{
double vsum;
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double t = 0.0;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) ;
}
}
MPI_Allreduce(&t,&vsum,1,MPI_DOUBLE,MPI_SUM,world);
return vsum;
}
diff --git a/src/SHOCK/fix_msst.h b/src/SHOCK/fix_msst.h
index 7046b8ac9..26ce3b1c9 100644
--- a/src/SHOCK/fix_msst.h
+++ b/src/SHOCK/fix_msst.h
@@ -1,106 +1,167 @@
/* ----------------------------------------------------------------------
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.
------------------------------------------------------------------------- */
/* Implementation of the Multi-Scale Shock Method.
See Reed, Fried, Joannopoulos, Phys. Rev. Lett., 90, 235503(2003).
Implementation by Laurence Fried, LLNL, 4/2007.
*/
#ifdef FIX_CLASS
FixStyle(msst,FixMSST)
#else
#ifndef FIX_MSST_H
#define FIX_MSST_H
#include "fix.h"
namespace LAMMPS_NS {
class FixMSST : public Fix {
public:
FixMSST(class LAMMPS *, int, char **);
~FixMSST();
int setmask();
void init();
void setup(int);
void initial_integrate(int);
void final_integrate();
double compute_scalar();
double compute_vector(int);
void write_restart(FILE *);
void restart(char *);
int modify_param(int, char **);
private:
double dtv,dtf,dthalf; // Full and half step sizes.
double boltz,nktv2p, mvv2e; // Boltzmann factor and unit conversions.
double total_mass; // Mass of the computational cell.
double omega[3]; // Time derivative of the volume.
double p_current[3],dilation[3];
double qmass; // Effective cell mass.
double mu; // Effective cell viscosity.
double tscale; // Converts thermal energy to compressive
// strain ke at simulation start
double velocity_sum; // Sum of the velocities squared.
double **old_velocity; // Saved velocities.
int kspace_flag; // 1 if KSpace invoked, 0 if not
int nrigid; // number of rigid fixes
int *rfix; // indices of rigid fixes
char *id_temp,*id_press; // Strings with identifiers of
char *id_pe; // created computes.
class Compute *temperature; // Computes created to evaluate
class Compute *pressure; // thermodynamic quantities.
class Compute *pe;
int tflag,pflag,vsflag,peflag; // Flags to keep track of computes that
// were created.
// shock initial conditions.
double e0; // Initial energy
double v0; // Initial volume
double p0; // Initial pressure
double velocity; // Velocity of the shock.
double lagrangian_position; // Lagrangian location of computational cell
int direction; // Direction of shock
int p0_set; // Is pressure set.
int v0_set; // Is volume set.
int e0_set; // Is energy set.
int atoms_allocated; // The number of allocated atoms in old_velocity.
// functions
void couple();
void remap(int);
void check_alloc(int n);
double compute_etotal();
double compute_vol();
double compute_hugoniot();
double compute_rayleigh();
double compute_lagrangian_speed();
double compute_lagrangian_position();
double compute_vsum();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix msst tscale must satisfy 0 <= tscale < 1
+
+Self-explanatory.
+
+E: Fix msst requires a periodic box
+
+Self-explanatory.
+
+E: Cannot use fix msst without per-type mass defined
+
+Self-explanatory.
+
+E: Could not find fix msst compute ID
+
+Self-explanatory.
+
+E: Fix msst compute ID does not compute temperature
+
+Self-explanatory.
+
+E: Fix msst compute ID does not compute pressure
+
+Self-explanatory.
+
+E: Fix msst compute ID does not compute potential energy
+
+Self-explanatory.
+
+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 MSST is not for group all
+
+User-assigned temperature to MSST fix does not compute temperature for
+all atoms. Since MSST computes a global pressure, the kinetic energy
+contribution from the temperature is assumed to also be for all atoms.
+Thus the pressure used by MSST could be inaccurate.
+
+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.
+
+*/
diff --git a/src/SHOCK/fix_nphug.h b/src/SHOCK/fix_nphug.h
index f70ebf632..0cf9ea0c2 100644
--- a/src/SHOCK/fix_nphug.h
+++ b/src/SHOCK/fix_nphug.h
@@ -1,61 +1,87 @@
/* ----------------------------------------------------------------------
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(nphug,FixNPHug)
#else
#ifndef LMP_FIX_NPHUG_H
#define LMP_FIX_NPHUG_H
#include "fix_nh.h"
namespace LAMMPS_NS {
class FixNPHug : public FixNH {
public:
FixNPHug(class LAMMPS *, int, char **);
~FixNPHug();
void init();
void setup(int);
int modify_param(int, char **);
int pack_restart_data(double *); // pack restart data
void restart(char *);
private:
class Compute *pe; // PE compute pointer
void compute_temp_target();
double compute_vector(int);
double compute_etotal();
double compute_vol();
double compute_hugoniot();
double compute_us();
double compute_up();
char *id_pe;
int peflag;
int v0_set,p0_set,e0_set;
double v0,p0,e0,rho0;
int idir;
int uniaxial;
int size_restart_global();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Invalid argument for fix nphug
+
+UNDOCUMENTED
+
+E: Temperature control must be used with fix nphug
+
+UNDOCUMENTED
+
+E: Pressure control must be used with fix nphug
+
+UNDOCUMENTED
+
+E: Potential energy ID for fix nvt/nph/npt does not exist
+
+UNDOCUMENTED
+
+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.
+
+*/
diff --git a/src/SHOCK/fix_wall_piston.h b/src/SHOCK/fix_wall_piston.h
index 46d4cdee6..67d9827a3 100644
--- a/src/SHOCK/fix_wall_piston.h
+++ b/src/SHOCK/fix_wall_piston.h
@@ -1,46 +1,80 @@
/* ----------------------------------------------------------------------
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(wall/piston,FixWallPiston)
#else
#ifndef LMP_FIX_WALL_PISTON_H
#define LMP_FIX_WALL_PISTON_H
#include "fix.h"
namespace LAMMPS_NS {
class FixWallPiston : public Fix {
public:
FixWallPiston(class LAMMPS *, int, char **);
int setmask();
void post_integrate();
void initial_integrate(int);
private:
int xloflag,xhiflag,yloflag,yhiflag,zloflag,zhiflag;
int scaleflag, roughflag, rampflag, rampNL1flag, rampNL2flag, rampNL3flag, rampNL4flag, rampNL5flag;
double roughdist,roughoff,x0,y0,z0,vx,vy,vz,maxvx,maxvy,maxvz,paccelx,paccely,paccelz, angfreq;
int tempflag, tseed;
double t_target, t_period, t_extent;
class RanMars *randomt;
double *gfactor1,*gfactor2;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix wall/piston command only available at zlo
+
+UNDOCUMENTED
+
+E: Must shrink-wrap piston boundary
+
+UNDOCUMENTED
+
+E: Illegal fix wall/piston velocity
+
+UNDOCUMENTED
+
+E: Cannot use wall in periodic dimension
+
+Self-explanatory.
+
+E: Use of fix wall/piston with undefined lattice
+
+UNDOCUMENTED
+
+E: NL ramp in wall/piston only implemented in zlo for now
+
+UNDOCUMENTED
+
+*/
diff --git a/src/SRD/fix_srd.h b/src/SRD/fix_srd.h
index 43d9f7c2e..a3266ae9f 100644
--- a/src/SRD/fix_srd.h
+++ b/src/SRD/fix_srd.h
@@ -1,253 +1,395 @@
/* ----------------------------------------------------------------------
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(srd,FixSRD)
#else
#ifndef LMP_FIX_SRD_H
#define LMP_FIX_SRD_H
#include "fix.h"
namespace LAMMPS_NS {
class FixSRD : public Fix {
public:
FixSRD(class LAMMPS *, int, char **);
~FixSRD();
int setmask();
void init();
void setup(int);
void pre_neighbor();
void post_force(int);
double compute_vector(int);
double memory_usage();
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
private:
int me,nprocs;
int bigexist,biggroup,biggroupbit;
int collidestyle,lamdaflag,overlap,insideflag,exactflag,maxbounceallow;
int cubicflag,shiftuser,shiftseed,shiftflag,tstat;
double gridsrd,gridsearch,lamda,radfactor,cubictol;
int triclinic,change_size,change_shape,deformflag;
double dt_big,dt_srd;
double mass_big,mass_srd;
double temperature_srd;
double sigma;
double srd_per_cell;
double dmax,vmax,vmaxsq;
double maxbigdiam,minbigdiam;
double dist_ghost,dist_srd,dist_srd_reneigh; // explained in code
int wallexist,nwall,wallvarflag;
class FixWallSRD *wallfix;
int *wallwhich;
double *xwall,*xwallhold,*vwall;
double **fwall;
double walltrigger;
class AtomVecEllipsoid *avec_ellipsoid;
class AtomVecLine *avec_line;
class AtomVecTri *avec_tri;
// for orthogonal box, these are in box units
// for triclinic box, these are in lamda units
double srdlo[3],srdhi[3]; // SRDs must stay inside
double srdlo_reneigh[3],srdhi_reneigh[3]; // SRDs trigger a reneigh
int dimension;
int initflag,setupflag,reneighflag;
class RanMars *random;
class RanPark *randomshift;
// stats
int ncheck,ncollide,ninside,nrescale,reneighcount;
int nbounce,bouncemaxnum,bouncemax;
int stats_flag;
int srd_bin_count;
double srd_bin_temp;
double stats[12],stats_all[12];
double **flocal; // local ptrs to atom force and torque
double **tlocal;
// info to store for each owned and ghost big particle and wall
struct Big {
int index; // local index of particle/wall
int type; // SPHERE or ELLIPSOID or LINE or TRI or WALL
double radius,radsq; // radius of sphere
double aradsqinv; // 3 ellipsoid radii
double bradsqinv;
double cradsqinv;
double length; // length of line segment
double normbody[3]; // normal of tri in body-frame
double cutbinsq; // add big to bin if within this distance
double omega[3]; // current omega for sphere/ellipsoid/tri/line
double ex[3],ey[3],ez[3]; // current orientation vecs for ellipsoid/tri
double norm[3]; // current unit normal of tri in space-frame
double theta; // current orientation of line
};
Big *biglist; // list of info for each owned & ghost big and wall
int torqueflag; // 1 if any big particle is torqued
// current size of particle-based arrays
int nbig; // # of owned/ghost big particles and walls
int maxbig; // max number of owned/ghost big particles and walls
int nmax; // max number of SRD particles
// bins for SRD velocity remap, shifting and communication
// binsize and inv are in lamda units for triclinic
int nbins1,nbin1x,nbin1y,nbin1z;
double binsize1x,binsize1y,binsize1z;
double bininv1x,bininv1y,bininv1z;
struct BinAve {
int owner; // 1 if I am owner of this bin, 0 if not
int n; // # of SRD particles in bin
double xctr[3]; // center point of bin, only used for triclinic
double vsum[3]; // sum of v components for SRD particles in bin
double random; // random value if I am owner
};
struct BinComm {
int nsend,nrecv; // # of bins to send/recv
int sendproc,recvproc; // who to send/recv to/from
int *sendlist,*recvlist; // list of bins to send/recv
};
struct BinShift {
int commflag; // 1 if this shift requires any comm
int nbins,nbinx,nbiny,nbinz; // extent of my bins
int maxbinsq,maxvbin;
int binlo[3],binhi[3]; // extent of my bins in global array
double corner[3]; // lower,left corner to offset from
// corner is in lamda units for triclinic
BinAve *vbin; // my bins
BinComm bcomm[6]; // bin communication pattern for overlaps
};
BinShift shifts[2]; // 0 = no shift, 1 = shift
int maxbin1;
int *binhead; // 1st SRD particle in each bin
int *binnext; // next SRD particle in same bin
int maxbuf;
double *sbuf1,*sbuf2; // buffers for send/recv of velocity bin data
double *rbuf1,*rbuf2;
// bins and stencil for collision searching for SRDs & big particles
int nbins2,nbin2x,nbin2y,nbin2z;
int maxbin2;
double binsize2x,binsize2y,binsize2z;
double bininv2x,bininv2y,bininv2z;
double xblo2,yblo2,zblo2;
int *nbinbig; // # of big particles overlapping each bin
int **binbig; // indices of big particles overlapping each bin
int *binsrd; // which bin each SRD particle is in
int nstencil; // # of bins in stencil
int maxstencil; // max # of bins stencil array can hold
int **stencil; // list of 3d bin offsets a big particle can overlap
// persistent data for line/tri collision calculations
double tfraction,theta0,theta1;
double xs0[3],xs1[3],xsc[3];
double xb0[3],xb1[3],xbc[3];
double nbc[3];
// shared data for triangle collision calculations
// private functions
void reset_velocities();
void vbin_comm(int);
void vbin_pack(BinAve *, int, int *, double *);
void vbin_unpack(double *, BinAve *, int, int *);
void collisions_single();
void collisions_multi();
int inside_sphere(double *, double *, Big *);
int inside_ellipsoid(double *, double *, Big *);
int inside_line(double *, double *, double *, double *, Big *, double);
int inside_tri(double *, double *, double *, double *, Big *, double);
int inside_wall(double *, int);
double collision_sphere_exact(double *, double *, double *, double *,
Big *, double *, double *, double *);
void collision_sphere_inexact(double *, double *,
Big *, double *, double *, double *);
double collision_ellipsoid_exact(double *, double *, double *, double *,
Big *, double *, double *, double *);
void collision_ellipsoid_inexact(double *, double *,
Big *, double *, double *, double *);
double collision_line_exact(double *, double *, double *, double *,
Big *, double, double *, double *, double *);
double collision_tri_exact(double *, double *, double *, double *,
Big *, double, double *, double *, double *);
double collision_wall_exact(double *, int, double *,
double *, double *, double *);
void collision_wall_inexact(double *, int, double *, double *, double *);
void slip(double *, double *, double *, Big *,
double *, double *, double *);
void slip_wall(double *, int, double *, double *);
void noslip(double *, double *, double *, Big *, int,
double *, double *, double *);
void force_torque(double *, double *, double *,
double *, double *, double *);
void force_wall(double *, double *, int);
int update_srd(int, double, double *, double *, double *, double *);
void parameterize();
void setup_bounds();
void setup_velocity_bins();
void setup_velocity_shift(int, int);
void setup_search_bins();
void setup_search_stencil();
void big_static();
void big_dynamic();
double point_bin_distance(double *, int, int, int);
double bin_bin_distance(int, int, int);
void velocity_stats(int);
double newton_raphson(double, double);
void lineside(double, double &, double &);
void triside(double, double &, double &);
double distance(int, int);
void print_collision(int, int, int, double, double,
double *, double *, double *, int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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 srd group ID
+
+Self-explanatory.
+
+E: Fix srd requires newton pair on
+
+Self-explanatory.
+
+E: Fix srd requires ghost atoms store velocity
+
+Use the communicate vel yes command to enable this.
+
+E: Fix SRD no-slip requires atom attribute torque
+
+This is because the SRD collisions will impart torque to the solute
+particles.
+
+E: Cannot change timestep once fix srd is setup
+
+This is because various SRD properties depend on the timestep
+size.
+
+E: Cannot use fix wall/srd more than once
+
+Nor is their a need to since multiple walls can be specified
+in one command.
+
+W: Fix SRD walls overlap but fix srd overlap not set
+
+You likely want to set this in your input script.
+
+E: Using fix srd with inconsistent fix deform remap option
+
+When shearing the box in an SRD simulation, the remap v option for fix
+deform needs to be used.
+
+W: Using fix srd with box deformation but no SRD thermostat
+
+UNDOCUMENTED
+
+W: Fix srd SRD moves may trigger frequent reneighboring
+
+This is because the SRD particles may move long distances.
+
+E: Fix SRD: bad search bin assignment
+
+Something has gone wrong in your SRD model; try using more
+conservative settings.
+
+E: Fix SRD: bad stencil bin for big particle
+
+Something has gone wrong in your SRD model; try using more
+conservative settings.
+
+E: Fix SRD: too many big particles in bin
+
+Reset the ATOMPERBIN parameter at the top of fix_srd.cpp
+to a larger value, and re-compile the code.
+
+E: Fix SRD: too many walls in bin
+
+This should not happen unless your system has been setup incorrectly.
+
+E: Fix SRD: bad bin assignment for SRD advection
+
+Something has gone wrong in your SRD model; try using more
+conservative settings.
+
+E: SRD particle %d started inside big particle %d on step %ld bounce %d\n
+
+UNDOCUMENTED
+
+E: Bad quadratic solve for particle/line collision
+
+UNDOCUMENTED
+
+E: Bad quadratic solve for particle/tri collision
+
+UNDOCUMENTED
+
+W: Fix srd particle moved outside valid domain
+
+This may indicate a problem with your simulation parameters.
+
+E: Big particle in fix srd cannot be point particle
+
+Big particles must be extended spheriods or ellipsoids.
+
+E: Cannot use lines with fix srd unless overlap is set
+
+UNDOCUMENTED
+
+E: Cannot use tris with fix srd unless overlap is set
+
+UNDOCUMENTED
+
+E: Fix srd requires SRD particles all have same mass
+
+Self-explanatory.
+
+E: Fewer SRD bins than processors in some dimension
+
+This is not allowed. Make your SRD bin size smaller.
+
+E: SRD bins for fix srd are not cubic enough
+
+The bin shape is not within tolerance of cubic.
+
+E: SRD bin size for fix srd differs from user request
+
+Fix SRD had to adjust the bin size to fit the simulation box.
+
+E: Fix srd lamda must be >= 0.6 of SRD grid size
+
+This is a requirement for accuracy reasons.
+
+W: SRD bin shifting turned on due to small lamda
+
+This is done to try to preserve accuracy.
+
+W: Fix srd grid size > 1/4 of big particle diameter
+
+This may cause accuracy problems.
+
+W: Fix srd viscosity < 0.0 due to low SRD density
+
+This may cause accuracy problems.
+
+W: Fix srd particles may move > big particle diameter
+
+This may cause accuracy problems.
+
+*/
diff --git a/src/SRD/fix_wall_srd.h b/src/SRD/fix_wall_srd.h
index 172451b45..d3d1eb68c 100644
--- a/src/SRD/fix_wall_srd.h
+++ b/src/SRD/fix_wall_srd.h
@@ -1,59 +1,98 @@
/* ----------------------------------------------------------------------
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(wall/srd,FixWallSRD)
#else
#ifndef LMP_FIX_WALL_SRD_H
#define LMP_FIX_WALL_SRD_H
#include "fix.h"
namespace LAMMPS_NS {
class FixWallSRD : public Fix {
public:
int nwall,varflag,overlap;
int wallwhich[6];
double xwall[6],xwallhold[6],vwall[6];
double **fwall;
FixWallSRD(class LAMMPS *, int, char **);
~FixWallSRD();
int setmask();
void init();
double compute_array(int, int);
void wall_params(int);
private:
int wallstyle[6];
double coord0[6];
char *varstr[6];
int varindex[6];
double dt;
double xwalllast[6];
bigint laststep;
double **fwall_all;
int force_flag;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Wall defined twice in fix wall/srd command
+
+Self-explanatory.
+
+E: Cannot use fix wall/srd in periodic dimension
+
+Self-explanatory.
+
+E: Cannot use fix wall/srd zlo/zhi for a 2d simulation
+
+Self-explanatory.
+
+E: Use of fix wall with undefined lattice
+
+Must use lattice command with fix wall command if units option is set
+to lattice.
+
+E: Cannot use fix wall/srd without fix srd
+
+Self-explanatory.
+
+E: Variable name for fix wall/srd does not exist
+
+Self-explanatory.
+
+E: Variable for fix wall/srd is invalid style
+
+Only equal-style variables can be used.
+
+*/
diff --git a/src/USER-OMP/pair_tersoff_zbl_omp.cpp b/src/USER-OMP/pair_tersoff_zbl_omp.cpp
index 4265d84fb..74e77d544 100644
--- a/src/USER-OMP/pair_tersoff_zbl_omp.cpp
+++ b/src/USER-OMP/pair_tersoff_zbl_omp.cpp
@@ -1,296 +1,296 @@
/* ----------------------------------------------------------------------
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: Aidan Thompson (SNL) - original Tersoff implementation
David Farrell (NWU) - ZBL addition
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_tersoff_zbl_omp.h"
#include "atom.h"
#include "update.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "force.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
#include "math_const.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define MAXLINE 1024
#define DELTA 4
/* ----------------------------------------------------------------------
Fermi-like smoothing function
------------------------------------------------------------------------- */
static double F_fermi(const double r, const double expsc, const double cut)
{
return 1.0 / (1.0 + exp(-expsc*(r-cut)));
}
/* ----------------------------------------------------------------------
Fermi-like smoothing function derivative with respect to r
------------------------------------------------------------------------- */
static double F_fermi_d(const double r, const double expsc, const double cut)
{
return expsc*exp(-expsc*(r-cut)) / pow(1.0 + exp(-expsc*(r-cut)),2.0);
}
/* ---------------------------------------------------------------------- */
PairTersoffZBLOMP::PairTersoffZBLOMP(LAMMPS *lmp) : PairTersoffOMP(lmp)
{
// hard-wired constants in metal or real units
// a0 = Bohr radius
// epsilon0 = permittivity of vacuum = q / energy-distance units
// e = unit charge
// 1 Kcal/mole = 0.043365121 eV
if (strcmp(update->unit_style,"metal") == 0) {
global_a_0 = 0.529;
global_epsilon_0 = 0.00552635;
global_e = 1.0;
} else if (strcmp(update->unit_style,"real") == 0) {
global_a_0 = 0.529;
global_epsilon_0 = 0.00552635 * 0.043365121;
global_e = 1.0;
} else error->all(FLERR,"Pair tersoff/zbl requires metal or real units");
}
/* ---------------------------------------------------------------------- */
void PairTersoffZBLOMP::read_file(char *file)
{
int params_per_line = 21;
char **words = new char*[params_per_line+1];
- delete [] params;
+ memory->sfree(params);
params = NULL;
nparams = 0;
// open file on proc 0
FILE *fp;
if (comm->me == 0) {
fp = fopen(file,"r");
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open Tersoff potential file %s",file);
error->one(FLERR,str);
}
}
// read each line out of file, skipping blank lines or leading '#'
// store line of params if all 3 element tags are in element list
int n,nwords,ielement,jelement,kelement;
char line[MAXLINE],*ptr;
int eof = 0;
while (1) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fp);
if (ptr == NULL) {
eof = 1;
fclose(fp);
} else n = strlen(line) + 1;
}
MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) break;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
// strip comment, skip line if blank
if (ptr = strchr(line,'#')) *ptr = '\0';
nwords = atom->count_words(line);
if (nwords == 0) continue;
// concatenate additional lines until have params_per_line words
while (nwords < params_per_line) {
n = strlen(line);
if (comm->me == 0) {
ptr = fgets(&line[n],MAXLINE-n,fp);
if (ptr == NULL) {
eof = 1;
fclose(fp);
} else n = strlen(line) + 1;
}
MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) break;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
if (ptr = strchr(line,'#')) *ptr = '\0';
nwords = atom->count_words(line);
}
if (nwords != params_per_line)
error->all(FLERR,"Incorrect format in Tersoff potential file");
// words = ptrs to all words in line
nwords = 0;
words[nwords++] = strtok(line," \t\n\r\f");
while (words[nwords++] = strtok(NULL," \t\n\r\f")) continue;
// ielement,jelement,kelement = 1st args
// if all 3 args are in element list, then parse this line
// else skip to next line
for (ielement = 0; ielement < nelements; ielement++)
if (strcmp(words[0],elements[ielement]) == 0) break;
if (ielement == nelements) continue;
for (jelement = 0; jelement < nelements; jelement++)
if (strcmp(words[1],elements[jelement]) == 0) break;
if (jelement == nelements) continue;
for (kelement = 0; kelement < nelements; kelement++)
if (strcmp(words[2],elements[kelement]) == 0) break;
if (kelement == nelements) continue;
// load up parameter settings and error check their values
if (nparams == maxparam) {
maxparam += DELTA;
params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
"pair:params");
}
params[nparams].ielement = ielement;
params[nparams].jelement = jelement;
params[nparams].kelement = kelement;
params[nparams].powerm = atof(words[3]);
params[nparams].gamma = atof(words[4]);
params[nparams].lam3 = atof(words[5]);
params[nparams].c = atof(words[6]);
params[nparams].d = atof(words[7]);
params[nparams].h = atof(words[8]);
params[nparams].powern = atof(words[9]);
params[nparams].beta = atof(words[10]);
params[nparams].lam2 = atof(words[11]);
params[nparams].bigb = atof(words[12]);
params[nparams].bigr = atof(words[13]);
params[nparams].bigd = atof(words[14]);
params[nparams].lam1 = atof(words[15]);
params[nparams].biga = atof(words[16]);
params[nparams].Z_i = atof(words[17]);
params[nparams].Z_j = atof(words[18]);
params[nparams].ZBLcut = atof(words[19]);
params[nparams].ZBLexpscale = atof(words[20]);
// currently only allow m exponent of 1 or 3
params[nparams].powermint = int(params[nparams].powerm);
if (
params[nparams].lam3 < 0.0 || params[nparams].c < 0.0 ||
params[nparams].d < 0.0 || params[nparams].powern < 0.0 ||
params[nparams].beta < 0.0 || params[nparams].lam2 < 0.0 ||
params[nparams].bigb < 0.0 || params[nparams].bigr < 0.0 ||
params[nparams].bigd < 0.0 ||
params[nparams].bigd > params[nparams].bigr ||
params[nparams].lam3 < 0.0 || params[nparams].biga < 0.0 ||
params[nparams].powerm - params[nparams].powermint != 0.0 ||
(params[nparams].powermint != 3 && params[nparams].powermint != 1) ||
params[nparams].gamma < 0.0 ||
params[nparams].Z_i < 1.0 || params[nparams].Z_j < 1.0 ||
params[nparams].ZBLcut < 0.0 || params[nparams].ZBLexpscale < 0.0)
error->all(FLERR,"Illegal Tersoff parameter");
nparams++;
}
delete [] words;
}
/* ---------------------------------------------------------------------- */
void PairTersoffZBLOMP::force_zeta(Param *param, double rsq, double zeta_ij,
double &fforce, double &prefactor,
int eflag, double &eng)
{
double r,fa,fa_d,bij;
r = sqrt(rsq);
fa = (r > param->bigr + param->bigd) ? 0.0 :
-param->bigb * exp(-param->lam2 * r) * ters_fc(r,param) *
F_fermi(r,param->ZBLexpscale,param->ZBLcut);
fa_d = (r > param->bigr + param->bigd) ? 0.0 :
param->bigb * exp(-param->lam2 * r) *
(param->lam2 * ters_fc(r,param) *
F_fermi(r,param->ZBLexpscale,param->ZBLcut) -
ters_fc_d(r,param) * F_fermi(r,param->ZBLexpscale,param->ZBLcut)
- ters_fc(r,param) * F_fermi_d(r,param->ZBLexpscale,param->ZBLcut));
bij = ters_bij(zeta_ij,param);
fforce = 0.5*bij*fa_d / r;
prefactor = -0.5*fa * ters_bij_d(zeta_ij,param);
if (eflag) eng = 0.5*bij*fa;
}
/* ---------------------------------------------------------------------- */
void PairTersoffZBLOMP::repulsive(Param *param, double rsq, double &fforce,
int eflag, double &eng)
{
double r,tmp_fc,tmp_fc_d,tmp_exp;
// Tersoff repulsive portion
r = sqrt(rsq);
tmp_fc = ters_fc(r,param);
tmp_fc_d = ters_fc_d(r,param);
tmp_exp = exp(-param->lam1 * r);
double fforce_ters = param->biga * tmp_exp * (tmp_fc_d - tmp_fc*param->lam1);
double eng_ters = tmp_fc * param->biga * tmp_exp;
// ZBL repulsive portion
double esq = pow(global_e,2.0);
double a_ij = (0.8854*global_a_0) /
(pow(param->Z_i,0.23) + pow(param->Z_j,0.23));
double premult = (param->Z_i * param->Z_j * esq)/(4.0*MY_PI*global_epsilon_0);
double r_ov_a = r/a_ij;
double phi = 0.1818*exp(-3.2*r_ov_a) + 0.5099*exp(-0.9423*r_ov_a) +
0.2802*exp(-0.4029*r_ov_a) + 0.02817*exp(-0.2016*r_ov_a);
double dphi = (1.0/a_ij) * (-3.2*0.1818*exp(-3.2*r_ov_a) -
0.9423*0.5099*exp(-0.9423*r_ov_a) -
0.4029*0.2802*exp(-0.4029*r_ov_a) -
0.2016*0.02817*exp(-0.2016*r_ov_a));
double fforce_ZBL = premult*-pow(r,-2.0)* phi + premult*pow(r,-1.0)*dphi;
double eng_ZBL = premult*(1.0/r)*phi;
// combine two parts with smoothing by Fermi-like function
fforce = -(-F_fermi_d(r,param->ZBLexpscale,param->ZBLcut) * eng_ZBL +
(1.0 - F_fermi(r,param->ZBLexpscale,param->ZBLcut))*fforce_ZBL +
F_fermi_d(r,param->ZBLexpscale,param->ZBLcut)*eng_ters +
F_fermi(r,param->ZBLexpscale,param->ZBLcut)*fforce_ters) / r;
if (eflag)
eng = (1.0 - F_fermi(r,param->ZBLexpscale,param->ZBLcut))*eng_ZBL +
F_fermi(r,param->ZBLexpscale,param->ZBLcut)*eng_ters;
}
diff --git a/src/XTC/dump_xtc.h b/src/XTC/dump_xtc.h
index 5b43d2f46..d6aee90be 100644
--- a/src/XTC/dump_xtc.h
+++ b/src/XTC/dump_xtc.h
@@ -1,63 +1,108 @@
/* ----------------------------------------------------------------------
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 DUMP_CLASS
DumpStyle(xtc,DumpXTC)
#else
#ifndef LMP_DUMP_XTC_H
#define LMP_DUMP_XTC_H
#include "dump.h"
#ifdef LAMMPS_XDR
#include "xdr_compat.h"
#else
#include "rpc/rpc.h"
#include "rpc/xdr.h"
#endif
namespace LAMMPS_NS {
class DumpXTC : public Dump {
public:
DumpXTC(class LAMMPS *, int, char**);
~DumpXTC();
private:
int natoms,ntotal;
int nevery_save;
int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no
float precision; // user-adjustable precision setting
float *coords;
double sfactor;
XDR xd;
void init_style();
int modify_param(int, char **);
void openfile();
void write_header(bigint);
int count();
void pack(int *);
void write_data(int, double *);
bigint memory_usage();
void write_frame();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Invalid dump xtc filename
+
+Filenames used with the dump xtc style cannot be binary or compressed
+or cause multiple files to be written.
+
+E: Too many atoms for dump xtc
+
+The system size must fit in a 32-bit integer to use this dump
+style.
+
+E: Dump xtc requires sorting by atom ID
+
+Use the dump_modify sort command to enable this.
+
+E: Cannot set dump_modify flush for dump xtc
+
+Self-explanatory.
+
+E: Cannot use variable every setting for dump xtc
+
+The format of this file requires snapshots at regular intervals.
+
+E: Cannot change dump_modify every for dump xtc
+
+The frequency of writing dump xtc snapshots cannot be changed.
+
+E: Cannot open dump file
+
+The output file for the dump command cannot be opened. Check that the
+path and name are correct.
+
+E: Too big a timestep for dump xtc
+
+The timestep must fit in a 32-bit integer to use this dump style.
+
+*/
diff --git a/src/angle.h b/src/angle.h
index 95a35a5a5..948ee071c 100644
--- a/src/angle.h
+++ b/src/angle.h
@@ -1,57 +1,71 @@
/* ----------------------------------------------------------------------
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_ANGLE_H
#define LMP_ANGLE_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class Angle : protected Pointers {
friend class ThrOMP;
public:
int allocated;
int *setflag;
double energy; // accumulated energies
double virial[6]; // accumlated virial
double *eatom,**vatom; // accumulated per-atom energy/virial
Angle(class LAMMPS *);
virtual ~Angle();
virtual void init();
virtual void compute(int, int) = 0;
virtual void settings(int, char **) {}
virtual void coeff(int, char **) = 0;
virtual void init_style() {};
virtual double equilibrium_angle(int) = 0;
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;
virtual double single(int, int, int, int) = 0;
virtual double memory_usage();
protected:
int evflag;
int eflag_either,eflag_global,eflag_atom;
int vflag_either,vflag_global,vflag_atom;
int maxeatom,maxvatom;
void ev_setup(int, int);
void ev_tally(int, int, int, int, int, double, double *, double *,
double, double, double, double, double, double);
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Angle coeffs are not set
+
+No angle coefficients have been assigned in the data file or via the
+angle_coeff command.
+
+E: All angle coeffs are not set
+
+All angle coefficients must be set in the data file or by the
+angle_coeff command before running a simulation.
+
+*/
diff --git a/src/atom.h b/src/atom.h
index 429aacb1c..6ddd280f0 100644
--- a/src/atom.h
+++ b/src/atom.h
@@ -1,230 +1,367 @@
/* ----------------------------------------------------------------------
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_ATOM_H
#define LMP_ATOM_H
#include "pointers.h"
namespace LAMMPS_NS {
class Atom : protected Pointers {
public:
char *atom_style;
class AtomVec *avec;
// atom counts
bigint natoms; // total # of atoms in system, could be 0
+ // natoms may not be current if atoms lost
int nlocal,nghost; // # of owned and ghost atoms on this proc
int nmax; // max # of owned+ghost in arrays on this proc
int tag_enable; // 0/1 if atom ID tags are defined
int molecular; // 0 = atomic, 1 = molecular system
bigint nbonds,nangles,ndihedrals,nimpropers;
int ntypes,nbondtypes,nangletypes,ndihedraltypes,nimpropertypes;
int bond_per_atom,angle_per_atom,dihedral_per_atom,improper_per_atom;
int extra_bond_per_atom;
int firstgroup; // store atoms in this group first, -1 if unset
int nfirst; // # of atoms in first group on this proc
char *firstgroupname; // group-ID to store first, NULL if unset
// per-atom arrays
// customize by adding new array
int *tag,*type,*mask,*image;
double **x,**v,**f;
int *molecule;
double *q,**mu;
double **omega,**angmom,**torque;
double *radius,*rmass,*vfrac,*s0;
double **x0;
int *ellipsoid,*line,*tri;
int *spin;
double *eradius,*ervel,*erforce,*ervelforce;
double *cs,*csforce,*vforce;
int *etag;
double *rho, *drho;
double *e, *de;
double **vest;
double *cv;
int **nspecial; // 0,1,2 = cummulative # of 1-2,1-3,1-4 neighs
int **special; // IDs of 1-2,1-3,1-4 neighs of each atom
int maxspecial; // special[nlocal][maxspecial]
int *num_bond;
int **bond_type;
int **bond_atom;
int *num_angle;
int **angle_type;
int **angle_atom1,**angle_atom2,**angle_atom3;
int *num_dihedral;
int **dihedral_type;
int **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
int *num_improper;
int **improper_type;
int **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
// atom style and per-atom array existence flags
// customize by adding new flag
int sphere_flag,ellipsoid_flag,line_flag,tri_flag,peri_flag,electron_flag;
int wavepacket_flag,sph_flag;
int molecule_flag,q_flag,mu_flag;
int rmass_flag,radius_flag,omega_flag,torque_flag,angmom_flag;
int vfrac_flag,spin_flag,eradius_flag,ervel_flag,erforce_flag;
int cs_flag,csforce_flag,vforce_flag,ervelforce_flag,etag_flag;
int rho_flag,e_flag,cv_flag,vest_flag;
// extra peratom info in restart file destined for fix & diag
double **extra;
// per-type arrays
double *mass;
int *mass_setflag;
// callback ptrs for atom arrays managed by fix classes
int nextra_grow,nextra_restart; // # of callbacks of each type
int *extra_grow,*extra_restart; // index of fix to callback to
int nextra_grow_max,nextra_restart_max; // size of callback lists
int nextra_store;
int map_style; // default or user-specified style of map
// 0 = none, 1 = array, 2 = hash
// spatial sorting of atoms
int sortfreq; // sort atoms every this many steps, 0 = off
bigint nextsort; // next timestep to sort on
// functions
Atom(class LAMMPS *);
~Atom();
void settings(class Atom *);
void create_avec(const char *, int, char **, char *suffix = NULL);
class AtomVec *new_avec(const char *, int, char **, char *, int &);
void init();
void setup();
class AtomVec *style_match(const char *);
void modify_params(int, char **);
void tag_extend();
int tag_consecutive();
int parse_data(const char *);
int count_words(const char *);
void data_atoms(int, char *);
void data_vels(int, char *);
void data_bonus(int, char *, class AtomVec *);
void data_bonds(int, char *);
void data_angles(int, char *);
void data_dihedrals(int, char *);
void data_impropers(int, char *);
void allocate_type_arrays();
void set_mass(const char *);
void set_mass(int, double);
void set_mass(int, char **);
void set_mass(double *);
void check_mass();
int radius_consistency(int, double &);
int shape_consistency(int, double &, double &, double &);
void first_reorder();
void sort();
void add_callback(int);
void delete_callback(const char *, int);
void update_callback(int);
void *extract(char *);
inline int* get_map_array() {return map_array;};
inline int get_map_size() {return map_tag_max+1;};
bigint memory_usage();
int memcheck(const char *);
// functions for global to local ID mapping
// map lookup function inlined for efficiency
inline int map(int global) {
if (map_style == 1) return map_array[global];
else return map_find_hash(global);
};
void map_init();
void map_clear();
void map_set();
void map_one(int, int);
void map_delete();
int map_find_hash(int);
private:
// global to local ID mapping
int map_tag_max;
int *map_array;
struct HashElem {
int global; // key to search on = global ID
int local; // value associated with key = local index
int next; // next entry in this bucket, -1 if last
};
int map_nhash; // # of entries hash table can hold
int map_nused; // # of actual entries in hash table
int map_free; // ptr to 1st unused entry in hash table
int map_nbucket; // # of hash buckets
int *map_bucket; // ptr to 1st entry in each bucket
HashElem *map_hash; // hash table
int *primes; // table of prime #s for hashing
int nprimes; // # of primes
// spatial sorting of atoms
int nbins; // # of sorting bins
int nbinx,nbiny,nbinz; // bins in each dimension
int maxbin; // max # of bins
int maxnext; // max size of next,permute
int *binhead; // 1st atom in each bin
int *next; // next atom in bin
int *permute; // permutation vector
double userbinsize; // requested sort bin size
double bininvx,bininvy,bininvz; // inverse actual bin sizes
double bboxlo[3],bboxhi[3]; // bounding box of my sub-domain
int memlength; // allocated size of memstr
char *memstr; // string of array names already counted
void setup_sort_bins();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Invalid atom style
+
+The choice of atom style is unknown.
+
+E: Could not find atom_modify first group ID
+
+Self-explanatory.
+
+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: Atom_modify map command after simulation box is defined
+
+The atom_modify map command cannot be used after a read_data,
+read_restart, or create_box command.
+
+E: Atom_modify sort and first options cannot be used together
+
+Self-explanatory.
+
+E: Cannot create an atom map unless atoms have IDs
+
+The simulation requires a mapping from global atom IDs to local atoms,
+but the atoms that have been defined have no IDs.
+
+E: Incorrect atom format in data file
+
+Number of values per atom line in the data file is not consistent with
+the atom style.
+
+E: Incorrect velocity format in data file
+
+Each atom style defines a format for the Velocity section
+of the data file. The read-in lines do not match.
+
+E: Invalid atom ID in Velocities section of data file
+
+Atom IDs must be positive integers and within range of defined
+atoms.
+
+E: Incorrect bonus data format in data file
+
+UNDOCUMENTED
+
+E: Invalid atom ID in Bonus section of data file
+
+UNDOCUMENTED
+
+E: Invalid atom ID in Bonds section of data file
+
+Atom IDs must be positive integers and within range of defined
+atoms.
+
+E: Invalid bond type in Bonds section of data file
+
+Bond type must be positive integer and within range of specified bond
+types.
+
+E: Invalid atom ID in Angles section of data file
+
+Atom IDs must be positive integers and within range of defined
+atoms.
+
+E: Invalid angle type in Angles section of data file
+
+Angle type must be positive integer and within range of specified angle
+types.
+
+E: Invalid atom ID in Dihedrals section of data file
+
+Atom IDs must be positive integers and within range of defined
+atoms.
+
+E: Invalid dihedral type in Dihedrals section of data file
+
+Dihedral type must be positive integer and within range of specified
+dihedral types.
+
+E: Invalid atom ID in Impropers section of data file
+
+Atom IDs must be positive integers and within range of defined
+atoms.
+
+E: Invalid improper type in Impropers section of data file
+
+Improper type must be positive integer and within range of specified
+improper types.
+
+E: Cannot set mass for this atom style
+
+This atom style does not support mass settings for each atom type.
+Instead they are defined on a per-atom basis in the data file.
+
+E: Invalid mass line in data file
+
+Self-explanatory.
+
+E: Invalid type for mass set
+
+Mass command must set a type from 1-N where N is the number of atom
+types.
+
+E: Invalid mass value
+
+Self-explanatory.
+
+E: All masses are not set
+
+For atom styles that define masses for each atom type, all masses must
+be set in the data file or by the mass command before running a
+simulation. They must also be set before using the velocity
+command.
+
+E: Atom sort did not operate correctly
+
+This is an internal LAMMPS error. Please report it to the
+developers.
+
+E: Atom sorting has bin size = 0.0
+
+The neighbor cutoff is being used as the bin size, but it is zero.
+Thus you must explicitly list a bin size in the atom_modify sort
+command or turn off sorting.
+
+E: Too many atom sorting bins
+
+This is likely due to an immense simulation box that has blown up
+to a large size.
+
+*/
diff --git a/src/atom_vec.h b/src/atom_vec.h
index 35cae37bb..f07e9e8e6 100644
--- a/src/atom_vec.h
+++ b/src/atom_vec.h
@@ -1,97 +1,100 @@
/* ----------------------------------------------------------------------
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_ATOM_VEC_H
#define LMP_ATOM_VEC_H
#include "pointers.h"
namespace LAMMPS_NS {
class AtomVec : protected Pointers {
public:
int molecular; // 0 = atomic, 1 = molecular system
int bonds_allow,angles_allow; // 1 if bonds, angles are used
int dihedrals_allow,impropers_allow; // 1 if dihedrals, impropers used
int mass_type; // 1 if per-type masses
int dipole_type; // 1 if per-type dipole moments
int comm_x_only; // 1 if only exchange x in forward comm
int comm_f_only; // 1 if only exchange f in reverse comm
int size_forward; // # of values per atom in comm
int size_reverse; // # in reverse comm
int size_border; // # in border comm
int size_velocity; // # of velocity based quantities
int size_data_atom; // number of values in Atom line
int size_data_vel; // number of values in Velocity line
int size_data_bonus; // number of values in Bonus line
int xcol_data; // column (1-N) where x is in Atom line
int cudable; // 1 if atom style is CUDA-enabled
int *maxsend; // CUDA-specific variable
AtomVec(class LAMMPS *, int, char **);
virtual ~AtomVec() {}
virtual void init();
virtual void grow(int) = 0;
virtual void grow_reset() = 0;
virtual void copy(int, int, int) = 0;
virtual void clear_bonus() {}
virtual int pack_comm(int, int *, double *, int, int *) = 0;
virtual int pack_comm_vel(int, int *, double *, int, int *) = 0;
virtual int pack_comm_hybrid(int, int *, double *) {return 0;}
virtual void unpack_comm(int, int, double *) = 0;
virtual void unpack_comm_vel(int, int, double *) = 0;
virtual int unpack_comm_hybrid(int, int, double *) {return 0;}
virtual int pack_reverse(int, int, double *) = 0;
virtual int pack_reverse_hybrid(int, int, double *) {return 0;}
virtual void unpack_reverse(int, int *, double *) = 0;
virtual int unpack_reverse_hybrid(int, int *, double *) {return 0;}
virtual int pack_border(int, int *, double *, int, int *) = 0;
virtual int pack_border_vel(int, int *, double *, int, int *) = 0;
virtual int pack_border_hybrid(int, int *, double *) {return 0;}
virtual void unpack_border(int, int, double *) = 0;
virtual void unpack_border_vel(int, int, double *) = 0;
virtual int unpack_border_hybrid(int, int, double *) {return 0;}
virtual int pack_exchange(int, double *) = 0;
virtual int unpack_exchange(double *) = 0;
virtual int size_restart() = 0;
virtual int pack_restart(int, double *) = 0;
virtual int unpack_restart(double *) = 0;
virtual void create_atom(int, double *) = 0;
virtual void data_atom(double *, int, char **) = 0;
virtual void data_atom_bonus(int, char **) {}
virtual int data_atom_hybrid(int, char **) {return 0;}
virtual void data_vel(int, char **);
virtual int data_vel_hybrid(int, char **) {return 0;}
virtual bigint memory_usage() = 0;
protected:
int nmax; // local copy of atom->nmax
int deform_vremap; // local copy of domain properties
int deform_groupbit;
double *h_rate;
};
}
#endif
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/atom_vec_atomic.h b/src/atom_vec_atomic.h
index 34fb3779a..4503b50a7 100644
--- a/src/atom_vec_atomic.h
+++ b/src/atom_vec_atomic.h
@@ -1,61 +1,78 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(atomic,AtomVecAtomic)
#else
#ifndef LMP_ATOM_VEC_ATOMIC_H
#define LMP_ATOM_VEC_ATOMIC_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecAtomic : public AtomVec {
public:
AtomVecAtomic(class LAMMPS *, int, char **);
virtual ~AtomVecAtomic() {}
void grow(int);
void grow_reset();
void copy(int, int, int);
virtual int pack_comm(int, int *, double *, int, int *);
virtual int pack_comm_vel(int, int *, double *, int, int *);
virtual void unpack_comm(int, int, double *);
virtual void unpack_comm_vel(int, int, double *);
int pack_reverse(int, int, double *);
void unpack_reverse(int, int *, double *);
virtual int pack_border(int, int *, double *, int, int *);
virtual int pack_border_vel(int, int *, double *, int, int *);
virtual void unpack_border(int, int, double *);
virtual void unpack_border_vel(int, int, double *);
virtual int pack_exchange(int, double *);
virtual 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 **);
bigint memory_usage();
protected:
int *tag,*type,*mask,*image;
double **x,**v,**f;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+*/
diff --git a/src/atom_vec_charge.h b/src/atom_vec_charge.h
index eb9fb9105..d2b6b7518 100644
--- a/src/atom_vec_charge.h
+++ b/src/atom_vec_charge.h
@@ -1,65 +1,82 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(charge,AtomVecCharge)
#else
#ifndef LMP_ATOM_VEC_CHARGE_H
#define LMP_ATOM_VEC_CHARGE_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecCharge : public AtomVec {
public:
AtomVecCharge(class LAMMPS *, int, char **);
virtual ~AtomVecCharge() {}
void grow(int);
void grow_reset();
void copy(int, int, int);
virtual int pack_comm(int, int *, double *, int, int *);
virtual int pack_comm_vel(int, int *, double *, int, int *);
virtual void unpack_comm(int, int, double *);
virtual void unpack_comm_vel(int, int, double *);
int pack_reverse(int, int, double *);
void unpack_reverse(int, int *, double *);
virtual int pack_border(int, int *, double *, int, int *);
virtual int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
virtual void unpack_border(int, int, double *);
virtual void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, int, double *);
virtual int pack_exchange(int, double *);
virtual 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 **);
bigint memory_usage();
protected:
int *tag,*type,*mask,*image;
double **x,**v,**f;
double *q;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+*/
diff --git a/src/atom_vec_ellipsoid.h b/src/atom_vec_ellipsoid.h
index 0020eb5f2..36244ad81 100755
--- a/src/atom_vec_ellipsoid.h
+++ b/src/atom_vec_ellipsoid.h
@@ -1,94 +1,123 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(ellipsoid,AtomVecEllipsoid)
#else
#ifndef LMP_ATOM_VEC_ELLIPSOID_H
#define LMP_ATOM_VEC_ELLIPSOID_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecEllipsoid : public AtomVec {
public:
struct Bonus {
double shape[3];
double quat[4];
int ilocal;
};
struct Bonus *bonus;
AtomVecEllipsoid(class LAMMPS *, int, char **);
~AtomVecEllipsoid();
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
int pack_comm_hybrid(int, int *, double *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int unpack_comm_hybrid(int, int, double *);
int pack_reverse(int, int, double *);
int pack_reverse_hybrid(int, int, double *);
void unpack_reverse(int, int *, double *);
int unpack_reverse_hybrid(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, 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 **);
bigint memory_usage();
// manipulate Bonus data structure for extra atom info
void clear_bonus();
void data_atom_bonus(int, char **);
// unique to AtomVecEllipsoid
void set_shape(int, double, double, double);
private:
int *tag,*type,*mask,*image;
double **x,**v,**f;
double *rmass;
double **angmom,**torque;
int *ellipsoid;
int nlocal_bonus,nghost_bonus,nmax_bonus;
void grow_bonus();
void copy_bonus(int, int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+E: Invalid density in Atoms section of data file
+
+Density value cannot be <= 0.0.
+
+E: Assigning ellipsoid parameters to non-ellipsoid atom
+
+UNDOCUMENTED
+
+E: Invalid shape in Ellipsoids section of data file
+
+UNDOCUMENTED
+
+*/
diff --git a/src/atom_vec_hybrid.h b/src/atom_vec_hybrid.h
index 8d157b8ab..4f2f2d185 100644
--- a/src/atom_vec_hybrid.h
+++ b/src/atom_vec_hybrid.h
@@ -1,70 +1,101 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(hybrid,AtomVecHybrid)
#else
#ifndef LMP_ATOM_VEC_HYBRID_H
#define LMP_ATOM_VEC_HYBRID_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecHybrid : public AtomVec {
public:
int nstyles;
class AtomVec **styles;
char **keywords;
AtomVecHybrid(class LAMMPS *, int, char **);
~AtomVecHybrid();
void init();
void grow(int);
void grow_reset();
void copy(int, int, int);
void clear_bonus();
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int pack_reverse(int, int, double *);
void unpack_reverse(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, 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 **) {return 0;}
void data_vel(int, char **);
bigint memory_usage();
private:
int *tag,*type,*mask,*image;
double **x,**v,**f;
double **omega,**angmom;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Atom style hybrid cannot use same atom style twice
+
+Self-explanatory.
+
+E: Atom style hybrid cannot have hybrid as an argument
+
+Self-explanatory.
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+*/
diff --git a/src/atom_vec_line.h b/src/atom_vec_line.h
index 3dd6d6e37..ca35e9be4 100644
--- a/src/atom_vec_line.h
+++ b/src/atom_vec_line.h
@@ -1,96 +1,137 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(line,AtomVecLine)
#else
#ifndef LMP_ATOM_VEC_LINE_H
#define LMP_ATOM_VEC_LINE_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecLine : public AtomVec {
public:
struct Bonus {
double length,theta;
int ilocal;
};
struct Bonus *bonus;
AtomVecLine(class LAMMPS *, int, char **);
~AtomVecLine();
void init();
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
int pack_comm_hybrid(int, int *, double *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int unpack_comm_hybrid(int, int, double *);
int pack_reverse(int, int, double *);
int pack_reverse_hybrid(int, int, double *);
void unpack_reverse(int, int *, double *);
int unpack_reverse_hybrid(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, 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 **);
bigint memory_usage();
// manipulate Bonus data structure for extra atom info
void clear_bonus();
void data_atom_bonus(int, char **);
// unique to AtomVecLine
void set_length(int, double);
private:
int *tag,*type,*mask,*image;
double **x,**v,**f;
int *molecule;
double *rmass;
double **omega,**torque;
int *line;
int nlocal_bonus,nghost_bonus,nmax_bonus;
void grow_bonus();
void copy_bonus(int, int);
// void consistency_check(int, char *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Atom_style line can only be used in 2d simulations
+
+UNDOCUMENTED
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+E: Invalid density in Atoms section of data file
+
+Density value cannot be <= 0.0.
+
+E: Assigning line parameters to non-line atom
+
+UNDOCUMENTED
+
+E: Inconsistent line segment in data file
+
+UNDOCUMENTED
+
+E: BAD VECLINE PTRS: %s: %d %d: %d\n
+
+UNDOCUMENTED
+
+E: BAD VECLINE COUNT: %s: %d %d: %d %d\n
+
+UNDOCUMENTED
+
+*/
diff --git a/src/atom_vec_sphere.h b/src/atom_vec_sphere.h
index 78357b7d1..1df8aaa2d 100644
--- a/src/atom_vec_sphere.h
+++ b/src/atom_vec_sphere.h
@@ -1,74 +1,99 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(sphere,AtomVecSphere)
#else
#ifndef LMP_ATOM_VEC_SPHERE_H
#define LMP_ATOM_VEC_SPHERE_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecSphere : public AtomVec {
public:
AtomVecSphere(class LAMMPS *, int, char **);
~AtomVecSphere() {}
void init();
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
int pack_comm_hybrid(int, int *, double *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int unpack_comm_hybrid(int, int, double *);
int pack_reverse(int, int, double *);
int pack_reverse_hybrid(int, int, double *);
void unpack_reverse(int, int *, double *);
int unpack_reverse_hybrid(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, 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 **);
bigint memory_usage();
private:
int *tag,*type,*mask,*image;
double **x,**v,**f;
double *radius,*density,*rmass;
double **omega,**torque;
int radvary;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+E: Invalid radius in Atoms section of data file
+
+Radius must be >= 0.0.
+
+E: Invalid density in Atoms section of data file
+
+Density value cannot be <= 0.0.
+
+*/
diff --git a/src/atom_vec_tri.h b/src/atom_vec_tri.h
index 33f3e9cd6..61368404e 100644
--- a/src/atom_vec_tri.h
+++ b/src/atom_vec_tri.h
@@ -1,97 +1,138 @@
/* ----------------------------------------------------------------------
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 ATOM_CLASS
AtomStyle(tri,AtomVecTri)
#else
#ifndef LMP_ATOM_VEC_TRI_H
#define LMP_ATOM_VEC_TRI_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecTri : public AtomVec {
public:
struct Bonus {
double quat[4];
double c1[3],c2[3],c3[3];
double inertia[3];
int ilocal;
};
struct Bonus *bonus;
AtomVecTri(class LAMMPS *, int, char **);
~AtomVecTri();
void init();
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
int pack_comm_hybrid(int, int *, double *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int unpack_comm_hybrid(int, int, double *);
int pack_reverse(int, int, double *);
int pack_reverse_hybrid(int, int, double *);
void unpack_reverse(int, int *, double *);
int unpack_reverse_hybrid(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, 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 **);
bigint memory_usage();
// manipulate Bonus data structure for extra atom info
void clear_bonus();
void data_atom_bonus(int, char **);
// unique to AtomVecTri
void set_equilateral(int, double);
private:
int *tag,*type,*mask,*image;
double **x,**v,**f;
int *molecule;
double *rmass;
double **angmom,**torque;
int *tri;
int nlocal_bonus,nghost_bonus,nmax_bonus;
void grow_bonus();
void copy_bonus(int, int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Atom_style tri can only be used in 3d simulations
+
+UNDOCUMENTED
+
+E: Per-processor system is too big
+
+The number of owned atoms plus ghost atoms on a single
+processor must fit in 32-bit integer.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Invalid atom type in Atoms section of data file
+
+Atom types must range from 1 to specified # of types.
+
+E: Invalid density in Atoms section of data file
+
+Density value cannot be <= 0.0.
+
+E: Assigning tri parameters to non-tri atom
+
+UNDOCUMENTED
+
+E: Invalid shape in Triangles section of data file
+
+UNDOCUMENTED
+
+E: Inconsistent triangle in data file
+
+UNDOCUMENTED
+
+E: Insufficient Jacobi rotations for triangle
+
+UNDOCUMENTED
+
+*/
diff --git a/src/bond.h b/src/bond.h
index 5ba822f52..8c72d19e8 100644
--- a/src/bond.h
+++ b/src/bond.h
@@ -1,56 +1,70 @@
/* ----------------------------------------------------------------------
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_BOND_H
#define LMP_BOND_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class Bond : protected Pointers {
friend class ThrOMP;
public:
int allocated;
int *setflag;
double energy; // accumulated energies
double virial[6]; // accumlated virial
double *eatom,**vatom; // accumulated per-atom energy/virial
Bond(class LAMMPS *);
virtual ~Bond();
virtual void init();
virtual void init_style() {}
virtual void compute(int, int) = 0;
virtual void settings(int, char **) {}
virtual void coeff(int, char **) = 0;
virtual double equilibrium_distance(int) = 0;
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;
virtual double single(int, double, int, int) = 0;
virtual double memory_usage();
protected:
int evflag;
int eflag_either,eflag_global,eflag_atom;
int vflag_either,vflag_global,vflag_atom;
int maxeatom,maxvatom;
void ev_setup(int, int);
void ev_tally(int, int, int, int, double, double, double, double, double);
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Bond coeffs are not set
+
+No bond coefficients have been assigned in the data file or via the
+bond_coeff command.
+
+E: All bond coeffs are not set
+
+All bond coefficients must be set in the data file or by the
+bond_coeff command before running a simulation.
+
+*/
diff --git a/src/bond_hybrid.h b/src/bond_hybrid.h
index 6c607ec6c..058524161 100644
--- a/src/bond_hybrid.h
+++ b/src/bond_hybrid.h
@@ -1,61 +1,97 @@
/* ----------------------------------------------------------------------
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 BOND_CLASS
BondStyle(hybrid,BondHybrid)
#else
#ifndef LMP_BOND_HYBRID_H
#define LMP_BOND_HYBRID_H
#include "stdio.h"
#include "bond.h"
namespace LAMMPS_NS {
class BondHybrid : public Bond {
friend class Force;
public:
int nstyles; // # of different bond styles
Bond **styles; // class list for each Bond style
char **keywords; // keyword for each Bond style
BondHybrid(class LAMMPS *);
~BondHybrid();
void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
double equilibrium_distance(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, double, int, int);
double memory_usage();
private:
int *map; // which style each bond type points to
int *nbondlist; // # of bonds in sub-style bondlists
int *maxbond; // max # of bonds sub-style lists can store
int ***bondlist; // bondlist for each sub-style
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Bond style hybrid cannot use same pair style twice
+
+Self-explanatory.
+
+E: Bond style hybrid cannot have hybrid as an argument
+
+Self-explanatory.
+
+E: Bond style hybrid cannot have none as an argument
+
+Self-explanatory.
+
+E: Bond coeff for hybrid has invalid style
+
+Bond style hybrid uses another bond style as one of its coefficients.
+The bond style used in the bond_coeff command or read from a restart
+file is not recognized.
+
+E: Invoked bond equil distance on bond style none
+
+Self-explanatory.
+
+E: Invoked bond single on bond style none
+
+Self-explanatory.
+
+*/
diff --git a/src/change_box.h b/src/change_box.h
index eb0c7f4e8..9399dcad8 100644
--- a/src/change_box.h
+++ b/src/change_box.h
@@ -1,36 +1,68 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(change_box,ChangeBox)
#else
#ifndef LMP_CHANGE_BOX_H
#define LMP_CHANGE_BOX_H
#include "pointers.h"
namespace LAMMPS_NS {
class ChangeBox : protected Pointers {
public:
ChangeBox(class LAMMPS *);
void command(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Change_box command before simulation box is defined
+
+Self-explanatory.
+
+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: Change_box operation is invalid
+
+Cannot change orthogonal box to orthogonal or a triclinic box to
+triclinic.
+
+E: Cannot change box to orthogonal when tilt is non-zero
+
+Self-explanatory
+
+E: Cannot change box with dumps defined
+
+Self-explanatory.
+
+E: Cannot change box with certain fixes defined
+
+The change_box command cannot be used when fix ave/spatial or
+fix/deform are defined .
+
+*/
diff --git a/src/comm.cpp b/src/comm.cpp
index e06f39c3c..789ed1a74 100644
--- a/src/comm.cpp
+++ b/src/comm.cpp
@@ -1,1805 +1,1498 @@
/* ----------------------------------------------------------------------
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 (triclinic) : Pieter in 't Veld (SNL)
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "mpi.h"
#include "math.h"
#include "string.h"
#include "stdio.h"
#include "stdlib.h"
#include "comm.h"
#include "universe.h"
#include "atom.h"
#include "atom_vec.h"
#include "force.h"
#include "pair.h"
#include "domain.h"
#include "neighbor.h"
#include "group.h"
#include "modify.h"
#include "fix.h"
#include "compute.h"
#include "output.h"
#include "dump.h"
+#include "procmap.h"
#include "math_extra.h"
#include "error.h"
#include "memory.h"
-#include <map>
-#include <string>
-
#ifdef _OPENMP
#include "omp.h"
#endif
using namespace LAMMPS_NS;
#define BUFFACTOR 1.5
#define BUFMIN 1000
#define BUFEXTRA 1000
#define BIG 1.0e20
enum{SINGLE,MULTI};
-enum{NONE,MULTIPLE};
-enum{CART,CARTREORDER,XYZ,XZY,YXZ,YZX,ZXY,ZYX};
+enum{MULTIPLE}; // same as in ProcMap
+enum{ONELEVEL,TWOLEVEL,NUMA,CUSTOM};
+enum{CART,CARTREORDER,XYZ};
/* ----------------------------------------------------------------------
setup MPI and allocate buffer space
------------------------------------------------------------------------- */
Comm::Comm(LAMMPS *lmp) : Pointers(lmp)
{
MPI_Comm_rank(world,&me);
MPI_Comm_size(world,&nprocs);
// query OpenMP for number of threads
// we need to be in a parallel area for that.
nthreads = 1;
#if defined (_OPENMP)
#pragma omp parallel default(shared)
{
#pragma omp master
{ nthreads = omp_get_num_threads(); }
}
#endif
user_procgrid[0] = user_procgrid[1] = user_procgrid[2] = 0;
+ gridflag = ONELEVEL;
+ mapflag = CART;
+ customfile = NULL;
+ recv_from_partition = send_to_partition = -1;
+ otherflag = 0;
+ outfile = NULL;
+
grid2proc = NULL;
- layoutflag = CART;
- numa_nodes = 0;
bordergroup = 0;
style = SINGLE;
multilo = multihi = NULL;
cutghostmulti = NULL;
cutghostuser = 0.0;
ghost_velocity = 0;
- recv_from_partition = send_to_partition = -1;
- other_partition_style = NONE;
// use of OpenMP threads
// query OpenMP for number of threads/process set by user at run-time
// need to be in a parallel area for this operation
nthreads = 1;
#ifdef _OPENMP
#pragma omp parallel default(shared)
{
#pragma omp master
{ nthreads = omp_get_num_threads(); }
}
if (me == 0) {
if (screen)
fprintf(screen," using %d OpenMP thread(s) per MPI task\n",nthreads);
if (logfile)
fprintf(logfile," using %d OpenMP thread(s) per MPI task\n",nthreads);
}
#endif
// initialize comm buffers & exchange memory
maxsend = BUFMIN;
memory->create(buf_send,maxsend+BUFEXTRA,"comm:buf_send");
maxrecv = BUFMIN;
memory->create(buf_recv,maxrecv,"comm:buf_recv");
maxswap = 6;
allocate_swap(maxswap);
sendlist = (int **) memory->smalloc(maxswap*sizeof(int *),"comm:sendlist");
memory->create(maxsendlist,maxswap,"comm:maxsendlist");
for (int i = 0; i < maxswap; i++) {
maxsendlist[i] = BUFMIN;
memory->create(sendlist[i],BUFMIN,"comm:sendlist[i]");
}
}
/* ---------------------------------------------------------------------- */
Comm::~Comm()
{
- if (grid2proc) memory->destroy(grid2proc);
+ delete [] customfile;
+ delete [] outfile;
+
+ memory->destroy(grid2proc);
free_swap();
if (style == MULTI) {
free_multi();
memory->destroy(cutghostmulti);
}
if (sendlist) for (int i = 0; i < maxswap; i++) memory->destroy(sendlist[i]);
memory->sfree(sendlist);
memory->destroy(maxsendlist);
memory->destroy(buf_send);
memory->destroy(buf_recv);
}
/* ----------------------------------------------------------------------
- create 3d grid of procs based on box size
+ create 3d grid of procs based on Nprocs and box size & shape
+ map processors to grid
------------------------------------------------------------------------- */
void Comm::set_proc_grid()
{
- // recv proc layout of another partition if my layout depends on it
+ // recv 3d proc grid of another partition if my 3d grid depends on it
if (recv_from_partition >= 0) {
MPI_Status status;
if (me == 0) MPI_Recv(other_procgrid,3,MPI_INT,
universe->root_proc[recv_from_partition],0,
universe->uworld,&status);
MPI_Bcast(other_procgrid,3,MPI_INT,0,world);
}
- // use NUMA routines if numa_nodes > 0
- // if NUMA routines fail, just continue
+ // create ProcMap class to create 3d grid and map procs to it
- if (numa_nodes) {
- int flag = numa_set_proc_grid();
- if (flag) return;
- }
+ ProcMap *pmap = new ProcMap(lmp);
- // create layout of procs mapped to simulation box
- // can fail (on one partition) if constrained by other_partition_style
+ // create 3d grid of processors
+ // produces procgrid and coregrid (if relevant)
- int flag =
- procs2box(nprocs,user_procgrid,procgrid,1,1,1,other_partition_style);
- if (!flag) error->all(FLERR,"Could not layout grid of processors",1);
+ if (gridflag == ONELEVEL) {
+ pmap->onelevel_grid(nprocs,user_procgrid,procgrid,
+ otherflag,other_style,other_procgrid);
- // error check
+ } else if (gridflag == TWOLEVEL) {
+ pmap->twolevel_grid(nprocs,user_procgrid,procgrid,
+ ncores,user_coregrid,coregrid,
+ otherflag,other_style,other_procgrid);
+
+ } else if (gridflag == NUMA) {
+ pmap->numa_grid(nprocs,user_procgrid,procgrid,coregrid);
+
+ } else if (gridflag == CUSTOM) {
+ pmap->custom_grid(customfile,nprocs,user_procgrid,procgrid);
+ }
+
+ // error check on procgrid
+ // should not be necessary due to ProcMap
if (procgrid[0]*procgrid[1]*procgrid[2] != nprocs)
error->all(FLERR,"Bad grid of processors");
if (domain->dimension == 2 && procgrid[2] != 1)
error->all(FLERR,"Processor count in z must be 1 for 2d simulation");
- // grid2proc[i][j][k] = proc that owns i,j,k location in grid
+ // grid2proc[i][j][k] = proc that owns i,j,k location in 3d grid
if (grid2proc) memory->destroy(grid2proc);
memory->create(grid2proc,procgrid[0],procgrid[1],procgrid[2],
"comm:grid2proc");
- // use MPI Cartesian routines to layout 3d grid of procs
- // MPI may do layout in machine-optimized fashion
-
- if (layoutflag == CART || layoutflag == CARTREORDER) {
- int reorder = 0;
- if (layoutflag == CARTREORDER) reorder = 1;
- int periods[3];
- periods[0] = periods[1] = periods[2] = 1;
- MPI_Comm cartesian;
-
- MPI_Cart_create(world,3,procgrid,periods,reorder,&cartesian);
- MPI_Cart_get(cartesian,3,procgrid,periods,myloc);
- MPI_Cart_shift(cartesian,0,1,&procneigh[0][0],&procneigh[0][1]);
- MPI_Cart_shift(cartesian,1,1,&procneigh[1][0],&procneigh[1][1]);
- MPI_Cart_shift(cartesian,2,1,&procneigh[2][0],&procneigh[2][1]);
-
- int coords[3];
- int i,j,k;
- for (i = 0; i < procgrid[0]; i++)
- for (j = 0; j < procgrid[1]; j++)
- for (k = 0; k < procgrid[2]; k++) {
- coords[0] = i; coords[1] = j; coords[2] = k;
- MPI_Cart_rank(cartesian,coords,&grid2proc[i][j][k]);
- }
+ // map processor IDs to 3d processor grid
+ // produces myloc, procneigh, grid2proc
+
+ if (gridflag == ONELEVEL) {
+ if (mapflag == CART)
+ pmap->cart_map(0,procgrid,myloc,procneigh,grid2proc);
+ else if (mapflag == CARTREORDER)
+ pmap->cart_map(1,procgrid,myloc,procneigh,grid2proc);
+ else if (mapflag == XYZ)
+ pmap->xyz_map(xyz,procgrid,myloc,procneigh,grid2proc);
+
+ } else if (gridflag == TWOLEVEL) {
+ if (mapflag == CART)
+ pmap->cart_map(0,procgrid,ncores,coregrid,myloc,procneigh,grid2proc);
+ else if (mapflag == CARTREORDER)
+ pmap->cart_map(1,procgrid,ncores,coregrid,myloc,procneigh,grid2proc);
+ else if (mapflag == XYZ)
+ pmap->xyz_map(xyz,procgrid,ncores,coregrid,myloc,procneigh,grid2proc);
- MPI_Comm_free(&cartesian);
+ // printf("AAA %d: %d %d: %d %d: %d %d\n",);
- // layout 3d grid of procs explicitly, via user-requested XYZ ordering
+ } else if (gridflag == NUMA) {
+ pmap->numa_map(0,coregrid,myloc,procneigh,grid2proc);
- } else {
- int i,j,k,ime,jme,kme;
- for (i = 0; i < procgrid[0]; i++)
- for (j = 0; j < procgrid[1]; j++)
- for (k = 0; k < procgrid[2]; k++) {
- if (layoutflag == XYZ)
- grid2proc[i][j][k] = k*procgrid[1]*procgrid[0] + j*procgrid[0] + i;
- else if (layoutflag == XZY)
- grid2proc[i][j][k] = j*procgrid[2]*procgrid[0] + k*procgrid[0] + i;
- else if (layoutflag == YXZ)
- grid2proc[i][j][k] = k*procgrid[0]*procgrid[1] + i*procgrid[1] + j;
- else if (layoutflag == YZX)
- grid2proc[i][j][k] = i*procgrid[2]*procgrid[1] + k*procgrid[1] + j;
- else if (layoutflag == ZXY)
- grid2proc[i][j][k] = j*procgrid[0]*procgrid[2] + i*procgrid[2] + k;
- else if (layoutflag == ZYX)
- grid2proc[i][j][k] = i*procgrid[1]*procgrid[2] + j*procgrid[2] + k;
-
- if (grid2proc[i][j][k] == me) {
- ime = i; jme = j, kme = k;
- }
- }
+ } else if (gridflag == CUSTOM) {
+ pmap->custom_map(procgrid,myloc,procneigh,grid2proc);
+ }
+
+ // print 3d grid info to screen and logfile
- myloc[0] = ime;
- myloc[1] = jme;
- myloc[2] = kme;
-
- i = ime-1;
- if (i < 0) i = procgrid[0]-1;
- procneigh[0][0] = grid2proc[i][jme][kme];
- i = ime+1;
- if (i == procgrid[0]) i = 0;
- procneigh[0][1] = grid2proc[i][jme][kme];
-
- j = jme-1;
- if (j < 0) j = procgrid[1]-1;
- procneigh[1][0] = grid2proc[ime][j][kme];
- j = jme+1;
- if (j == procgrid[1]) j = 0;
- procneigh[1][1] = grid2proc[ime][j][kme];
-
- k = kme-1;
- if (k < 0) k = procgrid[2]-1;
- procneigh[2][0] = grid2proc[ime][jme][k];
- k = kme+1;
- if (k == procgrid[2]) k = 0;
- procneigh[2][1] = grid2proc[ime][jme][k];
+ if (me == 0) {
+ if (screen) {
+ fprintf(screen," %d by %d by %d MPI processor grid\n",
+ procgrid[0],procgrid[1],procgrid[2]);
+ if (gridflag == NUMA || gridflag == TWOLEVEL)
+ fprintf(screen," %d by %d by %d core grid within node\n",
+ coregrid[0],coregrid[1],coregrid[2]);
+ }
+ if (logfile) {
+ fprintf(logfile," %d by %d by %d MPI processor grid\n",
+ procgrid[0],procgrid[1],procgrid[2]);
+ if (gridflag == NUMA || gridflag == TWOLEVEL)
+ fprintf(logfile," %d by %d by %d core grid within node\n",
+ coregrid[0],coregrid[1],coregrid[2]);
+ }
}
+ // print 3d grid details to outfile
+
+ if (outfile) pmap->output(outfile,procgrid,grid2proc);
+
// set lamda box params after procs are assigned
if (domain->triclinic) domain->set_lamda_box();
- if (me == 0) {
- if (screen) fprintf(screen," %d by %d by %d MPI processor grid\n",
- procgrid[0],procgrid[1],procgrid[2]);
- if (logfile) fprintf(logfile," %d by %d by %d MPI processor grid\n",
- procgrid[0],procgrid[1],procgrid[2]);
-
-#if defined(_OPENMP)
- // This will be the indication that a binary was compiled with OpenMP support.
- if (screen) fprintf(screen," using %d OpenMP thread(s) per MPI task\n", nthreads);
- if (logfile) fprintf(logfile," using %d OpenMP thread(s) per MPI task\n", nthreads);
-#endif
- }
+ // free ProcMap class
- // send my proc layout to another partition if requested
+ delete pmap;
+
+ // send my 3d proc grid to another partition if requested
if (send_to_partition >= 0) {
if (me == 0) MPI_Send(procgrid,3,MPI_INT,
universe->root_proc[send_to_partition],0,
universe->uworld);
}
}
/* ---------------------------------------------------------------------- */
void Comm::init()
{
triclinic = domain->triclinic;
map_style = atom->map_style;
// comm_only = 1 if only x,f are exchanged in forward/reverse comm
// comm_x_only = 0 if ghost_velocity since velocities are added
comm_x_only = atom->avec->comm_x_only;
comm_f_only = atom->avec->comm_f_only;
if (ghost_velocity) comm_x_only = 0;
// set per-atom sizes for forward/reverse/border comm
// augment by velocity quantities if needed
size_forward = atom->avec->size_forward;
size_reverse = atom->avec->size_reverse;
size_border = atom->avec->size_border;
if (ghost_velocity) size_forward += atom->avec->size_velocity;
if (ghost_velocity) size_border += atom->avec->size_velocity;
// maxforward = # of datums in largest forward communication
// maxreverse = # of datums in largest reverse communication
// query pair,fix,compute,dump for their requirements
maxforward = MAX(size_forward,size_border);
maxreverse = size_reverse;
if (force->pair) maxforward = MAX(maxforward,force->pair->comm_forward);
if (force->pair) maxreverse = MAX(maxreverse,force->pair->comm_reverse);
for (int i = 0; i < modify->nfix; i++) {
maxforward = MAX(maxforward,modify->fix[i]->comm_forward);
maxreverse = MAX(maxreverse,modify->fix[i]->comm_reverse);
}
for (int i = 0; i < modify->ncompute; i++) {
maxforward = MAX(maxforward,modify->compute[i]->comm_forward);
maxreverse = MAX(maxreverse,modify->compute[i]->comm_reverse);
}
for (int i = 0; i < output->ndump; i++) {
maxforward = MAX(maxforward,output->dump[i]->comm_forward);
maxreverse = MAX(maxreverse,output->dump[i]->comm_reverse);
}
if (force->newton == 0) maxreverse = 0;
// memory for multi-style communication
if (style == MULTI && multilo == NULL) {
allocate_multi(maxswap);
memory->create(cutghostmulti,atom->ntypes+1,3,"comm:cutghostmulti");
}
if (style == SINGLE && multilo) {
free_multi();
memory->destroy(cutghostmulti);
}
}
/* ----------------------------------------------------------------------
setup spatial-decomposition communication patterns
function of neighbor cutoff(s) & cutghostuser & current box size
single style sets slab boundaries (slablo,slabhi) based on max cutoff
multi style sets type-dependent slab boundaries (multilo,multihi)
------------------------------------------------------------------------- */
void Comm::setup()
{
// cutghost[] = max distance at which ghost atoms need to be acquired
// for orthogonal:
// cutghost is in box coords = neigh->cutghost in all 3 dims
// for triclinic:
// neigh->cutghost = distance between tilted planes in box coords
// cutghost is in lamda coords = distance between those planes
// for multi:
// cutghostmulti = same as cutghost, only for each atom type
int i;
int ntypes = atom->ntypes;
double *prd,*sublo,*subhi;
double cut = MAX(neighbor->cutneighmax,cutghostuser);
if (triclinic == 0) {
prd = domain->prd;
sublo = domain->sublo;
subhi = domain->subhi;
cutghost[0] = cutghost[1] = cutghost[2] = cut;
if (style == MULTI) {
double *cuttype = neighbor->cuttype;
for (i = 1; i <= ntypes; i++)
cutghostmulti[i][0] = cutghostmulti[i][1] = cutghostmulti[i][2] =
cuttype[i];
}
} else {
prd = domain->prd_lamda;
sublo = domain->sublo_lamda;
subhi = domain->subhi_lamda;
double *h_inv = domain->h_inv;
double length0,length1,length2;
length0 = sqrt(h_inv[0]*h_inv[0] + h_inv[5]*h_inv[5] + h_inv[4]*h_inv[4]);
cutghost[0] = cut * length0;
length1 = sqrt(h_inv[1]*h_inv[1] + h_inv[3]*h_inv[3]);
cutghost[1] = cut * length1;
length2 = h_inv[2];
cutghost[2] = cut * length2;
if (style == MULTI) {
double *cuttype = neighbor->cuttype;
for (i = 1; i <= ntypes; i++) {
cutghostmulti[i][0] = cuttype[i] * length0;
cutghostmulti[i][1] = cuttype[i] * length1;
cutghostmulti[i][2] = cuttype[i] * length2;
}
}
}
// need = # of procs I need atoms from in each dim based on max cutoff
// for 2d, don't communicate in z
need[0] = static_cast<int> (cutghost[0] * procgrid[0] / prd[0]) + 1;
need[1] = static_cast<int> (cutghost[1] * procgrid[1] / prd[1]) + 1;
need[2] = static_cast<int> (cutghost[2] * procgrid[2] / prd[2]) + 1;
if (domain->dimension == 2) need[2] = 0;
// if non-periodic, do not communicate further than procgrid-1 away
// this enables very large cutoffs in non-periodic systems
int *periodicity = domain->periodicity;
if (periodicity[0] == 0) need[0] = MIN(need[0],procgrid[0]-1);
if (periodicity[1] == 0) need[1] = MIN(need[1],procgrid[1]-1);
if (periodicity[2] == 0) need[2] = MIN(need[2],procgrid[2]-1);
// allocate comm memory
nswap = 2 * (need[0]+need[1]+need[2]);
if (nswap > maxswap) grow_swap(nswap);
// setup parameters for each exchange:
// sendproc = proc to send to at each swap
// recvproc = proc to recv from at each swap
// for style SINGLE:
// slablo/slabhi = boundaries for slab of atoms to send at each swap
// use -BIG/midpt/BIG to insure all atoms included even if round-off occurs
// if round-off, atoms recvd across PBC can be < or > than subbox boundary
// note that borders() only loops over subset of atoms during each swap
// set slablo > slabhi for swaps across non-periodic boundaries
// this insures no atoms are swapped
// only for procs owning sub-box at non-periodic end of global box
// for style MULTI:
// multilo/multihi is same as slablo/slabhi, only for each atom type
// pbc_flag: 0 = nothing across a boundary, 1 = something across a boundary
// pbc = -1/0/1 for PBC factor in each of 3/6 orthog/triclinic dirs
// for triclinic, slablo/hi and pbc_border will be used in lamda (0-1) coords
// 1st part of if statement is sending to the west/south/down
// 2nd part of if statement is sending to the east/north/up
int dim,ineed;
int iswap = 0;
for (dim = 0; dim < 3; dim++) {
for (ineed = 0; ineed < 2*need[dim]; ineed++) {
pbc_flag[iswap] = 0;
pbc[iswap][0] = pbc[iswap][1] = pbc[iswap][2] =
pbc[iswap][3] = pbc[iswap][4] = pbc[iswap][5] = 0;
if (ineed % 2 == 0) {
sendproc[iswap] = procneigh[dim][0];
recvproc[iswap] = procneigh[dim][1];
if (style == SINGLE) {
if (ineed < 2) slablo[iswap] = -BIG;
else slablo[iswap] = 0.5 * (sublo[dim] + subhi[dim]);
slabhi[iswap] = sublo[dim] + cutghost[dim];
} else {
for (i = 1; i <= ntypes; i++) {
if (ineed < 2) multilo[iswap][i] = -BIG;
else multilo[iswap][i] = 0.5 * (sublo[dim] + subhi[dim]);
multihi[iswap][i] = sublo[dim] + cutghostmulti[i][dim];
}
}
if (myloc[dim] == 0) {
if (periodicity[dim] == 0) {
if (style == SINGLE) slabhi[iswap] = slablo[iswap] - 1.0;
else
for (i = 1; i <= ntypes; i++)
multihi[iswap][i] = multilo[iswap][i] - 1.0;
} else {
pbc_flag[iswap] = 1;
pbc[iswap][dim] = 1;
if (triclinic) {
if (dim == 1) pbc[iswap][5] = 1;
else if (dim == 2) pbc[iswap][4] = pbc[iswap][3] = 1;
}
}
}
} else {
sendproc[iswap] = procneigh[dim][1];
recvproc[iswap] = procneigh[dim][0];
if (style == SINGLE) {
slablo[iswap] = subhi[dim] - cutghost[dim];
if (ineed < 2) slabhi[iswap] = BIG;
else slabhi[iswap] = 0.5 * (sublo[dim] + subhi[dim]);
} else {
for (i = 1; i <= ntypes; i++) {
multilo[iswap][i] = subhi[dim] - cutghostmulti[i][dim];
if (ineed < 2) multihi[iswap][i] = BIG;
else multihi[iswap][i] = 0.5 * (sublo[dim] + subhi[dim]);
}
}
if (myloc[dim] == procgrid[dim]-1) {
if (periodicity[dim] == 0) {
if (style == SINGLE) slabhi[iswap] = slablo[iswap] - 1.0;
else
for (i = 1; i <= ntypes; i++)
multihi[iswap][i] = multilo[iswap][i] - 1.0;
} else {
pbc_flag[iswap] = 1;
pbc[iswap][dim] = -1;
if (triclinic) {
if (dim == 1) pbc[iswap][5] = -1;
else if (dim == 2) pbc[iswap][4] = pbc[iswap][3] = -1;
}
}
}
}
iswap++;
}
}
}
/* ----------------------------------------------------------------------
forward communication of atom coords every timestep
other per-atom attributes may also be sent via pack/unpack routines
------------------------------------------------------------------------- */
void Comm::forward_comm(int dummy)
{
int n;
MPI_Request request;
MPI_Status status;
AtomVec *avec = atom->avec;
double **x = atom->x;
double *buf;
// exchange data with another proc
// if other proc is self, just copy
// if comm_x_only set, exchange or copy directly to x, don't unpack
for (int iswap = 0; iswap < nswap; iswap++) {
if (sendproc[iswap] != me) {
if (comm_x_only) {
if (size_forward_recv[iswap]) buf = x[firstrecv[iswap]];
else buf = NULL;
MPI_Irecv(buf,size_forward_recv[iswap],MPI_DOUBLE,
recvproc[iswap],0,world,&request);
n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
MPI_Wait(&request,&status);
} else if (ghost_velocity) {
MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
recvproc[iswap],0,world,&request);
n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
MPI_Wait(&request,&status);
avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_recv);
} else {
MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
recvproc[iswap],0,world,&request);
n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
MPI_Wait(&request,&status);
avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_recv);
}
} else {
if (comm_x_only) {
if (sendnum[iswap])
n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
x[firstrecv[iswap]],pbc_flag[iswap],
pbc[iswap]);
} else if (ghost_velocity) {
n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_send);
} else {
n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_send);
}
}
}
}
/* ----------------------------------------------------------------------
reverse communication of forces on atoms every timestep
other per-atom attributes may also be sent via pack/unpack routines
------------------------------------------------------------------------- */
void Comm::reverse_comm()
{
int n;
MPI_Request request;
MPI_Status status;
AtomVec *avec = atom->avec;
double **f = atom->f;
double *buf;
// exchange data with another proc
// if other proc is self, just copy
// if comm_f_only set, exchange or copy directly from f, don't pack
for (int iswap = nswap-1; iswap >= 0; iswap--) {
if (sendproc[iswap] != me) {
if (comm_f_only) {
MPI_Irecv(buf_recv,size_reverse_recv[iswap],MPI_DOUBLE,
sendproc[iswap],0,world,&request);
if (size_reverse_send[iswap]) buf = f[firstrecv[iswap]];
else buf = NULL;
MPI_Send(buf,size_reverse_send[iswap],MPI_DOUBLE,
recvproc[iswap],0,world);
MPI_Wait(&request,&status);
} else {
MPI_Irecv(buf_recv,size_reverse_recv[iswap],MPI_DOUBLE,
sendproc[iswap],0,world,&request);
n = avec->pack_reverse(recvnum[iswap],firstrecv[iswap],buf_send);
MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world);
MPI_Wait(&request,&status);
}
avec->unpack_reverse(sendnum[iswap],sendlist[iswap],buf_recv);
} else {
if (comm_f_only) {
if (sendnum[iswap])
avec->unpack_reverse(sendnum[iswap],sendlist[iswap],
f[firstrecv[iswap]]);
} else {
n = avec->pack_reverse(recvnum[iswap],firstrecv[iswap],buf_send);
avec->unpack_reverse(sendnum[iswap],sendlist[iswap],buf_send);
}
}
}
}
/* ----------------------------------------------------------------------
exchange: move atoms to correct processors
atoms exchanged with all 6 stencil neighbors
send out atoms that have left my box, receive ones entering my box
atoms will be lost if not inside some proc's box
can happen if atom moves outside of non-periodic bounary
or if atom moves more than one proc away
this routine called before every reneighboring
for triclinic, atoms must be in lamda coords (0-1) before exchange is called
------------------------------------------------------------------------- */
void Comm::exchange()
{
int i,m,nsend,nrecv,nrecv1,nrecv2,nlocal;
double lo,hi,value;
double **x;
double *sublo,*subhi,*buf;
MPI_Request request;
MPI_Status status;
AtomVec *avec = atom->avec;
// clear global->local map for owned and ghost atoms
// b/c atoms migrate to new procs in exchange() and
// new ghosts are created in borders()
// map_set() is done at end of borders()
if (map_style) atom->map_clear();
// subbox bounds for orthogonal or triclinic
if (triclinic == 0) {
sublo = domain->sublo;
subhi = domain->subhi;
} else {
sublo = domain->sublo_lamda;
subhi = domain->subhi_lamda;
}
// loop over dimensions
for (int dim = 0; dim < 3; dim++) {
// fill buffer with atoms leaving my box, using < and >=
// when atom is deleted, fill it in with last atom
x = atom->x;
lo = sublo[dim];
hi = subhi[dim];
nlocal = atom->nlocal;
i = nsend = 0;
while (i < nlocal) {
if (x[i][dim] < lo || x[i][dim] >= hi) {
if (nsend >= maxsend) grow_send(nsend,1);
nsend += avec->pack_exchange(i,&buf_send[nsend]);
avec->copy(nlocal-1,i,1);
nlocal--;
} else i++;
}
atom->nlocal = nlocal;
// send/recv atoms in both directions
// if 1 proc in dimension, no send/recv, set recv buf to send buf
// if 2 procs in dimension, single send/recv
// if more than 2 procs in dimension, send/recv to both neighbors
if (procgrid[dim] == 1) {
nrecv = nsend;
buf = buf_send;
} else {
MPI_Sendrecv(&nsend,1,MPI_INT,procneigh[dim][0],0,
&nrecv1,1,MPI_INT,procneigh[dim][1],0,world,&status);
nrecv = nrecv1;
if (procgrid[dim] > 2) {
MPI_Sendrecv(&nsend,1,MPI_INT,procneigh[dim][1],0,
&nrecv2,1,MPI_INT,procneigh[dim][0],0,world,&status);
nrecv += nrecv2;
}
if (nrecv >= maxrecv) grow_recv(nrecv);
MPI_Irecv(buf_recv,nrecv1,MPI_DOUBLE,procneigh[dim][1],0,
world,&request);
MPI_Send(buf_send,nsend,MPI_DOUBLE,procneigh[dim][0],0,world);
MPI_Wait(&request,&status);
if (procgrid[dim] > 2) {
MPI_Irecv(&buf_recv[nrecv1],nrecv2,MPI_DOUBLE,procneigh[dim][0],0,
world,&request);
MPI_Send(buf_send,nsend,MPI_DOUBLE,procneigh[dim][1],0,world);
MPI_Wait(&request,&status);
}
buf = buf_recv;
}
// check incoming atoms to see if they are in my box
// if so, add to my list
m = 0;
while (m < nrecv) {
value = buf[m+dim+1];
if (value >= lo && value < hi) m += avec->unpack_exchange(&buf[m]);
else m += static_cast<int> (buf[m]);
}
}
if (atom->firstgroupname) atom->first_reorder();
}
/* ----------------------------------------------------------------------
borders: list nearby atoms to send to neighboring procs at every timestep
one list is created for every swap that will be made
as list is made, actually do swaps
this does equivalent of a communicate (so don't need to explicitly
call communicate routine on reneighboring timestep)
this routine is called before every reneighboring
for triclinic, atoms must be in lamda coords (0-1) before borders is called
------------------------------------------------------------------------- */
void Comm::borders()
{
int i,n,itype,iswap,dim,ineed,maxneed,smax,rmax;
int nsend,nrecv,nfirst,nlast,ngroup;
double lo,hi;
int *type;
double **x;
double *buf,*mlo,*mhi;
MPI_Request request;
MPI_Status status;
AtomVec *avec = atom->avec;
// clear old ghosts and any ghost bonus data internal to AtomVec
atom->nghost = 0;
atom->avec->clear_bonus();
// do swaps over all 3 dimensions
iswap = 0;
smax = rmax = 0;
for (dim = 0; dim < 3; dim++) {
nlast = 0;
maxneed = 2*need[dim];
for (ineed = 0; ineed < maxneed; ineed++) {
// find atoms within slab boundaries lo/hi using <= and >=
// check atoms between nfirst and nlast
// for first swaps in a dim, check owned and ghost
// for later swaps in a dim, only check newly arrived ghosts
// store sent atom indices in list for use in future timesteps
x = atom->x;
if (style == SINGLE) {
lo = slablo[iswap];
hi = slabhi[iswap];
} else {
type = atom->type;
mlo = multilo[iswap];
mhi = multihi[iswap];
}
if (ineed % 2 == 0) {
nfirst = nlast;
nlast = atom->nlocal + atom->nghost;
}
nsend = 0;
// find send atoms according to SINGLE vs MULTI
// all atoms eligible versus atoms in bordergroup
// only need to limit loop to bordergroup for first sends (ineed < 2)
// on these sends, break loop in two: owned (in group) and ghost
if (!bordergroup || ineed >= 2) {
if (style == SINGLE) {
for (i = nfirst; i < nlast; i++)
if (x[i][dim] >= lo && x[i][dim] <= hi) {
if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
sendlist[iswap][nsend++] = i;
}
} else {
for (i = nfirst; i < nlast; i++) {
itype = type[i];
if (x[i][dim] >= mlo[itype] && x[i][dim] <= mhi[itype]) {
if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
sendlist[iswap][nsend++] = i;
}
}
}
} else {
if (style == SINGLE) {
ngroup = atom->nfirst;
for (i = 0; i < ngroup; i++)
if (x[i][dim] >= lo && x[i][dim] <= hi) {
if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
sendlist[iswap][nsend++] = i;
}
for (i = atom->nlocal; i < nlast; i++)
if (x[i][dim] >= lo && x[i][dim] <= hi) {
if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
sendlist[iswap][nsend++] = i;
}
} else {
ngroup = atom->nfirst;
for (i = 0; i < ngroup; i++) {
itype = type[i];
if (x[i][dim] >= mlo[itype] && x[i][dim] <= mhi[itype]) {
if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
sendlist[iswap][nsend++] = i;
}
}
for (i = atom->nlocal; i < nlast; i++) {
itype = type[i];
if (x[i][dim] >= mlo[itype] && x[i][dim] <= mhi[itype]) {
if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
sendlist[iswap][nsend++] = i;
}
}
}
}
// pack up list of border atoms
if (nsend*size_border >= maxsend)
grow_send(nsend*size_border,0);
if (ghost_velocity)
n = avec->pack_border_vel(nsend,sendlist[iswap],buf_send,
pbc_flag[iswap],pbc[iswap]);
else
n = avec->pack_border(nsend,sendlist[iswap],buf_send,
pbc_flag[iswap],pbc[iswap]);
// swap atoms with other proc
// put incoming ghosts at end of my atom arrays
// if swapping with self, simply copy, no messages
if (sendproc[iswap] != me) {
MPI_Sendrecv(&nsend,1,MPI_INT,sendproc[iswap],0,
&nrecv,1,MPI_INT,recvproc[iswap],0,world,&status);
if (nrecv*size_border >= maxrecv)
grow_recv(nrecv*size_border);
MPI_Irecv(buf_recv,nrecv*size_border,MPI_DOUBLE,
recvproc[iswap],0,world,&request);
MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
MPI_Wait(&request,&status);
buf = buf_recv;
} else {
nrecv = nsend;
buf = buf_send;
}
// unpack buffer
if (ghost_velocity)
avec->unpack_border_vel(nrecv,atom->nlocal+atom->nghost,buf);
else
avec->unpack_border(nrecv,atom->nlocal+atom->nghost,buf);
// set all pointers & counters
smax = MAX(smax,nsend);
rmax = MAX(rmax,nrecv);
sendnum[iswap] = nsend;
recvnum[iswap] = nrecv;
size_forward_recv[iswap] = nrecv*size_forward;
size_reverse_send[iswap] = nrecv*size_reverse;
size_reverse_recv[iswap] = nsend*size_reverse;
firstrecv[iswap] = atom->nlocal + atom->nghost;
atom->nghost += nrecv;
iswap++;
}
}
// insure send/recv buffers are long enough for all forward & reverse comm
int max = MAX(maxforward*smax,maxreverse*rmax);
if (max >= maxsend) grow_send(max,0);
max = MAX(maxforward*rmax,maxreverse*smax);
if (max >= maxrecv) grow_recv(max);
// reset global->local map
if (map_style) atom->map_set();
}
/* ----------------------------------------------------------------------
forward communication invoked by a Pair
------------------------------------------------------------------------- */
void Comm::forward_comm_pair(Pair *pair)
{
int iswap,n;
double *buf;
MPI_Request request;
MPI_Status status;
for (iswap = 0; iswap < nswap; iswap++) {
// pack buffer
n = pair->pack_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
// exchange with another proc
// if self, set recv buffer to send buffer
if (sendproc[iswap] != me) {
MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
world,&request);
MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
// unpack buffer
pair->unpack_comm(recvnum[iswap],firstrecv[iswap],buf);
}
}
/* ----------------------------------------------------------------------
reverse communication invoked by a Pair
------------------------------------------------------------------------- */
void Comm::reverse_comm_pair(Pair *pair)
{
int iswap,n;
double *buf;
MPI_Request request;
MPI_Status status;
for (iswap = nswap-1; iswap >= 0; iswap--) {
// pack buffer
n = pair->pack_reverse_comm(recvnum[iswap],firstrecv[iswap],buf_send);
// exchange with another proc
// if self, set recv buffer to send buffer
if (sendproc[iswap] != me) {
MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
world,&request);
MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
// unpack buffer
pair->unpack_reverse_comm(sendnum[iswap],sendlist[iswap],buf);
}
}
/* ----------------------------------------------------------------------
forward communication invoked by a Fix
------------------------------------------------------------------------- */
void Comm::forward_comm_fix(Fix *fix)
{
int iswap,n;
double *buf;
MPI_Request request;
MPI_Status status;
for (iswap = 0; iswap < nswap; iswap++) {
// pack buffer
n = fix->pack_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
// exchange with another proc
// if self, set recv buffer to send buffer
if (sendproc[iswap] != me) {
MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
world,&request);
MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
// unpack buffer
fix->unpack_comm(recvnum[iswap],firstrecv[iswap],buf);
}
}
/* ----------------------------------------------------------------------
reverse communication invoked by a Fix
------------------------------------------------------------------------- */
void Comm::reverse_comm_fix(Fix *fix)
{
int iswap,n;
double *buf;
MPI_Request request;
MPI_Status status;
for (iswap = nswap-1; iswap >= 0; iswap--) {
// pack buffer
n = fix->pack_reverse_comm(recvnum[iswap],firstrecv[iswap],buf_send);
// exchange with another proc
// if self, set recv buffer to send buffer
if (sendproc[iswap] != me) {
MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
world,&request);
MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
// unpack buffer
fix->unpack_reverse_comm(sendnum[iswap],sendlist[iswap],buf);
}
}
/* ----------------------------------------------------------------------
forward communication invoked by a Compute
------------------------------------------------------------------------- */
void Comm::forward_comm_compute(Compute *compute)
{
int iswap,n;
double *buf;
MPI_Request request;
MPI_Status status;
for (iswap = 0; iswap < nswap; iswap++) {
// pack buffer
n = compute->pack_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
// exchange with another proc
// if self, set recv buffer to send buffer
if (sendproc[iswap] != me) {
MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
world,&request);
MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
// unpack buffer
compute->unpack_comm(recvnum[iswap],firstrecv[iswap],buf);
}
}
/* ----------------------------------------------------------------------
reverse communication invoked by a Compute
------------------------------------------------------------------------- */
void Comm::reverse_comm_compute(Compute *compute)
{
int iswap,n;
double *buf;
MPI_Request request;
MPI_Status status;
for (iswap = nswap-1; iswap >= 0; iswap--) {
// pack buffer
n = compute->pack_reverse_comm(recvnum[iswap],firstrecv[iswap],buf_send);
// exchange with another proc
// if self, set recv buffer to send buffer
if (sendproc[iswap] != me) {
MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
world,&request);
MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
// unpack buffer
compute->unpack_reverse_comm(sendnum[iswap],sendlist[iswap],buf);
}
}
/* ----------------------------------------------------------------------
forward communication invoked by a Dump
------------------------------------------------------------------------- */
void Comm::forward_comm_dump(Dump *dump)
{
int iswap,n;
double *buf;
MPI_Request request;
MPI_Status status;
for (iswap = 0; iswap < nswap; iswap++) {
// pack buffer
n = dump->pack_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
// exchange with another proc
// if self, set recv buffer to send buffer
if (sendproc[iswap] != me) {
MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
world,&request);
MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
// unpack buffer
dump->unpack_comm(recvnum[iswap],firstrecv[iswap],buf);
}
}
/* ----------------------------------------------------------------------
reverse communication invoked by a Dump
------------------------------------------------------------------------- */
void Comm::reverse_comm_dump(Dump *dump)
{
int iswap,n;
double *buf;
MPI_Request request;
MPI_Status status;
for (iswap = nswap-1; iswap >= 0; iswap--) {
// pack buffer
n = dump->pack_reverse_comm(recvnum[iswap],firstrecv[iswap],buf_send);
// exchange with another proc
// if self, set recv buffer to send buffer
if (sendproc[iswap] != me) {
MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
world,&request);
MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
// unpack buffer
dump->unpack_reverse_comm(sendnum[iswap],sendlist[iswap],buf);
}
}
-/* ----------------------------------------------------------------------
- assign numprocs to 3d box so as to minimize surface area
- area = surface area of each of 3 faces of simulation box divided by sx,sy,sz
- for triclinic, area = cross product of 2 edge vectors stored in h matrix
- valid assignment will be factorization of numprocs = Px by Py by Pz
- user_factors = if non-zero, factors are specified by user
- sx,sy,sz = scale box xyz dimension vy dividing by sx,sy,sz
- other = 1 to enforce compatability with other partition's layout
- return factors = # of procs assigned to each dimension
- return 1 if successully factor, 0 if not
-------------------------------------------------------------------------- */
-
-int Comm::procs2box(int numprocs, int user_factors[3], int factors[3],
- const int sx, const int sy, const int sz, int other)
-{
- factors[0] = user_factors[0];
- factors[1] = user_factors[1];
- factors[2] = user_factors[2];
-
- // all 3 proc counts are specified
-
- if (factors[0] && factors[1] && factors[2]) return 1;
-
- // 2 out of 3 proc counts are specified
-
- if (factors[0] > 0 && factors[1] > 0) {
- factors[2] = nprocs/(factors[0]*factors[1]);
- return 1;
- } else if (factors[0] > 0 && factors[2] > 0) {
- factors[1] = nprocs/(factors[0]*factors[2]);
- return 1;
- } else if (factors[1] > 0 && factors[2] > 0) {
- factors[0] = nprocs/(factors[1]*factors[2]);
- return 1;
- }
-
- // determine cross-sectional areas for orthogonal and triclinic boxes
- // area[0] = xy, area[1] = xz, area[2] = yz
-
- double area[3];
- if (domain->triclinic == 0) {
- area[0] = domain->xprd * domain->yprd / (sx * sy);
- area[1] = domain->xprd * domain->zprd / (sx * sz);
- area[2] = domain->yprd * domain->zprd / (sy * sz);
- } else {
- double *h = domain->h;
- double a[3],b[3],c[3];
- a[0] = h[0]; a[1] = 0.0; a[2] = 0.0;
- b[0] = h[5]; b[1] = h[1]; b[2] = 0.0;
- MathExtra::cross3(a,b,c);
- area[0] = sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]) / (sx * sy);
- a[0] = h[0]; a[1] = 0.0; a[2] = 0.0;
- b[0] = h[4]; b[1] = h[3]; b[2] = h[2];
- MathExtra::cross3(a,b,c);
- area[1] = sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]) / (sx * sz);
- a[0] = h[5]; a[1] = h[1]; a[2] = 0.0;
- b[0] = h[4]; b[1] = h[3]; b[2] = h[2];
- MathExtra::cross3(a,b,c);
- area[2] = sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]) / (sy * sz);
- }
-
- double bestsurf = 2.0 * (area[0]+area[1]+area[2]);
-
- // loop thru all possible factorizations of numprocs
- // only consider valid cases that match procgrid settings
- // surf = surface area of a proc sub-domain
- // only consider cases that match user_factors & other_procgrid settings
- // success = 1 if valid factoriztion is found
- // may not be if other constraint is enforced
-
- int ipx,ipy,ipz,valid;
- double surf;
-
- int success = 0;
- ipx = 1;
- while (ipx <= numprocs) {
- valid = 1;
- if (user_factors[0] && ipx != user_factors[0]) valid = 0;
- if (other == MULTIPLE && other_procgrid[0] % ipx) valid = 0;
- if (numprocs % ipx) valid = 0;
-
- if (!valid) {
- ipx++;
- continue;
- }
-
- ipy = 1;
- while (ipy <= numprocs/ipx) {
- valid = 1;
- if (user_factors[1] && ipy != user_factors[1]) valid = 0;
- if (other == MULTIPLE && other_procgrid[1] % ipy) valid = 0;
- if ((numprocs/ipx) % ipy) valid = 0;
- if (!valid) {
- ipy++;
- continue;
- }
-
- ipz = numprocs/ipx/ipy;
- valid = 1;
- if (user_factors[2] && ipz != user_factors[2]) valid = 0;
- if (other == MULTIPLE && other_procgrid[2] % ipz) valid = 0;
- if (domain->dimension == 2 && ipz != 1) valid = 0;
- if (!valid) {
- ipy++;
- continue;
- }
-
- surf = area[0]/ipx/ipy + area[1]/ipx/ipz + area[2]/ipy/ipz;
- if (surf < bestsurf) {
- success = 1;
- bestsurf = surf;
- factors[0] = ipx;
- factors[1] = ipy;
- factors[2] = ipz;
- }
- ipy++;
- }
-
- ipx++;
- }
-
- return success;
-}
-
/* ----------------------------------------------------------------------
realloc the size of the send buffer as needed with BUFFACTOR & BUFEXTRA
if flag = 1, realloc
if flag = 0, don't need to realloc with copy, just free/malloc
------------------------------------------------------------------------- */
void Comm::grow_send(int n, int flag)
{
maxsend = static_cast<int> (BUFFACTOR * n);
if (flag)
memory->grow(buf_send,(maxsend+BUFEXTRA),"comm:buf_send");
else {
memory->destroy(buf_send);
memory->create(buf_send,maxsend+BUFEXTRA,"comm:buf_send");
}
}
/* ----------------------------------------------------------------------
free/malloc the size of the recv buffer as needed with BUFFACTOR
------------------------------------------------------------------------- */
void Comm::grow_recv(int n)
{
maxrecv = static_cast<int> (BUFFACTOR * n);
memory->destroy(buf_recv);
memory->create(buf_recv,maxrecv,"comm:buf_recv");
}
/* ----------------------------------------------------------------------
realloc the size of the iswap sendlist as needed with BUFFACTOR
------------------------------------------------------------------------- */
void Comm::grow_list(int iswap, int n)
{
maxsendlist[iswap] = static_cast<int> (BUFFACTOR * n);
memory->grow(sendlist[iswap],maxsendlist[iswap],"comm:sendlist[iswap]");
}
/* ----------------------------------------------------------------------
realloc the buffers needed for swaps
------------------------------------------------------------------------- */
void Comm::grow_swap(int n)
{
free_swap();
allocate_swap(n);
if (style == MULTI) {
free_multi();
allocate_multi(n);
}
sendlist = (int **)
memory->srealloc(sendlist,n*sizeof(int *),"comm:sendlist");
memory->grow(maxsendlist,n,"comm:maxsendlist");
for (int i = maxswap; i < n; i++) {
maxsendlist[i] = BUFMIN;
memory->create(sendlist[i],BUFMIN,"comm:sendlist[i]");
}
maxswap = n;
}
/* ----------------------------------------------------------------------
allocation of swap info
------------------------------------------------------------------------- */
void Comm::allocate_swap(int n)
{
memory->create(sendnum,n,"comm:sendnum");
memory->create(recvnum,n,"comm:recvnum");
memory->create(sendproc,n,"comm:sendproc");
memory->create(recvproc,n,"comm:recvproc");
memory->create(size_forward_recv,n,"comm:size");
memory->create(size_reverse_send,n,"comm:size");
memory->create(size_reverse_recv,n,"comm:size");
memory->create(slablo,n,"comm:slablo");
memory->create(slabhi,n,"comm:slabhi");
memory->create(firstrecv,n,"comm:firstrecv");
memory->create(pbc_flag,n,"comm:pbc_flag");
memory->create(pbc,n,6,"comm:pbc");
}
/* ----------------------------------------------------------------------
allocation of multi-type swap info
------------------------------------------------------------------------- */
void Comm::allocate_multi(int n)
{
multilo = memory->create(multilo,n,atom->ntypes+1,"comm:multilo");
multihi = memory->create(multihi,n,atom->ntypes+1,"comm:multihi");
}
/* ----------------------------------------------------------------------
free memory for swaps
------------------------------------------------------------------------- */
void Comm::free_swap()
{
memory->destroy(sendnum);
memory->destroy(recvnum);
memory->destroy(sendproc);
memory->destroy(recvproc);
memory->destroy(size_forward_recv);
memory->destroy(size_reverse_send);
memory->destroy(size_reverse_recv);
memory->destroy(slablo);
memory->destroy(slabhi);
memory->destroy(firstrecv);
memory->destroy(pbc_flag);
memory->destroy(pbc);
}
/* ----------------------------------------------------------------------
free memory for multi-type swaps
------------------------------------------------------------------------- */
void Comm::free_multi()
{
memory->destroy(multilo);
memory->destroy(multihi);
}
/* ----------------------------------------------------------------------
set communication style
invoked from input script by communicate command
------------------------------------------------------------------------- */
void Comm::set(int narg, char **arg)
{
if (narg < 1) error->all(FLERR,"Illegal communicate command");
if (strcmp(arg[0],"single") == 0) style = SINGLE;
else if (strcmp(arg[0],"multi") == 0) style = MULTI;
else error->all(FLERR,"Illegal communicate command");
int iarg = 1;
while (iarg < narg) {
if (strcmp(arg[iarg],"group") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal communicate command");
bordergroup = group->find(arg[iarg+1]);
if (bordergroup < 0)
error->all(FLERR,"Invalid group in communicate command");
if (bordergroup && (atom->firstgroupname == NULL ||
strcmp(arg[iarg+1],atom->firstgroupname) != 0))
error->all(FLERR,"Communicate group != atom_modify first group");
iarg += 2;
} else if (strcmp(arg[iarg],"cutoff") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal communicate command");
cutghostuser = atof(arg[iarg+1]);
if (cutghostuser < 0.0)
error->all(FLERR,"Invalid cutoff in communicate command");
iarg += 2;
} else if (strcmp(arg[iarg],"vel") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal communicate command");
if (strcmp(arg[iarg+1],"yes") == 0) ghost_velocity = 1;
else if (strcmp(arg[iarg+1],"no") == 0) ghost_velocity = 0;
else error->all(FLERR,"Illegal communicate command");
iarg += 2;
} else error->all(FLERR,"Illegal communicate command");
}
}
/* ----------------------------------------------------------------------
set dimensions for 3d grid of processors, and associated flags
invoked from input script by processors command
------------------------------------------------------------------------- */
void Comm::set_processors(int narg, char **arg)
{
if (narg < 3) error->all(FLERR,"Illegal processors command");
if (strcmp(arg[0],"*") == 0) user_procgrid[0] = 0;
else user_procgrid[0] = atoi(arg[0]);
if (strcmp(arg[1],"*") == 0) user_procgrid[1] = 0;
else user_procgrid[1] = atoi(arg[1]);
if (strcmp(arg[2],"*") == 0) user_procgrid[2] = 0;
else user_procgrid[2] = atoi(arg[2]);
if (user_procgrid[0] < 0 || user_procgrid[1] < 0 || user_procgrid[2] < 0)
error->all(FLERR,"Illegal processors command");
int iarg = 3;
while (iarg < narg) {
- if (strcmp(arg[iarg],"part") == 0) {
+ if (strcmp(arg[iarg],"grid") == 0) {
+ if (iarg+2 > narg) error->all(FLERR,"Illegal processors command");
+
+ if (strcmp(arg[iarg+1],"onelevel") == 0) {
+ gridflag = ONELEVEL;
+
+ } else if (strcmp(arg[iarg+1],"twolevel") == 0) {
+ if (iarg+6 > narg) error->all(FLERR,"Illegal processors command");
+ gridflag = TWOLEVEL;
+
+ ncores = atoi(arg[iarg+2]);
+ if (strcmp(arg[iarg+3],"*") == 0) user_coregrid[0] = 0;
+ else user_coregrid[0] = atoi(arg[iarg+3]);
+ if (strcmp(arg[iarg+4],"*") == 0) user_coregrid[1] = 0;
+ else user_coregrid[1] = atoi(arg[iarg+4]);
+ if (strcmp(arg[iarg+5],"*") == 0) user_coregrid[2] = 0;
+ else user_coregrid[2] = atoi(arg[iarg+5]);
+
+ if (ncores <= 0 || user_coregrid[0] < 0 ||
+ user_coregrid[1] < 0 || user_coregrid[2] < 0)
+ error->all(FLERR,"Illegal processors command");
+ iarg += 4;
+
+ } else if (strcmp(arg[iarg+1],"numa") == 0) {
+ gridflag = NUMA;
+
+ } else if (strcmp(arg[iarg],"custom") == 0) {
+ if (iarg+3 > narg) error->all(FLERR,"Illegal processors command");
+ gridflag = CUSTOM;
+ delete [] customfile;
+ int n = strlen(arg[iarg+2]) + 1;
+ customfile = new char[n];
+ strcpy(customfile,arg[iarg+2]);
+ iarg += 1;
+
+ } else error->all(FLERR,"Illegal processors command");
+ iarg += 2;
+
+ } else if (strcmp(arg[iarg],"map") == 0) {
+ if (iarg+2 > narg) error->all(FLERR,"Illegal processors command");
+ if (strcmp(arg[iarg+1],"cart") == 0) mapflag = CART;
+ else if (strcmp(arg[iarg+1],"cart/reorder") == 0) mapflag = CARTREORDER;
+ else if (strcmp(arg[iarg+1],"xyz") == 0 ||
+ strcmp(arg[iarg+1],"xzy") == 0 ||
+ strcmp(arg[iarg+1],"yxz") == 0 ||
+ strcmp(arg[iarg+1],"yzx") == 0 ||
+ strcmp(arg[iarg+1],"zxy") == 0 ||
+ strcmp(arg[iarg+1],"zyx") == 0) {
+ mapflag = XYZ;
+ strcpy(xyz,arg[iarg+1]);
+ } else error->all(FLERR,"Illegal processors command");
+ iarg += 2;
+
+ } else if (strcmp(arg[iarg],"part") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal processors command");
if (universe->nworlds == 1)
error->all(FLERR,
"Cannot use processors part command "
"without using partitions");
int isend = atoi(arg[iarg+1]);
int irecv = atoi(arg[iarg+2]);
if (isend < 1 || isend > universe->nworlds ||
irecv < 1 || irecv > universe->nworlds || isend == irecv)
error->all(FLERR,"Invalid partitions in processors part command");
if (isend-1 == universe->iworld) {
if (send_to_partition >= 0)
error->all(FLERR,
"Sending partition in processors part command "
"is already a sender");
send_to_partition = irecv-1;
}
if (irecv-1 == universe->iworld) {
if (recv_from_partition >= 0)
error->all(FLERR,
"Receiving partition in processors part command "
"is already a receiver");
recv_from_partition = isend-1;
}
+
+ // only receiver has otherflag dependency
+
if (strcmp(arg[iarg+3],"multiple") == 0) {
- if (universe->iworld == irecv-1) other_partition_style = MULTIPLE;
+ if (universe->iworld == irecv-1) {
+ otherflag = 1;
+ other_style = MULTIPLE;
+ }
} else error->all(FLERR,"Illegal processors command");
iarg += 4;
- } else if (strcmp(arg[iarg],"grid") == 0) {
+ } else if (strcmp(arg[iarg],"file") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal processors command");
- if (strcmp(arg[iarg+1],"cart") == 0) layoutflag = CART;
- else if (strcmp(arg[iarg+1],"cart/reorder") == 0)
- layoutflag = CARTREORDER;
- else if (strcmp(arg[iarg+1],"xyz") == 0) layoutflag = XYZ;
- else if (strcmp(arg[iarg+1],"xzy") == 0) layoutflag = XZY;
- else if (strcmp(arg[iarg+1],"yxz") == 0) layoutflag = YXZ;
- else if (strcmp(arg[iarg+1],"yzx") == 0) layoutflag = YZX;
- else if (strcmp(arg[iarg+1],"zxy") == 0) layoutflag = ZXY;
- else if (strcmp(arg[iarg+1],"zyx") == 0) layoutflag = ZYX;
- else error->all(FLERR,"Illegal processors command");
+ delete [] outfile;
+ int n = strlen(arg[iarg+1]) + 1;
+ outfile = new char[n];
+ strcpy(outfile,arg[iarg+1]);
iarg += 2;
- } else if (strcmp(arg[iarg],"numa") == 0) {
- if (iarg+1 > narg) error->all(FLERR,"Illegal processors command");
- numa_nodes = 1;
- if (numa_nodes < 0) error->all(FLERR,"Illegal processors command");
- iarg += 1;
-
} else error->all(FLERR,"Illegal processors command");
}
- // error check
+ // error checks
- if (numa_nodes) {
- if (layoutflag != CART)
- error->all(FLERR,"Can only use processors numa "
- "with processors grid cart");
- if (send_to_partition >= 0 || recv_from_partition >= 0)
- error->one(FLERR,"Cannot use processors numa with processors part");
- }
-}
-
-/* ----------------------------------------------------------------------
- setup 3d grid of procs based on box size, group neighbors by numa node
- return 1 if successful, return 0 if not
-------------------------------------------------------------------------- */
-
-int Comm::numa_set_proc_grid()
-{
- // get names of all nodes
-
- int name_length;
- char node_name[MPI_MAX_PROCESSOR_NAME];
- char node_names[MPI_MAX_PROCESSOR_NAME*nprocs];
- MPI_Get_processor_name(node_name,&name_length);
- MPI_Allgather(&node_name,MPI_MAX_PROCESSOR_NAME,MPI_CHAR,&node_names,
- MPI_MAX_PROCESSOR_NAME,MPI_CHAR,world);
- std::string node_string = std::string(node_name);
-
- // get number of procs per node
-
- std::map<std::string,int> name_map;
- std::map<std::string,int>::iterator np;
- for (int i = 0; i < nprocs; i++) {
- std::string i_string = std::string(&node_names[i*MPI_MAX_PROCESSOR_NAME]);
- np = name_map.find(i_string);
- if (np == name_map.end())
- name_map[i_string] = 1;
- else
- np->second++;
- }
- int procs_per_node = name_map.begin()->second;
- int procs_per_numa = procs_per_node / numa_nodes;
-
- // use non-numa mapping if any condition met
-
- if (procs_per_numa < 4 || // less than 4 procs per numa node
- procs_per_node % numa_nodes != 0 || // no-op since numa_nodes = 1 for now
- nprocs % procs_per_numa != 0 || // total procs not a multiple of node
- nprocs <= procs_per_numa || // only 1 node used
- user_procgrid[0] > 1 || // user specified grid dimension < 1
- user_procgrid[1] > 1 || // in any dimension
- user_procgrid[2] > 1) {
- if (me == 0) {
- if (screen) fprintf(screen," 1 by 1 by 1 Node grid\n");
- if (logfile) fprintf(logfile," 1 by 1 by 1 Node grid\n");
- }
- return 0;
- }
-
- // user settings for the factorization per numa node - currently always zero
-
- int user_numagrid[3];
- user_numagrid[0] = user_numagrid[1] = user_numagrid[2] = 0;
-
- // if user specifies 1 for a proc grid dimension,
- // also use 1 for the node grid dimension
-
- if (user_procgrid[0] == 1) user_numagrid[0] = 1;
- if (user_procgrid[1] == 1) user_numagrid[1] = 1;
- if (user_procgrid[2] == 1) user_numagrid[2] = 1;
-
- // get an initial factorization for each numa node,
- // if the user has not set the number of processors
-
- int numagrid[3];
- procs2box(procs_per_numa,user_numagrid,numagrid,1,1,1,0);
- if (numagrid[0] * numagrid[1] * numagrid[2] != procs_per_numa)
- error->all(FLERR,"Bad node grid of processors");
-
- // get a factorization for the grid of numa nodes
-
- int node_count = nprocs / procs_per_numa;
- procs2box(node_count,user_procgrid,procgrid,
- numagrid[0],numagrid[1],numagrid[2],0);
- if (procgrid[0] * procgrid[1] * procgrid[2] != node_count)
- error->all(FLERR,"Bad grid of processors");
-
- // repeat the numa node factorization using the subdomain sizes
- // this will refine the factorization if the user specified the node layout
-
- procs2box(procs_per_numa,user_numagrid,numagrid,
- procgrid[0],procgrid[1],procgrid[2],0);
- if (numagrid[0]*numagrid[1]*numagrid[2] != procs_per_numa)
- error->all(FLERR,"Bad Node grid of processors");
- if (domain->dimension == 2 && (procgrid[2] != 1 || numagrid[2] != 1))
- error->all(FLERR,"Processor count in z must be 1 for 2d simulation");
-
- // assign a unique id to each node
-
- int node_num = 0, node_id = 0;
- for (np = name_map.begin(); np != name_map.end(); ++np) {
- if (np->first == node_string) node_id = node_num;
- node_num++;
- }
-
- // setup a per node communicator and find rank within
-
- MPI_Comm node_comm;
- MPI_Comm_split(world,node_id,0,&node_comm);
- int node_rank;
- MPI_Comm_rank(node_comm,&node_rank);
-
- // setup a per numa communicator and find rank within
-
- MPI_Comm numa_comm;
- int local_numa = node_rank / procs_per_numa;
- MPI_Comm_split(node_comm,local_numa,0,&numa_comm);
- int numa_rank;
- MPI_Comm_rank(numa_comm,&numa_rank);
-
- // setup a communicator with the rank 0 procs from each numa node
-
- MPI_Comm numa_leaders;
- MPI_Comm_split(world,numa_rank,0,&numa_leaders);
-
- // use the MPI Cartesian routines to map the nodes to the grid
- // could implement layoutflag as in non-NUMA case?
-
- int reorder = 0;
- int periods[3];
- periods[0] = periods[1] = periods[2] = 1;
- MPI_Comm cartesian;
- if (numa_rank == 0) {
- MPI_Cart_create(numa_leaders,3,procgrid,periods,reorder,&cartesian);
- MPI_Cart_get(cartesian,3,procgrid,periods,myloc);
- }
-
- // broadcast numa node location in grid to other procs in numa node
-
- MPI_Bcast(myloc,3,MPI_INT,0,numa_comm);
-
- // get storage for the process mapping
-
- if (grid2proc) memory->destroy(grid2proc);
- memory->create(grid2proc,procgrid[0]*numagrid[0],procgrid[1]*numagrid[1],
- procgrid[2]*numagrid[2],"comm:grid2proc");
-
- // compute my location within the grid
-
- int z_offset = numa_rank / (numagrid[0] * numagrid[1]);
- int y_offset = (numa_rank % (numagrid[0] * numagrid[1]))/numagrid[0];
- int x_offset = numa_rank % numagrid[0];
- myloc[0] = myloc[0] * numagrid[0] + x_offset;
- myloc[1] = myloc[1] * numagrid[1] + y_offset;
- myloc[2] = myloc[2] * numagrid[2] + z_offset;
- procgrid[0] *= numagrid[0];
- procgrid[1] *= numagrid[1];
- procgrid[2] *= numagrid[2];
-
- // allgather of locations to fill grid2proc
-
- int **gridi;
- memory->create(gridi,nprocs,3,"comm:gridi");
- MPI_Allgather(&myloc,3,MPI_INT,gridi[0],3,MPI_INT,world);
- for (int i = 0; i < nprocs; i++)
- grid2proc[gridi[i][0]][gridi[i][1]][gridi[i][2]] = i;
- memory->destroy(gridi);
-
- // get my neighbors
-
- int minus, plus;
- for (int i = 0; i < 3; i++) {
- numa_shift(myloc[i],procgrid[i],minus,plus);
- procneigh[i][0] = minus;
- procneigh[i][1] = plus;
- }
- procneigh[0][0] = grid2proc[procneigh[0][0]][myloc[1]][myloc[2]];
- procneigh[0][1] = grid2proc[procneigh[0][1]][myloc[1]][myloc[2]];
- procneigh[1][0] = grid2proc[myloc[0]][procneigh[1][0]][myloc[2]];
- procneigh[1][1] = grid2proc[myloc[0]][procneigh[1][1]][myloc[2]];
- procneigh[2][0] = grid2proc[myloc[0]][myloc[1]][procneigh[2][0]];
- procneigh[2][1] = grid2proc[myloc[0]][myloc[1]][procneigh[2][1]];
-
- if (numa_rank == 0) MPI_Comm_free(&cartesian);
- MPI_Comm_free(&numa_leaders);
- MPI_Comm_free(&numa_comm);
- MPI_Comm_free(&node_comm);
-
- // set lamda box params after procs are assigned
-
- if (domain->triclinic) domain->set_lamda_box();
-
- if (me == 0) {
- if (screen) fprintf(screen," %d by %d by %d Node grid\n",
- numagrid[0],numagrid[1],numagrid[2]);
- if (logfile) fprintf(logfile," %d by %d by %d Node grid\n",
- numagrid[0],numagrid[1],numagrid[2]);
- if (screen) fprintf(screen," %d by %d by %d processor grid\n",
- procgrid[0],procgrid[1],procgrid[2]);
- if (logfile) fprintf(logfile," %d by %d by %d processor grid\n",
- procgrid[0],procgrid[1],procgrid[2]);
- }
-
- return 1;
-}
-
-/* ----------------------------------------------------------------------
- get the index to the neighboring processors in a dimension
-------------------------------------------------------------------------- */
-
-void Comm::numa_shift(int myloc, int num_procs, int &minus, int &plus)
-{
- minus = myloc - 1;
- if (minus < 0) minus = num_procs - 1;
- plus = myloc + 1;
- if (plus == num_procs) plus = 0;
+ if (gridflag == NUMA && mapflag != CART)
+ error->all(FLERR,"Processors grid numa and map style are incompatible");
+ if (otherflag && (gridflag == NUMA || gridflag == CUSTOM))
+ error->all(FLERR,
+ "Processors part option and grid style are incompatible");
}
/* ----------------------------------------------------------------------
return # of bytes of allocated memory
------------------------------------------------------------------------- */
bigint Comm::memory_usage()
{
bigint bytes = 0;
for (int i = 0; i < nswap; i++)
bytes += memory->usage(sendlist[i],maxsendlist[i]);
bytes += memory->usage(buf_send,maxsend+BUFEXTRA);
bytes += memory->usage(buf_recv,maxrecv);
return bytes;
}
diff --git a/src/comm.h b/src/comm.h
index e578f1881..55633db9b 100644
--- a/src/comm.h
+++ b/src/comm.h
@@ -1,117 +1,175 @@
/* ----------------------------------------------------------------------
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_COMM_H
#define LMP_COMM_H
#include "pointers.h"
namespace LAMMPS_NS {
class Comm : protected Pointers {
public:
- int me,nprocs,nthreads; // proc info
- int procgrid[3]; // assigned # of procs in each dim
+ int me,nprocs; // proc info
+ int procgrid[3]; // procs assigned in each dim of 3d grid
int user_procgrid[3]; // user request for procs in each dim
int myloc[3]; // which proc I am in each dim
int procneigh[3][2]; // my 6 neighboring procs
int ghost_velocity; // 1 if ghost atoms have velocity, 0 if not
double cutghost[3]; // cutoffs used for acquiring ghost atoms
double cutghostuser; // user-specified ghost cutoff
int ***grid2proc; // which proc owns i,j,k loc in 3d grid
int recv_from_partition; // recv proc layout from this partition
int send_to_partition; // send my proc layout to this partition
// -1 if no recv or send
int other_partition_style; // 0 = recv layout dims must be multiple of
// my layout dims
int nthreads; // OpenMP threads per MPI process
Comm(class LAMMPS *);
virtual ~Comm();
virtual void init();
virtual void set_proc_grid(); // setup 3d grid of procs
virtual void setup(); // setup 3d comm pattern
virtual void forward_comm(int dummy = 0); // forward comm of atom coords
virtual void reverse_comm(); // reverse comm of forces
virtual void exchange(); // move atoms to new procs
virtual void borders(); // setup list of atoms to comm
virtual void forward_comm_pair(class Pair *); // forward comm from a Pair
virtual void reverse_comm_pair(class Pair *); // reverse comm from a Pair
virtual void forward_comm_fix(class Fix *); // forward comm from a Fix
virtual void reverse_comm_fix(class Fix *); // reverse comm from a Fix
virtual void forward_comm_compute(class Compute *); // forward from a Compute
virtual void reverse_comm_compute(class Compute *); // reverse from a Compute
virtual void forward_comm_dump(class Dump *); // forward comm from a Dump
virtual void reverse_comm_dump(class Dump *); // reverse comm from a Dump
virtual void set(int, char **); // set communication style
void set_processors(int, char **); // set 3d processor grid attributes
virtual bigint memory_usage();
protected:
int style; // single vs multi-type comm
int nswap; // # of swaps to perform
int need[3]; // procs I need atoms from in each dim
int triclinic; // 0 if domain is orthog, 1 if triclinic
int maxswap; // max # of swaps memory is allocated for
int size_forward; // # of per-atom datums in forward comm
int size_reverse; // # of datums in reverse comm
int size_border; // # of datums in forward border comm
int *sendnum,*recvnum; // # of atoms to send/recv in each swap
int *sendproc,*recvproc; // proc to send/recv to/from at each swap
int *size_forward_recv; // # of values to recv in each forward comm
int *size_reverse_send; // # to send in each reverse comm
int *size_reverse_recv; // # to recv in each reverse comm
double *slablo,*slabhi; // bounds of slab to send at each swap
double **multilo,**multihi; // bounds of slabs for multi-type swap
double **cutghostmulti; // cutghost on a per-type basis
int *pbc_flag; // general flag for sending atoms thru PBC
int **pbc; // dimension flags for PBC adjustments
int comm_x_only,comm_f_only; // 1 if only exchange x,f in for/rev comm
int map_style; // non-0 if global->local mapping is done
int bordergroup; // only communicate this group in borders
- int layoutflag; // user-selected layout for 3d proc grid
- int numa_nodes; // layout NUMA-aware 3d proc grid
-
+ int gridflag; // option for creating 3d grid
+ int mapflag; // option for mapping procs to 3d grid
+ char xyz[4]; // xyz mapping of procs to 3d grid
+ char *customfile; // file with custom proc map
+ char *outfile; // proc grid/map output file
+
+ int otherflag; // 1 if this partition dependent on another
+ int other_style; // style of dependency
int other_procgrid[3]; // proc layout of another partition
+ int ncores; // # of cores per node
+ int coregrid[3]; // 3d grid of cores within a node
+ int user_coregrid[3]; // user request for cores in each dim
int *firstrecv; // where to put 1st recv atom in each swap
int **sendlist; // list of atoms to send in each swap
int *maxsendlist; // max size of send list for each swap
double *buf_send; // send buffer for all comm
double *buf_recv; // recv buffer for all comm
int maxsend,maxrecv; // current size of send/recv buffer
int maxforward,maxreverse; // max # of datums in forward/reverse comm
- int procs2box(int, int[3], int[3], // map procs to 3d box
- const int, const int, const int, int);
virtual void grow_send(int,int); // reallocate send buffer
virtual void grow_recv(int); // free/allocate recv buffer
virtual void grow_list(int, int); // reallocate one sendlist
virtual void grow_swap(int); // grow swap and multi arrays
virtual void allocate_swap(int); // allocate swap arrays
virtual void allocate_multi(int); // allocate multi arrays
virtual void free_swap(); // free swap arrays
virtual void free_multi(); // free multi arrays
-
- int numa_set_proc_grid();
- void numa_shift(int, int, int &, int &);
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Bad grid of processors
+
+The 3d grid of processors defined by the processors command does not
+match the number of processors LAMMPS is being run on.
+
+E: Processor count in z must be 1 for 2d simulation
+
+Self-explanatory.
+
+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: Invalid group in communicate command
+
+Self-explanatory.
+
+E: Communicate group != atom_modify first group
+
+Self-explanatory.
+
+E: Invalid cutoff in communicate command
+
+Specified cutoff must be >= 0.0.
+
+E: Cannot use processors part command without using partitions
+
+UNDOCUMENTED
+
+E: Invalid partitions in processors part command
+
+UNDOCUMENTED
+
+E: Sending partition in processors part command is already a sender
+
+UNDOCUMENTED
+
+E: Receiving partition in processors part command is already a receiver
+
+UNDOCUMENTED
+
+E: Processors grid numa and map style are incompatible
+
+UNDOCUMENTED
+
+E: Processors part option and grid style are incompatible
+
+UNDOCUMENTED
+
+*/
diff --git a/src/compute.cpp b/src/compute.cpp
index 5b8dc93f2..b33fe7595 100644
--- a/src/compute.cpp
+++ b/src/compute.cpp
@@ -1,289 +1,291 @@
/* ----------------------------------------------------------------------
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 "lmptype.h"
#include "mpi.h"
#include "stdlib.h"
#include "string.h"
#include "ctype.h"
#include "compute.h"
#include "atom.h"
#include "domain.h"
#include "comm.h"
#include "group.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define DELTA 4
#define BIG 2000000000
/* ---------------------------------------------------------------------- */
Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
{
if (narg < 3) error->all(FLERR,"Illegal compute command");
// compute ID, group, and style
// ID must be all alphanumeric chars or underscores
int n = strlen(arg[0]) + 1;
id = new char[n];
strcpy(id,arg[0]);
for (int i = 0; i < n-1; i++)
if (!isalnum(id[i]) && id[i] != '_')
- error->all(FLERR,"Compute ID must be alphanumeric or underscore characters");
+ error->all(FLERR,
+ "Compute ID must be alphanumeric or underscore characters");
igroup = group->find(arg[1]);
if (igroup == -1) error->all(FLERR,"Could not find compute group ID");
groupbit = group->bitmask[igroup];
n = strlen(arg[2]) + 1;
style = new char[n];
strcpy(style,arg[2]);
// set child class defaults
scalar_flag = vector_flag = array_flag = 0;
peratom_flag = local_flag = 0;
tempflag = pressflag = peflag = 0;
pressatomflag = peatomflag = 0;
tempbias = 0;
timeflag = 0;
comm_forward = comm_reverse = 0;
cudable = 0;
invoked_scalar = invoked_vector = invoked_array = -1;
invoked_peratom = invoked_local = -1;
// set modify defaults
extra_dof = domain->dimension;
dynamic = 0;
// setup list of timesteps
ntime = maxtime = 0;
tlist = NULL;
// setup map for molecule IDs
molmap = NULL;
}
/* ---------------------------------------------------------------------- */
Compute::~Compute()
{
delete [] id;
delete [] style;
memory->destroy(tlist);
memory->destroy(molmap);
}
/* ---------------------------------------------------------------------- */
void Compute::modify_params(int narg, char **arg)
{
if (narg == 0) error->all(FLERR,"Illegal compute_modify command");
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"extra") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command");
extra_dof = atoi(arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"dynamic") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command");
if (strcmp(arg[iarg+1],"no") == 0) dynamic = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) dynamic = 1;
else error->all(FLERR,"Illegal compute_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"thermo") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command");
if (strcmp(arg[iarg+1],"no") == 0) thermoflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) thermoflag = 1;
else error->all(FLERR,"Illegal compute_modify command");
iarg += 2;
} else error->all(FLERR,"Illegal compute_modify command");
}
}
/* ----------------------------------------------------------------------
reset extra_dof to its default value
------------------------------------------------------------------------- */
void Compute::reset_extra_dof()
{
extra_dof = domain->dimension;
}
/* ---------------------------------------------------------------------- */
-void Compute::reset_extra_compute_fix(char *)
+void Compute::reset_extra_compute_fix(const char *)
{
- error->all(FLERR,"Compute does not allow an extra compute or fix to be reset");
+ error->all(FLERR,
+ "Compute does not allow an extra compute or fix to be reset");
}
/* ----------------------------------------------------------------------
add ntimestep to list of timesteps the compute will be called on
do not add if already in list
search from top downward, since list of times is in decreasing order
------------------------------------------------------------------------- */
void Compute::addstep(bigint ntimestep)
{
// i = location in list to insert ntimestep
int i;
for (i = ntime-1; i >= 0; i--) {
if (ntimestep == tlist[i]) return;
if (ntimestep < tlist[i]) break;
}
i++;
// extend list as needed
if (ntime == maxtime) {
maxtime += DELTA;
memory->grow(tlist,maxtime,"compute:tlist");
}
// move remainder of list upward and insert ntimestep
for (int j = ntime-1; j >= i; j--) tlist[j+1] = tlist[j];
tlist[i] = ntimestep;
ntime++;
}
/* ----------------------------------------------------------------------
return 1/0 if ntimestep is or is not in list of calling timesteps
if value(s) on top of list are less than ntimestep, delete them
search from top downward, since list of times is in decreasing order
------------------------------------------------------------------------- */
int Compute::matchstep(bigint ntimestep)
{
for (int i = ntime-1; i >= 0; i--) {
if (ntimestep < tlist[i]) return 0;
if (ntimestep == tlist[i]) return 1;
if (ntimestep > tlist[i]) ntime--;
}
return 0;
}
/* ----------------------------------------------------------------------
clean out list of timesteps to call the compute on
------------------------------------------------------------------------- */
void Compute::clearstep()
{
ntime = 0;
}
/* ----------------------------------------------------------------------
identify molecule IDs with atoms in group
warn if any atom in group has molecule ID = 0
warn if any molecule has only some atoms in group
return Ncount = # of molecules with atoms in group
set molmap to NULL if molecule IDs include all in range from 1 to Ncount
else: molecule IDs range from idlo to idhi
set molmap to vector of length idhi-idlo+1
molmap[id-idlo] = index from 0 to Ncount-1
return idlo and idhi
------------------------------------------------------------------------- */
int Compute::molecules_in_group(int &idlo, int &idhi)
{
int i;
memory->destroy(molmap);
molmap = NULL;
// find lo/hi molecule ID for any atom in group
// warn if atom in group has ID = 0
int *molecule = atom->molecule;
int *mask = atom->mask;
int nlocal = atom->nlocal;
int lo = BIG;
int hi = -BIG;
int flag = 0;
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
if (molecule[i] == 0) flag = 1;
lo = MIN(lo,molecule[i]);
hi = MAX(hi,molecule[i]);
}
int flagall;
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
if (flagall && comm->me == 0)
error->warning(FLERR,"Atom with molecule ID = 0 included in "
"compute molecule group");
MPI_Allreduce(&lo,&idlo,1,MPI_INT,MPI_MIN,world);
MPI_Allreduce(&hi,&idhi,1,MPI_INT,MPI_MAX,world);
if (idlo == BIG) return 0;
// molmap = vector of length nlen
// set to 1 for IDs that appear in group across all procs, else 0
int nlen = idhi-idlo+1;
memory->create(molmap,nlen,"compute:molmap");
for (i = 0; i < nlen; i++) molmap[i] = 0;
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
molmap[molecule[i]-idlo] = 1;
int *molmapall;
memory->create(molmapall,nlen,"compute:molmapall");
MPI_Allreduce(molmap,molmapall,nlen,MPI_INT,MPI_MAX,world);
// nmolecules = # of non-zero IDs in molmap
// molmap[i] = index of molecule, skipping molecules not in group with -1
int nmolecules = 0;
for (i = 0; i < nlen; i++)
if (molmapall[i]) molmap[i] = nmolecules++;
else molmap[i] = -1;
memory->destroy(molmapall);
// warn if any molecule has some atoms in group and some not in group
flag = 0;
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) continue;
if (molecule[i] < idlo || molecule[i] > idhi) continue;
if (molmap[molecule[i]-idlo] >= 0) flag = 1;
}
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
if (flagall && comm->me == 0)
error->warning(FLERR,"One or more compute molecules has atoms not in group");
// if molmap simply stores 1 to Nmolecules, then free it
if (idlo == 1 && idhi == nmolecules && nlen == nmolecules) {
memory->destroy(molmap);
molmap = NULL;
}
return nmolecules;
}
diff --git a/src/compute.h b/src/compute.h
index b0f9709df..e8f185ee2 100644
--- a/src/compute.h
+++ b/src/compute.h
@@ -1,134 +1,169 @@
/* ----------------------------------------------------------------------
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_COMPUTE_H
#define LMP_COMPUTE_H
#include "pointers.h"
namespace LAMMPS_NS {
class Compute : protected Pointers {
public:
char *id,*style;
int igroup,groupbit;
double scalar; // computed global scalar
double *vector; // computed global vector
double **array; // computed global array
double *vector_atom; // computed per-atom vector
double **array_atom; // computed per-atom array
double *vector_local; // computed local vector
double **array_local; // computed local array
int scalar_flag; // 0/1 if compute_scalar() function exists
int vector_flag; // 0/1 if compute_vector() function exists
int array_flag; // 0/1 if compute_array() function exists
int size_vector; // length of global vector
int size_array_rows; // rows in global array
int size_array_cols; // columns in global array
int peratom_flag; // 0/1 if compute_peratom() function exists
int size_peratom_cols; // 0 = vector, N = columns in peratom array
int local_flag; // 0/1 if compute_local() function exists
int size_local_rows; // rows in local vector or array
int size_local_cols; // 0 = vector, N = columns in local array
int extscalar; // 0/1 if global scalar is intensive/extensive
int extvector; // 0/1/-1 if global vector is all int/ext/extlist
int *extlist; // list of 0/1 int/ext for each vec component
int extarray; // 0/1 if global array is all intensive/extensive
int tempflag; // 1 if Compute can be used as temperature
// must have both compute_scalar, compute_vector
int pressflag; // 1 if Compute can be used as pressure (uses virial)
// must have both compute_scalar, compute_vector
int pressatomflag; // 1 if Compute calculates per-atom virial
int peflag; // 1 if Compute calculates PE (uses Force energies)
int peatomflag; // 1 if Compute calculates per-atom PE
int tempbias; // 0/1 if Compute temp includes self/extra bias
int timeflag; // 1 if Compute stores list of timesteps it's called on
int ntime; // # of entries in time list
int maxtime; // max # of entries time list can hold
bigint *tlist; // list of timesteps the Compute is called on
int invoked_flag; // non-zero if invoked or accessed this step, 0 if not
bigint invoked_scalar; // last timestep on which compute_scalar() was invoked
bigint invoked_vector; // ditto for compute_vector()
bigint invoked_array; // ditto for compute_array()
bigint invoked_peratom; // ditto for compute_peratom()
bigint invoked_local; // ditto for compute_local()
double dof; // degrees-of-freedom for temperature
int comm_forward; // size of forward communication (0 if none)
int comm_reverse; // size of reverse communication (0 if none)
int cudable; // 1 if compute is CUDA-enabled
Compute(class LAMMPS *, int, char **);
virtual ~Compute();
void modify_params(int, char **);
void reset_extra_dof();
virtual void init() = 0;
virtual void init_list(int, class NeighList *) {}
virtual double compute_scalar() {return 0.0;}
virtual void compute_vector() {}
virtual void compute_array() {}
virtual void compute_peratom() {}
virtual void compute_local() {}
virtual int pack_comm(int, int *, double *, int, int *) {return 0;}
virtual void unpack_comm(int, int, double *) {}
virtual int pack_reverse_comm(int, int, double *) {return 0;}
virtual void unpack_reverse_comm(int, int *, double *) {}
virtual int dof_remove(int) {return 0;}
virtual void remove_bias(int, double *) {}
virtual void remove_bias_all() {}
virtual void restore_bias(int, double *) {}
virtual void restore_bias_all() {}
- virtual void reset_extra_compute_fix(char *);
+ virtual void reset_extra_compute_fix(const char *);
void addstep(bigint);
int matchstep(bigint);
void clearstep();
virtual double memory_usage() {return 0.0;}
protected:
int extra_dof; // extra DOF for temperature computes
int dynamic; // recount atoms for temperature computes
int thermoflag; // 1 if include fix PE for PE computes
double vbias[3]; // stored velocity bias for one atom
double **vbiasall; // stored velocity bias for all atoms
int maxbias; // size of vbiasall array
int *molmap; // convert molecule ID to local index
int molecules_in_group(int &, int &);
inline int sbmask(int j) {
return j >> SBBITS & 3;
}
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute ID must be alphanumeric or underscore characters
+
+Self-explanatory.
+
+E: Could not find compute group ID
+
+Self-explanatory.
+
+E: Compute does not allow an extra compute or fix to be reset
+
+This is an internal LAMMPS error. Please report it to the
+developers.
+
+W: Atom with molecule ID = 0 included in compute molecule group
+
+The group used in a compute command that operates on moleclues
+includes atoms with no molecule ID. This is probably not what you
+want.
+
+W: One or more compute molecules has atoms not in group
+
+The group used in a compute command that operates on moleclues does
+not include all the atoms in some molecules. This is probably not
+what you want.
+
+*/
diff --git a/src/compute_angle_local.h b/src/compute_angle_local.h
index 0c3ece25d..77858a418 100644
--- a/src/compute_angle_local.h
+++ b/src/compute_angle_local.h
@@ -1,50 +1,72 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(angle/local,ComputeAngleLocal)
#else
#ifndef LMP_COMPUTE_ANGLE_LOCAL_H
#define LMP_COMPUTE_ANGLE_LOCAL_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeAngleLocal : public Compute {
public:
ComputeAngleLocal(class LAMMPS *, int, char **);
~ComputeAngleLocal();
void init();
void compute_local();
double memory_usage();
private:
int nvalues,tflag,eflag;
int ncount;
int nmax;
double *vector;
double **array;
int compute_angles(int);
void reallocate(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute angle/local used when angles are not allowed
+
+The atom style does not support angles.
+
+E: Invalid keyword in compute angle/local command
+
+Self-explanatory.
+
+E: No angle style is defined for compute angle/local
+
+Self-explanatory.
+
+*/
diff --git a/src/compute_atom_molecule.h b/src/compute_atom_molecule.h
index 39acb6a5d..7e87ca7a2 100644
--- a/src/compute_atom_molecule.h
+++ b/src/compute_atom_molecule.h
@@ -1,55 +1,126 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(atom/molecule,ComputeAtomMolecule)
#else
#ifndef LMP_COMPUTE_ATOM_MOLECULE_H
#define LMP_COMPUTE_ATOM_MOLECULE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeAtomMolecule : public Compute {
public:
ComputeAtomMolecule(class LAMMPS *, int, char **);
~ComputeAtomMolecule();
void init();
void compute_vector();
void compute_array();
double memory_usage();
private:
int nvalues,nmolecules;
int idlo,idhi;
int *which,*argindex,*flavor,*value2index;
char **ids;
int nstride,maxatom;
double *vone;
double **aone;
double *scratch;
double *peratom;
void compute_one(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute atom/molecule requires molecular atom style
+
+Self-explanatory.
+
+E: Compute ID for compute atom/molecule does not exist
+
+Self-explanatory.
+
+E: Compute atom/molecule compute does not calculate per-atom values
+
+Self-explanatory.
+
+E: Compute atom/molecule compute does not calculate a per-atom vector
+
+Self-explanatory.
+
+E: Compute atom/molecule compute does not calculate a per-atom array
+
+Self-explanatory.
+
+E: Compute atom/molecule compute array is accessed out-of-range
+
+Self-explanatory.
+
+E: Fix ID for compute atom/molecule does not exist
+
+Self-explanatory.
+
+E: Compute atom/molecule fix does not calculate per-atom values
+
+Self-explanatory.
+
+E: Compute atom/molecule fix does not calculate a per-atom vector
+
+Self-explanatory.
+
+E: Compute atom/molecule fix does not calculate a per-atom array
+
+Self-explanatory.
+
+E: Compute atom/molecule fix array is accessed out-of-range
+
+Self-explanatory.
+
+E: Variable name for compute atom/molecule does not exist
+
+Self-explanatory.
+
+E: Compute atom/molecule variable is not atom-style variable
+
+Self-explanatory.
+
+E: Molecule count changed in compute atom/molecule
+
+Number of molecules must remain constant over time.
+
+E: Fix used in compute atom/molecule not computed at compatible time
+
+The fix must produce per-atom quantities on timesteps that the compute
+needs them.
+
+*/
diff --git a/src/compute_bond_local.h b/src/compute_bond_local.h
index be2724f08..902cd6bac 100644
--- a/src/compute_bond_local.h
+++ b/src/compute_bond_local.h
@@ -1,50 +1,72 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(bond/local,ComputeBondLocal)
#else
#ifndef LMP_COMPUTE_BOND_LOCAL_H
#define LMP_COMPUTE_BOND_LOCAL_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeBondLocal : public Compute {
public:
ComputeBondLocal(class LAMMPS *, int, char **);
~ComputeBondLocal();
void init();
void compute_local();
double memory_usage();
private:
int nvalues,dflag,eflag;
int ncount;
int nmax;
double *vector;
double **array;
int compute_bonds(int);
void reallocate(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute bond/local used when bonds are not allowed
+
+The atom style does not support bonds.
+
+E: Invalid keyword in compute bond/local command
+
+Self-explanatory.
+
+E: No bond style is defined for compute bond/local
+
+Self-explanatory.
+
+*/
diff --git a/src/compute_centro_atom.h b/src/compute_centro_atom.h
index 44553aec6..51a9a1921 100644
--- a/src/compute_centro_atom.h
+++ b/src/compute_centro_atom.h
@@ -1,50 +1,69 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(centro/atom,ComputeCentroAtom)
#else
#ifndef COMPUTE_CENTRO_ATOM_H
#define COMPUTE_CENTRO_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeCentroAtom : public Compute {
public:
ComputeCentroAtom(class LAMMPS *, int, char **);
~ComputeCentroAtom();
void init();
void init_list(int, class NeighList *);
void compute_peratom();
double memory_usage();
private:
int nmax,maxneigh,nnn;
double *distsq;
int *nearest;
class NeighList *list;
double *centro;
void select(int, int, double *);
void select2(int, int, double *, int *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute centro/atom requires a pair style be defined
+
+This is because the computation of the centro-symmetry values
+uses a pairwise neighbor list.
+
+W: More than one compute centro/atom
+
+It is not efficient to use compute centro/atom more than once.
+
+*/
diff --git a/src/compute_cluster_atom.h b/src/compute_cluster_atom.h
index 4b9dd61c9..510d9bf12 100644
--- a/src/compute_cluster_atom.h
+++ b/src/compute_cluster_atom.h
@@ -1,48 +1,75 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(cluster/atom,ComputeClusterAtom)
#else
#ifndef LMP_COMPUTE_CLUSTER_ATOM_H
#define LMP_COMPUTE_CLUSTER_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeClusterAtom : public Compute {
public:
ComputeClusterAtom(class LAMMPS *, int, char **);
~ComputeClusterAtom();
void init();
void init_list(int, class NeighList *);
void compute_peratom();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
double memory_usage();
private:
int nmax;
double cutsq;
class NeighList *list;
double *clusterID;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot use compute cluster/atom unless atoms have IDs
+
+Atom IDs are used to identify clusters.
+
+E: Compute cluster/atom requires a pair style be defined
+
+This is so that the pair style defines a cutoff distance which
+is used to find clusters.
+
+E: Compute cluster/atom cutoff is longer than pairwise cutoff
+
+Cannot identify clusters beyond cutoff.
+
+W: More than one compute cluster/atom
+
+It is not efficient to use compute cluster/atom more than once.
+
+*/
diff --git a/src/compute_cna_atom.h b/src/compute_cna_atom.h
index a9876f42f..3913480dc 100644
--- a/src/compute_cna_atom.h
+++ b/src/compute_cna_atom.h
@@ -1,48 +1,85 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(cna/atom,ComputeCNAAtom)
#else
#ifndef LMP_COMPUTE_CNA_ATOM_H
#define LMP_COMPUTE_CNA_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeCNAAtom : public Compute {
public:
ComputeCNAAtom(class LAMMPS *, int, char **);
~ComputeCNAAtom();
void init();
void init_list(int, class NeighList *);
void compute_peratom();
double memory_usage();
private:
int nmax;
double cutsq;
class NeighList *list;
int **nearest;
int *nnearest;
double *pattern;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute cna/atom requires a pair style be defined
+
+Self-explantory.
+
+E: Compute cna/atom cutoff is longer than pairwise cutoff
+
+Self-explantory.
+
+W: Compute cna/atom cutoff may be too large to find ghost atom neighbors
+
+The neighbor cutoff used may not encompass enough ghost atoms
+to perform this operation correctly.
+
+W: More than one compute cna/atom defined
+
+It is not efficient to use compute cna/atom more than once.
+
+W: Too many neighbors in CNA for %d atoms
+
+More than the maximum # of neighbors was found multiple times. This
+was unexpected.
+
+W: Too many common neighbors in CNA %d times
+
+More than the maximum # of neighbors was found multiple times. This
+was unexpected.
+
+*/
diff --git a/src/compute_com.h b/src/compute_com.h
index 476e599cf..7f4cb82a9 100644
--- a/src/compute_com.h
+++ b/src/compute_com.h
@@ -1,41 +1,51 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(com,ComputeCOM)
#else
#ifndef LMP_COMPUTE_COM_H
#define LMP_COMPUTE_COM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeCOM : public Compute {
public:
ComputeCOM(class LAMMPS *, int, char **);
~ComputeCOM();
void init();
void compute_vector();
private:
double masstotal;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/compute_com_molecule.h b/src/compute_com_molecule.h
index 4e6220d60..80dee0303 100644
--- a/src/compute_com_molecule.h
+++ b/src/compute_com_molecule.h
@@ -1,46 +1,64 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(com/molecule,ComputeCOMMolecule)
#else
#ifndef LMP_COMPUTE_COM_MOLECULE_H
#define LMP_COMPUTE_COM_MOLECULE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeCOMMolecule : public Compute {
public:
ComputeCOMMolecule(class LAMMPS *, int, char **);
~ComputeCOMMolecule();
void init();
void compute_array();
double memory_usage();
private:
int nmolecules;
int idlo,idhi;
double *massproc,*masstotal;
double **com,**comall;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute com/molecule requires molecular atom style
+
+Self-explanatory.
+
+E: Molecule count changed in compute com/molecule
+
+Number of molecules must remain constant over time.
+
+*/
diff --git a/src/compute_coord_atom.h b/src/compute_coord_atom.h
index 82d89961d..b9b7af64c 100644
--- a/src/compute_coord_atom.h
+++ b/src/compute_coord_atom.h
@@ -1,46 +1,69 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(coord/atom,ComputeCoordAtom)
#else
#ifndef LMP_COMPUTE_COORD_ATOM_H
#define LMP_COMPUTE_COORD_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeCoordAtom : public Compute {
public:
ComputeCoordAtom(class LAMMPS *, int, char **);
~ComputeCoordAtom();
void init();
void init_list(int, class NeighList *);
void compute_peratom();
double memory_usage();
private:
int nmax;
double cutsq;
class NeighList *list;
double *coordination;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute coord/atom requires a pair style be defined
+
+Self-explantory.
+
+E: Compute coord/atom cutoff is longer than pairwise cutoff
+
+Cannot compute coordination at distances longer than the pair cutoff,
+since those atoms are not in the neighbor list.
+
+W: More than one compute coord/atom
+
+It is not efficient to use compute coord/atom more than once.
+
+*/
diff --git a/src/compute_dihedral_local.h b/src/compute_dihedral_local.h
index 2683cc477..3aaadb154 100644
--- a/src/compute_dihedral_local.h
+++ b/src/compute_dihedral_local.h
@@ -1,50 +1,72 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(dihedral/local,ComputeDihedralLocal)
#else
#ifndef LMP_COMPUTE_DIHEDRAL_LOCAL_H
#define LMP_COMPUTE_DIHEDRAL_LOCAL_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeDihedralLocal : public Compute {
public:
ComputeDihedralLocal(class LAMMPS *, int, char **);
~ComputeDihedralLocal();
void init();
void compute_local();
double memory_usage();
private:
int nvalues,pflag;
int ncount;
int nmax;
double *vector;
double **array;
int compute_dihedrals(int);
void reallocate(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute dihedral/local used when dihedrals are not allowed
+
+The atom style does not support dihedrals.
+
+E: Invalid keyword in compute dihedral/local command
+
+Self-explanatory.
+
+E: No dihedral style is defined for compute dihedral/local
+
+Self-explanatory.
+
+*/
diff --git a/src/compute_displace_atom.h b/src/compute_displace_atom.h
index 7f43047b1..ba8c8b8f0 100644
--- a/src/compute_displace_atom.h
+++ b/src/compute_displace_atom.h
@@ -1,45 +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.
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(displace/atom,ComputeDisplaceAtom)
#else
#ifndef LMP_COMPUTE_DISPLACE_ATOM_H
#define LMP_COMPUTE_DISPLACE_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeDisplaceAtom : public Compute {
public:
ComputeDisplaceAtom(class LAMMPS *, int, char **);
~ComputeDisplaceAtom();
void init();
void compute_peratom();
double memory_usage();
private:
int nmax;
double **displace;
char *id_fix;
class Fix *fix;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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 compute displace/atom fix ID
+
+Self-explanatory.
+
+*/
diff --git a/src/compute_erotate_sphere.h b/src/compute_erotate_sphere.h
index 7c9d7dd4f..ffb5c683d 100644
--- a/src/compute_erotate_sphere.h
+++ b/src/compute_erotate_sphere.h
@@ -1,41 +1,55 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(erotate/sphere,ComputeERotateSphere)
#else
#ifndef LMP_COMPUTE_EROTATE_SPHERE_H
#define LMP_COMPUTE_EROTATE_SPHERE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeERotateSphere : public Compute {
public:
ComputeERotateSphere(class LAMMPS *, int, char **);
~ComputeERotateSphere() {}
void init();
double compute_scalar();
private:
double pfactor;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute erotate/sphere requires atom style sphere
+
+UNDOCUMENTED
+
+*/
diff --git a/src/compute_group_group.h b/src/compute_group_group.h
index a3e76407e..cddcdda29 100644
--- a/src/compute_group_group.h
+++ b/src/compute_group_group.h
@@ -1,49 +1,72 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(group/group,ComputeGroupGroup)
#else
#ifndef LMP_COMPUTE_GROUP_GROUP_H
#define LMP_COMPUTE_GROUP_GROUP_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeGroupGroup : public Compute {
public:
ComputeGroupGroup(class LAMMPS *, int, char **);
~ComputeGroupGroup();
void init();
void init_list(int, class NeighList *);
double compute_scalar();
void compute_vector();
private:
char *group2;
int jgroup,jgroupbit,othergroupbit;
double **cutsq;
class Pair *pair;
class NeighList *list;
void interact();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute group/group group ID does not exist
+
+Self-explanatory.
+
+E: No pair style defined for compute group/group
+
+Cannot calculate group interactions without a pair style defined.
+
+E: Pair style does not support compute group/group
+
+The pair_style does not have a single() function, so it cannot be
+invokded by the compute group/group command.
+
+*/
diff --git a/src/compute_gyration.h b/src/compute_gyration.h
index d24a88914..9ecab47ee 100644
--- a/src/compute_gyration.h
+++ b/src/compute_gyration.h
@@ -1,41 +1,51 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(gyration,ComputeGyration)
#else
#ifndef LMP_COMPUTE_GYRATION_H
#define LMP_COMPUTE_GYRATION_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeGyration : public Compute {
public:
ComputeGyration(class LAMMPS *, int, char **);
~ComputeGyration() {}
void init();
double compute_scalar();
private:
double masstotal;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/compute_gyration_molecule.h b/src/compute_gyration_molecule.h
index ae720048e..952feb211 100644
--- a/src/compute_gyration_molecule.h
+++ b/src/compute_gyration_molecule.h
@@ -1,47 +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 COMPUTE_CLASS
ComputeStyle(gyration/molecule,ComputeGyrationMolecule)
#else
#ifndef LMP_COMPUTE_GYRATION_MOLECULE_H
#define LMP_COMPUTE_GYRATION_MOLECULE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeGyrationMolecule : public Compute {
public:
ComputeGyrationMolecule(class LAMMPS *, int, char **);
~ComputeGyrationMolecule();
void init();
void compute_vector();
double memory_usage();
private:
int nmolecules;
int idlo,idhi;
double *massproc,*masstotal;
double **com,**comall;
double *rg,*rgall;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute gyration/molecule requires molecular atom style
+
+Self-explanatory.
+
+E: Molecule count changed in compute gyration/molecule
+
+Number of molecules must remain constant over time.
+
+*/
diff --git a/src/compute_heat_flux.h b/src/compute_heat_flux.h
index 2994b1e9a..26c5a9e77 100644
--- a/src/compute_heat_flux.h
+++ b/src/compute_heat_flux.h
@@ -1,42 +1,68 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(heat/flux,ComputeHeatFlux)
#else
#ifndef LMP_COMPUTE_HEAT_FLUX_H
#define LMP_COMPUTE_HEAT_FLUX_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeHeatFlux : public Compute {
public:
ComputeHeatFlux(class LAMMPS *, int, char **);
~ComputeHeatFlux();
void init();
void compute_vector();
private:
char *id_ke,*id_pe,*id_stress;
class Compute *c_ke,*c_pe,*c_stress;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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 compute heat/flux compute ID
+
+Self-explanatory.
+
+E: Compute heat/flux compute ID does not compute ke/atom
+
+Self-explanatory.
+
+E: Compute heat/flux compute ID does not compute pe/atom
+
+Self-explanatory.
+
+E: Compute heat/flux compute ID does not compute stress/atom
+
+Self-explanatory.
+
+*/
diff --git a/src/compute_improper_local.h b/src/compute_improper_local.h
index fa97afc71..60028bdb8 100644
--- a/src/compute_improper_local.h
+++ b/src/compute_improper_local.h
@@ -1,50 +1,72 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(improper/local,ComputeImproperLocal)
#else
#ifndef LMP_COMPUTE_IMPROPER_LOCAL_H
#define LMP_COMPUTE_IMPROPER_LOCAL_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeImproperLocal : public Compute {
public:
ComputeImproperLocal(class LAMMPS *, int, char **);
~ComputeImproperLocal();
void init();
void compute_local();
double memory_usage();
private:
int nvalues,cflag;
int ncount;
int nmax;
double *vector;
double **array;
int compute_impropers(int);
void reallocate(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute improper/local used when impropers are not allowed
+
+The atom style does not support impropers.
+
+E: Invalid keyword in compute improper/local command
+
+Self-explanatory.
+
+E: No improper style is defined for compute improper/local
+
+Self-explanatory.
+
+*/
diff --git a/src/compute_ke.h b/src/compute_ke.h
index 188debb3c..7bb4b4cfa 100644
--- a/src/compute_ke.h
+++ b/src/compute_ke.h
@@ -1,40 +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.
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(ke,ComputeKE)
#else
#ifndef LMP_COMPUTE_KE_H
#define LMP_COMPUTE_KE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeKE : public Compute {
public:
ComputeKE(class LAMMPS *, int, char **);
void init();
double compute_scalar();
private:
double pfactor;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/compute_ke_atom.h b/src/compute_ke_atom.h
index 7057dc33e..9a1265402 100644
--- a/src/compute_ke_atom.h
+++ b/src/compute_ke_atom.h
@@ -1,43 +1,57 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(ke/atom,ComputeKEAtom)
#else
#ifndef LMP_COMPUTE_KE_ATOM_H
#define LMP_COMPUTE_KE_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeKEAtom : public Compute {
public:
ComputeKEAtom(class LAMMPS *, int, char **);
~ComputeKEAtom();
void init();
void compute_peratom();
double memory_usage();
private:
int nmax;
double *ke;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+W: More than one compute ke/atom
+
+It is not efficient to use compute ke/atom more than once.
+
+*/
diff --git a/src/compute_msd.h b/src/compute_msd.h
index b93511abe..f4cc93d50 100644
--- a/src/compute_msd.h
+++ b/src/compute_msd.h
@@ -1,44 +1,58 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(msd,ComputeMSD)
#else
#ifndef LMP_COMPUTE_MSD_H
#define LMP_COMPUTE_MSD_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeMSD : public Compute {
public:
ComputeMSD(class LAMMPS *, int, char **);
~ComputeMSD();
void init();
void compute_vector();
private:
int comflag,nmsd;
double masstotal;
char *id_fix;
class Fix *fix;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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 compute msd fix ID
+
+Self-explanatory.
+
+*/
diff --git a/src/compute_msd_molecule.h b/src/compute_msd_molecule.h
index a31e0e614..3c1a59f6e 100644
--- a/src/compute_msd_molecule.h
+++ b/src/compute_msd_molecule.h
@@ -1,48 +1,66 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(msd/molecule,ComputeMSDMolecule)
#else
#ifndef LMP_COMPUTE_MSD_MOLECULE_H
#define LMP_COMPUTE_MSD_MOLECULE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeMSDMolecule : public Compute {
public:
ComputeMSDMolecule(class LAMMPS *, int, char **);
~ComputeMSDMolecule();
void init();
void compute_array();
double memory_usage();
private:
int nmolecules;
int idlo,idhi;
int firstflag;
double *massproc,*masstotal;
double **com,**comall,**cominit;
double **msd;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute msd/molecule requires molecular atom style
+
+Self-explanatory.
+
+E: Molecule count changed in compute msd/molecule
+
+Number of molecules must remain constant over time.
+
+*/
diff --git a/src/compute_pair.h b/src/compute_pair.h
index cf0e955ad..ff37eb6e0 100644
--- a/src/compute_pair.h
+++ b/src/compute_pair.h
@@ -1,45 +1,69 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(pair,ComputePair)
#else
#ifndef LMP_COMPUTE_PAIR_H
#define LMP_COMPUTE_PAIR_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputePair : public Compute {
public:
ComputePair(class LAMMPS *, int, char **);
~ComputePair();
void init();
double compute_scalar();
void compute_vector();
private:
int evalue,npair;
char *pstyle;
class Pair *pair;
double *one;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute pair must use group all
+
+Pair styles accumlate energy on all atoms.
+
+E: Unrecognized pair style in compute pair command
+
+Self-explanatory.
+
+E: Energy was not tallied on needed timestep
+
+You are using a thermo keyword that requires potentials to
+have tallied energy, but they didn't on this timestep. See the
+variable doc page for ideas on how to make this work.
+
+*/
diff --git a/src/compute_pair_local.h b/src/compute_pair_local.h
index aaa8cdf4c..bf399002d 100644
--- a/src/compute_pair_local.h
+++ b/src/compute_pair_local.h
@@ -1,57 +1,84 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(pair/local,ComputePairLocal)
#else
#ifndef LMP_COMPUTE_PAIR_LOCAL_H
#define LMP_COMPUTE_PAIR_LOCAL_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputePairLocal : public Compute {
public:
ComputePairLocal(class LAMMPS *, int, char **);
~ComputePairLocal();
void init();
void init_list(int, class NeighList *);
void compute_local();
double memory_usage();
private:
int nvalues,dflag,eflag,fflag;
int ncount;
int *pstyle; // style of each requested output
int *pindex; // for pI, index of the output (0 to M-1)
int singleflag;
int nmax;
double *vector;
double **array;
class NeighList *list;
int compute_pairs(int);
void reallocate(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Invalid keyword in compute pair/local command
+
+Self-explanatory.
+
+E: No pair style is defined for compute pair/local
+
+Self-explanatory.
+
+E: Pair style does not support compute pair/local
+
+The pair style does not have a single() function, so it can
+not be invoked by fix bond/swap.
+
+E: Pair style does not have single field requested by compute pair/local
+
+UNDOCUMENTED
+
+*/
diff --git a/src/compute_pe.h b/src/compute_pe.h
index 47162d084..e4a45a485 100644
--- a/src/compute_pe.h
+++ b/src/compute_pe.h
@@ -1,41 +1,62 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(pe,ComputePE)
#else
#ifndef LMP_COMPUTE_PE_H
#define LMP_COMPUTE_PE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputePE : public Compute {
public:
ComputePE(class LAMMPS *, int, char **);
~ComputePE() {}
void init() {}
double compute_scalar();
private:
int pairflag,bondflag,angleflag,dihedralflag,improperflag,kspaceflag;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute pe must use group all
+
+Energies computed by potentials (pair, bond, etc) are computed on all
+atoms.
+
+E: Energy was not tallied on needed timestep
+
+You are using a thermo keyword that requires potentials to
+have tallied energy, but they didn't on this timestep. See the
+variable doc page for ideas on how to make this work.
+
+*/
diff --git a/src/compute_pe_atom.h b/src/compute_pe_atom.h
index c53eeaca8..f4990a439 100644
--- a/src/compute_pe_atom.h
+++ b/src/compute_pe_atom.h
@@ -1,46 +1,62 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(pe/atom,ComputePEAtom)
#else
#ifndef LMP_COMPUTE_PE_ATOM_H
#define LMP_COMPUTE_PE_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputePEAtom : public Compute {
public:
ComputePEAtom(class LAMMPS *, int, char **);
~ComputePEAtom();
void init() {}
void compute_peratom();
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();
private:
int pairflag,bondflag,angleflag,dihedralflag,improperflag;
int nmax;
double *energy;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Per-atom energy was not tallied on needed timestep
+
+You are using a thermo keyword that requires potentials to
+have tallied energy, but they didn't on this timestep. See the
+variable doc page for ideas on how to make this work.
+
+*/
diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp
index edd6910cc..5f981db3c 100644
--- a/src/compute_pressure.cpp
+++ b/src/compute_pressure.cpp
@@ -1,286 +1,286 @@
/* ----------------------------------------------------------------------
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 "mpi.h"
#include "string.h"
#include "stdlib.h"
#include "compute_pressure.h"
#include "atom.h"
#include "update.h"
#include "domain.h"
#include "modify.h"
#include "fix.h"
#include "force.h"
#include "pair.h"
#include "bond.h"
#include "angle.h"
#include "dihedral.h"
#include "improper.h"
#include "kspace.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal compute pressure command");
if (igroup) error->all(FLERR,"Compute pressure must use group all");
scalar_flag = vector_flag = 1;
size_vector = 6;
extscalar = 0;
extvector = 0;
pressflag = 1;
timeflag = 1;
// store temperature ID used by pressure computation
// insure it is valid for temperature computation
int n = strlen(arg[3]) + 1;
id_temp = new char[n];
strcpy(id_temp,arg[3]);
int icompute = modify->find_compute(id_temp);
if (icompute < 0)
error->all(FLERR,"Could not find compute pressure temperature ID");
if (modify->compute[icompute]->tempflag == 0)
error->all(FLERR,"Compute pressure temperature ID does not compute temperature");
// process optional args
if (narg == 4) {
keflag = 1;
pairflag = 1;
bondflag = angleflag = dihedralflag = improperflag = 1;
kspaceflag = fixflag = 1;
} else {
keflag = 0;
pairflag = 0;
bondflag = angleflag = dihedralflag = improperflag = 0;
kspaceflag = fixflag = 0;
int iarg = 4;
while (iarg < narg) {
if (strcmp(arg[iarg],"ke") == 0) keflag = 1;
else if (strcmp(arg[iarg],"pair") == 0) pairflag = 1;
else if (strcmp(arg[iarg],"bond") == 0) bondflag = 1;
else if (strcmp(arg[iarg],"angle") == 0) angleflag = 1;
else if (strcmp(arg[iarg],"dihedral") == 0) dihedralflag = 1;
else if (strcmp(arg[iarg],"improper") == 0) improperflag = 1;
else if (strcmp(arg[iarg],"kspace") == 0) kspaceflag = 1;
else if (strcmp(arg[iarg],"fix") == 0) fixflag = 1;
else if (strcmp(arg[iarg],"virial") == 0) {
pairflag = 1;
bondflag = angleflag = dihedralflag = improperflag = 1;
kspaceflag = fixflag = 1;
} else error->all(FLERR,"Illegal compute pressure command");
iarg++;
}
}
vector = new double[6];
nvirial = 0;
vptr = NULL;
}
/* ---------------------------------------------------------------------- */
ComputePressure::~ComputePressure()
{
delete [] id_temp;
delete [] vector;
delete [] vptr;
}
/* ---------------------------------------------------------------------- */
void ComputePressure::init()
{
boltz = force->boltz;
nktv2p = force->nktv2p;
dimension = domain->dimension;
// set temperature compute, must be done in init()
// fixes could have changed or compute_modify could have changed it
int icompute = modify->find_compute(id_temp);
if (icompute < 0)
error->all(FLERR,"Could not find compute pressure temperature ID");
temperature = modify->compute[icompute];
// detect contributions to virial
// vptr points to all virial[6] contributions
delete [] vptr;
nvirial = 0;
vptr = NULL;
if (pairflag && force->pair) nvirial++;
if (bondflag && atom->molecular && force->bond) nvirial++;
if (angleflag && atom->molecular && force->angle) nvirial++;
if (dihedralflag && atom->molecular && force->dihedral) nvirial++;
if (improperflag && atom->molecular && force->improper) nvirial++;
if (fixflag)
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->virial_flag) nvirial++;
if (nvirial) {
vptr = new double*[nvirial];
nvirial = 0;
if (pairflag && force->pair) vptr[nvirial++] = force->pair->virial;
if (bondflag && force->bond) vptr[nvirial++] = force->bond->virial;
if (angleflag && force->angle) vptr[nvirial++] = force->angle->virial;
if (dihedralflag && force->dihedral)
vptr[nvirial++] = force->dihedral->virial;
if (improperflag && force->improper)
vptr[nvirial++] = force->improper->virial;
if (fixflag)
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->virial_flag)
vptr[nvirial++] = modify->fix[i]->virial;
}
// flag Kspace contribution separately, since not summed across procs
if (kspaceflag && force->kspace) kspace_virial = force->kspace->virial;
else kspace_virial = NULL;
}
/* ----------------------------------------------------------------------
compute total pressure, averaged over Pxx, Pyy, Pzz
------------------------------------------------------------------------- */
double ComputePressure::compute_scalar()
{
invoked_scalar = update->ntimestep;
if (update->vflag_global != invoked_scalar)
error->all(FLERR,"Virial was not tallied on needed timestep");
// invoke temperature it it hasn't been already
double t;
if (keflag) {
if (temperature->invoked_scalar != update->ntimestep)
t = temperature->compute_scalar();
else t = temperature->scalar;
}
if (dimension == 3) {
inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd);
virial_compute(3,3);
if (keflag)
scalar = (temperature->dof * boltz * t +
virial[0] + virial[1] + virial[2]) / 3.0 * inv_volume * nktv2p;
else
scalar = (virial[0] + virial[1] + virial[2]) / 3.0 * inv_volume * nktv2p;
} else {
inv_volume = 1.0 / (domain->xprd * domain->yprd);
virial_compute(2,2);
if (keflag)
scalar = (temperature->dof * boltz * t +
virial[0] + virial[1]) / 2.0 * inv_volume * nktv2p;
else
scalar = (virial[0] + virial[1]) / 2.0 * inv_volume * nktv2p;
}
return scalar;
}
/* ----------------------------------------------------------------------
compute pressure tensor
assume KE tensor has already been computed
------------------------------------------------------------------------- */
void ComputePressure::compute_vector()
{
invoked_vector = update->ntimestep;
if (update->vflag_global != invoked_vector)
error->all(FLERR,"Virial was not tallied on needed timestep");
// invoke temperature if it hasn't been already
double *ke_tensor;
if (keflag) {
if (temperature->invoked_vector != update->ntimestep)
temperature->compute_vector();
ke_tensor = temperature->vector;
}
if (dimension == 3) {
inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd);
virial_compute(6,3);
if (keflag) {
for (int i = 0; i < 6; i++)
vector[i] = (ke_tensor[i] + virial[i]) * inv_volume * nktv2p;
} else
for (int i = 0; i < 6; i++)
vector[i] = virial[i] * inv_volume * nktv2p;
} else {
inv_volume = 1.0 / (domain->xprd * domain->yprd);
virial_compute(4,2);
if (keflag) {
vector[0] = (ke_tensor[0] + virial[0]) * inv_volume * nktv2p;
vector[1] = (ke_tensor[1] + virial[1]) * inv_volume * nktv2p;
vector[3] = (ke_tensor[3] + virial[3]) * inv_volume * nktv2p;
vector[2] = vector[4] = vector[5] = 0.0;
} else {
vector[0] = virial[0] * inv_volume * nktv2p;
vector[1] = virial[1] * inv_volume * nktv2p;
vector[3] = virial[3] * inv_volume * nktv2p;
vector[2] = vector[4] = vector[5] = 0.0;
}
}
}
/* ---------------------------------------------------------------------- */
void ComputePressure::virial_compute(int n, int ndiag)
{
int i,j;
double v[6],*vcomponent;
for (i = 0; i < n; i++) v[i] = 0.0;
// sum contributions to virial from forces and fixes
for (j = 0; j < nvirial; j++) {
vcomponent = vptr[j];
for (i = 0; i < n; i++) v[i] += vcomponent[i];
}
// sum virial across procs
MPI_Allreduce(v,virial,n,MPI_DOUBLE,MPI_SUM,world);
// KSpace virial contribution is already summed across procs
if (kspace_virial)
for (i = 0; i < n; i++) virial[i] += kspace_virial[i];
// LJ long-range tail correction
if (force->pair && force->pair->tail_flag)
for (i = 0; i < ndiag; i++) virial[i] += force->pair->ptail * inv_volume;
}
/* ---------------------------------------------------------------------- */
-void ComputePressure::reset_extra_compute_fix(char *id_new)
+void ComputePressure::reset_extra_compute_fix(const char *id_new)
{
delete [] id_temp;
int n = strlen(id_new) + 1;
id_temp = new char[n];
strcpy(id_temp,id_new);
}
diff --git a/src/compute_pressure.h b/src/compute_pressure.h
index cab96ae61..ab5948114 100644
--- a/src/compute_pressure.h
+++ b/src/compute_pressure.h
@@ -1,53 +1,83 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(pressure,ComputePressure)
#else
#ifndef LMP_COMPUTE_PRESSURE_H
#define LMP_COMPUTE_PRESSURE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputePressure : public Compute {
public:
ComputePressure(class LAMMPS *, int, char **);
virtual ~ComputePressure();
void init();
double compute_scalar();
void compute_vector();
- void reset_extra_compute_fix(char *);
+ void reset_extra_compute_fix(const char *);
protected:
double boltz,nktv2p,inv_volume;
int nvirial,dimension;
double **vptr;
double *kspace_virial;
Compute *temperature;
char *id_temp;
double virial[6];
int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag;
int fixflag,kspaceflag;
void virial_compute(int, int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute pressure must use group all
+
+Virial contributions computed by potentials (pair, bond, etc) are
+computed on all atoms.
+
+E: Could not find compute pressure temperature ID
+
+The compute ID for calculating temperature does not exist.
+
+E: Compute pressure temperature ID does not compute temperature
+
+The compute ID assigned to a pressure computation must compute
+temperature.
+
+E: Virial was not tallied on needed timestep
+
+You are using a thermo keyword that requires potentials to
+have tallied the virial, but they didn't on this timestep. See the
+variable doc page for ideas on how to make this work.
+
+*/
diff --git a/src/compute_property_atom.h b/src/compute_property_atom.h
index 8f675b620..41f17b46f 100644
--- a/src/compute_property_atom.h
+++ b/src/compute_property_atom.h
@@ -1,126 +1,144 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(property/atom,ComputePropertyAtom)
#else
#ifndef LMP_COMPUTE_PROPERTY_ATOM_H
#define LMP_COMPUTE_PROPERTY_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputePropertyAtom : public Compute {
public:
ComputePropertyAtom(class LAMMPS *, int, char **);
~ComputePropertyAtom();
void init() {}
void compute_peratom();
double memory_usage();
private:
int nvalues;
int nmax;
double *vector;
double **array;
double *buf;
class AtomVecEllipsoid *avec_ellipsoid;
class AtomVecLine *avec_line;
class AtomVecTri *avec_tri;
typedef void (ComputePropertyAtom::*FnPtrPack)(int);
FnPtrPack *pack_choice; // ptrs to pack functions
void pack_id(int);
void pack_molecule(int);
void pack_type(int);
void pack_mass(int);
void pack_x(int);
void pack_y(int);
void pack_z(int);
void pack_xs(int);
void pack_ys(int);
void pack_zs(int);
void pack_xs_triclinic(int);
void pack_ys_triclinic(int);
void pack_zs_triclinic(int);
void pack_xu(int);
void pack_yu(int);
void pack_zu(int);
void pack_xu_triclinic(int);
void pack_yu_triclinic(int);
void pack_zu_triclinic(int);
void pack_ix(int);
void pack_iy(int);
void pack_iz(int);
void pack_vx(int);
void pack_vy(int);
void pack_vz(int);
void pack_fx(int);
void pack_fy(int);
void pack_fz(int);
void pack_q(int);
void pack_mux(int);
void pack_muy(int);
void pack_muz(int);
void pack_mu(int);
void pack_radius(int);
void pack_diameter(int);
void pack_omegax(int);
void pack_omegay(int);
void pack_omegaz(int);
void pack_angmomx(int);
void pack_angmomy(int);
void pack_angmomz(int);
void pack_shapex(int);
void pack_shapey(int);
void pack_shapez(int);
void pack_quatw(int);
void pack_quati(int);
void pack_quatj(int);
void pack_quatk(int);
void pack_tqx(int);
void pack_tqy(int);
void pack_tqz(int);
void pack_spin(int);
void pack_eradius(int);
void pack_ervel(int);
void pack_erforce(int);
void pack_end1x(int);
void pack_end1y(int);
void pack_end1z(int);
void pack_end2x(int);
void pack_end2y(int);
void pack_end2z(int);
void pack_corner1x(int);
void pack_corner1y(int);
void pack_corner1z(int);
void pack_corner2x(int);
void pack_corner2y(int);
void pack_corner2z(int);
void pack_corner3x(int);
void pack_corner3y(int);
void pack_corner3z(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute property/atom for atom property that isn't allocated
+
+Self-explanatory.
+
+E: Invalid keyword in compute property/atom command
+
+Self-explanatory.
+
+*/
diff --git a/src/compute_property_local.h b/src/compute_property_local.h
index 7517c674b..d7a2d6a61 100644
--- a/src/compute_property_local.h
+++ b/src/compute_property_local.h
@@ -1,87 +1,119 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(property/local,ComputePropertyLocal)
#else
#ifndef LMP_COMPUTE_PROPERTY_LOCAL_H
#define LMP_COMPUTE_PROPERTY_LOCAL_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputePropertyLocal : public Compute {
public:
ComputePropertyLocal(class LAMMPS *, int, char **);
~ComputePropertyLocal();
void init();
void init_list(int, class NeighList *);
void compute_local();
double memory_usage();
private:
int nvalues,kindflag;
int nmax;
double *vector;
double **array;
double *buf;
class NeighList *list;
int ncount;
int **indices;
int count_pairs(int, int);
int count_bonds(int);
int count_angles(int);
int count_dihedrals(int);
int count_impropers(int);
void reallocate(int);
typedef void (ComputePropertyLocal::*FnPtrPack)(int);
FnPtrPack *pack_choice; // ptrs to pack functions
void pack_patom1(int);
void pack_patom2(int);
void pack_batom1(int);
void pack_batom2(int);
void pack_btype(int);
void pack_aatom1(int);
void pack_aatom2(int);
void pack_aatom3(int);
void pack_atype(int);
void pack_datom1(int);
void pack_datom2(int);
void pack_datom3(int);
void pack_datom4(int);
void pack_dtype(int);
void pack_iatom1(int);
void pack_iatom2(int);
void pack_iatom3(int);
void pack_iatom4(int);
void pack_itype(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute property/local cannot use these inputs together
+
+Only inputs that generate the same number of datums can be used
+togther. E.g. bond and angle quantities cannot be mixed.
+
+E: Invalid keyword in compute property/local command
+
+Self-explanatory.
+
+E: Compute property/local for property that isn't allocated
+
+Self-explanatory.
+
+E: No pair style is defined for compute property/local
+
+Self-explanatory.
+
+E: Pair style does not support compute property/local
+
+The pair style does not have a single() function, so it can
+not be invoked by fix bond/swap.
+
+*/
diff --git a/src/compute_property_molecule.h b/src/compute_property_molecule.h
index 4317c67f6..9c79e93bc 100644
--- a/src/compute_property_molecule.h
+++ b/src/compute_property_molecule.h
@@ -1,52 +1,74 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(property/molecule,ComputePropertyMolecule)
#else
#ifndef LMP_COMPUTE_PROPERTY_MOLECULE_H
#define LMP_COMPUTE_PROPERTY_MOLECULE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputePropertyMolecule : public Compute {
public:
ComputePropertyMolecule(class LAMMPS *, int, char **);
~ComputePropertyMolecule();
void init();
void compute_vector();
void compute_array();
double memory_usage();
private:
int nvalues,nmolecules;
int idlo,idhi;
double *buf;
typedef void (ComputePropertyMolecule::*FnPtrPack)(int);
FnPtrPack *pack_choice; // ptrs to pack functions
void pack_mol(int);
void pack_count(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute property/molecule requires molecular atom style
+
+Self-explanatory.
+
+E: Invalid keyword in compute property/molecule command
+
+Self-explanatory.
+
+E: Molecule count changed in compute property/molecule
+
+Number of molecules must remain constant over time.
+
+*/
diff --git a/src/compute_rdf.h b/src/compute_rdf.h
index 03f74621c..5255abdc5 100644
--- a/src/compute_rdf.h
+++ b/src/compute_rdf.h
@@ -1,56 +1,70 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(rdf,ComputeRDF)
#else
#ifndef LMP_COMPUTE_RDF_H
#define LMP_COMPUTE_RDF_H
#include "stdio.h"
#include "compute.h"
namespace LAMMPS_NS {
class ComputeRDF : public Compute {
public:
ComputeRDF(class LAMMPS *, int, char **);
~ComputeRDF();
void init();
void init_list(int, class NeighList *);
void compute_array();
private:
int first;
int nbin; // # of rdf bins
int npairs; // # of rdf pairs
double delr,delrinv; // bin width and its inverse
int ***rdfpair; // map 2 type pair to rdf pair for each histo
int **nrdfpair; // # of histograms for each type pair
int *ilo,*ihi,*jlo,*jhi;
double **hist; // histogram bins
double **histall; // summed histogram bins across all procs
int *typecount;
int *icount,*jcount;
class NeighList *list; // half neighbor list
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute rdf requires a pair style be defined
+
+Self-explanatory.
+
+*/
diff --git a/src/compute_reduce.h b/src/compute_reduce.h
index 4cf8ee513..6fcded7e3 100644
--- a/src/compute_reduce.h
+++ b/src/compute_reduce.h
@@ -1,63 +1,154 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(reduce,ComputeReduce)
#else
#ifndef LMP_COMPUTE_REDUCE_H
#define LMP_COMPUTE_REDUCE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeReduce : public Compute {
public:
ComputeReduce(class LAMMPS *, int, char **);
virtual ~ComputeReduce();
void init();
double compute_scalar();
void compute_vector();
double memory_usage();
protected:
int me;
int mode,nvalues,iregion;
int *which,*argindex,*flavor,*value2index;
char **ids;
double *onevec;
int *replace,*indices,*owner;
int index;
char *idregion;
int maxatom;
double *varatom;
struct Pair {
double value;
int proc;
};
Pair pairme,pairall;
virtual double compute_one(int, int);
virtual bigint count(int);
void combine(double &, double, int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Region ID for compute reduce/region does not exist
+
+Self-explanatory.
+
+E: Compute reduce replace requires min or max mode
+
+Self-explanatory.
+
+E: Invalid replace values in compute reduce
+
+Self-explanatory.
+
+E: Compute ID for compute reduce does not exist
+
+Self-explanatory.
+
+E: Compute reduce compute does not calculate a per-atom vector
+
+Self-explanatory.
+
+E: Compute reduce compute does not calculate a per-atom array
+
+Self-explanatory.
+
+E: Compute reduce compute array is accessed out-of-range
+
+Self-explanatory.
+
+E: Compute reduce compute does not calculate a local vector
+
+Self-explanatory.
+
+E: Compute reduce compute does not calculate a local array
+
+Self-explanatory.
+
+E: Compute reduce compute calculates global values
+
+A compute that calculates peratom or local values is required.
+
+E: Fix ID for compute reduce does not exist
+
+Self-explanatory.
+
+E: Compute reduce fix does not calculate a per-atom vector
+
+Self-explanatory.
+
+E: Compute reduce fix does not calculate a per-atom array
+
+Self-explanatory.
+
+E: Compute reduce fix array is accessed out-of-range
+
+Self-explanatory.
+
+E: Compute reduce fix does not calculate a local vector
+
+Self-explanatory.
+
+E: Compute reduce fix does not calculate a local array
+
+Self-explanatory.
+
+E: Compute reduce fix calculates global values
+
+A fix that calculates peratom or local values is required.
+
+E: Variable name for compute reduce does not exist
+
+Self-explanatory.
+
+E: Compute reduce variable is not atom-style variable
+
+Self-explanatory.
+
+E: Fix used in compute reduce not computed at compatible time
+
+Fixes generate their values on specific timesteps. Compute sum is
+requesting a value on a non-allowed timestep.
+
+*/
diff --git a/src/compute_reduce_region.h b/src/compute_reduce_region.h
index 37abb3ea9..d57a20d05 100644
--- a/src/compute_reduce_region.h
+++ b/src/compute_reduce_region.h
@@ -1,40 +1,49 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(reduce/region,ComputeReduceRegion)
#else
#ifndef LMP_COMPUTE_REDUCE_REGION_H
#define LMP_COMPUTE_REDUCE_REGION_H
#include "compute_reduce.h"
namespace LAMMPS_NS {
class ComputeReduceRegion : public ComputeReduce {
public:
ComputeReduceRegion(class LAMMPS *, int, char **);
~ComputeReduceRegion() {}
private:
double compute_one(int, int);
bigint count(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Fix used in compute reduce not computed at compatible time
+
+Fixes generate their values on specific timesteps. Compute sum is
+requesting a value on a non-allowed timestep.
+
+*/
diff --git a/src/compute_slice.h b/src/compute_slice.h
index e80cb7139..3acd5c966 100644
--- a/src/compute_slice.h
+++ b/src/compute_slice.h
@@ -1,47 +1,109 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(slice,ComputeSlice)
#else
#ifndef LMP_COMPUTE_SLICE_H
#define LMP_COMPUTE_SLICE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeSlice : public Compute {
public:
ComputeSlice(class LAMMPS *, int, char **);
virtual ~ComputeSlice();
void init();
void compute_vector();
void compute_array();
private:
int me;
int nstart,nstop,nskip,nvalues;
int *which,*argindex,*value2index;
char **ids;
void extract_one(int, double *, int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute ID for compute slice does not exist
+
+UNDOCUMENTED
+
+E: Compute slice compute does not calculate a global array
+
+UNDOCUMENTED
+
+E: Compute slice compute vector is accessed out-of-range
+
+UNDOCUMENTED
+
+E: Compute slice compute does not calculate a global vector
+
+UNDOCUMENTED
+
+E: Compute slice compute array is accessed out-of-range
+
+UNDOCUMENTED
+
+E: Compute slice compute does not calculate global vector or array
+
+UNDOCUMENTED
+
+E: Fix ID for compute slice does not exist
+
+UNDOCUMENTED
+
+E: Compute slice fix does not calculate a global array
+
+UNDOCUMENTED
+
+E: Compute slice fix vector is accessed out-of-range
+
+UNDOCUMENTED
+
+E: Compute slice fix does not calculate a global vector
+
+UNDOCUMENTED
+
+E: Compute slice fix array is accessed out-of-range
+
+UNDOCUMENTED
+
+E: Compute slice fix does not calculate global vector or array
+
+UNDOCUMENTED
+
+E: Fix used in compute slice not computed at compatible time
+
+UNDOCUMENTED
+
+*/
diff --git a/src/compute_stress_atom.h b/src/compute_stress_atom.h
index f988a2803..641fe3840 100644
--- a/src/compute_stress_atom.h
+++ b/src/compute_stress_atom.h
@@ -1,46 +1,62 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(stress/atom,ComputeStressAtom)
#else
#ifndef LMP_COMPUTE_STRESS_ATOM_H
#define LMP_COMPUTE_STRESS_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeStressAtom : public Compute {
public:
ComputeStressAtom(class LAMMPS *, int, char **);
~ComputeStressAtom();
void init() {}
void compute_peratom();
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();
private:
int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag,fixflag;
int nmax;
double **stress;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Per-atom virial was not tallied on needed timestep
+
+You are using a thermo keyword that requires potentials to have
+tallied the virial, but they didn't on this timestep. See the
+variable doc page for ideas on how to make this work.
+
+*/
diff --git a/src/compute_temp.h b/src/compute_temp.h
index 3d3c030b6..7e201f871 100644
--- a/src/compute_temp.h
+++ b/src/compute_temp.h
@@ -1,45 +1,55 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(temp,ComputeTemp)
#else
#ifndef LMP_COMPUTE_TEMP_H
#define LMP_COMPUTE_TEMP_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeTemp : public Compute {
public:
ComputeTemp(class LAMMPS *, int, char **);
virtual ~ComputeTemp();
void init();
double compute_scalar();
void compute_vector();
protected:
int fix_dof;
double tfactor;
virtual void dof_compute();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/compute_temp_com.h b/src/compute_temp_com.h
index 65ba19e72..364ed57d9 100644
--- a/src/compute_temp_com.h
+++ b/src/compute_temp_com.h
@@ -1,52 +1,62 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(temp/com,ComputeTempCOM)
#else
#ifndef LMP_COMPUTE_TEMP_COM_H
#define LMP_COMPUTE_TEMP_COM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeTempCOM : public Compute {
public:
ComputeTempCOM(class LAMMPS *, int, char **);
~ComputeTempCOM();
void init();
double compute_scalar();
void compute_vector();
void remove_bias(int, double *);
void remove_bias_all();
void restore_bias(int, double *);
void restore_bias_all();
private:
int fix_dof;
double tfactor,masstotal;
double vbias[3]; // stored velocity bias for one atom
void dof_compute();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/compute_temp_deform.h b/src/compute_temp_deform.h
index ae066856b..fd18cce16 100644
--- a/src/compute_temp_deform.h
+++ b/src/compute_temp_deform.h
@@ -1,54 +1,74 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(temp/deform,ComputeTempDeform)
#else
#ifndef LMP_COMPUTE_TEMP_DEFORM_H
#define LMP_COMPUTE_TEMP_DEFORM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeTempDeform : public Compute {
public:
ComputeTempDeform(class LAMMPS *, int, char **);
virtual ~ComputeTempDeform();
void init();
virtual double compute_scalar();
virtual void compute_vector();
void remove_bias(int, double *);
void remove_bias_all();
void restore_bias(int, double *);
void restore_bias_all();
double memory_usage();
protected:
int fix_dof;
double tfactor;
double vbias[3]; // stored velocity bias for one atom
double **vbiasall; // stored velocity bias for all atoms
int maxbias; // size of vbiasall array
virtual void dof_compute();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+W: Using compute temp/deform with inconsistent fix deform remap option
+
+Fix nvt/sllod assumes deforming atoms have a velocity profile provided
+by "remap v" or "remap none" as a fix deform option.
+
+W: Using compute temp/deform with no fix deform defined
+
+This is probably an error, since it makes little sense to use
+compute temp/deform in this case.
+
+*/
diff --git a/src/compute_temp_partial.h b/src/compute_temp_partial.h
index e65c0b219..6302d28e2 100644
--- a/src/compute_temp_partial.h
+++ b/src/compute_temp_partial.h
@@ -1,53 +1,67 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(temp/partial,ComputeTempPartial)
#else
#ifndef LMP_COMPUTE_TEMP_PARTIAL_H
#define LMP_COMPUTE_TEMP_PARTIAL_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeTempPartial : public Compute {
public:
ComputeTempPartial(class LAMMPS *, int, char **);
virtual ~ComputeTempPartial();
void init();
double compute_scalar();
void compute_vector();
int dof_remove(int);
void remove_bias(int, double *);
void remove_bias_all();
void restore_bias(int, double *);
void restore_bias_all();
double memory_usage();
protected:
int xflag,yflag,zflag;
int fix_dof;
double tfactor;
void dof_compute();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute temp/partial cannot use vz for 2d systemx
+
+Self-explanatory.
+
+*/
diff --git a/src/compute_temp_profile.h b/src/compute_temp_profile.h
index 7b6fda0b4..3dc8583a6 100644
--- a/src/compute_temp_profile.h
+++ b/src/compute_temp_profile.h
@@ -1,66 +1,84 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(temp/profile,ComputeTempProfile)
#else
#ifndef LMP_COMPUTE_TEMP_PROFILE_H
#define LMP_COMPUTE_TEMP_PROFILE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeTempProfile : public Compute {
public:
ComputeTempProfile(class LAMMPS *, int, char **);
~ComputeTempProfile();
void init();
double compute_scalar();
void compute_vector();
void remove_bias(int, double *);
void remove_bias_all();
void restore_bias(int, double *);
void restore_bias_all();
double memory_usage();
private:
int xflag,yflag,zflag,ncount;
int nbinx,nbiny,nbinz,nbins;
int ivx,ivy,ivz;
int fix_dof;
double tfactor;
int box_change,triclinic;
int *periodicity;
double *boxlo,*boxhi,*prd;
double invdelta[3];
int maxatom;
int *bin;
double **vbin,**binave;
void dof_compute();
void bin_average();
void bin_setup();
void bin_assign();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute temp/profile cannot use vz for 2d systemx
+
+Self-explanatory.
+
+E: Compute temp/profile cannot bin z for 2d systems
+
+Self-explanatory.
+
+*/
diff --git a/src/compute_temp_ramp.h b/src/compute_temp_ramp.h
index e343cdb6b..c39334678 100644
--- a/src/compute_temp_ramp.h
+++ b/src/compute_temp_ramp.h
@@ -1,55 +1,70 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(temp/ramp,ComputeTempRamp)
#else
#ifndef LMP_COMPUTE_TEMP_RAMP_H
#define LMP_COMPUTE_TEMP_RAMP_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeTempRamp : public Compute {
public:
ComputeTempRamp(class LAMMPS *, int, char **);
~ComputeTempRamp();
void init();
double compute_scalar();
void compute_vector();
void remove_bias(int, double *);
void remove_bias_all();
void restore_bias(int, double *);
void restore_bias_all();
double memory_usage();
private:
int coord_dim;
double coord_lo,coord_hi;
int v_dim;
double v_lo,v_hi;
int scaleflag,fix_dof;
double tfactor,xscale,yscale,zscale;
void dof_compute();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Use of compute temp/ramp with undefined lattice
+
+Must use lattice command with compute temp/ramp command if units
+option is set to lattice.
+
+*/
diff --git a/src/compute_temp_region.h b/src/compute_temp_region.h
index d886da5ce..e0df3a8f6 100644
--- a/src/compute_temp_region.h
+++ b/src/compute_temp_region.h
@@ -1,50 +1,64 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(temp/region,ComputeTempRegion)
#else
#ifndef LMP_COMPUTE_TEMP_REGION_H
#define LMP_COMPUTE_TEMP_REGION_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeTempRegion : public Compute {
public:
ComputeTempRegion(class LAMMPS *, int, char **);
virtual ~ComputeTempRegion();
void init();
virtual double compute_scalar();
virtual void compute_vector();
int dof_remove(int);
void remove_bias(int, double *);
void remove_bias_all();
void restore_bias(int, double *);
void restore_bias_all();
double memory_usage();
protected:
int iregion;
char *idregion;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Region ID for compute temp/region does not exist
+
+Self-explanatory.
+
+*/
diff --git a/src/compute_temp_sphere.h b/src/compute_temp_sphere.h
index c0b29dce5..118e61ee7 100644
--- a/src/compute_temp_sphere.h
+++ b/src/compute_temp_sphere.h
@@ -1,51 +1,82 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(temp/sphere,ComputeTempSphere)
#else
#ifndef LMP_COMPUTE_TEMP_SPHERE_H
#define LMP_COMPUTE_TEMP_SPHERE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeTempSphere : public Compute {
public:
ComputeTempSphere(class LAMMPS *, int, char **);
~ComputeTempSphere();
void init();
double compute_scalar();
void compute_vector();
void remove_bias(int, double *);
void restore_bias(int, double *);
private:
int fix_dof,mode;
double tfactor;
double *inertia;
char *id_bias;
Compute *tbias; // ptr to additional bias compute
void dof_compute();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute temp/sphere requires atom style sphere
+
+UNDOCUMENTED
+
+E: Could not find compute ID for temperature bias
+
+Self-explanatory.
+
+E: Bias compute does not calculate temperature
+
+The specified compute must compute temperature.
+
+E: Bias compute does not calculate a velocity bias
+
+The specified compute must compute a bias for temperature.
+
+E: Bias compute group does not match compute group
+
+The specified compute must operate on the same group as the parent
+compute.
+
+*/
diff --git a/src/compute_ti.h b/src/compute_ti.h
index 02dfacff1..56d04ea8b 100644
--- a/src/compute_ti.h
+++ b/src/compute_ti.h
@@ -1,46 +1,82 @@
/* ----------------------------------------------------------------------
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 COMPUTE_CLASS
ComputeStyle(ti,ComputeTI)
#else
#ifndef COMPUTE_TI_H
#define COMPUTE_TI_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeTI : public Compute {
public:
ComputeTI(class LAMMPS *, int, char **);
~ComputeTI();
void init();
double compute_scalar();
private:
int nterms;
int *which;
int *ivar1,*ivar2;
char **var1,**var2;
class Pair **pptr;
char **pstyle;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Variable name for compute ti does not exist
+
+Self-explanatory.
+
+E: Variable for compute ti is invalid style
+
+Self-explanatory.
+
+E: Compute ti pair style does not exist
+
+Self-explanatory.
+
+E: Compute ti tail when pair style does not compute tail corrections
+
+Self-explanatory.
+
+E: Compute ti kspace style does not exist
+
+Self-explanatory.
+
+E: Energy was not tallied on needed timestep
+
+You are using a thermo keyword that requires potentials to
+have tallied energy, but they didn't on this timestep. See the
+variable doc page for ideas on how to make this work.
+
+*/
diff --git a/src/create_atoms.h b/src/create_atoms.h
index df6d39595..6d4fb7c3f 100644
--- a/src/create_atoms.h
+++ b/src/create_atoms.h
@@ -1,45 +1,84 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(create_atoms,CreateAtoms)
#else
#ifndef LMP_CREATE_ATOMS_H
#define LMP_CREATE_ATOMS_H
#include "pointers.h"
namespace LAMMPS_NS {
class CreateAtoms : protected Pointers {
public:
CreateAtoms(class LAMMPS *);
void command(int, char **);
private:
int itype,style,nregion,nbasis,nrandom,seed;
int *basistype;
double xone[3];
void add_single();
void add_random();
void add_lattice();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Create_atoms command before simulation box is defined
+
+The create_atoms command cannot be used before a read_data,
+read_restart, or create_box command.
+
+E: Cannot create_atoms after reading restart file with per-atom info
+
+The per-atom info was stored to be used when by a fix that you
+may re-define. If you add atoms before re-defining the fix, then
+there will not be a correct amount of per-atom info.
+
+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: Invalid atom type in create_atoms command
+
+The create_box command specified the range of valid atom types.
+An invalid type is being requested.
+
+E: Create_atoms region ID does not exist
+
+A region ID used in the create_atoms command does not exist.
+
+E: Cannot create atoms with undefined lattice
+
+Must use the lattice command before using the create_atoms
+command.
+
+E: Too many total atoms
+
+See the setting for bigint in the src/lmptype.h file.
+
+*/
diff --git a/src/create_box.h b/src/create_box.h
index fdf12d4c2..974e1db2d 100644
--- a/src/create_box.h
+++ b/src/create_box.h
@@ -1,36 +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 COMMAND_CLASS
CommandStyle(create_box,CreateBox)
#else
#ifndef LMP_CREATE_BOX_H
#define LMP_CREATE_BOX_H
#include "pointers.h"
namespace LAMMPS_NS {
class CreateBox : protected Pointers {
public:
CreateBox(class LAMMPS *);
void command(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot create_box after simulation box is defined
+
+The create_box command cannot be used after a read_data, read_restart,
+or create_box command.
+
+E: Cannot run 2d simulation with nonperiodic Z dimension
+
+Use the boundary command to make the z dimension periodic in order to
+run a 2d simulation.
+
+E: Create_box region ID does not exist
+
+A region ID used in the create_box command does not exist.
+
+E: Create_box region does not support a bounding box
+
+Not all regions represent bounded volumes. You cannot use
+such a region with the create_box command.
+
+*/
diff --git a/src/delete_atoms.h b/src/delete_atoms.h
index 840c0d65d..365c7507d 100644
--- a/src/delete_atoms.h
+++ b/src/delete_atoms.h
@@ -1,50 +1,87 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(delete_atoms,DeleteAtoms)
#else
#ifndef LMP_DELETE_ATOMS_H
#define LMP_DELETE_ATOMS_H
#include "pointers.h"
namespace LAMMPS_NS {
class DeleteAtoms : protected Pointers {
public:
DeleteAtoms(class LAMMPS *);
void command(int, char **);
private:
int *dlist;
int compress_flag;
void delete_group(int, char **);
void delete_region(int, char **);
void delete_overlap(int, char **);
void delete_porosity(int, char **);
void options(int, char **);
inline int sbmask(int j) {
return j >> SBBITS & 3;
}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Delete_atoms command before simulation box is defined
+
+The delete_atoms command cannot be used before a read_data,
+read_restart, or create_box command.
+
+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: Cannot use delete_atoms unless atoms have IDs
+
+Your atoms do not have IDs, so the delete_atoms command cannot be
+used.
+
+E: Could not find delete_atoms group ID
+
+Group ID used in the delete_atoms command does not exist.
+
+E: Could not find delete_atoms region ID
+
+Region ID used in the delete_atoms command does not exist.
+
+E: Delete_atoms requires a pair style be defined
+
+This is because atom deletion within a cutoff uses a pairwise
+neighbor list.
+
+E: Delete_atoms cutoff > neighbor cutoff
+
+Cannot delete atoms further away than a processor knows about.
+
+*/
diff --git a/src/delete_bonds.h b/src/delete_bonds.h
index 925d69b16..39ce872e7 100644
--- a/src/delete_bonds.h
+++ b/src/delete_bonds.h
@@ -1,36 +1,87 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(delete_bonds,DeleteBonds)
#else
#ifndef LMP_DELETE_BONDS_H
#define LMP_DELETE_BONDS_H
#include "pointers.h"
namespace LAMMPS_NS {
class DeleteBonds : protected Pointers {
public:
DeleteBonds(class LAMMPS *);
void command(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Delete_bonds command before simulation box is defined
+
+The delete_bonds command cannot be used before a read_data,
+read_restart, or create_box command.
+
+E: Delete_bonds command with no atoms existing
+
+No atoms are yet defined so the delete_bonds command cannot be used.
+
+E: Cannot use delete_bonds with non-molecular system
+
+Your choice of atom style does not have bonds.
+
+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: Cannot find delete_bonds group ID
+
+Group ID used in the delete_bonds command does not exist.
+
+E: Bond atom missing in delete_bonds
+
+The delete_bonds command cannot find one or more atoms in a particular
+bond on a particular processor. The pairwise cutoff is too short or
+the atoms are too far apart to make a valid bond.
+
+E: Angle atom missing in delete_bonds
+
+The delete_bonds command cannot find one or more atoms in a particular
+angle on a particular processor. The pairwise cutoff is too short or
+the atoms are too far apart to make a valid angle.
+
+E: Dihedral atom missing in delete_bonds
+
+The delete_bonds command cannot find one or more atoms in a particular
+dihedral on a particular processor. The pairwise cutoff is too short
+or the atoms are too far apart to make a valid dihedral.
+
+E: Improper atom missing in delete_bonds
+
+The delete_bonds command cannot find one or more atoms in a particular
+improper on a particular processor. The pairwise cutoff is too short
+or the atoms are too far apart to make a valid improper.
+
+*/
diff --git a/src/dihedral.h b/src/dihedral.h
index b41272b7b..31f8902cb 100644
--- a/src/dihedral.h
+++ b/src/dihedral.h
@@ -1,57 +1,71 @@
/* ----------------------------------------------------------------------
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_DIHEDRAL_H
#define LMP_DIHEDRAL_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class Dihedral : protected Pointers {
friend class ThrOMP;
public:
int allocated;
int *setflag;
double energy; // accumulated energy
double virial[6]; // accumlated virial
double *eatom,**vatom; // accumulated per-atom energy/virial
Dihedral(class LAMMPS *);
virtual ~Dihedral();
virtual void init();
virtual void init_style() {}
virtual void compute(int, int) = 0;
virtual void settings(int, char **) {}
virtual void coeff(int, char **) = 0;
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;
virtual double memory_usage();
protected:
int evflag;
int eflag_either,eflag_global,eflag_atom;
int vflag_either,vflag_global,vflag_atom;
int maxeatom,maxvatom;
void ev_setup(int, int);
void ev_tally(int, int, int, int, int, int, double,
double *, double *, double *, double, double, double,
double, double, double, double, double, double);
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Dihedral coeffs are not set
+
+No dihedral coefficients have been assigned in the data file or via
+the dihedral_coeff command.
+
+E: All dihedral coeffs are not set
+
+All dihedral coefficients must be set in the data file or by the
+dihedral_coeff command before running a simulation.
+
+*/
diff --git a/src/displace_atoms.h b/src/displace_atoms.h
index 7a3f2bc6b..be5921e61 100644
--- a/src/displace_atoms.h
+++ b/src/displace_atoms.h
@@ -1,40 +1,74 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(displace_atoms,DisplaceAtoms)
#else
#ifndef LMP_DISPLACE_ATOMS_H
#define LMP_DISPLACE_ATOMS_H
#include "pointers.h"
namespace LAMMPS_NS {
class DisplaceAtoms : protected Pointers {
public:
DisplaceAtoms(class LAMMPS *);
void command(int, char **);
private:
int scaleflag;
void options(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Displace_atoms command before simulation box is defined
+
+The displace_atoms command cannot be used before a read_data,
+read_restart, or create_box command.
+
+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: Cannot displace_atoms after reading restart file with per-atom info
+
+This is because the restart file info cannot be migrated with the
+atoms. You can get around this by performing a 0-timestep run which
+will assign the restart file info to actual atoms.
+
+E: Could not find displace_atoms group ID
+
+Group ID used in the displace_atoms command does not exist.
+
+E: Use of displace_atoms with undefined lattice
+
+Must use lattice command with displace_atoms command if units option
+is set to lattice.
+
+E: Lost atoms via displace_atoms: original %ld current %ld
+
+UNDOCUMENTED
+
+*/
diff --git a/src/displace_box.h b/src/displace_box.h
index a229d32a8..44df201c3 100644
--- a/src/displace_box.h
+++ b/src/displace_box.h
@@ -1,54 +1,105 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(displace_box,DisplaceBox)
#else
#ifndef LMP_DISPLACE_BOX_H
#define LMP_DISPLACE_BOX_H
#include "pointers.h"
namespace LAMMPS_NS {
class DisplaceBox : protected Pointers {
public:
DisplaceBox(class LAMMPS *);
void command(int, char **);
private:
int remapflag,scaleflag;
struct Set {
int style,substyle;
double flo,fhi,ftilt;
double dlo,dhi,dtilt;
double scale;
double lo_start,hi_start;
double lo_stop,hi_stop;
double tilt_start,tilt_stop;
double vol_start;
int fixed,dynamic1,dynamic2;
};
Set *set;
void options(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Displace_box command before simulation box is defined
+
+Self-explanatory.
+
+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: Cannot displace_box after reading restart file with per-atom info
+
+This is because the restart file info cannot be migrated with the
+atoms. You can get around this by performing a 0-timestep run which
+will assign the restart file info to actual atoms.
+
+E: Could not find displace_box group ID
+
+Group ID used in the displace_box command does not exist.
+
+E: Displace_box tilt factors require triclinic box
+
+Cannot use tilt factors unless the simulation box is
+non-orthogonal.
+
+E: Cannot displace_box on a non-periodic boundary
+
+Self-explanatory.
+
+E: Use of displace_box with undefined lattice
+
+Must use lattice command with displace_box command if units option is
+set to lattice.
+
+E: Fix deform volume setting is invalid
+
+Cannot use volume style unless other dimensions are being controlled.
+
+E: Induced tilt by displace_box is too large
+
+The final tilt value must be between -1/2 and 1/2 of the perpendicular
+box length.
+
+E: Lost atoms via displace_box: original %ld current %ld
+
+UNDOCUMENTED
+
+*/
diff --git a/src/domain.h b/src/domain.h
index 1e04ab4ab..f330d8587 100644
--- a/src/domain.h
+++ b/src/domain.h
@@ -1,122 +1,173 @@
/* ----------------------------------------------------------------------
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_DOMAIN_H
#define LMP_DOMAIN_H
#include "pointers.h"
namespace LAMMPS_NS {
class Domain : protected Pointers {
public:
int box_exist; // 0 = not yet created, 1 = exists
int dimension; // 2 = 2d, 3 = 3d
int nonperiodic; // 0 = periodic in all 3 dims
// 1 = periodic or fixed in all 6
// 2 = shrink-wrap in any of 6
int xperiodic,yperiodic,zperiodic; // 0 = non-periodic, 1 = periodic
int periodicity[3]; // xyz periodicity as array
int boundary[3][2]; // settings for 6 boundaries
// 0 = periodic
// 1 = fixed non-periodic
// 2 = shrink-wrap non-periodic
// 3 = shrink-wrap non-per w/ min
int triclinic; // 0 = orthog box, 1 = triclinic
// orthogonal box
double xprd,yprd,zprd; // global box dimensions
double xprd_half,yprd_half,zprd_half; // half dimensions
double prd[3]; // array form of dimensions
double prd_half[3]; // array form of half dimensions
// triclinic box
// xprd,xprd_half,prd,prd_half =
// same as if untilted
double prd_lamda[3]; // lamda box = (1,1,1)
double prd_half_lamda[3]; // lamda half box = (0.5,0.5,0.5)
double boxlo[3],boxhi[3]; // orthogonal box global bounds
// triclinic box
// boxlo/hi = same as if untilted
double boxlo_lamda[3],boxhi_lamda[3]; // lamda box = (0,1)
double boxlo_bound[3],boxhi_bound[3]; // bounding box of tilted domain
double corners[8][3]; // 8 corner points
// orthogonal box & triclinic box
double minxlo,minxhi; // minimum size of global box
double minylo,minyhi; // when shrink-wrapping
double minzlo,minzhi; // tri only possible for non-skew dims
// orthogonal box
double sublo[3],subhi[3]; // sub-box bounds on this proc
// triclinic box
// sublo/hi = undefined
double sublo_lamda[3],subhi_lamda[3]; // bounds of subbox in lamda
// triclinic box
double xy,xz,yz; // 3 tilt factors
double h[6],h_inv[6]; // shape matrix in Voigt notation
double h_rate[6],h_ratelo[3]; // rate of box size/shape change
int box_change; // 1 if box bounds ever change, 0 if fixed
int deform_flag; // 1 if fix deform exist, else 0
int deform_vremap; // 1 if fix deform remaps v, else 0
int deform_groupbit; // atom group to perform v remap for
class Lattice *lattice; // user-defined lattice
int nregion; // # of defined Regions
int maxregion; // max # list can hold
class Region **regions; // list of defined Regions
Domain(class LAMMPS *);
virtual ~Domain();
virtual void init();
void set_initial_box();
virtual void set_global_box();
virtual void set_lamda_box();
virtual void set_local_box();
virtual void reset_box();
virtual void pbc();
void remap(double *, int &);
void remap(double *);
void remap_near(double *, double *);
void unmap(double *, int);
void unmap(double *, int, double *);
int minimum_image_check(double, double, double);
void minimum_image(double &, double &, double &);
void minimum_image(double *);
void closest_image(const double * const, const double * const, double * const);
void set_lattice(int, char **);
void add_region(int, char **);
void delete_region(int, char **);
int find_region(char *);
void set_boundary(int, char **);
void print_box(const char *);
virtual void lamda2x(int);
virtual void x2lamda(int);
void lamda2x(double *, double *);
void x2lamda(double *, double *);
void bbox(double *, double *, double *, double *);
void box_corners();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Box bounds are invalid
+
+The box boundaries specified in the read_data file are invalid. The
+lo value must be less than the hi value for all 3 dimensions.
+
+E: Cannot skew triclinic box in z for 2d simulation
+
+Self-explanatory.
+
+E: Triclinic box must be periodic in skewed dimensions
+
+This is a requirement for using a non-orthogonal box. E.g. to set a
+non-zero xy tilt, both x and y must be periodic dimensions.
+
+E: Triclinic box skew is too large
+
+The displacement in a skewed direction must be less than half the box
+length in that dimension. E.g. the xy tilt must be between -half and
++half of the x box length.
+
+E: Illegal simulation box
+
+The lower bound of the simulation box is greater than the upper bound.
+
+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: Reuse of region ID
+
+A region ID cannot be used twice.
+
+E: Invalid region style
+
+The choice of region style is unknown.
+
+E: Delete region ID does not exist
+
+Self-explanatory.
+
+E: Both sides of boundary must be periodic
+
+Cannot specify a boundary as periodic only on the lo or hi side. Must
+be periodic on both sides.
+
+*/
diff --git a/src/dump.h b/src/dump.h
index 46a9dadba..c8855c3b8 100644
--- a/src/dump.h
+++ b/src/dump.h
@@ -1,117 +1,154 @@
/* -*- c++ -*- -------------------------------------------------------------
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_DUMP_H
#define LMP_DUMP_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class Dump : protected Pointers {
public:
char *id; // user-defined name of Dump
char *style; // style of Dump
int igroup,groupbit; // group that Dump is performed on
int first_flag; // 0 if no initial dump, 1 if yes initial dump
int clearstep; // 1 if dump invokes computes, 0 if not
int comm_forward; // size of forward communication (0 if none)
int comm_reverse; // size of reverse communication (0 if none)
// static variable across all Dump objects
static Dump *dumpptr; // holds a ptr to Dump currently being used
Dump(class LAMMPS *, int, char **);
virtual ~Dump();
void init();
virtual void write();
virtual int pack_comm(int, int *, double *, int, int *) {return 0;}
virtual void unpack_comm(int, int, double *) {}
virtual int pack_reverse_comm(int, int, double *) {return 0;}
virtual void unpack_reverse_comm(int, int *, double *) {}
void modify_params(int, char **);
virtual bigint memory_usage();
protected:
int me,nprocs; // proc info
char *filename; // user-specified file
int compressed; // 1 if dump file is written compressed, 0 no
int binary; // 1 if dump file is written binary, 0 no
int multifile; // 0 = one big file, 1 = one file per timestep
int multiproc; // 0 = proc 0 writes for all, 1 = one file/proc
int header_flag; // 0 = item, 2 = xyz
int flush_flag; // 0 if no flush, 1 if flush every dump
int sort_flag; // 1 if sorted output
int append_flag; // 1 if open file in append mode, 0 if not
int padflag; // timestep padding in filename
int singlefile_opened; // 1 = one big file, already opened, else 0
int sortcol; // 0 to sort on ID, 1-N on columns
int sortcolm1; // sortcol - 1
int sortorder; // ASCEND or DESCEND
char boundstr[9]; // encoding of boundary flags
char *format_default; // default format string
char *format_user; // format string set by user
char *format; // format string for the file write
FILE *fp; // file to write dump to
int size_one; // # of quantities for one atom
int nme; // # of atoms in this dump from me
double boxxlo,boxxhi; // local copies of domain values
double boxylo,boxyhi; // lo/hi are bounding box for triclinic
double boxzlo,boxzhi;
double boxxy,boxxz,boxyz;
bigint ntotal; // # of per-atom lines in snapshot
int reorderflag; // 1 if OK to reorder instead of sort
int ntotal_reorder; // # of atoms that must be in snapshot
int nme_reorder; // # of atoms I must own in snapshot
int idlo; // lowest ID I own when reordering
int maxbuf; // size of buf
double *buf; // memory for atom quantities
int maxids; // size of ids
int maxsort; // size of bufsort, idsort, index
int maxproc; // size of proclist
int *ids; // list of atom IDs, if sorting on IDs
double *bufsort;
int *idsort,*index,*proclist;
class Irregular *irregular;
virtual void init_style() = 0;
virtual void openfile();
virtual int modify_param(int, char **) {return 0;}
virtual void write_header(bigint) = 0;
virtual int count() = 0;
virtual void pack(int *) = 0;
virtual void write_data(int, double *) = 0;
void sort();
static int idcompare(const void *, const void *);
static int bufcompare(const void *, const void *);
static int bufcompare_reverse(const void *, const void *);
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Cannot dump sort on atom IDs with no atom IDs defined
+
+Self-explanatory.
+
+E: Dump sort column is invalid
+
+Self-explanatory.
+
+E: Too many atoms to dump sort
+
+Cannot sort when running with more than 2^31 atoms.
+
+E: Too much per-proc info for dump
+
+Number of local atoms times number of columns must fit in a 32-bit
+integer for dump.
+
+E: Cannot open gzipped file
+
+LAMMPS is attempting to open a gzipped version of the specified file
+but was unsuccessful. Check that the path and name are correct.
+
+E: Cannot open dump file
+
+The output file for the dump command cannot be opened. Check that the
+path and name are correct.
+
+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.
+
+*/
diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp
index 2365fb3e2..a9dfdcc03 100644
--- a/src/dump_atom.cpp
+++ b/src/dump_atom.cpp
@@ -1,454 +1,454 @@
/* ----------------------------------------------------------------------
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 "string.h"
#include "dump_atom.h"
#include "domain.h"
#include "atom.h"
#include "update.h"
#include "group.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
DumpAtom::DumpAtom(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
{
if (narg != 5) error->all(FLERR,"Illegal dump atom command");
scale_flag = 1;
image_flag = 0;
format_default = NULL;
}
/* ---------------------------------------------------------------------- */
void DumpAtom::init_style()
{
if (image_flag == 0) size_one = 5;
else size_one = 8;
// default format depends on image flags
delete [] format;
if (format_user) {
int n = strlen(format_user) + 2;
format = new char[n];
strcpy(format,format_user);
strcat(format,"\n");
} else {
char *str;
if (image_flag == 0) str = (char *) "%d %d %g %g %g";
else str = (char *) "%d %d %g %g %g %d %d %d";
int n = strlen(str) + 2;
format = new char[n];
strcpy(format,str);
strcat(format,"\n");
}
// setup boundary string
int m = 0;
for (int idim = 0; idim < 3; idim++) {
for (int iside = 0; iside < 2; iside++) {
if (domain->boundary[idim][iside] == 0) boundstr[m++] = 'p';
else if (domain->boundary[idim][iside] == 1) boundstr[m++] = 'f';
else if (domain->boundary[idim][iside] == 2) boundstr[m++] = 's';
else if (domain->boundary[idim][iside] == 3) boundstr[m++] = 'm';
}
boundstr[m++] = ' ';
}
boundstr[8] = '\0';
// setup column string
if (scale_flag == 0 && image_flag == 0)
- columns = "id type x y z";
+ columns = (char *) "id type x y z";
else if (scale_flag == 0 && image_flag == 1)
- columns = "id type x y z ix iy iz";
+ columns = (char *) "id type x y z ix iy iz";
else if (scale_flag == 1 && image_flag == 0)
- columns = "id type xs ys zs";
+ columns = (char *) "id type xs ys zs";
else if (scale_flag == 1 && image_flag == 1)
- columns = "id type xs ys zs ix iy iz";
+ columns = (char *) "id type xs ys zs ix iy iz";
// setup function ptrs
if (binary && domain->triclinic == 0)
header_choice = &DumpAtom::header_binary;
else if (binary && domain->triclinic == 1)
header_choice = &DumpAtom::header_binary_triclinic;
else if (!binary && domain->triclinic == 0)
header_choice = &DumpAtom::header_item;
else if (!binary && domain->triclinic == 1)
header_choice = &DumpAtom::header_item_triclinic;
if (scale_flag == 1 && image_flag == 0 && domain->triclinic == 0)
pack_choice = &DumpAtom::pack_scale_noimage;
else if (scale_flag == 1 && image_flag == 1 && domain->triclinic == 0)
pack_choice = &DumpAtom::pack_scale_image;
else if (scale_flag == 1 && image_flag == 0 && domain->triclinic == 1)
pack_choice = &DumpAtom::pack_scale_noimage_triclinic;
else if (scale_flag == 1 && image_flag == 1 && domain->triclinic == 1)
pack_choice = &DumpAtom::pack_scale_image_triclinic;
else if (scale_flag == 0 && image_flag == 0)
pack_choice = &DumpAtom::pack_noscale_noimage;
else if (scale_flag == 0 && image_flag == 1)
pack_choice = &DumpAtom::pack_noscale_image;
if (binary) write_choice = &DumpAtom::write_binary;
else if (image_flag == 0) write_choice = &DumpAtom::write_noimage;
else if (image_flag == 1) write_choice = &DumpAtom::write_image;
// open single file, one time only
if (multifile == 0) openfile();
}
/* ---------------------------------------------------------------------- */
int DumpAtom::modify_param(int narg, char **arg)
{
if (strcmp(arg[0],"scale") == 0) {
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
if (strcmp(arg[1],"yes") == 0) scale_flag = 1;
else if (strcmp(arg[1],"no") == 0) scale_flag = 0;
else error->all(FLERR,"Illegal dump_modify command");
return 2;
} else if (strcmp(arg[0],"image") == 0) {
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
if (strcmp(arg[1],"yes") == 0) image_flag = 1;
else if (strcmp(arg[1],"no") == 0) image_flag = 0;
else error->all(FLERR,"Illegal dump_modify command");
return 2;
}
return 0;
}
/* ---------------------------------------------------------------------- */
void DumpAtom::write_header(bigint ndump)
{
if (multiproc) (this->*header_choice)(ndump);
else if (me == 0) (this->*header_choice)(ndump);
}
/* ---------------------------------------------------------------------- */
int DumpAtom::count()
{
if (igroup == 0) return atom->nlocal;
int *mask = atom->mask;
int nlocal = atom->nlocal;
int m = 0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) m++;
return m;
}
/* ---------------------------------------------------------------------- */
void DumpAtom::pack(int *ids)
{
(this->*pack_choice)(ids);
}
/* ---------------------------------------------------------------------- */
void DumpAtom::write_data(int n, double *mybuf)
{
(this->*write_choice)(n,mybuf);
}
/* ---------------------------------------------------------------------- */
void DumpAtom::header_binary(bigint ndump)
{
fwrite(&update->ntimestep,sizeof(bigint),1,fp);
fwrite(&ndump,sizeof(bigint),1,fp);
fwrite(&domain->triclinic,sizeof(int),1,fp);
fwrite(&domain->boundary[0][0],6*sizeof(int),1,fp);
fwrite(&boxxlo,sizeof(double),1,fp);
fwrite(&boxxhi,sizeof(double),1,fp);
fwrite(&boxylo,sizeof(double),1,fp);
fwrite(&boxyhi,sizeof(double),1,fp);
fwrite(&boxzlo,sizeof(double),1,fp);
fwrite(&boxzhi,sizeof(double),1,fp);
fwrite(&size_one,sizeof(int),1,fp);
if (multiproc) {
int one = 1;
fwrite(&one,sizeof(int),1,fp);
} else fwrite(&nprocs,sizeof(int),1,fp);
}
/* ---------------------------------------------------------------------- */
void DumpAtom::header_binary_triclinic(bigint ndump)
{
fwrite(&update->ntimestep,sizeof(bigint),1,fp);
fwrite(&ndump,sizeof(bigint),1,fp);
fwrite(&domain->triclinic,sizeof(int),1,fp);
fwrite(&domain->boundary[0][0],6*sizeof(int),1,fp);
fwrite(&boxxlo,sizeof(double),1,fp);
fwrite(&boxxhi,sizeof(double),1,fp);
fwrite(&boxylo,sizeof(double),1,fp);
fwrite(&boxyhi,sizeof(double),1,fp);
fwrite(&boxzlo,sizeof(double),1,fp);
fwrite(&boxzhi,sizeof(double),1,fp);
fwrite(&boxxy,sizeof(double),1,fp);
fwrite(&boxxz,sizeof(double),1,fp);
fwrite(&boxyz,sizeof(double),1,fp);
fwrite(&size_one,sizeof(int),1,fp);
if (multiproc) {
int one = 1;
fwrite(&one,sizeof(int),1,fp);
} else fwrite(&nprocs,sizeof(int),1,fp);
}
/* ---------------------------------------------------------------------- */
void DumpAtom::header_item(bigint ndump)
{
fprintf(fp,"ITEM: TIMESTEP\n");
fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
fprintf(fp,BIGINT_FORMAT "\n",ndump);
fprintf(fp,"ITEM: BOX BOUNDS %s\n",boundstr);
fprintf(fp,"%g %g\n",boxxlo,boxxhi);
fprintf(fp,"%g %g\n",boxylo,boxyhi);
fprintf(fp,"%g %g\n",boxzlo,boxzhi);
fprintf(fp,"ITEM: ATOMS %s\n",columns);
}
/* ---------------------------------------------------------------------- */
void DumpAtom::header_item_triclinic(bigint ndump)
{
fprintf(fp,"ITEM: TIMESTEP\n");
fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
fprintf(fp,BIGINT_FORMAT "\n",ndump);
fprintf(fp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr);
fprintf(fp,"%g %g %g\n",boxxlo,boxxhi,boxxy);
fprintf(fp,"%g %g %g\n",boxylo,boxyhi,boxxz);
fprintf(fp,"%g %g %g\n",boxzlo,boxzhi,boxyz);
fprintf(fp,"ITEM: ATOMS %s\n",columns);
}
/* ---------------------------------------------------------------------- */
void DumpAtom::pack_scale_image(int *ids)
{
int m,n;
int *tag = atom->tag;
int *type = atom->type;
int *image = atom->image;
int *mask = atom->mask;
double **x = atom->x;
int nlocal = atom->nlocal;
double invxprd = 1.0/domain->xprd;
double invyprd = 1.0/domain->yprd;
double invzprd = 1.0/domain->zprd;
m = n = 00;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
buf[m++] = tag[i];
buf[m++] = type[i];
buf[m++] = (x[i][0] - boxxlo) * invxprd;
buf[m++] = (x[i][1] - boxylo) * invyprd;
buf[m++] = (x[i][2] - boxzlo) * invzprd;
buf[m++] = (image[i] & 1023) - 512;
buf[m++] = (image[i] >> 10 & 1023) - 512;
buf[m++] = (image[i] >> 20) - 512;
if (ids) ids[n++] = tag[i];
}
}
/* ---------------------------------------------------------------------- */
void DumpAtom::pack_scale_noimage(int *ids)
{
int m,n;
int *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
double **x = atom->x;
int nlocal = atom->nlocal;
double invxprd = 1.0/domain->xprd;
double invyprd = 1.0/domain->yprd;
double invzprd = 1.0/domain->zprd;
m = n = 0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
buf[m++] = tag[i];
buf[m++] = type[i];
buf[m++] = (x[i][0] - boxxlo) * invxprd;
buf[m++] = (x[i][1] - boxylo) * invyprd;
buf[m++] = (x[i][2] - boxzlo) * invzprd;
if (ids) ids[n++] = tag[i];
}
}
/* ---------------------------------------------------------------------- */
void DumpAtom::pack_scale_image_triclinic(int *ids)
{
int m,n;
int *tag = atom->tag;
int *type = atom->type;
int *image = atom->image;
int *mask = atom->mask;
double **x = atom->x;
int nlocal = atom->nlocal;
double lamda[3];
m = n = 0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
buf[m++] = tag[i];
buf[m++] = type[i];
domain->x2lamda(x[i],lamda);
buf[m++] = lamda[0];
buf[m++] = lamda[1];
buf[m++] = lamda[2];
buf[m++] = (image[i] & 1023) - 512;
buf[m++] = (image[i] >> 10 & 1023) - 512;
buf[m++] = (image[i] >> 20) - 512;
if (ids) ids[n++] = tag[i];
}
}
/* ---------------------------------------------------------------------- */
void DumpAtom::pack_scale_noimage_triclinic(int *ids)
{
int m,n;
int *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
double **x = atom->x;
int nlocal = atom->nlocal;
double lamda[3];
m = n = 0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
buf[m++] = tag[i];
buf[m++] = type[i];
domain->x2lamda(x[i],lamda);
buf[m++] = lamda[0];
buf[m++] = lamda[1];
buf[m++] = lamda[2];
if (ids) ids[n++] = tag[i];
}
}
/* ---------------------------------------------------------------------- */
void DumpAtom::pack_noscale_image(int *ids)
{
int m,n;
int *tag = atom->tag;
int *type = atom->type;
int *image = atom->image;
int *mask = atom->mask;
double **x = atom->x;
int nlocal = atom->nlocal;
m = n = 0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
buf[m++] = tag[i];
buf[m++] = type[i];
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
buf[m++] = (image[i] & 1023) - 512;
buf[m++] = (image[i] >> 10 & 1023) - 512;
buf[m++] = (image[i] >> 20) - 512;
if (ids) ids[n++] = tag[i];
}
}
/* ---------------------------------------------------------------------- */
void DumpAtom::pack_noscale_noimage(int *ids)
{
int m,n;
int *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
double **x = atom->x;
int nlocal = atom->nlocal;
m = n = 0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
buf[m++] = tag[i];
buf[m++] = type[i];
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
if (ids) ids[n++] = tag[i];
}
}
/* ---------------------------------------------------------------------- */
void DumpAtom::write_binary(int n, double *mybuf)
{
n *= size_one;
fwrite(&n,sizeof(int),1,fp);
fwrite(mybuf,sizeof(double),n,fp);
}
/* ---------------------------------------------------------------------- */
void DumpAtom::write_image(int n, double *mybuf)
{
int m = 0;
for (int i = 0; i < n; i++) {
fprintf(fp,format,
static_cast<int> (mybuf[m]), static_cast<int> (mybuf[m+1]),
mybuf[m+2],mybuf[m+3],mybuf[m+4], static_cast<int> (mybuf[m+5]),
static_cast<int> (mybuf[m+6]), static_cast<int> (mybuf[m+7]));
m += size_one;
}
}
/* ---------------------------------------------------------------------- */
void DumpAtom::write_noimage(int n, double *mybuf)
{
int m = 0;
for (int i = 0; i < n; i++) {
fprintf(fp,format,
static_cast<int> (mybuf[m]), static_cast<int> (mybuf[m+1]),
mybuf[m+2],mybuf[m+3],mybuf[m+4]);
m += size_one;
}
}
diff --git a/src/dump_atom.h b/src/dump_atom.h
index 0483a7d64..682b66004 100644
--- a/src/dump_atom.h
+++ b/src/dump_atom.h
@@ -1,70 +1,80 @@
/* ----------------------------------------------------------------------
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 DUMP_CLASS
DumpStyle(atom,DumpAtom)
#else
#ifndef LMP_DUMP_ATOM_H
#define LMP_DUMP_ATOM_H
#include "dump.h"
namespace LAMMPS_NS {
class DumpAtom : public Dump {
public:
DumpAtom(LAMMPS *, int, char**);
private:
int scale_flag; // 1 if atom coords are scaled, 0 if no
int image_flag; // 1 if append box count to atom coords, 0 if no
char *columns; // column labels
void init_style();
int modify_param(int, char **);
void write_header(bigint);
int count();
void pack(int *);
void write_data(int, double *);
typedef void (DumpAtom::*FnPtrHeader)(bigint);
FnPtrHeader header_choice; // ptr to write header functions
void header_binary(bigint);
void header_binary_triclinic(bigint);
void header_item(bigint);
void header_item_triclinic(bigint);
typedef void (DumpAtom::*FnPtrPack)(int *);
FnPtrPack pack_choice; // ptr to pack functions
void pack_scale_image(int *);
void pack_scale_noimage(int *);
void pack_noscale_image(int *);
void pack_noscale_noimage(int *);
void pack_scale_image_triclinic(int *);
void pack_scale_noimage_triclinic(int *);
typedef void (DumpAtom::*FnPtrData)(int, double *);
FnPtrData write_choice; // ptr to write data functions
void write_binary(int, double *);
void write_image(int, double *);
void write_noimage(int, double *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/dump_cfg.h b/src/dump_cfg.h
index bee5c1dbb..0f3c35e33 100644
--- a/src/dump_cfg.h
+++ b/src/dump_cfg.h
@@ -1,47 +1,67 @@
/* ----------------------------------------------------------------------
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 DUMP_CLASS
DumpStyle(cfg,DumpCFG)
#else
#ifndef LMP_DUMP_CFG_H
#define LMP_DUMP_CFG_H
#include "dump_custom.h"
namespace LAMMPS_NS {
class DumpCFG : public DumpCustom {
public:
DumpCFG(class LAMMPS *, int, char **);
~DumpCFG();
private:
char **auxname; // name strings of auxiliary properties
int nchosen; // # of lines to be written on a writing proc
int nlines; // # of lines transferred from buf to rbuf
double **rbuf; // buf of data lines for data lines rearrangement
int unwrapflag; // 1 if unwrapped coordinates are requested
void init_style();
void write_header(bigint);
void write_data(int, double *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Dump cfg arguments must start with 'id type xs ys zs' or 'id type xsu ysu zsu'
+
+This is a requirement of the CFG output format. :dd
+
+E: Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu
+
+UNDOCUMENTED
+
+E: Invalid keyword in dump cfg command
+
+Self-explanatory.
+
+E: Dump cfg requires one snapshot per file
+
+Use the wildcard "*" character in the filename.
+
+*/
diff --git a/src/dump_custom.h b/src/dump_custom.h
index 8b7fbc34a..623c010ca 100644
--- a/src/dump_custom.h
+++ b/src/dump_custom.h
@@ -1,173 +1,330 @@
/* ----------------------------------------------------------------------
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 DUMP_CLASS
DumpStyle(custom,DumpCustom)
#else
#ifndef LMP_DUMP_CUSTOM_H
#define LMP_DUMP_CUSTOM_H
#include "dump.h"
namespace LAMMPS_NS {
class DumpCustom : public Dump {
public:
DumpCustom(class LAMMPS *, int, char **);
virtual ~DumpCustom();
protected:
int nevery; // dump frequency to check Fix against
int iregion; // -1 if no region, else which region
char *idregion; // region ID
int nthresh; // # of defined threshholds
int *thresh_array; // array to threshhhold on for each nthresh
int *thresh_op; // threshhold operation for each nthresh
double *thresh_value; // threshhold value for each nthresh
int *vtype; // type of each vector (INT, DOUBLE)
char **vformat; // format string for each vector element
char *columns; // column labels
int nchoose; // # of selected atoms
int maxlocal; // size of atom selection and variable arrays
int *choose; // local indices of selected atoms
double *dchoose; // value for each atom to threshhold against
int *clist; // compressed list of indices of selected atoms
int nfield; // # of keywords listed by user
int ioptional; // index of start of optional args
int *field2index; // which compute,fix,variable calcs this field
int *argindex; // index into compute,fix scalar_atom,vector_atom
// 0 for scalar_atom, 1-N for vector_atom values
int ncompute; // # of Compute objects used by dump
char **id_compute; // their IDs
class Compute **compute; // list of ptrs to the Compute objects
int nfix; // # of Fix objects used by dump
char **id_fix; // their IDs
class Fix **fix; // list of ptrs to the Fix objects
int nvariable; // # of Variables used by dump
char **id_variable; // their names
int *variable; // list of indices for the Variables
double **vbuf; // local storage for variable evaluation
int ntypes; // # of atom types
char **typenames; // array of element names for each type
// private methods
virtual void init_style();
virtual void write_header(bigint);
int count();
void pack(int *);
virtual void write_data(int, double *);
bigint memory_usage();
int parse_fields(int, char **);
int add_compute(char *);
int add_fix(char *);
int add_variable(char *);
virtual int modify_param(int, char **);
typedef void (DumpCustom::*FnPtrHeader)(bigint);
FnPtrHeader header_choice; // ptr to write header functions
void header_binary(bigint);
void header_binary_triclinic(bigint);
void header_item(bigint);
void header_item_triclinic(bigint);
typedef void (DumpCustom::*FnPtrData)(int, double *);
FnPtrData write_choice; // ptr to write data functions
void write_binary(int, double *);
void write_text(int, double *);
// customize by adding a method prototype
typedef void (DumpCustom::*FnPtrPack)(int);
FnPtrPack *pack_choice; // ptrs to pack functions
void pack_id(int);
void pack_molecule(int);
void pack_type(int);
void pack_mass(int);
void pack_x(int);
void pack_y(int);
void pack_z(int);
void pack_xs(int);
void pack_ys(int);
void pack_zs(int);
void pack_xs_triclinic(int);
void pack_ys_triclinic(int);
void pack_zs_triclinic(int);
void pack_xu(int);
void pack_yu(int);
void pack_zu(int);
void pack_xu_triclinic(int);
void pack_yu_triclinic(int);
void pack_zu_triclinic(int);
void pack_xsu(int);
void pack_ysu(int);
void pack_zsu(int);
void pack_xsu_triclinic(int);
void pack_ysu_triclinic(int);
void pack_zsu_triclinic(int);
void pack_ix(int);
void pack_iy(int);
void pack_iz(int);
void pack_vx(int);
void pack_vy(int);
void pack_vz(int);
void pack_fx(int);
void pack_fy(int);
void pack_fz(int);
void pack_q(int);
void pack_mux(int);
void pack_muy(int);
void pack_muz(int);
void pack_mu(int);
void pack_radius(int);
void pack_diameter(int);
void pack_omegax(int);
void pack_omegay(int);
void pack_omegaz(int);
void pack_angmomx(int);
void pack_angmomy(int);
void pack_angmomz(int);
void pack_tqx(int);
void pack_tqy(int);
void pack_tqz(int);
void pack_spin(int);
void pack_eradius(int);
void pack_ervel(int);
void pack_erforce(int);
void pack_compute(int);
void pack_fix(int);
void pack_variable(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: No dump custom arguments specified
+
+The dump custom command requires that atom quantities be specified to
+output to dump file.
+
+E: Invalid attribute in dump custom command
+
+Self-explantory.
+
+E: Could not find dump custom compute ID
+
+The compute ID needed by dump custom to compute a per-atom quantity
+does not exist.
+
+E: Could not find dump custom fix ID
+
+Self-explanatory.
+
+E: Dump custom and fix not computed at compatible times
+
+The fix must produce per-atom quantities on timesteps that dump custom
+needs them.
+
+E: Could not find dump custom variable name
+
+Self-explanatory.
+
+E: Region ID for dump custom does not exist
+
+Self-explanatory.
+
+E: Threshhold for an atom property that isn't allocated
+
+A dump threshhold has been requested on a quantity that is
+not defined by the atom style used in this simulation.
+
+E: Dumping an atom property that isn't allocated
+
+The chosen atom style does not define the per-atom quantity being
+dumped.
+
+E: Dumping an atom quantity that isn't allocated
+
+Only per-atom quantities that are defined for the atom style being
+used are allowed.
+
+E: Dump custom compute does not compute per-atom info
+
+Self-explanatory.
+
+E: Dump custom compute does not calculate per-atom vector
+
+Self-explanatory.
+
+E: Dump custom compute does not calculate per-atom array
+
+Self-explanatory.
+
+E: Dump custom compute vector is accessed out-of-range
+
+Self-explanatory.
+
+E: Dump custom fix does not compute per-atom info
+
+Self-explanatory.
+
+E: Dump custom fix does not compute per-atom vector
+
+Self-explanatory.
+
+E: Dump custom fix does not compute per-atom array
+
+Self-explanatory.
+
+E: Dump custom fix vector is accessed out-of-range
+
+Self-explanatory.
+
+E: Dump custom variable is not atom-style variable
+
+Only atom-style variables generate per-atom quantities, needed for
+dump output.
+
+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: Dump_modify region ID does not exist
+
+Self-explanatory.
+
+E: Dump modify element names do not match atom types
+
+Number of element names must equal number of atom types.
+
+E: Invalid attribute in dump modify command
+
+Self-explantory.
+
+E: Could not find dump modify compute ID
+
+Self-explanatory.
+
+E: Dump modify compute ID does not compute per-atom info
+
+Self-explanatory.
+
+E: Dump modify compute ID does not compute per-atom vector
+
+Self-explanatory.
+
+E: Dump modify compute ID does not compute per-atom array
+
+Self-explanatory.
+
+E: Dump modify compute ID vector is not large enough
+
+Self-explanatory.
+
+E: Could not find dump modify fix ID
+
+Self-explanatory.
+
+E: Dump modify fix ID does not compute per-atom info
+
+Self-explanatory.
+
+E: Dump modify fix ID does not compute per-atom vector
+
+Self-explanatory.
+
+E: Dump modify fix ID does not compute per-atom array
+
+Self-explanatory.
+
+E: Dump modify fix ID vector is not large enough
+
+Self-explanatory.
+
+E: Could not find dump modify variable name
+
+Self-explanatory.
+
+E: Dump modify variable is not atom-style variable
+
+Self-explanatory.
+
+E: Invalid dump_modify threshhold operator
+
+Operator keyword used for threshold specification in not recognized.
+
+*/
diff --git a/src/dump_dcd.h b/src/dump_dcd.h
index 80598bd1d..a0197021b 100644
--- a/src/dump_dcd.h
+++ b/src/dump_dcd.h
@@ -1,57 +1,103 @@
/* ----------------------------------------------------------------------
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 DUMP_CLASS
DumpStyle(dcd,DumpDCD)
#else
#ifndef LMP_DUMP_DCD_H
#define LMP_DUMP_DCD_H
#include "stdio.h"
#include "dump.h"
#include "inttypes.h"
namespace LAMMPS_NS {
class DumpDCD : public Dump {
public:
DumpDCD(LAMMPS *, int, char**);
~DumpDCD();
private:
int natoms,ntotal;
int headerflag,nevery_save,nframes;
float *coords,*xf,*yf,*zf;
int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no
void init_style();
void openfile();
void write_header(bigint);
int count();
void pack(int *);
void write_data(int, double *);
int modify_param(int, char **);
bigint memory_usage();
void write_frame();
void write_dcd_header(const char *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Invalid dump dcd filename
+
+Filenames used with the dump dcd style cannot be binary or compressed
+or cause multiple files to be written.
+
+E: Too many atoms for dump dcd
+
+The system size must fit in a 32-bit integer to use this dump
+style.
+
+E: Dump dcd requires sorting by atom ID
+
+Use the dump_modify sort command to enable this.
+
+E: Cannot use variable every setting for dump dcd
+
+The format of DCD dump files requires snapshots be output
+at a constant frequency.
+
+E: Cannot change dump_modify every for dump dcd
+
+The frequency of writing dump dcd snapshots cannot be changed.
+
+E: Cannot open dump file
+
+The output file for the dump command cannot be opened. Check that the
+path and name are correct.
+
+E: Dump dcd of non-matching # of atoms
+
+Every snapshot written by dump dcd must contain the same # of atoms.
+
+E: Too big a timestep for dump dcd
+
+The timestep must fit in a 32-bit integer to use this dump style.
+
+*/
diff --git a/src/dump_image.cpp b/src/dump_image.cpp
index 16f677327..eeef5adf1 100644
--- a/src/dump_image.cpp
+++ b/src/dump_image.cpp
@@ -1,2311 +1,2310 @@
/* ----------------------------------------------------------------------
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: Nathan Fabian (Sandia)
------------------------------------------------------------------------- */
#include "mpi.h"
#include "math.h"
#include "ctype.h"
#include "stdlib.h"
#include "string.h"
#include "dump_image.h"
#include "math_extra.h"
#include "atom.h"
#include "domain.h"
#include "group.h"
#include "force.h"
#include "comm.h"
#include "input.h"
#include "variable.h"
#include "random_mars.h"
#include "math_const.h"
#include "error.h"
#include "memory.h"
#ifdef LAMMPS_JPEG
#include "jpeglib.h"
#endif
using namespace LAMMPS_NS;
using namespace MathConst;
#define NCOLORS 140
#define NELEMENTS 109
#define BIG 1.0e20
enum{PPM,JPG};
enum{NUMERIC,ATOM,TYPE,ELEMENT,ATTRIBUTE,MINVALUE,MAXVALUE};
enum{STATIC,DYNAMIC};
enum{CONTINUOUS,DISCRETE,SEQUENTIAL};
enum{ABSOLUTE,FRACTIONAL};
enum{NO,YES};
/* ---------------------------------------------------------------------- */
DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
DumpCustom(lmp, narg, arg)
{
if (binary || multiproc) error->all(FLERR,"Invalid dump image filename");
// set filetype based on filename suffix
int n = strlen(filename);
if (strlen(filename) > 4 && strcmp(&filename[n-4],".jpg") == 0)
filetype = JPG;
else if (strlen(filename) > 5 && strcmp(&filename[n-5],".jpeg") == 0)
filetype = JPG;
else filetype = PPM;
#ifndef LAMMPS_JPEG
if (filetype == JPG) error->all(FLERR,"Cannot dump JPG file");
#endif
// atom color,diameter settings
if (nfield != 2) error->all(FLERR,"Illegal dump image command");
acolor = ATTRIBUTE;
if (strcmp(arg[5],"type") == 0) acolor = TYPE;
else if (strcmp(arg[5],"element") == 0) acolor = ELEMENT;
adiam = ATTRIBUTE;
if (strcmp(arg[6],"type") == 0) adiam = TYPE;
else if (strcmp(arg[6],"element") == 0) adiam = ELEMENT;
// set defaults for optional args
atomflag = YES;
if (atom->nbondtypes == 0) bondflag = NO;
else {
bondflag = YES;
bcolor = ATOM;
bdiam = NUMERIC;
bdiamvalue = 0.5;
}
width = height = 512;
theta = 60.0 * MY_PI/180.0;
phi = 30.0 * MY_PI/180.0;
thetastr = phistr = NULL;
cflag = STATIC;
cx = cy = cz = 0.5;
cxstr = cystr = czstr = NULL;
if (domain->dimension == 3) {
up[0] = 0.0; up[1] = 0.0; up[2] = 1.0;
} else {
up[0] = 0.0; up[1] = 1.0; up[2] = 0.0;
}
upxstr = upystr = upzstr = NULL;
zoom = 1.0;
zoomstr = NULL;
persp = 0.0;
perspstr = NULL;
boxflag = YES;
boxdiam = 0.02;
axesflag = NO;
shiny = 1.0;
ssao = NO;
// parse optional args
int iarg = ioptional;
while (iarg < narg) {
if (strcmp(arg[iarg],"adiam") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
adiam = NUMERIC;
adiamvalue = atof(arg[iarg+1]);
if (adiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
iarg += 2;
} else if (strcmp(arg[iarg],"atom") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
if (strcmp(arg[iarg+1],"yes") == 0) atomflag = YES;
else if (strcmp(arg[iarg+1],"no") == 0) atomflag = NO;
else error->all(FLERR,"Illegal dump image command");
iarg += 2;
} else if (strcmp(arg[iarg],"bond") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (atom->nbondtypes == 0)
error->all(FLERR,"Dump image bond not allowed with no bond types");
bondflag = YES;
if (strcmp(arg[iarg+1],"none") == 0) bondflag = NO;
else if (strcmp(arg[iarg+1],"atom") == 0) bcolor = ATOM;
else if (strcmp(arg[iarg+1],"type") == 0) bcolor = TYPE;
else error->all(FLERR,"Illegal dump image command");
if (!islower(arg[iarg+2][0])) {
bdiam = NUMERIC;
bdiamvalue = atof(arg[iarg+2]);
if (bdiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
} else if (strcmp(arg[iarg+2],"atom") == 0) bdiam = ATOM;
else if (strcmp(arg[iarg+2],"type") == 0) bdiam = TYPE;
else if (strcmp(arg[iarg+2],"none") == 0) bondflag = NO;
else error->all(FLERR,"Illegal dump image command");
iarg += 3;
} else if (strcmp(arg[iarg],"size") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
width = atoi(arg[iarg+1]);
height = atoi(arg[iarg+2]);
if (width <= 0 || height <= 0) error->all(FLERR,"Illegal dump image command");
iarg += 3;
} else if (strcmp(arg[iarg],"view") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
int n = strlen(&arg[iarg+1][2]) + 1;
thetastr = new char[n];
strcpy(thetastr,&arg[iarg+1][2]);
} else {
theta = atof(arg[iarg+1]);
if (theta < 0.0 || theta > 180.0)
error->all(FLERR,"Invalid dump image theta value");
theta *= MY_PI/180.0;
}
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
phistr = new char[n];
strcpy(phistr,&arg[iarg+2][2]);
} else {
phi = atof(arg[iarg+2]);
phi *= MY_PI/180.0;
}
iarg += 3;
} else if (strcmp(arg[iarg],"center") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal dump image command");
if (strcmp(arg[iarg+1],"s") == 0) cflag = STATIC;
else if (strcmp(arg[iarg+1],"d") == 0) cflag = DYNAMIC;
else error->all(FLERR,"Illegal dump image command");
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
cxstr = new char[n];
strcpy(cxstr,&arg[iarg+2][2]);
cflag = DYNAMIC;
} else cx = atof(arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
cystr = new char[n];
strcpy(cystr,&arg[iarg+3][2]);
cflag = DYNAMIC;
} else cy = atof(arg[iarg+3]);
if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
int n = strlen(&arg[iarg+4][2]) + 1;
czstr = new char[n];
strcpy(czstr,&arg[iarg+4][2]);
cflag = DYNAMIC;
} else cz = atof(arg[iarg+4]);
iarg += 5;
} else if (strcmp(arg[iarg],"up") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
int n = strlen(&arg[iarg+1][2]) + 1;
upxstr = new char[n];
strcpy(upxstr,&arg[iarg+1][2]);
} else up[0] = atof(arg[iarg+1]);
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
upystr = new char[n];
strcpy(upystr,&arg[iarg+2][2]);
} else up[1] = atof(arg[iarg+1]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
upzstr = new char[n];
strcpy(upzstr,&arg[iarg+3][2]);
} else up[2] = atof(arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"zoom") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
int n = strlen(&arg[iarg+1][2]) + 1;
zoomstr = new char[n];
strcpy(zoomstr,&arg[iarg+1][2]);
} else {
zoom = atof(arg[iarg+1]);
if (zoom <= 0.0) error->all(FLERR,"Illegal dump image command");
}
iarg += 2;
} else if (strcmp(arg[iarg],"persp") == 0) {
error->all(FLERR,"Dump image persp option is not yet supported");
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
int n = strlen(&arg[iarg+1][2]) + 1;
perspstr = new char[n];
strcpy(perspstr,&arg[iarg+1][2]);
} else {
persp = atof(arg[iarg+1]);
if (persp < 0.0) error->all(FLERR,"Illegal dump image command");
}
iarg += 2;
} else if (strcmp(arg[iarg],"box") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (strcmp(arg[iarg+1],"yes") == 0) boxflag = YES;
else if (strcmp(arg[iarg+1],"no") == 0) boxflag = NO;
else error->all(FLERR,"Illegal dump image command");
boxdiam = atof(arg[iarg+2]);
if (boxdiam < 0.0) error->all(FLERR,"Illegal dump image command");
iarg += 3;
} else if (strcmp(arg[iarg],"axes") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (strcmp(arg[iarg+1],"yes") == 0) axesflag = YES;
else if (strcmp(arg[iarg+1],"no") == 0) axesflag = NO;
else error->all(FLERR,"Illegal dump image command");
axeslen = atof(arg[iarg+2]);
axesdiam = atof(arg[iarg+3]);
if (axeslen < 0.0 || axesdiam < 0.0)
error->all(FLERR,"Illegal dump image command");
iarg += 4;
} else if (strcmp(arg[iarg],"shiny") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
shiny = atof(arg[iarg+1]);
if (shiny < 0.0 || shiny > 1.0)
error->all(FLERR,"Illegal dump image command");
iarg += 2;
} else if (strcmp(arg[iarg],"ssao") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
if (strcmp(arg[iarg+1],"yes") == 0) ssao = YES;
else if (strcmp(arg[iarg+1],"no") == 0) ssao = NO;
else error->all(FLERR,"Illegal dump image command");
seed = atoi(arg[iarg+2]);
if (seed <= 0) error->all(FLERR,"Illegal dump image command");
ssaoint = atof(arg[iarg+3]);
if (ssaoint < 0.0 || ssaoint > 1.0)
error->all(FLERR,"Illegal dump image command");
iarg += 4;
} else error->all(FLERR,"Illegal dump image command");
}
// params based on args
npixels = width * height;
if (bondflag) {
if (bcolor == ATOM || bdiam == ATOM) comm_forward = 3;
else comm_forward = 1;
}
// additional defaults for dump_modify options
ncolors = 0;
username = NULL;
userrgb = NULL;
diamtype = new double[ntypes+1];
diamelement = new double[ntypes+1];
colortype = new double*[ntypes+1];
colorelement = new double*[ntypes+1];
for (int i = 1; i <= ntypes; i++) {
diamtype[i] = 1.0;
if (i % 6 == 1) colortype[i] = color2rgb("red");
else if (i % 6 == 2) colortype[i] = color2rgb("green");
else if (i % 6 == 3) colortype[i] = color2rgb("blue");
else if (i % 6 == 4) colortype[i] = color2rgb("yellow");
else if (i % 6 == 5) colortype[i] = color2rgb("aqua");
else if (i % 6 == 0) colortype[i] = color2rgb("cyan");
}
if (bondflag) {
bdiamtype = new double[atom->nbondtypes+1];
bcolortype = new double*[atom->nbondtypes+1];
for (int i = 1; i <= atom->nbondtypes; i++) {
bdiamtype[i] = 0.5;
if (i % 6 == 1) bcolortype[i] = color2rgb("red");
else if (i % 6 == 2) bcolortype[i] = color2rgb("green");
else if (i % 6 == 3) bcolortype[i] = color2rgb("blue");
else if (i % 6 == 4) bcolortype[i] = color2rgb("yellow");
else if (i % 6 == 5) bcolortype[i] = color2rgb("aqua");
else if (i % 6 == 0) bcolortype[i] = color2rgb("cyan");
}
} else {
bdiamtype = NULL;
bcolortype = NULL;
}
boxcolor = color2rgb("yellow");
background[0] = background[1] = background[2] = 0;
mlo = MINVALUE;
mhi = MAXVALUE;
mstyle = CONTINUOUS;
mrange = FRACTIONAL;
nentry = 2;
mentry = new MapEntry[nentry];
mentry[0].svalue = 0.0;
mentry[0].color = color2rgb("blue");
mentry[1].svalue = 1.0;
mentry[1].color = color2rgb("red");
// static parameters
FOV = MY_PI/6.0; // 30 degrees
ambientColor[0] = 0.0;
ambientColor[1] = 0.0;
ambientColor[2] = 0.0;
keyLightPhi = -MY_PI4; // -45 degrees
keyLightTheta = MY_PI/6.0; // 30 degrees
keyLightColor[0] = 0.9;
keyLightColor[1] = 0.9;
keyLightColor[2] = 0.9;
fillLightPhi = MY_PI/6.0; // 30 degrees
fillLightTheta = 0;
fillLightColor[0] = 0.45;
fillLightColor[1] = 0.45;
fillLightColor[2] = 0.45;
backLightPhi = MY_PI; // 180 degrees
backLightTheta = MY_PI/12.0; // 15 degrees
backLightColor[0] = 0.9;
backLightColor[1] = 0.9;
backLightColor[2] = 0.9;
// viewflag = DYNAMIC if any view parameter is dynamic
viewflag = STATIC;
if (thetastr || phistr || cflag == DYNAMIC ||
upxstr || upystr || upzstr || zoomstr || perspstr) viewflag = DYNAMIC;
if (cflag == STATIC) box_center();
if (viewflag == STATIC) view_params();
// image and depth buffers
depthBuffer = (double *) memory->smalloc(npixels*sizeof(double),
"dump:depthBuffer");
surfaceBuffer = (double *) memory->smalloc(2*npixels*sizeof(double),
"dump:surfaceBuffer");
imageBuffer = (char *) memory->smalloc(3*npixels*sizeof(char),
"dump:imageBuffer");
depthcopy = (double *) memory->smalloc(npixels*sizeof(double),
"dump:depthcopy");
surfacecopy = (double *) memory->smalloc(npixels*2*sizeof(double),
"dump:surfacecopy");
rgbcopy = (char *) memory->smalloc(3*npixels*sizeof(char),
"dump:rgbcopy");
maxbufcopy = 0;
bufcopy = NULL;
// RNG for SSAO depth shading
if (ssao) random = new RanMars(lmp,seed+me);
else random = NULL;
}
/* ---------------------------------------------------------------------- */
DumpImage::~DumpImage()
{
delete [] diamtype;
delete [] diamelement;
delete [] colortype;
delete [] colorelement;
delete [] bdiamtype;
delete [] bcolortype;
for (int i = 0; i < ncolors; i++) delete [] username[i];
memory->sfree(username);
memory->destroy(userrgb);
delete [] mentry;
memory->sfree(depthBuffer);
memory->sfree(surfaceBuffer);
memory->sfree(imageBuffer);
memory->sfree(depthcopy);
memory->sfree(surfacecopy);
memory->sfree(rgbcopy);
memory->destroy(bufcopy);
delete random;
}
/* ---------------------------------------------------------------------- */
void DumpImage::init_style()
{
if (multifile == 0) error->all(FLERR,"Dump image requires one snapshot per file");
if (sort_flag) error->all(FLERR,"Dump image cannot perform sorting");
DumpCustom::init_style();
// check variables
if (thetastr) {
thetavar = input->variable->find(thetastr);
if (thetavar < 0)
error->all(FLERR,"Variable name for dump image theta does not exist");
if (!input->variable->equalstyle(thetavar))
error->all(FLERR,"Variable for dump image theta is invalid style");
}
if (phistr) {
phivar = input->variable->find(phistr);
if (phivar < 0)
error->all(FLERR,"Variable name for dump image phi does not exist");
if (!input->variable->equalstyle(phivar))
error->all(FLERR,"Variable for dump image phi is invalid style");
}
if (cxstr) {
cxvar = input->variable->find(cxstr);
if (cxvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
if (!input->variable->equalstyle(cxvar))
error->all(FLERR,"Variable for dump image center is invalid style");
}
if (cystr) {
cyvar = input->variable->find(cystr);
if (cyvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
if (!input->variable->equalstyle(cyvar))
error->all(FLERR,"Variable for dump image center is invalid style");
}
if (czstr) {
czvar = input->variable->find(czstr);
if (czvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
if (!input->variable->equalstyle(czvar))
error->all(FLERR,"Variable for dump image center is invalid style");
}
if (upxstr) {
upxvar = input->variable->find(upxstr);
if (upxvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
if (!input->variable->equalstyle(upxvar))
error->all(FLERR,"Variable for dump image center is invalid style");
}
if (upystr) {
upyvar = input->variable->find(upystr);
if (upyvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
if (!input->variable->equalstyle(upyvar))
error->all(FLERR,"Variable for dump image center is invalid style");
}
if (upzstr) {
upzvar = input->variable->find(upzstr);
if (upzvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
if (!input->variable->equalstyle(upzvar))
error->all(FLERR,"Variable for dump image center is invalid style");
}
if (zoomstr) {
zoomvar = input->variable->find(zoomstr);
if (zoomvar < 0)
error->all(FLERR,"Variable name for dump image zoom does not exist");
if (!input->variable->equalstyle(zoomvar))
error->all(FLERR,"Variable for dump image zoom is invalid style");
}
if (perspstr) {
perspvar = input->variable->find(perspstr);
if (perspvar < 0)
error->all(FLERR,"Variable name for dump image persp does not exist");
if (!input->variable->equalstyle(perspvar))
error->all(FLERR,"Variable for dump image persp is invalid style");
}
// set up type -> element mapping
if (atomflag && acolor == ELEMENT) {
for (int i = 1; i <= ntypes; i++) {
colorelement[i] = element2color(typenames[i]);
if (colorelement[i] == NULL)
error->all(FLERR,"Invalid dump image element name");
}
}
if (atomflag && adiam == ELEMENT) {
for (int i = 1; i <= ntypes; i++) {
diamelement[i] = element2diam(typenames[i]);
if (diamelement[i] == 0.0)
error->all(FLERR,"Invalid dump image element name");
}
}
}
/* ---------------------------------------------------------------------- */
void DumpImage::write()
{
MPI_Request requests[3];
MPI_Status statuses[3];
// open new file
openfile();
// reset box center and view parameters if dynamic
if (cflag == DYNAMIC) box_center();
if (viewflag == DYNAMIC) view_params();
// nme = # of atoms this proc will contribute to dump
// pack buf with x,y,z,color,diameter
// set minmax color range if using color map
// create my portion of image for my particles
nme = count();
if (nme > maxbuf) {
maxbuf = nme;
memory->destroy(buf);
memory->create(buf,maxbuf*size_one,"dump:buf");
}
pack(NULL);
if (acolor == ATTRIBUTE) color_minmax();
create_image();
// merge images across procs using depth buffer
// hi procs send to lo procs, cascading down logarithmically
int nhalf = 1;
while (nhalf < nprocs) nhalf *= 2;
nhalf /= 2;
while (nhalf) {
if (me < nhalf && me+nhalf < nprocs) {
MPI_Irecv(rgbcopy,npixels*3,MPI_BYTE,me+nhalf,0,world,&requests[0]);
MPI_Irecv(depthcopy,npixels,MPI_DOUBLE,me+nhalf,0,world,&requests[1]);
if (ssao)
MPI_Irecv(surfacecopy,npixels*2,MPI_DOUBLE,
me+nhalf,0,world,&requests[2]);
if (ssao) MPI_Waitall(3,requests,statuses);
else MPI_Waitall(2,requests,statuses);
for (int i = 0; i < npixels; i++) {
if (depthBuffer[i] < 0 || (depthcopy[i] >= 0 &&
depthcopy[i] < depthBuffer[i])) {
depthBuffer[i] = depthcopy[i];
imageBuffer[i*3+0] = rgbcopy[i*3+0];
imageBuffer[i*3+1] = rgbcopy[i*3+1];
imageBuffer[i*3+2] = rgbcopy[i*3+2];
if (ssao) {
surfaceBuffer[i*2+0] = surfacecopy[i*2+0];
surfaceBuffer[i*2+1] = surfacecopy[i*2+1];
}
}
}
} else if (me >= nhalf && me < 2*nhalf) {
MPI_Send(imageBuffer,npixels*3,MPI_BYTE,me-nhalf,0,world);
MPI_Send(depthBuffer,npixels,MPI_DOUBLE,me-nhalf,0,world);
if (ssao) MPI_Send(surfaceBuffer,npixels*2,MPI_DOUBLE,me-nhalf,0,world);
}
nhalf /= 2;
}
// extra SSAO enhancement
// bcast full image to all procs
// each works on subset of pixels
// gather result back to proc 0
if (ssao) {
MPI_Bcast(imageBuffer,npixels*3,MPI_BYTE,0,world);
MPI_Bcast(surfaceBuffer,npixels*2,MPI_DOUBLE,0,world);
MPI_Bcast(depthBuffer,npixels,MPI_DOUBLE,0,world);
compute_SSAO();
int pixelPart = height/nprocs * width*3;
MPI_Gather(imageBuffer+me*pixelPart,pixelPart,MPI_BYTE,
rgbcopy,pixelPart,MPI_BYTE,0,world);
writeBuffer = rgbcopy;
} else {
writeBuffer = imageBuffer;
}
// write image file
if (me == 0) {
if (filetype == JPG) write_JPG();
else write_PPM();
fclose(fp);
}
}
/* ----------------------------------------------------------------------
reset view parameters
called once from constructor if view is STATIC
called every snapshot from write() if view is DYNAMIC
------------------------------------------------------------------------- */
void DumpImage::box_center()
{
box_bounds();
if (cxstr) phi = input->variable->compute_equal(cxvar);
if (cystr) phi = input->variable->compute_equal(cyvar);
if (czstr) phi = input->variable->compute_equal(czvar);
xctr = boxxlo + cx*(boxxhi-boxxlo);
yctr = boxylo + cy*(boxyhi-boxylo);
zctr = boxzlo + cz*(boxzhi-boxzlo);
}
/* ----------------------------------------------------------------------
reset view parameters
called once from constructor if view is STATIC
called every snapshot from write() if view is DYNAMIC
------------------------------------------------------------------------- */
void DumpImage::view_params()
{
// camDir = camera direction
if (thetastr) {
theta = input->variable->compute_equal(thetavar);
if (theta < 0.0 || theta > 180.0)
error->all(FLERR,"Invalid dump image theta value");
theta *= MY_PI/180.0;
}
if (phistr) {
phi = input->variable->compute_equal(phivar);
phi *= MY_PI/180.0;
}
camDir[0] = sin(theta)*cos(phi);
camDir[1] = sin(theta)*sin(phi);
camDir[2] = cos(theta);
// up vector
if (upxstr) up[0] = input->variable->compute_equal(upxvar);
if (upystr) up[1] = input->variable->compute_equal(upyvar);
if (upzstr) up[2] = input->variable->compute_equal(upzvar);
// zdist = camera distance = function of zoom & bounding box
// camPos = camera position = function of camDir and zdist
box_bounds();
if (zoomstr) zoom = input->variable->compute_equal(zoomvar);
if (zoom <= 0.0) error->all(FLERR,"Invalid dump image zoom value");
if (perspstr) persp = input->variable->compute_equal(perspvar);
if (persp < 0.0) error->all(FLERR,"Invalid dump image persp value");
double delx = 2.0*(boxxhi-boxxlo);
double dely = 2.0*(boxyhi-boxylo);
double delz = 2.0*(boxzhi-boxzlo);
double maxdel = MAX(delx,dely);
maxdel = MAX(maxdel,delz);
zdist = maxdel;
zdist /= tan(FOV);
zdist += 0.5 * (delx*camDir[0] + dely*camDir[1] + delz*camDir[2]);
zdist /= zoom;
camPos[0] = camDir[0] * zdist;
camPos[1] = camDir[1] * zdist;
camPos[2] = camDir[2] * zdist;
// camUp = camDir x (Up x camDir)
// camDir points at the camera, view direction = -camDir
if (camDir[0] == up[0] && camDir[1] == up[1] && camDir[2] == up[2]) {
double tmp = up[0];
up[0] = up[1];
up[1] = up[2];
up[2] = tmp;
}
MathExtra::cross3(up,camDir,camRight);
MathExtra::norm3(camRight);
MathExtra::cross3(camDir,camRight,camUp);
if (camUp[0] == 0.0 && camUp[1] == 0.0 && camUp[2] == 0.0)
error->all(FLERR,"Invalid dump image up vector");
MathExtra::norm3(camUp);
// light directions in terms of -camDir = z
keyLightDir[0] = cos(keyLightTheta) * sin(keyLightPhi);
keyLightDir[1] = sin(keyLightTheta);
keyLightDir[2] = cos(keyLightTheta) * cos(keyLightPhi);
fillLightDir[0] = cos(fillLightTheta) * sin(fillLightPhi);
fillLightDir[1] = sin(fillLightTheta);
fillLightDir[2] = cos(fillLightTheta) * cos(fillLightPhi);
backLightDir[0] = cos(backLightTheta) * sin(backLightPhi);
backLightDir[1] = sin(backLightTheta);
backLightDir[2] = cos(backLightTheta) * cos(backLightPhi);
keyHalfDir[0] = 0 + keyLightDir[0];
keyHalfDir[1] = 0 + keyLightDir[1];
keyHalfDir[2] = 1 + keyLightDir[2];
MathExtra::norm3(keyHalfDir);
// adjust shinyness of the reflection
specularHardness = 16.0 * shiny;
specularIntensity = shiny;
// adjust strength of the SSAO
if (ssao) {
SSAORadius = maxdel * 0.05 * ssaoint;
SSAOSamples = static_cast<int> (8.0 + 32.0*ssaoint);
SSAOJitter = MY_PI / 12;
ambientColor[0] = 0.5;
ambientColor[1] = 0.5;
ambientColor[2] = 0.5;
}
// param for rasterizing spheres
tanPerPixel = -(maxdel / (double) height);
}
/* ----------------------------------------------------------------------
simulation box bounds
------------------------------------------------------------------------- */
void DumpImage::box_bounds()
{
if (domain->triclinic == 0) {
boxxlo = domain->boxlo[0];
boxxhi = domain->boxhi[0];
boxylo = domain->boxlo[1];
boxyhi = domain->boxhi[1];
boxzlo = domain->boxlo[2];
boxzhi = domain->boxhi[2];
} else {
boxxlo = domain->boxlo_bound[0];
boxxhi = domain->boxhi_bound[0];
boxylo = domain->boxlo_bound[1];
boxyhi = domain->boxhi_bound[1];
boxzlo = domain->boxlo_bound[2];
boxzhi = domain->boxhi_bound[2];
boxxy = domain->xy;
boxxz = domain->xz;
boxyz = domain->yz;
}
}
/* ----------------------------------------------------------------------
set explicit values for all min/max settings in color map
lo/hi current and lvalue/hvalue settings for lo/hi = MIN/MAX VALUE in entries
if mlo/mhi = MIN/MAX VALUE, compute bounds on just the atoms being visualized
------------------------------------------------------------------------- */
void DumpImage::color_minmax()
{
double two[2],twoall[2];
if (mlo == MINVALUE || mhi == MAXVALUE) {
double lo = BIG;
double hi = -BIG;
int m = 0;
for (int i = 0; i < nchoose; i++) {
lo = MIN(lo,buf[m]);
hi = MAX(hi,buf[m+1]);
m += size_one;
}
two[0] = -lo;
two[1] = hi;
MPI_Allreduce(two,twoall,2,MPI_DOUBLE,MPI_MAX,world);
}
if (mlo == MINVALUE) locurrent = -twoall[0];
else locurrent = mlovalue;
if (mhi == MAXVALUE) hicurrent = twoall[1];
else hicurrent = mhivalue;
if (locurrent > hicurrent) error->all(FLERR,"Invalid dump image color range");
if (mstyle == CONTINUOUS) {
if (mrange == ABSOLUTE) mentry[0].svalue = locurrent;
else mentry[0].svalue = 0.0;
if (mrange == ABSOLUTE) mentry[nentry-1].svalue = hicurrent;
else mentry[nentry-1].svalue = 1.0;
} else if (mstyle == DISCRETE) {
for (int i = 0; i < nentry; i++) {
if (mentry[i].lo == MINVALUE) {
if (mrange == ABSOLUTE) mentry[i].lvalue = locurrent;
else mentry[i].lvalue = 0.0;
}
if (mentry[i].hi == MAXVALUE) {
if (mrange == ABSOLUTE) mentry[i].hvalue = hicurrent;
else mentry[i].hvalue = 1.0;
}
}
}
}
/* ----------------------------------------------------------------------
create image for atoms on this proc
every pixel has depth
------------------------------------------------------------------------- */
void DumpImage::create_image()
{
int i,j,m,itype,atom1,atom2;
double diameter,delx,dely,delz;
double *color,*color1,*color2;
double xmid[3];
// initialze image buffers
// no need to init surfaceBuffer, since will be based on depth
int red = background[0];
int green = background[1];
int blue = background[2];
int ix,iy;
for (iy = 0; iy < height; iy ++) {
for (ix = 0; ix < width; ix ++) {
imageBuffer[iy * width * 3 + ix * 3 + 0] = red;
imageBuffer[iy * width * 3 + ix * 3 + 1] = green;
imageBuffer[iy * width * 3 + ix * 3 + 2] = blue;
depthBuffer[iy * width + ix] = -1;
}
}
// render my atoms
if (atomflag) {
double **x = atom->x;
m = 0;
for (i = 0; i < nchoose; i++) {
j = clist[i];
if (acolor == TYPE) {
itype = static_cast<int> (buf[m]);
color = colortype[itype];
} else if (acolor == ELEMENT) {
itype = static_cast<int> (buf[m]);
color = colorelement[itype];
} else if (acolor == ATTRIBUTE) {
color = value2color(buf[m]);
}
if (adiam == NUMERIC) {
diameter = adiamvalue;
} else if (adiam == TYPE) {
itype = static_cast<int> (buf[m+1]);
diameter = diamtype[itype];
} else if (adiam == ELEMENT) {
itype = static_cast<int> (buf[m+1]);
diameter = diamelement[itype];
} else if (adiam == ATTRIBUTE) {
diameter = buf[m+1];
}
draw_sphere(x[j],color,diameter);
m += size_one;
}
}
// render bonds for my atoms
// both atoms in bond must be selected for bond to be rendered
// if newton_bond is off, only render bond once
// render bond in 2 pieces if crosses periodic boundary
// if bond is deleted (type = 0), do not render
// if bond is turned off (type < 0), still render
if (bondflag) {
double **x = atom->x;
int *tag = atom->tag;
int **bond_atom = atom->bond_atom;
int **bond_type = atom->bond_type;
int *num_bond = atom->num_bond;
int *type = atom->type;
int nlocal = atom->nlocal;
int nall = atom->nlocal + atom->nghost;
int newton_bond = force->newton_bond;
// communicate choose flag for ghost atoms to know if they are selected
// if bcolor/bdiam = ATOM, setup bufcopy to comm atom color/diam attributes
if (comm_forward == 3) {
if (nall > maxbufcopy) {
maxbufcopy = atom->nmax;
memory->destroy(bufcopy);
memory->create(bufcopy,maxbufcopy,2,"dump:bufcopy");
}
for (i = 0; i < nlocal; i++) bufcopy[i][0] = bufcopy[i][1] = 0.0;
m = 0;
for (i = 0; i < nchoose; i++) {
j = clist[i];
bufcopy[j][0] = buf[m];
bufcopy[j][1] = buf[m+1];
m += size_one;
}
}
comm->forward_comm_dump(this);
for (i = 0; i < nchoose; i++) {
atom1 = clist[i];
for (m = 0; m < num_bond[atom1]; m++) {
atom2 = atom->map(bond_atom[atom1][m]);
if (atom2 < 0 || !choose[atom2]) continue;
if (newton_bond == 0 && tag[atom1] > tag[atom2]) continue;
if (bond_type[atom1][m] == 0) continue;
if (bcolor == ATOM) {
if (acolor == TYPE) {
color1 = colortype[type[atom1]];
color2 = colortype[type[atom2]];
} else if (acolor == ELEMENT) {
color1 = colorelement[type[atom1]];
color2 = colorelement[type[atom2]];
} else if (acolor == ATTRIBUTE) {
color1 = value2color(bufcopy[atom1][0]);
color2 = value2color(bufcopy[atom2][0]);
}
} else if (bcolor == TYPE) {
itype = bond_type[atom1][m];
if (itype < 0) itype = -itype;
color = bcolortype[itype];
}
if (bdiam == NUMERIC) {
diameter = bdiamvalue;
} else if (bdiam == ATOM) {
if (adiam == NUMERIC) {
diameter = adiamvalue;
} else if (adiam == TYPE) {
diameter = MIN(diamtype[type[atom1]],diamtype[type[atom1]]);
} else if (adiam == ELEMENT) {
diameter = MIN(diamelement[type[atom1]],diamelement[type[atom1]]);
} else if (adiam == ATTRIBUTE) {
diameter = MIN(bufcopy[atom1][1],bufcopy[atom2][1]);
}
} else if (bdiam == TYPE) {
itype = bond_type[atom1][m];
if (itype < 0) itype = -itype;
diameter = bdiamtype[itype];
}
// draw cylinder in 2 pieces if bcolor = ATOM
// or bond crosses periodic boundary
delx = x[atom2][0] - x[atom1][0];
dely = x[atom2][1] - x[atom1][1];
delz = x[atom2][2] - x[atom1][2];
if (bcolor == ATOM || domain->minimum_image_check(delx,dely,delz)) {
domain->minimum_image(delx,dely,delz);
xmid[0] = x[atom1][0] + 0.5*delx;
xmid[1] = x[atom1][1] + 0.5*dely;
xmid[2] = x[atom1][2] + 0.5*delz;
if (bcolor == ATOM) draw_cylinder(x[atom1],xmid,color1,diameter,3);
else draw_cylinder(x[atom1],xmid,color,diameter,3);
xmid[0] = x[atom2][0] - 0.5*delx;
xmid[1] = x[atom2][1] - 0.5*dely;
xmid[2] = x[atom2][2] - 0.5*delz;
if (bcolor == ATOM) draw_cylinder(xmid,x[atom2],color2,diameter,3);
else draw_cylinder(xmid,x[atom2],color,diameter,3);
} else draw_cylinder(x[atom1],x[atom2],color,diameter,3);
}
}
}
// render outline of simulation box, orthogonal or triclinic
if (boxflag) {
double diameter = MIN(boxxhi-boxxlo,boxyhi-boxylo);
if (domain->dimension == 3) diameter = MIN(diameter,boxzhi-boxzlo);
diameter *= boxdiam;
double (*corners)[3];
double corner[8][3];
if (domain->triclinic == 0) {
corner[0][0] = boxxlo; corner[0][1] = boxylo; corner[0][2] = boxzlo;
corner[1][0] = boxxhi; corner[1][1] = boxylo; corner[1][2] = boxzlo;
corner[2][0] = boxxlo; corner[2][1] = boxyhi; corner[2][2] = boxzlo;
corner[3][0] = boxxhi; corner[3][1] = boxyhi; corner[3][2] = boxzlo;
corner[4][0] = boxxlo; corner[4][1] = boxylo; corner[4][2] = boxzhi;
corner[5][0] = boxxhi; corner[5][1] = boxylo; corner[5][2] = boxzhi;
corner[6][0] = boxxlo; corner[6][1] = boxyhi; corner[6][2] = boxzhi;
corner[7][0] = boxxhi; corner[7][1] = boxyhi; corner[7][2] = boxzhi;
corners = corner;
} else {
domain->box_corners();
corners = domain->corners;
}
draw_cylinder(corners[0],corners[1],boxcolor,diameter,3);
draw_cylinder(corners[2],corners[3],boxcolor,diameter,3);
draw_cylinder(corners[0],corners[2],boxcolor,diameter,3);
draw_cylinder(corners[1],corners[3],boxcolor,diameter,3);
draw_cylinder(corners[0],corners[4],boxcolor,diameter,3);
draw_cylinder(corners[1],corners[5],boxcolor,diameter,3);
draw_cylinder(corners[2],corners[6],boxcolor,diameter,3);
draw_cylinder(corners[3],corners[7],boxcolor,diameter,3);
draw_cylinder(corners[4],corners[5],boxcolor,diameter,3);
draw_cylinder(corners[6],corners[7],boxcolor,diameter,3);
draw_cylinder(corners[4],corners[6],boxcolor,diameter,3);
draw_cylinder(corners[5],corners[7],boxcolor,diameter,3);
}
// render XYZ axes in red/green/blue
// offset by 10% of box size and scale by axeslen
if (axesflag) {
double diameter = MIN(boxxhi-boxxlo,boxyhi-boxylo);
if (domain->dimension == 3) diameter = MIN(diameter,boxzhi-boxzlo);
diameter *= axesdiam;
double (*corners)[3];
double corner[8][3];
if (domain->triclinic == 0) {
corner[0][0] = boxxlo; corner[0][1] = boxylo; corner[0][2] = boxzlo;
corner[1][0] = boxxhi; corner[1][1] = boxylo; corner[1][2] = boxzlo;
corner[2][0] = boxxlo; corner[2][1] = boxyhi; corner[2][2] = boxzlo;
corner[4][0] = boxxlo; corner[4][1] = boxylo; corner[4][2] = boxzhi;
corners = corner;
} else {
domain->box_corners();
corners = domain->corners;
}
double offset = MAX(boxxhi-boxxlo,boxyhi-boxylo);
if (domain->dimension == 3) offset = MAX(offset,boxzhi-boxzlo);
offset *= 0.1;
corners[0][0] -= offset; corners[0][1] -= offset; corners[0][2] -= offset;
corners[1][0] -= offset; corners[1][1] -= offset; corners[1][2] -= offset;
corners[2][0] -= offset; corners[2][1] -= offset; corners[2][2] -= offset;
corners[4][0] -= offset; corners[4][1] -= offset; corners[4][2] -= offset;
corners[1][0] = corners[0][0] + axeslen*(corners[1][0]-corners[0][0]);
corners[1][1] = corners[0][1] + axeslen*(corners[1][1]-corners[0][1]);
corners[1][2] = corners[0][2] + axeslen*(corners[1][2]-corners[0][2]);
corners[2][0] = corners[0][0] + axeslen*(corners[2][0]-corners[0][0]);
corners[2][1] = corners[0][1] + axeslen*(corners[2][1]-corners[0][1]);
corners[2][2] = corners[0][2] + axeslen*(corners[2][2]-corners[0][2]);
corners[4][0] = corners[0][0] + axeslen*(corners[4][0]-corners[0][0]);
corners[4][1] = corners[0][1] + axeslen*(corners[4][1]-corners[0][1]);
corners[4][2] = corners[0][2] + axeslen*(corners[4][2]-corners[0][2]);
draw_cylinder(corners[0],corners[1],color2rgb("red"),diameter,3);
draw_cylinder(corners[0],corners[2],color2rgb("green"),diameter,3);
draw_cylinder(corners[0],corners[4],color2rgb("blue"),diameter,3);
}
}
/* ----------------------------------------------------------------------
draw sphere at x with surfaceColor and diameter
render pixel by pixel onto image plane with depth buffering
------------------------------------------------------------------------- */
void DumpImage::draw_sphere(double *x, double *surfaceColor, double diameter)
{
int ix,iy;
double projRad;
double xlocal[3],surface[3];
double depth;
xlocal[0] = x[0] - xctr;
xlocal[1] = x[1] - yctr;
xlocal[2] = x[2] - zctr;
double xmap = MathExtra::dot3(camRight,xlocal);
double ymap = MathExtra::dot3(camUp,xlocal);
double dist = MathExtra::dot3(camPos,camDir) - MathExtra::dot3(xlocal,camDir);
double radius = 0.5*diameter;
double radsq = radius*radius;
double pixelWidth = (tanPerPixel > 0) ? tanPerPixel * dist :
-tanPerPixel / zoom;
double pixelRadiusFull = radius / pixelWidth;
int pixelRadius = static_cast<int> (pixelRadiusFull + 0.5) + 1;
double xf = xmap / pixelWidth;
double yf = ymap / pixelWidth;
int xc = static_cast<int> (xf);
int yc = static_cast<int> (yf);
double width_error = xf - xc;
double height_error = yf - yc;
// shift 0,0 to screen center (vs lower left)
xc += width / 2;
yc += height / 2;
for (iy = yc - pixelRadius; iy <= yc + pixelRadius; iy++) {
for (ix = xc - pixelRadius; ix <= xc + pixelRadius; ix++) {
if (iy < 0 || iy >= height || ix < 0 || ix >= width) continue;
surface[1] = ((iy - yc) - height_error) * pixelWidth;
surface[0] = ((ix - xc) - width_error) * pixelWidth;
projRad = surface[0]*surface[0] + surface[1]*surface[1];
// outside the sphere in the projected image
if (projRad > radsq) continue;
surface[2] = sqrt(radsq - projRad);
depth = dist - surface[2];
surface[0] /= radius;
surface[1] /= radius;
surface[2] /= radius;
draw_pixel (ix, iy, depth, surface, surfaceColor);
}
}
}
/* ----------------------------------------------------------------------
draw cylinder from x to y with surfaceColor and diameter
render pixel by pixel onto image plane with depth buffering
if sflag = 0, draw no end spheres
if sflag = 1, draw 1st end sphere
if sflag = 2, draw 2nd end sphere
if sflag = 3, draw both end spheres
------------------------------------------------------------------------- */
void DumpImage::draw_cylinder(double *x, double *y,
double *surfaceColor, double diameter, int sflag)
{
double surface[3], normal[3];
double mid[3],xaxis[3],yaxis[3],zaxis[3];
double camLDir[3], camLRight[3], camLUp[3];
double zmin, zmax;
if (sflag % 2) draw_sphere(x,surfaceColor,diameter);
if (sflag/2) draw_sphere(y,surfaceColor,diameter);
double radius = 0.5*diameter;
double radsq = radius*radius;
zaxis[0] = y[0] - x[0];
zaxis[1] = y[1] - x[1];
zaxis[2] = y[2] - x[2];
double rasterWidth = fabs(MathExtra::dot3(zaxis, camRight)) + diameter;
double rasterHeight = fabs(MathExtra::dot3(zaxis, camUp)) + diameter;
mid[0] = (y[0] + x[0]) * 0.5 - xctr;
mid[1] = (y[1] + x[1]) * 0.5 - yctr;
mid[2] = (y[2] + x[2]) * 0.5 - zctr;
double len = MathExtra::len3(zaxis);
MathExtra::scale3(1.0/len,zaxis);
len *= 0.5;
zmax = len;
zmin = -len;
double xmap = MathExtra::dot3(camRight,mid);
double ymap = MathExtra::dot3(camUp,mid);
double dist = MathExtra::dot3(camPos,camDir) - MathExtra::dot3(mid,camDir);
double pixelWidth = (tanPerPixel > 0) ? tanPerPixel * dist :
-tanPerPixel / zoom;
double xf = xmap / pixelWidth;
double yf = ymap / pixelWidth;
int xc = static_cast<int> (xf);
int yc = static_cast<int> (yf);
double width_error = xf - xc;
double height_error = yf - yc;
// shift 0,0 to screen center (vs lower left)
xc += width / 2;
yc += height / 2;
double pixelHalfWidthFull = (rasterWidth * 0.5) / pixelWidth;
double pixelHalfHeightFull = (rasterHeight * 0.5) / pixelWidth;
int pixelHalfWidth = static_cast<int> (pixelHalfWidthFull + 0.5);
int pixelHalfHeight = static_cast<int> (pixelHalfHeightFull + 0.5);
if (zaxis[0] == camDir[0] && zaxis[1] == camDir[1] && zaxis[2] == camDir[2])
return;
if (zaxis[0] == -camDir[0] && zaxis[1] == -camDir[1] &&
zaxis[2] == -camDir[2]) return;
MathExtra::cross3(zaxis,camDir,yaxis);
MathExtra::norm3(yaxis);
MathExtra::cross3(yaxis,zaxis,xaxis);
MathExtra::norm3(xaxis);
camLDir[0] = MathExtra::dot3(camDir,xaxis);
camLDir[1] = 0.0;
camLDir[2] = MathExtra::dot3(camDir,zaxis);
camLRight[0] = MathExtra::dot3(camRight,xaxis);
camLRight[1] = MathExtra::dot3(camRight,yaxis);
camLRight[2] = MathExtra::dot3(camRight,zaxis);
MathExtra::norm3(camLRight);
camLUp[0] = MathExtra::dot3(camUp,xaxis);
camLUp[1] = MathExtra::dot3(camUp,yaxis);
camLUp[2] = MathExtra::dot3(camUp,zaxis);
MathExtra::norm3(camLUp);
double a = camLDir[0] * camLDir[0];
for (int iy = yc - pixelHalfHeight; iy <= yc + pixelHalfHeight; iy ++) {
for (int ix = xc - pixelHalfWidth; ix <= xc + pixelHalfWidth; ix ++) {
if (iy < 0 || iy >= height || ix < 0 || ix >= width) continue;
double sy = ((iy - yc) - height_error) * pixelWidth;
double sx = ((ix - xc) - width_error) * pixelWidth;
surface[0] = camLRight[0] * sx + camLUp[0] * sy;
surface[1] = camLRight[1] * sx + camLUp[1] * sy;
surface[2] = camLRight[2] * sx + camLUp[2] * sy;
double b = 2 * camLDir[0] * surface[0];
double c = surface[0] * surface[0] + surface[1] * surface[1] - radsq;
double partial = b*b - 4*a*c;
if (partial < 0) continue;
partial = sqrt (partial);
double t = (-b + partial) / (2*a);
double t2 = (-b - partial) / (2*a);
if (t2 > t) { t = t2; }
surface[0] += t * camLDir[0];
surface[1] += t * camLDir[1];
surface[2] += t * camLDir[2];
if (surface[2] > zmax || surface[2] < zmin) continue;
// convert surface into the surface normal
normal[0] = surface[0] / radius;
normal[1] = surface[1] / radius;
normal[2] = 0.0;
// in camera space
surface[0] = MathExtra::dot3 (normal, camLRight);
surface[1] = MathExtra::dot3 (normal, camLUp);
surface[2] = MathExtra::dot3 (normal, camLDir);
double depth = dist - t;
draw_pixel (ix, iy, depth, surface, surfaceColor);
}
}
}
/* ---------------------------------------------------------------------- */
void DumpImage::draw_pixel(int ix, int iy, double depth,
double *surface, double *surfaceColor)
{
double diffuseKey,diffuseFill,diffuseBack,specularKey;
if (depth < 0 || (depthBuffer[ix + iy*width] >= 0 &&
depth >= depthBuffer[ix + iy*width])) return;
depthBuffer[ix + iy*width] = depth;
// store only the tangent relative to the camera normal (0,0,-1)
surfaceBuffer[0 + ix * 2 + iy*width * 2] = surface[1];
surfaceBuffer[1 + ix * 2 + iy*width * 2] = -surface[0];
diffuseKey = saturate(MathExtra::dot3(surface, keyLightDir));
diffuseFill = saturate(MathExtra::dot3(surface, fillLightDir));
diffuseBack = saturate(MathExtra::dot3(surface, backLightDir));
specularKey = pow(saturate(MathExtra::dot3(surface, keyHalfDir)),
specularHardness) * specularIntensity;
double c[3];
c[0] = surfaceColor[0] * ambientColor[0];
c[1] = surfaceColor[1] * ambientColor[1];
c[2] = surfaceColor[2] * ambientColor[2];
c[0] += surfaceColor[0] * keyLightColor[0] * diffuseKey;
c[1] += surfaceColor[1] * keyLightColor[1] * diffuseKey;
c[2] += surfaceColor[2] * keyLightColor[2] * diffuseKey;
c[0] += keyLightColor[0] * specularKey;
c[1] += keyLightColor[1] * specularKey;
c[2] += keyLightColor[2] * specularKey;
c[0] += surfaceColor[0] * fillLightColor[0] * diffuseFill;
c[1] += surfaceColor[1] * fillLightColor[1] * diffuseFill;
c[2] += surfaceColor[2] * fillLightColor[2] * diffuseFill;
c[0] += surfaceColor[0] * backLightColor[0] * diffuseBack;
c[1] += surfaceColor[1] * backLightColor[1] * diffuseBack;
c[2] += surfaceColor[2] * backLightColor[2] * diffuseBack;
c[0] = saturate(c[0]);
c[1] = saturate(c[1]);
c[2] = saturate(c[2]);
imageBuffer[0 + ix*3 + iy*width*3] = static_cast<int>(c[0] * 255.0);
imageBuffer[1 + ix*3 + iy*width*3] = static_cast<int>(c[1] * 255.0);
imageBuffer[2 + ix*3 + iy*width*3] = static_cast<int>(c[2] * 255.0);
}
/* ---------------------------------------------------------------------- */
void DumpImage::compute_SSAO()
{
// used for rasterizing the spheres
double delTheta = 2.0*MY_PI / SSAOSamples;
// typical neighborhood value for shading
double pixelWidth = (tanPerPixel > 0) ? tanPerPixel :
-tanPerPixel / zoom;
int pixelRadius = (int) trunc (SSAORadius / pixelWidth + 0.5);
int x,y,s;
int hPart = height / nprocs;
int index = me * hPart * width;
for (y = me * hPart; y < (me + 1) * hPart; y ++) {
for (x = 0; x < width; x ++, index ++) {
double cdepth = depthBuffer[index];
if (cdepth < 0) { continue; }
double sx = surfaceBuffer[index * 2 + 0];
double sy = surfaceBuffer[index * 2 + 1];
double sin_t = -sqrt(sx*sx + sy*sy);
double theta = random->uniform() * SSAOJitter;
double ao = 0.0;
for (s = 0; s < SSAOSamples; s ++) {
double hx = cos(theta);
double hy = sin(theta);
theta += delTheta;
// multiply by z cross surface tangent
// so that dot (aka cos) works here
double scaled_sin_t = sin_t * (hx*sy + hy*sx);
// Bresenham's line algorithm to march over depthBuffer
int dx = static_cast<int> (hx * pixelRadius);
int dy = static_cast<int> (hy * pixelRadius);
int ex = x + dx;
if (ex < 0) { ex = 0; } if (ex >= width) { ex = width - 1; }
int ey = y + dy;
if (ey < 0) { ey = 0; } if (ey >= height) { ey = height - 1; }
double delta;
int small, large;
double lenIncr;
if (fabs(hx) > fabs(hy)) {
small = (hx > 0) ? 1 : -1;
large = (hy > 0) ? width : -width;
delta = fabs(hy / hx);
} else {
small = (hy > 0) ? width : -width;
large = (hx > 0) ? 1 : -1;
delta = fabs(hx / hy);
}
lenIncr = sqrt (1 + delta * delta) * pixelWidth;
// initialize with one step
// because the center point doesn't need testing
int end = ex + ey * width;
int ind = index + small;
double len = lenIncr;
double err = delta;
if (err >= 1.0) {
ind += large;
err -= 1.0;
}
double minPeak = -1;
double peakLen = 0.0;
int stepsTaken = 1;
while ((small > 0 && ind <= end) || (small < 0 && ind >= end)) {
if (ind < 0 || ind >= (width*height)) {
break;
}
// cdepth - depthBuffer B/C we want it in the negative z direction
if (minPeak < 0 || (depthBuffer[ind] >= 0 &&
depthBuffer[ind] < minPeak)) {
minPeak = depthBuffer[ind];
peakLen = len;
}
ind += small;
len += lenIncr;
err += delta;
if (err >= 1.0) {
ind += large;
err -= 1.0;
}
stepsTaken ++;
}
if (peakLen > 0) {
double h = atan ((cdepth - minPeak) / peakLen);
ao += saturate(sin (h) - scaled_sin_t);
} else {
ao += saturate(-scaled_sin_t);
}
}
ao /= (double)SSAOSamples;
double c[3];
c[0] = (double) (*(unsigned char *) &imageBuffer[index * 3 + 0]);
c[1] = (double) (*(unsigned char *) &imageBuffer[index * 3 + 1]);
c[2] = (double) (*(unsigned char *) &imageBuffer[index * 3 + 2]);
c[0] *= (1.0 - ao);
c[1] *= (1.0 - ao);
c[2] *= (1.0 - ao);
imageBuffer[index * 3 + 0] = (int) c[0];
imageBuffer[index * 3 + 1] = (int) c[1];
imageBuffer[index * 3 + 2] = (int) c[2];
}
}
}
/* ---------------------------------------------------------------------- */
void DumpImage::write_JPG()
{
#ifdef LAMMPS_JPEG
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
JSAMPROW row_pointer;
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_compress(&cinfo);
jpeg_stdio_dest(&cinfo, fp);
cinfo.image_width = width;
cinfo.image_height = height;
cinfo.input_components = 3;
cinfo.in_color_space = JCS_RGB;
jpeg_set_defaults(&cinfo);
jpeg_set_quality(&cinfo, 100, 1);
jpeg_start_compress(&cinfo, 1);
while (cinfo.next_scanline < cinfo.image_height) {
row_pointer = (JSAMPROW)
&writeBuffer[(cinfo.image_height - 1 - cinfo.next_scanline) * 3 * width];
jpeg_write_scanlines(&cinfo, &row_pointer, 1);
}
jpeg_finish_compress(&cinfo);
jpeg_destroy_compress(&cinfo);
#endif
}
/* ---------------------------------------------------------------------- */
void DumpImage::write_PPM()
{
int x,y;
fprintf (fp,"P6\n%d %d\n255\n",width,height);
for (y = height-1; y >= 0; y --)
for (x = 0; x < width; x ++)
fprintf (fp,"%c%c%c",
writeBuffer[0 + x*3 + y*width*3],
writeBuffer[1 + x*3 + y*width*3],
writeBuffer[2 + x*3 + y*width*3]);
}
/* ---------------------------------------------------------------------- */
int DumpImage::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
{
int i,j,m;
m = 0;
if (comm_forward == 1) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = choose[j];
}
} else {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = choose[j];
buf[m++] = bufcopy[j][0];
buf[m++] = bufcopy[j][1];
}
}
return comm_forward;
}
/* ---------------------------------------------------------------------- */
void DumpImage::unpack_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
if (comm_forward == 1)
for (i = first; i < last; i++) choose[i] = static_cast<int> (buf[m++]);
else {
for (i = first; i < last; i++) {
choose[i] = static_cast<int> (buf[m++]);
bufcopy[i][0] = buf[m++];
bufcopy[i][1] = buf[m++];
}
}
}
/* ---------------------------------------------------------------------- */
int DumpImage::modify_param(int narg, char **arg)
{
int n = DumpCustom::modify_param(narg,arg);
if (n) return n;
if (strcmp(arg[0],"acolor") == 0) {
if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
int nlo,nhi;
force->bounds(arg[1],atom->ntypes,nlo,nhi);
// ptrs = list of ncount colornames separated by '/'
int ncount = 1;
char *nextptr;
char *ptr = arg[2];
while (nextptr = strchr(ptr,'/')) {
ptr = nextptr + 1;
ncount++;
}
char **ptrs = new char*[ncount+1];
ncount = 0;
ptrs[ncount++] = strtok(arg[2],"/");
while (ptrs[ncount++] = strtok(NULL,"/"));
ncount--;
// assign each of ncount colors in round-robin fashion to types
int m = 0;
for (int i = nlo; i <= nhi; i++) {
colortype[i] = color2rgb(ptrs[m%ncount]);
if (colortype[i] == NULL)
error->all(FLERR,"Invalid color in dump_modify command");
m++;
}
delete [] ptrs;
return 3;
} else if (strcmp(arg[0],"adiam") == 0) {
if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
int nlo,nhi;
force->bounds(arg[1],atom->ntypes,nlo,nhi);
double diam = atof(arg[2]);
if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command");
for (int i = nlo; i <= nhi; i++) diamtype[i] = diam;
return 3;
} else if (strcmp(arg[0],"amap") == 0) {
if (narg < 6) error->all(FLERR,"Illegal dump_modify command");
if (!islower(arg[1][0])) {
mlo = NUMERIC;
mlovalue = atof(arg[1]);
} else if (strcmp(arg[1],"min") == 0) mlo = MINVALUE;
else error->all(FLERR,"Illegal dump_modify command");
if (!islower(arg[2][0])) {
mhi = NUMERIC;
mhivalue = atof(arg[2]);
} else if (strcmp(arg[2],"max") == 0) mhi = MAXVALUE;
else error->all(FLERR,"Illegal dump_modify command");
if (mlo == NUMERIC && mhi == NUMERIC && mlovalue >= mhivalue)
error->all(FLERR,"Illega dump_modify command");
if (strlen(arg[3]) != 2) error->all(FLERR,"Illegal dump_modify command");
if (arg[3][0] == 'c') mstyle = CONTINUOUS;
else if (arg[3][0] == 'd') mstyle = DISCRETE;
else if (arg[3][0] == 's') mstyle = SEQUENTIAL;
else error->all(FLERR,"Illegal dump_modify command");
if (arg[3][1] == 'a') mrange = ABSOLUTE;
else if (arg[3][1] == 'f') mrange = FRACTIONAL;
else error->all(FLERR,"Illegal dump_modify command");
if (mstyle == SEQUENTIAL) {
mbinsize = atof(arg[4]);
if (mbinsize <= 0.0) error->all(FLERR,"Illegal dump_modify command");
}
mbinsizeinv = 1.0/mbinsize;
nentry = atoi(arg[5]);
mentry = new MapEntry[nentry];
int n = 6;
for (int i = 0; i < nentry; i++) {
if (mstyle == CONTINUOUS) {
if (n+2 > narg) error->all(FLERR,"Illegal dump_modify command");
if (!islower(arg[n][0])) {
mentry[i].single = NUMERIC;
mentry[i].svalue = atof(arg[n]);
} else if (strcmp(arg[n],"min") == 0) mentry[i].single = MINVALUE;
else if (strcmp(arg[n],"max") == 0) mentry[i].single = MAXVALUE;
else error->all(FLERR,"Illegal dump_modify command");
mentry[i].color = color2rgb(arg[n+1]);
n += 2;
} else if (mstyle == DISCRETE) {
if (n+3 > narg) error->all(FLERR,"Illegal dump_modify command");
if (!islower(arg[n][0])) {
mentry[i].lo = NUMERIC;
mentry[i].lvalue = atof(arg[n]);
} else if (strcmp(arg[n],"min") == 0) mentry[i].single = MINVALUE;
else if (strcmp(arg[n],"max") == 0) mentry[i].single = MAXVALUE;
else error->all(FLERR,"Illegal dump_modify command");
if (!islower(arg[n+1][0])) {
mentry[i].hi = NUMERIC;
mentry[i].hvalue = atof(arg[n+1]);
} else if (strcmp(arg[n+1],"min") == 0) mentry[i].single = MINVALUE;
else if (strcmp(arg[n+1],"max") == 0) mentry[i].single = MAXVALUE;
else error->all(FLERR,"Illegal dump_modify command");
mentry[i].color = color2rgb(arg[n+2]);
n += 3;
} else if (mstyle == SEQUENTIAL) {
if (n+1 > narg) error->all(FLERR,"Illegal dump_modify command");
mentry[i].color = color2rgb(arg[n]);
n += 1;
}
if (mentry[i].color == NULL)
error->all(FLERR,"Invalid color in dump_modify command");
}
if (mstyle == CONTINUOUS) {
if (nentry < 2) error->all(FLERR,"Invalid color map in dump_modify command");
if (mentry[0].single != MINVALUE || mentry[nentry-1].single != MAXVALUE)
error->all(FLERR,"Invalid color map in dump_modify command");
for (int i = 2; i < nentry-1; i++)
if (mentry[i].svalue <= mentry[i-1].svalue)
error->all(FLERR,"Invalid color map in dump_modify command");
} else if (mstyle == DISCRETE) {
if (nentry < 1) error->all(FLERR,"Invalid color map in dump_modify command");
if (mentry[nentry-1].lo != MINVALUE || mentry[nentry-1].hi != MAXVALUE)
error->all(FLERR,"Invalid color map in dump_modify command");
} else if (mstyle == SEQUENTIAL) {
if (nentry < 1) error->all(FLERR,"Invalid color map in dump_modify command");
}
return n;
} else if (strcmp(arg[0],"bcolor") == 0) {
if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
if (atom->nbondtypes == 0)
error->all(FLERR,"Dump modify bcolor not allowed with no bond types");
int nlo,nhi;
force->bounds(arg[1],atom->nbondtypes,nlo,nhi);
// ptrs = list of ncount colornames separated by '/'
int ncount = 1;
char *nextptr;
char *ptr = arg[2];
while (nextptr = strchr(ptr,'/')) {
ptr = nextptr + 1;
ncount++;
}
char **ptrs = new char*[ncount+1];
ncount = 0;
ptrs[ncount++] = strtok(arg[2],"/");
while (ptrs[ncount++] = strtok(NULL,"/"));
ncount--;
// assign each of ncount colors in round-robin fashion to types
int m = 0;
for (int i = nlo; i <= nhi; i++) {
bcolortype[i] = color2rgb(ptrs[m%ncount]);
if (bcolortype[i] == NULL)
error->all(FLERR,"Invalid color in dump_modify command");
m++;
}
delete [] ptrs;
return 3;
} else if (strcmp(arg[0],"bdiam") == 0) {
if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
if (atom->nbondtypes == 0)
error->all(FLERR,"Dump modify bdiam not allowed with no bond types");
int nlo,nhi;
force->bounds(arg[1],atom->ntypes,nlo,nhi);
double diam = atof(arg[2]);
if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command");
for (int i = nlo; i <= nhi; i++) bdiamtype[i] = diam;
return 3;
} else if (strcmp(arg[0],"backcolor") == 0) {
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
double *color = color2rgb(arg[1]);
if (color == NULL) error->all(FLERR,"Invalid color in dump_modify command");
background[0] = static_cast<int> (color[0]*255.0);
background[1] = static_cast<int> (color[1]*255.0);
background[2] = static_cast<int> (color[2]*255.0);
return 2;
} else if (strcmp(arg[0],"boxcolor") == 0) {
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
boxcolor = color2rgb(arg[1]);
if (boxcolor == NULL) error->all(FLERR,"Invalid color in dump_modify command");
return 2;
} else if (strcmp(arg[0],"color") == 0) {
if (narg < 5) error->all(FLERR,"Illegal dump_modify command");
username = (char **)
memory->srealloc(username,(ncolors+1)*sizeof(char *),"dump:username");
memory->grow(userrgb,ncolors+1,3,"dump:userrgb");
int n = strlen(arg[1]) + 1;
username[ncolors] = new char[n];
strcpy(username[ncolors],arg[1]);
userrgb[ncolors][0] = atof(arg[2]);
userrgb[ncolors][1] = atof(arg[3]);
userrgb[ncolors][2] = atof(arg[4]);
if (userrgb[ncolors][0] < 0.0 || userrgb[ncolors][0] > 1.0 ||
userrgb[ncolors][1] < 0.0 || userrgb[ncolors][1] > 1.0 ||
userrgb[ncolors][2] < 0.0 || userrgb[ncolors][2] > 1.0)
error->all(FLERR,"Illegal dump_modify command");
ncolors++;
return 5;
}
return 0;
}
/* ----------------------------------------------------------------------
convert value into an RGB color via color map
------------------------------------------------------------------------- */
double *DumpImage::value2color(double value)
{
double lo,hi;
value = MAX(value,locurrent);
value = MIN(value,hicurrent);
if (mrange == FRACTIONAL) {
if (locurrent == hicurrent) value = 0.0;
else value = (value-locurrent) / (hicurrent-locurrent);
lo = 0.0;
hi = 1.0;
} else {
lo = locurrent;
hi = hicurrent;
}
if (mstyle == CONTINUOUS) {
for (int i = 0; i < nentry-1; i++)
if (value >= mentry[i].svalue && value <= mentry[i+1].svalue) {
double fraction = (value-mentry[i].svalue) /
(mentry[i+1].svalue-mentry[i].svalue);
interpolate[0] = mentry[i].color[0] +
fraction*(mentry[i+1].color[0]-mentry[i].color[0]);
interpolate[1] = mentry[i].color[1] +
fraction*(mentry[i+1].color[1]-mentry[i].color[1]);
interpolate[2] = mentry[i].color[2] +
fraction*(mentry[i+1].color[2]-mentry[i].color[2]);
return interpolate;
}
} else if (mstyle == DISCRETE) {
for (int i = 0; i < nentry; i++)
if (value >= mentry[i].lvalue && value <= mentry[i].hvalue)
return mentry[i].color;
} else {
int ibin = static_cast<int> ((value-lo) * mbinsizeinv);
return mentry[ibin%nentry].color;
}
return NULL;
}
/* ----------------------------------------------------------------------
search the list of color names for the string color
return a pointer to the 3 floating point RGB values
search user-defined color names first, then the list of NCOLORS names
------------------------------------------------------------------------- */
-double *DumpImage::color2rgb(char *color)
+double *DumpImage::color2rgb(const char *color)
{
- static char *name[NCOLORS] = {
+ static const char *name[NCOLORS] = {
"aliceblue",
"antiquewhite",
"aqua",
"aquamarine",
"azure",
"beige",
"bisque",
"black",
"blanchedalmond",
"blue",
"blueviolet",
"brown",
"burlywood",
"cadetblue",
"chartreuse",
"chocolate",
"coral",
"cornflowerblue",
"cornsilk",
"crimson",
"cyan",
"darkblue",
"darkcyan",
"darkgoldenrod",
"darkgray",
"darkgreen",
"darkkhaki",
"darkmagenta",
"darkolivegreen",
"darkorange",
"darkorchid",
"darkred",
"darksalmon",
"darkseagreen",
"darkslateblue",
"darkslategray",
"darkturquoise",
"darkviolet",
"deeppink",
"deepskyblue",
"dimgray",
"dodgerblue",
"firebrick",
"floralwhite",
"forestgreen",
"fuchsia",
"gainsboro",
"ghostwhite",
"gold",
"goldenrod",
"gray",
"green",
"greenyellow",
"honeydew",
"hotpink",
"indianred",
"indigo",
"ivory",
"khaki",
"lavender",
"lavenderblush",
"lawngreen",
"lemonchiffon",
"lightblue",
"lightcoral",
"lightcyan",
"lightgoldenrodyellow",
"lightgreen",
"lightgrey",
"lightpink",
"lightsalmon",
"lightseagreen",
"lightskyblue",
"lightslategray",
"lightsteelblue",
"lightyellow",
"lime",
"limegreen",
"linen",
"magenta",
"maroon",
"mediumaquamarine",
"mediumblue",
"mediumorchid",
"mediumpurple",
"mediumseagreen",
"mediumslateblue",
"mediumspringgreen",
"mediumturquoise",
"mediumvioletred",
"midnightblue",
"mintcream",
"mistyrose",
"moccasin",
"navajowhite",
"navy",
"oldlace",
"olive",
"olivedrab",
"orange",
"orangered",
"orchid",
"palegoldenrod",
"palegreen",
"paleturquoise",
"palevioletred",
"papayawhip",
"peachpuff",
"peru",
"pink",
"plum",
"powderblue",
"purple",
"red",
"rosybrown",
"royalblue",
"saddlebrown",
"salmon",
"sandybrown",
"seagreen",
"seashell",
"sienna",
"silver",
"skyblue",
"slateblue",
"slategray",
"snow",
"springgreen",
"steelblue",
"tan",
"teal",
"thistle",
"tomato",
"turquoise",
"violet",
"wheat",
"white",
"whitesmoke",
"yellow",
"yellowgreen"
};
static double rgb[NCOLORS][3] = {
{240/255.0, 248/255.0, 255/255.0},
{250/255.0, 235/255.0, 215/255.0},
{0/255.0, 255/255.0, 255/255.0},
{127/255.0, 255/255.0, 212/255.0},
{240/255.0, 255/255.0, 255/255.0},
{245/255.0, 245/255.0, 220/255.0},
{255/255.0, 228/255.0, 196/255.0},
{0/255.0, 0/255.0, 0/255.0},
{255/255.0, 255/255.0, 205/255.0},
{0/255.0, 0/255.0, 255/255.0},
{138/255.0, 43/255.0, 226/255.0},
{165/255.0, 42/255.0, 42/255.0},
{222/255.0, 184/255.0, 135/255.0},
{95/255.0, 158/255.0, 160/255.0},
{127/255.0, 255/255.0, 0/255.0},
{210/255.0, 105/255.0, 30/255.0},
{255/255.0, 127/255.0, 80/255.0},
{100/255.0, 149/255.0, 237/255.0},
{255/255.0, 248/255.0, 220/255.0},
{220/255.0, 20/255.0, 60/255.0},
{0/255.0, 255/255.0, 255/255.0},
{0/255.0, 0/255.0, 139/255.0},
{0/255.0, 139/255.0, 139/255.0},
{184/255.0, 134/255.0, 11/255.0},
{169/255.0, 169/255.0, 169/255.0},
{0/255.0, 100/255.0, 0/255.0},
{189/255.0, 183/255.0, 107/255.0},
{139/255.0, 0/255.0, 139/255.0},
{85/255.0, 107/255.0, 47/255.0},
{255/255.0, 140/255.0, 0/255.0},
{153/255.0, 50/255.0, 204/255.0},
{139/255.0, 0/255.0, 0/255.0},
{233/255.0, 150/255.0, 122/255.0},
{143/255.0, 188/255.0, 143/255.0},
{72/255.0, 61/255.0, 139/255.0},
{47/255.0, 79/255.0, 79/255.0},
{0/255.0, 206/255.0, 209/255.0},
{148/255.0, 0/255.0, 211/255.0},
{255/255.0, 20/255.0, 147/255.0},
{0/255.0, 191/255.0, 255/255.0},
{105/255.0, 105/255.0, 105/255.0},
{30/255.0, 144/255.0, 255/255.0},
{178/255.0, 34/255.0, 34/255.0},
{255/255.0, 250/255.0, 240/255.0},
{34/255.0, 139/255.0, 34/255.0},
{255/255.0, 0/255.0, 255/255.0},
{220/255.0, 220/255.0, 220/255.0},
{248/255.0, 248/255.0, 255/255.0},
{255/255.0, 215/255.0, 0/255.0},
{218/255.0, 165/255.0, 32/255.0},
{128/255.0, 128/255.0, 128/255.0},
{0/255.0, 128/255.0, 0/255.0},
{173/255.0, 255/255.0, 47/255.0},
{240/255.0, 255/255.0, 240/255.0},
{255/255.0, 105/255.0, 180/255.0},
{205/255.0, 92/255.0, 92/255.0},
{75/255.0, 0/255.0, 130/255.0},
{255/255.0, 240/255.0, 240/255.0},
{240/255.0, 230/255.0, 140/255.0},
{230/255.0, 230/255.0, 250/255.0},
{255/255.0, 240/255.0, 245/255.0},
{124/255.0, 252/255.0, 0/255.0},
{255/255.0, 250/255.0, 205/255.0},
{173/255.0, 216/255.0, 230/255.0},
{240/255.0, 128/255.0, 128/255.0},
{224/255.0, 255/255.0, 255/255.0},
{250/255.0, 250/255.0, 210/255.0},
{144/255.0, 238/255.0, 144/255.0},
{211/255.0, 211/255.0, 211/255.0},
{255/255.0, 182/255.0, 193/255.0},
{255/255.0, 160/255.0, 122/255.0},
{32/255.0, 178/255.0, 170/255.0},
{135/255.0, 206/255.0, 250/255.0},
{119/255.0, 136/255.0, 153/255.0},
{176/255.0, 196/255.0, 222/255.0},
{255/255.0, 255/255.0, 224/255.0},
{0/255.0, 255/255.0, 0/255.0},
{50/255.0, 205/255.0, 50/255.0},
{250/255.0, 240/255.0, 230/255.0},
{255/255.0, 0/255.0, 255/255.0},
{128/255.0, 0/255.0, 0/255.0},
{102/255.0, 205/255.0, 170/255.0},
{0/255.0, 0/255.0, 205/255.0},
{186/255.0, 85/255.0, 211/255.0},
{147/255.0, 112/255.0, 219/255.0},
{60/255.0, 179/255.0, 113/255.0},
{123/255.0, 104/255.0, 238/255.0},
{0/255.0, 250/255.0, 154/255.0},
{72/255.0, 209/255.0, 204/255.0},
{199/255.0, 21/255.0, 133/255.0},
{25/255.0, 25/255.0, 112/255.0},
{245/255.0, 255/255.0, 250/255.0},
{255/255.0, 228/255.0, 225/255.0},
{255/255.0, 228/255.0, 181/255.0},
{255/255.0, 222/255.0, 173/255.0},
{0/255.0, 0/255.0, 128/255.0},
{253/255.0, 245/255.0, 230/255.0},
{128/255.0, 128/255.0, 0/255.0},
{107/255.0, 142/255.0, 35/255.0},
{255/255.0, 165/255.0, 0/255.0},
{255/255.0, 69/255.0, 0/255.0},
{218/255.0, 112/255.0, 214/255.0},
{238/255.0, 232/255.0, 170/255.0},
{152/255.0, 251/255.0, 152/255.0},
{175/255.0, 238/255.0, 238/255.0},
{219/255.0, 112/255.0, 147/255.0},
{255/255.0, 239/255.0, 213/255.0},
{255/255.0, 239/255.0, 213/255.0},
{205/255.0, 133/255.0, 63/255.0},
{255/255.0, 192/255.0, 203/255.0},
{221/255.0, 160/255.0, 221/255.0},
{176/255.0, 224/255.0, 230/255.0},
{128/255.0, 0/255.0, 128/255.0},
{255/255.0, 0/255.0, 0/255.0},
{188/255.0, 143/255.0, 143/255.0},
{65/255.0, 105/255.0, 225/255.0},
{139/255.0, 69/255.0, 19/255.0},
{250/255.0, 128/255.0, 114/255.0},
{244/255.0, 164/255.0, 96/255.0},
{46/255.0, 139/255.0, 87/255.0},
{255/255.0, 245/255.0, 238/255.0},
{160/255.0, 82/255.0, 45/255.0},
{192/255.0, 192/255.0, 192/255.0},
{135/255.0, 206/255.0, 235/255.0},
{106/255.0, 90/255.0, 205/255.0},
{112/255.0, 128/255.0, 144/255.0},
{255/255.0, 250/255.0, 250/255.0},
{0/255.0, 255/255.0, 127/255.0},
{70/255.0, 130/255.0, 180/255.0},
{210/255.0, 180/255.0, 140/255.0},
{0/255.0, 128/255.0, 128/255.0},
{216/255.0, 191/255.0, 216/255.0},
{253/255.0, 99/255.0, 71/255.0},
{64/255.0, 224/255.0, 208/255.0},
{238/255.0, 130/255.0, 238/255.0},
{245/255.0, 222/255.0, 179/255.0},
{255/255.0, 255/255.0, 255/255.0},
{245/255.0, 245/255.0, 245/255.0},
{255/255.0, 255/255.0, 0/255.0},
{154/255.0, 205/255.0, 50/255.0}
};
for (int i = 0; i < ncolors; i++)
if (strcmp(color,username[i]) == 0) return userrgb[i];
for (int i = 0; i < NCOLORS; i++)
if (strcmp(color,name[i]) == 0) return rgb[i];
return NULL;
}
/* ----------------------------------------------------------------------
search the list of element names for the string element
return a pointer to the 3 floating point RGB values
this list is used by AtomEye and is taken from its Mendeleyev.c file
------------------------------------------------------------------------- */
double *DumpImage::element2color(char *element)
{
-
- static char *name[NELEMENTS] = {
+ static const char *name[NELEMENTS] = {
"H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne",
"Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca",
"Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn",
"Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr",
"Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn",
"Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd",
"Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb",
"Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg",
"Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th",
"Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm",
"Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt"
};
static double rgb[NELEMENTS][3] = {
{0.8, 0.8, 0.8},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.7, 0.7, 0.7},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.9, 0.4, 0},
{0.35, 0.35, 0.35},
{0.2, 0.2, 0.8},
{0.8, 0.2, 0.2},
{0.7, 0.85, 0.45},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6, 0.6, 0.6},
{0.6, 0.6, 0.7},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6901960784, 0.768627451, 0.8705882353},
{0.1, 0.7, 0.3},
{0.95, 0.9, 0.2},
{0.15, 0.5, 0.1},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.5, 0.5, 0.5},
{0.8, 0.8, 0.7},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0, 0.8, 0},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.5176470588, 0.5764705882, 0.6529411765},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.257254902, 0.2666666667, 0.271372549},
{0.95, 0.7900735294, 0.01385869565},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.9, 0, 1},
{0.6431372549, 0.6666666667, 0.6784313725},
{1, 1, 0.3},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.5, 0.08, 0.12},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.5, 0.1, 0.5},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.8, 0.8, 0},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{1, 0.8431372549, 0},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.9, 0.8, 0},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.8, 0.2, 0.2},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.1, 0.7, 0.3},
{0.1, 0.3, 0.7},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.9, 0.8, 0},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725},
{0.6431372549, 0.6666666667, 0.6784313725}
};
for (int i = 0; i < NELEMENTS; i++)
if (strcmp(element,name[i]) == 0) return rgb[i];
return NULL;
}
/* ----------------------------------------------------------------------
search the list of element names for the string element
return a pointer to the 3 floating point RGB values
this list is used by AtomEye and is taken from its Mendeleyev.c file
------------------------------------------------------------------------- */
double DumpImage::element2diam(char *element)
{
- static char *name[NELEMENTS] = {
+ static const char *name[NELEMENTS] = {
"H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne",
"Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca",
"Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn",
"Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr",
"Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn",
"Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd",
"Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb",
"Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg",
"Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th",
"Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm",
"Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt"
};
static double diameter[NELEMENTS] = {
0.35, 1.785, 1.45, 1.05, 0.85, 0.72, 0.65, 0.6, 0.5, 1.5662,
1.8, 1.5, 1.4255, 1.07, 1, 1, 1, 1.8597, 2.2, 1.8,
1.6, 1.4, 1.51995, 1.44225, 1.4, 1.43325, 1.35, 1.35, 1.278, 1.35,
1.3, 1.25, 1.15, 1.15, 1.15, 2.0223, 2.35, 2, 1.8, 1.55,
1.6504, 1.3872, 1.35, 1.3, 1.35, 1.4, 1.6, 1.55, 1.55, 1.45,
1.45, 1.4, 1.4, 2.192, 2.6, 2.15, 1.95, 1.85, 1.85, 1.85,
1.85, 1.85, 1.85, 1.8, 1.75, 1.75, 1.75, 1.75, 1.75, 1.75,
1.75, 1.55, 1.6529, 1.5826, 1.35, 1.3, 1.35, 1.35, 1.35, 1.5,
1.9, 1.8, 1.6, 1.9, 1.6, 1.0, 1.0, 2.15, 1.95, 1.8,
1.8, 1.75, 1.75, 1.75, 1.75, 1.0, 1.0, 1.6, 1.6, 1.0,
1.0, 1.0, 1.0, 1.0, 1.6, 1.0, 1.0, 1.0, 1.0
};
for (int i = 0; i < NELEMENTS; i++)
if (strcmp(element,name[i]) == 0) return diameter[i];
return 0.0;
}
diff --git a/src/dump_image.h b/src/dump_image.h
index 844ba1c11..a46420211 100644
--- a/src/dump_image.h
+++ b/src/dump_image.h
@@ -1,177 +1,295 @@
/* ----------------------------------------------------------------------
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 DUMP_CLASS
DumpStyle(image,DumpImage)
#else
#ifndef LMP_DUMP_IMAGE_H
#define LMP_DUMP_IMAGE_H
#include "math.h"
#include "dump_custom.h"
namespace LAMMPS_NS {
class DumpImage : public DumpCustom {
public:
DumpImage(class LAMMPS *, int, char**);
~DumpImage();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
private:
int filetype;
int acolor,adiam;
double adiamvalue;
int atomflag,bondflag;
int bcolor,bdiam;
double bdiamvalue;
int width,height;
double theta,phi;
char *thetastr,*phistr;
int thetavar,phivar;
int cflag;
double cx,cy,cz;
char *cxstr,*cystr,*czstr;
int cxvar,cyvar,czvar;
double up[3];
char *upxstr,*upystr,*upzstr;
int upxvar,upyvar,upzvar;
double zoom,persp;
char *zoomstr,*perspstr;
int zoomvar,perspvar;
int boxflag,axesflag;
double boxdiam,axeslen,axesdiam;
double shiny;
int ssao,seed;
double ssaoint;
int npixels,viewflag;
double *depthBuffer,*surfaceBuffer;
double *depthcopy,*surfacecopy;
char *imageBuffer,*rgbcopy,*writeBuffer;
double **bufcopy;
int maxbufcopy;
// constant view params
double FOV;
double ambientColor[3];
double keyLightTheta;
double keyLightPhi;
double keyLightColor[3];
double fillLightTheta;
double fillLightPhi;
double fillLightColor[3];
double backLightTheta;
double backLightPhi;
double backLightColor[3];
double specularHardness;
double specularIntensity;
double SSAORadius;
int SSAOSamples;
double SSAOJitter;
// dynamic view params
double xctr,yctr,zctr,zdist;
double tanPerPixel;
double camDir[3],camUp[3],camRight[4],camPos[3];
double keyLightDir[3],fillLightDir[3],backLightDir[3];
double keyHalfDir[3];
// dump_modify values
int ncolors;
char **username;
double **userrgb;
double *diamtype,*diamelement,*bdiamtype;
double **colortype,**colorelement,**bcolortype;
double *boxcolor;
int background[3];
// color map
int mstyle,mrange; // 2-letter style/range of color map
int mlo,mhi; // bounds = NUMERIC or MINVALUE or MAXVALUE
double mlovalue,mhivalue; // user bounds if NUMERIC
double locurrent,hicurrent; // current bounds for this snapshot
double mbinsize,mbinsizeinv; // bin size for sequential color map
struct MapEntry {
int single,lo,hi; // NUMERIC or MINVALUE or MAXVALUE
double svalue,lvalue,hvalue; // actual value
double *color; // RGB values
};
MapEntry *mentry;
int nentry;
double interpolate[3];
class RanMars *random;
void init_style();
int modify_param(int, char **);
void write();
void box_center();
void view_params();
void box_bounds();
void color_minmax();
void create_image();
// rasterizing methods
void draw_sphere(double *, double *, double);
void draw_cylinder(double *, double *, double *, double, int);
void draw_pixel(int, int, double, double *, double*);
void compute_SSAO();
void write_JPG();
void write_PPM();
double *value2color(double);
- double *color2rgb(char *);
+ double *color2rgb(const char *);
double *element2color(char *);
double element2diam(char *);
// inlined functions
inline double saturate(double v) {
if (v < 0.0) return 0.0;
else if (v > 1.0) return 1.0;
else return v;
}
inline double distance(double* a, double* b) {
return sqrt((a[0] - b[0]) * (a[0] - b[0]) +
(a[1] - b[1]) * (a[1] - b[1]) +
(a[2] - b[2]) * (a[2] - b[2]));
}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Invalid dump image filename
+
+UNDOCUMENTED
+
+E: Cannot dump JPG file
+
+UNDOCUMENTED
+
+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: Dump image bond not allowed with no bond types
+
+UNDOCUMENTED
+
+E: Invalid dump image theta value
+
+UNDOCUMENTED
+
+E: Dump image persp option is not yet supported
+
+UNDOCUMENTED
+
+E: Dump image requires one snapshot per file
+
+UNDOCUMENTED
+
+E: Dump image cannot perform sorting
+
+UNDOCUMENTED
+
+E: Variable name for dump image theta does not exist
+
+UNDOCUMENTED
+
+E: Variable for dump image theta is invalid style
+
+UNDOCUMENTED
+
+E: Variable name for dump image phi does not exist
+
+UNDOCUMENTED
+
+E: Variable for dump image phi is invalid style
+
+UNDOCUMENTED
+
+E: Variable name for dump image center does not exist
+
+UNDOCUMENTED
+
+E: Variable for dump image center is invalid style
+
+UNDOCUMENTED
+
+E: Variable name for dump image zoom does not exist
+
+UNDOCUMENTED
+
+E: Variable for dump image zoom is invalid style
+
+UNDOCUMENTED
+
+E: Variable name for dump image persp does not exist
+
+UNDOCUMENTED
+
+E: Variable for dump image persp is invalid style
+
+UNDOCUMENTED
+
+E: Invalid dump image element name
+
+UNDOCUMENTED
+
+E: Invalid dump image zoom value
+
+UNDOCUMENTED
+
+E: Invalid dump image persp value
+
+UNDOCUMENTED
+
+E: Invalid dump image up vector
+
+UNDOCUMENTED
+
+E: Invalid dump image color range
+
+UNDOCUMENTED
+
+E: Invalid color in dump_modify command
+
+UNDOCUMENTED
+
+E: Illega dump_modify command
+
+UNDOCUMENTED
+
+E: Invalid color map in dump_modify command
+
+UNDOCUMENTED
+
+E: Dump modify bcolor not allowed with no bond types
+
+UNDOCUMENTED
+
+E: Dump modify bdiam not allowed with no bond types
+
+UNDOCUMENTED
+
+*/
diff --git a/src/dump_local.cpp b/src/dump_local.cpp
index c95f77e7c..f44781194 100644
--- a/src/dump_local.cpp
+++ b/src/dump_local.cpp
@@ -1,470 +1,470 @@
/* ----------------------------------------------------------------------
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 "mpi.h"
#include "string.h"
#include "stdlib.h"
#include "dump_local.h"
#include "atom.h"
#include "modify.h"
#include "fix.h"
#include "compute.h"
#include "domain.h"
#include "update.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
enum{INT,DOUBLE};
#define INVOKED_LOCAL 16
/* ---------------------------------------------------------------------- */
DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) :
Dump(lmp, narg, arg)
{
if (narg == 5) error->all(FLERR,"No dump local arguments specified");
clearstep = 1;
nevery = atoi(arg[3]);
size_one = nfield = narg-5;
pack_choice = new FnPtrPack[nfield];
vtype = new int[nfield];
// computes & fixes which the dump accesses
field2index = new int[nfield];
argindex = new int[nfield];
ncompute = 0;
id_compute = NULL;
compute = NULL;
nfix = 0;
id_fix = NULL;
fix = NULL;
// process attributes
parse_fields(narg,arg);
// setup format strings
vformat = new char*[size_one];
format_default = new char[3*size_one+1];
format_default[0] = '\0';
for (int i = 0; i < size_one; i++) {
if (vtype[i] == INT) format_default = strcat(format_default,"%d ");
else format_default = strcat(format_default,"%g ");
vformat[i] = NULL;
}
// setup column string
int n = 0;
for (int iarg = 5; iarg < narg; iarg++) n += strlen(arg[iarg]) + 2;
columns = new char[n];
columns[0] = '\0';
for (int iarg = 5; iarg < narg; iarg++) {
strcat(columns,arg[iarg]);
strcat(columns," ");
}
// setup default label string
- char *str = "ENTRIES";
+ char *str = (char *) "ENTRIES";
n = strlen(str) + 1;
label = new char[n];
strcpy(label,str);
}
/* ---------------------------------------------------------------------- */
DumpLocal::~DumpLocal()
{
delete [] pack_choice;
delete [] vtype;
delete [] field2index;
delete [] argindex;
for (int i = 0; i < ncompute; i++) delete [] id_compute[i];
memory->sfree(id_compute);
delete [] compute;
for (int i = 0; i < nfix; i++) delete [] id_fix[i];
memory->sfree(id_fix);
delete [] fix;
for (int i = 0; i < size_one; i++) delete [] vformat[i];
delete [] vformat;
delete [] columns;
delete [] label;
}
/* ---------------------------------------------------------------------- */
void DumpLocal::init_style()
{
if (sort_flag && sortcol == 0)
error->all(FLERR,"Dump local cannot sort by atom ID");
delete [] format;
char *str;
if (format_user) str = format_user;
else str = format_default;
int n = strlen(str) + 1;
format = new char[n];
strcpy(format,str);
// tokenize the format string and add space at end of each format element
char *ptr;
for (int i = 0; i < size_one; i++) {
if (i == 0) ptr = strtok(format," \0");
else ptr = strtok(NULL," \0");
delete [] vformat[i];
vformat[i] = new char[strlen(ptr) + 2];
strcpy(vformat[i],ptr);
vformat[i] = strcat(vformat[i]," ");
}
// find current ptr for each compute,fix,variable
// check that fix frequency is acceptable
int icompute;
for (int i = 0; i < ncompute; i++) {
icompute = modify->find_compute(id_compute[i]);
if (icompute < 0) error->all(FLERR,"Could not find dump local compute ID");
compute[i] = modify->compute[icompute];
}
int ifix;
for (int i = 0; i < nfix; i++) {
ifix = modify->find_fix(id_fix[i]);
if (ifix < 0) error->all(FLERR,"Could not find dump local fix ID");
fix[i] = modify->fix[ifix];
if (nevery % modify->fix[ifix]->local_freq)
error->all(FLERR,"Dump local and fix not computed at compatible times");
}
// open single file, one time only
if (multifile == 0) openfile();
}
/* ---------------------------------------------------------------------- */
int DumpLocal::modify_param(int narg, char **arg)
{
if (strcmp(arg[0],"label") == 0) {
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
delete [] label;
int n = strlen(arg[1]) + 1;
label = new char[n];
strcpy(label,arg[1]);
return 2;
}
return 0;
}
/* ---------------------------------------------------------------------- */
void DumpLocal::write_header(bigint ndump)
{
if (me == 0) {
fprintf(fp,"ITEM: TIMESTEP\n");
fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF %s\n",label);
fprintf(fp,BIGINT_FORMAT "\n",ndump);
fprintf(fp,"ITEM: %s %s\n",label,columns);
}
}
/* ---------------------------------------------------------------------- */
int DumpLocal::count()
{
int i;
// invoke Computes for local quantities
if (ncompute) {
for (i = 0; i < ncompute; i++) {
if (!(compute[i]->invoked_flag & INVOKED_LOCAL)) {
compute[i]->compute_local();
compute[i]->invoked_flag |= INVOKED_LOCAL;
}
}
}
// nmine = # of local values I contribute
// must be consistent for all input fields
nmine = -1;
for (int i = 0; i < ncompute; i++) {
if (nmine < 0) nmine = compute[i]->size_local_rows;
else if (nmine != compute[i]->size_local_rows)
error->one(FLERR,"Dump local count is not consistent across input fields");
}
for (int i = 0; i < nfix; i++) {
if (nmine < 0) nmine = fix[i]->size_local_rows;
else if (nmine != fix[i]->size_local_rows)
error->one(FLERR,"Dump local count is not consistent across input fields");
}
return nmine;
}
/* ---------------------------------------------------------------------- */
void DumpLocal::pack(int *dummy)
{
for (int n = 0; n < size_one; n++) (this->*pack_choice[n])(n);
}
/* ---------------------------------------------------------------------- */
void DumpLocal::write_data(int n, double *mybuf)
{
int i,j;
int m = 0;
for (i = 0; i < n; i++) {
for (j = 0; j < size_one; j++) {
if (vtype[j] == INT) fprintf(fp,vformat[j],static_cast<int> (mybuf[m]));
else fprintf(fp,vformat[j],mybuf[m]);
m++;
}
fprintf(fp,"\n");
}
}
/* ---------------------------------------------------------------------- */
void DumpLocal::parse_fields(int narg, char **arg)
{
int computefixflag = 0;
// customize by adding to if statement
int i;
for (int iarg = 5; iarg < narg; iarg++) {
i = iarg-5;
if (strcmp(arg[iarg],"index") == 0) {
pack_choice[i] = &DumpLocal::pack_index;
vtype[i] = INT;
// compute value = c_ID
// if no trailing [], then arg is set to 0, else arg is int between []
} else if (strncmp(arg[iarg],"c_",2) == 0) {
computefixflag = 1;
pack_choice[i] = &DumpLocal::pack_compute;
vtype[i] = DOUBLE;
int n = strlen(arg[iarg]);
char *suffix = new char[n];
strcpy(suffix,&arg[iarg][2]);
char *ptr = strchr(suffix,'[');
if (ptr) {
if (suffix[strlen(suffix)-1] != ']')
error->all(FLERR,"Invalid attribute in dump local command");
argindex[i] = atoi(ptr+1);
*ptr = '\0';
} else argindex[i] = 0;
n = modify->find_compute(suffix);
if (n < 0) error->all(FLERR,"Could not find dump local compute ID");
if (modify->compute[n]->local_flag == 0)
error->all(FLERR,"Dump local compute does not compute local info");
if (argindex[i] == 0 && modify->compute[n]->size_local_cols > 0)
error->all(FLERR,"Dump local compute does not calculate local vector");
if (argindex[i] > 0 && modify->compute[n]->size_local_cols == 0)
error->all(FLERR,"Dump local compute does not calculate local array");
if (argindex[i] > 0 &&
argindex[i] > modify->compute[n]->size_local_cols)
error->all(FLERR,"Dump local compute vector is accessed out-of-range");
field2index[i] = add_compute(suffix);
delete [] suffix;
// fix value = f_ID
// if no trailing [], then arg is set to 0, else arg is between []
} else if (strncmp(arg[iarg],"f_",2) == 0) {
computefixflag = 1;
pack_choice[i] = &DumpLocal::pack_fix;
vtype[i] = DOUBLE;
int n = strlen(arg[iarg]);
char *suffix = new char[n];
strcpy(suffix,&arg[iarg][2]);
char *ptr = strchr(suffix,'[');
if (ptr) {
if (suffix[strlen(suffix)-1] != ']')
error->all(FLERR,"Invalid attribute in dump local command");
argindex[i] = atoi(ptr+1);
*ptr = '\0';
} else argindex[i] = 0;
n = modify->find_fix(suffix);
if (n < 0) error->all(FLERR,"Could not find dump local fix ID");
if (modify->fix[n]->local_flag == 0)
error->all(FLERR,"Dump local fix does not compute local info");
if (argindex[i] == 0 && modify->fix[n]->size_local_cols > 0)
error->all(FLERR,"Dump local fix does not compute local vector");
if (argindex[i] > 0 && modify->fix[n]->size_local_cols == 0)
error->all(FLERR,"Dump local fix does not compute local array");
if (argindex[i] > 0 &&
argindex[i] > modify->fix[n]->size_local_cols)
error->all(FLERR,"Dump local fix vector is accessed out-of-range");
field2index[i] = add_fix(suffix);
delete [] suffix;
} else error->all(FLERR,"Invalid attribute in dump local command");
}
if (computefixflag == 0)
error->all(FLERR,"Dump local attributes contain no compute or fix");
}
/* ----------------------------------------------------------------------
add Compute to list of Compute objects used by dump
return index of where this Compute is in list
if already in list, do not add, just return index, else add to list
------------------------------------------------------------------------- */
int DumpLocal::add_compute(char *id)
{
int icompute;
for (icompute = 0; icompute < ncompute; icompute++)
if (strcmp(id,id_compute[icompute]) == 0) break;
if (icompute < ncompute) return icompute;
id_compute = (char **)
memory->srealloc(id_compute,(ncompute+1)*sizeof(char *),"dump:id_compute");
delete [] compute;
compute = new Compute*[ncompute+1];
int n = strlen(id) + 1;
id_compute[ncompute] = new char[n];
strcpy(id_compute[ncompute],id);
ncompute++;
return ncompute-1;
}
/* ----------------------------------------------------------------------
add Fix to list of Fix objects used by dump
return index of where this Fix is in list
if already in list, do not add, just return index, else add to list
------------------------------------------------------------------------- */
int DumpLocal::add_fix(char *id)
{
int ifix;
for (ifix = 0; ifix < nfix; ifix++)
if (strcmp(id,id_fix[ifix]) == 0) break;
if (ifix < nfix) return ifix;
id_fix = (char **)
memory->srealloc(id_fix,(nfix+1)*sizeof(char *),"dump:id_fix");
delete [] fix;
fix = new Fix*[nfix+1];
int n = strlen(id) + 1;
id_fix[nfix] = new char[n];
strcpy(id_fix[nfix],id);
nfix++;
return nfix-1;
}
/* ----------------------------------------------------------------------
extraction of Compute, Fix results
------------------------------------------------------------------------- */
void DumpLocal::pack_compute(int n)
{
double *vector = compute[field2index[n]]->vector_local;
double **array = compute[field2index[n]]->array_local;
int ncount = compute[field2index[n]]->size_local_rows;
int index = argindex[n];
if (index == 0) {
for (int i = 0; i < ncount; i++) {
buf[n] = vector[i];
n += size_one;
}
} else {
index--;
for (int i = 0; i < ncount; i++) {
buf[n] = array[i][index];
n += size_one;
}
}
}
/* ---------------------------------------------------------------------- */
void DumpLocal::pack_fix(int n)
{
double *vector = fix[field2index[n]]->vector_local;
double **array = fix[field2index[n]]->array_local;
int index = argindex[n];
if (index == 0) {
for (int i = 0; i < nmine; i++) {
buf[n] = vector[i];
n += size_one;
}
} else {
index--;
for (int i = 0; i < nmine; i++) {
buf[n] = array[i][index];
n += size_one;
}
}
}
/* ----------------------------------------------------------------------
one method for every attribute dump local can output
the local value is packed into buf starting at n with stride size_one
customize a new attribute by adding a method
------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
void DumpLocal::pack_index(int n)
{
int index;
MPI_Scan(&nmine,&index,1,MPI_INT,MPI_SUM,world);
index -= nmine;
for (int i = 0; i < nmine; i++) {
buf[n] = ++index;
n += size_one;
}
}
diff --git a/src/dump_local.h b/src/dump_local.h
index cc2fedf96..8fe10ca13 100644
--- a/src/dump_local.h
+++ b/src/dump_local.h
@@ -1,80 +1,155 @@
/* ----------------------------------------------------------------------
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 DUMP_CLASS
DumpStyle(local,DumpLocal)
#else
#ifndef LMP_DUMP_LOCAL_H
#define LMP_DUMP_LOCAL_H
#include "dump.h"
namespace LAMMPS_NS {
class DumpLocal : public Dump {
public:
DumpLocal(LAMMPS *, int, char **);
~DumpLocal();
private:
int nevery; // dump frequency to check Fix against
char *label; // string for dump file header
int nmine; // # of lines I am dumping
int *vtype; // type of each vector (INT, DOUBLE)
char **vformat; // format string for each vector element
char *columns; // column labels
int nfield; // # of keywords listed by user
int *field2index; // which compute,fix,variable calcs this field
int *argindex; // index into compute,fix scalar_atom,vector_atom
// 0 for scalar_atom, 1-N for vector_atom values
int ncompute; // # of Compute objects used by dump
char **id_compute; // their IDs
class Compute **compute; // list of ptrs to the Compute objects
int nfix; // # of Fix objects used by dump
char **id_fix; // their IDs
class Fix **fix; // list of ptrs to the Fix objects
void init_style();
int modify_param(int, char **);
void write_header(bigint);
int count();
void pack(int *);
void write_data(int, double *);
void parse_fields(int, char **);
int add_compute(char *);
int add_fix(char *);
// customize by adding a method prototype
typedef void (DumpLocal::*FnPtrPack)(int);
FnPtrPack *pack_choice; // ptrs to pack functions
void pack_index(int);
void pack_compute(int);
void pack_fix(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: No dump local arguments specified
+
+Self-explanatory.
+
+E: Dump local cannot sort by atom ID
+
+This is because dump local does not really dump per-atom info.
+
+E: Could not find dump local compute ID
+
+Self-explanatory.
+
+E: Could not find dump local fix ID
+
+Self-explanatory.
+
+E: Dump local and fix not computed at compatible times
+
+The fix must produce per-atom quantities on timesteps that dump local
+needs them.
+
+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: Dump local count is not consistent across input fields
+
+Every column of output must be the same length.
+
+E: Invalid attribute in dump local command
+
+Self-explantory.
+
+E: Dump local compute does not compute local info
+
+Self-explanatory.
+
+E: Dump local compute does not calculate local vector
+
+Self-explanatory.
+
+E: Dump local compute does not calculate local array
+
+Self-explanatory.
+
+E: Dump local compute vector is accessed out-of-range
+
+Self-explanatory.
+
+E: Dump local fix does not compute local info
+
+Self-explanatory.
+
+E: Dump local fix does not compute local vector
+
+Self-explanatory.
+
+E: Dump local fix does not compute local array
+
+Self-explanatory.
+
+E: Dump local fix vector is accessed out-of-range
+
+Self-explanatory.
+
+E: Dump local attributes contain no compute or fix
+
+Self-explanatory.
+
+*/
diff --git a/src/dump_xyz.h b/src/dump_xyz.h
index 0dc4b0be5..57016eafc 100644
--- a/src/dump_xyz.h
+++ b/src/dump_xyz.h
@@ -1,43 +1,58 @@
/* ----------------------------------------------------------------------
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 DUMP_CLASS
DumpStyle(xyz,DumpXYZ)
#else
#ifndef LMP_DUMP_XYZ_H
#define LMP_DUMP_XYZ_H
#include "dump.h"
namespace LAMMPS_NS {
class DumpXYZ : public Dump {
public:
DumpXYZ(class LAMMPS *, int, char**);
~DumpXYZ() {}
private:
void init_style();
void write_header(bigint);
int count();
void pack(int *);
void write_data(int, double *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Invalid dump xyz filename
+
+Filenames used with the dump xyz style cannot be binary or cause files
+to be written by each processor.
+
+*/
diff --git a/src/error.cpp b/src/error.cpp
index b7836b45c..350f8fe1f 100644
--- a/src/error.cpp
+++ b/src/error.cpp
@@ -1,156 +1,154 @@
/* ----------------------------------------------------------------------
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 "mpi.h"
#include "stdlib.h"
#include "error.h"
#include "universe.h"
#include "memory.h"
#include "output.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
Error::Error(LAMMPS *lmp) : Pointers(lmp) {}
/* ----------------------------------------------------------------------
called by all procs in universe
close all output, screen, and log files in world and universe
no abort, so insure all procs in universe call, else will hang
------------------------------------------------------------------------- */
void Error::universe_all(const char *file, int line, const char *str)
{
MPI_Barrier(universe->uworld);
if (universe->me == 0) {
if (universe->uscreen) fprintf(universe->uscreen,
"ERROR: %s (%s:%d)\n",str,file,line);
if (universe->ulogfile) fprintf(universe->ulogfile,
"ERROR: %s (%s:%d)\n",str,file,line);
}
if (output) delete output;
if (universe->nworlds > 1) {
if (screen && screen != stdout) fclose(screen);
if (logfile) fclose(logfile);
}
if (universe->ulogfile) fclose(universe->ulogfile);
MPI_Finalize();
exit(1);
}
/* ----------------------------------------------------------------------
called by one proc in universe
forces abort of entire universe if any proc in universe calls
------------------------------------------------------------------------- */
void Error::universe_one(const char *file, int line, const char *str)
{
if (universe->uscreen)
fprintf(universe->uscreen,"ERROR on proc %d: %s (%s:%d)\n",
universe->me,str,file,line);
MPI_Abort(universe->uworld,1);
}
/* ----------------------------------------------------------------------
called by all procs in one world
close all output, screen, and log files in world
insure all procs in world call, else will hang
- if abort = 0 (default):
- if only one world in universe calls, universe will hang
- if abort = 1: force abort of entire universe if any world in universe calls
+ force MPI_Abort if running in multi-partition mode
------------------------------------------------------------------------- */
-void Error::all(const char *file, int line, const char *str, int abort)
+void Error::all(const char *file, int line, const char *str)
{
MPI_Barrier(world);
int me;
MPI_Comm_rank(world,&me);
if (me == 0) {
if (screen) fprintf(screen,"ERROR: %s (%s:%d)\n",str,file,line);
if (logfile) fprintf(logfile,"ERROR: %s (%s:%d)\n",str,file,line);
}
if (output) delete output;
if (screen && screen != stdout) fclose(screen);
if (logfile) fclose(logfile);
- if (abort) MPI_Abort(world,1);
+ if (universe->nworlds > 1) MPI_Abort(universe->uworld,1);
MPI_Finalize();
exit(1);
}
/* ----------------------------------------------------------------------
called by one proc in world
write to world screen only if non-NULL on this proc
always write to universe screen
forces abort of entire world (and universe) if any proc in world calls
------------------------------------------------------------------------- */
void Error::one(const char *file, int line, const char *str)
{
int me;
MPI_Comm_rank(world,&me);
if (screen) fprintf(screen,"ERROR on proc %d: %s (%s:%d)\n",
me,str,file,line);
if (universe->nworlds > 1)
fprintf(universe->uscreen,"ERROR on proc %d: %s (%s:%d)\n",
universe->me,str,file,line);
MPI_Abort(world,1);
}
/* ----------------------------------------------------------------------
called by one proc in world
only write to screen if non-NULL on this proc since could be file
------------------------------------------------------------------------- */
void Error::warning(const char *file, int line, const char *str, int logflag)
{
if (screen) fprintf(screen,"WARNING: %s (%s:%d)\n",str,file,line);
if (logflag && logfile) fprintf(logfile,"WARNING: %s (%s:%d)\n",
str,file,line);
}
/* ----------------------------------------------------------------------
called by one proc in world, typically proc 0
write message to screen and logfile (if logflag is set)
------------------------------------------------------------------------- */
-void Error::message(const char *file, int line, char *str, int logflag)
+void Error::message(const char *file, int line, const char *str, int logflag)
{
if (screen) fprintf(screen,"%s (%s:%d)\n",str,file,line);
if (logflag && logfile) fprintf(logfile,"%s (%s:%d)\n",str,file,line);
}
/* ----------------------------------------------------------------------
called by all procs in one world
close all output, screen, and log files in world
no abort, so insure all procs in world call, else will hang
------------------------------------------------------------------------- */
void Error::done()
{
MPI_Barrier(world);
if (output) delete output;
if (screen && screen != stdout) fclose(screen);
if (logfile) fclose(logfile);
MPI_Finalize();
exit(1);
}
diff --git a/src/error.h b/src/error.h
index 3ab51866b..df25f7c41 100644
--- a/src/error.h
+++ b/src/error.h
@@ -1,37 +1,40 @@
/* ----------------------------------------------------------------------
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_ERROR_H
#define LMP_ERROR_H
#include "pointers.h"
namespace LAMMPS_NS {
class Error : protected Pointers {
public:
Error(class LAMMPS *);
void universe_all(const char *, int, const char *);
void universe_one(const char *, int, const char *);
- void all(const char *, int, const char *, int = 0);
+ void all(const char *, int, const char *);
void one(const char *, int, const char *);
void warning(const char *, int, const char *, int = 1);
- void message(const char *, int, char *, int = 1);
+ void message(const char *, int, const char *, int = 1);
void done();
};
}
#endif
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/finish.h b/src/finish.h
index c2f7e8a19..09c28f975 100644
--- a/src/finish.h
+++ b/src/finish.h
@@ -1,32 +1,35 @@
/* ----------------------------------------------------------------------
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_FINISH_H
#define LMP_FINISH_H
#include "pointers.h"
namespace LAMMPS_NS {
class Finish : protected Pointers {
public:
Finish(class LAMMPS *);
void end(int);
private:
void stats(int, double *, double *, double *, double *, int, int *);
};
}
#endif
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/fix.h b/src/fix.h
index b1ede8b67..59a620be7 100644
--- a/src/fix.h
+++ b/src/fix.h
@@ -1,172 +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.
------------------------------------------------------------------------- */
#ifndef LMP_FIX_H
#define LMP_FIX_H
#include "pointers.h"
namespace LAMMPS_NS {
class Fix : protected Pointers {
public:
char *id,*style;
int igroup,groupbit;
int restart_global; // 1 if Fix saves global state, 0 if not
int restart_peratom; // 1 if Fix saves peratom state, 0 if not
int force_reneighbor; // 1 if Fix forces reneighboring, 0 if not
int box_change; // 1 if Fix changes box, 0 if not
int box_change_size; // 1 if Fix changes box size, 0 if not
int box_change_shape; // 1 if Fix changes box shape, 0 if not
bigint next_reneighbor; // next timestep to force a reneighboring
int thermo_energy; // 1 if fix_modify enabled ThEng, 0 if not
int nevery; // how often to call an end_of_step fix
int rigid_flag; // 1 if Fix integrates rigid bodies, 0 if not
int virial_flag; // 1 if Fix contributes to virial, 0 if not
int no_change_box; // 1 if cannot swap ortho <-> triclinic
int time_integrate; // 1 if fix performs time integration, 0 if no
int time_depend; // 1 if fix is timestep dependent, 0 if not
int create_attribute; // 1 if fix stores attributes that need
// setting when a new atom is created
int restart_pbc; // 1 if fix moves atoms (except integrate)
// so write_restart must remap to PBC
int cudable_comm; // 1 if fix has CUDA-enabled communication
int scalar_flag; // 0/1 if compute_scalar() function exists
int vector_flag; // 0/1 if compute_vector() function exists
int array_flag; // 0/1 if compute_array() function exists
int size_vector; // length of global vector
int size_array_rows; // rows in global array
int size_array_cols; // columns in global array
int global_freq; // frequency s/v data is available at
int peratom_flag; // 0/1 if per-atom data is stored
int size_peratom_cols; // 0 = vector, N = columns in peratom array
int peratom_freq; // frequency per-atom data is available at
int local_flag; // 0/1 if local data is stored
int size_local_rows; // rows in local vector or array
int size_local_cols; // 0 = vector, N = columns in local array
int local_freq; // frequency local data is available at
int extscalar; // 0/1 if global scalar is intensive/extensive
int extvector; // 0/1/-1 if global vector is all int/ext/extlist
int *extlist; // list of 0/1 int/ext for each vec component
int extarray; // 0/1 if global array is intensive/extensive
double *vector_atom; // computed per-atom vector
double **array_atom; // computed per-atom array
double *vector_local; // computed local vector
double **array_local; // computed local array
int comm_forward; // size of forward communication (0 if none)
int comm_reverse; // size of reverse communication (0 if none)
double virial[6]; // accumlated virial
double **vatom; // accumulated per-atom virial
int INITIAL_INTEGRATE,POST_INTEGRATE; // mask settings
int PRE_EXCHANGE,PRE_NEIGHBOR;
int PRE_FORCE,POST_FORCE,FINAL_INTEGRATE,END_OF_STEP,THERMO_ENERGY;
int INITIAL_INTEGRATE_RESPA,POST_INTEGRATE_RESPA;
int PRE_FORCE_RESPA,POST_FORCE_RESPA,FINAL_INTEGRATE_RESPA;
int MIN_PRE_EXCHANGE,MIN_PRE_FORCE,MIN_POST_FORCE,MIN_ENERGY;
int POST_RUN;
Fix(class LAMMPS *, int, char **);
virtual ~Fix();
void modify_params(int, char **);
virtual int setmask() = 0;
virtual void init() {}
virtual void init_list(int, class NeighList *) {}
virtual void setup(int) {}
virtual void setup_pre_exchange() {}
virtual void setup_pre_force(int) {}
virtual void min_setup(int) {}
virtual void initial_integrate(int) {}
virtual void post_integrate() {}
virtual void pre_exchange() {}
virtual void pre_neighbor() {}
virtual void pre_force(int) {}
virtual void post_force(int) {}
virtual void final_integrate() {}
virtual void end_of_step() {}
virtual void post_run() {}
virtual void write_restart(FILE *) {}
virtual void restart(char *) {}
virtual void grow_arrays(int) {}
virtual void copy_arrays(int, int) {}
virtual void set_arrays(int) {}
virtual int pack_exchange(int, double *) {return 0;}
virtual int unpack_exchange(int, double *) {return 0;}
virtual int pack_restart(int, double *) {return 0;}
virtual void unpack_restart(int, int) {}
virtual int size_restart(int) {return 0;}
virtual int maxsize_restart() {return 0;}
virtual void setup_pre_force_respa(int, int) {}
virtual void initial_integrate_respa(int, int, int) {}
virtual void post_integrate_respa(int, int) {}
virtual void pre_force_respa(int, int, int) {}
virtual void post_force_respa(int, int, int) {}
virtual void final_integrate_respa(int, int) {}
virtual void min_setup_pre_force(int) {}
virtual void min_pre_exchange() {}
virtual void min_pre_force(int) {}
virtual void min_post_force(int) {}
virtual double min_energy(double *) {return 0.0;}
virtual void min_store() {}
virtual void min_clearstore() {}
virtual void min_pushstore() {}
virtual void min_popstore() {}
virtual int min_reset_ref() {return 0;}
virtual void min_step(double, double *) {}
virtual double max_alpha(double *) {return 0.0;}
virtual int min_dof() {return 0;}
virtual int pack_comm(int, int *, double *, int, int *) {return 0;}
virtual void unpack_comm(int, int, double *) {}
virtual int pack_reverse_comm(int, int, double *) {return 0;}
virtual void unpack_reverse_comm(int, int *, double *) {}
virtual double compute_scalar() {return 0.0;}
virtual double compute_vector(int) {return 0.0;}
virtual double compute_array(int,int) {return 0.0;}
virtual int dof(int) {return 0;}
virtual void deform(int) {}
virtual void reset_target(double) {}
virtual void reset_dt() {}
virtual int modify_param(int, char **) {return 0;}
virtual double memory_usage() {return 0.0;}
protected:
int evflag;
int vflag_global,vflag_atom;
int maxvatom;
void v_setup(int);
void v_tally(int, int *, double, double *);
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Fix ID must be alphanumeric or underscore characters
+
+Self-explanatory.
+
+E: Could not find fix group ID
+
+A group ID used in the fix command does not exist.
+
+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.
+
+*/
diff --git a/src/fix_adapt.h b/src/fix_adapt.h
index b25ee0eb7..2fb9987cd 100644
--- a/src/fix_adapt.h
+++ b/src/fix_adapt.h
@@ -1,64 +1,102 @@
/* ----------------------------------------------------------------------
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(adapt,FixAdapt)
#else
#ifndef LMP_FIX_ADAPT_H
#define LMP_FIX_ADAPT_H
#include "fix.h"
namespace LAMMPS_NS {
class FixAdapt : public Fix {
public:
int diamflag; // 1 if atom diameters will vary, for AtomVecGranular
FixAdapt(class LAMMPS *, int, char **);
~FixAdapt();
int setmask();
void init();
void setup_pre_force(int);
void pre_force(int);
void post_run();
private:
int nadapt,resetflag,scaleflag;
int anypair;
struct Adapt {
int which,ivar;
char *var;
char *pstyle,*pparam;
int ilo,ihi,jlo,jhi;
int pdim;
double *scalar,scalar_orig;
double **array,**array_orig;
int aparam;
};
Adapt *adapt;
double *kspace_scale;
void change_settings();
void restore_settings();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Variable name for fix adapt does not exist
+
+Self-explanatory.
+
+E: Variable for fix adapt is invalid style
+
+Only equal-style variables can be used.
+
+E: Fix adapt pair style does not exist
+
+Self-explanatory
+
+E: Fix adapt pair style param not supported
+
+The pair style does not know about the parameter you specified.
+
+E: Fix adapt type pair range is not valid for pair hybrid sub-style
+
+Self-explanatory.
+
+E: Fix adapt kspace style does not exist
+
+Self-explanatory.
+
+E: Fix adapt requires atom attribute diameter
+
+The atom style being used does not specify an atom diameter.
+
+*/
diff --git a/src/fix_addforce.h b/src/fix_addforce.h
index 82798d98b..a8c283369 100644
--- a/src/fix_addforce.h
+++ b/src/fix_addforce.h
@@ -1,59 +1,91 @@
/* ----------------------------------------------------------------------
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(addforce,FixAddForce)
#else
#ifndef LMP_FIX_ADDFORCE_H
#define LMP_FIX_ADDFORCE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixAddForce : public Fix {
public:
FixAddForce(class LAMMPS *, int, char **);
~FixAddForce();
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);
double memory_usage();
private:
double xvalue,yvalue,zvalue;
int varflag,iregion;
char *xstr,*ystr,*zstr,*estr;
char *idregion;
int xvar,yvar,zvar,evar,xstyle,ystyle,zstyle,estyle;
double foriginal[4],foriginal_all[4];
int force_flag;
int nlevels_respa;
int maxatom;
double **sforce;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Region ID for fix addforce does not exist
+
+Self-explanatory.
+
+E: Variable name for fix addforce does not exist
+
+Self-explanatory.
+
+E: Variable for fix addforce is invalid style
+
+Self-explanatory.
+
+E: Cannot use variable energy with constant force in fix addforce
+
+This is because for constant force, LAMMPS can compute the change
+in energy directly.
+
+E: Must use variable energy with fix addforce
+
+Must define an energy vartiable when applyting a dynamic
+force during minimization.
+
+*/
diff --git a/src/fix_ave_atom.h b/src/fix_ave_atom.h
index 1995134f6..10bfb34fa 100644
--- a/src/fix_ave_atom.h
+++ b/src/fix_ave_atom.h
@@ -1,57 +1,120 @@
/* ----------------------------------------------------------------------
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(ave/atom,FixAveAtom)
#else
#ifndef LMP_FIX_AVE_ATOM_H
#define LMP_FIX_AVE_ATOM_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
class FixAveAtom : public Fix {
public:
FixAveAtom(class LAMMPS *, int, char **);
~FixAveAtom();
int setmask();
void init();
void setup(int);
void end_of_step();
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
private:
int nvalues;
int nrepeat,irepeat;
bigint nvalid;
int *which,*argindex,*value2index;
char **ids;
double **array;
bigint nextvalid();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute ID for fix ave/atom does not exist
+
+Self-explanatory.
+
+E: Fix ave/atom compute does not calculate per-atom values
+
+A compute used by fix ave/atom must generate per-atom values.
+
+E: Fix ave/atom compute does not calculate a per-atom vector
+
+A compute used by fix ave/atom must generate per-atom values.
+
+E: Fix ave/atom compute does not calculate a per-atom array
+
+Self-explanatory.
+
+E: Fix ave/atom compute array is accessed out-of-range
+
+Self-explanatory.
+
+E: Fix ID for fix ave/atom does not exist
+
+Self-explanatory.
+
+E: Fix ave/atom fix does not calculate per-atom values
+
+A fix used by fix ave/atom must generate per-atom values.
+
+E: Fix ave/atom fix does not calculate a per-atom vector
+
+A fix used by fix ave/atom must generate per-atom values.
+
+E: Fix ave/atom fix does not calculate a per-atom array
+
+Self-explanatory.
+
+E: Fix ave/atom fix array is accessed out-of-range
+
+Self-explanatory.
+
+E: Fix for fix ave/atom not computed at compatible time
+
+Fixes generate their values on specific timesteps. Fix ave/atom is
+requesting a value on a non-allowed timestep.
+
+E: Variable name for fix ave/atom does not exist
+
+Self-explanatory.
+
+E: Fix ave/atom variable is not atom-style variable
+
+A variable used by fix ave/atom must generate per-atom values.
+
+*/
diff --git a/src/fix_ave_correlate.h b/src/fix_ave_correlate.h
index 91f2491a0..72c9e0f85 100644
--- a/src/fix_ave_correlate.h
+++ b/src/fix_ave_correlate.h
@@ -1,68 +1,128 @@
/* ----------------------------------------------------------------------
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(ave/correlate,FixAveCorrelate)
#else
#ifndef LMP_FIX_AVE_CORRELATE_H
#define LMP_FIX_AVE_CORRELATE_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
class FixAveCorrelate : public Fix {
public:
FixAveCorrelate(class LAMMPS *, int, char **);
~FixAveCorrelate();
int setmask();
void init();
void setup(int);
void end_of_step();
double compute_array(int,int);
private:
int me,nvalues;
int nrepeat,nfreq;
bigint nvalid;
int *which,*argindex,*value2index;
char **ids;
FILE *fp;
int type,ave,startstep;
double prefactor;
char *title1,*title2,*title3;
int firstindex; // index in values ring of earliest time sample
int lastindex; // index in values ring of latest time sample
int nsample; // number of time samples in values ring
int npair; // number of correlation pairs to calculate
int *count;
double **values,**corr;
int *save_count; // saved values at Nfreq for output via compute_array()
double **save_corr;
void accumulate();
bigint nextvalid();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot open fix ave/correlate file %s
+
+The specified file cannot be opened. Check that the path and name are
+correct.
+
+E: Compute ID for fix ave/correlate does not exist
+
+Self-explanatory.
+
+E: Fix ave/correlate compute does not calculate a scalar
+
+UNDOCUMENTED
+
+E: Fix ave/correlate compute does not calculate a vector
+
+UNDOCUMENTED
+
+E: Fix ave/correlate compute vector is accessed out-of-range
+
+UNDOCUMENTED
+
+E: Fix ID for fix ave/correlate does not exist
+
+Self-explanatory.
+
+E: Fix ave/correlate fix does not calculate a scalar
+
+UNDOCUMENTED
+
+E: Fix ave/correlate fix does not calculate a vector
+
+UNDOCUMENTED
+
+E: Fix ave/correlate fix vector is accessed out-of-range
+
+UNDOCUMENTED
+
+E: Fix for fix ave/correlate not computed at compatible time
+
+Fixes generate their values on specific timesteps. Fix ave/correlate
+is requesting a value on a non-allowed timestep.
+
+E: Variable name for fix ave/correlate does not exist
+
+Self-explanatory.
+
+E: Fix ave/correlate variable is not equal-style variable
+
+UNDOCUMENTED
+
+*/
diff --git a/src/fix_ave_histo.h b/src/fix_ave_histo.h
index f36542310..4316bd72e 100644
--- a/src/fix_ave_histo.h
+++ b/src/fix_ave_histo.h
@@ -1,75 +1,220 @@
/* ----------------------------------------------------------------------
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(ave/histo,FixAveHisto)
#else
#ifndef LMP_FIX_AVE_HISTO_H
#define LMP_FIX_AVE_HISTO_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
class FixAveHisto : public Fix {
public:
FixAveHisto(class LAMMPS *, int, char **);
~FixAveHisto();
int setmask();
void init();
void setup(int);
void end_of_step();
double compute_vector(int);
double compute_array(int,int);
private:
int me,nvalues;
int nrepeat,nfreq,irepeat;
bigint nvalid;
int *which,*argindex,*value2index;
char **ids;
FILE *fp;
double lo,hi,binsize,bininv;
int kind,beyond;
double stats[4],stats_total[4],stats_all[4];
double **stats_list;
int nbins;
double *bin,*bin_total,*bin_all;
double **bin_list;
double *coord;
double *vector;
int maxatom;
int ave,nwindow,nsum,startstep,mode;
char *title1,*title2,*title3;
int iwindow,window_limit;
void bin_one(double);
void bin_vector(int, double *, int);
void bin_atoms(double *, int);
void options(int, char **);
void allocate_values(int);
bigint nextvalid();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute ID for fix ave/histo does not exist
+
+Self-explanatory.
+
+E: Fix ID for fix ave/histo does not exist
+
+Self-explanatory.
+
+E: Fix ave/histo input is invalid compute
+
+Self-explanatory.
+
+E: Fix ave/histo input is invalid fix
+
+Self-explanatory.
+
+E: Fix ave/histo input is invalid variable
+
+Self-explanatory.
+
+E: Fix ave/histo inputs are not all global, peratom, or local
+
+All inputs in a single fix ave/histo command must be of the
+same style.
+
+E: Fix ave/histo cannot input per-atom values in scalar mode
+
+Self-explanatory.
+
+E: Fix ave/histo cannot input local values in scalar mode
+
+Self-explanatory.
+
+E: Fix ave/histo compute does not calculate a global scalar
+
+Self-explanatory.
+
+E: Fix ave/histo compute does not calculate a global vector
+
+Self-explanatory.
+
+E: Fix ave/histo compute vector is accessed out-of-range
+
+Self-explanatory.
+
+E: Fix ave/histo compute does not calculate a global array
+
+Self-explanatory.
+
+E: Fix ave/histo compute array is accessed out-of-range
+
+Self-explanatory.
+
+E: Fix ave/histo compute does not calculate per-atom values
+
+Self-explanatory.
+
+E: Fix ave/histo compute does not calculate a per-atom vector
+
+Self-explanatory.
+
+E: Fix ave/histo compute does not calculate a per-atom array
+
+Self-explanatory.
+
+E: Fix ave/histo compute does not calculate local values
+
+Self-explanatory.
+
+E: Fix ave/histo compute does not calculate a local vector
+
+Self-explanatory.
+
+E: Fix ave/histo compute does not calculate a local array
+
+Self-explanatory.
+
+E: Fix ave/histo fix does not calculate a global scalar
+
+Self-explanatory.
+
+E: Fix ave/histo fix does not calculate a global vector
+
+Self-explanatory.
+
+E: Fix ave/histo fix vector is accessed out-of-range
+
+Self-explanatory.
+
+E: Fix for fix ave/histo not computed at compatible time
+
+Fixes generate their values on specific timesteps. Fix ave/histo is
+requesting a value on a non-allowed timestep.
+
+E: Fix ave/histo fix does not calculate a global array
+
+Self-explanatory.
+
+E: Fix ave/histo fix array is accessed out-of-range
+
+Self-explanatory.
+
+E: Fix ave/histo fix does not calculate per-atom values
+
+Self-explanatory.
+
+E: Fix ave/histo fix does not calculate a per-atom vector
+
+Self-explanatory.
+
+E: Fix ave/histo fix does not calculate a per-atom array
+
+Self-explanatory.
+
+E: Fix ave/histo fix does not calculate local values
+
+Self-explanatory.
+
+E: Fix ave/histo fix does not calculate a local vector
+
+Self-explanatory.
+
+E: Fix ave/histo fix does not calculate a local array
+
+Self-explanatory.
+
+E: Variable name for fix ave/histo does not exist
+
+Self-explanatory.
+
+E: Cannot open fix ave/histo file %s
+
+The specified file cannot be opened. Check that the path and name are
+correct.
+
+*/
diff --git a/src/fix_ave_spatial.h b/src/fix_ave_spatial.h
index fcf1bf022..ece55f48f 100644
--- a/src/fix_ave_spatial.h
+++ b/src/fix_ave_spatial.h
@@ -1,82 +1,176 @@
/* ----------------------------------------------------------------------
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(ave/spatial,FixAveSpatial)
#else
#ifndef LMP_FIX_AVE_SPATIAL_H
#define LMP_FIX_AVE_SPATIAL_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
class FixAveSpatial : public Fix {
public:
FixAveSpatial(class LAMMPS *, int, char **);
~FixAveSpatial();
int setmask();
void init();
void setup(int);
void end_of_step();
double compute_array(int,int);
double memory_usage();
private:
int me,nvalues;
int nrepeat,nfreq,irepeat;
bigint nvalid;
int ndim,normflag,regionflag,iregion;
char *tstring,*sstring,*idregion;
int *which,*argindex,*value2index;
char **ids;
FILE *fp;
class Region *region;
int ave,nwindow,scaleflag;
int norm,iwindow,window_limit;
double xscale,yscale,zscale;
double bin_volume;
int dim[3],originflag[3],nlayers[3];
double origin[3],delta[3];
double offset[3],invdelta[3];
int maxvar;
double *varatom;
int maxatom;
int *bin;
int nbins,maxbin;
double **coord;
double *count_one,*count_many,*count_sum;
double **values_one,**values_many,**values_sum;
double *count_total,**count_list;
double **values_total,***values_list;
void setup_bins();
void atom2bin1d();
void atom2bin2d();
void atom2bin3d();
bigint nextvalid();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot use fix ave/spatial z for 2 dimensional model
+
+Self-explanatory.
+
+E: Same dimension twice in fix ave/spatial
+
+Self-explanatory.
+
+E: Region ID for fix ave/spatial does not exist
+
+Self-explanatory.
+
+E: Cannot open fix ave/spatial file %s
+
+The specified file cannot be opened. Check that the path and name are
+correct.
+
+E: Compute ID for fix ave/spatial does not exist
+
+Self-explanatory.
+
+E: Fix ave/spatial compute does not calculate per-atom values
+
+A compute used by fix ave/spatial must generate per-atom values.
+
+E: Fix ave/spatial compute does not calculate a per-atom vector
+
+A compute used by fix ave/spatial must generate per-atom values.
+
+E: Fix ave/spatial compute does not calculate a per-atom array
+
+Self-explanatory.
+
+E: Fix ave/spatial compute vector is accessed out-of-range
+
+The index for the vector is out of bounds.
+
+E: Fix ID for fix ave/spatial does not exist
+
+Self-explanatory.
+
+E: Fix ave/spatial fix does not calculate per-atom values
+
+A fix used by fix ave/spatial must generate per-atom values.
+
+E: Fix ave/spatial fix does not calculate a per-atom vector
+
+A fix used by fix ave/spatial must generate per-atom values.
+
+E: Fix ave/spatial fix does not calculate a per-atom array
+
+Self-explanatory.
+
+E: Fix ave/spatial fix vector is accessed out-of-range
+
+The index for the vector is out of bounds.
+
+E: Variable name for fix ave/spatial does not exist
+
+Self-explanatory.
+
+E: Fix ave/spatial variable is not atom-style variable
+
+A variable used by fix ave/spatial must generate per-atom values.
+
+E: Fix ave/spatial for triclinic boxes requires units reduced
+
+Self-explanatory.
+
+E: Use of fix ave/spatial with undefined lattice
+
+A lattice must be defined to use fix ave/spatial with units = lattice.
+
+E: Fix ave/spatial settings invalid with changing box
+
+If the ave setting is "running" or "window" and the box size/shape
+changes during the simulation, then the units setting must be
+"reduced", else the number of bins may change.
+
+E: Fix for fix ave/spatial not computed at compatible time
+
+Fixes generate their values on specific timesteps. Fix ave/spatial is
+requesting a value on a non-allowed timestep.
+
+*/
diff --git a/src/fix_ave_time.h b/src/fix_ave_time.h
index b59c2c312..d6f0f4935 100644
--- a/src/fix_ave_time.h
+++ b/src/fix_ave_time.h
@@ -1,73 +1,169 @@
/* ----------------------------------------------------------------------
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(ave/time,FixAveTime)
#else
#ifndef LMP_FIX_AVE_TIME_H
#define LMP_FIX_AVE_TIME_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
class FixAveTime : public Fix {
public:
FixAveTime(class LAMMPS *, int, char **);
~FixAveTime();
int setmask();
void init();
void setup(int);
void end_of_step();
double compute_scalar();
double compute_vector(int);
double compute_array(int,int);
private:
int me,nvalues;
int nrepeat,nfreq,irepeat;
bigint nvalid;
int *which,*argindex,*value2index,*offcol;
char **ids;
FILE *fp;
int nrows;
int ave,nwindow,nsum,startstep,mode;
int noff;
int *offlist;
char *title1,*title2,*title3;
int norm,iwindow,window_limit;
double *vector;
double *vector_total;
double **vector_list;
double *column;
double **array;
double **array_total;
double ***array_list;
void invoke_scalar(bigint);
void invoke_vector(bigint);
void options(int, char **);
void allocate_values(int);
bigint nextvalid();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Compute ID for fix ave/time does not exist
+
+Self-explanatory.
+
+E: Fix ID for fix ave/time does not exist
+
+Self-explanatory.
+
+E: Invalid fix ave/time off column
+
+Self-explantory.
+
+E: Fix ave/time compute does not calculate a scalar
+
+Only computes that calculate a scalar or vector quantity (not a
+per-atom quantity) can be used with fix ave/time.
+
+E: Fix ave/time compute does not calculate a vector
+
+Only computes that calculate a scalar or vector quantity (not a
+per-atom quantity) can be used with fix ave/time.
+
+E: Fix ave/time compute vector is accessed out-of-range
+
+The index for the vector is out of bounds.
+
+E: Fix ave/time compute does not calculate an array
+
+Self-explanatory.
+
+E: Fix ave/time compute array is accessed out-of-range
+
+Self-explanatory.
+
+E: Fix ave/time fix does not calculate a scalar
+
+A fix used by fix ave/time must generate global values.
+
+E: Fix ave/time fix does not calculate a vector
+
+A fix used by fix ave/time must generate global values.
+
+E: Fix ave/time fix vector is accessed out-of-range
+
+The index for the vector is out of bounds.
+
+E: Fix for fix ave/time not computed at compatible time
+
+Fixes generate their values on specific timesteps. Fix ave/time
+is requesting a value on a non-allowed timestep.
+
+E: Fix ave/time fix does not calculate an array
+
+Self-explanatory.
+
+E: Fix ave/time fix array is accessed out-of-range
+
+Self-explanatory.
+
+E: Variable name for fix ave/time does not exist
+
+Self-explanatory.
+
+E: Fix ave/time variable is not equal-style variable
+
+A variable used by fix ave/time must generate a global value.
+
+E: Fix ave/time cannot use variable with vector mode
+
+Variables produce scalar values.
+
+E: Fix ave/time columns are inconsistent lengths
+
+Self-explanatory.
+
+E: Fix ave/time cannot set output array intensive/extensive from these inputs
+
+One of more of the vector inputs has individual elements which are
+flagged as intensive or extensive. Such an input cannot be flagged as
+all intensive/extensive when turned into an array by fix ave/time.
+
+E: Cannot open fix ave/time file %s
+
+The specified file cannot be opened. Check that the path and name are
+correct.
+
+*/
diff --git a/src/fix_aveforce.h b/src/fix_aveforce.h
index 0f84f47c4..f4bda6d91 100644
--- a/src/fix_aveforce.h
+++ b/src/fix_aveforce.h
@@ -1,54 +1,76 @@
/* ----------------------------------------------------------------------
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(aveforce,FixAveForce)
#else
#ifndef LMP_FIX_AVEFORCE_H
#define LMP_FIX_AVEFORCE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixAveForce : public Fix {
public:
FixAveForce(class LAMMPS *, int, char **);
~FixAveForce();
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_vector(int);
private:
double xvalue,yvalue,zvalue;
int varflag;
char *xstr,*ystr,*zstr;
char *idregion;
int xvar,yvar,zvar,xstyle,ystyle,zstyle;
int iregion;
double foriginal_all[4];
int nlevels_respa;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Region ID for fix aveforce does not exist
+
+Self-explanatory.
+
+E: Variable name for fix aveforce does not exist
+
+Self-explanatory.
+
+E: Variable for fix aveforce is invalid style
+
+Only equal-style variables can be used.
+
+*/
diff --git a/src/fix_box_relax.h b/src/fix_box_relax.h
index 590412e9e..53caf18ef 100644
--- a/src/fix_box_relax.h
+++ b/src/fix_box_relax.h
@@ -1,93 +1,179 @@
/* ----------------------------------------------------------------------
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(box/relax,FixBoxRelax)
#else
#ifndef LMP_FIX_BOX_RELAX_H
#define LMP_FIX_BOX_RELAX_H
#include "fix.h"
namespace LAMMPS_NS {
class FixBoxRelax : public Fix {
public:
FixBoxRelax(class LAMMPS *, int, char **);
~FixBoxRelax();
int setmask();
void init();
double min_energy(double *);
void min_store();
void min_clearstore();
void min_pushstore();
void min_popstore();
int min_reset_ref();
void min_step(double, double *);
double max_alpha(double *);
int min_dof();
int modify_param(int, char **);
private:
int p_flag[6];
int pstyle,pcouple,allremap;
int dimension;
double p_target[6],p_current[6];
double vol0,xprdinit,yprdinit,zprdinit;
double vmax,pv2e,pflagsum;
int kspace_flag;
int current_lifo; // LIFO stack pointer
double boxlo0[2][3]; // box bounds at start of line search
double boxhi0[2][3];
double boxtilt0[2][3]; // xy,xz,yz tilts at start of line search
double s0[3]; // scale matrix at start of line search
double ds[6]; // increment in scale matrix
char *id_temp,*id_press;
class Compute *temperature,*pressure;
int tflag,pflag;
int nrigid;
int *rfix;
double sigma[6]; // scaled target stress
double utsigma[3]; // weighting for upper-tri elements
// of modified sigma
int sigmamod_flag; // 1 if modified sigma to be used
double fdev[6]; // Deviatoric force on cell
int deviatoric_flag; // 0 if target stress tensor is hydrostatic
double h0[6]; // h_inv of reference (zero strain) box
double h0_inv[6]; // h_inv of reference (zero strain) box
int nreset_h0; // interval for resetting h0
double p_hydro; // hydrostatic component of target stress
void remap();
void couple();
void compute_sigma();
void compute_deviatoric();
double compute_strain_energy();
void compute_press_target();
double compute_scalar();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Invalid fix box/relax command for a 2d simulation
+
+Fix box/relax styles involving the z dimension cannot be used in
+a 2d simulation.
+
+E: Invalid fix box/relax command pressure settings
+
+If multiple dimensions are coupled, those dimensions must be specified.
+
+E: Cannot use fix box/relax on a non-periodic dimension
+
+When specifying a diagonal pressure component, the dimension must be
+periodic.
+
+E: Cannot use fix box/relax on a 2nd non-periodic dimension
+
+When specifying an off-diagonal pressure component, the 2nd of the two
+dimensions must be periodic. E.g. if the xy component is specified,
+then the y dimension must be periodic.
+
+E: Can not specify Pxy/Pxz/Pyz in fix box/relax with non-triclinic box
+
+Only triclinic boxes can be used with off-diagonal pressure components.
+See the region prism command for details.
+
+E: Invalid fix box/relax pressure settings
+
+Settings for coupled dimensions must be the same.
+
+E: Temperature ID for fix box/relax does not exist
+
+Self-explanatory.
+
+E: Pressure ID for fix box/relax does not exist
+
+The compute ID needed to compute pressure for the fix does not
+exist.
+
+E: Attempt to push beyond stack limit in fix box/relax
+
+Internal LAMMPS error. Please report it to the developers.
+
+E: Attempt to pop empty stack in fix box/relax
+
+Internal LAMMPS error. Please report it to the developers.
+
+E: Fix box/relax generated negative box length
+
+The pressure being applied is likely too large. Try applying
+it incrementally, to build to the high pressure.
+
+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.
+
+*/
diff --git a/src/fix_deform.h b/src/fix_deform.h
index 2c9e3a43f..5b268e48a 100644
--- a/src/fix_deform.h
+++ b/src/fix_deform.h
@@ -1,70 +1,122 @@
/* ----------------------------------------------------------------------
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(deform,FixDeform)
#else
#ifndef LMP_FIX_DEFORM_H
#define LMP_FIX_DEFORM_H
#include "fix.h"
namespace LAMMPS_NS {
class FixDeform : public Fix {
public:
int remapflag; // whether x,v are remapped across PBC
int dimflag[6]; // which dims are deformed
FixDeform(class LAMMPS *, int, char **);
~FixDeform();
int setmask();
void init();
void pre_exchange();
void end_of_step();
private:
int triclinic,scaleflag,flip;
double *h_rate,*h_ratelo;
int kspace_flag; // 1 if KSpace invoked, 0 if not
int nrigid; // number of rigid fixes
int *rfix; // indices of rigid fixes
class Irregular *irregular; // for migrating atoms after box flips
double TWOPI;
struct Set {
int style,substyle;
double flo,fhi,ftilt;
double dlo,dhi,dtilt;
double scale,vel,rate;
double amplitude,tperiod;
double lo_initial,hi_initial;
double lo_start,hi_start,lo_stop,hi_stop,lo_target,hi_target;
double tilt_initial,tilt_start,tilt_stop,tilt_target,tilt_flip;
double tilt_min,tilt_max;
double vol_initial,vol_start;
int fixed,dynamic1,dynamic2;
};
Set *set;
void options(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix deform tilt factors require triclinic box
+
+Cannot deform the tilt factors of a simulation box unless it
+is a triclinic (non-orthogonal) box.
+
+E: Cannot use fix deform on a non-periodic boundary
+
+When specifying a change is a box dimension, the dimension must be
+periodic.
+
+E: Cannot use fix deform on a 2nd non-periodic boundary
+
+When specifying a tilt factor change, the 2nd of the two dimensions
+must be periodic. E.g. if the xy tilt is specified, then the y
+dimension must be periodic.
+
+E: Use of fix deform with undefined lattice
+
+A lattice must be defined to use fix deform with units = lattice.
+
+E: Fix deform volume setting is invalid
+
+Cannot use volume style unless other dimensions are being controlled.
+
+E: More than one fix deform
+
+Only one fix deform can be defined at a time.
+
+E: Final box dimension due to fix deform is < 0.0
+
+Self-explanatory.
+
+E: Cannot use fix deform trate on a box with zero tilt
+
+The trate style alters the current strain.
+
+E: Fix deform is changing yz by too much with changing xy
+
+When both yz and xy are changing, it induces changes in xz if the
+box must flip from one tilt extreme to another. Thus it is not
+allowed for yz to grow so much that a flip is induced.
+
+*/
diff --git a/src/fix_deposit.h b/src/fix_deposit.h
index 2770e4d80..7107bb1f5 100644
--- a/src/fix_deposit.h
+++ b/src/fix_deposit.h
@@ -1,55 +1,97 @@
/* ----------------------------------------------------------------------
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(deposit,FixDeposit)
#else
#ifndef LMP_FIX_DEPOSIT_H
#define LMP_FIX_DEPOSIT_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
class FixDeposit : public Fix {
public:
FixDeposit(class LAMMPS *, int, char **);
~FixDeposit();
int setmask();
void init();
void pre_exchange();
void write_restart(FILE *);
void restart(char *);
private:
int ninsert,ntype,nfreq,seed;
int iregion,globalflag,localflag,maxattempt,rateflag,scaleflag,targetflag;
char *idregion;
double lo,hi,deltasq,nearsq,rate;
double vxlo,vxhi,vylo,vyhi,vzlo,vzhi;
double xlo,xhi,ylo,yhi,zlo,zhi;
double tx,ty,tz;
int nfirst,ninserted;
class RanPark *random;
void options(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Must specify a region in fix deposit
+
+The region keyword must be specified with this fix.
+
+E: Fix deposit region does not support a bounding box
+
+Not all regions represent bounded volumes. You cannot use
+such a region with the fix deposit command.
+
+E: Fix deposit region cannot be dynamic
+
+Only static regions can be used with fix deposit.
+
+E: Deposition region extends outside simulation box
+
+Self-explanatory.
+
+E: Use of fix deposit with undefined lattice
+
+Must use lattice command with compute fix deposit command if units
+option is set to lattice.
+
+E: Region ID for fix deposit does not exist
+
+Self-explanatory.
+
+W: Particle deposition was unsuccessful
+
+The fix deposit command was not able to insert as many atoms as
+needed. The requested volume fraction may be too high, or other atoms
+may be in the insertion region.
+
+*/
diff --git a/src/fix_drag.h b/src/fix_drag.h
index 0e0e07a06..49df06e9b 100644
--- a/src/fix_drag.h
+++ b/src/fix_drag.h
@@ -1,50 +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(drag,FixDrag)
#else
#ifndef LMP_FIX_DRAG_H
#define LMP_FIX_DRAG_H
#include "fix.h"
namespace LAMMPS_NS {
class FixDrag : public Fix {
public:
FixDrag(class LAMMPS *, int, char **);
int setmask();
void init();
void setup(int);
void post_force(int);
void post_force_respa(int, int, int);
double compute_vector(int);
private:
double xc,yc,zc;
double f_mag;
int xflag,yflag,zflag;
double delta;
int nlevels_respa;
double ftotal[3],ftotal_all[3];
int force_flag;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/fix_dt_reset.h b/src/fix_dt_reset.h
index 3a0146c91..5198afa82 100644
--- a/src/fix_dt_reset.h
+++ b/src/fix_dt_reset.h
@@ -1,51 +1,71 @@
/* ----------------------------------------------------------------------
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(dt/reset,FixDtReset)
#else
#ifndef LMP_FIX_DT_RESET_H
#define LMP_FIX_DT_RESET_H
#include "fix.h"
namespace LAMMPS_NS {
class FixDtReset : public Fix {
public:
FixDtReset(class LAMMPS *, int, char **);
~FixDtReset() {}
int setmask();
void init();
void setup(int);
void initial_integrate(int);
void end_of_step();
double compute_scalar();
double compute_vector(int);
private:
bigint laststep;
int minbound,maxbound;
double tmin,tmax,xmax;
double ftm2v;
double dt,t_elapsed,t_laststep;
int respaflag;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Use of fix dt/reset with undefined lattice
+
+Must use lattice command with fix dt/reset command if units option is
+set to lattice.
+
+W: Dump dcd/xtc timestamp may be wrong with fix dt/reset
+
+If the fix changes the timestep, the dump dcd file will not
+reflect the change.
+
+*/
diff --git a/src/fix_efield.h b/src/fix_efield.h
index 1edb84cfa..ba70cbae5 100644
--- a/src/fix_efield.h
+++ b/src/fix_efield.h
@@ -1,53 +1,75 @@
/* ----------------------------------------------------------------------
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(efield,FixEfield)
#else
#ifndef LMP_FIX_EFIELD_H
#define LMP_FIX_EFIELD_H
#include "fix.h"
namespace LAMMPS_NS {
class FixEfield : public Fix {
public:
FixEfield(class LAMMPS *, int, char **);
~FixEfield();
int setmask();
void init();
void setup(int);
void post_force(int);
void post_force_respa(int, int, int);
double memory_usage();
private:
double ex,ey,ez;
int varflag;
char *xstr,*ystr,*zstr;
int xvar,yvar,zvar,xstyle,ystyle,zstyle;
int nlevels_respa;
double qe2f;
int maxatom;
double **efield;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix efield requires atom attribute q
+
+Self-explanatory.
+
+E: Variable name for fix efield does not exist
+
+Self-explanatory.
+
+E: Variable for fix efield is invalid style
+
+Only equal-style variables can be used.
+
+*/
diff --git a/src/fix_enforce2d.h b/src/fix_enforce2d.h
index cbe9bb303..d1df796df 100644
--- a/src/fix_enforce2d.h
+++ b/src/fix_enforce2d.h
@@ -1,42 +1,56 @@
/* ----------------------------------------------------------------------
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(enforce2d,FixEnforce2D)
#else
#ifndef LMP_FIX_ENFORCE2D_H
#define LMP_FIX_ENFORCE2D_H
#include "fix.h"
namespace LAMMPS_NS {
class FixEnforce2D : public Fix {
public:
FixEnforce2D(class LAMMPS *, int, char **);
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);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot use fix enforce2d with 3d simulation
+
+Self-explanatory.
+
+*/
diff --git a/src/fix_evaporate.h b/src/fix_evaporate.h
index 63a6d122f..11d4b9bf1 100644
--- a/src/fix_evaporate.h
+++ b/src/fix_evaporate.h
@@ -1,52 +1,79 @@
/* ----------------------------------------------------------------------
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(evaporate,FixEvaporate)
#else
#ifndef LMP_FIX_EVAPORATE_H
#define LMP_FIX_EVAPORATE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixEvaporate : public Fix {
public:
FixEvaporate(class LAMMPS *, int, char **);
~FixEvaporate();
int setmask();
void init();
void pre_exchange();
double compute_scalar();
double memory_usage();
private:
int nevery,nflux,iregion;
int molflag;
int ndeleted;
char *idregion;
int nmax;
int *list,*mark;
class RanPark *random;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Region ID for fix evaporate does not exist
+
+Self-explanatory.
+
+E: Cannot evaporate atoms in atom_modify first group
+
+This is a restriction due to the way atoms are organized in
+a list to enable the atom_modify first command.
+
+W: Fix evaporate may delete atom with non-zero molecule ID
+
+UNDOCUMENTED
+
+E: Fix evaporate molecule requires atom attribute molecule
+
+The atom style being used does not define a molecule ID.
+
+*/
diff --git a/src/fix_external.h b/src/fix_external.h
index 231a2e56a..8cd798a72 100644
--- a/src/fix_external.h
+++ b/src/fix_external.h
@@ -1,51 +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(external,FixExternal)
#else
#ifndef LMP_FIX_EXTERNAL_H
#define LMP_FIX_EXTERNAL_H
#include "fix.h"
namespace LAMMPS_NS {
class FixExternal : public Fix {
public:
FixExternal(class LAMMPS *, int, char **);
~FixExternal();
int setmask();
void init();
void setup(int);
void min_setup(int);
void post_force(int);
void min_post_force(int);
typedef void (*FnPtr)(void *, int, int, int *, double **, double **);
void set_callback(FnPtr, void *);
private:
FnPtr callback;
void *ptr_caller;
int nmax;
double **fexternal;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix external callback function not set
+
+This must be done by an external program in order to use this fix.
+
+*/
diff --git a/src/fix_gravity.h b/src/fix_gravity.h
index c6a0a6e58..829a58e3c 100644
--- a/src/fix_gravity.h
+++ b/src/fix_gravity.h
@@ -1,56 +1,66 @@
/* ----------------------------------------------------------------------
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(gravity,FixGravity)
#else
#ifndef LMP_FIX_GRAVITY_H
#define LMP_FIX_GRAVITY_H
#include "fix.h"
namespace LAMMPS_NS {
class FixGravity : public Fix {
friend class FixPour;
friend class FixPourOMP;
public:
FixGravity(class LAMMPS *, int, char **);
int setmask();
void init();
void setup(int);
virtual void post_force(int);
virtual void post_force_respa(int, int, int);
double compute_scalar();
protected:
int style;
double magnitude,dt;
double phi,theta,phigrad,thetagrad;
double xdir,ydir,zdir;
double xgrav,ygrav,zgrav,xacc,yacc,zacc;
double degree2rad;
int nlevels_respa;
int time_origin;
int eflag;
double egrav,egrav_all;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/fix_heat.h b/src/fix_heat.h
index ecfcab76a..045c48649 100644
--- a/src/fix_heat.h
+++ b/src/fix_heat.h
@@ -1,47 +1,70 @@
/* ----------------------------------------------------------------------
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(heat,FixHeat)
#else
#ifndef LMP_FIX_HEAT_H
#define LMP_FIX_HEAT_H
#include "fix.h"
namespace LAMMPS_NS {
class FixHeat : public Fix {
public:
FixHeat(class LAMMPS *, int, char **);
~FixHeat();
int setmask();
void init();
void end_of_step();
double compute_scalar();
private:
int iregion;
double heat_input;
double masstotal;
double scale;
char *idregion;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Region ID for fix heat does not exist
+
+Self-explanatory.
+
+E: Fix heat group has no atoms
+
+Self-explanatory.
+
+E: Fix heat kinetic energy went negative
+
+This will cause the velocity rescaling about to be performed by fix
+heat to be invalid.
+
+*/
diff --git a/src/fix_indent.h b/src/fix_indent.h
index e94a9f4a1..af7efadd3 100644
--- a/src/fix_indent.h
+++ b/src/fix_indent.h
@@ -1,58 +1,85 @@
/* ----------------------------------------------------------------------
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(indent,FixIndent)
#else
#ifndef LMP_FIX_INDENT_H
#define LMP_FIX_INDENT_H
#include "fix.h"
namespace LAMMPS_NS {
class FixIndent : public Fix {
public:
FixIndent(class LAMMPS *, int, char **);
~FixIndent();
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 istyle,scaleflag,thermo_flag,eflag_enable,side;
double k,k3;
char *xstr,*ystr,*zstr,*rstr,*pstr;
int xvar,yvar,zvar,rvar,pvar;
double xvalue,yvalue,zvalue,rvalue,pvalue;
int indenter_flag,planeside;
double indenter[4],indenter_all[4];
int cdim,varflag;
int nlevels_respa;
void options(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Use of fix indent with undefined lattice
+
+The lattice command must be used to define a lattice before using the
+fix indent command.
+
+E: Variable name for fix indent does not exist
+
+Self-explanatory.
+
+E: Variable for fix indent is invalid style
+
+Only equal-style variables can be used.
+
+E: Variable for fix indent is not equal style
+
+Only equal-style variables can be used.
+
+*/
diff --git a/src/fix_langevin.h b/src/fix_langevin.h
index 80f4335b3..ab078512a 100644
--- a/src/fix_langevin.h
+++ b/src/fix_langevin.h
@@ -1,73 +1,137 @@
/* ----------------------------------------------------------------------
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(langevin,FixLangevin)
#else
#ifndef LMP_FIX_LANGEVIN_H
#define LMP_FIX_LANGEVIN_H
#include "fix.h"
namespace LAMMPS_NS {
class FixLangevin : public Fix {
public:
FixLangevin(class LAMMPS *, int, char **);
virtual ~FixLangevin();
int setmask();
void init();
void setup(int);
void post_force(int);
void post_force_respa(int, int, int);
virtual void end_of_step();
void reset_target(double);
void reset_dt();
int modify_param(int, char **);
virtual double compute_scalar();
double memory_usage();
protected:
int which,tally,zeroflag,oflag,aflag;
double t_start,t_stop,t_period;
double *gfactor1,*gfactor2,*ratio;
double energy,energy_onestep;
double tsqrt;
int tstyle,tvar;
char *tstr;
class AtomVecEllipsoid *avec;
int maxatom1,maxatom2;
double **flangevin;
double *tforce;
char *id_temp;
class Compute *temperature;
int nlevels_respa;
class RanMars *random;
virtual void post_force_no_tally();
virtual void post_force_tally();
void omega_thermostat();
void angmom_thermostat();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix langevin period must be > 0.0
+
+The time window for temperature relaxation must be > 0
+
+E: Fix langevin angmom requires atom style ellipsoid
+
+UNDOCUMENTED
+
+E: Fix langevin omega require atom style sphere
+
+UNDOCUMENTED
+
+E: Fix langevin angmom require atom style ellipsoid
+
+UNDOCUMENTED
+
+E: Variable name for fix langevin does not exist
+
+UNDOCUMENTED
+
+E: Variable for fix langevin is invalid style
+
+UNDOCUMENTED
+
+E: Fix langevin omega requires extended particles
+
+UNDOCUMENTED
+
+E: Fix langevin angmom requires extended particles
+
+UNDOCUMENTED
+
+E: Fix langevin variable returned negative temperature
+
+UNDOCUMENTED
+
+E: Cannot zero Langevin force of 0 atoms
+
+UNDOCUMENTED
+
+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: Group for fix_modify temp != fix group
+
+The fix_modify command is specifying a temperature computation that
+computes a temperature on a different group of atoms than the fix
+itself operates on. This is probably not what you want to do.
+
+*/
diff --git a/src/fix_lineforce.h b/src/fix_lineforce.h
index 5ad94a01a..ddcff2346 100644
--- a/src/fix_lineforce.h
+++ b/src/fix_lineforce.h
@@ -1,44 +1,54 @@
/* ----------------------------------------------------------------------
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(lineforce,FixLineForce)
#else
#ifndef LMP_FIX_LINEFORCE_H
#define LMP_FIX_LINEFORCE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixLineForce : public Fix {
public:
FixLineForce(class LAMMPS *, int, char **);
int setmask();
void setup(int);
void min_setup(int);
void post_force(int);
void post_force_respa(int, int, int);
void min_post_force(int);
private:
double xdir,ydir,zdir;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/fix_minimize.h b/src/fix_minimize.h
index 80f2854dd..8cb96ea25 100644
--- a/src/fix_minimize.h
+++ b/src/fix_minimize.h
@@ -1,59 +1,62 @@
/* ----------------------------------------------------------------------
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(MINIMIZE,FixMinimize)
#else
#ifndef LMP_FIX_MINIMIZE_H
#define LMP_FIX_MINIMIZE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixMinimize : public Fix {
friend class MinLineSearch;
public:
FixMinimize(class LAMMPS *, int, char **);
~FixMinimize();
int setmask();
void init() {}
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
void add_vector(int);
double *request_vector(int);
void store_box();
void reset_coords();
private:
int nvector;
int *peratom;
double **vectors;
double boxlo[3],boxhi[3];
void box_swap();
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/fix_momentum.h b/src/fix_momentum.h
index 0173349c9..a15d98b60 100644
--- a/src/fix_momentum.h
+++ b/src/fix_momentum.h
@@ -1,43 +1,57 @@
/* ----------------------------------------------------------------------
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(momentum,FixMomentum)
#else
#ifndef LMP_FIX_MOMENTUM_H
#define LMP_FIX_MOMENTUM_H
#include "fix.h"
namespace LAMMPS_NS {
class FixMomentum : public Fix {
public:
FixMomentum(class LAMMPS *, int, char **);
int setmask();
void init();
void end_of_step();
private:
int linear,angular;
int xflag,yflag,zflag;
double masstotal;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix momentum group has no atoms
+
+Self-explanatory.
+
+*/
diff --git a/src/fix_move.h b/src/fix_move.h
index 3df8a566d..632839340 100644
--- a/src/fix_move.h
+++ b/src/fix_move.h
@@ -1,76 +1,135 @@
/* ----------------------------------------------------------------------
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(move,FixMove)
#else
#ifndef LMP_FIX_MOVE_H
#define LMP_FIX_MOVE_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
class FixMove : public Fix {
public:
FixMove(class LAMMPS *, int, char **);
~FixMove();
int setmask();
void init();
void initial_integrate(int);
void final_integrate();
void initial_integrate_respa(int, int, int);
void final_integrate_respa(int, int);
double memory_usage();
void write_restart(FILE *);
void restart(char *);
void grow_arrays(int);
void copy_arrays(int, int);
void set_arrays(int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int maxsize_restart();
int size_restart(int);
void reset_dt();
private:
char *xvarstr,*yvarstr,*zvarstr,*vxvarstr,*vyvarstr,*vzvarstr;
int mstyle;
int vxflag,vyflag,vzflag,axflag,ayflag,azflag;
double vx,vy,vz,ax,ay,az;
double period,omega_rotate;
double point[3],axis[3],runit[3];
double dt,dtv,dtf;
int xvar,yvar,zvar,vxvar,vyvar,vzvar;
int xvarstyle,yvarstyle,zvarstyle,vxvarstyle,vyvarstyle,vzvarstyle;
int omega_flag,nlevels_respa;
int time_origin;
double **xoriginal; // original coords of atoms
int displaceflag,velocityflag;
int maxatom;
double **displace,**velocity;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix move cannot set linear z motion for 2d problem
+
+Self-explanatory.
+
+E: Fix move cannot set wiggle z motion for 2d problem
+
+Self-explanatory.
+
+E: Fix move cannot rotate aroung non z-axis for 2d problem
+
+Self-explanatory.
+
+E: Fix move cannot define z or vz variable for 2d problem
+
+Self-explanatory.
+
+W: Fix move does not update angular momentum
+
+Atoms store this quantity, but fix move does not (yet) update it.
+
+W: Fix move does not update quaternions
+
+Atoms store this quantity, but fix move does not (yet) update it.
+
+E: Use of fix move with undefined lattice
+
+Must use lattice command with fix move command if units option is
+set to lattice.
+
+E: Fix move cannot have 0 length rotation vector
+
+Self-explanatory.
+
+E: Variable name for fix move does not exist
+
+Self-explanatory.
+
+E: Variable for fix move is invalid style
+
+Only equal-style variables can be used.
+
+E: Cannot add atoms to fix move variable
+
+Atoms can not be added afterwards to this fix option.
+
+E: Resetting timestep is not allowed with fix move
+
+This is because fix move is moving atoms based on elapsed time.
+
+*/
diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp
index 2bf3df8a8..1aa2ad87f 100644
--- a/src/fix_nh.cpp
+++ b/src/fix_nh.cpp
@@ -1,2177 +1,2182 @@
/* ----------------------------------------------------------------------
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: Mark Stevens (SNL), Aidan Thompson (SNL)
------------------------------------------------------------------------- */
#include "string.h"
#include "stdlib.h"
#include "math.h"
#include "fix_nh.h"
#include "math_extra.h"
#include "atom.h"
#include "force.h"
#include "comm.h"
#include "irregular.h"
#include "modify.h"
#include "fix_deform.h"
#include "compute.h"
#include "kspace.h"
#include "update.h"
#include "respa.h"
#include "domain.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define DELTAFLIP 0.1
#define TILTMAX 1.5
enum{NOBIAS,BIAS};
enum{NONE,XYZ,XY,YZ,XZ};
enum{ISO,ANISO,TRICLINIC};
/* ----------------------------------------------------------------------
NVT,NPH,NPT integrators for improved Nose-Hoover equations of motion
---------------------------------------------------------------------- */
FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal fix nvt/npt/nph command");
restart_global = 1;
time_integrate = 1;
scalar_flag = 1;
vector_flag = 1;
global_freq = 1;
extscalar = 1;
extvector = 0;
// default values
pcouple = NONE;
drag = 0.0;
allremap = 1;
mtchain = mpchain = 3;
nc_tchain = nc_pchain = 1;
mtk_flag = 1;
deviatoric_flag = 0;
nreset_h0 = 0;
eta_mass_flag = 1;
omega_mass_flag = 0;
etap_mass_flag = 0;
// turn on tilt factor scaling, whenever applicable
dimension = domain->dimension;
scaleyz = scalexz = scalexy = 0;
if (domain->yperiodic && domain->xy != 0.0) scalexy = 1;
if (domain->zperiodic && dimension == 3) {
if (domain->yz != 0.0) scaleyz = 1;
if (domain->xz != 0.0) scalexz = 1;
}
// Used by FixNVTSllod to preserve non-default value
mtchain_default_flag = 1;
tstat_flag = 0;
double t_period = 0.0;
double p_period[6];
for (int i = 0; i < 6; i++) {
p_start[i] = p_stop[i] = p_period[i] = p_target[i] = 0.0;
p_flag[i] = 0;
}
// process keywords
int iarg = 3;
while (iarg < narg) {
if (strcmp(arg[iarg],"temp") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
tstat_flag = 1;
t_start = atof(arg[iarg+1]);
t_stop = atof(arg[iarg+2]);
t_period = atof(arg[iarg+3]);
if (t_start < 0.0 || t_stop <= 0.0)
error->all(FLERR,"Target temperature for fix nvt/npt/nph cannot be 0.0");
iarg += 4;
} else if (strcmp(arg[iarg],"iso") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
pcouple = XYZ;
p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
if (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 nvt/npt/nph command");
pcouple = NONE;
p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
if (dimension == 2) {
p_start[2] = p_stop[2] = p_period[2] = 0.0;
p_flag[2] = 0;
}
iarg += 4;
} else if (strcmp(arg[iarg],"tri") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
pcouple = NONE;
scalexy = scalexz = scaleyz = 0;
p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
p_start[3] = p_start[4] = p_start[5] = 0.0;
p_stop[3] = p_stop[4] = p_stop[5] = 0.0;
p_period[3] = p_period[4] = p_period[5] = atof(arg[iarg+3]);
p_flag[3] = p_flag[4] = p_flag[5] = 1;
if (dimension == 2) {
p_start[2] = p_stop[2] = p_period[2] = 0.0;
p_flag[2] = 0;
p_start[3] = p_stop[3] = p_period[3] = 0.0;
p_flag[3] = 0;
p_start[4] = p_stop[4] = p_period[4] = 0.0;
p_flag[4] = 0;
}
iarg += 4;
} else if (strcmp(arg[iarg],"x") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[0] = atof(arg[iarg+1]);
p_stop[0] = atof(arg[iarg+2]);
p_period[0] = atof(arg[iarg+3]);
p_flag[0] = 1;
deviatoric_flag = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"y") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[1] = atof(arg[iarg+1]);
p_stop[1] = atof(arg[iarg+2]);
p_period[1] = atof(arg[iarg+3]);
p_flag[1] = 1;
deviatoric_flag = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"z") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[2] = atof(arg[iarg+1]);
p_stop[2] = atof(arg[iarg+2]);
p_period[2] = atof(arg[iarg+3]);
p_flag[2] = 1;
deviatoric_flag = 1;
iarg += 4;
if (dimension == 2)
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
} else if (strcmp(arg[iarg],"yz") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
scaleyz = 0;
p_start[3] = atof(arg[iarg+1]);
p_stop[3] = atof(arg[iarg+2]);
p_period[3] = atof(arg[iarg+3]);
p_flag[3] = 1;
deviatoric_flag = 1;
iarg += 4;
if (dimension == 2)
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
} else if (strcmp(arg[iarg],"xz") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
scalexz = 0;
p_start[4] = atof(arg[iarg+1]);
p_stop[4] = atof(arg[iarg+2]);
p_period[4] = atof(arg[iarg+3]);
p_flag[4] = 1;
deviatoric_flag = 1;
iarg += 4;
if (dimension == 2)
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
} else if (strcmp(arg[iarg],"xy") == 0) {
scalexy = 0;
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[5] = atof(arg[iarg+1]);
p_stop[5] = atof(arg[iarg+2]);
p_period[5] = atof(arg[iarg+3]);
p_flag[5] = 1;
deviatoric_flag = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"couple") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph 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 nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"drag") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
drag = atof(arg[iarg+1]);
if (drag < 0.0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"dilate") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"all") == 0) allremap = 1;
else if (strcmp(arg[iarg+1],"partial") == 0) allremap = 0;
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"tchain") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
mtchain = atoi(arg[iarg+1]);
// used by FixNVTSllod to preserve non-default value
mtchain_default_flag = 0;
if (mtchain < 1) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"pchain") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
mpchain = atoi(arg[iarg+1]);
if (mpchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"mtk") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"yes") == 0) mtk_flag = 1;
else if (strcmp(arg[iarg+1],"no") == 0) mtk_flag = 0;
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"tloop") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
nc_tchain = atoi(arg[iarg+1]);
if (nc_tchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"ploop") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
nc_pchain = atoi(arg[iarg+1]);
if (nc_pchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"nreset") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
nreset_h0 = atoi(arg[iarg+1]);
if (nreset_h0 < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"scalexy") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"yes") == 0) scalexy = 1;
else if (strcmp(arg[iarg+1],"no") == 0) scalexy = 0;
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"scalexz") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"yes") == 0) scalexz = 1;
else if (strcmp(arg[iarg+1],"no") == 0) scalexz = 0;
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"scaleyz") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"yes") == 0) scaleyz = 1;
else if (strcmp(arg[iarg+1],"no") == 0) scaleyz = 0;
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else error->all(FLERR,"Illegal fix nvt/npt/nph command");
}
// error checks
if (dimension == 2 && (p_flag[2] || p_flag[3] || p_flag[4]))
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
if (dimension == 2 && (pcouple == YZ || pcouple == XZ))
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
if (dimension == 2 && (scalexz == 1 || scaleyz == 1 ))
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
if (pcouple == XYZ && (p_flag[0] == 0 || p_flag[1] == 0))
error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
if (pcouple == XYZ && dimension == 3 && p_flag[2] == 0)
error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
if (pcouple == XY && (p_flag[0] == 0 || p_flag[1] == 0))
error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
if (pcouple == YZ && (p_flag[1] == 0 || p_flag[2] == 0))
error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
if (pcouple == XZ && (p_flag[0] == 0 || p_flag[2] == 0))
error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
if (p_flag[0] && domain->xperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph on a non-periodic dimension");
if (p_flag[1] && domain->yperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph on a non-periodic dimension");
if (p_flag[2] && domain->zperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph on a non-periodic dimension");
if (p_flag[3] && domain->zperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
if (p_flag[4] && domain->zperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
if (p_flag[5] && domain->yperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
if (scaleyz == 1 && domain->zperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph "
"with yz dynamics when z is non-periodic dimension");
if (scalexz == 1 && domain->zperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph "
"with xz dynamics when z is non-periodic dimension");
if (scalexy == 1 && domain->yperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph "
"with xy dynamics when y is non-periodic dimension");
if (p_flag[3] && scaleyz == 1)
error->all(FLERR,"Cannot use fix nvt/npt/nph with"
"both yz dynamics and yz scaling");
if (p_flag[4] && scalexz == 1)
error->all(FLERR,"Cannot use fix nvt/npt/nph with "
"both xz dynamics and xz scaling");
if (p_flag[5] && scalexy == 1)
error->all(FLERR,"Cannot use fix nvt/npt/nph with "
"both xy dynamics and xy scaling");
if (!domain->triclinic && (p_flag[3] || p_flag[4] || p_flag[5]))
error->all(FLERR,"Can not specify Pxy/Pxz/Pyz in "
"fix nvt/npt/nph with non-triclinic box");
if (pcouple == XYZ && dimension == 3 &&
(p_start[0] != p_start[1] || p_start[0] != p_start[2] ||
p_stop[0] != p_stop[1] || p_stop[0] != p_stop[2] ||
p_period[0] != p_period[1] || p_period[0] != p_period[2]))
error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
if (pcouple == XYZ && dimension == 2 &&
(p_start[0] != p_start[1] || p_stop[0] != p_stop[1] ||
p_period[0] != p_period[1]))
error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
if (pcouple == XY &&
(p_start[0] != p_start[1] || p_stop[0] != p_stop[1] ||
p_period[0] != p_period[1]))
error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
if (pcouple == YZ &&
(p_start[1] != p_start[2] || p_stop[1] != p_stop[2] ||
p_period[1] != p_period[2]))
error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
if (pcouple == XZ &&
(p_start[0] != p_start[2] || p_stop[0] != p_stop[2] ||
p_period[0] != p_period[2]))
error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
if ((tstat_flag && t_period <= 0.0) ||
(p_flag[0] && p_period[0] <= 0.0) ||
(p_flag[1] && p_period[1] <= 0.0) ||
(p_flag[2] && p_period[2] <= 0.0) ||
(p_flag[3] && p_period[3] <= 0.0) ||
(p_flag[4] && p_period[4] <= 0.0) ||
(p_flag[5] && p_period[5] <= 0.0))
error->all(FLERR,"Fix nvt/npt/nph damping parameters must be > 0.0");
// set pstat_flag and box change and restart_pbc variables
pstat_flag = 0;
for (int i = 0; i < 6; i++)
if (p_flag[i]) pstat_flag = 1;
if (pstat_flag) {
box_change = 1;
if (p_flag[0] || p_flag[1] || p_flag[2]) box_change_size = 1;
if (p_flag[3] || p_flag[4] || p_flag[5]) box_change_shape = 1;
no_change_box = 1;
if (allremap == 0) restart_pbc = 1;
}
// pstyle = TRICLINIC if any off-diagonal term is controlled -> 6 dof
// else pstyle = ISO if XYZ coupling or XY coupling in 2d -> 1 dof
// else pstyle = ANISO -> 3 dof
if (p_flag[3] || p_flag[4] || p_flag[5]) pstyle = TRICLINIC;
else if (pcouple == XYZ || (dimension == 2 && pcouple == XY)) pstyle = ISO;
else pstyle = ANISO;
// reneighboring only forced if flips will occur due to shape changes
if (p_flag[3] || p_flag[4] || p_flag[5]) force_reneighbor = 1;
if (scaleyz || scalexz || scalexy) force_reneighbor = 1;
// convert input periods to frequencies
t_freq = 0.0;
p_freq[0] = p_freq[1] = p_freq[2] = p_freq[3] = p_freq[4] = p_freq[5] = 0.0;
if (tstat_flag) 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];
if (p_flag[3]) p_freq[3] = 1.0 / p_period[3];
if (p_flag[4]) p_freq[4] = 1.0 / p_period[4];
if (p_flag[5]) p_freq[5] = 1.0 / p_period[5];
// Nose/Hoover temp and pressure init
size_vector = 0;
if (tstat_flag) {
int ich;
eta = new double[mtchain];
// add one extra dummy thermostat, set to zero
eta_dot = new double[mtchain+1];
eta_dot[mtchain] = 0.0;
eta_dotdot = new double[mtchain];
for (ich = 0; ich < mtchain; ich++) {
eta[ich] = eta_dot[ich] = eta_dotdot[ich] = 0.0;
}
eta_mass = new double[mtchain];
size_vector += 2*2*mtchain;
}
if (pstat_flag) {
omega[0] = omega[1] = omega[2] = 0.0;
omega_dot[0] = omega_dot[1] = omega_dot[2] = 0.0;
omega_mass[0] = omega_mass[1] = omega_mass[2] = 0.0;
omega[3] = omega[4] = omega[5] = 0.0;
omega_dot[3] = omega_dot[4] = omega_dot[5] = 0.0;
omega_mass[3] = omega_mass[4] = omega_mass[5] = 0.0;
if (pstyle == ISO) size_vector += 2*2*1;
else if (pstyle == ANISO) size_vector += 2*2*3;
else if (pstyle == TRICLINIC) size_vector += 2*2*6;
if (mpchain) {
int ich;
etap = new double[mpchain];
// add one extra dummy thermostat, set to zero
etap_dot = new double[mpchain+1];
etap_dot[mpchain] = 0.0;
etap_dotdot = new double[mpchain];
for (ich = 0; ich < mpchain; ich++) {
etap[ich] = etap_dot[ich] =
etap_dotdot[ich] = 0.0;
}
etap_mass = new double[mpchain];
size_vector += 2*2*mpchain;
}
if (deviatoric_flag) size_vector += 1;
}
nrigid = 0;
rfix = NULL;
if (force_reneighbor) irregular = new Irregular(lmp);
else irregular = NULL;
// initialize vol0,t0 to zero to signal uninitialized
// values then assigned in init(), if necessary
vol0 = t0 = 0.0;
}
/* ---------------------------------------------------------------------- */
FixNH::~FixNH()
{
delete [] rfix;
delete irregular;
// delete temperature and pressure if fix created them
if (tflag) modify->delete_compute(id_temp);
delete [] id_temp;
if (tstat_flag) {
delete [] eta;
delete [] eta_dot;
delete [] eta_dotdot;
delete [] eta_mass;
}
if (pstat_flag) {
if (pflag) modify->delete_compute(id_press);
delete [] id_press;
if (mpchain) {
delete [] etap;
delete [] etap_dot;
delete [] etap_dotdot;
delete [] etap_mass;
}
}
}
/* ---------------------------------------------------------------------- */
int FixNH::setmask()
{
int mask = 0;
mask |= INITIAL_INTEGRATE;
mask |= FINAL_INTEGRATE;
mask |= THERMO_ENERGY;
mask |= INITIAL_INTEGRATE_RESPA;
mask |= FINAL_INTEGRATE_RESPA;
if (force_reneighbor) mask |= PRE_EXCHANGE;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixNH::init()
{
// ensure no conflict with fix deform
if (pstat_flag)
for (int i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
int *dimflag = ((FixDeform *) modify->fix[i])->dimflag;
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
(p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) ||
(p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
error->all(FLERR,"Cannot use fix npt and fix deform on "
"same component of stress tensor");
}
// set temperature and pressure ptrs
int icompute = modify->find_compute(id_temp);
if (icompute < 0)
error->all(FLERR,"Temperature ID for fix nvt/nph/npt does not exist");
temperature = modify->compute[icompute];
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
if (pstat_flag) {
icompute = modify->find_compute(id_press);
if (icompute < 0) error->all(FLERR,"Pressure ID for fix npt/nph does not exist");
pressure = modify->compute[icompute];
}
// set timesteps and frequencies
dtv = update->dt;
dtf = 0.5 * update->dt * force->ftm2v;
dthalf = 0.5 * update->dt;
dt4 = 0.25 * update->dt;
dt8 = 0.125 * update->dt;
dto = dthalf;
p_freq_max = 0.0;
if (pstat_flag) {
p_freq_max = MAX(p_freq[0],p_freq[1]);
p_freq_max = MAX(p_freq_max,p_freq[2]);
if (pstyle == TRICLINIC) {
p_freq_max = MAX(p_freq_max,p_freq[3]);
p_freq_max = MAX(p_freq_max,p_freq[4]);
p_freq_max = MAX(p_freq_max,p_freq[5]);
}
pdrag_factor = 1.0 - (update->dt * p_freq_max * drag / nc_pchain);
}
if (tstat_flag)
tdrag_factor = 1.0 - (update->dt * t_freq * drag / nc_tchain);
// tally the number of dimensions that are barostatted
// set initial volume and reference cell, if not already done
if (pstat_flag) {
pdim = p_flag[0] + p_flag[1] + p_flag[2];
if (vol0 == 0.0) {
if (dimension == 3) vol0 = domain->xprd * domain->yprd * domain->zprd;
else vol0 = domain->xprd * domain->yprd;
h0_inv[0] = domain->h_inv[0];
h0_inv[1] = domain->h_inv[1];
h0_inv[2] = domain->h_inv[2];
h0_inv[3] = domain->h_inv[3];
h0_inv[4] = domain->h_inv[4];
h0_inv[5] = domain->h_inv[5];
}
}
boltz = force->boltz;
nktv2p = force->nktv2p;
if (force->kspace) kspace_flag = 1;
else kspace_flag = 0;
if (strstr(update->integrate_style,"respa")) {
nlevels_respa = ((Respa *) update->integrate)->nlevels;
step_respa = ((Respa *) update->integrate)->step;
dto = 0.5*step_respa[0];
}
// detect if any rigid fixes exist so rigid bodies move when box is remapped
// rfix[] = indices to each fix rigid
delete [] rfix;
nrigid = 0;
rfix = NULL;
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->rigid_flag) nrigid++;
if (nrigid) {
rfix = new int[nrigid];
nrigid = 0;
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->rigid_flag) rfix[nrigid++] = i;
}
}
/* ----------------------------------------------------------------------
compute T,P before integrator starts
------------------------------------------------------------------------- */
void FixNH::setup(int vflag)
{
// initialize some quantities that were not available earlier
tdof = temperature->dof;
// t_target is needed by NPH and NPT in compute_scalar()
// If no thermostat or using fix nphug,
// t_target must be defined by other means.
if (tstat_flag && strcmp(style,"nphug") != 0) {
compute_temp_target();
} else if (pstat_flag) {
// t0 = reference temperature for masses
// cannot be done in init() b/c temperature cannot be called there
// is b/c Modify::init() inits computes after fixes due to dof dependence
// guesstimate a unit-dependent t0 if actual T = 0.0
// if it was read in from a restart file, leave it be
if (t0 == 0.0) {
t0 = temperature->compute_scalar();
if (t0 == 0.0) {
if (strcmp(update->unit_style,"lj") == 0) t0 = 1.0;
else t0 = 300.0;
}
}
t_target = t0;
}
if (pstat_flag) compute_press_target();
t_current = temperature->compute_scalar();
if (pstat_flag) {
if (pstyle == ISO) pressure->compute_scalar();
else pressure->compute_vector();
couple();
pressure->addstep(update->ntimestep+1);
}
// masses and initial forces on thermostat variables
if (tstat_flag) {
eta_mass[0] = tdof * boltz * t_target / (t_freq*t_freq);
for (int ich = 1; ich < mtchain; ich++)
eta_mass[ich] = boltz * t_target / (t_freq*t_freq);
for (int ich = 1; ich < mtchain; ich++) {
eta_dotdot[ich] = (eta_mass[ich-1]*eta_dot[ich-1]*eta_dot[ich-1] -
boltz * t_target) / eta_mass[ich];
}
}
// masses and initial forces on barostat variables
if (pstat_flag) {
double kt = boltz * t_target;
double nkt = atom->natoms * kt;
for (int i = 0; i < 3; i++)
if (p_flag[i])
omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
if (pstyle == TRICLINIC) {
for (int i = 3; i < 6; i++)
if (p_flag[i]) omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
}
// masses and initial forces on barostat thermostat variables
if (mpchain) {
etap_mass[0] = boltz * t_target / (p_freq_max*p_freq_max);
for (int ich = 1; ich < mpchain; ich++)
etap_mass[ich] = boltz * t_target / (p_freq_max*p_freq_max);
for (int ich = 1; ich < mpchain; ich++)
etap_dotdot[ich] =
(etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] -
boltz * t_target) / etap_mass[ich];
}
}
}
/* ----------------------------------------------------------------------
1st half of Verlet update
------------------------------------------------------------------------- */
void FixNH::initial_integrate(int vflag)
{
// update eta_press_dot
if (pstat_flag && mpchain) nhc_press_integrate();
// update eta_dot
if (tstat_flag) {
compute_temp_target();
nhc_temp_integrate();
}
// need to recompute pressure to account for change in KE
// t_current is up-to-date, but compute_temperature is not
// compute appropriately coupled elements of mvv_current
if (pstat_flag) {
if (pstyle == ISO) {
temperature->compute_scalar();
pressure->compute_scalar();
} else {
temperature->compute_vector();
pressure->compute_vector();
}
couple();
pressure->addstep(update->ntimestep+1);
}
if (pstat_flag) {
compute_press_target();
nh_omega_dot();
nh_v_press();
}
nve_v();
// remap simulation box by 1/2 step
if (pstat_flag) remap();
nve_x();
// remap simulation box by 1/2 step
// redo KSpace coeffs since volume has changed
if (pstat_flag) {
remap();
if (kspace_flag) force->kspace->setup();
}
}
/* ----------------------------------------------------------------------
2nd half of Verlet update
------------------------------------------------------------------------- */
void FixNH::final_integrate()
{
nve_v();
if (pstat_flag) nh_v_press();
// compute new T,P
// compute appropriately coupled elements of mvv_current
t_current = temperature->compute_scalar();
if (pstat_flag) {
if (pstyle == ISO) pressure->compute_scalar();
else pressure->compute_vector();
couple();
pressure->addstep(update->ntimestep+1);
}
if (pstat_flag) nh_omega_dot();
// update eta_dot
// update eta_press_dot
if (tstat_flag) nhc_temp_integrate();
if (pstat_flag && mpchain) nhc_press_integrate();
}
/* ---------------------------------------------------------------------- */
void FixNH::initial_integrate_respa(int vflag, int ilevel, int iloop)
{
// set timesteps by level
dtv = step_respa[ilevel];
dtf = 0.5 * step_respa[ilevel] * force->ftm2v;
dthalf = 0.5 * step_respa[ilevel];
// outermost level - update eta_dot and omega_dot, apply to v
// all other levels - NVE update of v
// x,v updates only performed for atoms in group
if (ilevel == nlevels_respa-1) {
// update eta_press_dot
if (pstat_flag && mpchain) nhc_press_integrate();
// update eta_dot
if (tstat_flag) {
compute_temp_target();
nhc_temp_integrate();
}
// recompute pressure to account for change in KE
// t_current is up-to-date, but compute_temperature is not
// compute appropriately coupled elements of mvv_current
if (pstat_flag) {
if (pstyle == ISO) {
temperature->compute_scalar();
pressure->compute_scalar();
} else {
temperature->compute_vector();
pressure->compute_vector();
}
couple();
pressure->addstep(update->ntimestep+1);
}
if (pstat_flag) {
compute_press_target();
nh_omega_dot();
nh_v_press();
}
nve_v();
} else nve_v();
// innermost level - also update x only for atoms in group
// if barostat, perform 1/2 step remap before and after
if (ilevel == 0) {
if (pstat_flag) remap();
nve_x();
if (pstat_flag) remap();
}
// if barostat, redo KSpace coeffs at outermost level,
// since volume has changed
if (ilevel == nlevels_respa-1 && kspace_flag && pstat_flag)
force->kspace->setup();
}
/* ---------------------------------------------------------------------- */
void FixNH::final_integrate_respa(int ilevel, int iloop)
{
// set timesteps by level
dtf = 0.5 * step_respa[ilevel] * force->ftm2v;
dthalf = 0.5 * step_respa[ilevel];
// outermost level - update eta_dot and omega_dot, apply via final_integrate
// all other levels - NVE update of v
if (ilevel == nlevels_respa-1) final_integrate();
else nve_v();
}
/* ---------------------------------------------------------------------- */
void FixNH::couple()
{
double *tensor = pressure->vector;
if (pstyle == ISO)
p_current[0] = p_current[1] = p_current[2] = pressure->scalar;
else if (pcouple == XYZ) {
double ave = 1.0/3.0 * (tensor[0] + tensor[1] + tensor[2]);
p_current[0] = p_current[1] = p_current[2] = ave;
} else if (pcouple == XY) {
double ave = 0.5 * (tensor[0] + tensor[1]);
p_current[0] = p_current[1] = ave;
p_current[2] = tensor[2];
} else if (pcouple == YZ) {
double ave = 0.5 * (tensor[1] + tensor[2]);
p_current[1] = p_current[2] = ave;
p_current[0] = tensor[0];
} else if (pcouple == XZ) {
double ave = 0.5 * (tensor[0] + tensor[2]);
p_current[0] = p_current[2] = ave;
p_current[1] = tensor[1];
} else {
p_current[0] = tensor[0];
p_current[1] = tensor[1];
p_current[2] = tensor[2];
}
// switch order from xy-xz-yz to Voigt
if (pstyle == TRICLINIC) {
p_current[3] = tensor[5];
p_current[4] = tensor[4];
p_current[5] = tensor[3];
}
}
/* ----------------------------------------------------------------------
change box size
remap all atoms or fix group atoms depending on allremap flag
if rigid bodies exist, scale rigid body centers-of-mass
------------------------------------------------------------------------- */
void FixNH::remap()
{
int i;
double oldlo,oldhi,ctr;
double expfac;
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double *h = domain->h;
// omega is not used, except for book-keeping
for (int i = 0; i < 6; i++) omega[i] += dto*omega_dot[i];
// convert pertinent atoms and rigid bodies to lamda coords
if (allremap) domain->x2lamda(nlocal);
else {
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
domain->x2lamda(x[i],x[i]);
}
if (nrigid)
for (i = 0; i < nrigid; i++)
modify->fix[rfix[i]]->deform(0);
// reset global and local box to new size/shape
// this operation corresponds to applying the
// translate and scale operations
// corresponding to the solution of the following ODE:
//
// h_dot = omega_dot * h
//
// where h_dot, omega_dot and h are all upper-triangular
// 3x3 tensors. In Voigt notation, the elements of the
// RHS product tensor are:
// h_dot = [0*0, 1*1, 2*2, 1*3+3*2, 0*4+5*3+4*2, 0*5+5*1]
//
// Ordering of operations preserves time symmetry.
double dto2 = dto/2.0;
double dto4 = dto/4.0;
double dto8 = dto/8.0;
// off-diagonal components, first half
if (pstyle == TRICLINIC) {
if (p_flag[4]) {
expfac = exp(dto8*omega_dot[0]);
h[4] *= expfac;
h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
h[4] *= expfac;
}
if (p_flag[3]) {
expfac = exp(dto4*omega_dot[1]);
h[3] *= expfac;
h[3] += dto2*(omega_dot[3]*h[2]);
h[3] *= expfac;
}
if (p_flag[5]) {
expfac = exp(dto4*omega_dot[0]);
h[5] *= expfac;
h[5] += dto2*(omega_dot[5]*h[1]);
h[5] *= expfac;
}
if (p_flag[4]) {
expfac = exp(dto8*omega_dot[0]);
h[4] *= expfac;
h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
h[4] *= expfac;
}
}
// scale diagonal components
// scale tilt factors with cell, if set
if (p_flag[0]) {
oldlo = domain->boxlo[0];
oldhi = domain->boxhi[0];
ctr = 0.5 * (oldlo + oldhi);
expfac = exp(dto*omega_dot[0]);
domain->boxlo[0] = (oldlo-ctr)*expfac + ctr;
domain->boxhi[0] = (oldhi-ctr)*expfac + ctr;
}
if (p_flag[1]) {
oldlo = domain->boxlo[1];
oldhi = domain->boxhi[1];
ctr = 0.5 * (oldlo + oldhi);
expfac = exp(dto*omega_dot[1]);
domain->boxlo[1] = (oldlo-ctr)*expfac + ctr;
domain->boxhi[1] = (oldhi-ctr)*expfac + ctr;
if (scalexy) h[5] *= expfac;
}
if (p_flag[2]) {
oldlo = domain->boxlo[2];
oldhi = domain->boxhi[2];
ctr = 0.5 * (oldlo + oldhi);
expfac = exp(dto*omega_dot[2]);
domain->boxlo[2] = (oldlo-ctr)*expfac + ctr;
domain->boxhi[2] = (oldhi-ctr)*expfac + ctr;
if (scalexz) h[4] *= expfac;
if (scaleyz) h[3] *= expfac;
}
// off-diagonal components, second half
if (pstyle == TRICLINIC) {
if (p_flag[4]) {
expfac = exp(dto8*omega_dot[0]);
h[4] *= expfac;
h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
h[4] *= expfac;
}
if (p_flag[3]) {
expfac = exp(dto4*omega_dot[1]);
h[3] *= expfac;
h[3] += dto2*(omega_dot[3]*h[2]);
h[3] *= expfac;
}
if (p_flag[5]) {
expfac = exp(dto4*omega_dot[0]);
h[5] *= expfac;
h[5] += dto2*(omega_dot[5]*h[1]);
h[5] *= expfac;
}
if (p_flag[4]) {
expfac = exp(dto8*omega_dot[0]);
h[4] *= expfac;
h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
h[4] *= expfac;
}
}
domain->yz = h[3];
domain->xz = h[4];
domain->xy = h[5];
// tilt factor to cell length ratio can not exceed TILTMAX
// in one step
if (domain->yz < -TILTMAX*domain->yprd || domain->yz > TILTMAX*domain->yprd ||
domain->xz < -TILTMAX*domain->xprd || domain->xz > TILTMAX*domain->xprd ||
domain->xy < -TILTMAX*domain->xprd || domain->xy > TILTMAX*domain->xprd)
error->all(FLERR,"Fix npt/nph has tilted box too far in one step - "
"periodic cell is too far from equilibrium state");
domain->set_global_box();
domain->set_local_box();
// convert pertinent atoms and rigid bodies back to box coords
if (allremap) domain->lamda2x(nlocal);
else {
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
domain->lamda2x(x[i],x[i]);
}
if (nrigid)
for (i = 0; i < nrigid; i++)
modify->fix[rfix[i]]->deform(1);
}
/* ----------------------------------------------------------------------
pack entire state of Fix into one write
------------------------------------------------------------------------- */
void FixNH::write_restart(FILE *fp)
{
int nsize = size_restart_global();
double *list;
memory->create(list,nsize,"nh:list");
int n = pack_restart_data(list);
if (comm->me == 0) {
int size = nsize * sizeof(double);
fwrite(&size,sizeof(int),1,fp);
fwrite(list,sizeof(double),nsize,fp);
}
memory->destroy(list);
}
/* ----------------------------------------------------------------------
calculate the number of data to be packed
------------------------------------------------------------------------- */
int FixNH::size_restart_global()
{
int nsize = 2;
if (tstat_flag) nsize += 1 + 2*mtchain;
if (pstat_flag) {
nsize += 16 + 2*mpchain;
if (deviatoric_flag) nsize += 6;
}
return nsize;
}
/* ----------------------------------------------------------------------
pack restart data
------------------------------------------------------------------------- */
int FixNH::pack_restart_data(double *list)
{
int n = 0;
list[n++] = tstat_flag;
if (tstat_flag) {
list[n++] = mtchain;
for (int ich = 0; ich < mtchain; ich++)
list[n++] = eta[ich];
for (int ich = 0; ich < mtchain; ich++)
list[n++] = eta_dot[ich];
}
list[n++] = pstat_flag;
if (pstat_flag) {
list[n++] = omega[0];
list[n++] = omega[1];
list[n++] = omega[2];
list[n++] = omega[3];
list[n++] = omega[4];
list[n++] = omega[5];
list[n++] = omega_dot[0];
list[n++] = omega_dot[1];
list[n++] = omega_dot[2];
list[n++] = omega_dot[3];
list[n++] = omega_dot[4];
list[n++] = omega_dot[5];
list[n++] = vol0;
list[n++] = t0;
list[n++] = mpchain;
if (mpchain) {
for (int ich = 0; ich < mpchain; ich++)
list[n++] = etap[ich];
for (int ich = 0; ich < mpchain; ich++)
list[n++] = etap_dot[ich];
}
list[n++] = deviatoric_flag;
if (deviatoric_flag) {
list[n++] = h0_inv[0];
list[n++] = h0_inv[1];
list[n++] = h0_inv[2];
list[n++] = h0_inv[3];
list[n++] = h0_inv[4];
list[n++] = h0_inv[5];
}
}
return n;
}
/* ----------------------------------------------------------------------
use state info from restart file to restart the Fix
------------------------------------------------------------------------- */
void FixNH::restart(char *buf)
{
int n = 0;
double *list = (double *) buf;
int flag = static_cast<int> (list[n++]);
if (flag) {
int m = static_cast<int> (list[n++]);
if (tstat_flag && m == mtchain) {
for (int ich = 0; ich < mtchain; ich++)
eta[ich] = list[n++];
for (int ich = 0; ich < mtchain; ich++)
eta_dot[ich] = list[n++];
} else n += 2*m;
}
flag = static_cast<int> (list[n++]);
if (flag) {
omega[0] = list[n++];
omega[1] = list[n++];
omega[2] = list[n++];
omega[3] = list[n++];
omega[4] = list[n++];
omega[5] = list[n++];
omega_dot[0] = list[n++];
omega_dot[1] = list[n++];
omega_dot[2] = list[n++];
omega_dot[3] = list[n++];
omega_dot[4] = list[n++];
omega_dot[5] = list[n++];
vol0 = list[n++];
t0 = list[n++];
int m = static_cast<int> (list[n++]);
if (pstat_flag && m == mpchain) {
for (int ich = 0; ich < mpchain; ich++)
etap[ich] = list[n++];
for (int ich = 0; ich < mpchain; ich++)
etap_dot[ich] = list[n++];
} else n+=2*m;
flag = static_cast<int> (list[n++]);
if (flag) {
h0_inv[0] = list[n++];
h0_inv[1] = list[n++];
h0_inv[2] = list[n++];
h0_inv[3] = list[n++];
h0_inv[4] = list[n++];
h0_inv[5] = list[n++];
}
}
}
/* ---------------------------------------------------------------------- */
int FixNH::modify_param(int narg, char **arg)
{
if (strcmp(arg[0],"temp") == 0) {
if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
if (tflag) {
modify->delete_compute(id_temp);
tflag = 0;
}
delete [] id_temp;
int n = strlen(arg[1]) + 1;
id_temp = new char[n];
strcpy(id_temp,arg[1]);
int icompute = modify->find_compute(arg[1]);
if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
temperature = modify->compute[icompute];
if (temperature->tempflag == 0)
error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
if (temperature->igroup != 0 && comm->me == 0)
error->warning(FLERR,"Temperature for fix modify is not for group all");
// reset id_temp of pressure to new temperature ID
if (pstat_flag) {
icompute = modify->find_compute(id_press);
if (icompute < 0)
error->all(FLERR,"Pressure ID for fix modify does not exist");
modify->compute[icompute]->reset_extra_compute_fix(id_temp);
}
return 2;
} else if (strcmp(arg[0],"press") == 0) {
if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
if (!pstat_flag) error->all(FLERR,"Illegal fix_modify command");
if (pflag) {
modify->delete_compute(id_press);
pflag = 0;
}
delete [] id_press;
int n = strlen(arg[1]) + 1;
id_press = new char[n];
strcpy(id_press,arg[1]);
int icompute = modify->find_compute(arg[1]);
if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
pressure = modify->compute[icompute];
if (pressure->pressflag == 0)
error->all(FLERR,"Fix_modify pressure ID does not compute pressure");
return 2;
}
return 0;
}
/* ---------------------------------------------------------------------- */
double FixNH::compute_scalar()
{
int i;
double volume;
double energy;
double kt = boltz * t_target;
double lkt_press = kt;
int ich;
if (dimension == 3) volume = domain->xprd * domain->yprd * domain->zprd;
else volume = domain->xprd * domain->yprd;
energy = 0.0;
// thermostat chain energy is equivalent to Eq. (2) in
// Martyna, Tuckerman, Tobias, Klein, Mol Phys, 87, 1117
// Sum(0.5*p_eta_k^2/Q_k,k=1,M) + L*k*T*eta_1 + Sum(k*T*eta_k,k=2,M),
// where L = tdof
// M = mtchain
// p_eta_k = Q_k*eta_dot[k-1]
// Q_1 = L*k*T/t_freq^2
// Q_k = k*T/t_freq^2, k > 1
if (tstat_flag) {
energy += ke_target * eta[0] + 0.5*eta_mass[0]*eta_dot[0]*eta_dot[0];
for (ich = 1; ich < mtchain; ich++)
energy += kt * eta[ich] + 0.5*eta_mass[ich]*eta_dot[ich]*eta_dot[ich];
}
// barostat energy is equivalent to Eq. (8) in
// Martyna, Tuckerman, Tobias, Klein, Mol Phys, 87, 1117
// Sum(0.5*p_omega^2/W + P*V),
// where N = natoms
// p_omega = W*omega_dot
// W = N*k*T/p_freq^2
// sum is over barostatted dimensions
if (pstat_flag) {
for (i = 0; i < 3; i++)
if (p_flag[i])
energy += 0.5*omega_dot[i]*omega_dot[i]*omega_mass[i] +
p_hydro*(volume-vol0) / (pdim*nktv2p);
if (pstyle == TRICLINIC) {
for (i = 3; i < 6; i++)
if (p_flag[i])
energy += 0.5*omega_dot[i]*omega_dot[i]*omega_mass[i];
}
// extra contributions from thermostat chain for barostat
if (mpchain) {
energy += lkt_press * etap[0] + 0.5*etap_mass[0]*etap_dot[0]*etap_dot[0];
for (ich = 1; ich < mpchain; ich++)
energy += kt * etap[ich] +
0.5*etap_mass[ich]*etap_dot[ich]*etap_dot[ich];
}
// extra contribution from strain energy
if (deviatoric_flag) energy += compute_strain_energy();
}
return energy;
}
/* ----------------------------------------------------------------------
return a single element of the following vectors, in this order:
eta[tchain], eta_dot[tchain], omega[ndof], omega_dot[ndof]
etap[pchain], etap_dot[pchain], PE_eta[tchain], KE_eta_dot[tchain]
PE_omega[ndof], KE_omega_dot[ndof], PE_etap[pchain], KE_etap_dot[pchain]
PE_strain[1]
if no thermostat exists, related quantities are omitted from the list
if no barostat exists, related quantities are omitted from the list
ndof = 1,3,6 degrees of freedom for pstyle = ISO,ANISO,TRI
------------------------------------------------------------------------- */
double FixNH::compute_vector(int n)
{
int ilen;
if (tstat_flag) {
ilen = mtchain;
if (n < ilen) return eta[n];
n -= ilen;
ilen = mtchain;
if (n < ilen) return eta_dot[n];
n -= ilen;
}
if (pstat_flag) {
if (pstyle == ISO) {
ilen = 1;
if (n < ilen) return omega[n];
n -= ilen;
} else if (pstyle == ANISO) {
ilen = 3;
if (n < ilen) return omega[n];
n -= ilen;
} else {
ilen = 6;
if (n < ilen) return omega[n];
n -= ilen;
}
if (pstyle == ISO) {
ilen = 1;
if (n < ilen) return omega_dot[n];
n -= ilen;
} else if (pstyle == ANISO) {
ilen = 3;
if (n < ilen) return omega_dot[n];
n -= ilen;
} else {
ilen = 6;
if (n < ilen) return omega_dot[n];
n -= ilen;
}
if (mpchain) {
ilen = mpchain;
if (n < ilen) return etap[n];
n -= ilen;
ilen = mpchain;
if (n < ilen) return etap_dot[n];
n -= ilen;
}
}
double volume;
double kt = boltz * t_target;
double lkt_press = kt;
int ich;
if (dimension == 3) volume = domain->xprd * domain->yprd * domain->zprd;
else volume = domain->xprd * domain->yprd;
if (tstat_flag) {
ilen = mtchain;
if (n < ilen) {
ich = n;
if (ich == 0)
return ke_target * eta[0];
else
return kt * eta[ich];
}
n -= ilen;
ilen = mtchain;
if (n < ilen) {
ich = n;
if (ich == 0)
return 0.5*eta_mass[0]*eta_dot[0]*eta_dot[0];
else
return 0.5*eta_mass[ich]*eta_dot[ich]*eta_dot[ich];
}
n -= ilen;
}
if (pstat_flag) {
if (pstyle == ISO) {
ilen = 1;
if (n < ilen)
return p_hydro*(volume-vol0) / nktv2p;
n -= ilen;
} else if (pstyle == ANISO) {
ilen = 3;
if (n < ilen)
if (p_flag[n])
return p_hydro*(volume-vol0) / (pdim*nktv2p);
else
return 0.0;
n -= ilen;
} else {
ilen = 6;
if (n < ilen)
if (n > 2) return 0.0;
else if (p_flag[n])
return p_hydro*(volume-vol0) / (pdim*nktv2p);
else
return 0.0;
n -= ilen;
}
if (pstyle == ISO) {
ilen = 1;
if (n < ilen)
return pdim*0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
n -= ilen;
} else if (pstyle == ANISO) {
ilen = 3;
if (n < ilen)
if (p_flag[n])
return 0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
else return 0.0;
n -= ilen;
} else {
ilen = 6;
if (n < ilen)
if (p_flag[n])
return 0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
else return 0.0;
n -= ilen;
}
if (mpchain) {
ilen = mpchain;
if (n < ilen) {
ich = n;
if (ich == 0) return lkt_press * etap[0];
else return kt * etap[ich];
}
n -= ilen;
ilen = mpchain;
if (n < ilen) {
ich = n;
if (ich == 0)
return 0.5*etap_mass[0]*etap_dot[0]*etap_dot[0];
else
return 0.5*etap_mass[ich]*etap_dot[ich]*etap_dot[ich];
}
n -= ilen;
}
if (deviatoric_flag) {
ilen = 1;
if (n < ilen)
return compute_strain_energy();
n -= ilen;
}
}
return 0.0;
}
/* ---------------------------------------------------------------------- */
void FixNH::reset_target(double t_new)
{
t_start = t_stop = t_new;
}
/* ---------------------------------------------------------------------- */
void FixNH::reset_dt()
{
dtv = update->dt;
dtf = 0.5 * update->dt * force->ftm2v;
dthalf = 0.5 * update->dt;
dt4 = 0.25 * update->dt;
dt8 = 0.125 * update->dt;
dto = dthalf;
// If using respa, then remap is performed in innermost level
if (strstr(update->integrate_style,"respa"))
dto = 0.5*step_respa[0];
if (pstat_flag)
pdrag_factor = 1.0 - (update->dt * p_freq_max * drag / nc_pchain);
if (tstat_flag)
tdrag_factor = 1.0 - (update->dt * t_freq * drag / nc_tchain);
}
/* ----------------------------------------------------------------------
perform half-step update of chain thermostat variables
------------------------------------------------------------------------- */
void FixNH::nhc_temp_integrate()
{
int ich;
double expfac;
double kecurrent = tdof * boltz * t_current;
// Update masses, to preserve initial freq, if flag set
if (eta_mass_flag) {
eta_mass[0] = tdof * boltz * t_target / (t_freq*t_freq);
for (int ich = 1; ich < mtchain; ich++)
eta_mass[ich] = boltz * t_target / (t_freq*t_freq);
}
- eta_dotdot[0] = (kecurrent - ke_target)/eta_mass[0];
+ if (eta_mass[0] > 0.0)
+ eta_dotdot[0] = (kecurrent - ke_target)/eta_mass[0];
+ else eta_dotdot[0] = 0.0;
double ncfac = 1.0/nc_tchain;
for (int iloop = 0; iloop < nc_tchain; iloop++) {
for (ich = mtchain-1; ich > 0; ich--) {
expfac = exp(-ncfac*dt8*eta_dot[ich+1]);
eta_dot[ich] *= expfac;
eta_dot[ich] += eta_dotdot[ich] * ncfac*dt4;
eta_dot[ich] *= tdrag_factor;
eta_dot[ich] *= expfac;
}
expfac = exp(-ncfac*dt8*eta_dot[1]);
eta_dot[0] *= expfac;
eta_dot[0] += eta_dotdot[0] * ncfac*dt4;
eta_dot[0] *= tdrag_factor;
eta_dot[0] *= expfac;
factor_eta = exp(-ncfac*dthalf*eta_dot[0]);
nh_v_temp();
// rescale temperature due to velocity scaling
// should not be necessary to explicitly recompute the temperature
t_current *= factor_eta*factor_eta;
kecurrent = tdof * boltz * t_current;
- eta_dotdot[0] = (kecurrent - ke_target)/eta_mass[0];
-
+
+ if (eta_mass[0] > 0.0)
+ eta_dotdot[0] = (kecurrent - ke_target)/eta_mass[0];
+ else eta_dotdot[0] = 0.0;
+
for (ich = 0; ich < mtchain; ich++)
eta[ich] += ncfac*dthalf*eta_dot[ich];
eta_dot[0] *= expfac;
eta_dot[0] += eta_dotdot[0] * ncfac*dt4;
eta_dot[0] *= expfac;
for (ich = 1; ich < mtchain; ich++) {
expfac = exp(-ncfac*dt8*eta_dot[ich+1]);
eta_dot[ich] *= expfac;
eta_dotdot[ich] = (eta_mass[ich-1]*eta_dot[ich-1]*eta_dot[ich-1]
- boltz * t_target)/eta_mass[ich];
eta_dot[ich] += eta_dotdot[ich] * ncfac*dt4;
eta_dot[ich] *= expfac;
}
}
}
/* ----------------------------------------------------------------------
perform half-step update of chain thermostat variables for barostat
scale barostat velocities
------------------------------------------------------------------------- */
void FixNH::nhc_press_integrate()
{
int ich,i;
double expfac,factor_etap,kecurrent;
double kt = boltz * t_target;
double lkt_press = kt;
// Update masses, to preserve initial freq, if flag set
if (omega_mass_flag) {
double nkt = atom->natoms * kt;
for (int i = 0; i < 3; i++)
if (p_flag[i])
omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
if (pstyle == TRICLINIC) {
for (int i = 3; i < 6; i++)
if (p_flag[i]) omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
}
}
if (etap_mass_flag) {
if (mpchain) {
etap_mass[0] = boltz * t_target / (p_freq_max*p_freq_max);
for (int ich = 1; ich < mpchain; ich++)
etap_mass[ich] = boltz * t_target / (p_freq_max*p_freq_max);
for (int ich = 1; ich < mpchain; ich++)
etap_dotdot[ich] =
(etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] -
boltz * t_target) / etap_mass[ich];
}
}
kecurrent = 0.0;
for (i = 0; i < 3; i++)
if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
if (pstyle == TRICLINIC) {
for (i = 3; i < 6; i++)
if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
}
etap_dotdot[0] = (kecurrent - lkt_press)/etap_mass[0];
double ncfac = 1.0/nc_pchain;
for (int iloop = 0; iloop < nc_pchain; iloop++) {
for (ich = mpchain-1; ich > 0; ich--) {
expfac = exp(-ncfac*dt8*etap_dot[ich+1]);
etap_dot[ich] *= expfac;
etap_dot[ich] += etap_dotdot[ich] * ncfac*dt4;
etap_dot[ich] *= pdrag_factor;
etap_dot[ich] *= expfac;
}
expfac = exp(-ncfac*dt8*etap_dot[1]);
etap_dot[0] *= expfac;
etap_dot[0] += etap_dotdot[0] * ncfac*dt4;
etap_dot[0] *= pdrag_factor;
etap_dot[0] *= expfac;
for (ich = 0; ich < mpchain; ich++)
etap[ich] += ncfac*dthalf*etap_dot[ich];
factor_etap = exp(-ncfac*dthalf*etap_dot[0]);
for (i = 0; i < 3; i++)
if (p_flag[i]) omega_dot[i] *= factor_etap;
if (pstyle == TRICLINIC) {
for (i = 3; i < 6; i++)
if (p_flag[i]) omega_dot[i] *= factor_etap;
}
kecurrent = 0.0;
for (i = 0; i < 3; i++)
if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
if (pstyle == TRICLINIC) {
for (i = 3; i < 6; i++)
if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
}
etap_dotdot[0] = (kecurrent - lkt_press)/etap_mass[0];
etap_dot[0] *= expfac;
etap_dot[0] += etap_dotdot[0] * ncfac*dt4;
etap_dot[0] *= expfac;
for (ich = 1; ich < mpchain; ich++) {
expfac = exp(-ncfac*dt8*etap_dot[ich+1]);
etap_dot[ich] *= expfac;
etap_dotdot[ich] =
(etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] - boltz*t_target) /
etap_mass[ich];
etap_dot[ich] += etap_dotdot[ich] * ncfac*dt4;
etap_dot[ich] *= expfac;
}
}
}
/* ----------------------------------------------------------------------
perform half-step barostat scaling of velocities
-----------------------------------------------------------------------*/
void FixNH::nh_v_press()
{
double factor[3];
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
factor[0] = exp(-dt4*(omega_dot[0]+mtk_term2));
factor[1] = exp(-dt4*(omega_dot[1]+mtk_term2));
factor[2] = exp(-dt4*(omega_dot[2]+mtk_term2));
if (which == NOBIAS) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
v[i][0] *= factor[0];
v[i][1] *= factor[1];
v[i][2] *= factor[2];
if (pstyle == TRICLINIC) {
v[i][0] += -dthalf*(v[i][1]*omega_dot[5] + v[i][2]*omega_dot[4]);
v[i][1] += -dthalf*v[i][2]*omega_dot[3];
}
v[i][0] *= factor[0];
v[i][1] *= factor[1];
v[i][2] *= factor[2];
}
}
} else if (which == BIAS) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
temperature->remove_bias(i,v[i]);
v[i][0] *= factor[0];
v[i][1] *= factor[1];
v[i][2] *= factor[2];
if (pstyle == TRICLINIC) {
v[i][0] += -dthalf*(v[i][1]*omega_dot[5] + v[i][2]*omega_dot[4]);
v[i][1] += -dthalf*v[i][2]*omega_dot[3];
}
v[i][0] *= factor[0];
v[i][1] *= factor[1];
v[i][2] *= factor[2];
temperature->restore_bias(i,v[i]);
}
}
}
}
/* ----------------------------------------------------------------------
perform half-step update of velocities
-----------------------------------------------------------------------*/
void FixNH::nve_v()
{
double dtfm;
double **v = atom->v;
double **f = atom->f;
double *rmass = atom->rmass;
double *mass = atom->mass;
int *type = atom->type;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
if (rmass) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
dtfm = dtf / rmass[i];
v[i][0] += dtfm*f[i][0];
v[i][1] += dtfm*f[i][1];
v[i][2] += dtfm*f[i][2];
}
}
} else {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
dtfm = dtf / mass[type[i]];
v[i][0] += dtfm*f[i][0];
v[i][1] += dtfm*f[i][1];
v[i][2] += dtfm*f[i][2];
}
}
}
}
/* ----------------------------------------------------------------------
perform full-step update of positions
-----------------------------------------------------------------------*/
void FixNH::nve_x()
{
double **x = atom->x;
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
// x update by full step only for atoms in group
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
x[i][0] += dtv * v[i][0];
x[i][1] += dtv * v[i][1];
x[i][2] += dtv * v[i][2];
}
}
}
/* ----------------------------------------------------------------------
perform half-step thermostat scaling of velocities
-----------------------------------------------------------------------*/
void FixNH::nh_v_temp()
{
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
if (which == NOBIAS) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
v[i][0] *= factor_eta;
v[i][1] *= factor_eta;
v[i][2] *= factor_eta;
}
}
} else if (which == BIAS) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
temperature->remove_bias(i,v[i]);
v[i][0] *= factor_eta;
v[i][1] *= factor_eta;
v[i][2] *= factor_eta;
temperature->restore_bias(i,v[i]);
}
}
}
}
/* ----------------------------------------------------------------------
compute sigma tensor
needed whenever p_target or h0_inv changes
-----------------------------------------------------------------------*/
void FixNH::compute_sigma()
{
// if nreset_h0 > 0, reset vol0 and h0_inv
// every nreset_h0 timesteps
if (nreset_h0 > 0) {
int delta = update->ntimestep - update->beginstep;
if (delta % nreset_h0 == 0) {
if (dimension == 3) vol0 = domain->xprd * domain->yprd * domain->zprd;
else vol0 = domain->xprd * domain->yprd;
h0_inv[0] = domain->h_inv[0];
h0_inv[1] = domain->h_inv[1];
h0_inv[2] = domain->h_inv[2];
h0_inv[3] = domain->h_inv[3];
h0_inv[4] = domain->h_inv[4];
h0_inv[5] = domain->h_inv[5];
}
}
// generate upper-triangular half of
// sigma = vol0*h0inv*(p_target-p_hydro)*h0inv^t
// units of sigma are are PV/L^2 e.g. atm.A
//
// [ 0 5 4 ] [ 0 5 4 ] [ 0 5 4 ] [ 0 - - ]
// [ 5 1 3 ] = [ - 1 3 ] [ 5 1 3 ] [ 5 1 - ]
// [ 4 3 2 ] [ - - 2 ] [ 4 3 2 ] [ 4 3 2 ]
sigma[0] =
vol0*(h0_inv[0]*((p_target[0]-p_hydro)*h0_inv[0] +
p_target[5]*h0_inv[5]+p_target[4]*h0_inv[4]) +
h0_inv[5]*(p_target[5]*h0_inv[0] +
(p_target[1]-p_hydro)*h0_inv[5]+p_target[3]*h0_inv[4]) +
h0_inv[4]*(p_target[4]*h0_inv[0]+p_target[3]*h0_inv[5] +
(p_target[2]-p_hydro)*h0_inv[4]));
sigma[1] =
vol0*(h0_inv[1]*((p_target[1]-p_hydro)*h0_inv[1] +
p_target[3]*h0_inv[3]) +
h0_inv[3]*(p_target[3]*h0_inv[1] +
(p_target[2]-p_hydro)*h0_inv[3]));
sigma[2] =
vol0*(h0_inv[2]*((p_target[2]-p_hydro)*h0_inv[2]));
sigma[3] =
vol0*(h0_inv[1]*(p_target[3]*h0_inv[2]) +
h0_inv[3]*((p_target[2]-p_hydro)*h0_inv[2]));
sigma[4] =
vol0*(h0_inv[0]*(p_target[4]*h0_inv[2]) +
h0_inv[5]*(p_target[3]*h0_inv[2]) +
h0_inv[4]*((p_target[2]-p_hydro)*h0_inv[2]));
sigma[5] =
vol0*(h0_inv[0]*(p_target[5]*h0_inv[1]+p_target[4]*h0_inv[3]) +
h0_inv[5]*((p_target[1]-p_hydro)*h0_inv[1]+p_target[3]*h0_inv[3]) +
h0_inv[4]*(p_target[3]*h0_inv[1]+(p_target[2]-p_hydro)*h0_inv[3]));
}
/* ----------------------------------------------------------------------
compute strain energy
-----------------------------------------------------------------------*/
double FixNH::compute_strain_energy()
{
// compute strain energy = 0.5*Tr(sigma*h*h^t) in energy units
double* h = domain->h;
double d0,d1,d2;
d0 =
sigma[0]*(h[0]*h[0]+h[5]*h[5]+h[4]*h[4]) +
sigma[5]*( h[1]*h[5]+h[3]*h[4]) +
sigma[4]*( h[2]*h[4]);
d1 =
sigma[5]*( h[5]*h[1]+h[4]*h[3]) +
sigma[1]*( h[1]*h[1]+h[3]*h[3]) +
sigma[3]*( h[2]*h[3]);
d2 =
sigma[4]*( h[4]*h[2]) +
sigma[3]*( h[3]*h[2]) +
sigma[2]*( h[2]*h[2]);
double energy = 0.5*(d0+d1+d2)/nktv2p;
return energy;
}
/* ----------------------------------------------------------------------
compute deviatoric barostat force = h*sigma*h^t
-----------------------------------------------------------------------*/
void FixNH::compute_deviatoric()
{
// generate upper-triangular part of h*sigma*h^t
// units of fdev are are PV, e.g. atm*A^3
// [ 0 5 4 ] [ 0 5 4 ] [ 0 5 4 ] [ 0 - - ]
// [ 5 1 3 ] = [ - 1 3 ] [ 5 1 3 ] [ 5 1 - ]
// [ 4 3 2 ] [ - - 2 ] [ 4 3 2 ] [ 4 3 2 ]
double* h = domain->h;
fdev[0] =
h[0]*(sigma[0]*h[0]+sigma[5]*h[5]+sigma[4]*h[4]) +
h[5]*(sigma[5]*h[0]+sigma[1]*h[5]+sigma[3]*h[4]) +
h[4]*(sigma[4]*h[0]+sigma[3]*h[5]+sigma[2]*h[4]);
fdev[1] =
h[1]*( sigma[1]*h[1]+sigma[3]*h[3]) +
h[3]*( sigma[3]*h[1]+sigma[2]*h[3]);
fdev[2] =
h[2]*( sigma[2]*h[2]);
fdev[3] =
h[1]*( sigma[3]*h[2]) +
h[3]*( sigma[2]*h[2]);
fdev[4] =
h[0]*( sigma[4]*h[2]) +
h[5]*( sigma[3]*h[2]) +
h[4]*( sigma[2]*h[2]);
fdev[5] =
h[0]*( sigma[5]*h[1]+sigma[4]*h[3]) +
h[5]*( sigma[1]*h[1]+sigma[3]*h[3]) +
h[4]*( sigma[3]*h[1]+sigma[2]*h[3]);
}
/* ----------------------------------------------------------------------
compute target temperature and kinetic energy
-----------------------------------------------------------------------*/
void FixNH::compute_temp_target()
{
double delta = update->ntimestep - update->beginstep;
if (update->endstep > update->beginstep)
delta /= update->endstep - update->beginstep;
else delta = 0.0;
t_target = t_start + delta * (t_stop-t_start);
ke_target = tdof * boltz * t_target;
}
/* ----------------------------------------------------------------------
compute hydrostatic target pressure
-----------------------------------------------------------------------*/
void FixNH::compute_press_target()
{
double delta = update->ntimestep - update->beginstep;
if (update->endstep > update->beginstep)
delta /= update->endstep - update->beginstep;
else delta = 0.0;
p_hydro = 0.0;
for (int i = 0; i < 3; i++)
if (p_flag[i]) {
p_target[i] = p_start[i] + delta * (p_stop[i]-p_start[i]);
p_hydro += p_target[i];
}
p_hydro /= pdim;
if (pstyle == TRICLINIC)
for (int i = 3; i < 6; i++)
p_target[i] = p_start[i] + delta * (p_stop[i]-p_start[i]);
// if deviatoric, recompute sigma each time p_target changes
if (deviatoric_flag) compute_sigma();
}
/* ----------------------------------------------------------------------
update omega_dot, omega
-----------------------------------------------------------------------*/
void FixNH::nh_omega_dot()
{
double f_omega,volume;
if (dimension == 3) volume = domain->xprd*domain->yprd*domain->zprd;
else volume = domain->xprd*domain->yprd;
if (deviatoric_flag) compute_deviatoric();
mtk_term1 = 0.0;
if (mtk_flag)
if (pstyle == ISO) {
mtk_term1 = tdof * boltz * t_current;
mtk_term1 /= pdim * atom->natoms;
} else {
double *mvv_current = temperature->vector;
for (int i = 0; i < 3; i++)
if (p_flag[i])
mtk_term1 += mvv_current[i];
mtk_term1 /= pdim * atom->natoms;
}
for (int i = 0; i < 3; i++)
if (p_flag[i]) {
f_omega = (p_current[i]-p_hydro)*volume /
(omega_mass[i] * nktv2p) + mtk_term1 / omega_mass[i];
if (deviatoric_flag) f_omega -= fdev[i]/(omega_mass[i] * nktv2p);
omega_dot[i] += f_omega*dthalf;
omega_dot[i] *= pdrag_factor;
}
mtk_term2 = 0.0;
if (mtk_flag) {
for (int i = 0; i < 3; i++)
if (p_flag[i])
mtk_term2 += omega_dot[i];
mtk_term2 /= pdim * atom->natoms;
}
if (pstyle == TRICLINIC) {
for (int i = 3; i < 6; i++) {
if (p_flag[i]) {
f_omega = p_current[i]*volume/(omega_mass[i] * nktv2p);
if (deviatoric_flag)
f_omega -= fdev[i]/(omega_mass[i] * nktv2p);
omega_dot[i] += f_omega*dthalf;
omega_dot[i] *= pdrag_factor;
}
}
}
}
/* ----------------------------------------------------------------------
if box tilt exceeds limits,
create new box in domain
remap to put far-away atoms back into new box
perform irregular on atoms in lamda coords to get atoms to new procs
force reneighboring on next timestep
------------------------------------------------------------------------- */
void FixNH::pre_exchange()
{
double xprd = domain->xprd;
double yprd = domain->yprd;
// flip is triggered when tilt exceeds 0.5 by
// an amount DELTAFLIP that is somewhat arbitrary
double xtiltmax = (0.5+DELTAFLIP)*xprd;
double ytiltmax = (0.5+DELTAFLIP)*yprd;
int flip = 0;
if (domain->yz < -ytiltmax) {
flip = 1;
domain->yz += yprd;
domain->xz += domain->xy;
} else if (domain->yz >= ytiltmax) {
flip = 1;
domain->yz -= yprd;
domain->xz -= domain->xy;
}
if (domain->xz < -xtiltmax) {
flip = 1;
domain->xz += xprd;
} else if (domain->xz >= xtiltmax) {
flip = 1;
domain->xz -= xprd;
}
if (domain->xy < -xtiltmax) {
flip = 1;
domain->xy += xprd;
} else if (domain->xy >= xtiltmax) {
flip = 1;
domain->xy -= xprd;
}
if (flip) {
domain->set_global_box();
domain->set_local_box();
double **x = atom->x;
int *image = atom->image;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) domain->remap(x[i],image[i]);
domain->x2lamda(atom->nlocal);
irregular->migrate_atoms();
domain->lamda2x(atom->nlocal);
}
}
diff --git a/src/fix_nh.h b/src/fix_nh.h
index 9ed1cab14..9d0d77352 100644
--- a/src/fix_nh.h
+++ b/src/fix_nh.h
@@ -1,135 +1,247 @@
/* ----------------------------------------------------------------------
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_NH_H
#define LMP_FIX_NH_H
#include "fix.h"
namespace LAMMPS_NS {
class FixNH : public Fix {
public:
FixNH(class LAMMPS *, int, char **);
virtual ~FixNH();
int setmask();
virtual void init();
virtual void setup(int);
virtual void initial_integrate(int);
virtual void final_integrate();
void initial_integrate_respa(int, int, int);
void final_integrate_respa(int, int);
void pre_exchange();
double compute_scalar();
virtual double compute_vector(int);
void write_restart(FILE *);
virtual int pack_restart_data(double *); // pack restart data
virtual void restart(char *);
int modify_param(int, char **);
void reset_target(double);
void reset_dt();
protected:
int dimension,which;
double dtv,dtf,dthalf,dt4,dt8,dto;
double boltz,nktv2p,tdof;
double vol0; // reference volume
double t0; // reference temperature
// used for barostat mass
double t_start,t_stop;
double t_current,t_target,ke_target;
double t_freq;
int tstat_flag; // 1 if control T
int pstat_flag; // 1 if control P
int pstyle,pcouple,allremap;
int p_flag[6]; // 1 if control P on this dim, 0 if not
double p_start[6],p_stop[6];
double p_freq[6],p_target[6];
double omega[6],omega_dot[6];
double omega_mass[6];
double p_current[6];
double drag,tdrag_factor; // drag factor on particle thermostat
double pdrag_factor; // drag factor on barostat
int kspace_flag; // 1 if KSpace invoked, 0 if not
int nrigid; // number of rigid fixes
int *rfix; // indices of rigid fixes
class Irregular *irregular; // for migrating atoms after box flips
int nlevels_respa;
double *step_respa;
char *id_temp,*id_press;
class Compute *temperature,*pressure;
int tflag,pflag;
double *eta,*eta_dot; // chain thermostat for particles
double *eta_dotdot;
double *eta_mass;
int mtchain; // length of chain
int mtchain_default_flag; // 1 = mtchain is default
double *etap; // chain thermostat for barostat
double *etap_dot;
double *etap_dotdot;
double *etap_mass;
int mpchain; // length of chain
int mtk_flag; // 0 if using Hoover barostat
int pdim; // number of barostatted dims
double p_freq_max; // maximum barostat frequency
double p_hydro; // hydrostatic target pressure
int nc_tchain,nc_pchain;
double factor_eta;
double sigma[6]; // scaled target stress
double fdev[6]; // deviatoric force on barostat
int deviatoric_flag; // 0 if target stress tensor is hydrostatic
double h0_inv[6]; // h_inv of reference (zero strain) box
int nreset_h0; // interval for resetting h0
double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections
int eta_mass_flag; // 1 if eta_mass updated, 0 if not.
int omega_mass_flag; // 1 if omega_mass updated, 0 if not.
int etap_mass_flag; // 1 if etap_mass updated, 0 if not.
int scaleyz; // 1 if yz scaled with lz
int scalexz; // 1 if xz scaled with lz
int scalexy; // 1 if xy scaled with ly
void couple();
void remap();
void nhc_temp_integrate();
void nhc_press_integrate();
virtual void nve_x(); // may be overwritten by child classes
virtual void nve_v();
virtual void nh_v_press();
virtual void nh_v_temp();
virtual void compute_temp_target();
virtual int size_restart_global();
void compute_sigma();
void compute_deviatoric();
double compute_strain_energy();
void compute_press_target();
void nh_omega_dot();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+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: Target temperature for fix nvt/npt/nph cannot be 0.0
+
+Self-explanatory.
+
+E: Invalid fix nvt/npt/nph command for a 2d simulation
+
+Cannot control z dimension in a 2d model.
+
+E: Invalid fix nvt/npt/nph command pressure settings
+
+If multiple dimensions are coupled, those dimensions must be
+specified.
+
+E: Cannot use fix nvt/npt/nph on a non-periodic dimension
+
+When specifying a diagonal pressure component, the dimension must be
+periodic.
+
+E: Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension
+
+When specifying an off-diagonal pressure component, the 2nd of the two
+dimensions must be periodic. E.g. if the xy component is specified,
+then the y dimension must be periodic.
+
+E: Cannot use fix nvt/npt/nph with yz dynamics when z is non-periodic dimension
+
+UNDOCUMENTED
+
+E: Cannot use fix nvt/npt/nph with xz dynamics when z is non-periodic dimension
+
+UNDOCUMENTED
+
+E: Cannot use fix nvt/npt/nph with xy dynamics when y is non-periodic dimension
+
+UNDOCUMENTED
+
+E: Cannot use fix nvt/npt/nph withboth yz dynamics and yz scaling
+
+UNDOCUMENTED
+
+E: Cannot use fix nvt/npt/nph with both xz dynamics and xz scaling
+
+UNDOCUMENTED
+
+E: Cannot use fix nvt/npt/nph with both xy dynamics and xy scaling
+
+UNDOCUMENTED
+
+E: Can not specify Pxy/Pxz/Pyz in fix nvt/npt/nph with non-triclinic box
+
+Only triclinic boxes can be used with off-diagonal pressure components.
+See the region prism command for details.
+
+E: Invalid fix nvt/npt/nph pressure settings
+
+Settings for coupled dimensions must be the same.
+
+E: Fix nvt/npt/nph damping parameters must be > 0.0
+
+Self-explanatory.
+
+E: Cannot use fix npt and fix deform on same component of stress tensor
+
+This would be changing the same box dimension twice.
+
+E: Temperature ID for fix nvt/nph/npt does not exist
+
+Self-explanatory.
+
+E: Pressure ID for fix npt/nph does not exist
+
+Self-explanatory.
+
+E: Fix npt/nph has tilted box too far in one step - periodic cell is too far from equilibrium state
+
+UNDOCUMENTED
+
+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.
+
+*/
diff --git a/src/fix_nh_sphere.h b/src/fix_nh_sphere.h
index 9a3a57b84..925726c7e 100644
--- a/src/fix_nh_sphere.h
+++ b/src/fix_nh_sphere.h
@@ -1,34 +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 LMP_FIX_NH_SPHERE_H
#define LMP_FIX_NH_SPHERE_H
#include "fix_nh.h"
namespace LAMMPS_NS {
class FixNHSphere : public FixNH {
public:
FixNHSphere(class LAMMPS *, int, char **);
virtual ~FixNHSphere() {}
void init();
protected:
void nve_v();
void nh_v_temp();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Fix nvt/nph/npt sphere requires atom style sphere
+
+UNDOCUMENTED
+
+E: Fix nvt/sphere requires extended particles
+
+This fix can only be used for particles of a finite size.
+
+*/
diff --git a/src/fix_nph.h b/src/fix_nph.h
index 8cdbd8834..a42d7f087 100644
--- a/src/fix_nph.h
+++ b/src/fix_nph.h
@@ -1,36 +1,48 @@
/* ----------------------------------------------------------------------
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(nph,FixNPH)
#else
#ifndef LMP_FIX_NPH_H
#define LMP_FIX_NPH_H
#include "fix_nh.h"
namespace LAMMPS_NS {
class FixNPH : public FixNH {
public:
FixNPH(class LAMMPS *, int, char **);
~FixNPH() {}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Temperature control can not be used with fix nph
+
+Self-explanatory.
+
+E: Pressure control must be used with fix nph
+
+Self-explanatory.
+
+*/
diff --git a/src/fix_nph_sphere.h b/src/fix_nph_sphere.h
index 76e473673..db8d5d743 100644
--- a/src/fix_nph_sphere.h
+++ b/src/fix_nph_sphere.h
@@ -1,36 +1,48 @@
/* ----------------------------------------------------------------------
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(nph/sphere,FixNPHSphere)
#else
#ifndef LMP_FIX_NPH_SPHERE_H
#define LMP_FIX_NPH_SPHERE_H
#include "fix_nh_sphere.h"
namespace LAMMPS_NS {
class FixNPHSphere : public FixNHSphere {
public:
FixNPHSphere(class LAMMPS *, int, char **);
~FixNPHSphere() {}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Temperature control can not be used with fix nph/sphere
+
+Self-explanatory.
+
+E: Pressure control must be used with fix nph/sphere
+
+Self-explanatory.
+
+*/
diff --git a/src/fix_npt.h b/src/fix_npt.h
index 50ded650b..6cdd1b37c 100644
--- a/src/fix_npt.h
+++ b/src/fix_npt.h
@@ -1,36 +1,48 @@
/* ----------------------------------------------------------------------
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(npt,FixNPT)
#else
#ifndef LMP_FIX_NPT_H
#define LMP_FIX_NPT_H
#include "fix_nh.h"
namespace LAMMPS_NS {
class FixNPT : public FixNH {
public:
FixNPT(class LAMMPS *, int, char **);
~FixNPT() {}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Temperature control must be used with fix npt
+
+Self-explanatory.
+
+E: Pressure control must be used with fix npt
+
+Self-explanatory.
+
+*/
diff --git a/src/fix_npt_sphere.h b/src/fix_npt_sphere.h
index 1bbd59e73..efcd47b2a 100644
--- a/src/fix_npt_sphere.h
+++ b/src/fix_npt_sphere.h
@@ -1,36 +1,48 @@
/* ----------------------------------------------------------------------
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(npt/sphere,FixNPTSphere)
#else
#ifndef LMP_FIX_NPT_SPHERE_H
#define LMP_FIX_NPT_SPHERE_H
#include "fix_nh_sphere.h"
namespace LAMMPS_NS {
class FixNPTSphere : public FixNHSphere {
public:
FixNPTSphere(class LAMMPS *, int, char **);
~FixNPTSphere() {}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Temperature control must be used with fix npt/sphere
+
+Self-explanatory.
+
+E: Pressure control must be used with fix npt/sphere
+
+Self-explanatory.
+
+*/
diff --git a/src/fix_nve.h b/src/fix_nve.h
index 2be7a671e..838f79b99 100644
--- a/src/fix_nve.h
+++ b/src/fix_nve.h
@@ -1,48 +1,58 @@
/* ----------------------------------------------------------------------
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(nve,FixNVE)
#else
#ifndef LMP_FIX_NVE_H
#define LMP_FIX_NVE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixNVE : public Fix {
public:
FixNVE(class LAMMPS *, int, char **);
virtual ~FixNVE() {}
int setmask();
virtual void init();
virtual void initial_integrate(int);
virtual void final_integrate();
virtual void initial_integrate_respa(int, int, int);
virtual void final_integrate_respa(int, int);
virtual void reset_dt();
protected:
double dtv,dtf;
double *step_respa;
int mass_require;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/fix_nve_limit.h b/src/fix_nve_limit.h
index 475b2e641..68927155d 100644
--- a/src/fix_nve_limit.h
+++ b/src/fix_nve_limit.h
@@ -1,49 +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.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/limit,FixNVELimit)
#else
#ifndef LMP_FIX_NVE_LIMIT_H
#define LMP_FIX_NVE_LIMIT_H
#include "fix.h"
namespace LAMMPS_NS {
class FixNVELimit : public Fix {
public:
FixNVELimit(class LAMMPS *, int, char **);
int setmask();
void init();
void initial_integrate(int);
void final_integrate();
void initial_integrate_respa(int, int, int);
void final_integrate_respa(int, int);
void reset_dt();
double compute_scalar();
private:
double dtv,dtf;
double *step_respa;
int mass_require,ncount;
double xlimit,vlimitsq;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/fix_nve_noforce.h b/src/fix_nve_noforce.h
index 90989869b..29d198564 100644
--- a/src/fix_nve_noforce.h
+++ b/src/fix_nve_noforce.h
@@ -1,44 +1,54 @@
/* ----------------------------------------------------------------------
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(nve/noforce,FixNVENoforce)
#else
#ifndef LMP_FIX_NVE_NOFORCE_H
#define LMP_FIX_NVE_NOFORCE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixNVENoforce : public Fix {
public:
FixNVENoforce(class LAMMPS *, int, char **);
int setmask();
virtual void init();
virtual void initial_integrate(int);
void initial_integrate_respa(int, int, int);
void reset_dt();
protected:
double dtv;
double *step_respa;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/fix_nve_sphere.h b/src/fix_nve_sphere.h
index c3148c2c5..89ffe806e 100644
--- a/src/fix_nve_sphere.h
+++ b/src/fix_nve_sphere.h
@@ -1,42 +1,64 @@
/* ----------------------------------------------------------------------
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(nve/sphere,FixNVESphere)
#else
#ifndef LMP_FIX_NVE_SPHERE_H
#define LMP_FIX_NVE_SPHERE_H
#include "fix_nve.h"
namespace LAMMPS_NS {
class FixNVESphere : public FixNVE {
public:
FixNVESphere(class LAMMPS *, int, char **);
virtual ~FixNVESphere() {}
void init();
virtual void initial_integrate(int);
virtual void final_integrate();
protected:
int extra;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix nve/sphere requires atom style sphere
+
+UNDOCUMENTED
+
+E: Fix nve/sphere requires atom attribute mu
+
+An atom style with this attribute is needed.
+
+E: Fix nve/sphere requires extended particles
+
+This fix can only be used for particles of a finite size.
+
+*/
diff --git a/src/fix_nvt.h b/src/fix_nvt.h
index 0e4360409..e0aa289a4 100644
--- a/src/fix_nvt.h
+++ b/src/fix_nvt.h
@@ -1,36 +1,48 @@
/* ----------------------------------------------------------------------
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(nvt,FixNVT)
#else
#ifndef LMP_FIX_NVT_H
#define LMP_FIX_NVT_H
#include "fix_nh.h"
namespace LAMMPS_NS {
class FixNVT : public FixNH {
public:
FixNVT(class LAMMPS *, int, char **);
~FixNVT() {}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Temperature control must be used with fix nvt
+
+Self-explanatory.
+
+E: Pressure control can not be used with fix nvt
+
+Self-explanatory.
+
+*/
diff --git a/src/fix_nvt_sllod.h b/src/fix_nvt_sllod.h
index d4d5dd7b3..a95065f8b 100644
--- a/src/fix_nvt_sllod.h
+++ b/src/fix_nvt_sllod.h
@@ -1,42 +1,67 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
www.cs.sandia.gov/~sjplimp/lammps.html
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
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(nvt/sllod,FixNVTSllod)
#else
#ifndef LMP_FIX_NVT_SLLOD_H
#define LMP_FIX_NVT_SLLOD_H
#include "fix_nh.h"
namespace LAMMPS_NS {
class FixNVTSllod : public FixNH {
public:
FixNVTSllod(class LAMMPS *, int, char **);
~FixNVTSllod() {}
void init();
private:
int nondeformbias;
void nh_v_temp();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Temperature control must be used with fix nvt/sllod
+
+Self-explanatory.
+
+E: Pressure control can not be used with fix nvt/sllod
+
+Self-explanatory.
+
+E: Temperature for fix nvt/sllod does not have a bias
+
+The specified compute must compute temperature with a bias.
+
+E: Using fix nvt/sllod with inconsistent fix deform remap option
+
+Fix nvt/sllod requires that deforming atoms have a velocity profile
+provided by "remap v" as a fix deform option.
+
+E: Using fix nvt/sllod with no fix deform defined
+
+Self-explanatory.
+
+*/
diff --git a/src/fix_nvt_sphere.h b/src/fix_nvt_sphere.h
index 60dd0a52e..daf1cc922 100644
--- a/src/fix_nvt_sphere.h
+++ b/src/fix_nvt_sphere.h
@@ -1,36 +1,48 @@
/* ----------------------------------------------------------------------
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(nvt/sphere,FixNVTSphere)
#else
#ifndef LMP_FIX_NVT_SPHERE_H
#define LMP_FIX_NVT_SPHERE_H
#include "fix_nh_sphere.h"
namespace LAMMPS_NS {
class FixNVTSphere : public FixNHSphere {
public:
FixNVTSphere(class LAMMPS *, int, char **);
~FixNVTSphere() {}
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Temperature control must be used with fix nvt/sphere
+
+Self-explanatory.
+
+E: Pressure control can not be used with fix nvt/sphere
+
+Self-explanatory.
+
+*/
diff --git a/src/fix_orient_fcc.h b/src/fix_orient_fcc.h
index b83753619..d565ca47b 100644
--- a/src/fix_orient_fcc.h
+++ b/src/fix_orient_fcc.h
@@ -1,90 +1,115 @@
/* ----------------------------------------------------------------------
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(orient/fcc,FixOrientFCC)
#else
#ifndef LMP_FIX_ORIENT_FCC_H
#define LMP_FIX_ORIENT_FCC_H
#include "fix.h"
namespace LAMMPS_NS {
class FixOrientFCC : public Fix {
public:
struct Nbr { // neighbor info for each owned and ghost atom
int n; // # of closest neighbors (up to 12)
int id[12]; // IDs of each neighbor
// if center atom is owned, these are local IDs
// if center atom is ghost, these are global IDs
double xismooth[12]; // distance weighting factor for each neighbors
double dxi[12][3]; // d order-parameter / dx for each neighbor
double duxi; // d Energy / d order-parameter for atom
};
struct Sort { // data structure for sorting to find 12 closest
int id; // ID of neighbor atom
double rsq; // distance between center and neighbor atom
double delta[3]; // displacement between center and neighbor atom
double xismooth; // distance weighting factor
};
FixOrientFCC(class LAMMPS *, int, char **);
~FixOrientFCC();
int setmask();
void init();
void init_list(int, class NeighList *);
void setup(int);
void post_force(int);
void post_force_respa(int, int, int);
double compute_scalar();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
double memory_usage();
private:
int me;
int nlevels_respa;
int direction_of_motion; // 1 = center shrinks, 0 = center grows
int nstats; // stats output every this many steps
double a; // lattice parameter
double Vxi; // potential value
double uxif_low; // cut-off fraction, low order parameter
double uxif_high; // cut-off fraction, high order parameter
char *xifilename, *chifilename; // file names for 2 crystal orientations
bool use_xismooth;
double Rxi[12][3],Rchi[12][3],half_xi_chi_vec[2][6][3];
double xiid,xi0,xi1,xicutoffsq,cutsq,added_energy;
int half_fcc_nn;
int nmax; // expose 2 per-atom quantities
double **order; // order param and normalized order param
Nbr *nbr;
Sort *sort;
class NeighList *list;
void find_best_ref(double *, int, double &, double *);
static int compare(const void *, const void *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix orient/fcc file open failed
+
+The fix orient/fcc command could not open a specified file.
+
+E: Fix orient/fcc file read failed
+
+The fix orient/fcc command could not read the needed parameters from a
+specified file.
+
+E: Fix orient/fcc found self twice
+
+The neighbor lists used by fix orient/fcc are messed up. If this
+error occurs, it is likely a bug, so send an email to the
+"developers"_http://lammps.sandia.gov/authors.html.
+
+*/
diff --git a/src/fix_planeforce.h b/src/fix_planeforce.h
index 1fc1f306f..78c66382d 100644
--- a/src/fix_planeforce.h
+++ b/src/fix_planeforce.h
@@ -1,44 +1,54 @@
/* ----------------------------------------------------------------------
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(planeforce,FixPlaneForce)
#else
#ifndef LMP_FIX_PLANEFORCE_H
#define LMP_FIX_PLANEFORCE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixPlaneForce : public Fix {
public:
FixPlaneForce(class LAMMPS *, int, char **);
int setmask();
void setup(int);
void min_setup(int);
void post_force(int);
void post_force_respa(int, int, int);
void min_post_force(int);
private:
double xdir,ydir,zdir;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/fix_press_berendsen.h b/src/fix_press_berendsen.h
index cbe9a642a..2caf9ea61 100644
--- a/src/fix_press_berendsen.h
+++ b/src/fix_press_berendsen.h
@@ -1,62 +1,129 @@
/* ----------------------------------------------------------------------
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(press/berendsen,FixPressBerendsen)
#else
#ifndef LMP_FIX_PRESS_BERENDSEN_H
#define LMP_FIX_PRESS_BERENDSEN_H
#include "fix.h"
namespace LAMMPS_NS {
class FixPressBerendsen : public Fix {
public:
FixPressBerendsen(class LAMMPS *, int, char **);
~FixPressBerendsen();
int setmask();
void init();
void setup(int);
void end_of_step();
int modify_param(int, char **);
protected:
int dimension,which;
double bulkmodulus;
int pstyle,pcouple,allremap;
int p_flag[3]; // 1 if control P on this dim, 0 if not
double p_start[3],p_stop[3];
double p_period[3],p_target[3];
double p_current[3],dilation[3];
double factor[3];
int kspace_flag; // 1 if KSpace invoked, 0 if not
int nrigid; // number of rigid fixes
int *rfix; // indices of rigid fixes
char *id_temp,*id_press;
class Compute *temperature,*pressure;
int tflag,pflag;
void couple();
void remap();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Invalid fix press/berendsen for a 2d simulation
+
+The z component of pressure cannot be controlled for a 2d model.
+
+E: Invalid fix press/berendsen pressure settings
+
+Settings for coupled dimensions must be the same.
+
+E: Cannot use fix press/berendsen on a non-periodic dimension
+
+Self-explanatory.
+
+E: Fix press/berendsen damping parameters must be > 0.0
+
+Self-explanatory.
+
+E: Cannot use fix press/berendsen with triclinic box
+
+Self-explanatory.
+
+E: Cannot use fix press/berendsen and fix deform on same component of stress tensor
+
+These commands both change the box size/shape, so you cannot use both
+together.
+
+E: Temperature ID for fix press/berendsen does not exist
+
+Self-explanatory.
+
+E: Pressure ID for fix press/berendsen does not exist
+
+The compute ID needed to compute pressure for the fix does not
+exist.
+
+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 NPT is not for group all
+
+User-assigned temperature to NPT fix does not compute temperature for
+all atoms. Since NPT computes a global pressure, the kinetic energy
+contribution from the temperature is assumed to also be for all atoms.
+Thus the pressure used by NPT could be inaccurate.
+
+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.
+
+*/
diff --git a/src/fix_print.h b/src/fix_print.h
index 52b4f59a8..c874d2dcd 100644
--- a/src/fix_print.h
+++ b/src/fix_print.h
@@ -1,44 +1,58 @@
/* ----------------------------------------------------------------------
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(print,FixPrint)
#else
#ifndef LMP_FIX_PRINT_H
#define LMP_FIX_PRINT_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
class FixPrint : public Fix {
public:
FixPrint(class LAMMPS *, int, char **);
~FixPrint();
int setmask();
void end_of_step();
private:
int me,screenflag;
FILE *fp;
char *string,*copy,*work;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot open fix print file %s
+
+The output file generated by the fix print command cannot be opened
+
+*/
diff --git a/src/fix_read_restart.h b/src/fix_read_restart.h
index d1b985b4b..897fc468a 100644
--- a/src/fix_read_restart.h
+++ b/src/fix_read_restart.h
@@ -1,49 +1,52 @@
/* ----------------------------------------------------------------------
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(READ_RESTART,FixReadRestart)
#else
#ifndef LMP_FIX_READ_RESTART_H
#define LMP_FIX_READ_RESTART_H
#include "fix.h"
namespace LAMMPS_NS {
class FixReadRestart : public Fix {
public:
int *count;
double **extra;
FixReadRestart(class LAMMPS *, int, char **);
~FixReadRestart();
int setmask();
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
private:
int nextra; // max number of extra values for any atom
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/fix_recenter.h b/src/fix_recenter.h
index 6e565bf9c..ea78c09e3 100644
--- a/src/fix_recenter.h
+++ b/src/fix_recenter.h
@@ -1,44 +1,72 @@
/* ----------------------------------------------------------------------
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(recenter,FixRecenter)
#else
#ifndef LMP_FIX_RECENTER_H
#define LMP_FIX_RECENTER_H
#include "fix.h"
namespace LAMMPS_NS {
class FixRecenter : public Fix {
public:
FixRecenter(class LAMMPS *, int, char **);
int setmask();
void init();
void initial_integrate(int);
private:
int group2bit,scaleflag;
int xflag,yflag,zflag;
int xinitflag,yinitflag,zinitflag;
double xcom,ycom,zcom,xinit,yinit,zinit,masstotal;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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 recenter group ID
+
+A group ID used in the fix recenter command does not exist.
+
+E: Use of fix recenter with undefined lattice
+
+Must use lattice command with fix recenter command if units option is
+set to lattice.
+
+E: Fix recenter group has no atoms
+
+Self-explanatory.
+
+W: Fix recenter should come after all other integration fixes
+
+Other fixes may change the position of the center-of-mass, so
+fix recenter should come last.
+
+*/
diff --git a/src/fix_respa.h b/src/fix_respa.h
index bdfd7f73c..74f53f1a6 100644
--- a/src/fix_respa.h
+++ b/src/fix_respa.h
@@ -1,51 +1,54 @@
/* ----------------------------------------------------------------------
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(RESPA,FixRespa)
#else
#ifndef LMP_FIX_RESPA_H
#define LMP_FIX_RESPA_H
#include "fix.h"
namespace LAMMPS_NS {
class FixRespa : public Fix {
friend class Respa;
friend class FixShake;
public:
FixRespa(class LAMMPS *, int, char **);
~FixRespa();
int setmask();
void init() {}
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
private:
int nlevels;
double ***f_level; // force at each rRESPA level
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/fix_restrain.h b/src/fix_restrain.h
index c54045909..9188b28a5 100644
--- a/src/fix_restrain.h
+++ b/src/fix_restrain.h
@@ -1,53 +1,75 @@
/* ----------------------------------------------------------------------
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(restrain,FixRestrain)
#else
#ifndef LMP_FIX_RESTRAIN_H
#define LMP_FIX_RESTRAIN_H
#include "fix.h"
namespace LAMMPS_NS {
class FixRestrain : public Fix {
public:
FixRestrain(class LAMMPS *, int, char **);
~FixRestrain();
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();
private:
int nlevels_respa;
int n_bonds, rstyle;
double k_start, k_stop, energy, energy_all;
int **atom_id;
double *target, *cos_shift, *sin_shift;
void restrain_dihedral();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix restrain requires an atom map, see atom_modify
+
+UNDOCUMENTED
+
+E: Restrain atoms %d %d %d %d missing on proc %d at step %ld
+
+UNDOCUMENTED
+
+W: Restrain problem: %d %ld %d %d %d %d
+
+UNDOCUMENTED
+
+*/
diff --git a/src/fix_rigid.h b/src/fix_rigid.h
index fa803df5f..c8fa8f3c6 100644
--- a/src/fix_rigid.h
+++ b/src/fix_rigid.h
@@ -1,122 +1,196 @@
/* ----------------------------------------------------------------------
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,FixRigid)
#else
#ifndef LMP_FIX_RIGID_H
#define LMP_FIX_RIGID_H
#include "fix.h"
namespace LAMMPS_NS {
class FixRigid : public Fix {
public:
FixRigid(class LAMMPS *, int, char **);
virtual ~FixRigid();
virtual int setmask();
virtual void init();
virtual void setup(int);
virtual void initial_integrate(int);
void post_force(int);
virtual void final_integrate();
void initial_integrate_respa(int, int, int);
void final_integrate_respa(int, int);
virtual double compute_scalar();
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
void set_arrays(int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
void pre_neighbor();
int dof(int);
void deform(int);
void reset_dt();
double compute_array(int, int);
protected:
int me,nprocs;
double dtv,dtf,dtq;
double *step_respa;
int triclinic;
double MINUSPI,TWOPI;
int nbody; // # of rigid bodies
int *nrigid; // # of atoms in each rigid body
double *masstotal; // total mass of each rigid body
double **xcm; // coords of center-of-mass of each rigid body
double **vcm; // velocity of center-of-mass of each
double **fcm; // force on center-of-mass of each
double **inertia; // 3 principal components of inertia of each
double **ex_space,**ey_space,**ez_space;
// principal axes of each in space coords
double **angmom; // angular momentum of each in space coords
double **omega; // angular velocity of each in space coords
double **torque; // torque on each rigid body in space coords
double **quat; // quaternion of each rigid body
int *imagebody; // image flags of xcm of each rigid body
double **fflag; // flag for on/off of center-of-mass force
double **tflag; // flag for on/off of center-of-mass torque
double **langextra; // Langevin thermostat forces and torques
int *body; // which body each atom is part of (-1 if none)
double **displace; // displacement of each atom in body coords
double **sum,**all; // work vectors for each rigid body
int **remapflag; // PBC remap flags for each rigid body
int extended; // 1 if any particles have extended attributes
int orientflag; // 1 if particles store spatial orientation
int dorientflag; // 1 if particles store dipole orientation
int *eflags; // flags for extended particles
double **orient; // orientation vector of particle wrt rigid body
double **dorient; // orientation of dipole mu wrt rigid body
double tfactor; // scale factor on temperature of rigid bodies
int langflag; // 0/1 = no/yes Langevin thermostat
int tempflag; // NVT settings
double t_start,t_stop;
double t_period,t_freq;
int t_chain,t_iter,t_order;
int pressflag; // NPT settings
double p_start,p_stop;
double p_period,p_freq;
int p_chain;
class RanMars *random;
class AtomVecEllipsoid *avec_ellipsoid;
class AtomVecLine *avec_line;
class AtomVecTri *avec_tri;
int POINT,SPHERE,ELLIPSOID,LINE,TRIANGLE,DIPOLE; // bitmasks for eflags
int OMEGA,ANGMOM,TORQUE;
void no_squish_rotate(int, double *, double *, double *, double);
void set_xv();
void set_v();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix rigid molecule requires atom attribute molecule
+
+Self-explanatory.
+
+E: Could not find fix rigid group ID
+
+A group ID used in the fix rigid command does not exist.
+
+E: One or more atoms belong to multiple rigid bodies
+
+Two or more rigid bodies defined by the fix rigid command cannot
+contain the same atom.
+
+E: No rigid bodies defined
+
+The fix specification did not end up defining any rigid bodies.
+
+E: Fix rigid z force cannot be on for 2d simulation
+
+UNDOCUMENTED
+
+E: Fix rigid xy torque cannot be on for 2d simulation
+
+UNDOCUMENTED
+
+E: Fix rigid langevin period must be > 0.0
+
+UNDOCUMENTED
+
+E: One or zero atoms in rigid body
+
+Any rigid body defined by the fix rigid command must contain 2 or more
+atoms.
+
+W: More than one fix rigid
+
+It is not efficient to use fix rigid more than once.
+
+E: Rigid fix must come before NPT/NPH fix
+
+NPT/NPH fix must be defined in input script after all rigid fixes,
+else the rigid fix contribution to the pressure virial is
+incorrect.
+
+E: Fix rigid atom has non-zero image flag in a non-periodic dimension
+
+You cannot set image flags for non-periodic dimensions.
+
+E: Insufficient Jacobi rotations for rigid body
+
+Eigensolve for rigid body was not sufficiently accurate.
+
+E: Fix rigid: Bad principal moments
+
+The principal moments of inertia computed for a rigid body
+are not within the required tolerances.
+
+W: Computing temperature of portions of rigid bodies
+
+The group defined by the temperature compute does not encompass all
+the atoms in one or more rigid bodies, so the change in
+degrees-of-freedom for the atoms in those partial rigid bodies will
+not be accounted for.
+
+*/
diff --git a/src/fix_rigid_nve.h b/src/fix_rigid_nve.h
index 60e56d85b..2e3b00bd8 100644
--- a/src/fix_rigid_nve.h
+++ b/src/fix_rigid_nve.h
@@ -1,42 +1,45 @@
/* ----------------------------------------------------------------------
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,FixRigidNVE)
#else
#ifndef LMP_FIX_RIGID_NVE_H
#define LMP_FIX_RIGID_NVE_H
#include "fix_rigid.h"
namespace LAMMPS_NS {
class FixRigidNVE : public FixRigid {
public:
FixRigidNVE(class LAMMPS *, int, char **);
virtual ~FixRigidNVE();
virtual void setup(int);
virtual void initial_integrate(int);
virtual void final_integrate();
private:
double **conjqm; // conjugate quaternion momentum
};
}
#endif
#endif
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/fix_rigid_nvt.h b/src/fix_rigid_nvt.h
index 7cfc1cf5f..132aeaa53 100644
--- a/src/fix_rigid_nvt.h
+++ b/src/fix_rigid_nvt.h
@@ -1,74 +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.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(rigid/nvt,FixRigidNVT)
#else
#ifndef LMP_FIX_RIGID_NVT_H
#define LMP_FIX_RIGID_NVT_H
#include "fix_rigid.h"
namespace LAMMPS_NS {
class FixRigidNVT : public FixRigid {
public:
FixRigidNVT(class LAMMPS *, int, char **);
virtual ~FixRigidNVT();
virtual int setmask();
virtual void init();
virtual void setup(int);
virtual void initial_integrate(int);
virtual void final_integrate();
virtual double compute_scalar();
virtual void write_restart(FILE *);
virtual void restart(char *);
virtual void reset_target(double);
private:
double **conjqm; // conjugate quaternion momentum
double boltz; // boltzman constant
double t_target;
int nf_t,nf_r; // 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
void update_nhcp(double, double);
inline double maclaurin_series(double);
void allocate_chain();
void allocate_order();
void deallocate_chain();
void deallocate_order();
};
inline double FixRigidNVT::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
#endif
+
+/* ERROR/WARNING messages:
+
+E: Did not set temp for fix rigid/nvt
+
+The temp keyword must be used.
+
+E: Target temperature for fix rigid/nvt cannot be 0.0
+
+Self-explanatory.
+
+E: Fix rigid/nvt period must be > 0.0
+
+Self-explanatory
+
+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: Fix_modify order must be 3 or 5
+
+Self-explanatory.
+
+E: Cannot restart fix rigid/nvt with different # of chains
+
+This is because the restart file contains per-chain info.
+
+*/
diff --git a/src/fix_setforce.h b/src/fix_setforce.h
index c8a493c62..7221397fc 100644
--- a/src/fix_setforce.h
+++ b/src/fix_setforce.h
@@ -1,58 +1,85 @@
/* ----------------------------------------------------------------------
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(setforce,FixSetForce)
#else
#ifndef LMP_FIX_SET_FORCE_H
#define LMP_FIX_SET_FORCE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixSetForce : public Fix {
public:
FixSetForce(class LAMMPS *, int, char **);
~FixSetForce();
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_vector(int);
double memory_usage();
private:
double xvalue,yvalue,zvalue;
int varflag,iregion;
char *xstr,*ystr,*zstr;
char *idregion;
int xvar,yvar,zvar,xstyle,ystyle,zstyle;
double foriginal[3],foriginal_all[3];
int varany,force_flag;
int nlevels_respa;
int maxatom;
double **sforce;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Region ID for fix setforce does not exist
+
+Self-explanatory.
+
+E: Variable name for fix setforce does not exist
+
+Self-explanatory.
+
+E: Variable for fix setforce is invalid style
+
+Only equal-style variables can be used.
+
+E: Cannot use non-zero forces in an energy minimization
+
+Fix setforce cannot be used in this manner. Use fix addforce
+instead.
+
+*/
diff --git a/src/fix_shake.h b/src/fix_shake.h
index b0aa5c63d..a0727b7cb 100644
--- a/src/fix_shake.h
+++ b/src/fix_shake.h
@@ -1,117 +1,226 @@
/* ----------------------------------------------------------------------
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(shake,FixShake)
#else
#ifndef LMP_FIX_SHAKE_H
#define LMP_FIX_SHAKE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixShake : public Fix {
public:
FixShake(class LAMMPS *, int, char **);
~FixShake();
int setmask();
void init();
void setup(int);
void pre_neighbor();
void post_force(int);
void post_force_respa(int, int, int);
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
void set_arrays(int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int dof(int);
void reset_dt();
private:
int me,nprocs;
double tolerance; // SHAKE tolerance
int max_iter; // max # of SHAKE iterations
int output_every; // SHAKE stat output every so often
bigint next_output; // timestep for next output
// settings from input command
int *bond_flag,*angle_flag; // bond/angle types to constrain
int *type_flag; // constrain bonds to these types
double *mass_list; // constrain bonds to these masses
int nmass; // # of masses in mass_list
double *bond_distance,*angle_distance; // constraint distances
int ifix_respa; // rRESPA fix needed by SHAKE
int nlevels_respa; // copies of needed rRESPA variables
int *loop_respa;
double *step_respa;
double **x,**v,**f; // local ptrs to atom class quantities
double *mass,*rmass;
int *type;
int nlocal;
// atom-based arrays
int *shake_flag; // 0 if atom not in SHAKE cluster
// 1 = size 3 angle cluster
// 2,3,4 = size of bond-only cluster
int **shake_atom; // global IDs of atoms in cluster
// central atom is 1st
// lowest global ID is 1st for size 2
int **shake_type; // bondtype of each bond in cluster
// for angle cluster, 3rd value
// is angletype
double **xshake; // unconstrained atom coords
int vflag; // virial flag
double dtv,dtfsq; // timesteps for trial move
double dtf_inner,dtf_innerhalf; // timesteps for rRESPA trial move
int *list; // list of clusters to SHAKE
int nlist,maxlist; // size and max-size of list
// stat quantities
int *b_count,*b_count_all; // counts for each bond type
double *b_ave,*b_max,*b_min; // ave/max/min dist for each bond type
double *b_ave_all,*b_max_all,*b_min_all; // MPI summing arrays
int *a_count,*a_count_all; // ditto for angle types
double *a_ave,*a_max,*a_min;
double *a_ave_all,*a_max_all,*a_min_all;
void find_clusters();
int masscheck(double);
void unconstrained_update();
void unconstrained_update_respa(int);
void shake2(int);
void shake3(int);
void shake4(int);
void shake3angle(int);
void stats();
int bondfind(int, int, int);
int anglefind(int, int, int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Cannot use fix shake with non-molecular system
+
+Your choice of atom style does not have bonds.
+
+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: Invalid bond type index for fix shake
+
+Self-explanatory. Check the fix shake command in the input script.
+
+E: Invalid angle type index for fix shake
+
+Self-explanatory.
+
+E: Invalid atom type index for fix shake
+
+Atom types must range from 1 to Ntypes inclusive.
+
+E: Invalid atom mass for fix shake
+
+Mass specified in fix shake command must be > 0.0.
+
+E: Too many masses for fix shake
+
+The fix shake command cannot list more masses than there are atom
+types.
+
+E: More than one fix shake
+
+Only one fix shake can be defined.
+
+E: Fix shake cannot be used with minimization
+
+Cannot use fix shake while doing an energy minimization since
+it turns off bonds that should contribute to the energy.
+
+E: Shake fix must come before NPT/NPH fix
+
+NPT fix must be defined in input script after SHAKE fix, else the
+SHAKE fix contribution to the pressure virial is incorrect.
+
+E: Bond potential must be defined for SHAKE
+
+Cannot use fix shake unless bond potential is defined.
+
+E: Angle potential must be defined for SHAKE
+
+When shaking angles, an angle_style potential must be used.
+
+E: Shake angles have different bond types
+
+All 3-atom angle-constrained SHAKE clusters specified by the fix shake
+command that are the same angle type, must also have the same bond
+types for the 2 bonds in the angle.
+
+E: Shake atoms %d %d missing on proc %d at step %ld
+
+The 2 atoms in a single shake cluster specified by the fix shake
+command are not all accessible to a processor. This probably means
+an atom has moved too far. :dd
+
+E: Shake atoms %d %d %d missing on proc %d at step %ld
+
+The 3 atoms in a single shake cluster specified by the fix shake
+command are not all accessible to a processor. This probably means
+an atom has moved too far. :dd
+
+E: Shake atoms %d %d %d %d missing on proc %d at step %ld
+
+The 4 atoms in a single shake cluster specified by the fix shake
+command are not all accessible to a processor. This probably means
+an atom has moved too far. :dd
+
+E: Did not find fix shake partner info
+
+Could not find bond partners implied by fix shake command. This error
+can be triggered if the delete_bonds command was used before fix
+shake, and it removed bonds without resetting the 1-2, 1-3, 1-4
+weighting list via the special keyword.
+
+E: Shake cluster of more than 4 atoms
+
+A single cluster specified by the fix shake command can have no more
+than 4 atoms.
+
+E: Shake clusters are connected
+
+A single cluster specified by the fix shake command must have a single
+central atom with up to 3 other atoms bonded to it.
+
+W: Shake determinant < 0.0
+
+The determinant of the quadratic equation being solved for a single
+cluster specified by the fix shake command is numerically suspect. LAMMPS
+will set it to 0.0 and continue.
+
+E: Shake determinant = 0.0
+
+The determinant of the matrix being solved for a single cluster
+specified by the fix shake command is numerically invalid.
+
+*/
diff --git a/src/fix_shear_history.h b/src/fix_shear_history.h
index 770eb8e06..8eaafdb76 100644
--- a/src/fix_shear_history.h
+++ b/src/fix_shear_history.h
@@ -1,64 +1,79 @@
/* ----------------------------------------------------------------------
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(SHEAR_HISTORY,FixShearHistory)
#else
#ifndef LMP_FIX_SHEAR_HISTORY_H
#define LMP_FIX_SHEAR_HISTORY_H
#include "fix.h"
namespace LAMMPS_NS {
class FixShearHistory : public Fix {
friend class Neighbor;
friend class PairGranHookeHistory;
friend class FixPour;
// for OpenMP support
friend class PairGranHookeHistoryOMP;
public:
FixShearHistory(class LAMMPS *, int, char **);
~FixShearHistory();
int setmask();
void init();
void setup_pre_exchange();
virtual void pre_exchange();
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
void set_arrays(int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
protected:
int *npartner; // # of touching partners of each atom
int **partner; // tags for the partners
double ***shearpartner; // 3 shear values with the partner
class Pair *pair;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Pair style granular with history requires atoms have IDs
+
+Atoms in the simulation do not have IDs, so history effects
+cannot be tracked by the granular pair potential.
+
+E: Too many touching neighbors - boost MAXTOUCH
+
+A granular simulation has too many neighbors touching one atom. The
+MAXTOUCH parameter in fix_shear_history.cpp must be set larger and
+LAMMPS must be re-built.
+
+*/
diff --git a/src/fix_spring.h b/src/fix_spring.h
index 904829536..92b5fb667 100644
--- a/src/fix_spring.h
+++ b/src/fix_spring.h
@@ -1,60 +1,82 @@
/* ----------------------------------------------------------------------
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(spring,FixSpring)
#else
#ifndef LMP_FIX_SPRING_H
#define LMP_FIX_SPRING_H
#include "fix.h"
namespace LAMMPS_NS {
class FixSpring : public Fix {
public:
FixSpring(class LAMMPS *, int, char **);
~FixSpring();
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:
double xc,yc,zc,r0;
double k_spring;
int xflag,yflag,zflag;
int styleflag;
char *group2;
int igroup2,group2bit;
double masstotal,masstotal2;
int nlevels_respa;
double espring,ftotal[4];
int force_flag;
void spring_tether();
void spring_couple();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: R0 < 0 for fix spring command
+
+Equilibrium spring length is invalid.
+
+E: Fix spring couple group ID does not exist
+
+Self-explanatory.
+
+E: Two groups cannot be the same in fix spring couple
+
+Self-explanatory.
+
+*/
diff --git a/src/fix_spring_rg.h b/src/fix_spring_rg.h
index ec7b60916..9abc90fbd 100644
--- a/src/fix_spring_rg.h
+++ b/src/fix_spring_rg.h
@@ -1,44 +1,54 @@
/* ----------------------------------------------------------------------
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(spring/rg,FixSpringRG)
#else
#ifndef LMP_FIX_SPRING_RG_H
#define LMP_FIX_SPRING_RG_H
#include "fix.h"
namespace LAMMPS_NS {
class FixSpringRG : public Fix {
public:
FixSpringRG(class LAMMPS *, int, char **);
int setmask();
void init();
void setup(int);
void post_force(int);
void post_force_respa(int, int, int);
private:
int nlevels_respa,rg0_flag;
double rg0,k,masstotal;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/fix_spring_self.h b/src/fix_spring_self.h
index b6376b122..379866a0b 100644
--- a/src/fix_spring_self.h
+++ b/src/fix_spring_self.h
@@ -1,60 +1,70 @@
/* ----------------------------------------------------------------------
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(spring/self,FixSpringSelf)
#else
#ifndef LMP_FIX_SPRING_SELF_H
#define LMP_FIX_SPRING_SELF_H
#include "fix.h"
namespace LAMMPS_NS {
class FixSpringSelf : public Fix {
public:
FixSpringSelf(class LAMMPS *, int, char **);
~FixSpringSelf();
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 memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
private:
double k,espring;
double **xoriginal; // original coords of atoms
int xflag, yflag, zflag;
int nlevels_respa;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/fix_store_force.h b/src/fix_store_force.h
index fca59f50c..cced61884 100644
--- a/src/fix_store_force.h
+++ b/src/fix_store_force.h
@@ -1,49 +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.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(store/force,FixStoreForce)
#else
#ifndef LMP_FIX_STORE_FORCE_H
#define LMP_FIX_STORE_FORCE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixStoreForce : public Fix {
public:
FixStoreForce(class LAMMPS *, int, char **);
~FixStoreForce();
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 memory_usage();
private:
int nlevels_respa;
int nmax;
double **foriginal; // stored force on atoms
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/fix_store_state.h b/src/fix_store_state.h
index 11d83366a..807c55af1 100644
--- a/src/fix_store_state.h
+++ b/src/fix_store_state.h
@@ -1,111 +1,180 @@
/* ----------------------------------------------------------------------
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(store/state,FixStoreState)
#else
#ifndef LMP_FIX_STORE_STATE_H
#define LMP_FIX_STORE_STATE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixStoreState : public Fix {
public:
FixStoreState(class LAMMPS *, int, char **);
~FixStoreState();
int setmask();
void init();
void setup(int);
void end_of_step();
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
private:
int nvalues;
int *which,*argindex,*value2index;
char **ids;
double **values; // archived atom properties
double *vbuf; // 1d ptr to values
int comflag;
double cm[3]; // center of mass
int kflag,cfv_flag,firstflag;
int cfv_any; // 1 if any compute/fix/variable specified
typedef void (FixStoreState::*FnPtrPack)(int);
FnPtrPack *pack_choice; // ptrs to pack functions
void pack_id(int);
void pack_molecule(int);
void pack_type(int);
void pack_mass(int);
void pack_x(int);
void pack_y(int);
void pack_z(int);
void pack_xs(int);
void pack_ys(int);
void pack_zs(int);
void pack_xs_triclinic(int);
void pack_ys_triclinic(int);
void pack_zs_triclinic(int);
void pack_xu(int);
void pack_yu(int);
void pack_zu(int);
void pack_xu_triclinic(int);
void pack_yu_triclinic(int);
void pack_zu_triclinic(int);
void pack_ix(int);
void pack_iy(int);
void pack_iz(int);
void pack_vx(int);
void pack_vy(int);
void pack_vz(int);
void pack_fx(int);
void pack_fy(int);
void pack_fz(int);
void pack_q(int);
void pack_mux(int);
void pack_muy(int);
void pack_muz(int);
void pack_radius(int);
void pack_omegax(int);
void pack_omegay(int);
void pack_omegaz(int);
void pack_angmomx(int);
void pack_angmomy(int);
void pack_angmomz(int);
void pack_tqx(int);
void pack_tqy(int);
void pack_tqz(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix store/state for atom property that isn't allocated
+
+Self-explanatory.
+
+E: Compute ID for fix store/state does not exist
+
+Self-explanatory.
+
+E: Fix store/state compute does not calculate per-atom values
+
+Computes that calculate global or local quantities cannot be used
+with fix store/state.
+
+E: Fix store/state compute does not calculate a per-atom vector
+
+The compute calculates a per-atom vector.
+
+E: Fix store/state compute does not calculate a per-atom array
+
+The compute calculates a per-atom vector.
+
+E: Fix store/state compute array is accessed out-of-range
+
+Self-explanatory.
+
+E: Fix ID for fix store/state does not exist
+
+Self-explanatory
+
+E: Fix store/state fix does not calculate per-atom values
+
+Fixes that calculate global or local quantities cannot be used with
+fix store/state.
+
+E: Fix store/state fix does not calculate a per-atom vector
+
+The fix calculates a per-atom array.
+
+E: Fix store/state fix does not calculate a per-atom array
+
+The fix calculates a per-atom vector.
+
+E: Fix store/state fix array is accessed out-of-range
+
+Self-explanatory.
+
+E: Fix for fix store/state not computed at compatible time
+
+Fixes generate their values on specific timesteps. Fix store/state
+is requesting a value on a non-allowed timestep.
+
+E: Variable name for fix store/state does not exist
+
+Self-explanatory.
+
+E: Fix store/state variable is not atom-style variable
+
+Only atom-style variables calculate per-atom quantities.
+
+*/
diff --git a/src/fix_temp_berendsen.h b/src/fix_temp_berendsen.h
index 718738367..7a1df6677 100644
--- a/src/fix_temp_berendsen.h
+++ b/src/fix_temp_berendsen.h
@@ -1,51 +1,87 @@
/* ----------------------------------------------------------------------
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(temp/berendsen,FixTempBerendsen)
#else
#ifndef LMP_FIX_TEMP_BERENDSEN_H
#define LMP_FIX_TEMP_BERENDSEN_H
#include "fix.h"
namespace LAMMPS_NS {
class FixTempBerendsen : public Fix {
public:
FixTempBerendsen(class LAMMPS *, int, char **);
~FixTempBerendsen();
int setmask();
void init();
void end_of_step();
int modify_param(int, char **);
void reset_target(double);
double compute_scalar();
private:
int which;
double t_start,t_stop,t_period;
double energy;
char *id_temp;
class Compute *temperature;
int tflag;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix temp/berendsen period must be > 0.0
+
+Self-explanatory.
+
+E: Temperature ID for fix temp/berendsen does not exist
+
+Self-explanatory.
+
+E: Computed temperature for fix temp/berendsen cannot be 0.0
+
+Self-explanatory.
+
+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: Group for fix_modify temp != fix group
+
+The fix_modify command is specifying a temperature computation that
+computes a temperature on a different group of atoms than the fix
+itself operates on. This is probably not what you want to do.
+
+*/
diff --git a/src/fix_temp_rescale.h b/src/fix_temp_rescale.h
index bd87e516b..d02cd4760 100644
--- a/src/fix_temp_rescale.h
+++ b/src/fix_temp_rescale.h
@@ -1,51 +1,84 @@
/* ----------------------------------------------------------------------
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(temp/rescale,FixTempRescale)
#else
#ifndef LMP_FIX_TEMP_RESCALE_H
#define LMP_FIX_TEMP_RESCALE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixTempRescale : public Fix {
public:
FixTempRescale(class LAMMPS *, int, char **);
virtual ~FixTempRescale();
int setmask();
void init();
virtual void end_of_step();
int modify_param(int, char **);
void reset_target(double);
double compute_scalar();
protected:
int which;
double t_start,t_stop,t_window;
double fraction,energy,efactor;
char *id_temp;
class Compute *temperature;
int tflag;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Temperature ID for fix temp/rescale does not exist
+
+Self-explanatory.
+
+E: Computed temperature for fix temp/rescale cannot be 0.0
+
+Cannot rescale the temperature to a new value if the current
+temperature is 0.0.
+
+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: Group for fix_modify temp != fix group
+
+The fix_modify command is specifying a temperature computation that
+computes a temperature on a different group of atoms than the fix
+itself operates on. This is probably not what you want to do.
+
+*/
diff --git a/src/fix_thermal_conductivity.h b/src/fix_thermal_conductivity.h
index ed9117ca9..752876247 100644
--- a/src/fix_thermal_conductivity.h
+++ b/src/fix_thermal_conductivity.h
@@ -1,52 +1,75 @@
/* ----------------------------------------------------------------------
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(thermal/conductivity,FixThermalConductivity)
#else
#ifndef LMP_FIX_THERMAL_CONDUCTIVITY_H
#define LMP_FIX_THERMAL_CONDUCTIVITY_H
#include "fix.h"
namespace LAMMPS_NS {
class FixThermalConductivity : public Fix {
public:
FixThermalConductivity(class LAMMPS *, int, char **);
~FixThermalConductivity();
int setmask();
void init();
void end_of_step();
double compute_scalar();
private:
int me;
int edim,nbin,periodicity;
int nswap;
double prd,boxlo,boxhi;
double slablo_lo,slablo_hi,slabhi_lo,slabhi_hi;
double e_exchange;
int nlo,nhi;
int *index_lo,*index_hi;
double *ke_lo,*ke_hi;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix thermal/conductivity swap value must be positive
+
+Self-explanatory.
+
+W: Fix thermal/conductivity comes before fix ave/spatial
+
+The order of these 2 fixes in your input script is such that fix
+thermal/conductivity comes first. If you are using fix ave/spatial to
+measure the temperature profile induced by fix viscosity, then this
+may cause a glitch in the profile since you are averaging immediately
+after swaps have occurred. Flipping the order of the 2 fixes
+typically helps.
+
+*/
diff --git a/src/fix_tmd.h b/src/fix_tmd.h
index ee4a723d8..49768293e 100644
--- a/src/fix_tmd.h
+++ b/src/fix_tmd.h
@@ -1,62 +1,109 @@
/* ----------------------------------------------------------------------
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(tmd,FixTMD)
#else
#ifndef LMP_FIX_TMD_H
#define LMP_FIX_TMD_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
class FixTMD : public Fix {
public:
FixTMD(class LAMMPS *, int, char **);
~FixTMD();
int setmask();
void init();
void initial_integrate(int);
void initial_integrate_respa(int, int, int);
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
void reset_dt();
private:
int me;
int nfileevery,compressed;
bigint previous_stat;
FILE *fp;
double rho_start,rho_stop,rho_old,masstotal;
double dtv,dtf;
double *step_respa;
double work_lambda,work_analytical;
double **xf,**xold;
void readfile(char *);
void open(char *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot use fix TMD unless atom map exists
+
+Using this fix requires the ability to lookup an atom index, which is
+provided by an atom map. An atom map does not exist (by default) for
+non-molecular problems. Using the atom_modify map command will force
+an atom map to be created.
+
+E: Cannot open fix tmd file %s
+
+The output file for the fix tmd command cannot be opened. Check that
+the path and name are correct.
+
+E: Fix tmd must come after integration fixes
+
+Any fix tmd command must appear in the input script after all time
+integration fixes (nve, nvt, npt). See the fix tmd documentation for
+details.
+
+E: Incorrect format in TMD target file
+
+Format of file read by fix tmd command is incorrect.
+
+E: TMD target file did not list all group atoms
+
+The target file for the fix tmd command did not list all atoms in the
+fix group.
+
+E: Cannot open gzipped file
+
+LAMMPS is attempting to open a gzipped version of the specified file
+but was unsuccessful. Check that the path and name are correct.
+
+E: Cannot open file %s
+
+The specified file cannot be opened. Check that the path and name are
+correct.
+
+*/
diff --git a/src/fix_ttm.h b/src/fix_ttm.h
index f02e3abfe..6669e21d6 100644
--- a/src/fix_ttm.h
+++ b/src/fix_ttm.h
@@ -1,76 +1,156 @@
/* ----------------------------------------------------------------------
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(ttm,FixTTM)
#else
#ifndef LMP_FIX_TTM_H
#define LMP_FIX_TTM_H
#include "fix.h"
namespace LAMMPS_NS {
class FixTTM : public Fix {
public:
FixTTM(class LAMMPS *, int, char **);
~FixTTM();
int setmask();
void init();
void setup(int);
void post_force(int);
void post_force_respa(int, int, int);
void post_force_setup(int);
void post_force_respa_setup(int, int, int);
void end_of_step();
void reset_dt();
void write_restart(FILE *);
void restart(char *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
double memory_usage();
void grow_arrays(int);
double compute_vector(int);
private:
int me;
int nfileevery;
int nlevels_respa;
int seed;
class RanMars *random;
FILE *fp,*fpr;
int nxnodes,nynodes,nznodes,total_nnodes;
int ***nsum;
int ***nsum_all,***T_initial_set;
double *gfactor1,*gfactor2,*ratio;
double **flangevin;
double ***T_electron,***T_electron_old;
double ***sum_vsq,***sum_mass_vsq;
double ***sum_vsq_all,***sum_mass_vsq_all;
double ***net_energy_transfer,***net_energy_transfer_all;
double electronic_specific_heat,electronic_density;
double electronic_thermal_conductivity;
double gamma_p,gamma_s,v_0,v_0_sq;
void read_initial_electron_temperatures();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot open file %s
+
+The specified file cannot be opened. Check that the path and name are
+correct.
+
+E: Cannot open fix ttm file %s
+
+The output file for the fix ttm command cannot be opened. Check that
+the path and name are correct.
+
+E: Invalid random number seed in fix ttm command
+
+Random number seed must be > 0.
+
+E: Fix ttm electronic_specific_heat must be > 0.0
+
+Self-explanatory.
+
+E: Fix ttm electronic_density must be > 0.0
+
+Self-explanatory.
+
+E: Fix ttm electronic_thermal_conductivity must be >= 0.0
+
+Self-explanatory.
+
+E: Fix ttm gamma_p must be > 0.0
+
+Self-explanatory.
+
+E: Fix ttm gamma_s must be >= 0.0
+
+Self-explanatory.
+
+E: Fix ttm v_0 must be >= 0.0
+
+Self-explanatory.
+
+E: Fix ttm number of nodes must be > 0
+
+Self-explanatory.
+
+E: Cannot use fix ttm with 2d simulation
+
+This is a current restriction of this fix due to the grid it creates.
+
+E: Cannot use nonperiodic boundares with fix ttm
+
+This fix requires a fully periodic simulation box.
+
+E: Cannot use fix ttm with triclinic box
+
+This is a current restriction of this fix due to the grid it creates.
+
+E: Electronic temperature dropped below zero
+
+Something has gone wrong with the fix ttm electron temperature model.
+
+E: Fix ttm electron temperatures must be > 0.0
+
+Self-explanatory.
+
+E: Initial temperatures not all set in fix ttm
+
+Self-explantory.
+
+W: Too many inner timesteps in fix ttm
+
+Self-explanatory.
+
+*/
diff --git a/src/fix_viscosity.h b/src/fix_viscosity.h
index fc62d4b32..46ae4727a 100644
--- a/src/fix_viscosity.h
+++ b/src/fix_viscosity.h
@@ -1,53 +1,80 @@
/* ----------------------------------------------------------------------
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(viscosity,FixViscosity)
#else
#ifndef LMP_FIX_VISCOSITY_H
#define LMP_FIX_VISCOSITY_H
#include "fix.h"
namespace LAMMPS_NS {
class FixViscosity : public Fix {
public:
FixViscosity(class LAMMPS *, int, char **);
~FixViscosity();
int setmask();
void init();
void end_of_step();
double compute_scalar();
private:
int me;
int vdim,pdim,nbin,periodicity;
int nswap;
double vtarget;
double prd,boxlo,boxhi;
double slablo_lo,slablo_hi,slabhi_lo,slabhi_hi;
double p_exchange;
int npositive,nnegative;
int *pos_index,*neg_index;
double *pos_delta,*neg_delta;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Fix viscosity swap value must be positive
+
+Self-explanatory.
+
+E: Fix viscosity vtarget value must be positive
+
+Self-explanatory.
+
+W: Fix viscosity comes before fix ave/spatial
+
+The order of these 2 fixes in your input script is such that
+fix viscosity comes first. If you are using fix ave/spatial
+to measure the velocity profile induced by fix viscosity, then
+this may cause a glitch in the profile since you are averaging
+immediately after swaps have occurred. Flipping the order
+of the 2 fixes typically helps.
+
+*/
diff --git a/src/fix_viscous.h b/src/fix_viscous.h
index de2c5156e..06b67c129 100644
--- a/src/fix_viscous.h
+++ b/src/fix_viscous.h
@@ -1,47 +1,57 @@
/* ----------------------------------------------------------------------
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(viscous,FixViscous)
#else
#ifndef LMP_FIX_VISCOUS_H
#define LMP_FIX_VISCOUS_H
#include "fix.h"
namespace LAMMPS_NS {
class FixViscous : public Fix {
public:
FixViscous(class LAMMPS *, int, char **);
virtual ~FixViscous();
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);
protected:
double *gamma;
int nlevels_respa;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/fix_wall.h b/src/fix_wall.h
index 9c2bd5ed2..4d78587ab 100644
--- a/src/fix_wall.h
+++ b/src/fix_wall.h
@@ -1,55 +1,94 @@
/* ----------------------------------------------------------------------
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_WALL_H
#define LMP_FIX_WALL_H
#include "fix.h"
namespace LAMMPS_NS {
class FixWall : public Fix {
public:
FixWall(class LAMMPS *, int, char **);
virtual ~FixWall();
int setmask();
virtual void init();
void setup(int);
void min_setup(int);
void pre_force(int);
void post_force(int);
void post_force_respa(int, int, int);
void min_post_force(int);
double compute_scalar();
double compute_vector(int);
virtual void precompute(int) = 0;
virtual void wall_particle(int, int, double) = 0;
protected:
int nwall;
int wallwhich[6],wallstyle[6];
double coord0[6],epsilon[6],sigma[6],cutoff[6];
char *varstr[6];
int varindex[6];
int eflag,varflag;
double ewall[7],ewall_all[7];
double xscale,yscale,zscale;
int nlevels_respa;
double dt;
int fldflag;
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+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: Wall defined twice in fix wall command
+
+Self-explanatory.
+
+E: Fix wall cutoff <= 0.0
+
+Self-explanatory.
+
+E: Cannot use fix wall in periodic dimension
+
+Self-explanatory.
+
+E: Cannot use fix wall zlo/zhi for a 2d simulation
+
+Self-explanatory.
+
+E: Use of fix wall with undefined lattice
+
+Must use lattice command with fix wall command if units option is set
+to lattice.
+
+E: Variable name for fix wall does not exist
+
+Self-explanatory.
+
+E: Variable for fix wall is invalid style
+
+Only equal-style variables can be used.
+
+*/
diff --git a/src/fix_wall_harmonic.h b/src/fix_wall_harmonic.h
index a5aa575e0..23947b4e6 100644
--- a/src/fix_wall_harmonic.h
+++ b/src/fix_wall_harmonic.h
@@ -1,40 +1,49 @@
/* ----------------------------------------------------------------------
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(wall/harmonic,FixWallHarmonic)
#else
#ifndef LMP_FIX_WALL_HARMONIC_H
#define LMP_FIX_WALL_HARMONIC_H
#include "fix_wall.h"
namespace LAMMPS_NS {
class FixWallHarmonic : public FixWall {
public:
FixWallHarmonic(class LAMMPS *, int, char **);
void precompute(int) {}
void wall_particle(int, int, double);
private:
double offset[6];
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Particle on or inside fix wall surface
+
+Particles must be "exterior" to the wall in order for energy/force to
+be calculated.
+
+*/
diff --git a/src/fix_wall_lj126.h b/src/fix_wall_lj126.h
index 882efbafd..37fb89446 100644
--- a/src/fix_wall_lj126.h
+++ b/src/fix_wall_lj126.h
@@ -1,40 +1,49 @@
/* ----------------------------------------------------------------------
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(wall/lj126,FixWallLJ126)
#else
#ifndef LMP_FIX_WALL_LJ126_H
#define LMP_FIX_WALL_LJ126_H
#include "fix_wall.h"
namespace LAMMPS_NS {
class FixWallLJ126 : public FixWall {
public:
FixWallLJ126(class LAMMPS *, int, char **);
void precompute(int);
void wall_particle(int, int, double);
private:
double coeff1[6],coeff2[6],coeff3[6],coeff4[6],offset[6];
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Particle on or inside fix wall surface
+
+Particles must be "exterior" to the wall in order for energy/force to
+be calculated.
+
+*/
diff --git a/src/fix_wall_lj93.h b/src/fix_wall_lj93.h
index 78df357c6..30e2788c0 100644
--- a/src/fix_wall_lj93.h
+++ b/src/fix_wall_lj93.h
@@ -1,40 +1,49 @@
/* ----------------------------------------------------------------------
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(wall/lj93,FixWallLJ93)
#else
#ifndef LMP_FIX_WALL_LJ93_H
#define LMP_FIX_WALL_LJ93_H
#include "fix_wall.h"
namespace LAMMPS_NS {
class FixWallLJ93 : public FixWall {
public:
FixWallLJ93(class LAMMPS *, int, char **);
void precompute(int);
void wall_particle(int, int, double);
private:
double coeff1[6],coeff2[6],coeff3[6],coeff4[6],offset[6];
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Particle on or inside fix wall surface
+
+Particles must be "exterior" to the wall in order for energy/force to
+be calculated.
+
+*/
diff --git a/src/fix_wall_reflect.h b/src/fix_wall_reflect.h
index 2345a4b19..475c4a338 100644
--- a/src/fix_wall_reflect.h
+++ b/src/fix_wall_reflect.h
@@ -1,48 +1,87 @@
/* ----------------------------------------------------------------------
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(wall/reflect,FixWallReflect)
#else
#ifndef LMP_FIX_WALL_REFLECT_H
#define LMP_FIX_WALL_REFLECT_H
#include "fix.h"
namespace LAMMPS_NS {
class FixWallReflect : public Fix {
public:
FixWallReflect(class LAMMPS *, int, char **);
virtual ~FixWallReflect();
int setmask();
void init();
void post_integrate();
protected:
int nwall;
int wallwhich[6],wallstyle[6];
double coord0[6];
char *varstr[6];
int varindex[6];
int varflag;
double xscale,yscale,zscale;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Wall defined twice in fix wall/reflect command
+
+Self-explanatory.
+
+E: Cannot use fix wall/reflect in periodic dimension
+
+Self-explanatory.
+
+E: Cannot use fix wall/reflect zlo/zhi for a 2d simulation
+
+Self-explanatory.
+
+E: Use of fix wall with undefined lattice
+
+Must use lattice command with fix wall command if units option is set
+to lattice.
+
+E: Variable name for fix wall/reflect does not exist
+
+Self-explanatory.
+
+E: Variable for fix wall/reflect is invalid style
+
+Only equal-style variables can be used.
+
+W: Should not allow rigid bodies to bounce off relecting walls
+
+LAMMPS allows this, but their dynamics are not computed correctly.
+
+*/
diff --git a/src/fix_wall_region.h b/src/fix_wall_region.h
index 03bc4b8b4..d1cc21a6a 100644
--- a/src/fix_wall_region.h
+++ b/src/fix_wall_region.h
@@ -1,62 +1,93 @@
/* ----------------------------------------------------------------------
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(wall/region,FixWallRegion)
#else
#ifndef LMP_FIX_WALL_REGION_H
#define LMP_FIX_WALL_REGION_H
#include "fix.h"
namespace LAMMPS_NS {
class FixWallRegion : public Fix {
public:
FixWallRegion(class LAMMPS *, int, char **);
~FixWallRegion();
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 style,iregion;
double epsilon,sigma,cutoff;
int eflag;
double ewall[4],ewall_all[4];
int nlevels_respa;
double dt;
char *idregion;
double coeff1,coeff2,coeff3,coeff4,offset;
double eng,fwall;
void lj93(double);
void lj126(double);
void colloid(double, double);
void harmonic(double);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Region ID for fix wall/region does not exist
+
+Self-explanatory.
+
+E: Fix wall/region cutoff <= 0.0
+
+Self-explanatory.
+
+E: Fix wall/region colloid requires atom style sphere
+
+UNDOCUMENTED
+
+E: Fix wall/region colloid requires extended particles
+
+Self-explanatory.
+
+E: Particle on or inside surface of region used in fix wall/region
+
+Particles must be "exterior" to the region surface in order for
+energy/force to be calculated.
+
+*/
diff --git a/src/force.h b/src/force.h
index bafa38acf..efdca6d1e 100644
--- a/src/force.h
+++ b/src/force.h
@@ -1,102 +1,148 @@
/* ----------------------------------------------------------------------
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_FORCE_H
#define LMP_FORCE_H
#include "pointers.h"
namespace LAMMPS_NS {
class Force : protected Pointers {
public:
double boltz; // Boltzmann constant (eng/degree-K)
double hplanck; // Planck's constant (energy-time)
double mvv2e; // conversion of mv^2 to energy
double ftm2v; // conversion of ft/m to velocity
double mv2d; // conversion of mass/volume to density
double nktv2p; // conversion of NkT/V to pressure
double qqr2e; // conversion of q^2/r to energy
double qe2f; // conversion of qE to force
double vxmu2f; // conversion of vx dynamic-visc to force
double xxt2kmu; // conversion of xx/t to kinematic-visc
double dielectric; // dielectric constant
double qqrd2e; // q^2/r to energy w/ dielectric constant
double e_mass; // electron mass
double hhmrr2e; // conversion of (hbar)^2/(mr^2) to energy
double mvh2r; // conversion of mv/hbar to distance
// hbar = h/(2*pi)
int newton,newton_pair,newton_bond; // Newton's 3rd law settings
class Pair *pair;
char *pair_style;
class Bond *bond;
char *bond_style;
class Angle *angle;
char *angle_style;
class Dihedral *dihedral;
char *dihedral_style;
class Improper *improper;
char *improper_style;
class KSpace *kspace;
char *kspace_style;
// index [0] is not used in these arrays
double special_lj[4]; // 1-2, 1-3, 1-4 prefactors for LJ
double special_coul[4]; // 1-2, 1-3, 1-4 prefactors for Coulombics
int special_angle; // 0 if defined angles are ignored
// 1 if only weight 1,3 atoms if in an angle
int special_dihedral; // 0 if defined dihedrals are ignored
// 1 if only weight 1,4 atoms if in a dihedral
int special_extra; // extra space for added bonds
Force(class LAMMPS *);
~Force();
void init();
void create_pair(const char *, const char *suffix = NULL);
class Pair *new_pair(const char *, const char *, int &);
class Pair *pair_match(const char *, int);
void create_bond(const char *, const char *suffix = NULL);
class Bond *new_bond(const char *, const char *, int &);
class Bond *bond_match(const char *);
void create_angle(const char *, const char *suffix = NULL);
class Angle *new_angle(const char *, const char *, int &);
void create_dihedral(const char *, const char *suffix = NULL);
class Dihedral *new_dihedral(const char *, const char *, int &);
void create_improper(const char *, const char *suffix = NULL);
class Improper *new_improper(const char *, const char *, int &);
void create_kspace(int, char **, const char *suffix = NULL);
class KSpace *new_kspace(int, char **, const char *, int &);
class KSpace *kspace_match(const char *, int);
void set_special(int, char **);
void bounds(char *, int, int &, int &);
double numeric(char *);
int inumeric(char *);
bigint memory_usage();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Invalid pair style
+
+The choice of pair style is unknown.
+
+E: Invalid bond style
+
+The choice of bond style is unknown.
+
+E: Invalid angle style
+
+The choice of angle style is unknown.
+
+E: Invalid dihedral style
+
+The choice of dihedral style is unknown.
+
+E: Invalid improper style
+
+The choice of improper style is unknown.
+
+E: Invalid kspace style
+
+The choice of kspace style is unknown.
+
+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: Numeric index is out of bounds
+
+UNDOCUMENTED
+
+E: Expected floating point parameter in input script or data file
+
+The quantity being read is an integer on non-numeric value.
+
+E: Expected integer parameter in input script or data file
+
+The quantity being read is a floating point or non-numeric value.
+
+*/
diff --git a/src/group.h b/src/group.h
index da9e2e0c4..6c3ea74bc 100644
--- a/src/group.h
+++ b/src/group.h
@@ -1,71 +1,123 @@
/* ----------------------------------------------------------------------
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_GROUP_H
#define LMP_GROUP_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class Group : protected Pointers {
public:
int ngroup; // # of defined groups
char **names; // name of each group
int *bitmask; // one-bit mask for each group
int *inversemask; // inverse mask for each group
Group(class LAMMPS *);
~Group();
void assign(int, char **); // assign atoms to a group
void create(char *, int *); // add flagged atoms to a group
int find(const char *); // lookup name in list of groups
void write_restart(FILE *);
void read_restart(FILE *);
bigint count(int); // count atoms in group
bigint count(int,int); // count atoms in group & region
double mass(int); // total mass of atoms in group
double mass(int,int);
double charge(int); // total charge of atoms in group
double charge(int,int);
void bounds(int, double *); // bounds of atoms in group
void bounds(int, double *, int);
void xcm(int, double, double *); // center-of-mass coords of group
void xcm(int, double, double *, int);
void vcm(int, double, double *); // center-of-mass velocity of group
void vcm(int, double, double *, int);
void fcm(int, double *); // total force on group
void fcm(int, double *, int);
double ke(int); // kinetic energy of group
double ke(int, int);
double gyration(int, double, double *); // radius-of-gyration of group
double gyration(int, double, double *, int);
void angmom(int, double *, double *); // angular momentum of group
void angmom(int, double *, double *, int);
void torque(int, double *, double *); // torque on group
void torque(int, double *, double *, int);
void inertia(int, double *, double [3][3]); // inertia tensor
void inertia(int, double *, double [3][3], int);
void omega(double *, double [3][3], double *); // angular velocity
private:
int me;
int find_unused();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Group command before simulation box is defined
+
+The group command cannot be used before a read_data, read_restart, or
+create_box command.
+
+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 group delete group ID
+
+Self-explanatory.
+
+E: Cannot delete group all
+
+Self-explanatory.
+
+E: Cannot delete group currently used by a fix
+
+Self-explanatory.
+
+E: Cannot delete group currently used by a compute
+
+Self-explanatory.
+
+E: Cannot delete group currently used by a dump
+
+Self-explanatory.
+
+E: Cannot delete group currently used by atom_modify first
+
+Self-explanatory.
+
+E: Too many groups
+
+The maximum number of atom groups (including the "all" group) is
+given by MAX_GROUP in group.cpp and is 32.
+
+E: Group region ID does not exist
+
+A region ID used in the group command does not exist.
+
+E: Group ID does not exist
+
+A group ID used in the group command does not exist.
+
+*/
diff --git a/src/improper.h b/src/improper.h
index d766015e3..30322a483 100644
--- a/src/improper.h
+++ b/src/improper.h
@@ -1,55 +1,69 @@
/* ----------------------------------------------------------------------
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_IMPROPER_H
#define LMP_IMPROPER_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class Improper : protected Pointers {
friend class ThrOMP;
public:
int allocated;
int *setflag;
double energy; // accumulated energies
double virial[6]; // accumlated virial
double *eatom,**vatom; // accumulated per-atom energy/virial
Improper(class LAMMPS *);
virtual ~Improper();
virtual void init();
virtual void compute(int, int) = 0;
virtual void settings(int, char **) {}
virtual void coeff(int, char **) = 0;
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;
virtual double memory_usage();
protected:
int evflag;
int eflag_either,eflag_global,eflag_atom;
int vflag_either,vflag_global,vflag_atom;
int maxeatom,maxvatom;
void ev_setup(int, int);
void ev_tally(int, int, int, int, int, int, double,
double *, double *, double *, double, double, double,
double, double, double, double, double, double);
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Improper coeffs are not set
+
+No improper coefficients have been assigned in the data file or via
+the improper_coeff command.
+
+E: All improper coeffs are not set
+
+All improper coefficients must be set in the data file or by the
+improper_coeff command before running a simulation.
+
+*/
diff --git a/src/input.cpp b/src/input.cpp
index b0358004d..f04717e52 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -1,1387 +1,1387 @@
/* ----------------------------------------------------------------------
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 "mpi.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "ctype.h"
#include "unistd.h"
#include "sys/stat.h"
#include "input.h"
#include "style_command.h"
#include "universe.h"
#include "atom.h"
#include "atom_vec.h"
#include "comm.h"
#include "group.h"
#include "domain.h"
#include "output.h"
#include "thermo.h"
#include "force.h"
#include "pair.h"
#include "min.h"
#include "modify.h"
#include "compute.h"
#include "bond.h"
#include "angle.h"
#include "dihedral.h"
#include "improper.h"
#include "kspace.h"
#include "update.h"
#include "neighbor.h"
#include "special.h"
#include "variable.h"
#include "accelerator_cuda.h"
#include "error.h"
#include "memory.h"
#ifdef _OPENMP
#include "omp.h"
#endif
using namespace LAMMPS_NS;
#define MAXLINE 2048
#define DELTA 4
/* ---------------------------------------------------------------------- */
Input::Input(LAMMPS *lmp, int argc, char **argv) : Pointers(lmp)
{
MPI_Comm_rank(world,&me);
line = new char[MAXLINE];
copy = new char[MAXLINE];
work = new char[MAXLINE];
narg = maxarg = 0;
arg = NULL;
echo_screen = 0;
echo_log = 1;
label_active = 0;
labelstr = NULL;
jump_skip = 0;
if (me == 0) {
nfile = maxfile = 1;
infiles = (FILE **) memory->smalloc(sizeof(FILE *),"input:infiles");
infiles[0] = infile;
} else infiles = NULL;
variable = new Variable(lmp);
// process command-line args
// check for args "-var" and "-echo"
// caller has already checked that sufficient arguments exist
int iarg = 0;
while (iarg < argc) {
if (strcmp(argv[iarg],"-var") == 0 || strcmp(argv[iarg],"-v") == 0) {
int jarg = iarg+3;
while (jarg < argc && argv[jarg][0] != '-') jarg++;
variable->set(argv[iarg+1],jarg-iarg-2,&argv[iarg+2]);
iarg = jarg;
} else if (strcmp(argv[iarg],"-echo") == 0 ||
strcmp(argv[iarg],"-e") == 0) {
narg = 1;
char **tmp = arg; // trick echo() into using argv instead of arg
arg = &argv[iarg+1];
echo();
arg = tmp;
iarg += 2;
} else iarg++;
}
}
/* ---------------------------------------------------------------------- */
Input::~Input()
{
// don't free command and arg strings
// they just point to other allocated memory
delete variable;
delete [] line;
delete [] copy;
delete [] work;
if (labelstr) delete [] labelstr;
memory->sfree(arg);
memory->sfree(infiles);
}
/* ----------------------------------------------------------------------
process all input from infile
infile = stdin or file if command-line arg "-in" was used
------------------------------------------------------------------------- */
void Input::file()
{
int m,n;
while (1) {
// read a line from input script
// if line ends in continuation char '&', concatenate next line(s)
// n = length of line including str terminator, 0 if end of file
// m = position of last printable char in line or -1 if blank line
if (me == 0) {
m = 0;
while (1) {
if (fgets(&line[m],MAXLINE-m,infile) == NULL) n = 0;
else n = strlen(line) + 1;
if (n == 0) break;
m = n-2;
while (m >= 0 && isspace(line[m])) m--;
if (m < 0 || line[m] != '&') break;
}
}
// bcast the line
// if n = 0, end-of-file
// error if label_active is set, since label wasn't encountered
// if original input file, code is done
// else go back to previous input file
MPI_Bcast(&n,1,MPI_INT,0,world);
if (n == 0) {
if (label_active) error->all(FLERR,"Label wasn't found in input script");
if (me == 0) {
if (infile != stdin) fclose(infile);
nfile--;
}
MPI_Bcast(&nfile,1,MPI_INT,0,world);
if (nfile == 0) break;
if (me == 0) infile = infiles[nfile-1];
continue;
}
MPI_Bcast(line,n,MPI_CHAR,0,world);
// if n = MAXLINE, line is too long
if (n == MAXLINE) {
char str[MAXLINE+32];
sprintf(str,"Input line too long: %s",line);
error->all(FLERR,str);
}
// echo the command unless scanning for label
if (me == 0 && label_active == 0) {
if (echo_screen && screen) fprintf(screen,"%s",line);
if (echo_log && logfile) fprintf(logfile,"%s",line);
}
// parse the line
// if no command, skip to next line in input script
parse();
if (command == NULL) continue;
// if scanning for label, skip command unless it's a label command
if (label_active && strcmp(command,"label") != 0) continue;
// execute the command
if (execute_command()) {
char str[MAXLINE];
sprintf(str,"Unknown command: %s",line);
error->all(FLERR,str);
}
}
}
/* ----------------------------------------------------------------------
process all input from filename
------------------------------------------------------------------------- */
void Input::file(const char *filename)
{
// error if another nested file still open
// if single open file is not stdin, close it
// open new filename and set infile, infiles[0]
if (me == 0) {
if (nfile > 1)
error->one(FLERR,"Another input script is already being processed");
if (infile != stdin) fclose(infile);
infile = fopen(filename,"r");
if (infile == NULL) {
char str[128];
sprintf(str,"Cannot open input script %s",filename);
error->one(FLERR,str);
}
infiles[0] = infile;
} else infile = NULL;
file();
}
/* ----------------------------------------------------------------------
parse the command in single and execute it
return command name to caller
------------------------------------------------------------------------- */
char *Input::one(const char *single)
{
strcpy(line,single);
// echo the command unless scanning for label
if (me == 0 && label_active == 0) {
if (echo_screen && screen) fprintf(screen,"%s\n",line);
if (echo_log && logfile) fprintf(logfile,"%s\n",line);
}
// parse the line
// if no command, just return NULL
parse();
if (command == NULL) return NULL;
// if scanning for label, skip command unless it's a label command
if (label_active && strcmp(command,"label") != 0) return NULL;
// execute the command and return its name
if (execute_command()) {
char str[MAXLINE];
sprintf(str,"Unknown command: %s",line);
error->all(FLERR,str);
}
return command;
}
/* ----------------------------------------------------------------------
parse copy of command line
strip comment = all chars from # on
replace all $ via variable substitution
command = first word
narg = # of args
arg[] = individual args
treat text between single/double quotes as one arg
------------------------------------------------------------------------- */
void Input::parse()
{
// make a copy to work on
strcpy(copy,line);
// strip any # comment by resetting string terminator
// do not strip # inside single/double quotes
char quote = '\0';
char *ptr = copy;
while (*ptr) {
if (*ptr == '#' && !quote) {
*ptr = '\0';
break;
}
if (*ptr == quote) quote = '\0';
else if (*ptr == '"' || *ptr == '\'') quote = *ptr;
ptr++;
}
// perform $ variable substitution (print changes)
// except if searching for a label since earlier variable may not be defined
if (!label_active) substitute(copy,1);
// command = 1st arg
command = strtok(copy," \t\n\r\f");
if (command == NULL) return;
// point arg[] at each subsequent arg
// treat text between single/double quotes as one arg
// insert string terminators in copy to delimit args
quote = '\0';
int iarg,argstart;
narg = 0;
while (1) {
if (narg == maxarg) {
maxarg += DELTA;
arg = (char **) memory->srealloc(arg,maxarg*sizeof(char *),"input:arg");
}
arg[narg] = strtok(NULL," \t\n\r\f");
if (!arg[narg]) break;
if (!quote && (arg[narg][0] == '"' || arg[narg][0] == '\'')) {
quote = arg[narg][0];
argstart = narg;
arg[narg] = &arg[narg][1];
}
if (quote && arg[narg][strlen(arg[narg])-1] == quote) {
for (iarg = argstart; iarg < narg; iarg++)
arg[iarg][strlen(arg[iarg])] = ' ';
arg[narg][strlen(arg[narg])-1] = '\0';
narg = argstart;
quote = '\0';
}
narg++;
}
if (quote) error->all(FLERR,"Unbalanced quotes in input line");
}
/* ----------------------------------------------------------------------
substitute for $ variables in str and return it
str assumed to be long enough to hold expanded version
print updated string if flag is set and not searching for label
------------------------------------------------------------------------- */
void Input::substitute(char *str, int flag)
{
// use work[] as scratch space to expand str, then copy back to str
// do not replace $ inside single/double quotes
// var = pts at variable name, ended by NULL
// if $ is followed by '{', trailing '}' becomes NULL
// else $x becomes x followed by NULL
// beyond = pts at text following variable
char *var,*value,*beyond;
char quote = '\0';
char *ptr = str;
while (*ptr) {
if (*ptr == '$' && !quote) {
if (*(ptr+1) == '{') {
var = ptr+2;
int i = 0;
while (var[i] != '\0' && var[i] != '}') i++;
if (var[i] == '\0') error->one(FLERR,"Invalid variable name");
var[i] = '\0';
beyond = ptr + strlen(var) + 3;
} else {
var = ptr;
var[0] = var[1];
var[1] = '\0';
beyond = ptr + strlen(var) + 1;
}
value = variable->retrieve(var);
if (value == NULL) error->one(FLERR,"Substitution for illegal variable");
*ptr = '\0';
strcpy(work,str);
if (strlen(work)+strlen(value) >= MAXLINE)
error->one(FLERR,"Input line too long after variable substitution");
strcat(work,value);
if (strlen(work)+strlen(beyond) >= MAXLINE)
error->one(FLERR,"Input line too long after variable substitution");
strcat(work,beyond);
strcpy(str,work);
ptr += strlen(value);
if (flag && me == 0 && label_active == 0) {
if (echo_screen && screen) fprintf(screen,"%s",str);
if (echo_log && logfile) fprintf(logfile,"%s",str);
}
continue;
}
if (*ptr == quote) quote = '\0';
else if (*ptr == '"' || *ptr == '\'') quote = *ptr;
ptr++;
}
}
/* ----------------------------------------------------------------------
process a single parsed command
return 0 if successful, -1 if did not recognize command
------------------------------------------------------------------------- */
int Input::execute_command()
{
int flag = 1;
if (!strcmp(command,"clear")) clear();
else if (!strcmp(command,"echo")) echo();
else if (!strcmp(command,"if")) ifthenelse();
else if (!strcmp(command,"include")) include();
else if (!strcmp(command,"jump")) jump();
else if (!strcmp(command,"label")) label();
else if (!strcmp(command,"log")) log();
else if (!strcmp(command,"next")) next_command();
else if (!strcmp(command,"partition")) partition();
else if (!strcmp(command,"print")) print();
else if (!strcmp(command,"shell")) shell();
else if (!strcmp(command,"variable")) variable_command();
else if (!strcmp(command,"angle_coeff")) angle_coeff();
else if (!strcmp(command,"angle_style")) angle_style();
else if (!strcmp(command,"atom_modify")) atom_modify();
else if (!strcmp(command,"atom_style")) atom_style();
else if (!strcmp(command,"bond_coeff")) bond_coeff();
else if (!strcmp(command,"bond_style")) bond_style();
else if (!strcmp(command,"boundary")) boundary();
else if (!strcmp(command,"communicate")) communicate();
else if (!strcmp(command,"compute")) compute();
else if (!strcmp(command,"compute_modify")) compute_modify();
else if (!strcmp(command,"dielectric")) dielectric();
else if (!strcmp(command,"dihedral_coeff")) dihedral_coeff();
else if (!strcmp(command,"dihedral_style")) dihedral_style();
else if (!strcmp(command,"dimension")) dimension();
else if (!strcmp(command,"dump")) dump();
else if (!strcmp(command,"dump_modify")) dump_modify();
else if (!strcmp(command,"fix")) fix();
else if (!strcmp(command,"fix_modify")) fix_modify();
else if (!strcmp(command,"group")) group_command();
else if (!strcmp(command,"improper_coeff")) improper_coeff();
else if (!strcmp(command,"improper_style")) improper_style();
else if (!strcmp(command,"kspace_modify")) kspace_modify();
else if (!strcmp(command,"kspace_style")) kspace_style();
else if (!strcmp(command,"lattice")) lattice();
else if (!strcmp(command,"mass")) mass();
else if (!strcmp(command,"min_modify")) min_modify();
else if (!strcmp(command,"min_style")) min_style();
else if (!strcmp(command,"neigh_modify")) neigh_modify();
else if (!strcmp(command,"neighbor")) neighbor_command();
else if (!strcmp(command,"newton")) newton();
else if (!strcmp(command,"package")) package();
else if (!strcmp(command,"pair_coeff")) pair_coeff();
else if (!strcmp(command,"pair_modify")) pair_modify();
else if (!strcmp(command,"pair_style")) pair_style();
else if (!strcmp(command,"pair_write")) pair_write();
else if (!strcmp(command,"processors")) processors();
else if (!strcmp(command,"region")) region();
else if (!strcmp(command,"reset_timestep")) reset_timestep();
else if (!strcmp(command,"restart")) restart();
else if (!strcmp(command,"run_style")) run_style();
else if (!strcmp(command,"special_bonds")) special_bonds();
else if (!strcmp(command,"suffix")) suffix();
else if (!strcmp(command,"thermo")) thermo();
else if (!strcmp(command,"thermo_modify")) thermo_modify();
else if (!strcmp(command,"thermo_style")) thermo_style();
else if (!strcmp(command,"timestep")) timestep();
else if (!strcmp(command,"uncompute")) uncompute();
else if (!strcmp(command,"undump")) undump();
else if (!strcmp(command,"unfix")) unfix();
else if (!strcmp(command,"units")) units();
else flag = 0;
// return if command was listed above
if (flag) return 0;
// check if command is added via style.h
if (0) return 0; // dummy line to enable else-if macro expansion
#define COMMAND_CLASS
#define CommandStyle(key,Class) \
else if (strcmp(command,#key) == 0) { \
Class key(lmp); \
key.command(narg,arg); \
return 0; \
}
#include "style_command.h"
#undef COMMAND_CLASS
// unrecognized command
return -1;
}
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
void Input::clear()
{
if (narg > 0) error->all(FLERR,"Illegal clear command");
lmp->destroy();
lmp->create();
lmp->post_create();
}
/* ---------------------------------------------------------------------- */
void Input::echo()
{
if (narg != 1) error->all(FLERR,"Illegal echo command");
if (strcmp(arg[0],"none") == 0) {
echo_screen = 0;
echo_log = 0;
} else if (strcmp(arg[0],"screen") == 0) {
echo_screen = 1;
echo_log = 0;
} else if (strcmp(arg[0],"log") == 0) {
echo_screen = 0;
echo_log = 1;
} else if (strcmp(arg[0],"both") == 0) {
echo_screen = 1;
echo_log = 1;
} else error->all(FLERR,"Illegal echo command");
}
/* ---------------------------------------------------------------------- */
void Input::ifthenelse()
{
if (narg < 3) error->all(FLERR,"Illegal if command");
// substitute for variables in Boolean expression for "if"
// in case expression was enclosed in quotes
// must substitute on copy of arg else will step on subsequent args
char *scopy = new char[MAXLINE];
strcpy(scopy,arg[0]);
substitute(scopy,0);
// evaluate Boolean expression for "if"
double btest = variable->evaluate_boolean(scopy);
// bound "then" commands
if (strcmp(arg[1],"then") != 0) error->all(FLERR,"Illegal if command");
int first = 2;
int iarg = first;
while (iarg < narg &&
(strcmp(arg[iarg],"elif") != 0 && strcmp(arg[iarg],"else") != 0))
iarg++;
int last = iarg-1;
// execute "then" commands
// make copies of all arg string commands
// required because re-parsing a command via one() will wipe out args
if (btest != 0.0) {
int ncommands = last-first + 1;
if (ncommands <= 0) error->all(FLERR,"Illegal if command");
char **commands = new char*[ncommands];
ncommands = 0;
for (int i = first; i <= last; i++) {
int n = strlen(arg[i]) + 1;
if (n == 1) error->all(FLERR,"Illegal if command");
commands[ncommands] = new char[n];
strcpy(commands[ncommands],arg[i]);
ncommands++;
}
for (int i = 0; i < ncommands; i++) one(commands[i]);
for (int i = 0; i < ncommands; i++) delete [] commands[i];
delete [] commands;
delete [] scopy;
return;
}
// done if no "elif" or "else"
if (iarg == narg) {
delete [] scopy;
return;
}
// check "elif" or "else" until find commands to execute
// substitute for variables and evaluate Boolean expression for "elif"
// must substitute on copy of arg else will step on subsequent args
// bound and execute "elif" or "else" commands
while (1) {
if (iarg+2 > narg) error->all(FLERR,"Illegal if command");
if (strcmp(arg[iarg],"elif") == 0) {
strcpy(scopy,arg[iarg+1]);
substitute(scopy,0);
btest = variable->evaluate_boolean(scopy);
first = iarg+2;
} else {
btest = 1.0;
first = iarg+1;
}
iarg = first;
while (iarg < narg &&
(strcmp(arg[iarg],"elif") != 0 && strcmp(arg[iarg],"else") != 0))
iarg++;
last = iarg-1;
if (btest == 0.0) continue;
int ncommands = last-first + 1;
if (ncommands <= 0) error->all(FLERR,"Illegal if command");
char **commands = new char*[ncommands];
ncommands = 0;
for (int i = first; i <= last; i++) {
int n = strlen(arg[i]) + 1;
if (n == 1) error->all(FLERR,"Illegal if command");
commands[ncommands] = new char[n];
strcpy(commands[ncommands],arg[i]);
ncommands++;
}
// execute the list of commands
for (int i = 0; i < ncommands; i++) one(commands[i]);
// clean up
for (int i = 0; i < ncommands; i++) delete [] commands[i];
delete [] commands;
delete [] scopy;
return;
}
}
/* ---------------------------------------------------------------------- */
void Input::include()
{
if (narg != 1) error->all(FLERR,"Illegal include command");
if (me == 0) {
if (nfile == maxfile) {
maxfile++;
infiles = (FILE **)
memory->srealloc(infiles,maxfile*sizeof(FILE *),"input:infiles");
}
infile = fopen(arg[0],"r");
if (infile == NULL) {
char str[128];
sprintf(str,"Cannot open input script %s",arg[0]);
error->one(FLERR,str);
}
infiles[nfile++] = infile;
}
}
/* ---------------------------------------------------------------------- */
void Input::jump()
{
if (narg < 1 || narg > 2) error->all(FLERR,"Illegal jump command");
if (jump_skip) {
jump_skip = 0;
return;
}
if (me == 0) {
if (strcmp(arg[0],"SELF") == 0) rewind(infile);
else {
if (infile != stdin) fclose(infile);
infile = fopen(arg[0],"r");
if (infile == NULL) {
char str[128];
sprintf(str,"Cannot open input script %s",arg[0]);
error->one(FLERR,str);
}
infiles[nfile-1] = infile;
}
}
if (narg == 2) {
label_active = 1;
if (labelstr) delete [] labelstr;
int n = strlen(arg[1]) + 1;
labelstr = new char[n];
strcpy(labelstr,arg[1]);
}
}
/* ---------------------------------------------------------------------- */
void Input::label()
{
if (narg != 1) error->all(FLERR,"Illegal label command");
if (label_active && strcmp(labelstr,arg[0]) == 0) label_active = 0;
}
/* ---------------------------------------------------------------------- */
void Input::log()
{
if (narg != 1) error->all(FLERR,"Illegal log command");
if (me == 0) {
if (logfile) fclose(logfile);
if (strcmp(arg[0],"none") == 0) logfile = NULL;
else {
logfile = fopen(arg[0],"w");
if (logfile == NULL) {
char str[128];
sprintf(str,"Cannot open logfile %s",arg[0]);
error->one(FLERR,str);
}
}
if (universe->nworlds == 1) universe->ulogfile = logfile;
}
}
/* ---------------------------------------------------------------------- */
void Input::next_command()
{
if (variable->next(narg,arg)) jump_skip = 1;
}
/* ---------------------------------------------------------------------- */
void Input::partition()
{
if (narg < 3) error->all(FLERR,"Illegal partition command");
int yesflag;
if (strcmp(arg[0],"yes") == 0) yesflag = 1;
else if (strcmp(arg[0],"no") == 0) yesflag = 0;
else error->all(FLERR,"Illegal partition command");
int ilo,ihi;
force->bounds(arg[1],universe->nworlds,ilo,ihi);
// copy original line to copy, since will use strtok() on it
// ptr = start of 4th word
strcpy(copy,line);
copy[strlen(copy)-1] = '\0';
char *ptr = strtok(copy," \t\n\r\f");
ptr = strtok(NULL," \t\n\r\f");
ptr = strtok(NULL," \t\n\r\f");
ptr += strlen(ptr) + 1;
ptr += strspn(ptr," \t\n\r\f");
// execute the remaining command line on requested partitions
if (yesflag) {
if (universe->iworld+1 >= ilo && universe->iworld+1 <= ihi) one(ptr);
} else {
if (universe->iworld+1 < ilo || universe->iworld+1 > ihi) one(ptr);
}
}
/* ---------------------------------------------------------------------- */
void Input::print()
{
if (narg != 1) error->all(FLERR,"Illegal print command");
// substitute for $ variables (no printing) and print arg
substitute(arg[0],0);
if (me == 0) {
if (screen) fprintf(screen,"%s\n",arg[0]);
if (logfile) fprintf(logfile,"%s\n",arg[0]);
}
}
/* ---------------------------------------------------------------------- */
void Input::shell()
{
if (narg < 1) error->all(FLERR,"Illegal shell command");
if (strcmp(arg[0],"cd") == 0) {
if (narg != 2) error->all(FLERR,"Illegal shell command");
chdir(arg[1]);
} else if (strcmp(arg[0],"mkdir") == 0) {
if (narg < 2) error->all(FLERR,"Illegal shell command");
#if !defined(WINDOWS) && !defined(__MINGW32_VERSION)
if (me == 0)
for (int i = 1; i < narg; i++)
mkdir(arg[i], S_IRWXU | S_IRGRP | S_IXGRP);
#endif
} else if (strcmp(arg[0],"mv") == 0) {
if (narg != 3) error->all(FLERR,"Illegal shell command");
if (me == 0) rename(arg[1],arg[2]);
} else if (strcmp(arg[0],"rm") == 0) {
if (narg < 2) error->all(FLERR,"Illegal shell command");
if (me == 0)
for (int i = 1; i < narg; i++) unlink(arg[i]);
} else if (strcmp(arg[0],"rmdir") == 0) {
if (narg < 2) error->all(FLERR,"Illegal shell command");
if (me == 0)
for (int i = 1; i < narg; i++) rmdir(arg[i]);
// use work to concat args back into one string separated by spaces
// invoke string in shell via system()
} else {
strcpy(work,arg[0]);
for (int i = 1; i < narg; i++) {
strcat(work," ");
strcat(work,arg[i]);
}
if (me == 0) system(work);
}
}
/* ---------------------------------------------------------------------- */
void Input::variable_command()
{
variable->set(narg,arg);
}
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
one function for each LAMMPS-specific input script command
------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
void Input::angle_coeff()
{
if (domain->box_exist == 0)
error->all(FLERR,"Angle_coeff command before simulation box is defined");
if (force->angle == NULL)
error->all(FLERR,"Angle_coeff command before angle_style is defined");
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Angle_coeff command when no angles allowed");
force->angle->coeff(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::angle_style()
{
if (narg < 1) error->all(FLERR,"Illegal angle_style command");
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Angle_style command when no angles allowed");
force->create_angle(arg[0],lmp->suffix);
if (force->angle) force->angle->settings(narg-1,&arg[1]);
}
/* ---------------------------------------------------------------------- */
void Input::atom_modify()
{
atom->modify_params(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::atom_style()
{
if (narg < 1) error->all(FLERR,"Illegal atom_style command");
if (domain->box_exist)
error->all(FLERR,"Atom_style command after simulation box is defined");
atom->create_avec(arg[0],narg-1,&arg[1],lmp->suffix);
}
/* ---------------------------------------------------------------------- */
void Input::bond_coeff()
{
if (domain->box_exist == 0)
error->all(FLERR,"Bond_coeff command before simulation box is defined");
if (force->bond == NULL)
error->all(FLERR,"Bond_coeff command before bond_style is defined");
if (atom->avec->bonds_allow == 0)
error->all(FLERR,"Bond_coeff command when no bonds allowed");
force->bond->coeff(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::bond_style()
{
if (narg < 1) error->all(FLERR,"Illegal bond_style command");
if (atom->avec->bonds_allow == 0)
error->all(FLERR,"Bond_style command when no bonds allowed");
force->create_bond(arg[0],lmp->suffix);
if (force->bond) force->bond->settings(narg-1,&arg[1]);
}
/* ---------------------------------------------------------------------- */
void Input::boundary()
{
if (domain->box_exist)
error->all(FLERR,"Boundary command after simulation box is defined");
domain->set_boundary(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::communicate()
{
comm->set(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::compute()
{
modify->add_compute(narg,arg,lmp->suffix);
}
/* ---------------------------------------------------------------------- */
void Input::compute_modify()
{
modify->modify_compute(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::dielectric()
{
if (narg != 1) error->all(FLERR,"Illegal dielectric command");
force->dielectric = atof(arg[0]);
}
/* ---------------------------------------------------------------------- */
void Input::dihedral_coeff()
{
if (domain->box_exist == 0)
error->all(FLERR,"Dihedral_coeff command before simulation box is defined");
if (force->dihedral == NULL)
error->all(FLERR,"Dihedral_coeff command before dihedral_style is defined");
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Dihedral_coeff command when no dihedrals allowed");
force->dihedral->coeff(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::dihedral_style()
{
if (narg < 1) error->all(FLERR,"Illegal dihedral_style command");
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Dihedral_style command when no dihedrals allowed");
force->create_dihedral(arg[0],lmp->suffix);
if (force->dihedral) force->dihedral->settings(narg-1,&arg[1]);
}
/* ---------------------------------------------------------------------- */
void Input::dimension()
{
if (narg != 1) error->all(FLERR,"Illegal dimension command");
if (domain->box_exist)
error->all(FLERR,"Dimension command after simulation box is defined");
domain->dimension = atoi(arg[0]);
if (domain->dimension != 2 && domain->dimension != 3)
error->all(FLERR,"Illegal dimension command");
// must reset default extra_dof of all computes
// since some were created before dimension command is encountered
for (int i = 0; i < modify->ncompute; i++)
modify->compute[i]->reset_extra_dof();
}
/* ---------------------------------------------------------------------- */
void Input::dump()
{
output->add_dump(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::dump_modify()
{
output->modify_dump(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::fix()
{
modify->add_fix(narg,arg,lmp->suffix);
}
/* ---------------------------------------------------------------------- */
void Input::fix_modify()
{
modify->modify_fix(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::group_command()
{
group->assign(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::improper_coeff()
{
if (domain->box_exist == 0)
error->all(FLERR,"Improper_coeff command before simulation box is defined");
if (force->improper == NULL)
error->all(FLERR,"Improper_coeff command before improper_style is defined");
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Improper_coeff command when no impropers allowed");
force->improper->coeff(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::improper_style()
{
if (narg < 1) error->all(FLERR,"Illegal improper_style command");
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Improper_style command when no impropers allowed");
force->create_improper(arg[0],lmp->suffix);
if (force->improper) force->improper->settings(narg-1,&arg[1]);
}
/* ---------------------------------------------------------------------- */
void Input::kspace_modify()
{
if (force->kspace == NULL)
error->all(FLERR,"KSpace style has not yet been set");
force->kspace->modify_params(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::kspace_style()
{
force->create_kspace(narg,arg,lmp->suffix);
}
/* ---------------------------------------------------------------------- */
void Input::lattice()
{
domain->set_lattice(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::mass()
{
if (narg != 2) error->all(FLERR,"Illegal mass command");
if (domain->box_exist == 0)
error->all(FLERR,"Mass command before simulation box is defined");
atom->set_mass(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::min_modify()
{
update->minimize->modify_params(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::min_style()
{
if (domain->box_exist == 0)
error->all(FLERR,"Min_style command before simulation box is defined");
update->create_minimize(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::neigh_modify()
{
neighbor->modify_params(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::neighbor_command()
{
neighbor->set(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::newton()
{
int newton_pair,newton_bond;
if (narg == 1) {
if (strcmp(arg[0],"off") == 0) newton_pair = newton_bond = 0;
else if (strcmp(arg[0],"on") == 0) newton_pair = newton_bond = 1;
else error->all(FLERR,"Illegal newton command");
} else if (narg == 2) {
if (strcmp(arg[0],"off") == 0) newton_pair = 0;
else if (strcmp(arg[0],"on") == 0) newton_pair= 1;
else error->all(FLERR,"Illegal newton command");
if (strcmp(arg[1],"off") == 0) newton_bond = 0;
else if (strcmp(arg[1],"on") == 0) newton_bond = 1;
else error->all(FLERR,"Illegal newton command");
} else error->all(FLERR,"Illegal newton command");
force->newton_pair = newton_pair;
if (newton_bond == 0) {
if (domain->box_exist && force->newton_bond == 1)
error->all(FLERR,"Newton bond change after simulation box is defined");
force->newton_bond = 0;
} else {
if (domain->box_exist && force->newton_bond == 0)
error->all(FLERR,"Newton bond change after simulation box is defined");
force->newton_bond = 1;
}
if (newton_pair || newton_bond) force->newton = 1;
else force->newton = 0;
}
/* ---------------------------------------------------------------------- */
void Input::package()
{
if (domain->box_exist)
error->all(FLERR,"Package command after simulation box is defined");
if (narg < 1) error->all(FLERR,"Illegal package command");
if (strcmp(arg[0],"cuda") == 0) {
if (!lmp->cuda)
error->all(FLERR,"Package cuda command without USER-CUDA installed");
lmp->cuda->accelerator(narg-1,&arg[1]);
} else if (strcmp(arg[0],"gpu") == 0) {
char **fixarg = new char*[2+narg];
- fixarg[0] = "package_gpu";
- fixarg[1] = "all";
- fixarg[2] = "GPU";
+ fixarg[0] = (char *) "package_gpu";
+ fixarg[1] = (char *) "all";
+ fixarg[2] = (char *) "GPU";
for (int i = 1; i < narg; i++) fixarg[i+2] = arg[i];
modify->allow_early_fix = 1;
modify->add_fix(2+narg,fixarg,NULL);
modify->allow_early_fix = 0;
delete [] fixarg;
} else if (strcmp(arg[0],"omp") == 0) {
char **fixarg = new char*[2+narg];
- fixarg[0] = "package_omp";
- fixarg[1] = "all";
- fixarg[2] = "OMP";
+ fixarg[0] = (char *) "package_omp";
+ fixarg[1] = (char *) "all";
+ fixarg[2] = (char *) "OMP";
for (int i = 1; i < narg; i++) fixarg[i+2] = arg[i];
modify->allow_early_fix = 1;
modify->add_fix(2+narg,fixarg,NULL);
modify->allow_early_fix = 0;
delete [] fixarg;
} else error->all(FLERR,"Illegal package command");
}
/* ---------------------------------------------------------------------- */
void Input::pair_coeff()
{
if (domain->box_exist == 0)
error->all(FLERR,"Pair_coeff command before simulation box is defined");
if (force->pair == NULL)
error->all(FLERR,"Pair_coeff command before pair_style is defined");
force->pair->coeff(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::pair_modify()
{
if (force->pair == NULL)
error->all(FLERR,"Pair_modify command before pair_style is defined");
force->pair->modify_params(narg,arg);
}
/* ----------------------------------------------------------------------
if old pair style exists and new style is same, just change settings
else create new pair class
------------------------------------------------------------------------- */
void Input::pair_style()
{
if (narg < 1) error->all(FLERR,"Illegal pair_style command");
if (force->pair && strcmp(arg[0],force->pair_style) == 0) {
force->pair->settings(narg-1,&arg[1]);
return;
}
force->create_pair(arg[0],lmp->suffix);
if (force->pair) force->pair->settings(narg-1,&arg[1]);
}
/* ---------------------------------------------------------------------- */
void Input::pair_write()
{
if (force->pair == NULL)
error->all(FLERR,"Pair_write command before pair_style is defined");
force->pair->write_file(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::processors()
{
if (domain->box_exist)
error->all(FLERR,"Processors command after simulation box is defined");
comm->set_processors(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::region()
{
domain->add_region(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::reset_timestep()
{
update->reset_timestep(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::restart()
{
output->create_restart(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::run_style()
{
if (domain->box_exist == 0)
error->all(FLERR,"Run_style command before simulation box is defined");
update->create_integrate(narg,arg,lmp->suffix);
}
/* ---------------------------------------------------------------------- */
void Input::special_bonds()
{
// store 1-3,1-4 and dihedral/extra flag values before change
// change in 1-2 coeffs will not change the special list
double lj2 = force->special_lj[2];
double lj3 = force->special_lj[3];
double coul2 = force->special_coul[2];
double coul3 = force->special_coul[3];
int angle = force->special_angle;
int dihedral = force->special_dihedral;
int extra = force->special_extra;
force->set_special(narg,arg);
// if simulation box defined and saved values changed, redo special list
if (domain->box_exist && atom->molecular) {
if (lj2 != force->special_lj[2] || lj3 != force->special_lj[3] ||
coul2 != force->special_coul[2] || coul3 != force->special_coul[3] ||
angle != force->special_angle ||
dihedral != force->special_dihedral ||
extra != force->special_extra) {
Special special(lmp);
special.build();
}
}
}
/* ---------------------------------------------------------------------- */
void Input::suffix()
{
if (narg != 1) error->all(FLERR,"Illegal suffix command");
if (strcmp(arg[0],"off") == 0) lmp->suffix_enable = 0;
else if (strcmp(arg[0],"on") == 0) lmp->suffix_enable = 1;
else {
delete [] lmp->suffix;
int n = strlen(arg[0]) + 1;
lmp->suffix = new char[n];
strcpy(lmp->suffix,arg[0]);
lmp->suffix_enable = 1;
}
}
/* ---------------------------------------------------------------------- */
void Input::thermo()
{
if (narg != 1) error->all(FLERR,"Illegal thermo command");
output->thermo_every = atoi(arg[0]);
}
/* ---------------------------------------------------------------------- */
void Input::thermo_modify()
{
output->thermo->modify_params(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::thermo_style()
{
output->create_thermo(narg,arg);
}
/* ---------------------------------------------------------------------- */
void Input::timestep()
{
if (narg != 1) error->all(FLERR,"Illegal timestep command");
update->dt = atof(arg[0]);
}
/* ---------------------------------------------------------------------- */
void Input::uncompute()
{
if (narg != 1) error->all(FLERR,"Illegal uncompute command");
modify->delete_compute(arg[0]);
}
/* ---------------------------------------------------------------------- */
void Input::undump()
{
if (narg != 1) error->all(FLERR,"Illegal undump command");
output->delete_dump(arg[0]);
}
/* ---------------------------------------------------------------------- */
void Input::unfix()
{
if (narg != 1) error->all(FLERR,"Illegal unfix command");
modify->delete_fix(arg[0]);
}
/* ---------------------------------------------------------------------- */
void Input::units()
{
if (narg != 1) error->all(FLERR,"Illegal units command");
if (domain->box_exist)
error->all(FLERR,"Units command after simulation box is defined");
update->set_units(arg[0]);
}
diff --git a/src/input.h b/src/input.h
index fd08a6098..3fe588989 100644
--- a/src/input.h
+++ b/src/input.h
@@ -1,119 +1,319 @@
/* ----------------------------------------------------------------------
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_INPUT_H
#define LMP_INPUT_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class Input : protected Pointers {
public:
int narg; // # of command args
char **arg; // parsed args for command
class Variable *variable; // defined variables
Input(class LAMMPS *, int, char **);
~Input();
void file(); // process all input
void file(const char *); // process an input script
char *one(const char *); // process a single command
void substitute(char *, int); // substitute for variables in a string
private:
int me; // proc ID
char *command; // ptr to current command
int maxarg; // max # of args in arg
char *line,*copy,*work; // input line & copy of it
int echo_screen; // 0 = no, 1 = yes
int echo_log; // 0 = no, 1 = yes
int nfile,maxfile; // current # and max # of open input files
int label_active; // 0 = no label, 1 = looking for label
char *labelstr; // label string being looked for
int jump_skip; // 1 if skipping next jump, 0 otherwise
FILE **infiles; // list of open input files
void parse(); // parse an input text line
int execute_command(); // execute a single command
void clear(); // input script commands
void echo();
void ifthenelse();
void include();
void jump();
void label();
void log();
void next_command();
void partition();
void print();
void shell();
void variable_command();
void angle_coeff(); // LAMMPS commands
void angle_style();
void atom_modify();
void atom_style();
void bond_coeff();
void bond_style();
void boundary();
void communicate();
void compute();
void compute_modify();
void dielectric();
void dihedral_coeff();
void dihedral_style();
void dimension();
void dump();
void dump_modify();
void fix();
void fix_modify();
void group_command();
void improper_coeff();
void improper_style();
void kspace_modify();
void kspace_style();
void lattice();
void mass();
void min_modify();
void min_style();
void neigh_modify();
void neighbor_command();
void newton();
void package();
void pair_coeff();
void pair_modify();
void pair_style();
void pair_write();
void processors();
void region();
void reset_timestep();
void restart();
void run_style();
void special_bonds();
void suffix();
void thermo();
void thermo_modify();
void thermo_style();
void timestep();
void uncompute();
void undump();
void unfix();
void units();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Label wasn't found in input script
+
+Self-explanatory.
+
+E: Input line too long: %s
+
+This is a hard (very large) limit defined in the input.cpp file.
+
+E: Unknown command: %s
+
+The command is not known to LAMMPS. Check the input script.
+
+E: Another input script is already being processed
+
+Cannot attempt to open a 2nd input script, when the original file is
+still being processed.
+
+E: Cannot open input script %s
+
+Self-explanatory.
+
+E: Unbalanced quotes in input line
+
+No matching end double quote was found following a leading double
+quote.
+
+E: Invalid variable name
+
+Variable name used in an input script line is invalid.
+
+E: Substitution for illegal variable
+
+Input script line contained a variable that could not be substituted
+for.
+
+E: Input line too long after variable substitution
+
+This is a hard (very large) limit defined in the input.cpp file.
+
+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: Cannot open logfile %s
+
+The LAMMPS log file specified in the input script cannot be opened.
+Check that the path and name are correct.
+
+E: Angle_coeff command before simulation box is defined
+
+The angle_coeff command cannot be used before a read_data,
+read_restart, or create_box command.
+
+E: Angle_coeff command before angle_style is defined
+
+Coefficients cannot be set in the data file or via the angle_coeff
+command until an angle_style has been assigned.
+
+E: Angle_coeff command when no angles allowed
+
+The chosen atom style does not allow for angles to be defined.
+
+E: Angle_style command when no angles allowed
+
+The chosen atom style does not allow for angles to be defined.
+
+E: Atom_style command after simulation box is defined
+
+The atom_style command cannot be used after a read_data,
+read_restart, or create_box command.
+
+E: Bond_coeff command before simulation box is defined
+
+The bond_coeff command cannot be used before a read_data,
+read_restart, or create_box command.
+
+E: Bond_coeff command before bond_style is defined
+
+Coefficients cannot be set in the data file or via the bond_coeff
+command until an bond_style has been assigned.
+
+E: Bond_coeff command when no bonds allowed
+
+The chosen atom style does not allow for bonds to be defined.
+
+E: Bond_style command when no bonds allowed
+
+The chosen atom style does not allow for bonds to be defined.
+
+E: Boundary command after simulation box is defined
+
+The boundary command cannot be used after a read_data, read_restart,
+or create_box command.
+
+E: Dihedral_coeff command before simulation box is defined
+
+The dihedral_coeff command cannot be used before a read_data,
+read_restart, or create_box command.
+
+E: Dihedral_coeff command before dihedral_style is defined
+
+Coefficients cannot be set in the data file or via the dihedral_coeff
+command until an dihedral_style has been assigned.
+
+E: Dihedral_coeff command when no dihedrals allowed
+
+The chosen atom style does not allow for dihedrals to be defined.
+
+E: Dihedral_style command when no dihedrals allowed
+
+The chosen atom style does not allow for dihedrals to be defined.
+
+E: Dimension command after simulation box is defined
+
+The dimension command cannot be used after a read_data,
+read_restart, or create_box command.
+
+E: Improper_coeff command before simulation box is defined
+
+The improper_coeff command cannot be used before a read_data,
+read_restart, or create_box command.
+
+E: Improper_coeff command before improper_style is defined
+
+Coefficients cannot be set in the data file or via the improper_coeff
+command until an improper_style has been assigned.
+
+E: Improper_coeff command when no impropers allowed
+
+The chosen atom style does not allow for impropers to be defined.
+
+E: Improper_style command when no impropers allowed
+
+The chosen atom style does not allow for impropers to be defined.
+
+E: KSpace style has not yet been set
+
+Cannot use kspace_modify command until a kspace style is set.
+
+E: Mass command before simulation box is defined
+
+The mass command cannot be used before a read_data, read_restart, or
+create_box command.
+
+E: Min_style command before simulation box is defined
+
+The min_style command cannot be used before a read_data, read_restart,
+or create_box command.
+
+E: Newton bond change after simulation box is defined
+
+The newton command cannot be used to change the newton bond value
+after a read_data, read_restart, or create_box command.
+
+E: Package command after simulation box is defined
+
+UNDOCUMENTED
+
+E: Package cuda command without USER-CUDA installed
+
+UNDOCUMENTED
+
+E: Pair_coeff command before simulation box is defined
+
+The pair_coeff command cannot be used before a read_data,
+read_restart, or create_box command.
+
+E: Pair_coeff command before pair_style is defined
+
+Self-explanatory.
+
+E: Pair_modify command before pair_style is defined
+
+Self-explanatory.
+
+E: Pair_write command before pair_style is defined
+
+Self-explanatory.
+
+E: Processors command after simulation box is defined
+
+The processors command cannot be used after a read_data, read_restart,
+or create_box command.
+
+E: Run_style command before simulation box is defined
+
+The run_style command cannot be used before a read_data,
+read_restart, or create_box command.
+
+E: Units command after simulation box is defined
+
+The units command cannot be used after a read_data, read_restart, or
+create_box command.
+
+*/
diff --git a/src/integrate.h b/src/integrate.h
index 3c75176a1..853390ae1 100644
--- a/src/integrate.h
+++ b/src/integrate.h
@@ -1,51 +1,54 @@
/* ----------------------------------------------------------------------
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_INTEGRATE_H
#define LMP_INTEGRATE_H
#include "pointers.h"
namespace LAMMPS_NS {
class Integrate : protected Pointers {
public:
Integrate(class LAMMPS *, int, char **);
virtual ~Integrate();
virtual void init() = 0;
virtual void setup() = 0;
virtual void setup_minimal(int) = 0;
virtual void run(int) = 0;
virtual void cleanup() {}
virtual void reset_dt() {}
virtual bigint memory_usage() {return 0;}
protected:
int eflag,vflag; // flags for energy/virial computation
int virial_style; // compute virial explicitly or implicitly
int external_force_clear; // clear forces locally or externally
int nelist_global,nelist_atom; // # of PE,virial computes to check
int nvlist_global,nvlist_atom;
class Compute **elist_global; // lists of PE,virial Computes
class Compute **elist_atom;
class Compute **vlist_global;
class Compute **vlist_atom;
void ev_setup();
void ev_set(bigint);
};
}
#endif
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/irregular.h b/src/irregular.h
index ccd317f2e..06b840171 100644
--- a/src/irregular.h
+++ b/src/irregular.h
@@ -1,91 +1,94 @@
/* ----------------------------------------------------------------------
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_IRREGULAR_H
#define LMP_IRREGULAR_H
#include "pointers.h"
namespace LAMMPS_NS {
class Irregular : protected Pointers {
public:
Irregular(class LAMMPS *);
~Irregular();
void migrate_atoms();
int create_data(int, int *);
void exchange_data(char *, int, char *);
void destroy_data();
bigint memory_usage();
private:
int me,nprocs;
int triclinic;
int map_style;
int *procgrid;
int ***grid2proc;
int maxsend,maxrecv; // size of buffers in # of doubles
double *buf_send,*buf_recv;
// plan for irregular communication of atoms
// no params refer to atoms copied to self
struct PlanAtom {
int nsend; // # of messages to send
int nrecv; // # of messages to recv
int sendmax; // # of doubles in largest send message
int *proc_send; // procs to send to
int *length_send; // # of doubles to send to each proc
int *num_send; // # of atoms to send to each proc
int *index_send; // list of which atoms to send to each proc
int *offset_send; // where each atom starts in send buffer
int *proc_recv; // procs to recv from
int *length_recv; // # of doubles to recv from each proc
MPI_Request *request; // MPI requests for posted recvs
MPI_Status *status; // MPI statuses for WaitAll
};
// plan for irregular communication of datums
// only 2 self params refer to atoms copied to self
struct PlanData { // plan for irregular communication of data
int nsend; // # of messages to send
int nrecv; // # of messages to recv
int sendmax; // # of datums in largest send message
int *proc_send; // procs to send to
int *num_send; // # of datums to send to each proc
int *index_send; // list of which datums to send to each proc
int *proc_recv; // procs to recv from
int *num_recv; // # of datums to recv from each proc
int num_self; // # of datums to copy to self
int *index_self; // list of which datums to copy to self
MPI_Request *request; // MPI requests for posted recvs
MPI_Status *status; // MPI statuses for WaitAll
};
PlanAtom *aplan;
PlanData *dplan;
int create_atom(int, int *, int *);
void exchange_atom(double *, int *, double *);
void destroy_atom();
int coord2proc(double *);
void grow_send(int,int); // reallocate send buffer
void grow_recv(int); // free/allocate recv buffer
};
}
#endif
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/kspace.cpp b/src/kspace.cpp
index 116535f8e..aa50ec1cd 100644
--- a/src/kspace.cpp
+++ b/src/kspace.cpp
@@ -1,80 +1,80 @@
/* ----------------------------------------------------------------------
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 "string.h"
#include "kspace.h"
#include "error.h"
#include "comm.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
KSpace::KSpace(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
{
energy = 0.0;
order = 5;
gridflag = 0;
gewaldflag = 0;
slabflag = 0;
slab_volfactor = 1;
}
/* ----------------------------------------------------------------------
modify parameters of the KSpace style
------------------------------------------------------------------------- */
void KSpace::modify_params(int narg, char **arg)
{
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"mesh") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal kspace_modify command");
nx_pppm = atoi(arg[iarg+1]);
ny_pppm = atoi(arg[iarg+2]);
nz_pppm = atoi(arg[iarg+3]);
if (nx_pppm == 0 && ny_pppm == 0 && nz_pppm == 0) gridflag = 0;
else gridflag = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"order") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command");
order = atoi(arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"gewald") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command");
g_ewald = atof(arg[iarg+1]);
if (g_ewald == 0.0) gewaldflag = 0;
else gewaldflag = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"slab") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command");
slab_volfactor = atof(arg[iarg+1]);
iarg += 2;
if (slab_volfactor <= 1.0)
error->all(FLERR,"Bad kspace_modify slab parameter");
if (slab_volfactor < 2.0 && comm->me == 0)
error->warning(FLERR,"Kspace_modify slab param < 2.0 may "
"cause unphysical behavior");
slabflag = 1;
} else error->all(FLERR,"Illegal kspace_modify command");
}
}
/* ---------------------------------------------------------------------- */
-void *KSpace::extract(char *str)
+void *KSpace::extract(const char *str)
{
if (strcmp(str,"scale") == 0) return (void *) &scale;
return NULL;
}
diff --git a/src/kspace.h b/src/kspace.h
index f77bacfcd..fa54e4837 100644
--- a/src/kspace.h
+++ b/src/kspace.h
@@ -1,50 +1,69 @@
/* ----------------------------------------------------------------------
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_KSPACE_H
#define LMP_KSPACE_H
#include "pointers.h"
namespace LAMMPS_NS {
class KSpace : protected Pointers {
friend class ThrOMP;
public:
double energy;
double virial[6];
double g_ewald;
int nx_pppm,ny_pppm,nz_pppm;
KSpace(class LAMMPS *, int, char **);
virtual ~KSpace() {}
void modify_params(int, char **);
- void *extract(char *);
+ void *extract(const char *);
virtual void init() = 0;
virtual void setup() = 0;
virtual void compute(int, int) = 0;
virtual void timing(int, double &, double &) {}
virtual double memory_usage() {return 0.0;}
protected:
double slab_volfactor;
int gridflag,gewaldflag;
int order;
int slabflag;
double scale;
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+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: Bad kspace_modify slab parameter
+
+Kspace_modify value for the slab/volume keyword must be >= 2.0.
+
+W: Kspace_modify slab param < 2.0 may cause unphysical behavior
+
+The kspace_modify slab parameter should be larger to insure periodic
+grids padded with empty space do not overlap.
+
+*/
diff --git a/src/lammps.cpp b/src/lammps.cpp
index cbfddc2f7..537ab1748 100644
--- a/src/lammps.cpp
+++ b/src/lammps.cpp
@@ -1,641 +1,641 @@
/* ----------------------------------------------------------------------
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 "mpi.h"
#include "string.h"
#include "lammps.h"
#include "style_angle.h"
#include "style_atom.h"
#include "style_bond.h"
#include "style_command.h"
#include "style_compute.h"
#include "style_dihedral.h"
#include "style_dump.h"
#include "style_fix.h"
#include "style_improper.h"
#include "style_integrate.h"
#include "style_kspace.h"
#include "style_minimize.h"
#include "style_pair.h"
#include "style_region.h"
#include "universe.h"
#include "input.h"
#include "atom.h"
#include "update.h"
#include "neighbor.h"
#include "comm.h"
#include "domain.h"
#include "force.h"
#include "modify.h"
#include "group.h"
#include "output.h"
#include "accelerator_cuda.h"
#include "timer.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ----------------------------------------------------------------------
start up LAMMPS
allocate fundamental classes (memory, error, universe, input)
parse input switches
initialize communicators, screen & logfile output
input is allocated at end after MPI info is setup
------------------------------------------------------------------------- */
LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
{
memory = new Memory(this);
error = new Error(this);
universe = new Universe(this,communicator);
output = NULL;
screen = NULL;
logfile = NULL;
// parse input switches
int inflag = 0;
int screenflag = 0;
int logflag = 0;
int partscreenflag = 0;
int partlogflag = 0;
int cudaflag = -1;
int helpflag = 0;
suffix = NULL;
suffix_enable = 0;
int iarg = 1;
while (iarg < narg) {
if (strcmp(arg[iarg],"-partition") == 0 ||
strcmp(arg[iarg],"-p") == 0) {
universe->existflag = 1;
if (iarg+2 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
iarg++;
while (iarg < narg && arg[iarg][0] != '-') {
universe->add_world(arg[iarg]);
iarg++;
}
} else if (strcmp(arg[iarg],"-in") == 0 ||
strcmp(arg[iarg],"-i") == 0) {
if (iarg+2 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
inflag = iarg + 1;
iarg += 2;
} else if (strcmp(arg[iarg],"-screen") == 0 ||
strcmp(arg[iarg],"-sc") == 0) {
if (iarg+2 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
screenflag = iarg + 1;
iarg += 2;
} else if (strcmp(arg[iarg],"-log") == 0 ||
strcmp(arg[iarg],"-l") == 0) {
if (iarg+2 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
logflag = iarg + 1;
iarg += 2;
} else if (strcmp(arg[iarg],"-var") == 0 ||
strcmp(arg[iarg],"-v") == 0) {
if (iarg+3 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
iarg += 3;
while (iarg < narg && arg[iarg][0] != '-') iarg++;
} else if (strcmp(arg[iarg],"-echo") == 0 ||
strcmp(arg[iarg],"-e") == 0) {
if (iarg+2 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
iarg += 2;
} else if (strcmp(arg[iarg],"-pscreen") == 0 ||
strcmp(arg[iarg],"-ps") == 0) {
if (iarg+2 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
partscreenflag = iarg + 1;
iarg += 2;
} else if (strcmp(arg[iarg],"-plog") == 0 ||
strcmp(arg[iarg],"-pl") == 0) {
if (iarg+2 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
partlogflag = iarg + 1;
iarg += 2;
} else if (strcmp(arg[iarg],"-cuda") == 0 ||
strcmp(arg[iarg],"-c") == 0) {
if (iarg+2 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
if (strcmp(arg[iarg+1],"on") == 0) cudaflag = 1;
else if (strcmp(arg[iarg+1],"off") == 0) cudaflag = 0;
else error->universe_all(FLERR,"Invalid command-line argument");
iarg += 2;
} else if (strcmp(arg[iarg],"-suffix") == 0 ||
strcmp(arg[iarg],"-sf") == 0) {
if (iarg+2 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
delete [] suffix;
int n = strlen(arg[iarg+1]) + 1;
suffix = new char[n];
strcpy(suffix,arg[iarg+1]);
suffix_enable = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"-reorder") == 0 ||
strcmp(arg[iarg],"-r") == 0) {
- if (iarg+2 > narg)
+ if (iarg+3 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
if (universe->existflag)
error->universe_all(FLERR,"Cannot use -reorder after -partition");
- universe->reorder(arg[iarg+1]);
- iarg += 2;
+ universe->reorder(arg[iarg+1],arg[iarg+2]);
+ iarg += 3;
} else if (strcmp(arg[iarg],"-help") == 0 ||
strcmp(arg[iarg],"-h") == 0) {
if (iarg+1 > narg)
error->universe_all(FLERR,"Invalid command-line argument");
helpflag = 1;
iarg += 1;
} else error->universe_all(FLERR,"Invalid command-line argument");
}
// if no partition command-line switch, universe is one world with all procs
if (universe->existflag == 0) universe->add_world(NULL);
// sum of procs in all worlds must equal total # of procs
if (!universe->consistent())
error->universe_all(FLERR,"Processor partitions are inconsistent");
// universe cannot use stdin for input file
if (universe->existflag && inflag == 0)
error->universe_all(FLERR,"Must use -in switch with multiple partitions");
// if no partition command-line switch, cannot use -pscreen option
if (universe->existflag == 0 && partscreenflag)
error->universe_all(FLERR,"Can only use -pscreen with multiple partitions");
// if no partition command-line switch, cannot use -plog option
if (universe->existflag == 0 && partlogflag)
error->universe_all(FLERR,"Can only use -plog with multiple partitions");
// set universe screen and logfile
if (universe->me == 0) {
if (screenflag == 0)
universe->uscreen = stdout;
else if (strcmp(arg[screenflag],"none") == 0)
universe->uscreen = NULL;
else {
universe->uscreen = fopen(arg[screenflag],"w");
if (universe->uscreen == NULL)
error->universe_one(FLERR,"Cannot open universe screen file");
}
if (logflag == 0) {
universe->ulogfile = fopen("log.lammps","w");
if (universe->ulogfile == NULL)
error->universe_one(FLERR,"Cannot open log.lammps");
} else if (strcmp(arg[logflag],"none") == 0)
universe->ulogfile = NULL;
else {
universe->ulogfile = fopen(arg[logflag],"w");
if (universe->ulogfile == NULL)
error->universe_one(FLERR,"Cannot open universe log file");
}
}
if (universe->me > 0) {
if (screenflag == 0) universe->uscreen = stdout;
else universe->uscreen = NULL;
universe->ulogfile = NULL;
}
// make universe and single world the same, since no partition switch
// world inherits settings from universe
// set world screen, logfile, communicator, infile
// open input script if from file
if (universe->existflag == 0) {
screen = universe->uscreen;
logfile = universe->ulogfile;
world = universe->uworld;
infile = NULL;
if (universe->me == 0) {
if (inflag == 0) infile = stdin;
else infile = fopen(arg[inflag],"r");
if (infile == NULL) {
char str[128];
sprintf(str,"Cannot open input script %s",arg[inflag]);
error->one(FLERR,str);
}
}
if (universe->me == 0) {
if (screen) fprintf(screen,"LAMMPS (%s)\n",universe->version);
if (logfile) fprintf(logfile,"LAMMPS (%s)\n",universe->version);
}
// universe is one or more worlds, as setup by partition switch
// split universe communicator into separate world communicators
// set world screen, logfile, communicator, infile
// open input script
} else {
int me;
MPI_Comm_split(universe->uworld,universe->iworld,0,&world);
MPI_Comm_rank(world,&me);
if (me == 0)
if (partscreenflag == 0)
if (screenflag == 0) {
char str[32];
sprintf(str,"screen.%d",universe->iworld);
screen = fopen(str,"w");
if (screen == NULL) error->one(FLERR,"Cannot open screen file");
} else if (strcmp(arg[screenflag],"none") == 0)
screen = NULL;
else {
char str[128];
sprintf(str,"%s.%d",arg[screenflag],universe->iworld);
screen = fopen(str,"w");
if (screen == NULL) error->one(FLERR,"Cannot open screen file");
}
else if (strcmp(arg[partscreenflag],"none") == 0)
screen = NULL;
else {
char str[128];
sprintf(str,"%s.%d",arg[partscreenflag],universe->iworld);
screen = fopen(str,"w");
if (screen == NULL) error->one(FLERR,"Cannot open screen file");
} else screen = NULL;
if (me == 0)
if (partlogflag == 0)
if (logflag == 0) {
char str[32];
sprintf(str,"log.lammps.%d",universe->iworld);
logfile = fopen(str,"w");
if (logfile == NULL) error->one(FLERR,"Cannot open logfile");
} else if (strcmp(arg[logflag],"none") == 0)
logfile = NULL;
else {
char str[128];
sprintf(str,"%s.%d",arg[logflag],universe->iworld);
logfile = fopen(str,"w");
if (logfile == NULL) error->one(FLERR,"Cannot open logfile");
}
else if (strcmp(arg[partlogflag],"none") == 0)
logfile = NULL;
else {
char str[128];
sprintf(str,"%s.%d",arg[partlogflag],universe->iworld);
logfile = fopen(str,"w");
if (logfile == NULL) error->one(FLERR,"Cannot open logfile");
} else logfile = NULL;
if (me == 0) {
infile = fopen(arg[inflag],"r");
if (infile == NULL) {
char str[128];
sprintf(str,"Cannot open input script %s",arg[inflag]);
error->one(FLERR,str);
}
} else infile = NULL;
// screen and logfile messages for universe and world
if (universe->me == 0) {
if (universe->uscreen) {
fprintf(universe->uscreen,"LAMMPS (%s)\n",universe->version);
fprintf(universe->uscreen,"Running on %d partitions of processors\n",
universe->nworlds);
}
if (universe->ulogfile) {
fprintf(universe->ulogfile,"LAMMPS (%s)\n",universe->version);
fprintf(universe->ulogfile,"Running on %d partitions of processors\n",
universe->nworlds);
}
}
if (me == 0) {
if (screen) {
fprintf(screen,"LAMMPS (%s)\n",universe->version);
fprintf(screen,"Processor partition = %d\n",universe->iworld);
}
if (logfile) {
fprintf(logfile,"LAMMPS (%s)\n",universe->version);
fprintf(logfile,"Processor partition = %d\n",universe->iworld);
}
}
}
// check datatype settings in lmptype.h
if (sizeof(smallint) != sizeof(int))
error->all(FLERR,"Smallint setting in lmptype.h is invalid");
if (sizeof(tagint) < sizeof(smallint))
error->all(FLERR,"Tagint setting in lmptype.h is invalid");
if (sizeof(bigint) < sizeof(tagint))
error->all(FLERR,"Bigint setting in lmptype.h is invalid");
int mpisize;
MPI_Type_size(MPI_LMP_TAGINT,&mpisize);
if (mpisize != sizeof(tagint))
error->all(FLERR,
"MPI_LMP_TAGINT and tagint in lmptype.h are not compatible");
MPI_Type_size(MPI_LMP_BIGINT,&mpisize);
if (mpisize != sizeof(bigint))
error->all(FLERR,
"MPI_LMP_BIGINT and bigint in lmptype.h are not compatible");
#ifdef LAMMPS_SMALLBIG
if (sizeof(smallint) != 4 || sizeof(tagint) != 4 || sizeof(bigint) != 8)
error->all(FLERR,"Small, tag, big integers are not sized correctly");
#endif
#ifdef LAMMPS_BIGBIG
if (sizeof(smallint) != 4 || sizeof(tagint) != 8 || sizeof(bigint) != 8)
error->all(FLERR,"Small, tag, big integers are not sized correctly");
#endif
#ifdef LAMMPS_SMALLSMALL
if (sizeof(smallint) != 4 || sizeof(tagint) != 4 || sizeof(bigint) != 4)
error->all(FLERR,"Small, tag, big integers are not sized correctly");
#endif
if (sizeof(tagint) == 8)
error->all(FLERR,"64-bit atom IDs are not yet supported");
// create CUDA class if USER-CUDA installed, unless explicitly switched off
// instantiation creates dummy CUDA class if USER-CUDA is not installed
if (cudaflag == 0) {
cuda = NULL;
} else if (cudaflag == 1) {
cuda = new Cuda(this);
if (!cuda->cuda_exists)
error->all(FLERR,"Cannot use -cuda on without USER-CUDA installed");
} else {
cuda = new Cuda(this);
if (!cuda->cuda_exists) {
delete cuda;
cuda = NULL;
}
}
int me;
MPI_Comm_rank(world,&me);
if (cuda && me == 0) error->message(FLERR,"USER-CUDA mode is enabled");
// allocate input class now that MPI is fully setup
input = new Input(this,narg,arg);
// allocate top-level classes
create();
post_create();
// if helpflag set, print help and exit
if (helpflag) {
if (universe->me == 0) print_styles();
error->done();
}
}
/* ----------------------------------------------------------------------
shutdown LAMMPS
delete top-level classes
close screen and log files in world and universe
output files were already closed in destroy()
delete fundamental classes
------------------------------------------------------------------------- */
LAMMPS::~LAMMPS()
{
destroy();
if (universe->nworlds == 1) {
if (logfile) fclose(logfile);
} else {
if (screen && screen != stdout) fclose(screen);
if (logfile) fclose(logfile);
if (universe->ulogfile) fclose(universe->ulogfile);
}
if (world != universe->uworld) MPI_Comm_free(&world);
delete cuda;
delete [] suffix;
delete input;
delete universe;
delete error;
delete memory;
}
/* ----------------------------------------------------------------------
allocate single instance of top-level classes
fundamental classes are allocated in constructor
some classes have package variants
------------------------------------------------------------------------- */
void LAMMPS::create()
{
atom = new Atom(this);
if (cuda) neighbor = new NeighborCuda(this);
else neighbor = new Neighbor(this);
if (cuda) comm = new CommCuda(this);
else comm = new Comm(this);
if (cuda) domain = new DomainCuda(this);
else domain = new Domain(this);
group = new Group(this);
force = new Force(this); // must be after group, to create temperature
if (cuda) modify = new ModifyCuda(this);
else modify = new Modify(this);
output = new Output(this); // must be after group, so "all" exists
// must be after modify so can create Computes
update = new Update(this); // must be after output, force, neighbor
timer = new Timer(this);
}
/* ----------------------------------------------------------------------
invoke package-specific setup commands
called from LAMMPS constructor and after clear() command
only invoke if suffix is set and enabled
------------------------------------------------------------------------- */
void LAMMPS::post_create()
{
if (suffix && suffix_enable) {
if (strcmp(suffix,"gpu") == 0) input->one("package gpu force/neigh 0 0 1");
if (strcmp(suffix,"omp") == 0) input->one("package omp *");
}
}
/* ----------------------------------------------------------------------
initialize top-level classes
do not initialize Timer class, other classes like Run() do that explicitly
------------------------------------------------------------------------- */
void LAMMPS::init()
{
if (cuda) cuda->accelerator(0,NULL);
update->init();
force->init(); // pair must come after update due to minimizer
domain->init();
atom->init(); // atom must come after force and domain
// atom deletes extra array
// used by fix shear_history::unpack_restart()
// when force->pair->gran_history creates fix ??
// atom_vec init uses deform_vremap
modify->init(); // modify must come after update, force, atom, domain
neighbor->init(); // neighbor must come after force, modify
comm->init(); // comm must come after force, modify, neighbor, atom
output->init(); // output must come after domain, force, modify
}
/* ----------------------------------------------------------------------
delete single instance of top-level classes
fundamental classes are deleted in destructor
------------------------------------------------------------------------- */
void LAMMPS::destroy()
{
delete update;
delete neighbor;
delete comm;
delete force;
delete group;
delete output;
delete modify; // modify must come after output, force, update
// since they delete fixes
delete domain; // domain must come after modify
// since fix destructors access domain
delete atom; // atom must come after modify, neighbor
// since fixes delete callbacks in atom
delete timer;
}
/* ----------------------------------------------------------------------
for each style, print name of all child classes build into executable
------------------------------------------------------------------------- */
void LAMMPS::print_styles()
{
printf("\nList of style options included in this executable:\n\n");
printf("Atom styles:");
#define ATOM_CLASS
#define AtomStyle(key,Class) printf(" %s",#key);
#include "style_atom.h"
#undef ATOM_CLASS
printf("\n\n");
printf("Integrate styles:");
#define INTEGRATE_CLASS
#define IntegrateStyle(key,Class) printf(" %s",#key);
#include "style_integrate.h"
#undef INTEGRATE_CLASS
printf("\n\n");
printf("Minimize styles:");
#define MINIMIZE_CLASS
#define MinimizeStyle(key,Class) printf(" %s",#key);
#include "style_minimize.h"
#undef MINIMIZE_CLASS
printf("\n\n");
printf("Pair styles:");
#define PAIR_CLASS
#define PairStyle(key,Class) printf(" %s",#key);
#include "style_pair.h"
#undef PAIR_CLASS
printf("\n\n");
printf("Bond styles:");
#define BOND_CLASS
#define BondStyle(key,Class) printf(" %s",#key);
#include "style_bond.h"
#undef BOND_CLASS
printf("\n\n");
printf("Angle styles:");
#define ANGLE_CLASS
#define AngleStyle(key,Class) printf(" %s",#key);
#include "style_angle.h"
#undef ANGLE_CLASS
printf("\n\n");
printf("Dihedral styles:");
#define DIHEDRAL_CLASS
#define DihedralStyle(key,Class) printf(" %s",#key);
#include "style_dihedral.h"
#undef DIHEDRAL_CLASS
printf("\n\n");
printf("Improper styles:");
#define IMPROPER_CLASS
#define ImproperStyle(key,Class) printf(" %s",#key);
#include "style_improper.h"
#undef IMPROPER_CLASS
printf("\n\n");
printf("KSpace styles:");
#define KSPACE_CLASS
#define KSpaceStyle(key,Class) printf(" %s",#key);
#include "style_kspace.h"
#undef KSPACE_CLASS
printf("\n\n");
printf("Fix styles (upper case are only for internal use):");
#define FIX_CLASS
#define FixStyle(key,Class) printf(" %s",#key);
#include "style_fix.h"
#undef FIX_CLASS
printf("\n\n");
printf("Compute styles:");
#define COMPUTE_CLASS
#define ComputeStyle(key,Class) printf(" %s",#key);
#include "style_compute.h"
#undef COMPUTE_CLASS
printf("\n\n");
printf("Region styles:");
#define REGION_CLASS
#define RegionStyle(key,Class) printf(" %s",#key);
#include "style_region.h"
#undef REGION_CLASS
printf("\n\n");
printf("Dump styles:");
#define DUMP_CLASS
#define DumpStyle(key,Class) printf(" %s",#key);
#include "style_dump.h"
#undef DUMP_CLASS
printf("\n\n");
printf("Command styles (add-on input script commands):");
#define COMMAND_CLASS
#define CommandStyle(key,Class) printf(" %s",#key);
#include "style_command.h"
#undef COMMAND_CLASS
printf("\n");
}
diff --git a/src/lammps.h b/src/lammps.h
index 811e01b2a..7a6b74d01 100644
--- a/src/lammps.h
+++ b/src/lammps.h
@@ -1,61 +1,156 @@
/* ----------------------------------------------------------------------
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_LAMMPS_H
#define LMP_LAMMPS_H
#include "stdio.h"
namespace LAMMPS_NS {
class LAMMPS {
public:
// ptrs to fundamental LAMMPS classes
class Memory *memory; // memory allocation functions
class Error *error; // error handling
class Universe *universe; // universe of processors
class Input *input; // input script processing
// ptrs to top-level LAMMPS-specific classes
class Atom *atom; // atom-based quantities
class Update *update; // integrators/minimizers
class Neighbor *neighbor; // neighbor lists
class Comm *comm; // inter-processor communication
class Domain *domain; // simulation box
class Force *force; // inter-particle forces
class Modify *modify; // fixes and computes
class Group *group; // groups of atoms
class Output *output; // thermo/dump/restart
class Timer *timer; // CPU timing info
MPI_Comm world; // MPI communicator
FILE *infile; // infile
FILE *screen; // screen output
FILE *logfile; // logfile
char *suffix; // suffix to add to input script style names
int suffix_enable; // 1 if suffix enabled, 0 if disabled
class Cuda *cuda; // CUDA accelerator class
LAMMPS(int, char **, MPI_Comm);
~LAMMPS();
void create();
void post_create();
void init();
void destroy();
void print_styles();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Invalid command-line argument
+
+One or more command-line arguments is invalid. Check the syntax of
+the command you are using to launch LAMMPS.
+
+E: Cannot use -reorder after -partition
+
+UNDOCUMENTED
+
+E: Processor partitions are inconsistent
+
+The total number of processors in all partitions must match the number
+of processors LAMMPS is running on.
+
+E: Must use -in switch with multiple partitions
+
+A multi-partition simulation cannot read the input script from stdin.
+The -in command-line option must be used to specify a file.
+
+E: Can only use -pscreen with multiple partitions
+
+UNDOCUMENTED
+
+E: Can only use -plog with multiple partitions
+
+UNDOCUMENTED
+
+E: Cannot open universe screen file
+
+For a multi-partition run, the master screen file cannot be opened.
+Check that the directory you are running in allows for files to be
+created.
+
+E: Cannot open log.lammps
+
+The default LAMMPS log file cannot be opened. Check that the
+directory you are running in allows for files to be created.
+
+E: Cannot open universe log file
+
+For a multi-partition run, the master log file cannot be opened.
+Check that the directory you are running in allows for files to be
+created.
+
+E: Cannot open input script %s
+
+Self-explanatory.
+
+E: Cannot open screen file
+
+The screen file specified as a command-line argument cannot be
+opened. Check that the directory you are running in allows for files
+to be created.
+
+E: Cannot open logfile
+
+The LAMMPS log file named in a command-line argument cannot be opened.
+Check that the path and name are correct.
+
+E: Smallint setting in lmptype.h is invalid
+
+It has to be the size of an integer.
+
+E: Tagint setting in lmptype.h is invalid
+
+Tagint must be as large or larger than smallint.
+
+E: Bigint setting in lmptype.h is invalid
+
+Size of bigint is less than size of tagint.
+
+E: MPI_LMP_TAGINT and tagint in lmptype.h are not compatible
+
+The size of the MPI datatype does not match the size of a tagint.
+
+E: MPI_LMP_BIGINT and bigint in lmptype.h are not compatible
+
+The size of the MPI datatype does not match the size of a bigint.
+
+E: Small, tag, big integers are not sized correctly
+
+UNDOCUMENTED
+
+E: 64-bit atom IDs are not yet supported
+
+UNDOCUMENTED
+
+E: Cannot use -cuda on without USER-CUDA installed
+
+UNDOCUMENTED
+
+*/
diff --git a/src/lattice.h b/src/lattice.h
index f38d2ac55..c53985665 100644
--- a/src/lattice.h
+++ b/src/lattice.h
@@ -1,60 +1,116 @@
/* ----------------------------------------------------------------------
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_LATTICE_H
#define LMP_LATTICE_H
#include "pointers.h"
namespace LAMMPS_NS {
class Lattice : protected Pointers {
public:
int style; // enum list of NONE,SC,FCC,etc
double xlattice,ylattice,zlattice; // lattice scale factors in 3 dims
double a1[3],a2[3],a3[3]; // edge vectors of unit cell
int nbasis; // # of basis atoms in unit cell
double **basis; // fractional coords of each basis atom
// within unit cell (0 <= coord < 1)
Lattice(class LAMMPS *, int, char **);
~Lattice();
void lattice2box(double &, double &, double &);
void box2lattice(double &, double &, double &);
void bbox(int, double, double, double,
double &, double &, double &, double &, double &, double &);
private:
double scale;
double origin[3]; // lattice origin
int orientx[3]; // lattice orientation vecs
int orienty[3]; // orientx = what lattice dir lies
int orientz[3]; // along x dim in box
double primitive[3][3]; // lattice <-> box transform matrices
double priminv[3][3];
double rotaterow[3][3];
double rotatecol[3][3];
int orthogonal();
int right_handed();
int collinear();
void setup_transform();
void add_basis(double, double, double);
double dot(double *, double *);
void cross(double *, double *, double *);
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+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: Lattice style incompatible with simulation dimension
+
+2d simulation can use sq, sq2, or hex lattice. 3d simulation can use
+sc, bcc, or fcc lattice.
+
+E: Invalid option in lattice command for non-custom style
+
+Certain lattice keywords are not supported unless the
+lattice style is "custom".
+
+E: No basis atoms in lattice
+
+Basis atoms must be defined for lattice style user.
+
+E: Lattice orient vectors are not orthogonal
+
+The three specified lattice orientation vectors must be mutually
+orthogonal.
+
+E: Lattice orient vectors are not right-handed
+
+The three specified lattice orientation vectors must create a
+right-handed coordinate system such that a1 cross a2 = a3.
+
+E: Lattice primitive vectors are collinear
+
+The specified lattice primitive vectors do not for a unit cell with
+non-zero volume.
+
+E: Lattice settings are not compatible with 2d simulation
+
+One or more of the specified lattice vectors has a non-zero z
+component.
+
+E: Lattice spacings are invalid
+
+Each x,y,z spacing must be > 0.
+
+E: Degenerate lattice primitive vectors
+
+Invalid set of 3 lattice vectors for lattice command.
+
+E: Zero-length lattice orient vector
+
+Self-explanatory.
+
+*/
diff --git a/src/library.h b/src/library.h
index 3d692b4f5..213a004c2 100644
--- a/src/library.h
+++ b/src/library.h
@@ -1,46 +1,49 @@
/* ----------------------------------------------------------------------
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.
------------------------------------------------------------------------- */
/*
C or Fortran style library interface to LAMMPS
new LAMMPS-specific functions can be added
*/
#include "mpi.h"
/* ifdefs allow this file to be included in a C program */
#ifdef __cplusplus
extern "C" {
#endif
void lammps_open(int, char **, MPI_Comm, void **);
void lammps_open_no_mpi(int, char **, void **);
void lammps_close(void *);
void lammps_file(void *, char *);
char *lammps_command(void *, char *);
void lammps_free(void *);
void *lammps_extract_global(void *, char *);
void *lammps_extract_atom(void *, char *);
void *lammps_extract_compute(void *, char *, int, int);
void *lammps_extract_fix(void *, char *, int, int, int, int);
void *lammps_extract_variable(void *, char *, char *);
int lammps_get_natoms(void *);
void lammps_get_coords(void *, double *);
void lammps_put_coords(void *, double *);
#ifdef __cplusplus
}
#endif
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/memory.h b/src/memory.h
index 94ff8f19b..ccbc66f71 100644
--- a/src/memory.h
+++ b/src/memory.h
@@ -1,482 +1,501 @@
/* ----------------------------------------------------------------------
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_MEMORY_H
#define LMP_MEMORY_H
#include "lmptype.h"
#include "pointers.h"
namespace LAMMPS_NS {
class Memory : protected Pointers {
public:
Memory(class LAMMPS *);
void *smalloc(bigint n, const char *);
void *srealloc(void *, bigint n, const char *);
void sfree(void *);
void fail(const char *);
/* ----------------------------------------------------------------------
create/grow/destroy vecs and multidim arrays with contiguous memory blocks
only use with primitive data types, e.g. 1d vec of ints, 2d array of doubles
cannot use with pointers, e.g. 1d vec of int*, due to mismatched destroy
avoid use with non-primitive data types to avoid code bloat
for these other cases, use smalloc/srealloc/sfree directly
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
create a 1d array
------------------------------------------------------------------------- */
template <typename TYPE>
TYPE *create(TYPE *&array, int n, const char *name)
{
bigint nbytes = ((bigint) sizeof(TYPE)) * n;
array = (TYPE *) smalloc(nbytes,name);
return array;
}
template <typename TYPE>
TYPE **create(TYPE **&array, int n, const char *name) {fail(name);}
/* ----------------------------------------------------------------------
grow or shrink 1d array
------------------------------------------------------------------------- */
template <typename TYPE>
TYPE *grow(TYPE *&array, int n, const char *name)
{
if (array == NULL) return create(array,n,name);
bigint nbytes = ((bigint) sizeof(TYPE)) * n;
array = (TYPE *) srealloc(array,nbytes,name);
return array;
}
template <typename TYPE>
TYPE **grow(TYPE **&array, int n, const char *name) {fail(name);}
/* ----------------------------------------------------------------------
destroy a 1d array
------------------------------------------------------------------------- */
template <typename TYPE>
void destroy(TYPE *array)
{
sfree(array);
}
/* ----------------------------------------------------------------------
create a 1d array with index from nlo to nhi inclusive
cannot grow it
------------------------------------------------------------------------- */
template <typename TYPE>
TYPE *create1d_offset(TYPE *&array, int nlo, int nhi, const char *name)
{
bigint nbytes = ((bigint) sizeof(TYPE)) * (nhi-nlo+1);
array = (TYPE *) smalloc(nbytes,name);
array -= nlo;
return array;
}
template <typename TYPE>
TYPE **create1d_offset(TYPE **&array, int nlo, int nhi, const char *name)
{fail(name);}
/* ----------------------------------------------------------------------
destroy a 1d array with index offset
------------------------------------------------------------------------- */
template <typename TYPE>
void destroy1d_offset(TYPE *array, int offset)
{
if (array) sfree(&array[offset]);
}
/* ----------------------------------------------------------------------
create a 2d array
------------------------------------------------------------------------- */
template <typename TYPE>
TYPE **create(TYPE **&array, int n1, int n2, const char *name)
{
bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2;
TYPE *data = (TYPE *) smalloc(nbytes,name);
nbytes = ((bigint) sizeof(TYPE *)) * n1;
array = (TYPE **) smalloc(nbytes,name);
bigint n = 0;
for (int i = 0; i < n1; i++) {
array[i] = &data[n];
n += n2;
}
return array;
}
template <typename TYPE>
TYPE ***create(TYPE ***&array, int n1, int n2, const char *name)
{fail(name);}
/* ----------------------------------------------------------------------
grow or shrink 1st dim of a 2d array
last dim must stay the same
------------------------------------------------------------------------- */
template <typename TYPE>
TYPE **grow(TYPE **&array, int n1, int n2, const char *name)
{
if (array == NULL) return create(array,n1,n2,name);
bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2;
TYPE *data = (TYPE *) srealloc(array[0],nbytes,name);
nbytes = ((bigint) sizeof(TYPE *)) * n1;
array = (TYPE **) srealloc(array,nbytes,name);
bigint n = 0;
for (int i = 0; i < n1; i++) {
array[i] = &data[n];
n += n2;
}
return array;
}
template <typename TYPE>
TYPE ***grow(TYPE ***&array, int n1, int n2, const char *name)
{fail(name);}
/* ----------------------------------------------------------------------
destroy a 2d array
------------------------------------------------------------------------- */
template <typename TYPE>
void destroy(TYPE **array)
{
if (array == NULL) return;
sfree(array[0]);
sfree(array);
}
/* ----------------------------------------------------------------------
create a 2d array with a ragged 2nd dimension
------------------------------------------------------------------------- */
template <typename TYPE>
TYPE **create_ragged(TYPE **&array, int n1, int *n2, const char *name)
{
bigint n2sum = 0;
for (int i = 0; i < n1; i++) n2sum += n2[i];
bigint nbytes = ((bigint) sizeof(TYPE)) * n2sum;
TYPE *data = (TYPE *) smalloc(nbytes,name);
nbytes = ((bigint) sizeof(TYPE *)) * n1;
array = (TYPE **) smalloc(nbytes,name);
bigint n = 0;
for (int i = 0; i < n1; i++) {
array[i] = &data[n];
n += n2[i];
}
return array;
}
template <typename TYPE>
TYPE ***create_ragged(TYPE ***&array, int n1, int *n2, const char *name)
{fail(name);}
/* ----------------------------------------------------------------------
create a 2d array with 2nd index from n2lo to n2hi inclusive
cannot grow it
------------------------------------------------------------------------- */
template <typename TYPE>
TYPE **create2d_offset(TYPE **&array, int n1, int n2lo, int n2hi,
const char *name)
{
int n2 = n2hi - n2lo + 1;
create(array,n1,n2,name);
for (int i = 0; i < n1; i++) array[i] -= n2lo;
return array;
}
template <typename TYPE>
TYPE ***create2d_offset(TYPE ***&array, int n1, int n2lo, int n2hi,
const char *name) {fail(name);}
/* ----------------------------------------------------------------------
destroy a 2d array with 2nd index offset
------------------------------------------------------------------------- */
template <typename TYPE>
void destroy2d_offset(TYPE **array, int offset)
{
if (array == NULL) return;
sfree(&array[0][offset]);
sfree(array);
}
/* ----------------------------------------------------------------------
create a 3d array
------------------------------------------------------------------------- */
template <typename TYPE>
TYPE ***create(TYPE ***&array, int n1, int n2, int n3, const char *name)
{
bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3;
TYPE *data = (TYPE *) smalloc(nbytes,name);
nbytes = ((bigint) sizeof(TYPE *)) * n1*n2;
TYPE **plane = (TYPE **) smalloc(nbytes,name);
nbytes = ((bigint) sizeof(TYPE **)) * n1;
array = (TYPE ***) smalloc(nbytes,name);
int i,j;
bigint m;
bigint n = 0;
for (i = 0; i < n1; i++) {
m = ((bigint) i) * n2;
array[i] = &plane[m];
for (j = 0; j < n2; j++) {
plane[m+j] = &data[n];
n += n3;
}
}
return array;
}
template <typename TYPE>
TYPE ****create(TYPE ****&array, int n1, int n2, int n3, const char *name)
{fail(name);}
/* ----------------------------------------------------------------------
grow or shrink 1st dim of a 3d array
last 2 dims must stay the same
------------------------------------------------------------------------- */
template <typename TYPE>
TYPE ***grow(TYPE ***&array, int n1, int n2, int n3, const char *name)
{
if (array == NULL) return create(array,n1,n2,n3,name);
bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3;
TYPE *data = (TYPE *) srealloc(array[0][0],nbytes,name);
nbytes = ((bigint) sizeof(TYPE *)) * n1*n2;
TYPE **plane = (TYPE **) srealloc(array[0],nbytes,name);
nbytes = ((bigint) sizeof(TYPE **)) * n1;
array = (TYPE ***) srealloc(array,nbytes,name);
int i,j;
bigint m;
bigint n = 0;
for (i = 0; i < n1; i++) {
m = ((bigint) i) * n2;
array[i] = &plane[m];
for (j = 0; j < n2; j++) {
plane[m+j] = &data[n];
n += n3;
}
}
return array;
}
template <typename TYPE>
TYPE ****grow(TYPE ****&array, int n1, int n2, int n3, const char *name)
{fail(name);}
/* ----------------------------------------------------------------------
destroy a 3d array
------------------------------------------------------------------------- */
template <typename TYPE>
void destroy(TYPE ***array)
{
if (array == NULL) return;
sfree(array[0][0]);
sfree(array[0]);
sfree(array);
}
/* ----------------------------------------------------------------------
create a 3d array with 1st index from n1lo to n1hi inclusive
cannot grow it
------------------------------------------------------------------------- */
template <typename TYPE>
TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi,
int n2, int n3, const char *name)
{
int n1 = n1hi - n1lo + 1;
create(array,n1,n2,n3,name);
array -= n1lo;
return array;
}
template <typename TYPE>
TYPE ****create3d_offset(TYPE ****&array, int n1lo, int n1hi,
int n2, int n3, const char *name)
{fail(name);}
/* ----------------------------------------------------------------------
free a 3d array with 1st index offset
------------------------------------------------------------------------- */
template <typename TYPE>
void destroy3d_offset(TYPE ***array, int offset)
{
if (array) destroy(&array[offset]);
}
/* ----------------------------------------------------------------------
create a 3d array with
1st index from n1lo to n1hi inclusive,
2nd index from n2lo to n2hi inclusive,
3rd index from n3lo to n3hi inclusive
cannot grow it
------------------------------------------------------------------------- */
template <typename TYPE>
TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi,
int n2lo, int n2hi, int n3lo, int n3hi,
const char *name)
{
int n1 = n1hi - n1lo + 1;
int n2 = n2hi - n2lo + 1;
int n3 = n3hi - n3lo + 1;
create(array,n1,n2,n3,name);
bigint m = ((bigint) n1) * n2;
for (bigint i = 0; i < m; i++) array[0][i] -= n3lo;
for (int i = 0; i < n1; i++) array[i] -= n2lo;
array -= n1lo;
return array;
}
template <typename TYPE>
TYPE ****create3d_offset(TYPE ****&array, int n1lo, int n1hi,
int n2lo, int n2hi, int n3lo, int n3hi,
const char *name)
{fail(name);}
/* ----------------------------------------------------------------------
free a 3d array with all 3 indices offset
------------------------------------------------------------------------- */
template <typename TYPE>
void destroy3d_offset(TYPE ***array,
int n1_offset, int n2_offset, int n3_offset)
{
if (array == NULL) return;
sfree(&array[n1_offset][n2_offset][n3_offset]);
sfree(&array[n1_offset][n2_offset]);
sfree(&array[n1_offset]);
}
/* ----------------------------------------------------------------------
create a 4d array
------------------------------------------------------------------------- */
template <typename TYPE>
TYPE ****create(TYPE ****&array, int n1, int n2, int n3, int n4,
const char *name)
{
bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4;
TYPE *data = (TYPE *) smalloc(nbytes,name);
nbytes = ((bigint) sizeof(TYPE *)) * n1*n2*n3;
TYPE **cube = (TYPE **) smalloc(nbytes,name);
nbytes = ((bigint) sizeof(TYPE **)) * n1*n2;
TYPE ***plane = (TYPE ***) smalloc(nbytes,name);
nbytes = ((bigint) sizeof(TYPE ***)) * n1;
array = (TYPE ****) smalloc(nbytes,name);
int i,j,k;
bigint m1,m2,m3;
bigint n = 0;
for (i = 0; i < n1; i++) {
m2 = ((bigint) i) * n2;
array[i] = &plane[m2];
for (j = 0; j < n2; j++) {
m1 = ((bigint) i) * n2 + j;
m2 = ((bigint) i) * n2*n3 + j*n3;
plane[m1] = &cube[m2];
for (k = 0; k < n3; k++) {
m1 = ((bigint) i) * n2*n3 + j*n3 + k;
cube[m1] = &data[n];
n += n4;
}
}
}
return array;
}
template <typename TYPE>
TYPE *****create(TYPE *****&array, int n1, int n2, int n3, int n4,
const char *name)
{fail(name);}
/* ----------------------------------------------------------------------
destroy a 4d array
------------------------------------------------------------------------- */
template <typename TYPE>
void destroy(TYPE ****array)
{
if (array == NULL) return;
sfree(array[0][0][0]);
sfree(array[0][0]);
sfree(array[0]);
sfree(array);
}
/* ----------------------------------------------------------------------
memory usage of arrays, including pointers
------------------------------------------------------------------------- */
template <typename TYPE>
bigint usage(TYPE *array, int n)
{
bigint bytes = ((bigint) sizeof(TYPE)) * n;
return bytes;
}
template <typename TYPE>
bigint usage(TYPE **array, int n1, int n2)
{
bigint bytes = ((bigint) sizeof(TYPE)) * n1*n2;
bytes += ((bigint) sizeof(TYPE *)) * n1;
return bytes;
}
template <typename TYPE>
bigint usage(TYPE ***array, int n1, int n2, int n3)
{
bigint bytes = ((bigint) sizeof(TYPE)) * n1*n2*n3;
bytes += ((bigint) sizeof(TYPE *)) * n1*n2;
bytes += ((bigint) sizeof(TYPE **)) * n1;
return bytes;
}
template <typename TYPE>
bigint usage(TYPE ****array, int n1, int n2, int n3, int n4)
{
bigint bytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4;
bytes += ((bigint) sizeof(TYPE *)) * n1*n2*n3;
bytes += ((bigint) sizeof(TYPE **)) * n1*n2;
bytes += ((bigint) sizeof(TYPE ***)) * n1;
return bytes;
}
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Failed to allocate %ld bytes for array %s
+
+Your LAMMPS simulation has run out of memory. You need to run a
+smaller simulation or on more processors. :dd
+
+E: Failed to reallocate %ld bytes for array %s
+
+Your LAMMPS simulation has run out of memory. You need to run a
+smaller simulation or on more processors. :dd
+
+E: Cannot create/grow a vector/array of pointers for %s
+
+LAMMPS code is making an illegal call to the templated memory
+allocaters, to create a vector or array of pointers.
+
+*/
diff --git a/src/min.cpp b/src/min.cpp
index eebfd03dc..d4e841e2a 100644
--- a/src/min.cpp
+++ b/src/min.cpp
@@ -1,764 +1,764 @@
/* ----------------------------------------------------------------------
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: Aidan Thompson (SNL)
improved CG and backtrack ls, added quadratic ls
Sources: Numerical Recipes frprmn routine
"Conjugate Gradient Method Without the Agonizing Pain" by
JR Shewchuk, http://www-2.cs.cmu.edu/~jrs/jrspapers.html#cg
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "math.h"
#include "stdlib.h"
#include "string.h"
#include "min.h"
#include "atom.h"
#include "domain.h"
#include "comm.h"
#include "update.h"
#include "modify.h"
#include "fix_minimize.h"
#include "compute.h"
#include "neighbor.h"
#include "force.h"
#include "pair.h"
#include "bond.h"
#include "angle.h"
#include "dihedral.h"
#include "improper.h"
#include "kspace.h"
#include "output.h"
#include "thermo.h"
#include "timer.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
Min::Min(LAMMPS *lmp) : Pointers(lmp)
{
dmax = 0.1;
searchflag = 0;
linestyle = 0;
elist_global = elist_atom = NULL;
vlist_global = vlist_atom = NULL;
nextra_global = 0;
fextra = NULL;
nextra_atom = 0;
xextra_atom = fextra_atom = NULL;
extra_peratom = extra_nlen = NULL;
extra_max = NULL;
requestor = NULL;
external_force_clear = 0;
}
/* ---------------------------------------------------------------------- */
Min::~Min()
{
delete [] elist_global;
delete [] elist_atom;
delete [] vlist_global;
delete [] vlist_atom;
delete [] fextra;
memory->sfree(xextra_atom);
memory->sfree(fextra_atom);
memory->destroy(extra_peratom);
memory->destroy(extra_nlen);
memory->destroy(extra_max);
memory->sfree(requestor);
}
/* ---------------------------------------------------------------------- */
void Min::init()
{
// create fix needed for storing atom-based quantities
// will delete it at end of run
char **fixarg = new char*[3];
fixarg[0] = (char *) "MINIMIZE";
fixarg[1] = (char *) "all";
fixarg[2] = (char *) "MINIMIZE";
modify->add_fix(3,fixarg);
delete [] fixarg;
fix_minimize = (FixMinimize *) modify->fix[modify->nfix-1];
// clear out extra global and per-atom dof
// will receive requests for new per-atom dof during pair init()
// can then add vectors to fix_minimize in setup()
nextra_global = 0;
delete [] fextra;
fextra = NULL;
nextra_atom = 0;
memory->sfree(xextra_atom);
memory->sfree(fextra_atom);
memory->destroy(extra_peratom);
memory->destroy(extra_nlen);
memory->destroy(extra_max);
memory->sfree(requestor);
xextra_atom = fextra_atom = NULL;
extra_peratom = extra_nlen = NULL;
extra_max = NULL;
requestor = NULL;
// virial_style:
// 1 if computed explicitly by pair->compute via sum over pair interactions
// 2 if computed implicitly by pair->virial_compute via sum over ghost atoms
if (force->newton_pair) virial_style = 2;
else virial_style = 1;
// setup lists of computes for global and per-atom PE and pressure
ev_setup();
// detect if fix omp is present for clearing force arrays
int ifix = modify->find_fix("package_omp");
if (ifix >= 0) external_force_clear = 1;
// set flags for what arrays to clear in force_clear()
// need to clear additionals arrays if they exist
torqueflag = 0;
if (atom->torque_flag) torqueflag = 1;
erforceflag = 0;
if (atom->erforce_flag) erforceflag = 1;
e_flag = 0;
if (atom->e_flag) e_flag = 1;
rho_flag = 0;
if (atom->rho_flag) rho_flag = 1;
// orthogonal vs triclinic simulation box
triclinic = domain->triclinic;
// reset reneighboring criteria if necessary
neigh_every = neighbor->every;
neigh_delay = neighbor->delay;
neigh_dist_check = neighbor->dist_check;
if (neigh_every != 1 || neigh_delay != 0 || neigh_dist_check != 1) {
if (comm->me == 0)
error->warning(FLERR,
"Resetting reneighboring criteria during minimization");
}
neighbor->every = 1;
neighbor->delay = 0;
neighbor->dist_check = 1;
niter = neval = 0;
// style-specific initialization
init_style();
}
/* ----------------------------------------------------------------------
setup before run
------------------------------------------------------------------------- */
void Min::setup()
{
if (comm->me == 0 && screen) fprintf(screen,"Setting up minimization ...\n");
// setup extra global dof due to fixes
// cannot be done in init() b/c update init() is before modify init()
nextra_global = modify->min_dof();
if (nextra_global) fextra = new double[nextra_global];
// compute for potential energy
int id = modify->find_compute("thermo_pe");
if (id < 0) error->all(FLERR,"Minimization could not find thermo_pe compute");
pe_compute = modify->compute[id];
// style-specific setup does two tasks
// setup extra global dof vectors
// setup extra per-atom dof vectors due to requests from Pair classes
// cannot be done in init() b/c update init() is before modify/pair init()
setup_style();
// ndoftotal = total dof for entire minimization problem
// dof for atoms, extra per-atom, extra global
bigint ndofme = 3*atom->nlocal;
for (int m = 0; m < nextra_atom; m++)
ndofme += extra_peratom[m]*atom->nlocal;
MPI_Allreduce(&ndofme,&ndoftotal,1,MPI_LMP_BIGINT,MPI_SUM,world);
ndoftotal += nextra_global;
// setup domain, communication and neighboring
// acquire ghosts
// build neighbor lists
atom->setup();
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
comm->exchange();
if (atom->sortfreq > 0) atom->sort();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
neighbor->build();
neighbor->ncalls = 0;
// remove these restriction eventually
if (nextra_global && searchflag == 0)
error->all(FLERR,
"Cannot use a damped dynamics min style with fix box/relax");
if (nextra_atom && searchflag == 0)
error->all(FLERR,
"Cannot use a damped dynamics min style with per-atom DOF");
// atoms may have migrated in comm->exchange()
reset_vectors();
// compute all forces
ev_set(update->ntimestep);
force_clear();
modify->setup_pre_force(vflag);
if (force->pair) force->pair->compute(eflag,vflag);
if (atom->molecular) {
if (force->bond) force->bond->compute(eflag,vflag);
if (force->angle) force->angle->compute(eflag,vflag);
if (force->dihedral) force->dihedral->compute(eflag,vflag);
if (force->improper) force->improper->compute(eflag,vflag);
}
if (force->kspace) {
force->kspace->setup();
force->kspace->compute(eflag,vflag);
}
if (force->newton) comm->reverse_comm();
// update per-atom minimization variables stored by pair styles
if (nextra_atom)
for (int m = 0; m < nextra_atom; m++)
requestor[m]->min_xf_get(m);
modify->setup(vflag);
output->setup(1);
// stats for Finish to print
ecurrent = pe_compute->compute_scalar();
if (nextra_global) ecurrent += modify->min_energy(fextra);
if (output->thermo->normflag) ecurrent /= atom->natoms;
einitial = ecurrent;
fnorm2_init = sqrt(fnorm_sqr());
fnorminf_init = fnorm_inf();
}
/* ----------------------------------------------------------------------
setup without output or one-time post-init setup
flag = 0 = just force calculation
flag = 1 = reneighbor and force calculation
------------------------------------------------------------------------- */
void Min::setup_minimal(int flag)
{
// setup domain, communication and neighboring
// acquire ghosts
// build neighbor lists
if (flag) {
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
comm->exchange();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
neighbor->build();
neighbor->ncalls = 0;
}
// atoms may have migrated in comm->exchange()
reset_vectors();
// compute all forces
ev_set(update->ntimestep);
force_clear();
modify->setup_pre_force(vflag);
if (force->pair) force->pair->compute(eflag,vflag);
if (atom->molecular) {
if (force->bond) force->bond->compute(eflag,vflag);
if (force->angle) force->angle->compute(eflag,vflag);
if (force->dihedral) force->dihedral->compute(eflag,vflag);
if (force->improper) force->improper->compute(eflag,vflag);
}
if (force->kspace) {
force->kspace->setup();
force->kspace->compute(eflag,vflag);
}
if (force->newton) comm->reverse_comm();
// update per-atom minimization variables stored by pair styles
if (nextra_atom)
for (int m = 0; m < nextra_atom; m++)
requestor[m]->min_xf_get(m);
modify->setup(vflag);
// stats for Finish to print
ecurrent = pe_compute->compute_scalar();
if (nextra_global) ecurrent += modify->min_energy(fextra);
if (output->thermo->normflag) ecurrent /= atom->natoms;
einitial = ecurrent;
fnorm2_init = sqrt(fnorm_sqr());
fnorminf_init = fnorm_inf();
}
/* ----------------------------------------------------------------------
perform minimization, calling iterate() for N steps
------------------------------------------------------------------------- */
void Min::run(int n)
{
// minimizer iterations
stop_condition = iterate(n);
stopstr = stopstrings(stop_condition);
// if early exit from iterate loop:
// set update->nsteps to niter for Finish stats to print
// set output->next values to this timestep
// call energy_force() to insure vflag is set when forces computed
// output->write does final output for thermo, dump, restart files
// add ntimestep to all computes that store invocation times
// since are hardwiring call to thermo/dumps and computes may not be ready
if (stop_condition) {
update->nsteps = niter;
if (update->restrict_output == 0) {
for (int idump = 0; idump < output->ndump; idump++)
output->next_dump[idump] = update->ntimestep;
output->next_dump_any = update->ntimestep;
if (output->restart_every) output->next_restart = update->ntimestep;
}
output->next_thermo = update->ntimestep;
modify->addstep_compute_all(update->ntimestep);
ecurrent = energy_force(0);
output->write(update->ntimestep);
}
}
/* ---------------------------------------------------------------------- */
void Min::cleanup()
{
// stats for Finish to print
efinal = ecurrent;
fnorm2_final = sqrt(fnorm_sqr());
fnorminf_final = fnorm_inf();
// reset reneighboring criteria
neighbor->every = neigh_every;
neighbor->delay = neigh_delay;
neighbor->dist_check = neigh_dist_check;
// delete fix at end of run, so its atom arrays won't persist
modify->delete_fix("MINIMIZE");
}
/* ----------------------------------------------------------------------
evaluate potential energy and forces
may migrate atoms due to reneighboring
return new energy, which should include nextra_global dof
return negative gradient stored in atom->f
return negative gradient for nextra_global dof in fextra
------------------------------------------------------------------------- */
double Min::energy_force(int resetflag)
{
// check for reneighboring
// always communicate since minimizer moved atoms
int nflag = neighbor->decide();
if (nflag == 0) {
timer->stamp();
comm->forward_comm();
timer->stamp(TIME_COMM);
} else {
if (modify->n_min_pre_exchange) modify->min_pre_exchange();
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
if (domain->box_change) {
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
}
timer->stamp();
comm->exchange();
if (atom->sortfreq > 0 &&
update->ntimestep >= atom->nextsort) atom->sort();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
timer->stamp(TIME_COMM);
neighbor->build();
timer->stamp(TIME_NEIGHBOR);
}
ev_set(update->ntimestep);
force_clear();
if (modify->n_min_pre_force) modify->min_pre_force(vflag);
timer->stamp();
if (force->pair) {
force->pair->compute(eflag,vflag);
timer->stamp(TIME_PAIR);
}
if (atom->molecular) {
if (force->bond) force->bond->compute(eflag,vflag);
if (force->angle) force->angle->compute(eflag,vflag);
if (force->dihedral) force->dihedral->compute(eflag,vflag);
if (force->improper) force->improper->compute(eflag,vflag);
timer->stamp(TIME_BOND);
}
if (force->kspace) {
force->kspace->compute(eflag,vflag);
timer->stamp(TIME_KSPACE);
}
if (force->newton) {
comm->reverse_comm();
timer->stamp(TIME_COMM);
}
// update per-atom minimization variables stored by pair styles
if (nextra_atom)
for (int m = 0; m < nextra_atom; m++)
requestor[m]->min_xf_get(m);
// fixes that affect minimization
if (modify->n_min_post_force) modify->min_post_force(vflag);
// compute potential energy of system
// normalize if thermo PE does
double energy = pe_compute->compute_scalar();
if (nextra_global) energy += modify->min_energy(fextra);
if (output->thermo->normflag) energy /= atom->natoms;
// if reneighbored, atoms migrated
// if resetflag = 1, update x0 of atoms crossing PBC
// reset vectors used by lo-level minimizer
if (nflag) {
if (resetflag) fix_minimize->reset_coords();
reset_vectors();
}
return energy;
}
/* ----------------------------------------------------------------------
clear force on own & ghost atoms
setup and clear other arrays as needed
------------------------------------------------------------------------- */
void Min::force_clear()
{
if (external_force_clear) return;
int i;
if (external_force_clear) return;
// clear global force array
// nall includes ghosts only if either newton flag is set
int nall;
if (force->newton) nall = atom->nlocal + atom->nghost;
else nall = atom->nlocal;
size_t nbytes = sizeof(double) * nall;
if (nbytes) {
memset(&(atom->f[0][0]),0,3*nbytes);
if (torqueflag) memset(&(atom->torque[0][0]),0,3*nbytes);
if (erforceflag) memset(&(atom->erforce[0]), 0, nbytes);
if (e_flag) memset(&(atom->de[0]), 0, nbytes);
if (rho_flag) memset(&(atom->drho[0]), 0, nbytes);
}
}
/* ----------------------------------------------------------------------
pair style makes request to add a per-atom variables to minimization
requestor stores callback to pair class to invoke during min
to get current variable and forces on it and to update the variable
return flag that pair can use if it registers multiple variables
------------------------------------------------------------------------- */
int Min::request(Pair *pair, int peratom, double maxvalue)
{
int n = nextra_atom + 1;
xextra_atom = (double **) memory->srealloc(xextra_atom,n*sizeof(double *),
"min:xextra_atom");
fextra_atom = (double **) memory->srealloc(fextra_atom,n*sizeof(double *),
"min:fextra_atom");
memory->grow(extra_peratom,n,"min:extra_peratom");
memory->grow(extra_nlen,n,"min:extra_nlen");
memory->grow(extra_max,n,"min:extra_max");
requestor = (Pair **) memory->srealloc(requestor,n*sizeof(Pair *),
"min:requestor");
requestor[nextra_atom] = pair;
extra_peratom[nextra_atom] = peratom;
extra_max[nextra_atom] = maxvalue;
nextra_atom++;
return nextra_atom-1;
}
/* ---------------------------------------------------------------------- */
void Min::modify_params(int narg, char **arg)
{
if (narg == 0) error->all(FLERR,"Illegal min_modify command");
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"dmax") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
dmax = atof(arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"line") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
if (strcmp(arg[iarg+1],"backtrack") == 0) linestyle = 0;
else if (strcmp(arg[iarg+1],"quadratic") == 0) linestyle = 1;
else error->all(FLERR,"Illegal min_modify command");
iarg += 2;
} else error->all(FLERR,"Illegal min_modify command");
}
}
/* ----------------------------------------------------------------------
setup lists of computes for global and per-atom PE and pressure
------------------------------------------------------------------------- */
void Min::ev_setup()
{
delete [] elist_global;
delete [] elist_atom;
delete [] vlist_global;
delete [] vlist_atom;
elist_global = elist_atom = NULL;
vlist_global = vlist_atom = NULL;
nelist_global = nelist_atom = 0;
nvlist_global = nvlist_atom = 0;
for (int i = 0; i < modify->ncompute; i++) {
if (modify->compute[i]->peflag) nelist_global++;
if (modify->compute[i]->peatomflag) nelist_atom++;
if (modify->compute[i]->pressflag) nvlist_global++;
if (modify->compute[i]->pressatomflag) nvlist_atom++;
}
if (nelist_global) elist_global = new Compute*[nelist_global];
if (nelist_atom) elist_atom = new Compute*[nelist_atom];
if (nvlist_global) vlist_global = new Compute*[nvlist_global];
if (nvlist_atom) vlist_atom = new Compute*[nvlist_atom];
nelist_global = nelist_atom = 0;
nvlist_global = nvlist_atom = 0;
for (int i = 0; i < modify->ncompute; i++) {
if (modify->compute[i]->peflag)
elist_global[nelist_global++] = modify->compute[i];
if (modify->compute[i]->peatomflag)
elist_atom[nelist_atom++] = modify->compute[i];
if (modify->compute[i]->pressflag)
vlist_global[nvlist_global++] = modify->compute[i];
if (modify->compute[i]->pressatomflag)
vlist_atom[nvlist_atom++] = modify->compute[i];
}
}
/* ----------------------------------------------------------------------
set eflag,vflag for current iteration
invoke matchstep() on all timestep-dependent computes to clear their arrays
eflag/vflag based on computes that need info on this ntimestep
always set eflag_global = 1, since need energy every iteration
eflag = 0 = no energy computation
eflag = 1 = global energy only
eflag = 2 = per-atom energy only
eflag = 3 = both global and per-atom energy
vflag = 0 = no virial computation (pressure)
vflag = 1 = global virial with pair portion via sum of pairwise interactions
vflag = 2 = global virial with pair portion via F dot r including ghosts
vflag = 4 = per-atom virial only
vflag = 5 or 6 = both global and per-atom virial
------------------------------------------------------------------------- */
void Min::ev_set(bigint ntimestep)
{
int i,flag;
int eflag_global = 1;
for (i = 0; i < nelist_global; i++)
elist_global[i]->matchstep(ntimestep);
flag = 0;
int eflag_atom = 0;
for (i = 0; i < nelist_atom; i++)
if (elist_atom[i]->matchstep(ntimestep)) flag = 1;
if (flag) eflag_atom = 2;
if (eflag_global) update->eflag_global = update->ntimestep;
if (eflag_atom) update->eflag_atom = update->ntimestep;
eflag = eflag_global + eflag_atom;
flag = 0;
int vflag_global = 0;
for (i = 0; i < nvlist_global; i++)
if (vlist_global[i]->matchstep(ntimestep)) flag = 1;
if (flag) vflag_global = virial_style;
flag = 0;
int vflag_atom = 0;
for (i = 0; i < nvlist_atom; i++)
if (vlist_atom[i]->matchstep(ntimestep)) flag = 1;
if (flag) vflag_atom = 4;
if (vflag_global) update->vflag_global = update->ntimestep;
if (vflag_atom) update->vflag_atom = update->ntimestep;
vflag = vflag_global + vflag_atom;
}
/* ----------------------------------------------------------------------
compute and return ||force||_2^2
------------------------------------------------------------------------- */
double Min::fnorm_sqr()
{
int i,n;
double *fatom;
double local_norm2_sqr = 0.0;
for (i = 0; i < nvec; i++) local_norm2_sqr += fvec[i]*fvec[i];
if (nextra_atom) {
for (int m = 0; m < nextra_atom; m++) {
fatom = fextra_atom[m];
n = extra_nlen[m];
for (i = 0; i < n; i++)
local_norm2_sqr += fatom[i]*fatom[i];
}
}
double norm2_sqr = 0.0;
MPI_Allreduce(&local_norm2_sqr,&norm2_sqr,1,MPI_DOUBLE,MPI_SUM,world);
if (nextra_global)
for (i = 0; i < nextra_global; i++)
norm2_sqr += fextra[i]*fextra[i];
return norm2_sqr;
}
/* ----------------------------------------------------------------------
compute and return ||force||_inf
------------------------------------------------------------------------- */
double Min::fnorm_inf()
{
int i,n;
double *fatom;
double local_norm_inf = 0.0;
for (i = 0; i < nvec; i++)
local_norm_inf = MAX(fabs(fvec[i]),local_norm_inf);
if (nextra_atom) {
for (int m = 0; m < nextra_atom; m++) {
fatom = fextra_atom[m];
n = extra_nlen[m];
for (i = 0; i < n; i++)
local_norm_inf = MAX(fabs(fatom[i]),local_norm_inf);
}
}
double norm_inf = 0.0;
MPI_Allreduce(&local_norm_inf,&norm_inf,1,MPI_DOUBLE,MPI_MAX,world);
if (nextra_global)
for (i = 0; i < nextra_global; i++)
norm_inf = MAX(fabs(fextra[i]),norm_inf);
return norm_inf;
}
/* ----------------------------------------------------------------------
possible stop conditions
------------------------------------------------------------------------- */
char *Min::stopstrings(int n)
{
- char *strings[] = {"max iterations",
- "max force evaluations",
- "energy tolerance",
- "force tolerance",
- "search direction is not downhill",
- "linesearch alpha is zero",
- "forces are zero",
- "quadratic factors are zero",
- "trust region too small",
- "HFTN minimizer error"};
- return strings[n];
+ const char *strings[] = {"max iterations",
+ "max force evaluations",
+ "energy tolerance",
+ "force tolerance",
+ "search direction is not downhill",
+ "linesearch alpha is zero",
+ "forces are zero",
+ "quadratic factors are zero",
+ "trust region too small",
+ "HFTN minimizer error"};
+ return (char *) strings[n];
}
diff --git a/src/min.h b/src/min.h
index 47956059d..b6cda2dcb 100644
--- a/src/min.h
+++ b/src/min.h
@@ -1,109 +1,141 @@
/* ----------------------------------------------------------------------
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_MIN_H
#define LMP_MIN_H
#include "pointers.h"
namespace LAMMPS_NS {
class Min : protected Pointers {
public:
double einitial,efinal,eprevious;
double fnorm2_init,fnorminf_init,fnorm2_final,fnorminf_final;
double alpha_final;
int niter,neval;
int stop_condition;
char *stopstr;
int searchflag; // 0 if damped dynamics, 1 if sub-cycles on local search
Min(class LAMMPS *);
virtual ~Min();
void init();
void setup();
void setup_minimal(int);
void run(int);
void cleanup();
int request(class Pair *, int, double);
virtual bigint memory_usage() {return 0;}
void modify_params(int, char **);
double fnorm_sqr();
double fnorm_inf();
virtual void init_style() {}
virtual void setup_style() = 0;
virtual void reset_vectors() = 0;
virtual int iterate(int) = 0;
protected:
int eflag,vflag; // flags for energy/virial computation
int virial_style; // compute virial explicitly or implicitly
int external_force_clear; // clear forces locally or externally
double dmax; // max dist to move any atom in one step
int linestyle; // 0 = backtrack, 1 = quadratic
int nelist_global,nelist_atom; // # of PE,virial computes to check
int nvlist_global,nvlist_atom;
class Compute **elist_global; // lists of PE,virial Computes
class Compute **elist_atom;
class Compute **vlist_global;
class Compute **vlist_atom;
int triclinic; // 0 if domain is orthog, 1 if triclinic
int pairflag;
int torqueflag,erforceflag;
int e_flag,rho_flag;
int narray; // # of arrays stored by fix_minimize
class FixMinimize *fix_minimize; // fix that stores auxiliary data
class Compute *pe_compute; // compute for potential energy
double ecurrent; // current potential energy
bigint ndoftotal; // total dof for entire problem
int nvec; // local atomic dof = length of xvec
double *xvec; // variables for atomic dof, as 1d vector
double *fvec; // force vector for atomic dof, as 1d vector
int nextra_global; // # of extra global dof due to fixes
double *fextra; // force vector for extra global dof
// xextra is stored by fix
int nextra_atom; // # of extra per-atom variables
double **xextra_atom; // ptr to the variable
double **fextra_atom; // ptr to the force on the variable
int *extra_peratom; // # of values in variable, e.g. 3 in x
int *extra_nlen; // total local length of variable, e.g 3*nlocal
double *extra_max; // max allowed change per iter for atom's var
class Pair **requestor; // Pair that stores/manipulates the variable
int neigh_every,neigh_delay,neigh_dist_check; // neighboring params
double energy_force(int);
void force_clear();
double compute_force_norm_sqr();
double compute_force_norm_inf();
void ev_setup();
void ev_set(bigint);
char *stopstrings(int);
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+W: Resetting reneighboring criteria during minimization
+
+Minimization requires that neigh_modify settings be delay = 0, every =
+1, check = yes. Since these settings were not in place, LAMMPS
+changed them and will restore them to their original values after the
+minimization.
+
+E: Minimization could not find thermo_pe compute
+
+This compute is created by the thermo command. It must have been
+explicitly deleted by a uncompute command.
+
+E: Cannot use a damped dynamics min style with fix box/relax
+
+This is a current restriction in LAMMPS. Use another minimizer
+style.
+
+E: Cannot use a damped dynamics min style with per-atom DOF
+
+This is a current restriction in LAMMPS. Use another minimizer
+style.
+
+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.
+
+*/
diff --git a/src/minimize.h b/src/minimize.h
index 61f81748f..8a4fa36f4 100644
--- a/src/minimize.h
+++ b/src/minimize.h
@@ -1,36 +1,56 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(minimize,Minimize)
#else
#ifndef LMP_MINIMIZE_H
#define LMP_MINIMIZE_H
#include "pointers.h"
namespace LAMMPS_NS {
class Minimize : protected Pointers {
public:
Minimize(class LAMMPS *);
void command(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Minimize command before simulation box is defined
+
+The minimize command cannot be used before a read_data, read_restart,
+or create_box command.
+
+E: Too many iterations
+
+You must use a number of iterations that fit in a 32-bit integer
+for minimization.
+
+*/
diff --git a/src/modify.cpp b/src/modify.cpp
index 3498ded73..32c6634de 100644
--- a/src/modify.cpp
+++ b/src/modify.cpp
@@ -1,1167 +1,1167 @@
/* ----------------------------------------------------------------------
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 "lmptype.h"
#include "stdio.h"
#include "string.h"
#include "modify.h"
#include "style_compute.h"
#include "style_fix.h"
#include "atom.h"
#include "comm.h"
#include "fix.h"
#include "compute.h"
#include "group.h"
#include "update.h"
#include "domain.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define DELTA 4
// mask settings - same as in fix.cpp
#define INITIAL_INTEGRATE 1
#define POST_INTEGRATE 2
#define PRE_EXCHANGE 4
#define PRE_NEIGHBOR 8
#define PRE_FORCE 16
#define POST_FORCE 32
#define FINAL_INTEGRATE 64
#define END_OF_STEP 128
#define THERMO_ENERGY 256
#define INITIAL_INTEGRATE_RESPA 512
#define POST_INTEGRATE_RESPA 1024
#define PRE_FORCE_RESPA 2048
#define POST_FORCE_RESPA 4096
#define FINAL_INTEGRATE_RESPA 8192
#define MIN_PRE_EXCHANGE 16384
#define MIN_PRE_FORCE 32768
#define MIN_POST_FORCE 65536
#define MIN_ENERGY 131072
#define POST_RUN 262144
#define BIG 1.0e20
/* ---------------------------------------------------------------------- */
Modify::Modify(LAMMPS *lmp) : Pointers(lmp)
{
nfix = maxfix = 0;
n_initial_integrate = n_post_integrate = 0;
n_pre_exchange = n_pre_neighbor = 0;
n_pre_force = n_post_force = 0;
n_final_integrate = n_end_of_step = n_thermo_energy = 0;
n_initial_integrate_respa = n_post_integrate_respa = 0;
n_pre_force_respa = n_post_force_respa = n_final_integrate_respa = 0;
n_min_pre_exchange = n_min_pre_force = n_min_post_force = n_min_energy = 0;
n_timeflag = 0;
fix = NULL;
fmask = NULL;
list_initial_integrate = list_post_integrate = NULL;
list_pre_exchange = list_pre_neighbor = NULL;
list_pre_force = list_post_force = NULL;
list_final_integrate = list_end_of_step = NULL;
list_thermo_energy = NULL;
list_initial_integrate_respa = list_post_integrate_respa = NULL;
list_pre_force_respa = list_post_force_respa = NULL;
list_final_integrate_respa = NULL;
list_min_pre_exchange = list_min_pre_force =
list_min_post_force = list_min_energy = NULL;
end_of_step_every = NULL;
list_timeflag = NULL;
nfix_restart_global = 0;
id_restart_global = style_restart_global = state_restart_global = NULL;
nfix_restart_peratom = 0;
id_restart_peratom = style_restart_peratom = NULL;
index_restart_peratom = NULL;
allow_early_fix = 0;
ncompute = maxcompute = 0;
compute = NULL;
}
/* ---------------------------------------------------------------------- */
Modify::~Modify()
{
// delete all fixes
// do it via delete_fix() so callbacks in Atom are also updated correctly
while (nfix) delete_fix(fix[0]->id);
memory->sfree(fix);
memory->destroy(fmask);
// delete all computes
for (int i = 0; i < ncompute; i++) delete compute[i];
memory->sfree(compute);
delete [] list_initial_integrate;
delete [] list_post_integrate;
delete [] list_pre_exchange;
delete [] list_pre_neighbor;
delete [] list_pre_force;
delete [] list_post_force;
delete [] list_final_integrate;
delete [] list_end_of_step;
delete [] list_thermo_energy;
delete [] list_initial_integrate_respa;
delete [] list_post_integrate_respa;
delete [] list_pre_force_respa;
delete [] list_post_force_respa;
delete [] list_final_integrate_respa;
delete [] list_min_pre_exchange;
delete [] list_min_pre_force;
delete [] list_min_post_force;
delete [] list_min_energy;
delete [] end_of_step_every;
delete [] list_timeflag;
restart_deallocate();
}
/* ----------------------------------------------------------------------
initialize all fixes and computes
------------------------------------------------------------------------- */
void Modify::init()
{
int i,j;
// delete storage of restart info since it is not valid after 1st run
restart_deallocate();
// create lists of fixes to call at each stage of run
list_init(INITIAL_INTEGRATE,n_initial_integrate,list_initial_integrate);
list_init(POST_INTEGRATE,n_post_integrate,list_post_integrate);
list_init(PRE_EXCHANGE,n_pre_exchange,list_pre_exchange);
list_init(PRE_NEIGHBOR,n_pre_neighbor,list_pre_neighbor);
list_init(PRE_FORCE,n_pre_force,list_pre_force);
list_init(POST_FORCE,n_post_force,list_post_force);
list_init(FINAL_INTEGRATE,n_final_integrate,list_final_integrate);
list_init_end_of_step(END_OF_STEP,n_end_of_step,list_end_of_step);
list_init_thermo_energy(THERMO_ENERGY,n_thermo_energy,list_thermo_energy);
list_init(INITIAL_INTEGRATE_RESPA,
n_initial_integrate_respa,list_initial_integrate_respa);
list_init(POST_INTEGRATE_RESPA,
n_post_integrate_respa,list_post_integrate_respa);
list_init(POST_FORCE_RESPA,
n_post_force_respa,list_post_force_respa);
list_init(PRE_FORCE_RESPA,
n_pre_force_respa,list_pre_force_respa);
list_init(FINAL_INTEGRATE_RESPA,
n_final_integrate_respa,list_final_integrate_respa);
list_init(MIN_PRE_EXCHANGE,n_min_pre_exchange,list_min_pre_exchange);
list_init(MIN_PRE_FORCE,n_min_pre_force,list_min_pre_force);
list_init(MIN_POST_FORCE,n_min_post_force,list_min_post_force);
list_init(MIN_ENERGY,n_min_energy,list_min_energy);
// init each fix
// needs to come before compute init
// this is b/c some computes call fix->dof()
// FixRigid::dof() depends on its own init having been called
for (i = 0; i < nfix; i++) fix[i]->init();
// set global flag if any fix has its restart_pbc flag set
restart_pbc_any = 0;
for (i = 0; i < nfix; i++)
if (fix[i]->restart_pbc) restart_pbc_any = 1;
// create list of computes that store invocation times
list_init_compute();
// init each compute
// set invoked_scalar,vector,etc to -1 to force new run to re-compute them
// add initial timestep to all computes that store invocation times
// since any of them may be invoked by initial thermo
// do not clear out invocation times stored within a compute,
// b/c some may be holdovers from previous run, like for ave fixes
for (i = 0; i < ncompute; i++) {
compute[i]->init();
compute[i]->invoked_scalar = -1;
compute[i]->invoked_vector = -1;
compute[i]->invoked_array = -1;
compute[i]->invoked_peratom = -1;
compute[i]->invoked_local = -1;
}
addstep_compute_all(update->ntimestep);
// warn if any particle is time integrated more than once
int nlocal = atom->nlocal;
int *mask = atom->mask;
int *flag = new int[nlocal];
for (i = 0; i < nlocal; i++) flag[i] = 0;
int groupbit;
for (i = 0; i < nfix; i++) {
if (fix[i]->time_integrate == 0) continue;
groupbit = fix[i]->groupbit;
for (j = 0; j < nlocal; j++)
if (mask[j] & groupbit) flag[j]++;
}
int check = 0;
for (i = 0; i < nlocal; i++)
if (flag[i] > 1) check = 1;
delete [] flag;
int checkall;
MPI_Allreduce(&check,&checkall,1,MPI_INT,MPI_SUM,world);
if (comm->me == 0 && checkall)
error->warning(FLERR,"One or more atoms are time integrated more than once");
}
/* ----------------------------------------------------------------------
setup for run, calls setup() of all fixes
------------------------------------------------------------------------- */
void Modify::setup(int vflag)
{
if (update->whichflag == 1)
for (int i = 0; i < nfix; i++) fix[i]->setup(vflag);
else if (update->whichflag == 2)
for (int i = 0; i < nfix; i++) fix[i]->min_setup(vflag);
}
/* ----------------------------------------------------------------------
setup pre_exchange call, only for fixes that define pre_exchange
------------------------------------------------------------------------- */
void Modify::setup_pre_exchange()
{
for (int i = 0; i < n_pre_exchange; i++)
fix[list_pre_exchange[i]]->setup_pre_exchange();
}
/* ----------------------------------------------------------------------
setup pre_force call, only for fixes that define pre_force
------------------------------------------------------------------------- */
void Modify::setup_pre_force(int vflag)
{
if (update->whichflag == 1)
for (int i = 0; i < n_pre_force; i++)
fix[list_pre_force[i]]->setup_pre_force(vflag);
else if (update->whichflag == 2)
for (int i = 0; i < n_min_pre_force; i++)
fix[list_min_pre_force[i]]->min_setup_pre_force(vflag);
}
/* ----------------------------------------------------------------------
1st half of integrate call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::initial_integrate(int vflag)
{
for (int i = 0; i < n_initial_integrate; i++)
fix[list_initial_integrate[i]]->initial_integrate(vflag);
}
/* ----------------------------------------------------------------------
post_integrate call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::post_integrate()
{
for (int i = 0; i < n_post_integrate; i++)
fix[list_post_integrate[i]]->post_integrate();
}
/* ----------------------------------------------------------------------
pre_exchange call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::pre_exchange()
{
for (int i = 0; i < n_pre_exchange; i++)
fix[list_pre_exchange[i]]->pre_exchange();
}
/* ----------------------------------------------------------------------
pre_neighbor call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::pre_neighbor()
{
for (int i = 0; i < n_pre_neighbor; i++)
fix[list_pre_neighbor[i]]->pre_neighbor();
}
/* ----------------------------------------------------------------------
pre_force call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::pre_force(int vflag)
{
for (int i = 0; i < n_pre_force; i++)
fix[list_pre_force[i]]->pre_force(vflag);
}
/* ----------------------------------------------------------------------
post_force call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::post_force(int vflag)
{
for (int i = 0; i < n_post_force; i++)
fix[list_post_force[i]]->post_force(vflag);
}
/* ----------------------------------------------------------------------
2nd half of integrate call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::final_integrate()
{
for (int i = 0; i < n_final_integrate; i++)
fix[list_final_integrate[i]]->final_integrate();
}
/* ----------------------------------------------------------------------
end-of-timestep call, only for relevant fixes
only call fix->end_of_step() on timesteps that are multiples of nevery
------------------------------------------------------------------------- */
void Modify::end_of_step()
{
for (int i = 0; i < n_end_of_step; i++)
if (update->ntimestep % end_of_step_every[i] == 0)
fix[list_end_of_step[i]]->end_of_step();
}
/* ----------------------------------------------------------------------
thermo energy call, only for relevant fixes
called by Thermo class
compute_scalar() is fix call to return energy
------------------------------------------------------------------------- */
double Modify::thermo_energy()
{
double energy = 0.0;
for (int i = 0; i < n_thermo_energy; i++)
energy += fix[list_thermo_energy[i]]->compute_scalar();
return energy;
}
/* ----------------------------------------------------------------------
post_run call
------------------------------------------------------------------------- */
void Modify::post_run()
{
for (int i = 0; i < nfix; i++) fix[i]->post_run();
}
/* ----------------------------------------------------------------------
setup rRESPA pre_force call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::setup_pre_force_respa(int vflag, int ilevel)
{
for (int i = 0; i < n_pre_force; i++)
fix[list_pre_force[i]]->setup_pre_force_respa(vflag,ilevel);
}
/* ----------------------------------------------------------------------
1st half of rRESPA integrate call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::initial_integrate_respa(int vflag, int ilevel, int iloop)
{
for (int i = 0; i < n_initial_integrate_respa; i++)
fix[list_initial_integrate_respa[i]]->
initial_integrate_respa(vflag,ilevel,iloop);
}
/* ----------------------------------------------------------------------
rRESPA post_integrate call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::post_integrate_respa(int ilevel, int iloop)
{
for (int i = 0; i < n_post_integrate_respa; i++)
fix[list_post_integrate_respa[i]]->post_integrate_respa(ilevel,iloop);
}
/* ----------------------------------------------------------------------
rRESPA pre_force call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::pre_force_respa(int vflag, int ilevel, int iloop)
{
for (int i = 0; i < n_pre_force_respa; i++)
fix[list_pre_force_respa[i]]->pre_force_respa(vflag,ilevel,iloop);
}
/* ----------------------------------------------------------------------
rRESPA post_force call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::post_force_respa(int vflag, int ilevel, int iloop)
{
for (int i = 0; i < n_post_force_respa; i++)
fix[list_post_force_respa[i]]->post_force_respa(vflag,ilevel,iloop);
}
/* ----------------------------------------------------------------------
2nd half of rRESPA integrate call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::final_integrate_respa(int ilevel, int iloop)
{
for (int i = 0; i < n_final_integrate_respa; i++)
fix[list_final_integrate_respa[i]]->final_integrate_respa(ilevel,iloop);
}
/* ----------------------------------------------------------------------
minimizer pre-exchange call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::min_pre_exchange()
{
for (int i = 0; i < n_min_pre_exchange; i++)
fix[list_min_pre_exchange[i]]->min_pre_exchange();
}
/* ----------------------------------------------------------------------
minimizer pre-force call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::min_pre_force(int vflag)
{
for (int i = 0; i < n_min_pre_force; i++)
fix[list_min_pre_force[i]]->min_pre_force(vflag);
}
/* ----------------------------------------------------------------------
minimizer force adjustment call, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::min_post_force(int vflag)
{
for (int i = 0; i < n_min_post_force; i++)
fix[list_min_post_force[i]]->min_post_force(vflag);
}
/* ----------------------------------------------------------------------
minimizer energy/force evaluation, only for relevant fixes
return energy and forces on extra degrees of freedom
------------------------------------------------------------------------- */
double Modify::min_energy(double *fextra)
{
int ifix,index;
index = 0;
double eng = 0.0;
for (int i = 0; i < n_min_energy; i++) {
ifix = list_min_energy[i];
eng += fix[ifix]->min_energy(&fextra[index]);
index += fix[ifix]->min_dof();
}
return eng;
}
/* ----------------------------------------------------------------------
store current state of extra dof, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::min_store()
{
for (int i = 0; i < n_min_energy; i++)
fix[list_min_energy[i]]->min_store();
}
/* ----------------------------------------------------------------------
mange state of extra dof on a stack, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::min_clearstore()
{
for (int i = 0; i < n_min_energy; i++)
fix[list_min_energy[i]]->min_clearstore();
}
void Modify::min_pushstore()
{
for (int i = 0; i < n_min_energy; i++)
fix[list_min_energy[i]]->min_pushstore();
}
void Modify::min_popstore()
{
for (int i = 0; i < n_min_energy; i++)
fix[list_min_energy[i]]->min_popstore();
}
/* ----------------------------------------------------------------------
displace extra dof along vector hextra, only for relevant fixes
------------------------------------------------------------------------- */
void Modify::min_step(double alpha, double *hextra)
{
int ifix,index;
index = 0;
for (int i = 0; i < n_min_energy; i++) {
ifix = list_min_energy[i];
fix[ifix]->min_step(alpha,&hextra[index]);
index += fix[ifix]->min_dof();
}
}
/* ----------------------------------------------------------------------
compute max allowed step size along vector hextra, only for relevant fixes
------------------------------------------------------------------------- */
double Modify::max_alpha(double *hextra)
{
int ifix,index;
double alpha = BIG;
index = 0;
for (int i = 0; i < n_min_energy; i++) {
ifix = list_min_energy[i];
double alpha_one = fix[ifix]->max_alpha(&hextra[index]);
alpha = MIN(alpha,alpha_one);
index += fix[ifix]->min_dof();
}
return alpha;
}
/* ----------------------------------------------------------------------
extract extra dof for minimization, only for relevant fixes
------------------------------------------------------------------------- */
int Modify::min_dof()
{
int ndof = 0;
for (int i = 0; i < n_min_energy; i++)
ndof += fix[list_min_energy[i]]->min_dof();
return ndof;
}
/* ----------------------------------------------------------------------
reset reference state of fix, only for relevant fixes
------------------------------------------------------------------------- */
int Modify::min_reset_ref()
{
int itmp,itmpall;
itmpall = 0;
for (int i = 0; i < n_min_energy; i++) {
itmp = fix[list_min_energy[i]]->min_reset_ref();
if (itmp) itmpall = 1;
}
return itmpall;
}
/* ----------------------------------------------------------------------
add a new fix or replace one with same ID
------------------------------------------------------------------------- */
void Modify::add_fix(int narg, char **arg, char *suffix)
{
if (domain->box_exist == 0 && allow_early_fix == 0)
error->all(FLERR,"Fix command before simulation box is defined");
if (narg < 3) error->all(FLERR,"Illegal fix command");
// check group ID
int igroup = group->find(arg[1]);
if (igroup == -1) error->all(FLERR,"Could not find fix group ID");
// if fix ID exists:
// set newflag = 0 so create new fix in same location in fix list
// error if new style does not match old style
// since can't replace it (all when-to-invoke ptrs would be invalid)
// warn if new group != old group
// delete old fix, but do not call update_callback(),
// since will replace this fix and thus other fix locs will not change
// set ptr to NULL in case new fix scans list of fixes,
// e.g. scan will occur in add_callback() if called by new fix
// if fix ID does not exist:
// set newflag = 1 so create new fix
// extend fix and fmask lists as necessary
int ifix,newflag;
for (ifix = 0; ifix < nfix; ifix++)
if (strcmp(arg[0],fix[ifix]->id) == 0) break;
if (ifix < nfix) {
newflag = 0;
if (strcmp(arg[2],fix[ifix]->style) != 0)
error->all(FLERR,"Replacing a fix, but new style != old style");
if (fix[ifix]->igroup != igroup && comm->me == 0)
error->warning(FLERR,"Replacing a fix, but new group != old group");
delete fix[ifix];
fix[ifix] = NULL;
} else {
newflag = 1;
if (nfix == maxfix) {
maxfix += DELTA;
fix = (Fix **) memory->srealloc(fix,maxfix*sizeof(Fix *),"modify:fix");
memory->grow(fmask,maxfix,"modify:fmask");
}
}
// create the Fix, first with suffix appended
int success = 0;
if (suffix && lmp->suffix_enable) {
char estyle[256];
sprintf(estyle,"%s/%s",arg[2],suffix);
success = 1;
if (0) return;
#define FIX_CLASS
#define FixStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) fix[ifix] = new Class(lmp,narg,arg);
#include "style_fix.h"
#undef FixStyle
#undef FIX_CLASS
else success = 0;
}
if (!success) {
if (0) return;
#define FIX_CLASS
#define FixStyle(key,Class) \
else if (strcmp(arg[2],#key) == 0) fix[ifix] = new Class(lmp,narg,arg);
#include "style_fix.h"
#undef FixStyle
#undef FIX_CLASS
else error->all(FLERR,"Invalid fix style");
}
// set fix mask values and increment nfix (if new)
fmask[ifix] = fix[ifix]->setmask();
if (newflag) nfix++;
// check if Fix is in restart_global list
// if yes, pass state info to the Fix so it can reset itself
for (int i = 0; i < nfix_restart_global; i++)
if (strcmp(id_restart_global[i],fix[ifix]->id) == 0 &&
strcmp(style_restart_global[i],fix[ifix]->style) == 0) {
fix[ifix]->restart(state_restart_global[i]);
if (comm->me == 0) {
char *str = (char *) ("Resetting global state of Fix %s Style %s "
"from restart file info\n");
if (screen) fprintf(screen,str,fix[ifix]->id,fix[ifix]->style);
if (logfile) fprintf(logfile,str,fix[ifix]->id,fix[ifix]->style);
}
}
// check if Fix is in restart_peratom list
// if yes, loop over atoms so they can extract info from atom->extra array
for (int i = 0; i < nfix_restart_peratom; i++)
if (strcmp(id_restart_peratom[i],fix[ifix]->id) == 0 &&
strcmp(style_restart_peratom[i],fix[ifix]->style) == 0) {
for (int j = 0; j < atom->nlocal; j++)
fix[ifix]->unpack_restart(j,index_restart_peratom[i]);
if (comm->me == 0) {
char *str = (char *) ("Resetting per-atom state of Fix %s Style %s "
"from restart file info\n");
if (screen) fprintf(screen,str,fix[ifix]->id,fix[ifix]->style);
if (logfile) fprintf(logfile,str,fix[ifix]->id,fix[ifix]->style);
}
}
}
/* ----------------------------------------------------------------------
modify a Fix's parameters
------------------------------------------------------------------------- */
void Modify::modify_fix(int narg, char **arg)
{
if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
// lookup Fix ID
int ifix;
for (ifix = 0; ifix < nfix; ifix++)
if (strcmp(arg[0],fix[ifix]->id) == 0) break;
if (ifix == nfix) error->all(FLERR,"Could not find fix_modify ID");
fix[ifix]->modify_params(narg-1,&arg[1]);
}
/* ----------------------------------------------------------------------
delete a Fix from list of Fixes
Atom class must update indices in its list of callbacks to fixes
------------------------------------------------------------------------- */
void Modify::delete_fix(const char *id)
{
int ifix = find_fix(id);
if (ifix < 0) error->all(FLERR,"Could not find fix ID to delete");
delete fix[ifix];
atom->update_callback(ifix);
// move other Fixes and fmask down in list one slot
for (int i = ifix+1; i < nfix; i++) fix[i-1] = fix[i];
for (int i = ifix+1; i < nfix; i++) fmask[i-1] = fmask[i];
nfix--;
}
/* ----------------------------------------------------------------------
find a fix by ID
return index of fix or -1 if not found
------------------------------------------------------------------------- */
int Modify::find_fix(const char *id)
{
int ifix;
for (ifix = 0; ifix < nfix; ifix++)
if (strcmp(id,fix[ifix]->id) == 0) break;
if (ifix == nfix) return -1;
return ifix;
}
/* ----------------------------------------------------------------------
add a new compute
------------------------------------------------------------------------- */
void Modify::add_compute(int narg, char **arg, char *suffix)
{
if (narg < 3) error->all(FLERR,"Illegal compute command");
// error check
for (int icompute = 0; icompute < ncompute; icompute++)
if (strcmp(arg[0],compute[icompute]->id) == 0)
error->all(FLERR,"Reuse of compute ID");
// extend Compute list if necessary
if (ncompute == maxcompute) {
maxcompute += DELTA;
compute = (Compute **)
memory->srealloc(compute,maxcompute*sizeof(Compute *),"modify:compute");
}
// create the Compute, first with suffix appended
int success = 0;
if (suffix && lmp->suffix_enable) {
char estyle[256];
sprintf(estyle,"%s/%s",arg[2],suffix);
success = 1;
if (0) return;
#define COMPUTE_CLASS
#define ComputeStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) \
compute[ncompute] = new Class(lmp,narg,arg);
#include "style_compute.h"
#undef ComputeStyle
#undef COMPUTE_CLASS
else success = 0;
}
if (!success) {
if (0) return;
#define COMPUTE_CLASS
#define ComputeStyle(key,Class) \
else if (strcmp(arg[2],#key) == 0) \
compute[ncompute] = new Class(lmp,narg,arg);
#include "style_compute.h"
#undef ComputeStyle
#undef COMPUTE_CLASS
else error->all(FLERR,"Invalid compute style");
}
ncompute++;
}
/* ----------------------------------------------------------------------
modify a Compute's parameters
------------------------------------------------------------------------- */
void Modify::modify_compute(int narg, char **arg)
{
if (narg < 2) error->all(FLERR,"Illegal compute_modify command");
// lookup Compute ID
int icompute;
for (icompute = 0; icompute < ncompute; icompute++)
if (strcmp(arg[0],compute[icompute]->id) == 0) break;
if (icompute == ncompute) error->all(FLERR,"Could not find compute_modify ID");
compute[icompute]->modify_params(narg-1,&arg[1]);
}
/* ----------------------------------------------------------------------
delete a Compute from list of Computes
------------------------------------------------------------------------- */
-void Modify::delete_compute(char *id)
+void Modify::delete_compute(const char *id)
{
int icompute = find_compute(id);
if (icompute < 0) error->all(FLERR,"Could not find compute ID to delete");
delete compute[icompute];
// move other Computes down in list one slot
for (int i = icompute+1; i < ncompute; i++) compute[i-1] = compute[i];
ncompute--;
}
/* ----------------------------------------------------------------------
find a compute by ID
return index of compute or -1 if not found
------------------------------------------------------------------------- */
-int Modify::find_compute(char *id)
+int Modify::find_compute(const char *id)
{
int icompute;
for (icompute = 0; icompute < ncompute; icompute++)
if (strcmp(id,compute[icompute]->id) == 0) break;
if (icompute == ncompute) return -1;
return icompute;
}
/* ----------------------------------------------------------------------
clear invoked flag of all computes
called everywhere that computes are used, before computes are invoked
invoked flag used to avoid re-invoking same compute multiple times
and to flag computes that store invocation times as having been invoked
------------------------------------------------------------------------- */
void Modify::clearstep_compute()
{
for (int icompute = 0; icompute < ncompute; icompute++)
compute[icompute]->invoked_flag = 0;
}
/* ----------------------------------------------------------------------
loop over computes that store invocation times
if its invoked flag set on this timestep, schedule next invocation
called everywhere that computes are used, after computes are invoked
------------------------------------------------------------------------- */
void Modify::addstep_compute(bigint newstep)
{
for (int icompute = 0; icompute < n_timeflag; icompute++)
if (compute[list_timeflag[icompute]]->invoked_flag)
compute[list_timeflag[icompute]]->addstep(newstep);
}
/* ----------------------------------------------------------------------
loop over all computes
schedule next invocation for those that store invocation times
called when not sure what computes will be needed on newstep
do not loop only over n_timeflag, since may not be set yet
------------------------------------------------------------------------- */
void Modify::addstep_compute_all(bigint newstep)
{
for (int icompute = 0; icompute < ncompute; icompute++)
if (compute[icompute]->timeflag) compute[icompute]->addstep(newstep);
}
/* ----------------------------------------------------------------------
write to restart file for all Fixes with restart info
(1) fixes that have global state
(2) fixes that store per-atom quantities
------------------------------------------------------------------------- */
void Modify::write_restart(FILE *fp)
{
int me = comm->me;
int count = 0;
for (int i = 0; i < nfix; i++)
if (fix[i]->restart_global) count++;
if (me == 0) fwrite(&count,sizeof(int),1,fp);
int n;
for (int i = 0; i < nfix; i++)
if (fix[i]->restart_global) {
if (me == 0) {
n = strlen(fix[i]->id) + 1;
fwrite(&n,sizeof(int),1,fp);
fwrite(fix[i]->id,sizeof(char),n,fp);
n = strlen(fix[i]->style) + 1;
fwrite(&n,sizeof(int),1,fp);
fwrite(fix[i]->style,sizeof(char),n,fp);
}
fix[i]->write_restart(fp);
}
count = 0;
for (int i = 0; i < nfix; i++)
if (fix[i]->restart_peratom) count++;
if (me == 0) fwrite(&count,sizeof(int),1,fp);
for (int i = 0; i < nfix; i++)
if (fix[i]->restart_peratom) {
if (me == 0) {
n = strlen(fix[i]->id) + 1;
fwrite(&n,sizeof(int),1,fp);
fwrite(fix[i]->id,sizeof(char),n,fp);
n = strlen(fix[i]->style) + 1;
fwrite(&n,sizeof(int),1,fp);
fwrite(fix[i]->style,sizeof(char),n,fp);
n = fix[i]->maxsize_restart();
fwrite(&n,sizeof(int),1,fp);
}
}
}
/* ----------------------------------------------------------------------
read in restart file data on all previously defined Fixes with restart info
(1) fixes that have global state
(2) fixes that store per-atom quantities
return maxsize of extra info that will be stored with any atom
------------------------------------------------------------------------- */
int Modify::read_restart(FILE *fp)
{
// nfix_restart_global = # of restart entries with global state info
int me = comm->me;
if (me == 0) fread(&nfix_restart_global,sizeof(int),1,fp);
MPI_Bcast(&nfix_restart_global,1,MPI_INT,0,world);
// allocate space for each entry
if (nfix_restart_global) {
id_restart_global = new char*[nfix_restart_global];
style_restart_global = new char*[nfix_restart_global];
state_restart_global = new char*[nfix_restart_global];
}
// read each entry and Bcast to all procs
// each entry has id string, style string, chunk of state data
int n;
for (int i = 0; i < nfix_restart_global; i++) {
if (me == 0) fread(&n,sizeof(int),1,fp);
MPI_Bcast(&n,1,MPI_INT,0,world);
id_restart_global[i] = new char[n];
if (me == 0) fread(id_restart_global[i],sizeof(char),n,fp);
MPI_Bcast(id_restart_global[i],n,MPI_CHAR,0,world);
if (me == 0) fread(&n,sizeof(int),1,fp);
MPI_Bcast(&n,1,MPI_INT,0,world);
style_restart_global[i] = new char[n];
if (me == 0) fread(style_restart_global[i],sizeof(char),n,fp);
MPI_Bcast(style_restart_global[i],n,MPI_CHAR,0,world);
if (me == 0) fread(&n,sizeof(int),1,fp);
MPI_Bcast(&n,1,MPI_INT,0,world);
state_restart_global[i] = new char[n];
if (me == 0) fread(state_restart_global[i],sizeof(char),n,fp);
MPI_Bcast(state_restart_global[i],n,MPI_CHAR,0,world);
}
// nfix_restart_peratom = # of restart entries with peratom info
int maxsize = 0;
if (me == 0) fread(&nfix_restart_peratom,sizeof(int),1,fp);
MPI_Bcast(&nfix_restart_peratom,1,MPI_INT,0,world);
// allocate space for each entry
if (nfix_restart_peratom) {
id_restart_peratom = new char*[nfix_restart_peratom];
style_restart_peratom = new char*[nfix_restart_peratom];
index_restart_peratom = new int[nfix_restart_peratom];
}
// read each entry and Bcast to all procs
// each entry has id string, style string, maxsize of one atom's data
// set index = which set of extra data this fix represents
for (int i = 0; i < nfix_restart_peratom; i++) {
if (me == 0) fread(&n,sizeof(int),1,fp);
MPI_Bcast(&n,1,MPI_INT,0,world);
id_restart_peratom[i] = new char[n];
if (me == 0) fread(id_restart_peratom[i],sizeof(char),n,fp);
MPI_Bcast(id_restart_peratom[i],n,MPI_CHAR,0,world);
if (me == 0) fread(&n,sizeof(int),1,fp);
MPI_Bcast(&n,1,MPI_INT,0,world);
style_restart_peratom[i] = new char[n];
if (me == 0) fread(style_restart_peratom[i],sizeof(char),n,fp);
MPI_Bcast(style_restart_peratom[i],n,MPI_CHAR,0,world);
if (me == 0) fread(&n,sizeof(int),1,fp);
MPI_Bcast(&n,1,MPI_INT,0,world);
maxsize += n;
index_restart_peratom[i] = i;
}
return maxsize;
}
/* ----------------------------------------------------------------------
delete all lists of restart file Fix info
------------------------------------------------------------------------- */
void Modify::restart_deallocate()
{
if (nfix_restart_global) {
for (int i = 0; i < nfix_restart_global; i++) {
delete [] id_restart_global[i];
delete [] style_restart_global[i];
delete [] state_restart_global[i];
}
delete [] id_restart_global;
delete [] style_restart_global;
delete [] state_restart_global;
}
if (nfix_restart_peratom) {
for (int i = 0; i < nfix_restart_peratom; i++) {
delete [] id_restart_peratom[i];
delete [] style_restart_peratom[i];
}
delete [] id_restart_peratom;
delete [] style_restart_peratom;
delete [] index_restart_peratom;
}
nfix_restart_global = nfix_restart_peratom = 0;
}
/* ----------------------------------------------------------------------
create list of fix indices for fixes which match mask
------------------------------------------------------------------------- */
void Modify::list_init(int mask, int &n, int *&list)
{
delete [] list;
n = 0;
for (int i = 0; i < nfix; i++) if (fmask[i] & mask) n++;
list = new int[n];
n = 0;
for (int i = 0; i < nfix; i++) if (fmask[i] & mask) list[n++] = i;
}
/* ----------------------------------------------------------------------
create list of fix indices for end_of_step fixes
also create end_of_step_every[]
------------------------------------------------------------------------- */
void Modify::list_init_end_of_step(int mask, int &n, int *&list)
{
delete [] list;
delete [] end_of_step_every;
n = 0;
for (int i = 0; i < nfix; i++) if (fmask[i] & mask) n++;
list = new int[n];
end_of_step_every = new int[n];
n = 0;
for (int i = 0; i < nfix; i++)
if (fmask[i] & mask) {
list[n] = i;
end_of_step_every[n++] = fix[i]->nevery;
}
}
/* ----------------------------------------------------------------------
create list of fix indices for thermo energy fixes
only added to list if fix has THERMO_ENERGY mask
and its thermo_energy flag was set via fix_modify
------------------------------------------------------------------------- */
void Modify::list_init_thermo_energy(int mask, int &n, int *&list)
{
delete [] list;
n = 0;
for (int i = 0; i < nfix; i++)
if (fmask[i] & mask && fix[i]->thermo_energy) n++;
list = new int[n];
n = 0;
for (int i = 0; i < nfix; i++)
if (fmask[i] & mask && fix[i]->thermo_energy) list[n++] = i;
}
/* ----------------------------------------------------------------------
create list of compute indices for computes which store invocation times
------------------------------------------------------------------------- */
void Modify::list_init_compute()
{
delete [] list_timeflag;
n_timeflag = 0;
for (int i = 0; i < ncompute; i++)
if (compute[i]->timeflag) n_timeflag++;
list_timeflag = new int[n_timeflag];
n_timeflag = 0;
for (int i = 0; i < ncompute; i++)
if (compute[i]->timeflag) list_timeflag[n_timeflag++] = i;
}
/* ----------------------------------------------------------------------
return # of bytes of allocated memory from all fixes
------------------------------------------------------------------------- */
bigint Modify::memory_usage()
{
bigint bytes = 0;
for (int i = 0; i < nfix; i++)
bytes += static_cast<bigint> (fix[i]->memory_usage());
for (int i = 0; i < ncompute; i++)
bytes += static_cast<bigint> (compute[i]->memory_usage());
return bytes;
}
diff --git a/src/modify.h b/src/modify.h
index 637ca702e..695d31429 100644
--- a/src/modify.h
+++ b/src/modify.h
@@ -1,140 +1,206 @@
/* ----------------------------------------------------------------------
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_MODIFY_H
#define LMP_MODIFY_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class Modify : protected Pointers {
public:
int nfix,maxfix;
int n_initial_integrate,n_post_integrate,n_pre_exchange,n_pre_neighbor;
int n_pre_force,n_post_force;
int n_final_integrate,n_end_of_step,n_thermo_energy;
int n_initial_integrate_respa,n_post_integrate_respa;
int n_pre_force_respa,n_post_force_respa,n_final_integrate_respa;
int n_min_pre_exchange,n_min_pre_force,n_min_post_force,n_min_energy;
int restart_pbc_any; // 1 if any fix sets restart_pbc
int nfix_restart_global; // stored fix global info from restart file
int nfix_restart_peratom; // stored fix peratom info from restart file
int allow_early_fix; // 1 if allow fix creation at start of script
class Fix **fix; // list of fixes
int *fmask; // bit mask for when each fix is applied
int ncompute,maxcompute; // list of computes
class Compute **compute;
Modify(class LAMMPS *);
virtual ~Modify();
virtual void init();
virtual void setup(int);
virtual void setup_pre_exchange();
virtual void setup_pre_force(int);
virtual void initial_integrate(int);
virtual void post_integrate();
void pre_decide();
virtual void pre_exchange();
virtual void pre_neighbor();
virtual void pre_force(int);
virtual void post_force(int);
virtual void final_integrate();
virtual void end_of_step();
virtual double thermo_energy();
virtual void post_run();
void setup_pre_force_respa(int, int);
void initial_integrate_respa(int, int, int);
void post_integrate_respa(int, int);
void pre_force_respa(int, int, int);
void post_force_respa(int, int, int);
void final_integrate_respa(int, int);
void setup_min_pre_force(int);
void min_pre_exchange();
void min_pre_force(int);
void min_post_force(int);
double min_energy(double *);
void min_store();
void min_step(double, double *);
void min_clearstore();
void min_pushstore();
void min_popstore();
int min_reset_ref();
double max_alpha(double *);
int min_dof();
void add_fix(int, char **, char *suffix = NULL);
void modify_fix(int, char **);
void delete_fix(const char *);
int find_fix(const char *);
void add_compute(int, char **, char *suffix = NULL);
void modify_compute(int, char **);
- void delete_compute(char *);
- int find_compute(char *);
+ void delete_compute(const char *);
+ int find_compute(const char *);
void clearstep_compute();
void addstep_compute(bigint);
void addstep_compute_all(bigint);
void write_restart(FILE *);
int read_restart(FILE *);
void restart_deallocate();
bigint memory_usage();
protected:
// lists of fixes to apply at different stages of timestep
int *list_initial_integrate,*list_post_integrate;
int *list_pre_exchange,*list_pre_neighbor;
int *list_pre_force,*list_post_force;
int *list_final_integrate,*list_end_of_step,*list_thermo_energy;
int *list_initial_integrate_respa,*list_post_integrate_respa;
int *list_pre_force_respa,*list_post_force_respa;
int *list_final_integrate_respa;
int *list_min_pre_exchange,*list_min_pre_force;
int *list_min_post_force,*list_min_energy;
int *end_of_step_every;
int n_timeflag; // list of computes that store time invocation
int *list_timeflag;
char **id_restart_global; // stored fix global info
char **style_restart_global; // from read-in restart file
char **state_restart_global;
char **id_restart_peratom; // stored fix peratom info
char **style_restart_peratom; // from read-in restart file
int *index_restart_peratom;
int index_permanent; // fix/compute index returned to library call
void list_init(int, int &, int *&);
void list_init_end_of_step(int, int &, int *&);
void list_init_thermo_energy(int, int &, int *&);
void list_init_compute();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+W: One or more atoms are time integrated more than once
+
+This is probably an error since you typically do not want to
+advance the positions or velocities of an atom more than once
+per timestep.
+
+E: Fix command before simulation box is defined
+
+The fix command cannot be used before a read_data, read_restart, or
+create_box command.
+
+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 group ID
+
+A group ID used in the fix command does not exist.
+
+E: Replacing a fix, but new style != old style
+
+A fix ID can be used a 2nd time, but only if the style matches the
+previous fix. In this case it is assumed you with to reset a fix's
+parameters. This error may mean you are mistakenly re-using a fix ID
+when you do not intend to.
+
+W: Replacing a fix, but new group != old group
+
+The ID and style of a fix match for a fix you are changing with a fix
+command, but the new group you are specifying does not match the old
+group.
+
+E: Invalid fix style
+
+The choice of fix style is unknown.
+
+E: Could not find fix_modify ID
+
+A fix ID used in the fix_modify command does not exist.
+
+E: Could not find fix ID to delete
+
+Self-explanatory.
+
+E: Reuse of compute ID
+
+A compute ID cannot be used twice.
+
+E: Invalid compute style
+
+Self-explanatory.
+
+E: Could not find compute_modify ID
+
+Self-explanatory.
+
+E: Could not find compute ID to delete
+
+Self-explanatory.
+
+*/
diff --git a/src/neigh_bond.h b/src/neigh_bond.h
new file mode 100644
index 000000000..c698aad11
--- /dev/null
+++ b/src/neigh_bond.h
@@ -0,0 +1,44 @@
+/* ----------------------------------------------------------------------
+ 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.
+------------------------------------------------------------------------- */
+
+/* ERROR/WARNING messages:
+
+E: Bond atoms %d %d missing on proc %d at step %ld
+
+One or both of 2 atoms needed to compute a particular bond are
+missing on this processor. Typically this is because the pairwise
+cutoff is set too short or the bond has blown apart and an atom is
+too far away. :dd
+
+E: Angle atoms %d %d %d missing on proc %d at step %ld
+
+One or more of 3 atoms needed to compute a particular angle are
+missing on this processor. Typically this is because the pairwise
+cutoff is set too short or the angle has blown apart and an atom is
+too far away. :dd
+
+E: Dihedral atoms %d %d %d %d missing on proc %d at step %ld
+
+One or more of 4 atoms needed to compute a particular dihedral are
+missing on this processor. Typically this is because the pairwise
+cutoff is set too short or the dihedral has blown apart and an atom is
+too far away. :dd
+
+E: Improper atoms %d %d %d %d missing on proc %d at step %ld
+
+One or more of 4 atoms needed to compute a particular improper are
+missing on this processor. Typically this is because the pairwise
+cutoff is set too short or the improper has blown apart and an atom is
+too far away. :dd
+
+*/
diff --git a/src/fix_nvt.h b/src/neigh_derive.h
similarity index 71%
copy from src/fix_nvt.h
copy to src/neigh_derive.h
index 0e4360409..bcc949792 100644
--- a/src/fix_nvt.h
+++ b/src/neigh_derive.h
@@ -1,36 +1,22 @@
/* ----------------------------------------------------------------------
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
+/* ERROR/WARNING messages:
-FixStyle(nvt,FixNVT)
+E: Neighbor list overflow, boost neigh_modify one or page
-#else
+There are too many neighbors of a single atom. Use the neigh_modify
+command to increase the neighbor page size and the max number of
+neighbors allowed for one atom.
-#ifndef LMP_FIX_NVT_H
-#define LMP_FIX_NVT_H
-
-#include "fix_nh.h"
-
-namespace LAMMPS_NS {
-
-class FixNVT : public FixNH {
- public:
- FixNVT(class LAMMPS *, int, char **);
- ~FixNVT() {}
-};
-
-}
-
-#endif
-#endif
+*/
diff --git a/src/fix_nvt.h b/src/neigh_full.h
similarity index 71%
copy from src/fix_nvt.h
copy to src/neigh_full.h
index 0e4360409..bcc949792 100644
--- a/src/fix_nvt.h
+++ b/src/neigh_full.h
@@ -1,36 +1,22 @@
/* ----------------------------------------------------------------------
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
+/* ERROR/WARNING messages:
-FixStyle(nvt,FixNVT)
+E: Neighbor list overflow, boost neigh_modify one or page
-#else
+There are too many neighbors of a single atom. Use the neigh_modify
+command to increase the neighbor page size and the max number of
+neighbors allowed for one atom.
-#ifndef LMP_FIX_NVT_H
-#define LMP_FIX_NVT_H
-
-#include "fix_nh.h"
-
-namespace LAMMPS_NS {
-
-class FixNVT : public FixNH {
- public:
- FixNVT(class LAMMPS *, int, char **);
- ~FixNVT() {}
-};
-
-}
-
-#endif
-#endif
+*/
diff --git a/src/fix_nvt.h b/src/neigh_gran.h
similarity index 71%
copy from src/fix_nvt.h
copy to src/neigh_gran.h
index 0e4360409..bcc949792 100644
--- a/src/fix_nvt.h
+++ b/src/neigh_gran.h
@@ -1,36 +1,22 @@
/* ----------------------------------------------------------------------
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
+/* ERROR/WARNING messages:
-FixStyle(nvt,FixNVT)
+E: Neighbor list overflow, boost neigh_modify one or page
-#else
+There are too many neighbors of a single atom. Use the neigh_modify
+command to increase the neighbor page size and the max number of
+neighbors allowed for one atom.
-#ifndef LMP_FIX_NVT_H
-#define LMP_FIX_NVT_H
-
-#include "fix_nh.h"
-
-namespace LAMMPS_NS {
-
-class FixNVT : public FixNH {
- public:
- FixNVT(class LAMMPS *, int, char **);
- ~FixNVT() {}
-};
-
-}
-
-#endif
-#endif
+*/
diff --git a/src/fix_nvt.h b/src/neigh_half_bin.h
similarity index 71%
copy from src/fix_nvt.h
copy to src/neigh_half_bin.h
index 0e4360409..bcc949792 100644
--- a/src/fix_nvt.h
+++ b/src/neigh_half_bin.h
@@ -1,36 +1,22 @@
/* ----------------------------------------------------------------------
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
+/* ERROR/WARNING messages:
-FixStyle(nvt,FixNVT)
+E: Neighbor list overflow, boost neigh_modify one or page
-#else
+There are too many neighbors of a single atom. Use the neigh_modify
+command to increase the neighbor page size and the max number of
+neighbors allowed for one atom.
-#ifndef LMP_FIX_NVT_H
-#define LMP_FIX_NVT_H
-
-#include "fix_nh.h"
-
-namespace LAMMPS_NS {
-
-class FixNVT : public FixNH {
- public:
- FixNVT(class LAMMPS *, int, char **);
- ~FixNVT() {}
-};
-
-}
-
-#endif
-#endif
+*/
diff --git a/src/fix_nvt.h b/src/neigh_half_multi.h
similarity index 71%
copy from src/fix_nvt.h
copy to src/neigh_half_multi.h
index 0e4360409..bcc949792 100644
--- a/src/fix_nvt.h
+++ b/src/neigh_half_multi.h
@@ -1,36 +1,22 @@
/* ----------------------------------------------------------------------
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
+/* ERROR/WARNING messages:
-FixStyle(nvt,FixNVT)
+E: Neighbor list overflow, boost neigh_modify one or page
-#else
+There are too many neighbors of a single atom. Use the neigh_modify
+command to increase the neighbor page size and the max number of
+neighbors allowed for one atom.
-#ifndef LMP_FIX_NVT_H
-#define LMP_FIX_NVT_H
-
-#include "fix_nh.h"
-
-namespace LAMMPS_NS {
-
-class FixNVT : public FixNH {
- public:
- FixNVT(class LAMMPS *, int, char **);
- ~FixNVT() {}
-};
-
-}
-
-#endif
-#endif
+*/
diff --git a/src/fix_nvt.h b/src/neigh_half_nsq.h
similarity index 71%
copy from src/fix_nvt.h
copy to src/neigh_half_nsq.h
index 0e4360409..bcc949792 100644
--- a/src/fix_nvt.h
+++ b/src/neigh_half_nsq.h
@@ -1,36 +1,22 @@
/* ----------------------------------------------------------------------
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
+/* ERROR/WARNING messages:
-FixStyle(nvt,FixNVT)
+E: Neighbor list overflow, boost neigh_modify one or page
-#else
+There are too many neighbors of a single atom. Use the neigh_modify
+command to increase the neighbor page size and the max number of
+neighbors allowed for one atom.
-#ifndef LMP_FIX_NVT_H
-#define LMP_FIX_NVT_H
-
-#include "fix_nh.h"
-
-namespace LAMMPS_NS {
-
-class FixNVT : public FixNH {
- public:
- FixNVT(class LAMMPS *, int, char **);
- ~FixNVT() {}
-};
-
-}
-
-#endif
-#endif
+*/
diff --git a/src/fix_nvt.h b/src/neigh_respa.h
similarity index 71%
copy from src/fix_nvt.h
copy to src/neigh_respa.h
index 0e4360409..bcc949792 100644
--- a/src/fix_nvt.h
+++ b/src/neigh_respa.h
@@ -1,36 +1,22 @@
/* ----------------------------------------------------------------------
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
+/* ERROR/WARNING messages:
-FixStyle(nvt,FixNVT)
+E: Neighbor list overflow, boost neigh_modify one or page
-#else
+There are too many neighbors of a single atom. Use the neigh_modify
+command to increase the neighbor page size and the max number of
+neighbors allowed for one atom.
-#ifndef LMP_FIX_NVT_H
-#define LMP_FIX_NVT_H
-
-#include "fix_nh.h"
-
-namespace LAMMPS_NS {
-
-class FixNVT : public FixNH {
- public:
- FixNVT(class LAMMPS *, int, char **);
- ~FixNVT() {}
-};
-
-}
-
-#endif
-#endif
+*/
diff --git a/src/neighbor.cpp b/src/neighbor.cpp
index a918249f9..54ead69fb 100644
--- a/src/neighbor.cpp
+++ b/src/neighbor.cpp
@@ -1,1846 +1,1844 @@
/* ----------------------------------------------------------------------
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 (triclinic and multi-neigh) : Pieter in 't Veld (SNL)
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "mpi.h"
#include "math.h"
#include "stdlib.h"
#include "string.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "atom.h"
#include "atom_vec.h"
#include "comm.h"
#include "force.h"
#include "pair.h"
#include "domain.h"
#include "group.h"
#include "modify.h"
#include "fix.h"
#include "compute.h"
#include "update.h"
#include "respa.h"
#include "output.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define RQDELTA 1
#define EXDELTA 1
#define LB_FACTOR 1.5
#define SMALL 1.0e-6
#define BIG 1.0e20
#define CUT2BIN_RATIO 100
enum{NSQ,BIN,MULTI}; // also in neigh_list.cpp
//#define NEIGH_LIST_DEBUG 1
/* ---------------------------------------------------------------------- */
Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp)
{
MPI_Comm_rank(world,&me);
MPI_Comm_size(world,&nprocs);
style = BIN;
every = 1;
delay = 10;
dist_check = 1;
pgsize = 100000;
oneatom = 2000;
binsizeflag = 0;
build_once = 0;
cutneighsq = NULL;
cutneighghostsq = NULL;
cuttype = NULL;
cuttypesq = NULL;
fixchecklist = NULL;
// coords at last neighboring
maxhold = 0;
xhold = NULL;
// binning
maxhead = 0;
binhead = NULL;
maxbin = 0;
bins = NULL;
// pair exclusion list info
includegroup = 0;
nex_type = maxex_type = 0;
ex1_type = ex2_type = NULL;
ex_type = NULL;
nex_group = maxex_group = 0;
ex1_group = ex2_group = ex1_bit = ex2_bit = NULL;
nex_mol = maxex_mol = 0;
ex_mol_group = ex_mol_bit = NULL;
// pair lists
maxatom = 0;
nblist = nglist = nslist = 0;
nlist = 0;
lists = NULL;
pair_build = NULL;
stencil_create = NULL;
blist = glist = slist = NULL;
anyghostlist = 0;
nrequest = maxrequest = 0;
requests = NULL;
old_style = BIN;
old_triclinic = 0;
old_nrequest = 0;
old_requests = NULL;
// bond lists
maxbond = 0;
bondlist = NULL;
maxangle = 0;
anglelist = NULL;
maxdihedral = 0;
dihedrallist = NULL;
maximproper = 0;
improperlist = NULL;
}
/* ---------------------------------------------------------------------- */
Neighbor::~Neighbor()
{
memory->destroy(cutneighsq);
memory->destroy(cutneighghostsq);
delete [] cuttype;
delete [] cuttypesq;
delete [] fixchecklist;
memory->destroy(xhold);
memory->destroy(binhead);
memory->destroy(bins);
memory->destroy(ex1_type);
memory->destroy(ex2_type);
memory->destroy(ex_type);
memory->destroy(ex1_group);
memory->destroy(ex2_group);
delete [] ex1_bit;
delete [] ex2_bit;
memory->destroy(ex_mol_group);
delete [] ex_mol_bit;
for (int i = 0; i < nlist; i++) delete lists[i];
delete [] lists;
delete [] pair_build;
delete [] stencil_create;
delete [] blist;
delete [] glist;
delete [] slist;
for (int i = 0; i < nrequest; i++) delete requests[i];
memory->sfree(requests);
for (int i = 0; i < old_nrequest; i++) delete old_requests[i];
memory->sfree(old_requests);
memory->destroy(bondlist);
memory->destroy(anglelist);
memory->destroy(dihedrallist);
memory->destroy(improperlist);
}
/* ---------------------------------------------------------------------- */
void Neighbor::init()
{
int i,j,m,n;
ncalls = ndanger = 0;
dimension = domain->dimension;
triclinic = domain->triclinic;
newton_pair = force->newton_pair;
// error check
if (delay > 0 && (delay % every) != 0)
error->all(FLERR,"Neighbor delay must be 0 or multiple of every setting");
if (pgsize < 10*oneatom)
error->all(FLERR,"Neighbor page size must be >= 10x the one atom setting");
// ------------------------------------------------------------------
// settings
// bbox lo/hi = bounding box of entire domain, stored by Domain
if (triclinic == 0) {
bboxlo = domain->boxlo;
bboxhi = domain->boxhi;
} else {
bboxlo = domain->boxlo_bound;
bboxhi = domain->boxhi_bound;
}
// set neighbor cutoffs (force cutoff + skin)
// trigger determines when atoms migrate and neighbor lists are rebuilt
// needs to be non-zero for migration distance check
// even if pair = NULL and no neighbor lists are used
// cutneigh = force cutoff + skin if cutforce > 0, else cutneigh = 0
triggersq = 0.25*skin*skin;
boxcheck = 0;
if (domain->box_change && (domain->xperiodic || domain->yperiodic ||
(dimension == 3 && domain->zperiodic)))
boxcheck = 1;
n = atom->ntypes;
if (cutneighsq == NULL) {
memory->create(cutneighsq,n+1,n+1,"neigh:cutneighsq");
memory->create(cutneighghostsq,n+1,n+1,"neigh:cutneighghostsq");
cuttype = new double[n+1];
cuttypesq = new double[n+1];
}
double cutoff,delta,cut;
cutneighmin = BIG;
cutneighmax = 0.0;
for (i = 1; i <= n; i++) {
cuttype[i] = cuttypesq[i] = 0.0;
for (j = 1; j <= n; j++) {
if (force->pair) cutoff = sqrt(force->pair->cutsq[i][j]);
else cutoff = 0.0;
if (cutoff > 0.0) delta = skin;
else delta = 0.0;
cut = cutoff + delta;
cutneighsq[i][j] = cut*cut;
cuttype[i] = MAX(cuttype[i],cut);
cuttypesq[i] = MAX(cuttypesq[i],cut*cut);
cutneighmin = MIN(cutneighmin,cut);
cutneighmax = MAX(cutneighmax,cut);
if (force->pair && force->pair->ghostneigh) {
cut = force->pair->cutghost[i][j] + skin;
cutneighghostsq[i][j] = cut*cut;
}
}
}
cutneighmaxsq = cutneighmax * cutneighmax;
// check other classes that can induce reneighboring in decide()
// don't check if build_once is set
restart_check = 0;
if (output->restart_every) restart_check = 1;
delete [] fixchecklist;
fixchecklist = NULL;
fixchecklist = new int[modify->nfix];
fix_check = 0;
for (i = 0; i < modify->nfix; i++)
if (modify->fix[i]->force_reneighbor)
fixchecklist[fix_check++] = i;
must_check = 0;
if (restart_check || fix_check) must_check = 1;
if (build_once) must_check = 0;
// set special_flag for 1-2, 1-3, 1-4 neighbors
// flag[0] is not used, flag[1] = 1-2, flag[2] = 1-3, flag[3] = 1-4
// flag = 0 if both LJ/Coulomb special values are 0.0
// flag = 1 if both LJ/Coulomb special values are 1.0
// flag = 2 otherwise or if KSpace solver is enabled
// pairwise portion of KSpace solver uses all 1-2,1-3,1-4 neighbors
if (force->special_lj[1] == 0.0 && force->special_coul[1] == 0.0)
special_flag[1] = 0;
else if (force->special_lj[1] == 1.0 && force->special_coul[1] == 1.0)
special_flag[1] = 1;
else special_flag[1] = 2;
if (force->special_lj[2] == 0.0 && force->special_coul[2] == 0.0)
special_flag[2] = 0;
else if (force->special_lj[2] == 1.0 && force->special_coul[2] == 1.0)
special_flag[2] = 1;
else special_flag[2] = 2;
if (force->special_lj[3] == 0.0 && force->special_coul[3] == 0.0)
special_flag[3] = 0;
else if (force->special_lj[3] == 1.0 && force->special_coul[3] == 1.0)
special_flag[3] = 1;
else special_flag[3] = 2;
if (force->kspace) special_flag[1] = special_flag[2] = special_flag[3] = 2;
// maxwt = max multiplicative factor on atom indices stored in neigh list
maxwt = 0;
if (special_flag[1] == 2) maxwt = 2;
if (special_flag[2] == 2) maxwt = 3;
if (special_flag[3] == 2) maxwt = 4;
// rRESPA cutoffs
int respa = 0;
if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
}
if (respa) {
double *cut_respa = ((Respa *) update->integrate)->cutoff;
cut_inner_sq = (cut_respa[1] + skin) * (cut_respa[1] + skin);
cut_middle_sq = (cut_respa[3] + skin) * (cut_respa[3] + skin);
cut_middle_inside_sq = (cut_respa[0] - skin) * (cut_respa[0] - skin);
}
// ------------------------------------------------------------------
// xhold, bins, exclusion lists
// free xhold and bins if not needed for this run
if (dist_check == 0) {
memory->destroy(xhold);
maxhold = 0;
xhold = NULL;
}
if (style == NSQ) {
memory->destroy(bins);
memory->destroy(binhead);
maxbin = maxhead = 0;
binhead = NULL;
bins = NULL;
}
// 1st time allocation of xhold and bins
if (dist_check) {
if (maxhold == 0) {
maxhold = atom->nmax;
memory->create(xhold,maxhold,3,"neigh:xhold");
}
}
if (style != NSQ) {
if (maxbin == 0) {
maxbin = atom->nmax;
memory->create(bins,maxbin,"bins");
}
}
// exclusion lists for type, group, molecule settings from neigh_modify
n = atom->ntypes;
if (nex_type == 0 && nex_group == 0 && nex_mol == 0) exclude = 0;
else exclude = 1;
if (nex_type) {
memory->destroy(ex_type);
memory->create(ex_type,n+1,n+1,"neigh:ex_type");
for (i = 1; i <= n; i++)
for (j = 1; j <= n; j++)
ex_type[i][j] = 0;
for (i = 0; i < nex_type; i++) {
if (ex1_type[i] <= 0 || ex1_type[i] > n ||
ex2_type[i] <= 0 || ex2_type[i] > n)
error->all(FLERR,"Invalid atom type in neighbor exclusion list");
ex_type[ex1_type[i]][ex2_type[i]] = 1;
ex_type[ex2_type[i]][ex1_type[i]] = 1;
}
}
if (nex_group) {
delete [] ex1_bit;
delete [] ex2_bit;
ex1_bit = new int[nex_group];
ex2_bit = new int[nex_group];
for (i = 0; i < nex_group; i++) {
ex1_bit[i] = group->bitmask[ex1_group[i]];
ex2_bit[i] = group->bitmask[ex2_group[i]];
}
}
if (nex_mol) {
delete [] ex_mol_bit;
ex_mol_bit = new int[nex_mol];
for (i = 0; i < nex_mol; i++)
ex_mol_bit[i] = group->bitmask[ex_mol_group[i]];
}
// ------------------------------------------------------------------
// pairwise lists
// test if pairwise lists need to be re-created
// no need to re-create if:
// neigh style and triclinic has not changed and
// current requests = old requests
int same = 1;
if (style != old_style) same = 0;
if (triclinic != old_triclinic) same = 0;
if (nrequest != old_nrequest) same = 0;
else
for (i = 0; i < nrequest; i++)
if (requests[i]->identical(old_requests[i]) == 0) same = 0;
#ifdef NEIGH_LIST_DEBUG
if (comm->me == 0) printf("SAME flag %d\n",same);
#endif
// if old and new are not the same, create new pairwise lists
if (!same) {
// delete old lists and create new ones
for (i = 0; i < nlist; i++) delete lists[i];
delete [] lists;
delete [] pair_build;
delete [] stencil_create;
nlist = nrequest;
lists = new NeighList*[nlist];
pair_build = new PairPtr[nlist];
stencil_create = new StencilPtr[nlist];
// create individual lists, one per request
// copy dnum setting from request to list
// pass list ptr back to requestor (except for Command class)
for (i = 0; i < nlist; i++) {
lists[i] = new NeighList(lmp,pgsize);
lists[i]->index = i;
lists[i]->dnum = requests[i]->dnum;
if (requests[i]->pair) {
Pair *pair = (Pair *) requests[i]->requestor;
pair->init_list(requests[i]->id,lists[i]);
} else if (requests[i]->fix) {
Fix *fix = (Fix *) requests[i]->requestor;
fix->init_list(requests[i]->id,lists[i]);
} else if (requests[i]->compute) {
Compute *compute = (Compute *) requests[i]->requestor;
compute->init_list(requests[i]->id,lists[i]);
}
}
// detect lists that are connected to other lists
// if-then-else sequence is important
// since don't want to re-process skip or copy lists further down
// copy: point this list at request->otherlist, could be a skip list
// skip: point this list at request->otherlist, copy skip info from request
// half_from_full: point this list at preceeding full list
// granhistory: set preceeding list's listgranhistory to this list
// also set preceeding list's ptr to FixShearHistory
// respaouter: point this list at preceeding 1/2 inner/middle lists
// pair and half: if there is a full non-occasional non-skip list
// change this list to half_from_full and point at the full list
// parent could be copy list or pair or fix
// fix/compute requests:
// kind of request = half or full, occasional or not doesn't matter
// if request = half and non-skip pair half/respaouter exists,
// become copy of that list if cudable flag matches
// if request = full and non-skip pair full exists,
// become copy of that list if cudable flag matches
// if request = half and non-skip pair full exists,
// become half_from_full of that list if cudable flag matches
// if no matches, do nothing, fix/compute list will be built directly
// ok if parent is copy list
for (i = 0; i < nlist; i++) {
if (requests[i]->copy)
lists[i]->listcopy = lists[requests[i]->otherlist];
else if (requests[i]->skip) {
lists[i]->listskip = lists[requests[i]->otherlist];
lists[i]->copy_skip_info(requests[i]->iskip,requests[i]->ijskip);
} else if (requests[i]->half_from_full)
lists[i]->listfull = lists[i-1];
else if (requests[i]->granhistory) {
lists[i-1]->listgranhistory = lists[i];
for (int ifix = 0; ifix < modify->nfix; ifix++)
if (strcmp(modify->fix[ifix]->style,"SHEAR_HISTORY") == 0)
lists[i-1]->fix_history = (FixShearHistory *) modify->fix[ifix];
} else if (requests[i]->respaouter) {
if (requests[i-1]->respainner) {
lists[i]->respamiddle = 0;
lists[i]->listinner = lists[i-1];
} else {
lists[i]->respamiddle = 1;
lists[i]->listmiddle = lists[i-1];
lists[i]->listinner = lists[i-2];
}
} else if (requests[i]->pair && requests[i]->half) {
for (j = 0; j < nlist; j++)
if (requests[j]->full && requests[j]->occasional == 0 &&
requests[j]->skip == 0) break;
if (j < nlist) {
requests[i]->half = 0;
requests[i]->half_from_full = 1;
lists[i]->listfull = lists[j];
}
} else if (requests[i]->fix || requests[i]->compute) {
for (j = 0; j < nlist; j++) {
if (requests[i]->half && requests[j]->pair &&
requests[j]->skip == 0 && requests[j]->half) break;
if (requests[i]->full && requests[j]->pair &&
requests[j]->skip == 0 && requests[j]->full) break;
if (requests[i]->half && requests[j]->pair &&
requests[j]->skip == 0 && requests[j]->respaouter) break;
}
if (j < nlist && requests[j]->cudable != requests[i]->cudable)
j = nlist;
if (j < nlist) {
requests[i]->copy = 1;
lists[i]->listcopy = lists[j];
} else {
for (j = 0; j < nlist; j++) {
if (requests[i]->half && requests[j]->pair &&
requests[j]->skip == 0 && requests[j]->full) break;
}
if (j < nlist && requests[j]->cudable != requests[i]->cudable)
j = nlist;
if (j < nlist) {
requests[i]->half = 0;
requests[i]->half_from_full = 1;
lists[i]->listfull = lists[j];
}
}
}
}
// set ptrs to pair_build and stencil_create functions for each list
// ptrs set to NULL if not set explicitly
// also set cudable to 0 if any neigh list request is not cudable
for (i = 0; i < nlist; i++) {
choose_build(i,requests[i]);
if (style != NSQ) choose_stencil(i,requests[i]);
else stencil_create[i] = NULL;
if (!requests[i]->cudable) cudable = 0;
}
// set each list's build/grow/stencil/ghost flags based on neigh request
// buildflag = 1 if its pair_build() invoked every reneighbor
// growflag = 1 if it stores atom-based arrays and pages
// stencilflag = 1 if it stores stencil arrays
// ghostflag = 1 if it stores neighbors of ghosts
// anyghostlist = 1 if any non-occasional list stores neighbors of ghosts
anyghostlist = 0;
for (i = 0; i < nlist; i++) {
lists[i]->buildflag = 1;
if (pair_build[i] == NULL) lists[i]->buildflag = 0;
if (requests[i]->occasional) lists[i]->buildflag = 0;
lists[i]->growflag = 1;
if (requests[i]->copy) lists[i]->growflag = 0;
lists[i]->stencilflag = 1;
if (style == NSQ) lists[i]->stencilflag = 0;
if (stencil_create[i] == NULL) lists[i]->stencilflag = 0;
lists[i]->ghostflag = 0;
if (requests[i]->ghost) lists[i]->ghostflag = 1;
if (requests[i]->ghost && !requests[i]->occasional) anyghostlist = 1;
}
#ifdef NEIGH_LIST_DEBUG
for (i = 0; i < nlist; i++) lists[i]->print_attributes();
#endif
// allocate atom arrays and 1st pages of lists that store them
maxatom = atom->nmax;
for (i = 0; i < nlist; i++)
if (lists[i]->growflag) {
lists[i]->grow(maxatom);
lists[i]->add_pages();
}
// setup 3 vectors of pairwise neighbor lists
// blist = lists whose pair_build() is invoked every reneighbor
// glist = lists who store atom arrays which are used every reneighbor
// slist = lists who store stencil arrays which are used every reneighbor
// blist and glist vectors are used by neighbor::build()
// slist vector is used by neighbor::setup_bins()
nblist = nglist = nslist = 0;
delete [] blist;
delete [] glist;
delete [] slist;
blist = new int[nlist];
glist = new int[nlist];
slist = new int[nlist];
for (i = 0; i < nlist; i++) {
if (lists[i]->buildflag) blist[nblist++] = i;
if (lists[i]->growflag && requests[i]->occasional == 0)
glist[nglist++] = i;
if (lists[i]->stencilflag && requests[i]->occasional == 0)
slist[nslist++] = i;
}
#ifdef NEIGH_LIST_DEBUG
print_lists_of_lists();
#endif
// reorder build vector if necessary
// relevant for lists that copy/skip/half-full from parent
// the derived list must appear in blist after the parent list
// no occasional lists are in build vector
// swap two lists within blist when dependency is mis-ordered
// done when entire pass thru blist results in no swaps
int done = 0;
while (!done) {
done = 1;
for (i = 0; i < nblist; i++) {
NeighList *ptr = NULL;
if (lists[blist[i]]->listfull) ptr = lists[blist[i]]->listfull;
if (lists[blist[i]]->listcopy) ptr = lists[blist[i]]->listcopy;
if (lists[blist[i]]->listskip) ptr = lists[blist[i]]->listskip;
if (ptr == NULL) continue;
for (m = 0; m < nlist; m++)
if (ptr == lists[m]) break;
for (j = 0; j < nblist; j++)
if (m == blist[j]) break;
if (j < i) continue;
int tmp = blist[i];
blist[i] = blist[j];
blist[j] = tmp;
done = 0;
break;
}
}
#ifdef NEIGH_LIST_DEBUG
print_lists_of_lists();
#endif
}
// delete old requests
// copy current requests and style to old for next run
for (i = 0; i < old_nrequest; i++) delete old_requests[i];
memory->sfree(old_requests);
old_nrequest = nrequest;
old_requests = requests;
nrequest = maxrequest = 0;
requests = NULL;
old_style = style;
old_triclinic = triclinic;
// ------------------------------------------------------------------
// topology lists
// 1st time allocation of topology lists
if (atom->molecular && atom->nbonds && maxbond == 0) {
if (nprocs == 1) maxbond = atom->nbonds;
else maxbond = static_cast<int> (LB_FACTOR * atom->nbonds / nprocs);
memory->create(bondlist,maxbond,3,"neigh:bondlist");
}
if (atom->molecular && atom->nangles && maxangle == 0) {
if (nprocs == 1) maxangle = atom->nangles;
else maxangle = static_cast<int> (LB_FACTOR * atom->nangles / nprocs);
memory->create(anglelist,maxangle,4,"neigh:anglelist");
}
if (atom->molecular && atom->ndihedrals && maxdihedral == 0) {
if (nprocs == 1) maxdihedral = atom->ndihedrals;
else maxdihedral = static_cast<int>
(LB_FACTOR * atom->ndihedrals / nprocs);
memory->create(dihedrallist,maxdihedral,5,"neigh:dihedrallist");
}
if (atom->molecular && atom->nimpropers && maximproper == 0) {
if (nprocs == 1) maximproper = atom->nimpropers;
else maximproper = static_cast<int>
(LB_FACTOR * atom->nimpropers / nprocs);
memory->create(improperlist,maximproper,5,"neigh:improperlist");
}
// set flags that determine which topology neighboring routines to use
// SHAKE sets bonds and angles negative
// bond_quartic sets bonds to 0
// delete_bonds sets all interactions negative
int bond_off = 0;
int angle_off = 0;
for (i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"shake") == 0)
bond_off = angle_off = 1;
if (force->bond && force->bond_match("quartic")) bond_off = 1;
if (atom->avec->bonds_allow) {
for (i = 0; i < atom->nlocal; i++) {
if (bond_off) break;
for (m = 0; m < atom->num_bond[i]; m++)
if (atom->bond_type[i][m] <= 0) bond_off = 1;
}
}
if (atom->avec->angles_allow) {
for (i = 0; i < atom->nlocal; i++) {
if (angle_off) break;
for (m = 0; m < atom->num_angle[i]; m++)
if (atom->angle_type[i][m] <= 0) angle_off = 1;
}
}
int dihedral_off = 0;
if (atom->avec->dihedrals_allow) {
for (i = 0; i < atom->nlocal; i++) {
if (dihedral_off) break;
for (m = 0; m < atom->num_dihedral[i]; m++)
if (atom->dihedral_type[i][m] <= 0) dihedral_off = 1;
}
}
int improper_off = 0;
if (atom->avec->impropers_allow) {
for (i = 0; i < atom->nlocal; i++) {
if (improper_off) break;
for (m = 0; m < atom->num_improper[i]; m++)
if (atom->improper_type[i][m] <= 0) improper_off = 1;
}
}
// set ptrs to topology build functions
if (bond_off) bond_build = &Neighbor::bond_partial;
else bond_build = &Neighbor::bond_all;
if (angle_off) angle_build = &Neighbor::angle_partial;
else angle_build = &Neighbor::angle_all;
if (dihedral_off) dihedral_build = &Neighbor::dihedral_partial;
else dihedral_build = &Neighbor::dihedral_all;
if (improper_off) improper_build = &Neighbor::improper_partial;
else improper_build = &Neighbor::improper_all;
// set topology neighbor list counts to 0
// in case all are turned off but potential is still defined
nbondlist = nanglelist = ndihedrallist = nimproperlist = 0;
}
/* ---------------------------------------------------------------------- */
int Neighbor::request(void *requestor)
{
if (nrequest == maxrequest) {
maxrequest += RQDELTA;
requests = (NeighRequest **)
memory->srealloc(requests,maxrequest*sizeof(NeighRequest *),
"neighbor:requests");
}
requests[nrequest] = new NeighRequest(lmp);
requests[nrequest]->requestor = requestor;
nrequest++;
return nrequest-1;
}
/* ----------------------------------------------------------------------
determine which pair_build function each neigh list needs
based on settings of neigh request
copy -> copy_from function
skip -> granular function if gran with granhistory,
respa function if respaouter,
skip_from function for everything else
half_from_full, half, full, gran, respaouter ->
choose by newton and rq->newton and tri settings
style NSQ options = newton off, newton on
style BIN options = newton off, newton on and not tri, newton on and tri
stlye MULTI options = same options as BIN
if none of these, ptr = NULL since pair_build is not invoked for this list
use "else if" b/c skip,copy can be set in addition to half,full,etc
------------------------------------------------------------------------- */
void Neighbor::choose_build(int index, NeighRequest *rq)
{
PairPtr pb = NULL;
if (rq->omp == 0) {
if (rq->copy) pb = &Neighbor::copy_from;
else if (rq->skip) {
if (rq->gran && lists[index]->listgranhistory)
pb = &Neighbor::skip_from_granular;
else if (rq->respaouter) pb = &Neighbor::skip_from_respa;
else pb = &Neighbor::skip_from;
} else if (rq->half_from_full) {
if (newton_pair == 0) pb = &Neighbor::half_from_full_no_newton;
else if (newton_pair == 1) pb = &Neighbor::half_from_full_newton;
} else if (rq->half) {
if (style == NSQ) {
if (rq->newton == 0) {
if (newton_pair == 0) pb = &Neighbor::half_nsq_no_newton;
else if (newton_pair == 1) pb = &Neighbor::half_nsq_newton;
} else if (rq->newton == 1) {
pb = &Neighbor::half_nsq_newton;
} else if (rq->newton == 2) {
pb = &Neighbor::half_nsq_no_newton;
}
} else if (style == BIN) {
if (rq->newton == 0) {
if (newton_pair == 0) pb = &Neighbor::half_bin_no_newton;
else if (triclinic == 0) pb = &Neighbor::half_bin_newton;
else if (triclinic == 1) pb = &Neighbor::half_bin_newton_tri;
} else if (rq->newton == 1) {
if (triclinic == 0) pb = &Neighbor::half_bin_newton;
else if (triclinic == 1) pb = &Neighbor::half_bin_newton_tri;
} else if (rq->newton == 2) pb = &Neighbor::half_bin_no_newton;
} else if (style == MULTI) {
if (rq->newton == 0) {
if (newton_pair == 0) pb = &Neighbor::half_multi_no_newton;
else if (triclinic == 0) pb = &Neighbor::half_multi_newton;
else if (triclinic == 1) pb = &Neighbor::half_multi_newton_tri;
} else if (rq->newton == 1) {
if (triclinic == 0) pb = &Neighbor::half_multi_newton;
else if (triclinic == 1) pb = &Neighbor::half_multi_newton_tri;
} else if (rq->newton == 2) pb = &Neighbor::half_multi_no_newton;
}
} else if (rq->full) {
if (style == NSQ) {
if (rq->ghost == 0) pb = &Neighbor::full_nsq;
else if (includegroup)
error->all(FLERR,
"Neighbor include group not allowed with ghost neighbors");
else if (rq->ghost == 1) pb = &Neighbor::full_nsq_ghost;
} else if (style == BIN) {
if (rq->ghost == 0) pb = &Neighbor::full_bin;
else if (includegroup)
error->all(FLERR,
"Neighbor include group not allowed with ghost neighbors");
else if (rq->ghost == 1) pb = &Neighbor::full_bin_ghost;
} else if (style == MULTI) {
if (rq->ghost == 0) pb = &Neighbor::full_multi;
else error->all(FLERR,
"Neighbor multi not yet enabled for ghost neighbors");
}
} else if (rq->gran) {
if (style == NSQ) {
if (newton_pair == 0) pb = &Neighbor::granular_nsq_no_newton;
else if (newton_pair == 1) pb = &Neighbor::granular_nsq_newton;
} else if (style == BIN) {
if (newton_pair == 0) pb = &Neighbor::granular_bin_no_newton;
else if (triclinic == 0) pb = &Neighbor::granular_bin_newton;
else if (triclinic == 1) pb = &Neighbor::granular_bin_newton_tri;
} else if (style == MULTI)
error->all(FLERR,"Neighbor multi not yet enabled for granular");
} else if (rq->respaouter) {
if (style == NSQ) {
if (newton_pair == 0) pb = &Neighbor::respa_nsq_no_newton;
else if (newton_pair == 1) pb = &Neighbor::respa_nsq_newton;
} else if (style == BIN) {
if (newton_pair == 0) pb = &Neighbor::respa_bin_no_newton;
else if (triclinic == 0) pb = &Neighbor::respa_bin_newton;
else if (triclinic == 1) pb = &Neighbor::respa_bin_newton_tri;
} else if (style == MULTI)
error->all(FLERR,"Neighbor multi not yet enabled for rRESPA");
}
} else {
if (rq->copy) pb = &Neighbor::copy_from;
else if (rq->skip) {
if (rq->gran && lists[index]->listgranhistory)
pb = &Neighbor::skip_from_granular;
else if (rq->respaouter) pb = &Neighbor::skip_from_respa;
else pb = &Neighbor::skip_from;
} else if (rq->half_from_full) {
if (newton_pair == 0) pb = &Neighbor::half_from_full_no_newton_omp;
else if (newton_pair == 1) pb = &Neighbor::half_from_full_newton_omp;
} else if (rq->half) {
if (style == NSQ) {
if (rq->newton == 0) {
if (newton_pair == 0) pb = &Neighbor::half_nsq_no_newton_omp;
else if (newton_pair == 1) pb = &Neighbor::half_nsq_newton_omp;
} else if (rq->newton == 1) {
pb = &Neighbor::half_nsq_newton_omp;
} else if (rq->newton == 2) {
pb = &Neighbor::half_nsq_no_newton_omp;
}
} else if (style == BIN) {
if (rq->newton == 0) {
if (newton_pair == 0) pb = &Neighbor::half_bin_no_newton_omp;
else if (triclinic == 0) pb = &Neighbor::half_bin_newton_omp;
else if (triclinic == 1) pb = &Neighbor::half_bin_newton_tri_omp;
} else if (rq->newton == 1) {
if (triclinic == 0) pb = &Neighbor::half_bin_newton_omp;
else if (triclinic == 1) pb = &Neighbor::half_bin_newton_tri_omp;
} else if (rq->newton == 2) pb = &Neighbor::half_bin_no_newton_omp;
} else if (style == MULTI) {
if (rq->newton == 0) {
if (newton_pair == 0) pb = &Neighbor::half_multi_no_newton_omp;
else if (triclinic == 0) pb = &Neighbor::half_multi_newton_omp;
else if (triclinic == 1) pb = &Neighbor::half_multi_newton_tri_omp;
} else if (rq->newton == 1) {
if (triclinic == 0) pb = &Neighbor::half_multi_newton_omp;
else if (triclinic == 1) pb = &Neighbor::half_multi_newton_tri_omp;
} else if (rq->newton == 2) pb = &Neighbor::half_multi_no_newton_omp;
}
} else if (rq->full) {
if (style == NSQ) {
if (rq->ghost == 0) pb = &Neighbor::full_nsq_omp;
else if (includegroup)
error->all(FLERR,
"Neighbor include group not allowed with ghost neighbors");
else if (rq->ghost == 1) pb = &Neighbor::full_nsq_ghost_omp;
} else if (style == BIN) {
if (rq->ghost == 0) pb = &Neighbor::full_bin_omp;
else if (includegroup)
error->all(FLERR,
"Neighbor include group not allowed with ghost neighbors");
else if (rq->ghost == 1) pb = &Neighbor::full_bin_ghost_omp;
} else if (style == MULTI) {
if (rq->ghost == 0) pb = &Neighbor::full_multi_omp;
else error->all(FLERR,
"Neighbor multi not yet enabled for ghost neighbors");
}
} else if (rq->gran) {
if (style == NSQ) {
if (newton_pair == 0) pb = &Neighbor::granular_nsq_no_newton_omp;
else if (newton_pair == 1) pb = &Neighbor::granular_nsq_newton_omp;
} else if (style == BIN) {
if (newton_pair == 0) pb = &Neighbor::granular_bin_no_newton_omp;
else if (triclinic == 0) pb = &Neighbor::granular_bin_newton_omp;
else if (triclinic == 1) pb = &Neighbor::granular_bin_newton_tri_omp;
} else if (style == MULTI)
error->all(FLERR,"Neighbor multi not yet enabled for granular");
} else if (rq->respaouter) {
if (style == NSQ) {
if (newton_pair == 0) pb = &Neighbor::respa_nsq_no_newton_omp;
else if (newton_pair == 1) pb = &Neighbor::respa_nsq_newton_omp;
} else if (style == BIN) {
if (newton_pair == 0) pb = &Neighbor::respa_bin_no_newton_omp;
else if (triclinic == 0) pb = &Neighbor::respa_bin_newton_omp;
else if (triclinic == 1) pb = &Neighbor::respa_bin_newton_tri_omp;
} else if (style == MULTI)
error->all(FLERR,"Neighbor multi not yet enabled for rRESPA");
}
}
// general error check
if (rq->ghost && !rq->full)
error->all(FLERR,
"Neighbors of ghost atoms only allowed for full neighbor lists");
pair_build[index] = pb;
}
/* ----------------------------------------------------------------------
determine which stencil_create function each neigh list needs
based on settings of neigh request, only called if style != NSQ
skip or copy or half_from_full -> no stencil
half, gran, respaouter, full -> choose by newton and tri and dimension
if none of these, ptr = NULL since this list needs no stencils
use "else if" b/c skip,copy can be set in addition to half,full,etc
------------------------------------------------------------------------- */
void Neighbor::choose_stencil(int index, NeighRequest *rq)
{
StencilPtr sc = NULL;
if (rq->skip || rq->copy || rq->half_from_full) sc = NULL;
else if (rq->half || rq->gran || rq->respaouter) {
if (style == BIN) {
if (rq->newton == 0) {
if (newton_pair == 0) {
if (dimension == 2)
sc = &Neighbor::stencil_half_bin_2d_no_newton;
else if (dimension == 3)
sc = &Neighbor::stencil_half_bin_3d_no_newton;
} else if (triclinic == 0) {
if (dimension == 2)
sc = &Neighbor::stencil_half_bin_2d_newton;
else if (dimension == 3)
sc = &Neighbor::stencil_half_bin_3d_newton;
} else if (triclinic == 1) {
if (dimension == 2)
sc = &Neighbor::stencil_half_bin_2d_newton_tri;
else if (dimension == 3)
sc = &Neighbor::stencil_half_bin_3d_newton_tri;
}
} else if (rq->newton == 1) {
if (triclinic == 0) {
if (dimension == 2)
sc = &Neighbor::stencil_half_bin_2d_newton;
else if (dimension == 3)
sc = &Neighbor::stencil_half_bin_3d_newton;
} else if (triclinic == 1) {
if (dimension == 2)
sc = &Neighbor::stencil_half_bin_2d_newton_tri;
else if (dimension == 3)
sc = &Neighbor::stencil_half_bin_3d_newton_tri;
}
} else if (rq->newton == 2) {
if (dimension == 2)
sc = &Neighbor::stencil_half_bin_2d_no_newton;
else if (dimension == 3)
sc = &Neighbor::stencil_half_bin_3d_no_newton;
}
} else if (style == MULTI) {
if (rq->newton == 0) {
if (newton_pair == 0) {
if (dimension == 2)
sc = &Neighbor::stencil_half_multi_2d_no_newton;
else if (dimension == 3)
sc = &Neighbor::stencil_half_multi_3d_no_newton;
} else if (triclinic == 0) {
if (dimension == 2)
sc = &Neighbor::stencil_half_multi_2d_newton;
else if (dimension == 3)
sc = &Neighbor::stencil_half_multi_3d_newton;
} else if (triclinic == 1) {
if (dimension == 2)
sc = &Neighbor::stencil_half_multi_2d_newton_tri;
else if (dimension == 3)
sc = &Neighbor::stencil_half_multi_3d_newton_tri;
}
} else if (rq->newton == 1) {
if (triclinic == 0) {
if (dimension == 2)
sc = &Neighbor::stencil_half_multi_2d_newton;
else if (dimension == 3)
sc = &Neighbor::stencil_half_multi_3d_newton;
} else if (triclinic == 1) {
if (dimension == 2)
sc = &Neighbor::stencil_half_multi_2d_newton_tri;
else if (dimension == 3)
sc = &Neighbor::stencil_half_multi_3d_newton_tri;
}
} else if (rq->newton == 2) {
if (dimension == 2)
sc = &Neighbor::stencil_half_multi_2d_no_newton;
else if (dimension == 3)
sc = &Neighbor::stencil_half_multi_3d_no_newton;
}
}
} else if (rq->full) {
if (style == BIN) {
if (dimension == 2) {
if (rq->ghost) sc = &Neighbor::stencil_full_ghost_bin_2d;
else sc = &Neighbor::stencil_full_bin_2d;
}
else if (dimension == 3) {
if (rq->ghost) sc = &Neighbor::stencil_full_ghost_bin_3d;
else sc = &Neighbor::stencil_full_bin_3d;
}
} else if (style == MULTI) {
if (dimension == 2) sc = &Neighbor::stencil_full_multi_2d;
else if (dimension == 3) sc = &Neighbor::stencil_full_multi_3d;
}
}
stencil_create[index] = sc;
}
/* ---------------------------------------------------------------------- */
void Neighbor::print_lists_of_lists()
{
if (comm->me == 0) {
printf("Build lists = %d: ",nblist);
for (int i = 0; i < nblist; i++) printf("%d ",blist[i]);
printf("\n");
printf("Grow lists = %d: ",nglist);
for (int i = 0; i < nglist; i++) printf("%d ",glist[i]);
printf("\n");
printf("Stencil lists = %d: ",nslist);
for (int i = 0; i < nslist; i++) printf("%d ",slist[i]);
printf("\n");
}
}
/* ---------------------------------------------------------------------- */
int Neighbor::decide()
{
if (must_check) {
int n = update->ntimestep;
if (restart_check && n == output->next_restart) return 1;
for (int i = 0; i < fix_check; i++)
if (n == modify->fix[fixchecklist[i]]->next_reneighbor) return 1;
}
ago++;
if (ago >= delay && ago % every == 0) {
if (build_once) return 0;
if (dist_check == 0) return 1;
return check_distance();
} else return 0;
}
/* ----------------------------------------------------------------------
if any atom moved trigger distance (half of neighbor skin) return 1
shrink trigger distance if box size has changed
conservative shrink procedure:
compute distance each of 8 corners of box has moved since last reneighbor
reduce skin distance by sum of 2 largest of the 8 values
new trigger = 1/2 of reduced skin distance
for orthogonal box, only need 2 lo/hi corners
for triclinic, need all 8 corners since deformations can displace all 8
------------------------------------------------------------------------- */
int Neighbor::check_distance()
{
double delx,dely,delz,rsq;
double delta,deltasq,delta1,delta2;
if (boxcheck) {
if (triclinic == 0) {
delx = bboxlo[0] - boxlo_hold[0];
dely = bboxlo[1] - boxlo_hold[1];
delz = bboxlo[2] - boxlo_hold[2];
delta1 = sqrt(delx*delx + dely*dely + delz*delz);
delx = bboxhi[0] - boxhi_hold[0];
dely = bboxhi[1] - boxhi_hold[1];
delz = bboxhi[2] - boxhi_hold[2];
delta2 = sqrt(delx*delx + dely*dely + delz*delz);
delta = 0.5 * (skin - (delta1+delta2));
deltasq = delta*delta;
} else {
domain->box_corners();
delta1 = delta2 = 0.0;
for (int i = 0; i < 8; i++) {
delx = corners[i][0] - corners_hold[i][0];
dely = corners[i][1] - corners_hold[i][1];
delz = corners[i][2] - corners_hold[i][2];
delta = sqrt(delx*delx + dely*dely + delz*delz);
if (delta > delta1) delta1 = delta;
else if (delta > delta2) delta2 = delta;
}
delta = 0.5 * (skin - (delta1+delta2));
deltasq = delta*delta;
}
} else deltasq = triggersq;
double **x = atom->x;
int nlocal = atom->nlocal;
if (includegroup) nlocal = atom->nfirst;
int flag = 0;
for (int i = 0; i < nlocal; i++) {
delx = x[i][0] - xhold[i][0];
dely = x[i][1] - xhold[i][1];
delz = x[i][2] - xhold[i][2];
rsq = delx*delx + dely*dely + delz*delz;
if (rsq > deltasq) flag = 1;
}
int flagall;
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_MAX,world);
if (flagall && ago == MAX(every,delay)) ndanger++;
return flagall;
}
/* ----------------------------------------------------------------------
build all perpetual neighbor lists every few timesteps
pairwise & topology lists are created as needed
------------------------------------------------------------------------- */
void Neighbor::build()
{
int i;
ago = 0;
ncalls++;
// store current atom positions and box size if needed
if (dist_check) {
double **x = atom->x;
int nlocal = atom->nlocal;
if (includegroup) nlocal = atom->nfirst;
if (nlocal > maxhold) {
maxhold = atom->nmax;
memory->destroy(xhold);
memory->create(xhold,maxhold,3,"neigh:xhold");
}
for (i = 0; i < nlocal; i++) {
xhold[i][0] = x[i][0];
xhold[i][1] = x[i][1];
xhold[i][2] = x[i][2];
}
if (boxcheck) {
if (triclinic == 0) {
boxlo_hold[0] = bboxlo[0];
boxlo_hold[1] = bboxlo[1];
boxlo_hold[2] = bboxlo[2];
boxhi_hold[0] = bboxhi[0];
boxhi_hold[1] = bboxhi[1];
boxhi_hold[2] = bboxhi[2];
} else {
domain->box_corners();
corners = domain->corners;
for (i = 0; i < 8; i++) {
corners_hold[i][0] = corners[i][0];
corners_hold[i][1] = corners[i][1];
corners_hold[i][2] = corners[i][2];
}
}
}
}
// if any lists store neighbors of ghosts:
// invoke grow() if nlocal+nghost exceeds previous list size
// else only invoke grow() if nlocal exceeds previous list size
// only done for lists with growflag set and which are perpetual
if (anyghostlist && atom->nlocal+atom->nghost > maxatom) {
maxatom = atom->nmax;
for (i = 0; i < nglist; i++) lists[glist[i]]->grow(maxatom);
} else if (atom->nlocal > maxatom) {
maxatom = atom->nmax;
for (i = 0; i < nglist; i++) lists[glist[i]]->grow(maxatom);
}
// extend atom bin list if necessary
if (style != NSQ && atom->nmax > maxbin) {
maxbin = atom->nmax;
memory->destroy(bins);
memory->create(bins,maxbin,"bins");
}
// check that neighbor list with special bond flags will not overflow
if (atom->nlocal+atom->nghost > NEIGHMASK)
error->one(FLERR,"Too many local+ghost atoms for neighbor list");
// invoke building of pair and molecular neighbor lists
// only for pairwise lists with buildflag set
for (i = 0; i < nblist; i++)
(this->*pair_build[blist[i]])(lists[blist[i]]);
if (atom->molecular) {
if (force->bond) (this->*bond_build)();
if (force->angle) (this->*angle_build)();
if (force->dihedral) (this->*dihedral_build)();
if (force->improper) (this->*improper_build)();
}
}
/* ----------------------------------------------------------------------
build a single occasional pairwise neighbor list indexed by I
called by other classes
------------------------------------------------------------------------- */
void Neighbor::build_one(int i)
{
// update stencils and grow atom arrays and bins as needed
// only for relevant settings of stencilflag and growflag
// grow atom array for this list to current size of perpetual lists
if (lists[i]->stencilflag) {
lists[i]->stencil_allocate(smax,style);
(this->*stencil_create[i])(lists[i],sx,sy,sz);
}
if (lists[i]->growflag) lists[i]->grow(maxatom);
if (style != NSQ && atom->nmax > maxbin) {
maxbin = atom->nmax;
memory->destroy(bins);
memory->create(bins,maxbin,"bins");
}
// check that neighbor list with special bond flags will not overflow
if (atom->nlocal+atom->nghost > NEIGHMASK)
error->one(FLERR,"Too many local+ghost atoms for neighbor list");
// when occasional list built, LAMMPS can crash if atoms have moved too far
// why is this?, give warning if this is the case
// no easy workaround b/c all neighbor lists really need to be rebuilt
// solution is for input script to check more often for rebuild
// only check_distance if running a simulation, not between simulations
int flag = 0;
if (dist_check && update->whichflag) flag = check_distance();
if (flag && me == 0)
error->warning(FLERR,"Building an occasional neighobr list when "
"atoms may have moved too far");
(this->*pair_build[i])(lists[i]);
}
/* ----------------------------------------------------------------------
setup neighbor binning parameters
bin numbering in each dimension is global:
0 = 0.0 to binsize, 1 = binsize to 2*binsize, etc
nbin-1,nbin,etc = bbox-binsize to bbox, bbox to bbox+binsize, etc
-1,-2,etc = -binsize to 0.0, -2*binsize to -binsize, etc
code will work for any binsize
since next(xyz) and stencil extend as far as necessary
binsize = 1/2 of cutoff is roughly optimal
for orthogonal boxes:
a dim must be filled exactly by integer # of bins
in periodic, procs on both sides of PBC must see same bin boundary
in non-periodic, coord2bin() still assumes this by use of nbin xyz
for triclinic boxes:
tilted simulation box cannot contain integer # of bins
stencil & neigh list built differently to account for this
mbinlo = lowest global bin any of my ghost atoms could fall into
mbinhi = highest global bin any of my ghost atoms could fall into
mbin = number of bins I need in a dimension
------------------------------------------------------------------------- */
void Neighbor::setup_bins()
{
// bbox = size of bbox of entire domain
// bsubbox lo/hi = bounding box of my subdomain extended by comm->cutghost
// for triclinic:
// bbox bounds all 8 corners of tilted box
// subdomain is in lamda coords
// include dimension-dependent extension via comm->cutghost
// domain->bbox() converts lamda extent to box coords and computes bbox
double bbox[3],bsubboxlo[3],bsubboxhi[3];
double *cutghost = comm->cutghost;
if (triclinic == 0) {
bsubboxlo[0] = domain->sublo[0] - cutghost[0];
bsubboxlo[1] = domain->sublo[1] - cutghost[1];
bsubboxlo[2] = domain->sublo[2] - cutghost[2];
bsubboxhi[0] = domain->subhi[0] + cutghost[0];
bsubboxhi[1] = domain->subhi[1] + cutghost[1];
bsubboxhi[2] = domain->subhi[2] + cutghost[2];
} else {
double lo[3],hi[3];
lo[0] = domain->sublo_lamda[0] - cutghost[0];
lo[1] = domain->sublo_lamda[1] - cutghost[1];
lo[2] = domain->sublo_lamda[2] - cutghost[2];
hi[0] = domain->subhi_lamda[0] + cutghost[0];
hi[1] = domain->subhi_lamda[1] + cutghost[1];
hi[2] = domain->subhi_lamda[2] + cutghost[2];
domain->bbox(lo,hi,bsubboxlo,bsubboxhi);
}
bbox[0] = bboxhi[0] - bboxlo[0];
bbox[1] = bboxhi[1] - bboxlo[1];
bbox[2] = bboxhi[2] - bboxlo[2];
// optimal bin size is roughly 1/2 the cutoff
// for BIN style, binsize = 1/2 of max neighbor cutoff
// for MULTI style, binsize = 1/2 of min neighbor cutoff
// special case of all cutoffs = 0.0, binsize = box size
double binsize_optimal;
if (binsizeflag) binsize_optimal = binsize_user;
else if (style == BIN) binsize_optimal = 0.5*cutneighmax;
else binsize_optimal = 0.5*cutneighmin;
if (binsize_optimal == 0.0) binsize_optimal = bbox[0];
double binsizeinv = 1.0/binsize_optimal;
// test for too many global bins in any dimension due to huge global domain
if (bbox[0]*binsizeinv > MAXSMALLINT || bbox[1]*binsizeinv > MAXSMALLINT ||
bbox[2]*binsizeinv > MAXSMALLINT)
error->all(FLERR,"Domain too large for neighbor bins");
// create actual bins
// always have one bin even if cutoff > bbox
// for 2d, nbinz = 1
nbinx = static_cast<int> (bbox[0]*binsizeinv);
nbiny = static_cast<int> (bbox[1]*binsizeinv);
if (dimension == 3) nbinz = static_cast<int> (bbox[2]*binsizeinv);
else nbinz = 1;
if (nbinx == 0) nbinx = 1;
if (nbiny == 0) nbiny = 1;
if (nbinz == 0) nbinz = 1;
// compute actual bin size for nbins to fit into box exactly
// error if actual bin size << cutoff, since will create a zillion bins
// this happens when nbin = 1 and box size << cutoff
// typically due to non-periodic, flat system in a particular dim
// in that extreme case, should use NSQ not BIN neighbor style
binsizex = bbox[0]/nbinx;
binsizey = bbox[1]/nbiny;
binsizez = bbox[2]/nbinz;
bininvx = 1.0 / binsizex;
bininvy = 1.0 / binsizey;
bininvz = 1.0 / binsizez;
if (binsize_optimal*bininvx > CUT2BIN_RATIO ||
binsize_optimal*bininvy > CUT2BIN_RATIO ||
binsize_optimal*bininvz > CUT2BIN_RATIO)
error->all(FLERR,"Cannot use neighbor bins - box size << cutoff");
// mbinlo/hi = lowest and highest global bins my ghost atoms could be in
// coord = lowest and highest values of coords for my ghost atoms
// static_cast(-1.5) = -1, so subract additional -1
// add in SMALL for round-off safety
int mbinxhi,mbinyhi,mbinzhi;
double coord;
coord = bsubboxlo[0] - SMALL*bbox[0];
mbinxlo = static_cast<int> ((coord-bboxlo[0])*bininvx);
if (coord < bboxlo[0]) mbinxlo = mbinxlo - 1;
coord = bsubboxhi[0] + SMALL*bbox[0];
mbinxhi = static_cast<int> ((coord-bboxlo[0])*bininvx);
coord = bsubboxlo[1] - SMALL*bbox[1];
mbinylo = static_cast<int> ((coord-bboxlo[1])*bininvy);
if (coord < bboxlo[1]) mbinylo = mbinylo - 1;
coord = bsubboxhi[1] + SMALL*bbox[1];
mbinyhi = static_cast<int> ((coord-bboxlo[1])*bininvy);
if (dimension == 3) {
coord = bsubboxlo[2] - SMALL*bbox[2];
mbinzlo = static_cast<int> ((coord-bboxlo[2])*bininvz);
if (coord < bboxlo[2]) mbinzlo = mbinzlo - 1;
coord = bsubboxhi[2] + SMALL*bbox[2];
mbinzhi = static_cast<int> ((coord-bboxlo[2])*bininvz);
}
// extend bins by 1 to insure stencil extent is included
// if 2d, only 1 bin in z
mbinxlo = mbinxlo - 1;
mbinxhi = mbinxhi + 1;
mbinx = mbinxhi - mbinxlo + 1;
mbinylo = mbinylo - 1;
mbinyhi = mbinyhi + 1;
mbiny = mbinyhi - mbinylo + 1;
if (dimension == 3) {
mbinzlo = mbinzlo - 1;
mbinzhi = mbinzhi + 1;
} else mbinzlo = mbinzhi = 0;
mbinz = mbinzhi - mbinzlo + 1;
// memory for bin ptrs
bigint bbin = mbinx*mbiny*mbinz;
if (bbin > MAXSMALLINT) error->one(FLERR,"Too many neighbor bins");
mbins = bbin;
if (mbins > maxhead) {
maxhead = mbins;
memory->destroy(binhead);
memory->create(binhead,maxhead,"neigh:binhead");
}
// create stencil of bins to search over in neighbor list construction
// sx,sy,sz = max range of stencil in each dim
// smax = max possible size of entire 3d stencil
// stencil is empty if cutneighmax = 0.0
sx = static_cast<int> (cutneighmax*bininvx);
if (sx*binsizex < cutneighmax) sx++;
sy = static_cast<int> (cutneighmax*bininvy);
if (sy*binsizey < cutneighmax) sy++;
sz = static_cast<int> (cutneighmax*bininvz);
if (sz*binsizez < cutneighmax) sz++;
if (dimension == 2) sz = 0;
smax = (2*sx+1) * (2*sy+1) * (2*sz+1);
// create stencils for pairwise neighbor lists
// only done for lists with stencilflag and buildflag set
for (int i = 0; i < nslist; i++) {
lists[slist[i]]->stencil_allocate(smax,style);
(this->*stencil_create[slist[i]])(lists[slist[i]],sx,sy,sz);
}
}
/* ----------------------------------------------------------------------
compute closest distance between central bin (0,0,0) and bin (i,j,k)
------------------------------------------------------------------------- */
double Neighbor::bin_distance(int i, int j, int k)
{
double delx,dely,delz;
if (i > 0) delx = (i-1)*binsizex;
else if (i == 0) delx = 0.0;
else delx = (i+1)*binsizex;
if (j > 0) dely = (j-1)*binsizey;
else if (j == 0) dely = 0.0;
else dely = (j+1)*binsizey;
if (k > 0) delz = (k-1)*binsizez;
else if (k == 0) delz = 0.0;
else delz = (k+1)*binsizez;
return (delx*delx + dely*dely + delz*delz);
}
/* ----------------------------------------------------------------------
set neighbor style and skin distance
------------------------------------------------------------------------- */
void Neighbor::set(int narg, char **arg)
{
if (narg != 2) error->all(FLERR,"Illegal neighbor command");
skin = atof(arg[0]);
if (skin < 0.0) error->all(FLERR,"Illegal neighbor command");
if (strcmp(arg[1],"nsq") == 0) style = NSQ;
else if (strcmp(arg[1],"bin") == 0) style = BIN;
else if (strcmp(arg[1],"multi") == 0) style = MULTI;
else error->all(FLERR,"Illegal neighbor command");
}
/* ----------------------------------------------------------------------
modify parameters of the pair-wise neighbor build
------------------------------------------------------------------------- */
void Neighbor::modify_params(int narg, char **arg)
{
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"every") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
every = atoi(arg[iarg+1]);
if (every <= 0) error->all(FLERR,"Illegal neigh_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"delay") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
delay = atoi(arg[iarg+1]);
if (delay < 0) error->all(FLERR,"Illegal neigh_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"check") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
if (strcmp(arg[iarg+1],"yes") == 0) dist_check = 1;
else if (strcmp(arg[iarg+1],"no") == 0) dist_check = 0;
else error->all(FLERR,"Illegal neigh_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"once") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
if (strcmp(arg[iarg+1],"yes") == 0) build_once = 1;
else if (strcmp(arg[iarg+1],"no") == 0) build_once = 0;
else error->all(FLERR,"Illegal neigh_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"page") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
pgsize = atoi(arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"one") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
oneatom = atoi(arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"binsize") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
binsize_user = atof(arg[iarg+1]);
if (binsize_user <= 0.0) binsizeflag = 0;
else binsizeflag = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"include") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
includegroup = group->find(arg[iarg+1]);
if (includegroup < 0)
error->all(FLERR,"Invalid group ID in neigh_modify command");
if (includegroup && (atom->firstgroupname == NULL ||
strcmp(arg[iarg+1],atom->firstgroupname) != 0))
error->all(FLERR,"Neigh_modify include group != atom_modify first group");
iarg += 2;
} else if (strcmp(arg[iarg],"exclude") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
if (strcmp(arg[iarg+1],"type") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal neigh_modify command");
if (nex_type == maxex_type) {
maxex_type += EXDELTA;
memory->grow(ex1_type,maxex_type,"neigh:ex1_type");
memory->grow(ex2_type,maxex_type,"neigh:ex2_type");
}
ex1_type[nex_type] = atoi(arg[iarg+2]);
ex2_type[nex_type] = atoi(arg[iarg+3]);
nex_type++;
iarg += 4;
} else if (strcmp(arg[iarg+1],"group") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal neigh_modify command");
if (nex_group == maxex_group) {
maxex_group += EXDELTA;
memory->grow(ex1_group,maxex_group,"neigh:ex1_group");
memory->grow(ex2_group,maxex_group,"neigh:ex2_group");
}
ex1_group[nex_group] = group->find(arg[iarg+2]);
ex2_group[nex_group] = group->find(arg[iarg+3]);
if (ex1_group[nex_group] == -1 || ex2_group[nex_group] == -1)
error->all(FLERR,"Invalid group ID in neigh_modify command");
nex_group++;
iarg += 4;
} else if (strcmp(arg[iarg+1],"molecule") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal neigh_modify command");
- if (atom->molecule_flag == 0) {
- char *str = (char *)
- "Neigh_modify exclude molecule requires atom attribute molecule";
- error->all(FLERR,str);
- }
+ if (atom->molecule_flag == 0)
+ error->all(FLERR,"Neigh_modify exclude molecule "
+ "requires atom attribute molecule");
if (nex_mol == maxex_mol) {
maxex_mol += EXDELTA;
memory->grow(ex_mol_group,maxex_mol,"neigh:ex_mol_group");
}
ex_mol_group[nex_mol] = group->find(arg[iarg+2]);
if (ex_mol_group[nex_mol] == -1)
error->all(FLERR,"Invalid group ID in neigh_modify command");
nex_mol++;
iarg += 3;
} else if (strcmp(arg[iarg+1],"none") == 0) {
nex_type = nex_group = nex_mol = 0;
iarg += 2;
} else error->all(FLERR,"Illegal neigh_modify command");
} else error->all(FLERR,"Illegal neigh_modify command");
}
}
/* ----------------------------------------------------------------------
bin owned and ghost atoms
------------------------------------------------------------------------- */
void Neighbor::bin_atoms()
{
int i,ibin;
for (i = 0; i < mbins; i++) binhead[i] = -1;
// bin in reverse order so linked list will be in forward order
// also puts ghost atoms at end of list, which is necessary
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
int nall = nlocal + atom->nghost;
if (includegroup) {
int bitmask = group->bitmask[includegroup];
for (i = nall-1; i >= nlocal; i--) {
if (mask[i] & bitmask) {
ibin = coord2bin(x[i]);
bins[i] = binhead[ibin];
binhead[ibin] = i;
}
}
for (i = atom->nfirst-1; i >= 0; i--) {
ibin = coord2bin(x[i]);
bins[i] = binhead[ibin];
binhead[ibin] = i;
}
} else {
for (i = nall-1; i >= 0; i--) {
ibin = coord2bin(x[i]);
bins[i] = binhead[ibin];
binhead[ibin] = i;
}
}
}
/* ----------------------------------------------------------------------
convert atom coords into local bin #
for orthogonal, only ghost atoms will have coord >= bboxhi or coord < bboxlo
take special care to insure ghosts are in correct bins even w/ roundoff
hi ghost atoms = nbin,nbin+1,etc
owned atoms = 0 to nbin-1
lo ghost atoms = -1,-2,etc
this is necessary so that both procs on either side of PBC
treat a pair of atoms straddling the PBC in a consistent way
for triclinic, doesn't matter since stencil & neigh list built differently
------------------------------------------------------------------------- */
int Neighbor::coord2bin(double *x)
{
int ix,iy,iz;
if (x[0] >= bboxhi[0])
ix = static_cast<int> ((x[0]-bboxhi[0])*bininvx) + nbinx;
else if (x[0] >= bboxlo[0]) {
ix = static_cast<int> ((x[0]-bboxlo[0])*bininvx);
ix = MIN(ix,nbinx-1);
} else
ix = static_cast<int> ((x[0]-bboxlo[0])*bininvx) - 1;
if (x[1] >= bboxhi[1])
iy = static_cast<int> ((x[1]-bboxhi[1])*bininvy) + nbiny;
else if (x[1] >= bboxlo[1]) {
iy = static_cast<int> ((x[1]-bboxlo[1])*bininvy);
iy = MIN(iy,nbiny-1);
} else
iy = static_cast<int> ((x[1]-bboxlo[1])*bininvy) - 1;
if (x[2] >= bboxhi[2])
iz = static_cast<int> ((x[2]-bboxhi[2])*bininvz) + nbinz;
else if (x[2] >= bboxlo[2]) {
iz = static_cast<int> ((x[2]-bboxlo[2])*bininvz);
iz = MIN(iz,nbinz-1);
} else
iz = static_cast<int> ((x[2]-bboxlo[2])*bininvz) - 1;
return (iz-mbinzlo)*mbiny*mbinx + (iy-mbinylo)*mbinx + (ix-mbinxlo);
}
/* ----------------------------------------------------------------------
same as coord2bin, but also return ix,iy,iz offsets in each dim
------------------------------------------------------------------------- */
int Neighbor::coord2bin(double *x, int &ix, int &iy, int &iz)
{
if (x[0] >= bboxhi[0])
ix = static_cast<int> ((x[0]-bboxhi[0])*bininvx) + nbinx;
else if (x[0] >= bboxlo[0]) {
ix = static_cast<int> ((x[0]-bboxlo[0])*bininvx);
ix = MIN(ix,nbinx-1);
} else
ix = static_cast<int> ((x[0]-bboxlo[0])*bininvx) - 1;
if (x[1] >= bboxhi[1])
iy = static_cast<int> ((x[1]-bboxhi[1])*bininvy) + nbiny;
else if (x[1] >= bboxlo[1]) {
iy = static_cast<int> ((x[1]-bboxlo[1])*bininvy);
iy = MIN(iy,nbiny-1);
} else
iy = static_cast<int> ((x[1]-bboxlo[1])*bininvy) - 1;
if (x[2] >= bboxhi[2])
iz = static_cast<int> ((x[2]-bboxhi[2])*bininvz) + nbinz;
else if (x[2] >= bboxlo[2]) {
iz = static_cast<int> ((x[2]-bboxlo[2])*bininvz);
iz = MIN(iz,nbinz-1);
} else
iz = static_cast<int> ((x[2]-bboxlo[2])*bininvz) - 1;
ix -= mbinxlo;
iy -= mbinylo;
iz -= mbinzlo;
return iz*mbiny*mbinx + iy*mbinx + ix;
}
/* ----------------------------------------------------------------------
test if atom pair i,j is excluded from neighbor list
due to type, group, molecule settings from neigh_modify command
return 1 if should be excluded, 0 if included
------------------------------------------------------------------------- */
int Neighbor::exclusion(int i, int j, int itype, int jtype,
int *mask, int *molecule) const {
int m;
if (nex_type && ex_type[itype][jtype]) return 1;
if (nex_group) {
for (m = 0; m < nex_group; m++) {
if (mask[i] & ex1_bit[m] && mask[j] & ex2_bit[m]) return 1;
if (mask[i] & ex2_bit[m] && mask[j] & ex1_bit[m]) return 1;
}
}
if (nex_mol) {
for (m = 0; m < nex_mol; m++)
if (mask[i] & ex_mol_bit[m] && mask[j] & ex_mol_bit[m] &&
molecule[i] == molecule[j]) return 1;
}
return 0;
}
/* ----------------------------------------------------------------------
return # of bytes of allocated memory
------------------------------------------------------------------------- */
bigint Neighbor::memory_usage()
{
bigint bytes = 0;
bytes += memory->usage(xhold,maxhold,3);
if (style != NSQ) {
bytes += memory->usage(bins,maxbin);
bytes += memory->usage(binhead,maxhead);
}
for (int i = 0; i < nlist; i++) bytes += lists[i]->memory_usage();
bytes += memory->usage(bondlist,maxbond,3);
bytes += memory->usage(anglelist,maxangle,4);
bytes += memory->usage(dihedrallist,maxdihedral,5);
bytes += memory->usage(improperlist,maximproper,5);
return bytes;
}
/* ----------------------------------------------------------------------
return the value of exclude - used to check compatibility with GPU
------------------------------------------------------------------------- */
int Neighbor::exclude_setting()
{
return exclude;
}
diff --git a/src/neighbor.h b/src/neighbor.h
index beeed9b21..32baa809a 100644
--- a/src/neighbor.h
+++ b/src/neighbor.h
@@ -1,301 +1,384 @@
/* -*- c++ -*- ----------------------------------------------------------
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_NEIGHBOR_H
#define LMP_NEIGHBOR_H
#include "pointers.h"
namespace LAMMPS_NS {
class Neighbor : protected Pointers {
friend class Cuda;
public:
int style; // 0,1,2 = nsq, bin, multi
int every; // build every this many steps
int delay; // delay build for this many steps
int dist_check; // 0 = always build, 1 = only if 1/2 dist
int ago; // how many steps ago neighboring occurred
int pgsize; // size of neighbor page
int oneatom; // max # of neighbors for one atom
int includegroup; // only build pairwise lists for this group
int build_once; // 1 if only build lists once per run
int cudable; // GPU <-> CPU communication flag for CUDA
double skin; // skin distance
double cutneighmin; // min neighbor cutoff for all type pairs
double cutneighmax; // max neighbor cutoff for all type pairs
double *cuttype; // for each type, max neigh cut w/ others
int ncalls; // # of times build has been called
int ndanger; // # of dangerous builds
int nrequest; // requests for pairwise neighbor lists
class NeighRequest **requests; // from Pair, Fix, Compute, Command classes
int maxrequest;
int old_style; // previous run info to avoid
int old_nrequest; // re-creation of pairwise neighbor lists
int old_triclinic;
class NeighRequest **old_requests;
int nlist; // pairwise neighbor lists
class NeighList **lists;
int nbondlist; // list of bonds to compute
int **bondlist;
int nanglelist; // list of angles to compute
int **anglelist;
int ndihedrallist; // list of dihedrals to compute
int **dihedrallist;
int nimproperlist; // list of impropers to compute
int **improperlist;
Neighbor(class LAMMPS *);
virtual ~Neighbor();
virtual void init();
int request(void *); // another class requests a neighbor list
void print_lists_of_lists(); // debug print out
int decide(); // decide whether to build or not
virtual int check_distance(); // check max distance moved since last build
void setup_bins(); // setup bins based on box and cutoff
virtual void build(); // create all neighbor lists (pair,bond)
void build_one(int); // create a single neighbor list
void set(int, char **); // set neighbor style and skin distance
void modify_params(int, char**); // modify parameters that control builds
bigint memory_usage();
int exclude_setting();
protected:
int me,nprocs;
int maxatom; // size of atom-based NeighList arrays
int maxbond,maxangle,maxdihedral,maximproper; // size of bond lists
int maxwt; // max weighting factor applied + 1
int must_check; // 1 if must check other classes to reneigh
int restart_check; // 1 if restart enabled, 0 if no
int fix_check; // # of fixes that induce reneigh
int *fixchecklist; // which fixes to check
double **cutneighsq; // neighbor cutneigh sq for each type pair
double **cutneighghostsq; // neighbor cutnsq for each ghost type pair
double cutneighmaxsq; // cutneighmax squared
double *cuttypesq; // cuttype squared
double triggersq; // trigger = build when atom moves this dist
double **xhold; // atom coords at last neighbor build
int maxhold; // size of xhold array
int boxcheck; // 1 if need to store box size
double boxlo_hold[3],boxhi_hold[3]; // box size at last neighbor build
double corners_hold[8][3]; // box corners at last neighbor build
int nbinx,nbiny,nbinz; // # of global bins
int *bins; // ptr to next atom in each bin
int maxbin; // size of bins array
int *binhead; // ptr to 1st atom in each bin
int maxhead; // size of binhead array
int mbins; // # of local bins and offset
int mbinx,mbiny,mbinz;
int mbinxlo,mbinylo,mbinzlo;
int binsizeflag; // user-chosen bin size
double binsize_user;
double binsizex,binsizey,binsizez; // actual bin sizes and inverse sizes
double bininvx,bininvy,bininvz;
int sx,sy,sz,smax; // bin stencil extents
int dimension; // 2/3 for 2d/3d
int triclinic; // 0 if domain is orthog, 1 if triclinic
int newton_pair; // 0 if newton off, 1 if on for pairwise
double *bboxlo,*bboxhi; // ptrs to full domain bounding box
double (*corners)[3]; // ptr to 8 corners of triclinic box
double inner[2],middle[2]; // rRESPA cutoffs for extra lists
double cut_inner_sq; // outer cutoff for inner neighbor list
double cut_middle_sq; // outer cutoff for middle neighbor list
double cut_middle_inside_sq; // inner cutoff for middle neighbor list
int special_flag[4]; // flags for 1-2, 1-3, 1-4 neighbors
int anyghostlist; // 1 if any non-occasional list
// stores neighbors of ghosts
int exclude; // 0 if no type/group exclusions, 1 if yes
int nex_type; // # of entries in type exclusion list
int maxex_type; // max # in type list
int *ex1_type,*ex2_type; // pairs of types to exclude
int **ex_type; // 2d array of excluded type pairs
int nex_group; // # of entries in group exclusion list
int maxex_group; // max # in group list
int *ex1_group,*ex2_group; // pairs of group #'s to exclude
int *ex1_bit,*ex2_bit; // pairs of group bits to exclude
int nex_mol; // # of entries in molecule exclusion list
int maxex_mol; // max # in molecule list
int *ex_mol_group; // molecule group #'s to exclude
int *ex_mol_bit; // molecule group bits to exclude
int nblist,nglist,nslist; // # of pairwise neigh lists of various kinds
int *blist; // lists to build every reneighboring
int *glist; // lists to grow atom arrays every reneigh
int *slist; // lists to grow stencil arrays every reneigh
void bin_atoms(); // bin all atoms
double bin_distance(int, int, int); // distance between binx
int coord2bin(double *); // mapping atom coord to a bin
int coord2bin(double *, int &, int &, int&); // ditto
int exclusion(int, int, int,
int, int *, int *) const; // test for pair exclusion
virtual void choose_build(int, class NeighRequest *);
void choose_stencil(int, class NeighRequest *);
// pairwise build functions
typedef void (Neighbor::*PairPtr)(class NeighList *);
PairPtr *pair_build;
void half_nsq_no_newton(class NeighList *);
void half_nsq_newton(class NeighList *);
void half_bin_no_newton(class NeighList *);
void half_bin_newton(class NeighList *);
void half_bin_newton_tri(class NeighList *);
void half_multi_no_newton(class NeighList *);
void half_multi_newton(class NeighList *);
void half_multi_newton_tri(class NeighList *);
void full_nsq(class NeighList *);
void full_nsq_ghost(class NeighList *);
void full_bin(class NeighList *);
void full_bin_ghost(class NeighList *);
void full_multi(class NeighList *);
void half_from_full_no_newton(class NeighList *);
void half_from_full_newton(class NeighList *);
void skip_from(class NeighList *);
void skip_from_granular(class NeighList *);
void skip_from_respa(class NeighList *);
void copy_from(class NeighList *);
void granular_nsq_no_newton(class NeighList *);
void granular_nsq_newton(class NeighList *);
void granular_bin_no_newton(class NeighList *);
void granular_bin_newton(class NeighList *);
void granular_bin_newton_tri(class NeighList *);
void respa_nsq_no_newton(class NeighList *);
void respa_nsq_newton(class NeighList *);
void respa_bin_no_newton(class NeighList *);
void respa_bin_newton(class NeighList *);
void respa_bin_newton_tri(class NeighList *);
// OpenMP multi-threaded neighbor list build versions
#include "accelerator_omp.h"
// pairwise stencil creation functions
typedef void (Neighbor::*StencilPtr)(class NeighList *, int, int, int);
StencilPtr *stencil_create;
void stencil_half_bin_2d_no_newton(class NeighList *, int, int, int);
void stencil_half_bin_3d_no_newton(class NeighList *, int, int, int);
void stencil_half_bin_2d_newton(class NeighList *, int, int, int);
void stencil_half_bin_3d_newton(class NeighList *, int, int, int);
void stencil_half_bin_2d_newton_tri(class NeighList *, int, int, int);
void stencil_half_bin_3d_newton_tri(class NeighList *, int, int, int);
void stencil_half_multi_2d_no_newton(class NeighList *, int, int, int);
void stencil_half_multi_3d_no_newton(class NeighList *, int, int, int);
void stencil_half_multi_2d_newton(class NeighList *, int, int, int);
void stencil_half_multi_3d_newton(class NeighList *, int, int, int);
void stencil_half_multi_2d_newton_tri(class NeighList *, int, int, int);
void stencil_half_multi_3d_newton_tri(class NeighList *, int, int, int);
void stencil_full_bin_2d(class NeighList *, int, int, int);
void stencil_full_ghost_bin_2d(class NeighList *, int, int, int);
void stencil_full_bin_3d(class NeighList *, int, int, int);
void stencil_full_ghost_bin_3d(class NeighList *, int, int, int);
void stencil_full_multi_2d(class NeighList *, int, int, int);
void stencil_full_multi_3d(class NeighList *, int, int, int);
// topology build functions
typedef void (Neighbor::*BondPtr)(); // ptrs to topology build functions
BondPtr bond_build; // ptr to bond list functions
void bond_all(); // bond list with all bonds
void bond_partial(); // exclude certain bonds
BondPtr angle_build; // ptr to angle list functions
void angle_all(); // angle list with all angles
void angle_partial(); // exclude certain angles
BondPtr dihedral_build; // ptr to dihedral list functions
void dihedral_all(); // dihedral list with all dihedrals
void dihedral_partial(); // exclude certain dihedrals
BondPtr improper_build; // ptr to improper list functions
void improper_all(); // improper list with all impropers
void improper_partial(); // exclude certain impropers
// find_special: determine if atom j is in special list of atom i
// if it is not, return 0
// if it is and special flag is 0 (both coeffs are 0.0), return -1
// if it is and special flag is 1 (both coeffs are 1.0), return 0
// if it is and special flag is 2 (otherwise), return 1,2,3
// for which neighbor it is (and which coeff it maps to)
inline int find_special(const int *list, const int *nspecial,
const int tag) const {
const int n1 = nspecial[0];
const int n2 = nspecial[1];
const int n3 = nspecial[2];
for (int i = 0; i < n3; i++) {
if (list[i] == tag) {
if (i < n1) {
if (special_flag[1] == 0) return -1;
else if (special_flag[1] == 1) return 0;
else return 1;
} else if (i < n2) {
if (special_flag[2] == 0) return -1;
else if (special_flag[2] == 1) return 0;
else return 2;
} else {
if (special_flag[3] == 0) return -1;
else if (special_flag[3] == 1) return 0;
else return 3;
}
}
}
return 0;
};
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Neighbor delay must be 0 or multiple of every setting
+
+The delay and every parameters set via the neigh_modify command are
+inconsistent. If the delay setting is non-zero, then it must be a
+multiple of the every setting.
+
+E: Neighbor page size must be >= 10x the one atom setting
+
+This is required to prevent wasting too much memory.
+
+E: Invalid atom type in neighbor exclusion list
+
+Atom types must range from 1 to Ntypes inclusive.
+
+E: Neighbor include group not allowed with ghost neighbors
+
+This is a current restriction within LAMMPS.
+
+E: Neighbor multi not yet enabled for ghost neighbors
+
+This is a current restriction within LAMMPS.
+
+E: Neighbor multi not yet enabled for granular
+
+Self-explanatory.
+
+E: Neighbor multi not yet enabled for rRESPA
+
+Self-explanatory.
+
+E: Neighbors of ghost atoms only allowed for full neighbor lists
+
+This is a current restriction within LAMMPS.
+
+E: Too many local+ghost atoms for neighbor list
+
+UNDOCUMENTED
+
+W: Building an occasional neighobr list when atoms may have moved too far
+
+This can cause LAMMPS to crash when the neighbor list is built.
+The solution is to check for building the regular neighbor lists
+more frequently.
+
+E: Domain too large for neighbor bins
+
+The domain has become extremely large so that neighbor bins cannot be
+used. Most likely, one or more atoms have been blown out of the
+simulation box to a great distance.
+
+E: Cannot use neighbor bins - box size << cutoff
+
+Too many neighbor bins will be created. This typically happens when
+the simulation box is very small in some dimension, compared to the
+neighbor cutoff. Use the "nsq" style instead of "bin" style.
+
+E: Too many neighbor bins
+
+This is likely due to an immense simulation box that has blown up
+to a large size.
+
+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: Invalid group ID in neigh_modify command
+
+A group ID used in the neigh_modify command does not exist.
+
+E: Neigh_modify include group != atom_modify first group
+
+Self-explanatory.
+
+E: Neigh_modify exclude molecule requires atom attribute molecule
+
+Self-explanatory.
+
+*/
diff --git a/src/output.h b/src/output.h
index 735cd28f3..be3023615 100644
--- a/src/output.h
+++ b/src/output.h
@@ -1,70 +1,141 @@
/* ----------------------------------------------------------------------
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_OUTPUT_H
#define LMP_OUTPUT_H
#include "pointers.h"
namespace LAMMPS_NS {
class Output : protected Pointers {
public:
bigint next; // next timestep for any kind of output
bigint next_thermo; // next timestep for thermo output
int thermo_every; // thermo output every this many steps
bigint last_thermo; // last timestep thermo was output
char *var_thermo; // variable name for thermo frequency
int ivar_thermo; // variable index for thermo frequency
class Thermo *thermo; // Thermodynamic computations
int ndump; // # of Dumps defined
int max_dump; // max size of Dump list
bigint next_dump_any; // next timestep for any Dump
int *every_dump; // output of each Dump every this many steps
bigint *next_dump; // next timestep to do each Dump
bigint *last_dump; // last timestep each snapshot was output
char **var_dump; // variable name for dump frequency
int *ivar_dump; // variable index for dump frequency
class Dump **dump; // list of defined Dumps
bigint next_restart; // next timestep to write a restart file
int restart_every; // write a restart file every this many steps
bigint last_restart; // last timestep a restart file was output
int restart_toggle; // 0 if use restart1 as prefix
// 1 if use restart1 as file, 2 for restart2
char *restart1,*restart2; // names for restart files
class WriteRestart *restart; // Restart output
Output(class LAMMPS *);
~Output();
void init();
void setup(int); // initial output before run/min
void write(bigint); // output for current timestep
void write_dump(bigint); // force output of dump snapshots
void write_restart(bigint); // force output of a restart file
void add_dump(int, char **); // add a Dump to Dump list
void modify_dump(int, char **); // modify a Dump
void delete_dump(char *); // delete a Dump from Dump list
void create_thermo(int, char **); // create a thermo style
void create_restart(int, char **); // create Restart and restart files
void memory_usage(); // print out memory usage
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Variable name for thermo every does not exist
+
+Self-explanatory.
+
+E: Variable for thermo every is invalid style
+
+Only equal-style variables can be used.
+
+E: Variable name for dump every does not exist
+
+Self-explanatory.
+
+E: Variable for dump every is invalid style
+
+Only equal-style variables can be used.
+
+E: Dump every variable returned a bad timestep
+
+The variable must return a timestep greater than the current timestep.
+
+E: Thermo every variable returned a bad timestep
+
+The variable must return a timestep greater than the current timestep.
+
+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: Reuse of dump ID
+
+A dump ID cannot be used twice.
+
+E: Could not find dump group ID
+
+A group ID used in the dump command does not exist.
+
+E: Invalid dump frequency
+
+Dump frequency must be 1 or greater.
+
+E: Invalid dump style
+
+The choice of dump style is unknown.
+
+E: Cound not find dump_modify ID
+
+Self-explanatory.
+
+E: Could not find undump ID
+
+A dump ID used in the undump command does not exist.
+
+E: Thermo_style command before simulation box is defined
+
+The thermo_style command cannot be used before a read_data,
+read_restart, or create_box command.
+
+W: New thermo_style command, previous thermo_modify settings will be lost
+
+If a thermo_style command is used after a thermo_modify command, the
+settings changed by the thermo_modify command will be reset to their
+default values. This is because the thermo_modify commmand acts on
+the currently defined thermo style, and a thermo_style command creates
+a new style.
+
+*/
diff --git a/src/pair.h b/src/pair.h
index ed64c43e4..756c894de 100644
--- a/src/pair.h
+++ b/src/pair.h
@@ -1,172 +1,253 @@
/* ----------------------------------------------------------------------
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_PAIR_H
#define LMP_PAIR_H
#include "pointers.h"
namespace LAMMPS_NS {
class Pair : protected Pointers {
friend class AngleSDK;
friend class AngleSDKOMP;
friend class BondQuartic;
friend class BondQuarticOMP;
friend class DihedralCharmm;
friend class DihedralCharmmOMP;
friend class FixGPU;
friend class ThrOMP;
public:
double eng_vdwl,eng_coul; // accumulated energies
double virial[6]; // accumulated virial
double *eatom,**vatom; // accumulated per-atom energy/virial
double cutforce; // max cutoff for all atom pairs
double **cutsq; // cutoff sq for each atom pair
int **setflag; // 0/1 = whether each i,j has been set
int comm_forward; // size of forward communication (0 if none)
int comm_reverse; // size of reverse communication (0 if none)
int single_enable; // 1 if single() routine exists
int restartinfo; // 1 if pair style writes restart info
int respa_enable; // 1 if inner/middle/outer rRESPA routines
int one_coeff; // 1 if allows only one coeff * * call
int no_virial_fdotr_compute; // 1 if does not invoke virial_fdotr_compute()
int ghostneigh; // 1 if pair style needs neighbors of ghosts
double **cutghost; // cutoff for each ghost pair
int tail_flag; // pair_modify flag for LJ tail correction
double etail,ptail; // energy/pressure tail corrections
double etail_ij,ptail_ij;
int nextra; // # of extra quantities pair style calculates
double *pvector; // vector of extra pair quantities
int single_extra; // number of extra single values calculated
double *svector; // vector of extra single quantities
class NeighList *list; // standard neighbor list used by most pairs
class NeighList *listhalf; // half list used by some pairs
class NeighList *listfull; // full list used by some pairs
class NeighList *listgranhistory; // granular history list used by some pairs
class NeighList *listinner; // rRESPA lists used by some pairs
class NeighList *listmiddle;
class NeighList *listouter;
Pair(class LAMMPS *);
virtual ~Pair();
// top-level Pair methods
void init();
void reinit();
double mix_energy(double, double, double, double);
double mix_distance(double, double);
void write_file(int, char **);
void init_bitmap(double, double, int, int &, int &, int &, int &);
virtual void modify_params(int, char **);
// need to be public, so can be called by pair_style reaxc
void v_tally(int, double *);
void ev_tally(int, int, int, int, double, double, double,
double, double, double);
void ev_tally3(int, int, int, double, double,
double *, double *, double *, double *);
void v_tally3(int, int, int, double *, double *, double *, double *);
void v_tally4(int, int, int, int, double *, double *, double *,
double *, double *, double *);
// general child-class methods
virtual void compute(int, int) = 0;
virtual void compute_inner() {}
virtual void compute_middle() {}
virtual void compute_outer(int, int) {}
virtual double single(int, int, int, int,
double, double, double, double &) {return 0.0;}
virtual void settings(int, char **) = 0;
virtual void coeff(int, char **) = 0;
virtual void init_style();
virtual void init_list(int, class NeighList *);
virtual double init_one(int, int) {return 0.0;}
virtual void write_restart(FILE *) {}
virtual void read_restart(FILE *) {}
virtual void write_restart_settings(FILE *) {}
virtual void read_restart_settings(FILE *) {}
virtual int pack_comm(int, int *, double *, int, int *) {return 0;}
virtual void unpack_comm(int, int, double *) {}
virtual int pack_reverse_comm(int, int, double *) {return 0;}
virtual void unpack_reverse_comm(int, int *, double *) {}
virtual double memory_usage();
// specific child-class methods for certain Pair styles
- virtual void *extract(char *, int &) {return NULL;}
+ virtual void *extract(const char *, int &) {return NULL;}
virtual void swap_eam(double *, double **) {}
virtual void reset_dt() {}
virtual void min_xf_pointers(int, double **, double **) {}
virtual void min_xf_get(int) {}
virtual void min_x_set(int) {}
protected:
int allocated; // 0/1 = whether arrays are allocated
// pair_modify settings
int offset_flag,mix_flag; // flags for offset and mixing
int ncoultablebits; // size of Coulomb table
double tabinner; // inner cutoff for Coulomb table
// custom data type for accessing Coulomb tables
typedef union {int i; float f;} union_int_float_t;
double THIRD;
int evflag; // energy,virial settings
int eflag_either,eflag_global,eflag_atom;
int vflag_either,vflag_global,vflag_atom;
int vflag_fdotr;
int maxeatom,maxvatom;
virtual void ev_setup(int, int);
void ev_tally_full(int, double, double, double, double, double, double);
void ev_tally_xyz(int, int, int, int, double, double,
double, double, double, double, double, double);
void ev_tally_xyz_full(int, double, double,
double, double, double, double, double, double);
void ev_tally4(int, int, int, int, double,
double *, double *, double *, double *, double *, double *);
void ev_tally_list(int, int *, double, double *);
void v_tally2(int, int, double, double *);
void v_tally_tensor(int, int, int, int,
double, double, double, double, double, double);
void virial_fdotr_compute();
inline int sbmask(int j) {
return j >> SBBITS & 3;
}
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+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: Too many total bits for bitmapped lookup table
+
+Table size specified via pair_modify command is too large. Note that
+a value of N generates a 2^N size table.
+
+E: Cannot have both pair_modify shift and tail set to yes
+
+These 2 options are contradictory.
+
+E: Cannot use pair tail corrections with 2d simulations
+
+The correction factors are only currently defined for 3d systems.
+
+W: Using pair tail corrections with nonperiodic system
+
+This is probably a bogus thing to do, since tail corrections are
+computed by integrating the density of a periodic system out to
+infinity.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+E: Pair style does not support pair_write
+
+The pair style does not have a single() function, so it can
+not be invoked by pair write.
+
+E: Invalid atom types in pair_write command
+
+Atom types must range from 1 to Ntypes inclusive.
+
+E: Invalid style in pair_write command
+
+Self-explanatory. Check the input script.
+
+E: Invalid cutoffs in pair_write command
+
+Inner cutoff must be larger than 0.0 and less than outer cutoff.
+
+E: Cannot open pair_write file
+
+The specified output file for pair energies and forces cannot be
+opened. Check that the path and name are correct.
+
+E: Bitmapped lookup tables require int/float be same size
+
+Cannot use pair tables on this machine, because of word sizes. Use
+the pair_modify command with table 0 instead.
+
+W: Table inner cutoff >= outer cutoff
+
+You specified an inner cutoff for a Coulombic table that is longer
+than the global cutoff. Probably not what you wanted.
+
+E: Too many exponent bits for lookup table
+
+Table size specified via pair_modify command does not work with your
+machine's floating point representation.
+
+E: Too many mantissa bits for lookup table
+
+Table size specified via pair_modify command does not work with your
+machine's floating point representation.
+
+E: Too few bits for lookup table
+
+Table size specified via pair_modify command does not work with your
+machine's floating point representation.
+
+*/
diff --git a/src/pair_born.cpp b/src/pair_born.cpp
index 271b7b1f7..68905a95d 100644
--- a/src/pair_born.cpp
+++ b/src/pair_born.cpp
@@ -1,409 +1,409 @@
/* ----------------------------------------------------------------------
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: Sai Jayaraman (Sandia)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_born.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neigh_list.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
/* ---------------------------------------------------------------------- */
PairBorn::PairBorn(LAMMPS *lmp) : Pair(lmp) {}
/* ---------------------------------------------------------------------- */
PairBorn::~PairBorn()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cut);
memory->destroy(a);
memory->destroy(rho);
memory->destroy(sigma);
memory->destroy(c);
memory->destroy(d);
memory->destroy(rhoinv);
memory->destroy(born1);
memory->destroy(born2);
memory->destroy(born3);
memory->destroy(offset);
}
}
/* ---------------------------------------------------------------------- */
void PairBorn::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,r2inv,r6inv,forceborn,factor_lj;
double r,rexp;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = 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;
double *special_lj = force->special_lj;
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];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
r = sqrt(rsq);
rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
+ born3[itype][jtype]*r2inv*r6inv;
fpair = factor_lj*forceborn*r2inv;
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) {
evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv
+ d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
evdwl *= factor_lj;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairBorn::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(a,n+1,n+1,"pair:a");
memory->create(rho,n+1,n+1,"pair:rho");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(c,n+1,n+1,"pair:c");
memory->create(d,n+1,n+1,"pair:d");
memory->create(rhoinv,n+1,n+1,"pair:rhoinv");
memory->create(born1,n+1,n+1,"pair:born1");
memory->create(born2,n+1,n+1,"pair:born2");
memory->create(born3,n+1,n+1,"pair:born3");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairBorn::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = atof(arg[0]);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut[i][j] = cut_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairBorn::coeff(int narg, char **arg)
{
if (narg < 7 || narg > 8) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a_one = force->numeric(arg[2]);
double rho_one = force->numeric(arg[3]);
double sigma_one = force->numeric(arg[4]);
if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients");
double c_one = force->numeric(arg[5]);
double d_one = force->numeric(arg[6]);
double cut_one = cut_global;
if (narg == 8) cut_one = force->numeric(arg[7]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
a[i][j] = a_one;
rho[i][j] = rho_one;
sigma[i][j] = sigma_one;
c[i][j] = c_one;
d[i][j] = d_one;
cut[i][j] = cut_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairBorn::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
rhoinv[i][j] = 1.0/rho[i][j];
born1[i][j] = a[i][j]/rho[i][j];
born2[i][j] = 6.0*c[i][j];
born3[i][j] = 8.0*d[i][j];
if (offset_flag) {
double rexp = exp((sigma[i][j]-cut[i][j])*rhoinv[i][j]);
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut[i][j],6.0) +
d[i][j]/pow(cut[i][j],8.0);
} else offset[i][j] = 0.0;
a[j][i] = a[i][j];
c[j][i] = c[i][j];
d[j][i] = d[i][j];
rhoinv[j][i] = rhoinv[i][j];
sigma[j][i] = sigma[i][j];
born1[j][i] = born1[i][j];
born2[j][i] = born2[i][j];
born3[j][i] = born3[i][j];
offset[j][i] = offset[i][j];
// compute I,J contribution to long-range tail correction
// count total # of atoms of type I and J via Allreduce
if (tail_flag) {
int *type = atom->type;
int nlocal = atom->nlocal;
double count[2],all[2];
count[0] = count[1] = 0.0;
for (int k = 0; k < nlocal; k++) {
if (type[k] == i) count[0] += 1.0;
if (type[k] == j) count[1] += 1.0;
}
MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
double rho1 = rho[i][j];
double rho2 = rho1*rho1;
double rho3 = rho2*rho1;
double rc = cut[i][j];
double rc2 = rc*rc;
double rc3 = rc2*rc;
double rc5 = rc3*rc2;
etail_ij = 2.0*MY_PI*all[0]*all[1] *
(a[i][j]*exp((sigma[i][j]-rc)/rho1)*rho1*
(rc2 + 2.0*rho1*rc + 2.0*rho2) -
c[i][j]/(3.0*rc3) + d[i][j]/(5.0*rc5));
ptail_ij = (-1/3.0)*2.0*MY_PI*all[0]*all[1] *
(-a[i][j]*exp((sigma[i][j]-rc)/rho1) *
(rc3 + 3.0*rho1*rc2 + 6.0*rho2*rc + 6.0*rho3) +
2.0*c[i][j]/rc3 - 8.0*d[i][j]/(5.0*rc5));
}
return cut[i][j];
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairBorn::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&a[i][j],sizeof(double),1,fp);
fwrite(&rho[i][j],sizeof(double),1,fp);
fwrite(&sigma[i][j],sizeof(double),1,fp);
fwrite(&c[i][j],sizeof(double),1,fp);
fwrite(&d[i][j],sizeof(double),1,fp);
fwrite(&cut[i][j],sizeof(double),1,fp);
}
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairBorn::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
fread(&a[i][j],sizeof(double),1,fp);
fread(&rho[i][j],sizeof(double),1,fp);
fread(&sigma[i][j],sizeof(double),1,fp);
fread(&c[i][j],sizeof(double),1,fp);
fread(&d[i][j],sizeof(double),1,fp);
fread(&cut[i][j],sizeof(double),1,fp);
}
MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&d[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairBorn::write_restart_settings(FILE *fp)
{
fwrite(&cut_global,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairBorn::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&cut_global,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
double PairBorn::single(int i, int j, int itype, int jtype,
double rsq, double factor_coul, double factor_lj,
double &fforce)
{
double r2inv,r6inv,r,rexp,forceborn,phiborn;
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
r = sqrt(rsq);
rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv +
born3[itype][jtype]*r2inv*r6inv;
fforce = factor_lj*forceborn*r2inv;
phiborn = a[itype][jtype]*rexp - c[itype][jtype]*r6inv +
d[itype][jtype]*r2inv*r6inv - offset[itype][jtype];
return factor_lj*phiborn;
}
/* ---------------------------------------------------------------------- */
-void *PairBorn::extract(char *str, int &dim)
+void *PairBorn::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str,"a") == 0) return (void *) a;
if (strcmp(str,"c") == 0) return (void *) c;
if (strcmp(str,"d") == 0) return (void *) d;
return NULL;
}
diff --git a/src/pair_born.h b/src/pair_born.h
index 716392eb8..566fdc7c4 100644
--- a/src/pair_born.h
+++ b/src/pair_born.h
@@ -1,55 +1,74 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(born,PairBorn)
#else
#ifndef PAIR_BORN_H
#define PAIR_BORN_H
#include "pair.h"
namespace LAMMPS_NS {
class PairBorn : public Pair {
public:
PairBorn(class LAMMPS *);
virtual ~PairBorn();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
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 &);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
double cut_global;
double **cut;
double **a,**rho,**sigma,**c, **d;
double **rhoinv,**born1,**born2,**born3,**offset;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+*/
diff --git a/src/KSPACE/pair_born_coul_long.cpp b/src/pair_born_coul_wolf.cpp
similarity index 73%
copy from src/KSPACE/pair_born_coul_long.cpp
copy to src/pair_born_coul_wolf.cpp
index 2e607cd74..647c6bdaf 100644
--- a/src/KSPACE/pair_born_coul_long.cpp
+++ b/src/pair_born_coul_wolf.cpp
@@ -1,497 +1,470 @@
/* ----------------------------------------------------------------------
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: Ahmed Ismail (SNL)
+ Contributing author: Yongfeng Zhang (INL), yongfeng.zhang@inl.gov
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
-#include "pair_born_coul_long.h"
+#include "pair_born_coul_wolf.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
-#include "kspace.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
-#define EWALD_F 1.12837917
-#define EWALD_P 0.3275911
-#define A1 0.254829592
-#define A2 -0.284496736
-#define A3 1.421413741
-#define A4 -1.453152027
-#define A5 1.061405429
-
/* ---------------------------------------------------------------------- */
-PairBornCoulLong::PairBornCoulLong(LAMMPS *lmp) : Pair(lmp) {}
+PairBornCoulWolf::PairBornCoulWolf(LAMMPS *lmp) : Pair(lmp) {}
/* ---------------------------------------------------------------------- */
-PairBornCoulLong::~PairBornCoulLong()
+PairBornCoulWolf::~PairBornCoulWolf()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(a);
memory->destroy(rho);
memory->destroy(sigma);
memory->destroy(c);
memory->destroy(d);
memory->destroy(rhoinv);
memory->destroy(born1);
memory->destroy(born2);
memory->destroy(born3);
memory->destroy(offset);
}
}
/* ---------------------------------------------------------------------- */
-void PairBornCoulLong::compute(int eflag, int vflag)
+void PairBornCoulWolf::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
double rsq,r2inv,r6inv,forcecoul,forceborn,factor_coul,factor_lj;
- double grij,expm2,prefactor,t,erfc;
+ double prefactor;
double r,rexp;
int *ilist,*jlist,*numneigh,**firstneigh;
+ double erfcc,erfcd,v_sh,dvdrr,e_self,qisq;
evdwl = ecoul = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
+ int nall = nlocal + atom->nghost;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
+ // self and shifted coulombic energy
+
+ e_self = v_sh = 0.0;
+ e_shift = erfc(alf*cut_coul)/cut_coul;
+ f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) /
+ cut_coul;
+
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];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
+ qisq = qtmp*qtmp;
+ e_self = -(e_shift/2.0 + alf/MY_PIS) * qisq*qqrd2e;
+ if (evflag) ev_tally(i,i,nlocal,0,0.0,e_self,0.0,0.0,0.0,0.0);
+
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
- factor_lj = special_lj[sbmask(j)];
- factor_coul = special_coul[sbmask(j)];
- j &= NEIGHMASK;
+
+ if (j < nall) factor_coul = factor_lj = 1.0;
+ else {
+ factor_coul = special_coul[j/nall];
+ factor_lj = special_lj[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];
if (rsq < cutsq[itype][jtype]) {
r2inv = 1.0/rsq;
- r = sqrt(rsq);
if (rsq < cut_coulsq) {
- grij = g_ewald * r;
- expm2 = exp(-grij*grij);
- t = 1.0 / (1.0 + EWALD_P*grij);
- erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
- prefactor = qqrd2e * qtmp*q[j]/r;
- forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+ r = sqrt(rsq);
+ prefactor = qqrd2e*qtmp*q[j]/r;
+ erfcc = erfc(alf*r);
+ erfcd = exp(-alf*alf*r*r);
+ v_sh = (erfcc - e_shift*r) * prefactor;
+ dvdrr = (erfcc/rsq + 2.0*alf/MY_PIS * erfcd/r) + f_shift;
+ forcecoul = dvdrr*rsq*prefactor;
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else forcecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
r6inv = r2inv*r2inv*r2inv;
+ r = sqrt(rsq);
rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
+ born3[itype][jtype]*r2inv*r6inv;
} else forceborn = 0.0;
fpair = (forcecoul + factor_lj*forceborn) * r2inv;
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) {
if (rsq < cut_coulsq) {
- ecoul = prefactor*erfc;
+ ecoul = v_sh;
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
} else ecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
- evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv
- + d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
+ evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv +
+ d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
evdwl *= factor_lj;
} else evdwl = 0.0;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,ecoul,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
-void PairBornCoulLong::allocate()
+void PairBornCoulWolf::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut_lj,n+1,n+1,"pair:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"pair:cut_ljsq");
memory->create(a,n+1,n+1,"pair:a");
memory->create(rho,n+1,n+1,"pair:rho");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(c,n+1,n+1,"pair:c");
memory->create(d,n+1,n+1,"pair:d");
memory->create(rhoinv,n+1,n+1,"pair:rhoinv");
memory->create(born1,n+1,n+1,"pair:born1");
memory->create(born2,n+1,n+1,"pair:born2");
memory->create(born3,n+1,n+1,"pair:born3");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
-void PairBornCoulLong::settings(int narg, char **arg)
+void PairBornCoulWolf::settings(int narg, char **arg)
{
- if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
-
- cut_lj_global = force->numeric(arg[0]);
- if (narg == 1) cut_coul = cut_lj_global;
- else cut_coul = force->numeric(arg[1]);
+ if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command");
- // reset cutoffs that have been explicitly set
+ alf = force->numeric(arg[0]);
+ cut_lj_global = force->numeric(arg[1]);
+ if (narg == 2) cut_coul = cut_lj_global;
+ else cut_coul = force->numeric(arg[2]);
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
-void PairBornCoulLong::coeff(int narg, char **arg)
+void PairBornCoulWolf::coeff(int narg, char **arg)
{
- if (narg < 7 || narg > 8) error->all(FLERR,"Incorrect args for pair coefficients");
+ if (narg < 7 || narg > 8)
+ error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a_one = force->numeric(arg[2]);
double rho_one = force->numeric(arg[3]);
double sigma_one = force->numeric(arg[4]);
if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients");
double c_one = force->numeric(arg[5]);
double d_one = force->numeric(arg[6]);
double cut_lj_one = cut_lj_global;
if (narg == 8) cut_lj_one = force->numeric(arg[7]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
a[i][j] = a_one;
rho[i][j] = rho_one;
sigma[i][j] = sigma_one;
c[i][j] = c_one;
d[i][j] = d_one;
cut_lj[i][j] = cut_lj_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
+/* ----------------------------------------------------------------------
+ init specific to this pair style
+------------------------------------------------------------------------- */
+
+void PairBornCoulWolf::init_style()
+{
+ if (!atom->q_flag)
+ error->all(FLERR,"Pair style born/coul/Wolf requires atom attribute q");
+
+ int irequest = neighbor->request(this);
+
+ cut_coulsq = cut_coul * cut_coul;
+}
+
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
-double PairBornCoulLong::init_one(int i, int j)
+double PairBornCoulWolf::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
double cut = MAX(cut_lj[i][j],cut_coul);
cut_ljsq[i][j] = cut_lj[i][j] * cut_lj[i][j];
rhoinv[i][j] = 1.0/rho[i][j];
born1[i][j] = a[i][j]/rho[i][j];
born2[i][j] = 6.0*c[i][j];
born3[i][j] = 8.0*d[i][j];
if (offset_flag) {
- double rexp = exp(-cut_lj[i][j]*rhoinv[i][j]);
- offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0) +
- d[i][j]/pow(cut_lj[i][j],8.0);
+ double rexp = exp(-cut_lj[i][j]/rho[i][j]);
+ offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0)
+ + d[i][j]/pow(cut_lj[i][j],8.0);
} else offset[i][j] = 0.0;
cut_ljsq[j][i] = cut_ljsq[i][j];
a[j][i] = a[i][j];
c[j][i] = c[i][j];
d[j][i] = d[i][j];
rhoinv[j][i] = rhoinv[i][j];
sigma[j][i] = sigma[i][j];
born1[j][i] = born1[i][j];
born2[j][i] = born2[i][j];
born3[j][i] = born3[i][j];
offset[j][i] = offset[i][j];
- // compute I,J contribution to long-range tail correction
- // count total # of atoms of type I and J via Allreduce
-
- if (tail_flag) {
- int *type = atom->type;
- int nlocal = atom->nlocal;
-
- double count[2],all[2];
- count[0] = count[1] = 0.0;
- for (int k = 0; k < nlocal; k++) {
- if (type[k] == i) count[0] += 1.0;
- if (type[k] == j) count[1] += 1.0;
- }
- MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
-
- double rho1 = rho[i][j];
- double rho2 = rho1*rho1;
- double rho3 = rho2*rho1;
- double rc = cut_lj[i][j];
- double rc2 = rc*rc;
- double rc3 = rc2*rc;
- double rc5 = rc3*rc2;
- etail_ij = 2.0*MY_PI*all[0]*all[1] *
- (a[i][j]*exp((sigma[i][j]-rc)/rho1)*rho1*
- (rc2 + 2.0*rho1*rc + 2.0*rho2) -
- c[i][j]/(3.0*rc3) + d[i][j]/(5.0*rc5));
- ptail_ij = (-1/3.0)*2.0*MY_PI*all[0]*all[1] *
- (-a[i][j]*exp((sigma[i][j]-rc)/rho1) *
- (rc3 + 3.0*rho1*rc2 + 6.0*rho2*rc + 6.0*rho3) +
- 2.0*c[i][j]/rc3 - 8.0*d[i][j]/(5.0*rc5));
- }
-
return cut;
}
-/* ----------------------------------------------------------------------
- init specific to this pair style
-------------------------------------------------------------------------- */
-
-void PairBornCoulLong::init_style()
-{
- if (!atom->q_flag)
- error->all(FLERR,"Pair style born/coul/long requires atom attribute q");
-
- cut_coulsq = cut_coul * cut_coul;
-
- // insure use of KSpace long-range solver, set g_ewald
-
- if (force->kspace == NULL)
- error->all(FLERR,"Pair style is incompatible with KSpace style");
- g_ewald = force->kspace->g_ewald;
-
- neighbor->request(this);
-}
-
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
-void PairBornCoulLong::write_restart(FILE *fp)
+void PairBornCoulWolf::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&a[i][j],sizeof(double),1,fp);
fwrite(&rho[i][j],sizeof(double),1,fp);
fwrite(&sigma[i][j],sizeof(double),1,fp);
fwrite(&c[i][j],sizeof(double),1,fp);
fwrite(&d[i][j],sizeof(double),1,fp);
fwrite(&cut_lj[i][j],sizeof(double),1,fp);
}
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
-void PairBornCoulLong::read_restart(FILE *fp)
+void PairBornCoulWolf::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
fread(&a[i][j],sizeof(double),1,fp);
fread(&rho[i][j],sizeof(double),1,fp);
fread(&sigma[i][j],sizeof(double),1,fp);
fread(&c[i][j],sizeof(double),1,fp);
fread(&d[i][j],sizeof(double),1,fp);
fread(&cut_lj[i][j],sizeof(double),1,fp);
}
MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&d[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
-void PairBornCoulLong::write_restart_settings(FILE *fp)
+void PairBornCoulWolf::write_restart_settings(FILE *fp)
{
+ fwrite(&alf,sizeof(double),1,fp);
fwrite(&cut_lj_global,sizeof(double),1,fp);
fwrite(&cut_coul,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
-void PairBornCoulLong::read_restart_settings(FILE *fp)
+void PairBornCoulWolf::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
+ fread(&alf,sizeof(double),1,fp);
fread(&cut_lj_global,sizeof(double),1,fp);
fread(&cut_coul,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
+ MPI_Bcast(&alf,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
-/* ---------------------------------------------------------------------- */
+/* ----------------------------------------------------------------------
+ only the pair part is calculated here
+------------------------------------------------------------------------- */
-double PairBornCoulLong::single(int i, int j, int itype, int jtype,
+double PairBornCoulWolf::single(int i, int j, int itype, int jtype,
double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
- double r2inv,r6inv,r,rexp,grij,expm2,t,erfc,prefactor;
+ double r2inv,r6inv,r,prefactor,rexp;
double forcecoul,forceborn,phicoul,phiborn;
+ double e_shift,f_shift,dvdrr,erfcc,erfcd;
r2inv = 1.0/rsq;
+ e_shift = erfc(alf*cut_coul) / cut_coul;
+ f_shift = -(e_shift+2*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) /
+ cut_coul;
+
if (rsq < cut_coulsq) {
r = sqrt(rsq);
- grij = g_ewald * r;
- expm2 = exp(-grij*grij);
- t = 1.0 / (1.0 + EWALD_P*grij);
- erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = force->qqrd2e * atom->q[i]*atom->q[j]/r;
- forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+ erfcc = erfc(alf*r);
+ erfcd = exp(-alf*alf*r*r);
+ dvdrr = (erfcc/rsq + 2.0*alf/MY_PIS * erfcd/r) + f_shift;
+ forcecoul = dvdrr*rsq*prefactor;
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
} else forcecoul = 0.0;
+
if (rsq < cut_ljsq[itype][jtype]) {
r6inv = r2inv*r2inv*r2inv;
r = sqrt(rsq);
- rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
- forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv +
- born3[itype][jtype]*r2inv*r6inv;
+ rexp = exp(-r*rhoinv[itype][jtype]);
+ forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
+ + born3[itype][jtype]*r2inv*r6inv;
} else forceborn = 0.0;
+
fforce = (forcecoul + factor_lj*forceborn) * r2inv;
double eng = 0.0;
if (rsq < cut_coulsq) {
- phicoul = prefactor*erfc;
+ phicoul = prefactor * (erfcc-e_shift*r);
if (factor_coul < 1.0) phicoul -= (1.0-factor_coul)*prefactor;
eng += phicoul;
}
if (rsq < cut_ljsq[itype][jtype]) {
- phiborn = a[itype][jtype]*rexp - c[itype][jtype]*r6inv +
- d[itype][jtype]*r2inv*r6inv - offset[itype][jtype];
+ phiborn = a[itype][jtype]*rexp - c[itype][jtype]*r6inv
+ + d[itype][jtype]*r2inv*r6inv - offset[itype][jtype];
eng += factor_lj*phiborn;
}
return eng;
}
-
-/* ---------------------------------------------------------------------- */
-
-void *PairBornCoulLong::extract(char *str, int &dim)
-{
- dim = 0;
- if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
- return NULL;
-}
diff --git a/src/KSPACE/pair_born_coul_long.h b/src/pair_born_coul_wolf.h
similarity index 59%
copy from src/KSPACE/pair_born_coul_long.h
copy to src/pair_born_coul_wolf.h
index 3a8c910db..56493c8d2 100644
--- a/src/KSPACE/pair_born_coul_long.h
+++ b/src/pair_born_coul_wolf.h
@@ -1,57 +1,79 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
-PairStyle(born/coul/long,PairBornCoulLong)
+PairStyle(born/coul/wolf,PairBornCoulWolf)
#else
-#ifndef LMP_PAIR_BORN_COUL_LONG_H
-#define LMP_PAIR_BORN_COUL_LONG_H
+#ifndef LMP_PAIR_BORN_COUL_WOLF_H
+#define LMP_PAIR_BORN_COUL_WOLF_H
#include "pair.h"
namespace LAMMPS_NS {
-class PairBornCoulLong : public Pair {
+class PairBornCoulWolf : public Pair {
public:
- PairBornCoulLong(class LAMMPS *);
- virtual ~PairBornCoulLong();
- virtual void compute(int, int);
+ PairBornCoulWolf(class LAMMPS *);
+ ~PairBornCoulWolf();
+ void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
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 &);
- void *extract(char *, int &);
-
- protected:
+
+ private:
double cut_lj_global;
double **cut_lj,**cut_ljsq;
double cut_coul,cut_coulsq;
double **a,**rho,**sigma,**c,**d;
double **rhoinv,**born1,**born2,**born3,**offset;
- double g_ewald;
+ double alf,e_shift,f_shift;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style born/coul/Wolf requires atom attribute q
+
+UNDOCUMENTED
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+*/
diff --git a/src/pair_buck.cpp b/src/pair_buck.cpp
index 1a3464e27..abd3d2dad 100644
--- a/src/pair_buck.cpp
+++ b/src/pair_buck.cpp
@@ -1,378 +1,378 @@
/* ----------------------------------------------------------------------
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 "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_buck.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neigh_list.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
/* ---------------------------------------------------------------------- */
PairBuck::PairBuck(LAMMPS *lmp) : Pair(lmp) {}
/* ---------------------------------------------------------------------- */
PairBuck::~PairBuck()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cut);
memory->destroy(a);
memory->destroy(rho);
memory->destroy(c);
memory->destroy(rhoinv);
memory->destroy(buck1);
memory->destroy(buck2);
memory->destroy(offset);
}
}
/* ---------------------------------------------------------------------- */
void PairBuck::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,r2inv,r6inv,forcebuck,factor_lj;
double r,rexp;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = 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;
double *special_lj = force->special_lj;
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];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
r = sqrt(rsq);
rexp = exp(-r*rhoinv[itype][jtype]);
forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
fpair = factor_lj*forcebuck*r2inv;
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) {
evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
offset[itype][jtype];
evdwl *= factor_lj;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairBuck::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut,n+1,n+1,"pair:cut_lj");
memory->create(a,n+1,n+1,"pair:a");
memory->create(rho,n+1,n+1,"pair:rho");
memory->create(c,n+1,n+1,"pair:c");
memory->create(rhoinv,n+1,n+1,"pair:rhoinv");
memory->create(buck1,n+1,n+1,"pair:buck1");
memory->create(buck2,n+1,n+1,"pair:buck2");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairBuck::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut[i][j] = cut_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairBuck::coeff(int narg, char **arg)
{
if (narg < 5 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a_one = force->numeric(arg[2]);
double rho_one = force->numeric(arg[3]);
if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients");
double c_one = force->numeric(arg[4]);
double cut_one = cut_global;
if (narg == 6) cut_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
a[i][j] = a_one;
rho[i][j] = rho_one;
c[i][j] = c_one;
cut[i][j] = cut_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairBuck::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
rhoinv[i][j] = 1.0/rho[i][j];
buck1[i][j] = a[i][j]/rho[i][j];
buck2[i][j] = 6.0*c[i][j];
if (offset_flag) {
double rexp = exp(-cut[i][j]/rho[i][j]);
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut[i][j],6.0);
} else offset[i][j] = 0.0;
a[j][i] = a[i][j];
c[j][i] = c[i][j];
rhoinv[j][i] = rhoinv[i][j];
buck1[j][i] = buck1[i][j];
buck2[j][i] = buck2[i][j];
offset[j][i] = offset[i][j];
// compute I,J contribution to long-range tail correction
// count total # of atoms of type I and J via Allreduce
if (tail_flag) {
int *type = atom->type;
int nlocal = atom->nlocal;
double count[2],all[2];
count[0] = count[1] = 0.0;
for (int k = 0; k < nlocal; k++) {
if (type[k] == i) count[0] += 1.0;
if (type[k] == j) count[1] += 1.0;
}
MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
double rho1 = rho[i][j];
double rho2 = rho1*rho1;
double rho3 = rho2*rho1;
double rc = cut[i][j];
double rc2 = rc*rc;
double rc3 = rc2*rc;
etail_ij = 2.0*MY_PI*all[0]*all[1]*
(a[i][j]*exp(-rc/rho1)*rho1*(rc2 + 2.0*rho1*rc + 2.0*rho2) -
c[i][j]/(3.0*rc3));
ptail_ij = (-1/3.0)*2.0*MY_PI*all[0]*all[1]*
(-a[i][j]*exp(-rc/rho1)*
(rc3 + 3.0*rho1*rc2 + 6.0*rho2*rc + 6.0*rho3) + 2.0*c[i][j]/rc3);
}
return cut[i][j];
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairBuck::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&a[i][j],sizeof(double),1,fp);
fwrite(&rho[i][j],sizeof(double),1,fp);
fwrite(&c[i][j],sizeof(double),1,fp);
fwrite(&cut[i][j],sizeof(double),1,fp);
}
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairBuck::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
fread(&a[i][j],sizeof(double),1,fp);
fread(&rho[i][j],sizeof(double),1,fp);
fread(&c[i][j],sizeof(double),1,fp);
fread(&cut[i][j],sizeof(double),1,fp);
}
MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairBuck::write_restart_settings(FILE *fp)
{
fwrite(&cut_global,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairBuck::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&cut_global,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
double PairBuck::single(int i, int j, int itype, int jtype,
double rsq, double factor_coul, double factor_lj,
double &fforce)
{
double r2inv,r6inv,r,rexp,forcebuck,phibuck;
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
r = sqrt(rsq);
rexp = exp(-r*rhoinv[itype][jtype]);
forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
fforce = factor_lj*forcebuck*r2inv;
phibuck = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
offset[itype][jtype];
return factor_lj*phibuck;
}
/* ---------------------------------------------------------------------- */
-void *PairBuck::extract(char *str, int &dim)
+void *PairBuck::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str,"a") == 0) return (void *) a;
if (strcmp(str,"c") == 0) return (void *) c;
return NULL;
}
diff --git a/src/pair_buck.h b/src/pair_buck.h
index 4e722eb41..fe9034329 100644
--- a/src/pair_buck.h
+++ b/src/pair_buck.h
@@ -1,54 +1,73 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(buck,PairBuck)
#else
#ifndef LMP_PAIR_BUCK_H
#define LMP_PAIR_BUCK_H
#include "pair.h"
namespace LAMMPS_NS {
class PairBuck : public Pair {
public:
PairBuck(class LAMMPS *);
virtual ~PairBuck();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
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 &);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
double cut_global;
double **cut;
double **a,**rho,**c;
double **rhoinv,**buck1,**buck2,**offset;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+*/
diff --git a/src/pair_buck_coul_cut.h b/src/pair_buck_coul_cut.h
index dcf7a5c4e..d4db4f8ca 100644
--- a/src/pair_buck_coul_cut.h
+++ b/src/pair_buck_coul_cut.h
@@ -1,55 +1,78 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(buck/coul/cut,PairBuckCoulCut)
#else
#ifndef LMP_PAIR_BUCK_COUL_CUT_H
#define LMP_PAIR_BUCK_COUL_CUT_H
#include "pair.h"
namespace LAMMPS_NS {
class PairBuckCoulCut : public Pair {
public:
PairBuckCoulCut(class LAMMPS *);
virtual ~PairBuckCoulCut();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
virtual void init_style();
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
virtual void read_restart_settings(FILE *);
virtual double single(int, int, int, int, double, double, double, double &);
protected:
double cut_lj_global,cut_coul_global;
double **cut_lj,**cut_ljsq;
double **cut_coul,**cut_coulsq;
double **a,**rho,**c;
double **rhoinv,**buck1,**buck2,**offset;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style buck/coul/cut requires atom attribute q
+
+The atom style defined does not have this attribute.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+*/
diff --git a/src/pair_coul_cut.cpp b/src/pair_coul_cut.cpp
index fbe2bfdfc..2fb10dabd 100644
--- a/src/pair_coul_cut.cpp
+++ b/src/pair_coul_cut.cpp
@@ -1,308 +1,308 @@
/* ----------------------------------------------------------------------
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 "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_coul_cut.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PairCoulCut::PairCoulCut(LAMMPS *lmp) : Pair(lmp) {}
/* ---------------------------------------------------------------------- */
PairCoulCut::~PairCoulCut()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cut);
memory->destroy(scale);
}
}
/* ---------------------------------------------------------------------- */
void PairCoulCut::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,ecoul,fpair;
double rsq,r2inv,rinv,forcecoul,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;
double *q = atom->q;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_coul = force->special_coul;
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
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];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
r2inv = 1.0/rsq;
rinv = sqrt(r2inv);
forcecoul = qqrd2e * scale[itype][jtype] * qtmp*q[j]*rinv;
fpair = factor_coul*forcecoul * r2inv;
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 = factor_coul * qqrd2e * scale[itype][jtype] * qtmp*q[j]*rinv;
if (evflag) ev_tally(i,j,nlocal,newton_pair,
0.0,ecoul,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairCoulCut::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(scale,n+1,n+1,"pair:scale");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairCoulCut::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut[i][j] = cut_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairCoulCut::coeff(int narg, char **arg)
{
if (narg < 2 || narg > 3) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double cut_one = cut_global;
if (narg == 3) cut_one = force->numeric(arg[2]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
cut[i][j] = cut_one;
scale[i][j] = 1.0;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairCoulCut::init_style()
{
if (!atom->q_flag)
error->all(FLERR,"Pair style coul/cut requires atom attribute q");
neighbor->request(this);
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairCoulCut::init_one(int i, int j)
{
if (setflag[i][j] == 0)
cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
scale[j][i] = scale[i][j];
return cut[i][j];
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairCoulCut::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) fwrite(&cut[i][j],sizeof(double),1,fp);
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairCoulCut::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) fread(&cut[i][j],sizeof(double),1,fp);
MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairCoulCut::write_restart_settings(FILE *fp)
{
fwrite(&cut_global,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairCoulCut::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&cut_global,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
double PairCoulCut::single(int i, int j, int itype, int jtype,
double rsq, double factor_coul, double factor_lj,
double &fforce)
{
double r2inv,rinv,forcecoul,phicoul;
r2inv = 1.0/rsq;
rinv = sqrt(r2inv);
forcecoul = force->qqrd2e * atom->q[i]*atom->q[j]*rinv;
fforce = factor_coul*forcecoul * r2inv;
phicoul = force->qqrd2e * atom->q[i]*atom->q[j]*rinv;
return factor_coul*phicoul;
}
/* ---------------------------------------------------------------------- */
-void *PairCoulCut::extract(char *str, int &dim)
+void *PairCoulCut::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str,"scale") == 0) return (void *) scale;
return NULL;
}
diff --git a/src/pair_coul_cut.h b/src/pair_coul_cut.h
index 1b5680976..6e3e1fdc8 100644
--- a/src/pair_coul_cut.h
+++ b/src/pair_coul_cut.h
@@ -1,53 +1,71 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(coul/cut,PairCoulCut)
#else
#ifndef LMP_PAIR_COUL_CUT_H
#define LMP_PAIR_COUL_CUT_H
#include "pair.h"
namespace LAMMPS_NS {
class PairCoulCut : public Pair {
public:
PairCoulCut(class LAMMPS *);
virtual ~PairCoulCut();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
virtual void read_restart_settings(FILE *);
virtual double single(int, int, int, int, double, double, double, double &);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
double cut_global;
double **cut,**scale;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style coul/cut requires atom attribute q
+
+The atom style defined does not have these attributes.
+
+*/
diff --git a/src/pair_coul_debye.h b/src/pair_coul_debye.h
index b3db25655..33f2785b2 100644
--- a/src/pair_coul_debye.h
+++ b/src/pair_coul_debye.h
@@ -1,43 +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 PAIR_CLASS
PairStyle(coul/debye,PairCoulDebye)
#else
#ifndef LMP_PAIR_COUL_DEBYE_H
#define LMP_PAIR_COUL_DEBYE_H
#include "pair_coul_cut.h"
namespace LAMMPS_NS {
class PairCoulDebye : public PairCoulCut {
public:
PairCoulDebye(class LAMMPS *);
virtual void compute(int, int);
void settings(int, char **);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
double single(int, int, int, int, double, double, double, double &);
protected:
double kappa;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/pair_coul_cut.cpp b/src/pair_coul_wolf.cpp
similarity index 59%
copy from src/pair_coul_cut.cpp
copy to src/pair_coul_wolf.cpp
index fbe2bfdfc..d44a24542 100644
--- a/src/pair_coul_cut.cpp
+++ b/src/pair_coul_wolf.cpp
@@ -1,308 +1,328 @@
/* ----------------------------------------------------------------------
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: Yongfeng Zhang (INL), yongfeng.zhang@inl.gov
+------------------------------------------------------------------------- */
+
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
-#include "pair_coul_cut.h"
+#include "pair_coul_wolf.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
+#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
+using namespace MathConst;
/* ---------------------------------------------------------------------- */
-PairCoulCut::PairCoulCut(LAMMPS *lmp) : Pair(lmp) {}
+PairCoulWolf::PairCoulWolf(LAMMPS *lmp) : Pair(lmp) {}
/* ---------------------------------------------------------------------- */
-PairCoulCut::~PairCoulCut()
+PairCoulWolf::~PairCoulWolf()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
-
- memory->destroy(cut);
- memory->destroy(scale);
}
}
/* ---------------------------------------------------------------------- */
-void PairCoulCut::compute(int eflag, int vflag)
+void PairCoulWolf::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,ecoul,fpair;
- double rsq,r2inv,rinv,forcecoul,factor_coul;
+ double rsq,forcecoul,factor_coul;
+ double prefactor;
+ double r,rexp;
int *ilist,*jlist,*numneigh,**firstneigh;
+ double erfcc,erfcd,v_sh,dvdrr,e_self,qisq;
ecoul = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
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;
double qqrd2e = force->qqrd2e;
+ // self and shifted coulombic energy
+
+ e_self = v_sh = 0.0;
+ e_shift = erfc(alf*cut_coul)/cut_coul;
+ f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) /
+ cut_coul;
+
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];
qtmp = q[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
+ qisq = qtmp*qtmp;
+ e_self = -(e_shift/2.0 + alf/MY_PIS) * qisq*qqrd2e;
+ if (evflag) ev_tally(i,i,nlocal,0,0.0,e_self,0.0,0.0,0.0,0.0);
+
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
- factor_coul = special_coul[sbmask(j)];
- j &= NEIGHMASK;
+
+ 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];
- if (rsq < cutsq[itype][jtype]) {
- r2inv = 1.0/rsq;
- rinv = sqrt(r2inv);
- forcecoul = qqrd2e * scale[itype][jtype] * qtmp*q[j]*rinv;
- fpair = factor_coul*forcecoul * r2inv;
+ if (rsq < cut_coulsq) {
+ r = sqrt(rsq);
+ prefactor = qqrd2e*qtmp*q[j]/r;
+ erfcc = erfc(alf*r);
+ erfcd = exp(-alf*alf*r*r);
+ v_sh = (erfcc - e_shift*r) * prefactor;
+ dvdrr = (erfcc/rsq + 2.0*alf/MY_PIS * erfcd/r) + f_shift;
+ forcecoul = dvdrr*rsq*prefactor;
+ if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+ fpair = forcecoul / rsq;
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 = factor_coul * qqrd2e * scale[itype][jtype] * qtmp*q[j]*rinv;
+ if (eflag) {
+ if (rsq < cut_coulsq) {
+ ecoul = v_sh;
+ if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+ } else ecoul = 0.0;
+ }
if (evflag) ev_tally(i,j,nlocal,newton_pair,
0.0,ecoul,fpair,delx,dely,delz);
}
}
}
-
+
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
-void PairCoulCut::allocate()
+void PairCoulWolf::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
-
- memory->create(cut,n+1,n+1,"pair:cut");
- memory->create(scale,n+1,n+1,"pair:scale");
}
/* ----------------------------------------------------------------------
global settings
+ unlike other pair styles,
+ there are no individual pair settings that these override
------------------------------------------------------------------------- */
-void PairCoulCut::settings(int narg, char **arg)
+void PairCoulWolf::settings(int narg, char **arg)
{
- if (narg != 1) error->all(FLERR,"Illegal pair_style command");
-
- cut_global = force->numeric(arg[0]);
+ if (narg != 2) error->all(FLERR,"Illegal pair_style command");
- // reset cutoffs that have been explicitly set
-
- if (allocated) {
- int i,j;
- for (i = 1; i <= atom->ntypes; i++)
- for (j = i+1; j <= atom->ntypes; j++)
- if (setflag[i][j]) cut[i][j] = cut_global;
- }
+ alf = force->numeric(arg[0]);
+ cut_coul = force->numeric(arg[1]);
}
/* ----------------------------------------------------------------------
- set coeffs for one or more type pairs
+ set cutoffs for one or more type pairs, optional
------------------------------------------------------------------------- */
-void PairCoulCut::coeff(int narg, char **arg)
+void PairCoulWolf::coeff(int narg, char **arg)
{
- if (narg < 2 || narg > 3) error->all(FLERR,"Incorrect args for pair coefficients");
+ if (narg != 2) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
- double cut_one = cut_global;
- if (narg == 3) cut_one = force->numeric(arg[2]);
-
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
- cut[i][j] = cut_one;
- scale[i][j] = 1.0;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
-
/* ----------------------------------------------------------------------
- init specific to this pair style
+ init specific to this pair style
------------------------------------------------------------------------- */
-void PairCoulCut::init_style()
+void PairCoulWolf::init_style()
{
if (!atom->q_flag)
- error->all(FLERR,"Pair style coul/cut requires atom attribute q");
+ error->all(FLERR,"Pair coul/wolf requires atom attribute q");
- neighbor->request(this);
+ int irequest = neighbor->request(this);
+
+ cut_coulsq = cut_coul*cut_coul;
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
-double PairCoulCut::init_one(int i, int j)
+double PairCoulWolf::init_one(int i, int j)
{
- if (setflag[i][j] == 0)
- cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
-
- scale[j][i] = scale[i][j];
-
- return cut[i][j];
+ return cut_coul;
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
-void PairCoulCut::write_restart(FILE *fp)
+void PairCoulWolf::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
- for (j = i; j <= atom->ntypes; j++) {
+ for (j = i; j <= atom->ntypes; j++)
fwrite(&setflag[i][j],sizeof(int),1,fp);
- if (setflag[i][j]) fwrite(&cut[i][j],sizeof(double),1,fp);
- }
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
-void PairCoulCut::read_restart(FILE *fp)
+void PairCoulWolf::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
- if (setflag[i][j]) {
- if (me == 0) fread(&cut[i][j],sizeof(double),1,fp);
- MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
- }
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
-void PairCoulCut::write_restart_settings(FILE *fp)
+void PairCoulWolf::write_restart_settings(FILE *fp)
{
- fwrite(&cut_global,sizeof(double),1,fp);
+ fwrite(&alf,sizeof(double),1,fp);
+ fwrite(&cut_coul,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
- proc 0 reads from restart file, bcasts
+ proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
-void PairCoulCut::read_restart_settings(FILE *fp)
+void PairCoulWolf::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
- fread(&cut_global,sizeof(double),1,fp);
+ fread(&alf,sizeof(double),1,fp);
+ fread(&cut_coul,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
- MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
+ MPI_Bcast(&alf,1,MPI_DOUBLE,0,world);
+ MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
-/* ---------------------------------------------------------------------- */
-
-double PairCoulCut::single(int i, int j, int itype, int jtype,
- double rsq, double factor_coul, double factor_lj,
- double &fforce)
-{
- double r2inv,rinv,forcecoul,phicoul;
-
- r2inv = 1.0/rsq;
- rinv = sqrt(r2inv);
- forcecoul = force->qqrd2e * atom->q[i]*atom->q[j]*rinv;
- fforce = factor_coul*forcecoul * r2inv;
-
- phicoul = force->qqrd2e * atom->q[i]*atom->q[j]*rinv;
- return factor_coul*phicoul;
-}
-
-/* ---------------------------------------------------------------------- */
+/* ----------------------------------------------------------------------
+ only the pair part is calculated here
+------------------------------------------------------------------------- */
-void *PairCoulCut::extract(char *str, int &dim)
+double PairCoulWolf::single(int i, int j, int itype, int jtype, double rsq,
+ double factor_coul, double factor_lj,
+ double &fforce)
{
- dim = 2;
- if (strcmp(str,"scale") == 0) return (void *) scale;
- return NULL;
+ double r6inv,r,prefactor,rexp;
+ double forcecoul,forceborn,phicoul;
+ double e_shift,f_shift,dvdrr,erfcc,erfcd;
+
+ e_shift = erfc(alf*cut_coul) / cut_coul;
+ f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) /
+ cut_coul;
+
+ if (rsq < cut_coulsq) {
+ r = sqrt(rsq);
+ prefactor = force->qqrd2e * atom->q[i]*atom->q[j]/r;
+ erfcc = erfc(alf*r);
+ erfcd = exp(-alf*alf*r*r);
+ dvdrr = (erfcc/rsq + 2.0*alf/MY_PIS * erfcd/r) + f_shift;
+ forcecoul = dvdrr*rsq*prefactor;
+ if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+ } else forcecoul = 0.0;
+ fforce = forcecoul / rsq;
+
+ double eng = 0.0;
+ if (rsq < cut_coulsq) {
+ phicoul = prefactor * (erfcc-e_shift*r);
+ if (factor_coul < 1.0) phicoul -= (1.0-factor_coul)*prefactor;
+ eng += phicoul;
+ }
+ return eng;
}
diff --git a/src/KSPACE/pair_buck_coul_long.h b/src/pair_coul_wolf.h
similarity index 64%
copy from src/KSPACE/pair_buck_coul_long.h
copy to src/pair_coul_wolf.h
index 44b82d99d..a7ed784b8 100644
--- a/src/KSPACE/pair_buck_coul_long.h
+++ b/src/pair_coul_wolf.h
@@ -1,57 +1,70 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
-PairStyle(buck/coul/long,PairBuckCoulLong)
+PairStyle(coul/wolf,PairCoulWolf)
#else
-#ifndef LMP_PAIR_BUCK_COUL_LONG_H
-#define LMP_PAIR_BUCK_COUL_LONG_H
+#ifndef LMP_PAIR_COUL_WOLF_H
+#define LMP_PAIR_COUL_WOLF_H
#include "pair.h"
namespace LAMMPS_NS {
-class PairBuckCoulLong : public Pair {
+class PairCoulWolf : public Pair {
public:
- PairBuckCoulLong(class LAMMPS *);
- virtual ~PairBuckCoulLong();
+ PairCoulWolf(class LAMMPS *);
+ ~PairCoulWolf();
void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
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 &);
- void *extract(char *, int &);
- protected:
- double cut_lj_global;
- double **cut_lj,**cut_ljsq;
+ private:
double cut_coul,cut_coulsq;
- double **a,**rho,**c;
- double **rhoinv,**buck1,**buck2,**offset;
- double g_ewald;
+ double alf,e_shift,f_shift;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair coul/wolf requires atom attribute q
+
+UNDOCUMENTED
+
+*/
diff --git a/src/pair_dpd.h b/src/pair_dpd.h
index 0784eefb6..b74c0aaf8 100644
--- a/src/pair_dpd.h
+++ b/src/pair_dpd.h
@@ -1,56 +1,83 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(dpd,PairDPD)
#else
#ifndef LMP_PAIR_DPD_H
#define LMP_PAIR_DPD_H
#include "pair.h"
namespace LAMMPS_NS {
class PairDPD : public Pair {
public:
PairDPD(class LAMMPS *);
virtual ~PairDPD();
virtual void compute(int, int);
virtual void settings(int, char **);
virtual void coeff(int, char **);
void init_style();
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
virtual void read_restart_settings(FILE *);
double single(int, int, int, int, double, double, double, double &);
protected:
double cut_global,temperature;
int seed;
double **cut;
double **a0,**gamma;
double **sigma;
class RanMars *random;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair dpd requires ghost atoms store velocity
+
+Use the communicate vel yes command to enable this.
+
+W: Pair dpd needs newton pair on for momentum conservation
+
+UNDOCUMENTED
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+*/
diff --git a/src/pair_dpd_tstat.h b/src/pair_dpd_tstat.h
index 06f3ac0b8..d4383c56b 100644
--- a/src/pair_dpd_tstat.h
+++ b/src/pair_dpd_tstat.h
@@ -1,44 +1,58 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(dpd/tstat,PairDPDTstat)
#else
#ifndef LMP_PAIR_DPD_TSTAT_H
#define LMP_PAIR_DPD_TSTAT_H
#include "pair_dpd.h"
namespace LAMMPS_NS {
class PairDPDTstat : public PairDPD {
public:
PairDPDTstat(class LAMMPS *);
~PairDPDTstat() {}
void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
protected:
double t_start,t_stop;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/pair_gauss.cpp b/src/pair_gauss.cpp
index 4649cdb0e..820d1e8b7 100644
--- a/src/pair_gauss.cpp
+++ b/src/pair_gauss.cpp
@@ -1,335 +1,335 @@
/* ----------------------------------------------------------------------
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: Sai Jayaraman (Sandia)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_gauss.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define EPSILON 1.0e-10
/* ---------------------------------------------------------------------- */
PairGauss::PairGauss(LAMMPS *lmp) :Pair(lmp)
{
nextra = 1;
pvector = new double[1];
}
/* ---------------------------------------------------------------------- */
PairGauss::~PairGauss()
{
delete [] pvector;
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cut);
memory->destroy(a);
memory->destroy(b);
memory->destroy(offset);
}
}
/* ---------------------------------------------------------------------- */
void PairGauss::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double r,rsq,r2inv,forcelj;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
int occ = 0;
double **x = atom->x;
double **f = atom->f;
int *type = atom->type;
int nlocal = atom->nlocal;
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];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
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];
// define a Gaussian well to be occupied if
// the site it interacts with is within the force maximum
if (eflag_global && rsq < 0.5/b[itype][jtype]) occ++;
if (rsq < cutsq[itype][jtype]) {
r2inv = 1.0/rsq;
r = sqrt(rsq);
forcelj = - 2.0*a[itype][jtype]*b[itype][jtype] * rsq *
exp(-b[itype][jtype]*rsq);
fpair = forcelj*r2inv;
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)
evdwl = -(a[itype][jtype]*exp(-b[itype][jtype]*rsq) -
offset[itype][jtype]);
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
}
}
}
if (eflag_global) pvector[0] = occ;
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairGauss::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut,n+1,n+1,"pair:cut_gauss");
memory->create(a,n+1,n+1,"pair:a");
memory->create(b,n+1,n+1,"pair:b");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairGauss::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = atof(arg[0]);
// reset cutoffs that have been explicity set
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut[i][j] = cut_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairGauss::coeff(int narg, char **arg)
{
if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo, ihi, jlo, jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a_one = atof(arg[2]);
double b_one = atof(arg[3]);
double cut_one = cut_global;
if (narg == 5) cut_one = atof(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j<=jhi; j++) {
a[i][j] = a_one;
b[i][j] = b_one;
cut[i][j] = cut_one;
setflag[i][j] = 1;
count++ ;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairGauss::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
if (offset_flag) offset[i][j] = a[i][j]*exp(-b[i][j]*cut[i][j]*cut[i][j]);
else offset[i][j] = 0.0;
a[j][i] = a[i][j];
b[j][i] = b[i][j];
offset[j][i] = offset[i][j];
return cut[i][j];
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairGauss::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&a[i][j],sizeof(double),1,fp);
fwrite(&b[i][j],sizeof(double),1,fp);
fwrite(&cut[i][j],sizeof(double),1,fp);
}
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairGauss::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
fread(&a[i][j],sizeof(double),1,fp);
fread(&b[i][j],sizeof(double),1,fp);
fread(&cut[i][j],sizeof(double),1,fp);
}
MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&b[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairGauss::write_restart_settings(FILE *fp)
{
fwrite(&cut_global,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairGauss::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&cut_global,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
double PairGauss::single(int i, int j, int itype, int jtype, double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double r2inv,forcelj,philj,r;
r = sqrt(rsq);
r2inv = 1.0/rsq;
philj = -(a[itype][jtype]*exp(-b[itype][jtype]*rsq) - offset[itype][jtype]);
forcelj = -2.0*a[itype][jtype]*b[itype][jtype]*rsq*exp(-b[itype][jtype]*rsq);
fforce = forcelj*r2inv;
return philj;
}
/* ---------------------------------------------------------------------- */
-void *PairGauss::extract(char *str, int &dim)
+void *PairGauss::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str,"a") == 0) return (void *) a;
return NULL;
}
diff --git a/src/pair_gauss.h b/src/pair_gauss.h
index 795079273..115a8948b 100644
--- a/src/pair_gauss.h
+++ b/src/pair_gauss.h
@@ -1,54 +1,73 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(gauss,PairGauss)
#else
#ifndef PAIR_GAUSS_H
#define PAIR_GAUSS_H
#include "pair.h"
namespace LAMMPS_NS {
class PairGauss : public Pair {
public:
PairGauss(class LAMMPS *);
virtual ~PairGauss();
virtual void compute(int,int);
void settings(int, char **);
void coeff(int, char **);
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 &);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
double cut_global;
double **cut;
double **a,**b;
double **offset;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+*/
diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp
index 71a136600..20f72100f 100644
--- a/src/pair_hybrid.cpp
+++ b/src/pair_hybrid.cpp
@@ -1,718 +1,718 @@
/* ----------------------------------------------------------------------
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 "math.h"
#include "string.h"
#include "ctype.h"
#include "pair_hybrid.h"
#include "atom.h"
#include "force.h"
#include "pair.h"
#include "neighbor.h"
#include "neigh_request.h"
#include "update.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PairHybrid::PairHybrid(LAMMPS *lmp) : Pair(lmp)
{
nstyles = 0;
}
/* ---------------------------------------------------------------------- */
PairHybrid::~PairHybrid()
{
if (nstyles) {
for (int m = 0; m < nstyles; m++) delete styles[m];
delete [] styles;
for (int m = 0; m < nstyles; m++) delete [] keywords[m];
delete [] keywords;
}
delete [] svector;
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cutghost);
memory->destroy(nmap);
memory->destroy(map);
}
}
/* ----------------------------------------------------------------------
call each sub-style's compute function
accumulate sub-style global/peratom energy/virial in hybrid
for global vflag = 1:
each sub-style computes own virial[6]
sum sub-style virial[6] to hybrid's virial[6]
for global vflag = 2:
call sub-style with adjusted vflag to prevent it calling
virial_fdotr_compute()
hybrid calls virial_fdotr_compute() on final accumulated f
------------------------------------------------------------------------- */
void PairHybrid::compute(int eflag, int vflag)
{
int i,j,m,n;
// if no_virial_fdotr_compute is set and global component of
// incoming vflag = 2, then
// reset vflag as if global component were 1
// necessary since one or more sub-styles cannot compute virial as F dot r
if (no_virial_fdotr_compute && vflag % 4 == 2) vflag = 1 + vflag/4 * 4;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = eflag_global = vflag_global =
eflag_atom = vflag_atom = 0;
// check if global component of incoming vflag = 2
// if so, reset vflag passed to substyle as if it were 0
// necessary so substyle will not invoke virial_fdotr_compute()
int vflag_substyle;
if (vflag % 4 == 2) vflag_substyle = vflag/4 * 4;
else vflag_substyle = vflag;
for (m = 0; m < nstyles; m++) {
styles[m]->compute(eflag,vflag_substyle);
if (eflag_global) {
eng_vdwl += styles[m]->eng_vdwl;
eng_coul += styles[m]->eng_coul;
}
if (vflag_global) {
for (n = 0; n < 6; n++) virial[n] += styles[m]->virial[n];
}
if (eflag_atom) {
n = atom->nlocal;
if (force->newton_pair) n += atom->nghost;
double *eatom_substyle = styles[m]->eatom;
for (i = 0; i < n; i++) eatom[i] += eatom_substyle[i];
}
if (vflag_atom) {
n = atom->nlocal;
if (force->newton_pair) n += atom->nghost;
double **vatom_substyle = styles[m]->vatom;
for (i = 0; i < n; i++)
for (j = 0; j < 6; j++)
vatom[i][j] += vatom_substyle[i][j];
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ---------------------------------------------------------------------- */
void PairHybrid::compute_inner()
{
for (int m = 0; m < nstyles; m++)
if (styles[m]->respa_enable) styles[m]->compute_inner();
}
/* ---------------------------------------------------------------------- */
void PairHybrid::compute_middle()
{
for (int m = 0; m < nstyles; m++)
if (styles[m]->respa_enable) styles[m]->compute_middle();
}
/* ---------------------------------------------------------------------- */
void PairHybrid::compute_outer(int eflag, int vflag)
{
for (int m = 0; m < nstyles; m++)
if (styles[m]->respa_enable) styles[m]->compute_outer(eflag,vflag);
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairHybrid::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cutghost,n+1,n+1,"pair:cutghost");
memory->create(nmap,n+1,n+1,"pair:nmap");
memory->create(map,n+1,n+1,nstyles,"pair:map");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
nmap[i][j] = 0;
}
/* ----------------------------------------------------------------------
create one pair style for each arg in list
------------------------------------------------------------------------- */
void PairHybrid::settings(int narg, char **arg)
{
int i,m,istyle;
if (narg < 1) error->all(FLERR,"Illegal pair_style command");
// delete old lists, since cannot just change settings
if (nstyles) {
for (m = 0; m < nstyles; m++) delete styles[m];
delete [] styles;
for (m = 0; m < nstyles; m++) delete [] keywords[m];
delete [] keywords;
}
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cutghost);
memory->destroy(nmap);
memory->destroy(map);
}
allocated = 0;
// count sub-styles by skipping numeric args
// exception is 1st arg of table style, which is non-numeric word
// exception is 1st two args of lj/coul style, which are non-numeric
// exception is 1st two args of buck/coul, which are non-numeric
// exception is 1st arg of reax/c style, which is non-numeric
// execption is 1st 6 args of gran styles, which can have NULLs
// need a better way to skip these exceptions
nstyles = 0;
i = 0;
while (i < narg) {
if (strcmp(arg[i],"table") == 0) i++;
if (strcmp(arg[i],"lj/coul") == 0) i += 2;
if (strcmp(arg[i],"buck/coul") == 0) i += 2;
if (strcmp(arg[i],"reax/c") == 0) i++;
if (strstr(arg[i],"gran/hooke")) i += 6;
if (strstr(arg[i],"gran/hertz")) i += 6;
i++;
while (i < narg && !isalpha(arg[i][0])) i++;
nstyles++;
}
// allocate list of sub-styles
styles = new Pair*[nstyles];
keywords = new char*[nstyles];
// allocate each sub-style and call its settings() with subset of args
// define subset of args for a sub-style by skipping numeric args
// exception is 1st arg of table style, which is non-numeric word
// exception is 1st two args of lj/coul style, which are non-numeric
// exception is 1st two args of buck/coul, which are non-numeric
// exception is 1st arg of reax/c style, which is non-numeric
// execption is 1st 6 args of gran styles, which can have NULLs
// need a better way to skip these exceptions
int dummy;
nstyles = 0;
i = 0;
while (i < narg) {
for (m = 0; m < nstyles; m++)
if (strcmp(arg[i],keywords[m]) == 0)
error->all(FLERR,"Pair style hybrid cannot use same pair style twice");
if (strcmp(arg[i],"hybrid") == 0)
error->all(FLERR,"Pair style hybrid cannot have hybrid as an argument");
if (strcmp(arg[i],"none") == 0)
error->all(FLERR,"Pair style hybrid cannot have none as an argument");
styles[nstyles] = force->new_pair(arg[i],lmp->suffix,dummy);
keywords[nstyles] = new char[strlen(arg[i])+1];
strcpy(keywords[nstyles],arg[i]);
istyle = i;
if (strcmp(arg[i],"table") == 0) i++;
if (strcmp(arg[i],"lj/coul") == 0) i += 2;
if (strcmp(arg[i],"buck/coul") == 0) i += 2;
if (strcmp(arg[i],"reax/c") == 0) i++;
if (strstr(arg[i],"gran/hooke")) i += 6;
if (strstr(arg[i],"gran/hertz")) i += 6;
i++;
while (i < narg && !isalpha(arg[i][0])) i++;
styles[nstyles]->settings(i-istyle-1,&arg[istyle+1]);
nstyles++;
}
// set comm_forward, comm_reverse to max of any sub-style
for (m = 0; m < nstyles; m++) {
if (styles[m]) comm_forward = MAX(comm_forward,styles[m]->comm_forward);
if (styles[m]) comm_reverse = MAX(comm_reverse,styles[m]->comm_reverse);
}
// single_enable = 1 if any sub-style is set
// respa_enable = 1 if any sub-style is set
// no_virial_fdotr_compute = 1 if any sub-style is set
// ghostneigh = 1 if any sub-style is set
single_enable = 0;
for (m = 0; m < nstyles; m++)
if (styles[m]->single_enable) single_enable = 1;
for (m = 0; m < nstyles; m++)
if (styles[m]->respa_enable) respa_enable = 1;
for (m = 0; m < nstyles; m++)
if (styles[m]->no_virial_fdotr_compute) no_virial_fdotr_compute = 1;
for (m = 0; m < nstyles; m++)
if (styles[m]->ghostneigh) ghostneigh = 1;
// single_extra = min of all sub-style single_extra
// allocate svector
single_extra = styles[0]->single_extra;
for (m = 1; m < nstyles; m++)
single_extra = MIN(single_extra,styles[m]->single_extra);
if (single_extra) {
delete [] svector;
svector = new double[single_extra];
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairHybrid::coeff(int narg, char **arg)
{
if (narg < 3) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
// 3rd arg = pair sub-style name
// allow for "none" as valid sub-style name
int m;
for (m = 0; m < nstyles; m++)
if (strcmp(arg[2],keywords[m]) == 0) break;
int none = 0;
if (m == nstyles) {
if (strcmp(arg[2],"none") == 0) none = 1;
else error->all(FLERR,"Pair coeff for hybrid has invalid style");
}
// move 1st/2nd args to 2nd/3rd args
// just copy ptrs, since arg[] points into original input line
arg[2] = arg[1];
arg[1] = arg[0];
// invoke sub-style coeff() starting with 1st arg
if (!none) styles[m]->coeff(narg-1,&arg[1]);
// if sub-style only allows one pair coeff call (with * * and type mapping)
// then unset setflag/map assigned to that style before setting it below
// in case pair coeff for this sub-style is being called for 2nd time
if (!none && styles[m]->one_coeff)
for (int i = 1; i <= atom->ntypes; i++)
for (int j = i; j <= atom->ntypes; j++)
if (nmap[i][j] && map[i][j][0] == m) {
setflag[i][j] = 0;
nmap[i][j] = 0;
}
// set setflag and which type pairs map to which sub-style
// if sub-style is none: set hybrid setflag, wipe out map
// else: set hybrid setflag & map only if substyle setflag is set
// previous mappings are wiped out
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
if (none) {
setflag[i][j] = 1;
nmap[i][j] = 0;
count++;
} else if (styles[m]->setflag[i][j]) {
setflag[i][j] = 1;
nmap[i][j] = 1;
map[i][j][0] = m;
count++;
}
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairHybrid::init_style()
{
int i,m,itype,jtype,used,istyle,skip;
// error if a sub-style is not used
int ntypes = atom->ntypes;
for (istyle = 0; istyle < nstyles; istyle++) {
used = 0;
for (itype = 1; itype <= ntypes; itype++)
for (jtype = itype; jtype <= ntypes; jtype++)
for (m = 0; m < nmap[itype][jtype]; m++)
if (map[itype][jtype][m] == istyle) used = 1;
if (used == 0) error->all(FLERR,"Pair hybrid sub-style is not used");
}
// each sub-style makes its neighbor list request(s)
for (istyle = 0; istyle < nstyles; istyle++) styles[istyle]->init_style();
// create skip lists for each pair neigh request
// any kind of list can have its skip flag set at this stage
for (i = 0; i < neighbor->nrequest; i++) {
if (!neighbor->requests[i]->pair) continue;
// istyle = associated sub-style
for (istyle = 0; istyle < nstyles; istyle++)
if (styles[istyle] == neighbor->requests[i]->requestor) break;
// allocate iskip and ijskip
// initialize so as to skip all pair types
// set ijskip = 0 if type pair matches any entry in sub-style map
// set ijskip = 0 if mixing will assign type pair to this sub-style
// will occur if type pair is currently unassigned
// and both I,I and J,J are assigned to single sub-style
// and sub-style for both I,I and J,J match istyle
// set iskip = 1 only if all ijskip for itype are 1
int *iskip = new int[ntypes+1];
int **ijskip;
memory->create(ijskip,ntypes+1,ntypes+1,"pair_hybrid:ijskip");
for (itype = 1; itype <= ntypes; itype++)
for (jtype = 1; jtype <= ntypes; jtype++)
ijskip[itype][jtype] = 1;
for (itype = 1; itype <= ntypes; itype++)
for (jtype = itype; jtype <= ntypes; jtype++) {
for (m = 0; m < nmap[itype][jtype]; m++)
if (map[itype][jtype][m] == istyle)
ijskip[itype][jtype] = ijskip[jtype][itype] = 0;
if (nmap[itype][jtype] == 0 &&
nmap[itype][itype] == 1 && map[itype][itype][0] == istyle &&
nmap[jtype][jtype] == 1 && map[jtype][jtype][0] == istyle)
ijskip[itype][jtype] = ijskip[jtype][itype] = 0;
}
for (itype = 1; itype <= ntypes; itype++) {
iskip[itype] = 1;
for (jtype = 1; jtype <= ntypes; jtype++)
if (ijskip[itype][jtype] == 0) iskip[itype] = 0;
}
// if any skipping occurs
// set request->skip and copy iskip and ijskip into request
// else delete iskip and ijskip
skip = 0;
for (itype = 1; itype <= ntypes; itype++)
for (jtype = 1; jtype <= ntypes; jtype++)
if (ijskip[itype][jtype] == 1) skip = 1;
if (skip) {
neighbor->requests[i]->skip = 1;
neighbor->requests[i]->iskip = iskip;
neighbor->requests[i]->ijskip = ijskip;
} else {
delete [] iskip;
memory->destroy(ijskip);
}
}
// combine sub-style neigh list requests and create new ones if needed
modify_requests();
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairHybrid::init_one(int i, int j)
{
// if I,J is not set explicitly:
// perform mixing only if I,I sub-style = J,J sub-style
// also require I,I and J,J are both assigned to single sub-style
if (setflag[i][j] == 0) {
if (nmap[i][i] != 1 || nmap[j][j] != 1 || map[i][i][0] != map[j][j][0])
error->one(FLERR,"All pair coeffs are not set");
nmap[i][j] = 1;
map[i][j][0] = map[i][i][0];
}
// call init/mixing for all sub-styles of I,J
// set cutsq in sub-style just as Pair::init() does via call to init_one()
// set cutghost for I,J and J,I just as sub-style does
// sum tail corrections for I,J
// return max cutoff of all sub-styles assigned to I,J
// if no sub-styles assigned to I,J (pair_coeff none), cutmax = 0.0 returned
double cutmax = 0.0;
cutghost[i][j] = cutghost[j][i] = 0.0;
if (tail_flag) etail_ij = ptail_ij = 0.0;
nmap[j][i] = nmap[i][j];
for (int k = 0; k < nmap[i][j]; k++) {
map[j][i][k] = map[i][j][k];
double cut = styles[map[i][j][k]]->init_one(i,j);
styles[map[i][j][k]]->cutsq[i][j] =
styles[map[i][j][k]]->cutsq[j][i] = cut*cut;
if (styles[map[i][j][k]]->ghostneigh)
cutghost[i][j] = cutghost[j][i] =
MAX(cutghost[i][j],styles[map[i][j][k]]->cutghost[i][j]);
if (tail_flag) {
etail_ij += styles[map[i][j][k]]->etail_ij;
ptail_ij += styles[map[i][j][k]]->ptail_ij;
}
cutmax = MAX(cutmax,cut);
}
return cutmax;
}
/* ----------------------------------------------------------------------
combine sub-style neigh list requests and create new ones if needed
------------------------------------------------------------------------- */
void PairHybrid::modify_requests()
{
int i,j;
NeighRequest *irq,*jrq;
// loop over pair requests only
// if list is skip list and not copy, look for non-skip list of same kind
// if one exists, point at that one via otherlist
// else make new non-skip request of same kind and point at that one
// don't bother to set ID for new request, since pair hybrid ignores list
// only exception is half_from_full:
// ignore it, turn off skip, since it will derive from its skip parent
// after possible new request creation, unset skip flag and otherlist
// for these derived lists: granhistory, rRESPA inner/middle
// this prevents neighbor from treating them as skip lists
// copy list check is for pair style = hybrid/overlay
// which invokes this routine
for (i = 0; i < neighbor->nrequest; i++) {
if (!neighbor->requests[i]->pair) continue;
irq = neighbor->requests[i];
if (irq->skip == 0 || irq->copy) continue;
if (irq->half_from_full) {
irq->skip = 0;
continue;
}
for (j = 0; j < neighbor->nrequest; j++) {
if (!neighbor->requests[j]->pair) continue;
jrq = neighbor->requests[j];
if (irq->same_kind(jrq) && jrq->skip == 0) break;
}
if (j < neighbor->nrequest) irq->otherlist = j;
else {
int newrequest = neighbor->request(this);
neighbor->requests[newrequest]->copy_request(irq);
irq->otherlist = newrequest;
}
if (irq->granhistory || irq->respainner || irq->respamiddle) {
irq->skip = 0;
irq->otherlist = -1;
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairHybrid::write_restart(FILE *fp)
{
fwrite(&nstyles,sizeof(int),1,fp);
// each sub-style writes its settings, but no coeff info
int n;
for (int m = 0; m < nstyles; m++) {
n = strlen(keywords[m]) + 1;
fwrite(&n,sizeof(int),1,fp);
fwrite(keywords[m],sizeof(char),n,fp);
styles[m]->write_restart_settings(fp);
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairHybrid::read_restart(FILE *fp)
{
int me = comm->me;
if (me == 0) fread(&nstyles,sizeof(int),1,fp);
MPI_Bcast(&nstyles,1,MPI_INT,0,world);
styles = new Pair*[nstyles];
keywords = new char*[nstyles];
// each sub-style is created via new_pair()
// each reads its settings, but no coeff info
int n,dummy;
for (int m = 0; m < nstyles; m++) {
if (me == 0) fread(&n,sizeof(int),1,fp);
MPI_Bcast(&n,1,MPI_INT,0,world);
keywords[m] = new char[n];
if (me == 0) fread(keywords[m],sizeof(char),n,fp);
MPI_Bcast(keywords[m],n,MPI_CHAR,0,world);
styles[m] = force->new_pair(keywords[m],lmp->suffix,dummy);
styles[m]->read_restart_settings(fp);
}
}
/* ----------------------------------------------------------------------
call sub-style to compute single interaction
error if sub-style does not support single() call
since overlay could have multiple sub-styles, sum results explicitly
------------------------------------------------------------------------- */
double PairHybrid::single(int i, int j, int itype, int jtype,
double rsq, double factor_coul, double factor_lj,
double &fforce)
{
if (nmap[itype][jtype] == 0)
error->one(FLERR,"Invoked pair single on pair style none");
double fone;
fforce = 0.0;
double esum = 0.0;
for (int m = 0; m < nmap[itype][jtype]; m++) {
if (rsq < styles[map[itype][jtype][m]]->cutsq[itype][jtype]) {
if (styles[map[itype][jtype][m]]->single_enable == 0)
error->one(FLERR,"Pair hybrid sub-style does not support single call");
esum += styles[map[itype][jtype][m]]->
single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fone);
fforce += fone;
// copy substyle extra values into hybrid's svector
if (single_extra && styles[map[itype][jtype][m]]->single_extra)
for (m = 0; m < single_extra; m++)
svector[m] = styles[map[itype][jtype][m]]->svector[m];
}
}
return esum;
}
/* ----------------------------------------------------------------------
modify parameters of the pair style
call modify_params of PairHybrid
also pass command args to each sub-style of hybrid
------------------------------------------------------------------------- */
void PairHybrid::modify_params(int narg, char **arg)
{
Pair::modify_params(narg,arg);
for (int m = 0; m < nstyles; m++) styles[m]->modify_params(narg,arg);
}
/* ----------------------------------------------------------------------
memory usage of each sub-style
------------------------------------------------------------------------- */
double PairHybrid::memory_usage()
{
double bytes = maxeatom * sizeof(double);
bytes += maxvatom*6 * sizeof(double);
for (int m = 0; m < nstyles; m++) bytes += styles[m]->memory_usage();
return bytes;
}
/* ----------------------------------------------------------------------
extract a ptr to a particular quantity stored by pair
pass request thru to sub-styles
return first non-NULL result except for cut_coul request
for cut_coul, insure all non-NULL results are equal since required by Kspace
------------------------------------------------------------------------- */
-void *PairHybrid::extract(char *str, int &dim)
+void *PairHybrid::extract(const char *str, int &dim)
{
void *cutptr = NULL;
void *ptr;
double cutvalue;
for (int m = 0; m < nstyles; m++) {
ptr = styles[m]->extract(str,dim);
if (ptr && strcmp(str,"cut_coul") == 0) {
double *p_newvalue = (double *) ptr;
double newvalue = *p_newvalue;
if (cutptr && newvalue != cutvalue)
error->all(FLERR,
"Coulomb cutoffs of pair hybrid sub-styles do not match");
cutptr = ptr;
cutvalue = newvalue;
} else if (ptr) return ptr;
}
if (strcmp(str,"cut_coul") == 0) return cutptr;
return NULL;
}
/* ---------------------------------------------------------------------- */
void PairHybrid::reset_dt()
{
for (int m = 0; m < nstyles; m++) styles[m]->reset_dt();
}
/* ----------------------------------------------------------------------
check if itype,jtype maps to sub-style
------------------------------------------------------------------------- */
int PairHybrid::check_ijtype(int itype, int jtype, char *substyle)
{
for (int m = 0; m < nmap[itype][jtype]; m++)
if (strcmp(keywords[map[itype][jtype][m]],substyle) == 0) return 1;
return 0;
}
diff --git a/src/pair_hybrid.h b/src/pair_hybrid.h
index 0f090a031..6b4bf8051 100644
--- a/src/pair_hybrid.h
+++ b/src/pair_hybrid.h
@@ -1,66 +1,123 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(hybrid,PairHybrid)
#else
#ifndef LMP_PAIR_HYBRID_H
#define LMP_PAIR_HYBRID_H
#include "stdio.h"
#include "pair.h"
namespace LAMMPS_NS {
class PairHybrid : public Pair {
public:
int nstyles; // # of different sub-styles
Pair **styles; // list of Pair style classes
char **keywords; // style name of each Pair style
PairHybrid(class LAMMPS *);
virtual ~PairHybrid();
void compute(int, int);
void settings(int, char **);
virtual void coeff(int, char **);
void init_style();
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, int, int, int, double, double, double, double &);
void modify_params(int narg, char **arg);
double memory_usage();
void compute_inner();
void compute_middle();
void compute_outer(int, int);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
void reset_dt();
int check_ijtype(int, int, char *);
protected:
int **nmap; // # of sub-styles itype,jtype points to
int ***map; // list of sub-styles itype,jtype points to
void allocate();
virtual void modify_requests();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Pair style hybrid cannot use same pair style twice
+
+The sub-style arguments of pair_style hybrid cannot be duplicated.
+Check the input script.
+
+E: Pair style hybrid cannot have hybrid as an argument
+
+Self-explanatory.
+
+E: Pair style hybrid cannot have none as an argument
+
+Self-explanatory.
+
+E: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair coeff for hybrid has invalid style
+
+Style in pair coeff must have been listed in pair_style command.
+
+E: Pair hybrid sub-style is not used
+
+No pair_coeff command used a sub-style specified in the pair_style
+command.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+E: Invoked pair single on pair style none
+
+A command (e.g. a dump) attempted to invoke the single() function on a
+pair style none, which is illegal. You are probably attempting to
+compute per-atom quantities with an undefined pair style.
+
+E: Pair hybrid sub-style does not support single call
+
+You are attempting to invoke a single() call on a pair style
+that doesn't support it.
+
+E: Coulomb cutoffs of pair hybrid sub-styles do not match
+
+If using a Kspace solver, all Coulomb cutoffs of long pair styles must
+be the same.
+
+*/
diff --git a/src/pair_hybrid_overlay.h b/src/pair_hybrid_overlay.h
index dea84bae4..a3da3254b 100644
--- a/src/pair_hybrid_overlay.h
+++ b/src/pair_hybrid_overlay.h
@@ -1,40 +1,52 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(hybrid/overlay,PairHybridOverlay)
#else
#ifndef LMP_PAIR_HYBRID_OVERLAY_H
#define LMP_PAIR_HYBRID_OVERLAY_H
#include "pair_hybrid.h"
namespace LAMMPS_NS {
class PairHybridOverlay : public PairHybrid {
public:
PairHybridOverlay(class LAMMPS *);
~PairHybridOverlay() {}
void coeff(int, char **);
private:
void modify_requests();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair coeff for hybrid has invalid style
+
+Style in pair coeff must have been listed in pair_style command.
+
+*/
diff --git a/src/pair_lj96_cut.h b/src/pair_lj96_cut.h
index 1e9b94ae0..4d2f61947 100644
--- a/src/pair_lj96_cut.h
+++ b/src/pair_lj96_cut.h
@@ -1,61 +1,80 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj96/cut,PairLJ96Cut)
#else
#ifndef LMP_PAIR_LJ96_CUT_H
#define LMP_PAIR_LJ96_CUT_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJ96Cut : public Pair {
public:
PairLJ96Cut(class LAMMPS *);
virtual ~PairLJ96Cut();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
void init_list(int, class NeighList *);
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 &);
void compute_inner();
void compute_middle();
void compute_outer(int, int);
protected:
double cut_global;
double **cut;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
double *cut_respa;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair cutoff < Respa interior cutoff
+
+One or more pairwise cutoffs are too short to use with the specified
+rRESPA cutoffs.
+
+*/
diff --git a/src/pair_lj_cubic.h b/src/pair_lj_cubic.h
index 9acf98a2c..0b90f25ff 100644
--- a/src/pair_lj_cubic.h
+++ b/src/pair_lj_cubic.h
@@ -1,66 +1,80 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/cubic,PairLJCubic)
#else
#ifndef LMP_PAIR_LJ_CUBIC_H
#define LMP_PAIR_LJ_CUBIC_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJCubic : public Pair {
public:
PairLJCubic(class LAMMPS *);
virtual ~PairLJCubic();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
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 &);
protected:
double **cut,**cut_inner,**cut_inner_sq;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4;
void allocate();
};
namespace PairLJCubicConstants {
// LJ quantities scaled by epsilon and rmin = sigma*2^1/6
static const double RT6TWO = 1.1224621; // 2^1/6
static const double SS = 1.1086834; // inflection point (13/7)^1/6
static const double PHIS = -0.7869823; // energy at s
static const double DPHIDS = 2.6899009; // gradient at s
static const double A3 = 27.93357; // cubic coefficient
static const double SM = 1.5475375; // cubic cutoff = s*67/48
}
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp
index 44d86990d..69add0d11 100644
--- a/src/pair_lj_cut.cpp
+++ b/src/pair_lj_cut.cpp
@@ -1,703 +1,704 @@
/* ----------------------------------------------------------------------
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: Paul Crozier (SNL)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_lj_cut.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "update.h"
#include "integrate.h"
#include "respa.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
/* ---------------------------------------------------------------------- */
PairLJCut::PairLJCut(LAMMPS *lmp) : Pair(lmp)
{
respa_enable = 1;
}
/* ---------------------------------------------------------------------- */
PairLJCut::~PairLJCut()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cut);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
}
/* ---------------------------------------------------------------------- */
void PairLJCut::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,r2inv,r6inv,forcelj,factor_lj;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = 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;
double *special_lj = force->special_lj;
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];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
fpair = factor_lj*forcelj*r2inv;
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) {
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
offset[itype][jtype];
evdwl *= factor_lj;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ---------------------------------------------------------------------- */
void PairLJCut::compute_inner()
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,fpair;
double rsq,r2inv,r6inv,forcelj,factor_lj,rsw;
int *ilist,*jlist,*numneigh,**firstneigh;
double **x = atom->x;
double **f = atom->f;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
inum = listinner->inum;
ilist = listinner->ilist;
numneigh = listinner->numneigh;
firstneigh = listinner->firstneigh;
double cut_out_on = cut_respa[0];
double cut_out_off = cut_respa[1];
double cut_out_diff = cut_out_off - cut_out_on;
double cut_out_on_sq = cut_out_on*cut_out_on;
double cut_out_off_sq = cut_out_off*cut_out_off;
// 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];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
if (rsq < cut_out_off_sq) {
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
jtype = type[j];
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
fpair = factor_lj*forcelj*r2inv;
if (rsq > cut_out_on_sq) {
rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
fpair *= 1.0 - rsw*rsw*(3.0 - 2.0*rsw);
}
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;
}
}
}
}
}
/* ---------------------------------------------------------------------- */
void PairLJCut::compute_middle()
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,fpair;
double rsq,r2inv,r6inv,forcelj,factor_lj,rsw;
int *ilist,*jlist,*numneigh,**firstneigh;
double **x = atom->x;
double **f = atom->f;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
inum = listmiddle->inum;
ilist = listmiddle->ilist;
numneigh = listmiddle->numneigh;
firstneigh = listmiddle->firstneigh;
double cut_in_off = cut_respa[0];
double cut_in_on = cut_respa[1];
double cut_out_on = cut_respa[2];
double cut_out_off = cut_respa[3];
double cut_in_diff = cut_in_on - cut_in_off;
double cut_out_diff = cut_out_off - cut_out_on;
double cut_in_off_sq = cut_in_off*cut_in_off;
double cut_in_on_sq = cut_in_on*cut_in_on;
double cut_out_on_sq = cut_out_on*cut_out_on;
double cut_out_off_sq = cut_out_off*cut_out_off;
// 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];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
if (rsq < cut_out_off_sq && rsq > cut_in_off_sq) {
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
jtype = type[j];
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
fpair = factor_lj*forcelj*r2inv;
if (rsq < cut_in_on_sq) {
rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
fpair *= rsw*rsw*(3.0 - 2.0*rsw);
}
if (rsq > cut_out_on_sq) {
rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
}
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;
}
}
}
}
}
/* ---------------------------------------------------------------------- */
void PairLJCut::compute_outer(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,r2inv,r6inv,forcelj,factor_lj,rsw;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = 0;
double **x = atom->x;
double **f = atom->f;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_lj = force->special_lj;
int newton_pair = force->newton_pair;
inum = listouter->inum;
ilist = listouter->ilist;
numneigh = listouter->numneigh;
firstneigh = listouter->firstneigh;
double cut_in_off = cut_respa[2];
double cut_in_on = cut_respa[3];
double cut_in_diff = cut_in_on - cut_in_off;
double cut_in_off_sq = cut_in_off*cut_in_off;
double cut_in_on_sq = cut_in_on*cut_in_on;
// 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];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
if (rsq > cut_in_off_sq) {
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
fpair = factor_lj*forcelj*r2inv;
if (rsq < cut_in_on_sq) {
rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
fpair *= rsw*rsw*(3.0 - 2.0*rsw);
}
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) {
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
offset[itype][jtype];
evdwl *= factor_lj;
}
if (vflag) {
if (rsq <= cut_in_off_sq) {
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
fpair = factor_lj*forcelj*r2inv;
} else if (rsq < cut_in_on_sq)
fpair = factor_lj*forcelj*r2inv;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
}
}
}
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairLJCut::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairLJCut::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
-
+
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut[i][j] = cut_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairLJCut::coeff(int narg, char **arg)
{
- if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
+ if (narg < 4 || narg > 5)
+ error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_one = cut_global;
if (narg == 5) cut_one = force->numeric(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
epsilon[i][j] = epsilon_one;
sigma[i][j] = sigma_one;
cut[i][j] = cut_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairLJCut::init_style()
{
// request regular or rRESPA neighbor lists
int irequest;
if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
int respa = 0;
if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
if (respa == 0) irequest = neighbor->request(this);
else if (respa == 1) {
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 1;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respainner = 1;
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 3;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respaouter = 1;
} else {
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 1;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respainner = 1;
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 2;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respamiddle = 1;
irequest = neighbor->request(this);
neighbor->requests[irequest]->id = 3;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->respaouter = 1;
}
} else irequest = neighbor->request(this);
// set rRESPA cutoffs
if (strstr(update->integrate_style,"respa") &&
((Respa *) update->integrate)->level_inner >= 0)
cut_respa = ((Respa *) update->integrate)->cutoff;
else cut_respa = NULL;
}
/* ----------------------------------------------------------------------
neighbor callback to inform pair style of neighbor list to use
regular or rRESPA
------------------------------------------------------------------------- */
void PairLJCut::init_list(int id, NeighList *ptr)
{
if (id == 0) list = ptr;
else if (id == 1) listinner = ptr;
else if (id == 2) listmiddle = ptr;
else if (id == 3) listouter = ptr;
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairLJCut::init_one(int i, int j)
{
if (setflag[i][j] == 0) {
epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
sigma[i][i],sigma[j][j]);
sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
}
lj1[i][j] = 48.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
lj2[i][j] = 24.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
if (offset_flag) {
double ratio = sigma[i][j] / cut[i][j];
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
} else offset[i][j] = 0.0;
lj1[j][i] = lj1[i][j];
lj2[j][i] = lj2[i][j];
lj3[j][i] = lj3[i][j];
lj4[j][i] = lj4[i][j];
offset[j][i] = offset[i][j];
// check interior rRESPA cutoff
if (cut_respa && cut[i][j] < cut_respa[3])
error->all(FLERR,"Pair cutoff < Respa interior cutoff");
// compute I,J contribution to long-range tail correction
// count total # of atoms of type I and J via Allreduce
if (tail_flag) {
int *type = atom->type;
int nlocal = atom->nlocal;
double count[2],all[2];
count[0] = count[1] = 0.0;
for (int k = 0; k < nlocal; k++) {
if (type[k] == i) count[0] += 1.0;
if (type[k] == j) count[1] += 1.0;
}
MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
double sig2 = sigma[i][j]*sigma[i][j];
double sig6 = sig2*sig2*sig2;
double rc3 = cut[i][j]*cut[i][j]*cut[i][j];
double rc6 = rc3*rc3;
double rc9 = rc3*rc6;
etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
sig6 * (sig6 - 3.0*rc6) / (9.0*rc9);
ptail_ij = 16.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
sig6 * (2.0*sig6 - 3.0*rc6) / (9.0*rc9);
}
return cut[i][j];
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairLJCut::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&epsilon[i][j],sizeof(double),1,fp);
fwrite(&sigma[i][j],sizeof(double),1,fp);
fwrite(&cut[i][j],sizeof(double),1,fp);
}
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairLJCut::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
fread(&epsilon[i][j],sizeof(double),1,fp);
fread(&sigma[i][j],sizeof(double),1,fp);
fread(&cut[i][j],sizeof(double),1,fp);
}
MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairLJCut::write_restart_settings(FILE *fp)
{
fwrite(&cut_global,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairLJCut::read_restart_settings(FILE *fp)
{
int me = comm->me;
if (me == 0) {
fread(&cut_global,sizeof(double),1,fp);
fread(&offset_flag,sizeof(int),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
double PairLJCut::single(int i, int j, int itype, int jtype, double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double r2inv,r6inv,forcelj,philj;
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
fforce = factor_lj*forcelj*r2inv;
philj = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
offset[itype][jtype];
return factor_lj*philj;
}
/* ---------------------------------------------------------------------- */
-void *PairLJCut::extract(char *str, int &dim)
+void *PairLJCut::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str,"epsilon") == 0) return (void *) epsilon;
return NULL;
}
diff --git a/src/pair_lj_cut.h b/src/pair_lj_cut.h
index 75c1c367b..8eb4a4867 100644
--- a/src/pair_lj_cut.h
+++ b/src/pair_lj_cut.h
@@ -1,61 +1,80 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/cut,PairLJCut)
#else
#ifndef LMP_PAIR_LJ_CUT_H
#define LMP_PAIR_LJ_CUT_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJCut : public Pair {
public:
PairLJCut(class LAMMPS *);
virtual ~PairLJCut();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
void init_list(int, class NeighList *);
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 &);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
void compute_inner();
void compute_middle();
void compute_outer(int, int);
protected:
double cut_global;
double **cut;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
double *cut_respa;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair cutoff < Respa interior cutoff
+
+One or more pairwise cutoffs are too short to use with the specified
+rRESPA cutoffs.
+
+*/
diff --git a/src/pair_lj_cut_coul_cut.h b/src/pair_lj_cut_coul_cut.h
index 0302f2d21..3746df9f9 100644
--- a/src/pair_lj_cut_coul_cut.h
+++ b/src/pair_lj_cut_coul_cut.h
@@ -1,55 +1,73 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/cut/coul/cut,PairLJCutCoulCut)
#else
#ifndef LMP_PAIR_LJ_CUT_COUL_CUT_H
#define LMP_PAIR_LJ_CUT_COUL_CUT_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJCutCoulCut : public Pair {
public:
PairLJCutCoulCut(class LAMMPS *);
virtual ~PairLJCutCoulCut();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
virtual void read_restart_settings(FILE *);
virtual double single(int, int, int, int, double, double, double, double &);
protected:
double cut_lj_global,cut_coul_global;
double **cut_lj,**cut_ljsq;
double **cut_coul,**cut_coulsq;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style lj/cut/coul/cut requires atom attribute q
+
+The atom style defined does not have this attribute.
+
+*/
diff --git a/src/pair_lj_cut_coul_debye.h b/src/pair_lj_cut_coul_debye.h
index 4d10e89c1..073c1b5b0 100644
--- a/src/pair_lj_cut_coul_debye.h
+++ b/src/pair_lj_cut_coul_debye.h
@@ -1,44 +1,54 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/cut/coul/debye,PairLJCutCoulDebye)
#else
#ifndef LMP_PAIR_LJ_CUT_COUL_DEBYE_H
#define LMP_PAIR_LJ_CUT_COUL_DEBYE_H
#include "pair_lj_cut_coul_cut.h"
namespace LAMMPS_NS {
class PairLJCutCoulDebye : public PairLJCutCoulCut {
public:
PairLJCutCoulDebye(class LAMMPS *);
virtual ~PairLJCutCoulDebye() {}
virtual void compute(int, int);
void settings(int, char **);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
double single(int, int, int, int, double, double, double, double &);
protected:
double kappa;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/pair_lj_expand.h b/src/pair_lj_expand.h
index 568827c3c..a0babd99d 100644
--- a/src/pair_lj_expand.h
+++ b/src/pair_lj_expand.h
@@ -1,54 +1,68 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/expand,PairLJExpand)
#else
#ifndef LMP_PAIR_LJ_EXPAND_H
#define LMP_PAIR_LJ_EXPAND_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJExpand : public Pair {
public:
PairLJExpand(class LAMMPS *);
virtual ~PairLJExpand();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
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 &);
protected:
double cut_global;
double **cut;
double **epsilon,**sigma,**shift;
double **lj1,**lj2,**lj3,**lj4,**offset;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/pair_lj_gromacs.h b/src/pair_lj_gromacs.h
index c6a7b5976..3e61d7645 100644
--- a/src/pair_lj_gromacs.h
+++ b/src/pair_lj_gromacs.h
@@ -1,54 +1,68 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/gromacs,PairLJGromacs)
#else
#ifndef LMP_PAIR_LJ_GROMACS_H
#define LMP_PAIR_LJ_GROMACS_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJGromacs : public Pair {
public:
PairLJGromacs(class LAMMPS *);
virtual ~PairLJGromacs();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
virtual void read_restart_settings(FILE *);
virtual double single(int, int, int, int, double, double, double, double &);
protected:
double cut_inner_global,cut_global;
double **cut,**cut_inner,**cut_inner_sq;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4;
double **ljsw1,**ljsw2,**ljsw3,**ljsw4,**ljsw5;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/pair_lj_gromacs_coul_gromacs.h b/src/pair_lj_gromacs_coul_gromacs.h
index 5f41a456a..bb6d28ba0 100644
--- a/src/pair_lj_gromacs_coul_gromacs.h
+++ b/src/pair_lj_gromacs_coul_gromacs.h
@@ -1,56 +1,74 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/gromacs/coul/gromacs,PairLJGromacsCoulGromacs)
#else
#ifndef LMP_PAIR_LJ_GROMACS_COUL_GROMACS_H
#define LMP_PAIR_LJ_GROMACS_COUL_GROMACS_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJGromacsCoulGromacs : public Pair {
public:
PairLJGromacsCoulGromacs(class LAMMPS *);
virtual ~PairLJGromacsCoulGromacs();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
virtual void read_restart_settings(FILE *);
virtual double single(int, int, int, int, double, double, double, double &);
protected:
double cut_lj_inner,cut_lj,cut_coul_inner,cut_coul;
double cut_lj_innersq,cut_ljsq,cut_coul_innersq,cut_coulsq,cut_bothsq;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4;
double **ljsw1,**ljsw2,**ljsw3,**ljsw4,**ljsw5;
double coulsw1,coulsw2,coulsw3,coulsw4,coulsw5;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: Pair style lj/gromacs/coul/gromacs requires atom attribute q
+
+An atom_style with this attribute is needed.
+
+*/
diff --git a/src/pair_lj_smooth.h b/src/pair_lj_smooth.h
index ecc67dd52..b81a1b79f 100644
--- a/src/pair_lj_smooth.h
+++ b/src/pair_lj_smooth.h
@@ -1,55 +1,69 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(lj/smooth,PairLJSmooth)
#else
#ifndef LMP_PAIR_LJ_SMOOTH_H
#define LMP_PAIR_LJ_SMOOTH_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJSmooth : public Pair {
public:
PairLJSmooth(class LAMMPS *);
virtual ~PairLJSmooth();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
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 &);
protected:
double cut_inner_global,cut_global;
double **cut,**cut_inner,**cut_inner_sq;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4;
double **ljsw0,**ljsw1,**ljsw2,**ljsw3,**ljsw4;
double **offset;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/pair_morse.h b/src/pair_morse.h
index a6c628d3f..2110237b7 100644
--- a/src/pair_morse.h
+++ b/src/pair_morse.h
@@ -1,55 +1,74 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(morse,PairMorse)
#else
#ifndef LMP_PAIR_MORSE_H
#define LMP_PAIR_MORSE_H
#include "pair.h"
namespace LAMMPS_NS {
class PairMorse : public Pair {
public:
PairMorse(class LAMMPS *);
virtual ~PairMorse();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
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 &);
protected:
double cut_global;
double **cut;
double **d0,**alpha,**r0;
double **morse1;
double **offset;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+*/
diff --git a/src/pair_soft.cpp b/src/pair_soft.cpp
index 63f0b72b0..fb2889ddf 100644
--- a/src/pair_soft.cpp
+++ b/src/pair_soft.cpp
@@ -1,307 +1,307 @@
/* ----------------------------------------------------------------------
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 "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_soft.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "update.h"
#include "neigh_list.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
/* ---------------------------------------------------------------------- */
PairSoft::PairSoft(LAMMPS *lmp) : Pair(lmp) {}
/* ---------------------------------------------------------------------- */
PairSoft::~PairSoft()
{
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(prefactor);
memory->destroy(cut);
}
}
/* ---------------------------------------------------------------------- */
void PairSoft::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double r,rsq,arg,factor_lj;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = 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;
double *special_lj = force->special_lj;
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];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
r = sqrt(rsq);
arg = MY_PI*r/cut[itype][jtype];
if (r > 0.0) fpair = factor_lj * prefactor[itype][jtype] *
sin(arg) * MY_PI/cut[itype][jtype]/r;
else fpair = 0.0;
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)
evdwl = factor_lj * prefactor[itype][jtype] * (1.0+cos(arg));
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairSoft::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(prefactor,n+1,n+1,"pair:prefactor");
memory->create(cut,n+1,n+1,"pair:cut");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairSoft::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut[i][j] = cut_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairSoft::coeff(int narg, char **arg)
{
if (narg < 3 || narg > 4) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double prefactor_one = force->numeric(arg[2]);
double cut_one = cut_global;
if (narg == 4) cut_one = force->numeric(arg[3]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
prefactor[i][j] = prefactor_one;
cut[i][j] = cut_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairSoft::init_one(int i, int j)
{
// always mix prefactors geometrically
if (setflag[i][j] == 0) {
prefactor[i][j] = sqrt(prefactor[i][i]*prefactor[j][j]);
cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
}
prefactor[j][i] = prefactor[i][j];
cut[j][i] = cut[i][j];
return cut[i][j];
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairSoft::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&prefactor[i][j],sizeof(double),1,fp);
fwrite(&cut[i][j],sizeof(double),1,fp);
}
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairSoft::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
fread(&prefactor[i][j],sizeof(double),1,fp);
fread(&cut[i][j],sizeof(double),1,fp);
}
MPI_Bcast(&prefactor[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairSoft::write_restart_settings(FILE *fp)
{
fwrite(&cut_global,sizeof(double),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairSoft::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&cut_global,sizeof(double),1,fp);
fread(&mix_flag,sizeof(int),1,fp);
}
MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
double PairSoft::single(int i, int j, int itype, int jtype, double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double r,arg,philj;
r = sqrt(rsq);
arg = MY_PI*r/cut[itype][jtype];
fforce = factor_lj * prefactor[itype][jtype] *
sin(arg) * MY_PI/cut[itype][jtype]/r;
philj = prefactor[itype][jtype] * (1.0+cos(arg));
return factor_lj*philj;
}
/* ---------------------------------------------------------------------- */
-void *PairSoft::extract(char *str, int &dim)
+void *PairSoft::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str,"a") == 0) return (void *) prefactor;
return NULL;
}
diff --git a/src/pair_soft.h b/src/pair_soft.h
index 5cb895065..c5927cefd 100644
--- a/src/pair_soft.h
+++ b/src/pair_soft.h
@@ -1,56 +1,70 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(soft,PairSoft)
#else
#ifndef LMP_PAIR_SOFT_H
#define LMP_PAIR_SOFT_H
#include "pair.h"
namespace LAMMPS_NS {
class PairSoft : public Pair {
friend class Pair;
public:
PairSoft(class LAMMPS *);
virtual ~PairSoft();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
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 &);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
double cut_global;
double **prefactor;
double **cut;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/pair_table.cpp b/src/pair_table.cpp
index c27c667ab..b2c34d98b 100644
--- a/src/pair_table.cpp
+++ b/src/pair_table.cpp
@@ -1,961 +1,962 @@
/* ----------------------------------------------------------------------
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: Paul Crozier (SNL)
------------------------------------------------------------------------- */
#include "mpi.h"
#include "math.h"
#include "stdlib.h"
#include "string.h"
#include "pair_table.h"
#include "atom.h"
#include "force.h"
#include "comm.h"
#include "neigh_list.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define LOOKUP 0
#define LINEAR 1
#define SPLINE 2
#define BITMAP 3
#define R 1
#define RSQ 2
#define BMP 3
#define MAXLINE 1024
/* ---------------------------------------------------------------------- */
PairTable::PairTable(LAMMPS *lmp) : Pair(lmp)
{
ntables = 0;
tables = NULL;
}
/* ---------------------------------------------------------------------- */
PairTable::~PairTable()
{
for (int m = 0; m < ntables; m++) free_table(&tables[m]);
memory->sfree(tables);
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(tabindex);
}
}
/* ---------------------------------------------------------------------- */
void PairTable::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype,itable;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,factor_lj,fraction,value,a,b;
int *ilist,*jlist,*numneigh,**firstneigh;
Table *tb;
union_int_float_t rsq_lookup;
int tlm1 = tablength - 1;
evdwl = 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;
double *special_lj = force->special_lj;
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];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
j &= NEIGHMASK;
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];
if (rsq < cutsq[itype][jtype]) {
tb = &tables[tabindex[itype][jtype]];
if (rsq < tb->innersq)
error->one(FLERR,"Pair distance < table inner cutoff");
if (tabstyle == LOOKUP) {
itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
if (itable >= tlm1)
error->one(FLERR,"Pair distance > table outer cutoff");
fpair = factor_lj * tb->f[itable];
} else if (tabstyle == LINEAR) {
itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
if (itable >= tlm1)
error->one(FLERR,"Pair distance > table outer cutoff");
fraction = (rsq - tb->rsq[itable]) * tb->invdelta;
value = tb->f[itable] + fraction*tb->df[itable];
fpair = factor_lj * value;
} else if (tabstyle == SPLINE) {
itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
if (itable >= tlm1)
error->one(FLERR,"Pair distance > table outer cutoff");
b = (rsq - tb->rsq[itable]) * tb->invdelta;
a = 1.0 - b;
value = a * tb->f[itable] + b * tb->f[itable+1] +
((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) *
tb->deltasq6;
fpair = factor_lj * value;
} else {
rsq_lookup.f = rsq;
itable = rsq_lookup.i & tb->nmask;
itable >>= tb->nshiftbits;
fraction = (rsq_lookup.f - tb->rsq[itable]) * tb->drsq[itable];
value = tb->f[itable] + fraction*tb->df[itable];
fpair = factor_lj * value;
}
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) {
if (tabstyle == LOOKUP)
evdwl = tb->e[itable];
else if (tabstyle == LINEAR || tabstyle == BITMAP)
evdwl = tb->e[itable] + fraction*tb->de[itable];
else
evdwl = a * tb->e[itable] + b * tb->e[itable+1] +
((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) *
tb->deltasq6;
evdwl *= factor_lj;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairTable::allocate()
{
allocated = 1;
int nt = atom->ntypes;
memory->create(setflag,nt+1,nt+1,"pair:setflag");
for (int i = 1; i <= nt; i++)
for (int j = i; j <= nt; j++)
setflag[i][j] = 0;
memory->create(cutsq,nt+1,nt+1,"pair:cutsq");
memory->create(tabindex,nt+1,nt+1,"pair:tabindex");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairTable::settings(int narg, char **arg)
{
if (narg != 2) error->all(FLERR,"Illegal pair_style command");
// new settings
if (strcmp(arg[0],"lookup") == 0) tabstyle = LOOKUP;
else if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR;
else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE;
else if (strcmp(arg[0],"bitmap") == 0) tabstyle = BITMAP;
else error->all(FLERR,"Unknown table style in pair_style command");
tablength = force->inumeric(arg[1]);
if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries");
// delete old tables, since cannot just change settings
for (int m = 0; m < ntables; m++) free_table(&tables[m]);
memory->sfree(tables);
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(tabindex);
}
allocated = 0;
ntables = 0;
tables = NULL;
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairTable::coeff(int narg, char **arg)
{
if (narg != 4 && narg != 5) error->all(FLERR,"Illegal pair_coeff command");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
int me;
MPI_Comm_rank(world,&me);
tables = (Table *)
memory->srealloc(tables,(ntables+1)*sizeof(Table),"pair:tables");
Table *tb = &tables[ntables];
null_table(tb);
if (me == 0) read_table(tb,arg[2],arg[3]);
bcast_table(tb);
// set table cutoff
if (narg == 5) tb->cut = force->numeric(arg[4]);
else if (tb->rflag) tb->cut = tb->rhi;
else tb->cut = tb->rfile[tb->ninput-1];
// error check on table parameters
// insure cutoff is within table
// for BITMAP tables, file values can be in non-ascending order
if (tb->ninput <= 1) error->one(FLERR,"Invalid pair table length");
double rlo,rhi;
if (tb->rflag == 0) {
rlo = tb->rfile[0];
rhi = tb->rfile[tb->ninput-1];
} else {
rlo = tb->rlo;
rhi = tb->rhi;
}
if (tb->cut <= rlo || tb->cut > rhi)
error->all(FLERR,"Invalid pair table cutoff");
if (rlo <= 0.0) error->all(FLERR,"Invalid pair table cutoff");
// match = 1 if don't need to spline read-in tables
// this is only the case if r values needed by final tables
// exactly match r values read from file
// for tabstyle SPLINE, always need to build spline tables
tb->match = 0;
if (tabstyle == LINEAR && tb->ninput == tablength &&
tb->rflag == RSQ && tb->rhi == tb->cut) tb->match = 1;
if (tabstyle == BITMAP && tb->ninput == 1 << tablength &&
tb->rflag == BMP && tb->rhi == tb->cut) tb->match = 1;
if (tb->rflag == BMP && tb->match == 0)
error->all(FLERR,"Bitmapped table in file does not match requested table");
// spline read-in values and compute r,e,f vectors within table
if (tb->match == 0) spline_table(tb);
compute_table(tb);
// store ptr to table in tabindex
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
tabindex[i][j] = ntables;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Illegal pair_coeff command");
ntables++;
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairTable::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
tabindex[j][i] = tabindex[i][j];
return tables[tabindex[i][j]].cut;
}
/* ----------------------------------------------------------------------
read a table section from a tabulated potential file
only called by proc 0
this function sets these values in Table:
ninput,rfile,efile,ffile,rflag,rlo,rhi,fpflag,fplo,fphi,ntablebits
------------------------------------------------------------------------- */
void PairTable::read_table(Table *tb, char *file, char *keyword)
{
char line[MAXLINE];
// open file
FILE *fp = fopen(file,"r");
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open file %s",file);
error->one(FLERR,str);
}
// loop until section found with matching keyword
while (1) {
if (fgets(line,MAXLINE,fp) == NULL)
error->one(FLERR,"Did not find keyword in table file");
if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line
if (line[0] == '#') continue; // comment
if (strstr(line,keyword) == line) break; // matching keyword
fgets(line,MAXLINE,fp); // no match, skip section
param_extract(tb,line);
fgets(line,MAXLINE,fp);
for (int i = 0; i < tb->ninput; i++) fgets(line,MAXLINE,fp);
}
// read args on 2nd line of section
// allocate table arrays for file values
fgets(line,MAXLINE,fp);
param_extract(tb,line);
memory->create(tb->rfile,tb->ninput,"pair:rfile");
memory->create(tb->efile,tb->ninput,"pair:efile");
memory->create(tb->ffile,tb->ninput,"pair:ffile");
// setup bitmap parameters for table to read in
tb->ntablebits = 0;
int masklo,maskhi,nmask,nshiftbits;
if (tb->rflag == BMP) {
while (1 << tb->ntablebits < tb->ninput) tb->ntablebits++;
if (1 << tb->ntablebits != tb->ninput)
error->one(FLERR,"Bitmapped table is incorrect length in table file");
init_bitmap(tb->rlo,tb->rhi,tb->ntablebits,masklo,maskhi,nmask,nshiftbits);
}
// read r,e,f table values from file
// if rflag set, compute r
// if rflag not set, use r from file
int itmp;
double rtmp;
union_int_float_t rsq_lookup;
fgets(line,MAXLINE,fp);
for (int i = 0; i < tb->ninput; i++) {
fgets(line,MAXLINE,fp);
sscanf(line,"%d %lg %lg %lg",&itmp,&rtmp,&tb->efile[i],&tb->ffile[i]);
if (tb->rflag == R)
rtmp = tb->rlo + (tb->rhi - tb->rlo)*i/(tb->ninput-1);
else if (tb->rflag == RSQ) {
rtmp = tb->rlo*tb->rlo +
(tb->rhi*tb->rhi - tb->rlo*tb->rlo)*i/(tb->ninput-1);
rtmp = sqrt(rtmp);
} else if (tb->rflag == BMP) {
rsq_lookup.i = i << nshiftbits;
rsq_lookup.i |= masklo;
if (rsq_lookup.f < tb->rlo*tb->rlo) {
rsq_lookup.i = i << nshiftbits;
rsq_lookup.i |= maskhi;
}
rtmp = sqrtf(rsq_lookup.f);
}
tb->rfile[i] = rtmp;
}
// close file
fclose(fp);
}
/* ----------------------------------------------------------------------
broadcast read-in table info from proc 0 to other procs
this function communicates these values in Table:
ninput,rfile,efile,ffile,rflag,rlo,rhi,fpflag,fplo,fphi
------------------------------------------------------------------------- */
void PairTable::bcast_table(Table *tb)
{
MPI_Bcast(&tb->ninput,1,MPI_INT,0,world);
int me;
MPI_Comm_rank(world,&me);
if (me > 0) {
memory->create(tb->rfile,tb->ninput,"pair:rfile");
memory->create(tb->efile,tb->ninput,"pair:efile");
memory->create(tb->ffile,tb->ninput,"pair:ffile");
}
MPI_Bcast(tb->rfile,tb->ninput,MPI_DOUBLE,0,world);
MPI_Bcast(tb->efile,tb->ninput,MPI_DOUBLE,0,world);
MPI_Bcast(tb->ffile,tb->ninput,MPI_DOUBLE,0,world);
MPI_Bcast(&tb->rflag,1,MPI_INT,0,world);
if (tb->rflag) {
MPI_Bcast(&tb->rlo,1,MPI_DOUBLE,0,world);
MPI_Bcast(&tb->rhi,1,MPI_DOUBLE,0,world);
}
MPI_Bcast(&tb->fpflag,1,MPI_INT,0,world);
if (tb->fpflag) {
MPI_Bcast(&tb->fplo,1,MPI_DOUBLE,0,world);
MPI_Bcast(&tb->fphi,1,MPI_DOUBLE,0,world);
}
}
/* ----------------------------------------------------------------------
build spline representation of e,f over entire range of read-in table
this function sets these values in Table: e2file,f2file
------------------------------------------------------------------------- */
void PairTable::spline_table(Table *tb)
{
memory->create(tb->e2file,tb->ninput,"pair:e2file");
memory->create(tb->f2file,tb->ninput,"pair:f2file");
double ep0 = - tb->ffile[0];
double epn = - tb->ffile[tb->ninput-1];
spline(tb->rfile,tb->efile,tb->ninput,ep0,epn,tb->e2file);
if (tb->fpflag == 0) {
tb->fplo = (tb->ffile[1] - tb->ffile[0]) / (tb->rfile[1] - tb->rfile[0]);
tb->fphi = (tb->ffile[tb->ninput-1] - tb->ffile[tb->ninput-2]) /
(tb->rfile[tb->ninput-1] - tb->rfile[tb->ninput-2]);
}
double fp0 = tb->fplo;
double fpn = tb->fphi;
spline(tb->rfile,tb->ffile,tb->ninput,fp0,fpn,tb->f2file);
}
/* ----------------------------------------------------------------------
extract attributes from parameter line in table section
format of line: N value R/RSQ/BITMAP lo hi FP fplo fphi
N is required, other params are optional
------------------------------------------------------------------------- */
void PairTable::param_extract(Table *tb, char *line)
{
tb->ninput = 0;
tb->rflag = 0;
tb->fpflag = 0;
char *word = strtok(line," \t\n\r\f");
while (word) {
if (strcmp(word,"N") == 0) {
word = strtok(NULL," \t\n\r\f");
tb->ninput = atoi(word);
} else if (strcmp(word,"R") == 0 || strcmp(word,"RSQ") == 0 ||
strcmp(word,"BITMAP") == 0) {
if (strcmp(word,"R") == 0) tb->rflag = R;
else if (strcmp(word,"RSQ") == 0) tb->rflag = RSQ;
else if (strcmp(word,"BITMAP") == 0) tb->rflag = BMP;
word = strtok(NULL," \t\n\r\f");
tb->rlo = atof(word);
word = strtok(NULL," \t\n\r\f");
tb->rhi = atof(word);
} else if (strcmp(word,"FP") == 0) {
tb->fpflag = 1;
word = strtok(NULL," \t\n\r\f");
tb->fplo = atof(word);
word = strtok(NULL," \t\n\r\f");
tb->fphi = atof(word);
} else {
printf("WORD: %s\n",word);
error->one(FLERR,"Invalid keyword in pair table parameters");
}
word = strtok(NULL," \t\n\r\f");
}
if (tb->ninput == 0) error->one(FLERR,"Pair table parameters did not set N");
}
/* ----------------------------------------------------------------------
compute r,e,f vectors from splined values
------------------------------------------------------------------------- */
void PairTable::compute_table(Table *tb)
{
int tlm1 = tablength-1;
// inner = inner table bound
// cut = outer table bound
// delta = table spacing in rsq for N-1 bins
double inner;
if (tb->rflag) inner = tb->rlo;
else inner = tb->rfile[0];
tb->innersq = inner*inner;
tb->delta = (tb->cut*tb->cut - tb->innersq) / tlm1;
tb->invdelta = 1.0/tb->delta;
// direct lookup tables
// N-1 evenly spaced bins in rsq from inner to cut
// e,f = value at midpt of bin
// e,f are N-1 in length since store 1 value at bin midpt
// f is converted to f/r when stored in f[i]
// e,f are never a match to read-in values, always computed via spline interp
if (tabstyle == LOOKUP) {
memory->create(tb->e,tlm1,"pair:e");
memory->create(tb->f,tlm1,"pair:f");
double r,rsq;
for (int i = 0; i < tlm1; i++) {
rsq = tb->innersq + (i+0.5)*tb->delta;
r = sqrt(rsq);
tb->e[i] = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,r);
tb->f[i] = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,r)/r;
}
}
// linear tables
// N-1 evenly spaced bins in rsq from inner to cut
// rsq,e,f = value at lower edge of bin
// de,df values = delta from lower edge to upper edge of bin
// rsq,e,f are N in length so de,df arrays can compute difference
// f is converted to f/r when stored in f[i]
// e,f can match read-in values, else compute via spline interp
if (tabstyle == LINEAR) {
memory->create(tb->rsq,tablength,"pair:rsq");
memory->create(tb->e,tablength,"pair:e");
memory->create(tb->f,tablength,"pair:f");
memory->create(tb->de,tlm1,"pair:de");
memory->create(tb->df,tlm1,"pair:df");
double r,rsq;
for (int i = 0; i < tablength; i++) {
rsq = tb->innersq + i*tb->delta;
r = sqrt(rsq);
tb->rsq[i] = rsq;
if (tb->match) {
tb->e[i] = tb->efile[i];
tb->f[i] = tb->ffile[i]/r;
} else {
tb->e[i] = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,r);
tb->f[i] = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,r)/r;
}
}
for (int i = 0; i < tlm1; i++) {
tb->de[i] = tb->e[i+1] - tb->e[i];
tb->df[i] = tb->f[i+1] - tb->f[i];
}
}
// cubic spline tables
// N-1 evenly spaced bins in rsq from inner to cut
// rsq,e,f = value at lower edge of bin
// e2,f2 = spline coefficient for each bin
// rsq,e,f,e2,f2 are N in length so have N-1 spline bins
// f is converted to f/r after e is splined
// e,f can match read-in values, else compute via spline interp
if (tabstyle == SPLINE) {
memory->create(tb->rsq,tablength,"pair:rsq");
memory->create(tb->e,tablength,"pair:e");
memory->create(tb->f,tablength,"pair:f");
memory->create(tb->e2,tablength,"pair:e2");
memory->create(tb->f2,tablength,"pair:f2");
tb->deltasq6 = tb->delta*tb->delta / 6.0;
double r,rsq;
for (int i = 0; i < tablength; i++) {
rsq = tb->innersq + i*tb->delta;
r = sqrt(rsq);
tb->rsq[i] = rsq;
if (tb->match) {
tb->e[i] = tb->efile[i];
tb->f[i] = tb->ffile[i]/r;
} else {
tb->e[i] = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,r);
tb->f[i] = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,r);
}
}
// ep0,epn = dE/dr at inner and at cut
double ep0 = - tb->f[0];
double epn = - tb->f[tlm1];
spline(tb->rsq,tb->e,tablength,ep0,epn,tb->e2);
// fp0,fpn = dh/dg at inner and at cut
// h(r) = f(r)/r and g(r) = r^2
// dh/dg = (1/r df/dr - f/r^2) / 2r
// dh/dg in secant approx = (f(r2)/r2 - f(r1)/r1) / (g(r2) - g(r1))
double fp0,fpn;
double secant_factor = 0.1;
if (tb->fpflag) fp0 = (tb->fplo/sqrt(tb->innersq) - tb->f[0]/tb->innersq) /
(2.0 * sqrt(tb->innersq));
else {
double rsq1 = tb->innersq;
double rsq2 = rsq1 + secant_factor*tb->delta;
fp0 = (splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,sqrt(rsq2)) /
sqrt(rsq2) - tb->f[0] / sqrt(rsq1)) / (secant_factor*tb->delta);
}
if (tb->fpflag && tb->cut == tb->rfile[tb->ninput-1]) fpn =
(tb->fphi/tb->cut - tb->f[tlm1]/(tb->cut*tb->cut)) / (2.0 * tb->cut);
else {
double rsq2 = tb->cut * tb->cut;
double rsq1 = rsq2 - secant_factor*tb->delta;
fpn = (tb->f[tlm1] / sqrt(rsq2) -
splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,sqrt(rsq1)) /
sqrt(rsq1)) / (secant_factor*tb->delta);
}
for (int i = 0; i < tablength; i++) tb->f[i] /= sqrt(tb->rsq[i]);
spline(tb->rsq,tb->f,tablength,fp0,fpn,tb->f2);
}
// bitmapped linear tables
// 2^N bins from inner to cut, spaced in bitmapped manner
// f is converted to f/r when stored in f[i]
// e,f can match read-in values, else compute via spline interp
if (tabstyle == BITMAP) {
double r;
union_int_float_t rsq_lookup;
int masklo,maskhi;
// linear lookup tables of length ntable = 2^n
// stored value = value at lower edge of bin
init_bitmap(inner,tb->cut,tablength,masklo,maskhi,tb->nmask,tb->nshiftbits);
int ntable = 1 << tablength;
int ntablem1 = ntable - 1;
memory->create(tb->rsq,ntable,"pair:rsq");
memory->create(tb->e,ntable,"pair:e");
memory->create(tb->f,ntable,"pair:f");
memory->create(tb->de,ntable,"pair:de");
memory->create(tb->df,ntable,"pair:df");
memory->create(tb->drsq,ntable,"pair:drsq");
union_int_float_t minrsq_lookup;
minrsq_lookup.i = 0 << tb->nshiftbits;
minrsq_lookup.i |= maskhi;
for (int i = 0; i < ntable; i++) {
rsq_lookup.i = i << tb->nshiftbits;
rsq_lookup.i |= masklo;
if (rsq_lookup.f < tb->innersq) {
rsq_lookup.i = i << tb->nshiftbits;
rsq_lookup.i |= maskhi;
}
r = sqrtf(rsq_lookup.f);
tb->rsq[i] = rsq_lookup.f;
if (tb->match) {
tb->e[i] = tb->efile[i];
tb->f[i] = tb->ffile[i]/r;
} else {
tb->e[i] = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,r);
tb->f[i] = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,r)/r;
}
minrsq_lookup.f = MIN(minrsq_lookup.f,rsq_lookup.f);
}
tb->innersq = minrsq_lookup.f;
for (int i = 0; i < ntablem1; i++) {
tb->de[i] = tb->e[i+1] - tb->e[i];
tb->df[i] = tb->f[i+1] - tb->f[i];
tb->drsq[i] = 1.0/(tb->rsq[i+1] - tb->rsq[i]);
}
// get the delta values for the last table entries
// tables are connected periodically between 0 and ntablem1
tb->de[ntablem1] = tb->e[0] - tb->e[ntablem1];
tb->df[ntablem1] = tb->f[0] - tb->f[ntablem1];
tb->drsq[ntablem1] = 1.0/(tb->rsq[0] - tb->rsq[ntablem1]);
// get the correct delta values at itablemax
// smallest r is in bin itablemin
// largest r is in bin itablemax, which is itablemin-1,
// or ntablem1 if itablemin=0
// deltas at itablemax only needed if corresponding rsq < cut*cut
// if so, compute deltas between rsq and cut*cut
// if tb->match, data at cut*cut is unavailable, so we'll take
// deltas at itablemax-1 as a good approximation
double e_tmp,f_tmp;
int itablemin = minrsq_lookup.i & tb->nmask;
itablemin >>= tb->nshiftbits;
int itablemax = itablemin - 1;
if (itablemin == 0) itablemax = ntablem1;
int itablemaxm1 = itablemax - 1;
if (itablemax == 0) itablemaxm1 = ntablem1;
rsq_lookup.i = itablemax << tb->nshiftbits;
rsq_lookup.i |= maskhi;
if (rsq_lookup.f < tb->cut*tb->cut) {
if (tb->match) {
tb->de[itablemax] = tb->de[itablemaxm1];
tb->df[itablemax] = tb->df[itablemaxm1];
tb->drsq[itablemax] = tb->drsq[itablemaxm1];
} else {
rsq_lookup.f = tb->cut*tb->cut;
r = sqrtf(rsq_lookup.f);
e_tmp = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,r);
f_tmp = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,r)/r;
tb->de[itablemax] = e_tmp - tb->e[itablemax];
tb->df[itablemax] = f_tmp - tb->f[itablemax];
tb->drsq[itablemax] = 1.0/(rsq_lookup.f - tb->rsq[itablemax]);
}
}
}
}
/* ----------------------------------------------------------------------
set all ptrs in a table to NULL, so can be freed safely
------------------------------------------------------------------------- */
void PairTable::null_table(Table *tb)
{
tb->rfile = tb->efile = tb->ffile = NULL;
tb->e2file = tb->f2file = NULL;
tb->rsq = tb->drsq = tb->e = tb->de = NULL;
tb->f = tb->df = tb->e2 = tb->f2 = NULL;
}
/* ----------------------------------------------------------------------
free all arrays in a table
------------------------------------------------------------------------- */
void PairTable::free_table(Table *tb)
{
memory->destroy(tb->rfile);
memory->destroy(tb->efile);
memory->destroy(tb->ffile);
memory->destroy(tb->e2file);
memory->destroy(tb->f2file);
memory->destroy(tb->rsq);
memory->destroy(tb->drsq);
memory->destroy(tb->e);
memory->destroy(tb->de);
memory->destroy(tb->f);
memory->destroy(tb->df);
memory->destroy(tb->e2);
memory->destroy(tb->f2);
}
/* ----------------------------------------------------------------------
spline and splint routines modified from Numerical Recipes
------------------------------------------------------------------------- */
void PairTable::spline(double *x, double *y, int n,
double yp1, double ypn, double *y2)
{
int i,k;
double p,qn,sig,un;
double *u = new double[n];
if (yp1 > 0.99e30) y2[0] = u[0] = 0.0;
else {
y2[0] = -0.5;
u[0] = (3.0/(x[1]-x[0])) * ((y[1]-y[0]) / (x[1]-x[0]) - yp1);
}
for (i = 1; i < n-1; i++) {
sig = (x[i]-x[i-1]) / (x[i+1]-x[i-1]);
p = sig*y2[i-1] + 2.0;
y2[i] = (sig-1.0) / p;
u[i] = (y[i+1]-y[i]) / (x[i+1]-x[i]) - (y[i]-y[i-1]) / (x[i]-x[i-1]);
u[i] = (6.0*u[i] / (x[i+1]-x[i-1]) - sig*u[i-1]) / p;
}
if (ypn > 0.99e30) qn = un = 0.0;
else {
qn = 0.5;
un = (3.0/(x[n-1]-x[n-2])) * (ypn - (y[n-1]-y[n-2]) / (x[n-1]-x[n-2]));
}
y2[n-1] = (un-qn*u[n-2]) / (qn*y2[n-2] + 1.0);
for (k = n-2; k >= 0; k--) y2[k] = y2[k]*y2[k+1] + u[k];
delete [] u;
}
/* ---------------------------------------------------------------------- */
double PairTable::splint(double *xa, double *ya, double *y2a, int n, double x)
{
int klo,khi,k;
double h,b,a,y;
klo = 0;
khi = n-1;
while (khi-klo > 1) {
k = (khi+klo) >> 1;
if (xa[k] > x) khi = k;
else klo = k;
}
h = xa[khi]-xa[klo];
a = (xa[khi]-x) / h;
b = (x-xa[klo]) / h;
y = a*ya[klo] + b*ya[khi] +
((a*a*a-a)*y2a[klo] + (b*b*b-b)*y2a[khi]) * (h*h)/6.0;
return y;
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairTable::write_restart(FILE *fp)
{
write_restart_settings(fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairTable::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairTable::write_restart_settings(FILE *fp)
{
fwrite(&tabstyle,sizeof(int),1,fp);
fwrite(&tablength,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairTable::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&tabstyle,sizeof(int),1,fp);
fread(&tablength,sizeof(int),1,fp);
}
MPI_Bcast(&tabstyle,1,MPI_DOUBLE,0,world);
MPI_Bcast(&tablength,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
double PairTable::single(int i, int j, int itype, int jtype, double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
int itable;
double fraction,value,a,b,phi;
int tlm1 = tablength - 1;
Table *tb = &tables[tabindex[itype][jtype]];
if (rsq < tb->innersq) error->one(FLERR,"Pair distance < table inner cutoff");
if (tabstyle == LOOKUP) {
itable = static_cast<int> ((rsq-tb->innersq) * tb->invdelta);
if (itable >= tlm1) error->one(FLERR,"Pair distance > table outer cutoff");
fforce = factor_lj * tb->f[itable];
} else if (tabstyle == LINEAR) {
itable = static_cast<int> ((rsq-tb->innersq) * tb->invdelta);
if (itable >= tlm1) error->one(FLERR,"Pair distance > table outer cutoff");
fraction = (rsq - tb->rsq[itable]) * tb->invdelta;
value = tb->f[itable] + fraction*tb->df[itable];
fforce = factor_lj * value;
} else if (tabstyle == SPLINE) {
itable = static_cast<int> ((rsq-tb->innersq) * tb->invdelta);
if (itable >= tlm1) error->one(FLERR,"Pair distance > table outer cutoff");
b = (rsq - tb->rsq[itable]) * tb->invdelta;
a = 1.0 - b;
value = a * tb->f[itable] + b * tb->f[itable+1] +
((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) *
tb->deltasq6;
fforce = factor_lj * value;
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
itable = rsq_lookup.i & tb->nmask;
itable >>= tb->nshiftbits;
fraction = (rsq_lookup.f - tb->rsq[itable]) * tb->drsq[itable];
value = tb->f[itable] + fraction*tb->df[itable];
fforce = factor_lj * value;
}
if (tabstyle == LOOKUP)
phi = tb->e[itable];
else if (tabstyle == LINEAR || tabstyle == BITMAP)
phi = tb->e[itable] + fraction*tb->de[itable];
else
phi = a * tb->e[itable] + b * tb->e[itable+1] +
((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) * tb->deltasq6;
return factor_lj*phi;
}
/* ----------------------------------------------------------------------
return the Coulomb cutoff for tabled potentials
called by KSpace solvers which require that all pairwise cutoffs be the same
loop over all tables not just those indexed by tabindex[i][j] since
no way to know which tables are active since pair::init() not yet called
------------------------------------------------------------------------- */
-void *PairTable::extract(char *str, int &dim)
+void *PairTable::extract(const char *str, int &dim)
{
if (strcmp(str,"cut_coul") != 0) return NULL;
if (ntables == 0) error->all(FLERR,"All pair coeffs are not set");
double cut_coul = tables[0].cut;
for (int m = 1; m < ntables; m++)
if (tables[m].cut != cut_coul)
- error->all(FLERR,"Pair table cutoffs must all be equal to use with KSpace");
+ error->all(FLERR,
+ "Pair table cutoffs must all be equal to use with KSpace");
dim = 0;
return &tables[0].cut;
}
diff --git a/src/pair_table.h b/src/pair_table.h
index 3ef646626..11ffa4d75 100644
--- a/src/pair_table.h
+++ b/src/pair_table.h
@@ -1,75 +1,146 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(table,PairTable)
#else
#ifndef LMP_PAIR_TABLE_H
#define LMP_PAIR_TABLE_H
#include "pair.h"
namespace LAMMPS_NS {
class PairTable : public Pair {
public:
PairTable(class LAMMPS *);
virtual ~PairTable();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
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 &);
- void *extract(char *, int &);
+ void *extract(const char *, int &);
protected:
int tabstyle,tablength;
enum {LOOKUP=0, LINEAR=1, SPLINE=2, BITMAP=3};
struct Table {
int ninput,rflag,fpflag,match,ntablebits;
int nshiftbits,nmask;
double rlo,rhi,fplo,fphi,cut;
double *rfile,*efile,*ffile;
double *e2file,*f2file;
double innersq,delta,invdelta,deltasq6;
double *rsq,*drsq,*e,*de,*f,*df,*e2,*f2;
};
int ntables;
Table *tables;
int **tabindex;
void allocate();
void read_table(Table *, char *, char *);
void param_extract(Table *, char *);
void bcast_table(Table *);
void spline_table(Table *);
void compute_table(Table *);
void null_table(Table *);
void free_table(Table *);
void spline(double *, double *, int, double, double, double *);
double splint(double *, double *, double *, int, double);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Pair distance < table inner cutoff
+
+Two atoms are closer together than the pairwise table allows.
+
+E: Pair distance > table outer cutoff
+
+Two atoms are further apart than the pairwise table allows.
+
+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: Unknown table style in pair_style command
+
+Style of table is invalid for use with pair_style table command.
+
+E: Illegal number of pair table entries
+
+There must be at least 2 table entries.
+
+E: Invalid pair table length
+
+Length of read-in pair table is invalid
+
+E: Invalid pair table cutoff
+
+Cutoffs in pair_coeff command are not valid with read-in pair table.
+
+E: Bitmapped table in file does not match requested table
+
+Setting for bitmapped table in pair_coeff command must match table
+in file exactly.
+
+E: All pair coeffs are not set
+
+All pair coefficients must be set in the data file or by the
+pair_coeff command before running a simulation.
+
+E: Cannot open file %s
+
+The specified file cannot be opened. Check that the path and name are
+correct.
+
+E: Did not find keyword in table file
+
+Keyword used in pair_coeff command was not found in table file.
+
+E: Bitmapped table is incorrect length in table file
+
+Number of table entries is not a correct power of 2.
+
+E: Invalid keyword in pair table parameters
+
+Keyword used in list of table parameters is not recognized.
+
+E: Pair table parameters did not set N
+
+List of pair table parameters must include N setting.
+
+E: Pair table cutoffs must all be equal to use with KSpace
+
+When using pair style table with a long-range KSpace solver, the
+cutoffs for all atom type pairs must all be the same, since the
+long-range solver starts at that cutoff.
+
+*/
diff --git a/src/pair_yukawa.h b/src/pair_yukawa.h
index a7dfab947..2c07456c8 100644
--- a/src/pair_yukawa.h
+++ b/src/pair_yukawa.h
@@ -1,53 +1,67 @@
/* ----------------------------------------------------------------------
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 PAIR_CLASS
PairStyle(yukawa,PairYukawa)
#else
#ifndef LMP_PAIR_YUKAWA_H
#define LMP_PAIR_YUKAWA_H
#include "pair.h"
namespace LAMMPS_NS {
class PairYukawa : public Pair {
public:
PairYukawa(class LAMMPS *);
virtual ~PairYukawa();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
virtual double single(int, int, int, int, double, double, double, double &);
protected:
double cut_global;
double kappa;
double *rad;
double **cut,**a,**offset;
void allocate();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Incorrect args for pair coefficients
+
+Self-explanatory. Check the input script or data file.
+
+*/
diff --git a/src/procmap.cpp b/src/procmap.cpp
new file mode 100644
index 000000000..8fa1bd8f1
--- /dev/null
+++ b/src/procmap.cpp
@@ -0,0 +1,889 @@
+/* ----------------------------------------------------------------------
+ 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 (NUMA option) : Mike Brown (ORNL)
+------------------------------------------------------------------------- */
+
+#include "procmap.h"
+#include "universe.h"
+#include "domain.h"
+#include "math_extra.h"
+#include "memory.h"
+#include "error.h"
+
+#include <map>
+#include <string>
+
+using namespace LAMMPS_NS;
+
+#define MAXLINE 128
+
+enum{MULTIPLE}; // same as in Comm
+
+/* ---------------------------------------------------------------------- */
+
+ProcMap::ProcMap(LAMMPS *lmp) : Pointers(lmp) {}
+
+/* ----------------------------------------------------------------------
+ create a one-level 3d grid of procs
+------------------------------------------------------------------------- */
+
+void ProcMap::onelevel_grid(int nprocs, int *user_procgrid, int *procgrid,
+ int otherflag, int other_style,
+ int *other_procgrid)
+{
+ int **factors;
+
+ // factors = list of all possible 3 factors of processor count
+
+ int npossible = factor(nprocs,NULL);
+ memory->create(factors,npossible,3,"procmap:factors");
+ npossible = factor(nprocs,factors);
+
+ // constrain by 2d, user request, other partition
+
+ if (domain->dimension == 2) npossible = cull_2d(npossible,factors,3);
+ npossible = cull_user(npossible,factors,3,user_procgrid);
+ if (otherflag) npossible = cull_other(npossible,factors,3,
+ other_style,other_procgrid);
+
+ // user/other constraints make failure possible
+
+ if (npossible == 0)
+ error->all(FLERR,"Could not create 3d grid of processors");
+
+ // select best set of 3 factors based on surface area of proc sub-domains
+
+ best_factors(npossible,factors,procgrid,1,1,1);
+
+ // clean-up
+
+ memory->destroy(factors);
+}
+
+/* ----------------------------------------------------------------------
+ create a two-level 3d grid of procs
+------------------------------------------------------------------------- */
+
+void ProcMap::twolevel_grid(int nprocs, int *user_procgrid, int *procgrid,
+ int ncores, int *user_coregrid, int *coregrid,
+ int otherflag, int other_style,
+ int *other_procgrid)
+{
+ int **nfactors,**cfactors,**factors;
+
+ if (nprocs % ncores)
+ error->all(FLERR,"Processors twogrid requires proc count "
+ "be a multiple of core count");
+
+ // nfactors = list of all possible 3 factors of node count
+ // constrain by 2d
+
+ int nnpossible = factor(nprocs/ncores,NULL);
+ memory->create(nfactors,nnpossible,3,"procmap:nfactors");
+ nnpossible = factor(nprocs/ncores,nfactors);
+
+ if (domain->dimension == 2) nnpossible = cull_2d(nnpossible,nfactors,3);
+
+ // cfactors = list of all possible 3 factors of core count
+ // constrain by 2d
+
+ int ncpossible = factor(ncores,NULL);
+ memory->create(cfactors,ncpossible,3,"procmap:cfactors");
+ ncpossible = factor(ncores,cfactors);
+
+ if (domain->dimension == 2) ncpossible = cull_2d(ncpossible,cfactors,3);
+ ncpossible = cull_user(ncpossible,cfactors,3,user_coregrid);
+
+ // factors = all combinations of nfactors and cfactors
+ // factors stores additional index pointing to corresponding cfactors
+ // constrain by user request, other partition
+
+ int npossible = nnpossible * ncpossible;
+ memory->create(factors,npossible,4,"procmap:factors");
+ npossible = combine_factors(nnpossible,nfactors,ncpossible,cfactors,factors);
+
+ npossible = cull_user(npossible,factors,4,user_procgrid);
+ if (otherflag) npossible = cull_other(npossible,factors,4,
+ other_style,other_procgrid);
+
+ // user/other constraints make failure possible
+
+ if (npossible == 0)
+ error->all(FLERR,"Could not create twolevel 3d grid of processors");
+
+ // select best set of 3 factors based on surface area of proc sub-domains
+ // index points to corresponding core factorization
+
+ int index = best_factors(npossible,factors,procgrid,1,1,1);
+
+ coregrid[0] = cfactors[factors[index][3]][0];
+ coregrid[1] = cfactors[factors[index][3]][1];
+ coregrid[2] = cfactors[factors[index][3]][2];
+
+ // clean-up
+
+ memory->destroy(nfactors);
+ memory->destroy(cfactors);
+ memory->destroy(factors);
+}
+
+/* ----------------------------------------------------------------------
+ create a 3d grid of procs that does a 2-level hierarchy within a node
+ auto-detects NUMA sockets within a multi-core node
+------------------------------------------------------------------------- */
+
+void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid,
+ int *numagrid)
+{
+ // hardwire this for now
+
+ int numa_nodes = 1;
+
+ // get names of all nodes
+
+ int name_length;
+ char node_name[MPI_MAX_PROCESSOR_NAME];
+ char node_names[MPI_MAX_PROCESSOR_NAME*nprocs];
+ MPI_Get_processor_name(node_name,&name_length);
+ MPI_Allgather(&node_name,MPI_MAX_PROCESSOR_NAME,MPI_CHAR,&node_names,
+ MPI_MAX_PROCESSOR_NAME,MPI_CHAR,world);
+ std::string node_string = std::string(node_name);
+
+ // get number of procs per node
+
+ std::map<std::string,int> name_map;
+ std::map<std::string,int>::iterator np;
+ for (int i = 0; i < nprocs; i++) {
+ std::string i_string = std::string(&node_names[i*MPI_MAX_PROCESSOR_NAME]);
+ np = name_map.find(i_string);
+ if (np == name_map.end()) name_map[i_string] = 1;
+ else np->second++;
+ }
+ procs_per_node = name_map.begin()->second;
+ procs_per_numa = procs_per_node / numa_nodes;
+
+ // error if any of these conditions met
+
+ if (nprocs % procs_per_numa || // total procs not a multiple of node
+ user_procgrid[0] > 1 || // user specified grid > 1 in any dim
+ user_procgrid[1] > 1 ||
+ user_procgrid[2] > 1)
+ error->all(FLERR,"Could not create numa 3d grid of processors");
+
+ // user settings for the factorization per numa node
+ // currently not user settable
+ // if user specifies 1 for a proc grid dimension,
+ // also use 1 for the numa grid dimension
+
+ int user_numagrid[3];
+ user_numagrid[0] = user_numagrid[1] = user_numagrid[2] = 0;
+
+ if (user_procgrid[0] == 1) user_numagrid[0] = 1;
+ if (user_procgrid[1] == 1) user_numagrid[1] = 1;
+ if (user_procgrid[2] == 1) user_numagrid[2] = 1;
+
+ // initial factorization within NUMA node
+
+ int **numafactors;
+ int numapossible = factor(procs_per_numa,NULL);
+ memory->create(numafactors,numapossible,3,"procmap:numafactors");
+ numapossible = factor(procs_per_numa,numafactors);
+
+ if (domain->dimension == 2)
+ numapossible = cull_2d(numapossible,numafactors,3);
+ numapossible = cull_user(numapossible,numafactors,3,user_numagrid);
+
+ if (numapossible == 0)
+ error->all(FLERR,"Could not create numa grid of processors");
+
+ best_factors(numapossible,numafactors,numagrid,1,1,1);
+
+ // user_nodegrid = implied user contraints on nodes
+
+ int user_nodegrid[3];
+ user_nodegrid[0] = user_procgrid[0] / numagrid[0];
+ user_nodegrid[1] = user_procgrid[1] / numagrid[1];
+ user_nodegrid[2] = user_procgrid[2] / numagrid[2];
+
+ // factorization for the grid of NUMA nodes
+
+ int node_count = nprocs / procs_per_numa;
+
+ int **nodefactors;
+ int nodepossible = factor(node_count,NULL);
+ memory->create(nodefactors,nodepossible,3,"procmap:nodefactors");
+ nodepossible = factor(node_count,nodefactors);
+
+ if (domain->dimension == 2)
+ nodepossible = cull_2d(nodepossible,nodefactors,3);
+ nodepossible = cull_user(nodepossible,nodefactors,3,user_nodegrid);
+
+ if (nodepossible == 0)
+ error->all(FLERR,"Could not create numa grid of processors");
+
+ best_factors(nodepossible,nodefactors,nodegrid,
+ numagrid[0],numagrid[1],numagrid[2]);
+
+ // repeat NUMA node factorization using subdomain sizes
+ // refines the factorization if the user specified the node layout
+ // NOTE: this will not re-enforce user-procgrid constraint will it?
+
+ best_factors(numapossible,numafactors,numagrid,
+ nodegrid[0],nodegrid[1],nodegrid[2]);
+
+ memory->destroy(numafactors);
+ memory->destroy(nodefactors);
+
+ // assign a unique id to each node
+
+ node_id = 0;
+ int node_num = 0;
+ for (np = name_map.begin(); np != name_map.end(); ++np) {
+ if (np->first == node_string) node_id = node_num;
+ node_num++;
+ }
+
+ // return the proc-level factorization
+
+ procgrid[0] = nodegrid[0] * numagrid[0];
+ procgrid[1] = nodegrid[1] * numagrid[1];
+ procgrid[2] = nodegrid[2] * numagrid[2];
+}
+
+/* ----------------------------------------------------------------------
+ define a 3d grid from a custom file
+------------------------------------------------------------------------- */
+
+void ProcMap::custom_grid(char *cfile, int nprocs,
+ int *user_procgrid, int *procgrid)
+{
+ FILE *fp;
+ char line[MAXLINE];
+
+ int me;
+ MPI_Comm_rank(world,&me);
+
+ if (me == 0) {
+ FILE *fp = fopen(cfile,"r");
+ if (fp == NULL) error->one(FLERR,"Cannot open custom file");
+
+ // skip header = blank and comment lines
+
+ char *ptr;
+ if (!fgets(line,MAXLINE,fp))
+ error->one(FLERR,"Unexpected end of custom file");
+ while (1) {
+ if (ptr = strchr(line,'#')) *ptr = '\0';
+ if (strspn(line," \t\n\r") != strlen(line)) break;
+ if (!fgets(line,MAXLINE,fp))
+ error->one(FLERR,"Unexpected end of custom file");
+ }
+ }
+
+ int n = strlen(line) + 1;
+ MPI_Bcast(&n,1,MPI_INT,0,world);
+ MPI_Bcast(line,n,MPI_CHAR,0,world);
+
+ sscanf(line,"%d %d %d",&procgrid[0],&procgrid[1],&procgrid[2]);
+
+ int flag = 0;
+ if (procgrid[0]*procgrid[1]*procgrid[2] != nprocs) flag = 1;
+ if (user_procgrid[0] && procgrid[0] != user_procgrid[0]) flag = 1;
+ if (user_procgrid[1] && procgrid[1] != user_procgrid[1]) flag = 1;
+ if (user_procgrid[2] && procgrid[2] != user_procgrid[2]) flag = 1;
+ if (flag) error->all(FLERR,"Processors custom grid file is inconsistent");
+
+ // cmap = map of procs to grid
+ // store for use in custom_map()
+
+ memory->create(cmap,nprocs,4,"procmap:cmap");
+ for (int i = 0; i < nprocs; i++) cmap[i][0] = -1;
+
+ if (me == 0) {
+ for (int i = 0; i < nprocs; i++) {
+ if (!fgets(line,MAXLINE,fp))
+ error->one(FLERR,"Unexpected end of custom file");
+ sscanf(line,"%d %d %d %d",
+ &cmap[i][0],&cmap[i][1],&cmap[i][2],&cmap[i][3]);
+ }
+ fclose(fp);
+ }
+
+ MPI_Bcast(&cmap[0][0],nprocs*4,MPI_INT,0,world);
+
+ // error check on cmap values
+
+ flag = 0;
+ for (int i = 0; i < nprocs; i++) {
+ if (cmap[i][0] == -1) flag = 1;
+ else {
+ if (cmap[i][1] <= 0 || cmap[i][1] > procgrid[0]) flag = 1;
+ if (cmap[i][2] <= 0 || cmap[i][2] > procgrid[1]) flag = 1;
+ if (cmap[i][3] <= 0 || cmap[i][3] > procgrid[2]) flag = 1;
+ }
+ }
+ if (flag) error->all(FLERR,"Processors custom grid file is invalid");
+}
+
+/* ----------------------------------------------------------------------
+ map processors to 3d grid via MPI_Cart routines
+ MPI may do layout in machine-optimized fashion
+------------------------------------------------------------------------- */
+
+void ProcMap::cart_map(int reorder, int *procgrid,
+ int *myloc, int procneigh[3][2], int ***grid2proc)
+{
+ int periods[3];
+ periods[0] = periods[1] = periods[2] = 1;
+ MPI_Comm cartesian;
+
+ MPI_Cart_create(world,3,procgrid,periods,reorder,&cartesian);
+ MPI_Cart_get(cartesian,3,procgrid,periods,myloc);
+ MPI_Cart_shift(cartesian,0,1,&procneigh[0][0],&procneigh[0][1]);
+ MPI_Cart_shift(cartesian,1,1,&procneigh[1][0],&procneigh[1][1]);
+ MPI_Cart_shift(cartesian,2,1,&procneigh[2][0],&procneigh[2][1]);
+
+ int coords[3];
+ int i,j,k;
+ for (i = 0; i < procgrid[0]; i++)
+ for (j = 0; j < procgrid[1]; j++)
+ for (k = 0; k < procgrid[2]; k++) {
+ coords[0] = i; coords[1] = j; coords[2] = k;
+ MPI_Cart_rank(cartesian,coords,&grid2proc[i][j][k]);
+ }
+
+ MPI_Comm_free(&cartesian);
+}
+
+/* ----------------------------------------------------------------------
+ map processors to 3d grid via MPI_Cart routines
+ respect sub-grid of cores within each node
+ MPI may do layout in machine-optimized fashion
+------------------------------------------------------------------------- */
+
+void ProcMap::cart_map(int reorder, int *procgrid, int ncores, int *coregrid,
+ int *myloc, int procneigh[3][2], int ***grid2proc)
+{
+ // setup NUMA params that numa_grid() sets up
+
+ int me;
+ MPI_Comm_rank(world,&me);
+
+ procs_per_node = ncores;
+ procs_per_numa = ncores;
+ node_id = me/ncores;
+ nodegrid[0] = procgrid[0] / coregrid[0];
+ nodegrid[1] = procgrid[1] / coregrid[1];
+ nodegrid[2] = procgrid[2] / coregrid[2];
+
+ // now can use numa_map() to perform mapping
+
+ numa_map(reorder,coregrid,myloc,procneigh,grid2proc);
+}
+
+/* ----------------------------------------------------------------------
+ map processors to 3d grid in XYZ order
+ called by onelevel
+------------------------------------------------------------------------- */
+
+void ProcMap::xyz_map(char *xyz, int *procgrid,
+ int *myloc, int procneigh[3][2], int ***grid2proc)
+{
+ int me;
+ MPI_Comm_rank(world,&me);
+
+ int i,j,k;
+ for (i = 0; i < procgrid[0]; i++)
+ for (j = 0; j < procgrid[1]; j++)
+ for (k = 0; k < procgrid[2]; k++) {
+ if (xyz[0] == 'x' && xyz[1] == 'y' && xyz[2] == 'z')
+ grid2proc[i][j][k] = k*procgrid[1]*procgrid[0] + j*procgrid[0] + i;
+ else if (xyz[0] == 'x' && xyz[1] == 'z' && xyz[2] == 'y')
+ grid2proc[i][j][k] = j*procgrid[2]*procgrid[0] + k*procgrid[0] + i;
+ else if (xyz[0] == 'y' && xyz[1] == 'x' && xyz[2] == 'z')
+ grid2proc[i][j][k] = k*procgrid[0]*procgrid[1] + i*procgrid[1] + j;
+ else if (xyz[0] == 'y' && xyz[1] == 'z' && xyz[2] == 'x')
+ grid2proc[i][j][k] = i*procgrid[2]*procgrid[1] + k*procgrid[1] + j;
+ else if (xyz[0] == 'z' && xyz[1] == 'x' && xyz[2] == 'y')
+ grid2proc[i][j][k] = j*procgrid[0]*procgrid[2] + i*procgrid[2] + k;
+ else if (xyz[0] == 'z' && xyz[1] == 'y' && xyz[2] == 'x')
+ grid2proc[i][j][k] = i*procgrid[1]*procgrid[2] + j*procgrid[2] + k;
+
+ if (grid2proc[i][j][k] == me) {
+ myloc[0] = i; myloc[1] = j, myloc[2] = k;
+ }
+ }
+
+ // proc IDs of neighbors
+
+ int minus,plus;
+ grid_shift(myloc[0],procgrid[0],minus,plus);
+ procneigh[0][0] = grid2proc[minus][myloc[1]][myloc[2]];
+ procneigh[0][1] = grid2proc[plus][myloc[1]][myloc[2]];
+
+ grid_shift(myloc[1],procgrid[1],minus,plus);
+ procneigh[1][0] = grid2proc[myloc[0]][minus][myloc[2]];
+ procneigh[1][1] = grid2proc[myloc[0]][plus][myloc[2]];
+
+ grid_shift(myloc[2],procgrid[2],minus,plus);
+ procneigh[2][0] = grid2proc[myloc[0]][myloc[1]][minus];
+ procneigh[2][1] = grid2proc[myloc[0]][myloc[1]][plus];
+}
+
+/* ----------------------------------------------------------------------
+ map processors to 3d grid in XYZ order
+ respect sub-grid of cores within each node
+ called by twolevel
+------------------------------------------------------------------------- */
+
+void ProcMap::xyz_map(char *xyz, int *procgrid, int ncores, int *coregrid,
+ int *myloc, int procneigh[3][2], int ***grid2proc)
+{
+ int me;
+ MPI_Comm_rank(world,&me);
+
+ nodegrid[0] = procgrid[0] / coregrid[0];
+ nodegrid[1] = procgrid[1] / coregrid[1];
+ nodegrid[2] = procgrid[2] / coregrid[2];
+
+ int i,j,k,inode,jnode,knode,icore,jcore,kcore;
+ for (i = 0; i < procgrid[0]; i++)
+ for (j = 0; j < procgrid[1]; j++)
+ for (k = 0; k < procgrid[2]; k++) {
+ inode = i/coregrid[0];
+ jnode = j/coregrid[1];
+ knode = k/coregrid[2];
+ icore = i % coregrid[0];
+ jcore = j % coregrid[1];
+ kcore = k % coregrid[2];
+
+ if (xyz[0] == 'x' && xyz[1] == 'y' && xyz[2] == 'z') {
+ grid2proc[i][j][k] = ncores *
+ (knode*nodegrid[1]*nodegrid[0] + jnode*nodegrid[0] + inode) +
+ (kcore*coregrid[1]*coregrid[0] + jcore*coregrid[0] + icore);
+ } else if (xyz[0] == 'x' && xyz[1] == 'z' && xyz[2] == 'y')
+ grid2proc[i][j][k] = ncores *
+ (jnode*nodegrid[2]*nodegrid[0] + knode*nodegrid[0] + inode) +
+ (jcore*coregrid[2]*coregrid[0] + kcore*coregrid[0] + icore);
+ else if (xyz[0] == 'y' && xyz[1] == 'x' && xyz[2] == 'z')
+ grid2proc[i][j][k] = ncores *
+ (knode*nodegrid[0]*nodegrid[1] + inode*nodegrid[1] + jnode) +
+ (kcore*coregrid[0]*coregrid[1] + icore*coregrid[1] + jcore);
+ else if (xyz[0] == 'y' && xyz[1] == 'z' && xyz[2] == 'x')
+ grid2proc[i][j][k] = ncores *
+ (inode*nodegrid[2]*nodegrid[1] + knode*nodegrid[1] + jnode) +
+ (icore*coregrid[2]*coregrid[1] + kcore*coregrid[1] + jcore);
+ else if (xyz[0] == 'z' && xyz[1] == 'x' && xyz[2] == 'y')
+ grid2proc[i][j][k] = ncores *
+ (jnode*nodegrid[0]*nodegrid[2] + inode*nodegrid[2] + knode) +
+ (jcore*coregrid[0]*coregrid[2] + icore*coregrid[2] + kcore);
+ else if (xyz[0] == 'z' && xyz[1] == 'y' && xyz[2] == 'x')
+ grid2proc[i][j][k] = ncores *
+ (inode*nodegrid[1]*nodegrid[2] + jnode*nodegrid[2] + knode) +
+ (icore*coregrid[1]*coregrid[2] + jcore*coregrid[2] + kcore);
+
+ if (grid2proc[i][j][k] == me) {
+ myloc[0] = i; myloc[1] = j, myloc[2] = k;
+ }
+ }
+
+ // proc IDs of neighbors
+
+ int minus,plus;
+ grid_shift(myloc[0],procgrid[0],minus,plus);
+ procneigh[0][0] = grid2proc[minus][myloc[1]][myloc[2]];
+ procneigh[0][1] = grid2proc[plus][myloc[1]][myloc[2]];
+
+ grid_shift(myloc[1],procgrid[1],minus,plus);
+ procneigh[1][0] = grid2proc[myloc[0]][minus][myloc[2]];
+ procneigh[1][1] = grid2proc[myloc[0]][plus][myloc[2]];
+
+ grid_shift(myloc[2],procgrid[2],minus,plus);
+ procneigh[2][0] = grid2proc[myloc[0]][myloc[1]][minus];
+ procneigh[2][1] = grid2proc[myloc[0]][myloc[1]][plus];
+}
+
+/* ----------------------------------------------------------------------
+ map processors to 3d grid in 2-level NUMA ordering
+------------------------------------------------------------------------- */
+
+void ProcMap::numa_map(int reorder, int *numagrid,
+ int *myloc, int procneigh[3][2], int ***grid2proc)
+{
+ // setup a per node communicator and find rank within
+
+ MPI_Comm node_comm;
+ MPI_Comm_split(world,node_id,0,&node_comm);
+ int node_rank;
+ MPI_Comm_rank(node_comm,&node_rank);
+
+ // setup a per numa communicator and find rank within
+
+ MPI_Comm numa_comm;
+ int local_numa = node_rank / procs_per_numa;
+ MPI_Comm_split(node_comm,local_numa,0,&numa_comm);
+ int numa_rank;
+ MPI_Comm_rank(numa_comm,&numa_rank);
+
+ // setup a communicator with the rank 0 procs from each numa node
+
+ MPI_Comm numa_leaders;
+ MPI_Comm_split(world,numa_rank,0,&numa_leaders);
+
+ // use the MPI Cartesian routines to map the nodes to the grid
+
+ int periods[3];
+ periods[0] = periods[1] = periods[2] = 1;
+ MPI_Comm cartesian;
+ if (numa_rank == 0) {
+ MPI_Cart_create(numa_leaders,3,nodegrid,periods,reorder,&cartesian);
+ MPI_Cart_get(cartesian,3,nodegrid,periods,myloc);
+ }
+
+ // broadcast numa node location in grid to other procs in numa node
+
+ MPI_Bcast(myloc,3,MPI_INT,0,numa_comm);
+
+ // compute my location within the node grid
+
+ int z_offset = numa_rank / (numagrid[0] * numagrid[1]);
+ int y_offset = (numa_rank % (numagrid[0] * numagrid[1]))/numagrid[0];
+ int x_offset = numa_rank % numagrid[0];
+ myloc[0] = myloc[0] * numagrid[0] + x_offset;
+ myloc[1] = myloc[1] * numagrid[1] + y_offset;
+ myloc[2] = myloc[2] * numagrid[2] + z_offset;
+
+ // allgather of myloc into gridi to fill grid2proc
+
+ int nprocs;
+ MPI_Comm_size(world,&nprocs);
+
+ int **gridi;
+ memory->create(gridi,nprocs,3,"comm:gridi");
+ MPI_Allgather(myloc,3,MPI_INT,gridi[0],3,MPI_INT,world);
+ for (int i = 0; i < nprocs; i++)
+ grid2proc[gridi[i][0]][gridi[i][1]][gridi[i][2]] = i;
+ memory->destroy(gridi);
+
+ // proc IDs of neighbors
+
+ int minus,plus;
+ grid_shift(myloc[0],nodegrid[0]*numagrid[0],minus,plus);
+ procneigh[0][0] = grid2proc[minus][myloc[1]][myloc[2]];
+ procneigh[0][1] = grid2proc[plus][myloc[1]][myloc[2]];
+
+ grid_shift(myloc[1],nodegrid[1]*numagrid[1],minus,plus);
+ procneigh[1][0] = grid2proc[myloc[0]][minus][myloc[2]];
+ procneigh[1][1] = grid2proc[myloc[0]][plus][myloc[2]];
+
+ grid_shift(myloc[2],nodegrid[2]*numagrid[2],minus,plus);
+ procneigh[2][0] = grid2proc[myloc[0]][myloc[1]][minus];
+ procneigh[2][1] = grid2proc[myloc[0]][myloc[1]][plus];
+
+ // clean-up
+
+ if (numa_rank == 0) MPI_Comm_free(&cartesian);
+ MPI_Comm_free(&numa_leaders);
+ MPI_Comm_free(&numa_comm);
+ MPI_Comm_free(&node_comm);
+}
+
+/* ----------------------------------------------------------------------
+ map processors to 3d grid in custom ordering
+------------------------------------------------------------------------- */
+
+void ProcMap::custom_map(int *procgrid,
+ int *myloc, int procneigh[3][2], int ***grid2proc)
+{
+ int me,nprocs;
+ MPI_Comm_rank(world,&me);
+ MPI_Comm_size(world,&nprocs);
+
+ for (int i = 0; i < nprocs; i++) {
+ grid2proc[cmap[i][1]-1][cmap[i][2]-1][cmap[i][3]-1] = cmap[i][0];
+ if (cmap[i][0] == me) {
+ myloc[0] = cmap[i][1] - 1;
+ myloc[1] = cmap[i][2] - 1;
+ myloc[2] = cmap[i][3] - 1;
+ }
+ }
+
+ // proc IDs of neighbors
+
+ int minus,plus;
+ grid_shift(myloc[0],procgrid[0],minus,plus);
+ procneigh[0][0] = grid2proc[minus][myloc[1]][myloc[2]];
+ procneigh[0][1] = grid2proc[plus][myloc[1]][myloc[2]];
+
+ grid_shift(myloc[1],procgrid[1],minus,plus);
+ procneigh[1][0] = grid2proc[myloc[0]][minus][myloc[2]];
+ procneigh[1][1] = grid2proc[myloc[0]][plus][myloc[2]];
+
+ grid_shift(myloc[2],procgrid[2],minus,plus);
+ procneigh[2][0] = grid2proc[myloc[0]][myloc[1]][minus];
+ procneigh[2][1] = grid2proc[myloc[0]][myloc[1]][plus];
+
+ memory->destroy(cmap);
+}
+
+/* ----------------------------------------------------------------------
+ output mapping of processors to 3d grid to file
+------------------------------------------------------------------------- */
+
+void ProcMap::output(char *file, int *procgrid, int ***grid2proc)
+{
+ int me,nprocs;
+ MPI_Comm_rank(world,&me);
+ MPI_Comm_size(world,&nprocs);
+
+ FILE *fp;
+ if (me == 0) {
+ fp = fopen(file,"w");
+ if (fp == NULL) error->one(FLERR,"Cannot open processors custom file");
+ fprintf(fp,"LAMMPS mapping of processors to 3d grid\n");
+ fprintf(fp,"partition = %d\n",universe->iworld+1);
+ fprintf(fp,"Px Py Pz = %d %d %d\n",procgrid[0],procgrid[1],procgrid[2]);
+ fprintf(fp,"world-ID universe-ID original-ID: I J K: name\n\n");
+ }
+
+ // find me in the grid
+
+ int ime,jme,kme;
+ for (int i = 0; i < procgrid[0]; i++)
+ for (int j = 0; j < procgrid[1]; j++)
+ for (int k = 0; k < procgrid[2]; k++)
+ if (grid2proc[i][j][k] == me) {
+ ime = i; jme = j; kme = k;
+ }
+
+ // polled comm of grid mapping info from each proc to proc 0
+
+ int tmp;
+ int vec[6];
+ char procname[MPI_MAX_PROCESSOR_NAME+1];
+ MPI_Status status;
+
+ vec[0] = me;
+ vec[1] = universe->me;
+ MPI_Comm_rank(universe->uorig,&vec[2]);
+ vec[3] = ime + 1;
+ vec[4] = jme + 1;
+ vec[5] = kme + 1;
+
+ int len;
+ MPI_Get_processor_name(procname,&len);
+ procname[len] = '\0';
+
+ if (me == 0) {
+ for (int iproc = 0; iproc < nprocs; iproc++) {
+ if (iproc) {
+ MPI_Send(&tmp,0,MPI_INT,iproc,0,world);
+ MPI_Recv(vec,6,MPI_INT,iproc,0,world,&status);
+ MPI_Recv(procname,MPI_MAX_PROCESSOR_NAME+1,MPI_CHAR,
+ iproc,0,world,&status);
+ }
+
+ fprintf(fp,"%d %d %d: %d %d %d: %s\n",
+ vec[0],vec[1],vec[2],vec[3],vec[4],vec[5],procname);
+ }
+
+ } else {
+ MPI_Recv(&tmp,0,MPI_INT,0,0,world,&status);
+ MPI_Send(vec,6,MPI_INT,0,0,world);
+ MPI_Send(procname,strlen(procname)+1,MPI_CHAR,0,0,world);
+ }
+
+ // close output file
+
+ if (me == 0) fclose(fp);
+}
+
+/* ----------------------------------------------------------------------
+ generate all possible 3-integer factorizations of N
+ store them in factors if non-NULL
+ return # of factorizations
+------------------------------------------------------------------------- */
+
+int ProcMap::factor(int n, int **factors)
+{
+ int i,j,nyz;
+
+ int m = 0;
+ for (i = 1; i <= n; i++) {
+ if (n % i) continue;
+ nyz = n/i;
+ for (j = 1; j <= nyz; j++) {
+ if (nyz % j) continue;
+ if (factors) {
+ factors[m][0] = i;
+ factors[m][1] = j;
+ factors[m][2] = nyz/j;
+ }
+ m++;
+ }
+ }
+
+ return m;
+}
+
+/* ----------------------------------------------------------------------
+ create N1*N2 new factors (procs) from factors1 (nodes) and factors2 (cores)
+ store index of corresponding core factors in factors[][3]
+------------------------------------------------------------------------- */
+
+int ProcMap::combine_factors(int n1, int **factors1, int n2, int **factors2,
+ int **factors)
+{
+ int m = 0;
+ for (int i = 0; i < n1; i++)
+ for (int j = 0; j < n2; j++) {
+ factors[m][0] = factors1[i][0]*factors2[j][0];
+ factors[m][1] = factors1[i][1]*factors2[j][1];
+ factors[m][2] = factors1[i][2]*factors2[j][2];
+ factors[m][3] = j;
+ m++;
+ }
+ return n1*n2;
+}
+
+/* ----------------------------------------------------------------------
+ remove any factors where Pz != 1 for 2d
+------------------------------------------------------------------------- */
+
+int ProcMap::cull_2d(int n, int **factors, int m)
+{
+ int i = 0;
+ while (i < n) {
+ if (factors[i][2] != 1) {
+ for (int j = 0; j < m; j++) factors[i][j] = factors[n-1][j];
+ n--;
+ } else i++;
+ }
+ return n;
+}
+
+/* ----------------------------------------------------------------------
+ remove any factors that do not match non-zero user_factors Px,Py,Pz
+------------------------------------------------------------------------- */
+
+int ProcMap::cull_user(int n, int **factors, int m, int *user_factors)
+{
+ int i = 0;
+ while (i < n) {
+ int flag = 0;
+ if (user_factors[0] && factors[i][0] != user_factors[0]) flag = 1;
+ if (user_factors[1] && factors[i][1] != user_factors[1]) flag = 1;
+ if (user_factors[2] && factors[i][2] != user_factors[2]) flag = 1;
+ if (flag) {
+ for (int j = 0; j < m; j++) factors[i][j] = factors[n-1][j];
+ n--;
+ } else i++;
+ }
+ return n;
+}
+
+/* ----------------------------------------------------------------------
+ remove any factors that do not match settings from other partition
+ MULTIPLE = other Px,Py,Pz must be multiple of my Px,Py,Pz
+------------------------------------------------------------------------- */
+
+int ProcMap::cull_other(int n, int **factors, int m,
+ int other_style, int *other_grid)
+{
+ int i = 0;
+ while (i < n) {
+ if (other_style == MULTIPLE) {
+ int flag = 0;
+ if (other_grid[0] % factors[i][0]) flag = 1;
+ if (other_grid[1] % factors[i][1]) flag = 1;
+ if (other_grid[2] % factors[i][2]) flag = 1;
+ if (flag) {
+ for (int j = 0; j < m; j++) factors[i][j] = factors[n-1][j];
+ n--;
+ } else i++;
+ }
+ }
+ return n;
+}
+
+/* ----------------------------------------------------------------------
+ choose best factors from list of Npossible factors
+ best = minimal surface area of sub-domain
+ return best = 3 factors
+ return index of best factors in factors
+------------------------------------------------------------------------- */
+
+int ProcMap::best_factors(int npossible, int **factors, int *best,
+ const int sx, const int sy, const int sz)
+{
+ // determine cross-sectional areas for orthogonal and triclinic boxes
+ // for triclinic, area = cross product of 2 edge vectors stored in h matrix
+ // area[3] = surface area 3 box faces divided by sx,sy,sz
+ // area[0] = xy, area[1] = xz, area[2] = yz
+
+ double area[3];
+ if (domain->triclinic == 0) {
+ area[0] = domain->xprd * domain->yprd / (sx*sy);
+ area[1] = domain->xprd * domain->zprd / (sx*sz);
+ area[2] = domain->yprd * domain->zprd / (sy*sz);
+ } else {
+ double *h = domain->h;
+ double a[3],b[3],c[3];
+ a[0] = h[0]; a[1] = 0.0; a[2] = 0.0;
+ b[0] = h[5]; b[1] = h[1]; b[2] = 0.0;
+ MathExtra::cross3(a,b,c);
+ area[0] = sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]) / (sx*sy);
+ a[0] = h[0]; a[1] = 0.0; a[2] = 0.0;
+ b[0] = h[4]; b[1] = h[3]; b[2] = h[2];
+ MathExtra::cross3(a,b,c);
+ area[1] = sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]) / (sx*sz);
+ a[0] = h[5]; a[1] = h[1]; a[2] = 0.0;
+ b[0] = h[4]; b[1] = h[3]; b[2] = h[2];
+ MathExtra::cross3(a,b,c);
+ area[2] = sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]) / (sy*sz);
+ }
+
+ int index;
+ double surf;
+ double bestsurf = 2.0 * (area[0]+area[1]+area[2]);
+
+ for (int m = 0; m < npossible; m++) {
+ surf = area[0]/factors[m][0]/factors[m][1] +
+ area[1]/factors[m][0]/factors[m][2] +
+ area[2]/factors[m][1]/factors[m][2];
+ if (surf < bestsurf) {
+ bestsurf = surf;
+ best[0] = factors[m][0];
+ best[1] = factors[m][1];
+ best[2] = factors[m][2];
+ index = m;
+ }
+ }
+
+ return index;
+}
+
+/* ----------------------------------------------------------------------
+ minus,plus = indices of neighboring processors in a dimension
+------------------------------------------------------------------------- */
+
+void ProcMap::grid_shift(int myloc, int nprocs, int &minus, int &plus)
+{
+ minus = myloc - 1;
+ if (minus < 0) minus = nprocs - 1;
+ plus = myloc + 1;
+ if (plus == nprocs) plus = 0;
+}
+
diff --git a/src/procmap.h b/src/procmap.h
new file mode 100644
index 000000000..f4f98f43d
--- /dev/null
+++ b/src/procmap.h
@@ -0,0 +1,100 @@
+/* ----------------------------------------------------------------------
+ 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_PROCMAP_H
+#define LMP_PROCMAP_H
+
+#include "pointers.h"
+
+namespace LAMMPS_NS {
+
+class ProcMap : protected Pointers {
+ public:
+ ProcMap(class LAMMPS *);
+ ~ProcMap() {}
+ void onelevel_grid(int, int *, int *, int, int, int *);
+ void twolevel_grid(int, int *, int *, int, int *, int *, int, int, int *);
+ void numa_grid(int, int *, int *, int *);
+ void custom_grid(char *, int, int *, int *);
+ void cart_map(int, int *, int *, int [3][2], int ***);
+ void cart_map(int, int *, int, int *, int *, int [3][2], int ***);
+ void xyz_map(char *, int *, int *, int [3][2], int ***);
+ void xyz_map(char *, int *, int, int *, int *, int [3][2], int ***);
+ void numa_map(int, int *, int *, int [3][2], int ***);
+ void custom_map(int *, int *, int [3][2], int ***);
+ void output(char *, int *, int ***);
+
+ private:
+ int procs_per_node; // NUMA params
+ int procs_per_numa;
+ int node_id; // which node I am in
+ int nodegrid[3]; // 3d grid of nodes
+
+ int **cmap; // info in custom grid file
+
+ int factor(int, int **);
+ int combine_factors(int, int **, int, int **, int **);
+ int cull_2d(int, int **, int);
+ int cull_user(int, int **, int, int *);
+ int cull_other(int, int **, int, int, int *);
+ int best_factors(int, int **, int *, int, int, int);
+ void grid_shift(int, int, int &, int &);
+};
+
+}
+
+#endif
+
+/* ERROR/WARNING messages:
+
+E: Could not create 3d grid of processors
+
+UNDOCUMENTED
+
+E: Processors twogrid requires proc count be a multiple of core count
+
+UNDOCUMENTED
+
+E: Could not create twolevel 3d grid of processors
+
+UNDOCUMENTED
+
+E: Could not create numa 3d grid of processors
+
+UNDOCUMENTED
+
+E: Could not create numa grid of processors
+
+UNDOCUMENTED
+
+E: Cannot open custom file
+
+UNDOCUMENTED
+
+E: Unexpected end of custom file
+
+UNDOCUMENTED
+
+E: Processors custom grid file is inconsistent
+
+UNDOCUMENTED
+
+E: Processors custom grid file is invalid
+
+UNDOCUMENTED
+
+E: Cannot open processors custom file
+
+UNDOCUMENTED
+
+*/
diff --git a/src/random_mars.h b/src/random_mars.h
index 19bf3df83..6c183bcc5 100644
--- a/src/random_mars.h
+++ b/src/random_mars.h
@@ -1,38 +1,47 @@
/* ----------------------------------------------------------------------
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_RANMARS_H
#define LMP_RANMARS_H
#include "pointers.h"
namespace LAMMPS_NS {
class RanMars : protected Pointers {
public:
RanMars(class LAMMPS *, int);
~RanMars();
double uniform();
double gaussian();
private:
int seed,save;
double second;
double *u;
int i97,j97;
double c,cd,cm;
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Invalid seed for Marsaglia random # generator
+
+The initial seed for this random number generator must be a positive
+integer less than or equal to 900 million.
+
+*/
diff --git a/src/random_park.h b/src/random_park.h
index 3119ae995..7b1718498 100644
--- a/src/random_park.h
+++ b/src/random_park.h
@@ -1,38 +1,47 @@
/* ----------------------------------------------------------------------
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_RANPARK_H
#define LMP_RANPARK_H
#include "pointers.h"
namespace LAMMPS_NS {
class RanPark : protected Pointers {
friend class Set;
public:
RanPark(class LAMMPS *, int);
double uniform();
double gaussian();
void reset(int);
void reset(int, double *);
int state();
private:
int seed,save;
double second;
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Invalid seed for Park random # generator
+
+The initial seed for this random number generator must be a positive
+integer.
+
+*/
diff --git a/src/read_data.cpp b/src/read_data.cpp
index 872076b11..31addac3a 100644
--- a/src/read_data.cpp
+++ b/src/read_data.cpp
@@ -1,1448 +1,1448 @@
/* ----------------------------------------------------------------------
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 "lmptype.h"
#include "math.h"
#include "mpi.h"
#include "string.h"
#include "stdlib.h"
#include "ctype.h"
#include "read_data.h"
#include "atom.h"
#include "atom_vec.h"
#include "atom_vec_ellipsoid.h"
#include "atom_vec_line.h"
#include "atom_vec_tri.h"
#include "comm.h"
#include "update.h"
#include "force.h"
#include "pair.h"
#include "domain.h"
#include "bond.h"
#include "angle.h"
#include "dihedral.h"
#include "improper.h"
#include "error.h"
#include "memory.h"
#include "special.h"
using namespace LAMMPS_NS;
#define MAXLINE 256
#define LB_FACTOR 1.1
#define CHUNK 1024
#define DELTA 4 // must be 2 or larger
// customize for new sections
#define NSECTIONS 23 // change when add to header::section_keywords
/* ---------------------------------------------------------------------- */
ReadData::ReadData(LAMMPS *lmp) : Pointers(lmp)
{
MPI_Comm_rank(world,&me);
line = new char[MAXLINE];
keyword = new char[MAXLINE];
buffer = new char[CHUNK*MAXLINE];
narg = maxarg = 0;
arg = NULL;
// customize for new sections
// pointers to atom styles that store extra info
nellipsoids = 0;
avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
nlines = 0;
avec_line = (AtomVecLine *) atom->style_match("line");
ntris = 0;
avec_tri = (AtomVecTri *) atom->style_match("tri");
}
/* ---------------------------------------------------------------------- */
ReadData::~ReadData()
{
delete [] line;
delete [] keyword;
delete [] buffer;
memory->sfree(arg);
}
/* ---------------------------------------------------------------------- */
void ReadData::command(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal read_data command");
if (domain->box_exist)
error->all(FLERR,"Cannot read_data after simulation box is defined");
if (domain->dimension == 2 && domain->zperiodic == 0)
error->all(FLERR,"Cannot run 2d simulation with nonperiodic Z dimension");
// scan data file to determine max topology needed per atom
// allocate initial topology arrays
if (atom->molecular) {
if (me == 0) {
if (screen) fprintf(screen,"Scanning data file ...\n");
open(arg[0]);
header(0);
scan(atom->bond_per_atom,atom->angle_per_atom,
atom->dihedral_per_atom,atom->improper_per_atom);
if (compressed) pclose(fp);
else fclose(fp);
atom->bond_per_atom += atom->extra_bond_per_atom;
}
MPI_Bcast(&atom->bond_per_atom,1,MPI_INT,0,world);
MPI_Bcast(&atom->angle_per_atom,1,MPI_INT,0,world);
MPI_Bcast(&atom->dihedral_per_atom,1,MPI_INT,0,world);
MPI_Bcast(&atom->improper_per_atom,1,MPI_INT,0,world);
} else
atom->bond_per_atom = atom->angle_per_atom =
atom->dihedral_per_atom = atom->improper_per_atom = 0;
// read header info
if (me == 0) {
if (screen) fprintf(screen,"Reading data file ...\n");
open(arg[0]);
}
header(1);
domain->box_exist = 1;
// problem setup using info from header
update->ntimestep = 0;
int n;
if (comm->nprocs == 1) n = static_cast<int> (atom->natoms);
else n = static_cast<int> (LB_FACTOR * atom->natoms / comm->nprocs);
atom->allocate_type_arrays();
atom->avec->grow(n);
n = atom->nmax;
domain->print_box(" ");
domain->set_initial_box();
domain->set_global_box();
comm->set_proc_grid();
domain->set_local_box();
// customize for new sections
// read rest of file in free format
int atomflag = 0;
while (strlen(keyword)) {
if (strcmp(keyword,"Atoms") == 0) {
atoms();
atomflag = 1;
} else if (strcmp(keyword,"Velocities") == 0) {
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Velocities");
velocities();
} else if (strcmp(keyword,"Ellipsoids") == 0) {
if (!avec_ellipsoid)
error->all(FLERR,"Invalid data file section: Ellipsoids");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Ellipsoids");
bonus(nellipsoids,(AtomVec *) avec_ellipsoid,"ellipsoids");
} else if (strcmp(keyword,"Lines") == 0) {
if (!avec_line)
error->all(FLERR,"Invalid data file section: Lines");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Lines");
bonus(nlines,(AtomVec *) avec_line,"lines");
} else if (strcmp(keyword,"Triangles") == 0) {
if (!avec_tri)
error->all(FLERR,"Invalid data file section: Triangles");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Triangles");
bonus(ntris,(AtomVec *) avec_tri,"triangles");
} else if (strcmp(keyword,"Bonds") == 0) {
if (atom->avec->bonds_allow == 0)
error->all(FLERR,"Invalid data file section: Bonds");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Bonds");
bonds();
} else if (strcmp(keyword,"Angles") == 0) {
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Invalid data file section: Angles");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Angles");
angles();
} else if (strcmp(keyword,"Dihedrals") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: Dihedrals");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Dihedrals");
dihedrals();
} else if (strcmp(keyword,"Impropers") == 0) {
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Invalid data file section: Impropers");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Impropers");
impropers();
} else if (strcmp(keyword,"Masses") == 0) {
mass();
} else if (strcmp(keyword,"Pair Coeffs") == 0) {
if (force->pair == NULL)
error->all(FLERR,"Must define pair_style before Pair Coeffs");
paircoeffs();
} else if (strcmp(keyword,"Bond Coeffs") == 0) {
if (atom->avec->bonds_allow == 0)
error->all(FLERR,"Invalid data file section: Bond Coeffs");
if (force->bond == NULL)
error->all(FLERR,"Must define bond_style before Bond Coeffs");
bondcoeffs();
} else if (strcmp(keyword,"Angle Coeffs") == 0) {
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Invalid data file section: Angle Coeffs");
if (force->angle == NULL)
error->all(FLERR,"Must define angle_style before Angle Coeffs");
anglecoeffs(0);
} else if (strcmp(keyword,"Dihedral Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: Dihedral Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,"Must define dihedral_style before Dihedral Coeffs");
dihedralcoeffs(0);
} else if (strcmp(keyword,"Improper Coeffs") == 0) {
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Invalid data file section: Improper Coeffs");
if (force->improper == NULL)
error->all(FLERR,"Must define improper_style before Improper Coeffs");
impropercoeffs(0);
} else if (strcmp(keyword,"BondBond Coeffs") == 0) {
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Invalid data file section: BondBond Coeffs");
if (force->angle == NULL)
error->all(FLERR,"Must define angle_style before BondBond Coeffs");
anglecoeffs(1);
} else if (strcmp(keyword,"BondAngle Coeffs") == 0) {
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Invalid data file section: BondAngle Coeffs");
if (force->angle == NULL)
error->all(FLERR,"Must define angle_style before BondAngle Coeffs");
anglecoeffs(2);
} else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: MiddleBondTorsion Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before "
"MiddleBondTorsion Coeffs");
dihedralcoeffs(1);
} else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before EndBondTorsion Coeffs");
dihedralcoeffs(2);
} else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: AngleTorsion Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before AngleTorsion Coeffs");
dihedralcoeffs(3);
} else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: AngleAngleTorsion Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before "
"AngleAngleTorsion Coeffs");
dihedralcoeffs(4);
} else if (strcmp(keyword,"BondBond13 Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: BondBond13 Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,"Must define dihedral_style before BondBond13 Coeffs");
dihedralcoeffs(5);
} else if (strcmp(keyword,"AngleAngle Coeffs") == 0) {
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Invalid data file section: AngleAngle Coeffs");
if (force->improper == NULL)
error->all(FLERR,"Must define improper_style before AngleAngle Coeffs");
impropercoeffs(1);
} else {
char str[128];
sprintf(str,"Unknown identifier in data file: %s",keyword);
error->all(FLERR,str);
}
parse_keyword(0,1);
}
// close file
if (me == 0) {
if (compressed) pclose(fp);
else fclose(fp);
}
// error if natoms > 0 yet no atoms were read
if (atom->natoms > 0 && atomflag == 0)
error->all(FLERR,"No atoms in data file");
// create bond topology now that system is defined
if (atom->molecular) {
Special special(lmp);
special.build();
}
}
/* ----------------------------------------------------------------------
read free-format header of data file
if flag = 0, only called by proc 0
if flag = 1, called by all procs so bcast lines as read them
1st line and blank lines are skipped
non-blank lines are checked for header keywords and leading value is read
header ends with EOF or non-blank line containing no header keyword
if EOF, line is set to blank line
else line has first keyword line for rest of file
------------------------------------------------------------------------- */
void ReadData::header(int flag)
{
int n;
char *ptr;
// customize for new sections
- char *section_keywords[NSECTIONS] =
+ const char *section_keywords[NSECTIONS] =
{"Atoms","Velocities","Ellipsoids","Lines","Triangles",
"Bonds","Angles","Dihedrals","Impropers",
"Masses","Pair Coeffs","Bond Coeffs","Angle Coeffs",
"Dihedral Coeffs","Improper Coeffs",
"BondBond Coeffs","BondAngle Coeffs","MiddleBondTorsion Coeffs",
"EndBondTorsion Coeffs","AngleTorsion Coeffs",
"AngleAngleTorsion Coeffs","BondBond13 Coeffs","AngleAngle Coeffs"};
// skip 1st line of file
if (me == 0) {
char *eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
}
// customize for new header lines
while (1) {
// read a line and bcast length if flag is set
if (me == 0) {
if (fgets(line,MAXLINE,fp) == NULL) n = 0;
else n = strlen(line) + 1;
}
if (flag) MPI_Bcast(&n,1,MPI_INT,0,world);
// if n = 0 then end-of-file so return with blank line
if (n == 0) {
line[0] = '\0';
return;
}
// bcast line if flag is set
if (flag) MPI_Bcast(line,n,MPI_CHAR,0,world);
// trim anything from '#' onward
// if line is blank, continue
if (ptr = strchr(line,'#')) *ptr = '\0';
if (strspn(line," \t\n\r") == strlen(line)) continue;
// search line for header keyword and set corresponding variable
if (strstr(line,"atoms")) sscanf(line,BIGINT_FORMAT,&atom->natoms);
else if (strstr(line,"bonds")) sscanf(line,BIGINT_FORMAT,&atom->nbonds);
else if (strstr(line,"angles")) sscanf(line,BIGINT_FORMAT,&atom->nangles);
else if (strstr(line,"dihedrals")) sscanf(line,BIGINT_FORMAT,
&atom->ndihedrals);
else if (strstr(line,"impropers")) sscanf(line,BIGINT_FORMAT,
&atom->nimpropers);
else if (strstr(line,"atom types")) sscanf(line,"%d",&atom->ntypes);
else if (strstr(line,"bond types")) sscanf(line,"%d",&atom->nbondtypes);
else if (strstr(line,"angle types")) sscanf(line,"%d",&atom->nangletypes);
else if (strstr(line,"dihedral types"))
sscanf(line,"%d",&atom->ndihedraltypes);
else if (strstr(line,"improper types"))
sscanf(line,"%d",&atom->nimpropertypes);
else if (strstr(line,"extra bond per atom"))
sscanf(line,"%d",&atom->extra_bond_per_atom);
else if (strstr(line,"ellipsoids")) {
if (!avec_ellipsoid)
error->all(FLERR,"No ellipsoids allowed with this atom style");
sscanf(line,BIGINT_FORMAT,&nellipsoids);
} else if (strstr(line,"lines")) {
if (!avec_line)
error->all(FLERR,"No lines allowed with this atom style");
sscanf(line,BIGINT_FORMAT,&nlines);
} else if (strstr(line,"triangles")) {
if (!avec_tri)
error->all(FLERR,"No triangles allowed with this atom style");
sscanf(line,BIGINT_FORMAT,&ntris);
}
else if (strstr(line,"xlo xhi"))
sscanf(line,"%lg %lg",&domain->boxlo[0],&domain->boxhi[0]);
else if (strstr(line,"ylo yhi"))
sscanf(line,"%lg %lg",&domain->boxlo[1],&domain->boxhi[1]);
else if (strstr(line,"zlo zhi"))
sscanf(line,"%lg %lg",&domain->boxlo[2],&domain->boxhi[2]);
else if (strstr(line,"xy xz yz")) {
domain->triclinic = 1;
sscanf(line,"%lg %lg %lg",&domain->xy,&domain->xz,&domain->yz);
} else break;
}
// error check on total system size
if (atom->natoms < 0 || atom->natoms > MAXBIGINT ||
atom->nbonds < 0 || atom->nbonds > MAXBIGINT ||
atom->nangles < 0 || atom->nangles > MAXBIGINT ||
atom->ndihedrals < 0 || atom->ndihedrals > MAXBIGINT ||
atom->nimpropers < 0 || atom->nimpropers > MAXBIGINT) {
if (flag == 0) error->one(FLERR,"System in data file is too big");
else error->all(FLERR,"System in data file is too big");
}
// check that exiting string is a valid section keyword
parse_keyword(1,flag);
for (n = 0; n < NSECTIONS; n++)
if (strcmp(keyword,section_keywords[n]) == 0) break;
if (n == NSECTIONS) {
char str[128];
sprintf(str,"Unknown identifier in data file: %s",keyword);
error->all(FLERR,str);
}
// error check on consistency of header values
if ((atom->nbonds || atom->nbondtypes) &&
atom->avec->bonds_allow == 0)
error->one(FLERR,"No bonds allowed with this atom style");
if ((atom->nangles || atom->nangletypes) &&
atom->avec->angles_allow == 0)
error->one(FLERR,"No angles allowed with this atom style");
if ((atom->ndihedrals || atom->ndihedraltypes) &&
atom->avec->dihedrals_allow == 0)
error->one(FLERR,"No dihedrals allowed with this atom style");
if ((atom->nimpropers || atom->nimpropertypes) &&
atom->avec->impropers_allow == 0)
error->one(FLERR,"No impropers allowed with this atom style");
if (atom->nbonds > 0 && atom->nbondtypes <= 0)
error->one(FLERR,"Bonds defined but no bond types");
if (atom->nangles > 0 && atom->nangletypes <= 0)
error->one(FLERR,"Angles defined but no angle types");
if (atom->ndihedrals > 0 && atom->ndihedraltypes <= 0)
error->one(FLERR,"Dihedrals defined but no dihedral types");
if (atom->nimpropers > 0 && atom->nimpropertypes <= 0)
error->one(FLERR,"Impropers defined but no improper types");
}
/* ----------------------------------------------------------------------
read all atoms
------------------------------------------------------------------------- */
void ReadData::atoms()
{
int i,m,nchunk;
bigint nread = 0;
bigint natoms = atom->natoms;
while (nread < natoms) {
if (natoms-nread > CHUNK) nchunk = CHUNK;
else nchunk = natoms-nread;
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < nchunk; i++) {
eof = fgets(&buffer[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buffer[m]);
}
m++;
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buffer,m,MPI_CHAR,0,world);
atom->data_atoms(nchunk,buffer);
nread += nchunk;
}
// check that all atoms were assigned correctly
bigint tmp = atom->nlocal;
MPI_Allreduce(&tmp,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " atoms\n",natoms);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " atoms\n",natoms);
}
if (natoms != atom->natoms)
error->all(FLERR,"Did not assign all atoms correctly");
// if any atom ID < 0, error
// if all atom IDs = 0, tag_enable = 0
// if any atom ID > 0, error if any atom ID == 0
// not checking if atom IDs > natoms or are unique
int nlocal = atom->nlocal;
int *tag = atom->tag;
int flag = 0;
for (int i = 0; i < nlocal; i++)
if (tag[i] < 0) flag = 1;
int flag_all;
MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
if (flag_all)
error->all(FLERR,"Invalid atom ID in Atoms section of data file");
flag = 0;
for (int i = 0; i < nlocal; i++)
if (tag[i] > 0) flag = 1;
MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_MAX,world);
if (flag_all == 0) atom->tag_enable = 0;
if (atom->tag_enable) {
flag = 0;
for (int i = 0; i < nlocal; i++)
if (tag[i] == 0) flag = 1;
MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
if (flag_all)
error->all(FLERR,"Invalid atom ID in Atoms section of data file");
}
// create global mapping
if (atom->map_style) {
atom->map_init();
atom->map_set();
}
}
/* ----------------------------------------------------------------------
read all velocities
to find atoms, must build atom map if not a molecular system
------------------------------------------------------------------------- */
void ReadData::velocities()
{
int i,m,nchunk;
int mapflag = 0;
if (atom->map_style == 0) {
mapflag = 1;
atom->map_style = 1;
atom->map_init();
atom->map_set();
}
bigint nread = 0;
bigint natoms = atom->natoms;
while (nread < natoms) {
if (natoms-nread > CHUNK) nchunk = CHUNK;
else nchunk = natoms-nread;
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < nchunk; i++) {
eof = fgets(&buffer[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buffer[m]);
}
m++;
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buffer,m,MPI_CHAR,0,world);
atom->data_vels(nchunk,buffer);
nread += nchunk;
}
if (mapflag) {
atom->map_delete();
atom->map_style = 0;
}
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " velocities\n",natoms);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " velocities\n",natoms);
}
}
/* ----------------------------------------------------------------------
read all bonus data
to find atoms, must build atom map if not a molecular system
------------------------------------------------------------------------- */
-void ReadData::bonus(bigint nbonus, AtomVec *ptr, char *type)
+void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type)
{
int i,m,nchunk;
int mapflag = 0;
if (atom->map_style == 0) {
mapflag = 1;
atom->map_style = 1;
atom->map_init();
atom->map_set();
}
bigint nread = 0;
bigint natoms = nbonus;
while (nread < natoms) {
if (natoms-nread > CHUNK) nchunk = CHUNK;
else nchunk = natoms-nread;
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < nchunk; i++) {
eof = fgets(&buffer[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buffer[m]);
}
m++;
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buffer,m,MPI_CHAR,0,world);
atom->data_bonus(nchunk,buffer,ptr);
nread += nchunk;
}
if (mapflag) {
atom->map_delete();
atom->map_style = 0;
}
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " %s\n",natoms,type);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " %s\n",natoms,type);
}
}
/* ---------------------------------------------------------------------- */
void ReadData::bonds()
{
int i,m,nchunk;
bigint nread = 0;
bigint nbonds = atom->nbonds;
while (nread < nbonds) {
nchunk = MIN(nbonds-nread,CHUNK);
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < nchunk; i++) {
eof = fgets(&buffer[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buffer[m]);
}
m++;
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buffer,m,MPI_CHAR,0,world);
atom->data_bonds(nchunk,buffer);
nread += nchunk;
}
// check that bonds were assigned correctly
int nlocal = atom->nlocal;
bigint sum;
bigint n = 0;
for (i = 0; i < nlocal; i++) n += atom->num_bond[i];
MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
int factor = 1;
if (!force->newton_bond) factor = 2;
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " bonds\n",sum/factor);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " bonds\n",sum/factor);
}
if (sum != factor*atom->nbonds)
error->all(FLERR,"Bonds assigned incorrectly");
}
/* ---------------------------------------------------------------------- */
void ReadData::angles()
{
int i,m,nchunk;
bigint nread = 0;
bigint nangles = atom->nangles;
while (nread < nangles) {
nchunk = MIN(nangles-nread,CHUNK);
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < nchunk; i++) {
eof = fgets(&buffer[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buffer[m]);
}
m++;
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buffer,m,MPI_CHAR,0,world);
atom->data_angles(nchunk,buffer);
nread += nchunk;
}
// check that ang
int nlocal = atom->nlocal;
bigint sum;
bigint n = 0;
for (i = 0; i < nlocal; i++) n += atom->num_angle[i];
MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
int factor = 1;
if (!force->newton_bond) factor = 3;
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " angles\n",sum/factor);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " angles\n",sum/factor);
}
if (sum != factor*atom->nangles)
error->all(FLERR,"Angles assigned incorrectly");
}
/* ---------------------------------------------------------------------- */
void ReadData::dihedrals()
{
int i,m,nchunk;
bigint nread = 0;
bigint ndihedrals = atom->ndihedrals;
while (nread < ndihedrals) {
nchunk = MIN(ndihedrals-nread,CHUNK);
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < nchunk; i++) {
eof = fgets(&buffer[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buffer[m]);
}
m++;
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buffer,m,MPI_CHAR,0,world);
atom->data_dihedrals(nchunk,buffer);
nread += nchunk;
}
// check that dihedrals were assigned correctly
int nlocal = atom->nlocal;
bigint sum;
bigint n = 0;
for (i = 0; i < nlocal; i++) n += atom->num_dihedral[i];
MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
int factor = 1;
if (!force->newton_bond) factor = 4;
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " dihedrals\n",sum/factor);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " dihedrals\n",sum/factor);
}
if (sum != factor*atom->ndihedrals)
error->all(FLERR,"Dihedrals assigned incorrectly");
}
/* ---------------------------------------------------------------------- */
void ReadData::impropers()
{
int i,m,nchunk;
bigint nread = 0;
bigint nimpropers = atom->nimpropers;
while (nread < nimpropers) {
nchunk = MIN(nimpropers-nread,CHUNK);
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < nchunk; i++) {
eof = fgets(&buffer[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buffer[m]);
}
m++;
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buffer,m,MPI_CHAR,0,world);
atom->data_impropers(nchunk,buffer);
nread += nchunk;
}
// check that impropers were assigned correctly
int nlocal = atom->nlocal;
bigint sum;
bigint n = 0;
for (i = 0; i < nlocal; i++) n += atom->num_improper[i];
MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
int factor = 1;
if (!force->newton_bond) factor = 4;
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " impropers\n",sum/factor);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " impropers\n",sum/factor);
}
if (sum != factor*atom->nimpropers)
error->all(FLERR,"Impropers assigned incorrectly");
}
/* ---------------------------------------------------------------------- */
void ReadData::mass()
{
int i,m;
char *buf = new char[atom->ntypes*MAXLINE];
char *original = buf;
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < atom->ntypes; i++) {
eof = fgets(&buf[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buf[m]);
buf[m-1] = '\0';
}
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buf,m,MPI_CHAR,0,world);
for (i = 0; i < atom->ntypes; i++) {
atom->set_mass(buf);
buf += strlen(buf) + 1;
}
delete [] original;
}
/* ---------------------------------------------------------------------- */
void ReadData::paircoeffs()
{
int i,m;
char *buf = new char[atom->ntypes*MAXLINE];
char *original = buf;
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < atom->ntypes; i++) {
eof = fgets(&buf[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buf[m]);
buf[m-1] = '\0';
}
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buf,m,MPI_CHAR,0,world);
for (i = 0; i < atom->ntypes; i++) {
m = strlen(buf) + 1;
parse_coeffs(buf,NULL,1);
force->pair->coeff(narg,arg);
buf += m;
}
delete [] original;
}
/* ---------------------------------------------------------------------- */
void ReadData::bondcoeffs()
{
int i,m;
char *buf = new char[atom->nbondtypes*MAXLINE];
char *original = buf;
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < atom->nbondtypes; i++) {
eof = fgets(&buf[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buf[m]);
buf[m-1] = '\0';
}
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buf,m,MPI_CHAR,0,world);
for (i = 0; i < atom->nbondtypes; i++) {
m = strlen(buf) + 1;
parse_coeffs(buf,NULL,0);
force->bond->coeff(narg,arg);
buf += m;
}
delete [] original;
}
/* ---------------------------------------------------------------------- */
void ReadData::anglecoeffs(int which)
{
int i,m;
char *buf = new char[atom->nangletypes*MAXLINE];
char *original = buf;
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < atom->nangletypes; i++) {
eof = fgets(&buf[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buf[m]);
buf[m-1] = '\0';
}
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buf,m,MPI_CHAR,0,world);
for (i = 0; i < atom->nangletypes; i++) {
m = strlen(buf) + 1;
if (which == 0) parse_coeffs(buf,NULL,0);
else if (which == 1) parse_coeffs(buf,"bb",0);
else if (which == 2) parse_coeffs(buf,"ba",0);
force->angle->coeff(narg,arg);
buf += m;
}
delete [] original;
}
/* ---------------------------------------------------------------------- */
void ReadData::dihedralcoeffs(int which)
{
int i,m;
char *buf = new char[atom->ndihedraltypes*MAXLINE];
char *original = buf;
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < atom->ndihedraltypes; i++) {
eof = fgets(&buf[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buf[m]);
buf[m-1] = '\0';
}
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buf,m,MPI_CHAR,0,world);
for (i = 0; i < atom->ndihedraltypes; i++) {
m = strlen(buf) + 1;
if (which == 0) parse_coeffs(buf,NULL,0);
else if (which == 1) parse_coeffs(buf,"mbt",0);
else if (which == 2) parse_coeffs(buf,"ebt",0);
else if (which == 3) parse_coeffs(buf,"at",0);
else if (which == 4) parse_coeffs(buf,"aat",0);
else if (which == 5) parse_coeffs(buf,"bb13",0);
force->dihedral->coeff(narg,arg);
buf += m;
}
delete [] original;
}
/* ---------------------------------------------------------------------- */
void ReadData::impropercoeffs(int which)
{
int i,m;
char *buf = new char[atom->nimpropertypes*MAXLINE];
char *original = buf;
if (me == 0) {
char *eof;
m = 0;
for (i = 0; i < atom->nimpropertypes; i++) {
eof = fgets(&buf[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
m += strlen(&buf[m]);
buf[m-1] = '\0';
}
}
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buf,m,MPI_CHAR,0,world);
for (i = 0; i < atom->nimpropertypes; i++) {
m = strlen(buf) + 1;
if (which == 0) parse_coeffs(buf,NULL,0);
else if (which == 1) parse_coeffs(buf,"aa",0);
force->improper->coeff(narg,arg);
buf += m;
}
delete [] original;
}
/* ----------------------------------------------------------------------
proc 0 scans the data file for topology maximums
------------------------------------------------------------------------- */
void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
int &dihedral_per_atom, int &improper_per_atom)
{
int i,tmp1,tmp2,atom1,atom2,atom3,atom4;
char *eof;
if (atom->natoms > MAXSMALLINT)
error->all(FLERR,"Molecular data file has too many atoms");
// customize for new sections
int natoms = static_cast<int> (atom->natoms);
bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0;
int ellipsoid_flag = 0;
int line_flag = 0;
int tri_flag = 0;
// customize for new sections
// allocate topology counting vector
// initially, array length = 1 to natoms
// will grow via reallocate() if atom IDs > natoms
int cmax = natoms + 1;
int *count;
memory->create(count,cmax,"read_data:count");
while (strlen(keyword)) {
if (strcmp(keyword,"Masses") == 0) skip_lines(atom->ntypes);
else if (strcmp(keyword,"Atoms") == 0) skip_lines(natoms);
else if (strcmp(keyword,"Velocities") == 0) skip_lines(natoms);
else if (strcmp(keyword,"Ellipsoids") == 0) {
if (!avec_ellipsoid)
error->all(FLERR,"Invalid data file section: Ellipsoids");
ellipsoid_flag = 1;
skip_lines(nellipsoids);
} else if (strcmp(keyword,"Lines") == 0) {
if (!avec_line) error->all(FLERR,"Invalid data file section: Lines");
line_flag = 1;
skip_lines(nlines);
} else if (strcmp(keyword,"Triangles") == 0) {
if (!avec_tri) error->all(FLERR,"Invalid data file section: Triangles");
tri_flag = 1;
skip_lines(ntris);
} else if (strcmp(keyword,"Pair Coeffs") == 0) {
if (force->pair == NULL)
error->all(FLERR,"Must define pair_style before Pair Coeffs");
skip_lines(atom->ntypes);
} else if (strcmp(keyword,"Bond Coeffs") == 0) {
if (atom->avec->bonds_allow == 0)
error->all(FLERR,"Invalid data file section: Bond Coeffs");
if (force->bond == NULL)
error->all(FLERR,"Must define bond_style before Bond Coeffs");
skip_lines(atom->nbondtypes);
} else if (strcmp(keyword,"Angle Coeffs") == 0) {
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Invalid data file section: Angle Coeffs");
if (force->angle == NULL)
error->all(FLERR,"Must define angle_style before Angle Coeffs");
skip_lines(atom->nangletypes);
} else if (strcmp(keyword,"Dihedral Coeffs") == 0) {
skip_lines(atom->ndihedraltypes);
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: Dihedral Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,"Must define dihedral_style before Dihedral Coeffs");
} else if (strcmp(keyword,"Improper Coeffs") == 0) {
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Invalid data file section: Improper Coeffs");
if (force->improper == NULL)
error->all(FLERR,"Must define improper_style before Improper Coeffs");
skip_lines(atom->nimpropertypes);
} else if (strcmp(keyword,"BondBond Coeffs") == 0) {
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Invalid data file section: BondBond Coeffs");
if (force->angle == NULL)
error->all(FLERR,"Must define angle_style before BondBond Coeffs");
skip_lines(atom->nangletypes);
} else if (strcmp(keyword,"BondAngle Coeffs") == 0) {
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Invalid data file section: BondAngle Coeffs");
if (force->angle == NULL)
error->all(FLERR,"Must define angle_style before BondAngle Coeffs");
skip_lines(atom->nangletypes);
} else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: MiddleBondTorsion Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before "
"MiddleBondTorsion Coeffs");
skip_lines(atom->ndihedraltypes);
} else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before EndBondTorsion Coeffs");
skip_lines(atom->ndihedraltypes);
} else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: AngleTorsion Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before AngleTorsion Coeffs");
skip_lines(atom->ndihedraltypes);
} else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: AngleAngleTorsion Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before "
"AngleAngleTorsion Coeffs");
skip_lines(atom->ndihedraltypes);
} else if (strcmp(keyword,"BondBond13 Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: BondBond13 Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,"Must define dihedral_style before BondBond13 Coeffs");
skip_lines(atom->ndihedraltypes);
} else if (strcmp(keyword,"AngleAngle Coeffs") == 0) {
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Invalid data file section: AngleAngle Coeffs");
if (force->improper == NULL)
error->all(FLERR,"Must define improper_style before AngleAngle Coeffs");
skip_lines(atom->nimpropertypes);
} else if (strcmp(keyword,"Bonds") == 0) {
for (i = 1; i < cmax; i++) count[i] = 0;
if (force->newton_bond)
for (i = 0; i < atom->nbonds; i++) {
eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
sscanf(line,"%d %d %d %d",&tmp1,&tmp2,&atom1,&atom2);
if (atom1 >= cmax) cmax = reallocate(&count,cmax,atom1);
count[atom1]++;
}
else
for (i = 0; i < atom->nbonds; i++) {
eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
sscanf(line,"%d %d %d %d",&tmp1,&tmp2,&atom1,&atom2);
int amax = MAX(atom1,atom2);
if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
count[atom1]++;
count[atom2]++;
}
for (i = 1; i < cmax; i++) bond_per_atom = MAX(bond_per_atom,count[i]);
if (screen) fprintf(screen," %d = max bonds/atom\n",bond_per_atom);
if (logfile) fprintf(logfile," %d = max bonds/atom\n",bond_per_atom);
} else if (strcmp(keyword,"Angles") == 0) {
for (i = 1; i < cmax; i++) count[i] = 0;
if (force->newton_bond)
for (i = 0; i < atom->nangles; i++) {
eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
sscanf(line,"%d %d %d %d %d",&tmp1,&tmp2,&atom1,&atom2,&atom3);
if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
count[atom2]++;
}
else
for (i = 0; i < atom->nangles; i++) {
eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
sscanf(line,"%d %d %d %d %d",&tmp1,&tmp2,&atom1,&atom2,&atom3);
int amax = MAX(atom1,atom2);
amax = MAX(amax,atom3);
if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
count[atom1]++;
count[atom2]++;
count[atom3]++;
}
for (i = 1; i < cmax; i++) angle_per_atom = MAX(angle_per_atom,count[i]);
if (screen) fprintf(screen," %d = max angles/atom\n",angle_per_atom);
if (logfile) fprintf(logfile," %d = max angles/atom\n",angle_per_atom);
} else if (strcmp(keyword,"Dihedrals") == 0) {
for (i = 1; i < cmax; i++) count[i] = 0;
if (force->newton_bond)
for (i = 0; i < atom->ndihedrals; i++) {
eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
sscanf(line,"%d %d %d %d %d %d",
&tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
count[atom2]++;
}
else
for (i = 0; i < atom->ndihedrals; i++) {
eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
sscanf(line,"%d %d %d %d %d %d",
&tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
int amax = MAX(atom1,atom2);
amax = MAX(amax,atom3);
amax = MAX(amax,atom4);
if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
count[atom1]++;
count[atom2]++;
count[atom3]++;
count[atom4]++;
}
for (i = 1; i < cmax; i++)
dihedral_per_atom = MAX(dihedral_per_atom,count[i]);
if (screen)
fprintf(screen," %d = max dihedrals/atom\n",dihedral_per_atom);
if (logfile)
fprintf(logfile," %d = max dihedrals/atom\n",dihedral_per_atom);
} else if (strcmp(keyword,"Impropers") == 0) {
for (i = 1; i < cmax; i++) count[i] = 0;
if (force->newton_bond)
for (i = 0; i < atom->nimpropers; i++) {
eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
sscanf(line,"%d %d %d %d %d %d",
&tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
count[atom2]++;
}
else
for (i = 0; i < atom->nimpropers; i++) {
eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
sscanf(line,"%d %d %d %d %d %d",
&tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
int amax = MAX(atom1,atom2);
amax = MAX(amax,atom3);
amax = MAX(amax,atom4);
if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
count[atom1]++;
count[atom2]++;
count[atom3]++;
count[atom4]++;
}
for (i = 1; i < cmax; i++)
improper_per_atom = MAX(improper_per_atom,count[i]);
if (screen)
fprintf(screen," %d = max impropers/atom\n",improper_per_atom);
if (logfile)
fprintf(logfile," %d = max impropers/atom\n",improper_per_atom);
} else {
char str[128];
sprintf(str,"Unknown identifier in data file: %s",keyword);
error->one(FLERR,str);
}
parse_keyword(0,0);
}
// free topology counting vector
memory->destroy(count);
// error check that topology was specified in file
if ((atom->nbonds && !bond_per_atom) ||
(atom->nangles && !angle_per_atom) ||
(atom->ndihedrals && !dihedral_per_atom) ||
(atom->nimpropers && !improper_per_atom))
error->one(FLERR,"Needed topology not in data file");
// customize for new sections
// error check that Bonus sections were speficied in file
if (nellipsoids && !ellipsoid_flag)
error->one(FLERR,"Needed bonus data not in data file");
if (nlines && !line_flag)
error->one(FLERR,"Needed bonus data not in data file");
if (ntris && !tri_flag)
error->one(FLERR,"Needed bonus data not in data file");
}
/* ----------------------------------------------------------------------
reallocate the count vector from cmax to amax+1 and return new length
zero new locations
------------------------------------------------------------------------- */
int ReadData::reallocate(int **pcount, int cmax, int amax)
{
int *count = *pcount;
memory->grow(count,amax+1,"read_data:count");
for (int i = cmax; i <= amax; i++) count[i] = 0;
*pcount = count;
return amax+1;
}
/* ----------------------------------------------------------------------
proc 0 opens data file
test if gzipped
------------------------------------------------------------------------- */
void ReadData::open(char *file)
{
compressed = 0;
char *suffix = file + strlen(file) - 3;
if (suffix > file && strcmp(suffix,".gz") == 0) compressed = 1;
if (!compressed) fp = fopen(file,"r");
else {
#ifdef LAMMPS_GZIP
char gunzip[128];
sprintf(gunzip,"gunzip -c %s",file);
fp = popen(gunzip,"r");
#else
error->one(FLERR,"Cannot open gzipped file");
#endif
}
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open file %s",file);
error->one(FLERR,str);
}
}
/* ----------------------------------------------------------------------
grab next keyword
read lines until one is non-blank
keyword is all text on line w/out leading & trailing white space
read one additional line (assumed blank)
if any read hits EOF, set keyword to empty
if first = 1, line variable holds non-blank line that ended header
if flag = 0, only proc 0 is calling so no bcast
else flag = 1, bcast keyword line to all procs
------------------------------------------------------------------------- */
void ReadData::parse_keyword(int first, int flag)
{
int eof = 0;
// proc 0 reads upto non-blank line plus 1 following line
// eof is set to 1 if any read hits end-of-file
if (me == 0) {
if (!first) {
if (fgets(line,MAXLINE,fp) == NULL) eof = 1;
}
while (eof == 0 && strspn(line," \t\n\r") == strlen(line)) {
if (fgets(line,MAXLINE,fp) == NULL) eof = 1;
}
if (fgets(buffer,MAXLINE,fp) == NULL) eof = 1;
}
// if eof, set keyword empty and return
if (flag) MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) {
keyword[0] = '\0';
return;
}
// bcast keyword line to all procs
if (flag) {
int n;
if (me == 0) n = strlen(line) + 1;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
}
// copy non-whitespace portion of line into keyword
int start = strspn(line," \t\n\r");
int stop = strlen(line) - 1;
while (line[stop] == ' ' || line[stop] == '\t'
|| line[stop] == '\n' || line[stop] == '\r') stop--;
line[stop+1] = '\0';
strcpy(keyword,&line[start]);
}
/* ----------------------------------------------------------------------
proc 0 reads N lines from file
------------------------------------------------------------------------- */
void ReadData::skip_lines(int n)
{
char *eof;
for (int i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
}
/* ----------------------------------------------------------------------
parse a line of coeffs into words, storing them in narg,arg
trim anything from '#' onward
word strings remain in line, are not copied
if addstr != NULL, add addstr as extra arg for class2 angle/dihedral/improper
if 2nd word starts with letter, then is hybrid style, add addstr after it
else add addstr before 2nd word
if dupflag, duplicate 1st word, so pair_coeff "2" becomes "2 2"
------------------------------------------------------------------------- */
-void ReadData::parse_coeffs(char *line, char *addstr, int dupflag)
+void ReadData::parse_coeffs(char *line, const char *addstr, int dupflag)
{
char *ptr;
if (ptr = strchr(line,'#')) *ptr = '\0';
narg = 0;
char *word = strtok(line," \t\n\r\f");
while (word) {
if (narg == maxarg) {
maxarg += DELTA;
arg = (char **)
memory->srealloc(arg,maxarg*sizeof(char *),"read_data:arg");
}
- if (addstr && narg == 1 && !islower(word[0])) arg[narg++] = addstr;
+ if (addstr && narg == 1 && !islower(word[0])) arg[narg++] = (char *) addstr;
arg[narg++] = word;
- if (addstr && narg == 2 && islower(word[0])) arg[narg++] = addstr;
+ if (addstr && narg == 2 && islower(word[0])) arg[narg++] = (char *) addstr;
if (dupflag && narg == 1) arg[narg++] = word;
word = strtok(NULL," \t\n\r\f");
}
}
diff --git a/src/read_data.h b/src/read_data.h
index 67398469c..9ef79f706 100644
--- a/src/read_data.h
+++ b/src/read_data.h
@@ -1,76 +1,390 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(read_data,ReadData)
#else
#ifndef LMP_READ_DATA_H
#define LMP_READ_DATA_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class ReadData : protected Pointers {
public:
ReadData(class LAMMPS *);
~ReadData();
void command(int, char **);
private:
int me;
char *line,*keyword,*buffer;
FILE *fp;
int narg,maxarg,compressed;
char **arg;
bigint nellipsoids;
class AtomVecEllipsoid *avec_ellipsoid;
bigint nlines;
class AtomVecLine *avec_line;
bigint ntris;
class AtomVecTri *avec_tri;
void open(char *);
void scan(int &, int &, int &, int &);
int reallocate(int **, int, int);
void header(int);
void parse_keyword(int, int);
void skip_lines(int);
- void parse_coeffs(char *, char *, int);
+ void parse_coeffs(char *, const char *, int);
void atoms();
void velocities();
- void bonus(bigint, class AtomVec *, char *);
+ void bonus(bigint, class AtomVec *, const char *);
void bonds();
void angles();
void dihedrals();
void impropers();
void mass();
void paircoeffs();
void bondcoeffs();
void anglecoeffs(int);
void dihedralcoeffs(int);
void impropercoeffs(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot read_data after simulation box is defined
+
+The read_data command cannot be used after a read_data,
+read_restart, or create_box command.
+
+E: Cannot run 2d simulation with nonperiodic Z dimension
+
+Use the boundary command to make the z dimension periodic in order to
+run a 2d simulation.
+
+E: Must read Atoms before Velocities
+
+The Atoms section of a data file must come before a Velocities
+section.
+
+E: Invalid data file section: Ellipsoids
+
+UNDOCUMENTED
+
+E: Must read Atoms before Ellipsoids
+
+UNDOCUMENTED
+
+E: Invalid data file section: Lines
+
+UNDOCUMENTED
+
+E: Must read Atoms before Lines
+
+UNDOCUMENTED
+
+E: Invalid data file section: Triangles
+
+UNDOCUMENTED
+
+E: Must read Atoms before Triangles
+
+UNDOCUMENTED
+
+E: Invalid data file section: Bonds
+
+Atom style does not allow bonds.
+
+E: Must read Atoms before Bonds
+
+The Atoms section of a data file must come before a Bonds section.
+
+E: Invalid data file section: Angles
+
+Atom style does not allow angles.
+
+E: Must read Atoms before Angles
+
+The Atoms section of a data file must come before an Angles section.
+
+E: Invalid data file section: Dihedrals
+
+Atom style does not allow dihedrals.
+
+E: Must read Atoms before Dihedrals
+
+The Atoms section of a data file must come before a Dihedrals section.
+
+E: Invalid data file section: Impropers
+
+Atom style does not allow impropers.
+
+E: Must read Atoms before Impropers
+
+The Atoms section of a data file must come before an Impropers
+section.
+
+E: Must define pair_style before Pair Coeffs
+
+Must use a pair_style command before reading a data file that defines
+Pair Coeffs.
+
+E: Invalid data file section: Bond Coeffs
+
+Atom style does not allow bonds.
+
+E: Must define bond_style before Bond Coeffs
+
+Must use a bond_style command before reading a data file that
+defines Bond Coeffs.
+
+E: Invalid data file section: Angle Coeffs
+
+Atom style does not allow angles.
+
+E: Must define angle_style before Angle Coeffs
+
+Must use an angle_style command before reading a data file that
+defines Angle Coeffs.
+
+E: Invalid data file section: Dihedral Coeffs
+
+Atom style does not allow dihedrals.
+
+E: Must define dihedral_style before Dihedral Coeffs
+
+Must use a dihedral_style command before reading a data file that
+defines Dihedral Coeffs.
+
+E: Invalid data file section: Improper Coeffs
+
+Atom style does not allow impropers.
+
+E: Must define improper_style before Improper Coeffs
+
+Must use an improper_style command before reading a data file that
+defines Improper Coeffs.
+
+E: Invalid data file section: BondBond Coeffs
+
+Atom style does not allow angles.
+
+E: Must define angle_style before BondBond Coeffs
+
+Must use an angle_style command before reading a data file that
+defines Angle Coeffs.
+
+E: Invalid data file section: BondAngle Coeffs
+
+Atom style does not allow angles.
+
+E: Must define angle_style before BondAngle Coeffs
+
+Must use an angle_style command before reading a data file that
+defines Angle Coeffs.
+
+E: Invalid data file section: MiddleBondTorsion Coeffs
+
+Atom style does not allow dihedrals.
+
+E: Must define dihedral_style before MiddleBondTorsion Coeffs
+
+Must use a dihedral_style command before reading a data file that
+defines MiddleBondTorsion Coeffs.
+
+E: Invalid data file section: EndBondTorsion Coeffs
+
+Atom style does not allow dihedrals.
+
+E: Must define dihedral_style before EndBondTorsion Coeffs
+
+Must use a dihedral_style command before reading a data file that
+defines EndBondTorsion Coeffs.
+
+E: Invalid data file section: AngleTorsion Coeffs
+
+Atom style does not allow dihedrals.
+
+E: Must define dihedral_style before AngleTorsion Coeffs
+
+Must use a dihedral_style command before reading a data file that
+defines AngleTorsion Coeffs.
+
+E: Invalid data file section: AngleAngleTorsion Coeffs
+
+Atom style does not allow dihedrals.
+
+E: Must define dihedral_style before AngleAngleTorsion Coeffs
+
+Must use a dihedral_style command before reading a data file that
+defines AngleAngleTorsion Coeffs.
+
+E: Invalid data file section: BondBond13 Coeffs
+
+Atom style does not allow dihedrals.
+
+E: Must define dihedral_style before BondBond13 Coeffs
+
+Must use a dihedral_style command before reading a data file that
+defines BondBond13 Coeffs.
+
+E: Invalid data file section: AngleAngle Coeffs
+
+Atom style does not allow impropers.
+
+E: Must define improper_style before AngleAngle Coeffs
+
+Must use an improper_style command before reading a data file that
+defines AngleAngle Coeffs.
+
+E: Unknown identifier in data file: %s
+
+A section of the data file cannot be read by LAMMPS.
+
+E: No atoms in data file
+
+The header of the data file indicated that atoms would be included,
+but they were not present.
+
+E: Unexpected end of data file
+
+LAMMPS hit the end of the data file while attempting to read a
+section. Something is wrong with the format of the data file.
+
+E: No ellipsoids allowed with this atom style
+
+UNDOCUMENTED
+
+E: No lines allowed with this atom style
+
+UNDOCUMENTED
+
+E: No triangles allowed with this atom style
+
+UNDOCUMENTED
+
+E: System in data file is too big
+
+See the setting for bigint in the src/lmptype.h file.
+
+E: No bonds allowed with this atom style
+
+Self-explanatory. Check data file.
+
+E: No angles allowed with this atom style
+
+Self-explanatory. Check data file.
+
+E: No dihedrals allowed with this atom style
+
+Self-explanatory. Check data file.
+
+E: No impropers allowed with this atom style
+
+Self-explanatory. Check data file.
+
+E: Bonds defined but no bond types
+
+The data file header lists bonds but no bond types.
+
+E: Angles defined but no angle types
+
+The data file header lists angles but no angle types.
+
+E: Dihedrals defined but no dihedral types
+
+The data file header lists dihedrals but no dihedral types.
+
+E: Impropers defined but no improper types
+
+The data file header lists improper but no improper types.
+
+E: Did not assign all atoms correctly
+
+Atoms read in from a data file were not assigned correctly to
+processors. This is likely due to some atom coordinates being
+outside a non-periodic simulation box.
+
+E: Invalid atom ID in Atoms section of data file
+
+Atom IDs must be positive integers.
+
+E: Bonds assigned incorrectly
+
+Bonds read in from the data file were not assigned correctly to atoms.
+This means there is something invalid about the topology definitions.
+
+E: Angles assigned incorrectly
+
+Angles read in from the data file were not assigned correctly to
+atoms. This means there is something invalid about the topology
+definitions.
+
+E: Dihedrals assigned incorrectly
+
+Dihedrals read in from the data file were not assigned correctly to
+atoms. This means there is something invalid about the topology
+definitions.
+
+E: Impropers assigned incorrectly
+
+Impropers read in from the data file were not assigned correctly to
+atoms. This means there is something invalid about the topology
+definitions.
+
+E: Molecular data file has too many atoms
+
+These kids of data files are currently limited to a number
+of atoms that fits in a 32-bit integer.
+
+E: Needed topology not in data file
+
+The header of the data file indicated that bonds or angles or
+dihedrals or impropers would be included, but they were not present.
+
+E: Needed bonus data not in data file
+
+UNDOCUMENTED
+
+E: Cannot open gzipped file
+
+LAMMPS is attempting to open a gzipped version of the specified file
+but was unsuccessful. Check that the path and name are correct.
+
+E: Cannot open file %s
+
+The specified file cannot be opened. Check that the path and name are
+correct.
+
+*/
diff --git a/src/read_restart.h b/src/read_restart.h
index 162fb085f..14c1131bd 100644
--- a/src/read_restart.h
+++ b/src/read_restart.h
@@ -1,52 +1,148 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(read_restart,ReadRestart)
#else
#ifndef LMP_READ_RESTART_H
#define LMP_READ_RESTART_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class ReadRestart : protected Pointers {
public:
ReadRestart(class LAMMPS *);
void command(int, char **);
private:
int me,nprocs,nprocs_file;
FILE *fp;
int nfix_restart_global,nfix_restart_peratom;
void file_search(char *, char *);
void header();
void type_arrays();
void force_fields();
int read_int();
double read_double();
char *read_char();
bigint read_bigint();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot read_restart after simulation box is defined
+
+The read_restart command cannot be used after a read_data,
+read_restart, or create_box command.
+
+E: Cannot open restart file %s
+
+Self-explanatory.
+
+E: Did not assign all atoms correctly
+
+Atoms read in from a data file were not assigned correctly to
+processors. This is likely due to some atom coordinates being
+outside a non-periodic simulation box.
+
+E: Cannot open dir to search for restart file
+
+Using a "*" in the name of the restart file will open the current
+directory to search for matching file names.
+
+E: Found no restart file matching pattern
+
+When using a "*" in the restart file name, no matching file was found.
+
+W: Restart file version does not match LAMMPS version
+
+This may cause problems when reading the restart file.
+
+E: Smallint setting in lmptype.h is not compatible
+
+Smallint stored in restart file is not consistent with LAMMPS version
+you are running.
+
+E: Tagint setting in lmptype.h is not compatible
+
+Smallint stored in restart file is not consistent with LAMMPS version
+you are running.
+
+E: Bigint setting in lmptype.h is not compatible
+
+Bigint stored in restart file is not consistent with LAMMPS version
+you are running.
+
+E: Cannot run 2d simulation with nonperiodic Z dimension
+
+Use the boundary command to make the z dimension periodic in order to
+run a 2d simulation.
+
+W: Restart file used different # of processors
+
+The restart file was written out by a LAMMPS simulation running on a
+different number of processors. Due to round-off, the trajectories of
+your restarted simulation may diverge a little more quickly than if
+you ran on the same # of processors.
+
+W: Restart file used different 3d processor grid
+
+The restart file was written out by a LAMMPS simulation running on a
+different 3d grid of processors. Due to round-off, the trajectories
+of your restarted simulation may diverge a little more quickly than if
+you ran on the same # of processors.
+
+W: Restart file used different newton pair setting, using input script value
+
+The input script value will override the setting in the restart file.
+
+W: Restart file used different newton bond setting, using restart file value
+
+The restart file value will override the setting in the input script.
+
+W: Restart file used different boundary settings, using restart file values
+
+Your input script cannot change these restart file settings.
+
+E: Invalid flag in header section of restart file
+
+Unrecognized entry in restart file.
+
+E: Invalid flag in type arrays section of restart file
+
+Unrecognized entry in restart file.
+
+E: Invalid flag in force field section of restart file
+
+Unrecognized entry in restart file.
+
+*/
diff --git a/src/region.h b/src/region.h
index c0b55daa1..7a61f9b7b 100644
--- a/src/region.h
+++ b/src/region.h
@@ -1,72 +1,107 @@
/* ----------------------------------------------------------------------
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_REGION_H
#define LMP_REGION_H
#include "pointers.h"
namespace LAMMPS_NS {
class Region : protected Pointers {
public:
char *id,*style;
int interior; // 1 for interior, 0 for exterior
int scaleflag; // 1 for lattice, 0 for box
double xscale,yscale,zscale; // scale factors for box/lattice units
double extent_xlo,extent_xhi; // bounding box on region
double extent_ylo,extent_yhi;
double extent_zlo,extent_zhi;
int bboxflag; // 1 if bounding box is computable
// contact = particle near region surface
struct Contact {
double r; // distance between particle & surf, r > 0.0
double delx,dely,delz; // vector from surface pt to particle
};
Contact *contact; // list of contacts
int cmax; // max # of contacts possible with region
Region(class LAMMPS *, int, char **);
virtual ~Region();
void init();
virtual int dynamic_check();
int match(double, double, double);
int surface(double, double, double, double);
virtual int inside(double, double, double) = 0;
virtual int surface_interior(double *, double) = 0;
virtual int surface_exterior(double *, double) = 0;
protected:
void add_contact(int, double *, double, double, double);
void options(int, char **);
private:
int dynamic; // 1 if region changes over time
int moveflag,rotateflag;
double point[3],axis[3],runit[3];
char *xstr,*ystr,*zstr,*tstr;
int xvar,yvar,zvar,tvar;
double dx,dy,dz,theta;
bigint laststep;
void forward_transform(double &, double &, double &);
void inverse_transform(double &, double &, double &);
void rotate(double &, double &, double &, double);
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Variable name for region does not exist
+
+Self-explanatory.
+
+E: Variable for region is invalid style
+
+Only equal-style variables can be used.
+
+E: Variable for region is not equal style
+
+Self-explanatory.
+
+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: Region union or intersect cannot be dynamic
+
+The sub-regions can be dynamic, but not the combined region.
+
+E: Use of region with undefined lattice
+
+If scale = lattice (the default) for the region command, then a
+lattice must first be defined via the lattice command.
+
+E: Region cannot have 0 length rotation vector
+
+Self-explanatory.
+
+*/
diff --git a/src/region_block.h b/src/region_block.h
index c8726fd56..3376ce80d 100644
--- a/src/region_block.h
+++ b/src/region_block.h
@@ -1,45 +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 REGION_CLASS
RegionStyle(block,RegBlock)
#else
#ifndef LMP_REGION_BLOCK_H
#define LMP_REGION_BLOCK_H
#include "region.h"
namespace LAMMPS_NS {
class RegBlock : public Region {
friend class FixPour;
friend class FixPourOMP;
public:
RegBlock(class LAMMPS *, int, char **);
~RegBlock();
int inside(double, double, double);
int surface_interior(double *, double);
int surface_exterior(double *, double);
private:
double xlo,xhi,ylo,yhi,zlo,zhi;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Cannot use region INF or EDGE when box does not exist
+
+Regions that extend to the box boundaries can only be used after the
+create_box command has been used.
+
+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.
+
+*/
diff --git a/src/region_cone.h b/src/region_cone.h
index 96121ec03..782ebf2b3 100644
--- a/src/region_cone.h
+++ b/src/region_cone.h
@@ -1,52 +1,67 @@
/* ----------------------------------------------------------------------
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 REGION_CLASS
RegionStyle(cone,RegCone)
#else
#ifndef LMP_REGION_CONE_H
#define LMP_REGION_CONE_H
#include "region.h"
namespace LAMMPS_NS {
class RegCone : public Region {
public:
RegCone(class LAMMPS *, int, char **);
~RegCone();
int inside(double, double, double);
int surface_interior(double *, double);
int surface_exterior(double *, double);
private:
char axis;
double c1,c2;
double radiuslo,radiushi;
double lo,hi;
double maxradius;
void point_on_line_segment(double *, double *, double *, double *);
double closest(double *, double *, double *, double);
void subtract(double *, double *, double *);
double dotproduct(double *, double *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot use region INF or EDGE when box does not exist
+
+Regions that extend to the box boundaries can only be used after the
+create_box command has been used.
+
+*/
diff --git a/src/region_cylinder.h b/src/region_cylinder.h
index 7ada338cf..85313a3d7 100644
--- a/src/region_cylinder.h
+++ b/src/region_cylinder.h
@@ -1,48 +1,63 @@
/* ----------------------------------------------------------------------
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 REGION_CLASS
RegionStyle(cylinder,RegCylinder)
#else
#ifndef LMP_REGION_CYLINDER_H
#define LMP_REGION_CYLINDER_H
#include "region.h"
namespace LAMMPS_NS {
class RegCylinder : public Region {
friend class FixPour;
friend class FixPourOMP;
public:
RegCylinder(class LAMMPS *, int, char **);
~RegCylinder();
int inside(double, double, double);
int surface_interior(double *, double);
int surface_exterior(double *, double);
private:
char axis;
double c1,c2;
double radius;
double lo,hi;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Cannot use region INF or EDGE when box does not exist
+
+Regions that extend to the box boundaries can only be used after the
+create_box command has been used.
+
+*/
diff --git a/src/region_intersect.h b/src/region_intersect.h
index af16601bf..c5ad1a0b0 100644
--- a/src/region_intersect.h
+++ b/src/region_intersect.h
@@ -1,44 +1,58 @@
/* ----------------------------------------------------------------------
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 REGION_CLASS
RegionStyle(intersect,RegIntersect)
#else
#ifndef LMP_REGION_INTERSECT_H
#define LMP_REGION_INTERSECT_H
#include "region.h"
namespace LAMMPS_NS {
class RegIntersect : public Region {
public:
RegIntersect(class LAMMPS *, int, char **);
~RegIntersect();
int dynamic_check();
int inside(double, double, double);
int surface_interior(double *, double);
int surface_exterior(double *, double);
private:
int nregion;
int *list;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Region intersect region ID does not exist
+
+Self-explanatory.
+
+*/
diff --git a/src/region_plane.h b/src/region_plane.h
index 9dadd9307..8443a4c55 100644
--- a/src/region_plane.h
+++ b/src/region_plane.h
@@ -1,43 +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 REGION_CLASS
RegionStyle(plane,RegPlane)
#else
#ifndef LMP_REGION_PLANE_H
#define LMP_REGION_PLANE_H
#include "region.h"
namespace LAMMPS_NS {
class RegPlane : public Region {
public:
RegPlane(class LAMMPS *, int, char **);
~RegPlane();
int inside(double, double, double);
int surface_interior(double *, double);
int surface_exterior(double *, double);
private:
double xp,yp,zp;
double normal[3];
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/region_prism.h b/src/region_prism.h
index fc3caf54b..01f813c5f 100644
--- a/src/region_prism.h
+++ b/src/region_prism.h
@@ -1,62 +1,77 @@
/* ----------------------------------------------------------------------
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 REGION_CLASS
RegionStyle(prism,RegPrism)
#else
#ifndef LMP_REGION_PRISM_H
#define LMP_REGION_PRISM_H
#include "region.h"
namespace LAMMPS_NS {
class RegPrism : public Region {
friend class CreateBox;
public:
RegPrism(class LAMMPS *, int, char **);
~RegPrism();
int inside(double, double, double);
int surface_interior(double *, double);
int surface_exterior(double *, double);
private:
double xlo,xhi,ylo,yhi,zlo,zhi;
double xy,xz,yz;
double h[3][3],hinv[3][3];
int dimension;
double a[3],b[3],c[3]; // edge vectors of region
double clo[3],chi[3]; // opposite corners of prism
double face[6][3]; // unit normals of 6 prism faces
double corners[8][3]; // 8 corner pts of prism
int tri[12][3]; // 3 corner pts of 12 triangles (2 per face)
void find_nearest(double *, double &, double &, double &);
int inside_tri(double *, double *, double *, double *, double *);
void point_on_line_segment(double *, double *, double *, double *);
double closest(double *, double *, double *, double);
void subtract(double *, double *, double *);
void cross(double *, double *, double *);
double dotproduct(double *, double *);
void normalize(double *);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Cannot use region INF or EDGE when box does not exist
+
+Regions that extend to the box boundaries can only be used after the
+create_box command has been used.
+
+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.
+
+*/
diff --git a/src/region_sphere.h b/src/region_sphere.h
index 46c990b7d..53bbafd44 100644
--- a/src/region_sphere.h
+++ b/src/region_sphere.h
@@ -1,43 +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 REGION_CLASS
RegionStyle(sphere,RegSphere)
#else
#ifndef LMP_REGION_SPHERE_H
#define LMP_REGION_SPHERE_H
#include "region.h"
namespace LAMMPS_NS {
class RegSphere : public Region {
public:
RegSphere(class LAMMPS *, int, char **);
~RegSphere();
int inside(double, double, double);
int surface_interior(double *, double);
int surface_exterior(double *, double);
private:
double xc,yc,zc;
double radius;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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.
+
+*/
diff --git a/src/region_union.h b/src/region_union.h
index 8e09d638a..aace98bfc 100644
--- a/src/region_union.h
+++ b/src/region_union.h
@@ -1,44 +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.
------------------------------------------------------------------------- */
#ifdef REGION_CLASS
RegionStyle(union,RegUnion)
#else
#ifndef LMP_REGION_UNION_H
#define LMP_REGION_UNION_H
#include "region.h"
namespace LAMMPS_NS {
class RegUnion : public Region {
public:
RegUnion(class LAMMPS *, int, char **);
~RegUnion();
int dynamic_check();
int inside(double, double, double);
int surface_interior(double *, double);
int surface_exterior(double *, double);
private:
int nregion;
int *list;
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Region union region ID does not exist
+
+One or more of the region IDs specified by the region union command
+does not exist.
+
+*/
diff --git a/src/replicate.h b/src/replicate.h
index db20f06e3..5c8f8eb96 100644
--- a/src/replicate.h
+++ b/src/replicate.h
@@ -1,36 +1,84 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(replicate,Replicate)
#else
#ifndef LMP_REPLICATE_H
#define LMP_REPLICATE_H
#include "pointers.h"
namespace LAMMPS_NS {
class Replicate : protected Pointers {
public:
Replicate(class LAMMPS *);
void command(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Replicate command before simulation box is defined
+
+The replicate command cannot be used before a read_data, read_restart,
+or create_box command.
+
+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: Cannot replicate 2d simulation in z dimension
+
+The replicate command cannot replicate a 2d simulation in the z
+dimension.
+
+W: Replicating in a non-periodic dimension
+
+The parameters for a replicate command will cause a non-periodic
+dimension to be replicated; this may cause unwanted behavior.
+
+E: Cannot replicate with fixes that store atom quantities
+
+Either fixes are defined that create and store atom-based vectors or a
+restart file was read which included atom-based vectors for fixes.
+The replicate command cannot duplicate that information for new atoms.
+You should use the replicate command before fixes are applied to the
+system.
+
+E: Replicated molecular system atom IDs are too big
+
+See the setting for the allowed atom ID size in the src/lmptype.h
+file.
+
+E: Replicated system is too big
+
+See the setting for bigint in the src/lmptype.h file.
+
+E: Replicate did not assign all atoms correctly
+
+Atoms replicated by the replicate command were not assigned correctly
+to processors. This is likely due to some atom coordinates being
+outside a non-periodic simulation box.
+
+*/
diff --git a/src/respa.h b/src/respa.h
index 409184c73..126a56cfc 100644
--- a/src/respa.h
+++ b/src/respa.h
@@ -1,70 +1,129 @@
/* ----------------------------------------------------------------------
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 INTEGRATE_CLASS
IntegrateStyle(respa,Respa)
#else
#ifndef LMP_RESPA_H
#define LMP_RESPA_H
#include "integrate.h"
namespace LAMMPS_NS {
class Respa : public Integrate {
public:
// public so Fixes, Pairs, Neighbor can see them
int nlevels; // number of rRESPA levels
// 0 = innermost level, nlevels-1 = outermost level
double *step; // timestep at each level
int *loop; // sub-cycling factor at each level
double cutoff[4]; // cutoff[0] and cutoff[1] = between inner and middle
// cutoff[2] and cutoff[3] = between middle and outer
// if no middle then 0,1 = 2,3
int level_bond,level_angle,level_dihedral; // level to compute forces at
int level_improper,level_pair,level_kspace;
int level_inner,level_middle,level_outer;
Respa(class LAMMPS *, int, char **);
~Respa();
void init();
void setup();
void setup_minimal(int);
void run(int);
void cleanup();
void reset_dt();
void copy_f_flevel(int);
void copy_flevel_f(int);
private:
int triclinic; // 0 if domain is orthog, 1 if triclinic
int torqueflag,erforceflag;
int e_flag,rho_flag;
int *newton; // newton flag at each level
class FixRespa *fix_respa; // Fix to store the force level array
void recurse(int);
void force_clear(int);
void sum_flevel_f();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Respa levels must be >= 1
+
+Self-explanatory.
+
+E: Cannot set both respa pair and inner/middle/outer
+
+In the rRESPA integrator, you must compute pairwise potentials either
+all together (pair), or in pieces (inner/middle/outer). You can't do
+both.
+
+E: Must set both respa inner and outer
+
+Cannot use just the inner or outer option with respa without using the
+other.
+
+E: Cannot set respa middle without inner/outer
+
+In the rRESPA integrator, you must define both a inner and outer
+setting in order to use a middle setting.
+
+E: Invalid order of forces within respa levels
+
+For respa, ordering of force computations within respa levels must
+obey certain rules. E.g. bonds cannot be compute less frequently than
+angles, pairwise forces cannot be computed less frequently than
+kspace, etc.
+
+W: One or more respa levels compute no forces
+
+This is computationally inefficient.
+
+E: Respa inner cutoffs are invalid
+
+The first cutoff must be <= the second cutoff.
+
+E: Respa middle cutoffs are invalid
+
+The first cutoff must be <= the second cutoff.
+
+W: No fixes defined, atoms won't move
+
+If you are not using a fix like nve, nvt, npt then atom velocities and
+coordinates will not be updated during timestepping.
+
+E: Pair style does not support rRESPA inner/middle/outer
+
+You are attempting to use rRESPA options with a pair style that
+does not support them.
+
+*/
diff --git a/src/run.h b/src/run.h
index e42f3b127..48224f3ec 100644
--- a/src/run.h
+++ b/src/run.h
@@ -1,36 +1,76 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(run,Run)
#else
#ifndef LMP_RUN_H
#define LMP_RUN_H
#include "pointers.h"
namespace LAMMPS_NS {
class Run : protected Pointers {
public:
Run(class LAMMPS *);
void command(int, char **);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Run command before simulation box is defined
+
+The run command cannot be used before a read_data, read_restart, or
+create_box command.
+
+E: Invalid run command N value
+
+The number of timesteps must fit in a 32-bit integer. If you want to
+run for more steps than this, perform multiple shorter runs.
+
+E: Invalid run command upto value
+
+Self-explanatory.
+
+E: Invalid run command start/stop value
+
+Self-explanatory.
+
+E: Run command start value is after start of run
+
+Self-explanatory.
+
+E: Run command stop value is before end of run
+
+Self-explanatory.
+
+E: Too many timesteps
+
+UNDOCUMENTED
+
+*/
diff --git a/src/set.h b/src/set.h
index 00e0c77de..73b9e5883 100644
--- a/src/set.h
+++ b/src/set.h
@@ -1,48 +1,156 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(set,Set)
#else
#ifndef LMP_SET_H
#define LMP_SET_H
#include "pointers.h"
namespace LAMMPS_NS {
class Set : protected Pointers {
public:
Set(class LAMMPS *lmp) : Pointers(lmp) {};
void command(int, char **);
private:
char *id;
int *select;
int style,ivalue,newtype,count;
int ximage,yimage,zimage,ximageflag,yimageflag,zimageflag;
double dvalue,xvalue,yvalue,zvalue,wvalue,fraction;
void selection(int);
void set(int);
void setrandom(int);
void topology(int);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Set command before simulation box is defined
+
+The set command cannot be used before a read_data, read_restart,
+or create_box command.
+
+E: Set command with no atoms existing
+
+No atoms are yet defined so the set command cannot be used.
+
+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: Invalid value in set command
+
+The value specified for the setting is invalid, likely because it is
+too small or too large.
+
+E: Invalid random number seed in set command
+
+Random number seed must be > 0.
+
+E: Cannot set this attribute for this atom style
+
+The attribute being set does not exist for the defined atom style.
+
+E: Invalid mass in set command
+
+UNDOCUMENTED
+
+E: Invalid shape in set command
+
+UNDOCUMENTED
+
+E: Invalid length in set command
+
+UNDOCUMENTED
+
+E: Invalid dipole length in set command
+
+UNDOCUMENTED
+
+E: Invalid diameter in set command
+
+UNDOCUMENTED
+
+E: Cannot set non-zero image flag for non-periodic dimension
+
+Self-explanatory.
+
+E: Cannot set meso_rho for this atom style
+
+UNDOCUMENTED
+
+E: Cannot use set atom with no atom IDs defined
+
+Atom IDs are not defined, so they cannot be used to identify an atom.
+
+E: Cannot use set mol with no molecule IDs defined
+
+UNDOCUMENTED
+
+E: Could not find set group ID
+
+Group ID specified in set command does not exist.
+
+E: Set region ID does not exist
+
+Region ID specified in set command does not exist.
+
+E: Cannot set quaternion for atom that has none
+
+UNDOCUMENTED
+
+E: Cannot set theta for atom that is not a line
+
+UNDOCUMENTED
+
+E: Bond atom missing in set command
+
+The set command cannot find one or more atoms in a particular bond on
+a particular processor. The pairwise cutoff is too short or the atoms
+are too far apart to make a valid bond.
+
+E: Angle atom missing in set command
+
+The set command cannot find one or more atoms in a particular angle on
+a particular processor. The pairwise cutoff is too short or the atoms
+are too far apart to make a valid angle.
+
+E: Dihedral atom missing in set command
+
+The set command cannot find one or more atoms in a particular dihedral
+on a particular processor. The pairwise cutoff is too short or the
+atoms are too far apart to make a valid dihedral.
+
+E: Improper atom missing in set command
+
+The set command cannot find one or more atoms in a particular improper
+on a particular processor. The pairwise cutoff is too short or the
+atoms are too far apart to make a valid improper.
+
+*/
diff --git a/src/special.h b/src/special.h
index 116426473..b269f01fe 100644
--- a/src/special.h
+++ b/src/special.h
@@ -1,39 +1,55 @@
/* ----------------------------------------------------------------------
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_SPECIAL_H
#define LMP_SPECIAL_H
#include "pointers.h"
namespace LAMMPS_NS {
class Special : protected Pointers {
public:
Special(class LAMMPS *);
~Special();
void build();
private:
int me,nprocs;
int **onetwo,**onethree,**onefour;
int dihedral_flag;
void combine();
void angle_trim();
void dihedral_trim();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: 1-3 bond count is inconsistent
+
+An inconsistency was detected when computing the number of 1-3
+neighbors for each atom. This likely means something is wrong with
+the bond topologies you have defined.
+
+E: 1-4 bond count is inconsistent
+
+An inconsistency was detected when computing the number of 1-4
+neighbors for each atom. This likely means something is wrong with
+the bond topologies you have defined.
+
+*/
diff --git a/src/thermo.cpp b/src/thermo.cpp
index b52a5f3c9..7dadacd8a 100644
--- a/src/thermo.cpp
+++ b/src/thermo.cpp
@@ -1,1931 +1,1932 @@
/* ----------------------------------------------------------------------
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 "lmptype.h"
#include "mpi.h"
#include "math.h"
#include "stdlib.h"
#include "string.h"
#include "thermo.h"
#include "atom.h"
#include "update.h"
#include "comm.h"
#include "domain.h"
#include "lattice.h"
#include "modify.h"
#include "fix.h"
#include "compute.h"
#include "input.h"
#include "variable.h"
#include "force.h"
#include "pair.h"
#include "bond.h"
#include "angle.h"
#include "dihedral.h"
#include "improper.h"
#include "kspace.h"
#include "output.h"
#include "timer.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
// customize a new keyword by adding to this list:
// step, elapsed, elaplong, dt, cpu, tpcpu, spcpu
// atoms, temp, press, pe, ke, etotal, enthalpy
// evdwl, ecoul, epair, ebond, eangle, edihed, eimp, emol, elong, etail
// vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz, xlat, ylat, zlat
// pxx, pyy, pzz, pxy, pxz, pyz
// fmax, fnorm
// cella, cellb, cellc, cellalpha, cellbeta, cellgamma
// customize a new thermo style by adding a DEFINE to this list
#define ONE "step temp epair emol etotal press"
#define MULTI "etotal ke temp pe ebond eangle edihed eimp evdwl ecoul elong press"
enum{IGNORE,WARN,ERROR}; // same as write_restart.cpp
enum{ONELINE,MULTILINE};
enum{INT,FLOAT,BIGINT};
enum{SCALAR,VECTOR,ARRAY};
#define INVOKED_SCALAR 1
#define INVOKED_VECTOR 2
#define INVOKED_ARRAY 4
#define MAXLINE 8192 // make this 4x longer than Input::MAXLINE
#define DELTA 8
/* ---------------------------------------------------------------------- */
Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
{
MPI_Comm_rank(world,&me);
int n = strlen(arg[0]) + 1;
style = new char[n];
strcpy(style,arg[0]);
// set thermo_modify defaults
modified = 0;
normuserflag = 0;
lineflag = ONELINE;
lostflag = ERROR;
lostbefore = 0;
flushflag = 0;
// set style and corresponding lineflag
// custom style builds its own line of keywords
// customize a new thermo style by adding to if statement
line = new char[MAXLINE];
if (strcmp(style,"one") == 0) {
strcpy(line,ONE);
} else if (strcmp(style,"multi") == 0) {
strcpy(line,MULTI);
lineflag = MULTILINE;
} else if (strcmp(style,"custom") == 0) {
if (narg == 1) error->all(FLERR,"Illegal thermo style custom command");
line[0] = '\0';
for (int iarg = 1; iarg < narg; iarg++) {
strcat(line,arg[iarg]);
strcat(line," ");
}
line[strlen(line)-1] = '\0';
} else error->all(FLERR,"Illegal thermo style command");
// ptrs, flags, IDs for compute objects thermo may use or create
temperature = NULL;
pressure = NULL;
pe = NULL;
index_temp = index_press_scalar = index_press_vector = index_pe = -1;
id_temp = (char *) "thermo_temp";
id_press = (char *) "thermo_press";
id_pe = (char *) "thermo_pe";
// count fields in line
// allocate per-field memory
// process line of keywords
nfield_initial = atom->count_words(line);
allocate();
parse_fields(line);
// format strings
- char *bigint_format = BIGINT_FORMAT;
+ char *bigint_format = (char *) BIGINT_FORMAT;
char *fformat_multi = (char *) "---------------- Step %%8%s ----- "
"CPU = %%11.4f (sec) ----------------";
sprintf(format_multi,fformat_multi,&bigint_format[1]);
format_float_one_def = (char *) "%12.8g";
format_float_multi_def = (char *) "%14.4f";
format_int_one_def = (char *) "%8d";
format_int_multi_def = (char *) "%14d";
sprintf(format_bigint_one_def,"%%8%s",&bigint_format[1]);
sprintf(format_bigint_multi_def,"%%14%s",&bigint_format[1]);
format_float_user = NULL;
format_int_user = NULL;
format_bigint_user = NULL;
}
/* ---------------------------------------------------------------------- */
Thermo::~Thermo()
{
delete [] style;
delete [] line;
deallocate();
// format strings
delete [] format_float_user;
delete [] format_int_user;
delete [] format_bigint_user;
}
/* ---------------------------------------------------------------------- */
void Thermo::init()
{
int i,n;
// set normvalue to default setting unless user has specified it
if (normuserflag) normvalue = normuser;
else if (strcmp(update->unit_style,"lj") == 0) normvalue = 1;
else normvalue = 0;
// add Volume field if volume changes and not style = custom
// this check must come after domain init, so box_change is set
nfield = nfield_initial;
if (domain->box_change && strcmp(style,"custom") != 0)
addfield("Volume",&Thermo::compute_vol,FLOAT);
// set format string for each field
// include keyword if lineflag = MULTILINE
// add '/n' every 3 values if lineflag = MULTILINE
// add trailing '/n' to last value
char *ptr;
for (i = 0; i < nfield; i++) {
format[i][0] = '\0';
if (lineflag == MULTILINE && i % 3 == 0) strcat(format[i],"\n");
if (format_user[i]) ptr = format_user[i];
else if (vtype[i] == FLOAT) {
if (format_float_user) ptr = format_float_user;
else if (lineflag == ONELINE) ptr = format_float_one_def;
else if (lineflag == MULTILINE) ptr = format_float_multi_def;
} else if (vtype[i] == INT) {
if (format_int_user) ptr = format_int_user;
else if (lineflag == ONELINE) ptr = format_int_one_def;
else if (lineflag == MULTILINE) ptr = format_int_multi_def;
} else if (vtype[i] == BIGINT) {
if (format_bigint_user) ptr = format_bigint_user;
else if (lineflag == ONELINE) ptr = format_bigint_one_def;
else if (lineflag == MULTILINE) ptr = format_bigint_multi_def;
}
n = strlen(format[i]);
if (lineflag == ONELINE) sprintf(&format[i][n],"%s ",ptr);
else sprintf(&format[i][n],"%-8s = %s ",keyword[i],ptr);
if (i == nfield-1) strcat(format[i],"\n");
}
// find current ptr for each Compute ID
// cudable = 0 if any compute used by Thermo is non-CUDA
cudable = 1;
int icompute;
for (i = 0; i < ncompute; i++) {
icompute = modify->find_compute(id_compute[i]);
if (icompute < 0) error->all(FLERR,"Could not find thermo compute ID");
computes[i] = modify->compute[icompute];
cudable = cudable && computes[i]->cudable;
}
// find current ptr for each Fix ID
// check that fix frequency is acceptable with thermo output frequency
int ifix;
for (i = 0; i < nfix; i++) {
ifix = modify->find_fix(id_fix[i]);
if (ifix < 0) error->all(FLERR,"Could not find thermo fix ID");
fixes[i] = modify->fix[ifix];
if (output->thermo_every % fixes[i]->global_freq)
error->all(FLERR,"Thermo and fix not computed at compatible times");
}
// find current ptr for each Variable ID
int ivariable;
for (i = 0; i < nvariable; i++) {
ivariable = input->variable->find(id_variable[i]);
if (ivariable < 0)
error->all(FLERR,"Could not find thermo custom variable name");
variables[i] = ivariable;
}
// set ptrs to keyword-specific Compute objects
if (index_temp >= 0) temperature = computes[index_temp];
if (index_press_scalar >= 0) pressure = computes[index_press_scalar];
if (index_press_vector >= 0) pressure = computes[index_press_vector];
if (index_pe >= 0) pe = computes[index_pe];
}
/* ---------------------------------------------------------------------- */
void Thermo::header()
{
if (lineflag == MULTILINE) return;
int loc = 0;
for (int i = 0; i < nfield; i++)
loc += sprintf(&line[loc],"%s ",keyword[i]);
sprintf(&line[loc],"\n");
if (me == 0) {
if (screen) fprintf(screen,line);
if (logfile) fprintf(logfile,line);
}
}
/* ---------------------------------------------------------------------- */
void Thermo::compute(int flag)
{
int i;
firststep = flag;
bigint ntimestep = update->ntimestep;
// check for lost atoms
// turn off normflag if natoms = 0 to avoid divide by 0
natoms = lost_check();
if (natoms == 0) normflag = 0;
else normflag = normvalue;
// invoke Compute methods needed for thermo keywords
// which = 0 is global scalar, which = 1 is global vector
for (i = 0; i < ncompute; i++)
if (compute_which[i] == SCALAR) {
if (!(computes[i]->invoked_flag & INVOKED_SCALAR)) {
computes[i]->compute_scalar();
computes[i]->invoked_flag |= INVOKED_SCALAR;
}
} else if (compute_which[i] == VECTOR) {
if (!(computes[i]->invoked_flag & INVOKED_VECTOR)) {
computes[i]->compute_vector();
computes[i]->invoked_flag |= INVOKED_VECTOR;
}
} else if (compute_which[i] == ARRAY) {
if (!(computes[i]->invoked_flag & INVOKED_ARRAY)) {
computes[i]->compute_array();
computes[i]->invoked_flag |= INVOKED_ARRAY;
}
}
// if lineflag = MULTILINE, prepend step/cpu header line
int loc = 0;
if (lineflag == MULTILINE) {
double cpu;
if (flag) cpu = timer->elapsed(TIME_LOOP);
else cpu = 0.0;
loc = sprintf(&line[loc],format_multi,ntimestep,cpu);
}
// add each thermo value to line with its specific format
for (ifield = 0; ifield < nfield; ifield++) {
(this->*vfunc[ifield])();
if (vtype[ifield] == FLOAT)
loc += sprintf(&line[loc],format[ifield],dvalue);
else if (vtype[ifield] == INT)
loc += sprintf(&line[loc],format[ifield],ivalue);
else if (vtype[ifield] == BIGINT) {
loc += sprintf(&line[loc],format[ifield],bivalue);
}
}
// kludge for RedStorm timing issue
// if (ntimestep == 100) return;
// print line to screen and logfile
if (me == 0) {
if (screen) fprintf(screen,line);
if (logfile) {
fprintf(logfile,line);
if (flushflag) fflush(logfile);
}
}
}
/* ----------------------------------------------------------------------
check for lost atoms, return current number of atoms
------------------------------------------------------------------------- */
bigint Thermo::lost_check()
{
// ntotal = current # of atoms
bigint ntotal;
bigint nblocal = atom->nlocal;
MPI_Allreduce(&nblocal,&ntotal,1,MPI_LMP_BIGINT,MPI_SUM,world);
- if (ntotal < 0 || ntotal > MAXBIGINT) error->all(FLERR,"Too many total atoms");
+ if (ntotal < 0 || ntotal > MAXBIGINT)
+ error->all(FLERR,"Too many total atoms");
if (ntotal == atom->natoms) return ntotal;
// if not checking or already warned, just return
// reset total atom count
if (lostflag == IGNORE) return ntotal;
if (lostflag == WARN && lostbefore == 1) {
atom->natoms = ntotal;
return ntotal;
}
// error message
if (lostflag == ERROR) {
char str[64];
sprintf(str,
"Lost atoms: original " BIGINT_FORMAT " current " BIGINT_FORMAT,
atom->natoms,ntotal);
error->all(FLERR,str);
}
// warning message
char str[64];
sprintf(str,
"Lost atoms: original " BIGINT_FORMAT " current " BIGINT_FORMAT,
atom->natoms,ntotal);
if (me == 0) error->warning(FLERR,str,0);
// reset total atom count
atom->natoms = ntotal;
lostbefore = 1;
return ntotal;
}
/* ----------------------------------------------------------------------
modify thermo parameters
------------------------------------------------------------------------- */
void Thermo::modify_params(int narg, char **arg)
{
if (narg == 0) error->all(FLERR,"Illegal thermo_modify command");
modified = 1;
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"every") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
delete [] output->var_thermo;
int n = strlen(&arg[iarg+1][2]) + 1;
output->var_thermo = new char[n];
strcpy(output->var_thermo,&arg[iarg+1][2]);
} else error->all(FLERR,"Illegal thermo_modify command");
output->thermo_every = 0;
iarg += 2;
} else if (strcmp(arg[iarg],"temp") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
if (index_temp < 0) error->all(FLERR,"Thermo style does not use temp");
delete [] id_compute[index_temp];
int n = strlen(arg[iarg+1]) + 1;
id_compute[index_temp] = new char[n];
strcpy(id_compute[index_temp],arg[iarg+1]);
int icompute = modify->find_compute(arg[iarg+1]);
if (icompute < 0)
error->all(FLERR,"Could not find thermo_modify temperature ID");
temperature = modify->compute[icompute];
if (temperature->tempflag == 0)
error->all(FLERR,"Thermo_modify temperature ID does not "
"compute temperature");
if (temperature->igroup != 0 && comm->me == 0)
error->warning(FLERR,"Temperature for thermo pressure is not for group all");
// reset id_temp of pressure to new temperature ID
// either pressure currently being used by thermo or "thermo_press"
if (index_press_scalar >= 0) {
icompute = modify->find_compute(id_compute[index_press_scalar]);
if (icompute < 0) error->all(FLERR,"Pressure ID for thermo does not exist");
} else if (index_press_vector >= 0) {
icompute = modify->find_compute(id_compute[index_press_vector]);
if (icompute < 0) error->all(FLERR,"Pressure ID for thermo does not exist");
} else icompute = modify->find_compute((char *) "thermo_press");
modify->compute[icompute]->reset_extra_compute_fix(arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"press") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
if (index_press_scalar < 0 && index_press_vector < 0)
error->all(FLERR,"Thermo style does not use press");
if (index_press_scalar >= 0) {
delete [] id_compute[index_press_scalar];
int n = strlen(arg[iarg+1]) + 1;
id_compute[index_press_scalar] = new char[n];
strcpy(id_compute[index_press_scalar],arg[iarg+1]);
}
if (index_press_vector >= 0) {
delete [] id_compute[index_press_vector];
int n = strlen(arg[iarg+1]) + 1;
id_compute[index_press_vector] = new char[n];
strcpy(id_compute[index_press_vector],arg[iarg+1]);
}
int icompute = modify->find_compute(arg[iarg+1]);
if (icompute < 0) error->all(FLERR,"Could not find thermo_modify pressure ID");
pressure = modify->compute[icompute];
if (pressure->pressflag == 0)
error->all(FLERR,"Thermo_modify pressure ID does not compute pressure");
iarg += 2;
} else if (strcmp(arg[iarg],"lost") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
if (strcmp(arg[iarg+1],"ignore") == 0) lostflag = IGNORE;
else if (strcmp(arg[iarg+1],"warn") == 0) lostflag = WARN;
else if (strcmp(arg[iarg+1],"error") == 0) lostflag = ERROR;
else error->all(FLERR,"Illegal thermo_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"norm") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
normuserflag = 1;
if (strcmp(arg[iarg+1],"no") == 0) normuser = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) normuser = 1;
else error->all(FLERR,"Illegal thermo_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"flush") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
if (strcmp(arg[iarg+1],"no") == 0) flushflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) flushflag = 1;
else error->all(FLERR,"Illegal thermo_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"line") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
if (strcmp(arg[iarg+1],"one") == 0) lineflag = ONELINE;
else if (strcmp(arg[iarg+1],"multi") == 0) lineflag = MULTILINE;
else error->all(FLERR,"Illegal thermo_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"format") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal thermo_modify command");
if (strcmp(arg[iarg+1],"int") == 0) {
if (format_int_user) delete [] format_int_user;
int n = strlen(arg[iarg+2]) + 1;
format_int_user = new char[n];
strcpy(format_int_user,arg[iarg+2]);
if (format_bigint_user) delete [] format_bigint_user;
n = strlen(format_int_user) + 3;
format_bigint_user = new char[n];
char *ptr = strchr(format_int_user,'d');
if (ptr == NULL)
error->all(FLERR,"Thermo_modify int format does not contain d character");
*ptr = '\0';
sprintf(format_bigint_user,"%s%s%s",format_int_user,
BIGINT_FORMAT,ptr+1);
*ptr = 'd';
} else if (strcmp(arg[iarg+1],"float") == 0) {
if (format_float_user) delete [] format_float_user;
int n = strlen(arg[iarg+2]) + 1;
format_float_user = new char[n];
strcpy(format_float_user,arg[iarg+2]);
} else {
int i = atoi(arg[iarg+1]) - 1;
if (i < 0 || i >= nfield_initial)
error->all(FLERR,"Illegal thermo_modify command");
if (format_user[i]) delete [] format_user[i];
int n = strlen(arg[iarg+2]) + 1;
format_user[i] = new char[n];
strcpy(format_user[i],arg[iarg+2]);
}
iarg += 3;
} else error->all(FLERR,"Illegal thermo_modify command");
}
}
/* ----------------------------------------------------------------------
allocate all per-field memory
------------------------------------------------------------------------- */
void Thermo::allocate()
{
// n = specified fields + Volume field (added at run time)
int n = nfield_initial + 1;
keyword = new char*[n];
for (int i = 0; i < n; i++) keyword[i] = new char[32];
vfunc = new FnPtr[n];
vtype = new int[n];
format = new char*[n];
for (int i = 0; i < n; i++) format[i] = new char[32];
format_user = new char*[n];
for (int i = 0; i < n; i++) format_user[i] = NULL;
field2index = new int[n];
argindex1 = new int[n];
argindex2 = new int[n];
// factor of 3 is max number of computes a single field can add
ncompute = 0;
id_compute = new char*[3*n];
compute_which = new int[3*n];
computes = new Compute*[3*n];
nfix = 0;
id_fix = new char*[n];
fixes = new Fix*[n];
nvariable = 0;
id_variable = new char*[n];
variables = new int[n];
}
/* ----------------------------------------------------------------------
deallocate all per-field memory
------------------------------------------------------------------------- */
void Thermo::deallocate()
{
int n = nfield_initial + 1;
for (int i = 0; i < n; i++) delete [] keyword[i];
delete [] keyword;
delete [] vfunc;
delete [] vtype;
for (int i = 0; i < n; i++) delete [] format[i];
delete [] format;
for (int i = 0; i < n; i++) delete [] format_user[i];
delete [] format_user;
delete [] field2index;
delete [] argindex1;
delete [] argindex2;
for (int i = 0; i < ncompute; i++) delete [] id_compute[i];
delete [] id_compute;
delete [] compute_which;
delete [] computes;
for (int i = 0; i < nfix; i++) delete [] id_fix[i];
delete [] id_fix;
delete [] fixes;
for (int i = 0; i < nvariable; i++) delete [] id_variable[i];
delete [] id_variable;
delete [] variables;
}
/* ----------------------------------------------------------------------
parse list of thermo keywords from str
set compute flags (temp, press, pe, etc)
------------------------------------------------------------------------- */
void Thermo::parse_fields(char *str)
{
nfield = 0;
// customize a new keyword by adding to if statement
char *word = strtok(str," \0");
while (word) {
if (strcmp(word,"step") == 0) {
addfield("Step",&Thermo::compute_step,BIGINT);
} else if (strcmp(word,"elapsed") == 0) {
addfield("Elapsed",&Thermo::compute_elapsed,BIGINT);
} else if (strcmp(word,"elaplong") == 0) {
addfield("Elaplong",&Thermo::compute_elapsed_long,BIGINT);
} else if (strcmp(word,"dt") == 0) {
addfield("Dt",&Thermo::compute_dt,FLOAT);
} else if (strcmp(word,"cpu") == 0) {
addfield("CPU",&Thermo::compute_cpu,FLOAT);
} else if (strcmp(word,"tpcpu") == 0) {
addfield("T/CPU",&Thermo::compute_tpcpu,FLOAT);
} else if (strcmp(word,"spcpu") == 0) {
addfield("S/CPU",&Thermo::compute_spcpu,FLOAT);
} else if (strcmp(word,"atoms") == 0) {
addfield("Atoms",&Thermo::compute_atoms,BIGINT);
} else if (strcmp(word,"temp") == 0) {
addfield("Temp",&Thermo::compute_temp,FLOAT);
index_temp = add_compute(id_temp,SCALAR);
} else if (strcmp(word,"press") == 0) {
addfield("Press",&Thermo::compute_press,FLOAT);
index_press_scalar = add_compute(id_press,SCALAR);
} else if (strcmp(word,"pe") == 0) {
addfield("PotEng",&Thermo::compute_pe,FLOAT);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"ke") == 0) {
addfield("KinEng",&Thermo::compute_ke,FLOAT);
index_temp = add_compute(id_temp,SCALAR);
} else if (strcmp(word,"etotal") == 0) {
addfield("TotEng",&Thermo::compute_etotal,FLOAT);
index_temp = add_compute(id_temp,SCALAR);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"enthalpy") == 0) {
addfield("Enthalpy",&Thermo::compute_enthalpy,FLOAT);
index_temp = add_compute(id_temp,SCALAR);
index_press_scalar = add_compute(id_press,SCALAR);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"evdwl") == 0) {
addfield("E_vdwl",&Thermo::compute_evdwl,FLOAT);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"ecoul") == 0) {
addfield("E_coul",&Thermo::compute_ecoul,FLOAT);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"epair") == 0) {
addfield("E_pair",&Thermo::compute_epair,FLOAT);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"ebond") == 0) {
addfield("E_bond",&Thermo::compute_ebond,FLOAT);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"eangle") == 0) {
addfield("E_angle",&Thermo::compute_eangle,FLOAT);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"edihed") == 0) {
addfield("E_dihed",&Thermo::compute_edihed,FLOAT);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"eimp") == 0) {
addfield("E_impro",&Thermo::compute_eimp,FLOAT);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"emol") == 0) {
addfield("E_mol",&Thermo::compute_emol,FLOAT);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"elong") == 0) {
addfield("E_long",&Thermo::compute_elong,FLOAT);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"etail") == 0) {
addfield("E_tail",&Thermo::compute_etail,FLOAT);
index_pe = add_compute(id_pe,SCALAR);
} else if (strcmp(word,"vol") == 0) {
addfield("Volume",&Thermo::compute_vol,FLOAT);
} else if (strcmp(word,"lx") == 0) {
addfield("Lx",&Thermo::compute_lx,FLOAT);
} else if (strcmp(word,"ly") == 0) {
addfield("Ly",&Thermo::compute_ly,FLOAT);
} else if (strcmp(word,"lz") == 0) {
addfield("Lz",&Thermo::compute_lz,FLOAT);
} else if (strcmp(word,"xlo") == 0) {
addfield("Xlo",&Thermo::compute_xlo,FLOAT);
} else if (strcmp(word,"xhi") == 0) {
addfield("Xhi",&Thermo::compute_xhi,FLOAT);
} else if (strcmp(word,"ylo") == 0) {
addfield("Ylo",&Thermo::compute_ylo,FLOAT);
} else if (strcmp(word,"yhi") == 0) {
addfield("Yhi",&Thermo::compute_yhi,FLOAT);
} else if (strcmp(word,"zlo") == 0) {
addfield("Zlo",&Thermo::compute_zlo,FLOAT);
} else if (strcmp(word,"zhi") == 0) {
addfield("Zhi",&Thermo::compute_zhi,FLOAT);
} else if (strcmp(word,"xy") == 0) {
addfield("Xy",&Thermo::compute_xy,FLOAT);
} else if (strcmp(word,"xz") == 0) {
addfield("Xz",&Thermo::compute_xz,FLOAT);
} else if (strcmp(word,"yz") == 0) {
addfield("Yz",&Thermo::compute_yz,FLOAT);
} else if (strcmp(word,"xlat") == 0) {
if (domain->lattice == NULL)
error->all(FLERR,"Thermo keyword requires lattice be defined");
addfield("Xlat",&Thermo::compute_xlat,FLOAT);
} else if (strcmp(word,"ylat") == 0) {
if (domain->lattice == NULL)
error->all(FLERR,"Thermo keyword requires lattice be defined");
addfield("Ylat",&Thermo::compute_ylat,FLOAT);
} else if (strcmp(word,"zlat") == 0) {
if (domain->lattice == NULL)
error->all(FLERR,"Thermo keyword requires lattice be defined");
addfield("Zlat",&Thermo::compute_zlat,FLOAT);
} else if (strcmp(word,"pxx") == 0) {
addfield("Pxx",&Thermo::compute_pxx,FLOAT);
index_press_vector = add_compute(id_press,VECTOR);
} else if (strcmp(word,"pyy") == 0) {
addfield("Pyy",&Thermo::compute_pyy,FLOAT);
index_press_vector = add_compute(id_press,VECTOR);
} else if (strcmp(word,"pzz") == 0) {
addfield("Pzz",&Thermo::compute_pzz,FLOAT);
index_press_vector = add_compute(id_press,VECTOR);
} else if (strcmp(word,"pxy") == 0) {
addfield("Pxy",&Thermo::compute_pxy,FLOAT);
index_press_vector = add_compute(id_press,VECTOR);
} else if (strcmp(word,"pxz") == 0) {
addfield("Pxz",&Thermo::compute_pxz,FLOAT);
index_press_vector = add_compute(id_press,VECTOR);
} else if (strcmp(word,"pyz") == 0) {
addfield("Pyz",&Thermo::compute_pyz,FLOAT);
index_press_vector = add_compute(id_press,VECTOR);
} else if (strcmp(word,"fmax") == 0) {
addfield("Fmax",&Thermo::compute_fmax,FLOAT);
} else if (strcmp(word,"fnorm") == 0) {
addfield("Fnorm",&Thermo::compute_fnorm,FLOAT);
} else if (strcmp(word,"cella") == 0) {
addfield("Cella",&Thermo::compute_cella,FLOAT);
} else if (strcmp(word,"cellb") == 0) {
addfield("Cellb",&Thermo::compute_cellb,FLOAT);
} else if (strcmp(word,"cellc") == 0) {
addfield("Cellc",&Thermo::compute_cellc,FLOAT);
} else if (strcmp(word,"cellalpha") == 0) {
addfield("CellAlpha",&Thermo::compute_cellalpha,FLOAT);
} else if (strcmp(word,"cellbeta") == 0) {
addfield("CellBeta",&Thermo::compute_cellbeta,FLOAT);
} else if (strcmp(word,"cellgamma") == 0) {
addfield("CellGamma",&Thermo::compute_cellgamma,FLOAT);
// compute value = c_ID, fix value = f_ID, variable value = v_ID
// count trailing [] and store int arguments
// copy = at most 8 chars of ID to pass to addfield
} else if ((strncmp(word,"c_",2) == 0) || (strncmp(word,"f_",2) == 0) ||
(strncmp(word,"v_",2) == 0)) {
int n = strlen(word);
char *id = new char[n];
strcpy(id,&word[2]);
char copy[9];
strncpy(copy,id,8);
copy[8] = '\0';
// parse zero or one or two trailing brackets from ID
// argindex1,argindex2 = int inside each bracket pair, 0 if no bracket
char *ptr = strchr(id,'[');
if (ptr == NULL) argindex1[nfield] = 0;
else {
*ptr = '\0';
argindex1[nfield] = input->variable->int_between_brackets(ptr);
ptr++;
if (*ptr == '[') {
argindex2[nfield] = input->variable->int_between_brackets(ptr);
ptr++;
} else argindex2[nfield] = 0;
}
if (word[0] == 'c') {
n = modify->find_compute(id);
if (n < 0) error->all(FLERR,"Could not find thermo custom compute ID");
if (argindex1[nfield] == 0 && modify->compute[n]->scalar_flag == 0)
error->all(FLERR,"Thermo compute does not compute scalar");
if (argindex1[nfield] > 0 && argindex2[nfield] == 0) {
if (modify->compute[n]->vector_flag == 0)
error->all(FLERR,"Thermo compute does not compute vector");
if (argindex1[nfield] > modify->compute[n]->size_vector)
error->all(FLERR,"Thermo compute vector is accessed out-of-range");
}
if (argindex1[nfield] > 0 && argindex2[nfield] > 0) {
if (modify->compute[n]->array_flag == 0)
error->all(FLERR,"Thermo compute does not compute array");
if (argindex1[nfield] > modify->compute[n]->size_array_rows ||
argindex2[nfield] > modify->compute[n]->size_array_cols)
error->all(FLERR,"Thermo compute array is accessed out-of-range");
}
if (argindex1[nfield] == 0)
field2index[nfield] = add_compute(id,SCALAR);
else if (argindex2[nfield] == 0)
field2index[nfield] = add_compute(id,VECTOR);
else
field2index[nfield] = add_compute(id,ARRAY);
addfield(copy,&Thermo::compute_compute,FLOAT);
} else if (word[0] == 'f') {
n = modify->find_fix(id);
if (n < 0) error->all(FLERR,"Could not find thermo custom fix ID");
if (argindex1[nfield] == 0 && modify->fix[n]->scalar_flag == 0)
error->all(FLERR,"Thermo fix does not compute scalar");
if (argindex1[nfield] > 0 && argindex2[nfield] == 0) {
if (modify->fix[n]->vector_flag == 0)
error->all(FLERR,"Thermo fix does not compute vector");
if (argindex1[nfield] > modify->fix[n]->size_vector)
error->all(FLERR,"Thermo fix vector is accessed out-of-range");
}
if (argindex1[nfield] > 0 && argindex2[nfield] > 0) {
if (modify->fix[n]->array_flag == 0)
error->all(FLERR,"Thermo fix does not compute array");
if (argindex1[nfield] > modify->fix[n]->size_array_rows ||
argindex2[nfield] > modify->fix[n]->size_array_cols)
error->all(FLERR,"Thermo fix array is accessed out-of-range");
}
field2index[nfield] = add_fix(id);
addfield(copy,&Thermo::compute_fix,FLOAT);
} else if (word[0] == 'v') {
n = input->variable->find(id);
if (n < 0) error->all(FLERR,"Could not find thermo custom variable name");
if (input->variable->equalstyle(n) == 0)
error->all(FLERR,"Thermo custom variable is not equal-style variable");
if (argindex1[nfield])
error->all(FLERR,"Thermo custom variable cannot be indexed");
field2index[nfield] = add_variable(id);
addfield(copy,&Thermo::compute_variable,FLOAT);
}
delete [] id;
} else error->all(FLERR,"Invalid keyword in thermo_style custom command");
word = strtok(NULL," \0");
}
}
/* ----------------------------------------------------------------------
add field to list of quantities to print
------------------------------------------------------------------------- */
void Thermo::addfield(const char *key, FnPtr func, int typeflag)
{
strcpy(keyword[nfield],key);
vfunc[nfield] = func;
vtype[nfield] = typeflag;
nfield++;
}
/* ----------------------------------------------------------------------
add compute ID to list of Compute objects to call
return location of where this Compute is in list
if already in list with same which, do not add, just return index
------------------------------------------------------------------------- */
int Thermo::add_compute(const char *id, int which)
{
int icompute;
for (icompute = 0; icompute < ncompute; icompute++)
if ((strcmp(id,id_compute[icompute]) == 0) &&
which == compute_which[icompute]) break;
if (icompute < ncompute) return icompute;
int n = strlen(id) + 1;
id_compute[ncompute] = new char[n];
strcpy(id_compute[ncompute],id);
compute_which[ncompute] = which;
ncompute++;
return ncompute-1;
}
/* ----------------------------------------------------------------------
add fix ID to list of Fix objects to call
------------------------------------------------------------------------- */
int Thermo::add_fix(const char *id)
{
int n = strlen(id) + 1;
id_fix[nfix] = new char[n];
strcpy(id_fix[nfix],id);
nfix++;
return nfix-1;
}
/* ----------------------------------------------------------------------
add variable ID to list of Variables to evaluate
------------------------------------------------------------------------- */
int Thermo::add_variable(const char *id)
{
int n = strlen(id) + 1;
id_variable[nvariable] = new char[n];
strcpy(id_variable[nvariable],id);
nvariable++;
return nvariable-1;
}
/* ----------------------------------------------------------------------
compute a single thermodyanmic value, word is any keyword in custom list
called when a variable is evaluated by Variable class
return value as double in answer
return 0 if str is recoginzed keyword, 1 if unrecognized
customize a new keyword by adding to if statement
------------------------------------------------------------------------- */
int Thermo::evaluate_keyword(char *word, double *answer)
{
// invoke a lo-level thermo routine to compute the variable value
// if keyword requires a compute, error if thermo doesn't use the compute
// if inbetween runs and needed compute is not current, error
// if in middle of run and needed compute is not current, invoke it
// for keywords that use pe indirectly (evdwl, ebond, etc):
// check if energy was tallied on this timestep and set pe->invoked_flag
// this will trigger next timestep for energy tallying via addstep()
if (strcmp(word,"step") == 0) {
compute_step();
dvalue = bivalue;
} else if (strcmp(word,"elapsed") == 0) {
if (update->whichflag == 0)
error->all(FLERR,"This variable thermo keyword cannot be used between runs");
compute_elapsed();
dvalue = bivalue;
} else if (strcmp(word,"elaplong") == 0) {
if (update->whichflag == 0)
error->all(FLERR,"This variable thermo keyword cannot be used between runs");
compute_elapsed_long();
dvalue = bivalue;
} else if (strcmp(word,"dt") == 0) {
compute_dt();
} else if (strcmp(word,"cpu") == 0) {
if (update->whichflag == 0)
error->all(FLERR,"This variable thermo keyword cannot be used between runs");
compute_cpu();
} else if (strcmp(word,"tpcpu") == 0) {
if (update->whichflag == 0)
error->all(FLERR,"This variable thermo keyword cannot be used between runs");
compute_tpcpu();
} else if (strcmp(word,"spcpu") == 0) {
if (update->whichflag == 0)
error->all(FLERR,"This variable thermo keyword cannot be used between runs");
compute_spcpu();
} else if (strcmp(word,"atoms") == 0) {
compute_atoms();
dvalue = bivalue;
} else if (strcmp(word,"temp") == 0) {
if (!temperature)
error->all(FLERR,"Thermo keyword in variable requires "
"thermo to use/init temp");
if (update->whichflag == 0) {
if (temperature->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(temperature->invoked_flag & INVOKED_SCALAR)) {
temperature->compute_scalar();
temperature->invoked_flag |= INVOKED_SCALAR;
}
compute_temp();
} else if (strcmp(word,"press") == 0) {
if (!pressure)
error->all(FLERR,"Thermo keyword in variable requires "
"thermo to use/init press");
if (update->whichflag == 0) {
if (pressure->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(pressure->invoked_flag & INVOKED_SCALAR)) {
pressure->compute_scalar();
pressure->invoked_flag |= INVOKED_SCALAR;
}
compute_press();
} else if (strcmp(word,"pe") == 0) {
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
if (update->whichflag == 0) {
if (pe->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(pe->invoked_flag & INVOKED_SCALAR)) {
pe->compute_scalar();
pe->invoked_flag |= INVOKED_SCALAR;
}
compute_pe();
} else if (strcmp(word,"ke") == 0) {
if (!temperature)
error->all(FLERR,"Thermo keyword in variable requires "
"thermo to use/init temp");
if (update->whichflag == 0) {
if (temperature->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(temperature->invoked_flag & INVOKED_SCALAR)) {
temperature->compute_scalar();
temperature->invoked_flag |= INVOKED_SCALAR;
}
compute_ke();
} else if (strcmp(word,"etotal") == 0) {
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
if (update->whichflag == 0) {
if (pe->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(pe->invoked_flag & INVOKED_SCALAR)) {
pe->compute_scalar();
pe->invoked_flag |= INVOKED_SCALAR;
}
if (!temperature)
error->all(FLERR,"Thermo keyword in variable requires "
"thermo to use/init temp");
if (update->whichflag == 0) {
if (temperature->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(temperature->invoked_flag & INVOKED_SCALAR)) {
temperature->compute_scalar();
temperature->invoked_flag |= INVOKED_SCALAR;
}
compute_etotal();
} else if (strcmp(word,"enthalpy") == 0) {
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
if (update->whichflag == 0) {
if (pe->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(pe->invoked_flag & INVOKED_SCALAR)) {
pe->compute_scalar();
pe->invoked_flag |= INVOKED_SCALAR;
}
if (!temperature)
error->all(FLERR,"Thermo keyword in variable requires "
"thermo to use/init temp");
if (update->whichflag == 0) {
if (temperature->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(temperature->invoked_flag & INVOKED_SCALAR)) {
temperature->compute_scalar();
temperature->invoked_flag |= INVOKED_SCALAR;
}
if (!pressure)
error->all(FLERR,"Thermo keyword in variable requires "
"thermo to use/init press");
if (update->whichflag == 0) {
if (pressure->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(pressure->invoked_flag & INVOKED_SCALAR)) {
pressure->compute_scalar();
pressure->invoked_flag |= INVOKED_SCALAR;
}
compute_enthalpy();
} else if (strcmp(word,"evdwl") == 0) {
if (update->eflag_global != update->ntimestep)
error->all(FLERR,"Energy was not tallied on needed timestep");
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
pe->invoked_flag |= INVOKED_SCALAR;
compute_evdwl();
} else if (strcmp(word,"ecoul") == 0) {
if (update->eflag_global != update->ntimestep)
error->all(FLERR,"Energy was not tallied on needed timestep");
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
pe->invoked_flag |= INVOKED_SCALAR;
compute_ecoul();
} else if (strcmp(word,"epair") == 0) {
if (update->eflag_global != update->ntimestep)
error->all(FLERR,"Energy was not tallied on needed timestep");
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
pe->invoked_flag |= INVOKED_SCALAR;
compute_epair();
} else if (strcmp(word,"ebond") == 0) {
if (update->eflag_global != update->ntimestep)
error->all(FLERR,"Energy was not tallied on needed timestep");
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
pe->invoked_flag |= INVOKED_SCALAR;
compute_ebond();
} else if (strcmp(word,"eangle") == 0) {
if (update->eflag_global != update->ntimestep)
error->all(FLERR,"Energy was not tallied on needed timestep");
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
pe->invoked_flag |= INVOKED_SCALAR;
compute_eangle();
} else if (strcmp(word,"edihed") == 0) {
if (update->eflag_global != update->ntimestep)
error->all(FLERR,"Energy was not tallied on needed timestep");
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
pe->invoked_flag |= INVOKED_SCALAR;
compute_edihed();
} else if (strcmp(word,"eimp") == 0) {
if (update->eflag_global != update->ntimestep)
error->all(FLERR,"Energy was not tallied on needed timestep");
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
pe->invoked_flag |= INVOKED_SCALAR;
compute_eimp();
} else if (strcmp(word,"emol") == 0) {
if (update->eflag_global != update->ntimestep)
error->all(FLERR,"Energy was not tallied on needed timestep");
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
pe->invoked_flag |= INVOKED_SCALAR;
compute_emol();
} else if (strcmp(word,"elong") == 0) {
if (update->eflag_global != update->ntimestep)
error->all(FLERR,"Energy was not tallied on needed timestep");
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
pe->invoked_flag |= INVOKED_SCALAR;
compute_elong();
} else if (strcmp(word,"etail") == 0) {
if (update->eflag_global != update->ntimestep)
error->all(FLERR,"Energy was not tallied on needed timestep");
if (!pe)
error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
pe->invoked_flag |= INVOKED_SCALAR;
compute_etail();
} else if (strcmp(word,"vol") == 0) compute_vol();
else if (strcmp(word,"lx") == 0) compute_lx();
else if (strcmp(word,"ly") == 0) compute_ly();
else if (strcmp(word,"lz") == 0) compute_lz();
else if (strcmp(word,"xlo") == 0) compute_xlo();
else if (strcmp(word,"xhi") == 0) compute_xhi();
else if (strcmp(word,"ylo") == 0) compute_ylo();
else if (strcmp(word,"yhi") == 0) compute_yhi();
else if (strcmp(word,"zlo") == 0) compute_zlo();
else if (strcmp(word,"zhi") == 0) compute_zhi();
else if (strcmp(word,"xy") == 0) compute_xy();
else if (strcmp(word,"xz") == 0) compute_xz();
else if (strcmp(word,"yz") == 0) compute_yz();
else if (strcmp(word,"xlat") == 0) {
if (domain->lattice == NULL)
error->all(FLERR,"Thermo keyword in variable requires lattice be defined");
compute_xlat();
} else if (strcmp(word,"ylat") == 0) {
if (domain->lattice == NULL)
error->all(FLERR,"Thermo keyword in variable requires lattice be defined");
compute_ylat();
} else if (strcmp(word,"zlat") == 0) {
if (domain->lattice == NULL)
error->all(FLERR,"Thermo keyword in variable requires lattice be defined");
compute_zlat();
} else if (strcmp(word,"pxx") == 0) {
if (!pressure)
error->all(FLERR,"Thermo keyword in variable requires "
"thermo to use/init press");
if (update->whichflag == 0) {
if (pressure->invoked_vector != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
pressure->compute_vector();
pressure->invoked_flag |= INVOKED_VECTOR;
}
compute_pxx();
} else if (strcmp(word,"pyy") == 0) {
if (!pressure)
error->all(FLERR,"Thermo keyword in variable requires "
"thermo to use/init press");
if (update->whichflag == 0) {
if (pressure->invoked_vector != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
pressure->compute_vector();
pressure->invoked_flag |= INVOKED_VECTOR;
}
compute_pyy();
} else if (strcmp(word,"pzz") == 0) {
if (!pressure)
error->all(FLERR,"Thermo keyword in variable requires "
"thermo to use/init press");
if (update->whichflag == 0) {
if (pressure->invoked_vector != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
pressure->compute_vector();
pressure->invoked_flag |= INVOKED_VECTOR;
}
compute_pzz();
} else if (strcmp(word,"pxy") == 0) {
if (!pressure)
error->all(FLERR,"Thermo keyword in variable requires "
"thermo to use/init press");
if (update->whichflag == 0) {
if (pressure->invoked_vector != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
pressure->compute_vector();
pressure->invoked_flag |= INVOKED_VECTOR;
}
compute_pxy();
} else if (strcmp(word,"pxz") == 0) {
if (!pressure)
error->all(FLERR,"Thermo keyword in variable requires "
"thermo to use/init press");
if (update->whichflag == 0) {
if (pressure->invoked_vector != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
pressure->compute_vector();
pressure->invoked_flag |= INVOKED_VECTOR;
}
compute_pxz();
} else if (strcmp(word,"pyz") == 0) {
if (!pressure)
error->all(FLERR,"Thermo keyword in variable requires "
"thermo to use/init press");
if (update->whichflag == 0) {
if (pressure->invoked_vector != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current");
} else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
pressure->compute_vector();
pressure->invoked_flag |= INVOKED_VECTOR;
}
compute_pyz();
} else if (strcmp(word,"fmax") == 0) compute_fmax();
else if (strcmp(word,"fnorm") == 0) compute_fnorm();
else if (strcmp(word,"cella") == 0) compute_cella();
else if (strcmp(word,"cellb") == 0) compute_cellb();
else if (strcmp(word,"cellc") == 0) compute_cellc();
else if (strcmp(word,"cellalpha") == 0) compute_cellalpha();
else if (strcmp(word,"cellbeta") == 0) compute_cellbeta();
else if (strcmp(word,"cellgamma") == 0) compute_cellgamma();
else return 1;
*answer = dvalue;
return 0;
}
/* ----------------------------------------------------------------------
extraction of Compute, Fix, Variable results
compute/fix are normalized by atoms if returning extensive value
variable value is not normalized (formula should normalize if desired)
------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
void Thermo::compute_compute()
{
int m = field2index[ifield];
Compute *compute = computes[m];
if (compute_which[m] == SCALAR) {
dvalue = compute->scalar;
if (normflag && compute->extscalar) dvalue /= natoms;
} else if (compute_which[m] == VECTOR) {
dvalue = compute->vector[argindex1[ifield]-1];
if (normflag) {
if (compute->extvector == 0) return;
else if (compute->extvector == 1) dvalue /= natoms;
else if (compute->extlist[argindex1[ifield]-1]) dvalue /= natoms;
}
} else {
dvalue = compute->array[argindex1[ifield]-1][argindex2[ifield]-1];
if (normflag && compute->extarray) dvalue /= natoms;
}
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_fix()
{
int m = field2index[ifield];
Fix *fix = fixes[m];
if (argindex1[ifield] == 0) {
dvalue = fix->compute_scalar();
if (normflag && fix->extscalar) dvalue /= natoms;
} else if (argindex2[ifield] == 0) {
dvalue = fix->compute_vector(argindex1[ifield]-1);
if (normflag) {
if (fix->extvector == 0) return;
else if (fix->extvector == 1) dvalue /= natoms;
else if (fix->extlist[argindex1[ifield]-1]) dvalue /= natoms;
}
} else {
dvalue = fix->compute_array(argindex1[ifield]-1,argindex2[ifield]-1);
if (normflag && fix->extarray) dvalue /= natoms;
}
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_variable()
{
dvalue = input->variable->compute_equal(variables[field2index[ifield]]);
}
/* ----------------------------------------------------------------------
one method for every keyword thermo can output
called by compute() or evaluate_keyword()
compute will have already been called
set ivalue/dvalue/bivalue if value is int/double/bigint
customize a new keyword by adding a method
------------------------------------------------------------------------- */
void Thermo::compute_step()
{
bivalue = update->ntimestep;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_elapsed()
{
bivalue = update->ntimestep - update->firststep;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_elapsed_long()
{
bivalue = update->ntimestep - update->beginstep;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_dt()
{
dvalue = update->dt;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_cpu()
{
if (firststep == 0) dvalue = 0.0;
else dvalue = timer->elapsed(TIME_LOOP);
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_tpcpu()
{
double new_cpu;
double new_time = update->ntimestep * update->dt;
if (firststep == 0) {
new_cpu = 0.0;
dvalue = 0.0;
} else {
new_cpu = timer->elapsed(TIME_LOOP);
double cpu_diff = new_cpu - last_tpcpu;
double time_diff = new_time - last_time;
if (time_diff > 0.0 && cpu_diff > 0.0) dvalue = time_diff/cpu_diff;
else dvalue = 0.0;
}
last_time = new_time;
last_tpcpu = new_cpu;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_spcpu()
{
double new_cpu;
int new_step = update->ntimestep;
if (firststep == 0) {
new_cpu = 0.0;
dvalue = 0.0;
} else {
new_cpu = timer->elapsed(TIME_LOOP);
double cpu_diff = new_cpu - last_spcpu;
int step_diff = new_step - last_step;
if (cpu_diff > 0.0) dvalue = step_diff/cpu_diff;
else dvalue = 0.0;
}
last_step = new_step;
last_spcpu = new_cpu;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_atoms()
{
bivalue = natoms;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_temp()
{
dvalue = temperature->scalar;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_press()
{
dvalue = pressure->scalar;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_pe()
{
dvalue = pe->scalar;
if (normflag) dvalue /= natoms;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_ke()
{
dvalue = temperature->scalar;
dvalue *= 0.5 * temperature->dof * force->boltz;
if (normflag) dvalue /= natoms;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_etotal()
{
compute_pe();
double ke = temperature->scalar;
ke *= 0.5 * temperature->dof * force->boltz;
if (normflag) ke /= natoms;
dvalue += ke;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_enthalpy()
{
compute_etotal();
double etmp = dvalue;
compute_vol();
double vtmp = dvalue;
if (normflag) vtmp /= natoms;
compute_press();
double ptmp = dvalue;
dvalue = etmp + ptmp*vtmp/(force->nktv2p);
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_evdwl()
{
double tmp = 0.0;
if (force->pair) tmp += force->pair->eng_vdwl;
MPI_Allreduce(&tmp,&dvalue,1,MPI_DOUBLE,MPI_SUM,world);
if (force->pair && force->pair->tail_flag) {
double volume = domain->xprd * domain->yprd * domain->zprd;
dvalue += force->pair->etail / volume;
}
if (normflag) dvalue /= natoms;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_ecoul()
{
double tmp = 0.0;
if (force->pair) tmp += force->pair->eng_coul;
MPI_Allreduce(&tmp,&dvalue,1,MPI_DOUBLE,MPI_SUM,world);
if (normflag) dvalue /= natoms;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_epair()
{
double tmp = 0.0;
if (force->pair) tmp += force->pair->eng_vdwl + force->pair->eng_coul;
MPI_Allreduce(&tmp,&dvalue,1,MPI_DOUBLE,MPI_SUM,world);
if (force->kspace) dvalue += force->kspace->energy;
if (force->pair && force->pair->tail_flag) {
double volume = domain->xprd * domain->yprd * domain->zprd;
dvalue += force->pair->etail / volume;
}
if (normflag) dvalue /= natoms;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_ebond()
{
if (force->bond) {
double tmp = force->bond->energy;
MPI_Allreduce(&tmp,&dvalue,1,MPI_DOUBLE,MPI_SUM,world);
if (normflag) dvalue /= natoms;
} else dvalue = 0.0;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_eangle()
{
if (force->angle) {
double tmp = force->angle->energy;
MPI_Allreduce(&tmp,&dvalue,1,MPI_DOUBLE,MPI_SUM,world);
if (normflag) dvalue /= natoms;
} else dvalue = 0.0;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_edihed()
{
if (force->dihedral) {
double tmp = force->dihedral->energy;
MPI_Allreduce(&tmp,&dvalue,1,MPI_DOUBLE,MPI_SUM,world);
if (normflag) dvalue /= natoms;
} else dvalue = 0.0;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_eimp()
{
if (force->improper) {
double tmp = force->improper->energy;
MPI_Allreduce(&tmp,&dvalue,1,MPI_DOUBLE,MPI_SUM,world);
if (normflag) dvalue /= natoms;
} else dvalue = 0.0;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_emol()
{
double tmp = 0.0;
if (atom->molecular) {
if (force->bond) tmp += force->bond->energy;
if (force->angle) tmp += force->angle->energy;
if (force->dihedral) tmp += force->dihedral->energy;
if (force->improper) tmp += force->improper->energy;
MPI_Allreduce(&tmp,&dvalue,1,MPI_DOUBLE,MPI_SUM,world);
if (normflag) dvalue /= natoms;
} else dvalue = 0.0;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_elong()
{
if (force->kspace) {
dvalue = force->kspace->energy;
if (normflag) dvalue /= natoms;
} else dvalue = 0.0;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_etail()
{
if (force->pair && force->pair->tail_flag) {
double volume = domain->xprd * domain->yprd * domain->zprd;
dvalue = force->pair->etail / volume;
if (normflag) dvalue /= natoms;
} else dvalue = 0.0;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_vol()
{
if (domain->dimension == 3)
dvalue = domain->xprd * domain->yprd * domain->zprd;
else
dvalue = domain->xprd * domain->yprd;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_lx()
{
dvalue = domain->xprd;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_ly()
{
dvalue = domain->yprd;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_lz()
{
dvalue = domain->zprd;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_xlo()
{
dvalue = domain->boxlo[0];
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_xhi()
{
dvalue = domain->boxhi[0];
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_ylo()
{
dvalue = domain->boxlo[1];
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_yhi()
{
dvalue = domain->boxhi[1];
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_zlo()
{
dvalue = domain->boxlo[2];
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_zhi()
{
dvalue = domain->boxhi[2];
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_xy()
{
dvalue = domain->xy;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_xz()
{
dvalue = domain->xz;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_yz()
{
dvalue = domain->yz;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_xlat()
{
dvalue = domain->lattice->xlattice;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_ylat()
{
dvalue = domain->lattice->ylattice;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_zlat()
{
dvalue = domain->lattice->zlattice;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_pxx()
{
dvalue = pressure->vector[0];
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_pyy()
{
dvalue = pressure->vector[1];
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_pzz()
{
dvalue = pressure->vector[2];
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_pxy()
{
dvalue = pressure->vector[3];
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_pxz()
{
dvalue = pressure->vector[4];
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_pyz()
{
dvalue = pressure->vector[5];
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_fmax()
{
double **f = atom->f;
int nlocal = atom->nlocal;
double max = 0.0;
for (int i = 0; i < nlocal; i++) {
max = MAX(max,fabs(f[i][0]));
max = MAX(max,fabs(f[i][1]));
max = MAX(max,fabs(f[i][2]));
}
double maxall;
MPI_Allreduce(&max,&maxall,1,MPI_DOUBLE,MPI_MAX,world);
dvalue = maxall;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_fnorm()
{
double **f = atom->f;
int nlocal = atom->nlocal;
double dot = 0.0;
for (int i = 0; i < nlocal; i++)
dot += f[i][0]*f[i][0] + f[i][1]*f[i][1] + f[i][2]*f[i][2];
double dotall;
MPI_Allreduce(&dot,&dotall,1,MPI_DOUBLE,MPI_SUM,world);
dvalue = sqrt(dotall);
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_cella()
{
dvalue = domain->xprd;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_cellb()
{
if (!domain->triclinic)
dvalue = domain->yprd;
else {
double* h = domain->h;
dvalue = sqrt(h[1]*h[1]+h[5]*h[5]);
}
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_cellc()
{
if (!domain->triclinic)
dvalue = domain->zprd;
else {
double* h = domain->h;
dvalue = sqrt(h[2]*h[2]+h[3]*h[3]+h[4]*h[4]);
}
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_cellalpha()
{
if (!domain->triclinic)
dvalue = 90.0;
else {
// Cos(alpha) = (xy.xz + ly.yz)/(b.c)
double* h = domain->h;
double cosalpha = (h[5]*h[4]+h[1]*h[3])/
sqrt((h[1]*h[1]+h[5]*h[5])*(h[2]*h[2]+h[3]*h[3]+h[4]*h[4]));
dvalue = acos(cosalpha)*180.0/MY_PI;
}
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_cellbeta()
{
if (!domain->triclinic)
dvalue = 90.0;
else {
// Cos(beta) = xz/c
double* h = domain->h;
double cosbeta = h[4]/sqrt(h[2]*h[2]+h[3]*h[3]+h[4]*h[4]);
dvalue = acos(cosbeta)*180.0/MY_PI;
}
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_cellgamma()
{
if (!domain->triclinic)
dvalue = 90.0;
else {
// Cos(gamma) = xy/b
double* h = domain->h;
double cosgamma = h[5]/sqrt(h[1]*h[1]+h[5]*h[5]);
dvalue = acos(cosgamma)*180.0/MY_PI;
}
}
diff --git a/src/thermo.h b/src/thermo.h
index d68fff887..dd935daa6 100644
--- a/src/thermo.h
+++ b/src/thermo.h
@@ -1,187 +1,375 @@
/* ----------------------------------------------------------------------
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_THERMO_H
#define LMP_THERMO_H
#include "pointers.h"
namespace LAMMPS_NS {
class Thermo : protected Pointers {
friend class WriteRestart; // accesses lostflag
friend class MinCG; // accesses compute_pe
public:
char *style;
int normflag; // 0 if do not normalize by atoms, 1 if normalize
int modified; // 1 if thermo_modify has been used, else 0
int cudable; // 1 if all computes used are cudable
Thermo(class LAMMPS *, int, char **);
~Thermo();
void init();
bigint lost_check();
void modify_params(int, char **);
void header();
void compute(int);
int evaluate_keyword(char *, double *);
private:
char *line;
char **keyword;
int *vtype;
int nfield,nfield_initial;
int me;
char **format,**format_user;
char *format_float_one_def,*format_float_multi_def;
char *format_int_one_def,*format_int_multi_def;
char *format_float_user,*format_int_user,*format_bigint_user;
char format_multi[128];
char format_bigint_one_def[8],format_bigint_multi_def[8];
int normvalue; // use this for normflag unless natoms = 0
int normuserflag; // 0 if user has not set, 1 if has
int normuser;
int firststep;
int lostflag,lostbefore;
int flushflag,lineflag;
double last_tpcpu,last_spcpu;
double last_time;
bigint last_step;
bigint natoms;
// data used by routines that compute single values
int ivalue; // integer value to print
double dvalue; // double value to print
bigint bivalue; // big integer value to print
int ifield; // which field in thermo output is being computed
int *field2index; // which compute,fix,variable calcs this field
int *argindex1; // indices into compute,fix scalar,vector
int *argindex2;
// data for keyword-specific Compute objects
// index = where they are in computes list
// id = ID of Compute objects
// Compute * = ptrs to the Compute objects
int index_temp,index_press_scalar,index_press_vector,index_pe;
char *id_temp,*id_press,*id_pe;
class Compute *temperature,*pressure,*pe;
int ncompute; // # of Compute objects called by thermo
char **id_compute; // their IDs
int *compute_which; // 0/1 if should call scalar() or vector()
class Compute **computes; // list of ptrs to the Compute objects
int nfix; // # of Fix objects called by thermo
char **id_fix; // their IDs
class Fix **fixes; // list of ptrs to the Fix objects
int nvariable; // # of variables evaulated by thermo
char **id_variable; // list of variable names
int *variables; // list of Variable indices
// private methods
void allocate();
void deallocate();
void parse_fields(char *);
int add_compute(const char *, int);
int add_fix(const char *);
int add_variable(const char *);
typedef void (Thermo::*FnPtr)();
void addfield(const char *, FnPtr, int);
FnPtr *vfunc; // list of ptrs to functions
void compute_compute(); // functions that compute a single value
void compute_fix(); // via calls to Compute,Fix,Variable classes
void compute_variable();
// functions that compute a single value
// customize a new keyword by adding a method prototype
void compute_step();
void compute_elapsed();
void compute_elapsed_long();
void compute_dt();
void compute_cpu();
void compute_tpcpu();
void compute_spcpu();
void compute_atoms();
void compute_temp();
void compute_press();
void compute_pe();
void compute_ke();
void compute_etotal();
void compute_enthalpy();
void compute_evdwl();
void compute_ecoul();
void compute_epair();
void compute_ebond();
void compute_eangle();
void compute_edihed();
void compute_eimp();
void compute_emol();
void compute_elong();
void compute_etail();
void compute_vol();
void compute_lx();
void compute_ly();
void compute_lz();
void compute_xlo();
void compute_xhi();
void compute_ylo();
void compute_yhi();
void compute_zlo();
void compute_zhi();
void compute_xy();
void compute_xz();
void compute_yz();
void compute_xlat();
void compute_ylat();
void compute_zlat();
void compute_pxx();
void compute_pyy();
void compute_pzz();
void compute_pxy();
void compute_pyz();
void compute_pxz();
void compute_fmax();
void compute_fnorm();
void compute_cella();
void compute_cellb();
void compute_cellc();
void compute_cellalpha();
void compute_cellbeta();
void compute_cellgamma();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+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 thermo compute ID
+
+Compute ID specified in thermo_style command does not exist.
+
+E: Could not find thermo fix ID
+
+Fix ID specified in thermo_style command does not exist.
+
+E: Thermo and fix not computed at compatible times
+
+Fixes generate values on specific timesteps. The thermo output
+does not match these timesteps.
+
+E: Could not find thermo custom variable name
+
+Self-explanatory.
+
+E: Too many total atoms
+
+See the setting for bigint in the src/lmptype.h file.
+
+E: Lost atoms: original %ld current %ld
+
+UNDOCUMENTED
+
+E: Thermo style does not use temp
+
+Cannot use thermo_modify to set this parameter since the thermo_style
+is not computing this quantity.
+
+E: Could not find thermo_modify temperature ID
+
+The compute ID needed by thermo style custom to compute temperature does
+not exist.
+
+E: Thermo_modify temperature ID does not compute temperature
+
+The specified compute ID does not compute temperature.
+
+W: Temperature for thermo pressure is not for group all
+
+User-assigned temperature to thermo via the thermo_modify command does
+not compute temperature for all atoms. Since thermo computes a global
+pressure, the kinetic energy contribution from the temperature is
+assumed to also be for all atoms. Thus the pressure printed by thermo
+could be inaccurate.
+
+E: Pressure ID for thermo does not exist
+
+The compute ID needed to compute pressure for thermodynamics does not
+exist.
+
+E: Thermo style does not use press
+
+Cannot use thermo_modify to set this parameter since the thermo_style
+is not computing this quantity.
+
+E: Could not find thermo_modify pressure ID
+
+The compute ID needed by thermo style custom to compute pressure does
+not exist.
+
+E: Thermo_modify pressure ID does not compute pressure
+
+The specified compute ID does not compute pressure.
+
+E: Thermo_modify int format does not contain d character
+
+Self-explanatory.
+
+E: Thermo keyword requires lattice be defined
+
+The xlat, ylat, zlat keywords refer to lattice properties.
+
+E: Could not find thermo custom compute ID
+
+The compute ID needed by thermo style custom to compute a requested
+quantity does not exist.
+
+E: Thermo compute does not compute scalar
+
+Self-explanatory.
+
+E: Thermo compute does not compute vector
+
+Self-explanatory.
+
+E: Thermo compute vector is accessed out-of-range
+
+Self-explanatory.
+
+E: Thermo compute does not compute array
+
+Self-explanatory.
+
+E: Thermo compute array is accessed out-of-range
+
+Self-explanatory.
+
+E: Could not find thermo custom fix ID
+
+The fix ID needed by thermo style custom to compute a requested
+quantity does not exist.
+
+E: Thermo fix does not compute scalar
+
+Self-explanatory.
+
+E: Thermo fix does not compute vector
+
+Self-explanatory.
+
+E: Thermo fix vector is accessed out-of-range
+
+Self-explanatory.
+
+E: Thermo fix does not compute array
+
+Self-explanatory.
+
+E: Thermo fix array is accessed out-of-range
+
+Self-explanatory.
+
+E: Thermo custom variable is not equal-style variable
+
+Only equal-style variables can be output with thermodynamics, not
+atom-style variables.
+
+E: Thermo custom variable cannot be indexed
+
+Self-explanatory.
+
+E: Invalid keyword in thermo_style custom command
+
+One or more specified keywords are not recognized.
+
+E: This variable thermo keyword cannot be used between runs
+
+Keywords that refer to time (such as cpu, elapsed) do not
+make sense in between runs.
+
+E: Thermo keyword in variable requires thermo to use/init temp
+
+You are using a thermo keyword in a variable that requires temperature
+to be calculated, but your thermo output does not use it. Add it to
+your thermo output.
+
+E: Compute used in variable thermo keyword between runs is not current
+
+Some thermo keywords rely on a compute to calculate their value(s).
+Computes cannot be invoked by a variable in between runs. Thus they
+must have been evaluated on the last timestep of the previous run in
+order for their value(s) to be accessed. See the doc page for the
+variable command for more info.
+
+E: Thermo keyword in variable requires thermo to use/init press
+
+You are using a thermo keyword in a variable that requires pressure to
+be calculated, but your thermo output does not use it. Add it to your
+thermo output.
+
+E: Thermo keyword in variable requires thermo to use/init pe
+
+You are using a thermo keyword in a variable that requires
+potential energy to be calculated, but your thermo output
+does not use it. Add it to your thermo output.
+
+E: Energy was not tallied on needed timestep
+
+You are using a thermo keyword that requires potentials to
+have tallied energy, but they didn't on this timestep. See the
+variable doc page for ideas on how to make this work.
+
+E: Thermo keyword in variable requires lattice be defined
+
+The xlat, ylat, zlat keywords refer to lattice properties.
+
+*/
diff --git a/src/universe.cpp b/src/universe.cpp
index 91c9824bd..903817293 100644
--- a/src/universe.cpp
+++ b/src/universe.cpp
@@ -1,173 +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.
------------------------------------------------------------------------- */
#include "mpi.h"
#include "stdlib.h"
#include "string.h"
#include "stdio.h"
#include "universe.h"
#include "version.h"
#include "error.h"
#include "memory.h"
using namespace LAMMPS_NS;
#define MAXLINE 256
/* ----------------------------------------------------------------------
create & initialize the universe of processors in communicator
------------------------------------------------------------------------- */
Universe::Universe(LAMMPS *lmp, MPI_Comm communicator) : Pointers(lmp)
{
version = (char *) LAMMPS_VERSION "-ICMS";
uworld = uorig = communicator;
MPI_Comm_rank(uworld,&me);
MPI_Comm_size(uworld,&nprocs);
uscreen = stdout;
ulogfile = NULL;
existflag = 0;
nworlds = 0;
procs_per_world = NULL;
root_proc = NULL;
memory->create(uni2orig,nprocs,"universe:uni2orig");
for (int i = 0; i < nprocs; i++) uni2orig[i] = i;
}
/* ---------------------------------------------------------------------- */
Universe::~Universe()
{
if (uworld != uorig) MPI_Comm_free(&uworld);
memory->destroy(procs_per_world);
memory->destroy(root_proc);
memory->destroy(uni2orig);
}
/* ----------------------------------------------------------------------
- reorder universe processors based on custom file
+ reorder universe processors
+ create uni2orig as inverse mapping
+ re-create uworld communicator with new ordering via Comm_split()
+ style = "nth", arg = N
+ move every Nth proc to end of rankings
+ style = "custom", arg = filename
file has nprocs lines with I J
I = universe proc ID in original communicator uorig
J = universe proc ID in reordered communicator uworld
- create uni2orig as inverse mapping
- re-create uworld communicator with new ordering via Comm_split()
------------------------------------------------------------------------- */
-void Universe::reorder(char *file)
+void Universe::reorder(char *style, char *arg)
{
char line[MAXLINE];
if (uworld != uorig) MPI_Comm_free(&uworld);
- if (me == 0) {
- FILE *fp = fopen(file,"r");
- if (fp == NULL) error->universe_one(FLERR,"Cannot open -reorder file");
-
- // skip header = blank and comment lines
-
- char *ptr;
- if (!fgets(line,MAXLINE,fp))
- error->one(FLERR,"Unexpected end of -reorder file");
- while (1) {
- if (ptr = strchr(line,'#')) *ptr = '\0';
- if (strspn(line," \t\n\r") != strlen(line)) break;
- if (!fgets(line,MAXLINE,fp))
- error->one(FLERR,"Unexpected end of -reorder file");
+ if (strcmp(style,"nth") == 0) {
+ int n = atoi(arg);
+ if (n <= 0)
+ error->universe_all(FLERR,"Invalid -reorder N value");
+ if (nprocs % n)
+ error->universe_all(FLERR,"Nprocs not a multiple of N for -reorder");
+ for (int i = 0; i < nprocs; i++) {
+ if (i < (n-1)*nprocs/n) uni2orig[i] = i/(n-1) * n + (i % (n-1));
+ else uni2orig[i] = (i - (n-1)*nprocs/n) * n + n-1;
}
- // read nprocs lines
- // uni2orig = inverse mapping
+ } else if (strcmp(style,"custom") == 0) {
+
+ if (me == 0) {
+ FILE *fp = fopen(arg,"r");
+ if (fp == NULL) error->universe_one(FLERR,"Cannot open -reorder file");
- int me_orig,me_new;
- sscanf(line,"%d %d",&me_orig,&me_new);
- if (me_orig < 0 || me_orig >= nprocs ||
- me_new < 0 || me_new >= nprocs)
- error->one(FLERR,"Invalid entry in reorder file");
- uni2orig[me_new] = me_orig;
+ // skip header = blank and comment lines
- for (int i = 1; i < nprocs; i++) {
+ char *ptr;
if (!fgets(line,MAXLINE,fp))
- error->one(FLERR,"Unexpected end of reorder file");
- sscanf(line,"%ld %ld",&me_orig,&me_new);
+ error->one(FLERR,"Unexpected end of -reorder file");
+ while (1) {
+ if (ptr = strchr(line,'#')) *ptr = '\0';
+ if (strspn(line," \t\n\r") != strlen(line)) break;
+ if (!fgets(line,MAXLINE,fp))
+ error->one(FLERR,"Unexpected end of -reorder file");
+ }
+
+ // read nprocs lines
+ // uni2orig = inverse mapping
+
+ int me_orig,me_new;
+ sscanf(line,"%d %d",&me_orig,&me_new);
if (me_orig < 0 || me_orig >= nprocs ||
me_new < 0 || me_new >= nprocs)
error->one(FLERR,"Invalid entry in reorder file");
uni2orig[me_new] = me_orig;
+
+ for (int i = 1; i < nprocs; i++) {
+ if (!fgets(line,MAXLINE,fp))
+ error->one(FLERR,"Unexpected end of reorder file");
+ sscanf(line,"%d %d",&me_orig,&me_new);
+ if (me_orig < 0 || me_orig >= nprocs ||
+ me_new < 0 || me_new >= nprocs)
+ error->one(FLERR,"Invalid entry in reorder file");
+ uni2orig[me_new] = me_orig;
+ }
+ fclose(fp);
}
- fclose(fp);
- }
- MPI_Bcast(uni2orig,nprocs,MPI_INT,0,uorig);
+ // bcast uni2org from proc 0 to all other universe procs
+
+ MPI_Bcast(uni2orig,nprocs,MPI_INT,0,uorig);
+
+ } else error->universe_all(FLERR,"Invalid command-line argument");
+
+ // create new uworld communicator
int ome,key;
MPI_Comm_rank(uorig,&ome);
for (int i = 0; i < nprocs; i++)
if (uni2orig[i] == ome) key = i;
MPI_Comm_split(uorig,0,key,&uworld);
MPI_Comm_rank(uworld,&me);
MPI_Comm_size(uworld,&nprocs);
}
/* ----------------------------------------------------------------------
add 1 or more worlds to universe
str == NULL -> add 1 world with all procs in universe
str = NxM -> add N worlds, each with M procs
str = P -> add 1 world with P procs
------------------------------------------------------------------------- */
void Universe::add_world(char *str)
{
int n,nper;
char *ptr;
if (str == NULL) {
n = 1;
nper = nprocs;
} else if ((ptr = strchr(str,'x')) != NULL) {
*ptr = '\0';
n = atoi(str);
nper = atoi(ptr+1);
} else {
n = 1;
nper = atoi(str);
}
memory->grow(procs_per_world,nworlds+n,"universe:procs_per_world");
memory->grow(root_proc,(nworlds+n),"universe:root_proc");
for (int i = 0; i < n; i++) {
procs_per_world[nworlds] = nper;
if (nworlds == 0) root_proc[nworlds] = 0;
else
root_proc[nworlds] = root_proc[nworlds-1] + procs_per_world[nworlds-1];
if (me >= root_proc[nworlds]) iworld = nworlds;
nworlds++;
}
}
/* ----------------------------------------------------------------------
check if total procs in all worlds = procs in universe
------------------------------------------------------------------------- */
int Universe::consistent()
{
int n = 0;
for (int i = 0; i < nworlds; i++) n += procs_per_world[i];
if (n == nprocs) return 1;
else return 0;
}
diff --git a/src/universe.h b/src/universe.h
index 7a601a337..fafca7383 100644
--- a/src/universe.h
+++ b/src/universe.h
@@ -1,51 +1,84 @@
/* ----------------------------------------------------------------------
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_UNIVERSE_H
#define LMP_UNIVERSE_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class Universe : protected Pointers {
public:
char *version; // LAMMPS version string = date
MPI_Comm uworld; // communicator for entire universe
int me,nprocs; // my place in universe
FILE *uscreen; // universe screen output
FILE *ulogfile; // universe logfile
int existflag; // 1 if universe exists due to -partition flag
int nworlds; // # of worlds in universe
int iworld; // which world I am in
int *procs_per_world; // # of procs in each world
int *root_proc; // root proc in each world
MPI_Comm uorig; // original communicator passed to LAMMPS instance
int *uni2orig; // proc I in universe uworld is
// proc uni2orig[I] in original communicator
Universe(class LAMMPS *, MPI_Comm);
~Universe();
- void reorder(char *);
+ void reorder(char *, char *);
void add_world(char *);
int consistent();
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: Invalid -reorder N value
+
+UNDOCUMENTED
+
+E: Nprocs not a multiple of N for -reorder
+
+UNDOCUMENTED
+
+E: Cannot open -reorder file
+
+UNDOCUMENTED
+
+E: Unexpected end of -reorder file
+
+UNDOCUMENTED
+
+E: Invalid entry in reorder file
+
+UNDOCUMENTED
+
+E: Unexpected end of reorder file
+
+UNDOCUMENTED
+
+E: Invalid command-line argument
+
+One or more command-line arguments is invalid. Check the syntax of
+the command you are using to launch LAMMPS.
+
+*/
diff --git a/src/update.h b/src/update.h
index 692f21548..12f947269 100644
--- a/src/update.h
+++ b/src/update.h
@@ -1,63 +1,115 @@
/* ----------------------------------------------------------------------
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_UPDATE_H
#define LMP_UPDATE_H
#include "pointers.h"
namespace LAMMPS_NS {
class Update : protected Pointers {
public:
double dt; // timestep
double etol,ftol; // minimizer tolerances on energy/force
bigint ntimestep; // current step (dynamics or min iterations)
int nsteps; // # of steps to run (dynamics or min iter)
int whichflag; // 0 for unset, 1 for dynamics, 2 for min
bigint firststep,laststep; // 1st & last step of this run
bigint beginstep,endstep; // 1st and last step of multiple runs
int first_update; // 0 before initial update, 1 after
int max_eval; // max force evaluations for minimizer
int restrict_output; // 1 if output should not write dump/restart
int setupflag; // set when setup() is computing forces
int multireplica; // 1 if min across replicas, else 0
bigint eflag_global,eflag_atom; // timestep global/peratom eng is tallied on
bigint vflag_global,vflag_atom; // ditto for virial
char *unit_style;
class Integrate *integrate;
char *integrate_style;
class Min *minimize;
char *minimize_style;
Update(class LAMMPS *);
~Update();
void init();
void set_units(const char *);
void create_integrate(int, char **, char *);
void create_minimize(int, char **);
void reset_timestep(int, char **);
bigint memory_usage();
private:
void new_integrate(char *, int, char **, char *, int &);
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+E: USER-CUDA mode requires CUDA variant of run style
+
+UNDOCUMENTED
+
+E: USER-CUDA mode requires CUDA variant of min style
+
+UNDOCUMENTED
+
+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: Illegal integrate style
+
+UNDOCUMENTED
+
+E: Cannot reset timestep with dump file already written to
+
+Changing the timestep will confuse when a dump file is written. Use
+the undump command, then restart the dump file.
+
+E: Cannot reset timestep with restart file already written
+
+Changing the timestep will confuse when a restart file is written.
+Use the "restart 0" command to turn off restarts, then start them
+again.
+
+E: Cannot reset timestep with a time-dependent fix defined
+
+You cannot reset the timestep when a fix that keeps track of elapsed
+time is in place.
+
+E: Cannot reset timestep with a dynamic region defined
+
+Dynamic regions (see the region command) have a time dependence.
+Thus you cannot change the timestep when one or more of these
+are defined.
+
+E: Timestep must be >= 0
+
+Specified timestep size is invalid.
+
+E: Too big a timestep
+
+UNDOCUMENTED
+
+*/
diff --git a/src/variable.cpp b/src/variable.cpp
index c6f955f75..428e8939f 100644
--- a/src/variable.cpp
+++ b/src/variable.cpp
@@ -1,3307 +1,3306 @@
/* ----------------------------------------------------------------------
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 "math.h"
#include "stdlib.h"
#include "string.h"
#include "ctype.h"
#include "unistd.h"
#include "variable.h"
#include "universe.h"
#include "atom.h"
#include "update.h"
#include "group.h"
#include "domain.h"
#include "region.h"
#include "modify.h"
#include "compute.h"
#include "fix.h"
#include "output.h"
#include "thermo.h"
#include "random_mars.h"
+#include "math_const.h"
#include "memory.h"
#include "error.h"
-#include "math_const.h"
-
using namespace LAMMPS_NS;
using namespace MathConst;
#define VARDELTA 4
#define MAXLEVEL 4
#define MYROUND(a) (( a-floor(a) ) >= .5) ? ceil(a) : floor(a)
enum{INDEX,LOOP,WORLD,UNIVERSE,ULOOP,STRING,EQUAL,ATOM};
enum{ARG,OP};
// customize by adding a function
enum{DONE,ADD,SUBTRACT,MULTIPLY,DIVIDE,CARAT,UNARY,
NOT,EQ,NE,LT,LE,GT,GE,AND,OR,
SQRT,EXP,LN,LOG,SIN,COS,TAN,ASIN,ACOS,ATAN,ATAN2,
RANDOM,NORMAL,CEIL,FLOOR,ROUND,RAMP,STAGGER,LOGFREQ,
VDISPLACE,SWIGGLE,CWIGGLE,GMASK,RMASK,GRMASK,
VALUE,ATOMARRAY,TYPEARRAY,INTARRAY};
// customize by adding a special function
enum{SUM,XMIN,XMAX,AVE,TRAP};
#define INVOKED_SCALAR 1
#define INVOKED_VECTOR 2
#define INVOKED_ARRAY 4
#define INVOKED_PERATOM 8
#define BIG 1.0e20
/* ---------------------------------------------------------------------- */
Variable::Variable(LAMMPS *lmp) : Pointers(lmp)
{
MPI_Comm_rank(world,&me);
nvar = maxvar = 0;
names = NULL;
style = NULL;
num = NULL;
which = NULL;
pad = NULL;
data = NULL;
randomequal = NULL;
randomatom = NULL;
precedence[DONE] = 0;
precedence[OR] = 1;
precedence[AND] = 2;
precedence[EQ] = precedence[NE] = 3;
precedence[LT] = precedence[LE] = precedence[GT] = precedence[GE] = 4;
precedence[ADD] = precedence[SUBTRACT] = 5;
precedence[MULTIPLY] = precedence[DIVIDE] = 6;
precedence[CARAT] = 7;
precedence[UNARY] = precedence[NOT] = 8;
}
/* ---------------------------------------------------------------------- */
Variable::~Variable()
{
for (int i = 0; i < nvar; i++) {
delete [] names[i];
if (style[i] == LOOP || style[i] == ULOOP) delete [] data[i][0];
else for (int j = 0; j < num[i]; j++) delete [] data[i][j];
delete [] data[i];
}
memory->sfree(names);
memory->destroy(style);
memory->destroy(num);
memory->destroy(which);
memory->destroy(pad);
memory->sfree(data);
delete randomequal;
delete randomatom;
}
/* ----------------------------------------------------------------------
called by variable command in input script
------------------------------------------------------------------------- */
void Variable::set(int narg, char **arg)
{
if (narg < 2) error->all(FLERR,"Illegal variable command");
// DELETE
// doesn't matter if variable no longer exists
if (strcmp(arg[1],"delete") == 0) {
if (narg != 2) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) remove(find(arg[0]));
return;
// INDEX
// num = listed args, which = 1st value, data = copied args
} else if (strcmp(arg[1],"index") == 0) {
if (narg < 3) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) extend();
style[nvar] = INDEX;
num[nvar] = narg - 2;
which[nvar] = 0;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(num[nvar],&arg[2],data[nvar]);
// LOOP
// 1 arg + pad: num = N, which = 1st value, data = single string
// 2 args + pad: num = N2, which = N1, data = single string
} else if (strcmp(arg[1],"loop") == 0) {
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) extend();
style[nvar] = LOOP;
int nfirst,nlast;
if (narg == 3 || (narg == 4 && strcmp(arg[3],"pad") == 0)) {
nfirst = 1;
nlast = atoi(arg[2]);
if (nlast <= 0) error->all(FLERR,"Illegal variable command");
if (narg == 4 && strcmp(arg[3],"pad") == 0) {
char digits[12];
sprintf(digits,"%d",nlast);
pad[nvar] = strlen(digits);
} else pad[nvar] = 0;
} else if (narg == 4 || (narg == 5 && strcmp(arg[4],"pad") == 0)) {
nfirst = atoi(arg[2]);
nlast = atoi(arg[3]);
if (nfirst > nlast || nlast <= 0) error->all(FLERR,"Illegal variable command");
if (narg == 5 && strcmp(arg[4],"pad") == 0) {
char digits[12];
sprintf(digits,"%d",nlast);
pad[nvar] = strlen(digits);
} else pad[nvar] = 0;
} else error->all(FLERR,"Illegal variable command");
num[nvar] = nlast;
which[nvar] = nfirst-1;
data[nvar] = new char*[1];
data[nvar][0] = NULL;
// WORLD
// num = listed args, which = partition this proc is in, data = copied args
// error check that num = # of worlds in universe
} else if (strcmp(arg[1],"world") == 0) {
if (narg < 3) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) extend();
style[nvar] = WORLD;
num[nvar] = narg - 2;
if (num[nvar] != universe->nworlds)
error->all(FLERR,"World variable count doesn't match # of partitions");
which[nvar] = universe->iworld;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(num[nvar],&arg[2],data[nvar]);
// UNIVERSE and ULOOP
// for UNIVERSE: num = listed args, data = copied args
// for ULOOP: num = N, data = single string
// which = partition this proc is in
// universe proc 0 creates lock file
// error check that all other universe/uloop variables are same length
} else if (strcmp(arg[1],"universe") == 0 || strcmp(arg[1],"uloop") == 0) {
if (strcmp(arg[1],"universe") == 0) {
if (narg < 3) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) extend();
style[nvar] = UNIVERSE;
num[nvar] = narg - 2;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(num[nvar],&arg[2],data[nvar]);
} else if (strcmp(arg[1],"uloop") == 0) {
if (narg < 3 || narg > 4 || (narg == 4 && strcmp(arg[3],"pad") != 0))
error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) extend();
style[nvar] = ULOOP;
num[nvar] = atoi(arg[2]);
data[nvar] = new char*[1];
data[nvar][0] = NULL;
if (narg == 4) {
char digits[12];
sprintf(digits,"%d",num[nvar]);
pad[nvar] = strlen(digits);
} else pad[nvar] = 0;
}
if (num[nvar] < universe->nworlds)
error->all(FLERR,"Universe/uloop variable count < # of partitions");
which[nvar] = universe->iworld;
if (universe->me == 0) {
FILE *fp = fopen("tmp.lammps.variable","w");
fprintf(fp,"%d\n",universe->nworlds);
fclose(fp);
}
for (int jvar = 0; jvar < nvar; jvar++)
if (num[jvar] && (style[jvar] == UNIVERSE || style[jvar] == ULOOP) &&
num[nvar] != num[jvar])
error->all(FLERR,"All universe/uloop variables must have same # of values");
// STRING
// remove pre-existing var if also style STRING (allows it to be reset)
// num = 1, which = 1st value
// data = 1 value, string to eval
} else if (strcmp(arg[1],"string") == 0) {
if (narg != 3) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) {
if (style[find(arg[0])] != STRING)
error->all(FLERR,"Cannot redefine variable as a different style");
remove(find(arg[0]));
}
if (nvar == maxvar) extend();
style[nvar] = STRING;
num[nvar] = 1;
which[nvar] = 0;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(1,&arg[2],data[nvar]);
// EQUAL
// remove pre-existing var if also style EQUAL (allows it to be reset)
// num = 2, which = 1st value
// data = 2 values, 1st is string to eval, 2nd is filled on retrieval
} else if (strcmp(arg[1],"equal") == 0) {
if (narg != 3) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) {
if (style[find(arg[0])] != EQUAL)
error->all(FLERR,"Cannot redefine variable as a different style");
remove(find(arg[0]));
}
if (nvar == maxvar) extend();
style[nvar] = EQUAL;
num[nvar] = 2;
which[nvar] = 0;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(1,&arg[2],data[nvar]);
data[nvar][1] = NULL;
// ATOM
// remove pre-existing var if also style ATOM (allows it to be reset)
// num = 1, which = 1st value
// data = 1 value, string to eval
} else if (strcmp(arg[1],"atom") == 0) {
if (narg != 3) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) {
if (style[find(arg[0])] != ATOM)
error->all(FLERR,"Cannot redefine variable as a different style");
remove(find(arg[0]));
}
if (nvar == maxvar) extend();
style[nvar] = ATOM;
num[nvar] = 1;
which[nvar] = 0;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(1,&arg[2],data[nvar]);
} else error->all(FLERR,"Illegal variable command");
// set name of variable
// must come at end, since STRING/EQUAL/ATOM reset may have removed name
// name must be all alphanumeric chars or underscores
int n = strlen(arg[0]) + 1;
names[nvar] = new char[n];
strcpy(names[nvar],arg[0]);
for (int i = 0; i < n-1; i++)
if (!isalnum(names[nvar][i]) && names[nvar][i] != '_')
error->all(FLERR,"Variable name must be alphanumeric or "
"underscore characters");
nvar++;
}
/* ----------------------------------------------------------------------
INDEX variable created by command-line argument
make it INDEX rather than STRING so cannot be re-defined in input script
------------------------------------------------------------------------- */
void Variable::set(char *name, int narg, char **arg)
{
char **newarg = new char*[2+narg];
newarg[0] = name;
newarg[1] = (char *) "index";
for (int i = 0; i < narg; i++) newarg[2+i] = arg[i];
set(2+narg,newarg);
delete [] newarg;
}
/* ----------------------------------------------------------------------
increment variable(s)
return 0 if OK if successfully incremented
return 1 if any variable is exhausted, free the variable to allow re-use
------------------------------------------------------------------------- */
int Variable::next(int narg, char **arg)
{
int ivar;
if (narg == 0) error->all(FLERR,"Illegal next command");
// check that variables exist and are all the same style
// exception: UNIVERSE and ULOOP variables can be mixed in same next command
for (int iarg = 0; iarg < narg; iarg++) {
ivar = find(arg[iarg]);
if (ivar == -1) error->all(FLERR,"Invalid variable in next command");
if (style[ivar] == ULOOP && style[find(arg[0])] == UNIVERSE) continue;
else if (style[ivar] == UNIVERSE && style[find(arg[0])] == ULOOP) continue;
else if (style[ivar] != style[find(arg[0])])
error->all(FLERR,"All variables in next command must be same style");
}
// invalid styles STRING or EQUAL or WORLD or ATOM
int istyle = style[find(arg[0])];
if (istyle == STRING || istyle == EQUAL || istyle == WORLD || istyle == ATOM)
error->all(FLERR,"Invalid variable style with next command");
// increment all variables in list
// if any variable is exhausted, set flag = 1 and remove var to allow re-use
int flag = 0;
if (istyle == INDEX || istyle == LOOP) {
for (int iarg = 0; iarg < narg; iarg++) {
ivar = find(arg[iarg]);
which[ivar]++;
if (which[ivar] >= num[ivar]) {
flag = 1;
remove(ivar);
}
}
} else if (istyle == UNIVERSE || istyle == ULOOP) {
// wait until lock file can be created and owned by proc 0 of this world
// read next available index and Bcast it within my world
// set all variables in list to nextindex
int nextindex;
if (me == 0) {
while (1) {
if (!rename("tmp.lammps.variable","tmp.lammps.variable.lock")) break;
usleep(100000);
}
FILE *fp = fopen("tmp.lammps.variable.lock","r");
fscanf(fp,"%d",&nextindex);
fclose(fp);
fp = fopen("tmp.lammps.variable.lock","w");
fprintf(fp,"%d\n",nextindex+1);
fclose(fp);
rename("tmp.lammps.variable.lock","tmp.lammps.variable");
if (universe->uscreen)
fprintf(universe->uscreen,
"Increment via next: value %d on partition %d\n",
nextindex+1,universe->iworld);
if (universe->ulogfile)
fprintf(universe->ulogfile,
"Increment via next: value %d on partition %d\n",
nextindex+1,universe->iworld);
}
MPI_Bcast(&nextindex,1,MPI_INT,0,world);
for (int iarg = 0; iarg < narg; iarg++) {
ivar = find(arg[iarg]);
which[ivar] = nextindex;
if (which[ivar] >= num[ivar]) {
flag = 1;
remove(ivar);
}
}
}
return flag;
}
/* ----------------------------------------------------------------------
return ptr to the data text associated with a variable
if INDEX or WORLD or UNIVERSE or STRING var, return ptr to stored string
if LOOP or ULOOP var, write int to data[0] and return ptr to string
if EQUAL var, evaluate variable and put result in str
if ATOM var, return NULL
return NULL if no variable or which is bad, caller must respond
------------------------------------------------------------------------- */
char *Variable::retrieve(char *name)
{
int ivar = find(name);
if (ivar == -1) return NULL;
if (which[ivar] >= num[ivar]) return NULL;
char *str;
if (style[ivar] == INDEX || style[ivar] == WORLD ||
style[ivar] == UNIVERSE || style[ivar] == STRING) {
str = data[ivar][which[ivar]];
} else if (style[ivar] == LOOP || style[ivar] == ULOOP) {
char result[16];
if (pad[ivar] == 0) sprintf(result,"%d",which[ivar]+1);
else {
char padstr[16];
sprintf(padstr,"%%0%dd",pad[ivar]);
sprintf(result,padstr,which[ivar]+1);
}
int n = strlen(result) + 1;
delete [] data[ivar][0];
data[ivar][0] = new char[n];
strcpy(data[ivar][0],result);
str = data[ivar][0];
} else if (style[ivar] == EQUAL) {
char result[32];
double answer = evaluate(data[ivar][0],NULL);
sprintf(result,"%.10g",answer);
int n = strlen(result) + 1;
if (data[ivar][1]) delete [] data[ivar][1];
data[ivar][1] = new char[n];
strcpy(data[ivar][1],result);
str = data[ivar][1];
} else if (style[ivar] == ATOM) return NULL;
return str;
}
/* ----------------------------------------------------------------------
return result of equal-style variable evaluation
------------------------------------------------------------------------- */
double Variable::compute_equal(int ivar)
{
return evaluate(data[ivar][0],NULL);
}
/* ----------------------------------------------------------------------
compute result of atom-style variable evaluation
only computed for atoms in igroup, else result is 0.0
answers are placed every stride locations into result
if sumflag, add variable values to existing result
------------------------------------------------------------------------- */
void Variable::compute_atom(int ivar, int igroup,
double *result, int stride, int sumflag)
{
Tree *tree;
double tmp = evaluate(data[ivar][0],&tree);
tmp = collapse_tree(tree);
int groupbit = group->bitmask[igroup];
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (sumflag == 0) {
int m = 0;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) result[m] = eval_tree(tree,i);
else result[m] = 0.0;
m += stride;
}
} else {
int m = 0;
for (int i = 0; i < nlocal; i++) {
if (mask[i] && groupbit) result[m] += eval_tree(tree,i);
m += stride;
}
}
free_tree(tree);
}
/* ----------------------------------------------------------------------
search for name in list of variables names
return index or -1 if not found
------------------------------------------------------------------------- */
int Variable::find(char *name)
{
for (int i = 0; i < nvar; i++)
if (strcmp(name,names[i]) == 0) return i;
return -1;
}
/* ----------------------------------------------------------------------
return 1 if variable is EQUAL style, 0 if not
------------------------------------------------------------------------- */
int Variable::equalstyle(int ivar)
{
if (style[ivar] == EQUAL) return 1;
return 0;
}
/* ----------------------------------------------------------------------
return 1 if variable is ATOM style, 0 if not
------------------------------------------------------------------------- */
int Variable::atomstyle(int ivar)
{
if (style[ivar] == ATOM) return 1;
return 0;
}
/* ----------------------------------------------------------------------
remove Nth variable from list and compact list
------------------------------------------------------------------------- */
void Variable::remove(int n)
{
delete [] names[n];
if (style[n] == LOOP || style[n] == ULOOP) delete [] data[n][0];
else for (int i = 0; i < num[n]; i++) delete [] data[n][i];
delete [] data[n];
for (int i = n+1; i < nvar; i++) {
names[i-1] = names[i];
style[i-1] = style[i];
num[i-1] = num[i];
which[i-1] = which[i];
pad[i-1] = pad[i];
data[i-1] = data[i];
}
nvar--;
}
/* ----------------------------------------------------------------------
make space in arrays for new variable
------------------------------------------------------------------------- */
void Variable::extend()
{
maxvar += VARDELTA;
names = (char **)
memory->srealloc(names,maxvar*sizeof(char *),"var:names");
memory->grow(style,maxvar,"var:style");
memory->grow(num,maxvar,"var:num");
memory->grow(which,maxvar,"var:which");
memory->grow(pad,maxvar,"var:pad");
data = (char ***)
memory->srealloc(data,maxvar*sizeof(char **),"var:data");
}
/* ----------------------------------------------------------------------
copy narg strings from **from to **to, and allocate space for them
------------------------------------------------------------------------- */
void Variable::copy(int narg, char **from, char **to)
{
int n;
for (int i = 0; i < narg; i++) {
n = strlen(from[i]) + 1;
to[i] = new char[n];
strcpy(to[i],from[i]);
}
}
/* ----------------------------------------------------------------------
recursive evaluation of a string str
str is an equal-style or atom-style formula containing one or more items:
number = 0.0, -5.45, 2.8e-4, ...
constant = PI
thermo keyword = ke, vol, atoms, ...
math operation = (),-x,x+y,x-y,x*y,x/y,x^y,
x==y,x!=y,x<y,x<=y,x>y,x>=y,x&&y,x||y,
sqrt(x),exp(x),ln(x),log(x),
sin(x),cos(x),tan(x),asin(x),atan2(y,x),...
group function = count(group), mass(group), xcm(group,x), ...
special function = sum(x),min(x), ...
atom value = x[i], y[i], vx[i], ...
atom vector = x, y, vx, ...
compute = c_ID, c_ID[i], c_ID[i][j]
fix = f_ID, f_ID[i], f_ID[i][j]
variable = v_name, v_name[i]
equal-style variables passes in tree = NULL:
evaluate the formula, return result as a double
atom-style variable passes in tree = non-NULL:
parse the formula but do not evaluate it
create a parse tree and return it
------------------------------------------------------------------------- */
double Variable::evaluate(char *str, Tree **tree)
{
int op,opprevious;
double value1,value2;
char onechar;
char *ptr;
double argstack[MAXLEVEL];
Tree *treestack[MAXLEVEL];
int opstack[MAXLEVEL];
int nargstack = 0;
int ntreestack = 0;
int nopstack = 0;
int i = 0;
int expect = ARG;
while (1) {
onechar = str[i];
// whitespace: just skip
if (isspace(onechar)) i++;
// ----------------
// parentheses: recursively evaluate contents of parens
// ----------------
else if (onechar == '(') {
if (expect == OP) error->all(FLERR,"Invalid syntax in variable formula");
expect = OP;
char *contents;
i = find_matching_paren(str,i,contents);
i++;
// evaluate contents and push on stack
if (tree) {
Tree *newtree;
evaluate(contents,&newtree);
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = evaluate(contents,NULL);
delete [] contents;
// ----------------
// number: push value onto stack
// ----------------
} else if (isdigit(onechar) || onechar == '.') {
if (expect == OP) error->all(FLERR,"Invalid syntax in variable formula");
expect = OP;
// istop = end of number, including scientific notation
int istart = i;
while (isdigit(str[i]) || str[i] == '.') i++;
if (str[i] == 'e' || str[i] == 'E') {
i++;
if (str[i] == '+' || str[i] == '-') i++;
while (isdigit(str[i])) i++;
}
int istop = i - 1;
int n = istop - istart + 1;
char *number = new char[n+1];
strncpy(number,&str[istart],n);
number[n] = '\0';
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = atof(number);
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = atof(number);
delete [] number;
// ----------------
// letter: c_ID, c_ID[], c_ID[][], f_ID, f_ID[], f_ID[][],
// v_name, v_name[], exp(), xcm(,), x, x[], PI, vol
// ----------------
} else if (isalpha(onechar)) {
if (expect == OP) error->all(FLERR,"Invalid syntax in variable formula");
expect = OP;
// istop = end of word
// word = all alphanumeric or underscore
int istart = i;
while (isalnum(str[i]) || str[i] == '_') i++;
int istop = i-1;
int n = istop - istart + 1;
char *word = new char[n+1];
strncpy(word,&str[istart],n);
word[n] = '\0';
// ----------------
// compute
// ----------------
if (strncmp(word,"c_",2) == 0) {
if (domain->box_exist == 0)
error->all(FLERR,"Variable evaluation before simulation box is defined");
n = strlen(word) - 2 + 1;
char *id = new char[n];
strcpy(id,&word[2]);
int icompute = modify->find_compute(id);
if (icompute < 0) error->all(FLERR,"Invalid compute ID in variable formula");
Compute *compute = modify->compute[icompute];
delete [] id;
// parse zero or one or two trailing brackets
// point i beyond last bracket
// nbracket = # of bracket pairs
// index1,index2 = int inside each bracket pair
int nbracket,index1,index2;
if (str[i] != '[') nbracket = 0;
else {
nbracket = 1;
ptr = &str[i];
index1 = int_between_brackets(ptr);
i = ptr-str+1;
if (str[i] == '[') {
nbracket = 2;
ptr = &str[i];
index2 = int_between_brackets(ptr);
i = ptr-str+1;
}
}
// c_ID = scalar from global scalar
if (nbracket == 0 && compute->scalar_flag) {
if (update->whichflag == 0) {
if (compute->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_SCALAR)) {
compute->compute_scalar();
compute->invoked_flag |= INVOKED_SCALAR;
}
value1 = compute->scalar;
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// c_ID[i] = scalar from global vector
} else if (nbracket == 1 && compute->vector_flag) {
if (index1 > compute->size_vector)
error->all(FLERR,"Variable formula compute vector "
"is accessed out-of-range");
if (update->whichflag == 0) {
if (compute->invoked_vector != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_VECTOR)) {
compute->compute_vector();
compute->invoked_flag |= INVOKED_VECTOR;
}
value1 = compute->vector[index1-1];
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// c_ID[i][j] = scalar from global array
} else if (nbracket == 2 && compute->array_flag) {
if (index1 > compute->size_array_rows)
error->all(FLERR,"Variable formula compute array "
"is accessed out-of-range");
if (index2 > compute->size_array_cols)
error->all(FLERR,"Variable formula compute array "
"is accessed out-of-range");
if (update->whichflag == 0) {
if (compute->invoked_array != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_ARRAY)) {
compute->compute_array();
compute->invoked_flag |= INVOKED_ARRAY;
}
value1 = compute->array[index1-1][index2-1];
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// c_ID[i] = scalar from per-atom vector
} else if (nbracket == 1 && compute->peratom_flag &&
compute->size_peratom_cols == 0) {
if (update->whichflag == 0) {
if (compute->invoked_peratom != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
compute->compute_peratom();
compute->invoked_flag |= INVOKED_PERATOM;
}
peratom2global(1,NULL,compute->vector_atom,1,index1,
tree,treestack,ntreestack,argstack,nargstack);
// c_ID[i][j] = scalar from per-atom array
} else if (nbracket == 2 && compute->peratom_flag &&
compute->size_peratom_cols > 0) {
if (index2 > compute->size_peratom_cols)
error->all(FLERR,"Variable formula compute array "
"is accessed out-of-range");
if (update->whichflag == 0) {
if (compute->invoked_peratom != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
compute->compute_peratom();
compute->invoked_flag |= INVOKED_PERATOM;
}
peratom2global(1,NULL,&compute->array_atom[0][index2-1],
compute->size_peratom_cols,index1,
tree,treestack,ntreestack,argstack,nargstack);
// c_ID = vector from per-atom vector
} else if (nbracket == 0 && compute->peratom_flag &&
compute->size_peratom_cols == 0) {
if (tree == NULL)
error->all(FLERR,"Per-atom compute in equal-style variable formula");
if (update->whichflag == 0) {
if (compute->invoked_peratom != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
compute->compute_peratom();
compute->invoked_flag |= INVOKED_PERATOM;
}
Tree *newtree = new Tree();
newtree->type = ATOMARRAY;
newtree->array = compute->vector_atom;
newtree->nstride = 1;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
// c_ID[i] = vector from per-atom array
} else if (nbracket == 1 && compute->peratom_flag &&
compute->size_peratom_cols > 0) {
if (tree == NULL)
error->all(FLERR,"Per-atom compute in equal-style variable formula");
if (index1 > compute->size_peratom_cols)
error->all(FLERR,"Variable formula compute array "
"is accessed out-of-range");
if (update->whichflag == 0) {
if (compute->invoked_peratom != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
compute->compute_peratom();
compute->invoked_flag |= INVOKED_PERATOM;
}
Tree *newtree = new Tree();
newtree->type = ATOMARRAY;
newtree->array = &compute->array_atom[0][index1-1];
newtree->nstride = compute->size_peratom_cols;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else error->all(FLERR,"Mismatched compute in variable formula");
// ----------------
// fix
// ----------------
} else if (strncmp(word,"f_",2) == 0) {
if (domain->box_exist == 0)
error->all(FLERR,"Variable evaluation before simulation box is defined");
n = strlen(word) - 2 + 1;
char *id = new char[n];
strcpy(id,&word[2]);
int ifix = modify->find_fix(id);
if (ifix < 0) error->all(FLERR,"Invalid fix ID in variable formula");
Fix *fix = modify->fix[ifix];
delete [] id;
// parse zero or one or two trailing brackets
// point i beyond last bracket
// nbracket = # of bracket pairs
// index1,index2 = int inside each bracket pair
int nbracket,index1,index2;
if (str[i] != '[') nbracket = 0;
else {
nbracket = 1;
ptr = &str[i];
index1 = int_between_brackets(ptr);
i = ptr-str+1;
if (str[i] == '[') {
nbracket = 2;
ptr = &str[i];
index2 = int_between_brackets(ptr);
i = ptr-str+1;
}
}
// f_ID = scalar from global scalar
if (nbracket == 0 && fix->scalar_flag) {
if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
value1 = fix->compute_scalar();
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// f_ID[i] = scalar from global vector
} else if (nbracket == 1 && fix->vector_flag) {
if (index1 > fix->size_vector)
error->all(FLERR,"Variable formula fix vector is accessed out-of-range");
if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
value1 = fix->compute_vector(index1-1);
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// f_ID[i][j] = scalar from global array
} else if (nbracket == 2 && fix->array_flag) {
if (index1 > fix->size_array_rows)
error->all(FLERR,"Variable formula fix array is accessed out-of-range");
if (index2 > fix->size_array_cols)
error->all(FLERR,"Variable formula fix array is accessed out-of-range");
if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
value1 = fix->compute_array(index1-1,index2-1);
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// f_ID[i] = scalar from per-atom vector
} else if (nbracket == 1 && fix->peratom_flag &&
fix->size_peratom_cols == 0) {
if (update->whichflag > 0 &&
update->ntimestep % fix->peratom_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
peratom2global(1,NULL,fix->vector_atom,1,index1,
tree,treestack,ntreestack,argstack,nargstack);
// f_ID[i][j] = scalar from per-atom array
} else if (nbracket == 2 && fix->peratom_flag &&
fix->size_peratom_cols > 0) {
if (index2 > fix->size_peratom_cols)
error->all(FLERR,"Variable formula fix array is accessed out-of-range");
if (update->whichflag > 0 &&
update->ntimestep % fix->peratom_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
peratom2global(1,NULL,&fix->array_atom[0][index2-1],
fix->size_peratom_cols,index1,
tree,treestack,ntreestack,argstack,nargstack);
// f_ID = vector from per-atom vector
} else if (nbracket == 0 && fix->peratom_flag &&
fix->size_peratom_cols == 0) {
if (tree == NULL)
error->all(FLERR,"Per-atom fix in equal-style variable formula");
if (update->whichflag > 0 &&
update->ntimestep % fix->peratom_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
Tree *newtree = new Tree();
newtree->type = ATOMARRAY;
newtree->array = fix->vector_atom;
newtree->nstride = 1;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
// f_ID[i] = vector from per-atom array
} else if (nbracket == 1 && fix->peratom_flag &&
fix->size_peratom_cols > 0) {
if (tree == NULL)
error->all(FLERR,"Per-atom fix in equal-style variable formula");
if (index1 > fix->size_peratom_cols)
error->all(FLERR,"Variable formula fix array is accessed out-of-range");
if (update->whichflag > 0 &&
update->ntimestep % fix->peratom_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
Tree *newtree = new Tree();
newtree->type = ATOMARRAY;
newtree->array = &fix->array_atom[0][index1-1];
newtree->nstride = fix->size_peratom_cols;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else error->all(FLERR,"Mismatched fix in variable formula");
// ----------------
// variable
// ----------------
} else if (strncmp(word,"v_",2) == 0) {
n = strlen(word) - 2 + 1;
char *id = new char[n];
strcpy(id,&word[2]);
int ivar = find(id);
if (ivar < 0) error->all(FLERR,"Invalid variable name in variable formula");
// parse zero or one trailing brackets
// point i beyond last bracket
// nbracket = # of bracket pairs
// index = int inside bracket
int nbracket,index;
if (str[i] != '[') nbracket = 0;
else {
nbracket = 1;
ptr = &str[i];
index = int_between_brackets(ptr);
i = ptr-str+1;
}
// v_name = scalar from non atom-style global scalar
if (nbracket == 0 && style[ivar] != ATOM) {
char *var = retrieve(id);
if (var == NULL)
error->all(FLERR,"Invalid variable evaluation in variable formula");
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = atof(var);
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = atof(var);
// v_name = vector from atom-style per-atom vector
} else if (nbracket == 0 && style[ivar] == ATOM) {
if (tree == NULL)
error->all(FLERR,"Atom-style variable in equal-style variable formula");
Tree *newtree;
evaluate(data[ivar][0],&newtree);
treestack[ntreestack++] = newtree;
// v_name[N] = scalar from atom-style per-atom vector
// compute the per-atom variable in result
// use peratom2global to extract single value from result
} else if (nbracket && style[ivar] == ATOM) {
double *result;
memory->create(result,atom->nlocal,"variable:result");
compute_atom(ivar,0,result,1,0);
peratom2global(1,NULL,result,1,index,
tree,treestack,ntreestack,argstack,nargstack);
memory->destroy(result);
} else error->all(FLERR,"Mismatched variable in variable formula");
delete [] id;
// ----------------
// math/group/special function or atom value/vector or
// constant or thermo keyword
// ----------------
} else {
// ----------------
// math or group or special function
// ----------------
if (str[i] == '(') {
char *contents;
i = find_matching_paren(str,i,contents);
i++;
if (math_function(word,contents,tree,
treestack,ntreestack,argstack,nargstack));
else if (group_function(word,contents,tree,
treestack,ntreestack,argstack,nargstack));
else if (special_function(word,contents,tree,
treestack,ntreestack,argstack,nargstack));
else error->all(FLERR,"Invalid math/group/special function "
"in variable formula");
delete [] contents;
// ----------------
// atom value
// ----------------
} else if (str[i] == '[') {
if (domain->box_exist == 0)
error->all(FLERR,"Variable evaluation before simulation box is defined");
ptr = &str[i];
int id = int_between_brackets(ptr);
i = ptr-str+1;
peratom2global(0,word,NULL,0,id,
tree,treestack,ntreestack,argstack,nargstack);
// ----------------
// atom vector
// ----------------
} else if (is_atom_vector(word)) {
if (domain->box_exist == 0)
error->all(FLERR,"Variable evaluation before simulation box is defined");
atom_vector(word,tree,treestack,ntreestack);
// ----------------
// constant
// ----------------
} else if (is_constant(word)) {
value1 = constant(word);
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// ----------------
// thermo keyword
// ----------------
} else {
if (domain->box_exist == 0)
error->all(FLERR,"Variable evaluation before simulation box is defined");
int flag = output->thermo->evaluate_keyword(word,&value1);
if (flag) error->all(FLERR,"Invalid thermo keyword in variable formula");
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
}
}
delete [] word;
// ----------------
// math operator, including end-of-string
// ----------------
} else if (strchr("+-*/^<>=!&|\0",onechar)) {
if (onechar == '+') op = ADD;
else if (onechar == '-') op = SUBTRACT;
else if (onechar == '*') op = MULTIPLY;
else if (onechar == '/') op = DIVIDE;
else if (onechar == '^') op = CARAT;
else if (onechar == '=') {
if (str[i+1] != '=') error->all(FLERR,"Invalid syntax in variable formula");
op = EQ;
i++;
} else if (onechar == '!') {
if (str[i+1] == '=') {
op = NE;
i++;
} else op = NOT;
} else if (onechar == '<') {
if (str[i+1] != '=') op = LT;
else {
op = LE;
i++;
}
} else if (onechar == '>') {
if (str[i+1] != '=') op = GT;
else {
op = GE;
i++;
}
} else if (onechar == '&') {
if (str[i+1] != '&') error->all(FLERR,"Invalid syntax in variable formula");
op = AND;
i++;
} else if (onechar == '|') {
if (str[i+1] != '|') error->all(FLERR,"Invalid syntax in variable formula");
op = OR;
i++;
} else op = DONE;
i++;
if (op == SUBTRACT && expect == ARG) {
opstack[nopstack++] = UNARY;
continue;
}
if (op == NOT && expect == ARG) {
opstack[nopstack++] = op;
continue;
}
if (expect == ARG) error->all(FLERR,"Invalid syntax in variable formula");
expect = ARG;
// evaluate stack as deep as possible while respecting precedence
// before pushing current op onto stack
while (nopstack && precedence[opstack[nopstack-1]] >= precedence[op]) {
opprevious = opstack[--nopstack];
if (tree) {
Tree *newtree = new Tree();
newtree->type = opprevious;
if (opprevious == UNARY) {
newtree->left = treestack[--ntreestack];
newtree->middle = newtree->right = NULL;
} else {
newtree->right = treestack[--ntreestack];
newtree->middle = NULL;
newtree->left = treestack[--ntreestack];
}
treestack[ntreestack++] = newtree;
} else {
value2 = argstack[--nargstack];
if (opprevious != UNARY && opprevious != NOT)
value1 = argstack[--nargstack];
if (opprevious == ADD)
argstack[nargstack++] = value1 + value2;
else if (opprevious == SUBTRACT)
argstack[nargstack++] = value1 - value2;
else if (opprevious == MULTIPLY)
argstack[nargstack++] = value1 * value2;
else if (opprevious == DIVIDE) {
if (value2 == 0.0) error->all(FLERR,"Divide by 0 in variable formula");
argstack[nargstack++] = value1 / value2;
} else if (opprevious == CARAT) {
if (value2 == 0.0) error->all(FLERR,"Power by 0 in variable formula");
argstack[nargstack++] = pow(value1,value2);
} else if (opprevious == UNARY) {
argstack[nargstack++] = -value2;
} else if (opprevious == NOT) {
if (value2 == 0.0) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == EQ) {
if (value1 == value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == NE) {
if (value1 != value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == LT) {
if (value1 < value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == LE) {
if (value1 <= value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == GT) {
if (value1 > value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == GE) {
if (value1 >= value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == AND) {
if (value1 != 0.0 && value2 != 0.0) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == OR) {
if (value1 != 0.0 || value2 != 0.0) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
}
}
}
// if end-of-string, break out of entire formula evaluation loop
if (op == DONE) break;
// push current operation onto stack
opstack[nopstack++] = op;
} else error->all(FLERR,"Invalid syntax in variable formula");
}
if (nopstack) error->all(FLERR,"Invalid syntax in variable formula");
// for atom-style variable, return remaining tree
// for equal-style variable, return remaining arg
if (tree) {
if (ntreestack != 1) error->all(FLERR,"Invalid syntax in variable formula");
*tree = treestack[0];
return 0.0;
} else {
if (nargstack != 1) error->all(FLERR,"Invalid syntax in variable formula");
return argstack[0];
}
}
/* ----------------------------------------------------------------------
one-time collapse of an atom-style variable parse tree
tree was created by one-time parsing of formula string via evaulate()
only keep tree nodes that depend on ATOMARRAY, TYPEARRAY, INTARRAY
remainder is converted to single VALUE
this enables optimal eval_tree loop over atoms
customize by adding a function:
sqrt(),exp(),ln(),log(),sin(),cos(),tan(),asin(),acos(),atan(),
atan2(y,x),random(x,y,z),normal(x,y,z),ceil(),floor(),round(),
ramp(x,y),stagger(x,y),logfreq(x,y,z),
vdisplace(x,y),swiggle(x,y,z),cwiggle(x,y,z),
gmask(x),rmask(x),grmask(x,y)
---------------------------------------------------------------------- */
double Variable::collapse_tree(Tree *tree)
{
double arg1,arg2;
if (tree->type == VALUE) return tree->value;
if (tree->type == ATOMARRAY) return 0.0;
if (tree->type == TYPEARRAY) return 0.0;
if (tree->type == INTARRAY) return 0.0;
if (tree->type == ADD) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = arg1 + arg2;
return tree->value;
}
if (tree->type == SUBTRACT) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = arg1 - arg2;
return tree->value;
}
if (tree->type == MULTIPLY) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = arg1 * arg2;
return tree->value;
}
if (tree->type == DIVIDE) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg2 == 0.0) error->one(FLERR,"Divide by 0 in variable formula");
tree->value = arg1 / arg2;
return tree->value;
}
if (tree->type == CARAT) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg2 == 0.0) error->one(FLERR,"Power by 0 in variable formula");
tree->value = pow(arg1,arg2);
return tree->value;
}
if (tree->type == UNARY) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = -arg1;
return tree->value;
}
if (tree->type == NOT) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 == 0.0) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == EQ) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 == arg2) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == NE) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 != arg2) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == LT) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 < arg2) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == LE) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 <= arg2) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == GT) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 > arg2) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == GE) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 >= arg2) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == AND) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 != 0.0 && arg2 != 0.0) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == OR) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 != 0.0 || arg2 != 0.0) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == SQRT) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 < 0.0) error->one(FLERR,"Sqrt of negative value in variable formula");
tree->value = sqrt(arg1);
return tree->value;
}
if (tree->type == EXP) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = exp(arg1);
return tree->value;
}
if (tree->type == LN) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 <= 0.0)
error->one(FLERR,"Log of zero/negative value in variable formula");
tree->value = log(arg1);
return tree->value;
}
if (tree->type == LOG) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 <= 0.0)
error->one(FLERR,"Log of zero/negative value in variable formula");
tree->value = log10(arg1);
return tree->value;
}
if (tree->type == SIN) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = sin(arg1);
return tree->value;
}
if (tree->type == COS) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = cos(arg1);
return tree->value;
}
if (tree->type == TAN) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = tan(arg1);
return tree->value;
}
if (tree->type == ASIN) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 < -1.0 || arg1 > 1.0)
error->one(FLERR,"Arcsin of invalid value in variable formula");
tree->value = asin(arg1);
return tree->value;
}
if (tree->type == ACOS) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 < -1.0 || arg1 > 1.0)
error->one(FLERR,"Arccos of invalid value in variable formula");
tree->value = acos(arg1);
return tree->value;
}
if (tree->type == ATAN) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = atan(arg1);
return tree->value;
}
if (tree->type == ATAN2) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = atan2(arg1,arg2);
return tree->value;
}
// random() or normal() do not become a single collapsed value
if (tree->type == RANDOM) {
collapse_tree(tree->left);
collapse_tree(tree->middle);
if (randomatom == NULL) {
int seed = static_cast<int> (collapse_tree(tree->right));
if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula");
randomatom = new RanMars(lmp,seed+me);
}
return 0.0;
}
if (tree->type == NORMAL) {
collapse_tree(tree->left);
double sigma = collapse_tree(tree->middle);
if (sigma < 0.0) error->one(FLERR,"Invalid math function in variable formula");
if (randomatom == NULL) {
int seed = static_cast<int> (collapse_tree(tree->right));
if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula");
randomatom = new RanMars(lmp,seed+me);
}
return 0.0;
}
if (tree->type == CEIL) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = ceil(arg1);
return tree->value;
}
if (tree->type == FLOOR) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = floor(arg1);
return tree->value;
}
if (tree->type == ROUND) {
arg1 = collapse_tree(tree->left);
if (tree->left->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = MYROUND(arg1);
return tree->value;
}
if (tree->type == RAMP) {
arg1 = collapse_tree(tree->left);
arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
double delta = update->ntimestep - update->beginstep;
delta /= update->endstep - update->beginstep;
tree->value = arg1 + delta*(arg2-arg1);
return tree->value;
}
if (tree->type == STAGGER) {
int ivalue1 = static_cast<int> (collapse_tree(tree->left));
int ivalue2 = static_cast<int> (collapse_tree(tree->right));
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
int lower = update->ntimestep/ivalue1 * ivalue1;
int delta = update->ntimestep - lower;
if (delta < ivalue2) tree->value = lower+ivalue2;
else tree->value = lower+ivalue1;
return tree->value;
}
if (tree->type == LOGFREQ) {
int ivalue1 = static_cast<int> (collapse_tree(tree->left));
int ivalue2 = static_cast<int> (collapse_tree(tree->middle));
int ivalue3 = static_cast<int> (collapse_tree(tree->right));
if (tree->left->type != VALUE || tree->middle->type != VALUE ||
tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3)
error->one(FLERR,"Invalid math function in variable formula");
if (update->ntimestep < ivalue1) tree->value = ivalue1;
else {
int lower = ivalue1;
while (update->ntimestep >= ivalue3*lower) lower *= ivalue3;
int multiple = update->ntimestep/lower;
if (multiple < ivalue2) tree->value = (multiple+1)*lower;
else tree->value = lower*ivalue3;
}
return tree->value;
}
if (tree->type == VDISPLACE) {
double arg1 = collapse_tree(tree->left);
double arg2 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
double delta = update->ntimestep - update->beginstep;
tree->value = arg1 + arg2*delta*update->dt;
return tree->value;
}
if (tree->type == SWIGGLE) {
double arg1 = collapse_tree(tree->left);
double arg2 = collapse_tree(tree->middle);
double arg3 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->middle->type != VALUE ||
tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg3 == 0.0) error->one(FLERR,"Invalid math function in variable formula");
double delta = update->ntimestep - update->beginstep;
double omega = 2.0*MY_PI/arg3;
tree->value = arg1 + arg2*sin(omega*delta*update->dt);
return tree->value;
}
if (tree->type == CWIGGLE) {
double arg1 = collapse_tree(tree->left);
double arg2 = collapse_tree(tree->middle);
double arg3 = collapse_tree(tree->right);
if (tree->left->type != VALUE || tree->middle->type != VALUE ||
tree->right->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg3 == 0.0) error->one(FLERR,"Invalid math function in variable formula");
double delta = update->ntimestep - update->beginstep;
double omega = 2.0*MY_PI/arg3;
tree->value = arg1 + arg2*(1.0-cos(omega*delta*update->dt));
return tree->value;
}
// mask functions do not become a single collapsed value
if (tree->type == GMASK) return 0.0;
if (tree->type == RMASK) return 0.0;
if (tree->type == GRMASK) return 0.0;
return 0.0;
}
/* ----------------------------------------------------------------------
evaluate an atom-style variable parse tree for atom I
tree was created by one-time parsing of formula string via evaulate()
customize by adding a function:
sqrt(),exp(),ln(),log(),sin(),cos(),tan(),asin(),acos(),atan(),
atan2(y,x),random(x,y,z),normal(x,y,z),ceil(),floor(),round(),
ramp(x,y),stagger(x,y),logfreq(x,y,z),
vdisplace(x,y),swiggle(x,y,z),cwiggle(x,y,z),
gmask(x),rmask(x),grmask(x,y)
---------------------------------------------------------------------- */
double Variable::eval_tree(Tree *tree, int i)
{
double arg,arg1,arg2,arg3;
if (tree->type == VALUE) return tree->value;
if (tree->type == ATOMARRAY) return tree->array[i*tree->nstride];
if (tree->type == TYPEARRAY) return tree->array[atom->type[i]];
if (tree->type == INTARRAY) return (double) tree->iarray[i*tree->nstride];
if (tree->type == ADD)
return eval_tree(tree->left,i) + eval_tree(tree->right,i);
if (tree->type == SUBTRACT)
return eval_tree(tree->left,i) - eval_tree(tree->right,i);
if (tree->type == MULTIPLY)
return eval_tree(tree->left,i) * eval_tree(tree->right,i);
if (tree->type == DIVIDE) {
double denom = eval_tree(tree->right,i);
if (denom == 0.0) error->one(FLERR,"Divide by 0 in variable formula");
return eval_tree(tree->left,i) / denom;
}
if (tree->type == CARAT) {
double exponent = eval_tree(tree->right,i);
if (exponent == 0.0) error->one(FLERR,"Power by 0 in variable formula");
return pow(eval_tree(tree->left,i),exponent);
}
if (tree->type == UNARY) return -eval_tree(tree->left,i);
if (tree->type == NOT) {
if (eval_tree(tree->left,i) == 0.0) return 1.0;
else return 0.0;
}
if (tree->type == EQ) {
if (eval_tree(tree->left,i) == eval_tree(tree->right,i)) return 1.0;
else return 0.0;
}
if (tree->type == NE) {
if (eval_tree(tree->left,i) != eval_tree(tree->right,i)) return 1.0;
else return 0.0;
}
if (tree->type == LT) {
if (eval_tree(tree->left,i) < eval_tree(tree->right,i)) return 1.0;
else return 0.0;
}
if (tree->type == LE) {
if (eval_tree(tree->left,i) <= eval_tree(tree->right,i)) return 1.0;
else return 0.0;
}
if (tree->type == GT) {
if (eval_tree(tree->left,i) > eval_tree(tree->right,i)) return 1.0;
else return 0.0;
}
if (tree->type == GE) {
if (eval_tree(tree->left,i) >= eval_tree(tree->right,i)) return 1.0;
else return 0.0;
}
if (tree->type == AND) {
if (eval_tree(tree->left,i) != 0.0 && eval_tree(tree->right,i) != 0.0)
return 1.0;
else return 0.0;
}
if (tree->type == OR) {
if (eval_tree(tree->left,i) != 0.0 || eval_tree(tree->right,i) != 0.0)
return 1.0;
else return 0.0;
}
if (tree->type == SQRT) {
arg1 = eval_tree(tree->left,i);
if (arg1 < 0.0) error->one(FLERR,"Sqrt of negative value in variable formula");
return sqrt(arg1);
}
if (tree->type == EXP)
return exp(eval_tree(tree->left,i));
if (tree->type == LN) {
arg1 = eval_tree(tree->left,i);
if (arg1 <= 0.0)
error->one(FLERR,"Log of zero/negative value in variable formula");
return log(arg1);
}
if (tree->type == LOG) {
arg1 = eval_tree(tree->left,i);
if (arg1 <= 0.0)
error->one(FLERR,"Log of zero/negative value in variable formula");
return log10(arg1);
}
if (tree->type == SIN)
return sin(eval_tree(tree->left,i));
if (tree->type == COS)
return cos(eval_tree(tree->left,i));
if (tree->type == TAN)
return tan(eval_tree(tree->left,i));
if (tree->type == ASIN) {
arg1 = eval_tree(tree->left,i);
if (arg1 < -1.0 || arg1 > 1.0)
error->one(FLERR,"Arcsin of invalid value in variable formula");
return asin(arg1);
}
if (tree->type == ACOS) {
arg1 = eval_tree(tree->left,i);
if (arg1 < -1.0 || arg1 > 1.0)
error->one(FLERR,"Arccos of invalid value in variable formula");
return acos(arg1);
}
if (tree->type == ATAN)
return atan(eval_tree(tree->left,i));
if (tree->type == ATAN2)
return atan2(eval_tree(tree->left,i),eval_tree(tree->right,i));
if (tree->type == RANDOM) {
double lower = eval_tree(tree->left,i);
double upper = eval_tree(tree->middle,i);
if (randomatom == NULL) {
int seed = static_cast<int> (eval_tree(tree->right,i));
if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula");
randomatom = new RanMars(lmp,seed+me);
}
return randomatom->uniform()*(upper-lower)+lower;
}
if (tree->type == NORMAL) {
double mu = eval_tree(tree->left,i);
double sigma = eval_tree(tree->middle,i);
if (sigma < 0.0) error->one(FLERR,"Invalid math function in variable formula");
if (randomatom == NULL) {
int seed = static_cast<int> (eval_tree(tree->right,i));
if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula");
randomatom = new RanMars(lmp,seed+me);
}
return mu + sigma*randomatom->gaussian();
}
if (tree->type == CEIL)
return ceil(eval_tree(tree->left,i));
if (tree->type == FLOOR)
return floor(eval_tree(tree->left,i));
if (tree->type == ROUND)
return MYROUND(eval_tree(tree->left,i));
if (tree->type == RAMP) {
arg1 = eval_tree(tree->left,i);
arg2 = eval_tree(tree->right,i);
double delta = update->ntimestep - update->beginstep;
delta /= update->endstep - update->beginstep;
arg = arg1 + delta*(arg2-arg1);
return arg;
}
if (tree->type == STAGGER) {
int ivalue1 = static_cast<int> (eval_tree(tree->left,i));
int ivalue2 = static_cast<int> (eval_tree(tree->right,i));
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
int lower = update->ntimestep/ivalue1 * ivalue1;
int delta = update->ntimestep - lower;
if (delta < ivalue2) arg = lower+ivalue2;
else arg = lower+ivalue1;
return arg;
}
if (tree->type == LOGFREQ) {
int ivalue1 = static_cast<int> (eval_tree(tree->left,i));
int ivalue2 = static_cast<int> (eval_tree(tree->middle,i));
int ivalue3 = static_cast<int> (eval_tree(tree->right,i));
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3)
error->one(FLERR,"Invalid math function in variable formula");
if (update->ntimestep < ivalue1) arg = ivalue1;
else {
int lower = ivalue1;
while (update->ntimestep >= ivalue3*lower) lower *= ivalue3;
int multiple = update->ntimestep/lower;
if (multiple < ivalue2) arg = (multiple+1)*lower;
else arg = lower*ivalue3;
}
return arg;
}
if (tree->type == VDISPLACE) {
arg1 = eval_tree(tree->left,i);
arg2 = eval_tree(tree->right,i);
double delta = update->ntimestep - update->beginstep;
arg = arg1 + arg2*delta*update->dt;
return arg;
}
if (tree->type == SWIGGLE) {
arg1 = eval_tree(tree->left,i);
arg2 = eval_tree(tree->middle,i);
arg3 = eval_tree(tree->right,i);
if (arg3 == 0.0) error->one(FLERR,"Invalid math function in variable formula");
double delta = update->ntimestep - update->beginstep;
double omega = 2.0*MY_PI/arg3;
arg = arg1 + arg2*sin(omega*delta*update->dt);
return arg;
}
if (tree->type == CWIGGLE) {
arg1 = eval_tree(tree->left,i);
arg2 = eval_tree(tree->middle,i);
arg3 = eval_tree(tree->right,i);
if (arg3 == 0.0) error->one(FLERR,"Invalid math function in variable formula");
double delta = update->ntimestep - update->beginstep;
double omega = 2.0*MY_PI/arg3;
arg = arg1 + arg2*(1.0-cos(omega*delta*update->dt));
return arg;
}
if (tree->type == GMASK) {
if (atom->mask[i] & tree->ivalue1) return 1.0;
else return 0.0;
}
if (tree->type == RMASK) {
if (domain->regions[tree->ivalue1]->inside(atom->x[i][0],
atom->x[i][1],
atom->x[i][2])) return 1.0;
else return 0.0;
}
if (tree->type == GRMASK) {
if ((atom->mask[i] & tree->ivalue1) &&
(domain->regions[tree->ivalue2]->inside(atom->x[i][0],
atom->x[i][1],
atom->x[i][2]))) return 1.0;
else return 0.0;
}
return 0.0;
}
/* ---------------------------------------------------------------------- */
void Variable::free_tree(Tree *tree)
{
if (tree->left) free_tree(tree->left);
if (tree->middle) free_tree(tree->middle);
if (tree->right) free_tree(tree->right);
delete tree;
}
/* ----------------------------------------------------------------------
find matching parenthesis in str, allocate contents = str between parens
i = left paren
return loc or right paren
------------------------------------------------------------------------- */
int Variable::find_matching_paren(char *str, int i,char *&contents)
{
// istop = matching ')' at same level, allowing for nested parens
int istart = i;
int ilevel = 0;
while (1) {
i++;
if (!str[i]) break;
if (str[i] == '(') ilevel++;
else if (str[i] == ')' && ilevel) ilevel--;
else if (str[i] == ')') break;
}
if (!str[i]) error->all(FLERR,"Invalid syntax in variable formula");
int istop = i;
int n = istop - istart - 1;
contents = new char[n+1];
strncpy(contents,&str[istart+1],n);
contents[n] = '\0';
return istop;
}
/* ----------------------------------------------------------------------
find int between brackets and return it
ptr initially points to left bracket
return it pointing to right bracket
error if no right bracket or brackets are empty
error if any between-bracket chars are non-digits or value == 0
------------------------------------------------------------------------- */
int Variable::int_between_brackets(char *&ptr)
{
char *start = ++ptr;
while (*ptr && *ptr != ']') {
if (!isdigit(*ptr))
error->all(FLERR,"Non digit character between brackets in variable");
ptr++;
}
if (*ptr != ']') error->all(FLERR,"Mismatched brackets in variable");
if (ptr == start) error->all(FLERR,"Empty brackets in variable");
*ptr = '\0';
int index = atoi(start);
*ptr = ']';
if (index == 0)
error->all(FLERR,"Index between variable brackets must be positive");
return index;
}
/* ----------------------------------------------------------------------
process a math function in formula
push result onto tree or arg stack
word = math function
contents = str between parentheses with one,two,three args
return 0 if not a match, 1 if successfully processed
customize by adding a math function:
sqrt(),exp(),ln(),log(),sin(),cos(),tan(),asin(),acos(),atan(),
atan2(y,x),random(x,y,z),normal(x,y,z),ceil(),floor(),round(),
ramp(x,y),stagger(x,y),logfreq(x,y,z),
vdisplace(x,y),swiggle(x,y,z),cwiggle(x,y,z)
------------------------------------------------------------------------- */
int Variable::math_function(char *word, char *contents, Tree **tree,
Tree **treestack, int &ntreestack,
double *argstack, int &nargstack)
{
// word not a match to any math function
if (strcmp(word,"sqrt") && strcmp(word,"exp") &&
strcmp(word,"ln") && strcmp(word,"log") &&
strcmp(word,"sin") && strcmp(word,"cos") &&
strcmp(word,"tan") && strcmp(word,"asin") &&
strcmp(word,"acos") && strcmp(word,"atan") &&
strcmp(word,"atan2") && strcmp(word,"random") &&
strcmp(word,"normal") && strcmp(word,"ceil") &&
strcmp(word,"floor") && strcmp(word,"round") &&
strcmp(word,"ramp") && strcmp(word,"stagger") &&
strcmp(word,"logfreq") && strcmp(word,"vdisplace") &&
strcmp(word,"swiggle") && strcmp(word,"cwiggle"))
return 0;
// parse contents for arg1,arg2,arg3 separated by commas
// ptr1,ptr2 = location of 1st and 2nd comma, NULL if none
char *arg1,*arg2,*arg3;
char *ptr1,*ptr2;
ptr1 = find_next_comma(contents);
if (ptr1) {
*ptr1 = '\0';
ptr2 = find_next_comma(ptr1+1);
if (ptr2) *ptr2 = '\0';
} else ptr2 = NULL;
int n = strlen(contents) + 1;
arg1 = new char[n];
strcpy(arg1,contents);
int narg = 1;
if (ptr1) {
n = strlen(ptr1+1) + 1;
arg2 = new char[n];
strcpy(arg2,ptr1+1);
narg = 2;
} else arg2 = NULL;
if (ptr2) {
n = strlen(ptr2+1) + 1;
arg3 = new char[n];
strcpy(arg3,ptr2+1);
narg = 3;
} else arg3 = NULL;
// evaluate args
Tree *newtree;
double tmp,value1,value2,value3;
if (tree) {
newtree = new Tree();
Tree *argtree;
if (narg == 1) {
tmp = evaluate(arg1,&argtree);
newtree->left = argtree;
newtree->middle = newtree->right = NULL;
} else if (narg == 2) {
tmp = evaluate(arg1,&argtree);
newtree->left = argtree;
newtree->middle = NULL;
tmp = evaluate(arg2,&argtree);
newtree->right = argtree;
} else if (narg == 3) {
tmp = evaluate(arg1,&argtree);
newtree->left = argtree;
tmp = evaluate(arg2,&argtree);
newtree->middle = argtree;
tmp = evaluate(arg3,&argtree);
newtree->right = argtree;
}
treestack[ntreestack++] = newtree;
} else {
if (narg == 1) {
value1 = evaluate(arg1,NULL);
} else if (narg == 2) {
value1 = evaluate(arg1,NULL);
value2 = evaluate(arg2,NULL);
} else if (narg == 3) {
value1 = evaluate(arg1,NULL);
value2 = evaluate(arg2,NULL);
value3 = evaluate(arg3,NULL);
}
}
if (strcmp(word,"sqrt") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = SQRT;
else {
if (value1 < 0.0)
error->all(FLERR,"Sqrt of negative value in variable formula");
argstack[nargstack++] = sqrt(value1);
}
} else if (strcmp(word,"exp") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = EXP;
else argstack[nargstack++] = exp(value1);
} else if (strcmp(word,"ln") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = LN;
else {
if (value1 <= 0.0)
error->all(FLERR,"Log of zero/negative value in variable formula");
argstack[nargstack++] = log(value1);
}
} else if (strcmp(word,"log") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = LOG;
else {
if (value1 <= 0.0)
error->all(FLERR,"Log of zero/negative value in variable formula");
argstack[nargstack++] = log10(value1);
}
} else if (strcmp(word,"sin") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = SIN;
else argstack[nargstack++] = sin(value1);
} else if (strcmp(word,"cos") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = COS;
else argstack[nargstack++] = cos(value1);
} else if (strcmp(word,"tan") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = TAN;
else argstack[nargstack++] = tan(value1);
} else if (strcmp(word,"asin") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = ASIN;
else {
if (value1 < -1.0 || value1 > 1.0)
error->all(FLERR,"Arcsin of invalid value in variable formula");
argstack[nargstack++] = asin(value1);
}
} else if (strcmp(word,"acos") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = ACOS;
else {
if (value1 < -1.0 || value1 > 1.0)
error->all(FLERR,"Arccos of invalid value in variable formula");
argstack[nargstack++] = acos(value1);
}
} else if (strcmp(word,"atan") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = ATAN;
else argstack[nargstack++] = atan(value1);
} else if (strcmp(word,"atan2") == 0) {
if (narg != 2) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = ATAN2;
else argstack[nargstack++] = atan2(value1,value2);
} else if (strcmp(word,"random") == 0) {
if (narg != 3) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = RANDOM;
else {
if (randomequal == NULL) {
int seed = static_cast<int> (value3);
if (seed <= 0) error->all(FLERR,"Invalid math function in variable formula");
randomequal = new RanMars(lmp,seed);
}
argstack[nargstack++] = randomequal->uniform()*(value2-value1) + value1;
}
} else if (strcmp(word,"normal") == 0) {
if (narg != 3) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = NORMAL;
else {
if (value2 < 0.0)
error->all(FLERR,"Invalid math function in variable formula");
if (randomequal == NULL) {
int seed = static_cast<int> (value3);
if (seed <= 0) error->all(FLERR,"Invalid math function in variable formula");
randomequal = new RanMars(lmp,seed);
}
argstack[nargstack++] = value1 + value2*randomequal->gaussian();
}
} else if (strcmp(word,"ceil") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = CEIL;
else argstack[nargstack++] = ceil(value1);
} else if (strcmp(word,"floor") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = FLOOR;
else argstack[nargstack++] = floor(value1);
} else if (strcmp(word,"round") == 0) {
if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = ROUND;
else argstack[nargstack++] = MYROUND(value1);
} else if (strcmp(word,"ramp") == 0) {
if (narg != 2) error->all(FLERR,"Invalid math function in variable formula");
if (update->whichflag == 0)
error->all(FLERR,"Cannot use ramp in variable formula between runs");
if (tree) newtree->type = RAMP;
else {
double delta = update->ntimestep - update->beginstep;
delta /= update->endstep - update->beginstep;
double value = value1 + delta*(value2-value1);
argstack[nargstack++] = value;
}
} else if (strcmp(word,"stagger") == 0) {
if (narg != 2) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = STAGGER;
else {
int ivalue1 = static_cast<int> (value1);
int ivalue2 = static_cast<int> (value2);
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2)
error->all(FLERR,"Invalid math function in variable formula");
int lower = update->ntimestep/ivalue1 * ivalue1;
int delta = update->ntimestep - lower;
double value;
if (delta < ivalue2) value = lower+ivalue2;
else value = lower+ivalue1;
argstack[nargstack++] = value;
}
} else if (strcmp(word,"logfreq") == 0) {
if (narg != 3) error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = LOGFREQ;
else {
int ivalue1 = static_cast<int> (value1);
int ivalue2 = static_cast<int> (value2);
int ivalue3 = static_cast<int> (value3);
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3)
error->all(FLERR,"Invalid math function in variable formula");
double value;
if (update->ntimestep < ivalue1) value = ivalue1;
else {
int lower = ivalue1;
while (update->ntimestep >= ivalue3*lower) lower *= ivalue3;
int multiple = update->ntimestep/lower;
if (multiple < ivalue2) value = (multiple+1)*lower;
else value = lower*ivalue3;
}
argstack[nargstack++] = value;
}
} else if (strcmp(word,"vdisplace") == 0) {
if (narg != 2) error->all(FLERR,"Invalid math function in variable formula");
if (update->whichflag == 0)
error->all(FLERR,"Cannot use vdisplace in variable formula between runs");
if (tree) newtree->type = VDISPLACE;
else {
double delta = update->ntimestep - update->beginstep;
double value = value1 + value2*delta*update->dt;
argstack[nargstack++] = value;
}
} else if (strcmp(word,"swiggle") == 0) {
if (narg != 3) error->all(FLERR,"Invalid math function in variable formula");
if (update->whichflag == 0)
error->all(FLERR,"Cannot use swiggle in variable formula between runs");
if (tree) newtree->type = CWIGGLE;
else {
if (value3 == 0.0)
error->all(FLERR,"Invalid math function in variable formula");
double delta = update->ntimestep - update->beginstep;
double omega = 2.0*MY_PI/value3;
double value = value1 + value2*sin(omega*delta*update->dt);
argstack[nargstack++] = value;
}
} else if (strcmp(word,"cwiggle") == 0) {
if (narg != 3) error->all(FLERR,"Invalid math function in variable formula");
if (update->whichflag == 0)
error->all(FLERR,"Cannot use cwiggle in variable formula between runs");
if (tree) newtree->type = CWIGGLE;
else {
if (value3 == 0.0)
error->all(FLERR,"Invalid math function in variable formula");
double delta = update->ntimestep - update->beginstep;
double omega = 2.0*MY_PI/value3;
double value = value1 + value2*(1.0-cos(omega*delta*update->dt));
argstack[nargstack++] = value;
}
}
delete [] arg1;
delete [] arg2;
delete [] arg3;
return 1;
}
/* ----------------------------------------------------------------------
process a group function in formula with optional region arg
push result onto tree or arg stack
word = group function
contents = str between parentheses with one,two,three args
return 0 if not a match, 1 if successfully processed
customize by adding a group function with optional region arg:
count(group),mass(group),charge(group),
xcm(group,dim),vcm(group,dim),fcm(group,dim),
bound(group,xmin),gyration(group),ke(group),angmom(group,dim),
torque(group,dim),inertia(group,dim),omega(group,dim)
------------------------------------------------------------------------- */
int Variable::group_function(char *word, char *contents, Tree **tree,
Tree **treestack, int &ntreestack,
double *argstack, int &nargstack)
{
// word not a match to any group function
if (strcmp(word,"count") && strcmp(word,"mass") &&
strcmp(word,"charge") && strcmp(word,"xcm") &&
strcmp(word,"vcm") && strcmp(word,"fcm") &&
strcmp(word,"bound") && strcmp(word,"gyration") &&
strcmp(word,"ke") && strcmp(word,"angmom") &&
strcmp(word,"torque") && strcmp(word,"inertia") &&
strcmp(word,"omega"))
return 0;
// parse contents for arg1,arg2,arg3 separated by commas
// ptr1,ptr2 = location of 1st and 2nd comma, NULL if none
char *arg1,*arg2,*arg3;
char *ptr1,*ptr2;
ptr1 = find_next_comma(contents);
if (ptr1) {
*ptr1 = '\0';
ptr2 = find_next_comma(ptr1+1);
if (ptr2) *ptr2 = '\0';
} else ptr2 = NULL;
int n = strlen(contents) + 1;
arg1 = new char[n];
strcpy(arg1,contents);
int narg = 1;
if (ptr1) {
n = strlen(ptr1+1) + 1;
arg2 = new char[n];
strcpy(arg2,ptr1+1);
narg = 2;
} else arg2 = NULL;
if (ptr2) {
n = strlen(ptr2+1) + 1;
arg3 = new char[n];
strcpy(arg3,ptr2+1);
narg = 3;
} else arg3 = NULL;
// group to operate on
int igroup = group->find(arg1);
if (igroup == -1)
error->all(FLERR,"Group ID in variable formula does not exist");
// match word to group function
double value;
if (strcmp(word,"count") == 0) {
if (narg == 1) value = group->count(igroup);
else if (narg == 2) value = group->count(igroup,region_function(arg2));
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"mass") == 0) {
if (narg == 1) value = group->mass(igroup);
else if (narg == 2) value = group->mass(igroup,region_function(arg2));
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"charge") == 0) {
if (narg == 1) value = group->charge(igroup);
else if (narg == 2) value = group->charge(igroup,region_function(arg2));
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"xcm") == 0) {
atom->check_mass();
double xcm[3];
if (narg == 2) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
} else if (narg == 3) {
int iregion = region_function(arg3);
double masstotal = group->mass(igroup,iregion);
group->xcm(igroup,masstotal,xcm,iregion);
} else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(arg2,"x") == 0) value = xcm[0];
else if (strcmp(arg2,"y") == 0) value = xcm[1];
else if (strcmp(arg2,"z") == 0) value = xcm[2];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"vcm") == 0) {
atom->check_mass();
double vcm[3];
if (narg == 2) {
double masstotal = group->mass(igroup);
group->vcm(igroup,masstotal,vcm);
} else if (narg == 3) {
int iregion = region_function(arg3);
double masstotal = group->mass(igroup,iregion);
group->vcm(igroup,masstotal,vcm,iregion);
} else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(arg2,"x") == 0) value = vcm[0];
else if (strcmp(arg2,"y") == 0) value = vcm[1];
else if (strcmp(arg2,"z") == 0) value = vcm[2];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"fcm") == 0) {
double fcm[3];
if (narg == 2) group->fcm(igroup,fcm);
else if (narg == 3) group->fcm(igroup,fcm,region_function(arg3));
else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(arg2,"x") == 0) value = fcm[0];
else if (strcmp(arg2,"y") == 0) value = fcm[1];
else if (strcmp(arg2,"z") == 0) value = fcm[2];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"bound") == 0) {
double minmax[6];
if (narg == 2) group->bounds(igroup,minmax);
else if (narg == 3) group->bounds(igroup,minmax,region_function(arg3));
else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(arg2,"xmin") == 0) value = minmax[0];
else if (strcmp(arg2,"xmax") == 0) value = minmax[1];
else if (strcmp(arg2,"ymin") == 0) value = minmax[2];
else if (strcmp(arg2,"ymax") == 0) value = minmax[3];
else if (strcmp(arg2,"zmin") == 0) value = minmax[4];
else if (strcmp(arg2,"zmax") == 0) value = minmax[5];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"gyration") == 0) {
atom->check_mass();
double xcm[3];
if (narg == 1) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
value = group->gyration(igroup,masstotal,xcm);
} else if (narg == 2) {
int iregion = region_function(arg2);
double masstotal = group->mass(igroup,iregion);
group->xcm(igroup,masstotal,xcm,iregion);
value = group->gyration(igroup,masstotal,xcm,iregion);
} else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"ke") == 0) {
if (narg == 1) value = group->ke(igroup);
else if (narg == 2) value = group->ke(igroup,region_function(arg2));
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"angmom") == 0) {
atom->check_mass();
double xcm[3],lmom[3];
if (narg == 2) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
group->angmom(igroup,xcm,lmom);
} else if (narg == 3) {
int iregion = region_function(arg3);
double masstotal = group->mass(igroup,iregion);
group->xcm(igroup,masstotal,xcm,iregion);
group->angmom(igroup,xcm,lmom,iregion);
} else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(arg2,"x") == 0) value = lmom[0];
else if (strcmp(arg2,"y") == 0) value = lmom[1];
else if (strcmp(arg2,"z") == 0) value = lmom[2];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"torque") == 0) {
atom->check_mass();
double xcm[3],tq[3];
if (narg == 2) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
group->torque(igroup,xcm,tq);
} else if (narg == 3) {
int iregion = region_function(arg3);
double masstotal = group->mass(igroup,iregion);
group->xcm(igroup,masstotal,xcm,iregion);
group->torque(igroup,xcm,tq,iregion);
} else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(arg2,"x") == 0) value = tq[0];
else if (strcmp(arg2,"y") == 0) value = tq[1];
else if (strcmp(arg2,"z") == 0) value = tq[2];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"inertia") == 0) {
atom->check_mass();
double xcm[3],inertia[3][3];
if (narg == 2) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
group->inertia(igroup,xcm,inertia);
} else if (narg == 3) {
int iregion = region_function(arg3);
double masstotal = group->mass(igroup,iregion);
group->xcm(igroup,masstotal,xcm,iregion);
group->inertia(igroup,xcm,inertia,iregion);
} else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(arg2,"xx") == 0) value = inertia[0][0];
else if (strcmp(arg2,"yy") == 0) value = inertia[1][1];
else if (strcmp(arg2,"zz") == 0) value = inertia[2][2];
else if (strcmp(arg2,"xy") == 0) value = inertia[0][1];
else if (strcmp(arg2,"yz") == 0) value = inertia[1][2];
else if (strcmp(arg2,"xz") == 0) value = inertia[0][2];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"omega") == 0) {
atom->check_mass();
double xcm[3],angmom[3],inertia[3][3],omega[3];
if (narg == 2) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
group->angmom(igroup,xcm,angmom);
group->inertia(igroup,xcm,inertia);
group->omega(angmom,inertia,omega);
} else if (narg == 3) {
int iregion = region_function(arg3);
double masstotal = group->mass(igroup,iregion);
group->xcm(igroup,masstotal,xcm,iregion);
group->angmom(igroup,xcm,angmom,iregion);
group->inertia(igroup,xcm,inertia,iregion);
group->omega(angmom,inertia,omega);
} else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(arg2,"x") == 0) value = omega[0];
else if (strcmp(arg2,"y") == 0) value = omega[1];
else if (strcmp(arg2,"z") == 0) value = omega[2];
else error->all(FLERR,"Invalid group function in variable formula");
}
delete [] arg1;
delete [] arg2;
delete [] arg3;
// save value in tree or on argstack
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value;
return 1;
}
/* ---------------------------------------------------------------------- */
int Variable::region_function(char *id)
{
int iregion = domain->find_region(id);
if (iregion == -1)
error->all(FLERR,"Region ID in variable formula does not exist");
return iregion;
}
/* ----------------------------------------------------------------------
process a special function in formula
push result onto tree or arg stack
word = special function
contents = str between parentheses with one,two,three args
return 0 if not a match, 1 if successfully processed
customize by adding a special function:
sum(x),min(x),max(x),ave(x),trap(x),gmask(x),rmask(x),grmask(x,y)
------------------------------------------------------------------------- */
int Variable::special_function(char *word, char *contents, Tree **tree,
Tree **treestack, int &ntreestack,
double *argstack, int &nargstack)
{
// word not a match to any special function
if (strcmp(word,"sum") && strcmp(word,"min") && strcmp(word,"max") &&
strcmp(word,"ave") && strcmp(word,"trap") && strcmp(word,"gmask") &&
strcmp(word,"rmask") && strcmp(word,"grmask"))
return 0;
// parse contents for arg1,arg2,arg3 separated by commas
// ptr1,ptr2 = location of 1st and 2nd comma, NULL if none
char *arg1,*arg2,*arg3;
char *ptr1,*ptr2;
ptr1 = find_next_comma(contents);
if (ptr1) {
*ptr1 = '\0';
ptr2 = find_next_comma(ptr1+1);
if (ptr2) *ptr2 = '\0';
} else ptr2 = NULL;
int n = strlen(contents) + 1;
arg1 = new char[n];
strcpy(arg1,contents);
int narg = 1;
if (ptr1) {
n = strlen(ptr1+1) + 1;
arg2 = new char[n];
strcpy(arg2,ptr1+1);
narg = 2;
} else arg2 = NULL;
if (ptr2) {
n = strlen(ptr2+1) + 1;
arg3 = new char[n];
strcpy(arg3,ptr2+1);
narg = 3;
} else arg3 = NULL;
// special functions that operate on global vectors
if (strcmp(word,"sum") == 0 || strcmp(word,"min") == 0 ||
strcmp(word,"max") == 0 || strcmp(word,"ave") == 0 ||
strcmp(word,"trap") == 0) {
int method;
if (strcmp(word,"sum") == 0) method = SUM;
else if (strcmp(word,"min") == 0) method = XMIN;
else if (strcmp(word,"max") == 0) method = XMAX;
else if (strcmp(word,"ave") == 0) method = AVE;
else if (strcmp(word,"trap") == 0) method = TRAP;
if (narg != 1) error->all(FLERR,"Invalid special function in variable formula");
Compute *compute = NULL;
Fix *fix = NULL;
int index,nvec,nstride;
if (strstr(arg1,"c_") == arg1) {
ptr1 = strchr(arg1,'[');
if (ptr1) {
ptr2 = ptr1;
index = int_between_brackets(ptr2);
*ptr1 = '\0';
} else index = 0;
int icompute = modify->find_compute(&arg1[2]);
if (icompute < 0) error->all(FLERR,"Invalid compute ID in variable formula");
compute = modify->compute[icompute];
if (index == 0 && compute->vector_flag) {
if (update->whichflag == 0) {
if (compute->invoked_vector != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs is not current");
} else if (!(compute->invoked_flag & INVOKED_VECTOR)) {
compute->compute_vector();
compute->invoked_flag |= INVOKED_VECTOR;
}
nvec = compute->size_vector;
nstride = 1;
} else if (index && compute->array_flag) {
if (index > compute->size_array_cols)
error->all(FLERR,"Variable formula compute array "
"is accessed out-of-range");
if (update->whichflag == 0) {
if (compute->invoked_array != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs is not current");
} else if (!(compute->invoked_flag & INVOKED_ARRAY)) {
compute->compute_array();
compute->invoked_flag |= INVOKED_ARRAY;
}
nvec = compute->size_array_rows;
nstride = compute->size_array_cols;
} else error->all(FLERR,"Mismatched compute in variable formula");
} else if (strstr(arg1,"f_") == arg1) {
ptr1 = strchr(arg1,'[');
if (ptr1) {
ptr2 = ptr1;
index = int_between_brackets(ptr2);
*ptr1 = '\0';
} else index = 0;
int ifix = modify->find_fix(&arg1[2]);
if (ifix < 0) error->all(FLERR,"Invalid fix ID in variable formula");
fix = modify->fix[ifix];
if (index == 0 && fix->vector_flag) {
if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
nvec = fix->size_vector;
nstride = 1;
} else if (index && fix->array_flag) {
if (index > fix->size_array_cols)
error->all(FLERR,"Variable formula fix array is accessed out-of-range");
if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
nvec = fix->size_array_rows;
nstride = fix->size_array_cols;
} else error->all(FLERR,"Mismatched fix in variable formula");
} else error->all(FLERR,"Invalid special function in variable formula");
double value = 0.0;
if (method == XMIN) value = BIG;
if (method == XMAX) value = -BIG;
if (compute) {
double *vec;
if (index) vec = &compute->array[0][index-1];
else vec = compute->vector;
int j = 0;
for (int i = 0; i < nvec; i++) {
if (method == SUM) value += vec[j];
else if (method == XMIN) value = MIN(value,vec[j]);
else if (method == XMAX) value = MAX(value,vec[j]);
else if (method == AVE) value += vec[j];
else if (method == TRAP) {
if (i > 0 && i < nvec-1) value += vec[j];
else value += 0.5*vec[j];
}
j += nstride;
}
}
if (fix) {
double one;
for (int i = 0; i < nvec; i++) {
if (index) one = fix->compute_array(i,index-1);
else one = fix->compute_vector(i);
if (method == SUM) value += one;
else if (method == XMIN) value = MIN(value,one);
else if (method == XMAX) value = MAX(value,one);
else if (method == AVE) value += one;
else if (method == TRAP) {
if (i > 1 && i < nvec) value += one;
else value += 0.5*one;
}
}
}
if (method == AVE) value /= nvec;
delete [] arg1;
delete [] arg2;
delete [] arg3;
// save value in tree or on argstack
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value;
// mask special functions
} else if (strcmp(word,"gmask") == 0) {
if (tree == NULL)
error->all(FLERR,"Gmask function in equal-style variable formula");
if (narg != 1) error->all(FLERR,"Invalid special function in variable formula");
int igroup = group->find(arg1);
if (igroup == -1)
error->all(FLERR,"Group ID in variable formula does not exist");
Tree *newtree = new Tree();
newtree->type = GMASK;
newtree->ivalue1 = group->bitmask[igroup];
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else if (strcmp(word,"rmask") == 0) {
if (tree == NULL)
error->all(FLERR,"Rmask function in equal-style variable formula");
if (narg != 1) error->all(FLERR,"Invalid special function in variable formula");
int iregion = region_function(arg1);
Tree *newtree = new Tree();
newtree->type = RMASK;
newtree->ivalue1 = iregion;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else if (strcmp(word,"grmask") == 0) {
if (tree == NULL)
error->all(FLERR,"Grmask function in equal-style variable formula");
if (narg != 2) error->all(FLERR,"Invalid special function in variable formula");
int igroup = group->find(arg1);
if (igroup == -1)
error->all(FLERR,"Group ID in variable formula does not exist");
int iregion = region_function(arg2);
Tree *newtree = new Tree();
newtree->type = RMASK;
newtree->ivalue1 = group->bitmask[igroup];
newtree->ivalue2 = iregion;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
}
return 1;
}
/* ----------------------------------------------------------------------
extract a global value from a per-atom quantity in a formula
flag = 0 -> word is an atom vector
flag = 1 -> vector is a per-atom compute or fix quantity with nstride
id = positive global ID of atom, converted to local index
push result onto tree or arg stack
customize by adding an atom vector:
mass,type,x,y,z,vx,vy,vz,fx,fy,fz
------------------------------------------------------------------------- */
void Variable::peratom2global(int flag, char *word,
double *vector, int nstride, int id,
Tree **tree, Tree **treestack, int &ntreestack,
double *argstack, int &nargstack)
{
if (atom->map_style == 0)
error->all(FLERR,"Indexed per-atom vector in variable formula without atom map");
int index = atom->map(id);
double mine;
if (index >= 0 && index < atom->nlocal) {
if (flag == 0) {
if (strcmp(word,"mass") == 0) {
if (atom->rmass) mine = atom->rmass[index];
else mine = atom->mass[atom->type[index]];
}
else if (strcmp(word,"type") == 0) mine = atom->type[index];
else if (strcmp(word,"x") == 0) mine = atom->x[index][0];
else if (strcmp(word,"y") == 0) mine = atom->x[index][1];
else if (strcmp(word,"z") == 0) mine = atom->x[index][2];
else if (strcmp(word,"vx") == 0) mine = atom->v[index][0];
else if (strcmp(word,"vy") == 0) mine = atom->v[index][1];
else if (strcmp(word,"vz") == 0) mine = atom->v[index][2];
else if (strcmp(word,"fx") == 0) mine = atom->f[index][0];
else if (strcmp(word,"fy") == 0) mine = atom->f[index][1];
else if (strcmp(word,"fz") == 0) mine = atom->f[index][2];
else error->one(FLERR,"Invalid atom vector in variable formula");
} else mine = vector[index*nstride];
} else mine = 0.0;
double value;
MPI_Allreduce(&mine,&value,1,MPI_DOUBLE,MPI_SUM,world);
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value;
}
/* ----------------------------------------------------------------------
check if word matches an atom vector
return 1 if yes, else 0
customize by adding an atom vector:
mass,type,x,y,z,vx,vy,vz,fx,fy,fz
------------------------------------------------------------------------- */
int Variable::is_atom_vector(char *word)
{
if (strcmp(word,"mass") == 0) return 1;
if (strcmp(word,"type") == 0) return 1;
if (strcmp(word,"x") == 0) return 1;
if (strcmp(word,"y") == 0) return 1;
if (strcmp(word,"z") == 0) return 1;
if (strcmp(word,"vx") == 0) return 1;
if (strcmp(word,"vy") == 0) return 1;
if (strcmp(word,"vz") == 0) return 1;
if (strcmp(word,"fx") == 0) return 1;
if (strcmp(word,"fy") == 0) return 1;
if (strcmp(word,"fz") == 0) return 1;
return 0;
}
/* ----------------------------------------------------------------------
process an atom vector in formula
push result onto tree
word = atom vector
customize by adding an atom vector:
mass,type,x,y,z,vx,vy,vz,fx,fy,fz
------------------------------------------------------------------------- */
void Variable::atom_vector(char *word, Tree **tree,
Tree **treestack, int &ntreestack)
{
if (tree == NULL)
error->all(FLERR,"Atom vector in equal-style variable formula");
Tree *newtree = new Tree();
newtree->type = ATOMARRAY;
newtree->nstride = 3;
newtree->left = newtree->middle = newtree->right = NULL;
treestack[ntreestack++] = newtree;
if (strcmp(word,"mass") == 0) {
if (atom->rmass) {
newtree->nstride = 1;
newtree->array = atom->rmass;
} else {
newtree->type = TYPEARRAY;
newtree->array = atom->mass;
}
} else if (strcmp(word,"type") == 0) {
newtree->type = INTARRAY;
newtree->nstride = 1;
newtree->iarray = atom->type;
}
else if (strcmp(word,"x") == 0) newtree->array = &atom->x[0][0];
else if (strcmp(word,"y") == 0) newtree->array = &atom->x[0][1];
else if (strcmp(word,"z") == 0) newtree->array = &atom->x[0][2];
else if (strcmp(word,"vx") == 0) newtree->array = &atom->v[0][0];
else if (strcmp(word,"vy") == 0) newtree->array = &atom->v[0][1];
else if (strcmp(word,"vz") == 0) newtree->array = &atom->v[0][2];
else if (strcmp(word,"fx") == 0) newtree->array = &atom->f[0][0];
else if (strcmp(word,"fy") == 0) newtree->array = &atom->f[0][1];
else if (strcmp(word,"fz") == 0) newtree->array = &atom->f[0][2];
}
/* ----------------------------------------------------------------------
check if word matches a constant
return 1 if yes, else 0
customize by adding a constant: PI
------------------------------------------------------------------------- */
int Variable::is_constant(char *word)
{
if (strcmp(word,"PI") == 0) return 1;
return 0;
}
/* ----------------------------------------------------------------------
process a constant in formula
customize by adding a constant: PI
------------------------------------------------------------------------- */
double Variable::constant(char *word)
{
if (strcmp(word,"PI") == 0) return MY_PI;
return 0.0;
}
/* ----------------------------------------------------------------------
read a floating point value from a string
generate an error if not a legitimate floating point value
------------------------------------------------------------------------- */
double Variable::numeric(char *str)
{
int n = strlen(str);
for (int i = 0; i < n; i++) {
if (isdigit(str[i])) continue;
if (str[i] == '-' || str[i] == '+' || str[i] == '.') continue;
if (str[i] == 'e' || str[i] == 'E') continue;
error->all(FLERR,"Expected floating point parameter in variable definition");
}
return atof(str);
}
/* ----------------------------------------------------------------------
read an integer value from a string
generate an error if not a legitimate integer value
------------------------------------------------------------------------- */
int Variable::inumeric(char *str)
{
int n = strlen(str);
for (int i = 0; i < n; i++) {
if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue;
error->all(FLERR,"Expected integer parameter in variable definition");
}
return atoi(str);
}
/* ----------------------------------------------------------------------
find next comma in str
skip commas inside one or more nested parenthesis
only return ptr to comma at level 0, else NULL if not found
------------------------------------------------------------------------- */
char *Variable::find_next_comma(char *str)
{
int level = 0;
for (char *p = str; *p; ++p) {
if ('(' == *p) level++;
else if (')' == *p) level--;
else if (',' == *p && !level) return p;
}
return NULL;
}
/* ----------------------------------------------------------------------
debug routine for printing formula tree recursively
------------------------------------------------------------------------- */
void Variable::print_tree(Tree *tree, int level)
{
printf("TREE %d: %d %g\n",level,tree->type,tree->value);
if (tree->left) print_tree(tree->left,level+1);
if (tree->middle) print_tree(tree->middle,level+1);
if (tree->right) print_tree(tree->right,level+1);
return;
}
/* ----------------------------------------------------------------------
recursive evaluation of string str
called from "if" command in input script
str is a boolean expression containing one or more items:
number = 0.0, -5.45, 2.8e-4, ...
math operation = (),x==y,x!=y,x<y,x<=y,x>y,x>=y,x&&y,x||y
------------------------------------------------------------------------- */
double Variable::evaluate_boolean(char *str)
{
int op,opprevious;
double value1,value2;
char onechar;
double argstack[MAXLEVEL];
int opstack[MAXLEVEL];
int nargstack = 0;
int nopstack = 0;
int i = 0;
int expect = ARG;
while (1) {
onechar = str[i];
// whitespace: just skip
if (isspace(onechar)) i++;
// ----------------
// parentheses: recursively evaluate contents of parens
// ----------------
else if (onechar == '(') {
if (expect == OP) error->all(FLERR,"Invalid Boolean syntax in if command");
expect = OP;
char *contents;
i = find_matching_paren(str,i,contents);
i++;
// evaluate contents and push on stack
argstack[nargstack++] = evaluate_boolean(contents);
delete [] contents;
// ----------------
// number: push value onto stack
// ----------------
} else if (isdigit(onechar) || onechar == '.' || onechar == '-') {
if (expect == OP) error->all(FLERR,"Invalid Boolean syntax in if command");
expect = OP;
// istop = end of number, including scientific notation
int istart = i++;
while (isdigit(str[i]) || str[i] == '.') i++;
if (str[i] == 'e' || str[i] == 'E') {
i++;
if (str[i] == '+' || str[i] == '-') i++;
while (isdigit(str[i])) i++;
}
int istop = i - 1;
int n = istop - istart + 1;
char *number = new char[n+1];
strncpy(number,&str[istart],n);
number[n] = '\0';
argstack[nargstack++] = atof(number);
delete [] number;
// ----------------
// Boolean operator, including end-of-string
// ----------------
} else if (strchr("<>=!&|\0",onechar)) {
if (onechar == '=') {
if (str[i+1] != '=')
error->all(FLERR,"Invalid Boolean syntax in if command");
op = EQ;
i++;
} else if (onechar == '!') {
if (str[i+1] == '=') {
op = NE;
i++;
} else op = NOT;
} else if (onechar == '<') {
if (str[i+1] != '=') op = LT;
else {
op = LE;
i++;
}
} else if (onechar == '>') {
if (str[i+1] != '=') op = GT;
else {
op = GE;
i++;
}
} else if (onechar == '&') {
if (str[i+1] != '&')
error->all(FLERR,"Invalid Boolean syntax in if command");
op = AND;
i++;
} else if (onechar == '|') {
if (str[i+1] != '|')
error->all(FLERR,"Invalid Boolean syntax in if command");
op = OR;
i++;
} else op = DONE;
i++;
if (op == NOT && expect == ARG) {
opstack[nopstack++] = op;
continue;
}
if (expect == ARG) error->all(FLERR,"Invalid Boolean syntax in if command");
expect = ARG;
// evaluate stack as deep as possible while respecting precedence
// before pushing current op onto stack
while (nopstack && precedence[opstack[nopstack-1]] >= precedence[op]) {
opprevious = opstack[--nopstack];
value2 = argstack[--nargstack];
if (opprevious != NOT) value1 = argstack[--nargstack];
if (opprevious == NOT) {
if (value2 == 0.0) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == EQ) {
if (value1 == value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == NE) {
if (value1 != value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == LT) {
if (value1 < value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == LE) {
if (value1 <= value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == GT) {
if (value1 > value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == GE) {
if (value1 >= value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == AND) {
if (value1 != 0.0 && value2 != 0.0) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == OR) {
if (value1 != 0.0 || value2 != 0.0) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
}
}
// if end-of-string, break out of entire formula evaluation loop
if (op == DONE) break;
// push current operation onto stack
opstack[nopstack++] = op;
} else error->all(FLERR,"Invalid Boolean syntax in if command");
}
if (nopstack) error->all(FLERR,"Invalid Boolean syntax in if command");
if (nargstack != 1) error->all(FLERR,"Invalid Boolean syntax in if command");
return argstack[0];
}
diff --git a/src/variable.h b/src/variable.h
index aa8ef616f..dac393966 100644
--- a/src/variable.h
+++ b/src/variable.h
@@ -1,91 +1,344 @@
/* ----------------------------------------------------------------------
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_VARIABLE_H
#define LMP_VARIABLE_H
#include "pointers.h"
namespace LAMMPS_NS {
class Variable : protected Pointers {
public:
Variable(class LAMMPS *);
~Variable();
void set(int, char **);
void set(char *, int, char **);
int next(int, char **);
int find(char *);
int equalstyle(int);
int atomstyle(int);
char *retrieve(char *);
double compute_equal(int);
void compute_atom(int, int, double *, int, int);
int int_between_brackets(char *&);
double evaluate_boolean(char *);
private:
int nvar; // # of defined variables
int maxvar; // max # of variables arrays can hold
char **names; // name of each variable
int *style; // style of each variable
int *num; // # of values for each variable
int *which; // next available value for each variable
int *pad; // 1 = pad loop/uloop variables with 0s, 0 = no pad
char ***data; // str value of each variable's values
class RanMars *randomequal; // random number generator for equal-style vars
class RanMars *randomatom; // random number generator for atom-style vars
int precedence[16]; // precedence level of math operators
// set length to include OR in enum
int me;
struct Tree { // parse tree for atom-style variables
double value;
double *array;
int *iarray;
int type;
int nstride;
int ivalue1,ivalue2;
Tree *left,*middle,*right;
};
void remove(int);
void extend();
void copy(int, char **, char **);
double evaluate(char *, Tree **);
double collapse_tree(Tree *);
double eval_tree(Tree *, int);
void free_tree(Tree *);
int find_matching_paren(char *, int, char *&);
int math_function(char *, char *, Tree **, Tree **, int &, double *, int &);
int group_function(char *, char *, Tree **, Tree **, int &, double *, int &);
int region_function(char *);
int special_function(char *, char *, Tree **, Tree **,
int &, double *, int &);
void peratom2global(int, char *, double *, int, int,
Tree **, Tree **, int &, double *, int &);
int is_atom_vector(char *);
void atom_vector(char *, Tree **, Tree **, int &);
int is_constant(char *);
double constant(char *);
double numeric(char *);
int inumeric(char *);
char *find_next_comma(char *);
void print_tree(Tree *, int);
};
}
#endif
+
+/* ERROR/WARNING messages:
+
+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: World variable count doesn't match # of partitions
+
+A world-style variable must specify a number of values equal to the
+number of processor partitions.
+
+E: Universe/uloop variable count < # of partitions
+
+A universe or uloop style variable must specify a number of values >= to the
+number of processor partitions.
+
+E: All universe/uloop variables must have same # of values
+
+Self-explanatory.
+
+E: Cannot redefine variable as a different style
+
+An equal-style variable can be re-defined but only if it was
+originally an equal-style variable.
+
+E: Variable name must be alphanumeric or underscore characters
+
+Self-explanatory.
+
+E: Invalid variable in next command
+
+Self-explanatory.
+
+E: All variables in next command must be same style
+
+Self-explanatory.
+
+E: Invalid variable style with next command
+
+Variable styles {equal} and {world} cannot be used in a next
+command.
+
+E: Invalid syntax in variable formula
+
+Self-explanatory.
+
+E: Variable evaluation before simulation box is defined
+
+Cannot evaluate a compute or fix or atom-based value in a variable
+before the simulation has been setup.
+
+E: Invalid compute ID in variable formula
+
+The compute is not recognized.
+
+E: Compute used in variable between runs is not current
+
+Computes cannot be invoked by a variable in between runs. Thus they
+must have been evaluated on the last timestep of the previous run in
+order for their value(s) to be accessed. See the doc page for the
+variable command for more info.
+
+E: Variable formula compute vector is accessed out-of-range
+
+Self-explanatory.
+
+E: Variable formula compute array is accessed out-of-range
+
+Self-explanatory.
+
+E: Per-atom compute in equal-style variable formula
+
+Equal-style variables cannot use per-atom quantities.
+
+E: Mismatched compute in variable formula
+
+A compute is referenced incorrectly or a compute that produces per-atom
+values is used in an equal-style variable formula.
+
+E: Invalid fix ID in variable formula
+
+The fix is not recognized.
+
+E: Fix in variable not computed at compatible time
+
+Fixes generate their values on specific timesteps. The variable is
+requesting the values on a non-allowed timestep.
+
+E: Variable formula fix vector is accessed out-of-range
+
+Self-explanatory.
+
+E: Variable formula fix array is accessed out-of-range
+
+Self-explanatory.
+
+E: Per-atom fix in equal-style variable formula
+
+Equal-style variables cannot use per-atom quantities.
+
+E: Mismatched fix in variable formula
+
+A fix is referenced incorrectly or a fix that produces per-atom
+values is used in an equal-style variable formula.
+
+E: Invalid variable name in variable formula
+
+Variable name is not recognized.
+
+E: Invalid variable evaluation in variable formula
+
+A variable used in a formula could not be evaluated.
+
+E: Atom-style variable in equal-style variable formula
+
+Atom-style variables generate one value per atom which is not allowed
+in an equal-style variable.
+
+E: Mismatched variable in variable formula
+
+A variable is referenced incorrectly or an atom-style variable that
+produces per-atom values is used in an equal-style variable
+formula.
+
+E: Invalid math/group/special function in variable formula
+
+Self-explanatory.
+
+E: Invalid thermo keyword in variable formula
+
+The keyword is not recognized.
+
+E: Divide by 0 in variable formula
+
+Self-explanatory.
+
+E: Power by 0 in variable formula
+
+Self-explanatory.
+
+E: Sqrt of negative value in variable formula
+
+Self-explanatory.
+
+E: Log of zero/negative value in variable formula
+
+Self-explanatory.
+
+E: Arcsin of invalid value in variable formula
+
+Argument of arcsin() must be between -1 and 1.
+
+E: Arccos of invalid value in variable formula
+
+Argument of arccos() must be between -1 and 1.
+
+E: Invalid math function in variable formula
+
+Self-explanatory.
+
+E: Non digit character between brackets in variable
+
+Self-explantory.
+
+E: Mismatched brackets in variable
+
+Self-explanatory.
+
+E: Empty brackets in variable
+
+There is no variable syntax that uses empty brackets. Check
+the variable doc page.
+
+E: Index between variable brackets must be positive
+
+Self-explanatory.
+
+E: Cannot use ramp in variable formula between runs
+
+This is because the ramp() function is time dependent.
+
+E: Cannot use vdisplace in variable formula between runs
+
+This is a function of elapsed time.
+
+E: Cannot use swiggle in variable formula between runs
+
+This is a function of elapsed time.
+
+E: Cannot use cwiggle in variable formula between runs
+
+This is a function of elapsed time.
+
+E: Group ID in variable formula does not exist
+
+Self-explanatory.
+
+E: Invalid group function in variable formula
+
+Group function is not recognized.
+
+E: Region ID in variable formula does not exist
+
+Self-explanatory.
+
+E: Invalid special function in variable formula
+
+Self-explanatory.
+
+E: Gmask function in equal-style variable formula
+
+Gmask is per-atom operation.
+
+E: Rmask function in equal-style variable formula
+
+Rmask is per-atom operation.
+
+E: Grmask function in equal-style variable formula
+
+Grmask is per-atom operation.
+
+E: Indexed per-atom vector in variable formula without atom map
+
+Accessing a value from an atom vector requires the ability to lookup
+an atom index, which is provided by an atom map. An atom map does not
+exist (by default) for non-molecular problems. Using the atom_modify
+map command will force an atom map to be created.
+
+E: Invalid atom vector in variable formula
+
+The atom vector is not recognized.
+
+E: Atom vector in equal-style variable formula
+
+Atom vectors generate one value per atom which is not allowed
+in an equal-style variable.
+
+E: Expected floating point parameter in variable definition
+
+The quantity being read is a non-numeric value.
+
+E: Expected integer parameter in variable definition
+
+The quantity being read is a floating point or non-numeric value.
+
+E: Invalid Boolean syntax in if command
+
+Self-explanatory.
+
+*/
diff --git a/src/velocity.cpp b/src/velocity.cpp
index ef95a873a..eb46bc0f6 100644
--- a/src/velocity.cpp
+++ b/src/velocity.cpp
@@ -1,796 +1,796 @@
/* ----------------------------------------------------------------------
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 "lmptype.h"
#include "mpi.h"
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "velocity.h"
#include "atom.h"
#include "update.h"
#include "domain.h"
#include "lattice.h"
#include "input.h"
#include "variable.h"
#include "force.h"
#include "modify.h"
#include "compute.h"
#include "compute_temp.h"
#include "random_park.h"
#include "group.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
enum{CREATE,SET,SCALE,RAMP,ZERO};
enum{ALL,LOCAL,GEOM};
enum{NONE,CONSTANT,EQUAL,ATOM};
#define WARMUP 100
#define SMALL 0.001
/* ---------------------------------------------------------------------- */
Velocity::Velocity(LAMMPS *lmp) : Pointers(lmp) {}
/* ---------------------------------------------------------------------- */
void Velocity::command(int narg, char **arg)
{
if (narg < 2) error->all(FLERR,"Illegal velocity command");
if (domain->box_exist == 0)
error->all(FLERR,"Velocity command before simulation box is defined");
if (atom->natoms == 0)
error->all(FLERR,"Velocity command with no atoms existing");
// atom masses must all be set
atom->check_mass();
// identify group
igroup = group->find(arg[0]);
if (igroup == -1) error->all(FLERR,"Could not find velocity group ID");
groupbit = group->bitmask[igroup];
// identify style
if (strcmp(arg[1],"create") == 0) style = CREATE;
else if (strcmp(arg[1],"set") == 0) style = SET;
else if (strcmp(arg[1],"scale") == 0) style = SCALE;
else if (strcmp(arg[1],"ramp") == 0) style = RAMP;
else if (strcmp(arg[1],"zero") == 0) style = ZERO;
else error->all(FLERR,"Illegal velocity command");
// set defaults
temperature = NULL;
dist_flag = 0;
sum_flag = 0;
momentum_flag = 1;
rotation_flag = 0;
loop_flag = ALL;
scale_flag = 1;
// read options from end of input line
// change defaults as options specify
if (style == CREATE) options(narg-4,&arg[4]);
else if (style == SET) options(narg-5,&arg[5]);
else if (style == SCALE) options(narg-3,&arg[3]);
else if (style == RAMP) options(narg-8,&arg[8]);
else if (style == ZERO) options(narg-3,&arg[3]);
// initialize velocities based on style
// create() invoked differently, so can be called externally
if (style == CREATE) {
double t_desired = atof(arg[2]);
int seed = atoi(arg[3]);
create(t_desired,seed);
}
else if (style == SET) set(narg-2,&arg[2]);
else if (style == SCALE) scale(narg-2,&arg[2]);
else if (style == RAMP) ramp(narg-2,&arg[2]);
else if (style == ZERO) zero(narg-2,&arg[2]);
}
/* ----------------------------------------------------------------------
initialization of defaults before calling velocity methods externaly
------------------------------------------------------------------------- */
-void Velocity::init_external(char *extgroup)
+void Velocity::init_external(const char *extgroup)
{
igroup = group->find(extgroup);
if (igroup == -1) error->all(FLERR,"Could not find velocity group ID");
groupbit = group->bitmask[igroup];
temperature = NULL;
dist_flag = 0;
sum_flag = 0;
momentum_flag = 1;
rotation_flag = 0;
loop_flag = ALL;
scale_flag = 1;
}
/* ---------------------------------------------------------------------- */
void Velocity::create(double t_desired, int seed)
{
int i;
if (seed <= 0) error->all(FLERR,"Illegal velocity create command");
// if temperature = NULL, create a new ComputeTemp with the velocity group
int tflag = 0;
if (temperature == NULL) {
char **arg = new char*[3];
arg[0] = (char *) "velocity_temp";
arg[1] = group->names[igroup];
arg[2] = (char *) "temp";
temperature = new ComputeTemp(lmp,3,arg);
tflag = 1;
delete [] arg;
}
// initialize temperature computation
// warn if groups don't match
if (igroup != temperature->igroup && comm->me == 0)
error->warning(FLERR,"Mismatch between velocity and compute groups");
temperature->init();
// store a copy of current velocities
double **v = atom->v;
int nlocal = atom->nlocal;
double **vhold;
memory->create(vhold,nlocal,3,"velocity:vnew");
for (i = 0; i < nlocal; i++) {
vhold[i][0] = v[i][0];
vhold[i][1] = v[i][1];
vhold[i][2] = v[i][2];
}
// create new velocities, in uniform or gaussian distribution
// loop option determines looping style, ALL is default
// ALL = loop over all natoms, only set those I own via atom->map
// cannot do this if atom IDs do not span 1-Natoms (some were deleted)
// will produce same V, independent of P, if atoms were read-in
// will NOT produce same V, independent of P, if used create_atoms
// LOCAL = only loop over my atoms, adjust RNG to be proc-specific
// will never produce same V, independent of P
// GEOM = only loop over my atoms
// choose RNG for each atom based on its xyz coord (geometry)
// via random->reset()
// will always produce same V, independent of P
// adjust by factor for atom mass
// for 2d, set Vz to 0.0
double *rmass = atom->rmass;
double *mass = atom->mass;
int *type = atom->type;
int *mask = atom->mask;
int dimension = domain->dimension;
int m;
double vx,vy,vz,factor;
RanPark *random;
if (loop_flag == ALL) {
// create an atom map if one doesn't exist already
int mapflag = 0;
if (atom->map_style == 0) {
mapflag = 1;
atom->map_style = 1;
atom->nghost = 0;
atom->map_init();
atom->map_set();
}
// error check
if (atom->natoms > MAXSMALLINT)
error->all(FLERR,"Too big a problem to use velocity create loop all");
if (atom->tag_enable == 0)
error->all(FLERR,"Cannot use velocity create loop all unless atoms have IDs");
if (atom->tag_consecutive() == 0)
error->all(FLERR,"Atom IDs must be consecutive for velocity create loop all");
// loop over all atoms in system
// generate RNGs for all atoms, only assign to ones I own
// use either per-type mass or per-atom rmass
random = new RanPark(lmp,seed);
int natoms = static_cast<int> (atom->natoms);
for (i = 1; i <= natoms; i++) {
if (dist_flag == 0) {
vx = random->uniform();
vy = random->uniform();
vz = random->uniform();
} else {
vx = random->gaussian();
vy = random->gaussian();
vz = random->gaussian();
}
m = atom->map(i);
if (m >= 0 && m < nlocal) {
if (mask[m] & groupbit) {
if (rmass) factor = 1.0/sqrt(rmass[m]);
else factor = 1.0/sqrt(mass[type[m]]);
v[m][0] = vx * factor;
v[m][1] = vy * factor;
if (dimension == 3) v[m][2] = vz * factor;
else v[m][2] = 0.0;
}
}
}
// delete temporary atom map
if (mapflag) {
atom->map_delete();
atom->map_style = 0;
}
} else if (loop_flag == LOCAL) {
random = new RanPark(lmp,seed + comm->me);
for (i = 0; i < WARMUP; i++) random->uniform();
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
if (dist_flag == 0) {
vx = random->uniform();
vy = random->uniform();
vz = random->uniform();
} else {
vx = random->gaussian();
vy = random->gaussian();
vz = random->gaussian();
}
if (rmass) factor = 1.0/sqrt(rmass[i]);
else factor = 1.0/sqrt(mass[type[i]]);
v[i][0] = vx * factor;
v[i][1] = vy * factor;
if (dimension == 3) v[i][2] = vz * factor;
else v[i][2] = 0.0;
}
}
} else if (loop_flag == GEOM) {
random = new RanPark(lmp,1);
double **x = atom->x;
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
random->reset(seed,x[i]);
if (dist_flag == 0) {
vx = random->uniform();
vy = random->uniform();
vz = random->uniform();
} else {
vx = random->gaussian();
vy = random->gaussian();
vz = random->gaussian();
}
if (rmass) factor = 1.0/sqrt(rmass[i]);
else factor = 1.0/sqrt(mass[type[i]]);
v[i][0] = vx * factor;
v[i][1] = vy * factor;
if (dimension == 3) v[i][2] = vz * factor;
else v[i][2] = 0.0;
}
}
}
// apply momentum and rotation zeroing
if (momentum_flag) zero_momentum();
if (rotation_flag) zero_rotation();
// scale temp to desired value
double t = temperature->compute_scalar();
rescale(t,t_desired);
// if sum_flag set, add back in previous velocities
if (sum_flag) {
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
v[i][0] += vhold[i][0];
v[i][1] += vhold[i][1];
v[i][2] += vhold[i][2];
}
}
}
// free local memory
// if temperature was created, delete it
memory->destroy(vhold);
delete random;
if (tflag) delete temperature;
}
/* ---------------------------------------------------------------------- */
void Velocity::set(int narg, char **arg)
{
int xstyle,ystyle,zstyle,varflag;
double vx,vy,vz;
char *xstr,*ystr,*zstr;
int xvar,yvar,zvar;
// parse 3 args
xstyle = ystyle = zstyle = CONSTANT;
xstr = ystr = zstr = NULL;
if (strstr(arg[0],"v_") == arg[0]) {
int n = strlen(&arg[0][2]) + 1;
xstr = new char[n];
strcpy(xstr,&arg[0][2]);
} else if (strcmp(arg[0],"NULL") == 0) xstyle = NONE;
else vx = atof(arg[0]);
if (strstr(arg[1],"v_") == arg[1]) {
int n = strlen(&arg[1][2]) + 1;
ystr = new char[n];
strcpy(ystr,&arg[1][2]);
} else if (strcmp(arg[1],"NULL") == 0) ystyle = NONE;
else vy = atof(arg[1]);
if (strstr(arg[2],"v_") == arg[2]) {
int n = strlen(&arg[2][2]) + 1;
zstr = new char[n];
strcpy(zstr,&arg[2][2]);
} else if (strcmp(arg[2],"NULL") == 0) zstyle = NONE;
else vz = atof(arg[2]);
// set and apply scale factors
xscale = yscale = zscale = 1.0;
if (xstyle && !xstr) {
if (scale_flag && domain->lattice == NULL)
error->all(FLERR,"Use of velocity with undefined lattice");
if (scale_flag) xscale = domain->lattice->xlattice;
vx *= xscale;
}
if (ystyle && !ystr) {
if (scale_flag && domain->lattice == NULL)
error->all(FLERR,"Use of velocity with undefined lattice");
if (scale_flag) yscale = domain->lattice->ylattice;
vy *= yscale;
}
if (zstyle && !zstr) {
if (scale_flag && domain->lattice == NULL)
error->all(FLERR,"Use of velocity with undefined lattice");
if (scale_flag) zscale = domain->lattice->zlattice;
vz *= zscale;
}
// check variables
if (xstr) {
xvar = input->variable->find(xstr);
if (xvar < 0) error->all(FLERR,"Variable name for velocity set does not exist");
if (input->variable->equalstyle(xvar)) xstyle = EQUAL;
else if (input->variable->atomstyle(xvar)) xstyle = ATOM;
else error->all(FLERR,"Variable for velocity set is invalid style");
}
if (ystr) {
yvar = input->variable->find(ystr);
if (yvar < 0) error->all(FLERR,"Variable name for velocity set does not exist");
if (input->variable->equalstyle(yvar)) ystyle = EQUAL;
else if (input->variable->atomstyle(yvar)) ystyle = ATOM;
else error->all(FLERR,"Variable for velocity set is invalid style");
}
if (zstr) {
zvar = input->variable->find(zstr);
if (zvar < 0) error->all(FLERR,"Variable name for velocity set does not exist");
if (input->variable->equalstyle(zvar)) zstyle = EQUAL;
else if (input->variable->atomstyle(zvar)) zstyle = ATOM;
else error->all(FLERR,"Variable for velocity set is invalid style");
}
if (xstyle == ATOM || ystyle == ATOM || zstyle == ATOM)
varflag = ATOM;
else if (xstyle == EQUAL || ystyle == EQUAL || zstyle == EQUAL)
varflag = EQUAL;
else varflag = CONSTANT;
// error check for 2d models
if (domain->dimension == 2) {
if (zstyle == CONSTANT && vz != 0.0)
error->all(FLERR,"Cannot set non-zero z velocity for 2d simulation");
if (zstyle == EQUAL || zstyle == ATOM)
error->all(FLERR,"Cannot set variable z velocity for 2d simulation");
}
// allocate vfield array if necessary
double **vfield = NULL;
if (varflag == ATOM) memory->create(vfield,atom->nlocal,3,"velocity:vfield");
// set velocities via constants
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (varflag == CONSTANT) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
if (sum_flag == 0) {
if (xstyle) v[i][0] = vx;
if (ystyle) v[i][1] = vy;
if (zstyle) v[i][2] = vz;
} else {
if (xstyle) v[i][0] += vx;
if (ystyle) v[i][1] += vy;
if (zstyle) v[i][2] += vz;
}
}
}
// set velocities via variables
} else {
if (xstyle == EQUAL) vx = input->variable->compute_equal(xvar);
else if (xstyle == ATOM && vfield)
input->variable->compute_atom(xvar,igroup,&vfield[0][0],3,0);
if (ystyle == EQUAL) vy = input->variable->compute_equal(yvar);
else if (ystyle == ATOM && vfield)
input->variable->compute_atom(yvar,igroup,&vfield[0][1],3,0);
if (zstyle == EQUAL) vz = input->variable->compute_equal(zvar);
else if (zstyle == ATOM && vfield)
input->variable->compute_atom(zvar,igroup,&vfield[0][2],3,0);
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
if (sum_flag == 0) {
if (xstyle == ATOM) v[i][0] = vfield[i][0];
else if (xstyle) v[i][0] = vx;
if (ystyle == ATOM) v[i][1] = vfield[i][1];
else if (ystyle) v[i][1] = vy;
if (zstyle == ATOM) v[i][2] = vfield[i][2];
else if (zstyle) v[i][2] = vz;
} else {
if (xstyle == ATOM) v[i][0] += vfield[i][0];
else if (xstyle) v[i][0] += vx;
if (ystyle == ATOM) v[i][1] += vfield[i][1];
else if (ystyle) v[i][1] += vy;
if (zstyle == ATOM) v[i][2] += vfield[i][2];
else if (zstyle) v[i][2] += vz;
}
}
}
// clean up
delete [] xstr;
delete [] ystr;
delete [] zstr;
memory->destroy(vfield);
}
/* ----------------------------------------------------------------------
rescale velocities of a group after computing its temperature
------------------------------------------------------------------------- */
void Velocity::scale(int narg, char **arg)
{
double t_desired = atof(arg[0]);
// if temperature = NULL, create a new ComputeTemp with the velocity group
int tflag = 0;
if (temperature == NULL) {
char **arg = new char*[3];
arg[0] = (char *) "velocity_temp";
arg[1] = group->names[igroup];
arg[2] = (char *) "temp";
temperature = new ComputeTemp(lmp,3,arg);
tflag = 1;
delete [] arg;
}
// initialize temperature computation
// warn if groups don't match
if (igroup != temperature->igroup && comm->me == 0)
error->warning(FLERR,"Mismatch between velocity and compute groups");
temperature->init();
// scale temp to desired value
double t = temperature->compute_scalar();
rescale(t,t_desired);
// if temperature was created, delete it
if (tflag) delete temperature;
}
/* ----------------------------------------------------------------------
apply a ramped set of velocities
------------------------------------------------------------------------- */
void Velocity::ramp(int narg, char **arg)
{
// set scale factors
if (scale_flag && domain->lattice == NULL)
error->all(FLERR,"Use of velocity with undefined lattice");
if (scale_flag) {
xscale = domain->lattice->xlattice;
yscale = domain->lattice->ylattice;
zscale = domain->lattice->zlattice;
}
else xscale = yscale = zscale = 1.0;
// parse args
int v_dim;
if (strcmp(arg[0],"vx") == 0) v_dim = 0;
else if (strcmp(arg[0],"vy") == 0) v_dim = 1;
else if (strcmp(arg[0],"vz") == 0) v_dim = 2;
else error->all(FLERR,"Illegal velocity command");
if (v_dim == 2 && domain->dimension == 2)
error->all(FLERR,"Velocity ramp in z for a 2d problem");
double v_lo,v_hi;
if (v_dim == 0) {
v_lo = xscale*atof(arg[1]);
v_hi = xscale*atof(arg[2]);
} else if (v_dim == 1) {
v_lo = yscale*atof(arg[1]);
v_hi = yscale*atof(arg[2]);
} else if (v_dim == 2) {
v_lo = zscale*atof(arg[1]);
v_hi = zscale*atof(arg[2]);
}
int coord_dim;
if (strcmp(arg[3],"x") == 0) coord_dim = 0;
else if (strcmp(arg[3],"y") == 0) coord_dim = 1;
else if (strcmp(arg[3],"z") == 0) coord_dim = 2;
else error->all(FLERR,"Illegal velocity command");
double coord_lo,coord_hi;
if (coord_dim == 0) {
coord_lo = xscale*atof(arg[4]);
coord_hi = xscale*atof(arg[5]);
} else if (coord_dim == 1) {
coord_lo = yscale*atof(arg[4]);
coord_hi = yscale*atof(arg[5]);
} else if (coord_dim == 2) {
coord_lo = zscale*atof(arg[4]);
coord_hi = zscale*atof(arg[5]);
}
// vramp = ramped velocity component for v_dim
// add or set based on sum_flag
double **x = atom->x;
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double fraction,vramp;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
fraction = (x[i][coord_dim] - coord_lo) / (coord_hi - coord_lo);
fraction = MAX(fraction,0.0);
fraction = MIN(fraction,1.0);
vramp = v_lo + fraction*(v_hi - v_lo);
if (sum_flag) v[i][v_dim] += vramp;
else v[i][v_dim] = vramp;
}
}
/* ----------------------------------------------------------------------
zero linear or angular momentum of a group
------------------------------------------------------------------------- */
void Velocity::zero(int narg, char **arg)
{
if (strcmp(arg[0],"linear") == 0) zero_momentum();
else if (strcmp(arg[0],"angular") == 0) zero_rotation();
else error->all(FLERR,"Illegal velocity command");
}
/* ----------------------------------------------------------------------
rescale velocities of group atoms to t_new from t_old
------------------------------------------------------------------------- */
void Velocity::rescale(double t_old, double t_new)
{
if (t_old == 0.0) error->all(FLERR,"Attempting to rescale a 0.0 temperature");
double factor = sqrt(t_new/t_old);
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
v[i][0] *= factor;
v[i][1] *= factor;
v[i][2] *= factor;
}
}
/* ----------------------------------------------------------------------
zero the linear momentum of a group of atoms by adjusting v by -Vcm
------------------------------------------------------------------------- */
void Velocity::zero_momentum()
{
// cannot have 0 atoms in group
if (group->count(igroup) == 0)
error->all(FLERR,"Cannot zero momentum of 0 atoms");
// compute velocity of center-of-mass of group
double masstotal = group->mass(igroup);
double vcm[3];
group->vcm(igroup,masstotal,vcm);
// adjust velocities by vcm to zero linear momentum
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
v[i][0] -= vcm[0];
v[i][1] -= vcm[1];
v[i][2] -= vcm[2];
}
}
/* ----------------------------------------------------------------------
zero the angular momentum of a group of atoms by adjusting v by -(w x r)
------------------------------------------------------------------------- */
void Velocity::zero_rotation()
{
int i;
// cannot have 0 atoms in group
if (group->count(igroup) == 0)
error->all(FLERR,"Cannot zero momentum of 0 atoms");
// compute omega (angular velocity) of group around center-of-mass
double xcm[3],angmom[3],inertia[3][3],omega[3];
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
group->angmom(igroup,xcm,angmom);
group->inertia(igroup,xcm,inertia);
group->omega(angmom,inertia,omega);
// adjust velocities to zero omega
// vnew_i = v_i - w x r_i
// must use unwrapped coords to compute r_i correctly
double **x = atom->x;
double **v = atom->v;
int *mask = atom->mask;
int *image = atom->image;
int nlocal = atom->nlocal;
int xbox,ybox,zbox;
double dx,dy,dz;
double xprd = domain->xprd;
double yprd = domain->yprd;
double zprd = domain->zprd;
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
xbox = (image[i] & 1023) - 512;
ybox = (image[i] >> 10 & 1023) - 512;
zbox = (image[i] >> 20) - 512;
dx = (x[i][0] + xbox*xprd) - xcm[0];
dy = (x[i][1] + ybox*yprd) - xcm[1];
dz = (x[i][2] + zbox*zprd) - xcm[2];
v[i][0] -= omega[1]*dz - omega[2]*dy;
v[i][1] -= omega[2]*dx - omega[0]*dz;
v[i][2] -= omega[0]*dy - omega[1]*dx;
}
}
/* ----------------------------------------------------------------------
parse optional parameters at end of velocity input line
------------------------------------------------------------------------- */
void Velocity::options(int narg, char **arg)
{
if (narg < 0) error->all(FLERR,"Illegal velocity command");
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"dist") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
if (strcmp(arg[iarg+1],"uniform") == 0) dist_flag = 0;
else if (strcmp(arg[iarg+1],"gaussian") == 0) dist_flag = 1;
else error->all(FLERR,"Illegal velocity command");
iarg += 2;
} else if (strcmp(arg[iarg],"sum") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
if (strcmp(arg[iarg+1],"no") == 0) sum_flag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) sum_flag = 1;
else error->all(FLERR,"Illegal velocity command");
iarg += 2;
} else if (strcmp(arg[iarg],"mom") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
if (strcmp(arg[iarg+1],"no") == 0) momentum_flag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) momentum_flag = 1;
else error->all(FLERR,"Illegal velocity command");
iarg += 2;
} else if (strcmp(arg[iarg],"rot") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
if (strcmp(arg[iarg+1],"no") == 0) rotation_flag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) rotation_flag = 1;
else error->all(FLERR,"Illegal velocity command");
iarg += 2;
} else if (strcmp(arg[iarg],"temp") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
int icompute;
for (icompute = 0; icompute < modify->ncompute; icompute++)
if (strcmp(arg[iarg+1],modify->compute[icompute]->id) == 0) break;
if (icompute == modify->ncompute)
error->all(FLERR,"Could not find velocity temperature ID");
temperature = modify->compute[icompute];
if (temperature->tempflag == 0)
error->all(FLERR,"Velocity temperature ID does not compute temperature");
iarg += 2;
} else if (strcmp(arg[iarg],"loop") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
if (strcmp(arg[iarg+1],"all") == 0) loop_flag = ALL;
else if (strcmp(arg[iarg+1],"local") == 0) loop_flag = LOCAL;
else if (strcmp(arg[iarg+1],"geom") == 0) loop_flag = GEOM;
else error->all(FLERR,"Illegal velocity command");
iarg += 2;
} else if (strcmp(arg[iarg],"units") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
if (strcmp(arg[iarg+1],"box") == 0) scale_flag = 0;
else if (strcmp(arg[iarg+1],"lattice") == 0) scale_flag = 1;
else error->all(FLERR,"Illegal velocity command");
iarg += 2;
} else error->all(FLERR,"Illegal velocity command");
}
}
diff --git a/src/velocity.h b/src/velocity.h
index 3401663c2..c64043394 100644
--- a/src/velocity.h
+++ b/src/velocity.h
@@ -1,55 +1,140 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(velocity,Velocity)
#else
#ifndef LMP_VELOCITY_H
#define LMP_VELOCITY_H
#include "pointers.h"
namespace LAMMPS_NS {
class Velocity : protected Pointers {
public:
Velocity(class LAMMPS *);
void command(int, char **);
- void init_external(char *);
+ void init_external(const char *);
void options(int, char **);
void create(double, int);
private:
int igroup,groupbit;
int style;
int dist_flag,sum_flag,momentum_flag,rotation_flag,loop_flag,scale_flag;
double xscale,yscale,zscale;
class Compute *temperature;
void set(int, char **);
void scale(int, char **);
void ramp(int, char **);
void zero(int, char **);
void rescale(double, double);
void zero_momentum();
void zero_rotation();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+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: Velocity command before simulation box is defined
+
+The velocity command cannot be used before a read_data, read_restart,
+or create_box command.
+
+E: Velocity command with no atoms existing
+
+A velocity command has been used, but no atoms yet exist.
+
+E: Could not find velocity group ID
+
+A group ID used in the velocity command does not exist.
+
+W: Mismatch between velocity and compute groups
+
+The temperature computation used by the velocity command will not be
+on the same group of atoms that velocities are being set for.
+
+E: Too big a problem to use velocity create loop all
+
+The system size must fit in a 32-bit integer to use this option.
+
+E: Cannot use velocity create loop all unless atoms have IDs
+
+Atoms in the simulation to do not have IDs, so this style
+of velocity creation cannot be performed.
+
+E: Atom IDs must be consecutive for velocity create loop all
+
+Self-explanatory.
+
+E: Use of velocity with undefined lattice
+
+If scale = lattice (the default) for the velocity set or velocity ramp
+command, then a lattice must first be defined via the lattice command.
+
+E: Variable name for velocity set does not exist
+
+Self-explanatory.
+
+E: Variable for velocity set is invalid style
+
+Only atom-style variables can be used.
+
+E: Cannot set non-zero z velocity for 2d simulation
+
+Self-explanatory.
+
+E: Cannot set variable z velocity for 2d simulation
+
+Self-explanatory.
+
+E: Velocity ramp in z for a 2d problem
+
+Self-explanatory.
+
+E: Attempting to rescale a 0.0 temperature
+
+Cannot rescale a temperature that is already 0.0.
+
+E: Cannot zero momentum of 0 atoms
+
+The collection of atoms for which momentum is being computed has no
+atoms.
+
+E: Could not find velocity temperature ID
+
+The compute ID needed by the velocity command to compute temperature
+does not exist.
+
+E: Velocity temperature ID does not compute temperature
+
+The compute ID given to the velocity command must compute
+temperature.
+
+*/
diff --git a/src/verlet.h b/src/verlet.h
index 3004b8650..9dbcf3272 100644
--- a/src/verlet.h
+++ b/src/verlet.h
@@ -1,48 +1,57 @@
/* ----------------------------------------------------------------------
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 INTEGRATE_CLASS
IntegrateStyle(verlet,Verlet)
#else
#ifndef LMP_VERLET_H
#define LMP_VERLET_H
#include "integrate.h"
namespace LAMMPS_NS {
class Verlet : public Integrate {
public:
Verlet(class LAMMPS *, int, char **);
virtual ~Verlet() {}
virtual void init();
virtual void setup();
virtual void setup_minimal(int);
virtual void run(int);
void cleanup();
protected:
int triclinic; // 0 if domain is orthog, 1 if triclinic
int torqueflag,erforceflag;
int e_flag,rho_flag;
void force_clear();
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+W: No fixes defined, atoms won't move
+
+If you are not using a fix like nve, nvt, npt then atom velocities and
+coordinates will not be updated during timestepping.
+
+*/
diff --git a/src/version.h b/src/version.h
index 8a1f33185..7c2fdc17d 100644
--- a/src/version.h
+++ b/src/version.h
@@ -1 +1 @@
-#define LAMMPS_VERSION "9 Dec 2011"
+#define LAMMPS_VERSION "19 Dec 2011"
diff --git a/src/write_restart.h b/src/write_restart.h
index 33bb164bf..d47314189 100644
--- a/src/write_restart.h
+++ b/src/write_restart.h
@@ -1,52 +1,76 @@
/* ----------------------------------------------------------------------
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 COMMAND_CLASS
CommandStyle(write_restart,WriteRestart)
#else
#ifndef LMP_WRITE_RESTART_H
#define LMP_WRITE_RESTART_H
#include "stdio.h"
#include "pointers.h"
namespace LAMMPS_NS {
class WriteRestart : protected Pointers {
public:
WriteRestart(class LAMMPS *);
void command(int, char **);
void write(char *);
private:
int me,nprocs;
FILE *fp;
bigint natoms; // natoms (sum of nlocal) to write into file
void header();
void type_arrays();
void force_fields();
void write_int(int, int);
void write_double(int, double);
void write_char(int, char *);
void write_bigint(int, bigint);
};
}
#endif
#endif
+
+/* ERROR/WARNING messages:
+
+E: Write_restart command before simulation box is defined
+
+The write_restart command cannot be used before a read_data,
+read_restart, or create_box command.
+
+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: Atom count is inconsistent, cannot write restart file
+
+Sum of atoms across processors does not equal initial total count.
+This is probably because you have lost some atoms.
+
+E: Cannot open restart file %s
+
+Self-explanatory.
+
+*/

Event Timeline