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

adding DummyPDESolver

parent c023bdde
......@@ -9,6 +9,7 @@
#include "assembling/DGTransportAssemble.hpp"
#include "assembling/DGReactionAssemble.hpp"
#include "assembling/PGReactionAssemble.hpp"
#include "IStochasticDummyAssemble.hpp"
// Imports from basics
#include "basics/Sample.hpp"
......@@ -92,6 +93,43 @@ public:
virtual void DrawSample(const SampleID &id) = 0;
};
class DummyPDESolver : public PDESolver {
private:
IStochasticDummyAssemble *assemble;
protected:
void run(SampleSolution &solution) override {
};
void computeQ(SampleSolution &solution) override {};
void computeCost(SampleSolution &solution) override {};
void plotSolution(SampleSolution &solution) override {};
public:
DummyPDESolver(IStochasticDummyAssemble *assemble) :
assemble(assemble),
PDESolver() {}
IAssemble *GetAssemble() const override {
return assemble;
}
IDiscretization *GetDisc() const override {
return assemble->GetDisc();
}
IStochasticProblem *GetProblem() const override {
return assemble->GetProblem();
}
void DrawSample(const SampleID &id) override {
assemble->DrawSample(id);
}
};
class EllipticPDESolver : public PDESolver {
private:
Solver solver;
......@@ -122,8 +160,8 @@ protected:
public:
EllipticPDESolver(IStochasticEllipticAssemble *assemble,
std::string pc="SuperLU",
std::string linearSolver="GMRES") :
std::string pc = "SuperLU",
std::string linearSolver = "GMRES") :
PDESolver(),
assemble(assemble),
solver(Solver(GetPC(pc), linearSolver)),
......
......@@ -45,5 +45,13 @@ PDESolver *PDESolverCreator::Create() {
if (_model == "PGTransport")
return nullptr; // Todo open research question
if (_model == "DummyPDESolver")
return new DummyPDESolver(
new IStochasticDummyAssemble(
new DGDiscretization(meshes, _degree),
CreateStochasticDummyProblem(meshes)
)
);
Exit(_model + " not found")
}
\ No newline at end of file
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