PROFASI  Version 1.5
Public Member Functions | List of all members
prf::ExVol Class Reference

The excluded volume term. More...

#include <ExVol.hh>

Inheritance diagram for prf::ExVol:
Inheritance graph
[legend]

Public Member Functions

void rangeEstimate (double &x1, double &x2)
 Estimate a range in which values of this observable are expected.
 
double evaluate ()
 
double deltaE (Update *)
 do a new delta calculation optimized for the given kind of update
 
double deltaEwithlimit (Update *updt, double emax)
 Calculate energy change for an update, but with a stop condition.
 
void Accept (Update *)
 Accept a proposed update.
 
void Revert (Update *)
 Reject a proposed update.
 
int PairType (int i, int j)
 Categorizes different kinds of pairs of atoms.
 
- Public Member Functions inherited from prf::Energy
void Connect (Population *pl)
 Connect the energy term with one population.
 
virtual void set_pars (std::string pars)
 Set some adjustible parameters.
 
void refresh ()
 Overrides the virtual member from the Observable class.
 
double value ()
 return result from last calculation
 
double deltaE ()
 return result from the last energy change calculation
 
double delta (Update *)
 Quick estimate of the change in an Observable due to an update.
 
int init_obs ()
 All observables must implement one initialize routine.
 
- Public Member Functions inherited from prf::Observable
void set (std::string cmd)
 Give the object an instruction to process during initialization.
 
double operator() ()
 Retrieve the value of the observable.
 
double Value ()
 Retrieve the value of the observable.
 
void disable_stats ()
 Stop collecting statistical data like averages and histograms.
 
void enable_stats ()
 Start collecting statistical data like averages and histograms.
 
- Public Member Functions inherited from prf::Named
 Named ()
 Create an object with name "unnamed".
 
 Named (const char *st)
 Create an object with name st given as a C string.
 
 Named (std::string st)
 Create an object with a name given as a string.
 
std::string Name () const
 Retrive the name of an object.
 
void Name (std::string gnm)
 Assign a new name to an object.
 

Detailed Description

This class represents the excluded volume interactions and is the most painstakingly optimized part of PROFASI. A backup matrix, as used for other energy terms would not be very effective, because almost every pair of atoms can interact with this term. The optimization is achieved using the following ...

  1. Since the model assumes fixed bond lengths and bond angles, there are many pairs of atoms with fixed separation. Excluded volume contribution from such pairs is dynamically uninteresting and is set to zero.
  2. Atom pairs separated by 3 covalent bonds are treated separately in the LocExVol class
  3. The excluded volume potential in the model is a strong repulsion with a finite range. So, the periodic box for the whole system is divided into cells with linear dimensions greater than or equal to the range of the excluded volume potential. Each atom is assigned a cell. Atom pairs which are neither in the same cell nor in neighbouring cells would have distances greater than the range of the potential, and hence wont contribute. So, during evaluation, such pairs are ignored. For each atom, contribution from other atoms in the same cell and in the neighbouring cells is calculated. For each update, the cell-assignment is carefully updated, so that only the moved atoms are re-assigned. Energy contributions are recalculated only on "active" cells, in which something happened: atoms moved in or moved out of the cell or one of its neighbours.

Member Function Documentation

void prf::ExVol::Accept ( Update updt)
virtual

PROFASI uses many local contribution matrices and backup variables to quickly evaluate the change caused to any energy term by a given update. Those backup variables and the contribution matrices need to be kept in sync with the current system configuration. So, each energy class has an accept and a reject method, which are called when an update is accepted or rejected. What is done inside these functions depends on the energy term and optimization trick used therein.

Reimplemented from prf::Energy.

double prf::ExVol::deltaEwithlimit ( Update updt,
double  maxde 
)
virtual

This function contains one of the interesting speed-up tricks of ProFASi. In Markov chain Monte Carlo simulations, there is an acceptance criterion, which depends, on energy changes, temperature a random number etc. Often, it is possible to calculate everything other than the energy change before proceeding to the energy change calculations. This means, before starting out to find how much the energy changed, we can figure out the maximum acceptable total energy change. We then isolate the most expensive contribution and calculate the regular delta E for all other terms, and subtract from the maximum total acceptable change, and get a value for the maximum allowed value for the last and most expensive term. We pass this value to the delta E calculation of the last term, using this function. Implementation of that energy function is allowed to abort its calculation, if at some point during its calculation, it can determine that there is no way to stay below the given limit. This means, this function is allowed to return any (wrong) value greater than maxde, if the correct value is also greater than maxde with certainty. It is understood that the update will be rejected if a value greater than maxde is returned.

As an example, consider the situation when the most expensive term is positive definite. We start by calculating the contributions of the moved atoms before the update. Then while calculating the contributions of the same atoms after the update, if after 5 of the 2000 terms, the partial sum exceeds a limit, there is no point in calculating the remaining contributions, which can not bring the total change below maxde. This trick makes a noticeable impact on the execution speed.Like deltaE, but stop if change exceeds a given limit

Reimplemented from prf::Energy.

double prf::ExVol::evaluate ( )
virtual

do a new ab initio calculation

Reimplemented from prf::Energy.

int prf::ExVol::PairType ( int  i,
int  j 
)
inline

If NA is the number of types of atoms (5 in our case, H, C, N, O, S), there are NA*NA kinds of pairs. This information is used to pre-calculate the unchanging parts of the functional form of excluded volume, and only insert the distance information for a new configuration when required. So, the function PairType(i,j) here, returns numbers between -1 and 25. 0-24 for all kinds of pairs. -1 means "don't care", and is returned when there is less than or equal to three covalent bonds between them. With 1 or 2 bonds, the distance between the pair can not change in the model. For 3 covalent bonds, the excluded volume is calculated separately in the LocExVol class.

void prf::ExVol::rangeEstimate ( double &  x1,
double &  x2 
)
virtual

The default is between 0 and 1. So, for observables with values always between 0 and 1, you need not over-write this virtual function. Sometimes the observable will have a different fixed range, determined by its definition. Sometimes the range can not be determined perfectly. In such a case, let this function just return something reasonable.

Reimplemented from prf::Energy.


The documentation for this class was generated from the following files:

PROFASI: Protein Folding and Aggregation Simulator, Version 1.5
© (2005-2016) Anders Irbäck and Sandipan Mohanty
Documentation generated on Mon Jul 18 2016 using Doxygen version 1.8.2