### ===================================================================================================================
### A3 Eigenvalue 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
### ===================================================================================================================
### 2. Function to create the A3 analysis
### ===================================================================================================================
[docs]def viia_create_analysis_a3(project: ViiaProject, modes: int = 1000) -> Analysis:
"""
Function to create the A3 eigenvalue analysis.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- modes (int): Number of eigenmodes to take into account in the analysis. This value is only used in eigenvalue
analysis (analysis type 'EIGEN'). Default value 1000.
Output:
- Creates and returns the A3 with all settings for VIIA.
"""
# Set analysis name
name = 'A3 - Eigenwaarde analyse met fixed base'
# Create the output-block for eigenvalue analysis
output = [
project.create_output_block_eigenvalue(
name='OUTPUT_EIGENVALUE',
output_items=[
project.create_output_item('displacements'),
project.create_output_item('displacements', theoretical_formulation='rotation')],
output_filename=f'{project.name}_v{project.version}_OUTPUT_EIGENVALUE')]
# Add tabulated output for result plotting in python
if project.viia_settings.python_result_plotting:
output.append(project.create_output_block_eigenvalue(
name='OUTPUT_EIGENVALUE', output_items=[project.create_output_item(output='displacements')],
output_filename=f'{project.name}_v{project.version}_OUTPUT_EIGENVALUE_TB', output_device='tabulated'))
# Create the execute-block for eigenvalue analysis
execute_block = project.create_specified_execute_eigenvalue(maximum_number_iterations=30)
# Create the analysis
return project.create_analysis(
name=name,
calculation_blocks=[project.create_eigenvalue_analysis_block(
modes=modes,
execute=execute_block,
output_blocks=output)])
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================