pyHarm.Systems.ABCSystem

Classes

ABCSystem

This is the abstract class ruling the system class. The system is responsible for assembling the Residual and Jacobian of a list of elements.

Module Contents

class pyHarm.Systems.ABCSystem.ABCSystem(idata: dict, logger: logging.Logger | None = None)

Bases: abc.ABC

This is the abstract class ruling the system class. The system is responsible for assembling the Residual and Jacobian of a list of elements.

Parameters:

idata (dict) – A dictionary containing the system parameters, the local coordinate systems, the substructures the kinematic conditions and the connectors.

system_options

dictionary containing other options for creation of the system class.

Type:

dict

nh

number of harmonics.

Type:

int

nti

number of time steps.

Type:

int

adim

adimension the equations using the characteristic length and angular frequency.

Type:

bool

adim_options

contains the characteristic length and angular frequency.

Type:

dict

lc

characteristic length.

Type:

float

wc

characteristic angular frequency.

Type:

float

ndofs

total number of degrees of freedom.

Type:

int

LE

list of elements.

Type:

list[ABCElement]

LC

list of kinematic conditions.

Type:

lit[ABCKinematic]

LE_extforcing

list of elements of type external forcing.

Type:

list[ABCElement]

LE_linear

list of elements that are linear towards the displacement.

Type:

list[ABCElement]

LE_nonlinear_dlft

list of elements that are nonlinear while using DLFT formulation.

Type:

list[ABCElement]

LE_nonlinear_nodlft

list of elements that are nonlinear while not using DLFT formulation.

Type:

list[ABCElement]

expl_dofs

Dataframe that explicit the nature of the degrees of freedom vector.

Type:

pd.DataFrame

ndofs_solve

number of degree of freedom that are to be solved.

Type:

int

default

set of default parameters for the system class if not given in the input argument.

Type:

dict

abstract property factory_keyword
property edf
ndofs
logger: logging.Logger
LE_extforcing
LE_linear
LE_nonlinear_dlft
LE_nonlinear_nodlft
_maincarateristics(idata: dict) None

Set attributes of the system class based on the input dictionary.

Parameters:

idata (dict) – A dictionary containing the system parameters.

system_options

dictionary containing other options for creation of the system class.

Type:

dict

nh

number of harmonics.

Type:

int

nti

number of time steps.

Type:

int

adim

adimension the equations using the characteristic length and angular frequency.

Type:

bool

adim_options

contains the characteristic length and angular frequency.

Type:

dict

lc

characteristic length.

Type:

float

wc

characteristic angular frequency.

Type:

float

_complete_expl_dofs() None

Modify the explicit dof vector according to the presence of kinematic conditions or non-linear connexions on certain dofs.

expl_dofs

Dataframe that explicit the nature of the degrees of freedom vector.

Type:

pd.DataFrame

ndofs_solve

number of degree of freedom that are to be solved.

Type:

int

_buildElements(idata: dict) None

Build the elements of the system and the kinematic conditions using the factory functions.

Parameters:

idata (dict) – A dictionary containing the system parameters, the local coordinate systems, the substructures the kinematic conditions and the connectors.

LE

list of elements.

Type:

list[ABCElement]

LC

list of kinematic conditions.

Type:

lit[ABCKinematic]

_generate_system_dof_DataFrame()
_get_expl_dofs_into_solver() pandas.DataFrame

Returns the explicit dof DataFrame that has to be solved after applying the kinematic condtions.

Returns:

Cut explicit dof DataFrame to be solved.

Return type:

pd.DataFrame

_expand_q(q: numpy.ndarray) numpy.ndarray

From the reduced size displacement vector, extend it to its full size.

Parameters:

q (np.ndarray) – Reduced size displacement vector (without the kinematic conditions).

Returns:

full size displacement vector without kinematic conditions applied.

Return type:

np.ndarray

_complete_x(list_of_kine: list[pyHarm.KinematicConditions.ABCKinematic.ABCKinematic], x: numpy.ndarray, **kwargs) numpy.ndarray

Apply the list of kinematic conditions and returns a vector of displacement to add to the full size displacement vector.

Parameters:
  • list_of_kine (list[ABCKinematic]) – List of kinematic conditions to be applied.

  • x (np.ndarray) – Full size displacement vector without kinematic conditions applied.

Returns:

vector of displacement to add in order to obtain the full size displacement vector with kinematic conditions.

Return type:

np.ndarray

get_full_disp(q: numpy.ndarray) numpy.ndarray

Apply the full list of kinematic conditions and returns the displacement vector.

Parameters:

q (list[ABCKinematic]) – Reduced size displacement vector without kinematic conditions applied.

Returns:

Full size displacement vector with kinematic conditions applied.

Return type:

np.ndarray

_complete_R(list_of_kine: list[pyHarm.KinematicConditions.ABCKinematic.ABCKinematic], R, x, **kwargs) numpy.ndarray

Apply the list of kinematic conditions and returns a vector of residual to add to the full size residual vector.

Parameters:
  • list_of_kine (list[ABCKinematic]) – List of kinematic conditions to be applied.

  • R (np.ndarray) – Full size residual vector without kinematic conditions applied.

  • x (np.ndarray) – Full size displacement vector without kinematic conditions applied.

Returns:

vector of residuals to add in order to obtain the full size residual vector with kinematic conditions.

Return type:

np.ndarray

_complete_J(list_of_kine: list[pyHarm.KinematicConditions.ABCKinematic.ABCKinematic], Jx, Jom, x, **kwargs) tuple[numpy.ndarray]

Apply the list of kinematic conditions and returns a jacobian matrices to add to the full size jacobian matrices.

Parameters:
  • list_of_kine (list[ABCKinematic]) – List of kinematic conditions to be applied.

  • Jx (np.ndarray) – Full size jacobian matrix with respect to displacement without kinematic conditions applied.

  • Jom (np.ndarray) – Full size jacobian matrix with respect to angular frequency without kinematic conditions applied.

  • x (np.ndarray) – Full size displacement vector without kinematic conditions applied.

Returns:

jacobian matrices to add in order to obtain the full size jacobian matrix with kinematic condtions.

Return type:

tuple(np.ndarray)

__post_init__() None

Method that can be complete in subclasses in order to facilitate a add during the instanciation of a class.

_residual(list_of_elems: list[pyHarm.Elements.ABCElement.ABCElement], x, **kwargs) numpy.ndarray

Compute the residual of a list of elements and add them in a full size residual vector.

Parameters:
  • list_of_elems (list[ABCElement]) – List of elements with a residual contribution.

  • x (np.ndarray) – Full size displacement vector.

Returns:

residual vector computed at point x for the list of elements.

Return type:

np.ndarray

_jacobian(list_of_elems: list[pyHarm.Elements.ABCElement.ABCElement], x, **kwargs) tuple[numpy.ndarray]

Compute the jacobian matrices of a list of elements and add them in a full size residual vector.

Parameters:
  • list_of_elems (list[ABCElement]) – List of elements with a residual contribution.

  • x (np.ndarray) – Full size displacement vector.

Returns:

jacobian matrices computed at point x for the list of elements.

Return type:

tuple(np.ndarray)

_get_assembled_mass_matrix(x, **kwargs)

Compute the mass matrix of the assembled system

Parameters:

x (np.ndarray) – Full size displacement vector.

Returns:

full mass matrix of the system

Return type:

M_assembled (np.ndarray)

_get_assembled_stiffness_matrix(x, **kwargs)

Compute the stiffness matrix of the assembled system

Parameters:

x (np.ndarray) – Full size displacement vector.

Returns:

full stiffness matrix of the system

Return type:

K_assembled (np.ndarray)

abstractmethod Residual() numpy.ndarray

Abstract method that is completed in each subclass and responsible to compute the residual vector of the whole system.

abstractmethod Jacobian() tuple[numpy.ndarray]

Abstract method that is completed in each subclass and responsible to compute the jacobian matrices of the whole system.

export(export_path: str, prefix: str, **kwargs) None