TestPDESolver.cpp 1.67 KB
Newer Older
niklas.baumgarten's avatar
niklas.baumgarten committed
1
2
3
4
#include "assemble/LagrangeEllipticAssemble.hpp"
#include "assemble/MixedEllipticAssemble.hpp"
#include "assemble/HybridEllipticAssemble.hpp"
#include "assemble/DGEllipticAssemble.hpp"
niklas.baumgarten's avatar
niklas.baumgarten committed
5
6
7
8
#include "assemble/DGTransportAssemble.hpp"
#include "assemble/DGReactionAssemble.hpp"
#include "assemble/PGReactionAssemble.hpp"
#include "montecarlo/PDESolver.hpp"
niklas.baumgarten's avatar
niklas.baumgarten committed
9
10
11
12
13
14
15
#include "TestEnvironment.hpp"


class TestPDESolver : public Test {
protected:
    PDESolver *pdeSolver;

niklas.baumgarten's avatar
niklas.baumgarten committed
16
17
18
19
20
21
22
23
24
25
26
    Meshes *meshes;

    MatrixGraphs *mGraphs;

    SampleID dummyID;

    TestPDESolver() {
        meshes = createTestMeshes("Square_DirichletBC", 0, 0);
        dummyID.level = Level(1 ,0);
        dummyID.coarse = false;
        dummyID.number = -1;
niklas.baumgarten's avatar
niklas.baumgarten committed
27
28
29
    }

    void TearDown() override {
niklas.baumgarten's avatar
niklas.baumgarten committed
30
31
        delete pdeSolver;
        delete meshes;
niklas.baumgarten's avatar
niklas.baumgarten committed
32
33
34
35
36
    }
};

class TestEllipticPDESolver : public TestPDESolver {
protected:
niklas.baumgarten's avatar
niklas.baumgarten committed
37
38
39
40
41
42
43
44
45
    TestEllipticPDESolver() : TestPDESolver() {
        pdeSolver = new EllipticPDESolver(
            new LagrangeEllipticAssemble(
                new LagrangeDiscretization(*meshes, 1),
                CreateStochasticEllipticProblem("StochasticLaplace2D", *meshes)
            )
        );

        mGraphs = pdeSolver->CreateSolutionMatrixGraph(*meshes);
niklas.baumgarten's avatar
niklas.baumgarten committed
46
47
48
49
50
51
52
53
54
55
56
57
58
59
    }
};

class TestTransportPDESolver : public TestPDESolver {
    void SetUp() override {
        // Todo
    }

    void TearDown() override {
        // Todo
    }
};

TEST_F(TestEllipticPDESolver, TestLagrangeDiscretization) {
niklas.baumgarten's avatar
niklas.baumgarten committed
60
61
    SampleSolution solution(*mGraphs, dummyID.level.mGfine);
    pdeSolver->Run(solution);
niklas.baumgarten's avatar
niklas.baumgarten committed
62
63
64
}

int main(int argc, char **argv) {
niklas.baumgarten's avatar
niklas.baumgarten committed
65
    MppTest mppTest = MppTestBuilder(argc, argv).WithPPM().WithScreenLogging();
niklas.baumgarten's avatar
niklas.baumgarten committed
66
67
    return mppTest.RUN_ALL_MPP_TESTS();
}