### ===================================================================================================================
### A3 Eigenvalue analysis result handling
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 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 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, json_file: Path, out_file: Optional[Union[Path, str]] = None,
dat_file: Optional[Union[Path, str]] = None, load_model: bool = True) -> 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.
- json_file (path): The json-file of the model generated at the moment the A3 analysis folder with its contents
was generated. Default value is None, in which case the json-file is retrieved from the current analysis
folder. Only required when loading the model is requested.
- 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 current analysis folder.
Alternative (str): The DIANA out-file location and filename of the analysis requested as string.
- dat_file (path): The ABAQUS dat-file location and filename of the analysis requested as path. Optional input,
if not provided the dat-file will be retrieved from the analysis folder.
Alternative (str): The ABAQUS dat-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.
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, dat_file=dat_file)
# 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
### ===================================================================================================================