HDF5File¶
-
class
dolfin.cpp.io.
HDF5File
(comm, filename, file_mode)¶ Bases:
dolfin.cpp.common.Variable
Constructor. file_mode should be “a” (append), “w” (write) or “r” (read).
-
attributes
()¶
-
close
()¶ Close file
-
flush
()¶ Flush buffered I/O to disk
-
get_mpi_atomicity
()¶ Get the MPI atomicity
-
h5_id
()¶
-
has_dataset
()¶ Check if dataset exists in HDF5 file
-
read
()¶ Overloaded versions
read(x, dataset_name, use_partition_from_file)
Read vector from file and optionally re-use any partitioning that is available in the file
read(u, name)
Read Function from file and distribute data according to the Mesh and dofmap associated with the Function. If the ‘name’ refers to a HDF5 group, then it is assumed that the Function data is stored in the datasets within that group. If the ‘name’ refers to a HDF5 dataset within a group, then it is assumed that it is a Vector, and the Function will be filled from that Vector
read(mesh, data_path, use_partition_from_file)
Read Mesh from file, using attribute data (e.g., cell type) stored in the HDF5 file. Optionally re-use any partition data in the file. This function requires all necessary data for constructing a Mesh to be present in the HDF5 file.
read(input_mesh, topology_path, geometry_path, gdim, cell_type, expected_num_global_cells, expected_num_global_points, use_partition_from_file)
Construct Mesh with paths to topology and geometry datasets, and providing essential meta-data, e.g. geometric dimension and cell type. If this data is available in the HDF5 file, it will be checked for consistency. Set expected_num_global_cells to a negative value if not known.
This function is typically called when using the XDMF format, in which case the meta data has alreayd been read from an XML file
read(meshfunction, name)
Read MeshFunction from file
read(meshfunction, name)
Read MeshFunction from file
read(meshfunction, name)
Read MeshFunction from file
read(meshfunction, name)
Read MeshFunction from file
read(mesh_values, name)
Read MeshValueCollection from file
read(mesh_values, name)
Read MeshValueCollection from file
read(mesh_values, name)
Read MeshValueCollection from file
-
set_mpi_atomicity
()¶ Set the MPI atomicity
-
thisown
¶ The membership flag
-
write
()¶ Overloaded versions
write(points, name)
Write points to file
write(values, name)
Write simple vector of double to file
write(x, name)
Write Vector to file in a format suitable for re-reading
write(mesh, name)
Write Mesh to file in a format suitable for re-reading
write(mesh, cell_dim, name)
Write Mesh of given cell dimension to file in a format suitable for re-reading
write(u, name)
Write Function to file in a format suitable for re-reading
write(u, name, timestamp)
Write Function to file with a timestamp
write(meshfunction, name)
Write MeshFunction to file in a format suitable for re-reading
write(meshfunction, name)
Write MeshFunction to file in a format suitable for re-reading
write(meshfunction, name)
Write MeshFunction to file in a format suitable for re-reading
write(meshfunction, name)
Write MeshFunction to file in a format suitable for re-reading
write(mesh_values, name)
Write MeshValueCollection to file
write(mesh_values, name)
Write MeshValueCollection to file
write(mesh_values, name)
Write MeshValueCollection to file
-