Loading Unstructured_mesh/Unstructured_mesh.pro +1 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ CONFIG -= qt INCLUDEPATH += $$PWD/../src/ SOURCES += \ ../src/UnitTests/UnstructuredMesh/UnstructuredMeshTest.cpp \ main.cpp \ HEADERS += \ Loading Loading @@ -61,7 +62,6 @@ DISTFILES += \ ../src/UnitTests/Traits/ArithmeticTraitsTest.cpp \ ../src/UnitTests/Traits/TraitsTest.cpp \ ../src/UnitTests/UnstructuredMesh/MeshDataContainerTest.cpp \ ../src/UnitTests/UnstructuredMesh/UnstructuredMeshTest.cpp \ ../README.md \ ../src/GTMesh/Debug/README.md \ ../src/GTMesh/Traits/TraitsAlgorithm/README.md \ Loading Unstructured_mesh/main.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -1055,7 +1055,7 @@ void testFPMA_poly(){ } /* int main() { //meshSize(); Loading @@ -1071,5 +1071,5 @@ int main() //testFPMA_poly(); } }*/ src/GTMesh/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataReader.h +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ class VTKMeshDataReader { >::type { ist.seekg(dataPositions[DefaultIOTraits<T>::traitsType::template getName<Index>()]); ist.seekg(dataPositions[DefaultIOTraits<T>::getTraits().template getName<Index>()]); typename DefaultIOTraits<T>::traitsType::template type<Index> value; typename DefaultIOTraits<T>::traitsType::template type<Index> dummy; Loading src/GTMesh/UnstructuredMesh/UnstructuredMeshDefine.h +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ bool isBoundaryIndex(const IndexType& index){ template <typename IndexType> IndexType makeBoundaryIndex(const IndexType& index){ return (EXTRACTING_INDEX(IndexType) | index); return (BOUNDARY_INDEX(IndexType) | index); } Loading src/UnitTests/UnstructuredMesh/UnstructuredMeshTest.cpp +17 −8 Original line number Diff line number Diff line Loading @@ -3,10 +3,10 @@ #include <gtest/gtest.h> #else #define TEST(_1,_2) void _1() #define EXPECT_TRUE(_1) (void)(_1) #define EXPECT_FALSE(_1) (void)(_1) #define EXPECT_EQ(_1,_2) (void)(_1 == _2) #define EXPECT_ANY_THROW(_1) try{(_1);}catch(...){} #define EXPECT_TRUE(_1) DBGCHECK;(void)(_1) #define EXPECT_FALSE(_1) DBGCHECK;(void)(_1) #define EXPECT_EQ(_1,_2) DBGCHECK;(void)(_1 == _2) #define EXPECT_ANY_THROW(_1) DBGCHECK;try{(_1);}catch(...){} #endif #include "GTMesh/Debug/Debug.h" #include <list> Loading Loading @@ -65,13 +65,14 @@ TEST( UnstructuredMesh2D_Functions_Test, basicTest ) mesh.setupBoundaryCells(); mesh.setupBoundaryCellsCenters(); face = mesh.getFaces()[0]; EXPECT_TRUE(floatArrayCompare( face.getCenter(), (Vector<2, double>{0, 0.5}))); EXPECT_TRUE(isBoundaryIndex(face.getCellRightIndex())); EXPECT_EQ(extractBoundaryIndex(face.getCellRightIndex()), 0); EXPECT_TRUE(face.getCellLeftIndex() == 0); EXPECT_EQ(face.getOtherCellIndex(makeBoundaryIndex(0)), 0); EXPECT_EQ(face.getOtherCellIndex(0), makeBoundaryIndex(0)); EXPECT_EQ(face.getOtherCellIndex(makeBoundaryIndex<size_t>(0)), 0); EXPECT_EQ(face.getOtherCellIndex(0), makeBoundaryIndex<size_t>(0)); EXPECT_EQ(face.getNextBElem(face.getCellLeftIndex()), 1); EXPECT_EQ(face.getNextBElem(face.getCellRightIndex()), INVALID_INDEX(size_t)); Loading Loading @@ -213,7 +214,7 @@ TEST( UnstructuredMesh3D_Functions_Test, 3DMeshTest ) EXPECT_EQ(extractBoundaryIndex(face.getCellRightIndex()), 0); EXPECT_TRUE(face.getCellLeftIndex() == 0); EXPECT_EQ(face.getOtherCellIndex(makeBoundaryIndex(0)), 0); EXPECT_EQ(face.getOtherCellIndex(makeBoundaryIndex<size_t>(0)), 0); EXPECT_EQ(face.getOtherCellIndex(0), makeBoundaryIndex(0)); EXPECT_EQ(face.getNextBElem(face.getCellLeftIndex()), 1); Loading Loading @@ -377,5 +378,13 @@ TEST( MeshRefineTest, 3DMeshTest ) { //#endif #ifndef HAVE_GTEST int main(){ UnstructuredMesh2D_Functions_Test(); UnstructuredMesh2DReadWrite(); MeshRefineTest(); UnstructuredMesh3D_Functions_Test(); } #else #include "UnitTests/main.h" #endif Loading
Unstructured_mesh/Unstructured_mesh.pro +1 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ CONFIG -= qt INCLUDEPATH += $$PWD/../src/ SOURCES += \ ../src/UnitTests/UnstructuredMesh/UnstructuredMeshTest.cpp \ main.cpp \ HEADERS += \ Loading Loading @@ -61,7 +62,6 @@ DISTFILES += \ ../src/UnitTests/Traits/ArithmeticTraitsTest.cpp \ ../src/UnitTests/Traits/TraitsTest.cpp \ ../src/UnitTests/UnstructuredMesh/MeshDataContainerTest.cpp \ ../src/UnitTests/UnstructuredMesh/UnstructuredMeshTest.cpp \ ../README.md \ ../src/GTMesh/Debug/README.md \ ../src/GTMesh/Traits/TraitsAlgorithm/README.md \ Loading
Unstructured_mesh/main.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -1055,7 +1055,7 @@ void testFPMA_poly(){ } /* int main() { //meshSize(); Loading @@ -1071,5 +1071,5 @@ int main() //testFPMA_poly(); } }*/
src/GTMesh/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataReader.h +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ class VTKMeshDataReader { >::type { ist.seekg(dataPositions[DefaultIOTraits<T>::traitsType::template getName<Index>()]); ist.seekg(dataPositions[DefaultIOTraits<T>::getTraits().template getName<Index>()]); typename DefaultIOTraits<T>::traitsType::template type<Index> value; typename DefaultIOTraits<T>::traitsType::template type<Index> dummy; Loading
src/GTMesh/UnstructuredMesh/UnstructuredMeshDefine.h +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ bool isBoundaryIndex(const IndexType& index){ template <typename IndexType> IndexType makeBoundaryIndex(const IndexType& index){ return (EXTRACTING_INDEX(IndexType) | index); return (BOUNDARY_INDEX(IndexType) | index); } Loading
src/UnitTests/UnstructuredMesh/UnstructuredMeshTest.cpp +17 −8 Original line number Diff line number Diff line Loading @@ -3,10 +3,10 @@ #include <gtest/gtest.h> #else #define TEST(_1,_2) void _1() #define EXPECT_TRUE(_1) (void)(_1) #define EXPECT_FALSE(_1) (void)(_1) #define EXPECT_EQ(_1,_2) (void)(_1 == _2) #define EXPECT_ANY_THROW(_1) try{(_1);}catch(...){} #define EXPECT_TRUE(_1) DBGCHECK;(void)(_1) #define EXPECT_FALSE(_1) DBGCHECK;(void)(_1) #define EXPECT_EQ(_1,_2) DBGCHECK;(void)(_1 == _2) #define EXPECT_ANY_THROW(_1) DBGCHECK;try{(_1);}catch(...){} #endif #include "GTMesh/Debug/Debug.h" #include <list> Loading Loading @@ -65,13 +65,14 @@ TEST( UnstructuredMesh2D_Functions_Test, basicTest ) mesh.setupBoundaryCells(); mesh.setupBoundaryCellsCenters(); face = mesh.getFaces()[0]; EXPECT_TRUE(floatArrayCompare( face.getCenter(), (Vector<2, double>{0, 0.5}))); EXPECT_TRUE(isBoundaryIndex(face.getCellRightIndex())); EXPECT_EQ(extractBoundaryIndex(face.getCellRightIndex()), 0); EXPECT_TRUE(face.getCellLeftIndex() == 0); EXPECT_EQ(face.getOtherCellIndex(makeBoundaryIndex(0)), 0); EXPECT_EQ(face.getOtherCellIndex(0), makeBoundaryIndex(0)); EXPECT_EQ(face.getOtherCellIndex(makeBoundaryIndex<size_t>(0)), 0); EXPECT_EQ(face.getOtherCellIndex(0), makeBoundaryIndex<size_t>(0)); EXPECT_EQ(face.getNextBElem(face.getCellLeftIndex()), 1); EXPECT_EQ(face.getNextBElem(face.getCellRightIndex()), INVALID_INDEX(size_t)); Loading Loading @@ -213,7 +214,7 @@ TEST( UnstructuredMesh3D_Functions_Test, 3DMeshTest ) EXPECT_EQ(extractBoundaryIndex(face.getCellRightIndex()), 0); EXPECT_TRUE(face.getCellLeftIndex() == 0); EXPECT_EQ(face.getOtherCellIndex(makeBoundaryIndex(0)), 0); EXPECT_EQ(face.getOtherCellIndex(makeBoundaryIndex<size_t>(0)), 0); EXPECT_EQ(face.getOtherCellIndex(0), makeBoundaryIndex(0)); EXPECT_EQ(face.getNextBElem(face.getCellLeftIndex()), 1); Loading Loading @@ -377,5 +378,13 @@ TEST( MeshRefineTest, 3DMeshTest ) { //#endif #ifndef HAVE_GTEST int main(){ UnstructuredMesh2D_Functions_Test(); UnstructuredMesh2DReadWrite(); MeshRefineTest(); UnstructuredMesh3D_Functions_Test(); } #else #include "UnitTests/main.h" #endif