IFEM  90A354
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DataWriter Class Referenceabstract

Stores and reads data from a file. More...

#include <DataExporter.h>

Inheritance diagram for DataWriter:
Inheritance graph
[legend]
Collaboration diagram for DataWriter:
Collaboration graph
[legend]

Public Member Functions

virtual ~DataWriter ()
 Empty destructor.
 
virtual int getLastTimeLevel ()=0
 Returns the last time level stored in file.
 
virtual void openFile (int level)=0
 Opens the file at a given time level. More...
 
virtual void closeFile (int level)=0
 Closes the file. More...
 
virtual void writeVector (int level, const DataEntry &entry)=0
 Writes a vector to file. More...
 
virtual void writeSIM (int level, double time, const DataEntry &entry, bool geometryUpdated, const std::string &prefix)=0
 Writes data from a SIM object to file. More...
 
virtual void writeNodalForces (int level, const DataEntry &entry)=0
 Writes nodal forces to file. More...
 
virtual void writeKnotspan (int level, const DataEntry &entry, const std::string &prefix)=0
 Writes a knotspan field to file. More...
 
virtual void writeBasis (int level, const DataEntry &entry, const std::string &prefix)=0
 Write a basis to file. More...
 
virtual bool writeTimeInfo (int level, double time)=0
 Writes time stepping info to file. More...
 
virtual bool writeLog (const std::string &data, const std::string &name)=0
 Write a log to output file. More...
 
const std::string & getName () const
 Returns the name of the file.
 

Protected Member Functions

 DataWriter (const std::string &name, const ProcessAdm &adm, const char *defaultExt=nullptr)
 Protected constructor as this is a purely virtual class.
 

Protected Attributes

std::string m_name
 File name.
 
int m_size
 Number of MPI nodes (processors)
 
int m_rank
 MPI rank (processor ID)
 

Detailed Description

Stores and reads data from a file.

A DataWriter is a backend for the DataExporter, they abstract different file formats.

Member Function Documentation

◆ closeFile()

virtual void DataWriter::closeFile ( int  level)
pure virtual

Closes the file.

Parameters
[in]levelLevel we just wrote to the file

Implemented in HDF5Writer.

◆ openFile()

virtual void DataWriter::openFile ( int  level)
pure virtual

Opens the file at a given time level.

Parameters
[in]levelThe requested time level

Implemented in HDF5Writer.

◆ writeBasis()

virtual void DataWriter::writeBasis ( int  level,
const DataEntry entry,
const std::string &  prefix 
)
pure virtual

Write a basis to file.

Parameters
[in]levelThe time level to write the basis at
[in]entryThe DataEntry describing the basis
[in]prefixPrefix for basis

Implemented in HDF5Writer.

◆ writeKnotspan()

virtual void DataWriter::writeKnotspan ( int  level,
const DataEntry entry,
const std::string &  prefix 
)
pure virtual

Writes a knotspan field to file.

Parameters
[in]levelThe time level to write the data at
[in]entryThe DataEntry describing the field
[in]prefixPrefix for field

Implemented in HDF5Writer.

◆ writeLog()

virtual bool DataWriter::writeLog ( const std::string &  data,
const std::string &  name 
)
pure virtual

Write a log to output file.

Parameters
dataText to write
nameName of log

Implemented in HDF5Writer.

◆ writeNodalForces()

virtual void DataWriter::writeNodalForces ( int  level,
const DataEntry entry 
)
pure virtual

Writes nodal forces to file.

Parameters
[in]levelThe time level to write the data at
[in]entryThe DataEntry describing the vector

Implemented in HDF5Writer.

◆ writeSIM()

virtual void DataWriter::writeSIM ( int  level,
double  time,
const DataEntry entry,
bool  geometryUpdated,
const std::string &  prefix 
)
pure virtual

Writes data from a SIM object to file.

Parameters
[in]levelThe time level to write the data at
[in]timeCurrent time
[in]entryThe DataEntry describing the vector
[in]geometryUpdatedWhether or not geometries should be written
[in]prefixField name prefix

Implemented in HDF5Writer.

◆ writeTimeInfo()

virtual bool DataWriter::writeTimeInfo ( int  level,
double  time 
)
pure virtual

Writes time stepping info to file.

Parameters
[in]levelThe time level to write the info at
[in]timeCurrent time

Implemented in HDF5Writer.

◆ writeVector()

virtual void DataWriter::writeVector ( int  level,
const DataEntry entry 
)
pure virtual

Writes a vector to file.

Parameters
[in]levelThe time level to write the vector at
[in]entryThe DataEntry describing the vector

Implemented in HDF5Writer.


The documentation for this class was generated from the following files: