git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7189 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -45,6 +45,7 @@ using namespace MathConst;
|
|||||||
PairAIREBO::PairAIREBO(LAMMPS *lmp) : Pair(lmp)
|
PairAIREBO::PairAIREBO(LAMMPS *lmp) : Pair(lmp)
|
||||||
{
|
{
|
||||||
single_enable = 0;
|
single_enable = 0;
|
||||||
|
restartinfo = 0;
|
||||||
one_coeff = 1;
|
one_coeff = 1;
|
||||||
ghostneigh = 1;
|
ghostneigh = 1;
|
||||||
|
|
||||||
@ -4237,52 +4238,6 @@ void PairAIREBO::spline_init()
|
|||||||
for (i = 2; i < 10; i++) Tf[2][2][i] = -0.0040480;
|
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
|
memory usage of local atom-based arrays
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -33,10 +33,6 @@ class PairAIREBO : public Pair {
|
|||||||
void coeff(int, char **);
|
void coeff(int, char **);
|
||||||
void init_style();
|
void init_style();
|
||||||
double init_one(int, int);
|
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();
|
double memory_usage();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -166,7 +166,6 @@ Pair *Force::new_pair(const char *style, const char *suffix, int &sflag)
|
|||||||
#undef PAIR_CLASS
|
#undef PAIR_CLASS
|
||||||
|
|
||||||
else error->all(FLERR,"Invalid pair style");
|
else error->all(FLERR,"Invalid pair style");
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,7 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp)
|
|||||||
comm_forward = comm_reverse = 0;
|
comm_forward = comm_reverse = 0;
|
||||||
|
|
||||||
single_enable = 1;
|
single_enable = 1;
|
||||||
|
restartinfo = 1;
|
||||||
respa_enable = 0;
|
respa_enable = 0;
|
||||||
one_coeff = 0;
|
one_coeff = 0;
|
||||||
no_virial_fdotr_compute = 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 comm_reverse; // size of reverse communication (0 if none)
|
||||||
|
|
||||||
int single_enable; // 1 if single() routine exists
|
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 respa_enable; // 1 if inner/middle/outer rRESPA routines
|
||||||
int one_coeff; // 1 if allows only one coeff * * call
|
int one_coeff; // 1 if allows only one coeff * * call
|
||||||
int no_virial_fdotr_compute; // 1 if does not invoke virial_fdotr_compute()
|
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);
|
force->create_pair(style);
|
||||||
delete [] 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) {
|
} else if (flag == BOND) {
|
||||||
if (me == 0) fread(&n,sizeof(int),1,fp);
|
if (me == 0) fread(&n,sizeof(int),1,fp);
|
||||||
|
|||||||
Reference in New Issue
Block a user