Commit 08ee6fde authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

rmv assemble from MonteCarlo

parent d44322ed
......@@ -26,6 +26,6 @@ void MonteCarlo::findSampleSolution(int m, SampleID &id, SampleSolution &solutio
id.number = m;
solution.id = id;
plotter->SetDirectory(id);
assemble->DrawSample(id);
pdeSolver->DrawSample(id);
pdeSolver->Run(solution);
}
......@@ -5,7 +5,6 @@
#include "EmpiricMeasures.hpp"
#include "PDESolver.hpp"
#include "Sample.hpp"
#include "assemble/IStochasticAssemble.hpp"
class MonteCarlo {
......@@ -28,24 +27,17 @@ public:
Variances vars;
Kurtosis kurtosis;
IStochasticAssemble *assemble;
PDESolver *pdeSolver;
MatrixGraphs solMGraphs;
SampleID coarseId;
SampleID fineId;
SampleSolution coarseSolution;
SampleSolution fineSolution;
MonteCarlo(int level,
int dM,
bool onlyFine,
Meshes &meshes,
IStochasticAssemble *assemble,
PDESolver *pdeSolver) :
level(level), onlyFine(onlyFine),
assemble(assemble), pdeSolver(pdeSolver),
solMGraphs(MatrixGraphs(meshes, *assemble->GetDiscretization())),
MonteCarlo(int level, int dM, bool onlyFine, Meshes &meshes, PDESolver *pdeSolver) :
level(level), onlyFine(onlyFine), pdeSolver(pdeSolver),
solMGraphs(MatrixGraphs(meshes, *pdeSolver->GetDisc())),
coarseSolution(SampleSolution(solMGraphs, level - meshes.pLevel() - 1)),
fineSolution(SampleSolution(solMGraphs, level - meshes.pLevel())) {
......
......@@ -13,7 +13,7 @@ void MultilevelMonteCarlo::initializeMapMonteCarlo() {
}
MonteCarlo *MultilevelMonteCarlo::createMonteCarlo(int l, int dM, bool onlyFine) {
return new MonteCarlo(l, dM, onlyFine, *meshes, assemble, new EllipticPDESolver());
return new MonteCarlo(l, dM, onlyFine, *meshes, pdeSolver);
// return new MonteCarlo(l, onlyFine, *meshes, assemble, new TransportPDESolver());
Exit("Wrong Assembly Class")
}
......
......@@ -18,7 +18,6 @@ public:
MonteCarloMap mcMap;
Meshes *meshes;
IStochasticAssemble *assemble;
PDESolver *pdeSolver;
vector<int> levels = {};
......@@ -33,8 +32,6 @@ public:
double epsilon = 0.0;
bool mcOnly = false;
vector<vector<int>> levelsOverEpsilon = {}, sampleAmountOverEpsilon = {};
vector<double> valueOverEpsilon = {}, costOverEpsilon = {};
double alpha = 0.0, beta = 0.0, gamma = 0.0;
double numErr = 0.0, statErr = 0.0, totalErr = 0.0;
......@@ -42,12 +39,10 @@ public:
MultilevelMonteCarlo(vector<int> &initLevels,
vector<int> &initSampleAmount,
Meshes *meshes,
IStochasticAssemble *assemble,
PDESolver *pdeSolver) :
initLevels(initLevels),
initSampleAmount(initSampleAmount),
meshes(meshes),
assemble(assemble),
pdeSolver(pdeSolver) {
config.get("mcOnly", mcOnly);
......
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