SENSEI
A frame work for generic in situ analytics
|
Base class that defines the interface for fetching data from a simulation. More...
#include <DataAdaptor.h>
Public Member Functions | |
senseiBaseTypeMacro (DataAdaptor, svtkObjectBase) | |
void | PrintSelf (ostream &os, svtkIndent indent) override |
Prints the current state of the adaptor. More... | |
virtual int | SetCommunicator (MPI_Comm comm) |
Set the communicator used by the adaptor. More... | |
MPI_Comm | GetCommunicator () |
Get the communicator used by the adaptor. More... | |
virtual int | GetNumberOfMeshes (unsigned int &numMeshes)=0 |
Gets the number of meshes a simulation can provide. More... | |
virtual int | GetMeshMetadata (unsigned int id, sensei::MeshMetadataPtr &metadata)=0 |
Get metadata of the i'th mesh. More... | |
virtual int | GetMesh (const std::string &meshName, bool structureOnly, svtkDataObject *&mesh)=0 |
Fetches the requested data object from the simulation. More... | |
virtual int | AddGhostNodesArray (svtkDataObject *mesh, const std::string &meshName) |
Adds ghost nodes on the specified mesh. More... | |
virtual int | AddGhostCellsArray (svtkDataObject *mesh, const std::string &meshName) |
Adds ghost cells on the specified mesh. More... | |
virtual int | AddArray (svtkDataObject *mesh, const std::string &meshName, int association, const std::string &arrayName)=0 |
Fetches the named array from the simulation and adds it to the passed mesh. More... | |
virtual int | AddArrays (svtkDataObject *mesh, const std::string &meshName, int association, const std::vector< std::string > &arrayNames) |
Fetches multiple arrays from the simulation and adds them to the mesh. More... | |
virtual int | ReleaseData () |
Release data allocated for the current timestep. More... | |
virtual double | GetDataTime () |
Get the current simulated time. More... | |
virtual void | SetDataTime (double time) |
Set the current simulated time. More... | |
virtual long | GetDataTimeStep () |
Get the current time step. More... | |
virtual void | SetDataTimeStep (long index) |
Set the current simulated time step. More... | |
Protected Member Functions | |
DataAdaptor (const DataAdaptor &)=delete | |
void | operator= (const DataAdaptor &)=delete |
Protected Attributes | |
InternalsType * | Internals |
MPI_Comm | Comm |
Base class that defines the interface for fetching data from a simulation.
Simulation codes provide an implementation of this interface which is used by data consumers to fetch simulation data for processing, movement, or I/O.
|
pure virtual |
Fetches the named array from the simulation and adds it to the passed mesh.
Implementers should pass the data by zero copy when possible. See svtkAOSDataArrayTemplate and svtkSOADataArrayTemplate for details of passing data zero copy.
[in] | mesh | the VTK object returned from GetMesh |
[in] | meshName | the name of the mesh on which the array is stored |
[in] | association | field association; one of svtkDataObject::FieldAssociations or svtkDataObject::AttributeTypes. |
[in] | arrayName | name of the array |
Implemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ProgrammableDataAdaptor, sensei::ADIOS2DataAdaptor, sensei::SVTKDataAdaptor, sensei::HDF5DataAdaptor, and sensei::ConduitDataAdaptor.
|
virtual |
Fetches multiple arrays from the simulation and adds them to the mesh.
Implementers typically do not have to override this method.
[in] | mesh | the VTK object returned from GetMesh |
[in] | meshName | the name of the mesh on which the array is stored |
[in] | association | field association; one of svtkDataObject::FieldAssociations or svtkDataObject::AttributeTypes. |
[in] | arrayNames | vector of array names to add |
Reimplemented in sensei::ConfigurableInTransitDataAdaptor.
|
virtual |
Adds ghost cells on the specified mesh.
Implementers should set the array name to "svtkGhostType".
[in] | mesh | the svtkDataObject returned from GetMesh |
[in] | meshName | the name of the mesh to access (see GetMeshMetadata) |
Reimplemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ADIOS2DataAdaptor, and sensei::HDF5DataAdaptor.
|
virtual |
Adds ghost nodes on the specified mesh.
Implementers shouls set the name of the array to "svtkGhostType".
[in] | mesh | the VTK object returned from GetMesh |
[in] | meshName | the name of the mesh to access (see GetMeshMetadata) |
Reimplemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ADIOS2DataAdaptor, and sensei::HDF5DataAdaptor.
|
inline |
Get the communicator used by the adaptor.
|
virtual |
Get the current simulated time.
Reimplemented in sensei::ConfigurableInTransitDataAdaptor.
|
virtual |
Get the current time step.
Reimplemented in sensei::ConfigurableInTransitDataAdaptor.
|
pure virtual |
Fetches the requested data object from the simulation.
This method will return a svtkDataObject containing the simulation state. Implementers should prefer svtkMultiBlockData over svtkDataSet types. However, both approaches are supported. Callers should typically pass structureOnly
to false. Caller may set stuctureOnly
to true when data arrays without mesh geometry and connectivity are sufficient for processing. If structureOnly
is set to true, then implementers should not populate the mesh geometry and connectivity information. This can result in large savings in data transfer.
[in] | meshName | the name of the mesh to access (see GetMeshMetadata) |
[in] | structureOnly | When set to true the returned mesh may not have any geometry or topology information. |
[out] | mesh | a reference to a pointer where a new VTK object is stored |
Implemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ProgrammableDataAdaptor, sensei::ADIOS2DataAdaptor, sensei::SVTKDataAdaptor, sensei::HDF5DataAdaptor, and sensei::ConduitDataAdaptor.
|
pure virtual |
Get metadata of the i'th mesh.
The caller passes the integer id of the mesh for which the metadata is desired, and a pointer to a MeshMetadata instance where the metadata is stored.
[in] | id | index of the mesh to access |
[out] | metadata | a pointer to instance where metadata is stored |
Implemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ProgrammableDataAdaptor, sensei::ADIOS2DataAdaptor, sensei::SVTKDataAdaptor, sensei::HDF5DataAdaptor, and sensei::ConduitDataAdaptor.
|
pure virtual |
Gets the number of meshes a simulation can provide.
The caller passes a reference to an integer variable in the first argument upon return this variable contains the number of meshes the simulation can provide. If successfull the method returns 0, a non-zero return indicates an error occurred.
[out] | numMeshes | an integer variable where number of meshes is stored |
Implemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ProgrammableDataAdaptor, sensei::ADIOS2DataAdaptor, sensei::SVTKDataAdaptor, sensei::HDF5DataAdaptor, and sensei::ConduitDataAdaptor.
|
override |
Prints the current state of the adaptor.
|
inlinevirtual |
Release data allocated for the current timestep.
This method allows implementers to free resources that were used in the conversion of the simulation data. However, note that callers of GetMesh must Delete the returned svtkDataObject which typically alleviates the need for the adaptor to hold references to the returned data. In most cases this method should not be overridden.
Reimplemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ProgrammableDataAdaptor, sensei::ADIOS2DataAdaptor, sensei::SVTKDataAdaptor, sensei::HDF5DataAdaptor, and sensei::ConduitDataAdaptor.
|
virtual |
Set the communicator used by the adaptor.
The default communicator is a duplicate of MPI_COMMM_WORLD, giving each adaptor a unique communication space. Users wishing to override this should set the communicator before doing anything else. Derived classes should use the communicator returned by GetCommunicator.
|
virtual |
Set the current simulated time.
The default implementation stores the passed time. Implemetors typically call this method rather than overriding the method.
Reimplemented in sensei::ConfigurableInTransitDataAdaptor.
|
virtual |
Set the current simulated time step.
The default implementation stores the passed time step. Implemetors typically call this method rather than overriding the method.
Reimplemented in sensei::ConfigurableInTransitDataAdaptor.