get_snapshot_filepath#

TwinModel.get_snapshot_filepath(rom_name, evaluation_time=0.0)#

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

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.

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.

Examples

>>> from pytwin import TwinModel
>>> model = TwinModel(model_filepath='path_to_twin_model_with_TBROM_in_it.twin')
>>> model.initialize_evaluation()
>>> available_rom_names = model.tbrom_names
>>> geometry_filepath = TwinModel.get_snapshot_filepath(rom_name=available_rom_names[0])