viktor.external.idea
Beam
- class viktor.external.idea_rcs.idea_rcs.Beam(rcs, check_section)
Bases:
MemberDo not use this __init__ directly, but create the object by
Model.create_beam().
CompressionMember
- class viktor.external.idea_rcs.idea_rcs.CompressionMember(rcs, check_section)
Bases:
MemberDo not use this __init__ directly, but create the object by
Model.create_compression_member().
GeneralShape
- class viktor.external.idea_rcs.idea_rcs.GeneralShape(outline, *, openings=None)
Bases:
SectionPrototype1DGeneral cross-section, defined by a set of coordinates.
- Parameters:
outline (
Sequence[Tuple[float,float]]) – Vertices which define the outline of the section (y, z). A minimum of 3 vertices is required, the outline is automatically closed.openings (
Sequence[Sequence[Tuple[float,float]]]) – One or multiple openings, defined by vertices (y, z). A minimum of 3 vertices per opening is required, the opening is automatically closed.
IdeaRcsAnalysis
- class viktor.external.idea_rcs.idea_rcs.IdeaRcsAnalysis(input_file, *, return_result_xml=None, return_rcs_file=None)
Bases:
ExternalProgramCan be used to perform an analysis using IDEA StatiCa RCS on a third-party worker. To start an analysis call the method
execute(), with an appropriate timeout (in seconds). To retrieve the results call the methodget_output_file(), afterexecute().Usage:
idea_rcs_file = File.from_data("idea rcs input file content") idea_rcs_analysis = IdeaRcsAnalysis(input_file=idea_rcs_file) idea_rcs_analysis.execute(timeout=10) result = idea_rcs_analysis.get_output_file()Exceptions which can be raised during calculation:
viktor.errors.ExecutionError: generic error. Error message provides more information
- Parameters:
input_file (
BytesIO|File) – IDEA (Open)Model input XML file.return_result_xml (
bool) – Result .xml file will be available if set to True (default: True).return_rcs_file (
bool) – Input .ideaRcs file will be available if set to True (default: False).
- get_idea_rcs_file(*, as_file=False)
Method can be used to retrieve the .ideaRcs file which is converted from the (Open)Model input XML. The file is only available when return_rcs_file=True.
execute()must be called first.- Return type:
BytesIO|File|None- Returns:
File, if as_file = True
BytesIO, if as_file = False (default)
- get_output_file(*, as_file=False)
Method can be used to retrieve the results generated by running an external analysis. The file is only available when return_result_xml=True.
execute()must be called first.- Return type:
BytesIO|File|None- Returns:
File (encoding=’utf-16’), if as_file = True
BytesIO (encoding=’utf-16’), if as_file = False (default)
Member
- class viktor.external.idea_rcs.idea_rcs.Member(rcs, check_section)
-
Base class of all member types.
- property bars: List[ReinforcedBar]
- create_bar(coordinates, diameter, material)
Create a reinforced bar on the reinforced cross-section.
- Parameters:
coordinates (
Tuple[float,float]) – (X, Y) coordinate of the bar [m].diameter (
float) – Diameter of the bar [m].material (
MatReinforcement) – Reinforcement material (created bycreate_matreinforcement_ec2()).
- Return type:
None
- create_bar_layer(*, origin, diameter, material, number_of_bars, delta_y=None, delta_z=None)
Create multiple reinforced bars on the reinforced cross-section, positioned on a line.
- Parameters:
origin (
Tuple[float,float]) – Origin point (Y, Z) [m].diameter (
float) – Diameter of the bar [m].material (
MatReinforcement) – Reinforcement material (created bycreate_matreinforcement_ec2()).number_of_bars (
int) – Number of bars (minimum of 2).delta_y (
float) – Distance between origin bar and the last bar in y-direction [m].delta_z (
float) – Distance between origin bar and the last bar in z-direction [m].
- Return type:
None
- create_extreme(*, description=None, accidental=None, fatigue=None, frequent=None, fundamental=None, characteristic=None, quasi_permanent=None)
Create an extreme case with corresponding internal forces on the beam for checking.
- Parameters:
description (
str) – Description of the extreme (default: ‘{section_name} - E {i}’).New in v14.6.0accidental (
LoadingULS) – Accidental loading.fatigue (
FatigueLoading) – Fatigue loading.frequent (
LoadingSLS) – Frequent loading.fundamental (
LoadingULS) – Fundamental loading.characteristic (
LoadingSLS) – Characteristic loading.quasi_permanent (
LoadingSLS) – Quasi-Permanent loading.
- Return type:
None
- create_stirrup(points, diameter, material, distance, shear_check=None, torsion_check=None, mandrel_diameter_factor=None, anchorage_length=None)
Create a stirrup on the reinforced cross-section.
- Parameters:
points (
Sequence[Tuple[float,float] |Tuple[Tuple[float,float],Tuple[float,float]]]) – Sequence of (X, Y) coordinates [m] of the stirrup vertices, connected by straight line segments. For arc-segments use ((X_end, Y_end), (X_on_arc, Y_on_arc)).diameter (
float) – Diameter of the stirrup [m].material (
MatReinforcement) – Reinforcement material (created bycreate_matreinforcement_ec2()).distance (
float) – Longitudinal distance between stirrups [m].shear_check (
bool) – Take stirrup into account in shear check (default: False).torsion_check (
bool) – Take stirrup into account in torsion check (default: False).mandrel_diameter_factor (
float) – Inner diameter of mandrel as multiple of stirrup diameter [-] (default: 1.0).anchorage_length (
float) – Anchorage length [m] (default: 0.0).
- Return type:
None
- property extremes: List[CheckSectionExtreme]
Model
- class viktor.external.idea_rcs.idea_rcs.Model(*, project_data=None, code_settings=None)
Bases:
_ModelCan be used to construct an IDEA-RCS model and generate its corresponding input XML file. This file can in turn be used as input of
IdeaRcsAnalysis. For a more detailed elaboration, please see the guide.Alternatively, you can use
OpenModel.Warning
Use this binding at own risk. Whether an input XML file represents a valid model is dependent on many things, e.g. on the combination of certain parameters. The Model does not give any guarantees on this. It is therefore important to always validate your model by hand thoroughly, before using it in an automated way within your app!
Example usage:
# Initialize the model. model = Model() # empty model, or optionally pass ProjectData and/or CodeSettings # Create the desired material(s). cs_mat = model.create_concrete_material(ConcreteMaterial.C12_15) mat_reinf = model.create_reinforcement_material(ReinforcementMaterial.B_400A) # Create a beam (or other type of member) to be checked. cross_section = RectSection(0.5, 1.0) beam = model.create_beam(cross_section, cs_mat) # Create bars (and stirrups) as desired bar_locations = [(-0.101, -0.175), (0.101, -0.175), (0.101, 0.175), (-0.101, 0.175)] bar_diameters = [0.016, 0.016, 0.016, 0.016] for coords, diameter in zip(bar_locations, bar_diameters): beam.create_bar(coords, diameter, mat_reinf) # Add extreme(s) freq = LoadingSLS(ResultOfInternalForces(N=-100000, My=210000)) fund = LoadingULS(ResultOfInternalForces(N=-99999, My=200000)) beam.create_extreme(frequent=freq, fundamental=fund) # Generate the input XML file. input_xml = model.generate_xml_input()- Parameters:
project_data (
ProjectData) – project_data (default: IDEA-RCS default project_data)code_settings (
CodeSettings) – code and calculation settings (default: IDEA-RCS default settings)