Guest User

Untitled

a guest
Apr 26th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. from dolfin import *
  2. from dolfin_utils import meshconvert
  3.  
  4. dolfin-convert cylinder6.msh out.xml
  5.  
  6. $ dolfin-convert
  7. Usage: dolfin-convert [OPTIONS] ... input.x output.y
  8.  
  9. Options:
  10.  
  11. -h display this help text and exit
  12. -i format specify input format
  13. -o format specify output format
  14.  
  15. Alternatively, the following long options may be used:
  16.  
  17. --help same as -h
  18. --input same as -i
  19. --output same as -o
  20.  
  21. Supported formats:
  22.  
  23. xml - DOLFIN XML mesh format (current)
  24. xml-old - DOLFIN XML mesh format (DOLFIN 0.6.2 and earlier)
  25. mesh - Medit, generated by tetgen with option -g
  26. Triangle - Triangle file format (input prefix of .ele and .node files)
  27. gmsh - Gmsh, version 2.0 file format
  28. metis - Metis graph file format
  29. scotch - Scotch graph file format
  30. diffpack - Diffpack tetrahedral grid format
  31. abaqus - Abaqus tetrahedral grid format
  32. ExodusII - Sandia Format (requires ncdump utility from NetCDF)
  33. Star-CD - Star-CD tetrahedral grid format
  34.  
  35. If --input or --output are not specified, the format will
  36. be deduced from the suffix:
  37.  
  38. .xml - xml
  39. .mesh - mesh
  40. .gmsh - gmsh
  41. .msh - gmsh
  42. .gra - metis
  43. .grf - scotch
  44. .grid - diffpack
  45. .inp - abaqus
  46. .e - Exodus II
  47. .exo - Exodus II
  48. .ncdf - ncdump'ed Exodus II
  49. .vrt and .cell - starcd
  50.  
  51. from dolfin_utils import meshconvert
  52.  
  53. # Convert to XML
  54. meshconvert.convert2xml(ifilename, ofilename, iformat=iformat)
  55.  
  56. # Order mesh
  57. os.system("dolfin-order %s" % ofilename)
  58.  
  59. import os
  60. os.system('dolfin-convert carbon_f.msh mesh.xml')
  61.  
  62. meshio-convert cylinder6.msh out.xml
Add Comment
Please, Sign In to add comment