Commit e97bbffb authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

added logger to assemble

parent ac359be4
......@@ -2,11 +2,13 @@
#define TUTORIAL_DGTRANSPORT_HPP
#include "DGTAssemble.h"
#include "MonteCarloLogger.h"
class DGTransportAssemble : public DGTAssemble {
public:
StochasticTransportProblem *problem;
PDELogger *logger;
double flux_alpha = 1.0;
double diffusion = 0.0;
......@@ -15,6 +17,7 @@ public:
Plot *plot) : DGTAssemble(dynamic_cast<DGDiscretization *>(disc),
plot), problem(problem) {
ReadConfig(Settings, "flux_alpha", flux_alpha);
logger = new PDELogger();
}
const char *Name() const override { return "DGTransportAssemble"; }
......@@ -225,14 +228,18 @@ public:
void PrintStep(double t, const Vector &u) const override {
pair<double, double> rate = InFlowOutFlowRate(u);
mout << "Step(" << step << "), t(" << t
<< "): Energy(u) = " << Energy(u)
<< " Mass(u) = " << Mass(u);
string msg = "Step(";
msg = msg.append(to_string(step)).append("), t(");
msg = msg.append(to_string(t)).append("): Energy(u) = ");
msg = msg.append(to_string(Energy(u))).append(" Mass(u) = ");
msg = msg.append(to_string(Mass(u)));
if (abs(rate.first) > 1e-7)
mout << " InFlowRate(u) = " << rate.first;
msg = msg.append(" InFlowRate(u) = ").append(to_string(rate.first));
if (abs(rate.second) > 1e-7)
mout << " OutFlowRate(u) = " << rate.second;
mout << endl;
msg = msg.append(" OutFlowRate(u) = ").append(to_string(rate.second));
logger->LogMsgv1Flush(msg);
}
void VtkPlotting(double t, const Vector &u) const override {
......
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