libs.elements package¶
Subpackages¶
- libs.elements.components package
- Submodules
- libs.elements.components.ComponentTemplate module
- libs.elements.components.Gear module
GearGear.axis_0Gear.chamfer_angleGear.chamfer_depthGear.convert_to_si()Gear.dev_tooth_numGear.diameterGear.display_teeth_angleGear.eccentricityGear.eccentricity_vector()Gear.from_dict()Gear.gui()Gear.gui_dict()Gear.lengthGear.maxhGear.mu_rGear.nGear.omegaGear.posGear.position()Gear.reset()Gear.rotate_meshGear.rotate_mesh_max_angleGear.rotation_axis()Gear.rotation_matrix()Gear.template()Gear.thetaGear.to_dict()Gear.tooth_deviationsGear.tooth_flank_angleGear.tooth_heightGear.tooth_widthGear.transformation_matrix()Gear.update()Gear.wobble_angle
- libs.elements.components.GearRack module
GearRackGearRack.chamfer_angleGearRack.chamfer_depthGearRack.convert_to_si()GearRack.dimGearRack.from_dict()GearRack.gui()GearRack.gui_dict()GearRack.maxhGearRack.mu_rGearRack.posGearRack.position()GearRack.reset()GearRack.rotGearRack.template()GearRack.to_dict()GearRack.tooth_flank_angleGearRack.tooth_heightGearRack.tooth_pitchGearRack.tooth_widthGearRack.transformation_matrix()GearRack.update()GearRack.velocity
- libs.elements.components.Shaft module
- Module contents
- libs.elements.magnets package
- Submodules
- libs.elements.magnets.CuboidMagnet module
CuboidMagnetCuboidMagnet.convert_to_si()CuboidMagnet.dimCuboidMagnet.directionCuboidMagnet.from_dict()CuboidMagnet.get_transformation_matrix()CuboidMagnet.gui()CuboidMagnet.gui_dict()CuboidMagnet.m_vecCuboidMagnet.reset()CuboidMagnet.rotCuboidMagnet.template()CuboidMagnet.to_dict()CuboidMagnet.transformation_matrix
- libs.elements.magnets.MagnetTemplate module
- libs.elements.magnets.RodMagnet module
- libs.elements.magnets.UniField module
- Module contents
- libs.elements.sensors package
- Submodules
- libs.elements.sensors.FieldRecorder module
FieldRecorderFieldRecorder.boundariesFieldRecorder.convert_to_si()FieldRecorder.fieldFieldRecorder.field_specifierFieldRecorder.from_dict()FieldRecorder.get_data()FieldRecorder.gui()FieldRecorder.gui_dict()FieldRecorder.maxhFieldRecorder.reset()FieldRecorder.samplesFieldRecorder.set_data()FieldRecorder.template()FieldRecorder.to_dict()
- libs.elements.sensors.GMRSensor module
GMRSensorGMRSensor.architecturesGMRSensor.convert_to_si()GMRSensor.depthGMRSensor.dimGMRSensor.from_dict()GMRSensor.get_data()GMRSensor.get_gmr_h_values()GMRSensor.get_gmr_position_matrix()GMRSensor.get_gmr_resistances()GMRSensor.get_gmr_sampling_matrix()GMRSensor.get_sensor_sampling_matrix()GMRSensor.get_transformation_matrix()GMRSensor.get_u_cos()GMRSensor.get_u_sin()GMRSensor.gmr_lengthGMRSensor.gmr_offsetGMRSensor.gmr_position_matrixGMRSensor.gmr_samplingGMRSensor.gui()GMRSensor.gui_dict()GMRSensor.h_sensorGMRSensor.heightGMRSensor.maxhGMRSensor.posGMRSensor.reset()GMRSensor.resistanceGMRSensor.rotGMRSensor.sensor_samplingGMRSensor.sensor_sampling_matrixGMRSensor.set_data()GMRSensor.template()GMRSensor.to_dict()GMRSensor.transformation_matrixGMRSensor.u_cosGMRSensor.u_sinGMRSensor.update()GMRSensor.width
GMRSensorProperties
- libs.elements.sensors.HallSensor module
- libs.elements.sensors.SensorTemplate module
- Module contents
Submodules¶
libs.elements.Component module¶
- class libs.elements.Component.Component(pos: ndarray, mu_r: float, maxh: float)¶
Bases:
objectParent class contains the parameters to describe the position and magnetic properties of a component in the simulation. The shape and rotation is defined in one of the subclasses.
- Parameters:
pos (numpy.ndarray) – Position of the magnet in the 3D space.
mu_r (float) – Permeability of the magnet.
maxh (float) – Maximum mesh size of the component.
- abstract convert_to_si() None¶
Calls the init method and converts the parameters from gui units to SI units.
- abstract classmethod from_dict(dictionary: Dict[any]) Component¶
- Method to init an instance of the Component class by passing a dictionary with the corresponding
arguments.
- Returns:
Instance of the Component class.
- Return type:
- abstract gui() Component¶
Returns a copy of the class with attributes converted to units used in the gui.
- abstract gui_dict() Dict[str, any]¶
Method creates a dictionary of the class members that will be stored in the ini file. Variables not passed to the init method are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.
- Returns:
The dictionary of the classes members.
- Return type:
Dict[str, any]
- maxh: float¶
- mu_r: float¶
- pos: ndarray¶
- abstract reset() None¶
Calls the init method with the actual class attributes.
- abstract classmethod template() Component¶
Class method to init the class with a set of standard values.
- Returns:
Object of the Component class.
- Return type:
- abstract to_dict() Dict[str, any]¶
- Method creates a dictionary of the class members that will be stored in the HDF5 file. Variables created
automatically when instantiating an object of the class are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.
- Returns:
The dictionary of the classes members.
- Return type:
Dict[str, any]
- abstract update(t: float) None¶
Method to update the states of a time dependent component.
- Parameters:
t (float) – Current time stamp.
libs.elements.Magnet module¶
- class libs.elements.Magnet.Magnet(pos: ndarray, m: float, mu_r: float, temperature: float, tk: float, maxh: float)¶
Bases:
objectParent class contains the parameters to describe the position and magnetic properties of a magnet in the simulation. The shape and rotation is defined in one of the subclasses.
- Parameters:
pos (numpy.ndarray) – Position of the magnet in the 3D space.
m (float) – Magnetisation of the magnet at room temperature.
mu_r (float) – Permeability of the magnet.
temperature (float) – Temperature at which the magnet is operated.
tk (float) – Temperature coefficiency of the magnetisation in the area of 20-100°C.
maxh (float) – Maximum mesh size of the magnet.
- abstract convert_to_si() None¶
Calls the init method and converts the parameters from gui units to SI units.
- abstract classmethod from_dict(dictionary: Dict[any]) Magnet¶
- Method to init an instance of the Magnet class by passing a dictionary with the corresponding
arguments.
- Returns:
Instance of the Magnet class.
- Return type:
- abstract gui() Magnet¶
Returns a copy of the class with attributes converted to units used in the gui.
- abstract gui_dict() Dict[str, any]¶
Method creates a dictionary of the class members that will be stored in the ini file. Variables not passed to the init method are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.
- Returns:
The dictionary of the classes members.
- Return type:
Dict[str, any]
- m: float¶
- maxh: float¶
- mu_r: float¶
- pos: ndarray¶
- abstract reset() None¶
Calls the init method with the actual class attributes.
- temperature: float¶
- abstract classmethod template() Magnet¶
Class method to init the class with a set of standard values.
- Returns:
Object of the Magnet class.
- Return type:
- tk: float¶
- abstract to_dict() Dict[str, any]¶
- Method creates a dictionary of the class members that will be stored in the HDF5 file. Variables created
automatically when instantiating an object of the class are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.
- Returns:
The dictionary of the classes members.
- Return type:
Dict[str, any]
libs.elements.Sensor module¶
- class libs.elements.Sensor.Sensor(pos: ndarray, maxh: float)¶
Bases:
objectParent class contains the parameters to describe the position and max mesh size of a sensor in the simulation. The shape and rotation is defined in one of the subclasses.
- Parameters:
pos (numpy.ndarray) – Position of the sensor in the 3D space.
maxh (float) – Maximum mesh size of the sensor.
- abstract convert_to_si() None¶
Calls the init method and converts the parameters from gui units to SI units.
- abstract classmethod from_dict(dictionary: Dict[any]) Sensor¶
- Method to init an instance of the Sensor class by passing a dictionary with the corresponding
arguments.
- Returns:
Instance of the Sensor class.
- Return type:
- abstract get_data(*args) None¶
Method to pass the measurement data saved in a dictionary to the sensor object.
- abstract gui() Sensor¶
Returns a copy of the class with attributes converted to units used in the gui.
- abstract gui_dict() Dict[str, any]¶
Method creates a dictionary of the class members that will be stored in the ini file. Variables not passed to the init method are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.
- Returns:
The dictionary of the classes members.
- Return type:
Dict[str, any]
- maxh: float¶
- pos: ndarray¶
- abstract reset() None¶
Calls the init method with the actual class attributes.
- abstract set_data(data_dict: Dict[str, List], field: MagneticField) Dict[str, List]¶
Method to update the sensor measurement parameters for the current simulation step.
- Parameters:
data_dict (Dict[str, List]) – Dictionary with the measurement data, shared between processes.
field (MagneticField) – Instance of the MagneticField class.
- abstract classmethod template() Sensor¶
Class method to init the class with a set of standard values.
- Returns:
Object of the Sensor class.
- Return type:
- abstract to_dict() Dict[str, any]¶
- Method creates a dictionary of the class members that will be stored in the HDF5 file. Variables created
automatically when instantiating an object of the class are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.
- Returns:
The dictionary of the classes members.
- Return type:
Dict[str, any]
libs.elements.SimParams module¶
- class libs.elements.SimParams.SimParams(boundaries: ndarray, t0: float, t1: float, samples: int, maxh_global: float, tol: float, maxit: int, **kwargs)¶
Bases:
objectThe parameters to specify the finite element space are summarized in this class.
- Parameters:
boundaries (numpy.ndarray) – The dimensions in mm of the 3D space containing the scenery.
t0 (float) – Start time of the simulation.
t1 (float) – End time of the simulation.
samples (int) – Number of time samples.
maxh_global (float) – The maximum mesh size of all simulation elements including the air surrounding the elements.
tol (float) – The maximum tolerated iteration error of the finite element magnetic field calculation.
maxit (int) – The maximum number of allowed iterations to calculate the magnetic field.
t (np.ndarray) – Array containing the time stamps of the simulation.
- boundaries: ndarray¶
- classmethod from_dict(dictionary: Dict[any]) SimParams¶
- Method to init an instance of the Gear class by passing a dictionary with the corresponding
arguments. Arguments that are in the dictionary and not in the class are ignored while arguments missing in the dictionary get initialised with the standard values defined in the template class method.
- Returns:
Instance of the SimParams class.
- Return type:
- gui_dict() Dict[str, any]¶
- Method creates a dictionary of the class members that will be stored in the HDF5 file. Variables created
automatically when instantiating an object of the class are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.
- Returns:
The dictionary of the classes members.
- Return type:
Dict[str, any]
- maxh_global: float¶
- maxit: int¶
- reset() None¶
Calls the init method with the actual class attributes.
- samples: int¶
- t: ndarray¶
- t0: float¶
- t1: float¶
- classmethod template()¶
- to_dict() Dict[str, any]¶
- Method creates a dictionary of the class members that will be stored in the HDF5 file. Variables created
automatically when instantiating an object of the class are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.
- Returns:
The dictionary of the classes members.
- Return type:
Dict[str, any]s
- tol: float¶