Adding restart method to fix neigh/history

This commit is contained in:
Joel Clemmer
2020-10-14 20:00:48 -06:00
parent d27c7cd2fc
commit fd8ff18abc
2 changed files with 21 additions and 1 deletions

View File

@ -40,6 +40,8 @@ FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) :
if (narg != 4) error->all(FLERR,"Illegal fix NEIGH_HISTORY command"); if (narg != 4) error->all(FLERR,"Illegal fix NEIGH_HISTORY command");
restart_peratom = 1; restart_peratom = 1;
restart_global = 1;
create_attribute = 1; create_attribute = 1;
maxexchange_dynamic = 1; maxexchange_dynamic = 1;
@ -840,6 +842,23 @@ int FixNeighHistory::unpack_exchange(int nlocal, double *buf)
return m; return m;
} }
/* ----------------------------------------------------------------------
Use write_restart to invoke pre_exchange
------------------------------------------------------------------------- */
void FixNeighHistory::write_restart(FILE *fp)
{
// Call pre-exchange to copy updated history in page file
// back into per-atom arrays prior to packing restart data
pre_exchange();
if (comm->me == 0) {
int size = 0;
fwrite(&size,sizeof(int),1,fp);
}
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
pack values in local atom-based arrays for restart file pack values in local atom-based arrays for restart file
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */

View File

@ -53,6 +53,7 @@ class FixNeighHistory : public Fix {
void unpack_reverse_comm(int, int *, double *); void unpack_reverse_comm(int, int *, double *);
int pack_exchange(int, double *); int pack_exchange(int, double *);
int unpack_exchange(int, double *); int unpack_exchange(int, double *);
void write_restart(FILE *);
int pack_restart(int, double *); int pack_restart(int, double *);
void unpack_restart(int, int); void unpack_restart(int, int);
int size_restart(int); int size_restart(int);