Add member function to Mesh to read from file

Issue #614 resolved
Prof Garth Wells created an issue

At present, once can only read a mesh from file via the Mesh constructor. This isn't helpful when passing a (shared) pointer to a function that is responsible for initialising a Mesh.

Comments (11)

  1. Prof Garth Wells reporter

    The >> interface is problematic because we can't set options, e.g. pass the MPI communicator.

  2. Anders Logg (Chalmers)

    OK, question is then whether it should be

    mesh.read(filename, options);
    

    or

    file.read(mesh, options);
    

    and << can remain as wrappers for read/write functions.

  3. Prof Garth Wells reporter

    That's at much more general (and important) question with implication across classes!

    Given where we've been going with XDMF and HDF5 (where files can have parameters), the latter is probably the most appropriate.

  4. Prof Garth Wells reporter

    Ok, let's move to this across the board. We'll soon add support for ascii XDMF, so for this particular case we'll drop the << syntax.

    It will also allow us to make proper use of XML to pull mesh data out explicitly rather than magically behind the scenes.

  5. Log in to comment