ABLATE Source Documentation  0.12.34
curveMonitor.hpp
1 #ifndef ABLATELIBRARY_CURVEMONITOR_HPP
2 #define ABLATELIBRARY_CURVEMONITOR_HPP
3 
4 #include <iostream>
5 #include <memory>
6 #include "io/interval/interval.hpp"
7 #include "monitor.hpp"
8 
9 namespace ablate::monitors {
10 
11 class CurveMonitor : public Monitor {
12  private:
13  const std::shared_ptr<io::interval::Interval> interval;
14  const std::string filePrefix;
15  inline static const std::string fileExtension = ".curve";
19  inline static const PetscReal minimumOutputValue = 1E-64;
20 
21  static PetscErrorCode OutputCurve(TS ts, PetscInt steps, PetscReal time, Vec u, void* mctx);
22 
23  static void WriteToCurveFile(std::ostream& curveFile, PetscInt cStart, PetscInt cEnd, Vec cellGeomVec, const std::vector<domain::Field>& fields, DM dm, Vec vec);
24 
25  public:
26  CurveMonitor(std::shared_ptr<io::interval::Interval> interval, std::string prefix);
27 
28  void Register(std::shared_ptr<solver::Solver>) override;
29  PetscMonitorFunction GetPetscFunction() override { return OutputCurve; }
30 };
31 } // namespace ablate::monitors
32 #endif // ABLATELIBRARY_CURVEMONITOR_HPP
Definition: curveMonitor.hpp:11
void Register(std::shared_ptr< solver::Solver >) override
Definition: curveMonitor.cpp:11
PetscMonitorFunction GetPetscFunction() override
Definition: curveMonitor.hpp:29
Definition: monitor.hpp:12
Definition: boundarySolverMonitor.hpp:16