Commit 71e073eb authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

Revert "new approach to HybridFluxGenerator"

This reverts commit f6cfb624.
parent f2ac59fb
......@@ -12,68 +12,14 @@
class HybridFluxGenerator : public SampleGenerator {
private:
PDESolver *pdeSolver;
MatrixGraphs *mGraphs;
protected:
void drawSample(const SampleID &id) override {
if (!id.coarse) {
generateFineSample(id);
// if (plotting)
// plotter->PlotVector("flux", *cellFlux, 3,
// id.level.fine, "CellData");
} else {
generateCoarseSample(id);
// if (plotting)
// plotter->PlotVector("flux", *cellFlux, 3,
// id.level.coarse, "CellData");
}
}
void generateFineSample(const SampleID &id) {
SampleSolution solution(mGraphs, id);
pdeSolver->DrawSample(id);
pdeSolver->Run(solution);
// auto cellFlux = new Vector(cellMGraphs[id.MGLevel()]);
// auto faceValues = new Vector(faceMGraphs[id.MGLevel()]);
// auto faceFlux = new Vector(faceMGraphs[id.MGLevel()]);
// pdeSolver->GetAssemble()->SetNormalFlux(*faceValues, *faceFlux);
// pdeSolver->GetAssemble()->SetFlux(*faceValues, *cellFlux);
}
void generateCoarseSample(const SampleID &id) {
generateFineSample(id);
};
public:
HybridFluxGenerator(Meshes &meshes) : SampleGenerator(meshes) {
std::string problemName = "StochasticLaplace2D";
pdeSolver = PDESolverCreator(meshes).
WithModel("HybridElliptic").
WithProblem(problemName).Create();
mGraphs = pdeSolver->CreateSolutionMatrixGraphs(meshes);
}
// VectorField EvalVectorFieldSample(const cell &c) override {
// RTLagrangeElement elem(*pdeSolver->GetDisc(), *faceFlux, c);
// VectorField F = zero;
// double area = 0;
// for (int q = 0; q < elem.nQ(); ++q) {
// double w = elem.QWeight(q);
// area += w;
// F += w * elem.VelocityField(q, *faceFlux);
// }
// F *= (1 / area);
// return F;
// }
//
// Scalar EvalScalarSample(int face, const cell &c) override {
// RTLagrangeElement elem(*pdeSolver->GetDisc(), *faceFlux, c);
// RTFaceElementT<> faceElem(*pdeSolver->GetDisc(), *faceFlux, c, face);
// return (*faceFlux)(elem[face], 0) * elem.Sign(face) / faceElem.Area();
// }
};
class MultilevelHybridFluxGenerator : public SampleGenerator {
......
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