Source code for viiapackage.analyses.viia_create_analysis

### ===================================================================================================================
###  FUNCTION to create the analyses for VIIA
### ===================================================================================================================
# 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.analyses import Analysis

# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
    from viiapackage.viiaStatus import ViiaProject
from viiapackage.analyses.analysis_a1 import viia_create_analysis_a1
from viiapackage.analyses.analysis_a2 import viia_create_analysis_a2
from viiapackage.analyses.analysis_a3 import viia_create_analysis_a3
from viiapackage.analyses.analysis_a4 import viia_create_analysis_a4
from viiapackage.analyses.analysis_a7 import viia_create_analysis_a7
from viiapackage.analyses.analysis_a10 import viia_create_analysis_a10
from viiapackage.analyses.analysis_a12 import viia_create_analysis_a12
from viiapackage.analyses.analysis_a13 import viia_create_analysis_a13
from viiapackage.analyses.analysis_a15 import viia_create_analysis_a15


### ===================================================================================================================
###   2. Function viia_create_analysis
### ===================================================================================================================

[docs]def viia_create_analysis( project: ViiaProject, analysis_nr: str, direction: Optional[str] = None, nmodes: Optional[int] = None, loadnr: Optional[int] = None, ac_pivots: Optional[str] = None, number_eigenmodes: int = 10, modal_pushover_flag: bool = True, iteration_method_requested: str = 'secant', output_1c: bool = False, nr_time_steps: Optional[int] = None) -> Analysis: """ Function to add a default analysis to the model in DIANA, see viiapackage documentation howto_dcf_settings. The name of the analysis that is created depends on the state of the model. This can be fixed base, flex base, soilblock or soilcolumn. .. note:: Always check your dcf-file prior to calculation. .. note:: To increase speed of the calculation, check the requested output (writing output takes time). Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - analysis_nr (str): Current analysis referencing the numbers for different analyses. For example 'A1'. - direction (str): String of the direction can be provided for the direction of which the analysis should be created. The default value of the argument is None, indicating no directions to be applied. - nmodes (int): Number of eigenmodes to take into account in the analysis. This value is only used in eigenvalue analysis. - loadnr (int): The associated ID (as integer) of the LoadCombination instance with the name corresponding to the NLPO load-cases, if available. - ac_pivots (str): Name of method of obtaining arc length control pivots or a sequence of node numbers in string format. - number_eigenmodes (int): Only used when the modal pushover analysis is set up. This is the number of modes set for the eigenvalue analysis executed before the modal pushover analysis, the default value is 10. When the dominate mode is after the first 10 modes, this should be adjusted accordingly. - modal_pushover_flag (bool): If this argument is set to True, the eigenvalue analysis will executed before modal NLPO analysis, otherwise eigenvalue analysis is not set up for uniform NLPO analysis. The default value is True. - iteration_method_requested (str): The iteration method selected for the time-steps execute, the default value is 'secant'. Other options are 'newton-raphson', 'linear-stiffness' and 'constant stiffness'. - output_1c (bool): Default False. If true the 1c output block will be returned. - nr_time_steps (int): Overrule the number of time-steps to be used in the NLTH analysis. Default value None, time-steps are determined based on the length of the signal. Output: - Requested analysis-type is created in DIANA. """ if analysis_nr == 'A1': return viia_create_analysis_a1(project=project) elif analysis_nr == 'A2': return viia_create_analysis_a2(project=project) elif analysis_nr == 'A3': return viia_create_analysis_a3(project=project, modes=nmodes) elif analysis_nr == 'A4': return viia_create_analysis_a4( project=project, iteration_method_requested=iteration_method_requested, output_1c=output_1c, nr_time_steps=nr_time_steps) elif analysis_nr == 'A7': return viia_create_analysis_a7(project=project, modes=nmodes) elif analysis_nr == 'A10': return viia_create_analysis_a10(project=project) elif analysis_nr == 'A12': return viia_create_analysis_a12( project=project, iteration_method_requested=iteration_method_requested, output_1c=output_1c, nr_time_steps=nr_time_steps) elif analysis_nr == 'A13': return viia_create_analysis_a13(project=project) elif analysis_nr == 'A15': return viia_create_analysis_a15( project=project, iteration_method_requested=iteration_method_requested, output_1c=output_1c, nr_time_steps=nr_time_steps) else: raise NotImplementedError( f"ERROR: The requested analysis '{analysis_nr}' is not available, please contact the VIIA-automation team.")
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================