Source code for viiapackage.results.results_a10

### ===================================================================================================================
###   A10 Nonlinear static analysis of flexbase model
### ===================================================================================================================
# 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_nls
from viiapackage.results.results_load_model import viia_results_load_model


### ===================================================================================================================
###   2. Function to handle results for A10 analysis
### ===================================================================================================================

[docs]def viia_results_a10( project: ViiaProject, convergence_graphs: bool = True, geo_output: bool = True, result_pictures: bool = True, load_model: bool = True, view: Optional[View] = None): """ Combination of functions to be performed on output of A10 nonlinear static analysis. Includes: - Graph of convergence. - Generating json-file with data for the geotechnical advisor. - Result pictures for A10 analysis. Input: - project (obj): Project object containing collections and of fem objects and project variables. - convergence_graphs (bool): Toggle to generate convergence graphs. Default value is True. - geo_output (bool): This allows the user to choose if the geo output needs to be created. This can be handy if the user wants to create results for multiple signals together. Then the user does not need to create the geo output each time. Default value is set to 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 A10 analysis are created. """ # Checking for version number if project.version != 1: raise ValueError("ERROR: The A10 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='A10') # Collect the analysis analysis = project.viia_get(collection='analyses', name='A10 - Niet-lineair statische analyse met flexbase') # 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, criterion='force', analysis=analysis, show=False) project.viia_convergence_graph(file=out_file, criterion='displacement', analysis=analysis, show=False) else: project.write_log("WARNING: No convergence graph is created because out-file could not be found.") fos = project.shallow_foundation_present() piles = project.pile_foundation_present() if not piles and not fos: raise ValueError( "ERROR: No shallow or pile foundation present in the model, please check. Maybe you are using the model " "json-file, not the json-file used for the analysis?") output_5a = None output_5b = None # Collect required files for result handling if fos: output_5a = project.viia_get_file(path=project.current_analysis_folder, in_name='_OUTPUT_5A', suffix='.tb') if piles: output_5b = project.viia_get_file(path=project.current_analysis_folder, in_name='_OUTPUT_5B', suffix='.tb') # Create geo output if geo_output and (output_5a or output_5b): project.viia_create_geo_output_static_analysis(output_5a=output_5a, output_5b=output_5b, analysis=analysis) project.write_log("The geo-output json-file from analysis A10 is created in the analysis folder.") # 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) else: project.write_log("WARNING: OUTPUT_5B not found. Pile force plots cannot be created.") # Result pictures for A10 if result_pictures: viia_create_result_pictures_nls(project=project, analysis=analysis, view=view)
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================