Chaste  Release::3.4
Element< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <Element.hpp>

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

Public Member Functions

 Element (unsigned index, const std::vector< Node< SPACE_DIM > * > &rNodes, bool registerWithNodes=true)
 
 Element (const Element &rElement, const unsigned index)
 
void RegisterWithNodes ()
 
void MarkAsDeleted ()
 
void UpdateNode (const unsigned &rIndex, Node< SPACE_DIM > *pNode)
 
void ResetIndex (unsigned index)
 
c_vector< double, SPACE_DIM+1 > CalculateCircumsphere (c_matrix< double, SPACE_DIM, ELEMENT_DIM > &rJacobian, c_matrix< double, ELEMENT_DIM, SPACE_DIM > &rInverseJacobian)
 
double CalculateCircumsphereVolume ()
 
double CalculateQuality ()
 
c_vector< double, 2 > CalculateMinMaxEdgeLengths ()
 
c_vector< double, SPACE_DIM+1 > CalculateInterpolationWeights (const ChastePoint< SPACE_DIM > &rTestPoint)
 
c_vector< double, SPACE_DIM+1 > CalculateInterpolationWeightsWithProjection (const ChastePoint< SPACE_DIM > &rTestPoint)
 
c_vector< double, SPACE_DIM > CalculateXi (const ChastePoint< SPACE_DIM > &rTestPoint)
 
bool IncludesPoint (const ChastePoint< SPACE_DIM > &rTestPoint, bool strict=false)
 
- Public Member Functions inherited from AbstractTetrahedralElement< ELEMENT_DIM, SPACE_DIM >
 AbstractTetrahedralElement (unsigned index, const std::vector< Node< SPACE_DIM > * > &rNodes)
 
 AbstractTetrahedralElement (unsigned index=INDEX_IS_NOT_USED)
 
virtual ~AbstractTetrahedralElement ()
 
c_vector< double, SPACE_DIM > CalculateCentroid () const
 
void CalculateJacobian (c_matrix< double, SPACE_DIM, ELEMENT_DIM > &rJacobian, double &rJacobianDeterminant)
 
void CalculateWeightedDirection (c_vector< double, SPACE_DIM > &rWeightedDirection, double &rJacobianDeterminant)
 
c_vector< double, SPACE_DIM > CalculateNormal ()
 
void CalculateInverseJacobian (c_matrix< double, SPACE_DIM, ELEMENT_DIM > &rJacobian, double &rJacobianDeterminant, c_matrix< double, ELEMENT_DIM, SPACE_DIM > &rInverseJacobian)
 
double GetVolume (double determinant) const
 
void GetStiffnessMatrixGlobalIndices (unsigned problemDim, unsigned *pIndices) 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 ()
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractTetrahedralElement< ELEMENT_DIM, SPACE_DIM >
void RefreshJacobian (c_matrix< double, SPACE_DIM, ELEMENT_DIM > &rJacobian)
 
- 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 Element< ELEMENT_DIM, SPACE_DIM >

A concrete element class which inherits from AbstractTetrahedralElement.

Definition at line 53 of file Element.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
Element< ELEMENT_DIM, SPACE_DIM >::Element ( unsigned  index,
const std::vector< Node< SPACE_DIM > * > &  rNodes,
bool  registerWithNodes = true 
)

Constructor which takes in a vector of nodes.

Parameters
indexthe index of the element in the mesh
rNodesthe nodes owned by the element
registerWithNodeswhether to tell the nodes that they are contained in this element

Definition at line 46 of file Element.cpp.

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
Element< ELEMENT_DIM, SPACE_DIM >::Element ( const Element< ELEMENT_DIM, SPACE_DIM > &  rElement,
const unsigned  index 
)

"Copy" constructor which allows a new index to be specified.

Parameters
rElementan element to copy
indexthe index of the new element

Definition at line 56 of file Element.cpp.

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, SPACE_DIM+1 > Element< ELEMENT_DIM, SPACE_DIM >::CalculateCircumsphere ( c_matrix< double, SPACE_DIM, ELEMENT_DIM > &  rJacobian,
c_matrix< double, ELEMENT_DIM, SPACE_DIM > &  rInverseJacobian 
)

Calculate the circumsphere/circumcircle of this element.

After reconstructing a cylindrical 2d mesh, the Jacobian data of the periodic elements is not valid anymore. We want to use the jacobians computed before swapping the nodes.

Returns
a vector containing x_centre, y_centre,...,radius^2
Parameters
rJacobianthe Jacobian matrix
rInverseJacobianthe inverse Jacobian matrix

Definition at line 118 of file Element.cpp.

Referenced by MutableMesh< ELEMENT_DIM, SPACE_DIM >::CheckIsVoronoi().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double Element< ELEMENT_DIM, SPACE_DIM >::CalculateCircumsphereVolume ( )
Returns
the volume of the circumsphere, or area of the circumcircle, of this element.
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, SPACE_DIM+1 > Element< ELEMENT_DIM, SPACE_DIM >::CalculateInterpolationWeights ( const ChastePoint< SPACE_DIM > &  rTestPoint)
Returns
calculated interpolation weights: the vector (1-xi(0)-xi(1)-xi(2), xi(0), xi(1), xi(2)) (in the 3D case) for a given point. (see CalculateXi() documentation)
Parameters
rTestPointreference to the point

Definition at line 228 of file Element.cpp.

Referenced by AbstractNonlinearElasticitySolver< DIM >::AssembleOnBoundaryElementForPressureOnDeformedBc(), CellBasedPdeHandler< DIM >::GetPdeSolutionAtPoint(), and CellBasedPdeHandler< DIM >::SolvePdeAndWriteResultsToFile().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, SPACE_DIM+1 > Element< ELEMENT_DIM, SPACE_DIM >::CalculateInterpolationWeightsWithProjection ( const ChastePoint< SPACE_DIM > &  rTestPoint)
Returns
calculated interpolation weights (see CalculateInterpolationWeights() documentation), but if we are not within the element (one or more negative weights), we project onto the element, rather than extrapolating from it.
Parameters
rTestPointreference to the point

Definition at line 248 of file Element.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, 2 > Element< ELEMENT_DIM, SPACE_DIM >::CalculateMinMaxEdgeLengths ( )
Returns
calculated maximum and minimum edge lengths

Definition at line 203 of file Element.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double Element< ELEMENT_DIM, SPACE_DIM >::CalculateQuality ( )
Returns
the quality of a triangle/tetrahedron is the ratio between the volume of the shape and the volume of its circumsphere. This is normalised by dividing through by the Platonic ratio.

The quality of a triangle/tetrahedron is the ratio between the volume of the shape and the volume of its circumsphere. This is normalised by dividing through by the Platonic ratio.

Definition at line 163 of file Element.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, SPACE_DIM > Element< ELEMENT_DIM, SPACE_DIM >::CalculateXi ( const ChastePoint< SPACE_DIM > &  rTestPoint)
Returns
calculated xi at a given point. These are the values in the canonical element, using the the canonical element coordinate system (relative to node 0), corresponding to the test point in this element. For example, if the test point is node 0, xi=(0,0,0); if node 2, then xi=(0,1,0); if the test point is halfway between nodes 1 and 2 on the edge between then, then xi=(0.5,0.5,0); if the test point is the interior, then xi=(a,b,c), where a,b,c>0 and 1-a-b-c > 0.
Parameters
rTestPointreference to the point
Todo:
: #1361 ComputeContainingElements and related methods, and methods called by that down to here, should really take in const c_vector& rather than ChastePoints.
Todo:
#1326 This method shouldn't need a new Jacobian inverse for every Xi

Definition at line 290 of file Element.cpp.

References ChastePoint< DIM >::rGetLocation().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool Element< ELEMENT_DIM, SPACE_DIM >::IncludesPoint ( const ChastePoint< SPACE_DIM > &  rTestPoint,
bool  strict = false 
)
Returns
whether a given point lies inside this element.
Parameters
rTestPointreference to the point
strictwhether the point must not be too close to an edge/face (defaults to false)

Definition at line 313 of file Element.cpp.

Referenced by MutableMesh< ELEMENT_DIM, SPACE_DIM >::RefineElement().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void Element< ELEMENT_DIM, SPACE_DIM >::MarkAsDeleted ( )
virtual

Mark the element as having been removed from the mesh. Also notify nodes in the element that it has been removed.

Implements AbstractElement< ELEMENT_DIM, SPACE_DIM >.

Definition at line 74 of file Element.cpp.

Referenced by MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteBoundaryNodeAt().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void Element< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes ( )
virtual

Inform all nodes forming this element that they are in this element.

Implements AbstractElement< ELEMENT_DIM, SPACE_DIM >.

Definition at line 65 of file Element.cpp.

Referenced by AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMesh(), and Element< ELEMENT_DIM, SPACE_DIM >::Element().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void Element< ELEMENT_DIM, SPACE_DIM >::ResetIndex ( unsigned  index)

Reset the index of this element in the mesh.

Parameters
indexthe new index of the element

Definition at line 104 of file Element.cpp.

Referenced by MutableMesh< ELEMENT_DIM, SPACE_DIM >::AddElement().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void Element< 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

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 89 of file Element.cpp.

References Node< SPACE_DIM >::AddElement().

Referenced by MutableMesh< ELEMENT_DIM, SPACE_DIM >::RefineElement().


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