NodeBoxCollection< DIM > Class Template Reference

#include <NodeBoxCollection.hpp>

Collaboration diagram for NodeBoxCollection< DIM >:

Collaboration graph
[legend]

List of all members.

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


Detailed Description

template<unsigned DIM>
class NodeBoxCollection< DIM >

A collection of 'boxes' partitioning the domain with information on which nodes are located in which box

not archived - constructed in NodeBasedTissue constructor.

Definition at line 86 of file NodeBoxCollection.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
NodeBoxCollection< DIM >::NodeBoxCollection ( double  cutOffLength,
c_vector< double, 2 *DIM >  domainSize 
) [inline]

Constructor

Parameters:
cutOffLength the width of each box (cutOffLength)
domainSize the size of the domain, in the form (xmin, xmax, ymin, ymax) (etc)

Todo:
3d node box collection

commented out as the 1d case is not tested or covered - do we really care about 1d? if so

Todo:
1d node box collection

Definition at line 72 of file NodeBoxCollection.cpp.

References NodeBoxCollection< DIM >::CalculateLocalBoxes(), NodeBoxCollection< DIM >::mBoxes, and NodeBoxCollection< DIM >::mNumBoxesEachDirection.


Member Function Documentation

template<unsigned DIM>
bool NodeBoxCollection< DIM >::IsBottomRow ( unsigned  boxIndex  )  [inline, private]

2D specific helper method - whether a box is on the bottom row of all the boxes.

Parameters:
boxIndex the box index

Definition at line 111 of file NodeBoxCollection.hpp.

References NodeBoxCollection< DIM >::mNumBoxesEachDirection.

Referenced by NodeBoxCollection< DIM >::CalculateLocalBoxes().

template<unsigned DIM>
bool NodeBoxCollection< DIM >::IsTopRow ( unsigned  boxIndex  )  [inline, private]

2D specific helper methods - whether a box is on the top row of all the boxes.

Parameters:
boxIndex the box index

Definition at line 122 of file NodeBoxCollection.hpp.

References NodeBoxCollection< DIM >::mNumBoxesEachDirection.

Referenced by NodeBoxCollection< DIM >::CalculateLocalBoxes().

template<unsigned DIM>
bool NodeBoxCollection< DIM >::IsLeftColumn ( unsigned  boxIndex  )  [inline, private]

2D specific helper methods - whether a box is on the left side of the boxes.

Parameters:
boxIndex the box index

Definition at line 133 of file NodeBoxCollection.hpp.

References NodeBoxCollection< DIM >::mNumBoxesEachDirection.

Referenced by NodeBoxCollection< DIM >::CalculateLocalBoxes().

template<unsigned DIM>
bool NodeBoxCollection< DIM >::IsRightColumn ( unsigned  boxIndex  )  [inline, private]

2D specific helper methods - whether a box is on the right side of the boxes.

Parameters:
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().

template<unsigned DIM>
unsigned NodeBoxCollection< DIM >::CalculateContainingBox ( Node< DIM > *  pNode  )  [inline]

template<unsigned DIM>
NodeBox< DIM > & NodeBoxCollection< DIM >::rGetBox ( unsigned  boxIndex  )  [inline]

Get a box.

Parameters:
boxIndex the index of the box to return
Returns:
a NodeBox

Definition at line 153 of file NodeBoxCollection.cpp.

References NodeBoxCollection< DIM >::mBoxes.

template<unsigned DIM>
unsigned NodeBoxCollection< DIM >::GetNumBoxes (  )  [inline]

Get the number of boxes.

Definition at line 160 of file NodeBoxCollection.cpp.

References NodeBoxCollection< DIM >::mBoxes.

template<unsigned DIM>
void NodeBoxCollection< DIM >::CalculateLocalBoxes (  )  [inline]

template<unsigned DIM>
std::set< unsigned > NodeBoxCollection< DIM >::GetLocalBoxes ( unsigned  boxIndex  )  [inline]

Get the set of all the local boxes, i.e. itself and its nearest-neighbours.

Parameters:
boxIndex the index of the box

Definition at line 221 of file NodeBoxCollection.cpp.

References NodeBoxCollection< DIM >::mLocalBoxes.

Referenced by NodeBoxCollection< DIM >::CalculateNodePairs().

template<unsigned DIM>
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.

Parameters:
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().


Member Data Documentation

template<unsigned DIM>
std::vector< NodeBox<DIM> > NodeBoxCollection< DIM >::mBoxes [private]

template<unsigned DIM>
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().

template<unsigned DIM>
double NodeBoxCollection< DIM >::mCutOffLength [private]

The width of each box.

Definition at line 97 of file NodeBoxCollection.hpp.

Referenced by NodeBoxCollection< DIM >::CalculateContainingBox().

template<unsigned DIM>
c_vector<unsigned,DIM> NodeBoxCollection< DIM >::mNumBoxesEachDirection [private]

template<unsigned DIM>
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().


The documentation for this class was generated from the following files:

Generated on Tue Aug 4 16:11:34 2009 for Chaste by  doxygen 1.5.5