#include <World.h>
Public Member Functions | |
World () | |
~World () | |
int | init (string FFEA_script_filename, int frames_to_delete, int mode, bool writeEnergy) |
Reads the .ffea file and initialises the World. More... | |
int | get_smallest_time_constants () |
Finds the largest allowed timesteps. More... | |
int | lem (set< int > blob_indices, int num_modes) |
Calculates an linear elastic model for a given blob. More... | |
int | dmm (set< int > blob_indices, int num_modes) |
Calculates an dynamic mode model for a given blob. More... | |
int | dmm_rp (set< int > blob_indices, int num_modes) |
Calculates an elastic network model for a given blob. More... | |
int | run () |
int | read_and_build_system (vector< string > script_vector) |
Parses <blobs>, <springs>, <rods> and <precomp>. More... | |
int | load_kinetic_maps (vector< string > map_fnames, vector< int > map_from, vector< int > map_to, int blob_index) |
Loads the maps from a given blob. More... | |
int | build_kinetic_identity_maps () |
Builds additional maps for energy calculations. More... | |
int | load_kinetic_states (string states_fname, int blob_index) |
int | load_kinetic_rates (string rates_fname, int blob_index) |
void | print_kinetic_rates_to_screen (int type) |
void | get_system_CoM (vector3 *system_CoM) |
void | get_system_centroid (vector3 *centroid) |
void | get_system_dimensions (vector3 *dimenstion_vector) |
int | enm (int *blob_index, int num_modes) |
int | get_num_blobs () |
Private Member Functions | |
int | load_springs (const char *fname) |
rod::Rod_blob_interface * | rod_blob_interface_from_block (vector< string > block, int interface_id, FFEA_input_reader *systemreader, rod::Rod **rod_array, Blob **blob_array) |
rod::Rod * | rod_from_block (vector< string > block, int block_id, FFEA_input_reader *systemreader) |
void | activate_springs () |
int | apply_springs () |
scalar | get_spring_field_energy (int index0, int index1) |
int | calculate_kinetic_rates () |
calculates the kinetic rates as a function of the energy of the system More... | |
int | choose_new_kinetic_state (int blob_index, int *target) |
randomly chooses a new kinetic state based upon the kinetic rates / switching probabilitie More... | |
int | change_kinetic_state (int blob_index, int target_state) |
changes the kinetic state based upon the kinetic rates. Maps between conformations and adds/ removes bound sites More... | |
int | get_next_script_tag (FILE *in, char *buf) |
void | apply_dense_matrix (scalar *y, scalar *M, scalar *x, int N) |
void | do_es () |
void | make_trajectory_from_eigenvector (string traj_out_fname, int blob_index, int mode_index, Eigen_VectorX evec, scalar step) |
Calculates a pseudo-trajectory by varying an eigenvector by a constant factor. More... | |
void | print_evecs_to_file (string fname, Eigen_MatrixX ev, int num_rows, int num_modes) |
void | print_evals_to_file (string fname, Eigen_VectorX ev, int num_modes, scalar scale) |
void | write_eig_to_files (scalar *evals_ordered, scalar **evecs_ordered, int num_modes, int num_nodes) |
Writes eigensystems to files in order. More... | |
void | write_output_header (FILE *fout, string fname) |
void | print_trajectory_and_measurement_files (int step, scalar wtime) |
void | print_checkpoints () |
void | write_pre_print_to_trajfile (int step) |
void | do_nothing () |
int | prebuild_nearest_neighbour_lookup_wrapper (scalar cell_size) |
void | make_measurements () |
void | write_measurements_to_file (FILE *fout, int step) |
void | write_detailed_measurements_to_file (FILE *fout) |
void | print_trajectory_conformation_changes (FILE *fout, int step, int *from_index, int *to_index) |
void | print_kinetic_files (int step) |
void | print_static_trajectory (int step, scalar wtime, int blob_index) |
void | calc_blob_corr_matrix (int num_blobs, scalar *blob_corr) |
calculates the blob to blob corrections due to periodic boundary conditions More... | |
int | die_with_dignity (int step, scalar wtime) |
Private Attributes | |
Blob ** | blob_array |
2-D Array of Blob objects (blob i, conformation j) More... | |
Blob ** | active_blob_array |
Which conformation is active in each blob. More... | |
rod::Rod ** | rod_array |
1-D array containing pointers to all rod objects More... | |
rod::Rod_blob_interface ** | rod_blob_interface_array |
1-D array containing pointers to all rod-blob interfaces More... | |
SparseMatrixFixedPattern *** | kinetic_map |
Maps for kinetic switching of conformations. More... | |
SparseMatrixFixedPattern **** | kinetic_return_map |
Spring * | spring_array |
An array of springs which connect nodes if necessary. More... | |
int | num_springs |
And how many springs are there? More... | |
int | num_binding_sites |
How many kinetic binding sites are there? More... | |
bool | mass_in_system |
Check whether mass is present anywhere, to determine whether or not to write kinetic energies to files. More... | |
int | num_threads |
How many threads are available for parallelisation. More... | |
RngStream * | rng |
An array of pointers to random number generators (for use in parallel) More... | |
unsigned long ** | Seeds |
A pointer to an array of arrays, containing the seeds of the different RNGStreams. More... | |
int | num_seeds |
The number of seeds stored in Seeds. More... | |
RngStream * | kinetic_rng |
An array of pointers to random number generators for use in kinetics. More... | |
SimulationParams | params |
Parameters being used for this simulation. More... | |
NearestNeighbourLinkedListCube | lookup |
Data structure keeping track of which `cell' each face lies in (where the world has been discretised into a grid of cells of dimension 1.5 kappa) so that the BEM matrices may be constructed quickly and sparsely. More... | |
FILE * | trajectory_out |
Output trajectory file. More... | |
FILE * | kinetics_out |
Output kinetics file. More... | |
FILE * | measurement_out |
Output measurement file. More... | |
bool | writeDetailed |
Output detailed measurements file. May be unneccesary. More... | |
FILE * | detailed_meas_out |
FILE * | trajbeads_out |
Output file for the trajectory beads. Completely optional. More... | |
FFEA_input_reader * | ffeareader |
FFEA_input_reader * | systemreader |
vector3 | L |
FILE * | checkpoint_out |
| |
BEM_Poisson_Boltzmann | PB_solver |
BEM solver for the exterior electrostatics. More... | |
int | total_num_surface_faces |
Number of surface faces in entire system. More... | |
scalar * | phi_Gamma |
Vector of the electrostatic potential on each surface in entire system. More... | |
scalar * | J_Gamma |
scalar * | work_vec |
BiCGSTAB_solver | nonsymmetric_solver |
Biconjugate gradient stabilised solver for nonsymmetric matrices. More... | |
VdW_solver * | vdw_solver |
SSINT_matrix | ssint_matrix |
LJ parameters matrix. More... | |
BindingSite_matrix | binding_matrix |
Binding Interactions matrix. More... | |
PreComp_params | pc_params |
stores info within the <precomp> block at the .ffea file. More... | |
PreComp_solver | pc_solver |
PreComputed potentials solver. More... | |
vector3 | box_dim |
long long | step_initial |
scalar * | blob_corr |
KineticState ** | kinetic_state |
Kinetic State and Rate objects. More... | |
scalar *** | kinetic_rate |
scalar *** | kinetic_base_rate |
scalar | kineticenergy |
scalar | strainenergy |
scalar | springenergy |
scalar ** | springfieldenergy |
scalar | ssintenergy |
scalar | preCompenergy |
vector3 | CoM |
vector3 | CoG |
scalar | rmsd |
Friends | |
struct | ffea_test |
World::World | ( | ) |
World::~World | ( | ) |
|
private |
Referenced by change_kinetic_state(), and load_springs().
|
private |
Referenced by run().
int World::build_kinetic_identity_maps | ( | ) |
Builds additional maps for energy calculations.
This function uses the existing kinetic maps to build 'return_maps', which are used for energy calculations and comparisons
Referenced by read_and_build_system().
|
private |
calculates the blob to blob corrections due to periodic boundary conditions
Referenced by run().
|
private |
calculates the kinetic rates as a function of the energy of the system
Calculates kinetic rates based upon the current state of the blob.
This function alters the given kinetic_rates using the energy of the system. The average rate throughout the simulation should still be the given values.
Referenced by run().
|
private |
changes the kinetic state based upon the kinetic rates. Maps between conformations and adds/ removes bound sites
Changes the active kinetic state for a given blob.
[in] | int | blob_index Index of the blob to be changed |
[in] | int | target_state State the blob should be changed to |
This function changes the kinetic state of the blob. For a conformational change, the current structure is mapped to the target and the active_blob_array[i] pointer is updated. For a binding / unbinding event, the binding sites are activated.
Referenced by run().
|
private |
randomly chooses a new kinetic state based upon the kinetic rates / switching probabilitie
Selects a new states based on the current kinetic rates.
[in] | int | blob_index Which blob wants to switch |
[in] | int | *target A list of potential states |
This function randomly chooses a state to switch to out of the given allowed taget states based upon the current kinetic rates.
Referenced by run().
int World::dmm | ( | set< int > | blob_indices, |
int | num_modes | ||
) |
Calculates an dynamic mode model for a given blob.
[in] | set<int> | List of blobs to get Dynamic Mode Model |
[in] | int | num_modes The number of modes / eigenvalues to be calculated |
By linearising the elasticity vector around the initial position, this function performs matrix algebra using the Eigen libraries to diagonalise the coupling between the elasticity and viscosity matrices, and outputs pseudo-trajectories based upon these eigenvectors
Referenced by main().
int World::dmm_rp | ( | set< int > | blob_indices, |
int | num_modes | ||
) |
Calculates an elastic network model for a given blob.
[in] | set<int> | List of blobs to get Elastic Network Model |
[in] | int | num_modes The number of modes / eigenvalues to be calculated |
By linearising the elasticity vector around the initial position, this function performs matrix algebra using the Eigen libraries to diagonalise the coupling between the elasticity and rotne-praga viscosity matrices, and outputs pseudo-trajectories based upon these eigenvectors
Referenced by main().
|
private |
Referenced by run().
|
private |
Referenced by init().
int World::enm | ( | int * | blob_index, |
int | num_modes | ||
) |
|
private |
int World::get_num_blobs | ( | ) |
Referenced by main().
int World::get_smallest_time_constants | ( | ) |
Finds the largest allowed timesteps.
By linearising the equation of motion, this function performs matrix algebra using the Eigen libraries to find the largest allowed timestep for ffea numerical integration.
Referenced by main().
|
private |
Referenced by make_measurements(), and write_detailed_measurements_to_file().
void World::get_system_centroid | ( | vector3 * | centroid | ) |
void World::get_system_CoM | ( | vector3 * | system_CoM | ) |
int World::init | ( | string | FFEA_script_filename, |
int | frames_to_delete, | ||
int | mode, | ||
bool | writeDetail | ||
) |
Reads the .ffea file and initialises the World.
[in] | string | FFEA_script_filename |
Open and read .ffea file, parse the block through SimulationParams::extract_params in the "SimulationParams params" private attribute, parse the <blobs> and <springs> blocks through World::read_and_build_system initialise a number of RNG, prepare output files, initialise VdW solver, initialise BEM PBE solver
Referenced by ffea_test::connection_energy(), ffea_test::connection_energy_2(), ffea_test::connection_energy_3(), ffea_test::connection_orientation_test(), ffea_test::connection_propagation(), ffea_test::connection_test(), ffea_test::identify_face(), load_kinetic_states(), ffea_test::lower_sphere(), main(), read_and_build_system(), and ffea_test::recover_normal().
int World::lem | ( | set< int > | blob_indices, |
int | num_modes | ||
) |
Calculates an linear elastic model for a given blob.
[in] | set<int> | List of blobs to get Linear Elastic Model |
[in] | int | num_modes The number of modes / eigenvalues to be calculated |
By linearising the elasticity vector around the initial position, this function performs matrix algebra using the Eigen libraries to diagonalise elasticity matrix and output pseudo-trajectories based upon these eigenvectors
Referenced by main().
int World::load_kinetic_maps | ( | vector< string > | map_fnames, |
vector< int > | map_from, | ||
vector< int > | map_to, | ||
int | blob_index | ||
) |
Loads the maps from a given blob.
[in] | vector<string> | map_fnames A vector of maps to load |
[in] | vector<int> | map_from Which conformation the maps are from |
[in] | vector<int> | map_to Which conformation the maps go to |
[in] | int | blob_index Which blob the maps belong to |
This function reads in the maps required for kinetic switching between conformations. Does no error checking for correct number of maps
Referenced by read_and_build_system().
int World::load_kinetic_rates | ( | string | rates_fname, |
int | blob_index | ||
) |
Referenced by read_and_build_system().
int World::load_kinetic_states | ( | string | states_fname, |
int | blob_index | ||
) |
Referenced by read_and_build_system().
|
private |
Referenced by read_and_build_system().
|
private |
Referenced by print_trajectory_and_measurement_files().
|
private |
|
private |
Referenced by die_with_dignity(), init(), and run().
|
private |
Print the RNG values responsible for the current state of the system i.e. do this before all forces are calculated, which advances the system
Referenced by run().
|
private |
|
private |
|
private |
Referenced by die_with_dignity(), and run().
void World::print_kinetic_rates_to_screen | ( | int | type | ) |
|
private |
|
private |
Write trajectory for each blob, then do blob specific measurements (which are needed for globals, but only explicitly printed if "-d" was used)
Referenced by ffea_test::connection_energy(), ffea_test::connection_orientation_test(), die_with_dignity(), ffea_test::identify_face(), and run().
|
private |
Referenced by make_trajectory_from_eigenvector().
int World::read_and_build_system | ( | vector< string > | script_vector | ) |
Parses <blobs>, <springs>, <rods> and <precomp>.
[in] | vector<string> | script_vector, which is essentially the FFEA input file, line by line, as it comes out of FFEA_input_reader::file_to_lines |
Referenced by init().
|
private |
Referenced by read_and_build_system().
|
private |
Referenced by read_and_build_system().
int World::run | ( | ) |
Update entire World for num_steps time steps
Referenced by ffea_test::connection_energy_3(), ffea_test::connection_propagation(), ffea_test::lower_sphere(), and main().
|
private |
Referenced by print_trajectory_and_measurement_files().
|
private |
Writes eigensystems to files in order.
This function writes the eigenvalues calculated for enms and dmms to files
|
private |
Referenced by print_trajectory_and_measurement_files().
|
private |
Referenced by init().
|
private |
Referenced by print_trajectory_and_measurement_files().
|
friend |
|
private |
Which conformation is active in each blob.
Referenced by activate_springs(), apply_springs(), calc_blob_corr_matrix(), calculate_kinetic_rates(), change_kinetic_state(), choose_new_kinetic_state(), dmm(), dmm_rp(), do_es(), get_smallest_time_constants(), get_system_centroid(), get_system_CoM(), get_system_dimensions(), init(), lem(), load_springs(), make_measurements(), make_trajectory_from_eigenvector(), print_kinetic_files(), print_static_trajectory(), print_trajectory_and_measurement_files(), print_trajectory_conformation_changes(), read_and_build_system(), run(), write_detailed_measurements_to_file(), write_pre_print_to_trajfile(), and ~World().
|
private |
Binding Interactions matrix.
Referenced by init(), load_kinetic_states(), and read_and_build_system().
|
private |
2-D Array of Blob objects (blob i, conformation j)
Referenced by change_kinetic_state(), init(), load_kinetic_maps(), load_springs(), ffea_test::lower_sphere(), read_and_build_system(), World(), and ~World().
|
private |
Referenced by read_and_build_system(), run(), World(), and ~World().
|
private |
Referenced by calc_blob_corr_matrix(), init(), run(), World(), and ~World().
|
private |
Referenced by init(), print_checkpoints(), World(), and ~World().
|
private |
Referenced by make_measurements(), World(), write_measurements_to_file(), and ~World().
|
private |
Referenced by init(), print_trajectory_and_measurement_files(), World(), write_detailed_measurements_to_file(), and ~World().
|
private |
|
private |
Referenced by calculate_kinetic_rates(), init(), load_kinetic_rates(), print_kinetic_rates_to_screen(), World(), and ~World().
|
private |
Maps for kinetic switching of conformations.
Referenced by build_kinetic_identity_maps(), change_kinetic_state(), init(), load_kinetic_maps(), World(), and ~World().
|
private |
Referenced by calculate_kinetic_rates(), choose_new_kinetic_state(), init(), load_kinetic_rates(), print_kinetic_rates_to_screen(), World(), and ~World().
|
private |
Referenced by build_kinetic_identity_maps(), init(), World(), and ~World().
|
private |
An array of pointers to random number generators for use in kinetics.
Referenced by choose_new_kinetic_state(), init(), and print_checkpoints().
|
private |
Kinetic State and Rate objects.
Referenced by calculate_kinetic_rates(), change_kinetic_state(), init(), load_kinetic_states(), World(), and ~World().
|
private |
Energies
Referenced by make_measurements(), World(), write_measurements_to_file(), and ~World().
|
private |
Output kinetics file.
Referenced by init(), print_kinetic_files(), World(), and ~World().
|
private |
Data structure keeping track of which `cell' each face lies in (where the world has been discretised into a grid of cells of dimension 1.5 kappa) so that the BEM matrices may be constructed quickly and sparsely.
Referenced by die_with_dignity(), init(), and run().
|
private |
Check whether mass is present anywhere, to determine whether or not to write kinetic energies to files.
Referenced by init(), read_and_build_system(), World(), write_measurements_to_file(), and ~World().
|
private |
Output measurement file.
Referenced by init(), print_trajectory_and_measurement_files(), World(), write_output_header(), and ~World().
|
private |
|
private |
How many kinetic binding sites are there?
|
private |
The number of seeds stored in Seeds.
Referenced by init(), print_checkpoints(), World(), and ~World().
|
private |
And how many springs are there?
Referenced by activate_springs(), apply_springs(), load_springs(), make_measurements(), World(), and ~World().
|
private |
How many threads are available for parallelisation.
Referenced by init(), print_checkpoints(), World(), and ~World().
|
private |
Parameters being used for this simulation.
Referenced by build_kinetic_identity_maps(), calculate_kinetic_rates(), choose_new_kinetic_state(), dmm(), dmm_rp(), do_es(), get_num_blobs(), get_smallest_time_constants(), get_spring_field_energy(), get_system_centroid(), get_system_CoM(), get_system_dimensions(), init(), lem(), load_kinetic_rates(), load_kinetic_states(), load_springs(), ffea_test::lower_sphere(), make_measurements(), print_checkpoints(), print_kinetic_files(), print_kinetic_rates_to_screen(), print_trajectory_and_measurement_files(), print_trajectory_conformation_changes(), read_and_build_system(), run(), write_detailed_measurements_to_file(), write_eig_to_files(), write_measurements_to_file(), write_pre_print_to_trajfile(), and ~World().
|
private |
|
private |
stores info within the <precomp> block at the .ffea file.
Referenced by init(), and read_and_build_system().
|
private |
PreComputed potentials solver.
Referenced by die_with_dignity(), init(), make_measurements(), print_trajectory_and_measurement_files(), run(), and write_detailed_measurements_to_file().
|
private |
|
private |
Referenced by make_measurements(), World(), write_measurements_to_file(), and ~World().
|
private |
Referenced by make_measurements(), World(), write_measurements_to_file(), and ~World().
|
private |
An array of pointers to random number generators (for use in parallel)
Referenced by ffea_test::connection_propagation(), init(), print_checkpoints(), read_and_build_system(), run(), World(), and ~World().
|
private |
1-D array containing pointers to all rod objects
Referenced by ffea_test::connection_propagation(), get_system_centroid(), get_system_dimensions(), init(), print_trajectory_and_measurement_files(), read_and_build_system(), run(), World(), and ~World().
|
private |
1-D array containing pointers to all rod-blob interfaces
Referenced by ffea_test::connection_energy(), ffea_test::connection_energy_2(), ffea_test::connection_energy_3(), ffea_test::connection_orientation_test(), ffea_test::connection_propagation(), ffea_test::connection_test(), ffea_test::identify_face(), init(), read_and_build_system(), ffea_test::recover_normal(), and run().
|
private |
A pointer to an array of arrays, containing the seeds of the different RNGStreams.
Referenced by init(), print_checkpoints(), World(), and ~World().
|
private |
An array of springs which connect nodes if necessary.
Referenced by activate_springs(), apply_springs(), load_springs(), make_measurements(), World(), and ~World().
|
private |
Referenced by make_measurements(), World(), write_measurements_to_file(), and ~World().
|
private |
Referenced by get_spring_field_energy(), load_springs(), make_measurements(), World(), and ~World().
|
private |
LJ parameters matrix.
Referenced by init(), and read_and_build_system().
|
private |
Referenced by make_measurements(), World(), write_measurements_to_file(), and ~World().
|
private |
Referenced by die_with_dignity(), init(), run(), World(), and ~World().
|
private |
Referenced by make_measurements(), World(), write_measurements_to_file(), and ~World().
|
private |
Referenced by read_and_build_system(), World(), and ~World().
|
private |
|
private |
Output file for the trajectory beads. Completely optional.
Referenced by init(), and print_trajectory_and_measurement_files().
|
private |
Output trajectory file.
Referenced by init(), print_static_trajectory(), print_trajectory_and_measurement_files(), World(), write_pre_print_to_trajfile(), and ~World().
|
private |
Van der Waals solver
Referenced by init(), make_measurements(), run(), World(), write_detailed_measurements_to_file(), and ~World().
|
private |