HybridEllipticAssemble.hpp 2.64 KB
Newer Older
1
2
3
#ifndef _HYBRID_H_
#define _HYBRID_H_

4
#include "Small.h"
5
6
7
8
9
#include "MixedEllipticAssemble.hpp"


class HybridEllipticAssemble : public MixedEllipticAssemble {
public:
10
    HybridEllipticAssemble(IDiscretization *disc, IStochasticEllipticProblem *problem)
11
        : MixedEllipticAssemble(disc, problem) {}
12

niklas.baumgarten's avatar
niklas.baumgarten committed
13
14
15
16
17
18
19
20
    virtual void DrawSample(SampleID id) override {
        problem->DrawSample(id);
    };

    virtual IDiscretization *GetDiscretization() override {
        return disc;
    }

21
    const char *Name() const override;
22
23
24

    void Initialize(Vector &u) const override;

25
26
    double Energy(const Vector &u) const override;

27
28
    void Residual(const cell &c, const Vector &u, Vector &r) const override;

29
    void Jacobi(const cell &c, const Vector &u, Matrix &A) const override;
30

31
    virtual double EnergyError(const Vector &u) const override;
32

33
    virtual double L2(const Vector &u) const override;
34

35
    virtual double H1(const Vector &u) const override;
36

37
    virtual double L2Error(const Vector &u) const override;
38

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
    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;

    FluxPair OutflowLeftRight(const Vector &u) const override;

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

    virtual void SetExactSolution(Vector &uEx) const override;
56

57
58
59
60
61
62
    virtual void SetFlux(const Vector &u, Vector &flux) override;

    void AssembleTransfer(TransferMatrix &TM) const override;

    void LocalProblem(const cell &c, const Vector &u,
                      SmallMatrix &A,
63
64
                      SmallVector &B, SmallVector &R) const;

65
66
    void SetNormalFlux(const Vector &u, Vector &flux);

67
68
    VectorField EvaluateCellFlux(const Vector &flux, const cell &c) const;

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
    double EvaluateNormalFlux(const Vector &flux, const cell &c, int i) const;

    VectorField EvaluateNormal(const Vector &flux, const cell &c, int i) const;

    Scalar Value(const cell &c, const Vector &u,
                 RT0_LagrangeElementT<> &elem) const;

    Scalar FaceValue(const cell &c, const Vector &u,
                     RT0_LagrangeFaceElementT<> &faceElem) const;

    VectorField Flux(const cell &c, const Vector &u,
                     RT0_LagrangeElementT<> &elem, int q) const;

    VectorField FaceFlux(const cell &c, const Vector &u,
                         RT0_LagrangeFaceElementT<> &faceElem,
                         int q, int face) const;
85
86
87
};

#endif