pyHarm.BaseUtilFuncs

This file contains a set of general useful functions that are in use in most of pyHarm modules.

pyHarm.BaseUtilFuncs.Dico_ABCClass_factory_keyword

Dictionary linking the abstract classes defined in every available subpackages and their factory dictionary.

Type:

dict

Attributes

Dico_ABCClass_factory_keyword

Dictionary linking the abstract classes defined in every available subpackages and their factory dictionary.

_plugable_types

Functions

getCustomOptionDictionary(custom_options, default_options)

Given a custom option dictionary and a default option dictionary,

getIndexfromExpldofs(expl_dofs, list_of_caracteristics)

Uses an explicit dof vector and returns an array of indices corresponding to the required dofs.

pyHarm_plugin(cls)

Plugin function for the pyHarm module. Allows registering a class in the pyHarm factories.

Module Contents

pyHarm.BaseUtilFuncs.getCustomOptionDictionary(custom_options: dict, default_options: dict)

Given a custom option dictionary and a default option dictionary, returns a new dictionary containing all the custom information along with the missing mandatory ones from the default dictionary.

Parameters:
  • custom_options (dict) – A dictionary containing custom options.

  • default_options (dict) – A dictionary containing default options.

Returns:

A new dictionary combining the custom options with the default options.

Return type:

dict

pyHarm.BaseUtilFuncs.getIndexfromExpldofs(expl_dofs: pandas.DataFrame, list_of_caracteristics: list[tuple[str, int, list[int]]])

Uses an explicit dof vector and returns an array of indices corresponding to the required dofs. Takes a list of tuples [(substructure_name[str], node_number[int], dir_num[list[int]]), …]. If None is given as input for the directions, then all the dofs from the node are returned.

Parameters:
  • expl_dofs (pd.DataFrame) – A DataFrame representing the explicit representation of the degree of freedom vector.

  • list_of_caracteristics (list[tuple[str,int,list[int]]]) – A list of tuples specifying the substructure name, node number, and direction numbers.

Returns:

An array of indices corresponding to the required dofs, sorted in ascending order.

Return type:

np.ndarray

pyHarm.BaseUtilFuncs.Dico_ABCClass_factory_keyword

Dictionary linking the abstract classes defined in every available subpackages and their factory dictionary.

Type:

dict

pyHarm.BaseUtilFuncs._plugable_types
pyHarm.BaseUtilFuncs.pyHarm_plugin(cls: _plugable_types)

Plugin function for the pyHarm module. Allows registering a class in the pyHarm factories.

Parameters:

cls – A class to be registered in one of the pyHarm factories.