#include <BoxCollection.hpp>
Public Member Functions | |
BoxCollection (double boxWidth, c_vector< double, 2 *DIM > domainSize) | |
unsigned | CalculateContainingBox (Node< DIM > *pNode) |
unsigned | CalculateContainingBox (c_vector< double, DIM > &rLocation) |
Box< DIM > & | rGetBox (unsigned boxIndex) |
unsigned | GetNumBoxes () |
void | SetupLocalBoxesHalfOnly () |
void | SetupAllLocalBoxes () |
std::set< unsigned > | GetLocalBoxes (unsigned boxIndex) |
void | CalculateNodePairs (std::vector< Node< DIM > * > &rNodes, std::set< std::pair< Node< DIM > *, Node< DIM > * > > &rNodePairs) |
Private Attributes | |
std::vector< Box< DIM > > | mBoxes |
c_vector< double, 2 *DIM > | mDomainSize |
double | mBoxWidth |
c_vector< unsigned, DIM > | mNumBoxesEachDirection |
std::vector< std::set< unsigned > > | mLocalBoxes |
A collection of 'boxes' partitioning the domain with information on which nodes are located in which box Not archived - in cell_based constructed in NodeBasedTissue constructor.
Definition at line 95 of file BoxCollection.hpp.
BoxCollection< DIM >::BoxCollection | ( | double | boxWidth, | |
c_vector< double, 2 *DIM > | domainSize | |||
) | [inline] |
Constructor
boxWidth | the width of each box (cut-off length in NodeBasedTissue cancer simulations) | |
domainSize | the size of the domain, in the form (xmin, xmax, ymin, ymax) (etc) |
Definition at line 84 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes, and BoxCollection< DIM >::mNumBoxesEachDirection.
unsigned BoxCollection< DIM >::CalculateContainingBox | ( | c_vector< double, DIM > & | rLocation | ) | [inline] |
Calculate which box a point is contained in
rLocation | The point |
Definition at line 168 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes, BoxCollection< DIM >::mBoxWidth, BoxCollection< DIM >::mDomainSize, and BoxCollection< DIM >::mNumBoxesEachDirection.
unsigned BoxCollection< DIM >::CalculateContainingBox | ( | Node< DIM > * | pNode | ) | [inline] |
Calculate which box this node is contained in.
pNode | address of the node |
Definition at line 159 of file BoxCollection.cpp.
References Node< SPACE_DIM >::rGetLocation().
Referenced by BoxCollection< DIM >::CalculateNodePairs().
void BoxCollection< DIM >::CalculateNodePairs | ( | std::vector< Node< DIM > * > & | rNodes, | |
std::set< std::pair< Node< DIM > *, Node< DIM > * > > & | rNodePairs | |||
) | [inline] |
Compute all the pairs of (potentially) connected nodes for cell_based simulations, ie nodes which are in a local box to the box containing the first node. **Note: the user still has to check that the node pairs are less than the cut-off distance apart.** The pairs are checked so that index1 < index2, so each connected pair of nodes is only in the set once.
rNodes | all the nodes to be consider | |
rNodePairs | the return value, a set of pairs of nodes |
Definition at line 682 of file BoxCollection.cpp.
References BoxCollection< DIM >::CalculateContainingBox(), BoxCollection< DIM >::GetLocalBoxes(), and BoxCollection< DIM >::mBoxes.
std::set< unsigned > BoxCollection< DIM >::GetLocalBoxes | ( | unsigned | boxIndex | ) | [inline] |
Get the set of all the local boxes, i.e. itself and its nearest-neighbours.
boxIndex | the index of the box |
Definition at line 675 of file BoxCollection.cpp.
References BoxCollection< DIM >::mLocalBoxes.
Referenced by BoxCollection< DIM >::CalculateNodePairs().
unsigned BoxCollection< DIM >::GetNumBoxes | ( | ) | [inline] |
Get the number of boxes.
Definition at line 212 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes.
Box< DIM > & BoxCollection< DIM >::rGetBox | ( | unsigned | boxIndex | ) | [inline] |
Get a box.
boxIndex | the index of the box to return |
Definition at line 205 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes.
void BoxCollection< DIM >::SetupAllLocalBoxes | ( | ) | [inline] |
Set up the local boxes (ie itself and its nearest-neighbours) for each of the boxes.
Definition at line 383 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes, BoxCollection< DIM >::mLocalBoxes, and BoxCollection< DIM >::mNumBoxesEachDirection.
void BoxCollection< DIM >::SetupLocalBoxesHalfOnly | ( | ) | [inline] |
Set up the local boxes (ie itself and its nearest-neighbours) for each of the boxes. Just set up half of the local boxes (for example, in 1D, local boxes for box0 = {1} local boxes for box1 = {2} not {0,2}, and so on. Similar to 2d, 3d.
Definition at line 218 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes, BoxCollection< DIM >::mLocalBoxes, and BoxCollection< DIM >::mNumBoxesEachDirection.
std::vector< Box<DIM> > BoxCollection< DIM >::mBoxes [private] |
A vector of boxes to store rough node/element positions.
Definition at line 99 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::BoxCollection(), BoxCollection< DIM >::CalculateContainingBox(), BoxCollection< DIM >::CalculateNodePairs(), BoxCollection< DIM >::GetNumBoxes(), BoxCollection< DIM >::rGetBox(), BoxCollection< DIM >::SetupAllLocalBoxes(), and BoxCollection< DIM >::SetupLocalBoxesHalfOnly().
double BoxCollection< DIM >::mBoxWidth [private] |
The width of each box.
Definition at line 105 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::CalculateContainingBox().
c_vector<double, 2*DIM> BoxCollection< DIM >::mDomainSize [private] |
The domain being partitioned.
Definition at line 102 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::CalculateContainingBox().
std::vector< std::set<unsigned> > BoxCollection< DIM >::mLocalBoxes [private] |
The boxes local (itself and nearest neighbour) to a given box.
Definition at line 111 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::GetLocalBoxes(), BoxCollection< DIM >::SetupAllLocalBoxes(), and BoxCollection< DIM >::SetupLocalBoxesHalfOnly().
c_vector<unsigned, DIM> BoxCollection< DIM >::mNumBoxesEachDirection [private] |
Number of boxes in each direction.
Definition at line 108 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::BoxCollection(), BoxCollection< DIM >::CalculateContainingBox(), BoxCollection< DIM >::SetupAllLocalBoxes(), and BoxCollection< DIM >::SetupLocalBoxesHalfOnly().