SENSEI
A frame work for generic in situ analytics
|
Implements the sensei::DataAdaptor interface with user provided callables ProgrammableDataAdaptor allows one to provide callbacks implementing the data interface. More...
#include <ProgrammableDataAdaptor.h>
Public Member Functions | |
senseiTypeMacro (ProgrammableDataAdaptor, DataAdaptor) | |
void | SetGetNumberOfMeshesCallback (const GetNumberOfMeshesFunction &callback) |
Set the callable that will be invoked when GetNumberOfMeshes is called See GetNumberOfMeshes for details of what the callback must do. More... | |
void | SetGetMeshMetadataCallback (const GetMeshMetadataFunction &callback) |
Set the callable that will be invoked when GetMeshMetadata is called See GetMeshMetadata for details of what the callback must do. More... | |
void | SetGetMeshCallback (const GetMeshFunction &callback) |
Set the callable that will be invoked when GetMesh is called See GetMesh for details of what the callback must do. More... | |
void | SetAddArrayCallback (const AddArrayFunction &callback) |
Set the callable that will be invoked when AddArray is called See AddArray for details of what the callback must do. More... | |
void | SetReleaseDataCallback (const ReleaseDataFunction &callback) |
Set the callable that will be invoked when ReleaseData is called. More... | |
int | GetNumberOfMeshes (unsigned int &numMeshes) override |
Gets the number of meshes a simulation can provide. More... | |
int | GetMeshMetadata (unsigned int id, MeshMetadataPtr &metadata) override |
Get metadata of the i'th mesh. More... | |
int | GetMesh (const std::string &meshName, bool structureOnly, svtkDataObject *&mesh) override |
Fetches the requested data object from the simulation. More... | |
int | AddArray (svtkDataObject *mesh, const std::string &meshName, int association, const std::string &arrayName) override |
Fetches the named array from the simulation and adds it to the passed mesh. More... | |
int | ReleaseData () override |
Release data allocated for the current timestep. More... | |
Public Member Functions inherited from sensei::DataAdaptor | |
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 | 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 | 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 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... | |
Static Public Member Functions | |
static ProgrammableDataAdaptor * | New () |
Protected Attributes | |
GetNumberOfMeshesFunction | GetNumberOfMeshesCallback |
GetMeshMetadataFunction | GetMeshMetadataCallback |
GetMeshFunction | GetMeshCallback |
AddArrayFunction | AddArrayCallback |
ReleaseDataFunction | ReleaseDataCallback |
Protected Attributes inherited from sensei::DataAdaptor | |
InternalsType * | Internals |
MPI_Comm | Comm |
Additional Inherited Members | |
Protected Member Functions inherited from sensei::DataAdaptor | |
DataAdaptor (const DataAdaptor &)=delete | |
void | operator= (const DataAdaptor &)=delete |
Implements the sensei::DataAdaptor interface with user provided callables ProgrammableDataAdaptor allows one to provide callbacks implementing the data interface.
This is an alternative to using polymorphism. Callbacks can be any callable including functors and C function pointers
|
overridevirtual |
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 |
Implements sensei::DataAdaptor.
|
overridevirtual |
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 |
Implements sensei::DataAdaptor.
|
overridevirtual |
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 |
Implements sensei::DataAdaptor.
|
overridevirtual |
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 |
Implements sensei::DataAdaptor.
|
overridevirtual |
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 from sensei::DataAdaptor.
void sensei::ProgrammableDataAdaptor::SetAddArrayCallback | ( | const AddArrayFunction & | callback | ) |
Set the callable that will be invoked when AddArray is called See AddArray for details of what the callback must do.
void sensei::ProgrammableDataAdaptor::SetGetMeshCallback | ( | const GetMeshFunction & | callback | ) |
Set the callable that will be invoked when GetMesh is called See GetMesh for details of what the callback must do.
void sensei::ProgrammableDataAdaptor::SetGetMeshMetadataCallback | ( | const GetMeshMetadataFunction & | callback | ) |
Set the callable that will be invoked when GetMeshMetadata is called See GetMeshMetadata for details of what the callback must do.
void sensei::ProgrammableDataAdaptor::SetGetNumberOfMeshesCallback | ( | const GetNumberOfMeshesFunction & | callback | ) |
Set the callable that will be invoked when GetNumberOfMeshes is called See GetNumberOfMeshes for details of what the callback must do.
void sensei::ProgrammableDataAdaptor::SetReleaseDataCallback | ( | const ReleaseDataFunction & | callback | ) |
Set the callable that will be invoked when ReleaseData is called.
See ReleaseData for details about wwhat the callback should do.