SENSEI
A frame work for generic in situ analytics
sensei::DataAdaptor Class Referenceabstract

Base class that defines the interface for fetching data from a simulation. More...

#include <DataAdaptor.h>

Inheritance diagram for sensei::DataAdaptor:
[legend]
Collaboration diagram for sensei::DataAdaptor:
[legend]

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
 

Detailed Description

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.

Member Function Documentation

◆ AddArray()

virtual int sensei::DataAdaptor::AddArray ( svtkDataObject *  mesh,
const std::string &  meshName,
int  association,
const std::string &  arrayName 
)
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.

Parameters
[in]meshthe VTK object returned from GetMesh
[in]meshNamethe name of the mesh on which the array is stored
[in]associationfield association; one of svtkDataObject::FieldAssociations or svtkDataObject::AttributeTypes.
[in]arrayNamename of the array
Returns
zero if successful, non zero if an error occurred

Implemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ProgrammableDataAdaptor, sensei::ADIOS2DataAdaptor, sensei::SVTKDataAdaptor, sensei::HDF5DataAdaptor, and sensei::ConduitDataAdaptor.

◆ AddArrays()

virtual int sensei::DataAdaptor::AddArrays ( svtkDataObject *  mesh,
const std::string &  meshName,
int  association,
const std::vector< std::string > &  arrayNames 
)
virtual

Fetches multiple arrays from the simulation and adds them to the mesh.

Implementers typically do not have to override this method.

Parameters
[in]meshthe VTK object returned from GetMesh
[in]meshNamethe name of the mesh on which the array is stored
[in]associationfield association; one of svtkDataObject::FieldAssociations or svtkDataObject::AttributeTypes.
[in]arrayNamesvector of array names to add
Returns
zero if successful, non zero if an error occurred

Reimplemented in sensei::ConfigurableInTransitDataAdaptor.

◆ AddGhostCellsArray()

virtual int sensei::DataAdaptor::AddGhostCellsArray ( svtkDataObject *  mesh,
const std::string &  meshName 
)
virtual

Adds ghost cells on the specified mesh.

Implementers should set the array name to "svtkGhostType".

Parameters
[in]meshthe svtkDataObject returned from GetMesh
[in]meshNamethe name of the mesh to access (see GetMeshMetadata)
Returns
zero if successful, non zero if an error occurred

Reimplemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ADIOS2DataAdaptor, and sensei::HDF5DataAdaptor.

◆ AddGhostNodesArray()

virtual int sensei::DataAdaptor::AddGhostNodesArray ( svtkDataObject *  mesh,
const std::string &  meshName 
)
virtual

Adds ghost nodes on the specified mesh.

Implementers shouls set the name of the array to "svtkGhostType".

Parameters
[in]meshthe VTK object returned from GetMesh
[in]meshNamethe name of the mesh to access (see GetMeshMetadata)
Returns
zero if successful, non zero if an error occurred

Reimplemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ADIOS2DataAdaptor, and sensei::HDF5DataAdaptor.

◆ GetCommunicator()

MPI_Comm sensei::DataAdaptor::GetCommunicator ( )
inline

Get the communicator used by the adaptor.

◆ GetDataTime()

virtual double sensei::DataAdaptor::GetDataTime ( )
virtual

Get the current simulated time.

Reimplemented in sensei::ConfigurableInTransitDataAdaptor.

◆ GetDataTimeStep()

virtual long sensei::DataAdaptor::GetDataTimeStep ( )
virtual

Get the current time step.

Reimplemented in sensei::ConfigurableInTransitDataAdaptor.

◆ GetMesh()

virtual int sensei::DataAdaptor::GetMesh ( const std::string &  meshName,
bool  structureOnly,
svtkDataObject *&  mesh 
)
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.

Note
Callers are to take ownership of the newly allocated mesh and must Delete the returned mesh when finished to prevent a memory leak.
Parameters
[in]meshNamethe name of the mesh to access (see GetMeshMetadata)
[in]structureOnlyWhen set to true the returned mesh may not have any geometry or topology information.
[out]mesha reference to a pointer where a new VTK object is stored
Returns
zero if successful, non zero if an error occurred

Implemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ProgrammableDataAdaptor, sensei::ADIOS2DataAdaptor, sensei::SVTKDataAdaptor, sensei::HDF5DataAdaptor, and sensei::ConduitDataAdaptor.

◆ GetMeshMetadata()

virtual int sensei::DataAdaptor::GetMeshMetadata ( unsigned int  id,
sensei::MeshMetadataPtr &  metadata 
)
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.

Parameters
[in]idindex of the mesh to access
[out]metadataa pointer to instance where metadata is stored
Returns
zero if successful, non zero if an error occurred

Implemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ProgrammableDataAdaptor, sensei::ADIOS2DataAdaptor, sensei::SVTKDataAdaptor, sensei::HDF5DataAdaptor, and sensei::ConduitDataAdaptor.

◆ GetNumberOfMeshes()

virtual int sensei::DataAdaptor::GetNumberOfMeshes ( unsigned int &  numMeshes)
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.

Parameters
[out]numMeshesan integer variable where number of meshes is stored
Returns
zero if successful, non zero if an error occurred

Implemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ProgrammableDataAdaptor, sensei::ADIOS2DataAdaptor, sensei::SVTKDataAdaptor, sensei::HDF5DataAdaptor, and sensei::ConduitDataAdaptor.

◆ PrintSelf()

void sensei::DataAdaptor::PrintSelf ( ostream &  os,
svtkIndent  indent 
)
override

Prints the current state of the adaptor.

◆ ReleaseData()

virtual int sensei::DataAdaptor::ReleaseData ( )
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.

Note
The instrumentation (or bridge) code must call this method when done processing a time step to ensure that all resources are released. Analysis adaptors should not call this method.
Returns
zero if successful, non zero if an error occurred

Reimplemented in sensei::ConfigurableInTransitDataAdaptor, sensei::ProgrammableDataAdaptor, sensei::ADIOS2DataAdaptor, sensei::SVTKDataAdaptor, sensei::HDF5DataAdaptor, and sensei::ConduitDataAdaptor.

◆ SetCommunicator()

virtual int sensei::DataAdaptor::SetCommunicator ( MPI_Comm  comm)
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.

◆ SetDataTime()

virtual void sensei::DataAdaptor::SetDataTime ( double  time)
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.

◆ SetDataTimeStep()

virtual void sensei::DataAdaptor::SetDataTimeStep ( long  index)
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.


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