36 #include "AbstractMeshReader.hpp"
43 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
51 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
57 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
65 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
70 std::vector<double> empty;
74 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
77 return GetNextFaceData();
80 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
83 EXCEPTION(
"Random access is only implemented in mesh readers for binary mesh files.");
86 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
89 EXCEPTION(
"Random access is only implemented in mesh readers for binary mesh files.");
92 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
95 EXCEPTION(
"Random access is only implemented in mesh readers for binary mesh files.");
98 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
101 return GetFaceData(index);
104 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
107 EXCEPTION(
"Ncl files are only implemented in mesh readers for binary mesh files.");
110 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
116 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
122 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
128 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
134 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
140 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
146 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
152 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
155 EXCEPTION(
"Node permutations aren't supported by this reader");
160 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
166 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
172 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
175 EXCEPTION(
"Cable elements are not supported by this mesh format.");
181 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
188 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
195 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
202 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
205 : mpIndices(&rIndices),
220 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
228 if (mIndicesIterator != mpIndices->end())
230 next_index = *mIndicesIterator;
236 next_index = mpReader->GetNumElements();
242 next_index = mIndex + 1;
244 CacheData(next_index);
247 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
251 assert(mIndex < index || mIndex == 0u || index == mpReader->
GetNumElements());
254 if (mpReader->IsFileFormatBinary())
256 mLastDataRead = mpReader->GetElementData(index);
262 assert(mIndex == 0u);
264 mLastDataRead = mpReader->GetNextElementData();
267 while (mIndex < index)
269 mLastDataRead = mpReader->GetNextElementData();
277 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
284 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
291 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
298 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
301 : mpIndices(&rIndices),
316 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
324 if (mIndicesIterator != mpIndices->end())
326 next_index = *mIndicesIterator;
332 next_index = mpReader->GetNumNodes();
338 next_index = mIndex + 1;
340 CacheData(next_index);
343 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
347 assert(mIndex < index || mIndex == 0u || index == mpReader->
GetNumNodes());
350 if (mpReader->IsFileFormatBinary())
352 mLastDataRead = mpReader->GetNode(index);
358 assert(mIndex == 0u);
360 mLastDataRead = mpReader->GetNextNode();
363 while (mIndex < index)
365 mLastDataRead = mpReader->GetNextNode();
ElementIterator GetElementIteratorBegin()
std::set< unsigned >::const_iterator mIndicesIterator
std::set< unsigned >::const_iterator mIndicesIterator
virtual ElementData GetElementData(unsigned index)
virtual ElementData GetFaceData(unsigned index)
virtual unsigned GetNumCableElementAttributes() const
NodeIterator(unsigned index, AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > *pReader)
NodeIterator GetNodeIteratorEnd()
NodeIterator GetNodeIteratorBegin()
#define EXCEPTION(message)
virtual unsigned GetOrderOfElements()
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > * mpReader
const std::set< unsigned > * mpIndices
ElementIterator(unsigned index, AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > *pReader)
virtual bool HasNodePermutation()
ElementIterator GetElementIteratorEnd()
virtual ElementData GetNextCableElementData()
virtual std::vector< double > GetNode(unsigned index)
virtual unsigned GetNumElements() const =0
ElementData GetEdgeData(unsigned index)
ElementData GetNextEdgeData()
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > * mpReader
virtual bool HasNclFile()
unsigned GetNumEdges() const
virtual unsigned GetNumFaceAttributes() const
virtual unsigned GetNumElementAttributes() const
virtual bool GetReadContainingElementOfBoundaryElement()
virtual bool IsFileFormatBinary()
virtual unsigned GetOrderOfBoundaryElements()
virtual unsigned GetNumCableElements() const
void CacheData(unsigned index, bool firstRead=false)
virtual std::vector< unsigned > GetContainingElementIndices(unsigned index)
virtual std::string GetMeshFileBaseName()
void CacheData(unsigned index, bool firstRead=false)
const std::set< unsigned > * mpIndices
virtual unsigned GetNumNodes() const =0
virtual std::vector< double > GetNodeAttributes()
virtual const std::vector< unsigned > & rGetNodePermutation()