sfepy.postprocess.sources module

class sfepy.postprocess.sources.FileSource(filename, watch=False, offscreen=True)[source]

General file source.

file_changed(self)[source]
get_mat_id(self, mat_id_name='mat_id')[source]

Get material ID numbers of the underlying mesh elements.

get_step_time(self, step=None, time=None)[source]

Set current step and time to the values closest greater or equal to either step or time. Return the found values.

get_ts_info(self)[source]
poll_file(self)[source]

Check the source file’s time stamp and notify the self.notify_obj in case it changed. Subclasses should implement the file_changed() method.

reset(self)[source]

Reset.

setup_mat_id(self, mat_id_name='mat_id', single_color=False)[source]
setup_notification(self, obj, attr)[source]

The attribute ‘attr’ of the object ‘obj’ will be set to True when the source file is watched and changes.

class sfepy.postprocess.sources.GenericFileSource(*args, **kwargs)[source]

File source usable with any format supported by MeshIO classes.

add_data_to_dataset(self, dataset, data)[source]

Add point and cell data to the dataset.

create_dataset(self)[source]

Create a tvtk.UnstructuredGrid dataset from the Mesh instance of the file source.

create_source(self)[source]

Create a VTK source from data in a SfePy-supported file.

Notes

All data need to be set here, otherwise time stepping will not work properly - data added by user later will be thrown away on time step change.

file_changed(self)[source]
get_bounding_box(self)[source]
get_mat_id(self, mat_id_name='mat_id')[source]

Get material ID numbers of the underlying mesh elements.

read_common(self, filename)[source]
set_filename(self, filename, vis_source)[source]
class sfepy.postprocess.sources.GenericSequenceFileSource(*args, **kwargs)[source]

File source usable with any format supported by MeshIO classes, with exception of HDF5 (.h5), for file sequences.

file_changed(self)[source]
read_common(self, filename)[source]
set_filename(self, filename, vis_source)[source]
class sfepy.postprocess.sources.VTKFileSource(filename, watch=False, offscreen=True)[source]

A thin wrapper around mlab.pipeline.open().

create_source(self)[source]

Create a VTK file source

get_bounding_box(self)[source]
set_filename(self, filename, vis_source)[source]
class sfepy.postprocess.sources.VTKSequenceFileSource(*args, **kwargs)[source]

A thin wrapper around mlab.pipeline.open() for VTK file sequences.

create_source(self)[source]

Create a VTK file source

set_filename(self, filename, vis_source)[source]
sfepy.postprocess.sources.create_file_source(filename, watch=False, offscreen=True)[source]

Factory function to create a file source corresponding to the given file format.