Simpatico  v1.10
EnergyCalculator.cpp
1 /*
2 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
3 *
4 * Copyright 2010 - 2017, The Regents of the University of Minnesota
5 * Distributed under the terms of the GNU General Public License.
6 */
7 
8 #include "EnergyCalculator.h"
9 
10 namespace McMd
11 {
12 
13  using namespace Util;
14 
15  /*
16  * Mark the energy as unknown (default implementation).
17  */
19  { energy_.unset(); }
20 
25  {
26  if (!energy_.isSet()) {
27  computeEnergy();
28  }
29  return energy_.value();
30  }
31 
32 }
virtual void unsetEnergy()
Mark the energy as unknown.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
double energy()
Return the energy contribution, compute if necessary.