Source code for viiapackage.analyses.analysis_a5

### ===================================================================================================================
###   A5 MRS 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 A5 analysis
### ===================================================================================================================

[docs]def viia_create_analysis_a5(project: ViiaProject, modes: int) -> Analysis: """ This function creates the A5 analysis, complete existing model modal response analysis. This analysis is only available for DIANA software. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - modes (int): Number of modes which should be considered in MRS analysis. Output: - Creates and returns the A5 with all settings for VIIA. """ # Set analysis name name = 'A5 - Modale respons spectrum analyse' # Select the dead load load combination load_combination = project.get_load_combination(name='DL') if load_combination is None: raise ValueError("ERROR: Load-combination for Dead Load (DL) is missing. Please create before proceeding.") # Create output-block for modal response spectrum analysis location_option_integration_points = project.create_element_output_item_options(location='integration points') location_option_nodes = project.create_element_output_item_options() output = [ project.create_output_block_response_spectrum( name='Output response spectrum analysis', output_items=[ project.create_output_item(output='displacements'), project.create_output_item(output='reaction forces'), project.create_output_item( output='stress', output_type='total', theoretical_formulation='concentrated force', operation='local', options=location_option_nodes), project.create_output_item( output='stress', output_type='total', theoretical_formulation='distributed force', operation='local', options=location_option_integration_points), project.create_output_item( output='stress', output_type='total', theoretical_formulation='distributed moment', operation='local', options=location_option_integration_points), project.create_output_item( output='stress', output_type='total', theoretical_formulation='concentrated moment', operation='local', options=location_option_nodes), project.create_output_item( output='stress', output_type='total', theoretical_formulation='cauchy', operation='von mises', options=location_option_integration_points), project.create_output_item( output='stress', output_type='total', theoretical_formulation='cauchy', operation='local', options=location_option_integration_points), project.create_output_item( output='element force', output_type='total', theoretical_formulation='translation', operation='global', options=location_option_nodes)], output_filename=f'{project.name}_v{project.version}_OUTPUT_MRS', modal_combination_method='CQC', modal_damping_coefficient=0.05, load_combination_method='linear', linear_combination_factor_1=1.0, linear_combination_factor_2=0.3, load_combination=load_combination, load_combination_factor=1.0)] fos, pile = viia_check_foundation_type(project=project) 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_response_spectrum( name='OUTPUT_5A', output_items=[ project.create_output_item(output='reaction forces')], output_device='tabulated', modal_combination_method='CQC', modal_damping_coefficient=0.05, load_combination_method='linear', linear_combination_factor_1=1.0, linear_combination_factor_2=0.3, load_combination=load_combination, load_combination_factor=1.0, manual_elements=shallow_foundation_elements, manual_nodes=shallow_foundation_nodes, output_filename=f'{project.name}_v{project.version}_OUTPUT_5A')) if pile: pile_elements, pile_nodes, pile_reinforcements, _, _ = viia_find_piles_elements(project=project) output.append(project.create_output_block_response_spectrum( name='OUTPUT_5B', output_items=[ project.create_output_item('stresses', output_type='total', theoretical_formulation='concentrated force', operation='global')], output_device='tabulated', modal_combination_method='CQC', modal_damping_coefficient=0.05, load_combination_method='linear', linear_combination_factor_1=1.0, linear_combination_factor_2=0.3, load_combination=load_combination, load_combination_factor=1.0, manual_elements=pile_elements, manual_nodes=pile_nodes, output_filename=f'{project.name}_v{project.version}_OUTPUT_5B')) # Create the execute block for the MRS analysis_block = project.create_response_spectrum_analysis_block( modes=modes, execute=project.create_specified_execute_eigenvalue(maximum_number_iterations=30), output_blocks_response_spectrum=output) # Create and return the analysis return project.create_analysis(name=name, calculation_blocks=[analysis_block])
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================