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

bug fix space dim flux

parent 18c0cb9a
......@@ -73,8 +73,8 @@ void EllipticPDESolver::computeCost(SampleSolution &solution) {
void EllipticPDESolver::plotSolution(SampleSolution &solution) {
if (!plotting) return;
SampleSolution solutionCellFlux(fluxMGraphs, solution.id, "Flux");
SampleSolution solutionPressure(pressureMGraphs, solution.id, "Pressure");
SampleSolution solutionCellFlux(fluxMGraphs, solution.id, "Flux");
assemble->SetPressure(solution.U, solutionPressure.U);
assemble->SetFlux(solution.U, solutionCellFlux.U);
......@@ -85,7 +85,7 @@ void EllipticPDESolver::plotSolution(SampleSolution &solution) {
void EllipticPDESolver::createOtherMatrixGraphs() {
if (plotting) {
fluxMGraphs = new MatrixGraphs(meshes, new LagrangeDoF(0, 3));
fluxMGraphs = new MatrixGraphs(meshes, new LagrangeDoF(0, SpaceDimension));
if (typeid(*assemble).name() == typeid(HybridEllipticAssemble).name())
pressureMGraphs = new MatrixGraphs(meshes, new LagrangeDoF(0, 1));
else
......
......@@ -27,20 +27,20 @@
class PDESolver {
protected:
Meshes &meshes;
MatrixGraphs *solMGraphs;
PlotMap plotMap;
int verbose;
int plotting;
Meshes &meshes;
PlotMap plotMap;
std::string quantity;
std::string costMeasure;
MatrixGraphs *solMGraphs;
virtual void run(SampleSolution &solution) = 0;
virtual void computeQ(SampleSolution &solution) = 0;
......@@ -146,12 +146,12 @@ private:
Newton newton;
IStochasticEllipticAssemble *assemble;
MatrixGraphs *fluxMGraphs;
MatrixGraphs *pressureMGraphs;
IStochasticEllipticAssemble *assemble;
protected:
void run(SampleSolution &solution) override;
......@@ -180,6 +180,7 @@ public:
}
~EllipticPDESolver() {
if (!assemble) delete assemble;
if (!solMGraphs) delete solMGraphs;
if (!fluxMGraphs) delete fluxMGraphs;
if (!pressureMGraphs) delete pressureMGraphs;
......
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