ABLATE Source Documentation  0.12.33
particleAverage.hpp
1 #ifndef ABLATELIBRARY_PARTICLEAVERAGE_HPP
2 #define ABLATELIBRARY_PARTICLEAVERAGE_HPP
3 
4 #include <petsc.h>
5 #include <monitors/logs/log.hpp>
6 #include "monitor.hpp"
7 #include "particles/particleSolver.hpp"
8 
9 namespace ablate::monitors {
10 
11 class ParticleAverage : 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 OutputParticleAverage(TS ts, PetscInt steps, PetscReal time, Vec u, void *mctx);
18 
19  public:
20  ParticleAverage(int interval, std::shared_ptr<logs::Log> log = {});
21 
22  void Register(std::shared_ptr<solver::Solver>) override;
23  PetscMonitorFunction GetPetscFunction() override { return OutputParticleAverage; }
24 };
25 
26 } // namespace ablate::monitors
27 #endif // ABLATELIBRARY_PARTICLECOUNT_HPP
Definition: monitor.hpp:12
Definition: particleAverage.hpp:11
PetscMonitorFunction GetPetscFunction() override
Definition: particleAverage.hpp:23
void Register(std::shared_ptr< solver::Solver >) override
Definition: particleAverage.cpp:5
Definition: boundarySolverMonitor.hpp:16