DGEllipticAssemble.hpp 2.29 KB
Newer Older
1 2 3 4
#ifndef _DGLAPLACE_H_
#define _DGLAPLACE_H_

#include "discretization/DGDiscretization.hpp"
niklas.baumgarten's avatar
niklas.baumgarten committed
5
#include "pdesolver/IStochasticEllipticAssemble.hpp"
6

7

niklas.baumgarten's avatar
niklas.baumgarten committed
8
class DGEllipticAssemble : public IStochasticEllipticAssemble {
niklas.baumgarten's avatar
niklas.baumgarten committed
9
protected:
10 11
    DGDiscretization *disc;

12
    double penalty = 20.0;
13 14
    int sign = 1;

niklas.baumgarten's avatar
niklas.baumgarten committed
15
public:
niklas.baumgarten's avatar
niklas.baumgarten committed
16
    DGEllipticAssemble(IDiscretization *disc, IStochasticEllipticProblem *problem)
niklas.baumgarten's avatar
niklas.baumgarten committed
17
        : IStochasticEllipticAssemble(problem),
18
          disc(dynamic_cast<DGDiscretization *> (disc)) {
19 20
        config.get("penalty", penalty);
        config.get("sign", sign);
21
        PrintInfo();
22 23
    }

24
    IDiscretization *GetDisc() const override {
niklas.baumgarten's avatar
niklas.baumgarten committed
25 26 27
        return disc;
    };

28 29 30
    void PrintInfo() const override {
        mout.PrintInfo("Assemble", verbose,
                       PrintInfoEntry("Assemble Name", Name()),
31 32
                       PrintInfoEntry("Discretization", GetDisc()->Name()),
                       PrintInfoEntry("Problem", GetProblem()->Name()),
33
                       PrintInfoEntry("penalty", penalty),
34
                       PrintInfoEntry("sign", sign));
35 36
    }

37
    const char *Name() const override;
38

39
    void Initialize(Vector &u) const override;
40

41
    double Energy(const Vector &u) const override;
42

43
    void Residual(const cell &c, const Vector &u, Vector &r) const override;
44

45
    void Jacobi(const cell &c, const Vector &u, Matrix &A) const override;
46

47
    virtual double EnergyError(const Vector &u) const override;
48

49
    virtual double L2(const Vector &u) const override;
50

51
    virtual double H1(const Vector &u) const override;
52

53
    virtual double L2Error(const Vector &u) const override;
54

55 56 57 58 59 60 61 62 63 64 65
    virtual double L2CellAverageError(const Vector &u) const override;

    virtual double MaxError(const Vector &u) const override;

    virtual double FluxError(const Vector &u) const override;

    virtual double FaceError(const Vector &u) const override;

    FluxPair InflowOutflow(const Vector &u) const override;

    FluxPair PrescribedInflowOutflow(const Vector &u) const override;
66

67 68 69 70 71 72 73 74 75
    FluxPair OutflowLeftRight(const Vector &u) const override;

    virtual double GoalFunctional(const Vector &u) const override;

    virtual void SetExactSolution(Vector &uEx) const override;

    virtual void SetFlux(const Vector &u, Vector &flux) override;

    void AssembleTransfer(TransferMatrix &TM) const override;
76 77 78
};

#endif