Commit 52c1ac62 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

added coshat problems

parent 0798ff6a
......@@ -45,9 +45,9 @@ public:
string Name() const override { return "Stochastic Pollution 1D"; }
};
class StochasticPollution2D : public StochasticTransportProblem {
class Pollution2D : public StochasticTransportProblem {
public:
StochasticPollution2D() = default;
Pollution2D() = default;
double ut(double t, const Point &x) const override {
double d = 1.0 / 16.0;
......@@ -55,48 +55,92 @@ public:
return 1.0;
else return 0.0;
}
};
class Pollution2DCosHat : public StochasticTransportProblem {
private:
double aa = 1.00;
double cc = 5.0;
public:
Pollution2DCosHat() = default;
double ut(double t, const Point &x) const override {
Point midPoint = Point(0.5, 0.8);
double r = dist(midPoint, x);
if (r < 1 / cc)
return aa * pow(cos(cc * Pi * r) + 1.0, 2.0);
return 0.0;
}
};
class StochasticPollution2D : public Pollution2D {
public:
StochasticPollution2D() = default;
VectorField cellB(const cell &c, const Point &x) const override {
VectorField localFlux;
VectorField localFlux;
for (int d = 0; d < 3; d++)
localFlux[d] = (*fieldSample)(c(), d);
return localFlux;
// return hybrid->EvaluateCellFlux(*flux, c);
}
double faceB(const cell &c, int f,
const VectorField &N, const Point &x) const override {
// return hybrid->EvaluateNormalFlux(*flux, c, f);
return N * VectorField(0.0,-1.0);
return N * VectorField(0.0, -1.0);
}
string Name() const override { return "Stochastic Pollution 2D"; }
};
class Pollution2D : public StochasticTransportProblem {
class StochasticPollution2DCosHat : public Pollution2DCosHat {
public:
Pollution2D() = default;
StochasticPollution2DCosHat() = default;
double ut(double t, const Point &x) const override {
double d = 1.0 / 16.0;
if ((abs(1 - x[1] - 1.5 * d) < d / 2) && (abs(0.5 - x[0]) < 3 * d))
return 1.0;
else return 0.0;
VectorField cellB(const cell &c, const Point &x) const override {
VectorField localFlux;
for (int d = 0; d < 3; d++)
localFlux[d] = (*fieldSample)(c(), d);
return localFlux;
}
double faceB(const cell &c, int f,
const VectorField &N, const Point &x) const override {
return N * VectorField(0.0, -1.0);
}
string Name() const override { return "Stochastic Pollution 2D"; }
};
class DeterministicPollution2D : public Pollution2D {
public:
DeterministicPollution2D() = default;
VectorField cellB(const cell &c, const Point &x) const override {
return VectorField(0.0,-1.0);
return VectorField(0.0, -1.0);
}
double faceB(const cell &c, int f,
const VectorField &N, const Point &x) const override {
return N * VectorField(0.0,-1.0);
return N * VectorField(0.0, -1.0);
}
string Name() const override { return "Pollution 2D"; }
};
//HybridEllipticAssemble *hybrid;
//Vector *flux;
class DeterministicPollution2DCosHat : public Pollution2DCosHat {
public:
DeterministicPollution2DCosHat() = default;
VectorField cellB(const cell &c, const Point &x) const override {
return VectorField(0.0, -1.0);
}
double faceB(const cell &c, int f,
const VectorField &N, const Point &x) const override {
return N * VectorField(0.0, -1.0);
}
string Name() const override { return "Pollution 2D"; }
};
#endif //MLMC_STOCHASTICTRANSPORTPROBLEM_HPP
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