simdesign.rcmrf.bnsm.baselib.building
This module provides a base class for Building Nonlinear Structural Models (BNSM) to build and export their OpenSees representations.
- class simdesign.rcmrf.bnsm.baselib.building.BuildingBase(design, load_factors={'G': 1.0, 'Q': 0.3}, mass_factors={'G': 1.0, 'Q': 0.3}, scheme='EQL', max_drift=0.05, dincr=0.001, include_infills=True, cyclic_model=False, cracked_beam=False, cracked_column=False)[source]
Bases:
ABCAbstract Base Class for Building Nonlinear Structural Model (BNSM) implementations. It provides methods to define a BNSM in the OpenSees domain and to export equivalent Python and Tcl commands.
- Variables:
design (BuildingBase) – Instance of building design information model.
foundations (List[FoundationBase]) – List of foundation instances.
floors (List[FloorDiaphragmBase]) – List of floor instances.
floor_joints (List[FloorJointBase]) – List of floor joints instances.
stairs_joints (List[StairsJointBase]) – List of stairs joints instances.
beams (List[BeamBase]) – List of beam instances.
columns (List[ColumnBase]) – List of column instances.
infills (List[InfillBase]) – List of infill instances.
FoundationClass (type[FoundationBase]) – Foundation class used to instantiate foundation objects.
FloorClass (type[FloorDiaphragmBase]) – Floor diaphragm class used to instantiate floor objects.
FloorJointClass (type[FloorJointBase]) – Floor-joint class used to instantiate floor joint objects.
StairsJointClass (type[StairsJointBase]) – Stairs-joint class used to instantiate stairs joint objects.
BeamClass (type[BeamBase]) – Beam class used by the building factory to instantiate beam objects.
ColumnClass (type[ColumnBas]) – Column class used by the building factory to instantiate column objects.
InfillClass (type[InfillBase]) – Infill class used to instantiate infill wall objects.
load_factors (Dict[Literal['G', 'Q'], float]) – Load factors used to compute gravity loads. - ‘G’ : Permanent load factor - ‘Q’ : Variable load factor
mass_sources (Dict[Literal['G', 'Q'], float]) – Mass sources used to compute seismic masses. - ‘G’ : Permanent mass factor - ‘Q’ : Variable mass factor
basic_masses (np.ndarray) – Point masses for the basic building geometry.
scheme (Literal['FMP', 'EQL', 'MPP', 'TRI', 'UNI']) – The loading scheme considered for retriving pushover loads. - ‘FMP : Fundamental-mode proportional loading. - ‘EQL : Equivalent lateral loading. - ‘MPP : Mass proportional loading. - ‘TRI : Triangular or height propotional loading. - ‘UNI : Uniform loading.
max_drift (float) – The drift value used to calculate maximum disp. of control node.
dincr (float) – First displacement increment considered during nspa.
include_infills (bool) – Flag to check whether include infills in the frame model or not.
cyclic_model (bool) – If True, the model parameters will be adjusted for cyclic analysis.
cracked_beam (bool) – If True, the elastic beam sections uses cracked-section (effective) flexural properties. If False, gross-section properties are used.
cracked_column (bool) – If True, the elastic column sections uses cracked-section (effective) flexural properties. If False, gross-section properties are used.
- Parameters:
design (BuildingBase)
load_factors (Dict[Literal['G', 'Q'], float])
mass_factors (Dict[Literal['G', 'Q'], float])
scheme (Literal['FMP', 'EQL', 'MPP', 'TRI', 'UNI'])
max_drift (float)
dincr (float)
include_infills (bool)
cyclic_model (bool)
cracked_beam (bool)
cracked_column (bool)
- FoundationClass
alias of
FoundationBase
- FloorClass
alias of
FloorDiaphragmBase
- FloorJointClass
alias of
FloorJointBase
- StairsJointClass
alias of
StairsJointBase
- ColumnClass
alias of
ColumnBase
- InfillClass
alias of
InfillBase
- basic_masses: ndarray
- design: BuildingBase
- load_factors: Dict[Literal['G', 'Q'], float]
- mass_sources: Dict[Literal['G', 'Q'], float]
- scheme: Literal['FMP', 'EQL', 'MPP', 'TRI', 'UNI']
- max_drift: float
- dincr: float
- include_infills: bool
- cyclic_model: bool
- cracked_beam: bool
- cracked_column: bool
- foundations: List[FoundationBase]
- floors: List[FloorDiaphragmBase]
- floor_joints: List[FloorJointBase]
- stairs_joints: List[StairsJointBase]
- columns: List[ColumnBase]
- infills: List[InfillBase]
- do_modal(num_modes=3, out_dir=None, print_screen=False, normalisation=True)[source]
Performs modal analysis.
- Parameters:
num_modes (int, optional) – Number of modes for whose properties are calculated. By default 3.
out_dir (bool, optional) – Output directory to save the modal properties and eigen vectors for the floor retained nodes. If None, these are not saved. By default None.
print_screen (bool, optional) – Flag to print modal properties on the screen. By default False.
normalisation (bool, optional) – Flag to compute the modal properties by using a displacement-normalized version of the eigenvectors. By default True.
- Returns:
Dictionary containing modal properties.
- Return type:
Dict[str, List[float]]
TODO
For now print screen does not work.
- do_nspa(ctrl_dof, out_dir=None, use_recorder=False)[source]
Performs nonlinear static pushover analysis (NSPA).
- Parameters:
ctrl_dof (Literal[1, 2]) – Control degrees of freedom for loading. 1: X-direction. 2: Y-direction.
out_dir (str | Path, optional) – Directory to save outputs. If None, no output is saved. By default None.
use_recorder (bool, optional) – If True, OpenSees recorders are used. By default False.
- Returns:
ctrl_disp (List[float]) – Displacement values of control node.
base_shear (List[float]) – Base shear value obtained as sum of the reaction forces.
ok (int) – Final analysis return code.
- Return type:
Tuple[List[float], List[float]]
- to_py(directory)[source]
Exports the numerical model files in Python format.
- Parameters:
directory (Path | str) – Directory in which the files will be written.
- Return type:
None
- to_tcl(directory)[source]
Exports the numerical model files in Tcl format.
- Parameters:
directory (Path | str) – Directory in which the files will be written.
- Return type:
None
- plot_model(show_nodes='yes', line_width=3, directory=None, show=True)[source]
Plots the structural model, showing nodes and elements grouped by type (nodes, beams, columns, infills).
- Parameters:
show_nodes (Literal['no', 'yes'], optional) – A flag to control whether to display the nodes in the plot. ‘yes’ to show the nodes, ‘no’ to hide them. By default ‘yes’.
line_width (float, optional) – Specifies the line width used to draw the elements in the plot. By default 3.
directory (str | Path | None, optional) – Directory to save an image of the model. If None, the image will not be saved. By default None.
show (bool, optional) – Flag for showing the figure in an interactive window, by default True.
- Return type:
None
- plot_mode_shape(mode_number=1, scale=100, line_width=3, contour=None, directory=None, show=True)[source]
Plots the mode shape of the structure for a given mode number, scaled for visual clarity.
- Parameters:
mode_number (int, optional) – Specifies the mode number to be plotted. By default 1.
scale (float, optional) – A scaling factor to exaggerate the mode shape for better visualization. By default 100.
line_width (float, optional) – Specifies the line width used to draw the mode shape. By default 3.
contour (Literal['x', 'y', 'z'] | None, optional) – Contours of displacement in x, y, or z. By default None.
directory (str | Path | None, optional) – Directory to save an image of the model. If None, the image will not be saved. By default None.
show (bool, optional) – Flag for showing the figure in an interactive window, by default True.
- Return type:
None