Source code for viiapackage.supports.pile_foundation.create_geometry

### ===================================================================================================================
###   Create the geometries for the piles
### ===================================================================================================================
# 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.geometries import Geometry

# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
    from viiapackage.viiaStatus import ViiaProject


### ===================================================================================================================
###   2. Function to create the rectangular of circular geometry for the Huan-beam of the pile
### ===================================================================================================================

[docs]def viia_create_pile_huanbeam_geometry( project: 'ViiaProject', pile_basename: str, pile_dimension: float, pile_shape: str = 'square') -> Geometry: """ This function creates the rectangular or circular geometry for the Huan-beam in the piles. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - pile_basename (str): Basename of the geometry. For example "PAAL-TYPE-A". - pile_dimension (float): Dimension used for the pile, can be diameter or width/height of the cross-section. Implementation based on the pile_shape, in [m]. - pile_shape (str): Type of shape of the pile. If 'circular' is selected a circular cross-section is created otherwise a square cross-section. Default value is 'square'. Output: - Returns the rectangular or circular geometry for the Huan-beam. """ geom = project.find(description=f'{pile_basename}-HUAN', collection='geometries') if geom: return geom if pile_shape == 'circular': return project.create_user_defined_geometry( name=f'{pile_basename}-HUAN', geometry_model=project.create_circle_profile( profile_name=f'D{int(pile_dimension * 1000)}', diameter=pile_dimension)) else: return project.create_user_defined_geometry( name=f'{pile_basename}-HUAN', geometry_model=project.create_rectangle( profile_name=f'{int(pile_dimension * 1000)}x{int(pile_dimension * 1000)}', width=pile_dimension, height=pile_dimension))
### =================================================================================================================== ### 3. Function to create the embedded bar reinforcement geometry for the rebar of the Huan-beam of the pile ### ===================================================================================================================
[docs]def viia_create_pile_rebar_geometry( project: 'ViiaProject', pile_basename: str, rebar_dimension: float) -> Geometry: """ This function creates the embedded bar geometry for the rebar of the Huan-beam in the piles. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - pile_basename (str): Basename of the geometries. For example "PAAL-TYPE-A". - dim_rebar (float): Diameter of the rebar, in [m]. Output: - Returns the embedded bar reinforcement geometry for the rebar of the Huan-beam. """ geom = project.find(description=f'{pile_basename}-HUAN-WAPENING', collection='geometries') if geom: return geom return project.create_user_defined_geometry( name=f'{pile_basename}-HUAN-WAPENING', geometry_model=project.create_embedded_bar_reinforcement( cross_section=project.create_circle_profile( profile_name=f'D{rebar_dimension * 1000}', diameter=rebar_dimension)))
### =================================================================================================================== ### 4. Functions to create the geometries for the springs of the pile ### ===================================================================================================================
[docs]def viia_create_pile_translational_spring_geometry( project: 'ViiaProject') -> Geometry: """ Create the geometry for the translational springs of the pile. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. Output: - Returns the geometry for the translational spring. """ geom = project.find(description=f'FCRIT', collection='geometries') if geom: return geom return project.create_user_defined_geometry( name=f'FCRIT', geometry_model=project.create_spring_profile())
[docs]def viia_create_pile_rotational_spring_geometry( project: 'ViiaProject') -> Geometry: """ Create the geometry for the rotational springs of the pile. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. Output: - Returns the geometry for the rotational spring. """ geom = project.find(description=f'ROT', collection='geometries') if geom: return geom return project.create_user_defined_geometry( name=f'ROT', geometry_model=project.create_spring_profile())
### =================================================================================================================== ### 5. End of script ### ===================================================================================================================