pyHarm.Reductors.LocalHarmonicReductor

Classes

LocalHarmonicReductor

The local harmonic reductor is a reductor (inheriting from the global Harmonic reductor) aiming at reducing the number of harmonics considered in the problem while solving.

Module Contents

class pyHarm.Reductors.LocalHarmonicReductor.LocalHarmonicReductor(data: dict, expl_dofs: pandas.DataFrame, *args)

Bases: pyHarm.Reductors.FactoryReductors.GlobalHarmonicReductor

The local harmonic reductor is a reductor (inheriting from the global Harmonic reductor) aiming at reducing the number of harmonics considered in the problem while solving.

Hence in linear situation, it is expected that the problem is gonna be reduced solely to the harmonics being involved in the forcing. The reduction method is based on Gastaldi et al. proposal in :

  • A method to solve the efficiency-accuracy trade-off of multi-harmonic balance calculation of structures with friction contacts.

This Reductor is local in the sense that it keeps only the higher harmonic numbers for the needed dofs

Attributes :

factory_keyword (str): name to use as input when willing to create an instance of this object. default (dict): dictionary of default reducer options. max_nh (int): maximum number of harmonics. data (dict): dictionary of input + missing parameters from default dictionary. tot_dofs (int): total number of dofs. disp_cut_off (float): displacement cut off parameter used to put compute the criterion err_admissible (float): admissible error commited on the representation of the input displacement using limited amount of harmonics h_always_kept (np.ndarray): harmonic numbers that shall be kept in any condition verbose (bool): parameter to display info at each update of the number of harmonics tol_update (float): tolerance over the jacobian that tells if an update of the number of harmonics might be necessary

factory_keyword: str = 'localHarmonic'

keyword that is used to call the creation of this class in the factory.

Type:

str

__post_init__(*args)

A post init method to be customized if needed when building new class.

update_reductor(xpred, J_f, expl_dofs, *args)

Updates the number of harmonics to be solved.

The update is made according to Gastaldi et al. paper named : - A method to solve the efficiency-accuracy trade-off of multi-harmonic balance calculation of structures with friction contacts (2017) A tolerance on the change of the Jacobian has been added in order to avoid costly update if the Jacobian remains identical to previous update.

Parameters:
  • xpred (np.ndarray) – point predicted as the new starting point for the next iteration of the analysis process.

  • J_f (np.ndarray) – full jacobian with respect to displacement and angular frequency (contains the correction equation residual).

phi

Updated transformation matrix generated depending on the number of harmonics to keep.

Type:

np.ndarray

Returns:

same displacement vector given in input after passing through the reductor np.ndarray: same jacobian matrix given in input after passing through the reductor pd.DataFrame: same explicit dof DataFrame after passing through the reductor

Return type:

np.ndarray

build_phi(nh_kept, local=False)

Creates the masking phi matrix based on the harmonic numbers that are to be kept.

Parameters:

nh_kept (np.ndarray) – Harmonic numbers to keep in the reduced vector.

phi

Updated transformation matrix.

Type:

np.nd.array

_harmonic_selection(criterion)

” Based on the criterion values and the harmonics that are set to be kept all the time, creates the array with all the harmonics to keep in the calculation for each dof.

Parameters:

criterion (np.ndarray[bool]) – array of booleans that indicates if the criterion is verified.

Returns:

array of harmonic numbers to keep.

Return type:

np.ndarray

_get_output_expl_dofs()

Obtains the modified explicit dof DataFrame after passing through the reducer.

Returns:

Modified explicit dof DataFrame after passing through the reducer.

Return type:

np.ndarray