Block-Structured AMR Software Framework
AMReX_InSituBridge.H
Go to the documentation of this file.
1 #ifndef AMReX_InSituBridge_H
2 #define AMReX_InSituBridge_H
3 #include <AMReX_Config.H>
4 
5 #include <string>
6 #include <AMReX_Vector.H>
7 
8 #if defined(AMREX_USE_SENSEI_INSITU)
9 #include <mpi.h>
10 namespace sensei {
11 class AnalysisAdaptor;
12 }
13 #endif
14 
15 namespace amrex
16 {
17 
19 
23 {
24 public:
25  InSituBridge();
26  virtual ~InSituBridge();
27 
28  InSituBridge(const InSituBridge&) = delete;
29  void operator=(const InSituBridge&) = delete;
30 
31 #if defined(BL_USE_MPI)
32  void setCommuniator(MPI_Comm acomm) { comm = acomm; }
33 #endif
34 
49  void setEnabled(int aenabled) { enabled = aenabled; }
50  void setFrequency(int freq) { frequency = freq; }
51  void setConfig(const std::string &aconfig) { config = aconfig; }
52  void setPinMesh(int apinMesh) { pinMesh = apinMesh; }
54 
58  virtual int initialize();
59 
61  virtual int finalize();
62 
63 protected:
64  bool doUpdate();
65 
66 protected:
67 #if defined(BL_USE_MPI)
68  MPI_Comm comm;
69 #endif
70 #if defined(AMREX_USE_SENSEI_INSITU)
71  sensei::AnalysisAdaptor *analysis_adaptor;
72 #endif
73  std::string config;
74  int enabled;
75  int frequency;
76  int counter;
77  int pinMesh;
78 };
79 
80 }
81 
82 #endif
int MPI_Comm
Definition: AMReX_ccse-mpi.H:47
A base class for coupling to the SENSEI in situ library.
Definition: AMReX_InSituBridge.H:23
void setEnabled(int aenabled)
Definition: AMReX_InSituBridge.H:49
std::string config
Definition: AMReX_InSituBridge.H:73
int frequency
Definition: AMReX_InSituBridge.H:75
int pinMesh
Definition: AMReX_InSituBridge.H:77
int enabled
Definition: AMReX_InSituBridge.H:74
InSituBridge(const InSituBridge &)=delete
InSituBridge()
Definition: AMReX_InSituBridge.cpp:15
virtual ~InSituBridge()
Definition: AMReX_InSituBridge.cpp:30
void setConfig(const std::string &aconfig)
Definition: AMReX_InSituBridge.H:51
virtual int finalize()
clean up the adaptors
Definition: AMReX_InSituBridge.cpp:113
int counter
Definition: AMReX_InSituBridge.H:76
void operator=(const InSituBridge &)=delete
bool doUpdate()
Definition: AMReX_InSituBridge.cpp:105
void setPinMesh(int apinMesh)
Definition: AMReX_InSituBridge.H:52
void setFrequency(int freq)
Definition: AMReX_InSituBridge.H:50
virtual int initialize()
Definition: AMReX_InSituBridge.cpp:41
Definition: AMReX_Amr.cpp:49