TestMonteCarlo.hpp 1.55 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
#ifndef TESTMONTECARLO_HPP
#define TESTMONTECARLO_HPP

#include "montecarlo/MonteCarlo.hpp"
#include "pdesolver/PDESolverCreator.hpp"

#include "mesh/MeshesCreator.hpp"
#include "TestEnvironment.hpp"


niklas.baumgarten's avatar
niklas.baumgarten committed
11
12
class TestMonteCarlo : public TestWithParam<std::string> {
protected:
niklas.baumgarten's avatar
niklas.baumgarten committed
13
  bool onlyFine = true;
niklas.baumgarten's avatar
niklas.baumgarten committed
14
15
16
17
18
19
20
21
22
23
24

  int level = 3;

  int dM = 1e6;

  MeshesCreator meshesCreator;

  PDESolverCreator pdeSolverCreator;

  MonteCarlo mc;

niklas.baumgarten's avatar
niklas.baumgarten committed
25
  TestMonteCarlo(const std::string &meshName, bool parallel) :
niklas.baumgarten's avatar
niklas.baumgarten committed
26
27
    meshesCreator(MeshesCreator("Interval").
      WithDistribute("RCB").
niklas.baumgarten's avatar
niklas.baumgarten committed
28
      WithoutOverlap()),
niklas.baumgarten's avatar
niklas.baumgarten committed
29
30
31
32
    pdeSolverCreator(PDESolverCreator().
      WithProblem(GetParam()).
      WithQuantity("GeneratorValue").
      WithModel("DummyPDESolver")),
niklas.baumgarten's avatar
niklas.baumgarten committed
33
34
    mc(MonteCarlo(level, dM, onlyFine, parallel,
                  meshesCreator, pdeSolverCreator)) {
niklas.baumgarten's avatar
niklas.baumgarten committed
35
36
37
38
39
40
41
42
43
44
    mc.Method();
  }

  void TearDown() {
    PPM->Barrier(0);
  }
};

class TestMonteCarloSeriell : public TestMonteCarlo {
protected:
niklas.baumgarten's avatar
niklas.baumgarten committed
45
46
  TestMonteCarloSeriell(const std::string &meshName) :
    TestMonteCarlo(meshName, false) {}
niklas.baumgarten's avatar
niklas.baumgarten committed
47
48
49
50
};

class TestMonteCarloParallel : public TestMonteCarlo {
protected:
niklas.baumgarten's avatar
niklas.baumgarten committed
51
52
  TestMonteCarloParallel(const std::string &meshName) :
    TestMonteCarlo(meshName, true) {}
niklas.baumgarten's avatar
niklas.baumgarten committed
53
54
55
56
};

class TestMonteCarloSeriellInterval : public TestMonteCarloSeriell {
protected:
niklas.baumgarten's avatar
niklas.baumgarten committed
57
58
  TestMonteCarloSeriellInterval() :
    TestMonteCarloSeriell("Interval") {}
niklas.baumgarten's avatar
niklas.baumgarten committed
59
60
61
62
};

class TestMonteCarloParallelInterval : public TestMonteCarloParallel {
protected:
niklas.baumgarten's avatar
niklas.baumgarten committed
63
64
  TestMonteCarloParallelInterval() :
    TestMonteCarloParallel("Interval") {}
niklas.baumgarten's avatar
niklas.baumgarten committed
65
66
};

67
68
69


#endif //TESTMONTECARLO_HPP