/[escript]/trunk/weipa/py_src/__init__.py
ViewVC logotype

Diff of /trunk/weipa/py_src/__init__.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3371 by caltinay, Mon Nov 22 06:13:47 2010 UTC revision 3623 by caltinay, Tue Oct 11 03:59:40 2011 UTC
# Line 60  def createDataset(domain=None, **data): Line 60  def createDataset(domain=None, **data):
60          dataset.addData(d, n, "")          dataset.addData(d, n, "")
61      return dataset      return dataset
62    
63  def saveSilo(filename, domain=None, **data):  def saveSilo(filename, domain=None, write_meshdata=False, **data):
64      """      """
65      Writes `Data` objects and their mesh to a file using the SILO file format.      Writes `Data` objects and their mesh to a file using the SILO file format.
66    
# Line 78  def saveSilo(filename, domain=None, **da Line 78  def saveSilo(filename, domain=None, **da
78      :param domain: domain of the `Data` objects. If not specified, the domain      :param domain: domain of the `Data` objects. If not specified, the domain
79                     of the given `Data` objects is used.                     of the given `Data` objects is used.
80      :type domain: `escript.Domain`      :type domain: `escript.Domain`
81        :param write_meshdata: whether to save mesh-related data such as element
82                               identifiers, ownership etc. This is mainly useful
83                               for debugging.
84        :type write_meshdata: ``bool``
85      :keyword <name>: writes the assigned value to the Silo file using <name> as      :keyword <name>: writes the assigned value to the Silo file using <name> as
86                       identifier                       identifier
87      :note: All data objects have to be defined on the same domain but they may      :note: All data objects have to be defined on the same domain but they may
# Line 85  def saveSilo(filename, domain=None, **da Line 89  def saveSilo(filename, domain=None, **da
89      """      """
90    
91      dataset = createDataset(domain, **data)      dataset = createDataset(domain, **data)
92      dataset.saveSilo(filename)      dataset.setSaveMeshData(write_meshdata)
93        return dataset.saveSilo(filename, write_meshdata)
94    
95  def saveVTK(filename, domain=None, metadata='', metadata_schema=None, **data):  def saveVTK(filename, domain=None, metadata='', metadata_schema=None, write_meshdata=False, **data):
96      """      """
97      Writes `Data` objects and their mesh to a file using the VTK XML file      Writes `Data` objects and their mesh to a file using the VTK XML file
98      format.      format.
# Line 127  def saveVTK(filename, domain=None, metad Line 132  def saveVTK(filename, domain=None, metad
132      :type metadata_schema: ``dict`` with ``metadata_schema[<namespace>]=<URI>``      :type metadata_schema: ``dict`` with ``metadata_schema[<namespace>]=<URI>``
133                             to assign the scheme ``<URI>`` to the name space                             to assign the scheme ``<URI>`` to the name space
134                             ``<namespace>``.                             ``<namespace>``.
135        :param write_meshdata: whether to save mesh-related data such as element
136                               identifiers, ownership etc. This is mainly useful
137                               for debugging.
138        :type write_meshdata: ``bool``
139      :note: All data objects have to be defined on the same domain. They may not      :note: All data objects have to be defined on the same domain. They may not
140             be in the same `FunctionSpace` but not all combinations of             be in the same `FunctionSpace` but not all combinations of
141             `FunctionSpace` s can be written to a single VTK file.             `FunctionSpace` s can be written to a single VTK file.
# Line 145  def saveVTK(filename, domain=None, metad Line 154  def saveVTK(filename, domain=None, metad
154          else:          else:
155              ss=metadata_schema              ss=metadata_schema
156      dataset.setMetadataSchemaString(ss.strip(), ms.strip())      dataset.setMetadataSchemaString(ss.strip(), ms.strip())
157      dataset.saveVTK(filename)      dataset.setSaveMeshData(write_meshdata)
158        return dataset.saveVTK(filename)
159    
160  def _saveVTK(filename, domain=None, metadata='', metadata_schema=None, data={}):  def _saveVTK(filename, domain=None, metadata='', metadata_schema=None, data={}):
161      """      """
162      This is only here to support the deprecated domain C++ member saveVTK().      This is only here to support the deprecated domain C++ member saveVTK().
163      """      """
164      saveVTK(filename, domain, metadata, metadata_schema, **data)      return saveVTK(filename, domain, metadata, metadata_schema, **data)
165    

Legend:
Removed from v.3371  
changed lines
  Added in v.3623

  ViewVC Help
Powered by ViewVC 1.1.26