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]) );
117 RegisterCableElement(element_index);
118 this->mCableElements.push_back(p_element);
119 for (
unsigned node_index=0; node_index<p_element->
GetNumNodes(); ++node_index)
122 p_element->
GetNode(node_index), p_element));
136 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
139 mCableElementsMapping[index] = this->mCableElements.size();
142 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
145 return mNumCableElements;
148 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
151 return mCableElements.size();
154 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
157 std::map<unsigned, unsigned>::const_iterator element_position = mCableElementsMapping.find(globalElementIndex);
159 if (element_position == mCableElementsMapping.end())
164 unsigned index = element_position->second;
166 return mCableElements[index];
169 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
175 unsigned tie_break_index = this->GetCableElement(elementIndex)->GetNodeGlobalIndex(0);
178 if (this->GetDistributedVectorFactory()->IsGlobalIndexLocal(tie_break_index))
195 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
198 return mNodeToCablesMapping.equal_range(pNode);
202 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
205 return mCableElements.begin();
208 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
211 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