Chaste  Release::2017.1
MutableElement< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <MutableElement.hpp>

+ Inheritance diagram for MutableElement< ELEMENT_DIM, SPACE_DIM >:
+ Collaboration diagram for MutableElement< ELEMENT_DIM, SPACE_DIM >:

Public Member Functions

 MutableElement (unsigned index)
 
 MutableElement (unsigned index, const std::vector< Node< SPACE_DIM > * > &rNodes)
 
virtual ~MutableElement ()
 
void RegisterWithNodes ()
 
void MarkAsDeleted ()
 
void ResetIndex (unsigned index)
 
void UpdateNode (const unsigned &rIndex, Node< SPACE_DIM > *pNode)
 
void DeleteNode (const unsigned &rIndex)
 
void AddNode (Node< SPACE_DIM > *pNode, const unsigned &rIndex)
 
unsigned GetNodeLocalIndex (unsigned globalIndex) const
 
virtual bool IsElementOnBoundary () const
 
- Public Member Functions inherited from AbstractElement< ELEMENT_DIM, SPACE_DIM >
 AbstractElement (unsigned index, const std::vector< Node< SPACE_DIM > * > &rNodes)
 
 AbstractElement (unsigned index=INDEX_IS_NOT_USED)
 
virtual ~AbstractElement ()
 
void ReplaceNode (Node< SPACE_DIM > *pOldNode, Node< SPACE_DIM > *pNewNode)
 
double GetNodeLocation (unsigned localIndex, unsigned dimension) const
 
c_vector< double, SPACE_DIM > GetNodeLocation (unsigned localIndex) const
 
unsigned GetNodeGlobalIndex (unsigned localIndex) const
 
Node< SPACE_DIM > * GetNode (unsigned localIndex) const
 
unsigned GetNumNodes () const
 
void AddNode (Node< SPACE_DIM > *pNode)
 
bool IsDeleted () const
 
unsigned GetIndex () const
 
void SetIndex (unsigned index)
 
bool GetOwnership () const
 
void SetOwnership (bool ownership)
 
void SetAttribute (double attribute)
 
double GetAttribute ()
 
unsigned GetUnsignedAttribute ()
 
void AddElementAttribute (double attribute)
 
std::vector< double > & rGetElementAttributes ()
 
unsigned GetNumElementAttributes ()
 

Private Member Functions

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

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractElement< ELEMENT_DIM, SPACE_DIM >
void ConstructElementAttributes ()
 
- Protected Attributes inherited from AbstractElement< ELEMENT_DIM, SPACE_DIM >
std::vector< Node< SPACE_DIM > * > mNodes
 
unsigned mIndex
 
bool mIsDeleted
 
bool mOwnership
 
ElementAttributes< ELEMENT_DIM, SPACE_DIM > * mpElementAttributes
 

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class MutableElement< ELEMENT_DIM, SPACE_DIM >

A mutable element containing functionality to add and remove nodes.

Definition at line 49 of file MutableElement.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MutableElement< ELEMENT_DIM, SPACE_DIM >::MutableElement ( unsigned  index)

Alternative constructor.

Parameters
indexglobal index of the element

Definition at line 41 of file MutableElement.cpp.

Referenced by MutableElement< DIM, DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MutableElement< ELEMENT_DIM, SPACE_DIM >::MutableElement ( unsigned  index,
const std::vector< Node< SPACE_DIM > * > &  rNodes 
)

Constructor.

Parameters
indexglobal index of the element
rNodesvector of Nodes associated with the element

Definition at line 47 of file MutableElement.cpp.

References MutableElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MutableElement< ELEMENT_DIM, SPACE_DIM >::~MutableElement ( )
virtual

Destructor.

Definition at line 58 of file MutableElement.cpp.

Referenced by MutableElement< DIM, DIM >::serialize().

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableElement< ELEMENT_DIM, SPACE_DIM >::AddNode ( Node< SPACE_DIM > *  pNode,
const unsigned rIndex 
)

Add a node to the element between nodes at rIndex and rIndex+1.

Parameters
rIndexthe local index of the node after which the new node is added
pNodea pointer to the new node

When constructing a VertexMesh as the Voronoi dual to a Delaunay mesh, each MutableElement is initially constructed without nodes. We therefore require the two cases below.

Definition at line 123 of file MutableElement.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.

Referenced by VertexElement< ELEMENT_DIM, SPACE_DIM >::AddFace(), Cylindrical2dVertexMesh::Cylindrical2dVertexMesh(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformProtorosetteResolution(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformRosetteRankDecrease(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT3Swap(), MutableElement< DIM, DIM >::serialize(), and VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexMesh().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableElement< ELEMENT_DIM, SPACE_DIM >::IsElementOnBoundary ( ) const
virtual

Get whether or not the element is on the boundary by seeing if contains boundary nodes.

Returns
whether or not the element is on the boundary.

Definition at line 165 of file MutableElement.cpp.

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

Referenced by MutableElement< DIM, DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableElement< ELEMENT_DIM, SPACE_DIM >::MarkAsDeleted ( )
virtual
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableElement< ELEMENT_DIM, SPACE_DIM >::ResetIndex ( unsigned  index)
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
template<class Archive >
void MutableElement< ELEMENT_DIM, SPACE_DIM >::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Serialize the object and its member variables.

Note that serialization of the mesh and cells is handled by load/save_construct_data.

Note also that member data related to writers is not saved - output must be set up again by the caller after a restart.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 68 of file MutableElement.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableElement< ELEMENT_DIM, SPACE_DIM >::UpdateNode ( const unsigned rIndex,
Node< SPACE_DIM > *  pNode 
)
virtual

Update node at the given index.

Parameters
rIndexis an local index to which node to change
pNodeis a pointer to the replacement node

Implements AbstractElement< ELEMENT_DIM, SPACE_DIM >.

Definition at line 96 of file MutableElement.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.

Referenced by MutableElement< DIM, DIM >::serialize().

Friends And Related Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 55 of file MutableElement.hpp.


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