Commit 358fb9e7 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

Merge branch '36-further-sc-tests' of git.scc.kit.edu:mpp/mluq into 36-further-sc-tests

parents 76bc4ed6 096ff363
......@@ -13,5 +13,7 @@ CreateStochasticEllipticProblem(const string &problemName, const Meshes &meshes)
return new Laplace2D(meshes);
if (problemName == "StochasticLaplace2DTest")
return new StochasticLaplace2DTest(meshes);
if (problemName == "SparseGridTestPDE")
return new SparseGridTestPDE(meshes);
Exit(problemName + " not found")
}
\ No newline at end of file
......@@ -164,6 +164,40 @@ public:
string Name() const override { return "Laplace2D"; }
};
class SparseGridTestPDE : public IStochasticEllipticProblem {
UniformDistributionRVector rVectorGenerator;
private:
double a_min = 1/100 ;
public:
explicit SparseGridTestPDE(const Meshes &meshes) : IStochasticEllipticProblem(meshes),
rVectorGenerator(UniformDistributionRVector(meshes, 4, 0.0, 1.0)) {}
void DrawSample(const SampleID &id) override {
rVectorGenerator.DrawSample(id);
}
//Sets dirichlet boundary condition
Scalar Solution(const Point &x) const override{
return 0.0;
}
//sets neumann boundary conditions
// VectorField Flux(const Point &x) const override {
// return VectorField(1.0,0.0);
// }
Scalar Load(const Point &x) const override {
return 0.0;
}
Tensor Permeability(const cell &c) const override {
return a_min + exp((cos(M_PI * c()[1]) * this -> rVectorGenerator.EvalSample()[0] + sin(M_PI * c()[1]) * this -> rVectorGenerator.EvalSample()[2]) * exp(-1/8)
+ (cos(M_PI * c()[0]) * this -> rVectorGenerator.EvalSample()[1] + sin(M_PI * c()[0]) * this -> rVectorGenerator.EvalSample()[4])* exp(-1/8));;
}
string Name() const override { return "SparseGridTestPDE";}
};
IStochasticEllipticProblem *
CreateStochasticEllipticProblem(const string &problemName, const Meshes &meshes);
......
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