Chaste Release::3.1
BoxCollection< DIM > Class Template Reference

#include <BoxCollection.hpp>

Inheritance diagram for BoxCollection< DIM >:
Collaboration diagram for BoxCollection< DIM >:

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, 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

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 104 of file BoxCollection.hpp.


Constructor & Destructor Documentation

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

Constructor

Parameters:
boxWidththe width of each box (cut-off length in NodeBasedCellPopulation simulations)
domainSizethe 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.


Member Function Documentation

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

Calculate which box this node is contained in.

Parameters:
pNodeaddress of the node

Definition at line 167 of file BoxCollection.cpp.

References Node< SPACE_DIM >::rGetLocation().

Referenced by FineCoarseMeshPair< DIM >::SetUpBoxes().

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

Calculate which box a point is contained in

Parameters:
rLocationThe point

Definition at line 176 of file BoxCollection.cpp.

References EXCEPTION.

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

Parameters:
rNodesall the nodes to be consider
rNodePairsthe return value, a set of pairs of nodes
rNodeNeighboursthe other return value, the neighbours of each node.

Definition at line 686 of file BoxCollection.cpp.

template<unsigned DIM>
std::set< unsigned > BoxCollection< DIM >::GetLocalBoxes ( unsigned  boxIndex)

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

Parameters:
boxIndexthe index of the box

Definition at line 679 of file BoxCollection.cpp.

Referenced by FineCoarseMeshPair< DIM >::CollectElementsInLocalBoxes().

template<unsigned DIM>
unsigned BoxCollection< DIM >::GetNumBoxes ( )

Get the number of boxes.

Definition at line 220 of file BoxCollection.cpp.

template<unsigned DIM>
Box< DIM > & BoxCollection< DIM >::rGetBox ( unsigned  boxIndex)

Get a box.

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

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

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


Member Data Documentation

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

template<unsigned DIM>
double BoxCollection< DIM >::mBoxWidth [private]

The width of each box.

Definition at line 116 of file BoxCollection.hpp.

template<unsigned DIM>
c_vector<double, 2*DIM> BoxCollection< DIM >::mDomainSize [private]

The domain being partitioned.

Definition at line 113 of file BoxCollection.hpp.

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

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 122 of file BoxCollection.hpp.

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


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