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

refactored assemble classes (constructor class printinfo now)

parent 2035858a
......@@ -5,6 +5,7 @@
#include "elements/Elements.hpp"
#include "IStochasticEllipticAssemble.hpp"
class DGEllipticAssemble : public IStochasticEllipticAssemble {
protected:
DGDiscretization *disc;
......@@ -15,21 +16,23 @@ protected:
public:
DGEllipticAssemble(IDiscretization *disc, IStochasticEllipticProblem *problem)
: IStochasticEllipticAssemble(problem),
disc(dynamic_cast<DGDiscretization *> (disc)) {
disc(dynamic_cast<DGDiscretization *> (disc)) {
config.get("penalty", penalty);
config.get("sign", sign);
PrintInfo();
}
IDiscretization *GetDisc() override {
IDiscretization *GetDisc() const override {
return disc;
};
void PrintInfo() const override {
mout.PrintInfo("Assemble", verbose,
PrintInfoEntry("Assemble Name", Name()),
PrintInfoEntry("Discretization", GetDisc()->Name()),
PrintInfoEntry("Problem", GetProblem()->Name()),
PrintInfoEntry("penalty", penalty),
PrintInfoEntry("sign", sign),
PrintInfoEntry("Problem", problem->Name()));
PrintInfoEntry("sign", sign));
}
const char *Name() const override;
......@@ -71,7 +74,6 @@ public:
virtual void SetFlux(const Vector &u, Vector &flux) override;
void AssembleTransfer(TransferMatrix &TM) const override;
};
#endif
......@@ -8,9 +8,11 @@
class HybridEllipticAssemble : public MixedEllipticAssemble {
public:
HybridEllipticAssemble(IDiscretization *disc, IStochasticEllipticProblem *problem)
: MixedEllipticAssemble(disc, problem) {}
: MixedEllipticAssemble(disc, problem) {
PrintInfo();
}
virtual IDiscretization *GetDisc() override {
virtual IDiscretization *GetDisc() const override {
return disc;
}
......
......@@ -10,26 +10,28 @@ typedef std::pair<double, double> FluxPair;
class IStochasticEllipticAssemble : public IAssemble {
protected:
InfoEntries entries;
IStochasticEllipticProblem *problem;
public:
explicit IStochasticEllipticAssemble(IStochasticEllipticProblem *problem) :
problem(problem) {
InfoEntries problemEntries = problem->GetInfoEntries();
// entries.insert(entries.end(), problemEntries.begin(), problemEntries.end());
};
problem(problem) {};
void DrawSample(const SampleID &id) {
problem->DrawSample(id);
}
IStochasticProblem *GetProblem() {
IStochasticProblem *GetProblem() const {
return problem;
};
virtual IDiscretization *GetDisc() = 0;
virtual IDiscretization *GetDisc() const = 0;
virtual void PrintInfo() const override {
mout.PrintInfo("Assemble", verbose,
PrintInfoEntry("Assemble Name", Name()),
PrintInfoEntry("Discretization", GetDisc()->Name()),
PrintInfoEntry("Problem", GetProblem()->Name()));
}
virtual ~IStochasticEllipticAssemble() = default;;
......@@ -110,14 +112,6 @@ public:
PrintInfoEntry("Right Outflow", outflowLeftRight.second));
}
}
InfoEntries GetInfoEntries() const {
return entries;
}
void PrintInfo() const override {
mout.PrintInfo("Assemble", verbose, GetInfoEntries());
}
};
#endif //ISTOCHASTICELLIPTICASSEMBLE_HPP
......@@ -12,9 +12,11 @@ protected:
public:
LagrangeEllipticAssemble(IDiscretization *disc, IStochasticEllipticProblem *problem)
: IStochasticEllipticAssemble(problem), disc(disc) {}
: IStochasticEllipticAssemble(problem), disc(disc) {
PrintInfo();
}
IDiscretization *GetDisc() override {
IDiscretization *GetDisc() const override {
return disc;
};
......
......@@ -13,9 +13,11 @@ protected:
public:
MixedEllipticAssemble(IDiscretization *disc, IStochasticEllipticProblem *problem) :
IStochasticEllipticAssemble(problem), disc(disc) {};
IStochasticEllipticAssemble(problem), disc(disc) {
PrintInfo();
};
IDiscretization *GetDisc() override {
IDiscretization *GetDisc() const override {
return disc;
};
......
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