#include <BoxCollection.hpp>
Public Member Functions | |
BoxCollection (double boxWidth, c_vector< double, 2 *DIM > domainSize, bool isPeriodicInX=false) | |
void | EmptyBoxes () |
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) |
const c_vector< double, 2 *DIM > & | rGetDomainSize () const |
void | CalculateNodePairs (std::vector< Node< DIM > * > &rNodes, std::vector< std::pair< Node< DIM > *, Node< DIM > * > > &rNodePairs, std::map< unsigned, std::set< unsigned > > &rNodeNeighbours) |
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 |
bool | mIsPeriodicInX |
Static Private Attributes | |
static const double | msFudge = 5e-14 |
Friends | |
class | TestBoxCollection |
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 49 of file BoxCollection.hpp.
BoxCollection< DIM >::BoxCollection | ( | double | boxWidth, | |
c_vector< double, 2 *DIM > | domainSize, | |||
bool | isPeriodicInX = false | |||
) | [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) | |
isPeriodicInX | whether the domain is peiodic in the x direction |
Definition at line 47 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes, BoxCollection< DIM >::mNumBoxesEachDirection, and BoxCollection< DIM >::msFudge.
unsigned BoxCollection< DIM >::CalculateContainingBox | ( | c_vector< double, DIM > & | rLocation | ) | [inline] |
rLocation | The point |
Definition at line 147 of file BoxCollection.cpp.
References EXCEPTION, BoxCollection< DIM >::mBoxes, BoxCollection< DIM >::mBoxWidth, BoxCollection< DIM >::mDomainSize, BoxCollection< DIM >::mNumBoxesEachDirection, and BoxCollection< DIM >::msFudge.
unsigned BoxCollection< DIM >::CalculateContainingBox | ( | Node< DIM > * | pNode | ) | [inline] |
pNode | address of the node |
Definition at line 138 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::vector< std::pair< Node< DIM > *, Node< DIM > * > > & | rNodePairs, | |||
std::map< unsigned, std::set< unsigned > > & | rNodeNeighbours | |||
) | [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 | |
rNodeNeighbours | the other return value, the neighbours of each node. |
Definition at line 709 of file BoxCollection.cpp.
References BoxCollection< DIM >::CalculateContainingBox(), BoxCollection< DIM >::GetLocalBoxes(), and BoxCollection< DIM >::mBoxes.
void BoxCollection< DIM >::EmptyBoxes | ( | ) | [inline] |
Remove the list of nodes stored in each box.
Definition at line 129 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes.
std::set< unsigned > BoxCollection< DIM >::GetLocalBoxes | ( | unsigned | boxIndex | ) | [inline] |
boxIndex | the index of the box |
Definition at line 696 of file BoxCollection.cpp.
References BoxCollection< DIM >::mLocalBoxes.
Referenced by BoxCollection< DIM >::CalculateNodePairs(), and FineCoarseMeshPair< DIM >::CollectElementsInLocalBoxes().
unsigned BoxCollection< DIM >::GetNumBoxes | ( | ) | [inline] |
Definition at line 191 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes.
Box< DIM > & BoxCollection< DIM >::rGetBox | ( | unsigned | boxIndex | ) | [inline] |
boxIndex | the index of the box to return |
Definition at line 184 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes.
Referenced by FineCoarseMeshPair< DIM >::CollectElementsInContainingBox(), FineCoarseMeshPair< DIM >::CollectElementsInLocalBoxes(), and FineCoarseMeshPair< DIM >::SetUpBoxes().
const c_vector< double, 2 *DIM > & BoxCollection< DIM >::rGetDomainSize | ( | ) | const [inline] |
Return the size of the domain partitioned by this collection
Definition at line 703 of file BoxCollection.cpp.
References BoxCollection< DIM >::mDomainSize.
void BoxCollection< DIM >::SetupAllLocalBoxes | ( | ) | [inline] |
Set up the local boxes (ie itself and its nearest-neighbours) for each of the boxes.
Definition at line 376 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes, BoxCollection< DIM >::mIsPeriodicInX, 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 197 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes, BoxCollection< DIM >::mIsPeriodicInX, 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 55 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::BoxCollection(), BoxCollection< DIM >::CalculateContainingBox(), BoxCollection< DIM >::CalculateNodePairs(), BoxCollection< DIM >::EmptyBoxes(), 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 61 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 58 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::CalculateContainingBox(), and BoxCollection< DIM >::rGetDomainSize().
bool BoxCollection< DIM >::mIsPeriodicInX [private] |
Whether the domain is periodic in the X dimension Note this currently only works for DIM=2.
Definition at line 70 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::SetupAllLocalBoxes(), and BoxCollection< DIM >::SetupLocalBoxesHalfOnly().
std::vector< std::set<unsigned> > BoxCollection< DIM >::mLocalBoxes [private] |
The boxes local (itself and nearest neighbour) to a given box.
Definition at line 67 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 64 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::BoxCollection(), BoxCollection< DIM >::CalculateContainingBox(), BoxCollection< DIM >::SetupAllLocalBoxes(), and BoxCollection< DIM >::SetupLocalBoxesHalfOnly().
const double BoxCollection< DIM >::msFudge = 5e-14 [inline, static, private] |
A fudge (box swelling) factor to deal with 32-bit floating point issues.
Definition at line 73 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::BoxCollection(), and BoxCollection< DIM >::CalculateContainingBox().