#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 NodeBasedCellPopulation 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 NodeBasedCellPopulation simulations) | |
domainSize | the size of the domain, in the form (xmin, xmax, ymin, ymax) (etc) |
Definition at line 85 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 169 of file BoxCollection.cpp.
References EXCEPTION, 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 160 of file BoxCollection.cpp.
References Node< SPACE_DIM >::rGetLocation().
Referenced by BoxCollection< DIM >::CalculateNodePairs(), and FineCoarseMeshPair< DIM >::SetUpBoxes().
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 679 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 672 of file BoxCollection.cpp.
References BoxCollection< DIM >::mLocalBoxes.
Referenced by BoxCollection< DIM >::CalculateNodePairs(), and FineCoarseMeshPair< DIM >::CollectElementsInLocalBoxes().
unsigned BoxCollection< DIM >::GetNumBoxes | ( | ) | [inline] |
Get the number of boxes.
Definition at line 213 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 206 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes.
Referenced by FineCoarseMeshPair< DIM >::CollectElementsInContainingBox(), FineCoarseMeshPair< DIM >::CollectElementsInLocalBoxes(), and FineCoarseMeshPair< DIM >::SetUpBoxes().
void BoxCollection< DIM >::SetupAllLocalBoxes | ( | ) | [inline] |
Set up the local boxes (ie itself and its nearest-neighbours) for each of the boxes.
Definition at line 384 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes, BoxCollection< DIM >::mLocalBoxes, BoxCollection< DIM >::mNumBoxesEachDirection, and NEVER_REACHED.
Referenced by FineCoarseMeshPair< DIM >::SetUpBoxes().
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 219 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes, BoxCollection< DIM >::mLocalBoxes, BoxCollection< DIM >::mNumBoxesEachDirection, and NEVER_REACHED.
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().