|
IFEM
90A354
|
Administer and write data using DataWriters. More...
#include <DataExporter.h>


Classes | |
| struct | FileEntry |
| A structure holding information about registered fields. More... | |
Public Types | |
| enum | FieldType { VECTOR , INTVECTOR , KNOTSPAN , SIM , NODALFORCES , BASIS } |
| Supported field types. | |
| enum | Results { PRIMARY = 1 , DISPLACEMENT = 2 , SECONDARY = 4 , NORMS = 8 , EIGENMODES = 16 , ONCE = 32 , GRID = 128 , REDUNDANT = 256 , L2G_NODE = 512 , ELEMENT_MASK = 1024 } |
| An enum used to describe the results to write from a SIM. More... | |
Public Member Functions | |
| DataExporter (bool dynWriters=false, int ndump=1, int level0=0) | |
| Default constructor. More... | |
| virtual | ~DataExporter () |
| The destructor deletes the writers if dynWriters was true. | |
| void | registerWriter (DataWriter *writer) |
| Adds the data writer to the list of registered writers. | |
| bool | registerField (const std::string &name, const std::string &description, FieldType field, int results=PRIMARY, const std::string &prefix="", int ncmps=0) |
| Registers an entry for storage. More... | |
| bool | setFieldValue (const std::string &name, const void *data, const void *data2=nullptr, const void *data3=nullptr, const void *data4=nullptr) |
| Sets the data values for a registered field. More... | |
| bool | dumpTimeLevel (const TimeStep *tp=nullptr, bool geoUpd=false, bool doLog=false) |
| Dumps all registered fields using the registered writers. More... | |
| virtual void | OnControl (const tinyxml2::XMLElement *context) |
| Callback on receiving a XML control block from external controller. | |
| virtual std::string | GetContext () const |
| Returns context name for callback for external controller. | |
| std::string | getName () const |
| Returns name from (first) data writer. | |
| int | getTimeLevel () const |
| Returns current time level of the exporter. | |
| int | getStride () const |
| Returns the data dump stride. | |
Protected Attributes | |
| std::map< std::string, FileEntry > | m_entry |
| A map of field names -> field info structures. | |
| std::vector< DataWriter * > | m_writers |
| A vector of registered data writers. | |
| bool | m_delete |
| If true, we are in charge of freeing up datawriters. | |
| int | m_ndump |
| Time level stride for dumping. | |
| int | m_level |
| Current time level. | |
| int | m_last_step |
| Last time step we dumped for. | |
Administer and write data using DataWriters.
This class holds a list of data writers, and the SIM classes or vectors to write.
An enum used to describe the results to write from a SIM.
| Enumerator | |
|---|---|
| PRIMARY | Storage of primary solutions. |
| DISPLACEMENT | Storage of vector fields as displacements. |
| SECONDARY | Storage of secondary field. |
| NORMS | Storage of norms. |
| EIGENMODES | Storage of eigenmodes. |
| ONCE | Only write field once. |
| GRID | Always store an updated grid. |
| REDUNDANT | Field is redundantly calculated on all processes. |
| L2G_NODE | Storage of local-to-global node mapping. |
| ELEMENT_MASK | Storage of element activation flags. |
|
inline |
Default constructor.
| [in] | dynWriters | If true, delete the writers on destruction |
| [in] | ndump | Interval between dumps |
| [in] | level0 | Time level to start dumping from (in case of restart) |
| bool DataExporter::dumpTimeLevel | ( | const TimeStep * | tp = nullptr, |
| bool | geoUpd = false, |
||
| bool | doLog = false |
||
| ) |
Dumps all registered fields using the registered writers.
| [in] | tp | Current time stepping info |
| [in] | geoUpd | If true, write updated geometry as well |
| [in] | doLog | If true, write a log message when dumping data |
References IFEM::cout, m_entry, m_last_step, m_level, m_ndump, m_writers, TimeStep::multiSteps(), ONCE, PROFILE1, TimeStep::step, TimeDomain::t, and TimeStep::time.
Referenced by SIMSolver< T1 >::saveState(), SIMSolverAdapInternal< T1 >::saveState(), and SIMSolverStat< T1 >::solveProblem().
| bool DataExporter::registerField | ( | const std::string & | name, |
| const std::string & | description, | ||
| FieldType | field, | ||
| int | results = PRIMARY, |
||
| const std::string & | prefix = "", |
||
| int | ncmps = 0 |
||
| ) |
Registers an entry for storage.
| [in] | name | Name of entry |
| [in] | description | Description of entry |
| [in] | field | Type of entry |
| [in] | results | Which results to store |
| [in] | prefix | Field name prefix |
| [in] | ncmps | Number of field components |
References DataExporter::FileEntry::description, DataExporter::FileEntry::enabled, DataExporter::FileEntry::field, m_entry, DataExporter::FileEntry::ncmps, DataExporter::FileEntry::prefix, and DataExporter::FileEntry::results.
| bool DataExporter::setFieldValue | ( | const std::string & | name, |
| const void * | data, | ||
| const void * | data2 = nullptr, |
||
| const void * | data3 = nullptr, |
||
| const void * | data4 = nullptr |
||
| ) |
Sets the data values for a registered field.
| [in] | name | Name the field is registered with |
| [in] | data | The value to set the field to |
| [in] | data2 | (optional) The secondary data of the field |
| [in] | data3 | (optional) The third data of the field |
| [in] | data4 | (optional) The fourth data of the field |
References m_entry.