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

worked on PDESolver

parent aec605b2
......@@ -7,15 +7,13 @@ void EllipticPDESolver::run(SampleSolution &solution) {
}
void EllipticPDESolver::computeQ(SampleSolution &solution) {
IStochasticEllipticAssemble *ellAssemble =
dynamic_cast<IStochasticEllipticAssemble *>(assemble);
if (quantity == "L2") solution.Q = ellAssemble->L2(solution.U);
else if (quantity == "H1") solution.Q = ellAssemble->H1(solution.U);
else if (quantity == "Energy") solution.Q = ellAssemble->Energy(solution.U);
if (quantity == "L2") solution.Q = assemble->L2(solution.U);
else if (quantity == "H1") solution.Q = assemble->H1(solution.U);
else if (quantity == "Energy") solution.Q = assemble->Energy(solution.U);
else if (quantity == "Inflow")
solution.Q = ellAssemble->InflowOutflow(solution.U).first;
solution.Q = assemble->InflowOutflow(solution.U).first;
else if (quantity == "Outflow")
solution.Q = ellAssemble->InflowOutflow(solution.U).second;
solution.Q = assemble->InflowOutflow(solution.U).second;
else Exit("Quantity of interest not implemented")
}
......
......@@ -5,8 +5,8 @@
#include "solver/Solver.h"
#include "solver/Newton.h"
#include "timestepping/TimeIntegrator.hpp"
#include "assemble/IStochasticAssemble.hpp"
#include "assemble/IStochasticEllipticAssemble.hpp"
#include "assemble/IStochasticTransportAssemble.hpp"
class PDESolver {
......@@ -43,7 +43,7 @@ public:
mout.EndBlock(verbose == 0);
}
virtual IDiscretization *GetDiscretization() = 0;
virtual IDiscretization *GetDisc() = 0;
virtual void DrawSample(SampleID id) = 0;
......@@ -68,14 +68,14 @@ protected:
void plotSolution(SampleSolution &solution) override;
public:
EllipticPDESolver(IStochasticEllipticAssemble *stochasticAssemble) :
assemble(stochasticAssemble),
EllipticPDESolver(IStochasticEllipticAssemble *assemble) :
PDESolver(),
assemble(assemble),
solver(Solver(GetPC("SuperLU"), "GMRES")),
newton(Newton(solver)) {}
IDiscretization *GetDiscretization() override {
return assemble->GetDiscretization();
IDiscretization *GetDisc() override {
return assemble->GetDisc();
}
void DrawSample(SampleID id) override {
......@@ -105,9 +105,9 @@ protected:
void plotSolution(SampleSolution &solution) override;
public:
TransportPDESolver(IStochasticAssemble *stochasticAssemble) :
assemble(stochasticAssemble),
TransportPDESolver(IStochasticAssemble *assemble) :
PDESolver(),
assemble(assemble),
solver(Solver(GetPC("PointBlockGaussSeidel"), "GMRES")),
timeInt(TimeIntegrator(solver)) {}
};
......
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