Simpatico  v1.10
McBondEnergyAverage.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 "McBondEnergyAverage.h" // class header
9 #include <mcMd/potentials/bond/BondPotential.h>
10 
11 namespace McMd
12 {
13 
14  using namespace Util;
15 
16  /*
17  * Constructor.
18  */
20  : AverageAnalyzer<McSystem>(system)
21  { setClassName("McBondEnergyAverage"); }
22 
23  /*
24  * Evaluate total bond energy.
25  */
26  void McBondEnergyAverage::sample(long iStep)
27  { accumulator_.sample(system().bondPotential().energy(), outputFile_); }
28 
29 }
A System for use in a Markov chain Monte Carlo simulation.
Definition: McSystem.h:52
virtual void sample(long iStep)
Evaluate total bond energy, and add to ensemble.
McSystem & system()
Return reference to parent system.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Average accumulator_
Average object - statistical accumulator.
AverageAnalyzer averages of total potential energy.
McBondEnergyAverage(McSystem &system)
Constructor.
void sample(double value)
Add a sampled value to the ensemble.
Definition: Average.cpp:94
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
void setClassName(const char *className)
Set class name string.