Commit 4902bc6c authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

added TestStochasticCollocation files

parent 4dfe536d
#include "TestStochasticCollocation.hpp"
int main(int argc, char **argv) {
return MppTest(
MppTestBuilder(argc, argv).
WithScreenLogging().
WithPPM()
).RUN_ALL_MPP_TESTS();
}
\ No newline at end of file
#ifndef TESTSTOCHASTICCOLLOCATION_HPP
#define TESTSTOCHASTICCOLLOCATION_HPP
#include "StochasticCollocation.hpp"
#include "TestEnvironment.hpp"
class TestStochasticCollocation : public Test {
protected:
bool onlyFine = true;
int level = 3;
int samples;
double epsilon;
MeshesCreator meshesCreator;
PDESolverCreator pdeSolverCreator;
std::unique_ptr<Estimator> scSeriell;
std::unique_ptr<Estimator> scParallel;
double MeanTolerance() const { return sqrt(1.0 / samples); }
double SVarTolerance() const { return sqrt(10.0 / samples); }
TestStochasticCollocation(double epsilon, int samples) :
samples(samples), epsilon(epsilon),
meshesCreator(MeshesCreator().
WithDistribute("RCB").
WithoutOverlap()),
pdeSolverCreator(PDESolverCreator().
WithProblem(GetParam().problemName).
WithQuantity(GetParam().quantity).
WithModel(GetParam().model)),
scSeriell(EstimatorCreator("MonteCarlo").
WithPDESolverCreator(pdeSolverCreator).
WithMeshesCreator(meshesCreator).
WithInitSamples(samples).
WithOnlyFine(onlyFine).
WithInitLevel(level).
WithEpsilon(epsilon).
WithParallel(false).
CreateUnique()),
scParallel(EstimatorCreator("MonteCarlo").
WithPDESolverCreator(pdeSolverCreator).
WithMeshesCreator(meshesCreator).
WithInitSamples(samples).
WithOnlyFine(onlyFine).
WithEpsilon(epsilon).
WithInitLevel(level).
WithParallel(true).
CreateUnique()) {}
};
#endif //TESTSTOCHASTICCOLLOCATION_HPP
Supports Markdown
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