pyrc.visualization.vtk_parser#

create_heat_flux_lines(resistors, time_steps: list, output_folder='output', step_interval=None)#
write_pvd(pvd_entries: list, output_folder='output', name='00_simulation')#
write_static_cells_vtu(nodes: list[Node], output_folder='output') tuple[np.ndarray, np.ndarray]#
write_temperature_vtu(result_temperatures: ndarray, time_steps: list, points: ndarray, cells: ndarray, output_folder='output', step_interval: int = 1, run_parallel=False)#

Creates multiple vtu files containing cell temperatures.

Parameters:
  • result_temperatures (np.narray) – The temperatures with shape (num_time_steps, num_nodes)

  • time_steps (list) – The time steps.

  • points (np.ndarray) – The points to build the mesh. First return of write_static_cells_vtu

  • cells (np.ndarray) – A list defining the cells out of the points using their number/increment. Second return of write_static_cells_vtu

  • output_folder (str, optional) – The location to save the files in (folder with path).

  • step_interval (int, optional) – An increment which time steps should be converted to vtu files. If 1, every time step is used, if 2, each second, and so on.

  • run_parallel (bool) – If True, the creation of the vtu files is done using all cores. But it only works on Linux because of the different mechanisms how processes are created (spawn/fork).

write_vtu_parallel(t_idx, name: str, time_steps: list, matrix, output_folder: str, format_layout: str, points: ndarray, cells: array, cell_type: str = 'hexahedron')#

Writes a single .vtu file for a specific time step. Is used in multiprocessing pool.starmap

Parameters:
  • t_idx (int) – The index of the time step.

  • name (str) – The name of the parameter.

  • time_steps (list) – A list with all time steps.

  • matrix (np.ndarray) – A numpy matrix with the values. Shape: time_steps, nodes For one time step one row is used (not one column)!

  • output_folder (str) – The output folder.

  • format_layout (str) – A format to style the index of the temperature. Should be: “0{len(time_steps)}d”

Returns:

The line to add to the pvd file that links to the created temperature file.

Return type:

str