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

added hybrid assemble to transport problem to eval flux

parent 6d6a7036
......@@ -10,7 +10,7 @@ public:
StochasticProblem() = default;
virtual ~StochasticProblem() {};
virtual ~StochasticProblem() = default;;
void LoadNewSample(Vector *sample) {
fieldSample = sample;
......
......@@ -12,7 +12,6 @@ public:
VectorField b = Point(0.0, -1.0, 0.0);
bool rhs = false;
const Vector *flux = nullptr;
bool RHS() const { return rhs; }
......@@ -73,11 +72,16 @@ public:
class StochasticPollutionCosHat2D : public StochasticTransportProblem {
private:
double aa = 1.00;
double cc = 5.0;
Discretization *disc;
HybridEllipticAssemble *assemble;
double aa = 1.00;
double cc = 6.0;
public:
StochasticPollutionCosHat2D() = default;
StochasticPollutionCosHat2D() {
disc = new Discretization("RT0_P0", 1, 2);
assemble = new HybridEllipticAssemble(disc, nullptr);
}
double ut(double t, const Point &x) const override {
Point midPoint = Point(0.5, 0.8);
......@@ -88,18 +92,45 @@ public:
}
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;
// VectorField localFlux;
// for (int d = 0; d < 3; d++)
// localFlux[d] = (*fieldSample)(c(), d);
// return localFlux;
return assemble->EvaluateCellFlux (*fieldSample, c);
}
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);
return assemble->EvaluateNormalFlux (*fieldSample, c, f);
}
string Name() const override { return "Stochastic Pollution 2D"; }
};
//class PollutionProblem : public ProblemTransport {
// double d;
//public:
// PollutionProblem (const Discretization_dG_variable& _disc,
// const HybridAssemble* hybrid,
// const Vector* flux) :
// ProblemTransport (_disc, hybrid, flux, 2), d (1.0 / 16) {}
// double ut (double t, const Point& x) const {
// if ((abs (1 - x[1] - 1.5 * d) < d / 2) && (abs (0.5 - x[0]) < 3 * d))
// return 1;
// else return 0.0;
// }
// VectorField cellB (const cell& c, const Point& x) const {
// return hybrid->EvaluateCellFlux (*flux, c);
// }
// double faceB (const cell& c, int f,
// const VectorField& N, const Point& x) const {
// return hybrid->EvaluateNormalFlux (*flux, c, f);
// }
// string Name () const { return string ("Pollution"); }
//};
#endif //MLMC_STOCHASTICTRANSPORTPROBLEM_HPP
Supports Markdown
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