SENSEI
A frame work for generic in situ analytics
MeshMetadataMap.h
1 #ifndef MeshMetadataMap_h
2 #define MeshMetadataMap_h
3 
4 #include "MeshMetadata.h"
5 
6 #include <vector>
7 #include <map>
8 #include <string>
9 
10 namespace sensei
11 {
12 class DataAdaptor;
13 
14 // An associative container mapping mesh names to metadata
15 // and data object id
16 class SENSEI_EXPORT MeshMetadataMap
17 {
18 public:
19  // initialize the map by getting metadata for all of the
20  // meshes provided by the simulation.
22 
23  void PushBack(MeshMetadataPtr &md);
24 
25  unsigned int Size() const { return this->Metadata.size(); }
26 
27  void Resize(unsigned int n){ this->Metadata.resize(n); }
28 
29  void Clear();
30 
31  // get the id of the object by name
32  int GetMeshId(const std::string &name, unsigned int &id) const;
33 
34  // get the metadata associated with the named object
35  int GetMeshMetadata(const std::string &name, MeshMetadataPtr &md);
36 
37  // set/get the i'th object's metadata
38  int GetMeshMetadata(unsigned int i, MeshMetadataPtr &md);
39  int SetMeshMetadata(unsigned int i, MeshMetadataPtr &md);
40 
41 private:
42  // a vector of metadata for each data object provided by
43  // the simulation
44  std::vector<MeshMetadataPtr> Metadata;
45 
46  // a mapping between mesh names and index into the the above
47  // vector
48  std::map<std::string, unsigned int> IdMap;
49 };
50 
51 }
52 
53 #endif
a set of flags describing which optional fields in the MeshMetadata structure should be generated...
Definition: MeshMetadata.h:19
int Initialize(MPI_Comm comm, const std::string &fileName, InTransitDataAdaptor *&dataAdaptor)
Creates a sensei::ConfigurableAnalysis adaptor and sensei::InTransitDataAdaptor based on a SENSEI XML...
Definition: MeshMetadataMap.h:16
SENSEI_EXPORT unsigned int Size(int svtkt)
given a SVTK type enum returns the sizeof that type
SENSEI.
Definition: ADIOS2AnalysisAdaptor.h:27
Base class that defines the interface for fetching data from a simulation.
Definition: DataAdaptor.h:25