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

added new problems

parent 36a4a666
......@@ -8,11 +8,13 @@
enum EStochasticProblem {
DefaultProblem,
StochasticLaplace2D,
StochasticLaplace1D,
StochasticLaplace2D,
StochasticPollution1D,
StochasticPollution2D,
StochasticPollutionCosHat2D,
StochasticPollutionCosHat1D,
DeterministicPollutionCosHat1D,
StochasticPollutionMollifiedBar2D,
DeterministicLaplace1D,
DeterministicLaplace2D,
......@@ -36,6 +38,9 @@ public:
case StochasticPollution1D:
case DeterministicPollution1D:
return (T *) new class StochasticPollution1D();
case StochasticPollutionCosHat1D:
case DeterministicPollutionCosHat1D:
return (T *) new class StochasticPollutionCosHat1D;
case StochasticPollution2D:
case DeterministicPollution2D:
return (T *) new class StochasticPollution2D();
......@@ -58,6 +63,8 @@ private:
static map<string, EStochasticProblem> problemMap() {
return {
{"DefaultProblem", DefaultProblem},
{"StochasticPollutionCosHat1D", StochasticPollutionCosHat1D},
{"DeterministicPollutionCosHat1D", DeterministicPollutionCosHat1D},
{"StochasticLaplace1D", StochasticLaplace1D},
{"DeterministicLaplace1D", DeterministicLaplace1D},
{"StochasticLaplace2D", StochasticLaplace2D},
......
......@@ -35,7 +35,7 @@ public:
}
virtual double faceB(const cell &c, int f,
const VectorField &N, const Point &x) const {
const VectorField &N, const Point &x) const {
return assemble->EvaluateNormalFlux(*fieldSample, c, f);
}
};
......@@ -51,9 +51,10 @@ public:
}
double ut(double t, const Point &x) const override {
if (abs(c * t - x[0] + 0.5) > 0.06251) return 0.0;
return 1.0;
if (abs(c * t - x[0] + 0.5) > 0.06251)
return 0.0;
else
return 1.0;
}
// VectorField cellB(const cell &c, const Point &x) const override {
......@@ -68,6 +69,36 @@ public:
string Name() const override { return "Stochastic Pollution 1D"; }
};
class StochasticPollutionCosHat1D : public StochasticTransportProblem {
private:
double amplitude = 1.00;
double cc = 6.0;
public:
StochasticPollutionCosHat1D() {
disc = new Discretization("RT0_P0", 1, 1);
assemble = new HybridEllipticAssemble(disc, nullptr);
}
double ut(double t, const Point &x) const override {
// mout << x << endl;
Point midPoint = Point(0.2, 0.0);
double r = dist(midPoint, x);
if (r < 0.1)
return 1.0;
else
return 0.0;
// if (r < 1 / cc)
// return amplitude * pow(cos(cc * Pi * r) + 1.0, 2.0);
// return 0.0;
}
string Name() const override { return "Stochastic Pollution CosHat 2D"; }
};
class StochasticPollution2D : public StochasticTransportProblem {
public:
StochasticPollution2D() {
......
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