### ===================================================================================================================
### A3 Eigenvalue analysis result handling
### ===================================================================================================================
# Copyright ©VIIA 2025
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
from __future__ import annotations
from typing import TYPE_CHECKING, Union, Optional
from pathlib import Path
# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.pictures import View
# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
from viiapackage.viiaStatus import ViiaProject
from viiapackage.results.results_eigenvalue import viia_results_eigenvalue
from viiapackage.results.results_load_model import viia_results_load_model
### ===================================================================================================================
### 2. Function to handle results for A3 analysis
### ===================================================================================================================
[docs]def viia_results_a3(
project: ViiaProject, out_file: Optional[Union[Path, str]] = None, load_model: bool = True,
result_pictures: bool = True, view: Optional[View] = None) -> None:
"""
Combination of functions to be performed on output of A3 eigen value analysis in VIIA.
Includes:
- Graph of eigenfrequency distribution.
- Graphs of governing modes plotted in response spectrum.
- Result pictures of the eigenmodes of A3 analysis.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- out_file (path): The DIANA out-file location and filename of the analysis requested as path. Optional input,
if not provided the out-file will be retrieved from the analysis folder.
Alternative (str): The DIANA out-file location and filename of the analysis requested as string.
- load_model (bool): Select to reload the model. Default value is True, but when directly creating analysis and
running, it needs to be switched off.
- result_pictures (bool): Toggle to generate result pictures. Default value is True.
- view (obj): View that should be used for the pictures. When None the default view will be used. Default is
None.
Output:
- Result items of A3 eigenvalue analysis are saved in workfolder.
"""
# Get the raw data from results-file in the specific software
output_file = project.viia_get_file(
path=project.current_analysis_folder, in_name='OUTPUT_EIGENVALUE_TB', suffix='.tb')
# Check if model needs to be loaded
if load_model:
# Load the model
viia_results_load_model(project=project, analysis_nr='A3')
# Collect the analysis
analysis = project.viia_get(collection='analyses', name='A3 - Eigenwaarde analyse met fixed base')
# Perform result handling for eigenvalue analysis
viia_results_eigenvalue(
project=project, analysis=analysis, analysis_nr='A3', out_file=out_file, result_pictures=result_pictures,
view=view)
# Generate result plots if required output is generated
if output_file:
project.read_diana_tbfile(file=output_file)
# Collect the analysis-reference for the plot
analysis_reference = project.get_analysis_reference(analysis=analysis, mode=1)
# Create result plot for displacements in z-direction
project.plot_results_3d(output_item='U_z', analysis_reference=analysis_reference)
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================