Output (class)

File generated according to Generator/ClassesRef/Output/Output.csv WARNING! All changes made in this file will be lost!

class Output(simu=-1, path_res='', geo=-1, elec=-1, mag=-1, struct=-1, post=-1, logger_name='Pyleecan.Output', init_dict=None)[source]

Bases: pyleecan.Classes._frozen.FrozenClass

Main Output object: gather all the outputs of all the modules

VERSION = 1
get_BH_stator()

Return the B(H) curve of the stator material

Parameters:self (Output) – an Output object
Returns:BH – B(H) values (two colums matrix: H and B(H))
Return type:numpy.ndarray
get_BH_rotor()

Return the B(H) curve of the rotor material

Parameters:self (Output) – an Output object
Returns:BH – B(H) values (two colums matrix: H and B(H))
Return type:numpy.ndarray
get_path_result()

Return the path to the result folder. If there is a name for the simulation, the path leads to a sub-folder of ‘Results’ folder which has the same name. If this sub-folder does not exist, it creates it.

Parameters:self (Output) – an Output object
Returns:res_path – path to the result folder
Return type:str
get_angle_rotor()

Return the angular position of the rotor as a function of time

Parameters:self (Output) – an Output object
Returns:alpha_rotor – angular position of the rotor as a function of time (vector) [rad]
Return type:numpy.ndarray
plot_mesh(j_t0=0, mesh=None, title='No title', group=None, elem_type=['Triangle3'])

Display mesh.

Parameters:
  • self (Output) – an Output object
  • mesh (Mesh) – a Mesh object
  • title (str) – Title of the figure
plot_A_time(Data_str, alpha=None, alpha_index=0, is_fft=False, is_elecorder=False, freq_max=20000, is_norm=False, unit='SI', out_list=[])

Plots a field as a function of time

Parameters:
  • self (Output) – an Output object
  • Data_str (str) – name of the Data Object to plot (e.g. “mag.Br”)
  • alpha (float) – angle value at which to slice
  • alpha_index (int) – angle index at which to slice
  • is_fft (bool) – boolean indicating if we want to plot the time-fft below the plot
  • is_elecorder (bool) – boolean indicating if we want to use the electrical order for the fft axis
  • freq_max (int) – maximum value of the frequency for the fft axis
  • is_norm (bool) – boolean indicating if the field must be normalized
  • unit (str) – unit in which to plot the field
  • out_list (list) – list of Output objects to compare
plot_A_space(Data_str, t=None, t_index=0, is_deg=True, is_fft=False, is_spaceorder=False, r_max=100, fund_harm=None, is_norm=False, unit='SI', out_list=[])

Plots a field as a function of space (angle)

Parameters:
  • self (Output) – an Output object
  • Data_str (str) – name of the Data Object to plot (e.g. “mag.Br”)
  • t (float) – time value at which to slice
  • t_index (int) – time index at which to slice
  • is_deg (bool) – boolean indicating if the angle must be converted to degrees
  • is_fft (bool) – boolean indicating if we want to plot the space-fft below the plot
  • is_spaceorder (bool) – boolean indicating if we want to use the spatial order for the fft axis
  • r_max (int) – maximum value of the wavenumber for the fft axis
  • fund_harm (float) – frequency of the fundamental harmonic
  • is_norm (bool) – boolean indicating if the field must be normalized
  • unit (str) – unit in which to plot the field
  • out_list (list) – list of Output objects to compare
plot_A_time_space(Data_str, is_deg=True, is_elecorder=False, is_spaceorder=False, freq_max=20000, r_max=100, z_max=1.0, is_norm=False, unit='SI', colormap='RdBu_r', out_list=[])

Plots a field as a function of time and space (angle)

Parameters:
  • self (Output) – an Output object
  • Data_str (str) – name of the Data Object to plot (e.g. “mag.Br”)
  • is_deg (bool) – boolean indicating if the angle must be converted to degrees
  • is_elecorder (bool) – boolean indicating if we want to use the electrical order for the fft axis
  • is_spaceorder (bool) – boolean indicating if we want to use the spatial order for the fft axis
  • freq_max (float) – maximum value of the frequency for the fft axis
  • r_max (int) – maximum value of the wavenumber for the fft axis
  • z_max (float) – maximum value for the field
  • is_norm (bool) – boolean indicating if the field must be normalized
  • unit (str) – unit in which to plot the field
  • colormap (colormap object) – colormap prescribed by user
  • out_list (list) – list of Output objects to compare
plot_A_surf(Data_str, is_deg=True, t_max=1.0, a_max=400, z_max=1.0, is_norm=False, unit='SI', colormap='RdBu_r')

Plots the isosurface of a field in 3D

Parameters:
  • self (Output) – an Output object
  • Data_str (str) – name of the Data Object to plot (e.g. “mag.Br”)
  • is_deg (bool) – boolean indicating if the angle must be converted to degrees
  • t_max (float) – maximum value of the time for the x axis
  • a_max (float) – maximum value of the angle for the y axis
  • z_max (float) – maximum value of the magnitude for the z axis
  • is_norm (bool) – boolean indicating if the field must be normalized
  • unit (str) – unit in which to plot the field
  • colormap (colormap object) – colormap prescribed by user
  • out_list (list) – list of Output objects to compare
plot_A_cfft2(Data_str, is_elecorder=False, is_spaceorder=False, freq_max=20000, r_max=100, mag_max=1.0, N_stem=100, disp_negative=False, is_norm=False, unit='SI', out_list=[])

3D stem plot of the 2D Fourier Transform of a field

Parameters:
  • self (Output) – an Output object
  • Data_str (str) – name of the Data Object to plot (e.g. “mag.Br”)
  • is_elecorder (bool) – boolean indicating if we want to use the electrical order for the fft axis
  • is_spaceorder (bool) – boolean indicating if we want to use the spatial order for the fft axis
  • freq_max (int) – maximum value of the frequency for the fft axis
  • r_max (int) – maximum value of the wavenumber for the fft axis
  • mag_max (int) – maximum value of the magnitude
  • N_stem (int) – number of stems to plot
  • disp_negative (bool) – plot negative frequencies
  • is_norm (bool) – boolean indicating if the field must be normalized
  • unit (str) – unit in which to plot the field
  • out_list (list) – list of Output objects to compare
plot_A_nthoctave
plot_A_fft2(Data_str, is_phase=False, is_deg=True, is_elecorder=False, is_spaceorder=False, freq_max=20000, r_max=100, mag_max=1.0, is_norm=False, unit='SI', colormap='RdBu_r', out_list=[])

2D color plot of the 2D Fourier Transform of a field

Parameters:
  • self (Output) – an Output object
  • Data_str (str) – name of the Data Object to plot (e.g. “mag.Br”)
  • is_deg (bool) – boolean indicating if the phase must be converted to degrees
  • is_elecorder (bool) – boolean indicating if we want to use the electrical order for the fft axis
  • is_spaceorder (bool) – boolean indicating if we want to use the spatial order for the fft axis
  • freq_max (int) – maximum value of the frequency for the fft axis
  • r_max (int) – maximum value of the wavenumber for the fft axis
  • is_norm (bool) – boolean indicating if the field must be normalized
  • unit (str) – unit in which to plot the field
  • out_list (list) – list of Output objects to compare
plot_B_space(j_t0=0, is_deg=True, out_list=[])

Plot the airgap flux as a function of space

Parameters:
  • self (Output) – an Output object
  • j_t0 (int) – Index of the time vector to plot
  • is_deg (bool) – True to plot in degree, False in rad
  • out_list (list) – List of Output object to compare
plot_force_space(j_t0=0, is_deg=True, out_list=[])

Plot the airgap surface forces as a function of space

Parameters:
  • self (Output) – an Output object
  • j_t0 (int) – Index of the time vector to plot
  • is_deg (bool) – True to plot in degree, False in rad
  • out_list (list) – List of Output object to compare
plot_mesh_field(meshsolution=None, field_name='mu', j_t0=0, mesh=None, solution=None, field=None, title='No title', group=None, elem_type='Triangle3')
Display 2D field amplitude per element. Several possible inputs combinations: meshsolution only,
mesh and solution, or mesh and field.
Parameters:
  • self (Output) – an Output object
  • meshsolution (MeshSolution) – a MeshSolution object. Can be replaced by mesh and field.
  • mesh (Mesh) – a Mesh object
  • solution (Solution) – a Solution object
  • field (array) – Column vector with the field to be displayed
  • title (str) – Title of the figure
plot_A_space_compare(Data_str, t=None, t_index=0, is_deg=True, is_fft=False, is_spaceorder=False, r_max=100, fund_harm=None, is_norm=False, unit='SI', index_list=[])

Plots a field as a function of space (angle)

Parameters:
  • self (Output) – an Output object
  • Data_str (str) – name of the Data Object to plot (e.g. “mag.Br”)
  • t (float) – time value at which to slice
  • t_index (int) – time index at which to slice
  • is_deg (bool) – boolean indicating if the angle must be converted to degrees
  • is_fft (bool) – boolean indicating if we want to plot the space-fft below the plot
  • is_spaceorder (bool) – boolean indicating if we want to use the spatial order for the fft axis
  • r_max (int) – maximum value of the wavenumber for the fft axis
  • fund_harm (float) – frequency of the fundamental harmonic
  • is_norm (bool) – boolean indicating if the field must be normalized
  • unit (str) – unit in which to plot the field
  • index_list (list) – list of indices to compare
save(save_path='')

Save the object to the save_path

Parameters:
  • self – A pyleecan object
  • save_path (str) – path to the folder to save the object
get_logger()

Get the object logger or its parent’s one

Parameters:obj – A pyleecan object
Returns:logger – Pyleecan object dedicated logger
Return type:logging.Logger
as_dict()[source]

Convert this objet in a json seriable dict (can be use in __init__)

simu

Simulation object that generated the Output

path_res

Path to the folder to same the results

geo

Geometry output

elec

Electrical module output

mag

Magnetic module output

struct

Structural module output

post

Post-Processing settings

logger_name

Name of the logger to use