pyHarm ====== .. py:module:: pyHarm .. autoapi-nested-parse:: The pyHarm package is the core of pyHarm. It contains every modules and subpackages for pyHarm to be runnning an analysis. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/pyHarm/Analysis/index /autoapi/pyHarm/BaseUtilFuncs/index /autoapi/pyHarm/CoordinateSystem/index /autoapi/pyHarm/Correctors/index /autoapi/pyHarm/DynamicOperator/index /autoapi/pyHarm/Elements/index /autoapi/pyHarm/KinematicConditions/index /autoapi/pyHarm/Maestro/index /autoapi/pyHarm/NonLinearSolver/index /autoapi/pyHarm/Predictors/index /autoapi/pyHarm/Reductors/index /autoapi/pyHarm/Solver/index /autoapi/pyHarm/StepSizeRules/index /autoapi/pyHarm/StopCriterion/index /autoapi/pyHarm/Substructures/index /autoapi/pyHarm/Systems/index /autoapi/pyHarm/__version__/index Attributes ---------- .. autoapisummary:: pyHarm.__version__ pyHarm.NonLinearStudy_kind pyHarm.Corrector_dico pyHarm.ElementDictionary pyHarm.Predictor_dico pyHarm.Reductor_dico pyHarm.StepSizer_dico pyHarm.Stopper_dico pyHarm.System_dico pyHarm.Kinematic_dico pyHarm.Solver_dico pyHarm.SubstructureDico pyHarm.SubstructureReaderDictionary pyHarm.Dico_ABCClass_factory_keyword Classes ------- .. autoapisummary:: pyHarm.ABCAnalysis pyHarm.ABCCorrector pyHarm.ABCElement pyHarm.ABCPredictor pyHarm.ABCReductor pyHarm.ABCStepSizeRule pyHarm.ABCStopCriterion pyHarm.ABCSystem pyHarm.ABCKinematic pyHarm.ABCNLSolver pyHarm.ABCSubstructure pyHarm.ABCReader pyHarm.Maestro Functions --------- .. autoapisummary:: pyHarm.getCustomOptionDictionary pyHarm.getIndexfromExpldofs pyHarm.pyHarm_plugin Package Contents ---------------- .. py:data:: __version__ :value: '1.0.1' .. py:function:: 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. :param custom_options: A dictionary containing custom options. :type custom_options: dict :param default_options: A dictionary containing default options. :type default_options: dict :returns: A new dictionary combining the custom options with the default options. :rtype: dict .. py:function:: 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. :param expl_dofs: A DataFrame representing the explicit representation of the degree of freedom vector. :type expl_dofs: pd.DataFrame :param list_of_caracteristics: A list of tuples specifying the substructure name, node number, and direction numbers. :type list_of_caracteristics: list[tuple[str,int,list[int]]] :returns: An array of indices corresponding to the required dofs, sorted in ascending order. :rtype: np.ndarray .. py:class:: ABCAnalysis(inputData: dict, System: pyHarm.Systems.ABCSystem.ABCSystem, ndofs: int, **kwargs) Bases: :py:obj:`abc.ABC` This is the abstract class ruling the solver class. The system is responsible of solving the system starting at a given starting point. .. py:property:: factory_keyword :abstractmethod: Class name for factory call during instantiation .. py:method:: initialise(**kwargs) :abstractmethod: Initialise step of the analysis. .. py:method:: Solve(**kwargs) :abstractmethod: Solving step of the analysis. .. py:method:: makeStep(**kwargs) :abstractmethod: Make a whole step of the analysis. .. py:data:: NonLinearStudy_kind Dictionary containing ABCAnalysis subclasses as values and their factory_keyword attribute as key. :type: dict[str, ABCAnalysis] .. py:class:: ABCCorrector(**kwargs) Bases: :py:obj:`abc.ABC` This is the abstract class ruling the corrector class. The system is responsible for adding the correction residual equation to the augmented system. .. py:property:: factory_keyword :type: str :abstractmethod: name of the class to call in the factory in order to create an instance of the class. :type: str .. py:method:: ClosureEquation(solx: numpy.ndarray, sol: pyHarm.Solver.SystemSolution, sollist: list[pyHarm.Solver.SystemSolution]) -> numpy.ndarray :abstractmethod: Computes the residual contribution of the correction equation. :param solx: actual displacement vector. :type solx: np.ndarray :param sol: actual SystemSolution that contains the starting point. :type sol: SystemSolution :param sollist: list of SystemSolutions from previous analysis steps. :type sollist: list[SystemSolution] .. py:method:: ClosureJacobian(solx: numpy.ndarray, sol: pyHarm.Solver.SystemSolution, sollist: list[pyHarm.Solver.SystemSolution]) -> tuple[numpy.ndarray, numpy.ndarray] :abstractmethod: Computes the jacobian contribution of the correction equation. :param solx: actual displacement vector. :type solx: np.ndarray :param sol: actual SystemSolution that contains the starting point. :type sol: SystemSolution :param sollist: list of SystemSolutions from previous analysis steps. :type sollist: list[SystemSolution] .. py:data:: Corrector_dico Dictionary containing the ABCCorrector subclasses as values and their factory_keyword as key. :type: dict[str, ABCCorrector] .. py:class:: ABCElement(nh: int, nti: int, name: str, data: dict, CS: pyHarm.CoordinateSystem.CoordinateSystem) Bases: :py:obj:`abc.ABC` This is the abstract class ruling the element class. An element consists in an elementary contribution to the residual equations. :param nh: number of harmonics. :type nh: int :param nti: number of time steps. :type nti: int :param name: name given to the kinematic condition. :type name: str :param data: dictionary containing all the definition information of the kinematic condition. :type data: dict :param CS: local or global coordinate system the kinematic condition is defined on. :type CS: CoordinateSystem .. attribute:: flag_nonlinear if True, the element is nonlinear. :type: bool .. attribute:: flag_AFT if True, the element requires an alternating frequency/time domain procedure for computing residuals. :type: bool .. attribute:: flag_extforcing if True, the element is an external forcing. :type: bool .. attribute:: flag_DLFT if True, the element uses the dynamic Lagrangian method for computing the residuals. :type: bool .. attribute:: flag_adim if True, the element is adimentioned. :type: bool .. attribute:: nh number of harmonics. :type: int .. attribute:: nti number of time steps. :type: int .. attribute:: D Dynamic operators containing inverse discrete Fourier transform and discrete Fourier transform. :type: dict[np.ndarray,np.ndarray] .. attribute:: nabla Derivation operator. :type: np.ndarray .. py:property:: factory_keyword :abstractmethod: .. py:method:: __init_flags__() .. py:method:: __init_harmonic_operators__(nh, nti) .. py:method:: __repr__() .. py:method:: __post_init__(*args) .. py:method:: __flag_update__(*args) .. py:method:: __init_data__(name, data, CS) :abstractmethod: .. py:method:: __str__() :abstractmethod: .. py:method:: generateIndices(expl_dofs: pandas.DataFrame) :abstractmethod: .. py:method:: adim(lc, wc) :abstractmethod: Modifies the element properties according to the characteristic length and angular frequency. :param lc: characteristic length value. :type lc: float :param wc: characteristic angular frequency value. :type wc: float .. py:method:: evalResidual(x, om) :abstractmethod: Computes the residual. :param x: full displacement vector. :type x: np.ndarray :param om: angular frequency value. :type om: float .. py:method:: evalJacobian(x, om) :abstractmethod: Computes the jacobians. :param x: full displacement vector. :type x: np.ndarray :param om: angular frequency value. :type om: float .. py:data:: ElementDictionary Dictionary of available ABCElement as values and their factory_keyword as key. :type: dict[str, ABCElement] .. py:class:: ABCPredictor(sign_ds, **kwargs) Bases: :py:obj:`abc.ABC` Abstract class for the predictor: Any added predictor shall be constructed from this class. :param sign_ds: if -1 predict in the direction of decreasing angular frequency, if 1 the opposite direction :type sign_ds: float .. attribute:: flag_print information are printed during the analysis if True. :type: bool .. attribute:: predictor_options dictionary containing the kwargs and competed using the default options if the keywords are missing. :type: dict .. py:property:: factory_keyword :type: str :abstractmethod: Returns: str: keyword that is used to call the creation of this class in the system factory. .. py:attribute:: default_options set of default parameters for the system class if not given in the input argument. It contains a normalisation parameter using the keyword 'norm' that can be set to either 'norm1' (default) if the direction is normed to 1 or 'om' if the direction is normed to 1 only for the angular frequency. It contains a bifurcation detection using the 'bifurcation_detect' keyword that can be set to True (default) if detection is needed. It contains a 'verbose' keyword that can be set to True (default) if information about detection of bifurcations is to be displayed during solving. :type: dict .. py:attribute:: sign_ds_init .. py:attribute:: sign_ds .. py:attribute:: predictor_options .. py:attribute:: flag_print .. py:method:: predict(sollist: list[pyHarm.Solver.SystemSolution], ds: float) -> tuple[numpy.ndarray, pyHarm.Solver.SystemSolution, float] :abstractmethod: Predicts the next strating point. :param sollist: list of SystemSolution already solved during the analysis. :type sollist: list[SystemSolution] :param ds: step size for the prediction. :type ds: float .. py:method:: bifurcation_detect(lstpt: pyHarm.Solver.SystemSolution) Makes a bifurcation detection analysis computing determinant of jacobian matrix and analysing change of sign. :param lstpt: previously accepted point in direct link with the actual solved point. :type lstpt: SystemSolution .. attribute:: sign_ds Attribute is modified if a turning point is detected. :type: float .. py:method:: getPointerToSolution(sollist: list[pyHarm.Solver.SystemSolution], k_imposed=None) -> pyHarm.Solver.SystemSolution Gets the last accepted solution in direct link with the studied point. :param sollist: list of SystemSolution already solved during the analysis. :type sollist: list[SystemSolution] :param k_imposed: if not None then the provided index is used as the last accepted point. :type k_imposed: None|int :returns: last accepted point. :rtype: SystemSolution .. py:method:: norm_dir(dir: float) -> float Normalises the direction according to the choice of norm given in the class attributes. :param dir: prediction direction. :type dir: np.ndarray :returns: normalized prediction direction. :rtype: np.ndarray .. py:data:: Predictor_dico Dictionary that contains ABCPredictor objects as values and their factory_keyword attribute as their key. :type: dict .. py:class:: ABCReductor(data: dict, expl_dofs: pandas.DataFrame, *args) Bases: :py:obj:`abc.ABC` This is the abstract class ruling the reducers class. The reducer is responsible for reducing the size of the system to be solved based on different hypotheses. :param data: A dictionary containing the reducers parameters. :type data: dict :param expl_dofs: DataFrame describing the positioning of dofs. It is generated by ABCSystem objects. :type expl_dofs: pd.DataFrame .. attribute:: expl_dofs DataFrame describing the positioning of dofs. It is generated by ABCSystem objects. :type: pd.DataFrame .. py:property:: factory_keyword :type: str :abstractmethod: Returns: str: keyword that is used to call the creation of this class in the system factory. .. py:attribute:: data .. py:attribute:: expl_dofs .. py:method:: __post_init__(*args) A post init method to be customized if needed when building new class. .. py:method:: output_expl_dofs() -> pandas.DataFrame Returns the explicit dof list after transformation by the reducer. :returns: reduced explicit dof DataFrame after passing through the reducer. :rtype: pd.DataFrame .. py:method:: reduce_vectorx(q: numpy.ndarray) -> numpy.ndarray Applies the reduce_vector method to the input vector of displacement. :param q: vector of displacement of full size. :type q: np.ndarray :returns: reduced vector of displacement. :rtype: np.ndarray .. py:method:: update_reductor(*args) -> None :abstractmethod: Using the given parameters, performs an update of the reductor and generates its new transformation matrix .. py:method:: expand(q: numpy.ndarray) -> numpy.ndarray :abstractmethod: From reduced vector, performs the inverse transformation to retrieve the original vector. :param q: reduced vector of displacement :type q: np.ndarray :returns: full size vector of displacement. :rtype: np.ndarray .. py:method:: reduce_vector(x: numpy.ndarray) -> numpy.ndarray :abstractmethod: From original vector, performs the transformation to get the reduced vector. :param x: full size vector. :type x: np.ndarray :returns: reduced vector. :rtype: np.ndarray .. py:method:: reduce_matrix(dJdx: numpy.ndarray) -> numpy.ndarray :abstractmethod: From original matrix, perform the transformation to get the reduced matrix. :param dJdx: full size jacobian matrix with respect to displacement. :type dJdx: np.ndarray :returns: reduced size jacobian matrix with respect to displacement. :rtype: np.ndarray .. py:data:: Reductor_dico Dictionary containing availabe ABCReductors as values and their factoryu keyword as key. :type: dict .. py:class:: ABCStepSizeRule(bounds: list[float, float], **kwargs) Bases: :py:obj:`abc.ABC` This is the abstract class ruling the stepsize rules class. The step size rules are responsible for adjusting the step size of the analysis depending on the given inputs. :param bounds: List containing the step size bounds [min_step, max_step]. :type bounds: list[float,float] .. attribute:: ds_min min step size. :type: float .. attribute:: ds_max max step size. :type: float .. py:property:: factory_keyword :type: str :abstractmethod: Returns: str: keyword that is used to call the creation of this class in the system factory. .. py:attribute:: ds_min .. py:attribute:: ds_max .. py:method:: getStepSize(ds: float, sollist: list[pyHarm.Solver.SystemSolution], **kwargs) -> float :abstractmethod: Returns the step size to be used for the prediction step of the analysis. .. py:method:: ProjectInBounds(ds: float) -> float Projects the step-size onto the bounds if the step-size is out of the required bounds. :param ds: step-size. :type ds: float :returns: step-size projected onto the bounds if it is out of the bounds. :rtype: float .. py:data:: StepSizer_dico Dictionary containing the factory keywords and their associated class of ABCStepSizeRule objects. :type: dict .. py:class:: ABCStopCriterion(bounds: list[float, float], ds_min: float, **kwargs) Bases: :py:obj:`abc.ABC` Abstract class for the stopping criterion. Any stopping criterion code shall inherit from this class. :param bounds: A list of upper and lower bounds. :type bounds: list[float, float] :param ds_min: The minimum step size. :param \*\*kwargs: Additional keyword arguments. :raises NotImplementedError: If the subclass lacks the factory_keyword class attribute. :raises TypeError: If the factory_keyword is not a string value. .. py:property:: factory_keyword :type: str :abstractmethod: Returns: str: keyword that is used to call the creation of this class in the system factory. .. py:attribute:: puls_inf .. py:attribute:: puls_sup .. py:attribute:: epsilon_bounds .. py:attribute:: bound_inf .. py:attribute:: bound_sup .. py:attribute:: ds_min .. py:method:: getStopCriterionStatus(sol: pyHarm.Solver.SystemSolution, sollist: list, **kwargs) -> bool :abstractmethod: Abstract method to get the stop criterion status. :param sol: A SystemSolution object. :type sol: SystemSolution :param sollist: A list of solutions. :type sollist: list :param \*\*kwargs: Additional keyword arguments. :raises None.: .. py:data:: Stopper_dico Dictionary containing all the StopCriterions available. :type: dict[str,ABCStopCriterion] .. py:class:: ABCSystem(idata: dict) Bases: :py:obj:`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. :param idata: A dictionary containing the system parameters, the local coordinate systems, the substructures the kinematic conditions and the connectors. :type idata: dict .. attribute:: system_options dictionary containing other options for creation of the system class. :type: dict .. attribute:: nh number of harmonics. :type: int .. attribute:: nti number of time steps. :type: int .. attribute:: adim adimension the equations using the characteristic length and angular frequency. :type: bool .. attribute:: adim_options contains the characteristic length and angular frequency. :type: dict .. attribute:: lc characteristic length. :type: float .. attribute:: wc characteristic angular frequency. :type: float .. attribute:: ndofs total number of degrees of freedom. :type: int .. attribute:: LE list of elements. :type: list[ABCElement] .. attribute:: LC list of kinematic conditions. :type: lit[ABCKinematic] .. attribute:: LE_extforcing list of elements of type external forcing. :type: list[ABCElement] .. attribute:: LE_linear list of elements that are linear towards the displacement. :type: list[ABCElement] .. attribute:: LE_nonlinear_dlft list of elements that are nonlinear while using DLFT formulation. :type: list[ABCElement] .. attribute:: LE_nonlinear_nodlft list of elements that are nonlinear while not using DLFT formulation. :type: list[ABCElement] .. attribute:: expl_dofs Dataframe that explicit the nature of the degrees of freedom vector. :type: pd.DataFrame .. attribute:: ndofs_solve number of degree of freedom that are to be solved. :type: int .. py:attribute:: default set of default parameters for the system class if not given in the input argument. :type: dict .. py:property:: factory_keyword :abstractmethod: .. py:attribute:: ndofs .. py:attribute:: LE_extforcing .. py:attribute:: LE_linear .. py:attribute:: LE_nonlinear_dlft .. py:attribute:: LE_nonlinear_nodlft .. py:method:: _maincarateristics(idata: dict) -> None Set attributes of the system class based on the input dictionary. :param idata: A dictionary containing the system parameters. :type idata: dict .. attribute:: system_options dictionary containing other options for creation of the system class. :type: dict .. attribute:: nh number of harmonics. :type: int .. attribute:: nti number of time steps. :type: int .. attribute:: adim adimension the equations using the characteristic length and angular frequency. :type: bool .. attribute:: adim_options contains the characteristic length and angular frequency. :type: dict .. attribute:: lc characteristic length. :type: float .. attribute:: wc characteristic angular frequency. :type: float .. py:method:: _complete_expl_dofs() -> None Modify the explicit dof vector according to the presence of kinematic conditions or non-linear connexions on certain dofs. .. attribute:: expl_dofs Dataframe that explicit the nature of the degrees of freedom vector. :type: pd.DataFrame .. attribute:: ndofs_solve number of degree of freedom that are to be solved. :type: int .. py:method:: _buildElements(idata: dict) -> None Build the elements of the system and the kinematic conditions using the factory functions. :param idata: A dictionary containing the system parameters, the local coordinate systems, the substructures the kinematic conditions and the connectors. :type idata: dict .. attribute:: LE list of elements. :type: list[ABCElement] .. attribute:: LC list of kinematic conditions. :type: lit[ABCKinematic] .. py:method:: _generate_system_dof_DataFrame() .. py:method:: _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. :rtype: pd.DataFrame .. py:method:: _expand_q(q: numpy.ndarray) -> numpy.ndarray From the reduced size displacement vector, extend it to its full size. :param q: Reduced size displacement vector (without the kinematic conditions). :type q: np.ndarray :returns: full size displacement vector without kinematic conditions applied. :rtype: np.ndarray .. py:method:: _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. :param list_of_kine: List of kinematic conditions to be applied. :type list_of_kine: list[ABCKinematic] :param x: Full size displacement vector without kinematic conditions applied. :type x: np.ndarray :returns: vector of displacement to add in order to obtain the full size displacement vector with kinematic conditions. :rtype: np.ndarray .. py:method:: get_full_disp(q: numpy.ndarray) -> numpy.ndarray Apply the full list of kinematic conditions and returns the displacement vector. :param q: Reduced size displacement vector without kinematic conditions applied. :type q: list[ABCKinematic] :returns: Full size displacement vector with kinematic conditions applied. :rtype: np.ndarray .. py:method:: _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. :param list_of_kine: List of kinematic conditions to be applied. :type list_of_kine: list[ABCKinematic] :param R: Full size residual vector without kinematic conditions applied. :type R: np.ndarray :param x: Full size displacement vector without kinematic conditions applied. :type x: np.ndarray :returns: vector of residuals to add in order to obtain the full size residual vector with kinematic conditions. :rtype: np.ndarray .. py:method:: _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. :param list_of_kine: List of kinematic conditions to be applied. :type list_of_kine: list[ABCKinematic] :param Jx: Full size jacobian matrix with respect to displacement without kinematic conditions applied. :type Jx: np.ndarray :param Jom: Full size jacobian matrix with respect to angular frequency without kinematic conditions applied. :type Jom: np.ndarray :param x: Full size displacement vector without kinematic conditions applied. :type x: np.ndarray :returns: jacobian matrices to add in order to obtain the full size jacobian matrix with kinematic condtions. :rtype: tuple(np.ndarray) .. py:method:: __post_init__() -> None Method that can be complete in subclasses in order to facilitate a add during the instanciation of a class. .. py:method:: _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. :param list_of_elems: List of elements with a residual contribution. :type list_of_elems: list[ABCElement] :param x: Full size displacement vector. :type x: np.ndarray :returns: residual vector computed at point x for the list of elements. :rtype: np.ndarray .. py:method:: _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. :param list_of_elems: List of elements with a residual contribution. :type list_of_elems: list[ABCElement] :param x: Full size displacement vector. :type x: np.ndarray :returns: jacobian matrices computed at point x for the list of elements. :rtype: tuple(np.ndarray) .. py:method:: _get_assembled_mass_matrix(x, **kwargs) Compute the mass matrix of the assembled system :param x: Full size displacement vector. :type x: np.ndarray :returns: full mass matrix of the system :rtype: M_assembled (np.ndarray) .. py:method:: _get_assembled_stiffness_matrix(x, **kwargs) Compute the stiffness matrix of the assembled system :param x: Full size displacement vector. :type x: np.ndarray :returns: full stiffness matrix of the system :rtype: K_assembled (np.ndarray) .. py:method:: Residual() -> numpy.ndarray :abstractmethod: Abstract method that is completed in each subclass and responsible to compute the residual vector of the whole system. .. py:method:: Jacobian() -> tuple[numpy.ndarray] :abstractmethod: Abstract method that is completed in each subclass and responsible to compute the jacobian matrices of the whole system. .. py:data:: System_dico Dictionary containing the available ABCSystem in pyHarm for creation as values and their factory_keyword as keys. :type: dict[str,ABCSystem] .. py:class:: ABCKinematic(nh: int, nti: int, name: str, data: dict, CS: pyHarm.CoordinateSystem.CoordinateSystem) Bases: :py:obj:`abc.ABC` This is the abstract class ruling the kinematic conditions class. The kinematic conditions are responsible to impose kinematic on dofs of the system and transfer the residuals. :param nh: number of harmonics. :type nh: int :param nti: number of time steps. :type nti: int :param name: name given to the kinematic condition. :type name: str :param data: dictionary containing all the definition information of the kinematic condition. :type data: dict :param CS: local or global coordinate system the kinematic condition is defined on. :type CS: CoordinateSystem .. attribute:: nh number of harmonics. :type: int .. attribute:: nti number of time steps. :type: int .. attribute:: D Dynamic operators containing inverse discrete Fourier transform and discrete Fourier transform. :type: dict[np.ndarray,np.ndarray] .. attribute:: nabla Derivation operator. :type: np.ndarray .. attribute:: indices index of the dofs that the kinematic conditions needs. :type: np.ndarray .. attribute:: Pdir a slice of first dimension is a transformation matrix to a direction in local coordinate system. :type: np.ndarray .. attribute:: Pslave selection array that selects the slave dofs of the kinematic condition. :type: np.ndarray .. attribute:: Pmaster selection array that selects the master dofs of the kinematic condition. :type: np.ndarray .. attribute:: subs list containing the name of the substructures that are involved. :type: list[str] .. attribute:: nbSub number of substructure involved. :type: int .. attribute:: nodes list of list of nodes the kinematic conditions act on. :type: list[list] .. attribute:: nbdofi number of nodes involved per substructure. :type: int .. py:property:: factory_keyword :abstractmethod: .. py:method:: __init_flags__() .. py:method:: __init_harmonic_operators__(nh, nti) .. py:method:: __init_data__(name, data, CS) .. py:method:: __str__() .. py:method:: __repr__() .. py:method:: __post_init__(*args) .. py:method:: __flag_update__(*args) .. py:method:: generateIndices(expl_dofs: pandas.DataFrame) From the explicit dof DataFrame, generates the index of dofs concerned by the kinematic condition. :param expl_dofs: explicit dof DataFrame from the studied system. :type expl_dofs: pd.DataFrame .. attribute:: indices index of the dofs that the kinematic conditions needs. :type: np.ndarray .. attribute:: Pdir a slice of first dimension is a transformation matrix to a direction in local coordinate system. :type: np.ndarray .. attribute:: Pslave selection array that selects the slave dofs of the kinematic condition. :type: np.ndarray .. attribute:: Pmaster selection array that selects the master dofs of the kinematic condition. :type: np.ndarray .. py:method:: _generateMatrices(sub_expl_dofs) .. py:method:: adim(lc, wc) :abstractmethod: Using adim parameters, modifies the kinematic conditions accordingly. :param lc: characteristic length. :type lc: float :param wc: characteristic angular frequency. :type wc: float .. py:method:: complete_x(x, om) :abstractmethod: Returns a vector x_add of same size of x that completes the vector of displacement x = x + x_add. :param x: displacement vector. :type x: np.ndarray :param om: angular frequency. :type om: float .. py:method:: complete_R(R, x) :abstractmethod: Returns a vector R_add of same size of R that completes the vector of residual R = R + R_add :param R: residual vector. :type R: np.ndarray :param x: displacement vector. :type x: np.ndarray .. py:method:: complete_J(Jx, Jom, x) :abstractmethod: Returns a vector Jx_add and Jom_add of same size of Jx and Jom that completes the Jacobian :param Jx: jacobian matrix with respect to displacement. :type Jx: np.ndarray :param Jom: jacobian matrix with respect to angular frequency. :type Jom: np.ndarray :param x: displacement vector. :type x: np.ndarray .. py:data:: Kinematic_dico Dictionary containing ABCKinematic as values and their factory_keyword attribute as key. :type: dict .. py:class:: ABCNLSolver(residual, jacobian, solver_options) Bases: :py:obj:`abc.ABC` This is the abstract class ruling the solver class. The system is responsible of solving the system starting at a given starting point. :param solver_options: dictionary containing other options for creation of the solver class. :type solver_options: dict :param residual: function that returns the residual vector of the system to be solved. :type residual: Callable :param jacobian: function that returns the jacobian matrix of the system to be solved. :type jacobian: Callable .. py:property:: factory_keyword :type: str :abstractmethod: keyword that is used to call the creation of this class in the system factory. .. py:attribute:: solver_options .. py:attribute:: residual .. py:attribute:: jacobian .. py:method:: __post_init__() .. py:method:: Solve(system_solution: pyHarm.Solver.SystemSolution) -> pyHarm.Solver.SystemSolution :abstractmethod: Runs the solver. :param system_solution: SystemSolution that contains the starting point. :type system_solution: SystemSolution .. py:data:: Solver_dico Dictionary containing all the available ABCNLSolvers as values, and their factory_keyword attribute as key. :type: dict .. py:data:: SubstructureDico List of available ABCSubstructure subclasses available for creation. :type: dict[str,ABCSubstructure] .. py:class:: ABCSubstructure(nh: int, name: str, data: dict) Bases: :py:obj:`abc.ABC` This class defines a substructure. Its main responsability is to create dofs and put them in an explicit pandas DataFrame. :param nh: number of harmonics. :type nh: int :param nti: number of time steps. :type nti: int :param name: name given to the kinematic condition. :type name: str :param data: dictionary containing all the definition information of the substructure. :type data: dict .. attribute:: nh number of harmonics. :type: int .. attribute:: name name of the substructure. :type: int .. attribute:: nnodes number of nodes. :type: int .. attribute:: nmodes number of modes. :type: int .. attribute:: ndofs number of dofs per node. :type: int .. attribute:: edf DataFrame describing the created dofs. :type: pd.DataFrame .. attribute:: connectors dictionary containing the added Elements to the system. :type: dict .. attribute:: kinematics dictionary containing the added Kinematic Conditions to the system. :type: dict .. py:attribute:: flag_substructure :value: True .. py:attribute:: default_data .. py:attribute:: nh .. py:attribute:: name .. py:attribute:: substructure_reader .. py:attribute:: nnodes .. py:attribute:: nmodes .. py:attribute:: ndofs .. py:attribute:: dofs_matching .. py:attribute:: total_dofs .. py:attribute:: edf .. py:attribute:: connectors .. py:attribute:: kinematics .. py:method:: __repr__() -> str .. py:property:: factory_keyword :type: str :abstractmethod: " Property defining the factory_keyword to be used for instantiation of daughter class. :returns: factory_keyword :rtype: str .. py:method:: _add_connectors() -> dict :abstractmethod: " Method that adds connectors depending on the type of substructure. .. py:method:: _add_kinematics() -> dict :abstractmethod: " Method that adds kinematic conditions depending on the type of substructure. .. py:method:: _gen_sub_col() .. py:method:: _gen_harm_col() .. py:method:: _gen_cs_col() .. py:method:: _gen_nodes_col() .. py:method:: _gen_dofs_col() .. py:method:: _gen_PoM_col() .. py:method:: _get_explicit_df() .. py:data:: SubstructureReaderDictionary Dictionary of available Substructure readers subclasses as values and their factory_keyword as key. :type: dict[str, ABCReader] .. py:class:: ABCReader Bases: :py:obj:`abc.ABC` This is the abstract class ruling the reader class for substructure. The reader is responsible for reading, parsing and completing an input dictionary from a external file to comply with pyHarm. .. py:property:: factory_keyword :abstractmethod: Factory keyword to be used when instantiating a reader .. py:method:: data_complete(data: dict) -> dict :abstractmethod: Reads and completes the input dictionary from the file. .. py:data:: Dico_ABCClass_factory_keyword Dictionary linking the abstract classes defined in every available subpackages and their factory dictionary. :type: dict .. py:function:: pyHarm_plugin(cls) Plugin function for the pyHarm module. Allows registering a class in the pyHarm factories. :param cls: A class to be registered in one of the pyHarm factories. .. py:class:: Maestro(idata: dict) Class that reads and launches the pyHarm analysis contained in the provided input file. The class is in charge of reading the input file and build the system and the analysis that are requested by the input file. The class is in charge of loading the plugins beforehand if some plugins are requested by the input file. When operated, the class runs a loop over the analysis required and solve them. :param idata: input dictionary describing all the necessary component (analysis, system composition). :type idata: dict .. py:attribute:: default .. py:attribute:: inputData .. py:attribute:: system .. py:attribute:: nls .. py:method:: operate(x0=None, **kwargs) Loops over the analysis and runs the Solve method associated with the analysis. :param x0: initial point from which running the analysis. :type x0: None | np.ndarray | str :param kwargs: additional keyword arguments. .. py:method:: getIndex(sub: str, node: int, dir_num: int) -> numpy.ndarray From a substructure name, a node number, and a direction; returns the index of the required dof into the explicit dof vector of the system. :param sub: name of the substructure. :type sub: str :param node: node number. :type node: int :param dir_num: direction number. :type dir_num: int Returns : np.ndarray : sorted array of the dof index associated with the input in the explicit dof DataFrame of the system.