Commit 421e49d7 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

further work on plotting

parent 75d5966b
Pipeline #117643 passed with stages
in 6 minutes and 19 seconds
......@@ -27,7 +27,15 @@ void EllipticPDESolver::computeCost(SampleSolution &solution) {
}
void EllipticPDESolver::plotSolution(SampleSolution &solution) {
plotMap.VtkPlot(solution, 1, "VertexData");
if (!plotting) return;
auto disc = this->GetDisc();
auto typeName = typeid(*disc).name();
if (typeName == typeid(LagrangeDiscretization).name())
plotMap.VtkPlot(solution, 1, "VertexData");
if (typeName == typeid(RTLagrangeDiscretization).name())
plotMap.VtkPlot(solution, 1, "CellData");
// if (typeName == typeid(DGDiscretization).name())
// Todo plot flux
// const auto d = dof(new CellDoF(3));
// MatrixGraph *fluxMGraph = new MatrixGraph(d, solution.U.GetMesh());
......
......@@ -33,6 +33,8 @@ protected:
int verbose = 1;
int plotting = 1;
InfoEntries entries;
string quantity = "L2";
......@@ -48,12 +50,14 @@ protected:
virtual void plotSolution(SampleSolution &solution) = 0;
virtual void setUpPlot(SampleSolution &solution) {
if (!plotting) return;
plotMap.UpdateMap(solution);
}
public:
PDESolver() {
config.get("PDESolverVerbose", verbose);
config.get("PDESolverPlotting", plotting);
config.get("Quantity", quantity);
config.get("CostMeasure", costMeasure);
entries.push_back(InfoEntry("Quantity", quantity));
......@@ -99,18 +103,6 @@ public:
virtual IStochasticProblem *GetProblem() const = 0;
virtual void DrawSample(const SampleID &id) = 0;
InfoEntries GetInfoEntries() const {
// auto assembleEntries = GetAssemble()->GetInfoEntries();
// auto discEntries = GetDisc()->GetInfoEntries();
auto problemEntries = GetProblem()->GetInfoEntries();
// entries.insert(entries.end(), problemEntries.begin(), problemEntries.end());
return entries;
}
void PrintInfo() const {
mout.PrintInfo("Model", verbose, entries);
}
};
class EllipticPDESolver : public PDESolver {
......@@ -135,10 +127,7 @@ public:
PDESolver(),
assemble(assemble),
solver(Solver(GetPC("SuperLU"), "GMRES")),
newton(Newton(solver)) {
auto assembleEntries = assemble->GetInfoEntries();
// entries.insert(entries.end(), assembleEntries.begin(), assembleEntries.end());
}
newton(Newton(solver)) {}
IAssemble *GetAssemble() const override {
return assemble;
......@@ -191,14 +180,9 @@ public:
// T(assemble) Todo make T and t0 Problem Properties
solver(Solver(GetPC("PointBlockGaussSeidel"), "GMRES")),
timeInt(TimeIntegrator(solver, -102)) {
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)));
}
IAssemble *GetAssemble() 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