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

How to save a mesh to a different directory with XML format

0 votes

How can I save a mesh/file in XML format to a directory I am not currently in?

I understand I can save a mesh in xml format as follows...

mesh_file = File("mesh.xml")
mesh_file << mesh

but I'd like to save it in another directory, not the current one.

asked Jul 30, 2015 by aldenpack FEniCS User (1,450 points)

1 Answer

0 votes
 
Best answer

Just few examples

File("/absolute/path/to/my/working/dir/mesh.xml")
File("relative/path/to/my/working/dir/mesh.xml")
File("../../my/data/dir/mesh.xml")

Of course you should use os.path package to manipulate path strings in a portable way...

answered Jul 30, 2015 by Jan Blechta FEniCS Expert (51,420 points)
selected Jun 27, 2016 by aldenpack
...