get_image_filepath#

TwinModel.get_image_filepath(rom_name, view_name, evaluation_time=0.0)#

Get the image file associated to a Reduced Order Model (ROM) available in the TwinModel and evaluated at the given time instant. The image file shows the field results of the ROM in the given predefined view.

Parameters:
rom_namestr

This is the name of a ROM model that is available in the TwinModel. See TwinModel.tbrom_names property to get a list of available ROM model.

view_namestr

The view name associated to the rendering view with which the ROM results are displayed. See TwinModel.get_available_view_names method to get a list of available rendering view names for a given ROM.

evaluation_time: float

This is the evaluation time at which you want to get the snapshot file. The method returns None if no snapshot file is available at this evaluation_time. Two evaluation times can be distinguished up to 6 digits after the comma.

Raises:
TwinModelError:

It raises an error if TwinModel has not been initialized. It raises an error if TwinModel does not include any TBROM. It raises an error if rom_name is not available. It raises an error if view_name is not available.

Examples

>>> from pytwin import TwinModel
>>> model = TwinModel(model_filepath='path_to_twin_model_with_TBROM_in_it.twin')
>>> model.initialize_evaluation()
>>> rom_name = model.tbrom_names[0]
>>> view_name = model.get_available_view_names(rom_name)[0]
>>> geometry_filepath = TwinModel.get_image_filepath(rom_name, view_name)