Estimator.cpp 883 Bytes
Newer Older
niklas.baumgarten's avatar
niklas.baumgarten committed
1
2
3
4
5
6
7
#include "StochasticCollocation.hpp"
#include "MultilevelEstimator.hpp"
#include "MonteCarlo.hpp"

#include "Estimator.hpp"


8
9
Estimator *EstimatorCreator::Create() {
  if (_estimatorName == "StochasticCollocation")
niklas.baumgarten's avatar
niklas.baumgarten committed
10
11
12
13
    return new StochasticCollocation(
      _epsilon, _level, _stochLevel, _onlyFine, _parallel,
      _meshesCreator, _pdeSolverCreator
    );
niklas.baumgarten's avatar
niklas.baumgarten committed
14

15
16
  if (_estimatorName == "MultilevelMonteCarlo")
    return new MultilevelEstimator(
17
18
      _epsilon, _levelVec, _samplesVec, _subEstName, _parallel,
      _meshesCreator, _pdeSolverCreator
19
20
21
22
    );

  if (_estimatorName == "MonteCarlo")
    return new MonteCarlo(
23
24
      _epsilon, _level, _initSamples, _onlyFine, _parallel,
      _meshesCreator, _pdeSolverCreator
25
    );
niklas.baumgarten's avatar
niklas.baumgarten committed
26

27
  Exit("Estimator is not implemented")
niklas.baumgarten's avatar
niklas.baumgarten committed
28
}
29
30
31
32
33

std::unique_ptr<Estimator> EstimatorCreator::CreateUnique() {
  return std::unique_ptr<Estimator>(Create());
}