### ===================================================================================================================
### L2-043 strengthening measure
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
from __future__ import annotations
from typing import Union, TYPE_CHECKING
# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.shapes import Wall
from rhdhv_fem.connections import Interface
# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
from viiapackage.viiaStatus import ViiaProject
from viiapackage.strengthening.helper_functions import viia_l2_base
### ===================================================================================================================
### 2. Function to create L2-043 strengthening measure
### ===================================================================================================================
[docs]def viia_l2_043(
project: ViiaProject, variant: int, interface: Union[str, Interface] = None,
shape_1: Union[str, Wall] = None, shape_2: Union[str, Wall] = None) -> Interface:
"""
This function creates an L2-043-measure. It can create an interface in between two walls, or make
an existing interface linear.
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.
- interface (str or obj): The interface that has to be made linear. Both the name or object reference can be
provided. Default is None, in this case shape_1 and shape_2 should be provided.
- shape_1 (str or obj): The object reference or name of the wall to what the interface should be applied.
Default is None, in this case the interface should be provided.
- shape_2 (str or obj): The object reference or name of the wall to what the interface should be
applied. Default is None, in this case the interface should be provided.
Output:
- The strengthening measure is added between shape_1 and shape_2 or the interface is made linear.
- Returns the interface object reference of the measure.
For example:
- To make a linear interface from a non-linear interface, the following input can be used:
>>> project.viia_l2_043(interface='name_of_interface')
- To make a new linear interface between two shapes, the following input can be used:
>>> project.viia_l2_043(shape_1='name_of_first_shape', shape_2='name_of_second_shape')
"""
if interface is not None:
if shape_1 or shape_2:
raise ValueError(
"ERROR: viia_l2_043 only accepts a interface or a combination of two shapes. Not both.")
return viia_l2_base(
project=project, measure_type='L2-043', variant=variant, connection=interface)
if not (shape_1 and shape_2):
raise ValueError("ERROR: When no interface two shapes should be given.")
return viia_l2_base(
project=project, measure_type='L2-043', variant=variant, shape_1=shape_1, shape_2=shape_2,
shape_1_types=Wall, shape_2_types=Wall)
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================