Commit 5f53f6b7 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

refactored DGTransportAssemble

parent 56f39fd5
#include "DGTransportAssemble.hpp"
const char *DGTransportAssemble::Name() const { return "DGTransportAssemble"; }
double DGTransportAssemble::Residual(const Vector &u, Vector &b) const {
b = 0;
......
......@@ -2,27 +2,38 @@
#define TUTORIAL_DGTRANSPORT_HPP
#include "timestepping/DGTAssemble.hpp"
#include "assemble/IStochasticTransportAssemble.hpp"
#include "problem/StochasticTransportProblem.hpp"
#include "TimeSeries.h"
#include "utility/Logging.hpp"
#include "elements/DGFaceElement.h"
class DGTransportAssemble : public DGTAssemble {
public:
IStochasticTransportProblem *problem;
class DGTransportAssemble : public IStochasticTransportAssemble, TAssemble {
protected:
DGDiscretization *disc;
double flux_alpha = 1.0;
double diffusion = 0.0;
DGTransportAssemble(IDiscretization *disc, IStochasticTransportProblem *problem,
Plot *plot)
: DGTAssemble(dynamic_cast<DGDiscretizationT<> *>(disc),
plot), problem(problem) {
public:
DGTransportAssemble(IDiscretization *disc, IStochasticTransportProblem *problem) :
IStochasticTransportAssemble(problem),
disc(dynamic_cast<DGDiscretization *>(disc)) {
config.get("flux_alpha", flux_alpha);
config.get("diffusion", diffusion);
}
const char *Name() const override { return "DGTransportAssemble"; }
IDiscretization *GetDisc() override {
return disc;
};
void PrintInfo() const {
mout.PrintInfo("Assemble", 1,
PrintInfoEntry("Name", Name()),
// PrintInfoEntry("Problem", problem->Name()),
PrintInfoEntry("Discretization", disc->DiscName()));
}
void PrintInfo(const Vector &u) const override {
// std::pair<double, double> rate = InFlowOutFlowRate(u);
......@@ -37,12 +48,7 @@ public:
// mout << endl;
}
void PrintInfo() const {
mout.PrintInfo("Assemble", verbose,
PrintInfoEntry("Name", Name()),
// PrintInfoEntry("Problem", problem->Name()),
PrintInfoEntry("Discretization", disc->DiscName()));
}
const char *Name() const override;
double Residual(const Vector &u, Vector &b) const override;
......@@ -62,7 +68,7 @@ public:
std::pair<double, double> InFlowOutFlowRate(const Vector &u) const;
void SetInitialValue(Vector &u) const override {
void SetInitialValue(Vector &u) const {
u = 0;
Point z[MaxNodalPoints];
for (cell c = u.cells(); c != u.cells_end(); ++c) {
......@@ -76,7 +82,7 @@ public:
Accumulate(u);
}
void VtkPlotting(double t, const Vector &u) const override {
void VtkPlotting(double t, const Vector &u) const {
// const Mesh &Mp = plot->GetMesh();
// const Mesh &Mu = u.GetMesh();
// if (Mp.CellCount() != Mu.CellCount()) return;
......@@ -85,7 +91,7 @@ public:
// VtkPlotting_cell(t, u, filename);
}
void PrintMatrixInfo(Matrix &A, int diagonal) const override {
void PrintMatrixInfo(Matrix &A, int diagonal) const {
for (cell c = A.cells(); c != A.cells_end(); ++c) {
DGElement elem(*disc, A, c);
DGRowEntries A_c(A, c, c);
......
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