#include "trexio.h" #include #include #include #include int test_read(); int test_write(); int test_h5read(); int test_h5write(); int main() { /*============== Main test launcher ================*/ test_h5write(); test_h5read(); test_write(); test_read(); printf("Test error message: %s\n", trexio_string_of_error(TREXIO_INVALID_ARG_2)); return 0 ; } int test_h5write() { /*======== Test write using HDF5 backend ===========*/ const char* file_name = "test_write.h5"; trexio_t* file = NULL; trexio_exit_code rc; // parameters to be written int num = 12; double charge[12] = {6., 6., 6., 6., 6., 6., 1., 1., 1., 1., 1., 1.}; double coord[36] = { 0.00000000 , 1.39250319 , 0.00000000 , -1.20594314 , 0.69625160 , 0.00000000 , -1.20594314 , -0.69625160 , 0.00000000 , 0.00000000 , -1.39250319 , 0.00000000 , 1.20594314 , -0.69625160 , 0.00000000 , 1.20594314 , 0.69625160 , 0.00000000 , -2.14171677 , 1.23652075 , 0.00000000 , -2.14171677 , -1.23652075 , 0.00000000 , 0.00000000 , -2.47304151 , 0.00000000 , 2.14171677 , -1.23652075 , 0.00000000 , 2.14171677 , 1.23652075 , 0.00000000 , 0.00000000 , 2.47304151 , 0.00000000 , }; const char* label[] = {"C" , "Na", "C" , "C" , "C" , "C" , "H" , "Ru", "H" , "H" , "H" , "H" }; //char labelxxx[] = "C C C Na C C H H H Ru H H"; char labelxxx[128] = ""; for (int i=0; i