28 #ifndef __LSDynaFamily_h 29 #define __LSDynaFamily_h 32 #include "LSDynaExport.h" 39 #include <sys/types.h> 49 # define VTK_LSDYNA_BADFILE -1 50 # define VTK_LSDYNA_TELL(fid) lseek( fid, 0, SEEK_CUR ) 51 # define VTK_LSDYNA_SEEK(fid,off,whence) lseek( fid, off, whence ) 52 # define VTK_LSDYNA_SEEKTELL(fid,off,whence) lseek( fid, off, whence ) 53 # define VTK_LSDYNA_READ(fid,ptr,cnt) read(fid,ptr,cnt) 54 # define VTK_LSDYNA_ISBADFILE(fid) (fid < 0) 55 # define VTK_LSDYNA_CLOSEFILE(fid) close(fid) 59 # define VTK_LSDYNA_BADFILE 0 60 # define VTK_LSDYNA_TELL(fid) ftell( fid ) 61 # define VTK_LSDYNA_SEEK(fid,off,whence) fseek( fid, off, whence ) 62 # define VTK_LSDYNA_SEEKTELL(fid,off,whence) fseek( fid, off, whence ), ftell( fid ) 63 # define VTK_LSDYNA_READ(fid,ptr,cnt) fread(ptr,1,cnt,fid) 64 # define VTK_LSDYNA_ISBADFILE(fid) (fid == 0) 65 # define VTK_LSDYNA_CLOSEFILE(fid) fclose(fid) 67 #ifdef VTKSNL_HAVE_ERRNO_H 131 this->Marks[i] = mark;
260 struct BufferingInfo;
267 if ( this->
ChunkWord >= this->
ChunkValid ) fprintf( stderr,
"Read char past end of buffer\n" );
274 if ( this->
ChunkWord >= this->
ChunkValid ) fprintf( stderr,
"Read float past end of buffer\n" );
279 vtkTypeFloat32
value;
280 memcpy(&value, &this->
Chunk[ this->
ChunkWord++ << 2 ],
sizeof(value));
286 vtkTypeFloat64
value;
287 memcpy(&value, &this->
Chunk[ this->
ChunkWord++ << 3 ],
sizeof(value));
298 fprintf( stderr,
"Read int past end of buffer\n" );
305 memcpy(&value, &this->
Chunk[ this->
ChunkWord++ << 2 ],
sizeof(value));
312 memcpy(&value, &this->
Chunk[ this->
ChunkWord++ << 3 ],
sizeof(value));
322 return reinterpret_cast<T*
>(this->
Chunk);
326 #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()
vtkIdType GetStateSize() const
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()
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()
char * GetNextWordAsChars()
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()
std::vector< int > FileAdaptLevels
The adaptation level associated with each file.
int GetCurrentAdaptLevel() const
void SetStateSize(vtkIdType sz)
int BufferChunk(WordType wType, vtkIdType chunkSizeInWords)
int TimeAdaptLevel(int i) const
static const char * SectionTypeToString(SectionType s)
vtkIdType GetCurrentFWord() const