saveVTK(filename,
domain=None,
metadata='',
metadata_schema=None,
write_meshdata=False,
**data)
|
|
Writes Data objects and their mesh to a file using the VTK XML file
format.
Example:
temp=Scalar(..)
v=Vector(..)
saveVTK("solution.vtu", temperature=temp, velocity=v)
temp and v are written to "solution.vtu" where temp is named
"temperature" and v is named "velocity".
Meta tags, e.g. a timeStamp, can be added to the file, for instance:
tmp=Scalar(..)
v=Vector(..)
saveVTK("solution.vtu", temperature=tmp, velocity=v,
metadata="<timeStamp>1.234</timeStamp>",
metadata_schema={"gml":"http://www.opengis.net/gml"})
The argument metadata_schema allows the definition of name spaces with
a schema used in the definition of meta tags.
- Parameters:
filename (str) - name of the output file ('.vtu' is added if required)
domain (escript.Domain) - domain of the Data objects. If not specified, the domain
of the given Data objects is used.
- writes the assigned value to the VTK file using <name> as
identifier
metadata (str) - additional XML meta data which are inserted into the VTK
file. The meta data are marked by the tag <MetaData>.
metadata_schema (dict with metadata_schema[<namespace>]=<URI>
to assign the scheme <URI> to the name space
<namespace>.) - assigns schemas to namespaces which have been used
to define meta data.
write_meshdata (bool) - whether to save mesh-related data such as element
identifiers, ownership etc. This is mainly useful
for debugging.
Note:
All data objects have to be defined on the same domain. They may not
be in the same FunctionSpace but not all combinations of
FunctionSpace s can be written to a single VTK file.
Typically, data on the boundary and on the interior cannot be mixed.
|