← Back to team overview

dolfin team mailing list archive

[Bug 780301] Re: Feature request: Output to other mesh formats than Dolfin XML

 

I have implemented a rudimentary function that outputs a dolfin::Mesh to
GMSH 2 format.

It currently only outputs geometry: no material IDs, no physical volumes
or surfaces, no boundaries, no faces, et cetera.

I have only made the GMSH output for Dolfin C++, since I was not able to
figure out from dolfin_utils/meshconvert.py how to read in the Dolfin
XML files. But as you can see, the format is very, very simple, so
adding it to dolfin-convert should be a very quick for someone who knows
the Dolfin python modules better than I.

The GMSH output function is attached. I am also not familiar enough with
the internals of Dolfin to know how it should fit in, so it's just a
stand alone function. I suppose I should add a GMSHFile class as
dolfin/io/GMSHFile.{h,cpp} and register it somewhere?

Cheers,
James


** Attachment added: "write_mesh.cpp"
   https://bugs.launchpad.net/dolfin/+bug/780301/+attachment/2122124/+files/write_mesh.cpp

-- 
You received this bug notification because you are a member of DOLFIN
Team, which is subscribed to DOLFIN.
https://bugs.launchpad.net/bugs/780301

Title:
  Feature request: Output to other mesh formats than Dolfin XML

Status in DOLFIN:
  New

Bug description:
  Dolfin can only output meshes in the Dolfin XML format.

  However, dolfin-convert currently is only able to convert in one direction: *to* the Dolfin XML format, but not from it. 
  This means that it is not possible at present to export generated meshes such that they can be used by other tools. 

  The feature request is for either adding one or more "external"
  formats for writing Mesh-classes from Dolfin, or for dolfin-convert to
  provide conversion from Dolfin XML to one or more other formats.



References