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 how you (developer, engineer, end-user, domain expert, project manager, etc.) can contribute to the creation of apps that provide real value to your work.

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:

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

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

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:

1from viktor.external.idea_rcs import IdeaRcsAnalysis 2analysis = IdeaRcsAnalysis(mu_idea_input_file, return_rcs_file=True) 3analysis.execute() 4ouput_file = analysis.get_output_file() 5idea_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:

1from viktor.external.idea_rcs import OutputFileParser 2parser = OutputFileParser(output_file) 3for section in parser.section_ids: 4 capacity_results_section = parser.capacity_results(section) 5 shear_results_section = parser.shear_results(section) 6 crack_width_results_section = parser.crack_width_results(section) 7 detailing_results_section = parser.detailing_results(section) 8 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!

illustration of free trial

Start building apps now

Try for free
Share

Related Blog Posts

Connecting Grasshopper & VIKTOR apps

Read more

Enhance Designs and Simulations with Geometry Interaction in VIKTOR

Read more

How to Make Complex 3D Models with Python

Read more

Build and share web apps

Get your free account now
Start for free