28 #ifndef __LSDynaFamily_h 29 #define __LSDynaFamily_h 39 #include <sys/types.h> 48 #define VTK_LSDYNA_BADFILE -1 49 #define VTK_LSDYNA_TELL(fid) lseek(fid, 0, SEEK_CUR) 50 #define VTK_LSDYNA_SEEK(fid, off, whence) lseek(fid, off, whence) 51 #define VTK_LSDYNA_SEEKTELL(fid, off, whence) lseek(fid, off, whence) 52 #define VTK_LSDYNA_READ(fid, ptr, cnt) read(fid, ptr, cnt) 53 #define VTK_LSDYNA_ISBADFILE(fid) (fid < 0) 54 #define VTK_LSDYNA_CLOSEFILE(fid) close(fid) 58 #define VTK_LSDYNA_BADFILE 0 59 #define VTK_LSDYNA_TELL(fid) ftell(fid) 60 #define VTK_LSDYNA_SEEK(fid, off, whence) fseek(fid, off, whence) 61 #define VTK_LSDYNA_SEEKTELL(fid, off, whence) fseek(fid, off, whence), ftell(fid) 62 #define VTK_LSDYNA_READ(fid, ptr, cnt) fread(ptr, 1, cnt, fid) 63 #define VTK_LSDYNA_ISBADFILE(fid) (fid == 0) 64 #define VTK_LSDYNA_CLOSEFILE(fid) fclose(fid) 66 #ifdef VTKSNL_HAVE_ERRNO_H 131 this->Marks[i] = mark;
168 template <
typename T>
261 struct BufferingInfo;
269 fprintf(stderr,
"Read char past end of buffer\n");
277 fprintf(stderr,
"Read float past end of buffer\n");
282 vtkTypeFloat32
value;
289 vtkTypeFloat64
value;
301 fprintf(stderr,
"Read int past end of buffer\n");
322 template <
typename T>
325 return reinterpret_cast<T*
>(this->
Chunk);
328 #endif // __LSDynaFamily_h static const float EOFMarker
void MarkSectionStart(int adapteLevel, SectionType m)
BufferingInfo * BufferInfo
std::vector< int > TimeAdaptLevels
The adaptation level associated with each time step.
vtkIdType StateSize
How many words is a timestep on disk?
std::vector< LSDynaFamilyAdaptLevel > AdaptationsMarkers
A vector of arrays of offsets to various header information sections (that do not vary with timestep)...
std::vector< std::string > Files
The list of files that make up the database.
vtkIdType GetNextWordAsInt()
void DumpMarks(std::ostream &os)
Print all adaptation and time step marker information.
vtkIdType GetFileSize(int i)
vtkLSDynaFile_t FD
The currently open file descriptor.
vtkIdType GetNumberOfFiles()
int FAdapt
The current adaptation level.
vtkIdType InitPartialChunkBuffering(const vtkIdType &numTuples, const vtkIdType &numComps)
std::string GetDatabaseDirectory()
std::vector< vtkIdType > FileSizes
The size of each file in the database.
vtkIdType ChunkAlloc
The allocated size (in words) of Chunk.
std::vector< int > Adaptations
Which files mark the start of a new mesh adaptation.
int DetermineStorageModel()
int GetCurrentAdaptLevel() const
unsigned char * Chunk
A buffer containing file contents of file FNum starting with word FWord.
std::string GetFileName(int i)
std::vector< LSDynaFamilySectionMark > TimeStepMarks
An array of bookmarks pointing to the start of state information for each timestep.
void SetDatabaseBaseName(const std::string &bn)
int JumpToMark(SectionType m)
int WordSize
Whether words are 4 or 8 bytes.
void SetDatabaseDirectory(const std::string &dd)
vtkIdType ChunkWord
A pointer to the next word in Chunk that will be returned when the reader requests a word...
int ScanDatabaseDirectory()
vtkIdType GetCurrentFWord() const
char * GetNextWordAsChars()
LSDynaFamilySectionMark Marks[NumberOfSectionTypes]
vtkIdType FWord
The offset of Chunk in currently open file.
int SkipToWord(SectionType sType, vtkIdType sId, vtkIdType wordNumber)
int SwapEndian
Whether files are reverse endian-ness of architecture.
std::string DatabaseBaseName
The name (title string) of the database.
std::string GetDatabaseBaseName()
std::string DatabaseDirectory
The directory containing d3plot files.
int SkipWords(vtkIdType numWords)
vtkIdType GetNextChunk(const WordType &wType)
static const char * SectionTypeNames[]
vtkIdType FNum
The index of currently open file descriptor into list of files.
vtkIdType TimeStep
A comprehensive list of all time values across all files (and mesh adaptations)
double GetNextWordAsFloat()
vtkIdType GetStateSize() const
std::vector< int > FileAdaptLevels
The adaptation level associated with each file.
int TimeAdaptLevel(int i) const
void SetStateSize(vtkIdType sz)
int BufferChunk(WordType wType, vtkIdType chunkSizeInWords)
static const char * SectionTypeToString(SectionType s)