diff --git a/proteus/Archiver.py b/proteus/Archiver.py index 697256b6d9..74509a4c4a 100644 --- a/proteus/Archiver.py +++ b/proteus/Archiver.py @@ -10,25 +10,9 @@ import numpy import os import h5py -from xml.etree.ElementTree import * memory = Profiling.memory -def indentXML(elem, level=0): - i = "\n" + level*" " - if len(elem): - if not elem.text or not elem.text.strip(): - elem.text = i + " " - for e in elem: - indentXML(e, level+1) - if not e.tail or not e.tail.strip(): - e.tail = i + " " - if not e.tail or not e.tail.strip(): - e.tail = i - else: - if level and (not elem.tail or not elem.tail.strip()): - elem.tail = i - #: The dtype of the index arrays the XDMF writers number themselves -- the #: point numbering of quadrature, DG and particle meshes -- as opposed to a #: mesh's own connectivity, whose dtype comes from the mesh. The writers @@ -55,6 +39,104 @@ def xdmf_number_type(*arrays): item = data_item_for(numpy.empty(0, numpy.result_type(*arrays)), inline=True) return {"DataType": item["data_type"], "Precision": str(item["precision"])} + +class ArchiveCollection(object): + """One temporal collection of the running archive. + + A collection is one finite-element space's sequence of grids, one per + archived instant, and it holds only the *current* step's grid: the + writers build it, :meth:`AR_base.sync` stores it in the HDF5 file and + clears it, so the running document is never more than one step deep. + The grid is a ymf grid dict (``topology``, ``geometry``, ``attributes`` + and an optional ``name``), built by :meth:`AR_base.write_grid`, + :meth:`AR_base.write_topology`, :meth:`AR_base.write_geometry` and + :meth:`AR_base.write_field`, and stored as it is. + + Before the XDMF retirement this was a ```` element whose last child was the current + step; the writers compared that child's ``