BoxCollection< DIM > Class Template Reference

#include <BoxCollection.hpp>

Collaboration diagram for BoxCollection< DIM >:
Collaboration graph
[legend]

List of all members.

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< unsignedGetLocalBoxes (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

Detailed Description

template<unsigned DIM>
class BoxCollection< DIM >

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.


Constructor & Destructor Documentation

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

Constructor

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


Member Function Documentation

template<unsigned DIM>
unsigned BoxCollection< DIM >::CalculateContainingBox ( c_vector< double, DIM > &  rLocation  )  [inline]

Calculate which box a point is contained in

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

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

Calculate which box this node is contained in.

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

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

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

template<unsigned DIM>
std::set< unsigned > BoxCollection< 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 672 of file BoxCollection.cpp.

References BoxCollection< DIM >::mLocalBoxes.

Referenced by BoxCollection< DIM >::CalculateNodePairs(), and FineCoarseMeshPair< DIM >::CollectElementsInLocalBoxes().

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

Get the number of boxes.

Definition at line 213 of file BoxCollection.cpp.

References BoxCollection< DIM >::mBoxes.

template<unsigned DIM>
Box< DIM > & BoxCollection< DIM >::rGetBox ( unsigned  boxIndex  )  [inline]
template<unsigned DIM>
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().

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


Member Data Documentation

template<unsigned DIM>
std::vector< Box<DIM> > BoxCollection< DIM >::mBoxes [private]
template<unsigned DIM>
double BoxCollection< DIM >::mBoxWidth [private]

The width of each box.

Definition at line 105 of file BoxCollection.hpp.

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

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

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

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

The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:02:58 2011 for Chaste by  doxygen 1.6.3