ABLATE Source Documentation  0.12.34
fieldMonitor.hpp
1 #ifndef ABLATELIBRARY_FIELDMONITOR_HPP
2 #define ABLATELIBRARY_FIELDMONITOR_HPP
3 
4 #include <petsc.h>
5 #include <vector>
6 #include "io/serializable.hpp"
7 #include "monitor.hpp"
8 
9 namespace ablate::monitors {
10 
14 class FieldMonitor : public Monitor, public io::Serializable {
15  private:
16  // Reuse the domain object to set up a domain to hold the monitor vector/dm
17  std::shared_ptr<ablate::domain::Domain> monitorDomain = nullptr;
18 
19  protected:
20  // Hold onto the subdomain for this monitor. It should be over the entire monitorDomain
21  std::shared_ptr<ablate::domain::SubDomain> monitorSubDomain = nullptr;
22 
23  public:
28  [[nodiscard]] const std::string& GetId() const override { return monitorDomain->GetName(); }
29 
35  void Register(std::shared_ptr<solver::Solver> solverIn) override { Monitor::Register(solverIn); }
36 
41  void Register(std::string id, std::shared_ptr<solver::Solver> solverIn, std::vector<std::shared_ptr<domain::FieldDescriptor>> fields);
42 
49  PetscErrorCode Save(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override;
50 
57  PetscErrorCode Restore(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override;
58 };
59 
60 } // namespace ablate::monitors
61 
62 #endif // ABLATELIBRARY_FIELDMONITOR_HPP
Definition: serializable.hpp:13
Definition: fieldMonitor.hpp:14
const std::string & GetId() const override
Definition: fieldMonitor.hpp:28
PetscErrorCode Restore(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override
Definition: fieldMonitor.cpp:42
void Register(std::shared_ptr< solver::Solver > solverIn) override
Definition: fieldMonitor.hpp:35
PetscErrorCode Save(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override
Definition: fieldMonitor.cpp:37
Definition: monitor.hpp:12
virtual void Register(std::shared_ptr< solver::Solver > solverIn)
Definition: monitor.hpp:22
Definition: boundarySolverMonitor.hpp:16