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
1ea45016
Commit
1ea45016
authored
13 years ago
by
sjplimp
Browse files
Options
Downloads
Patches
Plain Diff
git-svn-id:
svn://svn.icms.temple.edu/lammps-ro/trunk@5847
f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent
161a6cb7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/neigh_list.cpp
+10
-8
10 additions, 8 deletions
src/neigh_list.cpp
src/neighbor.cpp
+15
-12
15 additions, 12 deletions
src/neighbor.cpp
src/neighbor.h
+1
-1
1 addition, 1 deletion
src/neighbor.h
with
26 additions
and
21 deletions
src/neigh_list.cpp
+
10
−
8
View file @
1ea45016
...
...
@@ -20,6 +20,12 @@
#include
"memory.h"
#include
"error.h"
#include
"update.h"
using
namespace
LAMMPS_NS
;
#define PGDELTA 1
...
...
@@ -105,18 +111,14 @@ NeighList::~NeighList()
/* ----------------------------------------------------------------------
grow atom arrays to allow for nmax atoms
triggered by more atoms on a processor
caller knows if this list stores neighs of local atoms or local+ghost
------------------------------------------------------------------------- */
void
NeighList
::
grow
(
int
nmax
)
{
// skip if grow not needed by this list
// each list stores own maxatoms, b/c list->grow() called at different times
// if list does not store neighbors of ghosts, compare nmax to maxatoms
// else compare nlocal+nghost to maxatoms
// if reset list size, set it to nmax
if
(
!
ghostflag
&&
atom
->
nlocal
<=
maxatoms
)
return
;
if
(
ghostflag
&&
atom
->
nlocal
+
atom
->
nghost
<=
maxatoms
)
return
;
// skip if this list is already long enough to store nmax atoms
if
(
nmax
<=
maxatoms
)
return
;
maxatoms
=
nmax
;
memory
->
destroy
(
ilist
);
...
...
This diff is collapsed.
Click to expand it.
src/neighbor.cpp
+
15
−
12
View file @
1ea45016
...
...
@@ -106,7 +106,7 @@ Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp)
// pair lists
max
local
=
0
;
max
atom
=
0
;
nblist
=
nglist
=
nslist
=
0
;
nlist
=
0
;
...
...
@@ -590,10 +590,10 @@ void Neighbor::init()
// allocate atom arrays and 1st pages of lists that store them
max
local
=
atom
->
nmax
;
max
atom
=
atom
->
nmax
;
for
(
i
=
0
;
i
<
nlist
;
i
++
)
if
(
lists
[
i
]
->
growflag
)
{
lists
[
i
]
->
grow
(
max
local
);
lists
[
i
]
->
grow
(
max
atom
);
lists
[
i
]
->
add_pages
();
}
...
...
@@ -1151,13 +1151,16 @@ void Neighbor::build()
}
// if any lists store neighbors of ghosts:
// invoke grow() on all in case nlocal+nghost is now too big
// else only invoke grow() if nlocal has exceeded previous list size
// only for lists with growflag set and which are perpetual
if
(
anyghostlist
||
atom
->
nlocal
>
maxlocal
)
{
maxlocal
=
atom
->
nmax
;
for
(
i
=
0
;
i
<
nglist
;
i
++
)
lists
[
glist
[
i
]]
->
grow
(
maxlocal
);
// invoke grow() if nlocal+nghost exceeds previous list size
// else only invoke grow() if nlocal exceeds previous list size
// only done for lists with growflag set and which are perpetual
if
(
anyghostlist
&&
atom
->
nlocal
+
atom
->
nghost
>
maxatom
)
{
maxatom
=
atom
->
nmax
;
for
(
i
=
0
;
i
<
nglist
;
i
++
)
lists
[
glist
[
i
]]
->
grow
(
maxatom
);
}
else
if
(
atom
->
nlocal
>
maxatom
)
{
maxatom
=
atom
->
nmax
;
for
(
i
=
0
;
i
<
nglist
;
i
++
)
lists
[
glist
[
i
]]
->
grow
(
maxatom
);
}
// extend atom bin list if necessary
...
...
@@ -1199,14 +1202,14 @@ void Neighbor::build_one(int i)
{
// update stencils and grow atom arrays and bins as needed
// only for relevant settings of stencilflag and growflag
//
do not reset maxlocal to atom->nmax, since not all lists are being grown
//
grow atom array for this list to current size of perpetual lists
if
(
lists
[
i
]
->
stencilflag
)
{
lists
[
i
]
->
stencil_allocate
(
smax
,
style
);
(
this
->*
stencil_create
[
i
])(
lists
[
i
],
sx
,
sy
,
sz
);
}
if
(
lists
[
i
]
->
growflag
)
lists
[
i
]
->
grow
(
max
local
);
if
(
lists
[
i
]
->
growflag
)
lists
[
i
]
->
grow
(
max
atom
);
if
(
style
!=
NSQ
&&
atom
->
nmax
>
maxbin
)
{
maxbin
=
atom
->
nmax
;
...
...
This diff is collapsed.
Click to expand it.
src/neighbor.h
+
1
−
1
View file @
1ea45016
...
...
@@ -76,7 +76,7 @@ class Neighbor : protected Pointers {
private:
int
me
,
nprocs
;
int
max
local
;
// size of atom-based NeighList arrays
int
max
atom
;
// size of atom-based NeighList arrays
int
maxbond
,
maxangle
,
maxdihedral
,
maximproper
;
// size of bond lists
int
maxwt
;
// max weighting factor applied + 1
...
...
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