fix elstop: Rename to fix electron/stopping

This commit is contained in:
Risto Toijala 2019-04-04 09:57:15 +03:00
parent d1cb8970d5
commit 0d78c7b43d
17 changed files with 143 additions and 145 deletions

View File

@ -61,7 +61,7 @@ OPT.
"edpd/source"_fix_dpd_source.html,
"efield"_fix_efield.html,
"ehex"_fix_ehex.html,
"elstop"_fix_elstop.html,
"electron/stopping"_fix_electron_stopping.html,
"enforce2d (k)"_fix_enforce2d.html,
"eos/cv"_fix_eos_cv.html,
"eos/table"_fix_eos_table.html,

View File

@ -199,7 +199,7 @@ accelerated styles exist.
"edpd/source"_fix_dpd_source.html -
"efield"_fix_efield.html - impose electric field on system
"ehex"_fix_ehex.html - enhanced heat exchange algorithm
"elstop"_fix_elstop.html - electronic stopping power as a friction force
"electron/stopping"_fix_electron_stopping.html - electronic stopping power as a friction force
"enforce2d"_fix_enforce2d.html - zero out z-dimension velocity and force
"eos/cv"_fix_eos_cv.html -
"eos/table"_fix_eos_table.html -

View File

@ -6,14 +6,14 @@
:line
fix elstop command :h3
fix electron/stopping command :h3
[Syntax:]
fix ID group-ID elstop Ecut file keyword value ... :pre
fix ID group-ID electron/stopping Ecut file keyword value ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
elstop = style name of this fix command :l
electron/stopping = style name of this fix command :l
Ecut = minimum kinetic energy for electronic stopping (energy units) :l
file = name of the file containing the electronic stopping power table :l
zero or more keyword/value pairs may be appended to args :l
@ -21,14 +21,14 @@ keyword = {region} or {minneigh} :l
{region} value = region-ID
region-ID = region, whose atoms will be affected by this fix
{minneigh} value = minneigh
minneigh = minimum number of neighbors for atoms to have elstop applied :pre
minneigh = minimum number of neighbors an atom to have stopping applied :pre
:ule
[Examples:]
fix el all elstop 10.0 elstop-table.txt
fix el all elstop 10.0 elstop-table.txt minneigh 3
fix el mygroup elstop 1.0 elstop-table.txt region bulk :pre
fix el all electron/stopping 10.0 elstop-table.txt
fix el all electron/stopping 10.0 elstop-table.txt minneigh 3
fix el mygroup electron/stopping 1.0 elstop-table.txt region bulk :pre
[Description:]
@ -48,9 +48,9 @@ to each atom as:
\vec\{F\}_i = \vec\{F\}^0_i - \frac\{\vec\{v\}_i\}\{\|\vec\{v\}_i\|\} \cdot S_e
\end\{equation\}
where \(\vec\{F\}_i\) is the resulting total force on the atom. \(\vec\{F\}^0_i\)
is the original force applied to the atom, \(\vec\{v\}_i\) is its velocity and
\(S_e\) is the stopping power of the ion.
where \(\vec\{F\}_i\) is the resulting total force on the atom.
\(\vec\{F\}^0_i\) is the original force applied to the atom, \(\vec\{v\}_i\) is
its velocity and \(S_e\) is the stopping power of the ion.
NOTE: In addition to electronic stopping, atomic cascades and irradiation
simulations require the use of an adaptive timestep (see
@ -79,10 +79,10 @@ in bulk material. An alternative is to disable the check for neighbors by
setting {minneigh} to zero and using the {region} keyword. This is necessary
when running simulations of cluster bombardment.
If the {region} keyword is used, the atom must also be in the specified geometric
"region"_region.html in order to have electronic stopping applied to it. This is
useful if the position of the bulk material is fixed. By default the electronic
stopping is applied everywhere in the simulation cell.
If the {region} keyword is used, the atom must also be in the specified
geometric "region"_region.html in order to have electronic stopping applied to
it. This is useful if the position of the bulk material is fixed. By default
the electronic stopping is applied everywhere in the simulation cell.
:line

View File

@ -40,7 +40,7 @@ Fixes :h1
fix_dt_reset
fix_efield
fix_ehex
fix_elstop
fix_electron_stopping
fix_enforce2d
fix_eos_cv
fix_eos_table

View File

@ -264,7 +264,7 @@ fix_drude_transform.html
fix_dt_reset.html
fix_efield.html
fix_ehex.html
fix_elstop.html
fix_electron_stopping.html
fix_enforce2d.html
fix_eos_cv.html
fix_eos_table.html

View File

@ -692,7 +692,6 @@ elong
Elsevier
Elsner
Elstner
elstop
elt
emacs
emax

View File

@ -1,4 +1,4 @@
# Test case / example for the electronic stopping fix elstop
# Test case / example for fix electron/stopping
# Perfect Si lattice with one primary knock-on atom.
#
# Also uses fix dt/reset, as one should when energies are high
@ -26,7 +26,7 @@ pair_style sw
pair_coeff * * Si.sw Si
fix fdt all dt/reset 1 NULL 0.001 0.1 emax 20.0
fix fel all elstop 1.0 Si.Si.elstop
fix fel all electron/stopping 1.0 Si.Si.elstop
fix fnve all nve
thermo 10

View File

@ -1,6 +1,6 @@
# Test case / example for the electronic stopping fix elstop
# Test case / example for fix electron/stopping
# One fast atom, no other interactions.
# Elstop only applied in a smaller box in the middle.
# Stopping only applied in a smaller box in the middle.
#
# Also uses fix dt/reset, as one should when energies are high
# enough to require electronic stopping.
@ -25,7 +25,7 @@ pair_style zero 1
pair_coeff * * 1
fix fdt all dt/reset 1 NULL 0.001 0.1 emax 20.0
fix fel all elstop 1.0 Si.Si.elstop minneigh 0 region rsmallbox
fix fel all electron/stopping 1.0 Si.Si.elstop minneigh 0 region rsmallbox
fix fnve all nve
compute ek all ke/atom

View File

@ -1,7 +1,7 @@
LAMMPS (28 Feb 2019)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:88)
using 1 OpenMP thread(s) per MPI task
# Test case / example for the electronic stopping fix elstop
# Test case / example for fix electron/stopping
# Perfect Si lattice with one primary knock-on atom.
#
# Also uses fix dt/reset, as one should when energies are high
@ -23,7 +23,7 @@ mass 1 28.0855
create_atoms 1 box
Created 32000 atoms
Time spent = 0.00365901 secs
create_atoms CPU = 0.00282311 secs
velocity all create 300 42534 mom yes rot yes
@ -36,7 +36,7 @@ pair_coeff * * Si.sw Si
Reading potential file Si.sw with DATE: 2007-06-11
fix fdt all dt/reset 1 NULL 0.001 0.1 emax 20.0
fix fel all elstop 1.0 Si.Si.elstop
fix fel all electron/stopping 1.0 Si.Si.elstop
fix fnve all nve
thermo 10
@ -58,7 +58,7 @@ Neighbor list info ...
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(2) fix elstop, occasional, copy from (1)
(2) fix electron/stopping, occasional, copy from (1)
attributes: full, newton on
pair build: copy
stencil: none
@ -566,20 +566,20 @@ Step Time Dt f_fel
4980 0.014568876 3.9720495e-08 6777.8926
4990 0.014569265 3.7726941e-08 6778.0636
5000 0.014569634 3.5910753e-08 6778.2261
Loop time of 27.2739 on 1 procs for 5000 steps with 32000 atoms
Loop time of 24.155 on 1 procs for 5000 steps with 32000 atoms
Performance: 0.001 ns/day, 42193.880 hours/ns, 183.326 timesteps/s
96.6% CPU use with 1 MPI tasks x 1 OpenMP threads
Performance: 0.001 ns/day, 37368.951 hours/ns, 206.996 timesteps/s
99.8% CPU use with 1 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 17.626 | 17.626 | 17.626 | 0.0 | 64.62
Neigh | 1.5828 | 1.5828 | 1.5828 | 0.0 | 5.80
Comm | 0.78596 | 0.78596 | 0.78596 | 0.0 | 2.88
Output | 0.0082562 | 0.0082562 | 0.0082562 | 0.0 | 0.03
Modify | 6.414 | 6.414 | 6.414 | 0.0 | 23.52
Other | | 0.8573 | | | 3.14
Pair | 15.795 | 15.795 | 15.795 | 0.0 | 65.39
Neigh | 1.5182 | 1.5182 | 1.5182 | 0.0 | 6.29
Comm | 0.58555 | 0.58555 | 0.58555 | 0.0 | 2.42
Output | 0.0064323 | 0.0064323 | 0.0064323 | 0.0 | 0.03
Modify | 5.619 | 5.619 | 5.619 | 0.0 | 23.26
Other | | 0.6313 | | | 2.61
Nlocal: 32000 ave 32000 max 32000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
@ -594,4 +594,4 @@ Total # of neighbors = 576016
Ave neighs/atom = 18.0005
Neighbor list builds = 68
Dangerous builds = 42
Total wall time: 0:00:27
Total wall time: 0:00:24

View File

@ -1,7 +1,7 @@
LAMMPS (28 Feb 2019)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:88)
using 1 OpenMP thread(s) per MPI task
# Test case / example for the electronic stopping fix elstop
# Test case / example for fix electron/stopping
# Perfect Si lattice with one primary knock-on atom.
#
# Also uses fix dt/reset, as one should when energies are high
@ -23,7 +23,7 @@ mass 1 28.0855
create_atoms 1 box
Created 32000 atoms
Time spent = 0.000838995 secs
create_atoms CPU = 0.000856161 secs
velocity all create 300 42534 mom yes rot yes
@ -36,7 +36,7 @@ pair_coeff * * Si.sw Si
Reading potential file Si.sw with DATE: 2007-06-11
fix fdt all dt/reset 1 NULL 0.001 0.1 emax 20.0
fix fel all elstop 1.0 Si.Si.elstop
fix fel all electron/stopping 1.0 Si.Si.elstop
fix fnve all nve
thermo 10
@ -58,7 +58,7 @@ Neighbor list info ...
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(2) fix elstop, occasional, copy from (1)
(2) fix electron/stopping, occasional, copy from (1)
attributes: full, newton on
pair build: copy
stencil: none
@ -566,20 +566,20 @@ Step Time Dt f_fel
4980 0.014615386 1.0814135e-07 6805.2899
4990 0.014616494 1.1414984e-07 6805.7869
5000 0.014617666 1.2114278e-07 6806.313
Loop time of 20.4871 on 4 procs for 5000 steps with 32000 atoms
Loop time of 9.26846 on 4 procs for 5000 steps with 32000 atoms
Performance: 0.003 ns/day, 9395.278 hours/ns, 244.056 timesteps/s
80.0% CPU use with 4 MPI tasks x 1 OpenMP threads
Performance: 0.006 ns/day, 4250.474 hours/ns, 539.464 timesteps/s
96.0% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 5.3304 | 5.3747 | 5.4481 | 1.9 | 26.23
Neigh | 0.47764 | 0.49529 | 0.50484 | 1.5 | 2.42
Comm | 7.3264 | 7.6698 | 8.0174 | 11.5 | 37.44
Output | 0.020597 | 0.064879 | 0.11197 | 13.7 | 0.32
Modify | 4.3321 | 4.7499 | 5.1576 | 18.4 | 23.18
Other | | 2.132 | | | 10.41
Pair | 4.6281 | 4.7789 | 5.1937 | 11.0 | 51.56
Neigh | 0.40488 | 0.41576 | 0.43895 | 2.1 | 4.49
Comm | 0.8478 | 1.2799 | 1.4349 | 22.1 | 13.81
Output | 0.0048099 | 0.016429 | 0.050251 | 15.2 | 0.18
Modify | 2.1042 | 2.1347 | 2.1706 | 1.6 | 23.03
Other | | 0.6427 | | | 6.93
Nlocal: 8000 ave 8033 max 7977 min
Histogram: 1 0 1 1 0 0 0 0 0 1
@ -594,4 +594,4 @@ Total # of neighbors = 576008
Ave neighs/atom = 18.0003
Neighbor list builds = 67
Dangerous builds = 38
Total wall time: 0:00:20
Total wall time: 0:00:09

View File

@ -1,9 +1,9 @@
LAMMPS (28 Feb 2019)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:88)
using 1 OpenMP thread(s) per MPI task
# Test case / example for the electronic stopping fix elstop
# Test case / example for fix electron/stopping
# One fast atom, no other interactions.
# Elstop only applied in a smaller box in the middle.
# Stopping only applied in a smaller box in the middle.
#
# Also uses fix dt/reset, as one should when energies are high
# enough to require electronic stopping.
@ -26,14 +26,14 @@ mass 1 28.0855
create_atoms 1 single 0 0 0
Created 1 atoms
Time spent = 3.09944e-06 secs
create_atoms CPU = 4.05312e-06 secs
velocity all set 1120 1620 389
pair_style zero 1
pair_coeff * * 1
fix fdt all dt/reset 1 NULL 0.001 0.1 emax 20.0
fix fel all elstop 1.0 Si.Si.elstop minneigh 0 region rsmallbox
fix fel all electron/stopping 1.0 Si.Si.elstop minneigh 0 region rsmallbox
fix fnve all nve
compute ek all ke/atom
@ -45,8 +45,6 @@ thermo_style custom step time dt f_fel c_ektot
#dump mydump all custom 200 elstop.only.dump id x y z vx vy vz fx fy fz c_ek
run 10000
WARNING: More than one compute ke/atom (src/compute_ke_atom.cpp:55)
WARNING: More than one compute ke/atom (src/compute_ke_atom.cpp:55)
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
@ -59,7 +57,7 @@ Neighbor list info ...
pair build: half/bin/atomonly/newton
stencil: half/bin/3d/newton
bin: standard
(2) fix elstop, occasional
(2) fix electron/stopping, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
@ -167,20 +165,20 @@ Step Time Dt f_fel c_ektot
9800 0.57677384 6.0949329e-05 1947.6558 3917.8967
9900 0.58286878 6.0949329e-05 1947.6558 3917.8967
10000 0.58896371 6.0949329e-05 1947.6558 3917.8967
Loop time of 1.81749 on 1 procs for 10000 steps with 1 atoms
Loop time of 1.25184 on 1 procs for 10000 steps with 1 atoms
Performance: 28.974 ns/day, 0.828 hours/ns, 5502.087 timesteps/s
95.8% CPU use with 1 MPI tasks x 1 OpenMP threads
Performance: 42.066 ns/day, 0.571 hours/ns, 7988.216 timesteps/s
99.7% CPU use with 1 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.00068855 | 0.00068855 | 0.00068855 | 0.0 | 0.04
Neigh | 1.777 | 1.777 | 1.777 | 0.0 | 97.77
Comm | 0.028521 | 0.028521 | 0.028521 | 0.0 | 1.57
Output | 0.0020428 | 0.0020428 | 0.0020428 | 0.0 | 0.11
Modify | 0.0063827 | 0.0063827 | 0.0063827 | 0.0 | 0.35
Other | | 0.002891 | | | 0.16
Pair | 0.0005827 | 0.0005827 | 0.0005827 | 0.0 | 0.05
Neigh | 1.2134 | 1.2134 | 1.2134 | 0.0 | 96.93
Comm | 0.02822 | 0.02822 | 0.02822 | 0.0 | 2.25
Output | 0.0017159 | 0.0017159 | 0.0017159 | 0.0 | 0.14
Modify | 0.0052147 | 0.0052147 | 0.0052147 | 0.0 | 0.42
Other | | 0.002664 | | | 0.21
Nlocal: 1 ave 1 max 1 min
Histogram: 1 0 0 0 0 0 0 0 0 0

View File

@ -1,9 +1,9 @@
LAMMPS (28 Feb 2019)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:88)
using 1 OpenMP thread(s) per MPI task
# Test case / example for the electronic stopping fix elstop
# Test case / example for fix electron/stopping
# One fast atom, no other interactions.
# Elstop only applied in a smaller box in the middle.
# Stopping only applied in a smaller box in the middle.
#
# Also uses fix dt/reset, as one should when energies are high
# enough to require electronic stopping.
@ -26,14 +26,14 @@ mass 1 28.0855
create_atoms 1 single 0 0 0
Created 1 atoms
Time spent = 2.00272e-05 secs
create_atoms CPU = 1.19209e-05 secs
velocity all set 1120 1620 389
pair_style zero 1
pair_coeff * * 1
fix fdt all dt/reset 1 NULL 0.001 0.1 emax 20.0
fix fel all elstop 1.0 Si.Si.elstop minneigh 0 region rsmallbox
fix fel all electron/stopping 1.0 Si.Si.elstop minneigh 0 region rsmallbox
fix fnve all nve
compute ek all ke/atom
@ -45,8 +45,6 @@ thermo_style custom step time dt f_fel c_ektot
#dump mydump all custom 200 elstop.only.dump id x y z vx vy vz fx fy fz c_ek
run 10000
WARNING: More than one compute ke/atom (src/compute_ke_atom.cpp:55)
WARNING: More than one compute ke/atom (src/compute_ke_atom.cpp:55)
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
@ -59,7 +57,7 @@ Neighbor list info ...
pair build: half/bin/atomonly/newton
stencil: half/bin/3d/newton
bin: standard
(2) fix elstop, occasional
(2) fix electron/stopping, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
@ -167,20 +165,20 @@ Step Time Dt f_fel c_ektot
9800 0.57677384 6.0949329e-05 1947.6558 3917.8967
9900 0.58286878 6.0949329e-05 1947.6558 3917.8967
10000 0.58896371 6.0949329e-05 1947.6558 3917.8967
Loop time of 3.82192 on 4 procs for 10000 steps with 1 atoms
Loop time of 1.38891 on 4 procs for 10000 steps with 1 atoms
Performance: 13.778 ns/day, 1.742 hours/ns, 2616.487 timesteps/s
76.8% CPU use with 4 MPI tasks x 1 OpenMP threads
Performance: 37.915 ns/day, 0.633 hours/ns, 7199.876 timesteps/s
94.0% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.0006454 | 0.00077975 | 0.001003 | 0.0 | 0.02
Neigh | 1.3094 | 1.3771 | 1.441 | 4.0 | 36.03
Comm | 0.13665 | 0.16207 | 0.20281 | 6.1 | 4.24
Output | 0.036584 | 0.046189 | 0.060792 | 4.2 | 1.21
Modify | 2.1326 | 2.212 | 2.3096 | 4.3 | 57.88
Other | | 0.02382 | | | 0.62
Pair | 0.0004971 | 0.00060463 | 0.00069618 | 0.0 | 0.04
Neigh | 1.1005 | 1.1507 | 1.2839 | 7.2 | 82.85
Comm | 0.025918 | 0.026382 | 0.027041 | 0.3 | 1.90
Output | 0.0016336 | 0.005001 | 0.01507 | 8.2 | 0.36
Modify | 0.059378 | 0.20196 | 0.25453 | 18.3 | 14.54
Other | | 0.00422 | | | 0.30
Nlocal: 0.25 ave 1 max 0 min
Histogram: 3 0 0 0 0 0 0 0 0 1
@ -195,4 +193,4 @@ Total # of neighbors = 0
Ave neighs/atom = 0
Neighbor list builds = 960
Dangerous builds = 568
Total wall time: 0:00:03
Total wall time: 0:00:01

View File

@ -45,7 +45,7 @@ dihedral_style table/cut, Mike Salerno, ksalerno@pha.jhu.edu, 11 May 18
fix addtorque, Laurent Joly (U Lyon), ljoly.ulyon at gmail.com, 8 Aug 11
fix ave/correlate/long, Jorge Ramirez (UPM Madrid), jorge.ramirez at upm.es, 21 Oct 2015
fix bond/react, Jacob Gissinger (CU Boulder), info at disarmmd.org, 24 Feb 2018
fix elstop, Konstantin Avchaciov, k.avchachov at gmail.com, 26 Feb 2019
fix electron/stopping, Konstantin Avchaciov, k.avchachov at gmail.com, 26 Feb 2019
fix ffl, David Wilkins (EPFL Lausanne), david.wilkins @ epfl.ch, 28 Sep 2018
fix filter/corotate, Lukas Fath (KIT), lukas.fath at kit.edu, 15 Mar 2017
fix flow/gauss, Joel Eaves (CU Boulder), Joel.Eaves@Colorado.edu, 23 Aug 2016

View File

@ -19,7 +19,7 @@
#include <cmath>
#include <cstdio>
#include <cstring>
#include "fix_elstop.h"
#include "fix_electron_stopping.h"
#include "mpi.h"
#include "atom.h"
#include "update.h"
@ -42,7 +42,7 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixElstop::FixElstop(LAMMPS *lmp, int narg, char **arg) :
FixElectronStopping::FixElectronStopping(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
scalar_flag = 1; // Has compute_scalar
@ -51,16 +51,17 @@ FixElstop::FixElstop(LAMMPS *lmp, int narg, char **arg) :
nevery = 1; // Run fix every step
// args: 0 = fix ID, 1 = group ID, 2 = "elstop"
// args: 0 = fix ID, 1 = group ID, 2 = "electron/stopping"
// 3 = Ecut, 4 = file path
// optional rest: "region" <region name>
// "minneigh" <min number of neighbors>
if (narg < 5)
error->all(FLERR, "Illegal fix elstop command: too few arguments");
if (narg < 5) error->all(FLERR,
"Illegal fix electron/stopping command: too few arguments");
Ecut = force->numeric(FLERR, arg[3]);
if (Ecut <= 0.0) error->all(FLERR, "Illegal fix elstop command: Ecut <= 0");
if (Ecut <= 0.0) error->all(FLERR,
"Illegal fix electron/stopping command: Ecut <= 0");
int iarg = 5;
iregion = -1;
@ -69,27 +70,28 @@ FixElstop::FixElstop(LAMMPS *lmp, int narg, char **arg) :
while (iarg < narg) {
if (strcmp(arg[iarg], "region") == 0) {
if (iregion >= 0)
error->all(FLERR, "Illegal fix elstop command: region given twice");
if (iarg+2 > narg)
error->all(FLERR, "Illegal fix elstop command: region name missing");
if (iregion >= 0) error->all(FLERR,
"Illegal fix electron/stopping command: region given twice");
if (iarg+2 > narg) error->all(FLERR,
"Illegal fix electron/stopping command: region name missing");
iregion = domain->find_region(arg[iarg+1]);
if (iregion < 0)
error->all(FLERR, "Region ID for fix elstop does not exist");
if (iregion < 0) error->all(FLERR,
"Region ID for fix electron/stopping does not exist");
iarg += 2;
}
else if (strcmp(arg[iarg], "minneigh") == 0) {
if (minneighflag)
error->all(FLERR, "Illegal fix elstop command: minneigh given twice");
if (minneighflag) error->all(FLERR,
"Illegal fix electron/stopping command: minneigh given twice");
minneighflag = true;
if (iarg+2 > narg)
error->all(FLERR, "Illegal fix elstop command: minneigh number missing");
if (iarg+2 > narg) error->all(FLERR,
"Illegal fix electron/stopping command: minneigh number missing");
minneigh = force->inumeric(FLERR, arg[iarg+1]);
if (minneigh < 0)
error->all(FLERR, "Illegal fix elstop command: minneigh < 0");
if (minneigh < 0) error->all(FLERR,
"Illegal fix electron/stopping command: minneigh < 0");
iarg += 2;
}
else error->all(FLERR, "Illegal fix elstop command: unknown argument");
else error->all(FLERR,
"Illegal fix electron/stopping command: unknown argument");
}
@ -98,7 +100,7 @@ FixElstop::FixElstop(LAMMPS *lmp, int narg, char **arg) :
const int ncol = atom->ntypes + 1;
if (comm->me == 0) {
maxlines = 300;
memory->create(elstop_ranges, ncol, maxlines, "elstop:tabs");
memory->create(elstop_ranges, ncol, maxlines, "electron/stopping:table");
read_table(arg[4]);
}
@ -106,21 +108,21 @@ FixElstop::FixElstop(LAMMPS *lmp, int narg, char **arg) :
MPI_Bcast(&table_entries, 1 , MPI_INT, 0, world);
if (comm->me != 0)
memory->create(elstop_ranges, ncol, maxlines, "elstop:tabs");
memory->create(elstop_ranges, ncol, maxlines, "electron/stopping:table");
MPI_Bcast(&elstop_ranges[0][0], ncol*maxlines, MPI_DOUBLE, 0, world);
}
/* ---------------------------------------------------------------------- */
FixElstop::~FixElstop()
FixElectronStopping::~FixElectronStopping()
{
memory->destroy(elstop_ranges);
}
/* ---------------------------------------------------------------------- */
int FixElstop::setmask()
int FixElectronStopping::setmask()
{
int mask = 0;
mask |= POST_FORCE;
@ -129,7 +131,7 @@ int FixElstop::setmask()
/* ---------------------------------------------------------------------- */
void FixElstop::init()
void FixElectronStopping::init()
{
SeLoss_sync_flag = 0;
SeLoss = 0.0;
@ -145,14 +147,14 @@ void FixElstop::init()
/* ---------------------------------------------------------------------- */
void FixElstop::init_list(int /*id*/, NeighList *ptr)
void FixElectronStopping::init_list(int /*id*/, NeighList *ptr)
{
list = ptr;
}
/* ---------------------------------------------------------------------- */
void FixElstop::post_force(int /*vflag*/)
void FixElectronStopping::post_force(int /*vflag*/)
{
SeLoss_sync_flag = 0;
@ -183,8 +185,8 @@ void FixElstop::post_force(int /*vflag*/)
if (energy < Ecut) continue;
if (energy < elstop_ranges[0][0]) continue;
if (energy > elstop_ranges[0][table_entries - 1])
error->one(FLERR, "Atom kinetic energy too high for fix elstop");
if (energy > elstop_ranges[0][table_entries - 1]) error->one(FLERR,
"Atom kinetic energy too high for fix electron/stopping");
if (iregion >= 0) {
// Only apply in the given region
@ -207,7 +209,7 @@ void FixElstop::post_force(int /*vflag*/)
double E_lo = elstop_ranges[0][idown];
double E_hi = elstop_ranges[0][iup];
// Get elstop with a simple linear interpolation
// Get electronic stopping with a simple linear interpolation
double Se = (Se_hi - Se_lo) / (E_hi - E_lo) * (energy - E_lo) + Se_lo;
double vabs = sqrt(v2);
@ -223,7 +225,7 @@ void FixElstop::post_force(int /*vflag*/)
/* ---------------------------------------------------------------------- */
double FixElstop::compute_scalar()
double FixElectronStopping::compute_scalar()
{
// only sum across procs when changed since last call
@ -236,7 +238,7 @@ double FixElstop::compute_scalar()
/* ---------------------------------------------------------------------- */
void FixElstop::read_table(const char *file)
void FixElectronStopping::read_table(const char *file)
{
char line[MAXLINE];
@ -266,30 +268,31 @@ void FixElstop::read_table(const char *file)
}
if (i != ncol || pch != NULL) // too short or too long
error->one(FLERR, "fix elstop: Invalid table line");
error->one(FLERR, "fix electron/stopping: Invalid table line");
if (l >= 1 && elstop_ranges[0][l] <= elstop_ranges[0][l-1])
error->one(FLERR, "fix elstop: Energies must be in ascending order");
error->one(FLERR,
"fix electron/stopping: Energies must be in ascending order");
l++;
}
table_entries = l;
if (table_entries == 0)
error->one(FLERR, "Did not find any data in elstop table file");
error->one(FLERR, "Did not find any data in electron/stopping table file");
fclose(fp);
}
/* ---------------------------------------------------------------------- */
void FixElstop::grow_table()
void FixElectronStopping::grow_table()
{
const int ncol = atom->ntypes + 1;
int new_maxlines = 2 * maxlines;
double **new_array;
memory->create(new_array, ncol, new_maxlines, "elstop:tabscopy");
memory->create(new_array, ncol, new_maxlines, "electron/stopping:table");
for (int i = 0; i < ncol; i++)
memcpy(new_array[i], elstop_ranges[i], maxlines*sizeof(double));

View File

@ -18,22 +18,22 @@
#ifdef FIX_CLASS
FixStyle(elstop,FixElstop)
FixStyle(electron/stopping,FixElectronStopping)
#else
#ifndef LMP_FIX_ELSTOP_H
#define LMP_FIX_ELSTOP_H
#ifndef LMP_FIX_ELECTRON_STOPPING_H
#define LMP_FIX_ELECTRON_STOPPING_H
#include "fix.h"
namespace LAMMPS_NS {
class FixElstop : public Fix {
class FixElectronStopping : public Fix {
public:
FixElstop(class LAMMPS *, int, char **);
~FixElstop();
FixElectronStopping(class LAMMPS *, int, char **);
~FixElectronStopping();
int setmask();
void init();
void post_force(int);
@ -72,33 +72,33 @@ 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 elstop does not exist
E: Region ID for fix electron/stopping does not exist
Self-explanatory.
E: Atom kinetic energy too high for fix elstop
E: Atom kinetic energy too high for fix electron/stopping
The group given in the fix elstop command includes an atom that has
a kinetic energy higher than the largest energy in the elstop table.
Reconsider whether the table is physically applicable to your system.
The group given in the fix electron/stopping command includes an atom
that has a kinetic energy higher than the largest energy in the stopping
table. Reconsider whether the table is physically applicable to your system.
E: Cannot open stopping range table ...
The file containing the elstop table could not be opened. Chck the
given path and the file's permissions.
The file containing the electronic stopping table could not be opened.
Check the given path and the file's permissions.
E: fix elstop: Invalid table line
E: fix electron/stopping: Invalid table line
A line in the elstop table file contained too many or too few columns.
A line in the stopping table file contained too many or too few columns.
E: fix elstop: Energies must be in ascending order
E: fix electron/stopping: Energies must be in ascending order
The first column in the elstop table must be sorted from the smallest
The first column in the stopping table must be sorted from the smallest
energy to the largest.
E: Did not find any data in elstop table file
E: Did not find any data in electronic stopping table file
Parsing the elstop table file produced no lines that were identifiable
Parsing the stopping table file produced no lines that were identifiable
as energies/stopping powers. Most likely the file is empty or contains
only comments.