pymoto.SeriesToVTI
- class pymoto.SeriesToVTI(domain: VoxelDomain, saveto: str, delta_t: float = 1.0, interval: int = 10, scale: float = 1.0)
Writes transient response vectors to a Paraview VTI file
This module utilizes a series file to properly associate the correct time with each timestep: https://gitlab.kitware.com/paraview/paraview/blob/v5.5.0/Documentation/release/ParaView-5.5.0.md#json-based-new-meta-file-format-for-series-added
See also:
VoxelDomain.write_to_vti()The size of the vectors should be a multiple of
nelornnodeson its first dimension. Based on their size they are marked as cell-data or point-data in the VTI file. For 2D data (size is equal to2*nnodes), the z-dimension is padded with zeros to have 3-dimensional data. Also, non-transient block-vectors of multiple dimensions (e.g.(2, 3*nnodes)) are accepted, which get the suffixed as_00. The time dimension is the last dimension of the vector.- Input Signals:
*args(numpy.ndarray): Vectors to write to VTI. The signal tags are used as name.
- __init__(domain: VoxelDomain, saveto: str, delta_t: float = 1.0, interval: int = 10, scale: float = 1.0)
Initialize Series VTI writer module :param - domain: The domain layout :param - saveto: Location to save folders with transient responses for specific iterations :type - saveto: str :param - delta_t: Length of timestep :type - delta_t: float :param - interval: Iteration interval for saving data :type - interval: int, optional :param - scale: Scaling factor for the domain :type - scale: float, optional
Methods
__init__(domain, saveto[, delta_t, ...])Initialize Series VTI writer module :param - domain: The domain layout :param - saveto: Location to save folders with transient responses for specific iterations :type - saveto: str :param - delta_t: Length of timestep :type - delta_t: float :param - interval: Iteration interval for saving data :type - interval: int, optional :param - scale: Scaling factor for the domain :type - scale: float, optional
connect(sig_in[, sig_out])Connect without automatic adding to a function network
get_input_sensitivities([as_list])get_input_states([as_list])get_output_sensitivities([as_list])get_output_states([as_list])reset()Reset the state of the sensitivities (they are set to zero or to None)
response()Calculate the response from sig_in and output this to sig_out
Calculate sensitivities using backpropagation
Attributes
Get the number of input signals
Get the number of output signals
- connect(sig_in: Signal | Iterable[Signal], sig_out: Signal | Iterable[Signal] = None)
Connect without automatic adding to a function network
- get_input_sensitivities(as_list=False)
- get_input_states(as_list=False)
- get_output_sensitivities(as_list=False)
- get_output_states(as_list=False)
- property n_in: int
Get the number of input signals
- property n_out: int
Get the number of output signals
Note: Cannot be used in the initial __call__()
- reset()
Reset the state of the sensitivities (they are set to zero or to None)
- response()
Calculate the response from sig_in and output this to sig_out
- sensitivity()
Calculate sensitivities using backpropagation
Based on the sensitivity we get from sig_out, reverse the process and output the new sensitivities to sig_in
- sig_in: List = None
- sig_out: List = None