Commit 6e00674f authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

using shared pointers

parent 8c1946b2
......@@ -8,14 +8,15 @@
class DGEllipticAssemble : public EllipticAssemble, public DGUtils {
public:
DGDiscretization *disc;
shared_ptr<DGDiscretization> disc;
double penalty = 1.0;
int sign = 1;
DGEllipticAssemble(Discretization *disc, StochasticEllipticProblem *problem)
: EllipticAssemble(disc, problem) {
this->disc = dynamic_cast<DGDiscretization *>(disc);
DGEllipticAssemble(shared_ptr<Discretization> disc,
shared_ptr<StochasticEllipticProblem> problem)
: EllipticAssemble(move(disc), move(problem)) {
this->disc = dynamic_pointer_cast<DGDiscretization>(disc);
config.get("penalty", penalty);
config.get("sign", sign);
}
......
......@@ -3,19 +3,21 @@
#include "m++.h"
#include "problem/StochasticEllipticProblem.hpp"
#include <memory>
class EllipticAssemble : public Assemble {
public:
Discretization *disc;
StochasticEllipticProblem *problem;
std::shared_ptr<Discretization> disc;
std::shared_ptr<StochasticEllipticProblem> problem;
EllipticAssemble(std::shared_ptr<Discretization> disc,
std::shared_ptr<StochasticEllipticProblem> problem) :
disc(move(disc)), problem(move(problem)) {}
string sampleDir = "";
Plot *plot;
EllipticAssemble(Discretization *disc, StochasticEllipticProblem *problem)
: disc(disc), problem(problem) {}
virtual ~EllipticAssemble() = default;
virtual Element *getElement(const cell &c, const Vector &u) const;
......
......@@ -6,8 +6,9 @@
class HybridEllipticAssemble : public MixedEllipticAssemble {
public:
HybridEllipticAssemble(Discretization *disc, StochasticEllipticProblem *problem)
: MixedEllipticAssemble(disc, problem) {}
HybridEllipticAssemble(shared_ptr<Discretization> disc,
shared_ptr<StochasticEllipticProblem> problem)
: MixedEllipticAssemble(move(disc), move(problem)) {}
Scalar getValue(const cell &c, const Vector &u, Element *elem, int q) const override;
......
......@@ -6,8 +6,9 @@
class MixedEllipticAssemble : public EllipticAssemble {
public:
MixedEllipticAssemble(Discretization *disc, StochasticEllipticProblem *problem)
: EllipticAssemble(disc, problem) {}
MixedEllipticAssemble(shared_ptr<Discretization> disc,
shared_ptr<StochasticEllipticProblem> problem)
: EllipticAssemble(move(disc), move(problem)) {}
Element *getElement(const cell &c, const Vector &u) const override;
......
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