-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test Modules for Reading and Writing (#29)
* Add vector support for preCICE interface * Remove old test files * Add test executables and tests to CMake * Collect VTK includes and Remove Duplicates * Bug Fixes * Add vector support for preCICE interface * Remove old test files * Add test executables and tests to CMake * Collect VTK includes and Remove Duplicates * Bug Fixes * Add mistakenly removed assertions * Change CMake file for Boost Test * Convert Read Test to A Boost Unit Test * Add static_cast to PointId's * Remove md5sum data * Change CMake to single test file * Change read/write test to void functions * Add test to a main test file * Ignore vscode directory * Change from size_t arrays to int array to keep it consistent with preCICE interface * Add new functionality to safely cast from vtkIDtype to preCICE * Add VID to mesh * Correct write test cases * Adapt VID instead of int type arrays * Add init and final time and corrrect timesteps
- Loading branch information
1 parent
dd89d74
commit 35c0412
Showing
16 changed files
with
360 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,4 @@ testMesh.txt | |
*.synctex.gz | ||
compile_commands.json | ||
build/ | ||
.vscode/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "testing.hpp" | ||
|
||
void readtest(const Case ¤t_case) | ||
{ | ||
|
||
auto read_test = aste::BaseName{current_case.fname}.with(aste::ExecutionContext()); | ||
auto mesh = read_test.load(current_case.dim, current_case.dataname); | ||
|
||
BOOST_TEST(mesh.positions.size() == 12); | ||
BOOST_TEST(mesh.edges.size() == 2); | ||
BOOST_TEST(mesh.quadrilaterals.size() == 2); | ||
BOOST_TEST(mesh.triangles.size() == 4); | ||
//std::cout << "Number of mesh elements are correctly loaded\n"; | ||
|
||
BOOST_TEST(mesh.edges[1][0] == 10); | ||
BOOST_TEST(mesh.edges[1][1] == 11); | ||
//std::cout << "Edges loaded correctly\n"; | ||
BOOST_TEST(mesh.triangles[0][0] == 0); | ||
BOOST_TEST(mesh.triangles[0][1] == 1); | ||
BOOST_TEST(mesh.triangles[0][2] == 3); | ||
//std::cout << "Triangles loaded correctly\n"; | ||
BOOST_TEST(mesh.quadrilaterals[1][0] == 4); | ||
BOOST_TEST(mesh.quadrilaterals[1][1] == 5); | ||
BOOST_TEST(mesh.quadrilaterals[1][2] == 8); | ||
BOOST_TEST(mesh.quadrilaterals[1][3] == 7); | ||
//std::cout << "Quads loaded correctly\n"; | ||
|
||
switch (current_case.dim) { | ||
case 1: | ||
BOOST_TEST(mesh.data.size() == 12); | ||
break; | ||
case 2: | ||
BOOST_TEST(mesh.data.size() == 24); | ||
break; | ||
case 3: | ||
BOOST_TEST(mesh.data.size() == 36); | ||
break; | ||
} | ||
|
||
std::vector<double> testdata; | ||
testdata.resize(mesh.data.size()); | ||
|
||
std::iota(testdata.begin(), testdata.end(), 0); | ||
|
||
for (size_t i = 0; i < mesh.data.size(); ++i) { | ||
BOOST_TEST(mesh.data[i] == testdata[i]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# vtk DataFile Version 4.1 | ||
vtk output | ||
ASCII | ||
DATASET UNSTRUCTURED_GRID | ||
POINTS 12 float | ||
0 0 0 1 0 0 2 0 0 | ||
0 1 0 1 1 0 2 1 0 | ||
0 2 0 1 2 0 2 2 0 | ||
4 0 0 5 0 0 6 0 0 | ||
|
||
CELLS 8 32 | ||
4 3 4 7 6 | ||
4 4 5 8 7 | ||
3 0 1 3 | ||
3 1 4 3 | ||
3 1 2 4 | ||
3 2 4 5 | ||
2 9 10 | ||
2 10 11 | ||
|
||
CELL_TYPES 8 | ||
9 | ||
9 | ||
5 | ||
5 | ||
5 | ||
5 | ||
3 | ||
3 | ||
|
||
POINT_DATA 12 | ||
FIELD FieldData 1 | ||
Scalars 1 12 double | ||
0 1 2 3 4 5 6 7 8 | ||
9 10 11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# vtk DataFile Version 4.1 | ||
vtk output | ||
ASCII | ||
DATASET UNSTRUCTURED_GRID | ||
POINTS 12 float | ||
0 0 0 1 0 0 2 0 0 | ||
0 1 0 1 1 0 2 1 0 | ||
0 2 0 1 2 0 2 2 0 | ||
4 0 0 5 0 0 6 0 0 | ||
|
||
CELLS 8 32 | ||
4 3 4 7 6 | ||
4 4 5 8 7 | ||
3 0 1 3 | ||
3 1 4 3 | ||
3 1 2 4 | ||
3 2 4 5 | ||
2 9 10 | ||
2 10 11 | ||
|
||
CELL_TYPES 8 | ||
9 | ||
9 | ||
5 | ||
5 | ||
5 | ||
5 | ||
3 | ||
3 | ||
|
||
POINT_DATA 12 | ||
FIELD FieldData 1 | ||
Vector2D 2 12 double | ||
0 1 2 3 4 5 6 7 8 | ||
9 10 11 12 13 14 15 16 17 | ||
18 19 20 21 22 23 |
Oops, something went wrong.