### ===================================================================================================================
### A1 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_check_foundation_type, viia_find_piles_elements
### ===================================================================================================================
### 2. Function to create the A1 analysis
### ===================================================================================================================
[docs]def viia_create_analysis_a1(project: ViiaProject) -> Analysis:
"""
This function creates the A1 analysis, complete existing model linear static analysis. This analysis is available
for DIANA and ABAQUS software.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
Output:
- Creates and returns the A1 with all settings for VIIA.
"""
# Set analysis name
name = 'A1 - Lineair statische analyse'
# Check if shallow foundation is present and if piles are present
fos, pile = viia_check_foundation_type(project=project)
# Create the output-block for linear static analysis
location_option = project.create_element_output_item_options(location='integration points')
output = [
project.create_output_block_static(
name='OUTPUT_STATIC', output_items=[
project.create_output_item(output='displacements'),
project.create_output_item(output='reaction forces'),
project.create_output_item(output='residual forces'),
project.create_output_item(
output='stress', theoretical_formulation='cauchy', operation='principal', options=location_option),
project.create_output_item(
output='stress', theoretical_formulation='traction', operation='local', options=location_option),
project.create_output_item(
output='stress', theoretical_formulation='distributed force', operation='local',
options=location_option),
project.create_output_item(
output='stress', theoretical_formulation='distributed moment', operation='local',
options=location_option),
project.create_output_item(
output='stress', theoretical_formulation='cauchy', operation='von mises', options=location_option)],
output_filename=f'{project.name}_v{project.version}_OUTPUT_STATIC')]
# Add tabulated output for result plotting in python
if project.viia_settings.python_result_plotting:
output.append(project.create_output_block_static(
name='OUTPUT_STATIC', output_items=[project.create_output_item(output='displacements')],
output_filename=f'{project.name}_v{project.version}_OUTPUT_STATIC_TB', output_device='tabulated'))
# Check if there are piles, output is required to be added
if pile:
pile_elements, pile_nodes, _, _, _ = viia_find_piles_elements(project=project)
output.append(
project.create_output_block_static(
name='OUTPUT_STATIC_PILES', output_device='tabulated', manual_nodes=pile_nodes,
manual_elements=pile_elements, output_items=[project.create_output_item(
output='nodal element force', output_type='total', theoretical_formulation='translation',
operation='global')],
output_filename=f'{project.name}_v{project.version}_OUTPUT_STATIC_PILES'))
# Create the execute-block 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
### ===================================================================================================================