### ===================================================================================================================
### L5-B strengthening measure
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
from __future__ import annotations
from typing import TYPE_CHECKING, Union
from copy import deepcopy
# 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 L5-B strengthening measures
### ===================================================================================================================
[docs]def viia_l5b(
project: ViiaProject, wall: Union[Wall, str], application_type: str = 'Center', variant: int = 1):
"""
This function creates an L5B-measure, i.e. replacing a selected wall with a reinforced concrete wall. It adjusts the
properties of the original wall with a wall of 200mm, C20/25 and applies two sheets of grid reinforcement of R12_150
in both directions. Inclusion of eccentricity is optional, for which one sheet is applied at both edges of the wall.
It will model the strengthening measure around openings and can be applied on walls in all directions.
.. warning:: Function is currently not available, it requires updates, please send request to the VIIA automating
team.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- wall (obj): The object reference of the wall that has to be strengthened.
Alternative (str): Name of the wall to be strengthened.
- application_type (str): Default value is 'Center'. In that case no eccentricity is applied. If 'Eccentric'
the grid reinforcement will be applied with corresponding eccentricity (set in constants for VIIA).
- variant (int): The variant number of the measure that is in the GMC.
Output:
- The strengthening measure is added to the wall and modelled in DIANA or SCIA.
For example:
>>> project.viia_l5b(wall)
This example will apply the L5B measure and adjust the wall in the model to a concrete wall of 200mm with a grid
reinforcement 2x2R12-150.
>>> project.viia_l5b(wall, application_type='Eccentric')
The example has the same result as the previous, but the grid reinforcement has been applied with eccentricity
(both sides of the wall).
"""
raise NotImplementedError(
"ERROR: Function to apply L5B measure is currently not available, script needs updates. Please contact the "
"VIIA automation team.")
# Check if measure is in GMC
measure_type = 'L5-B'
measure_sub_type = f"{measure_type}-{int(variant)}"
viia_check_measure_in_gmc(project=project, measure_sub_type=measure_sub_type)
# Argument handling
wall = viia_check_shape_argument(project, wall, 'viia_l5b')
if application_type.lower() not in ['center', 'eccentric']:
raise ValueError(f"ERROR: Input for viia_l5b function for 'application_type' has to be 'Center' or 'Eccentric'."
f" Check your input ({application_type}).")
application_type = application_type.lower()
# Get geometry
geometry_object = wall.geometry
# Material and geometry to be used for strengthening measure
# The eccentricity is set in direction of normalvector of wall. It may be necessary to adjust this to the negative
# direction depending on the location where the measure will be fitted.
# Eccentricity is half the thickness of the wall and half of the new concrete (150mm)
old_wall_name = wall.name
new_wall_name = wall.name.split('-')[0] + "-WANDEN-L5B-BETON-C20/25-200-" + wall.name[-1]
material_name_wall = "BETON-C20/25"
geometry_name_wall = "WAND-200-" + str(geometry_object.geometry_properties['element x axis'])\
.replace('[', '(').replace(']', ')')
# data_name = "THINTE7"
new_points = wall.points
if application_type == 'Center':
reinforcement_name = wall.name.split('-')[0] + "-WANDEN-L5B-WAP-B500-" + wall.name[-1]
material_name_reinforcement = "WAP-B500"
geometry_name_reinforcement = "L5B-WAPENING-2R12_150x2R12_150-" + \
str(geometry_object.geometry_properties['element x axis'])\
.replace('[', '(').replace(']', ')')
else:
reinforcement_name_in = wall.name.split('-')[0] + "-WANDEN-L5B-IN-WAP-B500-" + wall.name[-1]
reinforcement_name_out = wall.name.split('-')[0] + "-WANDEN-L5B-OUT-WAP-B500-" + wall.name[-1]
material_name_reinforcement = "WAP-B500"
eccentricity_in = -0.075
eccentricity_out = 0.075
geometry_name_reinforcement_in = "L5B-IN-WAPENING-R12_150xR12_150-" + \
str(geometry_object.geometry_properties['element x axis'])\
.replace('[', '(').replace(']', ')')
geometry_name_reinforcement_out = "L5B-OUT-WAPENING-R12_150xR12_150-" + \
str(geometry_object.geometry_properties['element x axis'])\
.replace('[', '(').replace(']', ')')
# Reinforcement eccentricity
if application_type == 'Eccentric':
normal_direction = wall.outward_vector()
new_points_in = deepcopy(new_points)
for i in range(len(new_points_in)):
for j in range(len(new_points_in[i])):
new_points_in[i][j][0] = new_points_in[i][j][0] + normal_direction[0] * eccentricity_in
new_points_in[i][j][1] = new_points_in[i][j][1] + normal_direction[1] * eccentricity_in
new_points_in[i][j][2] = new_points_in[i][j][2] + normal_direction[2] * eccentricity_in
new_points_out = deepcopy(new_points)
for i in range(len(new_points_out)):
for j in range(len(new_points_out[i])):
new_points_out[i][j][0] = new_points_out[i][j][0] + normal_direction[0] * eccentricity_out
new_points_out[i][j][1] = new_points_out[i][j][1] + normal_direction[1] * eccentricity_out
new_points_out[i][j][2] = new_points_out[i][j][2] + normal_direction[2] * eccentricity_out
wall.set_name(new_wall_name)
wall.material = material_name_wall
wall.geometry = geometry_name_wall
wall.data = wall.material.material_properties['DATA']
# Create the new shapes in PY-memory and in model if created
if application_type == 'Center':
project.create_surface_reinforcement(reinforcement_name, new_points, material_name_reinforcement,
geometry_name_reinforcement)
else:
project.create_surface_reinforcement(reinforcement_name_in, new_points_in, material_name_reinforcement,
geometry_name_reinforcement_in)
project.create_surface_reinforcement(reinforcement_name_out, new_points_out, material_name_reinforcement,
geometry_name_reinforcement_out)
# Set the data for strengthening in attribute of wall
wall.add_meta_data({'strengthening': measure_sub_type})
# Notifications for user
project.write_log(f"L5-B measure applied on wall {old_wall_name} and is updated to wall {wall.name}.")
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================