ABLATE Source Documentation  0.12.34
physicsTimeStep.hpp
1 #ifndef ABLATELIBRARY_PHYSICSTIMESTEP_HPP
2 #define ABLATELIBRARY_PHYSICSTIMESTEP_HPP
3 
4 #include <memory>
5 #include "io/interval/interval.hpp"
6 #include "monitor.hpp"
7 #include "monitors/logs/log.hpp"
8 #include "solver/physicsTimeStepFunction.hpp"
9 
10 namespace ablate::monitors {
11 
15 class PhysicsTimeStep : public Monitor {
16  private:
17  static PetscErrorCode ReportPhysicsTimeStep(TS ts, PetscInt step, PetscReal crtime, Vec u, void* ctx);
18  const std::shared_ptr<logs::Log> log;
19  const std::shared_ptr<io::interval::Interval> interval;
20  std::shared_ptr<ablate::solver::PhysicsTimeStepFunction> solver;
21 
22  public:
23  explicit PhysicsTimeStep(std::shared_ptr<logs::Log> log = {}, std::shared_ptr<io::interval::Interval> interval = {});
24 
25  void Register(std::shared_ptr<solver::Solver>) override;
26 
27  PetscMonitorFunction GetPetscFunction() override { return ReportPhysicsTimeStep; }
28 };
29 
30 } // namespace ablate::monitors
31 #endif // ABLATELIBRARY_PHYSICSTIMESTEP_HPP
Definition: monitor.hpp:12
Definition: physicsTimeStep.hpp:15
PetscMonitorFunction GetPetscFunction() override
Definition: physicsTimeStep.hpp:27
void Register(std::shared_ptr< solver::Solver >) override
Definition: physicsTimeStep.cpp:8
Definition: boundarySolverMonitor.hpp:16