Commit 763d84e7 authored by niklas.baumgarten's avatar niklas.baumgarten

fixed multilevel plotter test and included it into yml

parent 3da42994
......@@ -50,6 +50,8 @@ program-test:
script:
- cd tests
- mpirun -n 4 TestMainProgram
- mpirun -n 4 TestMultilevelPlotter
downstream-test:
stage: test
......@@ -79,5 +81,6 @@ downstream-test:
script:
- cd tests
- mpirun -n 4 TestMainProgram
- mpirun -n 4 TestMultilevelPlotter
......@@ -5,25 +5,29 @@
class TestMultilevelPlotter : public ::Test {
protected:
shared_ptr<Meshes> meshes;
int pLevel;
void SetUp() override {
meshes = make_shared<Meshes>("UnitSquare", 1, 4);
plotter = make_shared<MultilevelPlotter>(*meshes);
pLevel = meshes->pLevel();
// Refactor
logging = new Logging;
logging->initialize();
// // Refactor
// logging = new Logging;
// logging->initialize();
}
void TearDown() override {
system("rm -rf data/vtk/*");
// Only master checks if files are there, thus only master deletes
if (PPM->master())
system("rm -rf data/vtk/*");
}
};
TEST_F(TestMultilevelPlotter, TestVertexData1D) {
MatrixGraphs vertexMG(*meshes, dof("vertex", 1));
for (int l = meshes->pLevel(); l <= meshes->Level(); l++) {
Vector vertexData(vertexMG[l]);
for (int l = pLevel; l <= meshes->Level(); l++) {
Vector vertexData(vertexMG[l - pLevel]);
vertexData = 1.0;
string name = "VertexData1D_" + to_string(l);
plotter->PlotVector(name, vertexData, 1, l, "VertexData");
......@@ -35,7 +39,7 @@ TEST_F(TestMultilevelPlotter, TestVertexData1D) {
TEST_F(TestMultilevelPlotter, TestVertexData2D) {
MatrixGraphs vertexMG(*meshes, dof("vertex", 2));
for (int l = meshes->pLevel(); l <= meshes->Level(); l++) {
Vector vertexData(vertexMG[l]);
Vector vertexData(vertexMG[l - pLevel]);
vertexData = 1.0;
string name = "VertexData2D_" + to_string(l);
plotter->PlotVector(name, vertexData, 2, l, "VertexData");
......@@ -47,7 +51,7 @@ TEST_F(TestMultilevelPlotter, TestVertexData2D) {
TEST_F(TestMultilevelPlotter, TestCellData1D) {
MatrixGraphs cellMG(*meshes, dof("cell", 1));
for (int l = meshes->pLevel(); l <= meshes->Level(); l++) {
Vector cellData(cellMG[l]);
Vector cellData(cellMG[l - pLevel]);
cellData = 1.0;
string name = "CellData1D_" + to_string(l);
plotter->PlotVector(name, cellData, 1, l, "CellData");
......@@ -59,7 +63,7 @@ TEST_F(TestMultilevelPlotter, TestCellData1D) {
TEST_F(TestMultilevelPlotter, TestCellData2D) {
MatrixGraphs cellMG(*meshes, dof("cell", 2));
for (int l = meshes->pLevel(); l <= meshes->Level(); l++) {
Vector cellData(cellMG[l]);
Vector cellData(cellMG[l - pLevel]);
cellData = 1.0;
string name = "CellData2D_" + to_string(l);
plotter->PlotVector(name, cellData, 2, l, "CellData");
......
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