1 #ifndef ABLATELIBRARY_DMVIEWFROMOPTIONS_HPP
2 #define ABLATELIBRARY_DMVIEWFROMOPTIONS_HPP
5 #include <parameters/parameters.hpp>
18 enum class Scope { INITIAL, MONITOR };
21 PetscOptions petscOptions;
22 const std::string optionName;
25 static PetscErrorCode CallDmViewFromOptions(TS ts, PetscInt steps, PetscReal time, Vec u,
void* mctx);
27 PetscErrorCode DMViewFromOptions(DM dm);
36 explicit DmViewFromOptions(Scope scope, std::string options = {},
const std::string& optionName = {});
43 explicit DmViewFromOptions(std::string options = {}, std::string optionName = {});
46 void Register(std::shared_ptr<solver::Solver>)
override;
53 std::string
ToString()
const override {
return "ablate::monitors::DmViewFromOptions"; }
67 std::ostream&
operator<<(std::ostream& os,
const DmViewFromOptions::Scope& v);
74 std::istream&
operator>>(std::istream& is, DmViewFromOptions::Scope& v);
Definition: modifier.hpp:8
Definition: dmViewFromOptions.hpp:16
PetscMonitorFunction GetPetscFunction() override
Definition: dmViewFromOptions.hpp:47
DmViewFromOptions(Scope scope, std::string options={}, const std::string &optionName={})
Definition: dmViewFromOptions.cpp:7
void Register(std::shared_ptr< solver::Solver >) override
Definition: dmViewFromOptions.cpp:27
std::string ToString() const override
Definition: dmViewFromOptions.hpp:53
void Modify(DM &) override
Definition: dmViewFromOptions.cpp:74
Definition: monitor.hpp:12
Definition: boundarySolverMonitor.hpp:16
std::ostream & operator<<(std::ostream &os, const DmViewFromOptions::Scope &v)
Definition: dmViewFromOptions.cpp:76
std::istream & operator>>(std::istream &is, DmViewFromOptions::Scope &v)
Definition: dmViewFromOptions.cpp:87