pymoto.WriteToVTI
- class pymoto.WriteToVTI(domain: VoxelDomain, saveto: str, overwrite: bool = False, scale=1.0, interval=1)
Writes vectors to a Paraview VTI file
See also:
VoxelDomain.write_to_vti()The size of the vectors should be a multiple of
nelornnodes. 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 block-vectors of multiple dimensions (e.g.(2, 3*nnodes)) are accepted, which get the suffixed as_00.- Input Signals:
*args(numpy.ndarray): Vectors to write to VTI. The signal tags are used as name.
- __init__(domain: VoxelDomain, saveto: str, overwrite: bool = False, scale=1.0, interval=1)
Initialize VTI writer module
- Parameters:
domain (
pymoto.VoxelDomain) – The finite element domain layoutsaveto (str) – Location to save the VTI file
overwrite (bool, optional) – Overwrite the VTI file for each iteration. Defaults to False.
scale (float, optional) – Scaling factor for the domain. Defaults to 1.0.
interval (int, optional) – Interval at which to write the VTI file, defaults to 1 (every iteration). Defaults to 1.
Methods
__init__(domain, saveto[, overwrite, scale, ...])Initialize VTI writer module
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