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

moving meshes and matrixgraphs to pdesolver

parent becb870d
#include "PDESolver.hpp"
MatrixGraphs *PDESolver::CreateSolutionMatrixGraphs(Meshes &meshes) {
createOtherMatrixGraphs(meshes);
MatrixGraphs *PDESolver::CreateSolutionMatrixGraphs() {
createOtherMatrixGraphs();
auto disc = this->GetDisc();
auto discType = typeid(*disc).name();
......@@ -84,7 +84,7 @@ void EllipticPDESolver::plotSolution(SampleSolution &solution) {
plotMap.VtkPlot(solutionCellFlux);
}
void EllipticPDESolver::createOtherMatrixGraphs(Meshes &meshes) {
void EllipticPDESolver::createOtherMatrixGraphs() {
if (plotting) {
fluxMGraphs = new MatrixGraphs(meshes, new LagrangeDoF(0, 3));
if (typeid(*assemble).name() == typeid(HybridEllipticAssemble).name())
......
......@@ -27,6 +27,10 @@
class PDESolver {
protected:
Meshes &meshes;
MatrixGraphs *solMGraph;
PlotMap plotMap;
int verbose;
......@@ -50,20 +54,23 @@ protected:
plotMap.UpdateMap(solution);
}
virtual void createOtherMatrixGraphs(Meshes &meshes) {}
virtual void createOtherMatrixGraphs() {}
public:
PDESolver(const std::string &quantity, const std::string &costMeasure,
PDESolver(Meshes &meshes, const std::string &quantity, const std::string &costMeasure,
int verbose, int plotting) :
quantity(quantity), costMeasure(costMeasure),
meshes(meshes), quantity(quantity), costMeasure(costMeasure),
verbose(verbose), plotting(plotting) {
config.get("Quantity", this->quantity);
config.get("CostMeasure", this->costMeasure);
config.get("PDESolverVerbose", this->verbose);
config.get("PDESolverPlotting", this->plotting);
createOtherMatrixGraphs();
}
virtual ~PDESolver() {};
virtual ~PDESolver() {
delete solMGraph;
};
MatrixGraphs* MGraphs() {
return solMGraph;
}
void Run(SampleSolution &solution) {
mout.StartBlock("PDE Solver");
......@@ -77,7 +84,7 @@ public:
mout.EndBlock(verbose == 0);
}
MatrixGraphs *CreateSolutionMatrixGraphs(Meshes &meshes);
MatrixGraphs *CreateSolutionMatrixGraphs();
virtual IAssemble *GetAssemble() const = 0;
......@@ -105,10 +112,11 @@ protected:
public:
DummyPDESolver(IStochasticDummyAssemble *assemble,
Meshes &meshes,
const std::string &quantity = "L2",
const std::string &costMeasure = "size",
int verbose = 1, int plotting = 1) :
PDESolver(quantity, costMeasure, verbose, plotting),
PDESolver(meshes, quantity, costMeasure, verbose, plotting),
assemble(assemble) {}
IAssemble *GetAssemble() const override {
......@@ -154,16 +162,17 @@ protected:
// void setUpPlot(SampleSolution &solution) override {}
void createOtherMatrixGraphs(Meshes &meshes) override;
void createOtherMatrixGraphs() override;
public:
EllipticPDESolver(IStochasticEllipticAssemble *assemble,
Meshes &meshes,
const std::string &quantity = "L2",
const std::string &costMeasure = "size",
int verbose = 1, int plotting = 1,
const std::string &pc = "SuperLU",
const std::string &linearSolver = "GMRES") :
PDESolver(quantity, costMeasure, verbose, plotting),
PDESolver(meshes, quantity, costMeasure, verbose, plotting),
assemble(assemble),
solver(Solver(GetPC(pc), linearSolver)),
newton(Newton(solver)) {
......@@ -216,10 +225,11 @@ protected:
public:
TransportPDESolver(IStochasticTransportAssemble *assemble,
Meshes &meshes,
const std::string &quantity = "L2",
const std::string &costMeasure = "size",
int verbose = 1, int plotting = 1) :
PDESolver(quantity, costMeasure, verbose, plotting),
PDESolver(meshes, quantity, costMeasure, verbose, plotting),
assemble(assemble),
// T(assemble) Todo make T and t0 Problem Properties
solver(Solver(GetPC("PointBlockGaussSeidel"), "GMRES")),
......
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