Commit 123b006a authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

added stochastic collocation class - maybe only estimator will survive

parent 9f35c1c2
//
// Created by niklas on 11.05.21.
//
#include "StochasticCollocation.hpp"
......@@ -6,17 +6,49 @@
class StochasticCollocation : public Estimator {
private:
SampleID fineId;
SampleID coarseId;
MeshesCreator meshesCreator;
PDESolverCreator pdeSolverCreator;
public:
StochasticCollocation() : Estimator(0.0, 0, 0) {}
StochasticCollocation(MeshesCreator meshesCreator = MeshesCreator(),
PDESolverCreator pdeCreator = PDESolverCreator()) :
Estimator(0.0, 0, 0),
meshesCreator(meshesCreator), pdeSolverCreator(pdeCreator) {}
std::string Name() const override {
return "StochasticCollocation";
}
void Method() override {
// Todo here is some stuff todo
}
};
std::unique_ptr<Meshes> meshes = meshesCreator.
WithMeshName(pdeSolverCreator.GetMeshName()).
WithCommSplit(aggregate.commSplit).
WithPLevel(level - 1).
WithLevel(level).
CreateUnique();
std::unique_ptr<PDESolver> pdeSolver = pdeSolverCreator.
CreateUnique(*meshes);
SampleSolution fineSolution(pdeSolver->GetDisc(), fineId);
SampleSolution coarseSolution(pdeSolver->GetDisc(), coarseId);
while (aggregate.ctr.dMcomm != 0) {
pdeSolver->DrawSample(fineId);
pdeSolver->Run(fineSolution);
aggregate.Update(fineSolution, coarseSolution);
// errors.Estimate(aggregate);
//
// if (errors.stochastic > epsilon && epsilon != 0.0)
// mout << "TODO" << endl;
// aggregate.
}
};
#endif //STOCHASTICCOLLOCATION_HPP
Supports Markdown
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