Chaste Release::3.1
|
#include <NodesOnlyMesh.hpp>
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< double > | mCellRadii |
BoxCollection< SPACE_DIM > * | mpBoxCollection |
double | mMaximumInteractionDistance |
Friends | |
class | TestNodesOnlyMesh |
class | boost::serialization::access |
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.
NodesOnlyMesh< SPACE_DIM >::NodesOnlyMesh | ( | ) |
Default constructor to initialise BoxCollection to NULL.
Definition at line 40 of file NodesOnlyMesh.cpp.
NodesOnlyMesh< SPACE_DIM >::~NodesOnlyMesh | ( | ) |
Over-written destructor to delete pointer to BoxCollection
Definition at line 47 of file NodesOnlyMesh.cpp.
unsigned NodesOnlyMesh< SPACE_DIM >::AddNode | ( | Node< SPACE_DIM > * | pNewNode | ) | [virtual] |
Overridden AddNode() method.
pNewNode | pointer 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().
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
rNodePairs | reference to the set of node pairs to populate. |
rNodeNeighbours | reference to the list of neighbouring nodes for each node. |
Definition at line 138 of file NodesOnlyMesh.cpp.
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().
void NodesOnlyMesh< SPACE_DIM >::ClearBoxCollection | ( | ) |
Clear the BoxCollection
Definition at line 108 of file NodesOnlyMesh.cpp.
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.
rNodes | a 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().
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.
rGeneratingMesh | any mesh with nodes, used to generate the NodesOnlyMesh |
Definition at line 72 of file NodesOnlyMesh.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.
void NodesOnlyMesh< SPACE_DIM >::DeleteNode | ( | unsigned | index | ) | [virtual] |
Overridden DeleteNode() method.
index | is 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.
BoxCollection< SPACE_DIM > * NodesOnlyMesh< SPACE_DIM >::GetBoxCollection | ( | ) |
double NodesOnlyMesh< SPACE_DIM >::GetCellRadius | ( | unsigned | index | ) |
Get the cell radius associated with a given node index.
index | the index of a node |
Definition at line 88 of file NodesOnlyMesh.cpp.
Referenced by BuskeElasticForce< DIM >::CalculateForceBetweenNodes(), BuskeAdhesiveForce< DIM >::CalculateForceBetweenNodes(), and NodeBasedCellPopulationWithParticles< DIM >::WriteVtkResultsToFile().
void NodesOnlyMesh< SPACE_DIM >::ReMesh | ( | NodeMap & | rMap | ) | [virtual] |
Overridden ReMesh() method.
rMap | a 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().
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).
archive | the archive |
version | the current version of this class |
Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.
Definition at line 89 of file NodesOnlyMesh.hpp.
void NodesOnlyMesh< SPACE_DIM >::SetCellRadius | ( | unsigned | index, |
double | radius | ||
) |
Set the cell radius associated with a given node index.
index | the index of a node |
radius | the cell radius |
Definition at line 95 of file NodesOnlyMesh.cpp.
Referenced by NodeBasedCellPopulationWithParticles< DIM >::AddCell().
void NodesOnlyMesh< SPACE_DIM >::SetMaximumInteractionDistance | ( | double | maximumInteractionDistance | ) |
Set the maximum interaction distance between nodes
maximumInteractionDistance | the maximum distance between two neighbouring nodes |
Definition at line 132 of file NodesOnlyMesh.cpp.
void NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection | ( | double | cutOffLength, |
c_vector< double, 2 *SPACE_DIM > | domainSize | ||
) |
Set up the box collection
cutOffLength | the cut off length for node neighbours |
domainSize | the size of the domain containing the nodes. |
Definition at line 118 of file NodesOnlyMesh.cpp.
References BoxCollection< DIM >::SetupLocalBoxesHalfOnly().
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.
Definition at line 76 of file NodesOnlyMesh.hpp.
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().
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.
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.