MonteCarloTransport.h 1.31 KB
Newer Older
1
2
3
4
5
#ifndef MLMC_MONTECARLOTRANSPORT_HPP
#define MLMC_MONTECARLOTRANSPORT_HPP

#include "MonteCarlo.h"
#include "assemble/DGTransportAssemble.h"
6
#include "timestepping/TimeIntegrator.h"
7
//#include "timestepping/TimeIntegrator2.h"
8

9

10
class MonteCarloTransport : public MonteCarlo {
niklas.baumgarten's avatar
niklas.baumgarten committed
11
12
13
14
protected:
    void initialize() override;

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

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

private:
    double startTime = 0.0;
    double endTime = 0.0;
23
24

    TimeSeries getTimeSeries(bool fineLevel);
25

26
27
public:
    DGTransportAssemble *assemble;
28

niklas.baumgarten's avatar
niklas.baumgarten committed
29
    MatrixGraphs cellMatrixGraphs;
30
    MatrixGraphs faceMatrixGraphs;
31
32
    CellMatrixGraphs solMatrixGraphs;

33
    MonteCarloTransport(int l, int dM, bool baseLevel, Meshes *meshes,
34
35
36
                        StochasticField *stochFields, DGTransportAssemble *assemble) :
        MonteCarlo(l, dM, baseLevel, meshes, stochFields),
        assemble(assemble),
niklas.baumgarten's avatar
niklas.baumgarten committed
37
        cellMatrixGraphs(MatrixGraphs(*meshes, dof("cell", 3))),
38
        faceMatrixGraphs(MatrixGraphs(*meshes, dof("face", 3))),
niklas.baumgarten's avatar
niklas.baumgarten committed
39
        solMatrixGraphs(*meshes, *assemble->disc) {
40

41
42
        config.get("startTime", startTime);
        config.get("endTime", endTime);
43
44
    }

45
    ~MonteCarloTransport() {
niklas.baumgarten's avatar
niklas.baumgarten committed
46
    }
47
48
49
};

#endif //MLMC_MONTECARLOTRANSPORT_HPP