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

added new test case

parent 684c6605
Pipeline #158178 passed with stages
in 28 minutes and 21 seconds
......@@ -23,5 +23,7 @@ CreateStochasticDummyProblem(const std::string &problemName, const Meshes &meshe
return new SparseGrid1DGeneratorProblem(meshes);
if (problemName == "SparseGrid2DGeneratorProblem")
return new SparseGrid2DGeneratorProblem(meshes);
if (problemName == "SparseGrid2DPolynomialDegree2Problem")
return new SparseGrid2DPolynomialDegree2Problem(meshes);
Exit(problemName + " not found")
}
\ No newline at end of file
......@@ -249,6 +249,23 @@ public:
}
};
class SparseGrid2DPolynomialDegree2Problem : public SparseGridGeneratorProblem {
public:
explicit SparseGrid2DPolynomialDegree2Problem(const Meshes &meshes) :
SparseGridGeneratorProblem(meshes, SparseGridGenerator(meshes, 2, 0, 1)) {}
double FunctionEvaluation() override {
RVector sample = this->generator.EvalSample();
return sample[0] * sample[1];
}
string Name() const override {
return "SparseGrid2DPolynomialDegree2Problem";
}
};
// Todo find more test cases in tasmanina examples and write sparse grid problems
StochasticDummyProblem *
CreateStochasticDummyProblem(const std::string &problemName, const Meshes &meshes);
......
#include "TestStochasticCollocation.hpp"
// Test cases for convergence rate
// depending on dimension and level -> Smoothness of problem has to be known
//
INSTANTIATE_TEST_SUITE_P(
TestStochasticCollocation, TestStochasticCollocationWithoutEpsilon, Values(
TestParams{"SparseGrid2DGeneratorProblem", "FunctionEvaluation",
"DummyPDESolver", 2.513723354063905}
"DummyPDESolver", 2.513723354063905},
TestParams{"SparseGrid2DPolynomialDegree2Problem", "FunctionEvaluation",
"DummyPDESolver", 0.0}
// Todo add more test cases
));
......
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