Source code for viiapackage.analyses.analysis_a16

### ===================================================================================================================
###   A16 Static analysis
### ===================================================================================================================
# 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.analyses import Analysis

# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
    from viiapackage.viiaStatus import ViiaProject
from viiapackage.analyses.helper_functions import viia_find_piles_elements, viia_find_shallow_foundation_elements, \
    viia_check_foundation_type


### ===================================================================================================================
###   2. Function to create the A16 analysis
### ===================================================================================================================

[docs]def viia_create_analysis_a16(project: ViiaProject) -> Analysis: """ This function creates the A16 analysis, complete existing model TVA linear static analysis and build the geo output for the corresponding foundation. This analysis is available for DIANA software. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. Output: - Creates and returns the A16 with all settings for VIIA. """ # Validate requirements for A16 # Check for version if project.version < 2: raise ValueError( "ERROR: The strengthening models should have a version number of at least 2. When you continue, " "you might encounter unexpected behaviour or errors in code.") # Set analysis name name = 'A16 - Lineair statische analyse met fixed base met versterkingen voor geo-output' output = [] # Create the outputblock for linear static analysis location_option = project.create_element_output_item_options(location='integration points') fos, pile = viia_check_foundation_type(project=project) output.append( project.create_output_block_static( name='OUTPUT_STATIC', output_items=[ project.create_output_item('displacements'), project.create_output_item('reaction forces'), project.create_output_item('residual forces'), project.create_output_item('stress', theoretical_formulation='cauchy', operation='principal', options=location_option), project.create_output_item('stress', theoretical_formulation='traction', operation='local', options=location_option), project.create_output_item('stress', theoretical_formulation='distributed force', operation='local', options=location_option), project.create_output_item('stress', theoretical_formulation='distributed moment', operation='local', options=location_option), project.create_output_item('stress', theoretical_formulation='cauchy', operation='von mises', options=location_option)], output_filename=f'{project.name}_v{project.version}_OUTPUT_STATIC')) if fos: shallow_foundation_elements_dict, shallow_foundation_nodes_dict, shallow_foundation_ref_elements, \ shallow_foundation_ref_nodes = viia_find_shallow_foundation_elements(project=project) shallow_foundation_elements = [] shallow_foundation_nodes = [] for key in shallow_foundation_elements_dict: shallow_foundation_elements.extend(shallow_foundation_elements_dict[key]) for key in shallow_foundation_nodes_dict: shallow_foundation_nodes.extend(shallow_foundation_nodes_dict[key]) output.append( project.create_output_block_static( name='OUTPUT_5A', output_items=[project.create_output_item('reaction forces')], output_device='tabulated', manual_nodes=shallow_foundation_nodes, manual_elements=shallow_foundation_elements, output_filename=project.name + '_v' + str(project.version) + '_OUTPUT_5A')) if pile: pile_elements, pile_nodes, pile_reinforcements, _, _ = viia_find_piles_elements(project=project) output.append( project.create_output_block_static( name='OUTPUT_5B', output_items=[ project.create_output_item('stresses', output_type='total', theoretical_formulation='concentrated force', operation='global')], output_device='tabulated', manual_nodes=pile_nodes, manual_elements=pile_elements, output_filename=project.name + '_v' + str(project.version) + '_OUTPUT_5B')) # Create the executeblock for static analysis analysis_block = project.create_static_analysis_block(output_blocks=output) # Create the analysis return project.create_analysis(name=name, calculation_blocks=[analysis_block])
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================