@@ -58,8 +58,9 @@ namespace {
5858 FILE * m_file = nullptr ; /* file for m file output */
5959 mat_t * mat_file = nullptr ; /* file for binary .mat output */
6060 bool debug = false;
61+ bool do_info = true;
6162
62- const std ::array < std ::string , 3 > qainfo {"exo2mat ", "2025/02/03 " , "4.09 " };
63+ const std ::array < std ::string , 3 > qainfo {"exo2mat ", "2025/04/10 " , "4.10 " };
6364
6465 void logger (const char * message )
6566 {
@@ -76,6 +77,7 @@ namespace {
7677 " Options:\n"
7778 " -t write a text (.m) file rather than a binary .mat\n"
7879 " -o output file name (rather than auto generate)\n"
80+ " -i do *NOT* output the info records to mat file\n"
7981 " -c use cell arrays for transient variables.\n"
8082 " -v5 output version 5 mat file {}\n"
8183 " -v73 output version 7.3 mat file (hdf5-based) {}\n"
@@ -928,8 +930,6 @@ int main(int argc, char *argv[])
928930 int num_blocks ;
929931 int num_side_sets ;
930932 int num_node_sets ;
931- int num_time_steps ;
932- int num_info_lines ;
933933 int num_global_vars ;
934934 int num_nodal_vars ;
935935 int num_element_vars ;
@@ -963,6 +963,12 @@ int main(int argc, char *argv[])
963963 debug = true;
964964 continue ;
965965 }
966+ if (strcmp (argv [j ], "-i" ) == 0 ) { /* do not write info records */
967+ del_arg (& argc , argv , j );
968+ j -- ;
969+ do_info = false;
970+ continue ;
971+ }
966972 if (strcmp (argv [j ], "-c" ) == 0 ) { /* use cell arrays */
967973 del_arg (& argc , argv , j );
968974 j -- ;
@@ -1113,8 +1119,8 @@ int main(int argc, char *argv[])
11131119 std ::array < char , MAX_LINE_LENGTH + 1 > line ;
11141120 ex_get_init (exo_file , line .data (), & num_axes , & num_nodes , & num_elements , & num_blocks ,
11151121 & num_node_sets , & num_side_sets );
1116- num_info_lines = ex_inquire_int (exo_file , EX_INQ_INFO );
1117- num_time_steps = ex_inquire_int (exo_file , EX_INQ_TIME );
1122+ int num_info_lines = ex_inquire_int (exo_file , EX_INQ_INFO );
1123+ int num_time_steps = ex_inquire_int (exo_file , EX_INQ_TIME );
11181124 ex_get_variable_param (exo_file , EX_GLOBAL , & num_global_vars );
11191125 ex_get_variable_param (exo_file , EX_NODAL , & num_nodal_vars );
11201126 ex_get_variable_param (exo_file , EX_ELEM_BLOCK , & num_element_vars );
@@ -1136,7 +1142,7 @@ int main(int argc, char *argv[])
11361142 PutInt ("nssvars" , num_sideset_vars );
11371143
11381144 /* allocate -char- scratch space*/
1139- int nstr2 = num_info_lines ;
1145+ int nstr2 = do_info ? num_info_lines : 0 ;
11401146 nstr2 = std ::max (nstr2 , num_blocks );
11411147 nstr2 = std ::max (nstr2 , num_node_sets );
11421148 nstr2 = std ::max (nstr2 , num_side_sets );
@@ -1146,7 +1152,7 @@ int main(int argc, char *argv[])
11461152 PutStr ("Title" , line .data ());
11471153
11481154 /* information records */
1149- if (num_info_lines > 0 ) {
1155+ if (do_info && num_info_lines > 0 ) {
11501156 ex_get_info (exo_file , str2 );
11511157 std ::string ostr ;
11521158 for (int i = 0 ; i < num_info_lines ; i ++ ) {
0 commit comments