def __init__(self, name="datawriterhdf5"): """ Constructor. """ DataWriter.__init__(self, name) ModuleDataWriterHDF5.__init__(self) return
def initialize(self, normalizer): """ Initialize writer. """ DataWriter.initialize(self, normalizer, self.filename) timeScale = normalizer.timeScale() ModuleDataWriterHDF5.filename(self, self.filename) ModuleDataWriterHDF5.timeScale(self, timeScale.value) return
def close(self): """ Close writer. """ ModuleDataWriterHDF5.close(self) # Only write Xdmf file on proc 0 from pylith.mpi.Communicator import mpi_comm_world comm = mpi_comm_world() if not comm.rank: from Xdmf import Xdmf xdmf = Xdmf() xdmf.write(ModuleDataWriterHDF5.hdf5Filename(self), verbose=False) return