Go to the documentation of this file.
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;
286 vtkTypeFloat64
value;
298 fprintf( stderr,
"Read int past end of buffer\n" );
322 return reinterpret_cast<T*>(this->
Chunk);
326 #endif // __LSDynaFamily_h
vtkIdType GetNextWordAsInt()
int WordSize
Whether words are 4 or 8 bytes.
char * GetNextWordAsChars()
vtkIdType GetNumberOfFiles()
unsigned char * Chunk
A buffer containing file contents of file FNum starting with word FWord.
vtkIdType GetStateSize() const
std::string GetFileName(int i)
int GetCurrentAdaptLevel() const
vtkIdType ChunkAlloc
The allocated size (in words) of Chunk.
std::string GetDatabaseDirectory()
std::vector< LSDynaFamilySectionMark > TimeStepMarks
An array of bookmarks pointing to the start of state information for each timestep.
vtkIdType GetFileSize(int i)
vtkIdType FNum
The index of currently open file descriptor into list of files.
int SkipWords(vtkIdType numWords)
std::vector< std::string > Files
The list of files that make up the database.
LSDynaFamilySectionMark Marks[NumberOfSectionTypes]
int ScanDatabaseDirectory()
vtkIdType GetCurrentFWord() const
void DumpMarks(std::ostream &os)
Print all adaptation and time step marker information.
int SkipToWord(SectionType sType, vtkIdType sId, vtkIdType wordNumber)
void SetDatabaseBaseName(const std::string &bn)
double GetNextWordAsFloat()
static const char * SectionTypeToString(SectionType s)
static const float EOFMarker
int SwapEndian
Whether files are reverse endian-ness of architecture.
std::vector< int > TimeAdaptLevels
The adaptation level associated with each time step.
std::string GetDatabaseBaseName()
BufferingInfo * BufferInfo
std::vector< LSDynaFamilyAdaptLevel > AdaptationsMarkers
A vector of arrays of offsets to various header information sections (that do not vary with timestep)...
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.
vtkIdType GetNextChunk(const WordType &wType)
void SetStateSize(vtkIdType sz)
static const char * SectionTypeNames[]
int BufferChunk(WordType wType, vtkIdType chunkSizeInWords)
int TimeAdaptLevel(int i) const
vtkLSDynaFile_t FD
The currently open file descriptor.
std::vector< vtkIdType > FileSizes
The size of each file in the database.
int FAdapt
The current adaptation level.
std::vector< int > FileAdaptLevels
The adaptation level associated with each file.
vtkIdType InitPartialChunkBuffering(const vtkIdType &numTuples, const vtkIdType &numComps)
vtkIdType FWord
The offset of Chunk in currently open file.
void MarkSectionStart(int adapteLevel, SectionType m)
std::string DatabaseDirectory
The directory containing d3plot files.
vtkIdType TimeStep
A comprehensive list of all time values across all files (and mesh adaptations)
int JumpToMark(SectionType m)
vtkIdType StateSize
How many words is a timestep on disk?
int DetermineStorageModel()
std::vector< int > Adaptations
Which files mark the start of a new mesh adaptation.
std::string DatabaseBaseName
The name (title string) of the database.