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

#include <MixedDimensionMesh.hpp>

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

Public Types

typedef std::multimap< const
Node< SPACE_DIM > *, Element< 1u, SPACE_DIM > * >::iterator 
NodeCableIterator
 
typedef std::pair
< NodeCableIterator,
NodeCableIterator
CableRangeAtNode
 
typedef std::vector< Element
< 1, SPACE_DIM >
* >::const_iterator 
CableElementIterator
 
- Public Types inherited from DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
typedef std::vector< Node
< SPACE_DIM >
* >::const_iterator 
HaloNodeIterator
 
- Public Types inherited from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
typedef std::vector
< BoundaryElement< ELEMENT_DIM-1,
SPACE_DIM >
* >::const_iterator 
BoundaryElementIterator
 
- Public Types inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
typedef std::vector< Node
< SPACE_DIM >
* >::const_iterator 
BoundaryNodeIterator
 

Public Member Functions

 MixedDimensionMesh (DistributedTetrahedralMeshPartitionType::type partitioningMethod=DistributedTetrahedralMeshPartitionType::METIS_LIBRARY)
 
 ~MixedDimensionMesh ()
 
void ConstructFromMeshReader (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
 
void RegisterCableElement (unsigned index)
 
unsigned GetNumCableElements () const
 
unsigned GetNumLocalCableElements () const
 
Element< 1u, SPACE_DIM > * GetCableElement (unsigned globalElementIndex) const
 
bool CalculateDesignatedOwnershipOfCableElement (unsigned globalElementIndex)
 
CableRangeAtNode GetCablesAtNode (const Node< SPACE_DIM > *pNode)
 
CableElementIterator GetCableElementIteratorBegin () const
 
CableElementIterator GetCableElementIteratorEnd () const
 
- Public Member Functions inherited from DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
 DistributedTetrahedralMesh (DistributedTetrahedralMeshPartitionType::type partitioningMethod=DistributedTetrahedralMeshPartitionType::PARMETIS_LIBRARY)
 
virtual ~DistributedTetrahedralMesh ()
 
void SetDistributedVectorFactory (DistributedVectorFactory *pFactory)
 
unsigned GetNumLocalNodes () const
 
unsigned GetNumHaloNodes () const
 
unsigned GetNumLocalElements () const
 
unsigned GetNumLocalBoundaryElements () const
 
unsigned GetNumNodes () const
 
unsigned GetNumAllNodes () const
 
unsigned GetNumElements () const
 
DistributedTetrahedralMeshPartitionType::type GetPartitionType () const
 
unsigned GetNumBoundaryElements () const
 
void GetHaloNodeIndices (std::vector< unsigned > &rHaloIndices) const
 
void SetProcessRegion (ChasteCuboid< SPACE_DIM > *pRegion)
 
ChasteCuboid< SPACE_DIM > * GetProcessRegion ()
 
bool CalculateDesignatedOwnershipOfElement (unsigned elementIndex)
 
bool CalculateDesignatedOwnershipOfBoundaryElement (unsigned faceIndex)
 
void ConstructLinearMesh (unsigned width)
 
void ConstructRectangularMesh (unsigned width, unsigned height, bool stagger=true)
 
void ConstructCuboid (unsigned width, unsigned height, unsigned depth)
 
virtual void Scale (const double xFactor=1.0, const double yFactor=1.0, const double zFactor=1.0)
 
Node< SPACE_DIM > * GetNodeOrHaloNode (unsigned index) const
 
virtual ChasteCuboid< SPACE_DIM > CalculateBoundingBox () const
 
virtual unsigned GetNearestNodeIndex (const ChastePoint< SPACE_DIM > &rTestPoint)
 
virtual c_vector< double, 2 > CalculateMinMaxEdgeLengths ()
 
void Rotate (c_matrix< double, SPACE_DIM, SPACE_DIM > rotationMatrix)
 
void Translate (const c_vector< double, SPACE_DIM > &rDisplacement)
 
HaloNodeIterator GetHaloNodeIteratorBegin () const
 
HaloNodeIterator GetHaloNodeIteratorEnd () const
 
- Public Member Functions inherited from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
ElementIterator GetElementIteratorBegin (bool skipDeletedElements=true)
 
ElementIterator GetElementIteratorEnd ()
 
 AbstractTetrahedralMesh ()
 
virtual ~AbstractTetrahedralMesh ()
 
unsigned GetNumAllElements () const
 
unsigned GetNumAllBoundaryElements () const
 
virtual unsigned GetNumVertices () const
 
virtual unsigned GetMaximumNodeIndex ()
 
Element< ELEMENT_DIM, SPACE_DIM > * GetElement (unsigned index) const
 
BoundaryElement< ELEMENT_DIM-1,
SPACE_DIM > * 
GetBoundaryElement (unsigned index) const
 
void ConstructFromMesh (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rOtherMesh)
 
BoundaryElementIterator GetBoundaryElementIteratorBegin () const
 
BoundaryElementIterator GetBoundaryElementIteratorEnd () const
 
virtual void GetInverseJacobianForElement (unsigned elementIndex, c_matrix< double, SPACE_DIM, ELEMENT_DIM > &rJacobian, double &rJacobianDeterminant, c_matrix< double, ELEMENT_DIM, SPACE_DIM > &rInverseJacobian) const
 
virtual void GetWeightedDirectionForBoundaryElement (unsigned elementIndex, c_vector< double, SPACE_DIM > &rWeightedDirection, double &rJacobianDeterminant) const
 
void CheckOutwardNormals ()
 
void ConstructRegularSlabMesh (double spaceStep, double width, double height=0, double depth=0)
 
void ConstructRegularSlabMeshWithDimensionSplit (unsigned dimension, double spaceStep, double width, double height=0, double depth=0)
 
unsigned CalculateMaximumNodeConnectivityPerProcess () const
 
void CalculateNodeExchange (std::vector< std::vector< unsigned > > &rNodesToSendPerProcess, std::vector< std::vector< unsigned > > &rNodesToReceivePerProcess)
 
unsigned GetContainingElementIndex (const ChastePoint< SPACE_DIM > &rTestPoint, bool strict=false, std::set< unsigned > testElements=std::set< unsigned >(), bool onlyTryWithTestElements=false)
 
unsigned GetNearestElementIndexFromTestElements (const ChastePoint< SPACE_DIM > &rTestPoint, std::set< unsigned > testElements)
 
- Public Member Functions inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
NodeIterator GetNodeIteratorBegin (bool skipDeletedNodes=true)
 
NodeIterator GetNodeIteratorEnd ()
 
 AbstractMesh ()
 
virtual ~AbstractMesh ()
 
unsigned GetNumBoundaryNodes () const
 
unsigned GetNumNodeAttributes () const
 
Node< SPACE_DIM > * GetNode (unsigned index) const
 
Node< SPACE_DIM > * GetNodeFromPrePermutationIndex (unsigned index) const
 
virtual void ReadNodesPerProcessorFile (const std::string &rNodesPerProcessorFile)
 
virtual DistributedVectorFactoryGetDistributedVectorFactory ()
 
virtual void PermuteNodes ()
 
BoundaryNodeIterator GetBoundaryNodeIteratorBegin () const
 
BoundaryNodeIterator GetBoundaryNodeIteratorEnd () const
 
std::string GetMeshFileBaseName () const
 
bool IsMeshOnDisk () const
 
const std::vector< unsigned > & rGetNodePermutation () const
 
virtual c_vector< double,
SPACE_DIM > 
GetVectorFromAtoB (const c_vector< double, SPACE_DIM > &rLocationA, const c_vector< double, SPACE_DIM > &rLocationB)
 
double GetDistanceBetweenNodes (unsigned indexA, unsigned indexB)
 
virtual double GetWidth (const unsigned &rDimension) const
 
void Translate (const double xMovement=0.0, const double yMovement=0.0, const double zMovement=0.0)
 
void Rotate (c_vector< double, 3 > axis, double angle)
 
void RotateX (const double theta)
 
void RotateY (const double theta)
 
void RotateZ (const double theta)
 
void Rotate (double theta)
 
virtual void RefreshMesh ()
 
bool IsMeshChanging () const
 
unsigned CalculateMaximumContainingElementsPerProcess () const
 
void SetMeshHasChangedSinceLoading ()
 

Private Member Functions

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

Private Attributes

std::vector< Element< 1u, SPACE_DIM > * > mCableElements
 
unsigned mNumCableElements
 
std::map< unsigned, unsignedmCableElementsMapping
 
std::multimap< const Node
< SPACE_DIM > *, Element< 1u, SPACE_DIM > * > 
mNodeToCablesMapping
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Member Functions inherited from DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
unsigned SolveNodeMapping (unsigned index) const
 
unsigned SolveElementMapping (unsigned index) const
 
unsigned SolveBoundaryElementMapping (unsigned index) const
 
- Protected Member Functions inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
ChasteCuboid< SPACE_DIM > CalculateBoundingBox (const std::vector< Node< SPACE_DIM > * > &rNodes) const
 
- Protected Attributes inherited from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
bool mMeshIsLinear
 
std::vector< Element
< ELEMENT_DIM, SPACE_DIM > * > 
mElements
 
std::vector< BoundaryElement
< ELEMENT_DIM-1, SPACE_DIM > * > 
mBoundaryElements
 
- Protected Attributes inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
std::vector< Node< SPACE_DIM > * > mNodes
 
std::vector< Node< SPACE_DIM > * > mBoundaryNodes
 
DistributedVectorFactorympDistributedVectorFactory
 
std::vector< unsignedmNodePermutation
 
std::string mMeshFileBaseName
 
bool mMeshChangesDuringSimulation
 

Detailed Description

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

A tetrahedral mesh that also supports embedded 1D cable elements.

Could be used for Purkinje or blood vessels, etc.

Definition at line 51 of file MixedDimensionMesh.hpp.

Member Typedef Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
typedef std::vector<Element<1, SPACE_DIM> *>::const_iterator MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::CableElementIterator

Definition of cable element Iterator type.

Definition at line 156 of file MixedDimensionMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
typedef std::pair<NodeCableIterator, NodeCableIterator> MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::CableRangeAtNode

The type returned by GetCablesAtNode.

Definition at line 112 of file MixedDimensionMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
typedef std::multimap<const Node<SPACE_DIM>*, Element<1u, SPACE_DIM>*>::iterator MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::NodeCableIterator

Iterator type over mNodeToCablesMapping.

Definition at line 109 of file MixedDimensionMesh.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::MixedDimensionMesh ( DistributedTetrahedralMeshPartitionType::type  partitioningMethod = DistributedTetrahedralMeshPartitionType::METIS_LIBRARY)

Constructor.

Parameters
partitioningMethoddefaults to METIS_LIBRARY, but in 1-D is always overridden in this constructor to be the DUMB partition

Definition at line 40 of file MixedDimensionMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::~MixedDimensionMesh ( )

Destructor - cleans up the cables

Definition at line 46 of file MixedDimensionMesh.cpp.

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::CalculateDesignatedOwnershipOfCableElement ( unsigned  globalElementIndex)

Determine whether or not the current process owns node 0 of this cable element (tie breaker to determine which process writes to file for when two or more share ownership of a cable element).

Returns
true if designated owner
Parameters
globalElementIndexis the global index of the cable element

Definition at line 167 of file MixedDimensionMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
Element< 1u, SPACE_DIM > * MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::GetCableElement ( unsigned  globalElementIndex) const

Get the cable element with a given index in the mesh.

Parameters
globalElementIndexthe global index of the cable element
Returns
a pointer to the cable element.

Definition at line 152 of file MixedDimensionMesh.cpp.

References EXCEPTION, and PetscTools::GetMyRank().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::CableElementIterator MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::GetCableElementIteratorBegin ( ) const
Returns
a pointer to the first boundary element in the mesh.

Definition at line 200 of file MixedDimensionMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::CableElementIterator MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::GetCableElementIteratorEnd ( ) const
Returns
a pointer to *one past* the last boundary element in the mesh (for consistency with STL iterators).

Definition at line 206 of file MixedDimensionMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::CableRangeAtNode MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::GetCablesAtNode ( const Node< SPACE_DIM > *  pNode)
Returns
the cables that are attached to the given node.
Parameters
pNodea node to find the adjoining cables of
Returns
the adjoining cables.

Definition at line 193 of file MixedDimensionMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::GetNumCableElements ( ) const
virtual
Returns
the number of cable elements.

Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 141 of file MixedDimensionMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::GetNumLocalCableElements ( ) const
Returns
the number of cable elements on this process.

Definition at line 146 of file MixedDimensionMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::RegisterCableElement ( unsigned  index)

Add the most recently constructed cable element to the global->local cable element mapping

Parameters
indexis the global index of cable element to be registered

Definition at line 135 of file MixedDimensionMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
template<class Archive >
void MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Serialize the mesh.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 144 of file MixedDimensionMesh.hpp.

Friends And Related Function Documentation

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

Needed for serialization.

Definition at line 136 of file MixedDimensionMesh.hpp.

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<Element<1u, SPACE_DIM>*> MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::mCableElements
private

The elements making up the 1D cables

Definition at line 124 of file MixedDimensionMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::map<unsigned, unsigned> MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::mCableElementsMapping
private

A map from global cable index to local index used by this process.

Definition at line 130 of file MixedDimensionMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::multimap<const Node<SPACE_DIM>*, Element<1u, SPACE_DIM>*> MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::mNodeToCablesMapping
private

Records which cables are attached to each node.

Definition at line 133 of file MixedDimensionMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM >::mNumCableElements
private

The global number of cables over all processes

Definition at line 127 of file MixedDimensionMesh.hpp.


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