How to make an IDEA StatiCa Concrete model with Python

Bas van der Hulst

by Bas van der Hulst

For many companies in the civil industry, IDEA StatiCa Concrete is an invaluable tool for dealing with the analysis of reinforced concrete structures. Over the years I became aware that the manual labor required to create such models is extensive and consequently the number of variations that can be explored is limited, which is a major bottleneck for almost all of these companies. Being able to create (or better: generate) such models does not only eliminate the manual labor (hence the boring stuff), but also opens up time and resources to explore more (detailed) designs (hence the awesome stuff), which could lead to better and cheaper solutions. This is where VIKTOR steps in...
How to create successful application that ensure adoption
Build successful applications

Learn the process to build apps that provide real value to your work and that other people will definitely want to use as well.

Speed up with VIKTOR and Python

VIKTOR offers a binding with IDEA StatiCa Concrete, as one of its digital building blocks, making it easy to generate such models with minimal Python code and to perform analyses all from within your VIKTOR web application (without the need to open the IDEA interface at all). This makes it even easier to integrate a complete analysis/design process in a single app, and with the tools you are familiar with. For example, by integrating VIKTOR with SCIA and IDEA StatiCa Concrete, a structure can be verified by Finite Element Analysis (FEA) both on a structural scale as well as on a reinforced member-scale. Practice has shown that such VIKTOR web apps contribute to a huge increase in effectiveness and a significant decrease in errors, by providing a common, standardized interface for the engineers involved in the process.

Visualization of a reinforced cross-section in VIKTOR (top) and IDEA (bottom) Visualization of a reinforced cross-section in VIKTOR (top) and IDEA (bottom)

Creating the IDEA model with a few lines of Python code

VIKTOR provides two ways of building the IDEA model. One follows IDEA’s Open Model API (OpenModel class), the other resembles IDEA’s clickable interface (Model class). Both classes can be found in viktor.external.idea_rcs.

Creating the model using VIKTOR’s Model class is straightforward, since the required code is concise. Below is an example of a simple beam model (dummy) with reinforcement bars under frequent and fundamental extreme cases:

1# Initialize the model. 2model = model() 3 4# Create the desired material(s). 5cs_mat = model.create_concrete_material(ConcreteMaterial.C12_15) 6mat_reinf = model.create_reinforcement_material(ReinforcementMaterial.B_400A) 7 8# Create a beam (or other type of member) to be checked. 9cross_section = RectSection(0.5, 1.0) 10beam = model.create_beam(cross_section, cs_mat) 11 12# Create bars (and stirrups)_as desired 13bar_locations = [(-0.101, -0.175), (0.101, -0.175), (-0.101, 0.175)] 14bar_diameters = [0.016, 0.016, 0.016, 0.016] 15 16for coords, diameter in zip(bar_locations, bar_diameters): 17 beam.create_bar(coords, diameter, mat_reinf) 18 19# Add extreme(s) 20freq = LoadingSLS(ResultOfInternalForces(N=-100000, My=21000)) 21fund = LoadingURL(ResultOfInternalForces(N=-99999, My=200000)) 22beam.create_extreme(frequent=freq, fundamental=fund)

Creating the (same) model using VIKTOR’s OpenModel class feels similar to creating it using IDEA’s Open Model API (but then in Python code). Compared to the Model class, it is slightly more verbose and therefore recommended only for people familiar with IDEA’s Open Model API:

1# Initialize the model. 2model = OpenModel() 3 4# Create the concrete section. 5mat = model.create_matconcrete_ec(ConcreteMaterial.C12_15) 6cs = model.create_cross_section_parameter(name=‘c’, cross_section_type=CrossSectionType, RECT, 7 Material=mat, Width=2.0, Heigth=2.0) 8 9# Create the reinforced cross section. 10rcs = model.create_reinforced_cross_section(name=‘rcs’, cross_section=cs) 11 12# Create bars (and stirrups) as desired 13mat_reinf = model.create_mareinforcement_ec2(ReinforcementMaterial.B_400A) 14 15bar_locations = [(-0.101, -0.175), (0.101, -0.175), (-0.101, 0.175)] 16bar_diameters = [0.016, 0.016, 0.016, 0.016] 17 18for coord, diameter in zip(bar_locations, bar_diameters): 19 rcs.create_bar(coords, diameter, mat_reinf) 20 21# Create a CheckMember. 22member = model.create_check_member1d() 23 24# ‘Assign’ the CheckMember to a CheckSection with the previously defined reinforced section and add extremes. 25check_section = model.add_check_section(description=‘S 1’, check_member=member, reinf_section=rcs) 26freq = LoadingSLS(ResultOfInternalForces(N=-100000, My=210000)) 27fund = LoadingULS(ResultOfInternalForces(N=-99999, My=200000)) 28check_section.create_extreme(frequent=freq, fundamental=fund) 29 30# ‘Assign’ the necessary additional data to the CheckMember. 31model.add_member_data_ec2(member, MemberType, BEAM_SLAB, TwoWaySlabType, SHELL_AS_PLATE) 32

A valid IDEA input file can subsequently be generated by calling model. generate_xml_input().

Running the analysis in the VIKTOR web application

With VIKTOR you can run an IDEA StatiCa Concrete analysis from within your web application, without having to open the IDEA interface manually, so that it can be easily integrated in a fully automated design process. The analysis can be performed using the IdeaRcsAnalysis class, by providing an IDEA StatiCa Concrete Open Model input file. This could be an input file generated with generate_xml_input (see above), or one obtained in a different way, as long IDEA considers it valid:

1analysis = IdeaRcsAnalysis(mu_idea_input_file, return_rcs_file=True) 2analysis.execute() 3ouput_file = analysis.get_output_file() 4idea_rcs_file = analysis.get_idea_rcs_file()

Executing the analysis invokes the input file to be sent to a designated (virtual) machine that executes the job (on a so-called ‘worker’), using the local IDEA software and license. After execution, the resulting output file (.xml) and/or IDEA StatiCa Concrete file (.rcs) can be retrieved for further processing.

Parsing the Results

For convenience, VIKTOR is shipped with an output file parser (OutputFileParser) that simplifies the extraction of results from the XML output file (obtained from IdeaRcsAnalysis, or in any other way). This way, the most common results (e.g. capacity, shear or crack-width results) can be obtained for each of the sections with only a few lines of code:

1parser = OutputFileParser(output_file) 2for section in parser.section_ids: 3 capacity_results_section = parser.capacity_results(section) 4 shear_results_section = parser.shear_results(section) 5 crack_width_results_section = parser.crack_width_results(section) 6 detailing_results_section = parser.detailing_results(section) 7 stress_limitation_results_section = parser.stress_limitations_results(section)

These numerical results can be further processed within your VIKTOR web application and used to create graphs and tables and the like, giving the user valuable (visual) feedback.

User-friendly web applications

Creating web apps with VIKTOR enables you to cover the full analysis/design cycle, from the parametrization and creation of a (structural) model, to performing FE calculation(s), performing IDEA StatiCa Concrete checks, and providing valuable (visual) feedback to the user, all with the tools you are already familiar with. By having all engineers work in a single, standardized web application, errors in the process can be reduced and effectiveness can be significantly increased as well.

Are you interested in a complete overview of the VIKTOR – IDEA binding and integration possibilities? Please contact us and join the VIKTOR community!

Share

Related Blog Posts

Application development engineering Python

WSP builds engineering apps for colleagues without Python experience

Read more
parametric design cloud

Parametric design in the Cloud for engineering & construction

Read more

Data-driven decision-making with Revit

Read more