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

update problem

parent 118080e0
Pipeline #251962 failed with stages
in 33 minutes and 31 seconds
......@@ -239,11 +239,11 @@ public:
};
class StochasticPollutionCosHat2D : public IStochasticTransportProblem {
protected:
HybridFaceNormalFluxGenerator scalarGenerator;
HybridCellFluxGenerator vectorFieldGenerator;
protected:
double amplitude = 1.0;
double cc = 6.0;
......@@ -283,20 +283,36 @@ public:
};
class StochasticPollutionTrippleCosHat2D : public StochasticPollutionCosHat2D {
UniformDistributionRVector rVectorGenerator;
public:
explicit StochasticPollutionTrippleCosHat2D() :
IProblem("UnitSquare"), StochasticPollutionCosHat2D() {
IProblem("UnitSquare"), StochasticPollutionCosHat2D(),
rVectorGenerator(UniformDistributionRVector(3, 0.25, 0.75)) {
CFL = 1.0;
}
void InitGenerator(int init) override {
scalarGenerator.InitGenerator(meshes, init);
rVectorGenerator.InitGenerator(meshes, init);
vectorFieldGenerator.InitGenerator(meshes, init);
}
void drawSample(const SampleID &id) override {
scalarGenerator.DrawSample(id);
rVectorGenerator.DrawSample(id);
vectorFieldGenerator.DrawSample(id);
}
double Solution(double t, const Point &x) const override {
std::vector<Point> midPoints{Point(0.25, 0.8), Point(0.5, 0.8), Point(0.75, 0.8)};
RVector x0 = this->rVectorGenerator.EvalSample();
std::vector<Point> midPoints{Point(x0[0], 0.8), Point(x0[1], 0.8), Point(x0[2], 0.8)};
double return_val = 0.0;
for (auto &point : midPoints) {
double r = dist(point, x);
if (r < 1 / cc)
return amplitude * pow(cos(cc * Pi * r) + 1.0, 2.0);
return_val = max(amplitude * pow(cos(cc * Pi * r) + 1.0, 2.0), return_val);
}
return 0.0;
return return_val;
}
};
......
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