AnalyzeExample

class AnalyzeExample : public feasst::Analyze

Add an analysis to FEASST by using this file as a template and instruction set. Follow the same 4 steps detailed in /feasst/plugin/example/include/model_example.h In summary, copy analyze_example.[h/cpp] to new_name.[h/cpp], replace AnalyzeExample with NewName, Replace ANALYZE_EXAMPLE with NEW_NAME, and finally cd /path/to/feasst/build; python ../py/depend-py -s ../

For more inspiration, take a look at the other existing Analyze in the stepper plugin, such as Movie, Log or PairDistribution.

In this example, compute the average geometric center of all site positions.

Public Functions

const Accumulator &geometric_center(const int dimension) const

Return the average geometric center of a given dimension.

const std::vector<Accumulator> &geometric_center() const

Return the average geometric center.

std::string header(const Criteria &criteria, const System &system, const TrialFactory &trials) const

Write the header for the file.

void initialize(Criteria *criteria, System *system, TrialFactory *trial_factory)

Size and zero the geometric center accumulator for each dimension.

void update(const Criteria &criteria, const System &system, const TrialFactory &trial_factory)

Compute the geometric center and update the accumulator.

std::string write(const Criteria &criteria, const System &system, const TrialFactory &trial_factory)

Write the geometric center to file.

Arguments

  • group_index: index of group defined in Configuration (default: 0, which is all existing sites).

  • Stepper arguments.

Note that Stepper, which is the Base class of Analyze, already contains the vast majority of arguments that are required.