ABLATE Source Documentation  0.12.34
radiationFlux.hpp
1 #ifndef ABLATELIBRARY_VIRTUALTCP_H
2 #define ABLATELIBRARY_VIRTUALTCP_H
3 
4 #include "boundarySolver/boundarySolver.hpp"
5 #include "domain/dynamicRange.hpp"
6 #include "io/interval/fixedInterval.hpp"
7 #include "io/interval/interval.hpp"
8 #include "monitor.hpp"
9 #include "radiation/radiation.hpp"
10 #include "radiation/surfaceRadiation.hpp"
11 
12 namespace ablate::monitors {
13 
17 class RadiationFlux : public Monitor, public io::Serializable {
18  private:
22  DM fluxDm = nullptr;
23 
27  std::string name = "_radiationFluxMonitor";
28 
32  std::vector<std::shared_ptr<ablate::radiation::SurfaceRadiation>> radiation;
33 
37  std::shared_ptr<ablate::boundarySolver::BoundarySolver> boundarySolver;
38 
42  ablate::domain::DynamicRange monitorRange;
43 
47  std::shared_ptr<ablate::domain::Region> radiationFluxRegion;
48 
49  public:
50  RadiationFlux(std::vector<std::shared_ptr<radiation::SurfaceRadiation>> radiationIn, std::shared_ptr<domain::Region> radiationFluxRegionIn, std::shared_ptr<ablate::monitors::logs::Log> = {});
51 
55  ~RadiationFlux() override;
56 
61  void Register(std::shared_ptr<solver::Solver> solverIn) override;
62 
69  PetscErrorCode Save(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override;
70 
74  void* GetContext() override { return this; }
75 
76  [[nodiscard]] const std::string& GetId() const override { return name; };
77 
78  PetscErrorCode Restore(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override { return 0; };
79 
80  [[nodiscard]] SerializerType Serialize() const override { return io::Serializable::SerializerType::collective; }
81 
86  PetscMonitorFunction GetPetscFunction() override { return nullptr; }
87 
88  protected:
89  const std::shared_ptr<ablate::monitors::logs::Log> log = nullptr;
90 };
91 } // namespace ablate::monitors
92 
93 #endif // ABLATELIBRARY_VIRTUALTCP_H
Definition: dynamicRange.hpp:12
Definition: serializable.hpp:13
SerializerType
Definition: serializable.hpp:18
Definition: monitor.hpp:12
Definition: radiationFlux.hpp:17
PetscErrorCode Save(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override
Definition: radiationFlux.cpp:105
void * GetContext() override
Definition: radiationFlux.hpp:74
SerializerType Serialize() const override
Definition: radiationFlux.hpp:80
const std::string & GetId() const override
Definition: radiationFlux.hpp:76
PetscErrorCode Restore(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override
Definition: radiationFlux.hpp:78
void Register(std::shared_ptr< solver::Solver > solverIn) override
Definition: radiationFlux.cpp:13
PetscMonitorFunction GetPetscFunction() override
Definition: radiationFlux.hpp:86
~RadiationFlux() override
Definition: radiationFlux.cpp:7
Definition: boundarySolverMonitor.hpp:16