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

import a mesh from cubit

+2 votes

I'm trying to import a mesh from cubit 14.0 (it's a cube with tetmesh elements) into fenics via dolfin-convert. I've tried telling cubit to export into several output files but dolfin-convert doesn't have success with any of them:

Abaqus (.inp) : "_csv.Error: line contains NULL byte"
Exodus (.e): "IOError: [Errno 2] No such file or directory: 'cubit5a.ncdf'
Fluent: "*** Unable to find cells of supported type."

Paraview is able to load the exodus file so I think that is good. But even if I resave it with paraview I get the same error with dolfin-convert.

Has anyone had any success in this or can offer some advice please?

Thanks

asked Apr 8, 2015 by mwelland FEniCS User (8,410 points)

2 Answers

+2 votes
 
Best answer

For those who are interested, this (finally) worked:

  1. Used Cubit to build the geometry and give it an initial mesh.
  2. Exported (file > export) it to an .stl file.
  3. Use tetgen (http://wias-berlin.de/software/tetgen/#Documentation) with -g flag to get a .mesh file and do any other mesh refinement / manipulations
  4. Use dolfin-convert to get the .mesh file to a .xml file which loads correctly.

Not the most elegant but it works!

answered Apr 9, 2015 by mwelland FEniCS User (8,410 points)
selected Jun 19, 2017 by mwelland
+2 votes

You can also export in exodusII format and then use dolfin-convert. You should select an option when saving to exodusII format from cubit to disable "large file format", which is not accepted by dolfin-convert

answered Apr 11, 2015 by cmaurini FEniCS User (1,130 points)
...