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

This commit is contained in:
sjplimp
2015-02-06 16:19:34 +00:00
parent 7b1005eeae
commit 1091ba1131
3 changed files with 22 additions and 30 deletions

View File

@ -128,30 +128,19 @@ void FixShearHistory::allocate_pages()
} }
} }
/* ----------------------------------------------------------------------
called by setup of run or minimize
called by write_restart as input script command
only invoke pre_exchange() if neigh list stores more current history info
than npartner/partner arrays in this fix
that will only be case if pair->compute() has been invoked since
update of npartner/partner
this logic avoids 2 problems:
run 100; write_restart; run 100
setup_pre_exchange is called twice (by write_restart and 2nd run setup)
w/out a neighbor list being created in between
read_restart; run 100
setup_pre_exchange called by run setup whacks restart shear history info
------------------------------------------------------------------------- */
void FixShearHistory::setup_pre_exchange()
{
if (*computeflag) pre_exchange();
*computeflag = 0;
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
copy shear partner info from neighbor lists to atom arrays copy shear partner info from neighbor lists to atom arrays
so can be migrated or stored with atoms should be called whenever neighbor list stores current history info
and need to have atoms store the info
e.g. so atoms can migrate to new procs or between runs
when atoms may be added or deleted (neighbor list becomes out-of-date)
the next granular neigh list build will put this info back into neigh list
called during run before atom exchanges
called at end of run via post_run()
do not call during setup of run (setup_pre_exchange)
b/c there is no guarantee of a current neigh list (even on continued run)
if run command does a 2nd run with pre = no, then no neigh list
will be built, but old neigh list will still have the info
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void FixShearHistory::pre_exchange() void FixShearHistory::pre_exchange()
@ -262,15 +251,14 @@ void FixShearHistory::pre_exchange()
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void FixShearHistory::min_setup_pre_exchange() void FixShearHistory::min_pre_exchange()
{ {
if (*computeflag) pre_exchange(); pre_exchange();
*computeflag = 0;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void FixShearHistory::min_pre_exchange() void FixShearHistory::post_run()
{ {
pre_exchange(); pre_exchange();
} }

View File

@ -34,10 +34,9 @@ class FixShearHistory : public Fix {
~FixShearHistory(); ~FixShearHistory();
int setmask(); int setmask();
void init(); void init();
void setup_pre_exchange();
virtual void pre_exchange(); virtual void pre_exchange();
void min_setup_pre_exchange();
void min_pre_exchange(); void min_pre_exchange();
void post_run();
double memory_usage(); double memory_usage();
void grow_arrays(int); void grow_arrays(int);

View File

@ -113,11 +113,16 @@ void WriteRestart::command(int narg, char **arg)
lmp->init(); lmp->init();
// move atoms to new processors before writing file // move atoms to new processors before writing file
// do setup_pre_exchange to force update of per-atom info if needed
// enforce PBC in case atoms are outside box // enforce PBC in case atoms are outside box
// call borders() to rebuild atom map since exchange() destroys map // call borders() to rebuild atom map since exchange() destroys map
// NOTE: removed call to setup_pre_exchange
// used to be needed by fixShearHistory for granular
// to move history info from neigh list to atoms between runs
// but now that is done via FIx::post_run()
// don't think any other fix needs this or should do it
// e.g. fix evaporate should not delete more atoms
modify->setup_pre_exchange(); // modify->setup_pre_exchange();
if (domain->triclinic) domain->x2lamda(atom->nlocal); if (domain->triclinic) domain->x2lamda(atom->nlocal);
domain->pbc(); domain->pbc();
domain->reset_box(); domain->reset_box();