Commit 109c25f3 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

first version of parabolic pde solver

parent b48daa3e
//
// Created by niklas on 11.05.21.
//
#include "ParabolicPDESolver.hpp"
void ParabolicPDESolver::run(SampleSolution &solution) {
}
void ParabolicPDESolver::computeQ(SampleSolution &solution) {
}
void ParabolicPDESolver::computeCost(SampleSolution &solution) {
}
void ParabolicPDESolver::plotSolution(SampleSolution &solution) {
}
......@@ -4,7 +4,64 @@
#include "DGReactionAssemble.hpp"
#include "PGReactionAssemble.hpp"
class ParabolicPDESolver {
class ParabolicPDESolver : public PDESolver {
private:
std::string quantity = "L2";
std::string costMeasure = "size";
std::unique_ptr<NonLinearTimeIntegrator> timeInt;
IStochasticReactionAssemble *assemble;
protected:
void run(SampleSolution &solution) override;
void computeQ(SampleSolution &solution) override;
void computeCost(SampleSolution &solution) override;
void plotSolution(SampleSolution &solution) override;
public:
ParabolicPDESolver(IStochasticReactionAssemble *assemble,
const string &quantity, const string &costMeasure) :
PDESolver(), assemble(assemble), quantity(quantity), costMeasure(costMeasure) {
if (typeid(*assemble).name() == typeid(PGReactionAssemble).name())
timeInt = TimeIntegratorCreator(IMPLICIT_EULER).
WithNonLinearSolver(new Newton(std::make_unique<GMRES>(GetPC("SuperLU")))).
CreateUniqueNonLinearTimeIntegrator();
if (typeid(*assemble).name() == typeid(DGReactionAssemble).name())
timeInt = TimeIntegratorCreator(IMPLICIT_EULER).
WithNonLinearSolver(new Newton(std::make_unique<GMRES>(GetPC(
"PointBlockJacobi_dG")))).
CreateUniqueNonLinearTimeIntegrator();
if (verbose)
mout.PrintInfo("TransportPDESolver", verbose,
PrintInfoEntry("Quantity", quantity),
PrintInfoEntry("Cost measure", costMeasure));
}
~ParabolicPDESolver() override {
delete assemble;
}
IAssemble *GetAssemble() const override {
return nullptr;
// return assemble;
}
IDiscretization *GetDisc() const override { return nullptr; }
IStochasticProblem *GetProblem() const override { return nullptr; }
void DrawSample(const SampleID &id) override { }
std::string Name() const override { return "ParabolicPDESolver"; }
};
#endif //PARABOLICPDESOLVER_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