ABLATE Source Documentation  0.12.34
particleCount.hpp
1 #ifndef ABLATELIBRARY_PARTICLECOUNT_HPP
2 #define ABLATELIBRARY_PARTICLECOUNT_HPP
3 
4 #include <petsc.h>
5 #include "monitor.hpp"
6 #include "monitors/logs/log.hpp"
7 #include "particles/particleSolver.hpp"
8 
9 namespace ablate::monitors {
10 
11 class ParticleCount : public Monitor {
12  private:
13  const PetscInt interval;
14  std::shared_ptr<ablate::particles::ParticleSolver> particles;
15  const std::shared_ptr<logs::Log> log;
16 
17  static PetscErrorCode OutputParticleCount(TS ts, PetscInt steps, PetscReal time, Vec u, void *mctx);
18 
19  public:
20  ParticleCount(int interval, std::shared_ptr<logs::Log> log = {});
21 
22  void Register(std::shared_ptr<solver::Solver>) override;
23  PetscMonitorFunction GetPetscFunction() override { return OutputParticleCount; }
24 };
25 
26 } // namespace ablate::monitors
27 #endif // ABLATELIBRARY_PARTICLECOUNT_HPP
Definition: monitor.hpp:12
Definition: particleCount.hpp:11
void Register(std::shared_ptr< solver::Solver >) override
Definition: particleCount.cpp:5
PetscMonitorFunction GetPetscFunction() override
Definition: particleCount.hpp:23
Definition: boundarySolverMonitor.hpp:16