#include <LinkedListCube.h>
Public Member Functions | |
LinkedListCube () | |
~LinkedListCube () | |
int | alloc (int N_x, int N_y, int N_z, int max_num_nodes_in_pool) |
int | alloc_dual (int N_x, int N_y, int N_z, int max_num_nodes_in_pool) |
int | add_to_pool (T *t) |
int | add_to_pool_dual (T *t) |
LinkedListNode< T > * | get_from_pool (int i) |
void | clear () |
void | clear_layer (int l) |
void | clear_shadow_layer () |
int | add_node_to_stack (int i, int x, int y, int z) |
int | add_node_to_stack_shadow (int i, int x, int y, int z) |
LinkedListNode< T > * | get_top_of_stack (int x, int y, int z) |
int | get_pool_size () |
void | get_dim (int *Nx, int *Ny, int *Nz) |
int | safely_swap_layers () |
void | allow_swapping () |
void | forbid_swapping () |
Protected Member Functions | |
void | swap_layers () |
Protected Attributes | |
int | N_x |
int | N_y |
int | N_z |
int | max_num_nodes_in_pool |
int | num_nodes_in_pool |
LinkedListNode< T > ** | root1 |
LinkedListNode< T > ** | root2 |
LinkedListNode< T > ** | root |
LinkedListNode< T > ** | root_shadow |
LinkedListNode< T > * | pool1 |
LinkedListNode< T > * | pool2 |
LinkedListNode< T > * | pool |
LinkedListNode< T > * | pool_shadow |
int | active_layer |
int | shadow_layer |
bool | can_swap |
Private Member Functions | |
void | pbc (int *x, int *y, int *z) |
Private Attributes | |
int | add_index |
LinkedListCube< T >::LinkedListCube | ( | ) |
Constructor
LinkedListCube< T >::~LinkedListCube | ( | ) |
Destructor
int LinkedListCube< T >::add_node_to_stack | ( | int | i, |
int | x, | ||
int | y, | ||
int | z | ||
) |
Adds the specified pool node to the stack at index (x, y, z) on the grid. Does this by setting the current top of stack node to be the 'next' in the list after node i, with node i becoming the new top of stack node on that cell;
Referenced by PreComp_solver::build_pc_nearest_neighbour_lookup().
int LinkedListCube< T >::add_node_to_stack_shadow | ( | int | i, |
int | x, | ||
int | y, | ||
int | z | ||
) |
int LinkedListCube< T >::add_to_pool | ( | T * | t | ) |
Adds the specified T object to the pool (at the index given by add_index)
Referenced by PreComp_solver::init(), and World::init().
int LinkedListCube< T >::add_to_pool_dual | ( | T * | t | ) |
Adds the specified T object to the pool (at the index given by add_index)
Referenced by PreComp_solver::init(), and World::init().
int LinkedListCube< T >::alloc | ( | int | N_x, |
int | N_y, | ||
int | N_z, | ||
int | max_num_nodes_in_pool | ||
) |
Builds a LinkedListCube of dimensions N_x x N_y x N_z, and an array of LinkedListNodes of size max_num_nodes_in_pool
Referenced by PreComp_solver::init(), and World::init().
int LinkedListCube< T >::alloc_dual | ( | int | N_x, |
int | N_y, | ||
int | N_z, | ||
int | max_num_nodes_in_pool | ||
) |
Builds 2 layers of LinkedListCubes of dimensions N_x x N_y x N_z, a and an dual array of LinkedListNodes of size max_num_nodes_in_pool
Referenced by PreComp_solver::init(), and World::init().
void LinkedListCube< T >::allow_swapping | ( | ) |
Referenced by PreComp_solver::prebuild_pc_nearest_neighbour_lookup().
void LinkedListCube< T >::clear | ( | ) |
Completely clears entire grid of all linked lists by setting all pointers to NULL in root, and all 'next' pointers to NULL in the pool of LinkedListNodes.
Referenced by PreComp_solver::build_pc_nearest_neighbour_lookup().
void LinkedListCube< T >::clear_layer | ( | int | l | ) |
void LinkedListCube< T >::clear_shadow_layer | ( | ) |
void LinkedListCube< T >::forbid_swapping | ( | ) |
Referenced by PreComp_solver::prebuild_pc_nearest_neighbour_lookup().
void LinkedListCube< T >::get_dim | ( | int * | Nx, |
int * | Ny, | ||
int * | Nz | ||
) |
Referenced by VdW_solver::solve_sticky_wall().
LinkedListNode<T>* LinkedListCube< T >::get_from_pool | ( | int | i | ) |
Returns pointer to ith object in the pool
Referenced by BEM_Poisson_Boltzmann::build_BEM_matrices(), VdW_solver::solve(), PreComp_solver::solve_using_neighbours(), and PreComp_solver::solve_using_neighbours_non_critical().
int LinkedListCube< T >::get_pool_size | ( | ) |
Returns how many objects are in the 'pool'
Referenced by BEM_Poisson_Boltzmann::init(), PreComp_solver::init(), and VdW_solver::solve().
LinkedListNode<T>* LinkedListCube< T >::get_top_of_stack | ( | int | x, |
int | y, | ||
int | z | ||
) |
Returns whatever node is at the top of the (linked list) stack in grid cell (x, y, z)
Referenced by BEM_Poisson_Boltzmann::perform_integrals_for_lookup_cell_relative(), BEM_Poisson_Boltzmann::perform_integrals_for_lookup_cell_self(), VdW_solver::solve(), VdW_solver::solve_sticky_wall(), PreComp_solver::solve_using_neighbours(), and PreComp_solver::solve_using_neighbours_non_critical().
|
private |
int LinkedListCube< T >::safely_swap_layers | ( | ) |
|
protected |
|
protected |
|
private |
The current index in the pool array at which nodes are to be added
|
protected |
|
protected |
The number of linked list nodes available for stacking
|
protected |
The cube has dimensions N_x x N_y x N_z
|
protected |
|
protected |
|
protected |
The number of nodes in use
|
protected |
|
protected |
A "pool" of LinkedListNodes available for stacking on the various stacks in the cube
|
protected |
|
protected |
|
protected |
|
protected |
A cubic grid of pointers
|
protected |
|
protected |
|
protected |