git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10047 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2013-06-06 20:18:08 +00:00
parent 51814ba9bd
commit aa1ebc8444
3 changed files with 12 additions and 10 deletions

View File

@ -19,6 +19,7 @@
#include "stdlib.h"
#include "string.h"
#include "unistd.h"
#include "fix_ave_correlate.h"
#include "update.h"
#include "modify.h"
@ -484,6 +485,10 @@ void FixAveCorrelate::end_of_step()
fprintf(fp,"\n");
}
fflush(fp);
if (overwrite) {
long fileend = ftell(fp);
ftruncate(fileno(fp),fileend);
}
}
// zero accumulation if requested

View File

@ -160,7 +160,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
if (gjfflag) {
nvalues = 3;
grow_arrays(atom->nlocal);
grow_arrays(atom->nmax);
atom->add_callback(0);
// initialize franprev to zero
@ -884,9 +884,7 @@ double FixLangevin::memory_usage()
void FixLangevin::grow_arrays(int nmax)
{
if (!gjfflag) return;
memory->grow(franprev,nmax,3,"fix_langevin:franprev");
array = franprev;
}
/* ----------------------------------------------------------------------
@ -896,7 +894,7 @@ void FixLangevin::grow_arrays(int nmax)
void FixLangevin::copy_arrays(int i, int j, int delflag)
{
for (int m = 0; m < nvalues; m++)
array[j][m] = array[i][m];
franprev[j][m] = franprev[i][m];
}
/* ----------------------------------------------------------------------
@ -905,7 +903,7 @@ void FixLangevin::copy_arrays(int i, int j, int delflag)
int FixLangevin::pack_exchange(int i, double *buf)
{
for (int m = 0; m < nvalues; m++) buf[m] = array[i][m];
for (int m = 0; m < nvalues; m++) buf[m] = franprev[i][m];
return nvalues;
}
@ -915,7 +913,6 @@ int FixLangevin::pack_exchange(int i, double *buf)
int FixLangevin::unpack_exchange(int nlocal, double *buf)
{
for (int m = 0; m < nvalues; m++) array[nlocal][m] = buf[m];
for (int m = 0; m < nvalues; m++) franprev[nlocal][m] = buf[m];
return nvalues;
}

View File

@ -61,7 +61,7 @@ class FixLangevin : public Fix {
int maxatom1,maxatom2;
double **flangevin;
double *tforce;
double **franprev, **array;
double **franprev;
int nvalues;
char *id_temp;