#include <NodesOnlyMesh.hpp>
Inherits MutableMesh< SPACE_DIM, SPACE_DIM >.
Public Member Functions | |
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) |
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 |
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 42 of file NodesOnlyMesh.hpp.
unsigned NodesOnlyMesh< SPACE_DIM >::AddNode | ( | Node< SPACE_DIM > * | pNewNode | ) | [inline, virtual] |
Overridden AddNode() method.
pNewNode | pointer to the new node |
Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.
Definition at line 144 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mCellRadii, and NodesOnlyMesh< SPACE_DIM >::SetCellRadius().
Referenced by NodeBasedCellPopulation< DIM >::AddNode().
void NodesOnlyMesh< SPACE_DIM >::Clear | ( | ) | [inline, 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 57 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mCellRadii.
Referenced by NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), and NodesOnlyMesh< SPACE_DIM >::ReMesh().
void NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh | ( | const AbstractMesh< SPACE_DIM, SPACE_DIM > & | rGeneratingMesh | ) | [inline] |
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 51 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.
void NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh | ( | const std::vector< Node< SPACE_DIM > * > & | rNodes | ) | [inline] |
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 33 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::Clear(), NodesOnlyMesh< SPACE_DIM >::mCellRadii, and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.
Referenced by NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), PottsBasedCellPopulation< DIM >::WriteVtkResultsToFile(), and MeshBasedCellPopulation< DIM >::WriteVtkResultsToFile().
void NodesOnlyMesh< SPACE_DIM >::DeleteNode | ( | unsigned | index | ) | [inline, virtual] |
Overridden DeleteNode() method.
index | is the index of the node to be deleted |
Note: we do 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 160 of file NodesOnlyMesh.cpp.
References EXCEPTION, MutableMesh< SPACE_DIM, SPACE_DIM >::mDeletedNodeIndices, and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.
double NodesOnlyMesh< SPACE_DIM >::GetCellRadius | ( | unsigned | index | ) | [inline] |
Get the cell radius associated with a given node index.
index | the index of a node |
Definition at line 67 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mCellRadii.
Referenced by BuskeElasticForce< DIM >::CalculateForceBetweenNodes(), BuskeAdhesiveForce< DIM >::CalculateForceBetweenNodes(), NodeBasedCellPopulation< DIM >::GetNeighbouringNodeIndices(), NodeBasedCellPopulationWithBuskeUpdate< DIM >::UpdateNodeLocations(), NodeBasedCellPopulation< DIM >::WriteCellVolumeResultsToFile(), and NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile().
void NodesOnlyMesh< SPACE_DIM >::ReMesh | ( | NodeMap & | rMap | ) | [inline, 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 81 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::Clear(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllNodes(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryNodes, NodesOnlyMesh< SPACE_DIM >::mCellRadii, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, NodeMap::SetDeleted(), and NodeMap::SetNewIndex().
Referenced by NodeBasedCellPopulation< DIM >::Update().
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 69 of file NodesOnlyMesh.hpp.
void NodesOnlyMesh< SPACE_DIM >::SetCellRadius | ( | unsigned | index, | |
double | radius | |||
) | [inline] |
Set the cell radius associated with a given node index.
index | the index of a node | |
radius | the cell radius |
Definition at line 74 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mCellRadii.
Referenced by NodeBasedCellPopulation< DIM >::AddCell(), and NodesOnlyMesh< SPACE_DIM >::AddNode().
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.
Definition at line 56 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 1.0 by default in the method ConstructNodesWithoutMesh()
Definition at line 51 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::AddNode(), NodesOnlyMesh< SPACE_DIM >::Clear(), NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), NodesOnlyMesh< SPACE_DIM >::GetCellRadius(), NodesOnlyMesh< SPACE_DIM >::ReMesh(), NodesOnlyMesh< DIM >::serialize(), and NodesOnlyMesh< SPACE_DIM >::SetCellRadius().