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();
81 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
84 EXCEPTION(
"Random access is only implemented in mesh readers for binary mesh files.");
87 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
90 EXCEPTION(
"Random access is only implemented in mesh readers for binary mesh files.");
93 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
96 EXCEPTION(
"Random access is only implemented in mesh readers for binary mesh files.");
99 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
102 return GetFaceData(index);
105 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
108 EXCEPTION(
"Ncl files are only implemented in mesh readers for binary mesh files.");
111 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
117 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
123 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
129 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
135 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
141 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
147 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
153 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
156 EXCEPTION(
"Node permutations aren't supported by this reader");
161 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
167 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
173 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
176 EXCEPTION(
"Cable elements are not supported by this mesh format.");
182 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
189 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
196 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
203 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
206 : mpIndices(&rIndices),
209 if (mpIndices->empty())
211 mIndex = mpReader->GetNumElements();
215 mIndicesIterator = mpIndices->begin();
217 CacheData(*mIndicesIterator,
true);
221 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
248 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
252 assert(mIndex < index || mIndex == 0u || index == mpReader->
GetNumElements());
255 if (mpReader->IsFileFormatBinary())
257 mLastDataRead = mpReader->GetElementData(index);
263 assert(mIndex == 0u);
265 mLastDataRead = mpReader->GetNextElementData();
268 while (mIndex < index)
270 mLastDataRead = mpReader->GetNextElementData();
279 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
286 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
293 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
300 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
303 : mpIndices(&rIndices),
306 if (mpIndices->empty())
308 mIndex = mpReader->GetNumNodes();
312 mIndicesIterator = mpIndices->begin();
314 CacheData(*mIndicesIterator,
true);
318 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
345 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
349 assert(mIndex < index || mIndex == 0u || index == mpReader->
GetNumNodes());
352 if (mpReader->IsFileFormatBinary())
354 mLastDataRead = mpReader->GetNode(index);
360 assert(mIndex == 0u);
362 mLastDataRead = mpReader->GetNextNode();
365 while (mIndex < index)
367 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 GetNodeIteratorEnd()
NodeIterator GetNodeIteratorBegin()
#define EXCEPTION(message)
virtual unsigned GetOrderOfElements()
const std::set< unsigned > * mpIndices
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()
virtual bool HasNclFile()
unsigned GetNumEdges() const
AbstractMeshReader * mpReader
virtual unsigned GetNumFaceAttributes() const
AbstractMeshReader * mpReader
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()