PROFASI
Version 1.5

The excluded volume term. More...
#include <ExVol.hh>
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.  
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 ...

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.

virtual 
This function contains one of the interesting speedup 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.

virtual 
do a new ab initio calculation
Reimplemented from prf::Energy.

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 precalculate 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. 024 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.

virtual 
The default is between 0 and 1. So, for observables with values always between 0 and 1, you need not overwrite 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.