Chaste Release::3.1
NodesOnlyMesh< SPACE_DIM > Class Template Reference

#include <NodesOnlyMesh.hpp>

Inheritance diagram for NodesOnlyMesh< SPACE_DIM >:
Collaboration diagram for NodesOnlyMesh< SPACE_DIM >:

List of all members.

Public Member Functions

 NodesOnlyMesh ()
 ~NodesOnlyMesh ()
void ConstructNodesWithoutMesh (const std::vector< Node< SPACE_DIM > * > &rNodes)
void ConstructNodesWithoutMesh (const AbstractMesh< SPACE_DIM, SPACE_DIM > &rGeneratingMesh)
void Clear ()
double GetCellRadius (unsigned index)
void SetCellRadius (unsigned index, double radius)
BoxCollection< SPACE_DIM > * GetBoxCollection ()
void ClearBoxCollection ()
void SetUpBoxCollection (double cutOffLength, c_vector< double, 2 *SPACE_DIM > domainSize)
void SetMaximumInteractionDistance (double maximumInteractionDistance)
void CalculateNodePairs (std::set< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > &rNodePairs, std::map< unsigned, std::set< unsigned > > &rNodeNeighbours)
void ReMesh (NodeMap &rMap)
unsigned AddNode (Node< SPACE_DIM > *pNewNode)
void DeleteNode (unsigned index)

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)

Private Attributes

std::vector< doublemCellRadii
BoxCollection< SPACE_DIM > * mpBoxCollection
double mMaximumInteractionDistance

Friends

class TestNodesOnlyMesh
class boost::serialization::access

Detailed Description

template<unsigned SPACE_DIM>
class NodesOnlyMesh< SPACE_DIM >

Mesh class for storing lists of nodes (no elements). This inherits from MutableMesh because we want to be able to add and delete nodes.

Definition at line 49 of file NodesOnlyMesh.hpp.


Constructor & Destructor Documentation

template<unsigned SPACE_DIM>
NodesOnlyMesh< SPACE_DIM >::NodesOnlyMesh ( )

Default constructor to initialise BoxCollection to NULL.

Definition at line 40 of file NodesOnlyMesh.cpp.

template<unsigned SPACE_DIM>
NodesOnlyMesh< SPACE_DIM >::~NodesOnlyMesh ( )

Over-written destructor to delete pointer to BoxCollection

Definition at line 47 of file NodesOnlyMesh.cpp.


Member Function Documentation

template<unsigned SPACE_DIM>
unsigned NodesOnlyMesh< SPACE_DIM >::AddNode ( Node< SPACE_DIM > *  pNewNode) [virtual]

Overridden AddNode() method.

Parameters:
pNewNodepointer to the new node

Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.

Definition at line 186 of file NodesOnlyMesh.cpp.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::AddNode().

template<unsigned SPACE_DIM>
void NodesOnlyMesh< SPACE_DIM >::CalculateNodePairs ( std::set< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > &  rNodePairs,
std::map< unsigned, std::set< unsigned > > &  rNodeNeighbours 
)

Calculate pairs of nodes using the BoxCollection

Parameters:
rNodePairsreference to the set of node pairs to populate.
rNodeNeighboursreference to the list of neighbouring nodes for each node.

Definition at line 138 of file NodesOnlyMesh.cpp.

template<unsigned SPACE_DIM>
void NodesOnlyMesh< SPACE_DIM >::Clear ( ) [virtual]

Overridden Clear() method for NodesOnlyMesh. Clears mCellRadii in addition to calling Clear() on the parent class.

Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.

Definition at line 78 of file NodesOnlyMesh.cpp.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::Clear().

template<unsigned SPACE_DIM>
void NodesOnlyMesh< SPACE_DIM >::ClearBoxCollection ( )

Clear the BoxCollection

Definition at line 108 of file NodesOnlyMesh.cpp.

template<unsigned SPACE_DIM>
void NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh ( const std::vector< Node< SPACE_DIM > * > &  rNodes)

Construct the mesh using only nodes. No mesh is created, but the nodes are stored. The original vector of nodes is deep-copied: new node objects are made with are independent of the pointers in the input so that they can be safely deleted.

If this is the only way of constructing a mesh of this type, then we can be certain that elements and boundary elements are always unused.

Parameters:
rNodesa vector of pointers to nodes

Definition at line 54 of file NodesOnlyMesh.cpp.

Referenced by PottsBasedCellPopulation< DIM >::WriteVtkResultsToFile(), MultipleCaBasedCellPopulation< DIM >::WriteVtkResultsToFile(), and MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::WriteVtkResultsToFile().

template<unsigned SPACE_DIM>
void NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh ( const AbstractMesh< SPACE_DIM, SPACE_DIM > &  rGeneratingMesh)

A Helper method to enable you to construct a nodes-only mesh by stripping the nodes TetrahedralMesh, this calls the ConstructNodesWithoutMesh method with the nodes

If this is the only way of constructing a mesh of this type, then we can be certain that elements and boundary elements are always unused.

Parameters:
rGeneratingMeshany mesh with nodes, used to generate the NodesOnlyMesh

Definition at line 72 of file NodesOnlyMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.

template<unsigned SPACE_DIM>
void NodesOnlyMesh< SPACE_DIM >::DeleteNode ( unsigned  index) [virtual]

Overridden DeleteNode() method.

Parameters:
indexis the index of the node to be deleted

Note: we may not need to update mCellRadii here, since if the node index is ever re-used when a new node is added, mCellRadii will be updated correctly.

Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.

Definition at line 202 of file NodesOnlyMesh.cpp.

References DOUBLE_UNSET, and EXCEPTION.

template<unsigned SPACE_DIM>
BoxCollection< SPACE_DIM > * NodesOnlyMesh< SPACE_DIM >::GetBoxCollection ( )

Get mpBoxCollection

Returns:
mpBoxCollection

Definition at line 102 of file NodesOnlyMesh.cpp.

template<unsigned SPACE_DIM>
double NodesOnlyMesh< SPACE_DIM >::GetCellRadius ( unsigned  index)

Get the cell radius associated with a given node index.

Parameters:
indexthe index of a node

Definition at line 88 of file NodesOnlyMesh.cpp.

Referenced by BuskeElasticForce< DIM >::CalculateForceBetweenNodes(), BuskeAdhesiveForce< DIM >::CalculateForceBetweenNodes(), and NodeBasedCellPopulationWithParticles< DIM >::WriteVtkResultsToFile().

template<unsigned SPACE_DIM>
void NodesOnlyMesh< SPACE_DIM >::ReMesh ( NodeMap rMap) [virtual]

Overridden ReMesh() method.

Parameters:
rMapa reference to a nodemap which should be created with the required number of nodes.

Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.

Definition at line 145 of file NodesOnlyMesh.cpp.

References NodeMap::SetDeleted(), and NodeMap::SetNewIndex().

template<unsigned SPACE_DIM>
template<class Archive >
void NodesOnlyMesh< SPACE_DIM >::serialize ( Archive &  archive,
const unsigned int  version 
) [inline, private]

Archives the member variables of the object which have to be preserved during its lifetime.

Note that we must archive any member variables FIRST so that this method can call a ReMesh (to convert from TrianglesMeshReader input format into our native format).

Parameters:
archivethe archive
versionthe current version of this class

Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.

Definition at line 89 of file NodesOnlyMesh.hpp.

template<unsigned SPACE_DIM>
void NodesOnlyMesh< SPACE_DIM >::SetCellRadius ( unsigned  index,
double  radius 
)

Set the cell radius associated with a given node index.

Parameters:
indexthe index of a node
radiusthe cell radius

Definition at line 95 of file NodesOnlyMesh.cpp.

Referenced by NodeBasedCellPopulationWithParticles< DIM >::AddCell().

template<unsigned SPACE_DIM>
void NodesOnlyMesh< SPACE_DIM >::SetMaximumInteractionDistance ( double  maximumInteractionDistance)

Set the maximum interaction distance between nodes

Parameters:
maximumInteractionDistancethe maximum distance between two neighbouring nodes

Definition at line 132 of file NodesOnlyMesh.cpp.

template<unsigned SPACE_DIM>
void NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection ( double  cutOffLength,
c_vector< double, 2 *SPACE_DIM >  domainSize 
)

Set up the box collection

Parameters:
cutOffLengththe cut off length for node neighbours
domainSizethe size of the domain containing the nodes.

Definition at line 118 of file NodesOnlyMesh.cpp.

References BoxCollection< DIM >::SetupLocalBoxesHalfOnly().


Friends And Related Function Documentation

template<unsigned SPACE_DIM>
friend class boost::serialization::access [friend]

Needed for serialization.

Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.

Definition at line 76 of file NodesOnlyMesh.hpp.


Member Data Documentation

template<unsigned SPACE_DIM>
std::vector<double> NodesOnlyMesh< SPACE_DIM >::mCellRadii [private]

Vector of radii of cells corresponding to nodes. Each radius is set to 0.5 by default in the method ConstructNodesWithoutMesh()

Definition at line 58 of file NodesOnlyMesh.hpp.

Referenced by NodesOnlyMesh< DIM >::serialize().

template<unsigned SPACE_DIM>
double NodesOnlyMesh< SPACE_DIM >::mMaximumInteractionDistance [private]

The maximum interaction distance for two nodes. Defines the maximum distance between two `neighbouring` nodes.

Definition at line 70 of file NodesOnlyMesh.hpp.

template<unsigned SPACE_DIM>
BoxCollection<SPACE_DIM>* NodesOnlyMesh< SPACE_DIM >::mpBoxCollection [private]

A pointer to a box collection. Used to calculate neighbourhood information for nodes in the mesh

Definition at line 64 of file NodesOnlyMesh.hpp.


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