MonteCarloElliptic.hpp 1.49 KB
Newer Older
1
2
#ifndef MLMC_MONTECARLOELLIPTIC_H
#define MLMC_MONTECARLOELLIPTIC_H
3

4
5
#include "MonteCarlo.h"
#include "assemble/EllipticAssemble.h"
6

7

8
class MonteCarloElliptic : public MonteCarlo {
niklas.baumgarten's avatar
niklas.baumgarten committed
9
10
protected:
    void initialize() override;
11

niklas.baumgarten's avatar
niklas.baumgarten committed
12
    void method() override;
13

14
15
16
17
18
    void solvePDE(int l,
                  int m,
                  bool fineLevel,
                  double &valueQ,
                  double &cost,
niklas.baumgarten's avatar
niklas.baumgarten committed
19
                  Vector &solution) override;
20

21
22
public:
    EllipticAssemble *assemble;
23

niklas.baumgarten's avatar
niklas.baumgarten committed
24
    MatrixGraphs cellMatrixGraphs;
25
    MatrixGraphs solMatrixGraphs;
26

niklas.baumgarten's avatar
niklas.baumgarten committed
27
28
29
30
31
    Vector finePermeability;
    Vector coarsePermeability;
    Vector fineSolution;
    Vector coarseSolution;

32
33
34
35
36
37
38
39
    MonteCarloElliptic(int l,
                       int dM,
                       bool onlyFineLevel,
                       Meshes *meshes,
                       StochasticField *stochFields,
                       EllipticAssemble *assemble,
                       MultilevelPlotter &plots) :
        MonteCarlo(l, dM, onlyFineLevel, meshes, plots, stochFields),
40
        assemble(assemble),
niklas.baumgarten's avatar
niklas.baumgarten committed
41
        cellMatrixGraphs(MatrixGraphs(*meshes, dof("cell", 3))),
niklas.baumgarten's avatar
niklas.baumgarten committed
42
43
44
45
46
47
48
        solMatrixGraphs(MatrixGraphs(*meshes, *assemble->disc)),
        finePermeability(Vector(cellMatrixGraphs[l - pLevel])),
        coarsePermeability(Vector(cellMatrixGraphs[l - pLevel - 1])),
        fineSolution(Vector(solMatrixGraphs[l - pLevel])),
        coarseSolution(Vector(solMatrixGraphs[l - pLevel - 1])) {

        initialize();
49
    }
50
51
};

52
#endif //MLMC_MONTECARLOELLIPTIC_H