36#include "MixedDimensionMesh.hpp"
39template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
45template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
48 for (
unsigned i=0; i<mCableElements.size(); i++)
50 delete mCableElements[i];
54template<
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));
136template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
139 mCableElementsMapping[index] = this->mCableElements.size();
142template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
145 return mNumCableElements;
148template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
151 return mCableElements.size();
154template<
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];
169template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
175 unsigned tie_break_index = this->GetCableElement(elementIndex)->GetNodeGlobalIndex(0);
178 if (this->GetDistributedVectorFactory()->IsGlobalIndexLocal(tie_break_index))
195template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
198 return mNodeToCablesMapping.equal_range(pNode);
202template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
205 return mCableElements.begin();
208template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
211 return mCableElements.end();
#define EXCEPTION(message)
#define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS)
void SetAttribute(double attribute)
Node< SPACE_DIM > * GetNode(unsigned localIndex) const
unsigned GetNumNodes() const
virtual unsigned GetNumCableElementAttributes() const
virtual ElementData GetNextCableElementData()
virtual unsigned GetNumCableElements() const
virtual void ConstructFromMeshReader(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
std::vector< Element< 1, SPACE_DIM > * >::const_iterator CableElementIterator
std::pair< NodeCableIterator, NodeCableIterator > CableRangeAtNode
CableElementIterator GetCableElementIteratorEnd() const
CableRangeAtNode GetCablesAtNode(const Node< SPACE_DIM > *pNode)
unsigned GetNumLocalCableElements() const
void RegisterCableElement(unsigned index)
unsigned GetNumCableElements() const
Element< 1u, SPACE_DIM > * GetCableElement(unsigned globalElementIndex) const
bool CalculateDesignatedOwnershipOfCableElement(unsigned globalElementIndex)
MixedDimensionMesh(DistributedTetrahedralMeshPartitionType::type partitioningMethod=DistributedTetrahedralMeshPartitionType::METIS_LIBRARY)
void ConstructFromMeshReader(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
CableElementIterator GetCableElementIteratorBegin() const
std::vector< unsigned > NodeIndices