SENSEI
A frame work for generic in situ analytics
CatalystAnalysisAdaptor.h
1 #ifndef CatalystAnalysisAdaptor_h
2 #define CatalystAnalysisAdaptor_h
3 
4 #include "AnalysisAdaptor.h"
5 #include "MeshMetadata.h"
6 
7 #include <memory>
8 #include <vector>
9 
10 class vtkCPDataDescription;
11 class vtkCPInputDataDescription;
12 class vtkCPPipeline;
13 class svtkDataObject;
14 
15 namespace sensei
16 {
17 
18 /** An adaptor that invokes ParaView Catalyst. The adaptor is configured via a
19  * ParaView generated Catalyst Python script. See AddPythonScriptPipeline.
20  */
21 class SENSEI_EXPORT CatalystAnalysisAdaptor : public AnalysisAdaptor
22 {
23 public:
24  /// creates a new instance
25  static CatalystAnalysisAdaptor* New();
26 
27  senseiTypeMacro(CatalystAnalysisAdaptor, AnalysisAdaptor);
28 
29  /// prints the current adaptor state.
30  void PrintSelf(ostream& os, svtkIndent indent) override;
31 
32  ///@name Run time configuration
33  ///@{
34 
35  /** Add a vtkCPPipeline subclass to the global Catalyst Co-Processor. This is
36  * a manual configuration method and can be used for pipelines hard wired
37  * with compiled C++ code. This is the high performance bare metal method. A
38  * run time defined Catalyst Python script may also be used. See
39  * AddPythonScriptPipeline.
40  */
41  virtual void AddPipeline(vtkCPPipeline* pipeline);
42 
43  /** Adds a pipeline defined in a Catalyst python script. The Catalyst Python
44  * script can be automatically generated using the ParaView GUI on a
45  * representative dataset. The sensei::VTKPosthocIO and sensei::VTKAmrWriter
46  * can be used to obtain such data. If ParaView is unable to determine the
47  * version of the Script, if will default to the given version.
48  */
49  virtual void AddPythonScriptPipeline(const std::string& fileName,
50  const std::string& resultProducer, const std::string& steerableSourceType,
51  const std::string& resultMesh, int versionHint = 2);
52 
53  /// Control how frequently the in situ processing occurs.
54  int SetFrequency(unsigned int frequency);
55 
56  ///@}
57  /// @brief Add a plugin xml
58  ///
59  /// Adds a plugin XML which can add new proxy definitions.
60  virtual void AddPluginXML(const std::string& fileName);
61 
62  /// Invoke in situ processing using Catalyst
63  bool Execute(DataAdaptor* data, DataAdaptor**) override;
64 
65  /// Shuts ParaView catalyst down.
66  int Finalize() override;
67 
68 protected:
70  ~CatalystAnalysisAdaptor() override;
71 
72  void Initialize();
73 
74  int DescribeData(int timeStep, double time,
75  const std::vector<MeshMetadataPtr> &metadata, vtkCPDataDescription *dataDesc);
76 
77  int SelectData(DataAdaptor *dataAdaptor,
78  const std::vector<MeshMetadataPtr> &reqs, vtkCPDataDescription *dataDesc);
79 
80  int SetWholeExtent(svtkDataObject *dobj, vtkCPInputDataDescription *desc);
81 
82 private:
83  CatalystAnalysisAdaptor(const CatalystAnalysisAdaptor&); // Not implemented.
84  void operator=(const CatalystAnalysisAdaptor&); // Not implemented.
85 
86  unsigned int Frequency;
87 };
88 
89 }
90 
91 #endif
int Initialize(MPI_Comm comm, const std::string &fileName, InTransitDataAdaptor *&dataAdaptor)
Creates a sensei::ConfigurableAnalysis adaptor and sensei::InTransitDataAdaptor based on a SENSEI XML...
The base class for data consumers.
Definition: AnalysisAdaptor.h:24
SENSEI.
Definition: ADIOS2AnalysisAdaptor.h:27
Base class that defines the interface for fetching data from a simulation.
Definition: DataAdaptor.h:25
An adaptor that invokes ParaView Catalyst.
Definition: CatalystAnalysisAdaptor.h:21