# Stiffened Panel Bay (`compmech.stiffpanelbay`)

Main features:

- possibility to use many panels with different properties. In such case the panels are separated by their (circumferential) coordinate. Usually there is a stiffener positioned at the coordinate between two panels.
- possibility to use stiffeners (blade) modeled with 1D or 2D formulation.

class `compmech.stiffpanelbay.``StiffPanelBay`

  Stiffened Panel Bay

  Can be used for supersonic Aeroelastic studies with the Piston Theory.

  Stiffeners are modeled either with 1D or 2D formulations.

  Main characteristics:

  - Supports both airflows along x (axis) or y (circumferential). Controlled by the parameter `flow`
  - `bladestiff1ds` contains the `BladeStiff1D` stiffeners
  - `bladestiff2ds` contains the `BladeStiff2D` stiffeners
  - `tstiff2ds` contains the `TStiff2D` stiffeners

  Methods

  `add_bladestiff1d`(ys[, mu, bb, bstack, ...]) | Add a new BladeStiff1D to the current panel bay
  `add_bladestiff2d`(ys[, mu, bb, bstack, ...]) | Add a new BladeStiff2D to the current panel bay
  `add_panel`(y1, y2[, stack, plyts, plyt, ...]) | Add a new panel to the current panel bay
  `add_tstiff2d`(ys[, mu, bb, bstack, bplyts, ...]) | Add a new TStiff2D to the current panel bay
  `calc_cA`([silent]) |
  `calc_fext`([silent]) | Calculates the external force vector
  `calc_k0`([silent]) |
  `calc_kA`([silent]) |
  `calc_kG0`([silent, c]) |
  `calc_kM`([silent]) |
  `get_size`() | Calculate the size of the stiffness matrices
  `plot_skin`(c[, invert_y, plot_type, vec, ...]) | Contour plot for a Ritz constants vector.
  `plot_stiffener`(c, si[, region, invert_y, ...]) | Contour plot for a Ritz constants vector.
  `save`() | Save the `StiffPanelBay` object using `cPickle`
  `uvw_skin`(c[, xs, ys, gridx, gridy]) | Calculate the displacement field
  `uvw_stiffener`(c, si[, region, xs, ys, ...]) | Calculate the displacement field on a stiffener

  `add_bladestiff1d`(ys, mu=None, bb=None, bstack=None, bplyts=None, bplyt=None, blaminaprops=None, blaminaprop=None, bf=None, fstack=None, fplyts=None, fplyt=None, flaminaprops=None, flaminaprop=None, **kwargs)

    Add a new BladeStiff1D to the current panel bay

    Parameters: | ys : float Stiffener position. mu : float, optional Stiffener’s material density. If not given the bay density will be used. bb : float, optional Stiffener base width. bstack : list, optional Stacking sequence for the stiffener base laminate. bplyts : list, optional Thicknesses for each stiffener base ply. bplyt : float, optional Unique thickness for all stiffener base plies. blaminaprops : list, optional Lamina properties for each stiffener base ply. blaminaprop : float, optional Unique lamina properties for all stiffener base plies. bf : float Stiffener flange width. fstack : list, optional Stacking sequence for the stiffener flange laminate. fplyts : list, optional Thicknesses for each stiffener flange ply. fplyt : float, optional Unique thickness for all stiffener flange plies. flaminaprops : list, optional Lamina properties for each stiffener flange ply. flaminaprop : float, optional Unique lamina properties for all stiffener flange plies.
    Returns: | s : `BladeStiff1D` object

    Notes

    Additional parameters can be passed using the `kwargs`.

  `add_bladestiff2d`(ys, mu=None, bb=None, bstack=None, bplyts=None, bplyt=None, blaminaprops=None, blaminaprop=None, bf=None, fstack=None, fplyts=None, fplyt=None, flaminaprops=None, flaminaprop=None, **kwargs)

    Add a new BladeStiff2D to the current panel bay

    Parameters: | ys : float Stiffener position. mu : float, optional Stiffener’s material density. If not given the bay density will be used. bb : float, optional Stiffener base width. bstack : list, optional Stacking sequence for the stiffener base laminate. bplyts : list, optional Thicknesses for each stiffener base ply. bplyt : float, optional Unique thickness for all stiffener base plies. blaminaprops : list, optional Lamina properties for each stiffener base ply. blaminaprop : float, optional Unique lamina properties for all stiffener base plies. bf : float Stiffener flange width. fstack : list, optional Stacking sequence for the stiffener flange laminate. fplyts : list, optional Thicknesses for each stiffener flange ply. fplyt : float, optional Unique thickness for all stiffener flange plies. flaminaprops : list, optional Lamina properties for each stiffener flange ply. flaminaprop : float, optional Unique lamina properties for all stiffener flange plies.
    Returns: | s : `BladeStiff2D` object

    Notes

    Additional parameters can be passed using the `kwargs`.

  `add_panel`(y1, y2, stack=None, plyts=None, plyt=None, laminaprops=None, laminaprop=None, model=None, mu=None, **kwargs)

    Add a new panel to the current panel bay

    Parameters: | y1 : float Position of the first panel edge along . y2 : float Position of the second panel edge along . stack : list, optional Panel stacking sequence. If not given the stacking sequence of the bay will be used. plyts : list, optional Thicknesses for each panel ply. If not supplied the bay `plyts` attribute will be used. plyt : float, optional Unique thickness to be used for all panel plies. If not supplied the bay `plyt` attribute will be used. laminaprops : list, optional Lamina properties for each panel ply. laminaprop : list, optional Unique lamina properties for all panel plies. model : str, optional Not recommended to pass this parameter, but the user can use a different model for each panel. It is recommended to defined `model` for the bay object. mu : float, optional Panel material density. If not given the bay density will be used.

    Notes

    Additional parameters can be passed using the `kwargs`.

  `add_tstiff2d`(ys, mu=None, bb=None, bstack=None, bplyts=None, bplyt=None, blaminaprops=None, blaminaprop=None, bf=None, fstack=None, fplyts=None, fplyt=None, flaminaprops=None, flaminaprop=None, **kwargs)

    Add a new TStiff2D to the current panel bay

    Parameters: | ys : float Stiffener position. mu : float, optional Stiffener’s material density. If not given the bay density will be used. bb : float, optional Stiffener base width. bstack : list, optional Stacking sequence for the stiffener base laminate. bplyts : list, optional Thicknesses for each stiffener base ply. bplyt : float, optional Unique thickness for all stiffener base plies. blaminaprops : list, optional Lamina properties for each stiffener base ply. blaminaprop : float, optional Unique lamina properties for all stiffener base plies. bf : float Stiffener flange width. fstack : list, optional Stacking sequence for the stiffener flange laminate. fplyts : list, optional Thicknesses for each stiffener flange ply. fplyt : float, optional Unique thickness for all stiffener flange plies. flaminaprops : list, optional Lamina properties for each stiffener flange ply. flaminaprop : float, optional Unique lamina properties for all stiffener flange plies.
    Returns: | s : `TStiff2D` object

    Notes

    Additional parameters can be passed using the `kwargs`.

  `calc_fext`(silent=False)

    Calculates the external force vector

    Parameters: | silent : bool, optional A boolean to tell whether the msg messages should be printed.
    Returns: | fext : np.ndarray The external force vector

  `get_size`()

    Calculate the size of the stiffness matrices

    The size of the stiffness matrices can be interpreted as the number of rows or columns, recalling that this will be the size of the Ritz constants’ vector , the internal force vector and the external force vector .

    It takes into account the independent degrees of freedom from each of the objects that belong to the current assembly.

    Returns: | size : int The size of the stiffness matrices.

  `plot_skin`(c, invert_y=False, plot_type=1, vec='w', deform_u=False, deform_u_sf=100.0, filename='', ax=None, figsize=(3.5, 2.0), save=True, title='', colorbar=False, cbar_nticks=2, cbar_format=None, cbar_title='', cbar_fontsize=10, aspect='equal', clean=True, dpi=400, texts=[], xs=None, ys=None, gridx=300, gridy=300, num_levels=400, vecmin=None, vecmax=None, silent=False)

    Contour plot for a Ritz constants vector.

    Parameters: | c : np.ndarray The Ritz constants that will be used to compute the field contour. vec : str, optional Can be one of the components: Displacement: `'u'`, `'v'`, `'w'`, `'phix'`, `'phiy'` Strain: `'exx'`, `'eyy'`, `'gxy'`, `'kxx'`, `'kyy'`, `'kxy'`, `'gyz'`, `'gxz'` Stress: `'Nxx'`, `'Nyy'`, `'Nxy'`, `'Mxx'`, `'Myy'`, `'Mxy'`, `'Qy'`, `'Qx'` deform_u : bool, optional If `True` the contour plot will look deformed. deform_u_sf : float, optional The scaling factor used to deform the contour. invert_y : bool, optional Inverts the axis of the plot. It may be used to match the coordinate system of the finite element models created using the `desicos.abaqus` module. plot_type : int, optional For cylinders only `4` and `5` are valid. For cones all the following types can be used: `1`: concave up (with `invert_y=False`) (default) `2`: concave down (with `invert_y=False`) `3`: stretched closed `4`: stretched opened ( vs. ) `5`: stretched opened ( vs. ) save : bool, optional Flag telling whether the contour should be saved to an image file. dpi : int, optional Resolution of the saved file in dots per inch. filename : str, optional The file name for the generated image file. If no value is given, the parameter of the `StiffPanelBay` object will be used. ax : AxesSubplot, optional When `ax` is given, the contour plot will be created inside it. figsize : tuple, optional The figure size given by `(width, height)`. title : str, optional If any string is given it is added as title to the contour plot. colorbar : bool, optional If a colorbar should be added to the contour plot. cbar_nticks : int, optional Number of ticks added to the colorbar. cbar_format : [ None | format string | Formatter object ], optional See the `matplotlib.pyplot.colorbar` documentation. cbar_fontsize : int, optional Fontsize of the colorbar labels. cbar_title : str, optional Colorbar title. If `cbar_title == ''` no title is added. aspect : str, optional String that will be passed to the `AxesSubplot.set_aspect()` method. clean : bool, optional Clean axes ticks, grids, spines etc. xs : np.ndarray, optional The positions where to calculate the displacement field. Default is `None` and the method `_default_field` is used. ys : np.ndarray, optional The `y` positions where to calculate the displacement field. Default is `None` and the method `_default_field` is used. gridx : int, optional Number of points along the axis where to calculate the displacement field. gridy : int, optional Number of points along the where to calculate the displacement field. num_levels : int, optional Number of contour levels (higher values make the contour smoother). vecmin : float, optional Minimum value for the contour scale (useful to compare with other results). If not specified it will be taken from the calculated field. vecmax : float, optional Maximum value for the contour scale. silent : bool, optional A boolean to tell whether the msg messages should be printed.
    Returns: | ax : matplotlib.axes.Axes The Matplotlib object that can be used to modify the current plot if needed.

  `plot_stiffener`(c, si, region='flange', invert_y=False, plot_type=1, vec='w', deform_u=False, deform_u_sf=100.0, filename='', ax=None, figsize=(3.5, 2.0), save=True, title='', colorbar=False, cbar_nticks=2, cbar_format=None, cbar_title='', cbar_fontsize=10, aspect='equal', clean=True, dpi=400, texts=[], xs=None, ys=None, gridx=300, gridy=300, num_levels=400, vecmin=None, vecmax=None, silent=False)

    Contour plot for a Ritz constants vector.

    Parameters: | c : np.ndarray The Ritz constants that will be used to compute the field contour. si : int Stiffener index. region : str, optional Stiffener region (‘base’, ‘flange’ etc). vec : str, optional Can be one of the components: Displacement: `'u'`, `'v'`, `'w'`, `'phix'`, `'phiy'` Strain: `'exx'`, `'eyy'`, `'gxy'`, `'kxx'`, `'kyy'`, `'kxy'`, `'gyz'`, `'gxz'` Stress: `'Nxx'`, `'Nyy'`, `'Nxy'`, `'Mxx'`, `'Myy'`, `'Mxy'`, `'Qy'`, `'Qx'` deform_u : bool, optional If `True` the contour plot will look deformed. deform_u_sf : float, optional The scaling factor used to deform the contour. invert_y : bool, optional Inverts the axis of the plot. It may be used to match the coordinate system of the finite element models created using the `desicos.abaqus` module. plot_type : int, optional For cylinders only `4` and `5` are valid. For cones all the following types can be used: `1`: concave up (with `invert_y=False`) (default) `2`: concave down (with `invert_y=False`) `3`: stretched closed `4`: stretched opened ( vs. ) `5`: stretched opened ( vs. ) save : bool, optional Flag telling whether the contour should be saved to an image file. dpi : int, optional Resolution of the saved file in dots per inch. filename : str, optional The file name for the generated image file. If no value is given, the parameter of the `StiffPanelBay` object will be used. ax : AxesSubplot, optional When `ax` is given, the contour plot will be created inside it. figsize : tuple, optional The figure size given by `(width, height)`. title : str, optional If any string is given it is added as title to the contour plot. colorbar : bool, optional If a colorbar should be added to the contour plot. cbar_nticks : int, optional Number of ticks added to the colorbar. cbar_format : [ None | format string | Formatter object ], optional See the `matplotlib.pyplot.colorbar` documentation. cbar_fontsize : int, optional Fontsize of the colorbar labels. cbar_title : str, optional Colorbar title. If `cbar_title == ''` no title is added. aspect : str, optional String that will be passed to the `AxesSubplot.set_aspect()` method. clean : bool, optional Clean axes ticks, grids, spines etc. xs : np.ndarray, optional The positions where to calculate the displacement field. Default is `None` and the method `_default_field` is used. ys : np.ndarray, optional The `y` positions where to calculate the displacement field. Default is `None` and the method `_default_field` is used. gridx : int, optional Number of points along the axis where to calculate the displacement field. gridy : int, optional Number of points along the where to calculate the displacement field. num_levels : int, optional Number of contour levels (higher values make the contour smoother). vecmin : float, optional Minimum value for the contour scale (useful to compare with other results). If not specified it will be taken from the calculated field. vecmax : float, optional Maximum value for the contour scale. silent : bool, optional A boolean to tell whether the msg messages should be printed.
    Returns: | ax : matplotlib.axes.Axes The Matplotlib object that can be used to modify the current plot if needed.

  `save`()

    Save the `StiffPanelBay` object using `cPickle`

    Notes

    The pickled file will have the name stored in :property:`.StiffPanelBay.name` followed by a `'.StiffPanelBay'` extension.

  `uvw_skin`(c, xs=None, ys=None, gridx=300, gridy=300)

    Calculate the displacement field

    For a given full set of Ritz constants `c`, the displacement field is calculated and stored in the parameters `u`, `v`, `w`, `phix`, `phiy` of the `StiffPanelBay` object.

    Parameters: | c : float The full set of Ritz constants xs : np.ndarray The positions where to calculate the displacement field. Default is `None` and the method `_default_field` is used. ys : np.ndarray The `y` positions where to calculate the displacement field. Default is `None` and the method `_default_field` is used. gridx : int Number of points along the axis where to calculate the displacement field. gridy : int Number of points along the where to calculate the displacement field.
    Returns: | out : tuple A tuple of `np.ndarrays` containing `(u, v, w, phix, phiy)`.

    Notes

    The returned values `u``, `v`, `w`, `phix`, `phiy` are stored as parameters with the same name in the `StiffPanelBay` object.

  `uvw_stiffener`(c, si, region='flange', xs=None, ys=None, gridx=300, gridy=300)

    Calculate the displacement field on a stiffener

    For a given full set of Ritz constants `c`, the displacement field is calculated and stored in the parameters `u`, `v`, `w`, `phix`, `phiy` of the `StiffPanelBay` object.

    Parameters: | c : float The full set of Ritz constants si : int Stiffener index. region : str, optional Stiffener region (‘base’, ‘flange’ etc). xs : np.ndarray The positions where to calculate the displacement field. Default is `None` and the method `_default_field` is used. ys : np.ndarray The `y` positions where to calculate the displacement field. Default is `None` and the method `_default_field` is used. gridx : int Number of points along the axis where to calculate the displacement field. gridy : int Number of points along the where to calculate the displacement field.
    Returns: | out : tuple A tuple of `np.ndarrays` containing `(u, v, w, phix, phiy)`.

    Notes

    The returned values `u``, `v`, `w`, `phix`, `phiy` are stored as parameters with the same name in the `StiffPanelBay` object.