git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13102 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -112,6 +112,7 @@ void ComputeCOMChunk::compute_array()
|
||||
int *ichunk = cchunk->ichunk;
|
||||
|
||||
if (nchunk > maxchunk) allocate();
|
||||
size_array_rows = nchunk;
|
||||
|
||||
// zero local per-chunk values
|
||||
|
||||
@ -222,7 +223,7 @@ void ComputeCOMChunk::allocate()
|
||||
memory->destroy(masstotal);
|
||||
memory->destroy(com);
|
||||
memory->destroy(comall);
|
||||
size_array_rows = maxchunk = nchunk;
|
||||
maxchunk = nchunk;
|
||||
memory->create(massproc,maxchunk,"com/chunk:massproc");
|
||||
memory->create(masstotal,maxchunk,"com/chunk:masstotal");
|
||||
memory->create(com,maxchunk,3,"com/chunk:com");
|
||||
|
||||
@ -216,6 +216,8 @@ void ComputeGyrationChunk::com_chunk()
|
||||
int *ichunk = cchunk->ichunk;
|
||||
|
||||
if (nchunk > maxchunk) allocate();
|
||||
if (tensor) size_array_rows = nchunk;
|
||||
else size_vector = nchunk;
|
||||
|
||||
// zero local per-chunk values
|
||||
|
||||
@ -327,7 +329,7 @@ void ComputeGyrationChunk::allocate()
|
||||
memory->destroy(rgall);
|
||||
memory->destroy(rgt);
|
||||
memory->destroy(rgtall);
|
||||
size_array_rows = maxchunk = nchunk;
|
||||
maxchunk = nchunk;
|
||||
memory->create(massproc,maxchunk,"gyration/chunk:massproc");
|
||||
memory->create(masstotal,maxchunk,"gyration/chunk:masstotal");
|
||||
memory->create(com,maxchunk,3,"gyration/chunk:com");
|
||||
|
||||
@ -99,6 +99,7 @@ void ComputeInertiaChunk::compute_array()
|
||||
int *ichunk = cchunk->ichunk;
|
||||
|
||||
if (nchunk > maxchunk) allocate();
|
||||
size_array_rows = nchunk;
|
||||
|
||||
// zero local per-chunk values
|
||||
|
||||
@ -233,7 +234,7 @@ void ComputeInertiaChunk::allocate()
|
||||
memory->destroy(comall);
|
||||
memory->destroy(inertia);
|
||||
memory->destroy(inertiaall);
|
||||
size_array_rows = maxchunk = nchunk;
|
||||
maxchunk = nchunk;
|
||||
memory->create(massproc,maxchunk,"inertia/chunk:massproc");
|
||||
memory->create(masstotal,maxchunk,"inertia/chunk:masstotal");
|
||||
memory->create(com,maxchunk,3,"inertia/chunk:com");
|
||||
|
||||
@ -115,8 +115,10 @@ void ComputeMSDChunk::compute_array()
|
||||
// first time call, allocate per-chunk arrays
|
||||
// thereafter, require nchunk remain the same
|
||||
|
||||
if (firstflag) allocate(n);
|
||||
else if (n != nchunk)
|
||||
if (firstflag) {
|
||||
nchunk = n;
|
||||
allocate();
|
||||
} else if (n != nchunk)
|
||||
error->all(FLERR,"Compute msd/chunk nchunk is not static");
|
||||
|
||||
// zero local per-chunk values
|
||||
@ -236,9 +238,8 @@ void ComputeMSDChunk::unlock(Fix *fixptr)
|
||||
one-time allocate of per-chunk arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeMSDChunk::allocate(int n)
|
||||
void ComputeMSDChunk::allocate()
|
||||
{
|
||||
size_array_rows = nchunk = n;
|
||||
memory->create(massproc,nchunk,"msd/chunk:massproc");
|
||||
memory->create(masstotal,nchunk,"msd/chunk:masstotal");
|
||||
memory->create(com,nchunk,3,"msd/chunk:com");
|
||||
|
||||
@ -51,7 +51,7 @@ class ComputeMSDChunk : public Compute {
|
||||
|
||||
int firstflag;
|
||||
|
||||
void allocate(int);
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -134,6 +134,8 @@ void ComputePropertyChunk::compute_vector()
|
||||
|
||||
nchunk = cchunk->setup_chunks();
|
||||
if (nchunk > maxchunk) allocate();
|
||||
if (nvalues == 1) size_vector = nchunk;
|
||||
else size_array_rows = nchunk;
|
||||
|
||||
if (countflag) {
|
||||
cchunk->compute_ichunk();
|
||||
@ -158,6 +160,8 @@ void ComputePropertyChunk::compute_array()
|
||||
|
||||
nchunk = cchunk->setup_chunks();
|
||||
if (nchunk > maxchunk) allocate();
|
||||
if (nvalues == 1) size_vector = nchunk;
|
||||
else size_array_rows = nchunk;
|
||||
|
||||
if (countflag) {
|
||||
cchunk->compute_ichunk();
|
||||
@ -237,12 +241,9 @@ void ComputePropertyChunk::allocate()
|
||||
memory->destroy(array);
|
||||
memory->destroy(count_one);
|
||||
memory->destroy(count_all);
|
||||
|
||||
if (nvalues == 1) size_vector = maxchunk = nchunk;
|
||||
else size_array_rows = maxchunk = nchunk;
|
||||
maxchunk = nchunk;
|
||||
if (nvalues == 1) memory->create(vector,maxchunk,"property/chunk:vector");
|
||||
else memory->create(array,maxchunk,nvalues,"property/chunk:array");
|
||||
|
||||
if (countflag) {
|
||||
memory->create(count_one,maxchunk,"property/chunk:count_one");
|
||||
memory->create(count_all,maxchunk,"property/chunk:count_all");
|
||||
|
||||
@ -32,7 +32,7 @@ ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (narg < 4) error->all(FLERR,"Illegal compute temp/chunk command");
|
||||
|
||||
vector_flag = 1;
|
||||
size_vector = 1;
|
||||
size_vector = 0;
|
||||
size_vector_variable = 1;
|
||||
extvector = 0;
|
||||
|
||||
@ -163,6 +163,7 @@ void ComputeTempChunk::compute_vector()
|
||||
int *ichunk = cchunk->ichunk;
|
||||
|
||||
if (nchunk > maxchunk) allocate();
|
||||
size_vector = nchunk;
|
||||
|
||||
// calculate COM velocity for each chunk
|
||||
|
||||
@ -372,7 +373,7 @@ void ComputeTempChunk::allocate()
|
||||
memory->destroy(keall);
|
||||
memory->destroy(count);
|
||||
memory->destroy(countall);
|
||||
size_vector = maxchunk = nchunk;
|
||||
maxchunk = nchunk;
|
||||
memory->create(ke,maxchunk,"temp/chunk:ke");
|
||||
memory->create(keall,maxchunk,"temp/chunk:keall");
|
||||
memory->create(count,maxchunk,"temp/chunk:count");
|
||||
|
||||
@ -99,6 +99,7 @@ void ComputeTorqueChunk::compute_array()
|
||||
int *ichunk = cchunk->ichunk;
|
||||
|
||||
if (nchunk > maxchunk) allocate();
|
||||
size_array_rows = nchunk;
|
||||
|
||||
// zero local per-chunk values
|
||||
|
||||
@ -229,7 +230,7 @@ void ComputeTorqueChunk::allocate()
|
||||
memory->destroy(comall);
|
||||
memory->destroy(torque);
|
||||
memory->destroy(torqueall);
|
||||
size_array_rows = maxchunk = nchunk;
|
||||
maxchunk = nchunk;
|
||||
memory->create(massproc,maxchunk,"torque/chunk:massproc");
|
||||
memory->create(masstotal,maxchunk,"torque/chunk:masstotal");
|
||||
memory->create(com,maxchunk,3,"torque/chunk:com");
|
||||
|
||||
@ -111,6 +111,7 @@ void ComputeVCMChunk::compute_array()
|
||||
int *ichunk = cchunk->ichunk;
|
||||
|
||||
if (nchunk > maxchunk) allocate();
|
||||
size_array_rows = nchunk;
|
||||
|
||||
// zero local per-chunk values
|
||||
|
||||
@ -217,7 +218,7 @@ void ComputeVCMChunk::allocate()
|
||||
memory->destroy(masstotal);
|
||||
memory->destroy(vcm);
|
||||
memory->destroy(vcmall);
|
||||
size_array_rows = maxchunk = nchunk;
|
||||
maxchunk = nchunk;
|
||||
memory->create(massproc,maxchunk,"vcm/chunk:massproc");
|
||||
memory->create(masstotal,maxchunk,"vcm/chunk:masstotal");
|
||||
memory->create(vcm,maxchunk,3,"vcm/chunk:vcm");
|
||||
|
||||
Reference in New Issue
Block a user