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

added weight solution - other possible approach could be to add the weight as...

added weight solution - other possible approach could be to add the weight as class member to SampleSolution, such that aggregate can access it
parent a7adf6c3
......@@ -32,6 +32,10 @@ protected:
virtual void plotSolution(SampleSolution &solution) = 0;
void weightSolution(SampleSolution &solution) const {
solution.Q = GetProblem()->SampleWeight(solution.id) * solution.Q;
}
public:
PDESolver(const Meshes &meshes, const std::string &quantity,
const std::string &costMeasure) :
......@@ -56,6 +60,8 @@ public:
computeQ(solution);
computeCost(solution);
plotSolution(solution);
weightSolution(solution);
// Todo other idea: Add weight as class member of solution
vout(2) << "Q=" << solution.Q << " cost=" << solution.Cost << endl;
mout.EndBlock(verbose <= 1);
}
......@@ -98,12 +104,7 @@ public:
const Meshes &meshes,
const std::string &quantity = "L2",
const std::string &costMeasure = "size") :
PDESolver(meshes, quantity, costMeasure), assemble(assemble) {
if (verbose > 0) {
PrintInfo();
assemble->PrintInfo();
}
}
PDESolver(meshes, quantity, costMeasure), assemble(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