Commit 017982f0 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

made DrawSample protected

parent b5619f0c
Pipeline #168493 canceled with stages
in 26 minutes
......@@ -48,15 +48,8 @@ void MonteCarlo::method(PDESolver &pdeSolver) {
while (aggregate.ctr.dMcomm != 0) {
updateSampleIds(fineSolution, coarseSolution);
pdeSolver.DrawSample(fineId);
pdeSolver.Run(fineSolution);
if (!onlyFine) {
pdeSolver.DrawSample(coarseId);
pdeSolver.Run(coarseSolution);
}
if (!onlyFine) pdeSolver.Run(coarseSolution);
aggregate.Update(fineSolution, coarseSolution);
}
......@@ -77,15 +70,8 @@ void MonteCarlo::adaptiveMethod(PDESolver &pdeSolver) {
while (aggregate.ctr.dM != 0) {
while (aggregate.ctr.dMcomm != 0) {
updateSampleIds(fineSolution, coarseSolution);
pdeSolver.DrawSample(fineId);
pdeSolver.Run(fineSolution);
if (!onlyFine) {
pdeSolver.DrawSample(coarseId);
pdeSolver.Run(coarseSolution);
}
if (!onlyFine) pdeSolver.Run(coarseSolution);
aggregate.Update(fineSolution, coarseSolution);
}
......
......@@ -31,7 +31,6 @@ void StochasticCollocation::method() {
// Todo implement coarse solution solving
pdeSolver->DrawSample(fineId);
pdeSolver->Run(fineSolution);
aggregate.Update(fineSolution, coarseSolution);
......
......@@ -20,7 +20,6 @@ void HybridFaceNormalFluxGenerator::createPDESolver() {
// Todo delete sample solutions
void HybridFaceNormalFluxGenerator::drawSample(const SampleID &id) {
pdeSolver->DrawSample(id);
solutionFaceValues = new SampleSolution(pdeSolver->GetDisc(), id);
solutionFaceFlux = new SampleSolution(pdeSolver->GetDisc(), id);
pdeSolver->Run(*solutionFaceValues);
......
......@@ -55,7 +55,7 @@ public:
IStochasticProblem *GetProblem() const override { return assemble->GetProblem(); }
void DrawSample(const SampleID &id) override { assemble->DrawSample(id); }
void drawSample(const SampleID &id) override { assemble->DrawSample(id); }
std::string Name() const override { return "EllipticPDESolver"; }
};
......
......@@ -3,6 +3,7 @@
void PDESolver::Run(SampleSolution &solution) {
mout.StartBlock("PDE Solver");
drawSample(solution.id);
vout(2) << solution.id << endl;
run(solution);
computeQ(solution);
......
......@@ -20,6 +20,8 @@ protected:
virtual void run(SampleSolution &solution) = 0;
virtual void drawSample(const SampleID &id) = 0;
virtual void computeQ(SampleSolution &solution) = 0;
virtual void computeCost(SampleSolution &solution) = 0;
......@@ -46,8 +48,6 @@ public:
virtual IStochasticProblem *GetProblem() const = 0;
virtual void DrawSample(const SampleID &id) = 0;
virtual std::string Name() const = 0;
};
......@@ -78,7 +78,7 @@ public:
IStochasticProblem *GetProblem() const override { return assemble->GetProblem(); }
void DrawSample(const SampleID &id) override { assemble->DrawSample(id); }
void drawSample(const SampleID &id) override { assemble->DrawSample(id); }
std::string Name() const override { return "DummyPDESolver"; }
};
......
......@@ -61,7 +61,7 @@ public:
IStochasticProblem *GetProblem() const override { return nullptr; }
void DrawSample(const SampleID &id) override {}
void drawSample(const SampleID &id) override {}
std::string Name() const override { return "ParabolicPDESolver"; }
};
......
......@@ -56,7 +56,7 @@ public:
IStochasticProblem *GetProblem() const override { return assemble->GetProblem(); }
void DrawSample(const SampleID &id) override { assemble->DrawSample(id); }
void drawSample(const SampleID &id) override { assemble->DrawSample(id); }
std::string Name() const override { return "TransportPDESolver"; }
};
......
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