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
2a30b762
Commit
2a30b762
authored
8 years ago
by
sjplimp
Browse files
Options
Downloads
Patches
Plain Diff
git-svn-id:
svn://svn.icms.temple.edu/lammps-ro/trunk@15633
f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent
31e41707
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_store.cpp
+16
-0
16 additions, 0 deletions
src/fix_store.cpp
src/fix_store.h
+1
-0
1 addition, 0 deletions
src/fix_store.h
with
17 additions
and
0 deletions
src/fix_store.cpp
+
16
−
0
View file @
2a30b762
...
@@ -40,6 +40,7 @@ vstore(NULL), astore(NULL), rbuf(NULL)
...
@@ -40,6 +40,7 @@ vstore(NULL), astore(NULL), rbuf(NULL)
// 0/1 flag = not-store or store peratom values in restart file
// 0/1 flag = not-store or store peratom values in restart file
// nvalues = # of peratom values, N = 1 is vector, N > 1 is array
// nvalues = # of peratom values, N = 1 is vector, N > 1 is array
disable
=
0
;
nvalues
=
vecflag
=
0
;
nvalues
=
vecflag
=
0
;
flavor
=
UNKNOWN
;
flavor
=
UNKNOWN
;
...
@@ -230,6 +231,8 @@ void FixStore::grow_arrays(int nmax)
...
@@ -230,6 +231,8 @@ void FixStore::grow_arrays(int nmax)
void
FixStore
::
copy_arrays
(
int
i
,
int
j
,
int
delflag
)
void
FixStore
::
copy_arrays
(
int
i
,
int
j
,
int
delflag
)
{
{
if
(
disable
)
return
;
if
(
vecflag
)
vstore
[
j
]
=
vstore
[
i
];
if
(
vecflag
)
vstore
[
j
]
=
vstore
[
i
];
else
else
for
(
int
m
=
0
;
m
<
nvalues
;
m
++
)
for
(
int
m
=
0
;
m
<
nvalues
;
m
++
)
...
@@ -242,6 +245,8 @@ void FixStore::copy_arrays(int i, int j, int delflag)
...
@@ -242,6 +245,8 @@ void FixStore::copy_arrays(int i, int j, int delflag)
int
FixStore
::
pack_exchange
(
int
i
,
double
*
buf
)
int
FixStore
::
pack_exchange
(
int
i
,
double
*
buf
)
{
{
if
(
disable
)
return
0
;
if
(
vecflag
)
buf
[
0
]
=
vstore
[
i
];
if
(
vecflag
)
buf
[
0
]
=
vstore
[
i
];
else
else
for
(
int
m
=
0
;
m
<
nvalues
;
m
++
)
for
(
int
m
=
0
;
m
<
nvalues
;
m
++
)
...
@@ -255,6 +260,8 @@ int FixStore::pack_exchange(int i, double *buf)
...
@@ -255,6 +260,8 @@ int FixStore::pack_exchange(int i, double *buf)
int
FixStore
::
unpack_exchange
(
int
nlocal
,
double
*
buf
)
int
FixStore
::
unpack_exchange
(
int
nlocal
,
double
*
buf
)
{
{
if
(
disable
)
return
0
;
if
(
vecflag
)
vstore
[
nlocal
]
=
buf
[
0
];
if
(
vecflag
)
vstore
[
nlocal
]
=
buf
[
0
];
else
else
for
(
int
m
=
0
;
m
<
nvalues
;
m
++
)
for
(
int
m
=
0
;
m
<
nvalues
;
m
++
)
...
@@ -268,6 +275,11 @@ int FixStore::unpack_exchange(int nlocal, double *buf)
...
@@ -268,6 +275,11 @@ int FixStore::unpack_exchange(int nlocal, double *buf)
int
FixStore
::
pack_restart
(
int
i
,
double
*
buf
)
int
FixStore
::
pack_restart
(
int
i
,
double
*
buf
)
{
{
if
(
disable
)
{
buf
[
0
]
=
0
;
return
1
;
}
buf
[
0
]
=
nvalues
+
1
;
buf
[
0
]
=
nvalues
+
1
;
if
(
vecflag
)
buf
[
1
]
=
vstore
[
i
];
if
(
vecflag
)
buf
[
1
]
=
vstore
[
i
];
else
else
...
@@ -282,6 +294,8 @@ int FixStore::pack_restart(int i, double *buf)
...
@@ -282,6 +294,8 @@ int FixStore::pack_restart(int i, double *buf)
void
FixStore
::
unpack_restart
(
int
nlocal
,
int
nth
)
void
FixStore
::
unpack_restart
(
int
nlocal
,
int
nth
)
{
{
if
(
disable
)
return
;
double
**
extra
=
atom
->
extra
;
double
**
extra
=
atom
->
extra
;
// skip to Nth set of extra values
// skip to Nth set of extra values
...
@@ -302,6 +316,7 @@ void FixStore::unpack_restart(int nlocal, int nth)
...
@@ -302,6 +316,7 @@ void FixStore::unpack_restart(int nlocal, int nth)
int
FixStore
::
maxsize_restart
()
int
FixStore
::
maxsize_restart
()
{
{
if
(
disable
)
return
1
;
return
nvalues
+
1
;
return
nvalues
+
1
;
}
}
...
@@ -311,6 +326,7 @@ int FixStore::maxsize_restart()
...
@@ -311,6 +326,7 @@ int FixStore::maxsize_restart()
int
FixStore
::
size_restart
(
int
nlocal
)
int
FixStore
::
size_restart
(
int
nlocal
)
{
{
if
(
disable
)
return
1
;
return
nvalues
+
1
;
return
nvalues
+
1
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/fix_store.h
+
1
−
0
View file @
2a30b762
...
@@ -31,6 +31,7 @@ class FixStore : public Fix {
...
@@ -31,6 +31,7 @@ class FixStore : public Fix {
int
nvalues
;
// number of per-atom values
int
nvalues
;
// number of per-atom values
double
*
vstore
;
// vector storage for GLOBAL or PERATOM
double
*
vstore
;
// vector storage for GLOBAL or PERATOM
double
**
astore
;
// array storage for GLOBAL or PERATOM
double
**
astore
;
// array storage for GLOBAL or PERATOM
int
disable
;
// 1 if operations (except grow) are currently disabled
FixStore
(
class
LAMMPS
*
,
int
,
char
**
);
FixStore
(
class
LAMMPS
*
,
int
,
char
**
);
~
FixStore
();
~
FixStore
();
...
...
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