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

#include <SemMesh.hpp>

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

List of all members.

Classes

class  SemElementIterator

Public Member Functions

SemElementIterator GetElementIteratorBegin (bool skipDeletedElements=true)
SemElementIterator GetElementIteratorEnd ()
 SemMesh (std::vector< Node< DIM > * > nodes, std::vector< PottsElement< DIM > * > pottsElements)
 SemMesh ()
virtual ~SemMesh ()
virtual unsigned GetNumNodes () const
virtual unsigned GetNumAllNodes () const
virtual unsigned GetNumElements () const
unsigned GetNumAllElements () const
PottsElement< DIM > * GetElement (unsigned index) const
void ConstructFromMeshReader (AbstractMeshReader< DIM, DIM > &rMeshReader)
virtual void Clear ()
void ReMesh ()
void DeleteElement (unsigned index)
unsigned AddElement (PottsElement< DIM > *pNewElement, std::vector< Node< DIM > * > pNewNodes)

Protected Member Functions

unsigned SolveNodeMapping (unsigned index) const
unsigned SolveElementMapping (unsigned index) const
unsigned SolveBoundaryElementMapping (unsigned index) const
template<class Archive >
void save (Archive &archive, const unsigned int version) const
template<class Archive >
void load (Archive &archive, const unsigned int version)

Protected Attributes

std::vector< PottsElement< DIM > * > mElements
std::vector< unsignedmDeletedElementIndices
std::vector< unsignedmDeletedNodeIndices

Friends

class TestSemMesh
class boost::serialization::access

Detailed Description

template<unsigned DIM>
class SemMesh< DIM >

A Subcellular Element mesh class, for use in subcellular element model simulations.

Definition at line 63 of file SemMesh.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
SemMesh< DIM >::SemMesh ( std::vector< Node< DIM > * >  nodes,
std::vector< PottsElement< DIM > * >  pottsElements 
)

Default constructor.

Parameters:
nodesa vector of all the nodes contained in all elements
pottsElementsvector of pointers to PottsElements

Definition at line 42 of file SemMesh.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().

template<unsigned DIM>
SemMesh< DIM >::SemMesh ( )

Default constructor for use by serializer.

Definition at line 81 of file SemMesh.cpp.

template<unsigned DIM>
SemMesh< DIM >::~SemMesh ( ) [virtual]

Destructor.

Definition at line 89 of file SemMesh.cpp.


Member Function Documentation

template<unsigned DIM>
unsigned SemMesh< DIM >::AddElement ( PottsElement< DIM > *  pNewElement,
std::vector< Node< DIM > * >  pNewNodes 
)

Add an element to the mesh.

Parameters:
pNewElementthe new element
pNewNodesthe new nodes associated with the element.
Returns:
the index of the new element in the mesh

Definition at line 306 of file SemMesh.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), MutableElement< DIM, DIM >::RegisterWithNodes(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::SetIndex().

template<unsigned DIM>
void SemMesh< DIM >::Clear ( ) [virtual]

Delete mNodes and mElements.

Definition at line 115 of file SemMesh.cpp.

template<unsigned DIM>
void SemMesh< DIM >::DeleteElement ( unsigned  index)

Mark an element as deleted.

Parameters:
indexthe global index of a specified Potts element

Definition at line 290 of file SemMesh.cpp.

References Node< SPACE_DIM >::MarkAsDeleted().

template<unsigned DIM>
PottsElement< DIM > * SemMesh< DIM >::GetElement ( unsigned  index) const
Parameters:
indexthe global index of a specified PottsElement.
Returns:
a pointer to the PottsElement

Definition at line 215 of file SemMesh.cpp.

template<unsigned DIM>
SemMesh< DIM >::SemElementIterator SemMesh< DIM >::GetElementIteratorBegin ( bool  skipDeletedElements = true) [inline]

Get an iterator to the first element in the mesh.

Parameters:
skipDeletedElementswhether to include deleted element

Definition at line 337 of file SemMesh.hpp.

template<unsigned DIM>
SemMesh< DIM >::SemElementIterator SemMesh< DIM >::GetElementIteratorEnd ( ) [inline]

Get an iterator to one past the last element in the mesh.

Definition at line 344 of file SemMesh.hpp.

template<unsigned DIM>
unsigned SemMesh< DIM >::GetNumAllElements ( ) const
Returns:
the number of PottsElements in the mesh, including those marked as deleted.

Definition at line 209 of file SemMesh.cpp.

template<unsigned DIM>
unsigned SemMesh< DIM >::GetNumAllNodes ( ) const [virtual]
Returns:
the number of Nodes in the mesh including deleted nodes.

Reimplemented from AbstractMesh< DIM, DIM >.

Definition at line 197 of file SemMesh.cpp.

template<unsigned DIM>
unsigned SemMesh< DIM >::GetNumElements ( ) const [virtual]
Returns:
the number of PottsElements in the mesh.

Definition at line 203 of file SemMesh.cpp.

template<unsigned DIM>
unsigned SemMesh< DIM >::GetNumNodes ( ) const [virtual]
Returns:
the number of undeleted Nodes in the mesh.

Reimplemented from AbstractMesh< DIM, DIM >.

Definition at line 191 of file SemMesh.cpp.

Referenced by SemMeshWriter< SPACE_DIM >::WriteFilesUsingMesh().

template<unsigned DIM>
template<class Archive >
void SemMesh< DIM >::load ( Archive &  archive,
const unsigned int  version 
) [inline, protected]

Loads a mesh by using SemMeshReader and the location in ArchiveLocationInfo.

Parameters:
archivethe archive
versionthe current version of this class

Definition at line 140 of file SemMesh.hpp.

template<unsigned DIM>
void SemMesh< DIM >::ReMesh ( )

Remesh the SemMesh. This cleans out elements and nodes that are marked as deleted and tidys up the vectors mElements and mNodes.

Definition at line 222 of file SemMesh.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and Node< SPACE_DIM >::rGetLocation().

template<unsigned DIM>
template<class Archive >
void SemMesh< DIM >::save ( Archive &  archive,
const unsigned int  version 
) const [inline, protected]

Archive the SemMesh and its member variables. Note that this will write out a SemMeshWriter file to wherever ArchiveLocationInfo has specified.

Parameters:
archivethe archive
versionthe current version of this class

Definition at line 119 of file SemMesh.hpp.

template<unsigned DIM>
unsigned SemMesh< DIM >::SolveBoundaryElementMapping ( unsigned  index) const [protected]

Solve boundary element mapping method. This overridden method is required as it is pure virtual in the base class.

Parameters:
indexthe global index of the boundary element

Definition at line 109 of file SemMesh.cpp.

template<unsigned DIM>
unsigned SemMesh< DIM >::SolveElementMapping ( unsigned  index) const [protected]

Solve element mapping method. This overridden method is required as it is pure virtual in the base class.

Parameters:
indexthe global index of the element

Definition at line 102 of file SemMesh.cpp.

template<unsigned DIM>
unsigned SemMesh< DIM >::SolveNodeMapping ( unsigned  index) const [protected, virtual]

Solve node mapping method. This overridden method is required as it is pure virtual in the base class.

Parameters:
indexthe global index of the node

Implements AbstractMesh< DIM, DIM >.

Definition at line 95 of file SemMesh.cpp.


Friends And Related Function Documentation

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

Needed for serialization.

Reimplemented from AbstractMesh< DIM, DIM >.

Definition at line 109 of file SemMesh.hpp.


Member Data Documentation

template<unsigned DIM>
std::vector<unsigned> SemMesh< DIM >::mDeletedElementIndices [protected]

Indices of elements that have been marked as deleted. These indices can be reused when adding new elements.

Definition at line 76 of file SemMesh.hpp.

Referenced by SemMesh< SPACE_DIM >::load(), and SemMesh< SPACE_DIM >::save().

template<unsigned DIM>
std::vector<unsigned> SemMesh< DIM >::mDeletedNodeIndices [protected]

Indices of elements that have been marked as deleted. These indices can be reused when adding new elements.

Definition at line 82 of file SemMesh.hpp.

Referenced by SemMesh< SPACE_DIM >::load(), and SemMesh< SPACE_DIM >::save().

template<unsigned DIM>
std::vector<PottsElement<DIM>*> SemMesh< DIM >::mElements [protected]

Vector of pointers to PottsElements.

Definition at line 70 of file SemMesh.hpp.

Referenced by SemMesh< DIM >::SemElementIterator::IsAtEnd().


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