[cig-commits] r13843 - cs/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Mon Jan 12 14:10:13 PST 2009


Author: luis
Date: 2009-01-12 14:10:13 -0800 (Mon, 12 Jan 2009)
New Revision: 13843

Modified:
   cs/cigma/trunk/src/cli_list_cmd.cpp
   cs/cigma/trunk/src/core_list_op.cpp
Log:
For 'cigma list' op, call system("ncdump -h filename.exo") on ExodusII files

Eventually, we should format the information ourselves by calling
the exo_print_contents() function instead.

Modified: cs/cigma/trunk/src/cli_list_cmd.cpp
===================================================================
--- cs/cigma/trunk/src/cli_list_cmd.cpp	2009-01-12 22:10:11 UTC (rev 13842)
+++ cs/cigma/trunk/src/cli_list_cmd.cpp	2009-01-12 22:10:13 UTC (rev 13843)
@@ -25,8 +25,9 @@
         "Supported file extensions:\n"
         "   .h5                 - Cigma HDF5 file\n"
         "   .vtk                - Legacy VTK file\n"
-        "   .vtu, .vts, .vtr    - XML VTK file\n"
-        "   .pvtu, .pvts, .pvtr - XML Parallel VTK files\n"
+        "   .vtu, .vts, .vtr    - VTK files\n"
+        "   .pvtu, .pvts, .pvtr - Parallel VTK files\n"
+        "   .exo                - Cubit mesh file\n"
         ;
 }
 

Modified: cs/cigma/trunk/src/core_list_op.cpp
===================================================================
--- cs/cigma/trunk/src/core_list_op.cpp	2009-01-12 22:10:11 UTC (rev 13842)
+++ cs/cigma/trunk/src/core_list_op.cpp	2009-01-12 22:10:13 UTC (rev 13843)
@@ -3,6 +3,7 @@
 #include "Filesystem.h"
 
 #include "io_hdf5_reader.h"
+#include "io_exo_reader.h"
 #include "io_vtk_reader.h"
 
 #include <cstdlib>
@@ -26,13 +27,16 @@
 
 static int list_h5(const char *filename)
 {
+    // XXX: need own list function for HDF5 files
+    //return hdf5_print_contents(filename);
+    
+    // XXX: for now, defer work to /usr/bin/h5ls
     assert(filename != 0);
-
     string cmd = string("h5ls -r ").append(filename);
     int ret = system(cmd.c_str());
     if (ret < 0)
     {
-        cerr << "list: Could not find h5ls in your PATH" << endl;
+        cerr << "Error: Could not find h5ls in your PATH" << endl;
     }
     return ret;
 }
@@ -42,7 +46,22 @@
     return vtk_print_contents(filename);
 }
 
+static int list_exo(const char *filename)
+{
+    // XXX: need own list function for exodus files
+    //return exo_print_contents(filename);
 
+    // XXX: for now, defer work to /usr/bin/ncdump
+    assert(filename != 0);
+    string cmd = string("ncdump -h ").append(filename);
+    int ret = system(cmd.c_str());
+    if (ret < 0)
+    {
+        cerr << "Error: Could not find ncdump in your PATH" << endl;
+    }
+    return ret;
+}
+
 void ListOp::configure()
 {
     fs::path p(filename);
@@ -70,6 +89,10 @@
         {
             return list_h5(filename.c_str());
         }
+        else if (is_exo_extension(ext.c_str()))
+        {
+            return list_exo(filename.c_str());
+        }
         else if (is_vtk_extension(ext.c_str()))
         {
             return list_vtk(filename.c_str());



More information about the CIG-COMMITS mailing list