Commit 1180a8e9 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

tested plotmap

parent aa312d01
#include "montecarlo/PDESolver.hpp"
#include "TestEnvironment.hpp"
#include <filesystem>
constexpr double PDESOLVER_TEST_TOLERANCE = 1e-5;
struct TestParams {
std::string model;
std::string problem;
std::string quantity;
double Q;
};
class TestPlotMap : public Test {
protected:
......@@ -17,26 +10,41 @@ protected:
MatrixGraphs *mGraphs;
SampleID dummyID;
void SetUp(const std::string &meshName) {
meshes = createTestMeshes(meshName, dummyID.level.pLevel,
dummyID.level.fine);
// Plot testen mit SampleSolution
std::vector<SampleID> dummyIDs;
PlotMap plotMap;
TestPlotMap(const std::string &meshName) {
dummyIDs = {
SampleID(Level(0, 0), false, -1),
SampleID(Level(1, 0), false, -1),
SampleID(Level(2, 0), false, -1),
SampleID(Level(3, 0), false, -1),
SampleID(Level(4, 0), false, -1),
SampleID(Level(5, 0), false, -1),
SampleID(Level(6, 0), false, -1)
};
meshes = createTestMeshes(meshName, dummyIDs.back().level.pLevel,
dummyIDs.back().level.fine);
mGraphs = new MatrixGraphs(*meshes, *(new LagrangeDiscretization(*meshes, 1)));
}
void TearDown() override {
}
void TearDown() override {}
};
class TestPlotMap2D : public TestPlotMap {
public:
TestPlotMap2D() : TestPlotMap("Square_DirichletBC") {}
};
TEST_F(TestPlotMap, TestPlot) {
PlotMap _plotMap = {
{Level(3), new Plot((*meshes)[3])}
};
SampleSolution solution(mGraphs, dummyID);
solution.U = 0.0;
_plotMap.VtkPlot(solution, 1, "VertexData");
TEST_F(TestPlotMap2D, TestPlotMap) {
for (auto &dummyID: dummyIDs) {
SampleSolution solution(mGraphs, dummyIDs.back());
solution.U = 0.0;
plotMap.VtkPlot(solution, 1, "VertexData");
ASSERT_TRUE(std::filesystem::exists(plotMap.currentFile));
std::filesystem::remove_all(plotMap.currentDir);
}
}
int main(int argc, char **argv) {
......
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