Source code for viiapackage.results.results_a7

### ===================================================================================================================
###   A7 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 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 A7 analysis
### ===================================================================================================================

[docs]def viia_results_a7( project: ViiaProject, json_file: Optional[Path] = None, out_file: Optional[Union[Path, str]] = None, dat_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 A7 eigen value analysis in VIIA. Includes: - Graph of eigenfrequency distribution. - Graphs of governing modes plotted in response spectrum. - Result pictures of the eigenmodes of A7 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 A7 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. - analysis (obj): Instance of analysis class that contains the eigenvalue analysis. - 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. - 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. - 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 A7 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='A7') # Collect the analysis analysis = project.viia_get(collection='analyses', name='A7 - Eigenwaarde analyse met flex base') # Perform result handling for eigenvalue analysis viia_results_eigenvalue( project=project, analysis=analysis, analysis_nr='A7', out_file=out_file, dat_file=dat_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 ### ===================================================================================================================