Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lammps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
multiscale
lammps
Commits
9ef1bfe8
Commit
9ef1bfe8
authored
6 years ago
by
Axel Kohlmeyer
Browse files
Options
Downloads
Patches
Plain Diff
whitespace cleanup
parent
76b85e4d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/USER-MISC/compute_pentropy_atom.cpp
+13
-13
13 additions, 13 deletions
src/USER-MISC/compute_pentropy_atom.cpp
with
13 additions
and
13 deletions
src/USER-MISC/compute_pentropy_atom.cpp
+
13
−
13
View file @
9ef1bfe8
...
@@ -50,10 +50,10 @@ ComputePairEntropyAtom(LAMMPS *lmp, int narg, char **arg) :
...
@@ -50,10 +50,10 @@ ComputePairEntropyAtom(LAMMPS *lmp, int narg, char **arg) :
" of arguments"
);
" of arguments"
);
// Arguments are: sigma cutoff avg yes/no cutoff2 local yes/no
// Arguments are: sigma cutoff avg yes/no cutoff2 local yes/no
// sigma is the gaussian width
// sigma is the gaussian width
// cutoff is the cutoff for the calculation of g(r)
// cutoff is the cutoff for the calculation of g(r)
// avg is optional and allows averaging the pair entropy over neighbors
// avg is optional and allows averaging the pair entropy over neighbors
// the next argument should be yes or no
// the next argument should be yes or no
// cutoff2 is the cutoff for the averaging
// cutoff2 is the cutoff for the averaging
// local is optional and allows using the local density to normalize
// local is optional and allows using the local density to normalize
// the g(r)
// the g(r)
...
@@ -102,8 +102,8 @@ ComputePairEntropyAtom(LAMMPS *lmp, int narg, char **arg) :
...
@@ -102,8 +102,8 @@ ComputePairEntropyAtom(LAMMPS *lmp, int narg, char **arg) :
// Number of bins above and below the central one that will be
// Number of bins above and below the central one that will be
// considered as affected by the gaussian kernel
// considered as affected by the gaussian kernel
// 2 seems a good compromise between speed and good mollification
// 2 seems a good compromise between speed and good mollification
deltabin
=
2
;
deltabin
=
2
;
deltar
=
sigma
;
deltar
=
sigma
;
peratom_flag
=
1
;
peratom_flag
=
1
;
size_peratom_cols
=
0
;
size_peratom_cols
=
0
;
}
}
...
@@ -124,9 +124,9 @@ void ComputePairEntropyAtom::init()
...
@@ -124,9 +124,9 @@ void ComputePairEntropyAtom::init()
error
->
all
(
FLERR
,
"Compute centro/atom requires a pair style be"
error
->
all
(
FLERR
,
"Compute centro/atom requires a pair style be"
" defined"
);
" defined"
);
if
(
(
cutoff
+
cutoff2
)
>
(
force
->
pair
->
cutforce
+
neighbor
->
skin
)
)
if
(
(
cutoff
+
cutoff2
)
>
(
force
->
pair
->
cutforce
+
neighbor
->
skin
)
)
{
{
error
->
all
(
FLERR
,
"Compute pentropy/atom cutoff is longer than the"
error
->
all
(
FLERR
,
"Compute pentropy/atom cutoff is longer than the"
" pairwise cutoff. Increase the neighbor list skin"
" pairwise cutoff. Increase the neighbor list skin"
" distance."
);
" distance."
);
}
}
...
@@ -220,16 +220,16 @@ void ComputePairEntropyAtom::compute_peratom()
...
@@ -220,16 +220,16 @@ void ComputePairEntropyAtom::compute_peratom()
// If local density is used, calculate it
// If local density is used, calculate it
if
(
local_flag
)
{
if
(
local_flag
)
{
double
neigh_cutoff
=
force
->
pair
->
cutforce
+
neighbor
->
skin
;
double
neigh_cutoff
=
force
->
pair
->
cutforce
+
neighbor
->
skin
;
double
volume
=
double
volume
=
(
4.
/
3.
)
*
MY_PI
*
neigh_cutoff
*
neigh_cutoff
*
neigh_cutoff
;
(
4.
/
3.
)
*
MY_PI
*
neigh_cutoff
*
neigh_cutoff
*
neigh_cutoff
;
density
=
jnum
/
volume
;
density
=
jnum
/
volume
;
}
}
// calculate kernel normalization
// calculate kernel normalization
// Normalization of g(r)
// Normalization of g(r)
double
normConstantBase
=
4
*
MY_PI
*
density
;
double
normConstantBase
=
4
*
MY_PI
*
density
;
// Normalization of gaussian
// Normalization of gaussian
normConstantBase
*=
sqrt
(
2.
*
MY_PI
)
*
sigma
;
normConstantBase
*=
sqrt
(
2.
*
MY_PI
)
*
sigma
;
double
invNormConstantBase
=
1.
/
normConstantBase
;
double
invNormConstantBase
=
1.
/
normConstantBase
;
// loop over list of all neighbors within force cutoff
// loop over list of all neighbors within force cutoff
...
@@ -259,7 +259,7 @@ void ComputePairEntropyAtom::compute_peratom()
...
@@ -259,7 +259,7 @@ void ComputePairEntropyAtom::compute_peratom()
for
(
int
k
=
minbin
;
k
<
maxbin
+
1
;
k
++
)
{
for
(
int
k
=
minbin
;
k
<
maxbin
+
1
;
k
++
)
{
double
invNormKernel
=
invNormConstantBase
/
rbinsq
[
k
];
double
invNormKernel
=
invNormConstantBase
/
rbinsq
[
k
];
double
distance
=
r
-
rbin
[
k
];
double
distance
=
r
-
rbin
[
k
];
gofr
[
k
]
+=
invNormKernel
*
exp
(
-
distance
*
distance
/
sigmasq2
);
gofr
[
k
]
+=
invNormKernel
*
exp
(
-
distance
*
distance
/
sigmasq2
);
}
}
}
}
}
}
...
@@ -298,7 +298,7 @@ void ComputePairEntropyAtom::compute_peratom()
...
@@ -298,7 +298,7 @@ void ComputePairEntropyAtom::compute_peratom()
ztmp
=
x
[
i
][
2
];
ztmp
=
x
[
i
][
2
];
jlist
=
firstneigh
[
i
];
jlist
=
firstneigh
[
i
];
jnum
=
numneigh
[
i
];
jnum
=
numneigh
[
i
];
pair_entropy_avg
[
i
]
=
pair_entropy
[
i
];
pair_entropy_avg
[
i
]
=
pair_entropy
[
i
];
double
counter
=
1
;
double
counter
=
1
;
...
@@ -306,7 +306,7 @@ void ComputePairEntropyAtom::compute_peratom()
...
@@ -306,7 +306,7 @@ void ComputePairEntropyAtom::compute_peratom()
for
(
jj
=
0
;
jj
<
jnum
;
jj
++
)
{
for
(
jj
=
0
;
jj
<
jnum
;
jj
++
)
{
j
=
jlist
[
jj
];
j
=
jlist
[
jj
];
j
&=
NEIGHMASK
;
j
&=
NEIGHMASK
;
delx
=
xtmp
-
x
[
j
][
0
];
delx
=
xtmp
-
x
[
j
][
0
];
dely
=
ytmp
-
x
[
j
][
1
];
dely
=
ytmp
-
x
[
j
][
1
];
delz
=
ztmp
-
x
[
j
][
2
];
delz
=
ztmp
-
x
[
j
][
2
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment