AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
Document.hpp File Reference

Header file for Sina Document class. More...

#include "axom/config.hpp"
#include "axom/sina/core/Record.hpp"
#include "axom/sina/core/Relationship.hpp"
#include "conduit.hpp"
#include "conduit_relay.hpp"
#include "conduit_relay_io.hpp"
#include <memory>
#include <vector>

Classes

class  axom::sina::Document
 An object representing the top-level object of a Sina file. More...
 

Namespaces

 axom
 
 axom::sina
 

Macros

#define SINA_FILE_FORMAT_VERSION_MAJOR   1
 
#define SINA_FILE_FORMAT_VERSION_MINOR   0
 

Enumerations

enum class  axom::sina::Protocol { axom::sina::AUTO_DETECT = -1 , axom::sina::JSON = 0 , axom::sina::HDF5 = 1 }
 File format enum for explicit format specification. More...
 

Functions

void axom::sina::saveDocument (Document const &document, std::string const &fileName, Protocol protocol=Protocol::AUTO_DETECT)
 Save the given Document to the specified location. If the given file exists, it will be overwritten. More...
 
std::string axom::sina::getSinaFileFormatVersion ()
 Get the current file format version. More...
 
void axom::sina::restoreSlashes (const conduit::Node &modifiedNode, conduit::Node &restoredNode)
 
Document axom::sina::loadDocument (std::string const &path, Protocol protocol=Protocol::JSON)
 Load a document from the given path. Only records which this library knows about will be able to be loaded. More...
 
Document axom::sina::loadDocument (std::string const &path, RecordLoader const &recordLoader, Protocol protocol=Protocol::JSON)
 Load a document from the given path. More...
 
conduit::Node axom::sina::appendDocumentToJson (const std::string &jsonFilePath, const Document &newData, const int mergeProtocol=1, const bool skipValidation=false)
 Append the new records or, per-record, new data, user defined content, curves/curve sets, and library data of a Sina Document to an existing JSON file. For a full explanation of behavior, see appendDocumentToHDF5. Note that a JSON file must be entirely re-written for an append to function; it's more efficient for shorter files, but prefer HDF5 for large files (many timeseries/long timeseries) More...
 
conduit::Node axom::sina::appendDocumentToHDF5 (const std::string &hdf5FilePath, Document const &newData, const int mergeProtocol=1, const bool skipValidation=false)
 Append the new records or, per-record, new data, user defined content, curves/curve sets, and library data of a Sina Document to an existing HDF5 file. Appending is meant to allow a Sina document to grow as a simulation continues, i.e. by appending new snapshots into the same file, or by writing additional points of a timeseries to disk as they become available. HDF5 is the preferred filetype for heavy appending into, as it does not require being entirely re-written to file each time, unlike JSON. More...
 
void axom::sina::appendDocument (const Document &document, const std::string &filepath, int mergeProtocol=1, Protocol Protocol=Protocol::AUTO_DETECT)
 Append a Document to an existing file with automatic format detection. More...
 
template<typename ConduitRelayLike >
conduit::Node axom::sina::validateAppendDocument (ConduitRelayLike &appendTo, const conduit::Node &appendFrom, const std::string &endpoint, const int mergeProtocol, int record_num, const std::string &original_file_path="")
 Check a node against some file handle and return a Conduit node populated with any errors that would prevent appending. Primarily useful for dry run testing of what may be going wrong with an append. More...
 

Variables

const std::vector< std::string > axom::sina::supported_types
 
const std::string axom::sina::slashSubstitute = "__SINA_SLASHREPLACE__"
 The string used to replace '/' in parent node names when saving to HDF5. More...
 

Detailed Description

Header file for Sina Document class.

Macro Definition Documentation

◆ SINA_FILE_FORMAT_VERSION_MAJOR

#define SINA_FILE_FORMAT_VERSION_MAJOR   1

◆ SINA_FILE_FORMAT_VERSION_MINOR

#define SINA_FILE_FORMAT_VERSION_MINOR   0