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
c5ce3ffe
Commit
c5ce3ffe
authored
7 years ago
by
Axel Kohlmeyer
Browse files
Options
Downloads
Patches
Plain Diff
use list of bonds per atom instead of bondlist, as that will work with shake as well
parent
6f66e6c4
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/compute_fragment_atom.cpp
+10
-19
10 additions, 19 deletions
src/compute_fragment_atom.cpp
with
10 additions
and
19 deletions
src/compute_fragment_atom.cpp
+
10
−
19
View file @
c5ce3ffe
...
@@ -90,9 +90,6 @@ void ComputeFragmentAtom::compute_peratom()
...
@@ -90,9 +90,6 @@ void ComputeFragmentAtom::compute_peratom()
vector_atom
=
fragmentID
;
vector_atom
=
fragmentID
;
}
}
int
nbondlist
=
neighbor
->
nbondlist
;
int
**
bondlist
=
neighbor
->
bondlist
;
// if group is dynamic, insure ghost atom masks are current
// if group is dynamic, insure ghost atom masks are current
if
(
group
->
dynamic
[
igroup
])
{
if
(
group
->
dynamic
[
igroup
])
{
...
@@ -100,21 +97,17 @@ void ComputeFragmentAtom::compute_peratom()
...
@@ -100,21 +97,17 @@ void ComputeFragmentAtom::compute_peratom()
comm
->
forward_comm_compute
(
this
);
comm
->
forward_comm_compute
(
this
);
}
}
// every bond starts in its own fragment,
// each atom starts in its own fragment,
// with fragmentID = MIN(b1atomID,b2atomID)
// only bonds wholly contained in the group are considered
int
nlocal
=
atom
->
nlocal
;
tagint
*
tag
=
atom
->
tag
;
tagint
*
tag
=
atom
->
tag
;
int
*
mask
=
atom
->
mask
;
int
*
mask
=
atom
->
mask
;
int
*
num_bond
=
atom
->
num_bond
;
tagint
**
bond_atom
=
atom
->
bond_atom
;
for
(
i
=
0
;
i
<
nbondlist
;
i
++
)
{
for
(
i
=
0
;
i
<
nlocal
+
atom
->
nghost
;
i
++
)
const
int
b1
=
bondlist
[
i
][
0
];
if
(
mask
[
i
]
&
groupbit
)
fragmentID
[
i
]
=
tag
[
i
];
const
int
b2
=
bondlist
[
i
][
1
];
else
fragmentID
[
i
]
=
0
;
if
((
mask
[
b1
]
&
groupbit
)
&&
(
mask
[
b2
]
&
groupbit
))
fragmentID
[
b1
]
=
fragmentID
[
b2
]
=
MIN
(
tag
[
b1
],
tag
[
b2
]);
else
fragmentID
[
b1
]
=
fragmentID
[
b2
]
=
0
;
}
// loop until no more changes on any proc:
// loop until no more changes on any proc:
// acquire fragmentIDs of ghost atoms
// acquire fragmentIDs of ghost atoms
...
@@ -124,9 +117,6 @@ void ComputeFragmentAtom::compute_peratom()
...
@@ -124,9 +117,6 @@ void ComputeFragmentAtom::compute_peratom()
// then check if any proc made changes
// then check if any proc made changes
commflag
=
1
;
commflag
=
1
;
int
nlocal
=
atom
->
nlocal
;
int
*
num_bond
=
atom
->
num_bond
;
tagint
**
bond_atom
=
atom
->
bond_atom
;
int
change
,
done
,
anychange
;
int
change
,
done
,
anychange
;
...
@@ -138,9 +128,10 @@ void ComputeFragmentAtom::compute_peratom()
...
@@ -138,9 +128,10 @@ void ComputeFragmentAtom::compute_peratom()
done
=
1
;
done
=
1
;
for
(
i
=
0
;
i
<
nlocal
;
i
++
)
{
for
(
i
=
0
;
i
<
nlocal
;
i
++
)
{
if
(
!
(
mask
[
i
]
&
groupbit
))
continue
;
if
(
!
(
mask
[
i
]
&
groupbit
))
continue
;
for
(
j
=
0
;
j
<
num_bond
[
i
];
j
++
)
{
for
(
j
=
0
;
j
<
num_bond
[
i
];
j
++
)
{
k
=
bond_atom
[
i
][
j
];
k
=
atom
->
map
(
bond_atom
[
i
][
j
]);
if
(
k
<
0
)
continue
;
if
(
!
(
mask
[
k
]
&
groupbit
))
continue
;
if
(
!
(
mask
[
k
]
&
groupbit
))
continue
;
if
(
fragmentID
[
i
]
==
fragmentID
[
k
])
continue
;
if
(
fragmentID
[
i
]
==
fragmentID
[
k
])
continue
;
...
...
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