Source code for viiapackage.strengthening.l3.l3g

### ===================================================================================================================
###   L3-G strengthening measure
### ===================================================================================================================
# Copyright ©VIIA 2024

### ===================================================================================================================
###   1. Import modules
### ===================================================================================================================

# General imports
from __future__ import annotations
from typing import Union, Optional, List, TYPE_CHECKING

# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.shapes import Roof, Shapes
from rhdhv_fem.grid import Level
from rhdhv_fem.groups import Layer

# References for functions and classes in the viiaPackage
from viiapackage.strengthening.helper_functions import viia_check_shape_argument, viia_add_strengthening_shape, \
    viia_check_measure_in_gmc
if TYPE_CHECKING:
    from viiapackage.viiaStatus import ViiaProject


### ===================================================================================================================
###   2. Function to create L3-G strengthening measure
### ===================================================================================================================

[docs]def viia_l3g( project: ViiaProject, variant: int, name: Union[str, Layer], material: str, geometry: str, points: List[List[Union[float, str, Shapes, Level]]], roof: Optional[Union[str, Roof]] = None): """ This function creates an L3-G-measure for a selected roof. With this measure, the roof is strengthened by adding steel bracing. Various steel profiles can be applied. The modelling of this measure is in line with the modelling as described for steel structures in general. .. note:: Function will add the strengthening measure data to the roof when provided, otherwise, the data is added to the created steel bracing shape object. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - variant (int): The variant number of the measure that is in the GMC. - name (str or Layer): Name of the layer as a string, or the Layer object itself, to which the newly created bracing shape object should be added. - material (str): Name of the material of the bracing shape to be created, complying VIIA naming convention. - geometry (str): Name of the geometry of the bracing shape to be created, complying VIIA naming convention. - points (list of list of floats and shapes): The start and end point of the bracing shape. Each point point is a list of 3 floats or 2 floats and 1 shape. If 3 floats are given, the unmodified point is used. If 2 floats and 1 shape is given, the unknown coordinate at the index of the shape is calculated by projection on this shape. Shapes can be inputted as objects or strings e.g. [[19.2, 6, "roof_1"], [0, 1, 4]] or [[19.2, roof_1, 15], [0, 1, 4]]. The z-coordinate can also be provided as level object, or name of the level. - roof (obj): Object reference of the roof that has to be strengthened. Optional input, if not provided the data about the strengthening measure is stored in the newly added bracing element. Alternative (str): Name of the roof to be strengthened. Output: - The strengthening measure is added to the roof or the steel bracing. - When running in DIANA after creating the model, the DIANA model is updated. - Returns the newly created truss element as object reference. """ if roof: roof = viia_check_shape_argument(project, roof, 'viia_l3g') project.write_log(f'Start applying L3-G measure to roof {roof.name}.') else: project.write_log(f'Start applying L3-G measure.') # Firstly create the beam element beam = project.viia_create_beam( name=name, material=material, geometry=geometry, points=points) # Convert the beam to truss element project.viia_truss(beam) measure_type = 'L3-G' # Check if measure is in GMC measure_sub_type = f"{measure_type}-{int(variant)}" viia_check_measure_in_gmc(project=project, measure_sub_type=measure_sub_type) # Add meta-data to the roof or the truss if roof: roof.add_meta_data({'strengthening': measure_sub_type}) viia_add_strengthening_shape(shape=roof, strengthening_shape=beam) project.write_log(f"{measure_type} measure is applied on roof {roof.name}.") else: beam.add_meta_data({'strengthening': measure_sub_type}) project.write_log(f"{measure_type} measure is applied as truss {beam.name}.") return beam
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================