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

InfoEntries not working yet

parent b9d60475
......@@ -14,7 +14,7 @@ void MainProgram::Initialize() {
mlmc = new MultilevelMonteCarlo(initLevels, initSampleAmount, meshes, pdeSolver);
// Todo: rmv
// pdeSolver->PrintInfo();
pdeSolver->PrintInfo();
meshes->PrintInfo();
mlmc->PrintInfo();
}
......
......@@ -41,7 +41,7 @@ void TransportPDESolver::plotSolution(SampleSolution &solution) {
TimeSeries TransportPDESolver::createTimeSeries(SampleSolution &solution) {
if (solution.id.coarse)
return TimeSeries(t0, T, cfl * (int) (pow(2, solution.id.level.coarse)));
return TimeSeries(t0, T, CFL * (int) (pow(2, solution.id.level.coarse)));
else
return TimeSeries(t0, T, cfl * (int) (pow(2, solution.id.level.fine)));
return TimeSeries(t0, T, CFL * (int) (pow(2, solution.id.level.fine)));
}
......@@ -9,10 +9,16 @@
#include "assemble/IStochasticTransportAssemble.hpp"
typedef PrintInfoEntry<std::string> InfoEntry;
typedef std::vector<InfoEntry> InfoEntries;
class PDESolver {
protected:
int verbose = 1;
InfoEntries entries;
string quantity = "L2";
string costMeasure = "size";
......@@ -30,6 +36,8 @@ public:
config.get("PDESolverVerbose", verbose);
config.get("Quantity", quantity);
config.get("CostMeasure", costMeasure);
entries.push_back(InfoEntry("Quantity", quantity));
entries.push_back(InfoEntry("CostMeasure", costMeasure));
}
void Run(SampleSolution &solution) {
......@@ -47,13 +55,9 @@ public:
virtual void DrawSample(const SampleID &id) = 0;
// void PrintInfo() const {
// std::vector<PrintInfoEntry<std::string>> entries;
// InfoEntries(entries);
// mout.PrintInfo("Model", verbose, entries);
// }
//
// virtual void InfoEntries(std::vector<PrintInfoEntry<std::string>> &entries) = 0;
void PrintInfo() const {
mout.PrintInfo("Model", verbose, entries);
}
};
class EllipticPDESolver : public PDESolver {
......@@ -87,20 +91,11 @@ public:
void DrawSample(const SampleID &id) override {
assemble->DrawSample(id);
}
// std::vector<PrintInfoEntry<std::string>> InfoEntries() override {
// vector<PrintInfoEntry<std::string>> entries;
// vector<PrintInfoEntry<std::string>> assembleEntries = assemble->InfoEntries();
// entries.insert(std::end(entries),
// std::begin(assembleEntries),
// std::end(assembleEntries));
// return entries;
// };
};
class TransportPDESolver : public PDESolver {
private:
double cfl = 1.0; // \tau < C * h
double CFL = 1.0; // \tau < C * h
double t0;
......@@ -129,9 +124,12 @@ public:
assemble(assemble),
solver(Solver(GetPC("PointBlockGaussSeidel"), "GMRES")),
timeInt(TimeIntegrator(solver)) {
config.get("cfl", cfl);
config.get("CFL", CFL);
config.get("t0", t0);
config.get("T", T);
entries.push_back(InfoEntry("CFL", to_string(CFL)));
entries.push_back(InfoEntry("t0", to_string(t0)));
entries.push_back(InfoEntry("T", to_string(T)));
}
IDiscretization *GetDisc() override {
......@@ -141,14 +139,6 @@ public:
void DrawSample(const SampleID &id) override {
assemble->DrawSample(id);
}
// std::vector<PrintInfoEntry<std::string>> InfoEntries() const override {
// vector<PrintInfoEntry<std::string>> entries;
// entries.push_back(PrintInfoEntry("cfl", to_string(cfl)));
// entries.push_back(PrintInfoEntry("t0", to_string(t0)));
// entries.push_back(PrintInfoEntry("T", to_string(T)));
// return entries;
// }
};
#endif //PDESOLVER_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