Chaste Release::3.1
|
#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, 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 |
Static Private Attributes | |
static const double | mFudge = 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 104 of file BoxCollection.hpp.
BoxCollection< DIM >::BoxCollection | ( | double | boxWidth, |
c_vector< double, 2 *DIM > | domainSize | ||
) |
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 92 of file BoxCollection.cpp.
References BoxCollection< DIM >::mBoxes, BoxCollection< DIM >::mFudge, and BoxCollection< DIM >::mNumBoxesEachDirection.
unsigned BoxCollection< DIM >::CalculateContainingBox | ( | Node< DIM > * | pNode | ) |
Calculate which box this node is contained in.
pNode | address of the node |
Definition at line 167 of file BoxCollection.cpp.
References Node< SPACE_DIM >::rGetLocation().
Referenced by FineCoarseMeshPair< DIM >::SetUpBoxes().
unsigned BoxCollection< DIM >::CalculateContainingBox | ( | c_vector< double, DIM > & | rLocation | ) |
Calculate which box a point is contained in
rLocation | The point |
Definition at line 176 of file BoxCollection.cpp.
References EXCEPTION.
void BoxCollection< DIM >::CalculateNodePairs | ( | std::vector< Node< DIM > * > & | rNodes, |
std::set< std::pair< Node< DIM > *, Node< DIM > * > > & | rNodePairs, | ||
std::map< unsigned, std::set< unsigned > > & | rNodeNeighbours | ||
) |
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 686 of file BoxCollection.cpp.
std::set< unsigned > BoxCollection< DIM >::GetLocalBoxes | ( | unsigned | boxIndex | ) |
Get the set of all the local boxes, i.e. itself and its nearest-neighbours.
boxIndex | the index of the box |
Definition at line 679 of file BoxCollection.cpp.
Referenced by FineCoarseMeshPair< DIM >::CollectElementsInLocalBoxes().
unsigned BoxCollection< DIM >::GetNumBoxes | ( | ) |
Get the number of boxes.
Definition at line 220 of file BoxCollection.cpp.
Box< DIM > & BoxCollection< DIM >::rGetBox | ( | unsigned | boxIndex | ) |
Get a box.
boxIndex | the index of the box to return |
Definition at line 213 of file BoxCollection.cpp.
Referenced by FineCoarseMeshPair< DIM >::CollectElementsInContainingBox(), FineCoarseMeshPair< DIM >::CollectElementsInLocalBoxes(), and FineCoarseMeshPair< DIM >::SetUpBoxes().
void BoxCollection< DIM >::SetupAllLocalBoxes | ( | ) |
Set up the local boxes (ie itself and its nearest-neighbours) for each of the boxes.
Definition at line 391 of file BoxCollection.cpp.
References NEVER_REACHED.
Referenced by FineCoarseMeshPair< DIM >::SetUpBoxes().
void BoxCollection< DIM >::SetupLocalBoxesHalfOnly | ( | ) |
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 226 of file BoxCollection.cpp.
References NEVER_REACHED.
Referenced by NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection().
std::vector< Box<DIM> > BoxCollection< DIM >::mBoxes [private] |
A vector of boxes to store rough node/element positions.
Definition at line 110 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::BoxCollection().
double BoxCollection< DIM >::mBoxWidth [private] |
The width of each box.
Definition at line 116 of file BoxCollection.hpp.
c_vector<double, 2*DIM> BoxCollection< DIM >::mDomainSize [private] |
The domain being partitioned.
Definition at line 113 of file BoxCollection.hpp.
const double BoxCollection< DIM >::mFudge = 5e-14 [static, private] |
A fudge (box swelling) factor to deal with 32-bit floating point issues.
Definition at line 125 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::BoxCollection().
std::vector< std::set<unsigned> > BoxCollection< DIM >::mLocalBoxes [private] |
The boxes local (itself and nearest neighbour) to a given box.
Definition at line 122 of file BoxCollection.hpp.
c_vector<unsigned, DIM> BoxCollection< DIM >::mNumBoxesEachDirection [private] |
Number of boxes in each direction.
Definition at line 119 of file BoxCollection.hpp.
Referenced by BoxCollection< DIM >::BoxCollection().