mcpele  1.0.0
The Monte Carlo Python Energy Landscape Explorer
 All Classes Namespaces Functions Variables Typedefs
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
mcpele::MC Class Reference

#include <mc.h>

List of all members.

Public Types

typedef std::vector
< std::shared_ptr< Action > > 
actions_t
typedef std::vector
< std::shared_ptr< AcceptTest > > 
accept_t
typedef std::vector
< std::shared_ptr< ConfTest > > 
conf_t

Public Member Functions

 MC (std::shared_ptr< pele::BasePotential > potential, pele::Array< double > &coords, const double temperature)
virtual ~MC ()
void one_iteration ()
void run (const size_t max_iter)
void set_temperature (const double T)
double get_temperature () const
void set_report_steps (const size_t report_steps)
size_t get_report_steps () const
void add_action (std::shared_ptr< Action > action)
void add_accept_test (std::shared_ptr< AcceptTest > accept_test)
void add_conf_test (std::shared_ptr< ConfTest > conf_test)
void add_late_conf_test (std::shared_ptr< ConfTest > conf_test)
void set_takestep (std::shared_ptr< TakeStep > takestep)
std::shared_ptr< TakeStepget_takestep () const
void set_coordinates (pele::Array< double > &coords, double energy)
double get_energy () const
void reset_energy ()
double get_trial_energy () const
pele::Array< double > get_coords () const
pele::Array< double > get_trial_coords () const
double get_norm_coords () const
size_t get_naccept () const
size_t get_nreject () const
double get_accepted_fraction () const
double get_conf_rejection_fraction () const
double get_E_rejection_fraction () const
size_t get_iterations_count () const
size_t get_neval () const
std::shared_ptr
< pele::BasePotential
get_potential_ptr ()
bool take_step_specified () const
bool report_steps_specified () const
void check_input ()
void set_print_progress (const bool input)
void set_print_progress ()
bool get_success () const
void abort ()

Public Attributes

size_t m_niter
size_t m_neval
double m_temperature
double m_energy
double m_trial_energy

Protected Member Functions

double compute_energy (pele::Array< double > x)
bool do_conf_tests (pele::Array< double > x)
bool do_accept_tests (pele::Array< double > xtrial, double etrial, pele::Array< double > xold, double eold)
bool do_late_conf_tests (pele::Array< double > x)
void do_actions (pele::Array< double > x, double energy, bool success)
void take_steps ()

Protected Attributes

std::shared_ptr
< pele::BasePotential
m_potential
pele::Array< double > m_coords
pele::Array< double > m_trial_coords
actions_t m_actions
accept_t m_accept_tests
conf_t m_conf_tests
conf_t m_late_conf_tests
std::shared_ptr< TakeStepm_take_step
size_t m_nitercount
size_t m_accept_count
size_t m_E_reject_count
size_t m_conf_reject_count
bool m_success
bool m_print_progress

Detailed Description

Monte Carlo _coords and _trialcoords are arrays that store coordinates and trial coordinates respectively _potential is on object of Pele::BasePotential type that defines the interaction potential _E_reject_count is the count of rejections due to an energy test (e.g. Metropolis) _conf_reject_count is the count of rejections due to a configuration test (e.g. spherical container) _niter is the count of steps whithin a MCMC run, it is reset to zero at the end of the run _nitercount is the cumulative number of MCMC steps taken by the class _neval is the number of energy evaluations _temperature is the temperature at which the simulation is performed _energy is the current energy of the system _success records whether the step has been accepted or rejected

Definition at line 83 of file mc.h.


Member Typedef Documentation

typedef std::vector<std::shared_ptr<AcceptTest> > mcpele::MC::accept_t

Definition at line 86 of file mc.h.

typedef std::vector<std::shared_ptr<Action> > mcpele::MC::actions_t

Definition at line 85 of file mc.h.

typedef std::vector<std::shared_ptr<ConfTest> > mcpele::MC::conf_t

Definition at line 87 of file mc.h.


Constructor & Destructor Documentation

mcpele::MC::MC ( std::shared_ptr< pele::BasePotential potential,
pele::Array< double > &  coords,
const double  temperature 
)

Definition at line 8 of file mc.cpp.

virtual mcpele::MC::~MC ( ) [inline, virtual]

Definition at line 115 of file mc.h.


Member Function Documentation

void mcpele::MC::abort ( ) [inline]

this will trigger premature exit from the MC run loop

Definition at line 155 of file mc.h.

void mcpele::MC::add_accept_test ( std::shared_ptr< AcceptTest accept_test) [inline]

Definition at line 123 of file mc.h.

void mcpele::MC::add_action ( std::shared_ptr< Action action) [inline]

Definition at line 122 of file mc.h.

void mcpele::MC::add_conf_test ( std::shared_ptr< ConfTest conf_test) [inline]

Definition at line 124 of file mc.h.

void mcpele::MC::add_late_conf_test ( std::shared_ptr< ConfTest conf_test) [inline]

Definition at line 125 of file mc.h.

Definition at line 137 of file mc.cpp.

double mcpele::MC::compute_energy ( pele::Array< double >  x) [inline, protected]

Definition at line 157 of file mc.h.

bool mcpele::MC::do_accept_tests ( pele::Array< double >  xtrial,
double  etrial,
pele::Array< double >  xold,
double  eold 
) [protected]

perform the acceptance tests. Stop as soon as one of them fails

Definition at line 49 of file mc.cpp.

void mcpele::MC::do_actions ( pele::Array< double >  x,
double  energy,
bool  success 
) [protected]

Definition at line 78 of file mc.cpp.

bool mcpele::MC::do_conf_tests ( pele::Array< double >  x) [protected]

perform the configuration tests. Stop as soon as one of them fails

Definition at line 33 of file mc.cpp.

bool mcpele::MC::do_late_conf_tests ( pele::Array< double >  x) [protected]

perform the configuration tests. Stop as soon as one of them fails

Definition at line 65 of file mc.cpp.

double mcpele::MC::get_accepted_fraction ( ) const [inline]

Definition at line 137 of file mc.h.

double mcpele::MC::get_conf_rejection_fraction ( ) const [inline]

Definition at line 139 of file mc.h.

pele::Array<double> mcpele::MC::get_coords ( ) const [inline]

Definition at line 132 of file mc.h.

double mcpele::MC::get_E_rejection_fraction ( ) const [inline]

Definition at line 141 of file mc.h.

double mcpele::MC::get_energy ( ) const [inline]

Definition at line 129 of file mc.h.

size_t mcpele::MC::get_iterations_count ( ) const [inline]

Definition at line 143 of file mc.h.

size_t mcpele::MC::get_naccept ( ) const [inline]

Definition at line 135 of file mc.h.

size_t mcpele::MC::get_neval ( ) const [inline]

Definition at line 144 of file mc.h.

double mcpele::MC::get_norm_coords ( ) const [inline]

Definition at line 134 of file mc.h.

size_t mcpele::MC::get_nreject ( ) const [inline]

Definition at line 136 of file mc.h.

std::shared_ptr<pele::BasePotential> mcpele::MC::get_potential_ptr ( ) [inline]

Definition at line 145 of file mc.h.

size_t mcpele::MC::get_report_steps ( ) const [inline]

Definition at line 121 of file mc.h.

bool mcpele::MC::get_success ( ) const [inline]

Definition at line 151 of file mc.h.

std::shared_ptr<TakeStep> mcpele::MC::get_takestep ( ) const [inline]

Definition at line 127 of file mc.h.

double mcpele::MC::get_temperature ( ) const [inline]

Definition at line 119 of file mc.h.

pele::Array<double> mcpele::MC::get_trial_coords ( ) const [inline]

Definition at line 133 of file mc.h.

double mcpele::MC::get_trial_energy ( ) const [inline]

Definition at line 131 of file mc.h.

Definition at line 91 of file mc.cpp.

bool mcpele::MC::report_steps_specified ( ) const [inline]

Definition at line 147 of file mc.h.

Definition at line 155 of file mc.cpp.

void mcpele::MC::run ( const size_t  max_iter)

Definition at line 163 of file mc.cpp.

void mcpele::MC::set_coordinates ( pele::Array< double > &  coords,
double  energy 
)

Definition at line 148 of file mc.cpp.

void mcpele::MC::set_print_progress ( const bool  input) [inline]

Definition at line 149 of file mc.h.

void mcpele::MC::set_print_progress ( ) [inline]

Definition at line 150 of file mc.h.

void mcpele::MC::set_report_steps ( const size_t  report_steps) [inline]

Definition at line 120 of file mc.h.

void mcpele::MC::set_takestep ( std::shared_ptr< TakeStep takestep) [inline]

Definition at line 126 of file mc.h.

void mcpele::MC::set_temperature ( const double  T) [inline]

Definition at line 118 of file mc.h.

bool mcpele::MC::take_step_specified ( ) const [inline]

Definition at line 146 of file mc.h.

void mcpele::MC::take_steps ( ) [protected]

Definition at line 85 of file mc.cpp.


Member Data Documentation

size_t mcpele::MC::m_accept_count [protected]

Definition at line 98 of file mc.h.

Definition at line 93 of file mc.h.

Definition at line 92 of file mc.h.

size_t mcpele::MC::m_conf_reject_count [protected]

Definition at line 100 of file mc.h.

Definition at line 94 of file mc.h.

pele::Array<double> mcpele::MC::m_coords [protected]

Definition at line 90 of file mc.h.

size_t mcpele::MC::m_E_reject_count [protected]

Definition at line 99 of file mc.h.

Definition at line 109 of file mc.h.

Definition at line 95 of file mc.h.

Definition at line 107 of file mc.h.

Definition at line 106 of file mc.h.

size_t mcpele::MC::m_nitercount [protected]

Definition at line 97 of file mc.h.

std::shared_ptr<pele::BasePotential> mcpele::MC::m_potential [protected]

Definition at line 89 of file mc.h.

bool mcpele::MC::m_print_progress [protected]

Definition at line 103 of file mc.h.

bool mcpele::MC::m_success [protected]

Definition at line 101 of file mc.h.

std::shared_ptr<TakeStep> mcpele::MC::m_take_step [protected]

Definition at line 96 of file mc.h.

Definition at line 108 of file mc.h.

Definition at line 91 of file mc.h.

Definition at line 110 of file mc.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs