36 #include "MixedDimensionMesh.hpp"
39 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
45 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
48 for (
unsigned i=0; i<mCableElements.size(); i++)
50 delete mCableElements[i];
54 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
65 for (
unsigned element_index=0; element_index < mNumCableElements; element_index++)
69 if (!this->mNodePermutation.empty())
71 for (
unsigned j=0; j<2; j++)
78 bool node_owned =
false;
79 for (
unsigned j=0; j<2; j++)
83 this->SolveNodeMapping(element_data.
NodeIndices[j]);
96 std::vector<Node<SPACE_DIM>*> nodes;
99 for (
unsigned j=0; j<2; j++)
106 nodes.push_back(this->GetNodeOrHaloNode(element_data.
NodeIndices[j]) );
115 RegisterCableElement(element_index);
116 this->mCableElements.push_back(p_element);
117 for (
unsigned node_index=0; node_index<p_element->
GetNumNodes(); ++node_index)
120 p_element->
GetNode(node_index), p_element));
134 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
137 mCableElementsMapping[index] = this->mCableElements.size();
140 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
143 return mNumCableElements;
145 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
148 return mCableElements.size();
151 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
154 std::map<unsigned, unsigned>::const_iterator element_position = mCableElementsMapping.find(globalElementIndex);
156 if (element_position == mCableElementsMapping.end())
161 unsigned index = element_position->second;
163 return mCableElements[index];
166 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
172 unsigned tie_break_index = this->GetCableElement(elementIndex)->GetNodeGlobalIndex(0);
175 if (this->GetDistributedVectorFactory()->IsGlobalIndexLocal(tie_break_index))
192 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
195 return mNodeToCablesMapping.equal_range(pNode);
199 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
202 return mCableElements.begin();
205 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
208 return mCableElements.end();
CableElementIterator GetCableElementIteratorEnd() const
void SetAttribute(double attribute)
unsigned GetNumLocalCableElements() const
void RegisterCableElement(unsigned index)
std::pair< NodeCableIterator, NodeCableIterator > CableRangeAtNode
virtual unsigned GetNumCableElementAttributes() const
#define EXCEPTION(message)
virtual void ConstructFromMeshReader(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
void ConstructFromMeshReader(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
std::vector< unsigned > NodeIndices
Node< SPACE_DIM > * GetNode(unsigned localIndex) const
virtual ElementData GetNextCableElementData()
CableElementIterator GetCableElementIteratorBegin() const
unsigned GetNumNodes() const
unsigned GetNumCableElements() const
bool CalculateDesignatedOwnershipOfCableElement(unsigned globalElementIndex)
#define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS)
virtual unsigned GetNumCableElements() const
MixedDimensionMesh(DistributedTetrahedralMeshPartitionType::type partitioningMethod=DistributedTetrahedralMeshPartitionType::METIS_LIBRARY)
CableRangeAtNode GetCablesAtNode(const Node< SPACE_DIM > *pNode)
Element< 1u, SPACE_DIM > * GetCableElement(unsigned globalElementIndex) const
std::vector< Element< 1, SPACE_DIM > * >::const_iterator CableElementIterator