esys.weipa Package¶
Classes¶
-
class
esys.weipa.EscriptToTVTK(domain=None)¶ Bases:
objecta simple interface from escript to TVTK for rendering with mayavi.mlab
-
__init__(domain=None)¶ sets up driver for translating Data objects in domain to TVTK object.
-
getDomain()¶
-
getTVTK()¶
-
setData(**kwargs)¶ set the scalar data set:
-
setDomain(domain)¶ resets the domain
-
Functions¶
-
esys.weipa.convertToNumpy(data)¶ Writes
Dataobjects to a numpy array.The keyword args are Data objects to save. If a scalar
Dataobject is passed with the namemask, then only samples which correspond to positive values inmaskwill be output.Example usage:
s=Scalar(..) v=Vector(..) t=Tensor(..) f=float() array = getNumpy(a=s, b=v, c=t, d=f)
-
esys.weipa.createDataset(domain=None, **data)¶ Creates and returns an esys.weipa dataset consisting of a Domain and Data objects. The returned object provides methods to access and export data.
-
esys.weipa.hasFeature((str)name) → bool :¶ Check if escript was compiled with a certain feature
Parameters: name ( string) – feature to lookup
-
esys.weipa.interpolateEscriptData(domain, data)¶ esys.weipa does not support the function spaces Solution and ReducedSolution. This function interpolates Data defined on those function spaces to compatible alternatives.
-
esys.weipa.saveSilo(filename, domain=None, write_meshdata=False, time=0.0, cycle=0, **data)¶ Writes
Dataobjects and their mesh to a file using the SILO file format.Example:
temp=Scalar(..) v=Vector(..) saveSilo("solution.silo", temperature=temp, velocity=v)
tempandvare written to “solution.silo” wheretempis named “temperature” andvis named “velocity”.Parameters: - filename (
str) – name of the output file (‘.silo’ is added if required) - domain (
escript.Domain) – domain of theDataobjects. If not specified, the domain of the givenDataobjects is used. - write_meshdata (
bool) – whether to save mesh-related data such as element identifiers, ownership etc. This is mainly useful for debugging. - time (
float) – the timestamp to save within the file - cycle (
int) – the cycle (or timestep) of the data - <name> – writes the assigned value to the Silo file using <name> as identifier
Note: All data objects have to be defined on the same domain but they may be defined on separate
FunctionSpaces.- filename (
-
esys.weipa.saveVTK(filename, domain=None, metadata='', metadata_schema=None, write_meshdata=False, time=0.0, cycle=0, **data)¶ Writes
Dataobjects and their mesh to a file using the VTK XML file format.Example:
temp=Scalar(..) v=Vector(..) saveVTK("solution.vtu", temperature=temp, velocity=v)
tempandvare written to “solution.vtu” wheretempis named “temperature” andvis 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_schemaallows 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 theDataobjects. If not specified, the domain of the givenDataobjects is used. - <name> – 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 (
dictwithmetadata_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. - time (
float) – the timestamp to save within the file, seperate to metadata - cycle (
int) – the cycle (or timestep) of the data
Note: All data objects have to be defined on the same domain. They may not be in the same
FunctionSpacebut not all combinations ofFunctionSpaces can be written to a single VTK file. Typically, data on the boundary and on the interior cannot be mixed.- filename (
-
esys.weipa.saveVoxet(filename, **data)¶ Writes
Dataobjects to a file using the GOCAD Voxet file format as separate properties on the same grid. At the moment only Data on aripleydomain can be saved in this format. Note that this function will produce one header file (ending in .vo) and a separate property file for eachDataobject.Parameters: filename ( str) – name of the output file (‘.vo’ is added if required)Note: All data objects have to be defined on the same ripley domain and either defined on reduced Function or on a FunctionSpacethat allows interpolation to reduced Function.
-
esys.weipa.visitInitialize((str)simFile[, (str)comment='']) → bool¶
-
esys.weipa.visitPublishData((EscriptDataset)dataset) → bool¶
Others¶
- HAVE_TVTK