Commit 72409f82 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

implemented CreateSolutionMatrixGraph

parent 9eac3214
......@@ -7,12 +7,13 @@
#include "timestepping/TimeIntegrator.hpp"
#include "assemble/IStochasticEllipticAssemble.hpp"
#include "assemble/IStochasticTransportAssemble.hpp"
#include "discretization/DGDiscretization.hpp"
#include "discretization/EGDiscretization.hpp"
#include "discretization/LagrangeDiscretization.hpp"
#include "discretization/RTLagrangeDiscretization.hpp"
#include <typeinfo>
typedef PrintInfoEntry<std::string> InfoEntry;
typedef std::vector<InfoEntry> InfoEntries;
class PDESolver {
protected:
int verbose = 1;
......@@ -51,12 +52,31 @@ public:
mout.EndBlock(verbose == 0);
}
MatrixGraphs *CreateSolutionMatrixGraph(Meshes &meshes) {
auto disc = this->GetDisc();
auto typeName = typeid(*disc).name();
if (typeName == typeid(LagrangeDiscretization).name())
return new MatrixGraphs(meshes, *disc);
if (typeName == typeid(RTLagrangeDiscretization).name())
return new MatrixGraphs(meshes, *disc);
if (typeName == typeid(DGDiscretization).name())
return new CellMatrixGraphs(meshes, *disc);
if (typeName == typeid(EGDiscretization).name())
return new CellVertexMatrixGraphs(meshes, *disc);
Exit(string(typeName) + " not found")
}
virtual IDiscretization *GetDisc() = 0;
virtual void DrawSample(const SampleID &id) = 0;
InfoEntries GetInfoEntries() const {
return entries;
}
void PrintInfo() const {
mout.PrintInfo("Model", verbose, entries);
mout.PrintInfo("Model", verbose, GetInfoEntries());
}
};
......@@ -82,7 +102,10 @@ public:
PDESolver(),
assemble(assemble),
solver(Solver(GetPC("SuperLU"), "GMRES")),
newton(Newton(solver)) {}
newton(Newton(solver)) {
auto assembleEntries = assemble->GetInfoEntries();
// entries.insert(entries.end(), assembleEntries.begin(), assembleEntries.end());
}
IDiscretization *GetDisc() override {
return assemble->GetDisc();
......
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