PreComp_solver Class Reference

#include <PreComp_solver.h>

Public Member Functions

 PreComp_solver ()
 
 ~PreComp_solver ()
 destructor: deallocates pointers. More...
 
int init (PreComp_params *pc_params, SimulationParams *params, Blob **blob_array)
 Read input precomputed tables. More...
 
int solve (scalar *blob_corr=NULL)
 calculate the forces using a straightforward double loop. More...
 
int solve_using_neighbours ()
 calculate the forces using linkedlists. More...
 
int solve_using_neighbours_non_critical (scalar *blob_corr=NULL)
 using linkedlists, calculate twice the forces to avoid any critical regions. More...
 
void reset_fieldenergy ()
 
scalar 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 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 get_field_energy (int index0, int index1)
 
int compute_bead_positions ()
 calculate b_pos, the absolute positions of the beads. More...
 
int build_pc_nearest_neighbour_lookup ()
 put the beads on the grid. More...
 
int prebuild_pc_nearest_neighbour_lookup_and_swap ()
 put the beads on the grid. More...
 
int prebuild_pc_nearest_neighbour_lookup ()
 put the beads on the grid. More...
 
int safely_swap_pc_layers ()
 swap the two LinkedLists. More...
 
void write_beads_to_file (FILE *fout, int timestep)
 write beads to file, for the current timestep More...
 

Private Types

typedef tetra_element_linearTELPtr
 

Private Member Functions

int msg (string whatever)
 
int msg (int whatever)
 
int read_tabulated_values (PreComp_params &pc_params, string kind, scalar *Z, scalar scale_Z)
 
int calc_force_from_pot ()
 
scalar 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...
 

Private Attributes

int msgc
 
LinkedListCube< int > pcLookUp
 the linkedlist itself More...
 
scalar pcVoxelSize
 the size of the voxels. More...
 
int pcVoxelsInBox [3]
 num of voxels per side. More...
 
scalar Dx
 
scalar x_range [2]
 
scalar x_range2 [2]
 
int n_values
 
int nint
 
int ntypes
 
scalarU
 
scalarF
 
TELPtrb_elems
 
TELPtrb_unq_elems
 
int * b_types
 
int * map_e_to_b
 
int n_beads
 
int num_diff_elems
 
scalarb_rel_pos
 
scalarb_pos
 
scalarb_forces
 
int * b_daddyblob
 
bool * isPairActive
 
vector< string > stypes
 string types for the beads; sorry it is a c++ vector More...
 
int * b_elems_ndx
 array with the corresponding element index. More...
 
int * b_blob_ndx
 array with the corresponding blob index. More...
 
scalarfieldenergy
 
int num_blobs
 
int num_threads
 

Static Private Attributes

static const int adjacent_cells [27][3]
 

Member Typedef Documentation

◆ TELPtr

interacting elements

Field Documentation

◆ b_blob_ndx

int* PreComp_solver::b_blob_ndx
private

array with the corresponding blob index.

Referenced by init(), and write_beads_to_file().

◆ b_daddyblob

int* PreComp_solver::b_daddyblob
private

list of the daddy blob

Referenced by init(), solve(), and solve_using_neighbours_non_critical().

◆ b_elems

◆ b_elems_ndx

int* PreComp_solver::b_elems_ndx
private

array with the corresponding element index.

Referenced by init(), and write_beads_to_file().

◆ b_forces

scalar* PreComp_solver::b_forces
private

forces to be applied

Referenced by init(), and solve_using_neighbours_non_critical().

◆ b_pos

◆ b_rel_pos

scalar* PreComp_solver::b_rel_pos
private

relative position of the beads to the element they belong, xyzxyzxyz...

Referenced by compute_bead_positions(), init(), solve(), solve_using_neighbours(), and solve_using_neighbours_non_critical().

◆ b_types

◆ b_unq_elems

TELPtr* PreComp_solver::b_unq_elems
private

◆ Dx

scalar PreComp_solver::Dx
private

delta x in tabulated potentials and forces"

Referenced by calc_force_from_pot(), finterpolate(), init(), and read_tabulated_values().

◆ F

scalar* PreComp_solver::F
private

pointer to array containing all the values for all the pair forces.

Referenced by calc_force_from_pot(), get_F(), init(), PreComp_solver(), and ~PreComp_solver().

◆ fieldenergy

scalar* PreComp_solver::fieldenergy
private

Variables to store the energy field data between each pair of blobs

Referenced by get_field_energy(), init(), PreComp_solver(), reset_fieldenergy(), solve(), solve_using_neighbours(), solve_using_neighbours_non_critical(), and ~PreComp_solver().

◆ isPairActive

bool* PreComp_solver::isPairActive
private

bool "matrix" (array) storing for every pair if it is active or not

Referenced by init(), PreComp_solver(), read_tabulated_values(), solve(), solve_using_neighbours(), solve_using_neighbours_non_critical(), and ~PreComp_solver().

◆ map_e_to_b

int* PreComp_solver::map_e_to_b
private

map b_unq_elems to beads

Referenced by init(), and solve_using_neighbours_non_critical().

◆ msgc

int PreComp_solver::msgc
private

msgc and msg are helpful while developing

Referenced by msg(), and PreComp_solver().

◆ n_beads

◆ n_values

int PreComp_solver::n_values
private

number of pre-computed values per table

Referenced by calc_force_from_pot(), finterpolate(), init(), and read_tabulated_values().

◆ nint

int PreComp_solver::nint
private

total number of type interactions

Referenced by calc_force_from_pot(), init(), and PreComp_solver().

◆ ntypes

int PreComp_solver::ntypes
private

◆ num_blobs

◆ num_diff_elems

int PreComp_solver::num_diff_elems
private

number of different elements

Referenced by init(), and solve_using_neighbours_non_critical().

◆ num_threads

int PreComp_solver::num_threads
private

◆ pcLookUp

◆ pcVoxelsInBox

int PreComp_solver::pcVoxelsInBox[3]
private

num of voxels per side.

Referenced by init().

◆ pcVoxelSize

scalar PreComp_solver::pcVoxelSize
private

◆ stypes

vector<string> PreComp_solver::stypes
private

string types for the beads; sorry it is a c++ vector

variables stypes, b_elems_ndx, and b_blob_ndx will only be used if writing traj

Referenced by init(), and write_beads_to_file().

◆ U

scalar* PreComp_solver::U
private

pointer to array containing all the values for all the pair potentials.

Referenced by calc_force_from_pot(), get_U(), init(), PreComp_solver(), and ~PreComp_solver().

◆ x_range

scalar PreComp_solver::x_range[2]
private

x_range

Referenced by init(), and read_tabulated_values().

◆ x_range2

scalar PreComp_solver::x_range2[2]
private

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