Commit 08f708e4 authored by jonathan.froehlich's avatar jonathan.froehlich
Browse files

Merge branch 'plotting' into 'feature'

Plotting

See merge request mpp/mpp!205
parents 05aaff2f e144b3dd
......@@ -124,3 +124,11 @@ VtuPlot &mpp::deformed_plot(const string &name, const Vector &deformation) {
std::pair<std::string, PlotStatus> mpp::save_plot(const string &filename) {
return {filename, Plotting::status};
}
void mpp::plot_mesh(const Mesh &mesh) {
auto name = mesh.Name();
if(name.empty()) name = "Mesh";
Plotting::InstanceM().AddPlot(name, mesh);
Plotting::InstanceM().SavePlot(name);
Plotting::InstanceM().RemovePlot(name);
}
......@@ -82,6 +82,8 @@ namespace mpp{
std::pair<std::string, PlotStatus> save_plot(const string& filename);
constexpr PlotStatus endp = PlotStatus::CLEAR;
void plot_mesh(const Mesh& mesh);
static string intAsString(int i) {
char buffer[256];
sprintf(buffer, "%04d", i);
......@@ -90,9 +92,4 @@ namespace mpp{
}
}
#define plot_vector(v) mpp::plot(#v) << v << mpp::save_plot(#v)
#define plot_deformed(v, u) mpp::deformed_plot(#v, u) << v << mpp::save_plot(#v)
#define plot_time_vector(v, i) mpp::plot(#v) << v << mpp::save_plot(#v+mpp::intAsString(i))
#define plot_time_deformed(v, u, i) mpp::deformed_plot(#v, u) << v << mpp::save_plot(#v+mpp::intAsString(i))
#endif //PLOTTING_HPP
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment