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

added deterministic problems

parent 4cacf451
......@@ -44,6 +44,32 @@ public:
string Name() const override { return "StochasticLaplace1D"; }
};
class Laplace1D : public IStochasticEllipticProblem {
public:
Laplace1D(Meshes &meshes) :
IStochasticEllipticProblem(GeneratorNames{"DummyGenerator"},
meshes) {};
Scalar Solution(const Point &x) const override {
return 1 - x[0];
}
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 this->generators.find("DummyGenerator")->
second->EvalTensorSample(c);
}
string Name() const override { return "Laplace1D"; }
};
class StochasticLaplace2D : public IStochasticEllipticProblem {
public:
StochasticLaplace2D(Meshes &meshes) :
......@@ -61,13 +87,35 @@ public:
Scalar Load(const Point &x) const override { return 0.0; }
Tensor Permeability(const cell &c) const override {
return this->generators.find("CirculantEmbedding")->
second->EvalTensorSample(c);
return One;
}
string Name() const override { return "StochasticLaplace2D"; }
};
class Laplace2D : public IStochasticEllipticProblem {
public:
Laplace2D(Meshes &meshes) :
IStochasticEllipticProblem(GeneratorNames{"DummyGenerator"},
meshes) {}
Scalar Solution(const Point &x) const override {
return -x[1];
}
VectorField Flux(const Point &x) const override {
return VectorField(0.0, -1.0);
}
Scalar Load(const Point &x) const override { return 0.0; }
Tensor Permeability(const cell &c) const override {
return One;
}
string Name() const override { return "Laplace2D"; }
};
IStochasticEllipticProblem *
CreateStochasticEllipticProblem(std::string problemName, 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