pyleecan.Classes.StructElmer module

Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/StructElmer

class StructElmer(Kmesh_fineness=1, path_name='', FEA_dict_enforced=- 1, is_get_mesh=False, is_save_FEA=True, transform_list=- 1, include_magnets=True, logger_name='Pyleecan.Structural', init_dict=None, init_str=None)[source]

Bases: Structural

Structural module: FEA model with Elmer

VERSION = 1
run()

Run the Structural module

get_meshsolution(output)

Get and set the mesh data and solution data.

Parameters:
  • self (StructElmer) – a StructElmer object

  • save_path (str) – Full path to folder in which the results are saved

Returns:

success – Information if meshsolution could be created

Return type:

bool

get_path_save_fea(output)

Return the path to save the FEA simulation

Parameters:
  • self (MagFEMM) – a MagFEMM object

  • output (Output) –

    an Output object

    Returns

  • -------

  • save_path (str) – Path to save the .fem file

solve_FEA(output)

Solve the FEA simulation

gen_mesh(output)

Initialize the FEA simulation model

Parameters:
  • self (StructElmer object) –

  • output (Output) – Output object that contains the StructElmer simulation

gen_case(output, mesh_names)

Setup the Elmer Case file (.sif file)

process_mesh(file_in, file_out, is_get_lam=True, is_get_magnet=False, is_hole_air=True)

Preprocess the GMSH model, i.e. remove unused parts, rename boundaries, …

save(save_path='', is_folder=False, type_handle_old=2, type_compression=0)

Save the object to the save_path

Parameters:
  • self – A pyleecan object

  • save_path (str) – path to the folder to save the object

  • is_folder (bool) – to split the object in different files: separate simulation machine and materials (json only)

  • type_handle_old (int) – How to handle old file in folder mode (0:Nothing, 1:Delete, 2:Move to “Backup” folder)

  • type_compression (int) – Available only for json, 0: no compression, 1: gzip

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

compare(other, name='self', ignore_list=None, is_add_value=False)[source]

Compare two objects and return list of differences

as_dict(type_handle_ndarray=0, keep_function=False, **kwargs)[source]

Convert this object in a json serializable dict (can be use in __init__). type_handle_ndarray: int

How to handle ndarray (0: tolist, 1: copy, 2: nothing)

keep_functionbool

True to keep the function object, else return str

Optional keyword input parameter is for internal use only and may prevent json serializability.

copy()[source]

Creates a deepcopy of the object

property Kmesh_fineness

finner , < 1 : less fine)

Type:

float

Type:

global coefficient to adjust mesh fineness in FEMM (1

Type:

default , > 1

property path_name

Name of the path to save the FEA model

Type:

str

property FEA_dict_enforced

To enforce user-defined values for FEA main parameters

Type:

dict

property is_get_mesh

To save FEA mesh for latter post-procesing (only possible with is_save_FEA set to True)

Type:

bool

property is_save_FEA

To save FEA mesh and solution in .vtu file

Type:

bool

property transform_list

label (to select the surface), type (rotate or translate), value (alpha or delta)

Type:

list

Type:

List of dictionary to apply transformation on the machine surfaces. Key

property include_magnets

Switch to include magents in the structural simulation

Type:

bool