ABLATE Source Documentation  0.12.34
turbFlowStats.hpp
1 #ifndef ABLATELIBRARY_TURBFLOWSTATS_HPP
2 #define ABLATELIBRARY_TURBFLOWSTATS_HPP
3 
4 #include <string>
5 #include "domain/field.hpp"
6 #include "eos/eos.hpp"
7 #include "fieldMonitor.hpp"
8 #include "io/interval/interval.hpp"
9 
10 namespace ablate::monitors {
11 
12 class TurbFlowStats : public FieldMonitor {
14 
15  enum FieldPlacements { densitySum, densityDtSum, fieldsStart };
16  enum SectionLabels { densityMult, densityDtMult, densitySqr, sum, sumSqr, favreAvg, rms, mRms, END };
17 
18  private:
19  const std::vector<std::string> fieldNames;
20  const std::shared_ptr<ablate::eos::EOS> eos;
21  const std::shared_ptr<io::interval::Interval> interval;
22  ttf densityFunc;
23  PetscInt step;
24 
25  static PetscErrorCode MonitorTurbFlowStats(TS ts, PetscInt step, PetscReal crtime, Vec u, void* ctx);
26 
27  public:
28  explicit TurbFlowStats(const std::vector<std::string> nameIn, const std::shared_ptr<ablate::eos::EOS> eosIn, std::shared_ptr<io::interval::Interval> intervalIn = {});
29  PetscMonitorFunction GetPetscFunction() override { return MonitorTurbFlowStats; }
30  void Register(std::shared_ptr<ablate::solver::Solver> solverIn) override;
31 
32  PetscErrorCode Save(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override;
33  PetscErrorCode Restore(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override;
34 };
35 
36 } // namespace ablate::monitors
37 
38 #endif // ABLATELIBRARY_TURBFLOWSTATS_HPP
Definition: fieldMonitor.hpp:14
Definition: turbFlowStats.hpp:12
PetscErrorCode Restore(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override
Definition: turbFlowStats.cpp:194
PetscErrorCode Save(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override
Definition: turbFlowStats.cpp:184
PetscMonitorFunction GetPetscFunction() override
Definition: turbFlowStats.hpp:29
Definition: boundarySolverMonitor.hpp:16