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
999b5404
Commit
999b5404
authored
13 years ago
by
sjplimp
Browse files
Options
Downloads
Patches
Plain Diff
git-svn-id:
svn://svn.icms.temple.edu/lammps-ro/trunk@5861
f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent
72fbf1b5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/fix_langevin.cpp
+10
-10
10 additions, 10 deletions
src/fix_langevin.cpp
src/fix_langevin.h
+1
-1
1 addition, 1 deletion
src/fix_langevin.h
with
11 additions
and
11 deletions
src/fix_langevin.cpp
+
10
−
10
View file @
999b5404
...
...
@@ -72,7 +72,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
for
(
int
i
=
1
;
i
<=
atom
->
ntypes
;
i
++
)
ratio
[
i
]
=
1.0
;
tally
=
0
;
zero
sum
=
0
;
zero
flag
=
1
;
int
iarg
=
7
;
while
(
iarg
<
narg
)
{
...
...
@@ -90,10 +90,10 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
else
if
(
strcmp
(
arg
[
iarg
+
1
],
"yes"
)
==
0
)
tally
=
1
;
else
error
->
all
(
"Illegal fix langevin command"
);
iarg
+=
2
;
}
else
if
(
strcmp
(
arg
[
iarg
],
"zero
sum
"
)
==
0
)
{
}
else
if
(
strcmp
(
arg
[
iarg
],
"zero"
)
==
0
)
{
if
(
iarg
+
2
>
narg
)
error
->
all
(
"Illegal fix langevin command"
);
if
(
strcmp
(
arg
[
iarg
+
1
],
"no"
)
==
0
)
zero
sum
=
0
;
else
if
(
strcmp
(
arg
[
iarg
+
1
],
"yes"
)
==
0
)
zero
sum
=
1
;
if
(
strcmp
(
arg
[
iarg
+
1
],
"no"
)
==
0
)
zero
flag
=
0
;
else
if
(
strcmp
(
arg
[
iarg
+
1
],
"yes"
)
==
0
)
zero
flag
=
1
;
else
error
->
all
(
"Illegal fix langevin command"
);
iarg
+=
2
;
}
else
error
->
all
(
"Illegal fix langevin command"
);
...
...
@@ -212,15 +212,15 @@ void FixLangevin::post_force_no_tally()
// computed on current nlocal atoms to remove bias
// test v = 0 since some computes mask non-participating atoms via v = 0
// and added force has extra term not multiplied by v = 0
// for ZERO
SUM
:
//
S
um random force over all atoms in group
//
S
ubtract sum/count from each atom in group
// for ZERO
FLAG
:
//
s
um random force over all atoms in group
//
s
ubtract sum/count from each atom in group
double
fran
[
3
],
fsum
[
3
],
fsumall
[
3
];
fsum
[
0
]
=
fsum
[
1
]
=
fsum
[
2
]
=
0.0
;
bigint
count
;
if
(
zero
sum
)
{
if
(
zero
flag
)
{
count
=
group
->
count
(
igroup
);
if
(
count
==
0
)
error
->
all
(
"Cannot zero Langevin force of 0 atoms"
);
...
...
@@ -323,9 +323,9 @@ void FixLangevin::post_force_no_tally()
}
}
//
S
et total force to zero
//
s
et total force to zero
if
(
zero
sum
)
{
if
(
zero
flag
)
{
MPI_Allreduce
(
fsum
,
fsumall
,
3
,
MPI_DOUBLE
,
MPI_SUM
,
world
);
fsumall
[
0
]
/=
count
;
fsumall
[
1
]
/=
count
;
...
...
This diff is collapsed.
Click to expand it.
src/fix_langevin.h
+
1
−
1
View file @
999b5404
...
...
@@ -41,7 +41,7 @@ class FixLangevin : public Fix {
double
memory_usage
();
protected:
int
which
,
tally
,
zero
sum
;
int
which
,
tally
,
zero
flag
;
double
t_start
,
t_stop
,
t_period
;
double
*
gfactor1
,
*
gfactor2
,
*
ratio
;
double
energy
,
energy_onestep
;
...
...
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