Functions | |
vector< int > | Blob::get_bead_assignment (int i) |
returns the list of nodes where bead i should be assigned to. More... | |
void | Blob::get_bead_position (int i, arr3 &v) |
returns the position of bead i. More... | |
int * | Blob::get_bead_type_ptr () |
returns the bead_type pointer. More... | |
int | Blob::get_bead_type (int i) |
returns the bead_type of bead i. More... | |
int | Blob::load_beads (const char *beads_filename, PreComp_params *pc_params, scalar scale) |
Read the beads_filename, loading beads position and types. More... | |
int | Blob::forget_beads () |
num_beads = 0; delete bead_type; delete bead_position. More... | |
PreComp_solver::PreComp_solver () | |
PreComp_solver::~PreComp_solver () | |
destructor: deallocates pointers. More... | |
int | PreComp_solver::msg (int whatever) |
int | PreComp_solver::msg (string whatever) |
void | PreComp_solver::reset_fieldenergy () |
int | PreComp_solver::init (PreComp_params *pc_params, SimulationParams *params, Blob **blob_array) |
Read input precomputed tables. More... | |
int | PreComp_solver::solve_using_neighbours_non_critical (scalar *blob_corr=NULL) |
using linkedlists, calculate twice the forces to avoid any critical regions. More... | |
int | PreComp_solver::solve_using_neighbours () |
calculate the forces using linkedlists. More... | |
int | PreComp_solver::solve (scalar *blob_corr=NULL) |
calculate the forces using a straightforward double loop. More... | |
int | PreComp_solver::compute_bead_positions () |
calculate b_pos, the absolute positions of the beads. More... | |
int | PreComp_solver::calc_force_from_pot () |
int | PreComp_solver::read_tabulated_values (PreComp_params &pc_params, string kind, scalar *Z, scalar scale_Z) |
scalar | PreComp_solver::get_U (scalar x, int typei, int typej) |
Use finterpolate to return the value for U at x between types i and j. More... | |
scalar | PreComp_solver::get_F (scalar x, int typei, int typej) |
Use finterpolate to return the value for F at x between types i and j. More... | |
scalar | PreComp_solver::finterpolate (scalar *Z, scalar x, int typei, int typej) |
Get the value Z value (either U or F) at x between types typei and typej. More... | |
scalar | PreComp_solver::get_field_energy (int index0, int index1) |
int | PreComp_solver::build_pc_nearest_neighbour_lookup () |
put the beads on the grid. More... | |
int | PreComp_solver::prebuild_pc_nearest_neighbour_lookup_and_swap () |
put the beads on the grid. More... | |
int | PreComp_solver::prebuild_pc_nearest_neighbour_lookup () |
put the beads on the grid. More... | |
int | PreComp_solver::safely_swap_pc_layers () |
swap the two LinkedLists. More... | |
void | PreComp_solver::write_beads_to_file (FILE *fout, int timestep) |
write beads to file, for the current timestep More... | |
Variables | |
static const int | PreComp_solver::adjacent_cells [27][3] |
int PreComp_solver::build_pc_nearest_neighbour_lookup | ( | ) |
put the beads on the grid.
Referenced by World::run().
|
private |
Calculate F as the numerical derivative of U, instead of reading .force files
[in] | int | total_int: total number of different interactions. |
Referenced by PreComp_solver::init().
int PreComp_solver::compute_bead_positions | ( | ) |
calculate b_pos, the absolute positions of the beads.
Referenced by World::init(), PreComp_solver::solve(), PreComp_solver::solve_using_neighbours(), and PreComp_solver::solve_using_neighbours_non_critical().
Get the value Z value (either U or F) at x between types typei and typej.
The function is currently private and accessed through get_U and get_F. For production purposes it may be reasonable to move it to public, and remove get_U and get_F
Referenced by PreComp_solver::get_F(), and PreComp_solver::get_U().
int Blob::forget_beads | ( | ) |
num_beads = 0; delete bead_type; delete bead_position.
Beads are only useful before PreComp_solver.init is called. They can be removed later on.
Beads are only useful before PreComp_solver.init is called.
Referenced by PreComp_solver::init().
vector< int > Blob::get_bead_assignment | ( | int | i | ) |
returns the list of nodes where bead i should be assigned to.
Referenced by PreComp_solver::init().
void Blob::get_bead_position | ( | int | i, |
arr3 & | v | ||
) |
returns the position of bead i.
get_bead_position i onto arr3 v [precomp]
Referenced by PreComp_solver::init().
int Blob::get_bead_type | ( | int | i | ) |
returns the bead_type of bead i.
get_bead_type [precomp]
int * Blob::get_bead_type_ptr | ( | ) |
returns the bead_type pointer.
get the pointer to "bead_type" [precomp]
Use finterpolate to return the value for F at x between types i and j.
Compute (through finterpolate) the value of the potential at x between bead types typei and typej. Kept just for clarity, may be removed in the future.
Referenced by PreComp_solver::solve(), PreComp_solver::solve_using_neighbours(), and PreComp_solver::solve_using_neighbours_non_critical().
scalar PreComp_solver::get_field_energy | ( | int | index0, |
int | index1 | ||
) |
Referenced by World::make_measurements(), and World::write_detailed_measurements_to_file().
Use finterpolate to return the value for U at x between types i and j.
Compute (through finterpolate) the value of the potential at x between bead types typei and typej. Kept just for clarity, may be removed in the future.
Referenced by PreComp_solver::solve(), PreComp_solver::solve_using_neighbours(), and PreComp_solver::solve_using_neighbours_non_critical().
int PreComp_solver::init | ( | PreComp_params * | pc_params, |
SimulationParams * | params, | ||
Blob ** | blob_array | ||
) |
Read input precomputed tables.
[in] | vector<string> | types: types of beads present. |
[in] | int | inputData: 1 means read .force and .pot files, while 2 means read .pot and calculate the forces |
read <type_i>-<type_j>.force and <type_i>-<type_j>.pot files for all the possible pairs, setting up the potential functions. All the .pot and .force files need to have the same x_range same Dx, and same number of points. It is allowed, however, that they have a different number of lines at the beginning starting with "#".
Referenced by World::init().
|
private |
Read the beads_filename, loading beads position and types.
Opens and reads the given 'ffea beads file', extracting all the beads types and positions and for this Blob.
Referenced by Blob::init().
|
private |
Referenced by PreComp_solver::init(), and PreComp_solver::read_tabulated_values().
|
private |
int PreComp_solver::prebuild_pc_nearest_neighbour_lookup | ( | ) |
put the beads on the grid.
Referenced by World::init(), and World::run().
int PreComp_solver::prebuild_pc_nearest_neighbour_lookup_and_swap | ( | ) |
put the beads on the grid.
PreComp_solver::PreComp_solver | ( | ) |
|
private |
Read either the .pot or .force files and store its contents either in U or F
Referenced by PreComp_solver::init().
void PreComp_solver::reset_fieldenergy | ( | ) |
Zero measurement stuff, AKA fieldenergy
Referenced by PreComp_solver::solve(), PreComp_solver::solve_using_neighbours(), and PreComp_solver::solve_using_neighbours_non_critical().
int PreComp_solver::safely_swap_pc_layers | ( | ) |
swap the two LinkedLists.
Referenced by World::die_with_dignity().
int PreComp_solver::solve | ( | scalar * | blob_corr = NULL | ) |
calculate the forces using a straightforward double loop.
int PreComp_solver::solve_using_neighbours | ( | ) |
calculate the forces using linkedlists.
int PreComp_solver::solve_using_neighbours_non_critical | ( | scalar * | blob_corr = NULL | ) |
using linkedlists, calculate twice the forces to avoid any critical regions.
Referenced by World::run().
void PreComp_solver::write_beads_to_file | ( | FILE * | fout, |
int | timestep | ||
) |
write beads to file, for the current timestep
Referenced by World::print_trajectory_and_measurement_files().
PreComp_solver::~PreComp_solver | ( | ) |
destructor: deallocates pointers.
|
staticprivate |
Referenced by PreComp_solver::solve_using_neighbours(), and PreComp_solver::solve_using_neighbours_non_critical().