Source code for viiapackage.supports.pile_foundation.create_fixedbase

### ===================================================================================================================
###   Create fixedbase pile foundations
### ===================================================================================================================
# Copyright ©VIIA 2024

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

# General imports
from __future__ import annotations
from typing import TYPE_CHECKING, Optional, List, Union

# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.shapes import Pile
from rhdhv_fem.shape_geometries import Node
from rhdhv_fem.supports import PointSupport

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


### ===================================================================================================================
###   2. Function to create fixed-base piles
### ===================================================================================================================

[docs]def viia_create_piles_fixedbase( project: ViiaProject, connecting_nodes: List[Node], pile_group: str, pile_dimension: float, pile_shape: str = 'square', counter: int = 1, pile_numbers: Optional[List[Union[int, str]]] = None) \ -> List[Union[Pile, PointSupport]]: """ This function creates piles for the fixed-base pile foundation. .. note:: If piles are located at the positions where there are several strips overlapping the same area at different height, the piles will be created under the lowest strip. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - connecting_nodes (list of nodes): List with the nodes, which are the connecting points on the foundation strips. These nodes should be part of the Fstrip (on contour or as internal point). - pile_group (str): name of the pile group (e.g. A, B, C...), to retrieve pile data from MYVIIA. - 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'. The shape should relate to the selected rebar configuration. - counter (int): Counter to create the name of the pile with. Default value is 1. - pile_numbers (list): List of pile numbers that is used to number the piles. The user can overrule the auto-numbering by providing this list. The list should be of equal length as the list of coordinates. Default value is None, in which case the piles are numbered regularly (based on order of creation). It is also possible to provide a list of strings. Output: - Returns list of created piles and point supports. """ # Default properties for fixed-base piles material = project.viia_materials('LIN-BETON') dim_pile = int(pile_dimension * 1000) if pile_shape.lower() == 'square': geometry = project.viia_geometries(f'PAAL-{dim_pile}x{dim_pile}') elif pile_shape.lower() == 'circular': geometry = project.viia_geometries(f'PAAL-D{dim_pile}') else: raise NotImplementedError( f"ERROR: Incorrect or not implemented pile shape '{pile_shape}', " f"please select from 'square' or 'circular'.") data = project.viia_create_datas(f'THINTE3') support_set = project.create_supportset('PileSupport') axes = [project.create_direction(name='X'), project.create_direction(name='Y'), project.create_direction(name='Z')] # Default properties for fixed-base piles if pile_group is None: pile_basename = f"PAAL" else: pile_basename = f"PAAL-TYPE-{pile_group}" layer = project.viia_create_layer(name='F') # Start creating piles in PY-memory, assign pile properties as list - start project.assign_list(True) collected = [] for i, node in enumerate(connecting_nodes): # Collect the coordinate of the bottom of the beam element bottom_point = [ node.coordinates[0], node.coordinates[1], node.coordinates[2] - project.pile_foundation_settings['pile_dimension']] # Set the name for the pile if pile_numbers: nr = pile_numbers[i] else: nr = counter pile_name = f'{pile_basename}-{nr}' # Create pile pile = project.create_pile( name=pile_name, contour=project.create_line([bottom_point, node]), material=material, geometry=geometry, data=data) layer.add_shape(pile) collected.append(pile) # Create support at bottom of pile # See viiaStatus for settings of degrees of freedom and spring stiffnesses collected.append(project.create_pointsupport( name=pile_name, support_set=support_set, axes=axes, degrees_of_freedom=project.pile_foundation_settings['dof'], connecting_shapes=[{ 'connecting_shape': pile, 'shape_geometry': pile.contour.get_bottom_node()}], spring_stiffnesses=project.pile_foundation_settings['spring_stiffnesses'])) counter += 1 # Assign pile properties as list - end project.assign_list(False) return collected
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================