13#ifndef __LSDynaFamily_h
14#define __LSDynaFamily_h
33#define VTK_LSDYNA_BADFILE -1
34#define VTK_LSDYNA_TELL(fid) lseek(fid, 0, SEEK_CUR)
35#define VTK_LSDYNA_SEEK(fid, off, whence) lseek(fid, off, whence)
36#define VTK_LSDYNA_SEEKTELL(fid, off, whence) lseek(fid, off, whence)
37#define VTK_LSDYNA_READ(fid, ptr, cnt) read(fid, ptr, cnt)
38#define VTK_LSDYNA_ISBADFILE(fid) (fid < 0)
39#define VTK_LSDYNA_CLOSEFILE(fid) close(fid)
43#define VTK_LSDYNA_BADFILE 0
44#define VTK_LSDYNA_TELL(fid) ftell(fid)
45#define VTK_LSDYNA_SEEK(fid, off, whence) fseek(fid, off, whence)
46#define VTK_LSDYNA_SEEKTELL(fid, off, whence) fseek(fid, off, whence), ftell(fid)
47#define VTK_LSDYNA_READ(fid, ptr, cnt) fread(ptr, 1, cnt, fid)
48#define VTK_LSDYNA_ISBADFILE(fid) (fid == 0)
49#define VTK_LSDYNA_CLOSEFILE(fid) fclose(fid)
51#ifdef VTKSNL_HAVE_ERRNO_H
55VTK_ABI_NAMESPACE_BEGIN
117 this->Marks[i] = mark;
154 template <
typename T>
247 struct BufferingInfo;
255 fprintf(stderr,
"Read char past end of buffer\n");
263 fprintf(stderr,
"Read float past end of buffer\n");
268 vtkTypeFloat32 value;
269 memcpy(&value, &this->
Chunk[this->
ChunkWord++ << 2],
sizeof(value));
275 vtkTypeFloat64 value;
276 memcpy(&value, &this->
Chunk[this->
ChunkWord++ << 3],
sizeof(value));
287 fprintf(stderr,
"Read int past end of buffer\n");
294 memcpy(&value, &this->
Chunk[this->
ChunkWord++ << 2],
sizeof(value));
301 memcpy(&value, &this->
Chunk[this->
ChunkWord++ << 3],
sizeof(value));
311 return reinterpret_cast<T*
>(this->
Chunk);
LSDynaFamilySectionMark Marks[NumberOfSectionTypes]
vtkIdType GetCurrentFWord() const
int BufferChunk(WordType wType, vtkIdType chunkSizeInWords)
int ScanDatabaseDirectory()
vtkIdType GetNextWordAsInt()
static const char * SectionTypeNames[]
unsigned char * Chunk
A buffer containing file contents of file FNum starting with word FWord.
BufferingInfo * BufferInfo
vtkIdType StateSize
How many words is a timestep on disk?
void SetDatabaseBaseName(const std::string &bn)
int WordSize
Whether words are 4 or 8 bytes.
std::vector< int > Adaptations
Which files mark the start of a new mesh adaptation.
std::vector< int > TimeAdaptLevels
The adaptation level associated with each time step.
int GetCurrentAdaptLevel() const
std::vector< LSDynaFamilyAdaptLevel > AdaptationsMarkers
A vector of arrays of offsets to various header information sections (that do not vary with timestep)...
static const float EOFMarker
int DetermineStorageModel()
int SkipToWord(SectionType sType, vtkIdType sId, vtkIdType wordNumber)
vtkIdType TimeStep
A comprehensive list of all time values across all files (and mesh adaptations)
double GetNextWordAsFloat()
vtkIdType GetNumberOfFiles()
int FAdapt
The current adaptation level.
int SkipWords(vtkIdType numWords)
int SwapEndian
Whether files are reverse endian-ness of architecture.
vtkIdType GetNextChunk(const WordType &wType)
std::string GetDatabaseBaseName()
std::string GetDatabaseDirectory()
vtkIdType FNum
The index of currently open file descriptor into list of files.
std::vector< vtkIdType > FileSizes
The size of each file in the database.
void SetDatabaseDirectory(const std::string &dd)
std::string DatabaseDirectory
The directory containing d3plot files.
vtkLSDynaFile_t FD
The currently open file descriptor.
vtkIdType GetStateSize() const
vtkIdType ChunkWord
A pointer to the next word in Chunk that will be returned when the reader requests a word.
vtkIdType GetFileSize(int i)
vtkIdType InitPartialChunkBuffering(const vtkIdType &numTuples, const vtkIdType &numComps)
std::vector< int > FileAdaptLevels
The adaptation level associated with each file.
void DumpMarks(std::ostream &os)
Print all adaptation and time step marker information.
vtkIdType ChunkAlloc
The allocated size (in words) of Chunk.
std::string DatabaseBaseName
The name (title string) of the database.
int TimeAdaptLevel(int i) const
void MarkSectionStart(int adaptLevel, SectionType m)
std::string GetFileName(int i)
void SetStateSize(vtkIdType sz)
static const char * SectionTypeToString(SectionType s)
std::vector< LSDynaFamilySectionMark > TimeStepMarks
An array of bookmarks pointing to the start of state information for each timestep.
int JumpToMark(SectionType m)
char * GetNextWordAsChars()
std::vector< std::string > Files
The list of files that make up the database.
vtkIdType FWord
The offset of Chunk in currently open file.