Source code for viiapackage.supports.pile_foundation.rob_test

### ===================================================================================================================
###   Update piles for Rob-test
### ===================================================================================================================
# Copyright ©VIIA 2024

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

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

# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.supports import PointSupport

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


### ===================================================================================================================
###   2. Functions to update piles for Rob-test and remove afterwards
### ===================================================================================================================

[docs]def viia_update_pile_supports_for_rob_test(project: ViiaProject) -> List[PointSupport]: """ This function temporarily adds vertical restraints on the bottom node of the piles. Then the rob-test can be performed which applies a vertical displacement on those nodes. Therefore, it requires a constraint and not a boundary spring. The boundary spring can remain in the model. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. Output: - Pointsupports for piles are created constraining the vertical degree of freedom. The name of the support contains the text '-temp_for_robtest'. Which is used to have the possibility to remove after the rob-test analysis. """ supports_created = [] for pile in project.collections.piles: # Create additional vertical support at bottom of pile supports_created.append(project.create_pointsupport( name=pile.name + '-temp_for_robtest', support_set=project.create_supportset('PileSupport'), axes=[project.create_direction(name='X'), project.create_direction(name='Y'), project.create_direction(name='Z')], degrees_of_freedom=[[0, 0, 1], [0, 0, 0]], connecting_shapes=[{ 'connecting_shape': pile, 'shape_geometry': pile.contour.get_bottom_node()}])) return supports_created
[docs]def viia_remove_temporarily_pile_supports_for_rob_test(project: ViiaProject): """ This function removes the temporarily added vertical restraints on the bottom node of the piles to perform the rob-test. It counters the viia_update_pile_supports_for_rob_test function. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. Output: - The pointsupports for piles in the rob-test constraining the vertical degree of freedom are removed. This is done based on the name of the support, if it contains the text '-temp_for_robtest'. """ for support in reversed(project.collections.supports): if '-temp_for_robtest' in support.name: support.remove_support()
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================