SSAGES
0.9.3
Software Suite for Advanced General Ensemble Simulations
|
ForwardFlux sampling method. More...
#include <DirectForwardFlux.h>
Public Member Functions | |
DirectForwardFlux (const MPI_Comm &world, const MPI_Comm &comm, double ninterfaces, std::vector< double > interfaces, unsigned int N0Target, std::vector< unsigned int > M, bool initialFluxFlag, bool saveTrajectories, unsigned int currentInterface, std::string output_directory, unsigned int frequency) | |
Constructor. More... | |
void | PostIntegration (Snapshot *snapshot, const class CVManager &cvmanager) override |
Post-integration hook. More... | |
Public Member Functions inherited from SSAGES::ForwardFlux | |
ForwardFlux (const MPI_Comm &world, const MPI_Comm &comm, double ninterfaces, std::vector< double > interfaces, unsigned int N0Target, std::vector< unsigned int > M, bool initialFluxFlag, bool saveTrajectories, unsigned int currentInterface, std::string output_directory, unsigned int frequency) | |
Constructor. More... | |
void | PreSimulation (Snapshot *snapshot, const class CVManager &cvmanager) override |
Method call prior to simulation initiation. More... | |
void | PostSimulation (Snapshot *snapshot, const class CVManager &cvmanager) override |
Method call post simulation. More... | |
Public Member Functions inherited from SSAGES::Method | |
Method (unsigned int frequency, const MPI_Comm &world, const MPI_Comm &comm) | |
Constructor. More... | |
void | SetCVMask (const std::vector< unsigned int > &mask) |
Sets the collective variable mask. More... | |
virtual | ~Method () |
Destructor. | |
Public Member Functions inherited from SSAGES::EventListener | |
EventListener (unsigned int frequency) | |
Constructor. More... | |
unsigned int | GetFrequency () const |
Get frequency of event listener. More... | |
virtual | ~EventListener () |
Destructor. | |
Static Public Member Functions | |
static DirectForwardFlux * | Build (const Json::Value &json, const MPI_Comm &world, const MPI_Comm &comm, const std::string &path) |
Build a derived method from JSON node. More... | |
Static Public Member Functions inherited from SSAGES::ForwardFlux | |
static ForwardFlux * | Build (const Json::Value &json, const MPI_Comm &world, const MPI_Comm &comm, const std::string &path) |
Build a derived method from JSON node. More... | |
Static Public Member Functions inherited from SSAGES::Method | |
static Method * | BuildMethod (const Json::Value &json, const MPI_Comm &world, const MPI_Comm &comm, const std::string &path) |
Build a derived method from JSON node. More... | |
Static Public Member Functions inherited from SSAGES::EventListener | |
static unsigned int | GetWalkerID (const MPI_Comm &world, const MPI_Comm &comm) |
Get walker ID number of specified communicator. More... | |
static unsigned int | GetNumWalkers (const MPI_Comm &world, const MPI_Comm &comm) |
Get total number of walkers in the simulation. More... | |
static bool | IsMasterRank (const MPI_Comm &comm) |
Check if current processor is master. More... | |
Protected Member Functions | |
void | CheckForInterfaceCrossings (Snapshot *, const class CVManager &) override |
Function that checks if interfaces have been crossed (different for each FFS flavor) More... | |
void | InitializeQueue (Snapshot *, const CVList &) override |
Initialize the Queue. | |
Protected Member Functions inherited from SSAGES::ForwardFlux | |
void | CheckInitialStructure (const CVList &) |
Function that checks the initial structure that user provides. | |
void | WriteInitialFlux () |
Function to compute and write the initial flux. | |
void | AddNewIDsToQueue () |
bool | HasReturnedToA (double current) |
Function checks if configuration has returned to A. More... | |
int | HasCrossedInterface (double current, double prev, unsigned int i) |
Function checks if configuration has crossed interface specified since the last check. More... | |
void | WriteFFSConfiguration (Snapshot *snapshot, FFSConfigID &ffsconfig, bool wassuccess) |
Write a file corresponding to FFSConfigID from current snapshot. More... | |
void | ReadFFSConfiguration (Snapshot *snapshot, FFSConfigID &ffsconfig, bool wassuccess) |
Read a file corresponding to a FFSConfigID into current snapshot. More... | |
void | ComputeInitialFlux (Snapshot *, const CVList &) |
Compute Initial Flux. | |
void | ComputeTransitionProbabilities () |
Compute the probability of going from each lambda_i to lambda_{i+1}. More... | |
void | PrintQueue () |
Print the queue, useful for debugging. | |
void | PopQueueMPI (Snapshot *, const CVList &, unsigned) |
Pop the queue, do MPI so that all procs maintain the same queue. | |
void | FluxBruteForce (Snapshot *, const CVList &) |
Compute the flux via brute force. More... | |
void | ReconstructTrajectories (Snapshot *) |
When simulation is finished, parse through the trajectories that reached B, and reconstruct the complete trajectory from where it started at A (lambda0) | |
void | ComputeCommittorProbability (Snapshot *) |
When simulation is finished, recursively parse through the trajectories that reached B or failed back to A and calculate the Commitor Probability of that state going to B (_pB) | |
void | AppendTrajectoryFile (Snapshot *, std::ofstream &) |
void | OpenTrajectoryFile (std::ofstream &) |
Take the current config in snapshot and append it to the provided ofstream. | |
Additional Inherited Members | |
Protected Attributes inherited from SSAGES::ForwardFlux | |
double | _ninterfaces |
std::vector< double > | _interfaces |
FFS Interfaces. | |
bool | _interfaces_increase |
Interfaces must monotonically increase (or decrease), this determines whether going to the 'next' interface will be higher values of CV, or lower ones. | |
double | _cvvalue_previous |
Previous cv position, used to determine if you've crossed an interface since last time. | |
double | _cvvalue |
current cv position | |
double | _rate |
rate constant | |
std::vector< FFSConfigID > | Lambda0ConfigLibrary |
Data structure that holds a Library N0 configurations at lambda0. | |
double | _N0TotalSimTime |
Total Simulation Time spent in accumulating \ _N0. | |
unsigned int | _N0Target |
Number of configurations to store at lambda0, target. | |
double | _fluxA0 |
Flux of trajectories out of state A. Denoted PhiA0 over h_A in Allen2009. | |
std::vector< unsigned int > | _M |
std::vector< unsigned int > | _A |
Number of attempts from interface i. | |
std::vector< double > | _P |
Flag to determine wheter fluxA0 should be calculated, seems not using this. More... | |
std::vector< unsigned int > | _S |
std::vector< unsigned int > | _N |
bool | _pop_tried_but_empty_queue |
bool | _initialFluxFlag |
if 1, compute initial flux | |
bool | initializeQueueFlag |
if 1, initialize the Queue | |
FFSConfigID | myFFSConfigID |
The current FFSConfigID of this MPI process. | |
bool | _saveTrajectories |
should the FFS trajectories be saved | |
unsigned int | _nfailure_total |
std::vector< std::vector< double > > | _pB |
unsigned int | _current_interface |
Current Interface. | |
std::deque< FFSConfigID > | FFSConfigIDQueue |
std::string | _output_directory |
Directory of FFS output. | |
std::ofstream | _trajectory_file |
file to which the current trajectory is written to | |
std::default_random_engine | _generator |
random number generator | |
unsigned int | iteration_ |
Method iteration counter/. | |
Protected Attributes inherited from SSAGES::Method | |
mxx::comm | world_ |
Global MPI communicator. | |
mxx::comm | comm_ |
Local MPI communicator. | |
std::vector< unsigned int > | cvmask_ |
Mask which identifies which CVs to act on. | |
ForwardFlux sampling method.
The notation used here is drawn largely from Allen, Valeriani and Rein ten Wolde. J. Phys.: Condens. Matter (2009) 21:463102. We recommend referring to this review if the reader is unfamiliar with the method, or our variable naming conventions.
Definition at line 35 of file DirectForwardFlux.h.
|
inline |
Constructor.
world | MPI global communicator. |
comm | MPI local communicator. |
ninterfaces | Number of interfaces. |
interfaces | Vector of interfaces. |
N0Target | Required number of initial configurations. |
M | Vector of trials. |
initialFluxFlag | Flag for first step of this method. |
saveTrajectories | Flag to save flux trajectories. |
currentInterface | The number of the current interface. |
output_directory | Directory to which trajectories are saved. |
frequency | Frequency with which this method is invoked. |
Create instance of Forward Flux
Definition at line 58 of file DirectForwardFlux.h.
|
static |
Build a derived method from JSON node.
json | JSON Value containing all input information. |
world | MPI global communicator. |
comm | MPI local communicator. |
path | Path for JSON path specification. |
This function builds a registered method from a JSON node. The difference between this function and "Build" is that this automatically determines the appropriate derived type based on the JSON node information.
|
overrideprotectedvirtual |
Function that checks if interfaces have been crossed (different for each FFS flavor)
Number of trials to attemt from each interface Note _M[0] sets the number of 'branches' for RBFFS and BGFFS?
Implements SSAGES::ForwardFlux.
Definition at line 67 of file DirectForwardFlux.cpp.
References SSAGES::ForwardFlux::_A, SSAGES::ForwardFlux::_current_interface, SSAGES::ForwardFlux::_cvvalue, SSAGES::ForwardFlux::_cvvalue_previous, SSAGES::ForwardFlux::_generator, SSAGES::ForwardFlux::_interfaces, SSAGES::ForwardFlux::_M, SSAGES::ForwardFlux::_N, SSAGES::ForwardFlux::_nfailure_total, SSAGES::ForwardFlux::_ninterfaces, SSAGES::ForwardFlux::_P, SSAGES::ForwardFlux::_pop_tried_but_empty_queue, SSAGES::ForwardFlux::_S, SSAGES::ForwardFlux::_saveTrajectories, SSAGES::ForwardFlux::_trajectory_file, SSAGES::ForwardFlux::FFSConfigID::a, SSAGES::ForwardFlux::AppendTrajectoryFile(), SSAGES::Method::cvmask_, SSAGES::ForwardFlux::FFSConfigIDQueue, SSAGES::CVManager::GetCVs(), SSAGES::ForwardFlux::HasCrossedInterface(), SSAGES::ForwardFlux::HasReturnedToA(), SSAGES::EventListener::IsMasterRank(), SSAGES::ForwardFlux::iteration_, SSAGES::ForwardFlux::FFSConfigID::l, SSAGES::ForwardFlux::myFFSConfigID, SSAGES::ForwardFlux::FFSConfigID::n, SSAGES::ForwardFlux::PopQueueMPI(), SSAGES::ForwardFlux::PostSimulation(), SSAGES::Method::world_, and SSAGES::ForwardFlux::WriteFFSConfiguration().
Referenced by PostIntegration().
|
overridevirtual |
Post-integration hook.
snapshot | Current simulation snapshot. |
cvmanager | Collective variable manager. |
Implements SSAGES::ForwardFlux.
Definition at line 32 of file DirectForwardFlux.cpp.
References SSAGES::ForwardFlux::_initialFluxFlag, CheckForInterfaceCrossings(), SSAGES::ForwardFlux::CheckInitialStructure(), SSAGES::ForwardFlux::ComputeInitialFlux(), SSAGES::Method::cvmask_, SSAGES::CVManager::GetCVs(), InitializeQueue(), SSAGES::ForwardFlux::initializeQueueFlag, SSAGES::ForwardFlux::iteration_, and SSAGES::ForwardFlux::PrintQueue().