#include <NodeBoxCollection.hpp>
Public Member Functions | |
NodeBoxCollection (double cutOffLength, c_vector< double, 2 *DIM > domainSize) | |
unsigned | CalculateContainingBox (Node< DIM > *pNode) |
NodeBox< DIM > & | rGetBox (unsigned boxIndex) |
unsigned | GetNumBoxes () |
void | CalculateLocalBoxes () |
std::set< unsigned > | GetLocalBoxes (unsigned boxIndex) |
void | CalculateNodePairs (std::vector< Node< DIM > * > &rNodes, std::set< std::pair< Node< DIM > *, Node< DIM > * > > &rNodePairs) |
Private Member Functions | |
bool | IsBottomRow (unsigned boxIndex) |
bool | IsTopRow (unsigned boxIndex) |
bool | IsLeftColumn (unsigned boxIndex) |
bool | IsRightColumn (unsigned boxIndex) |
Private Attributes | |
std::vector< NodeBox< DIM > > | mBoxes |
c_vector< double, 2 *DIM > | mDomainSize |
double | mCutOffLength |
c_vector< unsigned, DIM > | mNumBoxesEachDirection |
std::vector< std::set< unsigned > > | mLocalBoxes |
not archived - constructed in NodeBasedTissue constructor.
Definition at line 86 of file NodeBoxCollection.hpp.
NodeBoxCollection< DIM >::NodeBoxCollection | ( | double | cutOffLength, | |
c_vector< double, 2 *DIM > | domainSize | |||
) | [inline] |
Constructor
cutOffLength | the width of each box (cutOffLength) | |
domainSize | the size of the domain, in the form (xmin, xmax, ymin, ymax) (etc) |
commented out as the 1d case is not tested or covered - do we really care about 1d? if so
Definition at line 72 of file NodeBoxCollection.cpp.
References NodeBoxCollection< DIM >::CalculateLocalBoxes(), NodeBoxCollection< DIM >::mBoxes, and NodeBoxCollection< DIM >::mNumBoxesEachDirection.
bool NodeBoxCollection< DIM >::IsBottomRow | ( | unsigned | boxIndex | ) | [inline, private] |
2D specific helper method - whether a box is on the bottom row of all the boxes.
boxIndex | the box index |
Definition at line 111 of file NodeBoxCollection.hpp.
References NodeBoxCollection< DIM >::mNumBoxesEachDirection.
Referenced by NodeBoxCollection< DIM >::CalculateLocalBoxes().
bool NodeBoxCollection< DIM >::IsTopRow | ( | unsigned | boxIndex | ) | [inline, private] |
2D specific helper methods - whether a box is on the top row of all the boxes.
boxIndex | the box index |
Definition at line 122 of file NodeBoxCollection.hpp.
References NodeBoxCollection< DIM >::mNumBoxesEachDirection.
Referenced by NodeBoxCollection< DIM >::CalculateLocalBoxes().
bool NodeBoxCollection< DIM >::IsLeftColumn | ( | unsigned | boxIndex | ) | [inline, private] |
2D specific helper methods - whether a box is on the left side of the boxes.
boxIndex | the box index |
Definition at line 133 of file NodeBoxCollection.hpp.
References NodeBoxCollection< DIM >::mNumBoxesEachDirection.
Referenced by NodeBoxCollection< DIM >::CalculateLocalBoxes().
bool NodeBoxCollection< DIM >::IsRightColumn | ( | unsigned | boxIndex | ) | [inline, private] |
2D specific helper methods - whether a box is on the right side of the boxes.
boxIndex | the box index |
Definition at line 144 of file NodeBoxCollection.hpp.
References NodeBoxCollection< DIM >::mBoxes, and NodeBoxCollection< DIM >::mNumBoxesEachDirection.
Referenced by NodeBoxCollection< DIM >::CalculateLocalBoxes().
unsigned NodeBoxCollection< DIM >::CalculateContainingBox | ( | Node< DIM > * | pNode | ) | [inline] |
Calculate which box this node is contained in.
pNode | address of the node |
Definition at line 134 of file NodeBoxCollection.cpp.
References NodeBoxCollection< DIM >::mBoxes, NodeBoxCollection< DIM >::mCutOffLength, NodeBoxCollection< DIM >::mDomainSize, NodeBoxCollection< DIM >::mNumBoxesEachDirection, and Node< SPACE_DIM >::rGetLocation().
Referenced by NodeBoxCollection< DIM >::CalculateNodePairs().
NodeBox< DIM > & NodeBoxCollection< DIM >::rGetBox | ( | unsigned | boxIndex | ) | [inline] |
Get a box.
boxIndex | the index of the box to return |
Definition at line 153 of file NodeBoxCollection.cpp.
References NodeBoxCollection< DIM >::mBoxes.
unsigned NodeBoxCollection< DIM >::GetNumBoxes | ( | ) | [inline] |
Get the number of boxes.
Definition at line 160 of file NodeBoxCollection.cpp.
References NodeBoxCollection< DIM >::mBoxes.
void NodeBoxCollection< DIM >::CalculateLocalBoxes | ( | ) | [inline] |
Set up the local boxes (ie itself and its nearest-neighbours) for each of the boxes.
Definition at line 166 of file NodeBoxCollection.cpp.
References NodeBoxCollection< DIM >::IsBottomRow(), NodeBoxCollection< DIM >::IsLeftColumn(), NodeBoxCollection< DIM >::IsRightColumn(), NodeBoxCollection< DIM >::IsTopRow(), NodeBoxCollection< DIM >::mBoxes, NodeBoxCollection< DIM >::mLocalBoxes, and NodeBoxCollection< DIM >::mNumBoxesEachDirection.
Referenced by NodeBoxCollection< DIM >::NodeBoxCollection().
std::set< unsigned > NodeBoxCollection< 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 221 of file NodeBoxCollection.cpp.
References NodeBoxCollection< DIM >::mLocalBoxes.
Referenced by NodeBoxCollection< DIM >::CalculateNodePairs().
void NodeBoxCollection< 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, ie nodes which are in a local box to the box containing the first node. **Note that 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 228 of file NodeBoxCollection.cpp.
References NodeBoxCollection< DIM >::CalculateContainingBox(), NodeBoxCollection< DIM >::GetLocalBoxes(), NodeBoxCollection< DIM >::mBoxes, and NodeBox< DIM >::rGetNodesContained().
std::vector< NodeBox<DIM> > NodeBoxCollection< DIM >::mBoxes [private] |
A vector of boxes to store rough node positions.
Definition at line 91 of file NodeBoxCollection.hpp.
Referenced by NodeBoxCollection< DIM >::CalculateContainingBox(), NodeBoxCollection< DIM >::CalculateLocalBoxes(), NodeBoxCollection< DIM >::CalculateNodePairs(), NodeBoxCollection< DIM >::GetNumBoxes(), NodeBoxCollection< DIM >::IsRightColumn(), NodeBoxCollection< DIM >::NodeBoxCollection(), and NodeBoxCollection< DIM >::rGetBox().
c_vector<double,2*DIM> NodeBoxCollection< DIM >::mDomainSize [private] |
The domain being partitioned.
Definition at line 94 of file NodeBoxCollection.hpp.
Referenced by NodeBoxCollection< DIM >::CalculateContainingBox().
double NodeBoxCollection< DIM >::mCutOffLength [private] |
The width of each box.
Definition at line 97 of file NodeBoxCollection.hpp.
Referenced by NodeBoxCollection< DIM >::CalculateContainingBox().
c_vector<unsigned,DIM> NodeBoxCollection< DIM >::mNumBoxesEachDirection [private] |
Number of boxes in each direction.
Definition at line 100 of file NodeBoxCollection.hpp.
Referenced by NodeBoxCollection< DIM >::CalculateContainingBox(), NodeBoxCollection< DIM >::CalculateLocalBoxes(), NodeBoxCollection< DIM >::IsBottomRow(), NodeBoxCollection< DIM >::IsLeftColumn(), NodeBoxCollection< DIM >::IsRightColumn(), NodeBoxCollection< DIM >::IsTopRow(), and NodeBoxCollection< DIM >::NodeBoxCollection().
std::vector< std::set<unsigned> > NodeBoxCollection< DIM >::mLocalBoxes [private] |
The boxes local (itself and nearest neighbour) to a given box.
Definition at line 103 of file NodeBoxCollection.hpp.
Referenced by NodeBoxCollection< DIM >::CalculateLocalBoxes(), and NodeBoxCollection< DIM >::GetLocalBoxes().