Source code for viiapackage.strengthening.l4.l4d

### ===================================================================================================================
###   L4-D strengthening measure
### ===================================================================================================================
# Copyright ©VIIA 2024

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

# General imports
from __future__ import annotations
from typing import TYPE_CHECKING

# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.shapes import Wall

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


### ===================================================================================================================
###   2. Function to create L4-D strengthening measures
### ===================================================================================================================

[docs]def viia_l4d( project: ViiaProject, variant: int, wall, cavity: float = 0.0, outer_wall_thickness: float = None, outer_wall_material: str = None, flip: bool = False, edge_distance: float = 0.25, wall_tie_distance: float = 0.5): """ This function creates an L4-D-measure for a selected wall. The purpose of this measure is to fix the outer leaf at the cavity wall to the structural inner leaf with cavity wall ties. The measure is modeled with the same properties as the modelling of existing wall ties. .. warning:: Wall ties close to the corners or edges of the wall's geometry will be moved to the nearby corner or edge. This is done to prevent mesh inconsistencies. Check the final mesh! .. note:: Strengthening measure is only applicable on vertical walls. 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. - wall (as object/str or list of two objects/str): When provided with only one wall object or string, the outer leaf of that wall will be created along with cavity wall ties. When provided with list of 2 wall objects or strings in case the walls are existing in the model, the cavity wall ties will be created between two walls. - cavity (as float): Cavity distance only when one wall has been given as input. This is the dimension between the inner- and outer leaf of cavity wall, in [m]. - outer wall thickness (as float) in [m], only when one wall has been given as input and may be omitted if wall thickness is same as inner leaf. - outer_wall_material (as string): Material for the outer wall, only when one wall has been given as input and may be omitted if wall material is same as inner leaf. Alternative (str): Name of the material. If the material does not yet exist it will be created. - flip (as bool): Not obligatory, default value is 'False'. If flip is true, the new leaf will be placed on the inner side of the existing wall. - edge_distance (as float): Distance between cavity wall ties and the edges of the wall. - wall_tie_distance (as float): Mutual distance between cavity wall ties. Output: - The strengthening measure is added to class of springs and modelled in DIANA or SCIA. """ # Check if measure is in GMC measure_type = 'L4-D' measure_sub_type = f"{measure_type}-{int(variant)}" viia_check_measure_in_gmc(project=project, measure_sub_type=measure_sub_type) # Argument handling if isinstance(wall, list): if len(wall) != 2: raise ValueError( f"ERROR: The provided argument type for wall is a list with a length other than two, which is " f"not correct, please check.") wall = [viia_check_shape_argument(project, one_wall, 'viia_l4d') for one_wall in wall] wall_ties = project.viia_create_cavity_wall_ties( inner_leaf=wall[0], outer_leaf=wall[1], edge_distance=edge_distance, wall_tie_distance=wall_tie_distance) elif isinstance(wall, Wall) or isinstance(wall, str): wall = [viia_check_shape_argument(project, wall, 'viia_l4d')] outer_leafs, wall_ties, dummy_plates = project.viia_create_cavity_wall_ties_from_list( cavity_wall_list=wall, cavity=cavity, outer_wall_thickness=outer_wall_thickness, outer_wall_material=outer_wall_material, flip=flip, edge_distance=edge_distance, wall_tie_distance=wall_tie_distance, complete_output=True) else: raise TypeError( f"ERROR: The provided argument type for wall is {type(wall)}, which is not correct, please check.") if wall_ties is not None: if isinstance(wall, list): for single_wall in wall: # Update wall attribute with strengthening measure single_wall.add_meta_data({'strengthening': measure_sub_type}) # Notifications for user project.write_log( f"L4-D measure applied on wall ({single_wall.name}) with {len(wall_ties)} wall ties.") elif isinstance(wall, Wall): # Update wall attribute with strengthening measure wall.add_meta_data({'strengthening': measure_sub_type}) # Notifications for user project.write_log( f"L4-D measure applied on wall ({wall.name}) with {len(wall_ties)} wall ties.") else: project.write_log( "Something went wrong in the viia_create_cavity_wall_ties function, no wall ties is created, please check.") return wall
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================