Commit b210acda authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

Committed to Library Structure

parent 6ad73e86
......@@ -3,4 +3,4 @@ add_library(PROBLEMS STATIC
StochasticEllipticProblem.cpp
StochasticTransportProblem.cpp
)
target_link_libraries(PROBLEMS GENERATORS MPP_LIBRARIES)
target_link_libraries(PROBLEMS GENERATORS)
......@@ -2,8 +2,6 @@
StochasticDummyProblem *
CreateStochasticDummyProblem(const std::string &problemName, const Meshes &meshes) {
if (problemName == "StochasticDummyProblem")
return new StochasticDummyProblem(meshes);
if (problemName == "StochasticDummyScalarGeneratorProblem")
return new StochasticDummyScalarGeneratorProblem(meshes);
if (problemName == "StochasticDummyComplexGeneratorProblem")
......
......@@ -29,15 +29,7 @@ public:
explicit StochasticDummyProblem(const Meshes &meshes) :
IStochasticProblem(meshes) {}
virtual double GeneratorValue() {
return 0.0;
};
void DrawSample(const SampleID &id) override {}
string Name() const override {
return "StochasticDummyProblem";
}
virtual double GeneratorValue() = 0;
};
class StochasticDummyScalarGeneratorProblem : public StochasticDummyProblem {
......@@ -121,6 +113,10 @@ public:
StochasticDummyProblem(meshes),
rVectorGenerator(NormalDistributionRVector(meshes)) {}
void DrawSample(const SampleID &id) override {
rVectorGenerator.DrawSample(id);
}
double GeneratorValue() override {
return this->rVectorGenerator.EvalSample().Mean();
}
......@@ -137,6 +133,10 @@ public:
StochasticDummyProblem(meshes),
cVectorGenerator(NormalDistributionCVector(meshes)) {}
void DrawSample(const SampleID &id) override {
cVectorGenerator.DrawSample(id);
}
double GeneratorValue() override {
return abs_compl(this->cVectorGenerator.EvalSample().Mean());
}
......@@ -153,6 +153,10 @@ public:
StochasticDummyProblem(meshes),
rMatrixGenerator(NormalDistributionRMatrix(meshes)) {}
void DrawSample(const SampleID &id) override {
rMatrixGenerator.DrawSample(id);
}
double GeneratorValue() override {
return abs_compl(this->rMatrixGenerator.EvalSample().Mean());
}
......@@ -169,6 +173,10 @@ public:
StochasticDummyProblem(meshes),
cMatrixGenerator(NormalDistributionCMatrix(meshes)) {}
void DrawSample(const SampleID &id) override {
cMatrixGenerator.DrawSample(id);
}
double GeneratorValue() override {
return abs_compl(this->cMatrixGenerator.EvalSample().Mean());
}
......
#include "problems/StochasticEllipticProblem.hpp"
#include "StochasticEllipticProblem.hpp"
IStochasticEllipticProblem *
......
#ifndef STOCHASTICELLIPTICPROBLEM_HPP
#define STOCHASTICELLIPTICPROBLEM_HPP
#include "problems/IStochasticProblem.hpp"
#include "IStochasticProblem.hpp"
class IStochasticEllipticProblem : public IStochasticProblem {
......
......@@ -18,18 +18,18 @@ add_mpp_test(generators/TestSparseGridGenerator GENERATORS)
#add_mpp_test(generators/TestHybridFluxGenerator GENERATORS)
add_mpp_test(estimators/datastructure/TestLevelMaps MONTECARLO)
add_mpp_test(estimators/datastructure/TestExponents MONTECARLO)
add_mpp_test(estimators/datastructure/TestMultilevelErrors MONTECARLO)
add_mpp_test(estimators/datastructure/TestLevelMaps ESTIMATORS)
add_mpp_test(estimators/datastructure/TestExponents ESTIMATORS)
add_mpp_test(estimators/datastructure/TestMultilevelErrors ESTIMATORS)
add_mpp_test(pdesolver/TestPDESolver PDESOLVER)
add_mpp_test(pdesolver/TestPDESolver PDESOLVERS)
# ------- MPI Tests -------
add_mpi_test(TestMain MONTECARLO)
add_mpi_test(generators/TestSPRNG5 MONTECARLO)
add_mpi_test(estimators/TestMonteCarlo MONTECARLO)
add_mpi_test(estimators/TestMultilevelMonteCarlo MONTECARLO)
add_mpi_test(pdesolver/TestPDESolver PDESOLVER)
add_mpi_test(estimators/datastructure/TestWelfordAggregate MONTECARLO)
\ No newline at end of file
add_mpi_test(TestMain ESTIMATORS)
add_mpi_test(generators/TestSPRNG5 ESTIMATORS)
add_mpi_test(estimators/TestMonteCarlo ESTIMATORS)
add_mpi_test(estimators/TestMultilevelMonteCarlo ESTIMATORS)
add_mpi_test(pdesolver/TestPDESolver PDESOLVERS)
add_mpi_test(estimators/datastructure/TestWelfordAggregate ESTIMATORS)
\ No newline at end of file
Markdown is supported
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