This guide is an informative piece to help you if you have questions about our SCIA Engineer integration. If you would like a more instructive lesson, take a look at the SCIA Engineer tutorial we have available.
Create selections using
Several new objects can be constructed:
SolverSetupto configure (general) solver settings
ProjectDatato set basic project information
- Library cross-sections using
- Cross-links using
NonLinearLoadCombination can be used in a
The XML representation of the SCIA model generated by VIKTOR's SCIA binding represents floating point numbers using the
,-character as decimal separator. Please make sure to set the (worker) machine's decimal separator to
importing the file in SCIA, to prevent numbers being stripped of their decimals.
Supported (tested) SCIA versions:
VIKTOR's SCIA integration requires a specific SCIA worker which can be downloaded here.
Creating and analyzing a SCIA model in VIKTOR consists of the following steps:
- Create the empty model.
- Fill the model with the desired parts (e.g. nodes, beams, load cases, forces, etc.), by calling the corresponding create_xxx() methods.
- Generate the XML representation of the SCIA model.
- Run the SCIA analysis with the generated XML input file and a user-created esa template file.
- Obtain the results
In code this looks like:
from viktor.external.scia import SciaAnalysis, Material, Model
# 1. Create the empty model
model = Model()
# 2. Fill the model with the parts (to be extended as desired)
cross_section = model.create_rectangular_cross_section('rectangular_section', Material(455, 'test_material'), 100, 100)
n1 = model.create_node('n1', 0, 0, 0)
n2 = model.create_node('n2', 1, 0, 0)
model.create_beam(n1, n2, cross_section, name='test_beam')
# 3. Generate the XML input file
xml_file, def_file = model.generate_xml_input()
# 4. Run the SCIA analysis
esa_file = File.from_path('my_template.esa')
scia_analysis = SciaAnalysis(xml_file, def_file, esa_file)
# Obtain the results
analysis_result = scia_analysis.get_xml_output_file()
The ESA template file
The ESA file must be created by the user by using the SCIA interface. It functions as the template to which the model is added. The materials used in the VIKTOR model must exist in the ESA template file: both the name and id of the material must match. The SCIA version in which the template file was created must match the SCIA version called by the worker.
An I/O document has to be defined in the
.esa file, which has to be named "output". If not defined, the worker will
not be able to write this expected document and fails to execute.
Example I/O document of the esa model
Currently, the creation of the following SCIA parts is (fully, or partially) supported in VIKTOR:
- Circular composed cross-section
- Circular cross-section
- Circular hollow cross-section
- Library cross section (>= v13.1.0)
- Non-linear function
- Numerical cross section (>= v12.6.0)
- Rectangular cross-section
- Selections (>= v14.1.0)
- Updating of material properties
- Arbitrary profile
- Arbitrary profile span
- Circular plane
- Cross-link (>= v13.1.0)
- Open slab
- Rigid arm
- Hinge on beam
- Hinge on plane
- Line support on beam
- Line support on 2D-member edge
- Point support on beam
- Support in node
- Surface support
- Load case permanent
- Load case variable
- Load combination
- Load group
- Nonlinear load combination
- Result class
- Free line force
- Free point force
- Free surface load
- Line force on beam
- Line force on 2D-member edge
- Line moment on beam
- Line moment on 2D-member edge
- Moment in node
- Point force on beam
- Point force in node (>= v12.6.0)
- Surface load
- Thermal load on beam
- Thermal load on 2D-member
mock_SciaAnalysis decorator for easier testing of
SciaAnalysis.execute need to be
mocked within the context of (automated) testing.
viktor.testing module provides the
mock_SciaAnalysis decorator that
facilitate mocking of workers:
from viktor import File
from viktor.testing import mock_SciaAnalysis
from app.my_entity_type.controller import MyEntityTypeController
For the decorator's input parameters the following holds:
- If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
- If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
- If None is provided (default), a default File/BytesIO object (with empty content) is returned each time the corresponding method is called (endlessly).