#ifndef STOCHASTICCOLLOCATION_HPP #define STOCHASTICCOLLOCATION_HPP #include "Estimator.hpp" class StochasticCollocation : public Estimator { private: SampleID fineId; SampleID coarseId; MeshesCreator meshesCreator; PDESolverCreator pdeSolverCreator; public: 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 { std::unique_ptr meshes = meshesCreator. WithMeshName(pdeSolverCreator.GetMeshName()). WithCommSplit(aggregate.commSplit). WithPLevel(level - 1). WithLevel(level). CreateUnique(); std::unique_ptr 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