releso.util.cnn_xns_observations.get_visual_representation

releso.util.cnn_xns_observations.get_visual_representation(connectivity: ndarray, sol_len: int = 3, height: int = 10, width: int = 10, dpi: int = 20) ndarray

Return an array representing the calculated solution.

This function is used to create the array which is used if the solution/cnn representation of the base observations are selected.

Note

The calculated solution can only be found if the SporObject of the solver is called main_solver and uses the xns solver.

#TODO make it broader in its application e.g. other solvers?

Parameters:
  • connectivity (np.ndarray) – Connectivity array of the mesh.

  • sol_len (int, optional) – Number of variables to return per data point, input can be more but not less. Assumed is u,v,p. Defaults to 3.

  • height (int, optional) – Height of the image array in inches. Defaults to 10.

  • width (int, optional) – Width of the image array in inches. Defaults to 10.

  • dpi (int, optional) – DPI of the image array. Together with the height and width, this variable defines the shape of the return array shape=(height*dpi, width*dpi, sol_len). Defaults to 20.

Raises:

RuntimeError – could not find solution file, mesh is of the incorrect type (needs to be triangular), mesh is of the incorrect dimensions (needs to be dim=2)