Add member function to Mesh to read from file
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)
-
-
reporter The
>>
interface is problematic because we can't set options, e.g. pass the MPI communicator. -
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.
-
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.
-
+1 for
file.read(mesh, options)
, allowing e.g. Mesh to be independent of I/O. -
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.
-
OK
-
- removed milestone
Removing milestone: 1.7 (automated comment)
-
reporter @chris_richardson Has this been fixed?
-
reporter @michalhabera @chris_richardson Can this be closed?
-
- changed status to resolved
Works for xdmf
- Log in to comment
This should work?