### ===================================================================================================================
### Function to create the geometry-model for VIIA models
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
from __future__ import annotations
from typing import TYPE_CHECKING, Dict, Union
# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.geometries import GeometryModel
# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
from viiapackage.viiaStatus import ViiaProject
### ===================================================================================================================
### 2. Create the geometry-model based on collected properties
### ===================================================================================================================
[docs]def viia_create_geometry_model(
project: ViiaProject, geometry_group: str, geometry_model_properties: Dict[str, Union[str, float, int]]) \
-> GeometryModel:
"""
Function to create a geometry model based on the given geometry properties.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- geometry_group (str): Geometry group corresponding to the to be created geometry model.
- geometry_properties (dict): Dictionary with all the needed geometry properties.
Output:
- Returns a geometry model object with VIIA settings.
"""
if geometry_group == 'points':
if geometry_model_properties['model'] == 'rotation springs/dashpots':
return project.create_spring_profile()
elif geometry_model_properties['model'] == '3d point mass':
return project.create_point_geometry()
raise NotImplementedError(
f"ERROR: Unknown geometry-model {geometry_model_properties['model']}requested for points geometry.")
if geometry_group == 'lines':
if geometry_model_properties['predefined']:
return project.create_predefined_profile(
profile_name=geometry_model_properties['profile_name'])
else:
if geometry_model_properties['class'] == 'Rectangle':
return project.create_rectangle(
profile_name=geometry_model_properties['profile_name'],
height=geometry_model_properties['height'],
width=geometry_model_properties['width'])
elif geometry_model_properties['class'] == 'Box':
return project.create_box(
profile_name=geometry_model_properties['profile_name'],
height=geometry_model_properties['height'],
width=geometry_model_properties['width'],
thickness_flange_bottom=geometry_model_properties['thickness_flange_bottom'],
thickness_flange_top=geometry_model_properties['thickness_flange_top'],
thickness_web_left=geometry_model_properties['thickness_left_web'],
thickness_web_right=geometry_model_properties['thickness_right_web'])
elif geometry_model_properties['class'] == 'CircleProfile':
return project.create_circle_profile(
profile_name=geometry_model_properties['profile_name'],
diameter=geometry_model_properties['diameter'])
elif geometry_model_properties['class'] == 'Pipe':
return project.create_pipe(
profile_name=geometry_model_properties['profile_name'],
diameter=geometry_model_properties['diameter'],
thickness=geometry_model_properties['thickness'])
elif geometry_model_properties['class'] == 'IShape':
return project.create_IShape(
profile_name=geometry_model_properties['profile_name'],
height=geometry_model_properties['height'],
thickness_flange_bottom=geometry_model_properties['thickness_flange_bottom'],
thickness_flange_top=geometry_model_properties['thickness_flange_top'],
thickness_web=geometry_model_properties['thickness_web'],
width_flange_bottom=geometry_model_properties['width_flange_bottom'],
width_flange_top=geometry_model_properties['width_flange_top'],
fillet_radius=geometry_model_properties['fillet_radius'])
elif geometry_model_properties['class'] == 'LShape':
return project.create_LShape(
profile_name=geometry_model_properties['profile_name'],
height=geometry_model_properties['height'],
width=geometry_model_properties['width'],
thickness_flange=geometry_model_properties['thickness_flange_bottom'],
thickness_web=geometry_model_properties['thickness_left_leg'])
elif geometry_model_properties['class'] == 'TShape':
return project.create_TShape(
profile_name=geometry_model_properties['profile_name'],
height=geometry_model_properties['height'],
thickness_flange=geometry_model_properties['thickness_flange_top'],
thickness_web=geometry_model_properties['thickness_web'],
width=geometry_model_properties['width_flange_top'])
elif geometry_model_properties['class'] == 'UShape':
return project.create_UShape(
profile_name=geometry_model_properties['profile_name'],
height=geometry_model_properties['height'],
width=geometry_model_properties['width'],
thickness_bottom=geometry_model_properties['thickness_bottom'],
thickness_left_leg=geometry_model_properties['thickness_left_leg'],
thickness_right_leg=geometry_model_properties['thickness_right_leg'])
elif geometry_model_properties['class'] == 'TrussProfile':
return project.create_truss_profile(
profile_name=geometry_model_properties['profile_name'],
cross_sectional_area=geometry_model_properties['cross-section'])
elif geometry_model_properties['class'] == 'LineMassGM':
return project.create_line_mass_geometry_model()
raise NotImplementedError(
f"ERROR: Unknown geometry-model {geometry_model_properties['class']} requested for lines geometry.")
elif geometry_group == 'surfaces':
if geometry_model_properties['model'] == 'structural surface interface elements':
return project.create_surface_interface()
elif isinstance(geometry_model_properties['thickness'], (int, float)):
return project.create_isotropic_thickness(thickness=geometry_model_properties['thickness'])
raise NotImplementedError(
f"ERROR: Unknown geometry-model {geometry_model_properties['model']} requested for surfaces geometry.")
elif geometry_group == 'surface-reinforcements':
if geometry_model_properties['model'] == 'grid reinforcement':
if geometry_model_properties['thickness'] == 'diameter and spacing':
return project.create_embedded_surface_reinforcement(
thickness_model=project.create_diameter_and_spacing_ESRT(
bar_diameter_x=geometry_model_properties['bar_diameter_x'],
bar_diameter_y=geometry_model_properties['bar_diameter_y'],
spacing_x=geometry_model_properties['spacing_x'],
spacing_y=geometry_model_properties['spacing_y']))
else:
return project.create_embedded_surface_reinforcement(
thickness_model=project.create_direct_input_ESRT(
equivalent_thickness_x=geometry_model_properties['equivalent_thickness_x'],
equivalent_thickness_y=geometry_model_properties['equivalent_thickness_y']))
raise NotImplementedError(
f"ERROR: Unknown geometry-model {geometry_model_properties['model']} requested for surface-reinforcements "
f"geometry.")
elif geometry_group == 'line-reinforcements-with-bondslip':
if geometry_model_properties['reinforcement type'] == 'truss bondslip':
return project.create_truss_BSR(
cross_section=project.create_truss_profile(
profile_name=geometry_model_properties['truss_name'],
cross_sectional_area=geometry_model_properties['cross_section_area']),
contact_perimeter=geometry_model_properties['contact_perimeter'])
raise NotImplementedError(
f"ERROR: Unknown geometry-model {geometry_model_properties['model']} requested for surface-reinforcements "
f"geometry.")
raise NotImplementedError(f"ERROR: Unknown geometry group '{geometry_group}'.")
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================