forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7189 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
f4aa73f5d5
commit
fdba4b962b
|
@ -45,6 +45,7 @@ using namespace MathConst;
|
|||
PairAIREBO::PairAIREBO(LAMMPS *lmp) : Pair(lmp)
|
||||
{
|
||||
single_enable = 0;
|
||||
restartinfo = 0;
|
||||
one_coeff = 1;
|
||||
ghostneigh = 1;
|
||||
|
||||
|
@ -4237,52 +4238,6 @@ void PairAIREBO::spline_init()
|
|||
for (i = 2; i < 10; i++) Tf[2][2][i] = -0.0040480;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairAIREBO::write_restart(FILE *fp)
|
||||
{
|
||||
write_restart_settings(fp);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 reads from restart file, bcasts
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairAIREBO::read_restart(FILE *fp)
|
||||
{
|
||||
read_restart_settings(fp);
|
||||
allocate();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairAIREBO::write_restart_settings(FILE *fp)
|
||||
{
|
||||
fwrite(&cutlj,sizeof(double),1,fp);
|
||||
fwrite(&ljflag,sizeof(int),1,fp);
|
||||
fwrite(&torflag,sizeof(int),1,fp);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 reads from restart file, bcasts
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairAIREBO::read_restart_settings(FILE *fp)
|
||||
{
|
||||
if (comm->me == 0) {
|
||||
fread(&cutlj,sizeof(double),1,fp);
|
||||
fread(&ljflag,sizeof(int),1,fp);
|
||||
fread(&torflag,sizeof(int),1,fp);
|
||||
}
|
||||
MPI_Bcast(&cutlj,1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&ljflag,1,MPI_INT,0,world);
|
||||
MPI_Bcast(&torflag,1,MPI_INT,0,world);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
memory usage of local atom-based arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
|
|
@ -33,10 +33,6 @@ class PairAIREBO : public Pair {
|
|||
void coeff(int, char **);
|
||||
void init_style();
|
||||
double init_one(int, int);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
double memory_usage();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -166,7 +166,6 @@ Pair *Force::new_pair(const char *style, const char *suffix, int &sflag)
|
|||
#undef PAIR_CLASS
|
||||
|
||||
else error->all(FLERR,"Invalid pair style");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp)
|
|||
comm_forward = comm_reverse = 0;
|
||||
|
||||
single_enable = 1;
|
||||
restartinfo = 1;
|
||||
respa_enable = 0;
|
||||
one_coeff = 0;
|
||||
no_virial_fdotr_compute = 0;
|
||||
|
|
|
@ -39,6 +39,7 @@ class Pair : protected Pointers {
|
|||
int comm_reverse; // size of reverse communication (0 if none)
|
||||
|
||||
int single_enable; // 1 if single() routine exists
|
||||
int restartinfo; // 1 if pair style writes restart info
|
||||
int respa_enable; // 1 if inner/middle/outer rRESPA routines
|
||||
int one_coeff; // 1 if allows only one coeff * * call
|
||||
int no_virial_fdotr_compute; // 1 if does not invoke virial_fdotr_compute()
|
||||
|
|
|
@ -737,7 +737,11 @@ void ReadRestart::force_fields()
|
|||
|
||||
force->create_pair(style);
|
||||
delete [] style;
|
||||
force->pair->read_restart(fp);
|
||||
if (force->pair->restartinfo) force->pair->read_restart(fp);
|
||||
else {
|
||||
delete force->pair;
|
||||
force->pair = NULL;
|
||||
}
|
||||
|
||||
} else if (flag == BOND) {
|
||||
if (me == 0) fread(&n,sizeof(int),1,fp);
|
||||
|
|
Loading…
Reference in New Issue