### ===================================================================================================================
### A4 Analysis LTH result handling
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
from __future__ import annotations
from typing import TYPE_CHECKING, Optional
# 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.pictures import viia_create_result_pictures_nlth
from viiapackage.results.results_load_model import viia_results_load_model
### ===================================================================================================================
### 2. Function to handle results for A4 analysis
### ===================================================================================================================
[docs]def viia_results_a4(
project: ViiaProject, signal: str, convergence_graphs: bool = True, wall_displacement_graphs: bool = True,
result_pictures: bool = True, load_model: bool = True, view: Optional[View] = None):
"""
Combination of functions to be performed on output of A4 linear time history analysis.
Includes:
- Graph of convergence.
- Graphs of relative out-of-plane wall displacements.
- Result pictures for A4 analysis.
Input:
- project (obj): Project object containing collections and of fem objects and project variables.
- signal (str): Signal to consider. Can be S1-S11.
- convergence_graphs (bool): Toggle to generate convergence graphs. Default value is True.
- wall_displacement_graphs (bool): Toggle to generate wall displacement graphs. Default value is True.
- result_pictures (bool): Toggle to generate result pictures. Default value is True.
- 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.
- 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 A4 analysis are created.
"""
# Checking for version number
if project.version != 1:
raise ValueError("ERROR: The A4 analysis is to be applied only on non-strengthened models.")
# Check if model needs to be loaded
if load_model:
# Load the model
viia_results_load_model(project=project, analysis_nr='A4', signal=signal)
# Collect the analysis
analysis = project.viia_get(collection='analyses', name='A4 - Lineair seismische analyse met fixed base')
if analysis is None:
raise ValueError("ERROR: The analysis object for A4 analysis could not be found.")
# Plot convergence graphs if requested
if convergence_graphs:
out_file = project.viia_get_file(path=project.current_analysis_folder, suffix='.out')
if out_file:
project.viia_convergence_graph(file=out_file, signal=signal, analysis=analysis, show=False)
else:
project.write_log("WARNING: No convergence graph is created because no out-file has been found.")
# Create graph of wall displacements
if wall_displacement_graphs:
output_2 = project.viia_get_file(path=project.current_analysis_folder, in_name='_OUTPUT_2', suffix='.tb')
if output_2:
project.viia_wall_displacements(wall_oop_tbfile=output_2, signal=signal, analysis=analysis)
else:
project.write_log("WARNING: OUTPUT_2 not found. Wall displacement plot cannot be created.")
# Collect the pile reactions
if project.pile_foundation_present():
output_5b = project.viia_get_file(path=project.current_analysis_folder, in_name='OUTPUT_5B', suffix='.tb')
if output_5b:
project.viia_collect_pile_reactions(pile_output_file=output_5b, analysis=analysis, signal=signal)
else:
project.write_log("WARNING: OUTPUT_5B not found. Pile force plots cannot be created.")
# Result pictures for A4
if result_pictures:
viia_create_result_pictures_nlth(project=project, analysis=analysis, view=view)
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================