add errorurl(11) with explanation to "Energy/Stess was not tallied by pair style"

This commit is contained in:
Axel Kohlmeyer
2025-03-21 19:57:57 -04:00
parent 3ab91e4e1a
commit 649fd86e11
7 changed files with 42 additions and 20 deletions

View File

@ -458,7 +458,20 @@ with the relevant person or people who can update the executable.
.. _err011:
.. currently unused
Energy or stress was not tallied by pair style
----------------------------------------------
This warning will be printed by computes from the :ref:`TALLY package
<PKG-TALLY>`. Those use a callback mechanism that will only work for
regular pair-wise additive pair styles like :doc:`Lennard-Jones
<pair_lj>`, :doc:`Morse <pair_morse>`, :doc:`Born-Meyer-Huggins
<pair_born>`, and similar. Making these computes work for many-body
potentials will require to implement similar callbacks suitable for such
potentials, which has not been done (and may be difficult to do in a
generic fashion). Whether this warning indicates that contributions to
the computed properties are missing depends on the groups used. At any
rate, careful testing of the results is advised when this warning
appears.
.. _err0012:

View File

@ -182,7 +182,7 @@ double ComputeForceTally::compute_scalar()
error->all(FLERR, Error::NOLASTLINE, "Stress was not tallied on needed timestep{}", utils::errorurl(22));
if ((comm->me == 0) && !force->pair->did_tally_callback())
error->warning(FLERR, "Stress was not tallied by pair style");
error->warning(FLERR, "Stress was not tallied by pair style" + utils::errorurl(11));
// sum accumulated forces across procs
@ -201,7 +201,7 @@ void ComputeForceTally::compute_peratom()
error->all(FLERR, Error::NOLASTLINE, "Stress was not tallied on needed timestep{}", utils::errorurl(22));
if ((comm->me == 0) && !force->pair->did_tally_callback())
error->warning(FLERR, "Stress was not tallied by pair style");
error->warning(FLERR, "Stress was not tallied by pair style" + utils::errorurl(11));
// collect contributions from ghost atoms

View File

@ -69,7 +69,8 @@ ComputeHeatFluxTally::~ComputeHeatFluxTally()
void ComputeHeatFluxTally::init()
{
if (force->pair == nullptr)
error->all(FLERR, "Trying to use compute heat/flux/tally without pair style");
error->all(FLERR, Error::NOLASTLINE,
"Trying to use compute heat/flux/tally without pair style");
else
force->pair->add_tally_callback(this);
@ -205,10 +206,11 @@ void ComputeHeatFluxTally::compute_vector()
{
invoked_vector = update->ntimestep;
if ((did_setup != invoked_vector) || (update->eflag_global != invoked_vector))
error->all(FLERR, Error::NOLASTLINE, "Stress was not tallied on needed timestep{}", utils::errorurl(22));
error->all(FLERR, Error::NOLASTLINE,
"Stress was not tallied on needed timestep" + utils::errorurl(22));
if ((comm->me == 0) && !force->pair->did_tally_callback())
error->warning(FLERR, "Stress was not tallied by pair style");
error->warning(FLERR, "Stress was not tallied by pair style" + utils::errorurl(11));
// collect contributions from ghost atoms

View File

@ -191,10 +191,11 @@ double ComputeHeatFluxVirialTally::compute_scalar()
invoked_scalar = update->ntimestep;
if ((did_setup != invoked_scalar) || (update->eflag_global != invoked_scalar))
error->all(FLERR, Error::NOLASTLINE, "Stress was not tallied on needed timestep{}", utils::errorurl(22));
error->all(FLERR, Error::NOLASTLINE,
"Stress was not tallied on needed timestep" + utils::errorurl(22));
if ((comm->me == 0) && !force->pair->did_tally_callback())
error->warning(FLERR, "Stress was not tallied by pair style");
error->warning(FLERR, "Stress was not tallied by pair style" + utils::errorurl(11));
// sum heat flux across procs
double hflux = 0.0;
@ -213,10 +214,11 @@ void ComputeHeatFluxVirialTally::compute_peratom()
{
invoked_peratom = update->ntimestep;
if ((did_setup != invoked_peratom) || (update->eflag_global != invoked_peratom))
error->all(FLERR, Error::NOLASTLINE, "Stress was not tallied on needed timestep{}", utils::errorurl(22));
error->all(FLERR, Error::NOLASTLINE,
"Stress was not tallied on needed timestep" + utils::errorurl(22));
if ((comm->me == 0) && !force->pair->did_tally_callback())
error->warning(FLERR, "Stress was not tallied by pair style");
error->warning(FLERR, "Stress was not tallied by pair style" + utils::errorurl(11));
// collect contributions from ghost atoms

View File

@ -126,10 +126,11 @@ void ComputePEMolTally::compute_vector()
{
invoked_vector = update->ntimestep;
if ((did_setup != invoked_vector) || (update->eflag_global != invoked_vector))
error->all(FLERR, Error::NOLASTLINE, "Energy was not tallied on needed timestep{}", utils::errorurl(22));
error->all(FLERR, Error::NOLASTLINE,
"Energy was not tallied on needed timestep" + utils::errorurl(22));
if ((comm->me == 0) && !force->pair->did_tally_callback())
error->warning(FLERR, "Energy was not tallied by pair style");
error->warning(FLERR, "Energy was not tallied by pair style" + utils::errorurl(11));
// sum accumulated energies across procs

View File

@ -167,10 +167,11 @@ double ComputePETally::compute_scalar()
{
invoked_scalar = update->ntimestep;
if ((did_setup != invoked_scalar) || (update->eflag_global != invoked_scalar))
error->all(FLERR, Error::NOLASTLINE, "Energy was not tallied on needed timestep{}", utils::errorurl(22));
error->all(FLERR, Error::NOLASTLINE,
"Energy was not tallied on needed timestep" + utils::errorurl(22));
if ((comm->me == 0) && !force->pair->did_tally_callback())
error->warning(FLERR, "Energy was not tallied by pair style");
error->warning(FLERR, "Energy was not tallied by pair style" + utils::errorurl(11));
// sum accumulated energies across procs
@ -186,10 +187,11 @@ void ComputePETally::compute_peratom()
{
invoked_peratom = update->ntimestep;
if ((did_setup != invoked_peratom) || (update->eflag_global != invoked_peratom))
error->all(FLERR, Error::NOLASTLINE, "Energy was not tallied on needed timestep{}", utils::errorurl(22));
error->all(FLERR, Error::NOLASTLINE,
"Energy was not tallied on needed timestep" + utils::errorurl(22));
if ((comm->me == 0) && !force->pair->did_tally_callback())
error->warning(FLERR, "Energy was not tallied by pair style");
error->warning(FLERR, "Energy was not tallied by pair style" + utils::errorurl(11));
// collect contributions from ghost atoms

View File

@ -202,10 +202,11 @@ double ComputeStressTally::compute_scalar()
{
invoked_scalar = update->ntimestep;
if ((did_setup != invoked_scalar) || (update->eflag_global != invoked_scalar))
error->all(FLERR, Error::NOLASTLINE, "Stress was not tallied on needed timestep{}", utils::errorurl(22));
error->all(FLERR, Error::NOLASTLINE,
"Stress was not tallied on needed timestep" + utils::errorurl(22));
if ((comm->me == 0) && !force->pair->did_tally_callback())
error->warning(FLERR, "Stress was not tallied by pair style");
error->warning(FLERR, "Stress was not tallied by pair style" + utils::errorurl(11));
// sum accumulated forces across procs
@ -225,10 +226,11 @@ void ComputeStressTally::compute_peratom()
{
invoked_peratom = update->ntimestep;
if ((did_setup != invoked_peratom) || (update->eflag_global != invoked_peratom))
error->all(FLERR, Error::NOLASTLINE, "Stress was not tallied on needed timestep{}", utils::errorurl(22));
error->all(FLERR, Error::NOLASTLINE,
"Stress was not tallied on needed timestep" + utils::errorurl(22));
if ((comm->me == 0) && !force->pair->did_tally_callback())
error->warning(FLERR, "Stress was not tallied by pair style");
error->warning(FLERR, "Stress was not tallied by pair style" + utils::errorurl(11));
// collect contributions from ghost atoms