do not run tally callback setup multiple times per time step

This commit is contained in:
Axel Kohlmeyer
2019-06-14 15:46:28 -04:00
parent daa53e3008
commit e73b34a5b1
6 changed files with 26 additions and 1 deletions

View File

@ -21,7 +21,7 @@ The person who created this package is Axel Kohlmeyer (akohlmey@gmail.com)
at Temple University with a little help and inspiration from
Loris Ercole (SISSA/ISAS Trieste), who contributed compute heat/flux/tally.
Additional contributed compute style for this package are welcome.
Additional contributed compute styles for this package are welcome.
Please contact Axel, if you have questions about the implementation.

View File

@ -85,6 +85,11 @@ void ComputeForceTally::init()
void ComputeForceTally::pair_setup_callback(int, int)
{
// run setup only once per time step.
// we may be called from multiple pair styles
if (did_setup == update->ntimestep) return;
const int ntotal = atom->nlocal + atom->nghost;
// grow per-atom storage, if needed

View File

@ -87,6 +87,11 @@ void ComputeHeatFluxTally::init()
/* ---------------------------------------------------------------------- */
void ComputeHeatFluxTally::pair_setup_callback(int, int)
{
// run setup only once per time step.
// we may be called from multiple pair styles
if (did_setup == update->ntimestep) return;
const int ntotal = atom->nlocal + atom->nghost;
// grow per-atom storage, if needed

View File

@ -82,6 +82,11 @@ void ComputePEMolTally::init()
void ComputePEMolTally::pair_setup_callback(int, int)
{
// run setup only once per time step.
// we may be called from multiple pair styles
if (did_setup == update->ntimestep) return;
etotal[0] = etotal[1] = etotal[2] = etotal[3] = 0.0;
did_setup = update->ntimestep;
}

View File

@ -84,6 +84,11 @@ void ComputePETally::init()
void ComputePETally::pair_setup_callback(int, int)
{
// run setup only once per time step.
// we may be called from multiple pair styles
if (did_setup == update->ntimestep) return;
const int ntotal = atom->nlocal + atom->nghost;
// grow per-atom storage, if needed

View File

@ -87,6 +87,11 @@ void ComputeStressTally::init()
void ComputeStressTally::pair_setup_callback(int, int)
{
// run setup only once per time step.
// we may be called from multiple pair styles
if (did_setup == update->ntimestep) return;
const int ntotal = atom->nlocal + atom->nghost;
// grow per-atom storage, if needed