Commit 4da6dfda authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

refactoring

parent 26a32320
...@@ -85,26 +85,19 @@ protected: ...@@ -85,26 +85,19 @@ protected:
void run(SampleSolution &solution) override {} void run(SampleSolution &solution) override {}
void computeQ(SampleSolution &solution) override { void computeQ(SampleSolution &solution) override {
if (quantity == "FunctionEvaluation") solution.Q = assemble->FunctionEvaluation(); solution.Q = assemble->FunctionEvaluation();
else Exit("Quantity of interest not implemented")
} }
void computeCost(SampleSolution &solution) override { void computeCost(SampleSolution &solution) override {
if (costMeasure == "size") solution.C = solution.U.size(); solution.C = 1.0; // Cost corresponds to one function evaluation
// else if (costMeasure == "time") solution.Cost = solution.U.size(); // Todo
else Exit("Cost measure not implemented")
} }
void plotSolution(SampleSolution &solution) override { void plotSolution(SampleSolution &solution) override {}
mpp::plot_mesh(solution.U.GetMesh());
}
public: public:
DummyPDESolver(IStochasticDummyAssemble *assemble, // Todo remove costMeasure and quantity
const Meshes &meshes, DummyPDESolver(IStochasticDummyAssemble *assemble, const Meshes &meshes) :
const std::string &quantity = "L2", PDESolver(meshes, "", ""), assemble(assemble) {}
const std::string &costMeasure = "size") :
PDESolver(meshes, quantity, costMeasure), assemble(assemble) {}
IAssemble *GetAssemble() const override { return assemble; } IAssemble *GetAssemble() const override { return assemble; }
......
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