SCIA Engineer
New in v13.1.0
Several new objects can be constructed:
SolverSetup
to configure (general) solver settingsProjectData
to set basic project information- Library cross-sections using
Model.create_library_cross_section()
- Cross-links using
Model.create_cross_link()
New in v12.4.0
A NonLinearLoadCombination
can be used in a ResultClass
.
Decimal separator
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 ,
before
importing the file in SCIA, to prevent numbers being stripped of their decimals.
Supported (tested) SCIA versions:
- v21
- v20
- v19
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 a BytesIO representation of the generated XML input file and a user-created esa template file.
- Obtain the results
In code this looks like:
from io import BytesIOfrom viktor.external.scia import SciaAnalysis, Material, Model# 1. Create the empty modelmodel = 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 filexml_file, def_file = model.generate_xml_input()# 4. Run the SCIA analysisesa_file = BytesIO()with open('my_template.esa', "rb") as f: esa_file.write(f.read())scia_analysis = SciaAnalysis(xml_file, def_file, esa_file)scia_analysis.execute(300)# Obtain the resultsanalysis_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.
note
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
Supported parts
Currently, the creation of the following SCIA parts is (fully, or partially) supported in VIKTOR:
Libraries:
- Circular composed cross section
- Circular cross section
- Circular hollow cross section
- Layer
- Library cross section (>= v13.1.0)
- Non-linear function
- Numerical cross section (>= v12.6.0)
- Orthotropy
- Rectangular cross section
- Subsoil
- Updating of material properties
Structure:
- Arbitrary profile
- Arbitrary profile span
- Beam
- Circular plane
- Cross-link (>= v13.1.0)
- Node
- Open slab
- Plane
- Rigid arm
Results:
Supports:
- 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
Sets:
- Load case permanent
- Load case variable
- Load combination
- Load group
- Nonlinear load combination
- Result class
Loads:
- 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
Misc.:
- Mesh setup
- Project data (>= v13.1.0)
- Solver setup (>= v13.1.0)
Testing
New in v13.3.0
Model.generate_xml_input
and SciaAnalysis.execute
need to be
mocked within the context of (automated) testing.
The viktor.testing
module provides the mock_SciaAnalysis
decorator that
facilitate mocking of workers:
import unittestfrom viktor.testing import mock_SciaAnalysisfrom app.my_entity_type.controller import MyEntityTypeControllerclass TestMyEntityTypeController(unittest.TestCase): @mock_SciaAnalysis(get_xml_output_file=File.from_path(Path(__file__).parent / 'test_output.xml')) def test_scia_analysis(self): MyEntityTypeController().scia_analysis()