Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
argo
Applications
LAMMPS
Commits
44bda245
Commit
44bda245
authored
Aug 24, 2018
by
Steven J. Plimpton
Browse files
resolution of cutoff issues
parent
59d3af44
Changes
6
Hide whitespace changes
Inline
Side-by-side
doc/src/pair_atm.txt
View file @
44bda245
...
@@ -10,8 +10,6 @@ pair_style atm command :h3
...
@@ -10,8 +10,6 @@ pair_style atm command :h3
[Syntax:]
[Syntax:]
SJP: add an arg
pair_style atm cutoff cutoff_triple :pre
pair_style atm cutoff cutoff_triple :pre
cutoff = cutoff for each pair in 3-body interaction (distance units)
cutoff = cutoff for each pair in 3-body interaction (distance units)
...
@@ -19,11 +17,10 @@ cutoff_triple = additional cutoff applied to product of 3 pairwise distances (di
...
@@ -19,11 +17,10 @@ cutoff_triple = additional cutoff applied to product of 3 pairwise distances (di
[Examples:]
[Examples:]
SJP: is 1.5 a good value?
pair_style atm 4.5 2.5
pair_style atm 2.5 1.5
pair_coeff * * * 0.072 :pre
pair_coeff * * * 0.072 :pre
pair_style hybrid/overlay lj/cut 6.5 atm
2
.5
1
.5
pair_style hybrid/overlay lj/cut 6.5 atm
4
.5
2
.5
pair_coeff * * lj/cut 1.0 1.0
pair_coeff * * lj/cut 1.0 1.0
pair_coeff 1 1 atm 1 0.064
pair_coeff 1 1 atm 1 0.064
pair_coeff 1 1 atm 2 0.080
pair_coeff 1 1 atm 2 0.080
...
@@ -55,9 +52,9 @@ command as in the example above.
...
@@ -55,9 +52,9 @@ command as in the example above.
The potential for a triplet of atom is calculated only if all 3
The potential for a triplet of atom is calculated only if all 3
distances r12, r23, r31 between the 3 atoms satisfy rIJ < cutoff.
distances r12, r23, r31 between the 3 atoms satisfy rIJ < cutoff.
SJP:
In addition, the product of the 3 distances r12*r23*r31 <
In addition, the product of the 3 distances r12*r23*r31 <
cutoff_triple^3 is required, which
limits the contribu
tion
of
the
cutoff_triple^3 is required, which
excludes from calcula
tion the
potential to ???
triplets with small contribution to the interaction.
The following coefficients must be defined for each pair of atoms
The following coefficients must be defined for each pair of atoms
types via the "pair_coeff"_pair_coeff.html command as in the examples
types via the "pair_coeff"_pair_coeff.html command as in the examples
...
...
examples/atm/in.atm
View file @
44bda245
...
@@ -16,7 +16,7 @@ region box block 0 ${xx} 0 ${yy} 0 ${zz}
...
@@ -16,7 +16,7 @@ region box block 0 ${xx} 0 ${yy} 0 ${zz}
create_box 1 box
create_box 1 box
create_atoms 1 box
create_atoms 1 box
pair_style hybrid/overlay lj/cut 4.5 atm 2.5
pair_style hybrid/overlay lj/cut 4.5 atm
4.5
2.5
pair_coeff * * lj/cut 1.0 1.0
pair_coeff * * lj/cut 1.0 1.0
pair_coeff * * atm * 0.072
pair_coeff * * atm * 0.072
...
...
examples/atm/log.
9Jul
18.atm.g++.1
→
examples/atm/log.
23Aug
18.atm.g++.1
View file @
44bda245
LAMMPS (2
9 Jun
2018)
LAMMPS (2
2 Aug
2018)
# Axilrod-Teller-Muto potential example
# Axilrod-Teller-Muto potential example
variable x index 1
variable x index 1
...
@@ -26,9 +26,9 @@ Created orthogonal box = (0 0 0) to (18.3252 18.3252 18.3252)
...
@@ -26,9 +26,9 @@ Created orthogonal box = (0 0 0) to (18.3252 18.3252 18.3252)
1 by 1 by 1 MPI processor grid
1 by 1 by 1 MPI processor grid
create_atoms 1 box
create_atoms 1 box
Created 4000 atoms
Created 4000 atoms
Time spent = 0.0012
5098
secs
Time spent = 0.0012
6314
secs
pair_style hybrid/overlay lj/cut 4.5 atm 2.5
pair_style hybrid/overlay lj/cut 4.5 atm
4.5
2.5
pair_coeff * * lj/cut 1.0 1.0
pair_coeff * * lj/cut 1.0 1.0
pair_coeff * * atm * 0.072
pair_coeff * * atm * 0.072
...
@@ -60,26 +60,26 @@ Neighbor list info ...
...
@@ -60,26 +60,26 @@ Neighbor list info ...
bin: standard
bin: standard
Per MPI rank memory allocation (min/avg/max) = 11.47 | 11.47 | 11.47 Mbytes
Per MPI rank memory allocation (min/avg/max) = 11.47 | 11.47 | 11.47 Mbytes
Step Temp E_pair E_mol TotEng Press
Step Temp E_pair E_mol TotEng Press
0 1.033
-4.
733482
0 -3.
1843694 -3.924644
0 1.033 -4.
8899813
0 -3.
3408686 -4.2298176
5 1.033
574
3 -4.
733052
8 0 -3.
1830789 -3.9119065
5 1.033
785
3 -4.
892820
8 0 -3.
3425304 -4.2233154
10 1.03
49987
-4.
7346788
0 -3.
1825689 -3.8769962
10 1.03
58056
-4.
8953304
0 -3.
3420104 -4.1897183
15 1.03
62024
-4.
7401425
0 -3.
1862275 -3.8225106
15 1.03
80938
-4.
8990457
0 -3.
3422942 -4.1310148
20 1.03
52365
-4.
7459627
0 -3.
1934962 -3.7403572
20 1.03
89566
-4.
9014345
0 -3.
3433892 -4.0406616
25 1.0
29596
3 -4.
7444397
0 -3.
2004313 -3.6132651
25 1.0
35831
3 -4.
8989663
0 -3.
3456079 -3.9093019
Loop time of
27.841
on 1 procs for 25 steps with 4000 atoms
Loop time of
12.2062
on 1 procs for 25 steps with 4000 atoms
Performance:
155.167
tau/day,
0.89
8 timesteps/s
Performance:
353.920
tau/day,
2.04
8 timesteps/s
100.0
% CPU use with 1 MPI tasks x no OpenMP threads
99.9
% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
---------------------------------------------------------------
Pair |
27.837
|
27.837
|
27.837
| 0.0 | 99.9
9
Pair |
12.202
|
12.202
|
12.202
| 0.0 | 99.9
6
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0.0015
3
21 | 0.0015
3
21 | 0.0015
3
21 | 0.0 | 0.01
Comm | 0.0015
6
21 | 0.0015
6
21 | 0.0015
6
21 | 0.0 | 0.01
Output | 0.000
1659
4 | 0.000
1659
4 | 0.000
1659
4 | 0.0 | 0.00
Output | 0.000
2081
4 | 0.000
2081
4 | 0.000
2081
4 | 0.0 | 0.00
Modify | 0.001
785
| 0.001
785
| 0.001
785
| 0.0 | 0.0
1
Modify | 0.001
9698
| 0.001
9698
| 0.001
9698
| 0.0 | 0.0
2
Other | | 0.000
6
73
1
| | | 0.0
0
Other | | 0.000
7
73
4
| | | 0.0
1
Nlocal: 4000 ave 4000 max 4000 min
Nlocal: 4000 ave 4000 max 4000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Histogram: 1 0 0 0 0 0 0 0 0 0
...
@@ -97,4 +97,4 @@ Dangerous builds = 0
...
@@ -97,4 +97,4 @@ Dangerous builds = 0
Please see the log.cite file for references relevant to this simulation
Please see the log.cite file for references relevant to this simulation
Total wall time: 0:00:
29
Total wall time: 0:00:
13
examples/atm/log.
9Jul
18.atm.g++.4
→
examples/atm/log.
23Aug
18.atm.g++.4
View file @
44bda245
LAMMPS (2
9 Jun
2018)
LAMMPS (2
2 Aug
2018)
# Axilrod-Teller-Muto potential example
# Axilrod-Teller-Muto potential example
variable x index 1
variable x index 1
...
@@ -26,9 +26,9 @@ Created orthogonal box = (0 0 0) to (18.3252 18.3252 18.3252)
...
@@ -26,9 +26,9 @@ Created orthogonal box = (0 0 0) to (18.3252 18.3252 18.3252)
1 by 2 by 2 MPI processor grid
1 by 2 by 2 MPI processor grid
create_atoms 1 box
create_atoms 1 box
Created 4000 atoms
Created 4000 atoms
Time spent = 0.0007
69138
secs
Time spent = 0.0007
85112
secs
pair_style hybrid/overlay lj/cut 4.5 atm 2.5
pair_style hybrid/overlay lj/cut 4.5 atm
4.5
2.5
pair_coeff * * lj/cut 1.0 1.0
pair_coeff * * lj/cut 1.0 1.0
pair_coeff * * atm * 0.072
pair_coeff * * atm * 0.072
...
@@ -60,26 +60,26 @@ Neighbor list info ...
...
@@ -60,26 +60,26 @@ Neighbor list info ...
bin: standard
bin: standard
Per MPI rank memory allocation (min/avg/max) = 5.532 | 5.532 | 5.532 Mbytes
Per MPI rank memory allocation (min/avg/max) = 5.532 | 5.532 | 5.532 Mbytes
Step Temp E_pair E_mol TotEng Press
Step Temp E_pair E_mol TotEng Press
0 1.033
-4.
733482
0 -3.
1843694 -3.924644
0 1.033 -4.
8921547
0
-3.
343042 -4.2340557
5 1.033
5743
-4.
7330528
0 -3.
1830789 -3.9119065
5 1.033
7949
-4.
8947881
0 -3.
3444835 -4.2271456
10 1.03
49987
-4.
734678
8 0 -3.
1825689 -3.8769962
10 1.03
58286
-4.
897317
8 0 -3.
3439632 -4.1935779
15 1.03
62024
-4.
7401425
0 -3.
1862275 -3.8225106
15 1.03
81322
-4.
9010593
0 -3.
3442503 -4.134913
20 1.03
52365
-4.
7459627
0 -3.
1934962 -3.740357
2
20 1.03
90107
-4.
9034854
0 -3.
3453589 -4.044616
2
25 1.0
295963 -4.7444397
0 -3.
2004313
-3.
6
13
2651
25 1.0
358988 -4.9010506
0 -3.
3475908
-3.
9
13
3006
Loop time of
7.22029
on 4 procs for 25 steps with 4000 atoms
Loop time of
3.20632
on 4 procs for 25 steps with 4000 atoms
Performance:
598.314
tau/day,
3.462
timesteps/s
Performance:
1347.340
tau/day,
7.797
timesteps/s
100.0% CPU use with 4 MPI tasks x no OpenMP threads
100.0% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
---------------------------------------------------------------
Pair |
7
.1
346
|
7
.1
684
|
7
.18
63
|
0.8
| 9
9.28
Pair |
3
.1
207
|
3
.1
553
|
3
.18
59
|
1.5
| 9
8.41
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0.0
32945
| 0.0509
| 0.0846
64
|
9.1 | 0.70
Comm | 0.0
19466
| 0.050
0
9 | 0.0846
02
|
12.0 | 1.56
Output |
0.00010133 | 0.00011
05
1
| 0.0001
3804
| 0.0 | 0.00
Output |
7.1049e-05 | 8.2076e-
05 | 0.0001
1325
| 0.0 | 0.00
Modify | 0.0005
9557
| 0.000
60683
| 0.000
61274
| 0.0 | 0.0
1
Modify | 0.0005
6338
| 0.000
57292
| 0.000
58413
| 0.0 | 0.0
2
Other | | 0.0003
18
| | | 0.0
0
Other | | 0.0003
092
| | | 0.0
1
Nlocal: 1000 ave 1000 max 1000 min
Nlocal: 1000 ave 1000 max 1000 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Histogram: 4 0 0 0 0 0 0 0 0 0
...
@@ -97,4 +97,4 @@ Dangerous builds = 0
...
@@ -97,4 +97,4 @@ Dangerous builds = 0
Please see the log.cite file for references relevant to this simulation
Please see the log.cite file for references relevant to this simulation
Total wall time: 0:00:0
7
Total wall time: 0:00:0
3
src/MANYBODY/pair_atm.cpp
View file @
44bda245
...
@@ -15,9 +15,7 @@
...
@@ -15,9 +15,7 @@
Contributing author: Sergey Lishchuk
Contributing author: Sergey Lishchuk
------------------------------------------------------------------------- */
------------------------------------------------------------------------- */
#include <cmath>
#include <cmath>
#include "pair_atm.h"
#include "pair_atm.h"
#include "atom.h"
#include "atom.h"
#include "citeme.h"
#include "citeme.h"
...
@@ -92,7 +90,6 @@ void PairATM::compute(int eflag, int vflag)
...
@@ -92,7 +90,6 @@ void PairATM::compute(int eflag, int vflag)
int
*
type
=
atom
->
type
;
int
*
type
=
atom
->
type
;
double
cutoff_squared
=
cut_global
*
cut_global
;
double
cutoff_squared
=
cut_global
*
cut_global
;
// SJP: new cutoff
double
triple
=
cut_triple
*
cut_triple
*
cut_triple
;
double
triple
=
cut_triple
*
cut_triple
*
cut_triple
;
double
cutoff_triple_sixth
=
triple
*
triple
;
double
cutoff_triple_sixth
=
triple
*
triple
;
...
@@ -142,15 +139,14 @@ void PairATM::compute(int eflag, int vflag)
...
@@ -142,15 +139,14 @@ void PairATM::compute(int eflag, int vflag)
rik2
=
rik
[
0
]
*
rik
[
0
]
+
rik
[
1
]
*
rik
[
1
]
+
rik
[
2
]
*
rik
[
2
];
rik2
=
rik
[
0
]
*
rik
[
0
]
+
rik
[
1
]
*
rik
[
1
]
+
rik
[
2
]
*
rik
[
2
];
if
(
rik2
>
cutoff_squared
)
continue
;
if
(
rik2
>
cutoff_squared
)
continue
;
// SJP: add this line?
double
r6
=
rij2
*
rjk2
*
rik2
;
if
(
r6
>
cutoff_triple_sixth
)
continue
;
if
(
rij2
*
rjk2
*
rik2
>
cutoff_triple_sixth
)
continue
;
nu_local
=
nu
[
type
[
i
]][
type
[
j
]][
type
[
k
]];
nu_local
=
nu
[
type
[
i
]][
type
[
j
]][
type
[
k
]];
if
(
nu_local
==
0.0
)
continue
;
if
(
nu_local
==
0.0
)
continue
;
interaction_ddd
(
nu_local
,
interaction_ddd
(
nu_local
,
rij2
,
rik2
,
rjk2
,
rij
,
rik
,
rjk
,
fj
,
fk
,
eflag
,
evdwl
);
r6
,
rij2
,
rik2
,
rjk2
,
rij
,
rik
,
rjk
,
fj
,
fk
,
eflag
,
evdwl
);
f
[
i
][
0
]
-=
fj
[
0
]
+
fk
[
0
];
f
[
i
][
0
]
-=
fj
[
0
]
+
fk
[
0
];
f
[
i
][
1
]
-=
fj
[
1
]
+
fk
[
1
];
f
[
i
][
1
]
-=
fj
[
1
]
+
fk
[
1
];
...
@@ -200,14 +196,10 @@ void PairATM::allocate()
...
@@ -200,14 +196,10 @@ void PairATM::allocate()
void
PairATM
::
settings
(
int
narg
,
char
**
arg
)
void
PairATM
::
settings
(
int
narg
,
char
**
arg
)
{
{
// SJP: change to 2 args, require triple <= global
if
(
narg
!=
2
)
error
->
all
(
FLERR
,
"Illegal pair_style command"
);
if
(
narg
!=
2
)
error
->
all
(
FLERR
,
"Illegal pair_style command"
);
cut_global
=
force
->
numeric
(
FLERR
,
arg
[
0
]);
cut_global
=
force
->
numeric
(
FLERR
,
arg
[
0
]);
cut_triple
=
force
->
numeric
(
FLERR
,
arg
[
1
]);
cut_triple
=
force
->
numeric
(
FLERR
,
arg
[
1
]);
if
(
cut_triple
>
cut_global
)
error
->
all
(
FLERR
,
"Illegal pair_style command"
);
}
}
/* ----------------------------------------------------------------------
/* ----------------------------------------------------------------------
...
@@ -324,7 +316,6 @@ void PairATM::read_restart(FILE *fp)
...
@@ -324,7 +316,6 @@ void PairATM::read_restart(FILE *fp)
void
PairATM
::
write_restart_settings
(
FILE
*
fp
)
void
PairATM
::
write_restart_settings
(
FILE
*
fp
)
{
{
fwrite
(
&
cut_global
,
sizeof
(
double
),
1
,
fp
);
fwrite
(
&
cut_global
,
sizeof
(
double
),
1
,
fp
);
// SJP: 2nd arg
fwrite
(
&
cut_triple
,
sizeof
(
double
),
1
,
fp
);
fwrite
(
&
cut_triple
,
sizeof
(
double
),
1
,
fp
);
}
}
...
@@ -334,7 +325,6 @@ void PairATM::write_restart_settings(FILE *fp)
...
@@ -334,7 +325,6 @@ void PairATM::write_restart_settings(FILE *fp)
void
PairATM
::
read_restart_settings
(
FILE
*
fp
)
void
PairATM
::
read_restart_settings
(
FILE
*
fp
)
{
{
// SJP: 2nd arg
int
me
=
comm
->
me
;
int
me
=
comm
->
me
;
if
(
me
==
0
)
{
if
(
me
==
0
)
{
fread
(
&
cut_global
,
sizeof
(
double
),
1
,
fp
);
fread
(
&
cut_global
,
sizeof
(
double
),
1
,
fp
);
...
@@ -348,13 +338,12 @@ void PairATM::read_restart_settings(FILE *fp)
...
@@ -348,13 +338,12 @@ void PairATM::read_restart_settings(FILE *fp)
Axilrod-Teller-Muto (dipole-dipole-dipole) potential
Axilrod-Teller-Muto (dipole-dipole-dipole) potential
------------------------------------------------------------------------- */
------------------------------------------------------------------------- */
void
PairATM
::
interaction_ddd
(
double
nu
,
void
PairATM
::
interaction_ddd
(
double
nu
,
double
r6
,
double
rij2
,
double
rik2
,
double
rjk2
,
double
rij2
,
double
rik2
,
double
rjk2
,
double
*
rij
,
double
*
rik
,
double
*
rjk
,
double
*
rij
,
double
*
rik
,
double
*
rjk
,
double
*
fj
,
double
*
fk
,
int
eflag
,
double
&
eng
)
double
*
fj
,
double
*
fk
,
int
eflag
,
double
&
eng
)
{
{
double
r6
,
r5inv
,
rri
,
rrj
,
rrk
,
rrr
;
double
r5inv
,
rri
,
rrj
,
rrk
,
rrr
;
r6
=
rij2
*
rik2
*
rjk2
;
r5inv
=
nu
/
(
r6
*
r6
*
sqrt
(
r6
));
r5inv
=
nu
/
(
r6
*
r6
*
sqrt
(
r6
));
rri
=
rik
[
0
]
*
rij
[
0
]
+
rik
[
1
]
*
rij
[
1
]
+
rik
[
2
]
*
rij
[
2
];
rri
=
rik
[
0
]
*
rij
[
0
]
+
rik
[
1
]
*
rij
[
1
]
+
rik
[
2
]
*
rij
[
2
];
rrj
=
rij
[
0
]
*
rjk
[
0
]
+
rij
[
1
]
*
rjk
[
1
]
+
rij
[
2
]
*
rjk
[
2
];
rrj
=
rij
[
0
]
*
rjk
[
0
]
+
rij
[
1
]
*
rjk
[
1
]
+
rij
[
2
]
*
rjk
[
2
];
...
...
src/MANYBODY/pair_atm.h
View file @
44bda245
...
@@ -39,12 +39,11 @@ class PairATM : public Pair {
...
@@ -39,12 +39,11 @@ class PairATM : public Pair {
void
read_restart_settings
(
FILE
*
);
void
read_restart_settings
(
FILE
*
);
protected:
protected:
// SJP: add 2nd cutoff
double
cut_global
,
cut_triple
;
double
cut_global
,
cut_triple
;
double
***
nu
;
double
***
nu
;
void
allocate
();
void
allocate
();
void
interaction_ddd
(
double
,
double
,
double
,
double
,
double
*
,
void
interaction_ddd
(
double
,
double
,
double
,
double
,
double
,
double
*
,
double
*
,
double
*
,
double
*
,
double
*
,
int
,
double
&
);
double
*
,
double
*
,
double
*
,
double
*
,
int
,
double
&
);
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment