This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

dolfin-convert of Exodus II file

0 votes

Hello,

I first want to thank all of the FEniCS contributors for their great work.

As everything else works just fine, I assume this question is not related with my installation.

dolfin-convert works just fine with the .node and .ele file from the dolfin/scripts/dolfin-convert directory. The .exo however gives an error:

$:./dolfin-convert test_exodus.exo out.xml

Converting from Exodus II format to NetCDF format
Traceback (most recent call last):
  File "./dolfin-convert", line 131, in <module>
    main(sys.argv[1:])

  File "./dolfin-convert", line 78, in main
    meshconvert.convert2xml(ifilename, ofilename, iformat=iformat)

  File ".hashdist/bld/profile/d5cuhiuki6dy/lib/python2.7/site-packages/dolfin_utils/meshconvert/meshconvert.py", line 1303, in convert2xml
    convert(ifilename, XmlHandler(ofilename), iformat=iformat)

  File ".hashdist/bld/profile/d5cuhiuki6dy/lib/python2.7/site-packages/dolfin_utils/meshconvert/meshconvert.py", line 1348, in convert
    exodus2xml(ifilename, ofilename)

  File ".hashdist/bld/profile/d5cuhiuki6dy/lib/python2.7/site-packages/dolfin_utils/meshconvert/meshconvert.py", line 1287, in exodus2xml
    status, output = get_status_output('ncdump '+ifilename + ' > '+netcdffilename)

  File ".hashdist/bld/profile/d5cuhiuki6dy/lib/python2.7/site-packages/instant/output.py", line 120, in get_status_output
    pipe = Popen(cmd, shell=False, cwd=cwd, env=env, stdout=PIPE, stderr=STDOUT)

  File ".hashdist/bld/profile/d5cuhiuki6dy/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)

  File ".hashdist/bld/profile/d5cuhiuki6dy/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception

OSError: [Errno 2] No such file or directory

Is this error reproducible? I'd be glad for any hints, as it seems to be a bit too deep to debug it myself within reasonable time.

Thank you very much in advance!
JonnyB

asked Feb 16, 2016 by JonnyB FEniCS Novice (170 points)
edited Feb 17, 2016 by JonnyB

Do you get the same error if you run dolfin-convert instead of ./dolfin-convert (without ./)?

It's trying to run ncdump, which apparently is part of netcdf. I'm guessing it cannot be reached from inside the hashdist-build..

Ok, so you can either try to install netcdf on your system (netcdf-bin on Ubuntu) or let hashdist build and install netcdf for you.

Thank you very much for your help. So I guess it turned out to be an installation question after all, my apologies, for using the wrong forum.

I tried to install the netcdf-bin first (Ubuntu 12.04). This solved the error above, but lead to the following error:

Converting from Exodus II format to NetCDF format
Converting from NetCDF format (.ncdf) to DOLFIN XML format
Traceback (most recent call last):
  File ".hashdist/bld/profile/sr76g7nnkasp/bin/dolfin-convert", line 131, in <module>
    main(sys.argv[1:])

  File ".hashdist/bld/profile/sr76g7nnkasp/bin/dolfin-convert", line 78, in main
    meshconvert.convert2xml(ifilename, ofilename, iformat=iformat)

  File ".hashdist/bld/profile/sr76g7nnkasp/lib/python2.7/site-packages/dolfin_utils/meshconvert/meshconvert.py", line 1303, in convert2xml
    convert(ifilename, XmlHandler(ofilename), iformat=iformat)

  File ".hashdist/bld/profile/sr76g7nnkasp/lib/python2.7/site-packages/dolfin_utils/meshconvert/meshconvert.py", line 1348, in convert
    exodus2xml(ifilename, ofilename)

  File ".hashdist/bld/profile/sr76g7nnkasp/lib/python2.7/site-packages/dolfin_utils/meshconvert/meshconvert.py", line 1291, in exodus2xml
    netcdf2xml(netcdffilename, ofilename)

  File ".hashdist/bld/profile/sr76g7nnkasp/lib/python2.7/site-packages/dolfin_utils/meshconvert/meshconvert.py", line 1174, in netcdf2xml
    ifile = open(ifilename, "r")

IOError: [Errno 2] No such file or directory: 'test_exodus.ncdf'

So I went for the hashdist build and and extend the fenics-developer-tools/install/profiles/fenics.Linux.yaml by the packages

  netcdf4:
  netcdf4cpp:
  python-netcdf4:

Unfortunately, this lead to the error (the one suggested above by Øyvind Evju?):

Converting from Exodus II format to NetCDF format
Traceback (most recent call last):
  File "./dolfin-convert", line 131, in <module>
    main(sys.argv[1:])
  File "./dolfin-convert", line 78, in main
    meshconvert.convert2xml(ifilename, ofilename, iformat=iformat)
  File ".hashdist/bld/profile/sezrvjawl7jl/lib/python2.7/site-packages/dolfin_utils/meshconvert/meshconvert.py", line 1303, in convert2xml
    convert(ifilename, XmlHandler(ofilename), iformat=iformat)
  File ".hashdist/bld/profile/sezrvjawl7jl/lib/python2.7/site-packages/dolfin_utils/meshconvert/meshconvert.py", line 1348, in convert
    exodus2xml(ifilename, ofilename)
  File ".hashdist/bld/profile/sezrvjawl7jl/lib/python2.7/site-packages/dolfin_utils/meshconvert/meshconvert.py", line 1289, in exodus2xml
    raise IOError("Something wrong while executing ncdump. Is ncdump "\
IOError: Something wrong while executing ncdump. Is ncdump installed on the system?

Am I missing another package? Any suggestions appreciated. Thanks!

Ok, the netcdf-bin Ubuntu package will not work with the HashDist build since they have different versions of HDF5.

On the other hand, adding netcdf4: in fenics-developer-tools/install/profiles/fenics.Linux.yaml works fine for me. Just run

cd fenics-developer-tools
./install/fenics-install.sh install/profiles/fenics.Linux.yaml

Then run source fenics.custom when it has finished and ncdump should be in your path.

Mhm, that's what I did. I also tried on another machine today. Same issue.

I'm giving up now and look for a workaround. I basically just wanted to have a "connection" to all the mesh formats supported by vtk, and I read that it's the recommended way to go across the Exodus II format. But I guess, a little script that writes the dolfin xml files directly will also do it.

Thanks for your help anyway!

...