SENSEI
A frame work for generic in situ analytics
SVTKDataAdaptor.h
1 #ifndef sensei_SVTKDataAdaptor_h
2 #define sensei_SVTKDataAdaptor_h
3 
4 #include "DataAdaptor.h"
5 #include <svtkSmartPointer.h>
6 
7 class svtkDataObject;
8 
9 namespace sensei
10 {
11 /** A sensei::DataAdaptor for a svtkDataObject. To use this data adaptor for
12  * codes that produce a svtkDataObject natively. Once simply passes the
13  * svtkDataObject instance to this class and one then connect it to the
14  * sensei::AnalysisAdators.
15  *
16  * If the DataObject is a composite-dataset, the first non-null block on the
17  * current rank is assumed to the representative block for answering all
18  * queries.
19  */
20 class SENSEI_EXPORT SVTKDataAdaptor : public DataAdaptor
21 {
22 public:
23  static SVTKDataAdaptor *New();
24  senseiTypeMacro(SVTKDataAdaptor, DataAdaptor);
25 
26  /** Set the data object for current timestep. This method must be called to
27  * the set the data object for the current timestep.
28  *
29  * @param[in] meshName name of the mesh represented in the object
30  * @param[in] mesh the mesh or nullptr if this rank has no data
31  */
32  void SetDataObject(const std::string &meshName, svtkDataObject *mesh);
33 
34  /** Get the data object for the current time step. This method returns the
35  * mesh associated with the passed in name. It returns zero if the mesh is
36  * present and non-zero if it is not.
37  *
38  * @param[in] meshName the name of the mesh to get
39  * @param[out] mesh a reference to store a pointer to the named mesh
40  * @returns zero if the named mesh is present, non zero if it was not
41  */
42  int GetDataObject(const std::string &meshName, svtkDataObject *&dobj);
43 
44 
45  int GetNumberOfMeshes(unsigned int &numMeshes) override;
46  int GetMeshMetadata(unsigned int id, MeshMetadataPtr &metadata) override;
47 
48  int GetMesh(const std::string &meshName, bool structure_only,
49  svtkDataObject *&mesh) override;
50 
52 
53  int AddArray(svtkDataObject* mesh, const std::string &meshName,
54  int association, const std::string &arrayName) override;
55 
56  int ReleaseData() override;
57 
58 protected:
60  ~SVTKDataAdaptor();
61 
62 private:
63  SVTKDataAdaptor(const SVTKDataAdaptor&); // Not implemented.
64  void operator=(const SVTKDataAdaptor&); // Not implemented.
65 
66  struct InternalsType;
67  InternalsType *Internals;
68 
69 };
70 
71 }
72 
73 #endif
SENSEI.
Definition: ADIOS2AnalysisAdaptor.h:27
virtual int GetMesh(const std::string &meshName, bool structureOnly, svtkDataObject *&mesh)=0
Fetches the requested data object from the simulation.
Base class that defines the interface for fetching data from a simulation.
Definition: DataAdaptor.h:25
A sensei::DataAdaptor for a svtkDataObject.
Definition: SVTKDataAdaptor.h:20