SeekNumParticles

class SeekNumParticles

Initialize the number of particles in MonteCarlo. Use the existing trials, but reset their stats once the goal is reached.

Public Functions

SeekNumParticles(const int num, const argtype &args = argtype())

args:

  • particle_type: type of particle to add. If -1, all types (default: -1).

  • max_attempts: maximum number of trial attempts for seek (default: 1e8).

SeekNumParticles with_thermo_params(const argtype &args)

Optionally, use a temporary ThermoParams.

SeekNumParticles with_metropolis()

Optionally use a temporary Metropolis criteria with given args. This is the recommended approach, especially to avoid using FlatHistogram.

SeekNumParticles with_metropolis(std::shared_ptr<Constraint> constraint)

Same as above but with a constraint.

SeekNumParticles with_trial_add(const argtype &args = argtype())

Use an extra and temporary TrialAdd between every existing Trial. If particle_type is not included in args, use value given by class argument particle_type, if not -1. If -1, then use 0.

SeekNumParticles add(std::shared_ptr<Trial> trial)

Add an extra trial. Any extra trials, including TrialAdd above, are attempted between each trial already present in MonteCarlo.

SeekNumParticles add(std::shared_ptr<ProgressReport> report)

Add a progress report.

void run(MonteCarlo *monte_carlo)

Perform the seek.