Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![](https://img.shields.io/badge/SDK-v14.0.0-blue) <Please check version is the same as specified in requirements.txt>

# VIKTOR interaction with RFEM

This sample application is made to showcase the interaction between VIKTOR and RFEM. It builds a model representing a truss, uses a VIKTOR worker running in an environment where RFEM is running with its web service enabled and visualizes the calculations inside the VIKTOR interface.
Expand All @@ -8,4 +10,7 @@ This application uses [RFEM](https://www.dlubal.com/en). RFEM needs to be runnin

## The Worker

To interact with RFEM using the VIKTOR application we use the VIKTOR worker. Some steps need to be taken to make it work. These steps are described [here](app/lib/README.md).
To interact with RFEM using the VIKTOR application we use the VIKTOR worker. Some steps need to be taken to make it work. These steps are described [here](app/lib/README.md).

# App structure
This is an simple app.
4 changes: 2 additions & 2 deletions app/truss/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from viktor.views import GeometryAndDataView
from viktor.views import GeometryResult
from viktor.views import GeometryView
from viktor.views import SVGResult
from viktor.views import ImageResult

from .constants import material_allowed_stress
from .datagroups_and_visualisations import build_model_from_params
Expand Down Expand Up @@ -107,7 +107,7 @@ def get_optimal_result(self, params: Munch, **kwargs) -> OptimizationResult:
ax.set_xlabel("Height panels")
ax.set_ylabel("UC")
plt.savefig(io_, format="svg")
image = SVGResult(io_)
image = ImageResult(io_)

# Return results
return OptimizationResult(
Expand Down
4 changes: 2 additions & 2 deletions app/truss/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
from munch import Munch

from viktor.core import UserException
from viktor.core import UserError
from viktor.external.generic import GenericAnalysis
from viktor.geometry import Color
from viktor.geometry import Line
Expand Down Expand Up @@ -120,7 +120,7 @@ def send2rfem(model: str, selection: int = 0) -> str:
try:
generic_analysis.execute(timeout=600)
except TimeoutError as err:
raise UserException(err)
raise UserError(err)
output_file = generic_analysis.get_output_file("output.json")
json_str = output_file.read()
json_str = json_str.decode("utf-8")
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# viktor==13.7.0
viktor==14.0.0
2 changes: 1 addition & 1 deletion viktor.config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
app_type = 'simple'
app_type = 'editor'
python_version = '3.10'