|
13 | 13 | #include <libmesh/exodusII_io.h> |
14 | 14 | #include <libmesh/nemesis_io.h> |
15 | 15 | #include <libmesh/vtk_io.h> |
| 16 | +#include <libmesh/tetgen_io.h> |
16 | 17 |
|
17 | 18 | #include "test_comm.h" |
18 | 19 | #include "libmesh_cppunit.h" |
@@ -101,6 +102,10 @@ public: |
101 | 102 | #endif // LIBMESH_HAVE_GZSTREAM |
102 | 103 | #endif // LIBMESH_DIM > 1 |
103 | 104 |
|
| 105 | +#ifdef LIBMESH_HAVE_TETGEN |
| 106 | + CPPUNIT_TEST( testTetgenIO ); |
| 107 | +#endif |
| 108 | + |
104 | 109 | CPPUNIT_TEST_SUITE_END(); |
105 | 110 |
|
106 | 111 | private: |
@@ -823,6 +828,30 @@ public: |
823 | 828 | helperTestingDynaQuad(mesh); |
824 | 829 | } |
825 | 830 |
|
| 831 | + void testTetgenIO () |
| 832 | + { |
| 833 | +#ifdef LIBMESH_HAVE_TETGEN |
| 834 | + LOG_UNIT_TEST; |
| 835 | + |
| 836 | + Mesh mesh(*TestCommWorld); |
| 837 | + |
| 838 | + TetGenIO tetgen_io(mesh); |
| 839 | + |
| 840 | + if (mesh.processor_id() == 0) |
| 841 | + tetgen_io.read("meshes/tetgen_one_tet10.ele"); |
| 842 | + MeshCommunication().broadcast(mesh); |
| 843 | + |
| 844 | + mesh.prepare_for_use(); |
| 845 | + |
| 846 | + // Mesh should contain 1 TET10 finite element |
| 847 | + CPPUNIT_ASSERT_EQUAL(mesh.n_elem(), dof_id_type(1)); |
| 848 | + CPPUNIT_ASSERT_EQUAL(mesh.n_nodes(), dof_id_type(10)); |
| 849 | + |
| 850 | + // Element should have TET10 reference element volume |
| 851 | + Real vol = mesh.elem_ptr(0)->volume(); |
| 852 | + CPPUNIT_ASSERT_DOUBLES_EQUAL(vol, 1./6, TOLERANCE*TOLERANCE); |
| 853 | +#endif |
| 854 | + } |
826 | 855 |
|
827 | 856 | void testDynaNoSplines () |
828 | 857 | { |
|
0 commit comments