do not run tally callback setup multiple times per time step
This commit is contained in:
@ -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.
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user